vendor: 4,638 bytes, lines 1-123
1var __defProp = Object.defineProperty; 2var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; 3var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); 4var _a; 5var define_process_env_default$9 = {}; 6/** 7* @vue/shared v3.5.22 8* (c) 2018-present Yuxi (Evan) You and Vue contributors 9* @license MIT 10**/ 11// @__NO_SIDE_EFFECTS__ 12function makeMap(str) { 13 const map2 = /* @__PURE__ */ Object.create(null); 14 for (const key of str.split(",")) map2[key] = 1; 15 return (val) => val in map2; 16} 17const EMPTY_OBJ = !!(define_process_env_default$9.NODE_ENV !== "production") ? Object.freeze({}) : {}; 18const EMPTY_ARR = !!(define_process_env_default$9.NODE_ENV !== "production") ? Object.freeze([]) : []; 19const NOOP = () => { 20}; 21const NO = () => false; 22const isOn = (key) => key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // uppercase letter 23(key.charCodeAt(2) > 122 || key.charCodeAt(2) < 97); 24const isModelListener = (key) => key.startsWith("onUpdate:"); 25const extend = Object.assign; 26const remove = (arr, el) => { 27 const i = arr.indexOf(el); 28 if (i > -1) { 29 arr.splice(i, 1); 30 } 31}; 32const hasOwnProperty$2 = Object.prototype.hasOwnProperty; 33const hasOwn$1 = (val, key) => hasOwnProperty$2.call(val, key); 34const isArray$1 = Array.isArray; 35const isMap = (val) => toTypeString$1(val) === "[object Map]"; 36const isSet = (val) => toTypeString$1(val) === "[object Set]"; 37const isDate$1 = (val) => toTypeString$1(val) === "[object Date]"; 38const isFunction$1 = (val) => typeof val === "function"; 39const isString$2 = (val) => typeof val === "string"; 40const isSymbol = (val) => typeof val === "symbol"; 41const isObject$3 = (val) => val !== null && typeof val === "object"; 42const isPromise$2 = (val) => { 43 return (isObject$3(val) || isFunction$1(val)) && isFunction$1(val.then) && isFunction$1(val.catch); 44}; 45const objectToString$1 = Object.prototype.toString; 46const toTypeString$1 = (value) => objectToString$1.call(value); 47const toRawType = (value) => { 48 return toTypeString$1(value).slice(8, -1); 49}; 50const isPlainObject$2 = (val) => toTypeString$1(val) === "[object Object]"; 51const isIntegerKey = (key) => isString$2(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; 52const isReservedProp = /* @__PURE__ */ makeMap( 53 // the leading comma is intentional so empty string "" is also included 54 ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" 55); 56const isBuiltInDirective = /* @__PURE__ */ makeMap( 57 "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo" 58); 59const cacheStringFunction = (fn) => { 60 const cache2 = /* @__PURE__ */ Object.create(null); 61 return ((str) => { 62 const hit = cache2[str]; 63 return hit || (cache2[str] = fn(str)); 64 }); 65}; 66const camelizeRE = /-\w/g; 67const camelize = cacheStringFunction( 68 (str) => { 69 return str.replace(camelizeRE, (c) => c.slice(1).toUpperCase()); 70 } 71); 72const hyphenateRE = /\B([A-Z])/g; 73const hyphenate = cacheStringFunction( 74 (str) => str.replace(hyphenateRE, "-$1").toLowerCase() 75); 76const capitalize$1 = cacheStringFunction((str) => { 77 return str.charAt(0).toUpperCase() + str.slice(1); 78}); 79const toHandlerKey = cacheStringFunction( 80 (str) => { 81 const s = str ? `on${capitalize$1(str)}` : ``; 82 return s; 83 } 84); 85const hasChanged = (value, oldValue) => !Object.is(value, oldValue); 86const invokeArrayFns = (fns, ...arg) => { 87 for (let i = 0; i < fns.length; i++) { 88 fns[i](...arg); 89 } 90}; 91const def$1 = (obj, key, value, writable = false) => { 92 Object.defineProperty(obj, key, { 93 configurable: true, 94 enumerable: false, 95 writable, 96 value 97 }); 98}; 99const looseToNumber = (val) => { 100 const n = parseFloat(val); 101 return isNaN(n) ? val : n; 102}; 103let _globalThis$1; 104const getGlobalThis$1 = () => { 105 return _globalThis$1 || (_globalThis$1 = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); 106}; 107function normalizeStyle(value) { 108 if (isArray$1(value)) { 109 const res = {}; 110 for (let i = 0; i < value.length; i++) { 111 const item = value[i]; 112 const normalized = isString$2(item) ? parseStringStyle(item) : normalizeStyle(item); 113 if (normalized) { 114 for (const key in normalized) { 115 res[key] = normalized[key]; 116 } 117 } 118 } 119 return res; 120 } else if (isString$2(value) || isObject$3(value)) { 121 return value; 122 } 123}
vendor: 4,192 bytes, lines 124-208
124const listDelimiterRE = /;(?![^(]*\))/g; 125const propertyDelimiterRE = /:([^]+)/; 126const styleCommentRE = /\/\*[^]*?\*\//g; 127function parseStringStyle(cssText) { 128 const ret = {}; 129 cssText.replace(styleCommentRE, "").split(listDelimiterRE).forEach((item) => { 130 if (item) { 131 const tmp = item.split(propertyDelimiterRE); 132 tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); 133 } 134 }); 135 return ret; 136} 137function normalizeClass(value) { 138 let res = ""; 139 if (isString$2(value)) { 140 res = value; 141 } else if (isArray$1(value)) { 142 for (let i = 0; i < value.length; i++) { 143 const normalized = normalizeClass(value[i]); 144 if (normalized) { 145 res += normalized + " "; 146 } 147 } 148 } else if (isObject$3(value)) { 149 for (const name in value) { 150 if (value[name]) { 151 res += name + " "; 152 } 153 } 154 } 155 return res.trim(); 156} 157const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,hgroup,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; 158const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; 159const MATH_TAGS = "annotation,annotation-xml,maction,maligngroup,malignmark,math,menclose,merror,mfenced,mfrac,mfraction,mglyph,mi,mlabeledtr,mlongdiv,mmultiscripts,mn,mo,mover,mpadded,mphantom,mprescripts,mroot,mrow,ms,mscarries,mscarry,msgroup,msline,mspace,msqrt,msrow,mstack,mstyle,msub,msubsup,msup,mtable,mtd,mtext,mtr,munder,munderover,none,semantics"; 160const isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); 161const isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); 162const isMathMLTag = /* @__PURE__ */ makeMap(MATH_TAGS); 163const specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; 164const isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); 165function includeBooleanAttr(value) { 166 return !!value || value === ""; 167} 168function looseCompareArrays(a, b) { 169 if (a.length !== b.length) return false; 170 let equal = true; 171 for (let i = 0; equal && i < a.length; i++) { 172 equal = looseEqual(a[i], b[i]); 173 } 174 return equal; 175} 176function looseEqual(a, b) { 177 if (a === b) return true; 178 let aValidType = isDate$1(a); 179 let bValidType = isDate$1(b); 180 if (aValidType || bValidType) { 181 return aValidType && bValidType ? a.getTime() === b.getTime() : false; 182 } 183 aValidType = isSymbol(a); 184 bValidType = isSymbol(b); 185 if (aValidType || bValidType) { 186 return a === b; 187 } 188 aValidType = isArray$1(a); 189 bValidType = isArray$1(b); 190 if (aValidType || bValidType) { 191 return aValidType && bValidType ? looseCompareArrays(a, b) : false; 192 } 193 aValidType = isObject$3(a); 194 bValidType = isObject$3(b); 195 if (aValidType || bValidType) { 196 if (!aValidType || !bValidType) { 197 return false; 198 } 199 const aKeysCount = Object.keys(a).length; 200 const bKeysCount = Object.keys(b).length; 201 if (aKeysCount !== bKeysCount) { 202 return false; 203 } 204 for (const key in a) { 205 const aHasKey = a.hasOwnProperty(key); 206 const bHasKey = b.hasOwnProperty(key); 207 if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a[key], b[key])) { 208 return false;
vendor: 4,867 bytes, lines 209-388
209 } 210 } 211 } 212 return String(a) === String(b); 213} 214function looseIndexOf(arr, val) { 215 return arr.findIndex((item) => looseEqual(item, val)); 216} 217const isRef$1 = (val) => { 218 return !!(val && val["__v_isRef"] === true); 219}; 220const toDisplayString$1 = (val) => { 221 return isString$2(val) ? val : val == null ? "" : isArray$1(val) || isObject$3(val) && (val.toString === objectToString$1 || !isFunction$1(val.toString)) ? isRef$1(val) ? toDisplayString$1(val.value) : JSON.stringify(val, replacer, 2) : String(val); 222}; 223const replacer = (_key, val) => { 224 if (isRef$1(val)) { 225 return replacer(_key, val.value); 226 } else if (isMap(val)) { 227 return { 228 [`Map(${val.size})`]: [...val.entries()].reduce( 229 (entries, [key, val2], i) => { 230 entries[stringifySymbol(key, i) + " =>"] = val2; 231 return entries; 232 }, 233 {} 234 ) 235 }; 236 } else if (isSet(val)) { 237 return { 238 [`Set(${val.size})`]: [...val.values()].map((v) => stringifySymbol(v)) 239 }; 240 } else if (isSymbol(val)) { 241 return stringifySymbol(val); 242 } else if (isObject$3(val) && !isArray$1(val) && !isPlainObject$2(val)) { 243 return String(val); 244 } 245 return val; 246}; 247const stringifySymbol = (v, i = "") => { 248 var _a2; 249 return ( 250 // Symbol.description in es2019+ so we need to cast here to pass 251 // the lib: es2016 check 252 isSymbol(v) ? `Symbol(${(_a2 = v.description) != null ? _a2 : i})` : v 253 ); 254}; 255var define_process_env_default$8 = {}; 256function warn$3(msg, ...args) { 257 console.warn(`[Vue warn] ${msg}`, ...args); 258} 259let activeEffectScope; 260class EffectScope { 261 constructor(detached = false) { 262 this.detached = detached; 263 this._active = true; 264 this._on = 0; 265 this.effects = []; 266 this.cleanups = []; 267 this._isPaused = false; 268 this.parent = activeEffectScope; 269 if (!detached && activeEffectScope) { 270 this.index = (activeEffectScope.scopes || (activeEffectScope.scopes = [])).push( 271 this 272 ) - 1; 273 } 274 } 275 get active() { 276 return this._active; 277 } 278 pause() { 279 if (this._active) { 280 this._isPaused = true; 281 let i, l; 282 if (this.scopes) { 283 for (i = 0, l = this.scopes.length; i < l; i++) { 284 this.scopes[i].pause(); 285 } 286 } 287 for (i = 0, l = this.effects.length; i < l; i++) { 288 this.effects[i].pause(); 289 } 290 } 291 } 292 /** 293 * Resumes the effect scope, including all child scopes and effects. 294 */ 295 resume() { 296 if (this._active) { 297 if (this._isPaused) { 298 this._isPaused = false; 299 let i, l; 300 if (this.scopes) { 301 for (i = 0, l = this.scopes.length; i < l; i++) { 302 this.scopes[i].resume(); 303 } 304 } 305 for (i = 0, l = this.effects.length; i < l; i++) { 306 this.effects[i].resume(); 307 } 308 } 309 } 310 } 311 run(fn) { 312 if (this._active) { 313 const currentEffectScope = activeEffectScope; 314 try { 315 activeEffectScope = this; 316 return fn(); 317 } finally { 318 activeEffectScope = currentEffectScope; 319 } 320 } else if (!!(define_process_env_default$8.NODE_ENV !== "production")) { 321 warn$3(`cannot run an inactive effect scope.`); 322 } 323 } 324 /** 325 * This should only be called on non-detached scopes 326 * @internal 327 */ 328 on() { 329 if (++this._on === 1) { 330 this.prevScope = activeEffectScope; 331 activeEffectScope = this; 332 } 333 } 334 /** 335 * This should only be called on non-detached scopes 336 * @internal 337 */ 338 off() { 339 if (this._on > 0 && --this._on === 0) { 340 activeEffectScope = this.prevScope; 341 this.prevScope = void 0; 342 } 343 } 344 stop(fromParent) { 345 if (this._active) { 346 this._active = false; 347 let i, l; 348 for (i = 0, l = this.effects.length; i < l; i++) { 349 this.effects[i].stop(); 350 } 351 this.effects.length = 0; 352 for (i = 0, l = this.cleanups.length; i < l; i++) { 353 this.cleanups[i](); 354 } 355 this.cleanups.length = 0; 356 if (this.scopes) { 357 for (i = 0, l = this.scopes.length; i < l; i++) { 358 this.scopes[i].stop(true); 359 } 360 this.scopes.length = 0; 361 } 362 if (!this.detached && this.parent && !fromParent) { 363 const last = this.parent.scopes.pop(); 364 if (last && last !== this) { 365 this.parent.scopes[this.index] = last; 366 last.index = this.index; 367 } 368 } 369 this.parent = void 0; 370 } 371 } 372} 373function effectScope(detached) { 374 return new EffectScope(detached); 375} 376function getCurrentScope() { 377 return activeEffectScope; 378} 379function onScopeDispose(fn, failSilently = false) { 380 if (activeEffectScope) { 381 activeEffectScope.cleanups.push(fn); 382 } else if (!!(define_process_env_default$8.NODE_ENV !== "production") && !failSilently) { 383 warn$3( 384 `onScopeDispose() is called when there is no active effect scope to be associated with.` 385 ); 386 } 387} 388let activeSub;
vendor: 4,354 bytes, lines 389-584
389const pausedQueueEffects = /* @__PURE__ */ new WeakSet(); 390class ReactiveEffect { 391 constructor(fn) { 392 this.fn = fn; 393 this.deps = void 0; 394 this.depsTail = void 0; 395 this.flags = 1 | 4; 396 this.next = void 0; 397 this.cleanup = void 0; 398 this.scheduler = void 0; 399 if (activeEffectScope && activeEffectScope.active) { 400 activeEffectScope.effects.push(this); 401 } 402 } 403 pause() { 404 this.flags |= 64; 405 } 406 resume() { 407 if (this.flags & 64) { 408 this.flags &= -65; 409 if (pausedQueueEffects.has(this)) { 410 pausedQueueEffects.delete(this); 411 this.trigger(); 412 } 413 } 414 } 415 /** 416 * @internal 417 */ 418 notify() { 419 if (this.flags & 2 && !(this.flags & 32)) { 420 return; 421 } 422 if (!(this.flags & 8)) { 423 batch(this); 424 } 425 } 426 run() { 427 if (!(this.flags & 1)) { 428 return this.fn(); 429 } 430 this.flags |= 2; 431 cleanupEffect(this); 432 prepareDeps(this); 433 const prevEffect = activeSub; 434 const prevShouldTrack = shouldTrack; 435 activeSub = this; 436 shouldTrack = true; 437 try { 438 return this.fn(); 439 } finally { 440 if (!!(define_process_env_default$8.NODE_ENV !== "production") && activeSub !== this) { 441 warn$3( 442 "Active effect was not restored correctly - this is likely a Vue internal bug." 443 ); 444 } 445 cleanupDeps(this); 446 activeSub = prevEffect; 447 shouldTrack = prevShouldTrack; 448 this.flags &= -3; 449 } 450 } 451 stop() { 452 if (this.flags & 1) { 453 for (let link2 = this.deps; link2; link2 = link2.nextDep) { 454 removeSub(link2); 455 } 456 this.deps = this.depsTail = void 0; 457 cleanupEffect(this); 458 this.onStop && this.onStop(); 459 this.flags &= -2; 460 } 461 } 462 trigger() { 463 if (this.flags & 64) { 464 pausedQueueEffects.add(this); 465 } else if (this.scheduler) { 466 this.scheduler(); 467 } else { 468 this.runIfDirty(); 469 } 470 } 471 /** 472 * @internal 473 */ 474 runIfDirty() { 475 if (isDirty(this)) { 476 this.run(); 477 } 478 } 479 get dirty() { 480 return isDirty(this); 481 } 482} 483let batchDepth = 0; 484let batchedSub; 485let batchedComputed; 486function batch(sub, isComputed2 = false) { 487 sub.flags |= 8; 488 if (isComputed2) { 489 sub.next = batchedComputed; 490 batchedComputed = sub; 491 return; 492 } 493 sub.next = batchedSub; 494 batchedSub = sub; 495} 496function startBatch() { 497 batchDepth++; 498} 499function endBatch() { 500 if (--batchDepth > 0) { 501 return; 502 } 503 if (batchedComputed) { 504 let e = batchedComputed; 505 batchedComputed = void 0; 506 while (e) { 507 const next = e.next; 508 e.next = void 0; 509 e.flags &= -9; 510 e = next; 511 } 512 } 513 let error2; 514 while (batchedSub) { 515 let e = batchedSub; 516 batchedSub = void 0; 517 while (e) { 518 const next = e.next; 519 e.next = void 0; 520 e.flags &= -9; 521 if (e.flags & 1) { 522 try { 523 ; 524 e.trigger(); 525 } catch (err) { 526 if (!error2) error2 = err; 527 } 528 } 529 e = next; 530 } 531 } 532 if (error2) throw error2; 533} 534function prepareDeps(sub) { 535 for (let link2 = sub.deps; link2; link2 = link2.nextDep) { 536 link2.version = -1; 537 link2.prevActiveLink = link2.dep.activeLink; 538 link2.dep.activeLink = link2; 539 } 540} 541function cleanupDeps(sub) { 542 let head; 543 let tail = sub.depsTail; 544 let link2 = tail; 545 while (link2) { 546 const prev = link2.prevDep; 547 if (link2.version === -1) { 548 if (link2 === tail) tail = prev; 549 removeSub(link2); 550 removeDep(link2); 551 } else { 552 head = link2; 553 } 554 link2.dep.activeLink = link2.prevActiveLink; 555 link2.prevActiveLink = void 0; 556 link2 = prev; 557 } 558 sub.deps = head; 559 sub.depsTail = tail; 560} 561function isDirty(sub) { 562 for (let link2 = sub.deps; link2; link2 = link2.nextDep) { 563 if (link2.dep.version !== link2.version || link2.dep.computed && (refreshComputed(link2.dep.computed) || link2.dep.version !== link2.version)) { 564 return true; 565 } 566 } 567 if (sub._dirty) { 568 return true; 569 } 570 return false; 571} 572function refreshComputed(computed2) { 573 if (computed2.flags & 4 && !(computed2.flags & 16)) { 574 return; 575 } 576 computed2.flags &= -17; 577 if (computed2.globalVersion === globalVersion) { 578 return; 579 } 580 computed2.globalVersion = globalVersion; 581 if (!computed2.isSSR && computed2.flags & 128 && (!computed2.deps && !computed2._dirty || !isDirty(computed2))) { 582 return; 583 } 584 computed2.flags |= 2;
vendor: 6,677 bytes, lines 585-846
585 const dep = computed2.dep; 586 const prevSub = activeSub; 587 const prevShouldTrack = shouldTrack; 588 activeSub = computed2; 589 shouldTrack = true; 590 try { 591 prepareDeps(computed2); 592 const value = computed2.fn(computed2._value); 593 if (dep.version === 0 || hasChanged(value, computed2._value)) { 594 computed2.flags |= 128; 595 computed2._value = value; 596 dep.version++; 597 } 598 } catch (err) { 599 dep.version++; 600 throw err; 601 } finally { 602 activeSub = prevSub; 603 shouldTrack = prevShouldTrack; 604 cleanupDeps(computed2); 605 computed2.flags &= -3; 606 } 607} 608function removeSub(link2, soft = false) { 609 const { dep, prevSub, nextSub } = link2; 610 if (prevSub) { 611 prevSub.nextSub = nextSub; 612 link2.prevSub = void 0; 613 } 614 if (nextSub) { 615 nextSub.prevSub = prevSub; 616 link2.nextSub = void 0; 617 } 618 if (!!(define_process_env_default$8.NODE_ENV !== "production") && dep.subsHead === link2) { 619 dep.subsHead = nextSub; 620 } 621 if (dep.subs === link2) { 622 dep.subs = prevSub; 623 if (!prevSub && dep.computed) { 624 dep.computed.flags &= -5; 625 for (let l = dep.computed.deps; l; l = l.nextDep) { 626 removeSub(l, true); 627 } 628 } 629 } 630 if (!soft && !--dep.sc && dep.map) { 631 dep.map.delete(dep.key); 632 } 633} 634function removeDep(link2) { 635 const { prevDep, nextDep } = link2; 636 if (prevDep) { 637 prevDep.nextDep = nextDep; 638 link2.prevDep = void 0; 639 } 640 if (nextDep) { 641 nextDep.prevDep = prevDep; 642 link2.nextDep = void 0; 643 } 644} 645let shouldTrack = true; 646const trackStack = []; 647function pauseTracking() { 648 trackStack.push(shouldTrack); 649 shouldTrack = false; 650} 651function resetTracking() { 652 const last = trackStack.pop(); 653 shouldTrack = last === void 0 ? true : last; 654} 655function cleanupEffect(e) { 656 const { cleanup } = e; 657 e.cleanup = void 0; 658 if (cleanup) { 659 const prevSub = activeSub; 660 activeSub = void 0; 661 try { 662 cleanup(); 663 } finally { 664 activeSub = prevSub; 665 } 666 } 667} 668let globalVersion = 0; 669class Link { 670 constructor(sub, dep) { 671 this.sub = sub; 672 this.dep = dep; 673 this.version = dep.version; 674 this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0; 675 } 676} 677class Dep { 678 // TODO isolatedDeclarations "__v_skip" 679 constructor(computed2) { 680 this.computed = computed2; 681 this.version = 0; 682 this.activeLink = void 0; 683 this.subs = void 0; 684 this.map = void 0; 685 this.key = void 0; 686 this.sc = 0; 687 this.__v_skip = true; 688 if (!!(define_process_env_default$8.NODE_ENV !== "production")) { 689 this.subsHead = void 0; 690 } 691 } 692 track(debugInfo) { 693 if (!activeSub || !shouldTrack || activeSub === this.computed) { 694 return; 695 } 696 let link2 = this.activeLink; 697 if (link2 === void 0 || link2.sub !== activeSub) { 698 link2 = this.activeLink = new Link(activeSub, this); 699 if (!activeSub.deps) { 700 activeSub.deps = activeSub.depsTail = link2; 701 } else { 702 link2.prevDep = activeSub.depsTail; 703 activeSub.depsTail.nextDep = link2; 704 activeSub.depsTail = link2; 705 } 706 addSub(link2); 707 } else if (link2.version === -1) { 708 link2.version = this.version; 709 if (link2.nextDep) { 710 const next = link2.nextDep; 711 next.prevDep = link2.prevDep; 712 if (link2.prevDep) { 713 link2.prevDep.nextDep = next; 714 } 715 link2.prevDep = activeSub.depsTail; 716 link2.nextDep = void 0; 717 activeSub.depsTail.nextDep = link2; 718 activeSub.depsTail = link2; 719 if (activeSub.deps === link2) { 720 activeSub.deps = next; 721 } 722 } 723 } 724 if (!!(define_process_env_default$8.NODE_ENV !== "production") && activeSub.onTrack) { 725 activeSub.onTrack( 726 extend( 727 { 728 effect: activeSub 729 }, 730 debugInfo 731 ) 732 ); 733 } 734 return link2; 735 } 736 trigger(debugInfo) { 737 this.version++; 738 globalVersion++; 739 this.notify(debugInfo); 740 } 741 notify(debugInfo) { 742 startBatch(); 743 try { 744 if (!!(define_process_env_default$8.NODE_ENV !== "production")) { 745 for (let head = this.subsHead; head; head = head.nextSub) { 746 if (head.sub.onTrigger && !(head.sub.flags & 8)) { 747 head.sub.onTrigger( 748 extend( 749 { 750 effect: head.sub 751 }, 752 debugInfo 753 ) 754 ); 755 } 756 } 757 } 758 for (let link2 = this.subs; link2; link2 = link2.prevSub) { 759 if (link2.sub.notify()) { 760 ; 761 link2.sub.dep.notify(); 762 } 763 } 764 } finally { 765 endBatch(); 766 } 767 } 768} 769function addSub(link2) { 770 link2.dep.sc++; 771 if (link2.sub.flags & 4) { 772 const computed2 = link2.dep.computed; 773 if (computed2 && !link2.dep.subs) { 774 computed2.flags |= 4 | 16; 775 for (let l = computed2.deps; l; l = l.nextDep) { 776 addSub(l); 777 } 778 } 779 const currentTail = link2.dep.subs; 780 if (currentTail !== link2) { 781 link2.prevSub = currentTail; 782 if (currentTail) currentTail.nextSub = link2; 783 } 784 if (!!(define_process_env_default$8.NODE_ENV !== "production") && link2.dep.subsHead === void 0) { 785 link2.dep.subsHead = link2; 786 } 787 link2.dep.subs = link2; 788 } 789} 790const targetMap = /* @__PURE__ */ new WeakMap(); 791const ITERATE_KEY = Symbol( 792 !!(define_process_env_default$8.NODE_ENV !== "production") ? "Object iterate" : "" 793); 794const MAP_KEY_ITERATE_KEY = Symbol( 795 !!(define_process_env_default$8.NODE_ENV !== "production") ? "Map keys iterate" : "" 796); 797const ARRAY_ITERATE_KEY = Symbol( 798 !!(define_process_env_default$8.NODE_ENV !== "production") ? "Array iterate" : "" 799); 800function track(target, type, key) { 801 if (shouldTrack && activeSub) { 802 let depsMap = targetMap.get(target); 803 if (!depsMap) { 804 targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); 805 } 806 let dep = depsMap.get(key); 807 if (!dep) { 808 depsMap.set(key, dep = new Dep()); 809 dep.map = depsMap; 810 dep.key = key; 811 } 812 if (!!(define_process_env_default$8.NODE_ENV !== "production")) { 813 dep.track({ 814 target, 815 type, 816 key 817 }); 818 } else { 819 dep.track(); 820 } 821 } 822} 823function trigger(target, type, key, newValue, oldValue, oldTarget) { 824 const depsMap = targetMap.get(target); 825 if (!depsMap) { 826 globalVersion++; 827 return; 828 } 829 const run = (dep) => { 830 if (dep) { 831 if (!!(define_process_env_default$8.NODE_ENV !== "production")) { 832 dep.trigger({ 833 target, 834 type, 835 key, 836 newValue, 837 oldValue, 838 oldTarget 839 }); 840 } else { 841 dep.trigger(); 842 } 843 } 844 }; 845 startBatch(); 846 if (type === "clear") {
vendor: 5,232 bytes, lines 847-1027
847 depsMap.forEach(run); 848 } else { 849 const targetIsArray = isArray$1(target); 850 const isArrayIndex = targetIsArray && isIntegerKey(key); 851 if (targetIsArray && key === "length") { 852 const newLength = Number(newValue); 853 depsMap.forEach((dep, key2) => { 854 if (key2 === "length" || key2 === ARRAY_ITERATE_KEY || !isSymbol(key2) && key2 >= newLength) { 855 run(dep); 856 } 857 }); 858 } else { 859 if (key !== void 0 || depsMap.has(void 0)) { 860 run(depsMap.get(key)); 861 } 862 if (isArrayIndex) { 863 run(depsMap.get(ARRAY_ITERATE_KEY)); 864 } 865 switch (type) { 866 case "add": 867 if (!targetIsArray) { 868 run(depsMap.get(ITERATE_KEY)); 869 if (isMap(target)) { 870 run(depsMap.get(MAP_KEY_ITERATE_KEY)); 871 } 872 } else if (isArrayIndex) { 873 run(depsMap.get("length")); 874 } 875 break; 876 case "delete": 877 if (!targetIsArray) { 878 run(depsMap.get(ITERATE_KEY)); 879 if (isMap(target)) { 880 run(depsMap.get(MAP_KEY_ITERATE_KEY)); 881 } 882 } 883 break; 884 case "set": 885 if (isMap(target)) { 886 run(depsMap.get(ITERATE_KEY)); 887 } 888 break; 889 } 890 } 891 } 892 endBatch(); 893} 894function getDepFromReactive(object, key) { 895 const depMap = targetMap.get(object); 896 return depMap && depMap.get(key); 897} 898function reactiveReadArray(array) { 899 const raw = toRaw(array); 900 if (raw === array) return raw; 901 track(raw, "iterate", ARRAY_ITERATE_KEY); 902 return isShallow(array) ? raw : raw.map(toReactive); 903} 904function shallowReadArray(arr) { 905 track(arr = toRaw(arr), "iterate", ARRAY_ITERATE_KEY); 906 return arr; 907} 908const arrayInstrumentations = { 909 __proto__: null, 910 [Symbol.iterator]() { 911 return iterator(this, Symbol.iterator, toReactive); 912 }, 913 concat(...args) { 914 return reactiveReadArray(this).concat( 915 ...args.map((x) => isArray$1(x) ? reactiveReadArray(x) : x) 916 ); 917 }, 918 entries() { 919 return iterator(this, "entries", (value) => { 920 value[1] = toReactive(value[1]); 921 return value; 922 }); 923 }, 924 every(fn, thisArg) { 925 return apply$1(this, "every", fn, thisArg, void 0, arguments); 926 }, 927 filter(fn, thisArg) { 928 return apply$1(this, "filter", fn, thisArg, (v) => v.map(toReactive), arguments); 929 }, 930 find(fn, thisArg) { 931 return apply$1(this, "find", fn, thisArg, toReactive, arguments); 932 }, 933 findIndex(fn, thisArg) { 934 return apply$1(this, "findIndex", fn, thisArg, void 0, arguments); 935 }, 936 findLast(fn, thisArg) { 937 return apply$1(this, "findLast", fn, thisArg, toReactive, arguments); 938 }, 939 findLastIndex(fn, thisArg) { 940 return apply$1(this, "findLastIndex", fn, thisArg, void 0, arguments); 941 }, 942 // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement 943 forEach(fn, thisArg) { 944 return apply$1(this, "forEach", fn, thisArg, void 0, arguments); 945 }, 946 includes(...args) { 947 return searchProxy(this, "includes", args); 948 }, 949 indexOf(...args) { 950 return searchProxy(this, "indexOf", args); 951 }, 952 join(separator) { 953 return reactiveReadArray(this).join(separator); 954 }, 955 // keys() iterator only reads `length`, no optimization required 956 lastIndexOf(...args) { 957 return searchProxy(this, "lastIndexOf", args); 958 }, 959 map(fn, thisArg) { 960 return apply$1(this, "map", fn, thisArg, void 0, arguments); 961 }, 962 pop() { 963 return noTracking(this, "pop"); 964 }, 965 push(...args) { 966 return noTracking(this, "push", args); 967 }, 968 reduce(fn, ...args) { 969 return reduce(this, "reduce", fn, args); 970 }, 971 reduceRight(fn, ...args) { 972 return reduce(this, "reduceRight", fn, args); 973 }, 974 shift() { 975 return noTracking(this, "shift"); 976 }, 977 // slice could use ARRAY_ITERATE but also seems to beg for range tracking 978 some(fn, thisArg) { 979 return apply$1(this, "some", fn, thisArg, void 0, arguments); 980 }, 981 splice(...args) { 982 return noTracking(this, "splice", args); 983 }, 984 toReversed() { 985 return reactiveReadArray(this).toReversed(); 986 }, 987 toSorted(comparer) { 988 return reactiveReadArray(this).toSorted(comparer); 989 }, 990 toSpliced(...args) { 991 return reactiveReadArray(this).toSpliced(...args); 992 }, 993 unshift(...args) { 994 return noTracking(this, "unshift", args); 995 }, 996 values() { 997 return iterator(this, "values", toReactive); 998 } 999}; 1000function iterator(self2, method, wrapValue) { 1001 const arr = shallowReadArray(self2); 1002 const iter = arr[method](); 1003 if (arr !== self2 && !isShallow(self2)) { 1004 iter._next = iter.next; 1005 iter.next = () => { 1006 const result = iter._next(); 1007 if (!result.done) { 1008 result.value = wrapValue(result.value); 1009 } 1010 return result; 1011 }; 1012 } 1013 return iter; 1014} 1015const arrayProto = Array.prototype; 1016function apply$1(self2, method, fn, thisArg, wrappedRetFn, args) { 1017 const arr = shallowReadArray(self2); 1018 const needsWrap = arr !== self2 && !isShallow(self2); 1019 const methodFn = arr[method]; 1020 if (methodFn !== arrayProto[method]) { 1021 const result2 = methodFn.apply(self2, args); 1022 return needsWrap ? toReactive(result2) : result2; 1023 } 1024 let wrappedFn = fn; 1025 if (arr !== self2) { 1026 if (needsWrap) { 1027 wrappedFn = function(item, index) {
vendor: 20,516 bytes, lines 1028-1704
1028 return fn.call(this, toReactive(item), index, self2); 1029 }; 1030 } else if (fn.length > 2) { 1031 wrappedFn = function(item, index) { 1032 return fn.call(this, item, index, self2); 1033 }; 1034 } 1035 } 1036 const result = methodFn.call(arr, wrappedFn, thisArg); 1037 return needsWrap && wrappedRetFn ? wrappedRetFn(result) : result; 1038} 1039function reduce(self2, method, fn, args) { 1040 const arr = shallowReadArray(self2); 1041 let wrappedFn = fn; 1042 if (arr !== self2) { 1043 if (!isShallow(self2)) { 1044 wrappedFn = function(acc, item, index) { 1045 return fn.call(this, acc, toReactive(item), index, self2); 1046 }; 1047 } else if (fn.length > 3) { 1048 wrappedFn = function(acc, item, index) { 1049 return fn.call(this, acc, item, index, self2); 1050 }; 1051 } 1052 } 1053 return arr[method](wrappedFn, ...args); 1054} 1055function searchProxy(self2, method, args) { 1056 const arr = toRaw(self2); 1057 track(arr, "iterate", ARRAY_ITERATE_KEY); 1058 const res = arr[method](...args); 1059 if ((res === -1 || res === false) && isProxy(args[0])) { 1060 args[0] = toRaw(args[0]); 1061 return arr[method](...args); 1062 } 1063 return res; 1064} 1065function noTracking(self2, method, args = []) { 1066 pauseTracking(); 1067 startBatch(); 1068 const res = toRaw(self2)[method].apply(self2, args); 1069 endBatch(); 1070 resetTracking(); 1071 return res; 1072} 1073const isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); 1074const builtInSymbols = new Set( 1075 /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((key) => key !== "arguments" && key !== "caller").map((key) => Symbol[key]).filter(isSymbol) 1076); 1077function hasOwnProperty$1(key) { 1078 if (!isSymbol(key)) key = String(key); 1079 const obj = toRaw(this); 1080 track(obj, "has", key); 1081 return obj.hasOwnProperty(key); 1082} 1083class BaseReactiveHandler { 1084 constructor(_isReadonly = false, _isShallow = false) { 1085 this._isReadonly = _isReadonly; 1086 this._isShallow = _isShallow; 1087 } 1088 get(target, key, receiver) { 1089 if (key === "__v_skip") return target["__v_skip"]; 1090 const isReadonly2 = this._isReadonly, isShallow2 = this._isShallow; 1091 if (key === "__v_isReactive") { 1092 return !isReadonly2; 1093 } else if (key === "__v_isReadonly") { 1094 return isReadonly2; 1095 } else if (key === "__v_isShallow") { 1096 return isShallow2; 1097 } else if (key === "__v_raw") { 1098 if (receiver === (isReadonly2 ? isShallow2 ? shallowReadonlyMap : readonlyMap : isShallow2 ? shallowReactiveMap : reactiveMap).get(target) || // receiver is not the reactive proxy, but has the same prototype 1099 // this means the receiver is a user proxy of the reactive proxy 1100 Object.getPrototypeOf(target) === Object.getPrototypeOf(receiver)) { 1101 return target; 1102 } 1103 return; 1104 } 1105 const targetIsArray = isArray$1(target); 1106 if (!isReadonly2) { 1107 let fn; 1108 if (targetIsArray && (fn = arrayInstrumentations[key])) { 1109 return fn; 1110 } 1111 if (key === "hasOwnProperty") { 1112 return hasOwnProperty$1; 1113 } 1114 } 1115 const res = Reflect.get( 1116 target, 1117 key, 1118 // if this is a proxy wrapping a ref, return methods using the raw ref 1119 // as receiver so that we don't have to call `toRaw` on the ref in all 1120 // its class methods 1121 isRef(target) ? target : receiver 1122 ); 1123 if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { 1124 return res; 1125 } 1126 if (!isReadonly2) { 1127 track(target, "get", key); 1128 } 1129 if (isShallow2) { 1130 return res; 1131 } 1132 if (isRef(res)) { 1133 const value = targetIsArray && isIntegerKey(key) ? res : res.value; 1134 return isReadonly2 && isObject$3(value) ? readonly(value) : value; 1135 } 1136 if (isObject$3(res)) { 1137 return isReadonly2 ? readonly(res) : reactive(res); 1138 } 1139 return res; 1140 } 1141} 1142class MutableReactiveHandler extends BaseReactiveHandler { 1143 constructor(isShallow2 = false) { 1144 super(false, isShallow2); 1145 } 1146 set(target, key, value, receiver) { 1147 let oldValue = target[key]; 1148 if (!this._isShallow) { 1149 const isOldValueReadonly = isReadonly(oldValue); 1150 if (!isShallow(value) && !isReadonly(value)) { 1151 oldValue = toRaw(oldValue); 1152 value = toRaw(value); 1153 } 1154 if (!isArray$1(target) && isRef(oldValue) && !isRef(value)) { 1155 if (isOldValueReadonly) { 1156 if (!!(define_process_env_default$8.NODE_ENV !== "production")) { 1157 warn$3( 1158 `Set operation on key "${String(key)}" failed: target is readonly.`, 1159 target[key] 1160 ); 1161 } 1162 return true; 1163 } else { 1164 oldValue.value = value; 1165 return true; 1166 } 1167 } 1168 } 1169 const hadKey = isArray$1(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn$1(target, key); 1170 const result = Reflect.set( 1171 target, 1172 key, 1173 value, 1174 isRef(target) ? target : receiver 1175 ); 1176 if (target === toRaw(receiver)) { 1177 if (!hadKey) { 1178 trigger(target, "add", key, value); 1179 } else if (hasChanged(value, oldValue)) { 1180 trigger(target, "set", key, value, oldValue); 1181 } 1182 } 1183 return result; 1184 } 1185 deleteProperty(target, key) { 1186 const hadKey = hasOwn$1(target, key); 1187 const oldValue = target[key]; 1188 const result = Reflect.deleteProperty(target, key); 1189 if (result && hadKey) { 1190 trigger(target, "delete", key, void 0, oldValue); 1191 } 1192 return result; 1193 } 1194 has(target, key) { 1195 const result = Reflect.has(target, key); 1196 if (!isSymbol(key) || !builtInSymbols.has(key)) { 1197 track(target, "has", key); 1198 } 1199 return result; 1200 } 1201 ownKeys(target) { 1202 track( 1203 target, 1204 "iterate", 1205 isArray$1(target) ? "length" : ITERATE_KEY 1206 ); 1207 return Reflect.ownKeys(target); 1208 } 1209} 1210class ReadonlyReactiveHandler extends BaseReactiveHandler { 1211 constructor(isShallow2 = false) { 1212 super(true, isShallow2); 1213 } 1214 set(target, key) { 1215 if (!!(define_process_env_default$8.NODE_ENV !== "production")) { 1216 warn$3( 1217 `Set operation on key "${String(key)}" failed: target is readonly.`, 1218 target 1219 ); 1220 } 1221 return true; 1222 } 1223 deleteProperty(target, key) { 1224 if (!!(define_process_env_default$8.NODE_ENV !== "production")) { 1225 warn$3( 1226 `Delete operation on key "${String(key)}" failed: target is readonly.`, 1227 target 1228 ); 1229 } 1230 return true; 1231 } 1232} 1233const mutableHandlers = /* @__PURE__ */ new MutableReactiveHandler(); 1234const readonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(); 1235const shallowReactiveHandlers = /* @__PURE__ */ new MutableReactiveHandler(true); 1236const shallowReadonlyHandlers = /* @__PURE__ */ new ReadonlyReactiveHandler(true); 1237const toShallow = (value) => value; 1238const getProto = (v) => Reflect.getPrototypeOf(v); 1239function createIterableMethod(method, isReadonly2, isShallow2) { 1240 return function(...args) { 1241 const target = this["__v_raw"]; 1242 const rawTarget = toRaw(target); 1243 const targetIsMap = isMap(rawTarget); 1244 const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; 1245 const isKeyOnly = method === "keys" && targetIsMap; 1246 const innerIterator = target[method](...args); 1247 const wrap = isShallow2 ? toShallow : isReadonly2 ? toReadonly : toReactive; 1248 !isReadonly2 && track( 1249 rawTarget, 1250 "iterate", 1251 isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY 1252 ); 1253 return { 1254 // iterator protocol 1255 next() { 1256 const { value, done } = innerIterator.next(); 1257 return done ? { value, done } : { 1258 value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), 1259 done 1260 }; 1261 }, 1262 // iterable protocol 1263 [Symbol.iterator]() { 1264 return this; 1265 } 1266 }; 1267 }; 1268} 1269function createReadonlyMethod(type) { 1270 return function(...args) { 1271 if (!!(define_process_env_default$8.NODE_ENV !== "production")) { 1272 const key = args[0] ? `on key "${args[0]}" ` : ``; 1273 warn$3( 1274 `${capitalize$1(type)} operation ${key}failed: target is readonly.`, 1275 toRaw(this) 1276 ); 1277 } 1278 return type === "delete" ? false : type === "clear" ? void 0 : this; 1279 }; 1280} 1281function createInstrumentations(readonly2, shallow) { 1282 const instrumentations = { 1283 get(key) { 1284 const target = this["__v_raw"]; 1285 const rawTarget = toRaw(target); 1286 const rawKey = toRaw(key); 1287 if (!readonly2) { 1288 if (hasChanged(key, rawKey)) { 1289 track(rawTarget, "get", key); 1290 } 1291 track(rawTarget, "get", rawKey); 1292 } 1293 const { has } = getProto(rawTarget); 1294 const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive; 1295 if (has.call(rawTarget, key)) { 1296 return wrap(target.get(key)); 1297 } else if (has.call(rawTarget, rawKey)) { 1298 return wrap(target.get(rawKey)); 1299 } else if (target !== rawTarget) { 1300 target.get(key); 1301 } 1302 }, 1303 get size() { 1304 const target = this["__v_raw"]; 1305 !readonly2 && track(toRaw(target), "iterate", ITERATE_KEY); 1306 return target.size; 1307 }, 1308 has(key) { 1309 const target = this["__v_raw"]; 1310 const rawTarget = toRaw(target); 1311 const rawKey = toRaw(key); 1312 if (!readonly2) { 1313 if (hasChanged(key, rawKey)) { 1314 track(rawTarget, "has", key); 1315 } 1316 track(rawTarget, "has", rawKey); 1317 } 1318 return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); 1319 }, 1320 forEach(callback, thisArg) { 1321 const observed = this; 1322 const target = observed["__v_raw"]; 1323 const rawTarget = toRaw(target); 1324 const wrap = shallow ? toShallow : readonly2 ? toReadonly : toReactive; 1325 !readonly2 && track(rawTarget, "iterate", ITERATE_KEY); 1326 return target.forEach((value, key) => { 1327 return callback.call(thisArg, wrap(value), wrap(key), observed); 1328 }); 1329 } 1330 }; 1331 extend( 1332 instrumentations, 1333 readonly2 ? { 1334 add: createReadonlyMethod("add"), 1335 set: createReadonlyMethod("set"), 1336 delete: createReadonlyMethod("delete"), 1337 clear: createReadonlyMethod("clear") 1338 } : { 1339 add(value) { 1340 if (!shallow && !isShallow(value) && !isReadonly(value)) { 1341 value = toRaw(value); 1342 } 1343 const target = toRaw(this); 1344 const proto = getProto(target); 1345 const hadKey = proto.has.call(target, value); 1346 if (!hadKey) { 1347 target.add(value); 1348 trigger(target, "add", value, value); 1349 } 1350 return this; 1351 }, 1352 set(key, value) { 1353 if (!shallow && !isShallow(value) && !isReadonly(value)) { 1354 value = toRaw(value); 1355 } 1356 const target = toRaw(this); 1357 const { has, get } = getProto(target); 1358 let hadKey = has.call(target, key); 1359 if (!hadKey) { 1360 key = toRaw(key); 1361 hadKey = has.call(target, key); 1362 } else if (!!(define_process_env_default$8.NODE_ENV !== "production")) { 1363 checkIdentityKeys(target, has, key); 1364 } 1365 const oldValue = get.call(target, key); 1366 target.set(key, value); 1367 if (!hadKey) { 1368 trigger(target, "add", key, value); 1369 } else if (hasChanged(value, oldValue)) { 1370 trigger(target, "set", key, value, oldValue); 1371 } 1372 return this; 1373 }, 1374 delete(key) { 1375 const target = toRaw(this); 1376 const { has, get } = getProto(target); 1377 let hadKey = has.call(target, key); 1378 if (!hadKey) { 1379 key = toRaw(key); 1380 hadKey = has.call(target, key); 1381 } else if (!!(define_process_env_default$8.NODE_ENV !== "production")) { 1382 checkIdentityKeys(target, has, key); 1383 } 1384 const oldValue = get ? get.call(target, key) : void 0; 1385 const result = target.delete(key); 1386 if (hadKey) { 1387 trigger(target, "delete", key, void 0, oldValue); 1388 } 1389 return result; 1390 }, 1391 clear() { 1392 const target = toRaw(this); 1393 const hadItems = target.size !== 0; 1394 const oldTarget = !!(define_process_env_default$8.NODE_ENV !== "production") ? isMap(target) ? new Map(target) : new Set(target) : void 0; 1395 const result = target.clear(); 1396 if (hadItems) { 1397 trigger( 1398 target, 1399 "clear", 1400 void 0, 1401 void 0, 1402 oldTarget 1403 ); 1404 } 1405 return result; 1406 } 1407 } 1408 ); 1409 const iteratorMethods = [ 1410 "keys", 1411 "values", 1412 "entries", 1413 Symbol.iterator 1414 ]; 1415 iteratorMethods.forEach((method) => { 1416 instrumentations[method] = createIterableMethod(method, readonly2, shallow); 1417 }); 1418 return instrumentations; 1419} 1420function createInstrumentationGetter(isReadonly2, shallow) { 1421 const instrumentations = createInstrumentations(isReadonly2, shallow); 1422 return (target, key, receiver) => { 1423 if (key === "__v_isReactive") { 1424 return !isReadonly2; 1425 } else if (key === "__v_isReadonly") { 1426 return isReadonly2; 1427 } else if (key === "__v_raw") { 1428 return target; 1429 } 1430 return Reflect.get( 1431 hasOwn$1(instrumentations, key) && key in target ? instrumentations : target, 1432 key, 1433 receiver 1434 ); 1435 }; 1436} 1437const mutableCollectionHandlers = { 1438 get: /* @__PURE__ */ createInstrumentationGetter(false, false) 1439}; 1440const shallowCollectionHandlers = { 1441 get: /* @__PURE__ */ createInstrumentationGetter(false, true) 1442}; 1443const readonlyCollectionHandlers = { 1444 get: /* @__PURE__ */ createInstrumentationGetter(true, false) 1445}; 1446const shallowReadonlyCollectionHandlers = { 1447 get: /* @__PURE__ */ createInstrumentationGetter(true, true) 1448}; 1449function checkIdentityKeys(target, has, key) { 1450 const rawKey = toRaw(key); 1451 if (rawKey !== key && has.call(target, rawKey)) { 1452 const type = toRawType(target); 1453 warn$3( 1454 `Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.` 1455 ); 1456 } 1457} 1458const reactiveMap = /* @__PURE__ */ new WeakMap(); 1459const shallowReactiveMap = /* @__PURE__ */ new WeakMap(); 1460const readonlyMap = /* @__PURE__ */ new WeakMap(); 1461const shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); 1462function targetTypeMap(rawType) { 1463 switch (rawType) { 1464 case "Object": 1465 case "Array": 1466 return 1; 1467 case "Map": 1468 case "Set": 1469 case "WeakMap": 1470 case "WeakSet": 1471 return 2; 1472 default: 1473 return 0; 1474 } 1475} 1476function getTargetType(value) { 1477 return value["__v_skip"] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value)); 1478} 1479function reactive(target) { 1480 if (isReadonly(target)) { 1481 return target; 1482 } 1483 return createReactiveObject( 1484 target, 1485 false, 1486 mutableHandlers, 1487 mutableCollectionHandlers, 1488 reactiveMap 1489 ); 1490} 1491function shallowReactive(target) { 1492 return createReactiveObject( 1493 target, 1494 false, 1495 shallowReactiveHandlers, 1496 shallowCollectionHandlers, 1497 shallowReactiveMap 1498 ); 1499} 1500function readonly(target) { 1501 return createReactiveObject( 1502 target, 1503 true, 1504 readonlyHandlers, 1505 readonlyCollectionHandlers, 1506 readonlyMap 1507 ); 1508} 1509function shallowReadonly(target) { 1510 return createReactiveObject( 1511 target, 1512 true, 1513 shallowReadonlyHandlers, 1514 shallowReadonlyCollectionHandlers, 1515 shallowReadonlyMap 1516 ); 1517} 1518function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { 1519 if (!isObject$3(target)) { 1520 if (!!(define_process_env_default$8.NODE_ENV !== "production")) { 1521 warn$3( 1522 `value cannot be made ${isReadonly2 ? "readonly" : "reactive"}: ${String( 1523 target 1524 )}` 1525 ); 1526 } 1527 return target; 1528 } 1529 if (target["__v_raw"] && !(isReadonly2 && target["__v_isReactive"])) { 1530 return target; 1531 } 1532 const targetType = getTargetType(target); 1533 if (targetType === 0) { 1534 return target; 1535 } 1536 const existingProxy = proxyMap.get(target); 1537 if (existingProxy) { 1538 return existingProxy; 1539 } 1540 const proxy = new Proxy( 1541 target, 1542 targetType === 2 ? collectionHandlers : baseHandlers 1543 ); 1544 proxyMap.set(target, proxy); 1545 return proxy; 1546} 1547function isReactive(value) { 1548 if (isReadonly(value)) { 1549 return isReactive(value["__v_raw"]); 1550 } 1551 return !!(value && value["__v_isReactive"]); 1552} 1553function isReadonly(value) { 1554 return !!(value && value["__v_isReadonly"]); 1555} 1556function isShallow(value) { 1557 return !!(value && value["__v_isShallow"]); 1558} 1559function isProxy(value) { 1560 return value ? !!value["__v_raw"] : false; 1561} 1562function toRaw(observed) { 1563 const raw = observed && observed["__v_raw"]; 1564 return raw ? toRaw(raw) : observed; 1565} 1566function markRaw(value) { 1567 if (!hasOwn$1(value, "__v_skip") && Object.isExtensible(value)) { 1568 def$1(value, "__v_skip", true); 1569 } 1570 return value; 1571} 1572const toReactive = (value) => isObject$3(value) ? reactive(value) : value; 1573const toReadonly = (value) => isObject$3(value) ? readonly(value) : value; 1574function isRef(r) { 1575 return r ? r["__v_isRef"] === true : false; 1576} 1577function ref(value) { 1578 return createRef(value, false); 1579} 1580function shallowRef(value) { 1581 return createRef(value, true); 1582} 1583function createRef(rawValue, shallow) { 1584 if (isRef(rawValue)) { 1585 return rawValue; 1586 } 1587 return new RefImpl(rawValue, shallow); 1588} 1589class RefImpl { 1590 constructor(value, isShallow2) { 1591 this.dep = new Dep(); 1592 this["__v_isRef"] = true; 1593 this["__v_isShallow"] = false; 1594 this._rawValue = isShallow2 ? value : toRaw(value); 1595 this._value = isShallow2 ? value : toReactive(value); 1596 this["__v_isShallow"] = isShallow2; 1597 } 1598 get value() { 1599 if (!!(define_process_env_default$8.NODE_ENV !== "production")) { 1600 this.dep.track({ 1601 target: this, 1602 type: "get", 1603 key: "value" 1604 }); 1605 } else { 1606 this.dep.track(); 1607 } 1608 return this._value; 1609 } 1610 set value(newValue) { 1611 const oldValue = this._rawValue; 1612 const useDirectValue = this["__v_isShallow"] || isShallow(newValue) || isReadonly(newValue); 1613 newValue = useDirectValue ? newValue : toRaw(newValue); 1614 if (hasChanged(newValue, oldValue)) { 1615 this._rawValue = newValue; 1616 this._value = useDirectValue ? newValue : toReactive(newValue); 1617 if (!!(define_process_env_default$8.NODE_ENV !== "production")) { 1618 this.dep.trigger({ 1619 target: this, 1620 type: "set", 1621 key: "value", 1622 newValue, 1623 oldValue 1624 }); 1625 } else { 1626 this.dep.trigger(); 1627 } 1628 } 1629 } 1630} 1631function unref(ref2) { 1632 return isRef(ref2) ? ref2.value : ref2; 1633} 1634const shallowUnwrapHandlers = { 1635 get: (target, key, receiver) => key === "__v_raw" ? target : unref(Reflect.get(target, key, receiver)), 1636 set: (target, key, value, receiver) => { 1637 const oldValue = target[key]; 1638 if (isRef(oldValue) && !isRef(value)) { 1639 oldValue.value = value; 1640 return true; 1641 } else { 1642 return Reflect.set(target, key, value, receiver); 1643 } 1644 } 1645}; 1646function proxyRefs(objectWithRefs) { 1647 return isReactive(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); 1648} 1649function toRefs(object) { 1650 if (!!(define_process_env_default$8.NODE_ENV !== "production") && !isProxy(object)) { 1651 warn$3(`toRefs() expects a reactive object but received a plain one.`); 1652 } 1653 const ret = isArray$1(object) ? new Array(object.length) : {}; 1654 for (const key in object) { 1655 ret[key] = propertyToRef(object, key); 1656 } 1657 return ret; 1658} 1659class ObjectRefImpl { 1660 constructor(_object, _key, _defaultValue) { 1661 this._object = _object; 1662 this._key = _key; 1663 this._defaultValue = _defaultValue; 1664 this["__v_isRef"] = true; 1665 this._value = void 0; 1666 } 1667 get value() { 1668 const val = this._object[this._key]; 1669 return this._value = val === void 0 ? this._defaultValue : val; 1670 } 1671 set value(newVal) { 1672 this._object[this._key] = newVal; 1673 } 1674 get dep() { 1675 return getDepFromReactive(toRaw(this._object), this._key); 1676 } 1677} 1678class GetterRefImpl { 1679 constructor(_getter) { 1680 this._getter = _getter; 1681 this["__v_isRef"] = true; 1682 this["__v_isReadonly"] = true; 1683 this._value = void 0; 1684 } 1685 get value() { 1686 return this._value = this._getter(); 1687 } 1688} 1689function toRef(source, key, defaultValue) { 1690 if (isRef(source)) { 1691 return source; 1692 } else if (isFunction$1(source)) { 1693 return new GetterRefImpl(source); 1694 } else if (isObject$3(source) && arguments.length > 1) { 1695 return propertyToRef(source, key, defaultValue); 1696 } else { 1697 return ref(source); 1698 } 1699} 1700function propertyToRef(source, key, defaultValue) { 1701 const val = source[key]; 1702 return isRef(val) ? val : new ObjectRefImpl(source, key, defaultValue); 1703} 1704class ComputedRefImpl {
1705 constructor(fn, setter, isSSR) { 1706 this.fn = fn; 1707 this.setter = setter; 1708 this._value = void 0; 1709 this.dep = new Dep(this); 1710 this.__v_isRef = true; 1711 this.deps = void 0; 1712 this.depsTail = void 0; 1713 this.flags = 16; 1714 this.globalVersion = globalVersion - 1; 1715 this.next = void 0; 1716 this.effect = this; 1717 this["__v_isReadonly"] = !setter; 1718 this.isSSR = isSSR; 1719 } 1720 /** 1721 * @internal 1722 */ 1723 notify() { 1724 this.flags |= 16; 1725 if (!(this.flags & 8) && // avoid infinite self recursion 1726 activeSub !== this) { 1727 batch(this, true); 1728 return true; 1729 } 1730 } 1731 get value() { 1732 const link2 = !!(define_process_env_default$8.NODE_ENV !== "production") ? this.dep.track({ 1733 target: this, 1734 type: "get", 1735 key: "value" 1736 }) : this.dep.track(); 1737 refreshComputed(this); 1738 if (link2) { 1739 link2.version = this.dep.version; 1740 } 1741 return this._value; 1742 } 1743 set value(newValue) { 1744 if (this.setter) { 1745 this.setter(newValue); 1746 } else if (!!(define_process_env_default$8.NODE_ENV !== "production")) { 1747 warn$3("Write operation failed: computed value is readonly"); 1748 } 1749 } 1750} 1751function computed$1(getterOrOptions, debugOptions, isSSR = false) { 1752 let getter; 1753 let setter; 1754 if (isFunction$1(getterOrOptions)) { 1755 getter = getterOrOptions; 1756 } else { 1757 getter = getterOrOptions.get; 1758 setter = getterOrOptions.set; 1759 } 1760 const cRef = new ComputedRefImpl(getter, setter, isSSR); 1761 return cRef; 1762} 1763const INITIAL_WATCHER_VALUE = {}; 1764const cleanupMap = /* @__PURE__ */ new WeakMap(); 1765let activeWatcher = void 0; 1766function onWatcherCleanup(cleanupFn, failSilently = false, owner = activeWatcher) { 1767 if (owner) { 1768 let cleanups = cleanupMap.get(owner); 1769 if (!cleanups) cleanupMap.set(owner, cleanups = []); 1770 cleanups.push(cleanupFn); 1771 } else if (!!(define_process_env_default$8.NODE_ENV !== "production") && !failSilently) { 1772 warn$3( 1773 `onWatcherCleanup() was called when there was no active watcher to associate with.` 1774 ); 1775 } 1776} 1777function watch$1(source, cb, options = EMPTY_OBJ) { 1778 const { immediate, deep, once: once2, scheduler, augmentJob, call } = options; 1779 const warnInvalidSource = (s) => { 1780 (options.onWarn || warn$3)( 1781 `Invalid watch source: `, 1782 s, 1783 `A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.` 1784 ); 1785 }; 1786 const reactiveGetter = (source2) => { 1787 if (deep) return source2; 1788 if (isShallow(source2) || deep === false || deep === 0) 1789 return traverse(source2, 1); 1790 return traverse(source2); 1791 }; 1792 let effect2; 1793 let getter; 1794 let cleanup; 1795 let boundCleanup; 1796 let forceTrigger = false; 1797 let isMultiSource = false;
vendor: 4,093 bytes, lines 1798-1936
1798 if (isRef(source)) { 1799 getter = () => source.value; 1800 forceTrigger = isShallow(source); 1801 } else if (isReactive(source)) { 1802 getter = () => reactiveGetter(source); 1803 forceTrigger = true; 1804 } else if (isArray$1(source)) { 1805 isMultiSource = true; 1806 forceTrigger = source.some((s) => isReactive(s) || isShallow(s)); 1807 getter = () => source.map((s) => { 1808 if (isRef(s)) { 1809 return s.value; 1810 } else if (isReactive(s)) { 1811 return reactiveGetter(s); 1812 } else if (isFunction$1(s)) { 1813 return call ? call(s, 2) : s(); 1814 } else { 1815 !!(define_process_env_default$8.NODE_ENV !== "production") && warnInvalidSource(s); 1816 } 1817 }); 1818 } else if (isFunction$1(source)) { 1819 if (cb) { 1820 getter = call ? () => call(source, 2) : source; 1821 } else { 1822 getter = () => { 1823 if (cleanup) { 1824 pauseTracking(); 1825 try { 1826 cleanup(); 1827 } finally { 1828 resetTracking(); 1829 } 1830 } 1831 const currentEffect = activeWatcher; 1832 activeWatcher = effect2; 1833 try { 1834 return call ? call(source, 3, [boundCleanup]) : source(boundCleanup); 1835 } finally { 1836 activeWatcher = currentEffect; 1837 } 1838 }; 1839 } 1840 } else { 1841 getter = NOOP; 1842 !!(define_process_env_default$8.NODE_ENV !== "production") && warnInvalidSource(source); 1843 } 1844 if (cb && deep) { 1845 const baseGetter = getter; 1846 const depth = deep === true ? Infinity : deep; 1847 getter = () => traverse(baseGetter(), depth); 1848 } 1849 const scope = getCurrentScope(); 1850 const watchHandle = () => { 1851 effect2.stop(); 1852 if (scope && scope.active) { 1853 remove(scope.effects, effect2); 1854 } 1855 }; 1856 if (once2 && cb) { 1857 const _cb = cb; 1858 cb = (...args) => { 1859 _cb(...args); 1860 watchHandle(); 1861 }; 1862 } 1863 let oldValue = isMultiSource ? new Array(source.length).fill(INITIAL_WATCHER_VALUE) : INITIAL_WATCHER_VALUE; 1864 const job = (immediateFirstRun) => { 1865 if (!(effect2.flags & 1) || !effect2.dirty && !immediateFirstRun) { 1866 return; 1867 } 1868 if (cb) { 1869 const newValue = effect2.run(); 1870 if (deep || forceTrigger || (isMultiSource ? newValue.some((v, i) => hasChanged(v, oldValue[i])) : hasChanged(newValue, oldValue))) { 1871 if (cleanup) { 1872 cleanup(); 1873 } 1874 const currentWatcher = activeWatcher; 1875 activeWatcher = effect2; 1876 try { 1877 const args = [ 1878 newValue, 1879 // pass undefined as the old value when it's changed for the first time 1880 oldValue === INITIAL_WATCHER_VALUE ? void 0 : isMultiSource && oldValue[0] === INITIAL_WATCHER_VALUE ? [] : oldValue, 1881 boundCleanup 1882 ]; 1883 oldValue = newValue; 1884 call ? call(cb, 3, args) : ( 1885 // @ts-expect-error 1886 cb(...args) 1887 ); 1888 } finally { 1889 activeWatcher = currentWatcher; 1890 } 1891 } 1892 } else { 1893 effect2.run(); 1894 } 1895 }; 1896 if (augmentJob) { 1897 augmentJob(job); 1898 } 1899 effect2 = new ReactiveEffect(getter); 1900 effect2.scheduler = scheduler ? () => scheduler(job, false) : job; 1901 boundCleanup = (fn) => onWatcherCleanup(fn, false, effect2); 1902 cleanup = effect2.onStop = () => { 1903 const cleanups = cleanupMap.get(effect2); 1904 if (cleanups) { 1905 if (call) { 1906 call(cleanups, 4); 1907 } else { 1908 for (const cleanup2 of cleanups) cleanup2(); 1909 } 1910 cleanupMap.delete(effect2); 1911 } 1912 }; 1913 if (!!(define_process_env_default$8.NODE_ENV !== "production")) { 1914 effect2.onTrack = options.onTrack; 1915 effect2.onTrigger = options.onTrigger; 1916 } 1917 if (cb) { 1918 if (immediate) { 1919 job(true); 1920 } else { 1921 oldValue = effect2.run(); 1922 } 1923 } else if (scheduler) { 1924 scheduler(job.bind(null, true), true); 1925 } else { 1926 effect2.run(); 1927 } 1928 watchHandle.pause = effect2.pause.bind(effect2); 1929 watchHandle.resume = effect2.resume.bind(effect2); 1930 watchHandle.stop = watchHandle; 1931 return watchHandle; 1932} 1933function traverse(value, depth = Infinity, seen) { 1934 if (depth <= 0 || !isObject$3(value) || value["__v_skip"]) { 1935 return value; 1936 }
vendor: 4,584 bytes, lines 1937-2095
1937 seen = seen || /* @__PURE__ */ new Map(); 1938 if ((seen.get(value) || 0) >= depth) { 1939 return value; 1940 } 1941 seen.set(value, depth); 1942 depth--; 1943 if (isRef(value)) { 1944 traverse(value.value, depth, seen); 1945 } else if (isArray$1(value)) { 1946 for (let i = 0; i < value.length; i++) { 1947 traverse(value[i], depth, seen); 1948 } 1949 } else if (isSet(value) || isMap(value)) { 1950 value.forEach((v) => { 1951 traverse(v, depth, seen); 1952 }); 1953 } else if (isPlainObject$2(value)) { 1954 for (const key in value) { 1955 traverse(value[key], depth, seen); 1956 } 1957 for (const key of Object.getOwnPropertySymbols(value)) { 1958 if (Object.prototype.propertyIsEnumerable.call(value, key)) { 1959 traverse(value[key], depth, seen); 1960 } 1961 } 1962 } 1963 return value; 1964} 1965var define_process_env_default$7 = {}; 1966const stack = []; 1967function pushWarningContext(vnode) { 1968 stack.push(vnode); 1969} 1970function popWarningContext() { 1971 stack.pop(); 1972} 1973let isWarning = false; 1974function warn$1$1(msg, ...args) { 1975 if (isWarning) return; 1976 isWarning = true; 1977 pauseTracking(); 1978 const instance = stack.length ? stack[stack.length - 1].component : null; 1979 const appWarnHandler = instance && instance.appContext.config.warnHandler; 1980 const trace = getComponentTrace(); 1981 if (appWarnHandler) { 1982 callWithErrorHandling( 1983 appWarnHandler, 1984 instance, 1985 11, 1986 [ 1987 // eslint-disable-next-line no-restricted-syntax 1988 msg + args.map((a) => { 1989 var _a2, _b; 1990 return (_b = (_a2 = a.toString) == null ? void 0 : _a2.call(a)) != null ? _b : JSON.stringify(a); 1991 }).join(""), 1992 instance && instance.proxy, 1993 trace.map( 1994 ({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>` 1995 ).join("\n"), 1996 trace 1997 ] 1998 ); 1999 } else { 2000 const warnArgs = [`[Vue warn]: ${msg}`, ...args]; 2001 if (trace.length && // avoid spamming console during tests 2002 true) { 2003 warnArgs.push(` 2004`, ...formatTrace(trace)); 2005 } 2006 console.warn(...warnArgs); 2007 } 2008 resetTracking(); 2009 isWarning = false; 2010} 2011function getComponentTrace() { 2012 let currentVNode = stack[stack.length - 1]; 2013 if (!currentVNode) { 2014 return []; 2015 } 2016 const normalizedStack = []; 2017 while (currentVNode) { 2018 const last = normalizedStack[0]; 2019 if (last && last.vnode === currentVNode) { 2020 last.recurseCount++; 2021 } else { 2022 normalizedStack.push({ 2023 vnode: currentVNode, 2024 recurseCount: 0 2025 }); 2026 } 2027 const parentInstance = currentVNode.component && currentVNode.component.parent; 2028 currentVNode = parentInstance && parentInstance.vnode; 2029 } 2030 return normalizedStack; 2031} 2032function formatTrace(trace) { 2033 const logs = []; 2034 trace.forEach((entry, i) => { 2035 logs.push(...i === 0 ? [] : [` 2036`], ...formatTraceEntry(entry)); 2037 }); 2038 return logs; 2039} 2040function formatTraceEntry({ vnode, recurseCount }) { 2041 const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``; 2042 const isRoot = vnode.component ? vnode.component.parent == null : false; 2043 const open = ` at <${formatComponentName( 2044 vnode.component, 2045 vnode.type, 2046 isRoot 2047 )}`; 2048 const close2 = `>` + postfix; 2049 return vnode.props ? [open, ...formatProps(vnode.props), close2] : [open + close2]; 2050} 2051function formatProps(props) { 2052 const res = []; 2053 const keys = Object.keys(props); 2054 keys.slice(0, 3).forEach((key) => { 2055 res.push(...formatProp(key, props[key])); 2056 }); 2057 if (keys.length > 3) { 2058 res.push(` ...`); 2059 } 2060 return res; 2061} 2062function formatProp(key, value, raw) { 2063 if (isString$2(value)) { 2064 value = JSON.stringify(value); 2065 return raw ? value : [`${key}=${value}`]; 2066 } else if (typeof value === "number" || typeof value === "boolean" || value == null) { 2067 return raw ? value : [`${key}=${value}`]; 2068 } else if (isRef(value)) { 2069 value = formatProp(key, toRaw(value.value), true); 2070 return raw ? value : [`${key}=Ref<`, value, `>`]; 2071 } else if (isFunction$1(value)) { 2072 return [`${key}=fn${value.name ? `<${value.name}>` : ``}`]; 2073 } else { 2074 value = toRaw(value); 2075 return raw ? value : [`${key}=`, value]; 2076 } 2077} 2078const ErrorTypeStrings$1 = { 2079 ["sp"]: "serverPrefetch hook", 2080 ["bc"]: "beforeCreate hook", 2081 ["c"]: "created hook", 2082 ["bm"]: "beforeMount hook", 2083 ["m"]: "mounted hook", 2084 ["bu"]: "beforeUpdate hook", 2085 ["u"]: "updated", 2086 ["bum"]: "beforeUnmount hook", 2087 ["um"]: "unmounted hook", 2088 ["a"]: "activated hook", 2089 ["da"]: "deactivated hook", 2090 ["ec"]: "errorCaptured hook", 2091 ["rtc"]: "renderTracked hook", 2092 ["rtg"]: "renderTriggered hook", 2093 [0]: "setup function", 2094 [1]: "render function", 2095 [2]: "watcher getter",
vendor: 1,750 bytes, lines 2096-2147
2096 [3]: "watcher callback", 2097 [4]: "watcher cleanup function", 2098 [5]: "native event handler", 2099 [6]: "component event handler", 2100 [7]: "vnode hook", 2101 [8]: "directive hook", 2102 [9]: "transition hook", 2103 [10]: "app errorHandler", 2104 [11]: "app warnHandler", 2105 [12]: "ref function", 2106 [13]: "async component loader", 2107 [14]: "scheduler flush", 2108 [15]: "component update", 2109 [16]: "app unmount cleanup function" 2110}; 2111function callWithErrorHandling(fn, instance, type, args) { 2112 try { 2113 return args ? fn(...args) : fn(); 2114 } catch (err) { 2115 handleError(err, instance, type); 2116 } 2117} 2118function callWithAsyncErrorHandling(fn, instance, type, args) { 2119 if (isFunction$1(fn)) { 2120 const res = callWithErrorHandling(fn, instance, type, args); 2121 if (res && isPromise$2(res)) { 2122 res.catch((err) => { 2123 handleError(err, instance, type); 2124 }); 2125 } 2126 return res; 2127 } 2128 if (isArray$1(fn)) { 2129 const values = []; 2130 for (let i = 0; i < fn.length; i++) { 2131 values.push(callWithAsyncErrorHandling(fn[i], instance, type, args)); 2132 } 2133 return values; 2134 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 2135 warn$1$1( 2136 `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof fn}` 2137 ); 2138 } 2139} 2140function handleError(err, instance, type, throwInDev = true) { 2141 const contextVNode = instance ? instance.vnode : null; 2142 const { errorHandler, throwUnhandledErrorInProduction } = instance && instance.appContext.config || EMPTY_OBJ; 2143 if (instance) { 2144 let cur = instance.parent; 2145 const exposedInstance = instance.proxy; 2146 const errorInfo = !!(define_process_env_default$7.NODE_ENV !== "production") ? ErrorTypeStrings$1[type] : `https://vuejs.org/error-reference/#runtime-${type}`; 2147 while (cur) {
vendor: 4,527 bytes, lines 2148-2307
2148 const errorCapturedHooks = cur.ec; 2149 if (errorCapturedHooks) { 2150 for (let i = 0; i < errorCapturedHooks.length; i++) { 2151 if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) { 2152 return; 2153 } 2154 } 2155 } 2156 cur = cur.parent; 2157 } 2158 if (errorHandler) { 2159 pauseTracking(); 2160 callWithErrorHandling(errorHandler, null, 10, [ 2161 err, 2162 exposedInstance, 2163 errorInfo 2164 ]); 2165 resetTracking(); 2166 return; 2167 } 2168 } 2169 logError(err, type, contextVNode, throwInDev, throwUnhandledErrorInProduction); 2170} 2171function logError(err, type, contextVNode, throwInDev = true, throwInProd = false) { 2172 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 2173 const info = ErrorTypeStrings$1[type]; 2174 if (contextVNode) { 2175 pushWarningContext(contextVNode); 2176 } 2177 warn$1$1(`Unhandled error${info ? ` during execution of ${info}` : ``}`); 2178 if (contextVNode) { 2179 popWarningContext(); 2180 } 2181 if (throwInDev) { 2182 throw err; 2183 } else { 2184 console.error(err); 2185 } 2186 } else if (throwInProd) { 2187 throw err; 2188 } else { 2189 console.error(err); 2190 } 2191} 2192const queue = []; 2193let flushIndex = -1; 2194const pendingPostFlushCbs = []; 2195let activePostFlushCbs = null; 2196let postFlushIndex = 0; 2197const resolvedPromise = /* @__PURE__ */ Promise.resolve(); 2198let currentFlushPromise = null; 2199const RECURSION_LIMIT = 100; 2200function nextTick(fn) { 2201 const p2 = currentFlushPromise || resolvedPromise; 2202 return fn ? p2.then(this ? fn.bind(this) : fn) : p2; 2203} 2204function findInsertionIndex(id) { 2205 let start = flushIndex + 1; 2206 let end = queue.length; 2207 while (start < end) { 2208 const middle = start + end >>> 1; 2209 const middleJob = queue[middle]; 2210 const middleJobId = getId(middleJob); 2211 if (middleJobId < id || middleJobId === id && middleJob.flags & 2) { 2212 start = middle + 1; 2213 } else { 2214 end = middle; 2215 } 2216 } 2217 return start; 2218} 2219function queueJob(job) { 2220 if (!(job.flags & 1)) { 2221 const jobId = getId(job); 2222 const lastJob = queue[queue.length - 1]; 2223 if (!lastJob || // fast path when the job id is larger than the tail 2224 !(job.flags & 2) && jobId >= getId(lastJob)) { 2225 queue.push(job); 2226 } else { 2227 queue.splice(findInsertionIndex(jobId), 0, job); 2228 } 2229 job.flags |= 1; 2230 queueFlush(); 2231 } 2232} 2233function queueFlush() { 2234 if (!currentFlushPromise) { 2235 currentFlushPromise = resolvedPromise.then(flushJobs); 2236 } 2237} 2238function queuePostFlushCb(cb) { 2239 if (!isArray$1(cb)) { 2240 if (activePostFlushCbs && cb.id === -1) { 2241 activePostFlushCbs.splice(postFlushIndex + 1, 0, cb); 2242 } else if (!(cb.flags & 1)) { 2243 pendingPostFlushCbs.push(cb); 2244 cb.flags |= 1; 2245 } 2246 } else { 2247 pendingPostFlushCbs.push(...cb); 2248 } 2249 queueFlush(); 2250} 2251function flushPreFlushCbs(instance, seen, i = flushIndex + 1) { 2252 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 2253 seen = seen || /* @__PURE__ */ new Map(); 2254 } 2255 for (; i < queue.length; i++) { 2256 const cb = queue[i]; 2257 if (cb && cb.flags & 2) { 2258 if (instance && cb.id !== instance.uid) { 2259 continue; 2260 } 2261 if (!!(define_process_env_default$7.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) { 2262 continue; 2263 } 2264 queue.splice(i, 1); 2265 i--; 2266 if (cb.flags & 4) { 2267 cb.flags &= -2; 2268 } 2269 cb(); 2270 if (!(cb.flags & 4)) { 2271 cb.flags &= -2; 2272 } 2273 } 2274 } 2275} 2276function flushPostFlushCbs(seen) { 2277 if (pendingPostFlushCbs.length) { 2278 const deduped = [...new Set(pendingPostFlushCbs)].sort( 2279 (a, b) => getId(a) - getId(b) 2280 ); 2281 pendingPostFlushCbs.length = 0; 2282 if (activePostFlushCbs) { 2283 activePostFlushCbs.push(...deduped); 2284 return; 2285 } 2286 activePostFlushCbs = deduped; 2287 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 2288 seen = seen || /* @__PURE__ */ new Map(); 2289 } 2290 for (postFlushIndex = 0; postFlushIndex < activePostFlushCbs.length; postFlushIndex++) { 2291 const cb = activePostFlushCbs[postFlushIndex]; 2292 if (!!(define_process_env_default$7.NODE_ENV !== "production") && checkRecursiveUpdates(seen, cb)) { 2293 continue; 2294 } 2295 if (cb.flags & 4) { 2296 cb.flags &= -2; 2297 } 2298 if (!(cb.flags & 8)) cb(); 2299 cb.flags &= -2; 2300 } 2301 activePostFlushCbs = null; 2302 postFlushIndex = 0; 2303 } 2304} 2305const getId = (job) => job.id == null ? job.flags & 2 ? -1 : Infinity : job.id; 2306function flushJobs(seen) { 2307 if (!!(define_process_env_default$7.NODE_ENV !== "production")) {
vendor: 10,776 bytes, lines 2308-2674
2308 seen = seen || /* @__PURE__ */ new Map(); 2309 } 2310 const check = !!(define_process_env_default$7.NODE_ENV !== "production") ? (job) => checkRecursiveUpdates(seen, job) : NOOP; 2311 try { 2312 for (flushIndex = 0; flushIndex < queue.length; flushIndex++) { 2313 const job = queue[flushIndex]; 2314 if (job && !(job.flags & 8)) { 2315 if (!!(define_process_env_default$7.NODE_ENV !== "production") && check(job)) { 2316 continue; 2317 } 2318 if (job.flags & 4) { 2319 job.flags &= ~1; 2320 } 2321 callWithErrorHandling( 2322 job, 2323 job.i, 2324 job.i ? 15 : 14 2325 ); 2326 if (!(job.flags & 4)) { 2327 job.flags &= ~1; 2328 } 2329 } 2330 } 2331 } finally { 2332 for (; flushIndex < queue.length; flushIndex++) { 2333 const job = queue[flushIndex]; 2334 if (job) { 2335 job.flags &= -2; 2336 } 2337 } 2338 flushIndex = -1; 2339 queue.length = 0; 2340 flushPostFlushCbs(seen); 2341 currentFlushPromise = null; 2342 if (queue.length || pendingPostFlushCbs.length) { 2343 flushJobs(seen); 2344 } 2345 } 2346} 2347function checkRecursiveUpdates(seen, fn) { 2348 const count = seen.get(fn) || 0; 2349 if (count > RECURSION_LIMIT) { 2350 const instance = fn.i; 2351 const componentName = instance && getComponentName(instance.type); 2352 handleError( 2353 `Maximum recursive updates exceeded${componentName ? ` in component <${componentName}>` : ``}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`, 2354 null, 2355 10 2356 ); 2357 return true; 2358 } 2359 seen.set(fn, count + 1); 2360 return false; 2361} 2362let isHmrUpdating = false; 2363const hmrDirtyComponents = /* @__PURE__ */ new Map(); 2364if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 2365 getGlobalThis$1().__VUE_HMR_RUNTIME__ = { 2366 createRecord: tryWrap(createRecord), 2367 rerender: tryWrap(rerender), 2368 reload: tryWrap(reload) 2369 }; 2370} 2371const map = /* @__PURE__ */ new Map(); 2372function registerHMR(instance) { 2373 const id = instance.type.__hmrId; 2374 let record = map.get(id); 2375 if (!record) { 2376 createRecord(id, instance.type); 2377 record = map.get(id); 2378 } 2379 record.instances.add(instance); 2380} 2381function unregisterHMR(instance) { 2382 map.get(instance.type.__hmrId).instances.delete(instance); 2383} 2384function createRecord(id, initialDef) { 2385 if (map.has(id)) { 2386 return false; 2387 } 2388 map.set(id, { 2389 initialDef: normalizeClassComponent(initialDef), 2390 instances: /* @__PURE__ */ new Set() 2391 }); 2392 return true; 2393} 2394function normalizeClassComponent(component) { 2395 return isClassComponent(component) ? component.__vccOpts : component; 2396} 2397function rerender(id, newRender) { 2398 const record = map.get(id); 2399 if (!record) { 2400 return; 2401 } 2402 record.initialDef.render = newRender; 2403 [...record.instances].forEach((instance) => { 2404 if (newRender) { 2405 instance.render = newRender; 2406 normalizeClassComponent(instance.type).render = newRender; 2407 } 2408 instance.renderCache = []; 2409 isHmrUpdating = true; 2410 if (!(instance.job.flags & 8)) { 2411 instance.update(); 2412 } 2413 isHmrUpdating = false; 2414 }); 2415} 2416function reload(id, newComp) { 2417 const record = map.get(id); 2418 if (!record) return; 2419 newComp = normalizeClassComponent(newComp); 2420 updateComponentDef(record.initialDef, newComp); 2421 const instances = [...record.instances]; 2422 for (let i = 0; i < instances.length; i++) { 2423 const instance = instances[i]; 2424 const oldComp = normalizeClassComponent(instance.type); 2425 let dirtyInstances = hmrDirtyComponents.get(oldComp); 2426 if (!dirtyInstances) { 2427 if (oldComp !== record.initialDef) { 2428 updateComponentDef(oldComp, newComp); 2429 } 2430 hmrDirtyComponents.set(oldComp, dirtyInstances = /* @__PURE__ */ new Set()); 2431 } 2432 dirtyInstances.add(instance); 2433 instance.appContext.propsCache.delete(instance.type); 2434 instance.appContext.emitsCache.delete(instance.type); 2435 instance.appContext.optionsCache.delete(instance.type); 2436 if (instance.ceReload) { 2437 dirtyInstances.add(instance); 2438 instance.ceReload(newComp.styles); 2439 dirtyInstances.delete(instance); 2440 } else if (instance.parent) { 2441 queueJob(() => { 2442 if (!(instance.job.flags & 8)) { 2443 isHmrUpdating = true; 2444 instance.parent.update(); 2445 isHmrUpdating = false; 2446 dirtyInstances.delete(instance); 2447 } 2448 }); 2449 } else if (instance.appContext.reload) { 2450 instance.appContext.reload(); 2451 } else if (typeof window !== "undefined") { 2452 window.location.reload(); 2453 } else { 2454 console.warn( 2455 "[HMR] Root or manually mounted instance modified. Full reload required." 2456 ); 2457 } 2458 if (instance.root.ce && instance !== instance.root) { 2459 instance.root.ce._removeChildStyle(oldComp); 2460 } 2461 } 2462 queuePostFlushCb(() => { 2463 hmrDirtyComponents.clear(); 2464 }); 2465} 2466function updateComponentDef(oldComp, newComp) { 2467 extend(oldComp, newComp); 2468 for (const key in oldComp) { 2469 if (key !== "__file" && !(key in newComp)) { 2470 delete oldComp[key]; 2471 } 2472 } 2473} 2474function tryWrap(fn) { 2475 return (id, arg) => { 2476 try { 2477 return fn(id, arg); 2478 } catch (e) { 2479 console.error(e); 2480 console.warn( 2481 `[HMR] Something went wrong during Vue component hot-reload. Full reload required.` 2482 ); 2483 } 2484 }; 2485} 2486let devtools$1; 2487let buffer = []; 2488let devtoolsNotInstalled = false; 2489function emit$1(event, ...args) { 2490 if (devtools$1) { 2491 devtools$1.emit(event, ...args); 2492 } else if (!devtoolsNotInstalled) { 2493 buffer.push({ event, args }); 2494 } 2495} 2496function setDevtoolsHook$1(hook, target) { 2497 var _a2, _b; 2498 devtools$1 = hook; 2499 if (devtools$1) { 2500 devtools$1.enabled = true; 2501 buffer.forEach(({ event, args }) => devtools$1.emit(event, ...args)); 2502 buffer = []; 2503 } else if ( 2504 // handle late devtools injection - only do this if we are in an actual 2505 // browser environment to avoid the timer handle stalling test runner exit 2506 // (#4815) 2507 typeof window !== "undefined" && // some envs mock window but not fully 2508 window.HTMLElement && // also exclude jsdom 2509 // eslint-disable-next-line no-restricted-syntax 2510 !((_b = (_a2 = window.navigator) == null ? void 0 : _a2.userAgent) == null ? void 0 : _b.includes("jsdom")) 2511 ) { 2512 const replay = target.__VUE_DEVTOOLS_HOOK_REPLAY__ = target.__VUE_DEVTOOLS_HOOK_REPLAY__ || []; 2513 replay.push((newHook) => { 2514 setDevtoolsHook$1(newHook, target); 2515 }); 2516 setTimeout(() => { 2517 if (!devtools$1) { 2518 target.__VUE_DEVTOOLS_HOOK_REPLAY__ = null; 2519 devtoolsNotInstalled = true; 2520 buffer = []; 2521 } 2522 }, 3e3); 2523 } else { 2524 devtoolsNotInstalled = true; 2525 buffer = []; 2526 } 2527} 2528function devtoolsInitApp(app, version2) { 2529 emit$1("app:init", app, version2, { 2530 Fragment, 2531 Text, 2532 Comment, 2533 Static 2534 }); 2535} 2536function devtoolsUnmountApp(app) { 2537 emit$1("app:unmount", app); 2538} 2539const devtoolsComponentAdded = /* @__PURE__ */ createDevtoolsComponentHook( 2540 "component:added" 2541 /* COMPONENT_ADDED */ 2542); 2543const devtoolsComponentUpdated = /* @__PURE__ */ createDevtoolsComponentHook( 2544 "component:updated" 2545 /* COMPONENT_UPDATED */ 2546); 2547const _devtoolsComponentRemoved = /* @__PURE__ */ createDevtoolsComponentHook( 2548 "component:removed" 2549 /* COMPONENT_REMOVED */ 2550); 2551const devtoolsComponentRemoved = (component) => { 2552 if (devtools$1 && typeof devtools$1.cleanupBuffer === "function" && // remove the component if it wasn't buffered 2553 !devtools$1.cleanupBuffer(component)) { 2554 _devtoolsComponentRemoved(component); 2555 } 2556}; 2557// @__NO_SIDE_EFFECTS__ 2558function createDevtoolsComponentHook(hook) { 2559 return (component) => { 2560 emit$1( 2561 hook, 2562 component.appContext.app, 2563 component.uid, 2564 component.parent ? component.parent.uid : void 0, 2565 component 2566 ); 2567 }; 2568} 2569const devtoolsPerfStart = /* @__PURE__ */ createDevtoolsPerformanceHook( 2570 "perf:start" 2571 /* PERFORMANCE_START */ 2572); 2573const devtoolsPerfEnd = /* @__PURE__ */ createDevtoolsPerformanceHook( 2574 "perf:end" 2575 /* PERFORMANCE_END */ 2576); 2577function createDevtoolsPerformanceHook(hook) { 2578 return (component, type, time) => { 2579 emit$1(hook, component.appContext.app, component.uid, component, type, time); 2580 }; 2581} 2582function devtoolsComponentEmit(component, event, params) { 2583 emit$1( 2584 "component:emit", 2585 component.appContext.app, 2586 component, 2587 event, 2588 params 2589 ); 2590} 2591let currentRenderingInstance = null; 2592let currentScopeId = null; 2593function setCurrentRenderingInstance(instance) { 2594 const prev = currentRenderingInstance; 2595 currentRenderingInstance = instance; 2596 currentScopeId = instance && instance.type.__scopeId || null; 2597 return prev; 2598} 2599function withCtx(fn, ctx = currentRenderingInstance, isNonScopedSlot) { 2600 if (!ctx) return fn; 2601 if (fn._n) { 2602 return fn; 2603 } 2604 const renderFnWithContext = (...args) => { 2605 if (renderFnWithContext._d) { 2606 setBlockTracking(-1); 2607 } 2608 const prevInstance = setCurrentRenderingInstance(ctx); 2609 let res; 2610 try { 2611 res = fn(...args); 2612 } finally { 2613 setCurrentRenderingInstance(prevInstance); 2614 if (renderFnWithContext._d) { 2615 setBlockTracking(1); 2616 } 2617 } 2618 if (!!(define_process_env_default$7.NODE_ENV !== "production") || false) { 2619 devtoolsComponentUpdated(ctx); 2620 } 2621 return res; 2622 }; 2623 renderFnWithContext._n = true; 2624 renderFnWithContext._c = true; 2625 renderFnWithContext._d = true; 2626 return renderFnWithContext; 2627} 2628function validateDirectiveName(name) { 2629 if (isBuiltInDirective(name)) { 2630 warn$1$1("Do not use built-in directive ids as custom directive id: " + name); 2631 } 2632} 2633function withDirectives(vnode, directives) { 2634 if (currentRenderingInstance === null) { 2635 !!(define_process_env_default$7.NODE_ENV !== "production") && warn$1$1(`withDirectives can only be used inside render functions.`); 2636 return vnode; 2637 } 2638 const instance = getComponentPublicInstance(currentRenderingInstance); 2639 const bindings = vnode.dirs || (vnode.dirs = []); 2640 for (let i = 0; i < directives.length; i++) { 2641 let [dir, value, arg, modifiers = EMPTY_OBJ] = directives[i]; 2642 if (dir) { 2643 if (isFunction$1(dir)) { 2644 dir = { 2645 mounted: dir, 2646 updated: dir 2647 }; 2648 } 2649 if (dir.deep) { 2650 traverse(value); 2651 } 2652 bindings.push({ 2653 dir, 2654 instance, 2655 value, 2656 oldValue: void 0, 2657 arg, 2658 modifiers 2659 }); 2660 } 2661 } 2662 return vnode; 2663} 2664function invokeDirectiveHook(vnode, prevVNode, instance, name) { 2665 const bindings = vnode.dirs; 2666 const oldBindings = prevVNode && prevVNode.dirs; 2667 for (let i = 0; i < bindings.length; i++) { 2668 const binding = bindings[i]; 2669 if (oldBindings) { 2670 binding.oldValue = oldBindings[i].value; 2671 } 2672 let hook = binding.dir[name]; 2673 if (hook) { 2674 pauseTracking();
2675 callWithAsyncErrorHandling(hook, instance, 8, [ 2676 vnode.el, 2677 binding, 2678 vnode, 2679 prevVNode 2680 ]); 2681 resetTracking(); 2682 } 2683 } 2684} 2685const TeleportEndKey = Symbol("_vte"); 2686const isTeleport = (type) => type.__isTeleport; 2687const leaveCbKey = Symbol("_leaveCb"); 2688function setTransitionHooks(vnode, hooks) { 2689 if (vnode.shapeFlag & 6 && vnode.component) { 2690 vnode.transition = hooks; 2691 setTransitionHooks(vnode.component.subTree, hooks); 2692 } else if (vnode.shapeFlag & 128) { 2693 vnode.ssContent.transition = hooks.clone(vnode.ssContent); 2694 vnode.ssFallback.transition = hooks.clone(vnode.ssFallback); 2695 } else { 2696 vnode.transition = hooks; 2697 } 2698} 2699// @__NO_SIDE_EFFECTS__ 2700function defineComponent(options, extraOptions) { 2701 return isFunction$1(options) ? ( 2702 // #8236: extend call and options.name access are considered side-effects 2703 // by Rollup, so we have to wrap it in a pure-annotated IIFE. 2704 /* @__PURE__ */ (() => extend({ name: options.name }, extraOptions, { setup: options }))() 2705 ) : options; 2706} 2707function markAsyncBoundary(instance) { 2708 instance.ids = [instance.ids[0] + instance.ids[2]++ + "-", 0, 0]; 2709} 2710const knownTemplateRefs = /* @__PURE__ */ new WeakSet(); 2711const pendingSetRefMap = /* @__PURE__ */ new WeakMap(); 2712function setRef(rawRef, oldRawRef, parentSuspense, vnode, isUnmount = false) { 2713 if (isArray$1(rawRef)) { 2714 rawRef.forEach( 2715 (r, i) => setRef( 2716 r, 2717 oldRawRef && (isArray$1(oldRawRef) ? oldRawRef[i] : oldRawRef), 2718 parentSuspense, 2719 vnode, 2720 isUnmount 2721 ) 2722 ); 2723 return; 2724 } 2725 if (isAsyncWrapper(vnode) && !isUnmount) { 2726 if (vnode.shapeFlag & 512 && vnode.type.__asyncResolved && vnode.component.subTree.component) { 2727 setRef(rawRef, oldRawRef, parentSuspense, vnode.component.subTree); 2728 } 2729 return; 2730 } 2731 const refValue = vnode.shapeFlag & 4 ? getComponentPublicInstance(vnode.component) : vnode.el; 2732 const value = isUnmount ? null : refValue; 2733 const { i: owner, r: ref3 } = rawRef; 2734 if (!!(define_process_env_default$7.NODE_ENV !== "production") && !owner) { 2735 warn$1$1( 2736 `Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function.` 2737 ); 2738 return; 2739 } 2740 const oldRef = oldRawRef && oldRawRef.r; 2741 const refs = owner.refs === EMPTY_OBJ ? owner.refs = {} : owner.refs; 2742 const setupState = owner.setupState; 2743 const rawSetupState = toRaw(setupState); 2744 const canSetSetupRef = setupState === EMPTY_OBJ ? NO : (key) => { 2745 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 2746 if (hasOwn$1(rawSetupState, key) && !isRef(rawSetupState[key])) { 2747 warn$1$1( 2748 `Template ref "${key}" used on a non-ref value. It will not work in the production build.` 2749 ); 2750 } 2751 if (knownTemplateRefs.has(rawSetupState[key])) { 2752 return false; 2753 } 2754 } 2755 return hasOwn$1(rawSetupState, key); 2756 }; 2757 const canSetRef = (ref22) => { 2758 return !!!(define_process_env_default$7.NODE_ENV !== "production") || !knownTemplateRefs.has(ref22); 2759 }; 2760 if (oldRef != null && oldRef !== ref3) { 2761 invalidatePendingSetRef(oldRawRef); 2762 if (isString$2(oldRef)) { 2763 refs[oldRef] = null; 2764 if (canSetSetupRef(oldRef)) { 2765 setupState[oldRef] = null; 2766 } 2767 } else if (isRef(oldRef)) { 2768 if (canSetRef(oldRef)) { 2769 oldRef.value = null; 2770 } 2771 const oldRawRefAtom = oldRawRef; 2772 if (oldRawRefAtom.k) refs[oldRawRefAtom.k] = null; 2773 } 2774 } 2775 if (isFunction$1(ref3)) { 2776 callWithErrorHandling(ref3, owner, 12, [value, refs]); 2777 } else { 2778 const _isString = isString$2(ref3); 2779 const _isRef = isRef(ref3); 2780 if (_isString || _isRef) { 2781 const doSet = () => { 2782 if (rawRef.f) { 2783 const existing = _isString ? canSetSetupRef(ref3) ? setupState[ref3] : refs[ref3] : canSetRef(ref3) || !rawRef.k ? ref3.value : refs[rawRef.k]; 2784 if (isUnmount) { 2785 isArray$1(existing) && remove(existing, refValue); 2786 } else { 2787 if (!isArray$1(existing)) { 2788 if (_isString) { 2789 refs[ref3] = [refValue]; 2790 if (canSetSetupRef(ref3)) { 2791 setupState[ref3] = refs[ref3]; 2792 } 2793 } else { 2794 const newVal = [refValue]; 2795 if (canSetRef(ref3)) { 2796 ref3.value = newVal; 2797 } 2798 if (rawRef.k) refs[rawRef.k] = newVal; 2799 } 2800 } else if (!existing.includes(refValue)) { 2801 existing.push(refValue); 2802 } 2803 } 2804 } else if (_isString) { 2805 refs[ref3] = value; 2806 if (canSetSetupRef(ref3)) { 2807 setupState[ref3] = value; 2808 } 2809 } else if (_isRef) { 2810 if (canSetRef(ref3)) { 2811 ref3.value = value; 2812 } 2813 if (rawRef.k) refs[rawRef.k] = value; 2814 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 2815 warn$1$1("Invalid template ref type:", ref3, `(${typeof ref3})`); 2816 } 2817 }; 2818 if (value) { 2819 const job = () => { 2820 doSet(); 2821 pendingSetRefMap.delete(rawRef); 2822 }; 2823 job.id = -1; 2824 pendingSetRefMap.set(rawRef, job); 2825 queuePostRenderEffect(job, parentSuspense); 2826 } else { 2827 invalidatePendingSetRef(rawRef); 2828 doSet(); 2829 } 2830 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 2831 warn$1$1("Invalid template ref type:", ref3, `(${typeof ref3})`); 2832 } 2833 } 2834}
vendor: 4,868 bytes, lines 2835-2976
2835function invalidatePendingSetRef(rawRef) { 2836 const pendingSetRef = pendingSetRefMap.get(rawRef); 2837 if (pendingSetRef) { 2838 pendingSetRef.flags |= 8; 2839 pendingSetRefMap.delete(rawRef); 2840 } 2841} 2842getGlobalThis$1().requestIdleCallback || ((cb) => setTimeout(cb, 1)); 2843getGlobalThis$1().cancelIdleCallback || ((id) => clearTimeout(id)); 2844const isAsyncWrapper = (i) => !!i.type.__asyncLoader; 2845const isKeepAlive = (vnode) => vnode.type.__isKeepAlive; 2846function onActivated(hook, target) { 2847 registerKeepAliveHook(hook, "a", target); 2848} 2849function onDeactivated(hook, target) { 2850 registerKeepAliveHook(hook, "da", target); 2851} 2852function registerKeepAliveHook(hook, type, target = currentInstance$1) { 2853 const wrappedHook = hook.__wdc || (hook.__wdc = () => { 2854 let current = target; 2855 while (current) { 2856 if (current.isDeactivated) { 2857 return; 2858 } 2859 current = current.parent; 2860 } 2861 return hook(); 2862 }); 2863 injectHook(type, wrappedHook, target); 2864 if (target) { 2865 let current = target.parent; 2866 while (current && current.parent) { 2867 if (isKeepAlive(current.parent.vnode)) { 2868 injectToKeepAliveRoot(wrappedHook, type, target, current); 2869 } 2870 current = current.parent; 2871 } 2872 } 2873} 2874function injectToKeepAliveRoot(hook, type, target, keepAliveRoot) { 2875 const injected = injectHook( 2876 type, 2877 hook, 2878 keepAliveRoot, 2879 true 2880 /* prepend */ 2881 ); 2882 onUnmounted(() => { 2883 remove(keepAliveRoot[type], injected); 2884 }, target); 2885} 2886function injectHook(type, hook, target = currentInstance$1, prepend = false) { 2887 if (target) { 2888 const hooks = target[type] || (target[type] = []); 2889 const wrappedHook = hook.__weh || (hook.__weh = (...args) => { 2890 pauseTracking(); 2891 const reset = setCurrentInstance(target); 2892 const res = callWithAsyncErrorHandling(hook, target, type, args); 2893 reset(); 2894 resetTracking(); 2895 return res; 2896 }); 2897 if (prepend) { 2898 hooks.unshift(wrappedHook); 2899 } else { 2900 hooks.push(wrappedHook); 2901 } 2902 return wrappedHook; 2903 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 2904 const apiName = toHandlerKey(ErrorTypeStrings$1[type].replace(/ hook$/, "")); 2905 warn$1$1( 2906 `${apiName} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.` 2907 ); 2908 } 2909} 2910const createHook = (lifecycle) => (hook, target = currentInstance$1) => { 2911 if (!isInSSRComponentSetup || lifecycle === "sp") { 2912 injectHook(lifecycle, (...args) => hook(...args), target); 2913 } 2914}; 2915const onBeforeMount = createHook("bm"); 2916const onMounted = createHook("m"); 2917const onBeforeUpdate = createHook( 2918 "bu" 2919); 2920const onUpdated = createHook("u"); 2921const onBeforeUnmount = createHook( 2922 "bum" 2923); 2924const onUnmounted = createHook("um"); 2925const onServerPrefetch = createHook( 2926 "sp" 2927); 2928const onRenderTriggered = createHook("rtg"); 2929const onRenderTracked = createHook("rtc"); 2930function onErrorCaptured(hook, target = currentInstance$1) { 2931 injectHook("ec", hook, target); 2932} 2933const COMPONENTS = "components"; 2934function resolveComponent(name, maybeSelfReference) { 2935 return resolveAsset(COMPONENTS, name, true, maybeSelfReference) || name; 2936} 2937const NULL_DYNAMIC_COMPONENT = Symbol.for("v-ndc"); 2938function resolveAsset(type, name, warnMissing = true, maybeSelfReference = false) { 2939 const instance = currentRenderingInstance || currentInstance$1; 2940 if (instance) { 2941 const Component = instance.type; 2942 { 2943 const selfName = getComponentName( 2944 Component, 2945 false 2946 ); 2947 if (selfName && (selfName === name || selfName === camelize(name) || selfName === capitalize$1(camelize(name)))) { 2948 return Component; 2949 } 2950 } 2951 const res = ( 2952 // local registration 2953 // check instance[type] first which is resolved for options API 2954 resolve(instance[type] || Component[type], name) || // global registration 2955 resolve(instance.appContext[type], name) 2956 ); 2957 if (!res && maybeSelfReference) { 2958 return Component; 2959 } 2960 if (!!(define_process_env_default$7.NODE_ENV !== "production") && warnMissing && !res) { 2961 const extra = ` 2962If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.`; 2963 warn$1$1(`Failed to resolve ${type.slice(0, -1)}: ${name}${extra}`); 2964 } 2965 return res; 2966 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 2967 warn$1$1( 2968 `resolve${capitalize$1(type.slice(0, -1))} can only be used in render() or setup().` 2969 ); 2970 } 2971} 2972function resolve(registry, name) { 2973 return registry && (registry[name] || registry[camelize(name)] || registry[capitalize$1(camelize(name))]); 2974} 2975function renderList(source, renderItem, cache2, index) { 2976 let ret;
2977 const cached = cache2; 2978 const sourceIsArray = isArray$1(source); 2979 if (sourceIsArray || isString$2(source)) { 2980 const sourceIsReactiveArray = sourceIsArray && isReactive(source); 2981 let needsWrap = false; 2982 let isReadonlySource = false; 2983 if (sourceIsReactiveArray) { 2984 needsWrap = !isShallow(source); 2985 isReadonlySource = isReadonly(source); 2986 source = shallowReadArray(source); 2987 } 2988 ret = new Array(source.length); 2989 for (let i = 0, l = source.length; i < l; i++) { 2990 ret[i] = renderItem( 2991 needsWrap ? isReadonlySource ? toReadonly(toReactive(source[i])) : toReactive(source[i]) : source[i], 2992 i, 2993 void 0, 2994 cached 2995 ); 2996 } 2997 } else if (typeof source === "number") { 2998 if (!!(define_process_env_default$7.NODE_ENV !== "production") && !Number.isInteger(source)) { 2999 warn$1$1(`The v-for range expect an integer value but got ${source}.`); 3000 } 3001 ret = new Array(source); 3002 for (let i = 0; i < source; i++) { 3003 ret[i] = renderItem(i + 1, i, void 0, cached); 3004 } 3005 } else if (isObject$3(source)) { 3006 if (source[Symbol.iterator]) { 3007 ret = Array.from( 3008 source, 3009 (item, i) => renderItem(item, i, void 0, cached) 3010 ); 3011 } else { 3012 const keys = Object.keys(source); 3013 ret = new Array(keys.length); 3014 for (let i = 0, l = keys.length; i < l; i++) { 3015 const key = keys[i]; 3016 ret[i] = renderItem(source[key], key, i, cached); 3017 } 3018 } 3019 } else { 3020 ret = []; 3021 } 3022 return ret; 3023} 3024const getPublicInstance = (i) => { 3025 if (!i) return null; 3026 if (isStatefulComponent(i)) return getComponentPublicInstance(i); 3027 return getPublicInstance(i.parent); 3028}; 3029const publicPropertiesMap = ( 3030 // Move PURE marker to new line to workaround compiler discarding it 3031 // due to type annotation 3032 /* @__PURE__ */ extend(/* @__PURE__ */ Object.create(null), { 3033 $: (i) => i, 3034 $el: (i) => i.vnode.el, 3035 $data: (i) => i.data, 3036 $props: (i) => !!(define_process_env_default$7.NODE_ENV !== "production") ? shallowReadonly(i.props) : i.props, 3037 $attrs: (i) => !!(define_process_env_default$7.NODE_ENV !== "production") ? shallowReadonly(i.attrs) : i.attrs, 3038 $slots: (i) => !!(define_process_env_default$7.NODE_ENV !== "production") ? shallowReadonly(i.slots) : i.slots, 3039 $refs: (i) => !!(define_process_env_default$7.NODE_ENV !== "production") ? shallowReadonly(i.refs) : i.refs, 3040 $parent: (i) => getPublicInstance(i.parent), 3041 $root: (i) => getPublicInstance(i.root), 3042 $host: (i) => i.ce, 3043 $emit: (i) => i.emit, 3044 $options: (i) => resolveMergedOptions(i), 3045 $forceUpdate: (i) => i.f || (i.f = () => { 3046 queueJob(i.update); 3047 }), 3048 $nextTick: (i) => i.n || (i.n = nextTick.bind(i.proxy)), 3049 $watch: (i) => instanceWatch.bind(i) 3050 }) 3051); 3052const isReservedPrefix = (key) => key === "_" || key === "$"; 3053const hasSetupBinding = (state, key) => state !== EMPTY_OBJ && !state.__isScriptSetup && hasOwn$1(state, key); 3054const PublicInstanceProxyHandlers = { 3055 get({ _: instance }, key) { 3056 if (key === "__v_skip") { 3057 return true; 3058 } 3059 const { ctx, setupState, data, props, accessCache, type, appContext } = instance; 3060 if (!!(define_process_env_default$7.NODE_ENV !== "production") && key === "__isVue") { 3061 return true; 3062 } 3063 let normalizedProps; 3064 if (key[0] !== "$") { 3065 const n = accessCache[key]; 3066 if (n !== void 0) { 3067 switch (n) { 3068 case 1: 3069 return setupState[key]; 3070 case 2: 3071 return data[key]; 3072 case 4: 3073 return ctx[key]; 3074 case 3: 3075 return props[key]; 3076 } 3077 } else if (hasSetupBinding(setupState, key)) { 3078 accessCache[key] = 1; 3079 return setupState[key]; 3080 } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) { 3081 accessCache[key] = 2; 3082 return data[key]; 3083 } else if ( 3084 // only cache other properties when instance has declared (thus stable) 3085 // props 3086 (normalizedProps = instance.propsOptions[0]) && hasOwn$1(normalizedProps, key) 3087 ) { 3088 accessCache[key] = 3; 3089 return props[key]; 3090 } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) { 3091 accessCache[key] = 4; 3092 return ctx[key]; 3093 } else if (shouldCacheAccess) { 3094 accessCache[key] = 0; 3095 } 3096 } 3097 const publicGetter = publicPropertiesMap[key];
3098 let cssModule, globalProperties; 3099 if (publicGetter) { 3100 if (key === "$attrs") { 3101 track(instance.attrs, "get", ""); 3102 !!(define_process_env_default$7.NODE_ENV !== "production") && markAttrsAccessed(); 3103 } else if (!!(define_process_env_default$7.NODE_ENV !== "production") && key === "$slots") { 3104 track(instance, "get", key); 3105 } 3106 return publicGetter(instance); 3107 } else if ( 3108 // css module (injected by vue-loader) 3109 (cssModule = type.__cssModules) && (cssModule = cssModule[key]) 3110 ) { 3111 return cssModule; 3112 } else if (ctx !== EMPTY_OBJ && hasOwn$1(ctx, key)) { 3113 accessCache[key] = 4; 3114 return ctx[key]; 3115 } else if ( 3116 // global properties 3117 globalProperties = appContext.config.globalProperties, hasOwn$1(globalProperties, key) 3118 ) { 3119 { 3120 return globalProperties[key]; 3121 } 3122 } else if (!!(define_process_env_default$7.NODE_ENV !== "production") && currentRenderingInstance && (!isString$2(key) || // #1091 avoid internal isRef/isVNode checks on component instance leading 3123 // to infinite warning loop 3124 key.indexOf("__v") !== 0)) { 3125 if (data !== EMPTY_OBJ && isReservedPrefix(key[0]) && hasOwn$1(data, key)) { 3126 warn$1$1( 3127 `Property ${JSON.stringify( 3128 key 3129 )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.` 3130 ); 3131 } else if (instance === currentRenderingInstance) { 3132 warn$1$1( 3133 `Property ${JSON.stringify(key)} was accessed during render but is not defined on instance.` 3134 ); 3135 } 3136 } 3137 }, 3138 set({ _: instance }, key, value) { 3139 const { data, setupState, ctx } = instance; 3140 if (hasSetupBinding(setupState, key)) { 3141 setupState[key] = value; 3142 return true; 3143 } else if (!!(define_process_env_default$7.NODE_ENV !== "production") && setupState.__isScriptSetup && hasOwn$1(setupState, key)) { 3144 warn$1$1(`Cannot mutate <script setup> binding "${key}" from Options API.`); 3145 return false; 3146 } else if (data !== EMPTY_OBJ && hasOwn$1(data, key)) { 3147 data[key] = value; 3148 return true; 3149 } else if (hasOwn$1(instance.props, key)) { 3150 !!(define_process_env_default$7.NODE_ENV !== "production") && warn$1$1(`Attempting to mutate prop "${key}". Props are readonly.`); 3151 return false; 3152 } 3153 if (key[0] === "$" && key.slice(1) in instance) { 3154 !!(define_process_env_default$7.NODE_ENV !== "production") && warn$1$1( 3155 `Attempting to mutate public property "${key}". Properties starting with $ are reserved and readonly.` 3156 ); 3157 return false; 3158 } else { 3159 if (!!(define_process_env_default$7.NODE_ENV !== "production") && key in instance.appContext.config.globalProperties) { 3160 Object.defineProperty(ctx, key, { 3161 enumerable: true, 3162 configurable: true, 3163 value 3164 }); 3165 } else { 3166 ctx[key] = value; 3167 } 3168 } 3169 return true; 3170 }, 3171 has({ 3172 _: { data, setupState, accessCache, ctx, appContext, propsOptions, type } 3173 }, key) { 3174 let normalizedProps, cssModules; 3175 return !!(accessCache[key] || data !== EMPTY_OBJ && key[0] !== "$" && hasOwn$1(data, key) || hasSetupBinding(setupState, key) || (normalizedProps = propsOptions[0]) && hasOwn$1(normalizedProps, key) || hasOwn$1(ctx, key) || hasOwn$1(publicPropertiesMap, key) || hasOwn$1(appContext.config.globalProperties, key) || (cssModules = type.__cssModules) && cssModules[key]); 3176 }, 3177 defineProperty(target, key, descriptor) { 3178 if (descriptor.get != null) { 3179 target._.accessCache[key] = 0; 3180 } else if (hasOwn$1(descriptor, "value")) { 3181 this.set(target, key, descriptor.value, null); 3182 } 3183 return Reflect.defineProperty(target, key, descriptor); 3184 } 3185}; 3186if (!!(define_process_env_default$7.NODE_ENV !== "production") && true) { 3187 PublicInstanceProxyHandlers.ownKeys = (target) => { 3188 warn$1$1( 3189 `Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead.` 3190 ); 3191 return Reflect.ownKeys(target); 3192 }; 3193} 3194function createDevRenderContext(instance) { 3195 const target = {}; 3196 Object.defineProperty(target, `_`, { 3197 configurable: true, 3198 enumerable: false, 3199 get: () => instance 3200 });
vendor: 5,736 bytes, lines 3201-3383
3201 Object.keys(publicPropertiesMap).forEach((key) => { 3202 Object.defineProperty(target, key, { 3203 configurable: true, 3204 enumerable: false, 3205 get: () => publicPropertiesMap[key](instance), 3206 // intercepted by the proxy so no need for implementation, 3207 // but needed to prevent set errors 3208 set: NOOP 3209 }); 3210 }); 3211 return target; 3212} 3213function exposePropsOnRenderContext(instance) { 3214 const { 3215 ctx, 3216 propsOptions: [propsOptions] 3217 } = instance; 3218 if (propsOptions) { 3219 Object.keys(propsOptions).forEach((key) => { 3220 Object.defineProperty(ctx, key, { 3221 enumerable: true, 3222 configurable: true, 3223 get: () => instance.props[key], 3224 set: NOOP 3225 }); 3226 }); 3227 } 3228} 3229function exposeSetupStateOnRenderContext(instance) { 3230 const { ctx, setupState } = instance; 3231 Object.keys(toRaw(setupState)).forEach((key) => { 3232 if (!setupState.__isScriptSetup) { 3233 if (isReservedPrefix(key[0])) { 3234 warn$1$1( 3235 `setup() return property ${JSON.stringify( 3236 key 3237 )} should not start with "$" or "_" which are reserved prefixes for Vue internals.` 3238 ); 3239 return; 3240 } 3241 Object.defineProperty(ctx, key, { 3242 enumerable: true, 3243 configurable: true, 3244 get: () => setupState[key], 3245 set: NOOP 3246 }); 3247 } 3248 }); 3249} 3250function normalizePropsOrEmits(props) { 3251 return isArray$1(props) ? props.reduce( 3252 (normalized, p2) => (normalized[p2] = null, normalized), 3253 {} 3254 ) : props; 3255} 3256function createDuplicateChecker() { 3257 const cache2 = /* @__PURE__ */ Object.create(null); 3258 return (type, key) => { 3259 if (cache2[key]) { 3260 warn$1$1(`${type} property "${key}" is already defined in ${cache2[key]}.`); 3261 } else { 3262 cache2[key] = type; 3263 } 3264 }; 3265} 3266let shouldCacheAccess = true; 3267function applyOptions(instance) { 3268 const options = resolveMergedOptions(instance); 3269 const publicThis = instance.proxy; 3270 const ctx = instance.ctx; 3271 shouldCacheAccess = false; 3272 if (options.beforeCreate) { 3273 callHook(options.beforeCreate, instance, "bc"); 3274 } 3275 const { 3276 // state 3277 data: dataOptions, 3278 computed: computedOptions, 3279 methods, 3280 watch: watchOptions, 3281 provide: provideOptions, 3282 inject: injectOptions, 3283 // lifecycle 3284 created, 3285 beforeMount, 3286 mounted, 3287 beforeUpdate, 3288 updated, 3289 activated, 3290 deactivated, 3291 beforeDestroy, 3292 beforeUnmount, 3293 destroyed, 3294 unmounted, 3295 render: render2, 3296 renderTracked, 3297 renderTriggered, 3298 errorCaptured, 3299 serverPrefetch, 3300 // public API 3301 expose, 3302 inheritAttrs, 3303 // assets 3304 components, 3305 directives, 3306 filters 3307 } = options; 3308 const checkDuplicateProperties = !!(define_process_env_default$7.NODE_ENV !== "production") ? createDuplicateChecker() : null; 3309 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3310 const [propsOptions] = instance.propsOptions; 3311 if (propsOptions) { 3312 for (const key in propsOptions) { 3313 checkDuplicateProperties("Props", key); 3314 } 3315 } 3316 } 3317 if (injectOptions) { 3318 resolveInjections(injectOptions, ctx, checkDuplicateProperties); 3319 } 3320 if (methods) { 3321 for (const key in methods) { 3322 const methodHandler = methods[key]; 3323 if (isFunction$1(methodHandler)) { 3324 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3325 Object.defineProperty(ctx, key, { 3326 value: methodHandler.bind(publicThis), 3327 configurable: true, 3328 enumerable: true, 3329 writable: true 3330 }); 3331 } else { 3332 ctx[key] = methodHandler.bind(publicThis); 3333 } 3334 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3335 checkDuplicateProperties("Methods", key); 3336 } 3337 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3338 warn$1$1( 3339 `Method "${key}" has type "${typeof methodHandler}" in the component definition. Did you reference the function correctly?` 3340 ); 3341 } 3342 } 3343 } 3344 if (dataOptions) { 3345 if (!!(define_process_env_default$7.NODE_ENV !== "production") && !isFunction$1(dataOptions)) { 3346 warn$1$1( 3347 `The data option must be a function. Plain object usage is no longer supported.` 3348 ); 3349 } 3350 const data = dataOptions.call(publicThis, publicThis); 3351 if (!!(define_process_env_default$7.NODE_ENV !== "production") && isPromise$2(data)) { 3352 warn$1$1( 3353 `data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>.` 3354 ); 3355 } 3356 if (!isObject$3(data)) { 3357 !!(define_process_env_default$7.NODE_ENV !== "production") && warn$1$1(`data() should return an object.`); 3358 } else { 3359 instance.data = reactive(data); 3360 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3361 for (const key in data) { 3362 checkDuplicateProperties("Data", key); 3363 if (!isReservedPrefix(key[0])) { 3364 Object.defineProperty(ctx, key, { 3365 configurable: true, 3366 enumerable: true, 3367 get: () => data[key], 3368 set: NOOP 3369 }); 3370 } 3371 } 3372 } 3373 } 3374 } 3375 shouldCacheAccess = true; 3376 if (computedOptions) { 3377 for (const key in computedOptions) { 3378 const opt = computedOptions[key]; 3379 const get = isFunction$1(opt) ? opt.bind(publicThis, publicThis) : isFunction$1(opt.get) ? opt.get.bind(publicThis, publicThis) : NOOP; 3380 if (!!(define_process_env_default$7.NODE_ENV !== "production") && get === NOOP) { 3381 warn$1$1(`Computed property "${key}" has no getter.`); 3382 } 3383 const set2 = !isFunction$1(opt) && isFunction$1(opt.set) ? opt.set.bind(publicThis) : !!(def
vendor: 5,070 bytes, lines 3383-3541
3383ine_process_env_default$7.NODE_ENV !== "production") ? () => { 3384 warn$1$1( 3385 `Write operation failed: computed property "${key}" is readonly.` 3386 ); 3387 } : NOOP; 3388 const c = computed({ 3389 get, 3390 set: set2 3391 }); 3392 Object.defineProperty(ctx, key, { 3393 enumerable: true, 3394 configurable: true, 3395 get: () => c.value, 3396 set: (v) => c.value = v 3397 }); 3398 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3399 checkDuplicateProperties("Computed", key); 3400 } 3401 } 3402 } 3403 if (watchOptions) { 3404 for (const key in watchOptions) { 3405 createWatcher(watchOptions[key], ctx, publicThis, key); 3406 } 3407 } 3408 if (provideOptions) { 3409 const provides = isFunction$1(provideOptions) ? provideOptions.call(publicThis) : provideOptions; 3410 Reflect.ownKeys(provides).forEach((key) => { 3411 provide(key, provides[key]); 3412 }); 3413 } 3414 if (created) { 3415 callHook(created, instance, "c"); 3416 } 3417 function registerLifecycleHook(register, hook) { 3418 if (isArray$1(hook)) { 3419 hook.forEach((_hook) => register(_hook.bind(publicThis))); 3420 } else if (hook) { 3421 register(hook.bind(publicThis)); 3422 } 3423 } 3424 registerLifecycleHook(onBeforeMount, beforeMount); 3425 registerLifecycleHook(onMounted, mounted); 3426 registerLifecycleHook(onBeforeUpdate, beforeUpdate); 3427 registerLifecycleHook(onUpdated, updated); 3428 registerLifecycleHook(onActivated, activated); 3429 registerLifecycleHook(onDeactivated, deactivated); 3430 registerLifecycleHook(onErrorCaptured, errorCaptured); 3431 registerLifecycleHook(onRenderTracked, renderTracked); 3432 registerLifecycleHook(onRenderTriggered, renderTriggered); 3433 registerLifecycleHook(onBeforeUnmount, beforeUnmount); 3434 registerLifecycleHook(onUnmounted, unmounted); 3435 registerLifecycleHook(onServerPrefetch, serverPrefetch); 3436 if (isArray$1(expose)) { 3437 if (expose.length) { 3438 const exposed = instance.exposed || (instance.exposed = {}); 3439 expose.forEach((key) => { 3440 Object.defineProperty(exposed, key, { 3441 get: () => publicThis[key], 3442 set: (val) => publicThis[key] = val, 3443 enumerable: true 3444 }); 3445 }); 3446 } else if (!instance.exposed) { 3447 instance.exposed = {}; 3448 } 3449 } 3450 if (render2 && instance.render === NOOP) { 3451 instance.render = render2; 3452 } 3453 if (inheritAttrs != null) { 3454 instance.inheritAttrs = inheritAttrs; 3455 } 3456 if (components) instance.components = components; 3457 if (directives) instance.directives = directives; 3458 if (serverPrefetch) { 3459 markAsyncBoundary(instance); 3460 } 3461} 3462function resolveInjections(injectOptions, ctx, checkDuplicateProperties = NOOP) { 3463 if (isArray$1(injectOptions)) { 3464 injectOptions = normalizeInject(injectOptions); 3465 } 3466 for (const key in injectOptions) { 3467 const opt = injectOptions[key]; 3468 let injected; 3469 if (isObject$3(opt)) { 3470 if ("default" in opt) { 3471 injected = inject( 3472 opt.from || key, 3473 opt.default, 3474 true 3475 ); 3476 } else { 3477 injected = inject(opt.from || key); 3478 } 3479 } else { 3480 injected = inject(opt); 3481 } 3482 if (isRef(injected)) { 3483 Object.defineProperty(ctx, key, { 3484 enumerable: true, 3485 configurable: true, 3486 get: () => injected.value, 3487 set: (v) => injected.value = v 3488 }); 3489 } else { 3490 ctx[key] = injected; 3491 } 3492 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3493 checkDuplicateProperties("Inject", key); 3494 } 3495 } 3496} 3497function callHook(hook, instance, type) { 3498 callWithAsyncErrorHandling( 3499 isArray$1(hook) ? hook.map((h2) => h2.bind(instance.proxy)) : hook.bind(instance.proxy), 3500 instance, 3501 type 3502 ); 3503} 3504function createWatcher(raw, ctx, publicThis, key) { 3505 let getter = key.includes(".") ? createPathGetter(publicThis, key) : () => publicThis[key]; 3506 if (isString$2(raw)) { 3507 const handler = ctx[raw]; 3508 if (isFunction$1(handler)) { 3509 { 3510 watch(getter, handler); 3511 } 3512 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3513 warn$1$1(`Invalid watch handler specified by key "${raw}"`, handler); 3514 } 3515 } else if (isFunction$1(raw)) { 3516 { 3517 watch(getter, raw.bind(publicThis)); 3518 } 3519 } else if (isObject$3(raw)) { 3520 if (isArray$1(raw)) { 3521 raw.forEach((r) => createWatcher(r, ctx, publicThis, key)); 3522 } else { 3523 const handler = isFunction$1(raw.handler) ? raw.handler.bind(publicThis) : ctx[raw.handler]; 3524 if (isFunction$1(handler)) { 3525 watch(getter, handler, raw); 3526 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3527 warn$1$1(`Invalid watch handler specified by key "${raw.handler}"`, handler); 3528 } 3529 } 3530 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3531 warn$1$1(`Invalid watch option: "${key}"`, raw); 3532 } 3533} 3534function resolveMergedOptions(instance) { 3535 const base = instance.type; 3536 const { mixins, extends: extendsOptions } = base; 3537 const { 3538 mixins: globalMixins, 3539 optionsCache: cache2, 3540 config: { optionMergeStrategies } 3541 } = instance.appContext;
vendor: 3,035 bytes, lines 3542-3655
3542 const cached = cache2.get(base); 3543 let resolved; 3544 if (cached) { 3545 resolved = cached; 3546 } else if (!globalMixins.length && !mixins && !extendsOptions) { 3547 { 3548 resolved = base; 3549 } 3550 } else { 3551 resolved = {}; 3552 if (globalMixins.length) { 3553 globalMixins.forEach( 3554 (m) => mergeOptions(resolved, m, optionMergeStrategies, true) 3555 ); 3556 } 3557 mergeOptions(resolved, base, optionMergeStrategies); 3558 } 3559 if (isObject$3(base)) { 3560 cache2.set(base, resolved); 3561 } 3562 return resolved; 3563} 3564function mergeOptions(to, from, strats, asMixin = false) { 3565 const { mixins, extends: extendsOptions } = from; 3566 if (extendsOptions) { 3567 mergeOptions(to, extendsOptions, strats, true); 3568 } 3569 if (mixins) { 3570 mixins.forEach( 3571 (m) => mergeOptions(to, m, strats, true) 3572 ); 3573 } 3574 for (const key in from) { 3575 if (asMixin && key === "expose") { 3576 !!(define_process_env_default$7.NODE_ENV !== "production") && warn$1$1( 3577 `"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.` 3578 ); 3579 } else { 3580 const strat = internalOptionMergeStrats[key] || strats && strats[key]; 3581 to[key] = strat ? strat(to[key], from[key]) : from[key]; 3582 } 3583 } 3584 return to; 3585} 3586const internalOptionMergeStrats = { 3587 data: mergeDataFn, 3588 props: mergeEmitsOrPropsOptions, 3589 emits: mergeEmitsOrPropsOptions, 3590 // objects 3591 methods: mergeObjectOptions, 3592 computed: mergeObjectOptions, 3593 // lifecycle 3594 beforeCreate: mergeAsArray, 3595 created: mergeAsArray, 3596 beforeMount: mergeAsArray, 3597 mounted: mergeAsArray, 3598 beforeUpdate: mergeAsArray, 3599 updated: mergeAsArray, 3600 beforeDestroy: mergeAsArray, 3601 beforeUnmount: mergeAsArray, 3602 destroyed: mergeAsArray, 3603 unmounted: mergeAsArray, 3604 activated: mergeAsArray, 3605 deactivated: mergeAsArray, 3606 errorCaptured: mergeAsArray, 3607 serverPrefetch: mergeAsArray, 3608 // assets 3609 components: mergeObjectOptions, 3610 directives: mergeObjectOptions, 3611 // watch 3612 watch: mergeWatchOptions, 3613 // provide / inject 3614 provide: mergeDataFn, 3615 inject: mergeInject 3616}; 3617function mergeDataFn(to, from) { 3618 if (!from) { 3619 return to; 3620 } 3621 if (!to) { 3622 return from; 3623 } 3624 return function mergedDataFn() { 3625 return extend( 3626 isFunction$1(to) ? to.call(this, this) : to, 3627 isFunction$1(from) ? from.call(this, this) : from 3628 ); 3629 }; 3630} 3631function mergeInject(to, from) { 3632 return mergeObjectOptions(normalizeInject(to), normalizeInject(from)); 3633} 3634function normalizeInject(raw) { 3635 if (isArray$1(raw)) { 3636 const res = {}; 3637 for (let i = 0; i < raw.length; i++) { 3638 res[raw[i]] = raw[i]; 3639 } 3640 return res; 3641 } 3642 return raw; 3643} 3644function mergeAsArray(to, from) { 3645 return to ? [...new Set([].concat(to, from))] : from; 3646} 3647function mergeObjectOptions(to, from) { 3648 return to ? extend(/* @__PURE__ */ Object.create(null), to, from) : from; 3649} 3650function mergeEmitsOrPropsOptions(to, from) { 3651 if (to) { 3652 if (isArray$1(to) && isArray$1(from)) { 3653 return [.../* @__PURE__ */ new Set([...to, ...from])]; 3654 } 3655 return extend(
vendor: 69,485 bytes, lines 3656-5812
3656 /* @__PURE__ */ Object.create(null), 3657 normalizePropsOrEmits(to), 3658 normalizePropsOrEmits(from != null ? from : {}) 3659 ); 3660 } else { 3661 return from; 3662 } 3663} 3664function mergeWatchOptions(to, from) { 3665 if (!to) return from; 3666 if (!from) return to; 3667 const merged = extend(/* @__PURE__ */ Object.create(null), to); 3668 for (const key in from) { 3669 merged[key] = mergeAsArray(to[key], from[key]); 3670 } 3671 return merged; 3672} 3673function createAppContext() { 3674 return { 3675 app: null, 3676 config: { 3677 isNativeTag: NO, 3678 performance: false, 3679 globalProperties: {}, 3680 optionMergeStrategies: {}, 3681 errorHandler: void 0, 3682 warnHandler: void 0, 3683 compilerOptions: {} 3684 }, 3685 mixins: [], 3686 components: {}, 3687 directives: {}, 3688 provides: /* @__PURE__ */ Object.create(null), 3689 optionsCache: /* @__PURE__ */ new WeakMap(), 3690 propsCache: /* @__PURE__ */ new WeakMap(), 3691 emitsCache: /* @__PURE__ */ new WeakMap() 3692 }; 3693} 3694let uid$1 = 0; 3695function createAppAPI(render2, hydrate) { 3696 return function createApp2(rootComponent, rootProps = null) { 3697 if (!isFunction$1(rootComponent)) { 3698 rootComponent = extend({}, rootComponent); 3699 } 3700 if (rootProps != null && !isObject$3(rootProps)) { 3701 !!(define_process_env_default$7.NODE_ENV !== "production") && warn$1$1(`root props passed to app.mount() must be an object.`); 3702 rootProps = null; 3703 } 3704 const context = createAppContext(); 3705 const installedPlugins = /* @__PURE__ */ new WeakSet(); 3706 const pluginCleanupFns = []; 3707 let isMounted = false; 3708 const app = context.app = { 3709 _uid: uid$1++, 3710 _component: rootComponent, 3711 _props: rootProps, 3712 _container: null, 3713 _context: context, 3714 _instance: null, 3715 version, 3716 get config() { 3717 return context.config; 3718 }, 3719 set config(v) { 3720 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3721 warn$1$1( 3722 `app.config cannot be replaced. Modify individual options instead.` 3723 ); 3724 } 3725 }, 3726 use(plugin, ...options) { 3727 if (installedPlugins.has(plugin)) { 3728 !!(define_process_env_default$7.NODE_ENV !== "production") && warn$1$1(`Plugin has already been applied to target app.`); 3729 } else if (plugin && isFunction$1(plugin.install)) { 3730 installedPlugins.add(plugin); 3731 plugin.install(app, ...options); 3732 } else if (isFunction$1(plugin)) { 3733 installedPlugins.add(plugin); 3734 plugin(app, ...options); 3735 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3736 warn$1$1( 3737 `A plugin must either be a function or an object with an "install" function.` 3738 ); 3739 } 3740 return app; 3741 }, 3742 mixin(mixin2) { 3743 { 3744 if (!context.mixins.includes(mixin2)) { 3745 context.mixins.push(mixin2); 3746 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3747 warn$1$1( 3748 "Mixin has already been applied to target app" + (mixin2.name ? `: ${mixin2.name}` : "") 3749 ); 3750 } 3751 } 3752 return app; 3753 }, 3754 component(name, component) { 3755 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3756 validateComponentName(name, context.config); 3757 } 3758 if (!component) { 3759 return context.components[name]; 3760 } 3761 if (!!(define_process_env_default$7.NODE_ENV !== "production") && context.components[name]) { 3762 warn$1$1(`Component "${name}" has already been registered in target app.`); 3763 } 3764 context.components[name] = component; 3765 return app; 3766 }, 3767 directive(name, directive) { 3768 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3769 validateDirectiveName(name); 3770 } 3771 if (!directive) { 3772 return context.directives[name]; 3773 } 3774 if (!!(define_process_env_default$7.NODE_ENV !== "production") && context.directives[name]) { 3775 warn$1$1(`Directive "${name}" has already been registered in target app.`); 3776 } 3777 context.directives[name] = directive; 3778 return app; 3779 }, 3780 mount(rootContainer, isHydrate, namespace) { 3781 if (!isMounted) { 3782 if (!!(define_process_env_default$7.NODE_ENV !== "production") && rootContainer.__vue_app__) { 3783 warn$1$1( 3784 `There is already an app instance mounted on the host container. 3785 If you want to mount another app on the same host container, you need to unmount the previous app by calling \`app.unmount()\` first.` 3786 ); 3787 } 3788 const vnode = app._ceVNode || createVNode(rootComponent, rootProps); 3789 vnode.appContext = context; 3790 if (namespace === true) { 3791 namespace = "svg"; 3792 } else if (namespace === false) { 3793 namespace = void 0; 3794 } 3795 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3796 context.reload = () => { 3797 const cloned = cloneVNode(vnode); 3798 cloned.el = null; 3799 render2(cloned, rootContainer, namespace); 3800 }; 3801 } 3802 { 3803 render2(vnode, rootContainer, namespace); 3804 } 3805 isMounted = true; 3806 app._container = rootContainer; 3807 rootContainer.__vue_app__ = app; 3808 if (!!(define_process_env_default$7.NODE_ENV !== "production") || false) { 3809 app._instance = vnode.component; 3810 devtoolsInitApp(app, version); 3811 } 3812 return getComponentPublicInstance(vnode.component); 3813 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3814 warn$1$1( 3815 `App has already been mounted. 3816If you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. \`const createMyApp = () => createApp(App)\`` 3817 ); 3818 } 3819 }, 3820 onUnmount(cleanupFn) { 3821 if (!!(define_process_env_default$7.NODE_ENV !== "production") && typeof cleanupFn !== "function") { 3822 warn$1$1( 3823 `Expected function as first argument to app.onUnmount(), but got ${typeof cleanupFn}` 3824 ); 3825 } 3826 pluginCleanupFns.push(cleanupFn); 3827 }, 3828 unmount() { 3829 if (isMounted) { 3830 callWithAsyncErrorHandling( 3831 pluginCleanupFns, 3832 app._instance, 3833 16 3834 ); 3835 render2(null, app._container); 3836 if (!!(define_process_env_default$7.NODE_ENV !== "production") || false) { 3837 app._instance = null; 3838 devtoolsUnmountApp(app); 3839 } 3840 delete app._container.__vue_app__; 3841 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3842 warn$1$1(`Cannot unmount an app that is not mounted.`); 3843 } 3844 }, 3845 provide(key, value) { 3846 if (!!(define_process_env_default$7.NODE_ENV !== "production") && key in context.provides) { 3847 if (hasOwn$1(context.provides, key)) { 3848 warn$1$1( 3849 `App already provides property with key "${String(key)}". It will be overwritten with the new value.` 3850 ); 3851 } else { 3852 warn$1$1( 3853 `App already provides property with key "${String(key)}" inherited from its parent element. It will be overwritten with the new value.` 3854 ); 3855 } 3856 } 3857 context.provides[key] = value; 3858 return app; 3859 }, 3860 runWithContext(fn) { 3861 const lastApp = currentApp; 3862 currentApp = app; 3863 try { 3864 return fn(); 3865 } finally { 3866 currentApp = lastApp; 3867 } 3868 } 3869 }; 3870 return app; 3871 }; 3872} 3873let currentApp = null; 3874function provide(key, value) { 3875 if (!currentInstance$1) { 3876 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3877 warn$1$1(`provide() can only be used inside setup().`); 3878 } 3879 } else { 3880 let provides = currentInstance$1.provides; 3881 const parentProvides = currentInstance$1.parent && currentInstance$1.parent.provides; 3882 if (parentProvides === provides) { 3883 provides = currentInstance$1.provides = Object.create(parentProvides); 3884 } 3885 provides[key] = value; 3886 } 3887} 3888function inject(key, defaultValue, treatDefaultAsFactory = false) { 3889 const instance = getCurrentInstance(); 3890 if (instance || currentApp) { 3891 let provides = currentApp ? currentApp._context.provides : instance ? instance.parent == null || instance.ce ? instance.vnode.appContext && instance.vnode.appContext.provides : instance.parent.provides : void 0; 3892 if (provides && key in provides) { 3893 return provides[key]; 3894 } else if (arguments.length > 1) { 3895 return treatDefaultAsFactory && isFunction$1(defaultValue) ? defaultValue.call(instance && instance.proxy) : defaultValue; 3896 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3897 warn$1$1(`injection "${String(key)}" not found.`); 3898 } 3899 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3900 warn$1$1(`inject() can only be used inside setup() or functional components.`); 3901 } 3902} 3903function hasInjectionContext() { 3904 return !!(getCurrentInstance() || currentApp); 3905} 3906const internalObjectProto = {}; 3907const createInternalObject = () => Object.create(internalObjectProto); 3908const isInternalObject = (obj) => Object.getPrototypeOf(obj) === internalObjectProto; 3909function initProps(instance, rawProps, isStateful, isSSR = false) { 3910 const props = {}; 3911 const attrs = createInternalObject(); 3912 instance.propsDefaults = /* @__PURE__ */ Object.create(null); 3913 setFullProps(instance, rawProps, props, attrs); 3914 for (const key in instance.propsOptions[0]) { 3915 if (!(key in props)) { 3916 props[key] = void 0; 3917 } 3918 } 3919 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 3920 validateProps(rawProps || {}, props, instance); 3921 } 3922 if (isStateful) { 3923 instance.props = isSSR ? props : shallowReactive(props); 3924 } else { 3925 if (!instance.type.props) { 3926 instance.props = attrs; 3927 } else { 3928 instance.props = props; 3929 } 3930 } 3931 instance.attrs = attrs; 3932} 3933function isInHmrContext(instance) { 3934 while (instance) { 3935 if (instance.type.__hmrId) return true; 3936 instance = instance.parent; 3937 } 3938} 3939function updateProps(instance, rawProps, rawPrevProps, optimized) { 3940 const { 3941 props, 3942 attrs, 3943 vnode: { patchFlag } 3944 } = instance; 3945 const rawCurrentProps = toRaw(props); 3946 const [options] = instance.propsOptions; 3947 let hasAttrsChanged = false; 3948 if ( 3949 // always force full diff in dev 3950 // - #1942 if hmr is enabled with sfc component 3951 // - vite#872 non-sfc component used by sfc component 3952 !(!!(define_process_env_default$7.NODE_ENV !== "production") && isInHmrContext(instance)) && (optimized || patchFlag > 0) && !(patchFlag & 16) 3953 ) { 3954 if (patchFlag & 8) { 3955 const propsToUpdate = instance.vnode.dynamicProps; 3956 for (let i = 0; i < propsToUpdate.length; i++) { 3957 let key = propsToUpdate[i]; 3958 if (isEmitListener(instance.emitsOptions, key)) { 3959 continue; 3960 } 3961 const value = rawProps[key]; 3962 if (options) { 3963 if (hasOwn$1(attrs, key)) { 3964 if (value !== attrs[key]) { 3965 attrs[key] = value; 3966 hasAttrsChanged = true; 3967 } 3968 } else { 3969 const camelizedKey = camelize(key); 3970 props[camelizedKey] = resolvePropValue( 3971 options, 3972 rawCurrentProps, 3973 camelizedKey, 3974 value, 3975 instance, 3976 false 3977 ); 3978 } 3979 } else { 3980 if (value !== attrs[key]) { 3981 attrs[key] = value; 3982 hasAttrsChanged = true; 3983 } 3984 } 3985 } 3986 } 3987 } else { 3988 if (setFullProps(instance, rawProps, props, attrs)) { 3989 hasAttrsChanged = true; 3990 } 3991 let kebabKey; 3992 for (const key in rawCurrentProps) { 3993 if (!rawProps || // for camelCase 3994 !hasOwn$1(rawProps, key) && // it's possible the original props was passed in as kebab-case 3995 // and converted to camelCase (#955) 3996 ((kebabKey = hyphenate(key)) === key || !hasOwn$1(rawProps, kebabKey))) { 3997 if (options) { 3998 if (rawPrevProps && // for camelCase 3999 (rawPrevProps[key] !== void 0 || // for kebab-case 4000 rawPrevProps[kebabKey] !== void 0)) { 4001 props[key] = resolvePropValue( 4002 options, 4003 rawCurrentProps, 4004 key, 4005 void 0, 4006 instance, 4007 true 4008 ); 4009 } 4010 } else { 4011 delete props[key]; 4012 } 4013 } 4014 } 4015 if (attrs !== rawCurrentProps) { 4016 for (const key in attrs) { 4017 if (!rawProps || !hasOwn$1(rawProps, key) && true) { 4018 delete attrs[key]; 4019 hasAttrsChanged = true; 4020 } 4021 } 4022 } 4023 } 4024 if (hasAttrsChanged) { 4025 trigger(instance.attrs, "set", ""); 4026 } 4027 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 4028 validateProps(rawProps || {}, props, instance); 4029 } 4030} 4031function setFullProps(instance, rawProps, props, attrs) { 4032 const [options, needCastKeys] = instance.propsOptions; 4033 let hasAttrsChanged = false; 4034 let rawCastValues; 4035 if (rawProps) { 4036 for (let key in rawProps) { 4037 if (isReservedProp(key)) { 4038 continue; 4039 } 4040 const value = rawProps[key]; 4041 let camelKey; 4042 if (options && hasOwn$1(options, camelKey = camelize(key))) { 4043 if (!needCastKeys || !needCastKeys.includes(camelKey)) { 4044 props[camelKey] = value; 4045 } else { 4046 (rawCastValues || (rawCastValues = {}))[camelKey] = value; 4047 } 4048 } else if (!isEmitListener(instance.emitsOptions, key)) { 4049 if (!(key in attrs) || value !== attrs[key]) { 4050 attrs[key] = value; 4051 hasAttrsChanged = true; 4052 } 4053 } 4054 } 4055 } 4056 if (needCastKeys) { 4057 const rawCurrentProps = toRaw(props); 4058 const castValues = rawCastValues || EMPTY_OBJ; 4059 for (let i = 0; i < needCastKeys.length; i++) { 4060 const key = needCastKeys[i]; 4061 props[key] = resolvePropValue( 4062 options, 4063 rawCurrentProps, 4064 key, 4065 castValues[key], 4066 instance, 4067 !hasOwn$1(castValues, key) 4068 ); 4069 } 4070 } 4071 return hasAttrsChanged; 4072} 4073function resolvePropValue(options, props, key, value, instance, isAbsent) { 4074 const opt = options[key]; 4075 if (opt != null) { 4076 const hasDefault = hasOwn$1(opt, "default"); 4077 if (hasDefault && value === void 0) { 4078 const defaultValue = opt.default; 4079 if (opt.type !== Function && !opt.skipFactory && isFunction$1(defaultValue)) { 4080 const { propsDefaults } = instance; 4081 if (key in propsDefaults) { 4082 value = propsDefaults[key]; 4083 } else { 4084 const reset = setCurrentInstance(instance); 4085 value = propsDefaults[key] = defaultValue.call( 4086 null, 4087 props 4088 ); 4089 reset(); 4090 } 4091 } else { 4092 value = defaultValue; 4093 } 4094 if (instance.ce) { 4095 instance.ce._setProp(key, value); 4096 } 4097 } 4098 if (opt[ 4099 0 4100 /* shouldCast */ 4101 ]) { 4102 if (isAbsent && !hasDefault) { 4103 value = false; 4104 } else if (opt[ 4105 1 4106 /* shouldCastTrue */ 4107 ] && (value === "" || value === hyphenate(key))) { 4108 value = true; 4109 } 4110 } 4111 } 4112 return value; 4113} 4114const mixinPropsCache = /* @__PURE__ */ new WeakMap(); 4115function normalizePropsOptions(comp, appContext, asMixin = false) { 4116 const cache2 = asMixin ? mixinPropsCache : appContext.propsCache; 4117 const cached = cache2.get(comp); 4118 if (cached) { 4119 return cached; 4120 } 4121 const raw = comp.props; 4122 const normalized = {}; 4123 const needCastKeys = []; 4124 let hasExtends = false; 4125 if (!isFunction$1(comp)) { 4126 const extendProps = (raw2) => { 4127 hasExtends = true; 4128 const [props, keys] = normalizePropsOptions(raw2, appContext, true); 4129 extend(normalized, props); 4130 if (keys) needCastKeys.push(...keys); 4131 }; 4132 if (!asMixin && appContext.mixins.length) { 4133 appContext.mixins.forEach(extendProps); 4134 } 4135 if (comp.extends) { 4136 extendProps(comp.extends); 4137 } 4138 if (comp.mixins) { 4139 comp.mixins.forEach(extendProps); 4140 } 4141 } 4142 if (!raw && !hasExtends) { 4143 if (isObject$3(comp)) { 4144 cache2.set(comp, EMPTY_ARR); 4145 } 4146 return EMPTY_ARR; 4147 } 4148 if (isArray$1(raw)) { 4149 for (let i = 0; i < raw.length; i++) { 4150 if (!!(define_process_env_default$7.NODE_ENV !== "production") && !isString$2(raw[i])) { 4151 warn$1$1(`props must be strings when using array syntax.`, raw[i]); 4152 } 4153 const normalizedKey = camelize(raw[i]); 4154 if (validatePropName(normalizedKey)) { 4155 normalized[normalizedKey] = EMPTY_OBJ; 4156 } 4157 } 4158 } else if (raw) { 4159 if (!!(define_process_env_default$7.NODE_ENV !== "production") && !isObject$3(raw)) { 4160 warn$1$1(`invalid props options`, raw); 4161 } 4162 for (const key in raw) { 4163 const normalizedKey = camelize(key); 4164 if (validatePropName(normalizedKey)) { 4165 const opt = raw[key]; 4166 const prop = normalized[normalizedKey] = isArray$1(opt) || isFunction$1(opt) ? { type: opt } : extend({}, opt); 4167 const propType = prop.type; 4168 let shouldCast = false; 4169 let shouldCastTrue = true; 4170 if (isArray$1(propType)) { 4171 for (let index = 0; index < propType.length; ++index) { 4172 const type = propType[index]; 4173 const typeName = isFunction$1(type) && type.name; 4174 if (typeName === "Boolean") { 4175 shouldCast = true; 4176 break; 4177 } else if (typeName === "String") { 4178 shouldCastTrue = false; 4179 } 4180 } 4181 } else { 4182 shouldCast = isFunction$1(propType) && propType.name === "Boolean"; 4183 } 4184 prop[ 4185 0 4186 /* shouldCast */ 4187 ] = shouldCast; 4188 prop[ 4189 1 4190 /* shouldCastTrue */ 4191 ] = shouldCastTrue; 4192 if (shouldCast || hasOwn$1(prop, "default")) { 4193 needCastKeys.push(normalizedKey); 4194 } 4195 } 4196 } 4197 } 4198 const res = [normalized, needCastKeys]; 4199 if (isObject$3(comp)) { 4200 cache2.set(comp, res); 4201 } 4202 return res; 4203} 4204function validatePropName(key) { 4205 if (key[0] !== "$" && !isReservedProp(key)) { 4206 return true; 4207 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 4208 warn$1$1(`Invalid prop name: "${key}" is a reserved property.`); 4209 } 4210 return false; 4211} 4212function getType(ctor) { 4213 if (ctor === null) { 4214 return "null"; 4215 } 4216 if (typeof ctor === "function") { 4217 return ctor.name || ""; 4218 } else if (typeof ctor === "object") { 4219 const name = ctor.constructor && ctor.constructor.name; 4220 return name || ""; 4221 } 4222 return ""; 4223} 4224function validateProps(rawProps, props, instance) { 4225 const resolvedValues = toRaw(props); 4226 const options = instance.propsOptions[0]; 4227 const camelizePropsKey = Object.keys(rawProps).map((key) => camelize(key)); 4228 for (const key in options) { 4229 let opt = options[key]; 4230 if (opt == null) continue; 4231 validateProp( 4232 key, 4233 resolvedValues[key], 4234 opt, 4235 !!(define_process_env_default$7.NODE_ENV !== "production") ? shallowReadonly(resolvedValues) : resolvedValues, 4236 !camelizePropsKey.includes(key) 4237 ); 4238 } 4239} 4240function validateProp(name, value, prop, props, isAbsent) { 4241 const { type, required, validator, skipCheck } = prop; 4242 if (required && isAbsent) { 4243 warn$1$1('Missing required prop: "' + name + '"'); 4244 return; 4245 } 4246 if (value == null && !required) { 4247 return; 4248 } 4249 if (type != null && type !== true && !skipCheck) { 4250 let isValid = false; 4251 const types = isArray$1(type) ? type : [type]; 4252 const expectedTypes = []; 4253 for (let i = 0; i < types.length && !isValid; i++) { 4254 const { valid, expectedType } = assertType(value, types[i]); 4255 expectedTypes.push(expectedType || ""); 4256 isValid = valid; 4257 } 4258 if (!isValid) { 4259 warn$1$1(getInvalidTypeMessage(name, value, expectedTypes)); 4260 return; 4261 } 4262 } 4263 if (validator && !validator(value, props)) { 4264 warn$1$1('Invalid prop: custom validator check failed for prop "' + name + '".'); 4265 } 4266} 4267const isSimpleType = /* @__PURE__ */ makeMap( 4268 "String,Number,Boolean,Function,Symbol,BigInt" 4269); 4270function assertType(value, type) { 4271 let valid; 4272 const expectedType = getType(type); 4273 if (expectedType === "null") { 4274 valid = value === null; 4275 } else if (isSimpleType(expectedType)) { 4276 const t = typeof value; 4277 valid = t === expectedType.toLowerCase(); 4278 if (!valid && t === "object") { 4279 valid = value instanceof type; 4280 } 4281 } else if (expectedType === "Object") { 4282 valid = isObject$3(value); 4283 } else if (expectedType === "Array") { 4284 valid = isArray$1(value); 4285 } else { 4286 valid = value instanceof type; 4287 } 4288 return { 4289 valid, 4290 expectedType 4291 }; 4292} 4293function getInvalidTypeMessage(name, value, expectedTypes) { 4294 if (expectedTypes.length === 0) { 4295 return `Prop type [] for prop "${name}" won't match anything. Did you mean to use type Array instead?`; 4296 } 4297 let message = `Invalid prop: type check failed for prop "${name}". Expected ${expectedTypes.map(capitalize$1).join(" | ")}`; 4298 const expectedType = expectedTypes[0]; 4299 const receivedType = toRawType(value); 4300 const expectedValue = styleValue(value, expectedType); 4301 const receivedValue = styleValue(value, receivedType); 4302 if (expectedTypes.length === 1 && isExplicable(expectedType) && !isBoolean$1(expectedType, receivedType)) { 4303 message += ` with value ${expectedValue}`; 4304 } 4305 message += `, got ${receivedType} `; 4306 if (isExplicable(receivedType)) { 4307 message += `with value ${receivedValue}.`; 4308 } 4309 return message; 4310} 4311function styleValue(value, type) { 4312 if (type === "String") { 4313 return `"${value}"`; 4314 } else if (type === "Number") { 4315 return `${Number(value)}`; 4316 } else { 4317 return `${value}`; 4318 } 4319} 4320function isExplicable(type) { 4321 const explicitTypes = ["string", "number", "boolean"]; 4322 return explicitTypes.some((elem) => type.toLowerCase() === elem); 4323} 4324function isBoolean$1(...args) { 4325 return args.some((elem) => elem.toLowerCase() === "boolean"); 4326} 4327const isInternalKey = (key) => key === "_" || key === "_ctx" || key === "$stable"; 4328const normalizeSlotValue = (value) => isArray$1(value) ? value.map(normalizeVNode) : [normalizeVNode(value)]; 4329const normalizeSlot = (key, rawSlot, ctx) => { 4330 if (rawSlot._n) { 4331 return rawSlot; 4332 } 4333 const normalized = withCtx((...args) => { 4334 if (!!(define_process_env_default$7.NODE_ENV !== "production") && currentInstance$1 && !(ctx === null && currentRenderingInstance) && !(ctx && ctx.root !== currentInstance$1.root)) { 4335 warn$1$1( 4336 `Slot "${key}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.` 4337 ); 4338 } 4339 return normalizeSlotValue(rawSlot(...args)); 4340 }, ctx); 4341 normalized._c = false; 4342 return normalized; 4343}; 4344const normalizeObjectSlots = (rawSlots, slots, instance) => { 4345 const ctx = rawSlots._ctx; 4346 for (const key in rawSlots) { 4347 if (isInternalKey(key)) continue; 4348 const value = rawSlots[key]; 4349 if (isFunction$1(value)) { 4350 slots[key] = normalizeSlot(key, value, ctx); 4351 } else if (value != null) { 4352 if (!!(define_process_env_default$7.NODE_ENV !== "production") && true) { 4353 warn$1$1( 4354 `Non-function value encountered for slot "${key}". Prefer function slots for better performance.` 4355 ); 4356 } 4357 const normalized = normalizeSlotValue(value); 4358 slots[key] = () => normalized; 4359 } 4360 } 4361}; 4362const normalizeVNodeSlots = (instance, children) => { 4363 if (!!(define_process_env_default$7.NODE_ENV !== "production") && !isKeepAlive(instance.vnode) && true) { 4364 warn$1$1( 4365 `Non-function value encountered for default slot. Prefer function slots for better performance.` 4366 ); 4367 } 4368 const normalized = normalizeSlotValue(children); 4369 instance.slots.default = () => normalized; 4370}; 4371const assignSlots = (slots, children, optimized) => { 4372 for (const key in children) { 4373 if (optimized || !isInternalKey(key)) { 4374 slots[key] = children[key]; 4375 } 4376 } 4377}; 4378const initSlots = (instance, children, optimized) => { 4379 const slots = instance.slots = createInternalObject(); 4380 if (instance.vnode.shapeFlag & 32) { 4381 const type = children._; 4382 if (type) { 4383 assignSlots(slots, children, optimized); 4384 if (optimized) { 4385 def$1(slots, "_", type, true); 4386 } 4387 } else { 4388 normalizeObjectSlots(children, slots); 4389 } 4390 } else if (children) { 4391 normalizeVNodeSlots(instance, children); 4392 } 4393}; 4394const updateSlots = (instance, children, optimized) => { 4395 const { vnode, slots } = instance; 4396 let needDeletionCheck = true; 4397 let deletionComparisonTarget = EMPTY_OBJ; 4398 if (vnode.shapeFlag & 32) { 4399 const type = children._; 4400 if (type) { 4401 if (!!(define_process_env_default$7.NODE_ENV !== "production") && isHmrUpdating) { 4402 assignSlots(slots, children, optimized); 4403 trigger(instance, "set", "$slots"); 4404 } else if (optimized && type === 1) { 4405 needDeletionCheck = false; 4406 } else { 4407 assignSlots(slots, children, optimized); 4408 } 4409 } else { 4410 needDeletionCheck = !children.$stable; 4411 normalizeObjectSlots(children, slots); 4412 } 4413 deletionComparisonTarget = children; 4414 } else if (children) { 4415 normalizeVNodeSlots(instance, children); 4416 deletionComparisonTarget = { default: 1 }; 4417 } 4418 if (needDeletionCheck) { 4419 for (const key in slots) { 4420 if (!isInternalKey(key) && deletionComparisonTarget[key] == null) { 4421 delete slots[key]; 4422 } 4423 } 4424 } 4425}; 4426let supported$1; 4427let perf$1; 4428function startMeasure(instance, type) { 4429 if (instance.appContext.config.performance && isSupported()) { 4430 perf$1.mark(`vue-${type}-${instance.uid}`); 4431 } 4432 if (!!(define_process_env_default$7.NODE_ENV !== "production") || false) { 4433 devtoolsPerfStart(instance, type, isSupported() ? perf$1.now() : Date.now()); 4434 } 4435} 4436function endMeasure(instance, type) { 4437 if (instance.appContext.config.performance && isSupported()) { 4438 const startTag = `vue-${type}-${instance.uid}`; 4439 const endTag = startTag + `:end`; 4440 const measureName = `<${formatComponentName(instance, instance.type)}> ${type}`; 4441 perf$1.mark(endTag); 4442 perf$1.measure(measureName, startTag, endTag); 4443 perf$1.clearMeasures(measureName); 4444 perf$1.clearMarks(startTag); 4445 perf$1.clearMarks(endTag); 4446 } 4447 if (!!(define_process_env_default$7.NODE_ENV !== "production") || false) { 4448 devtoolsPerfEnd(instance, type, isSupported() ? perf$1.now() : Date.now()); 4449 } 4450} 4451function isSupported() { 4452 if (supported$1 !== void 0) { 4453 return supported$1; 4454 } 4455 if (typeof window !== "undefined" && window.performance) { 4456 supported$1 = true; 4457 perf$1 = window.performance; 4458 } else { 4459 supported$1 = false; 4460 } 4461 return supported$1; 4462} 4463function initFeatureFlags$2() { 4464 const needWarn = []; 4465 if (!!(define_process_env_default$7.NODE_ENV !== "production") && needWarn.length) { 4466 const multi = needWarn.length > 1; 4467 console.warn( 4468 `Feature flag${multi ? `s` : ``} ${needWarn.join(", ")} ${multi ? `are` : `is`} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle. 4469 4470For more details, see https://link.vuejs.org/feature-flags.` 4471 ); 4472 } 4473} 4474const queuePostRenderEffect = queueEffectWithSuspense; 4475function createRenderer(options) { 4476 return baseCreateRenderer(options); 4477} 4478function baseCreateRenderer(options, createHydrationFns) { 4479 { 4480 initFeatureFlags$2(); 4481 } 4482 const target = getGlobalThis$1(); 4483 target.__VUE__ = true; 4484 if (!!(define_process_env_default$7.NODE_ENV !== "production") || false) { 4485 setDevtoolsHook$1(target.__VUE_DEVTOOLS_GLOBAL_HOOK__, target); 4486 } 4487 const { 4488 insert: hostInsert, 4489 remove: hostRemove, 4490 patchProp: hostPatchProp, 4491 createElement: hostCreateElement, 4492 createText: hostCreateText, 4493 createComment: hostCreateComment, 4494 setText: hostSetText, 4495 setElementText: hostSetElementText, 4496 parentNode: hostParentNode, 4497 nextSibling: hostNextSibling, 4498 setScopeId: hostSetScopeId = NOOP, 4499 insertStaticContent: hostInsertStaticContent 4500 } = options; 4501 const patch = (n1, n2, container, anchor = null, parentComponent = null, parentSuspense = null, namespace = void 0, slotScopeIds = null, optimized = !!(define_process_env_default$7.NODE_ENV !== "production") && isHmrUpdating ? false : !!n2.dynamicChildren) => { 4502 if (n1 === n2) { 4503 return; 4504 } 4505 if (n1 && !isSameVNodeType(n1, n2)) { 4506 anchor = getNextHostNode(n1); 4507 unmount(n1, parentComponent, parentSuspense, true); 4508 n1 = null; 4509 } 4510 if (n2.patchFlag === -2) { 4511 optimized = false; 4512 n2.dynamicChildren = null; 4513 } 4514 const { type, ref: ref3, shapeFlag } = n2; 4515 switch (type) { 4516 case Text: 4517 processText(n1, n2, container, anchor); 4518 break; 4519 case Comment: 4520 processCommentNode(n1, n2, container, anchor); 4521 break; 4522 case Static: 4523 if (n1 == null) { 4524 mountStaticNode(n2, container, anchor, namespace); 4525 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 4526 patchStaticNode(n1, n2, container, namespace); 4527 } 4528 break; 4529 case Fragment: 4530 processFragment( 4531 n1, 4532 n2, 4533 container, 4534 anchor, 4535 parentComponent, 4536 parentSuspense, 4537 namespace, 4538 slotScopeIds, 4539 optimized 4540 ); 4541 break; 4542 default: 4543 if (shapeFlag & 1) { 4544 processElement( 4545 n1, 4546 n2, 4547 container, 4548 anchor, 4549 parentComponent, 4550 parentSuspense, 4551 namespace, 4552 slotScopeIds, 4553 optimized 4554 ); 4555 } else if (shapeFlag & 6) { 4556 processComponent( 4557 n1, 4558 n2, 4559 container, 4560 anchor, 4561 parentComponent, 4562 parentSuspense, 4563 namespace, 4564 slotScopeIds, 4565 optimized 4566 ); 4567 } else if (shapeFlag & 64) { 4568 type.process( 4569 n1, 4570 n2, 4571 container, 4572 anchor, 4573 parentComponent, 4574 parentSuspense, 4575 namespace, 4576 slotScopeIds, 4577 optimized, 4578 internals 4579 ); 4580 } else if (shapeFlag & 128) { 4581 type.process( 4582 n1, 4583 n2, 4584 container, 4585 anchor, 4586 parentComponent, 4587 parentSuspense, 4588 namespace, 4589 slotScopeIds, 4590 optimized, 4591 internals 4592 ); 4593 } else if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 4594 warn$1$1("Invalid VNode type:", type, `(${typeof type})`); 4595 } 4596 } 4597 if (ref3 != null && parentComponent) { 4598 setRef(ref3, n1 && n1.ref, parentSuspense, n2 || n1, !n2); 4599 } else if (ref3 == null && n1 && n1.ref != null) { 4600 setRef(n1.ref, null, parentSuspense, n1, true); 4601 } 4602 }; 4603 const processText = (n1, n2, container, anchor) => { 4604 if (n1 == null) { 4605 hostInsert( 4606 n2.el = hostCreateText(n2.children), 4607 container, 4608 anchor 4609 ); 4610 } else { 4611 const el = n2.el = n1.el; 4612 if (n2.children !== n1.children) { 4613 hostSetText(el, n2.children); 4614 } 4615 } 4616 }; 4617 const processCommentNode = (n1, n2, container, anchor) => { 4618 if (n1 == null) { 4619 hostInsert( 4620 n2.el = hostCreateComment(n2.children || ""), 4621 container, 4622 anchor 4623 ); 4624 } else { 4625 n2.el = n1.el; 4626 } 4627 }; 4628 const mountStaticNode = (n2, container, anchor, namespace) => { 4629 [n2.el, n2.anchor] = hostInsertStaticContent( 4630 n2.children, 4631 container, 4632 anchor, 4633 namespace, 4634 n2.el, 4635 n2.anchor 4636 ); 4637 }; 4638 const patchStaticNode = (n1, n2, container, namespace) => { 4639 if (n2.children !== n1.children) { 4640 const anchor = hostNextSibling(n1.anchor); 4641 removeStaticNode(n1); 4642 [n2.el, n2.anchor] = hostInsertStaticContent( 4643 n2.children, 4644 container, 4645 anchor, 4646 namespace 4647 ); 4648 } else { 4649 n2.el = n1.el; 4650 n2.anchor = n1.anchor; 4651 } 4652 }; 4653 const moveStaticNode = ({ el, anchor }, container, nextSibling) => { 4654 let next; 4655 while (el && el !== anchor) { 4656 next = hostNextSibling(el); 4657 hostInsert(el, container, nextSibling); 4658 el = next; 4659 } 4660 hostInsert(anchor, container, nextSibling); 4661 }; 4662 const removeStaticNode = ({ el, anchor }) => { 4663 let next; 4664 while (el && el !== anchor) { 4665 next = hostNextSibling(el); 4666 hostRemove(el); 4667 el = next; 4668 } 4669 hostRemove(anchor); 4670 }; 4671 const processElement = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 4672 if (n2.type === "svg") { 4673 namespace = "svg"; 4674 } else if (n2.type === "math") { 4675 namespace = "mathml"; 4676 } 4677 if (n1 == null) { 4678 mountElement( 4679 n2, 4680 container, 4681 anchor, 4682 parentComponent, 4683 parentSuspense, 4684 namespace, 4685 slotScopeIds, 4686 optimized 4687 ); 4688 } else { 4689 patchElement( 4690 n1, 4691 n2, 4692 parentComponent, 4693 parentSuspense, 4694 namespace, 4695 slotScopeIds, 4696 optimized 4697 ); 4698 } 4699 }; 4700 const mountElement = (vnode, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 4701 let el; 4702 let vnodeHook; 4703 const { props, shapeFlag, transition, dirs } = vnode; 4704 el = vnode.el = hostCreateElement( 4705 vnode.type, 4706 namespace, 4707 props && props.is, 4708 props 4709 ); 4710 if (shapeFlag & 8) { 4711 hostSetElementText(el, vnode.children); 4712 } else if (shapeFlag & 16) { 4713 mountChildren( 4714 vnode.children, 4715 el, 4716 null, 4717 parentComponent, 4718 parentSuspense, 4719 resolveChildrenNamespace(vnode, namespace), 4720 slotScopeIds, 4721 optimized 4722 ); 4723 } 4724 if (dirs) { 4725 invokeDirectiveHook(vnode, null, parentComponent, "created"); 4726 } 4727 setScopeId(el, vnode, vnode.scopeId, slotScopeIds, parentComponent); 4728 if (props) { 4729 for (const key in props) { 4730 if (key !== "value" && !isReservedProp(key)) { 4731 hostPatchProp(el, key, null, props[key], namespace, parentComponent); 4732 } 4733 } 4734 if ("value" in props) { 4735 hostPatchProp(el, "value", null, props.value, namespace); 4736 } 4737 if (vnodeHook = props.onVnodeBeforeMount) { 4738 invokeVNodeHook(vnodeHook, parentComponent, vnode); 4739 } 4740 } 4741 if (!!(define_process_env_default$7.NODE_ENV !== "production") || false) { 4742 def$1(el, "__vnode", vnode, true); 4743 def$1(el, "__vueParentComponent", parentComponent, true); 4744 } 4745 if (dirs) { 4746 invokeDirectiveHook(vnode, null, parentComponent, "beforeMount"); 4747 } 4748 const needCallTransitionHooks = needTransition(parentSuspense, transition); 4749 if (needCallTransitionHooks) { 4750 transition.beforeEnter(el); 4751 } 4752 hostInsert(el, container, anchor); 4753 if ((vnodeHook = props && props.onVnodeMounted) || needCallTransitionHooks || dirs) { 4754 queuePostRenderEffect(() => { 4755 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); 4756 needCallTransitionHooks && transition.enter(el); 4757 dirs && invokeDirectiveHook(vnode, null, parentComponent, "mounted"); 4758 }, parentSuspense); 4759 } 4760 }; 4761 const setScopeId = (el, vnode, scopeId, slotScopeIds, parentComponent) => { 4762 if (scopeId) { 4763 hostSetScopeId(el, scopeId); 4764 } 4765 if (slotScopeIds) { 4766 for (let i = 0; i < slotScopeIds.length; i++) { 4767 hostSetScopeId(el, slotScopeIds[i]); 4768 } 4769 } 4770 if (parentComponent) { 4771 let subTree = parentComponent.subTree; 4772 if (!!(define_process_env_default$7.NODE_ENV !== "production") && subTree.patchFlag > 0 && subTree.patchFlag & 2048) { 4773 subTree = filterSingleRoot(subTree.children) || subTree; 4774 } 4775 if (vnode === subTree || isSuspense(subTree.type) && (subTree.ssContent === vnode || subTree.ssFallback === vnode)) { 4776 const parentVNode = parentComponent.vnode; 4777 setScopeId( 4778 el, 4779 parentVNode, 4780 parentVNode.scopeId, 4781 parentVNode.slotScopeIds, 4782 parentComponent.parent 4783 ); 4784 } 4785 } 4786 }; 4787 const mountChildren = (children, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized, start = 0) => { 4788 for (let i = start; i < children.length; i++) { 4789 const child = children[i] = optimized ? cloneIfMounted(children[i]) : normalizeVNode(children[i]); 4790 patch( 4791 null, 4792 child, 4793 container, 4794 anchor, 4795 parentComponent, 4796 parentSuspense, 4797 namespace, 4798 slotScopeIds, 4799 optimized 4800 ); 4801 } 4802 }; 4803 const patchElement = (n1, n2, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 4804 const el = n2.el = n1.el; 4805 if (!!(define_process_env_default$7.NODE_ENV !== "production") || false) { 4806 el.__vnode = n2; 4807 } 4808 let { patchFlag, dynamicChildren, dirs } = n2; 4809 patchFlag |= n1.patchFlag & 16; 4810 const oldProps = n1.props || EMPTY_OBJ; 4811 const newProps = n2.props || EMPTY_OBJ; 4812 let vnodeHook; 4813 parentComponent && toggleRecurse(parentComponent, false); 4814 if (vnodeHook = newProps.onVnodeBeforeUpdate) { 4815 invokeVNodeHook(vnodeHook, parentComponent, n2, n1); 4816 } 4817 if (dirs) { 4818 invokeDirectiveHook(n2, n1, parentComponent, "beforeUpdate"); 4819 } 4820 parentComponent && toggleRecurse(parentComponent, true); 4821 if (!!(define_process_env_default$7.NODE_ENV !== "production") && isHmrUpdating) { 4822 patchFlag = 0; 4823 optimized = false; 4824 dynamicChildren = null; 4825 } 4826 if (oldProps.innerHTML && newProps.innerHTML == null || oldProps.textContent && newProps.textContent == null) { 4827 hostSetElementText(el, ""); 4828 } 4829 if (dynamicChildren) { 4830 patchBlockChildren( 4831 n1.dynamicChildren, 4832 dynamicChildren, 4833 el, 4834 parentComponent, 4835 parentSuspense, 4836 resolveChildrenNamespace(n2, namespace), 4837 slotScopeIds 4838 ); 4839 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 4840 traverseStaticChildren(n1, n2); 4841 } 4842 } else if (!optimized) { 4843 patchChildren( 4844 n1, 4845 n2, 4846 el, 4847 null, 4848 parentComponent, 4849 parentSuspense, 4850 resolveChildrenNamespace(n2, namespace), 4851 slotScopeIds, 4852 false 4853 ); 4854 } 4855 if (patchFlag > 0) { 4856 if (patchFlag & 16) { 4857 patchProps(el, oldProps, newProps, parentComponent, namespace); 4858 } else { 4859 if (patchFlag & 2) { 4860 if (oldProps.class !== newProps.class) { 4861 hostPatchProp(el, "class", null, newProps.class, namespace); 4862 } 4863 } 4864 if (patchFlag & 4) { 4865 hostPatchProp(el, "style", oldProps.style, newProps.style, namespace); 4866 } 4867 if (patchFlag & 8) { 4868 const propsToUpdate = n2.dynamicProps; 4869 for (let i = 0; i < propsToUpdate.length; i++) { 4870 const key = propsToUpdate[i]; 4871 const prev = oldProps[key]; 4872 const next = newProps[key]; 4873 if (next !== prev || key === "value") { 4874 hostPatchProp(el, key, prev, next, namespace, parentComponent); 4875 } 4876 } 4877 } 4878 } 4879 if (patchFlag & 1) { 4880 if (n1.children !== n2.children) { 4881 hostSetElementText(el, n2.children); 4882 } 4883 } 4884 } else if (!optimized && dynamicChildren == null) { 4885 patchProps(el, oldProps, newProps, parentComponent, namespace); 4886 } 4887 if ((vnodeHook = newProps.onVnodeUpdated) || dirs) { 4888 queuePostRenderEffect(() => { 4889 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, n2, n1); 4890 dirs && invokeDirectiveHook(n2, n1, parentComponent, "updated"); 4891 }, parentSuspense); 4892 } 4893 }; 4894 const patchBlockChildren = (oldChildren, newChildren, fallbackContainer, parentComponent, parentSuspense, namespace, slotScopeIds) => { 4895 for (let i = 0; i < newChildren.length; i++) { 4896 const oldVNode = oldChildren[i]; 4897 const newVNode = newChildren[i]; 4898 const container = ( 4899 // oldVNode may be an errored async setup() component inside Suspense 4900 // which will not have a mounted element 4901 oldVNode.el && // - In the case of a Fragment, we need to provide the actual parent 4902 // of the Fragment itself so it can move its children. 4903 (oldVNode.type === Fragment || // - In the case of different nodes, there is going to be a replacement 4904 // which also requires the correct parent container 4905 !isSameVNodeType(oldVNode, newVNode) || // - In the case of a component, it could contain anything. 4906 oldVNode.shapeFlag & (6 | 64 | 128)) ? hostParentNode(oldVNode.el) : ( 4907 // In other cases, the parent container is not actually used so we 4908 // just pass the block element here to avoid a DOM parentNode call. 4909 fallbackContainer 4910 ) 4911 ); 4912 patch( 4913 oldVNode, 4914 newVNode, 4915 container, 4916 null, 4917 parentComponent, 4918 parentSuspense, 4919 namespace, 4920 slotScopeIds, 4921 true 4922 ); 4923 } 4924 }; 4925 const patchProps = (el, oldProps, newProps, parentComponent, namespace) => { 4926 if (oldProps !== newProps) { 4927 if (oldProps !== EMPTY_OBJ) { 4928 for (const key in oldProps) { 4929 if (!isReservedProp(key) && !(key in newProps)) { 4930 hostPatchProp( 4931 el, 4932 key, 4933 oldProps[key], 4934 null, 4935 namespace, 4936 parentComponent 4937 ); 4938 } 4939 } 4940 } 4941 for (const key in newProps) { 4942 if (isReservedProp(key)) continue; 4943 const next = newProps[key]; 4944 const prev = oldProps[key]; 4945 if (next !== prev && key !== "value") { 4946 hostPatchProp(el, key, prev, next, namespace, parentComponent); 4947 } 4948 } 4949 if ("value" in newProps) { 4950 hostPatchProp(el, "value", oldProps.value, newProps.value, namespace); 4951 } 4952 } 4953 }; 4954 const processFragment = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 4955 const fragmentStartAnchor = n2.el = n1 ? n1.el : hostCreateText(""); 4956 const fragmentEndAnchor = n2.anchor = n1 ? n1.anchor : hostCreateText(""); 4957 let { patchFlag, dynamicChildren, slotScopeIds: fragmentSlotScopeIds } = n2; 4958 if (!!(define_process_env_default$7.NODE_ENV !== "production") && // #5523 dev root fragment may inherit directives 4959 (isHmrUpdating || patchFlag & 2048)) { 4960 patchFlag = 0; 4961 optimized = false; 4962 dynamicChildren = null; 4963 } 4964 if (fragmentSlotScopeIds) { 4965 slotScopeIds = slotScopeIds ? slotScopeIds.concat(fragmentSlotScopeIds) : fragmentSlotScopeIds; 4966 } 4967 if (n1 == null) { 4968 hostInsert(fragmentStartAnchor, container, anchor); 4969 hostInsert(fragmentEndAnchor, container, anchor); 4970 mountChildren( 4971 // #10007 4972 // such fragment like `<></>` will be compiled into 4973 // a fragment which doesn't have a children. 4974 // In this case fallback to an empty array 4975 n2.children || [], 4976 container, 4977 fragmentEndAnchor, 4978 parentComponent, 4979 parentSuspense, 4980 namespace, 4981 slotScopeIds, 4982 optimized 4983 ); 4984 } else { 4985 if (patchFlag > 0 && patchFlag & 64 && dynamicChildren && // #2715 the previous fragment could've been a BAILed one as a result 4986 // of renderSlot() with no valid children 4987 n1.dynamicChildren) { 4988 patchBlockChildren( 4989 n1.dynamicChildren, 4990 dynamicChildren, 4991 container, 4992 parentComponent, 4993 parentSuspense, 4994 namespace, 4995 slotScopeIds 4996 ); 4997 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 4998 traverseStaticChildren(n1, n2); 4999 } else if ( 5000 // #2080 if the stable fragment has a key, it's a <template v-for> that may 5001 // get moved around. Make sure all root level vnodes inherit el. 5002 // #2134 or if it's a component root, it may also get moved around 5003 // as the component is being moved. 5004 n2.key != null || parentComponent && n2 === parentComponent.subTree 5005 ) { 5006 traverseStaticChildren( 5007 n1, 5008 n2, 5009 true 5010 /* shallow */ 5011 ); 5012 } 5013 } else { 5014 patchChildren( 5015 n1, 5016 n2, 5017 container, 5018 fragmentEndAnchor, 5019 parentComponent, 5020 parentSuspense, 5021 namespace, 5022 slotScopeIds, 5023 optimized 5024 ); 5025 } 5026 } 5027 }; 5028 const processComponent = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 5029 n2.slotScopeIds = slotScopeIds; 5030 if (n1 == null) { 5031 if (n2.shapeFlag & 512) { 5032 parentComponent.ctx.activate( 5033 n2, 5034 container, 5035 anchor, 5036 namespace, 5037 optimized 5038 ); 5039 } else { 5040 mountComponent( 5041 n2, 5042 container, 5043 anchor, 5044 parentComponent, 5045 parentSuspense, 5046 namespace, 5047 optimized 5048 ); 5049 } 5050 } else { 5051 updateComponent(n1, n2, optimized); 5052 } 5053 }; 5054 const mountComponent = (initialVNode, container, anchor, parentComponent, parentSuspense, namespace, optimized) => { 5055 const instance = initialVNode.component = createComponentInstance( 5056 initialVNode, 5057 parentComponent, 5058 parentSuspense 5059 ); 5060 if (!!(define_process_env_default$7.NODE_ENV !== "production") && instance.type.__hmrId) { 5061 registerHMR(instance); 5062 } 5063 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5064 pushWarningContext(initialVNode); 5065 startMeasure(instance, `mount`); 5066 } 5067 if (isKeepAlive(initialVNode)) { 5068 instance.ctx.renderer = internals; 5069 } 5070 { 5071 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5072 startMeasure(instance, `init`); 5073 } 5074 setupComponent(instance, false, optimized); 5075 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5076 endMeasure(instance, `init`); 5077 } 5078 } 5079 if (!!(define_process_env_default$7.NODE_ENV !== "production") && isHmrUpdating) initialVNode.el = null; 5080 if (instance.asyncDep) { 5081 parentSuspense && parentSuspense.registerDep(instance, setupRenderEffect, optimized); 5082 if (!initialVNode.el) { 5083 const placeholder = instance.subTree = createVNode(Comment); 5084 processCommentNode(null, placeholder, container, anchor); 5085 initialVNode.placeholder = placeholder.el; 5086 } 5087 } else { 5088 setupRenderEffect( 5089 instance, 5090 initialVNode, 5091 container, 5092 anchor, 5093 parentSuspense, 5094 namespace, 5095 optimized 5096 ); 5097 } 5098 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5099 popWarningContext(); 5100 endMeasure(instance, `mount`); 5101 } 5102 }; 5103 const updateComponent = (n1, n2, optimized) => { 5104 const instance = n2.component = n1.component; 5105 if (shouldUpdateComponent(n1, n2, optimized)) { 5106 if (instance.asyncDep && !instance.asyncResolved) { 5107 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5108 pushWarningContext(n2); 5109 } 5110 updateComponentPreRender(instance, n2, optimized); 5111 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5112 popWarningContext(); 5113 } 5114 return; 5115 } else { 5116 instance.next = n2; 5117 instance.update(); 5118 } 5119 } else { 5120 n2.el = n1.el; 5121 instance.vnode = n2; 5122 } 5123 }; 5124 const setupRenderEffect = (instance, initialVNode, container, anchor, parentSuspense, namespace, optimized) => { 5125 const componentUpdateFn = () => { 5126 if (!instance.isMounted) { 5127 let vnodeHook; 5128 const { el, props } = initialVNode; 5129 const { bm, m, parent, root, type } = instance; 5130 const isAsyncWrapperVNode = isAsyncWrapper(initialVNode); 5131 toggleRecurse(instance, false); 5132 if (bm) { 5133 invokeArrayFns(bm); 5134 } 5135 if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeBeforeMount)) { 5136 invokeVNodeHook(vnodeHook, parent, initialVNode); 5137 } 5138 toggleRecurse(instance, true); 5139 { 5140 if (root.ce && // @ts-expect-error _def is private 5141 root.ce._def.shadowRoot !== false) { 5142 root.ce._injectChildStyle(type); 5143 } 5144 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5145 startMeasure(instance, `render`); 5146 } 5147 const subTree = instance.subTree = renderComponentRoot(instance); 5148 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5149 endMeasure(instance, `render`); 5150 } 5151 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5152 startMeasure(instance, `patch`); 5153 } 5154 patch( 5155 null, 5156 subTree, 5157 container, 5158 anchor, 5159 instance, 5160 parentSuspense, 5161 namespace 5162 ); 5163 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5164 endMeasure(instance, `patch`); 5165 } 5166 initialVNode.el = subTree.el; 5167 } 5168 if (m) { 5169 queuePostRenderEffect(m, parentSuspense); 5170 } 5171 if (!isAsyncWrapperVNode && (vnodeHook = props && props.onVnodeMounted)) { 5172 const scopedInitialVNode = initialVNode; 5173 queuePostRenderEffect( 5174 () => invokeVNodeHook(vnodeHook, parent, scopedInitialVNode), 5175 parentSuspense 5176 ); 5177 } 5178 if (initialVNode.shapeFlag & 256 || parent && isAsyncWrapper(parent.vnode) && parent.vnode.shapeFlag & 256) { 5179 instance.a && queuePostRenderEffect(instance.a, parentSuspense); 5180 } 5181 instance.isMounted = true; 5182 if (!!(define_process_env_default$7.NODE_ENV !== "production") || false) { 5183 devtoolsComponentAdded(instance); 5184 } 5185 initialVNode = container = anchor = null; 5186 } else { 5187 let { next, bu, u, parent, vnode } = instance; 5188 { 5189 const nonHydratedAsyncRoot = locateNonHydratedAsyncRoot(instance); 5190 if (nonHydratedAsyncRoot) { 5191 if (next) { 5192 next.el = vnode.el; 5193 updateComponentPreRender(instance, next, optimized); 5194 } 5195 nonHydratedAsyncRoot.asyncDep.then(() => { 5196 if (!instance.isUnmounted) { 5197 componentUpdateFn(); 5198 } 5199 }); 5200 return; 5201 } 5202 } 5203 let originNext = next; 5204 let vnodeHook; 5205 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5206 pushWarningContext(next || instance.vnode); 5207 } 5208 toggleRecurse(instance, false); 5209 if (next) { 5210 next.el = vnode.el; 5211 updateComponentPreRender(instance, next, optimized); 5212 } else { 5213 next = vnode; 5214 } 5215 if (bu) { 5216 invokeArrayFns(bu); 5217 } 5218 if (vnodeHook = next.props && next.props.onVnodeBeforeUpdate) { 5219 invokeVNodeHook(vnodeHook, parent, next, vnode); 5220 } 5221 toggleRecurse(instance, true); 5222 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5223 startMeasure(instance, `render`); 5224 } 5225 const nextTree = renderComponentRoot(instance); 5226 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5227 endMeasure(instance, `render`); 5228 } 5229 const prevTree = instance.subTree; 5230 instance.subTree = nextTree; 5231 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5232 startMeasure(instance, `patch`); 5233 } 5234 patch( 5235 prevTree, 5236 nextTree, 5237 // parent may have changed if it's in a teleport 5238 hostParentNode(prevTree.el), 5239 // anchor may have changed if it's in a fragment 5240 getNextHostNode(prevTree), 5241 instance, 5242 parentSuspense, 5243 namespace 5244 ); 5245 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5246 endMeasure(instance, `patch`); 5247 } 5248 next.el = nextTree.el; 5249 if (originNext === null) { 5250 updateHOCHostEl(instance, nextTree.el); 5251 } 5252 if (u) { 5253 queuePostRenderEffect(u, parentSuspense); 5254 } 5255 if (vnodeHook = next.props && next.props.onVnodeUpdated) { 5256 queuePostRenderEffect( 5257 () => invokeVNodeHook(vnodeHook, parent, next, vnode), 5258 parentSuspense 5259 ); 5260 } 5261 if (!!(define_process_env_default$7.NODE_ENV !== "production") || false) { 5262 devtoolsComponentUpdated(instance); 5263 } 5264 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5265 popWarningContext(); 5266 } 5267 } 5268 }; 5269 instance.scope.on(); 5270 const effect2 = instance.effect = new ReactiveEffect(componentUpdateFn); 5271 instance.scope.off(); 5272 const update2 = instance.update = effect2.run.bind(effect2); 5273 const job = instance.job = effect2.runIfDirty.bind(effect2); 5274 job.i = instance; 5275 job.id = instance.uid; 5276 effect2.scheduler = () => queueJob(job); 5277 toggleRecurse(instance, true); 5278 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5279 effect2.onTrack = instance.rtc ? (e) => invokeArrayFns(instance.rtc, e) : void 0; 5280 effect2.onTrigger = instance.rtg ? (e) => invokeArrayFns(instance.rtg, e) : void 0; 5281 } 5282 update2(); 5283 }; 5284 const updateComponentPreRender = (instance, nextVNode, optimized) => { 5285 nextVNode.component = instance; 5286 const prevProps = instance.vnode.props; 5287 instance.vnode = nextVNode; 5288 instance.next = null; 5289 updateProps(instance, nextVNode.props, prevProps, optimized); 5290 updateSlots(instance, nextVNode.children, optimized); 5291 pauseTracking(); 5292 flushPreFlushCbs(instance); 5293 resetTracking(); 5294 }; 5295 const patchChildren = (n1, n2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized = false) => { 5296 const c1 = n1 && n1.children; 5297 const prevShapeFlag = n1 ? n1.shapeFlag : 0; 5298 const c2 = n2.children; 5299 const { patchFlag, shapeFlag } = n2; 5300 if (patchFlag > 0) { 5301 if (patchFlag & 128) { 5302 patchKeyedChildren( 5303 c1, 5304 c2, 5305 container, 5306 anchor, 5307 parentComponent, 5308 parentSuspense, 5309 namespace, 5310 slotScopeIds, 5311 optimized 5312 ); 5313 return; 5314 } else if (patchFlag & 256) { 5315 patchUnkeyedChildren( 5316 c1, 5317 c2, 5318 container, 5319 anchor, 5320 parentComponent, 5321 parentSuspense, 5322 namespace, 5323 slotScopeIds, 5324 optimized 5325 ); 5326 return; 5327 } 5328 } 5329 if (shapeFlag & 8) { 5330 if (prevShapeFlag & 16) { 5331 unmountChildren(c1, parentComponent, parentSuspense); 5332 } 5333 if (c2 !== c1) { 5334 hostSetElementText(container, c2); 5335 } 5336 } else { 5337 if (prevShapeFlag & 16) { 5338 if (shapeFlag & 16) { 5339 patchKeyedChildren( 5340 c1, 5341 c2, 5342 container, 5343 anchor, 5344 parentComponent, 5345 parentSuspense, 5346 namespace, 5347 slotScopeIds, 5348 optimized 5349 ); 5350 } else { 5351 unmountChildren(c1, parentComponent, parentSuspense, true); 5352 } 5353 } else { 5354 if (prevShapeFlag & 8) { 5355 hostSetElementText(container, ""); 5356 } 5357 if (shapeFlag & 16) { 5358 mountChildren( 5359 c2, 5360 container, 5361 anchor, 5362 parentComponent, 5363 parentSuspense, 5364 namespace, 5365 slotScopeIds, 5366 optimized 5367 ); 5368 } 5369 } 5370 } 5371 }; 5372 const patchUnkeyedChildren = (c1, c2, container, anchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 5373 c1 = c1 || EMPTY_ARR; 5374 c2 = c2 || EMPTY_ARR; 5375 const oldLength = c1.length; 5376 const newLength = c2.length; 5377 const commonLength = Math.min(oldLength, newLength); 5378 let i; 5379 for (i = 0; i < commonLength; i++) { 5380 const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 5381 patch( 5382 c1[i], 5383 nextChild, 5384 container, 5385 null, 5386 parentComponent, 5387 parentSuspense, 5388 namespace, 5389 slotScopeIds, 5390 optimized 5391 ); 5392 } 5393 if (oldLength > newLength) { 5394 unmountChildren( 5395 c1, 5396 parentComponent, 5397 parentSuspense, 5398 true, 5399 false, 5400 commonLength 5401 ); 5402 } else { 5403 mountChildren( 5404 c2, 5405 container, 5406 anchor, 5407 parentComponent, 5408 parentSuspense, 5409 namespace, 5410 slotScopeIds, 5411 optimized, 5412 commonLength 5413 ); 5414 } 5415 }; 5416 const patchKeyedChildren = (c1, c2, container, parentAnchor, parentComponent, parentSuspense, namespace, slotScopeIds, optimized) => { 5417 let i = 0; 5418 const l2 = c2.length; 5419 let e1 = c1.length - 1; 5420 let e2 = l2 - 1; 5421 while (i <= e1 && i <= e2) { 5422 const n1 = c1[i]; 5423 const n2 = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 5424 if (isSameVNodeType(n1, n2)) { 5425 patch( 5426 n1, 5427 n2, 5428 container, 5429 null, 5430 parentComponent, 5431 parentSuspense, 5432 namespace, 5433 slotScopeIds, 5434 optimized 5435 ); 5436 } else { 5437 break; 5438 } 5439 i++; 5440 } 5441 while (i <= e1 && i <= e2) { 5442 const n1 = c1[e1]; 5443 const n2 = c2[e2] = optimized ? cloneIfMounted(c2[e2]) : normalizeVNode(c2[e2]); 5444 if (isSameVNodeType(n1, n2)) { 5445 patch( 5446 n1, 5447 n2, 5448 container, 5449 null, 5450 parentComponent, 5451 parentSuspense, 5452 namespace, 5453 slotScopeIds, 5454 optimized 5455 ); 5456 } else { 5457 break; 5458 } 5459 e1--; 5460 e2--; 5461 } 5462 if (i > e1) { 5463 if (i <= e2) { 5464 const nextPos = e2 + 1; 5465 const anchor = nextPos < l2 ? c2[nextPos].el : parentAnchor; 5466 while (i <= e2) { 5467 patch( 5468 null, 5469 c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]), 5470 container, 5471 anchor, 5472 parentComponent, 5473 parentSuspense, 5474 namespace, 5475 slotScopeIds, 5476 optimized 5477 ); 5478 i++; 5479 } 5480 } 5481 } else if (i > e2) { 5482 while (i <= e1) { 5483 unmount(c1[i], parentComponent, parentSuspense, true); 5484 i++; 5485 } 5486 } else { 5487 const s1 = i; 5488 const s2 = i; 5489 const keyToNewIndexMap = /* @__PURE__ */ new Map(); 5490 for (i = s2; i <= e2; i++) { 5491 const nextChild = c2[i] = optimized ? cloneIfMounted(c2[i]) : normalizeVNode(c2[i]); 5492 if (nextChild.key != null) { 5493 if (!!(define_process_env_default$7.NODE_ENV !== "production") && keyToNewIndexMap.has(nextChild.key)) { 5494 warn$1$1( 5495 `Duplicate keys found during update:`, 5496 JSON.stringify(nextChild.key), 5497 `Make sure keys are unique.` 5498 ); 5499 } 5500 keyToNewIndexMap.set(nextChild.key, i); 5501 } 5502 } 5503 let j; 5504 let patched = 0; 5505 const toBePatched = e2 - s2 + 1; 5506 let moved = false; 5507 let maxNewIndexSoFar = 0; 5508 const newIndexToOldIndexMap = new Array(toBePatched); 5509 for (i = 0; i < toBePatched; i++) newIndexToOldIndexMap[i] = 0; 5510 for (i = s1; i <= e1; i++) { 5511 const prevChild = c1[i]; 5512 if (patched >= toBePatched) { 5513 unmount(prevChild, parentComponent, parentSuspense, true); 5514 continue; 5515 } 5516 let newIndex; 5517 if (prevChild.key != null) { 5518 newIndex = keyToNewIndexMap.get(prevChild.key); 5519 } else { 5520 for (j = s2; j <= e2; j++) { 5521 if (newIndexToOldIndexMap[j - s2] === 0 && isSameVNodeType(prevChild, c2[j])) { 5522 newIndex = j; 5523 break; 5524 } 5525 } 5526 } 5527 if (newIndex === void 0) { 5528 unmount(prevChild, parentComponent, parentSuspense, true); 5529 } else { 5530 newIndexToOldIndexMap[newIndex - s2] = i + 1; 5531 if (newIndex >= maxNewIndexSoFar) { 5532 maxNewIndexSoFar = newIndex; 5533 } else { 5534 moved = true; 5535 } 5536 patch( 5537 prevChild, 5538 c2[newIndex], 5539 container, 5540 null, 5541 parentComponent, 5542 parentSuspense, 5543 namespace, 5544 slotScopeIds, 5545 optimized 5546 ); 5547 patched++; 5548 } 5549 } 5550 const increasingNewIndexSequence = moved ? getSequence(newIndexToOldIndexMap) : EMPTY_ARR; 5551 j = increasingNewIndexSequence.length - 1; 5552 for (i = toBePatched - 1; i >= 0; i--) { 5553 const nextIndex = s2 + i; 5554 const nextChild = c2[nextIndex]; 5555 const anchorVNode = c2[nextIndex + 1]; 5556 const anchor = nextIndex + 1 < l2 ? ( 5557 // #13559, fallback to el placeholder for unresolved async component 5558 anchorVNode.el || anchorVNode.placeholder 5559 ) : parentAnchor; 5560 if (newIndexToOldIndexMap[i] === 0) { 5561 patch( 5562 null, 5563 nextChild, 5564 container, 5565 anchor, 5566 parentComponent, 5567 parentSuspense, 5568 namespace, 5569 slotScopeIds, 5570 optimized 5571 ); 5572 } else if (moved) { 5573 if (j < 0 || i !== increasingNewIndexSequence[j]) { 5574 move2(nextChild, container, anchor, 2); 5575 } else { 5576 j--; 5577 } 5578 } 5579 } 5580 } 5581 }; 5582 const move2 = (vnode, container, anchor, moveType, parentSuspense = null) => { 5583 const { el, type, transition, children, shapeFlag } = vnode; 5584 if (shapeFlag & 6) { 5585 move2(vnode.component.subTree, container, anchor, moveType); 5586 return; 5587 } 5588 if (shapeFlag & 128) { 5589 vnode.suspense.move(container, anchor, moveType); 5590 return; 5591 } 5592 if (shapeFlag & 64) { 5593 type.move(vnode, container, anchor, internals); 5594 return; 5595 } 5596 if (type === Fragment) { 5597 hostInsert(el, container, anchor); 5598 for (let i = 0; i < children.length; i++) { 5599 move2(children[i], container, anchor, moveType); 5600 } 5601 hostInsert(vnode.anchor, container, anchor); 5602 return; 5603 } 5604 if (type === Static) { 5605 moveStaticNode(vnode, container, anchor); 5606 return; 5607 } 5608 const needTransition2 = moveType !== 2 && shapeFlag & 1 && transition; 5609 if (needTransition2) { 5610 if (moveType === 0) { 5611 transition.beforeEnter(el); 5612 hostInsert(el, container, anchor); 5613 queuePostRenderEffect(() => transition.enter(el), parentSuspense); 5614 } else { 5615 const { leave, delayLeave, afterLeave } = transition; 5616 const remove22 = () => { 5617 if (vnode.ctx.isUnmounted) { 5618 hostRemove(el); 5619 } else { 5620 hostInsert(el, container, anchor); 5621 } 5622 }; 5623 const performLeave = () => { 5624 if (el._isLeaving) { 5625 el[leaveCbKey]( 5626 true 5627 /* cancelled */ 5628 ); 5629 } 5630 leave(el, () => { 5631 remove22(); 5632 afterLeave && afterLeave(); 5633 }); 5634 }; 5635 if (delayLeave) { 5636 delayLeave(el, remove22, performLeave); 5637 } else { 5638 performLeave(); 5639 } 5640 } 5641 } else { 5642 hostInsert(el, container, anchor); 5643 } 5644 }; 5645 const unmount = (vnode, parentComponent, parentSuspense, doRemove = false, optimized = false) => { 5646 const { 5647 type, 5648 props, 5649 ref: ref3, 5650 children, 5651 dynamicChildren, 5652 shapeFlag, 5653 patchFlag, 5654 dirs, 5655 cacheIndex 5656 } = vnode; 5657 if (patchFlag === -2) { 5658 optimized = false; 5659 } 5660 if (ref3 != null) { 5661 pauseTracking(); 5662 setRef(ref3, null, parentSuspense, vnode, true); 5663 resetTracking(); 5664 } 5665 if (cacheIndex != null) { 5666 parentComponent.renderCache[cacheIndex] = void 0; 5667 } 5668 if (shapeFlag & 256) { 5669 parentComponent.ctx.deactivate(vnode); 5670 return; 5671 } 5672 const shouldInvokeDirs = shapeFlag & 1 && dirs; 5673 const shouldInvokeVnodeHook = !isAsyncWrapper(vnode); 5674 let vnodeHook; 5675 if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeBeforeUnmount)) { 5676 invokeVNodeHook(vnodeHook, parentComponent, vnode); 5677 } 5678 if (shapeFlag & 6) { 5679 unmountComponent(vnode.component, parentSuspense, doRemove); 5680 } else { 5681 if (shapeFlag & 128) { 5682 vnode.suspense.unmount(parentSuspense, doRemove); 5683 return; 5684 } 5685 if (shouldInvokeDirs) { 5686 invokeDirectiveHook(vnode, null, parentComponent, "beforeUnmount"); 5687 } 5688 if (shapeFlag & 64) { 5689 vnode.type.remove( 5690 vnode, 5691 parentComponent, 5692 parentSuspense, 5693 internals, 5694 doRemove 5695 ); 5696 } else if (dynamicChildren && // #5154 5697 // when v-once is used inside a block, setBlockTracking(-1) marks the 5698 // parent block with hasOnce: true 5699 // so that it doesn't take the fast path during unmount - otherwise 5700 // components nested in v-once are never unmounted. 5701 !dynamicChildren.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments 5702 (type !== Fragment || patchFlag > 0 && patchFlag & 64)) { 5703 unmountChildren( 5704 dynamicChildren, 5705 parentComponent, 5706 parentSuspense, 5707 false, 5708 true 5709 ); 5710 } else if (type === Fragment && patchFlag & (128 | 256) || !optimized && shapeFlag & 16) { 5711 unmountChildren(children, parentComponent, parentSuspense); 5712 } 5713 if (doRemove) { 5714 remove2(vnode); 5715 } 5716 } 5717 if (shouldInvokeVnodeHook && (vnodeHook = props && props.onVnodeUnmounted) || shouldInvokeDirs) { 5718 queuePostRenderEffect(() => { 5719 vnodeHook && invokeVNodeHook(vnodeHook, parentComponent, vnode); 5720 shouldInvokeDirs && invokeDirectiveHook(vnode, null, parentComponent, "unmounted"); 5721 }, parentSuspense); 5722 } 5723 }; 5724 const remove2 = (vnode) => { 5725 const { type, el, anchor, transition } = vnode; 5726 if (type === Fragment) { 5727 if (!!(define_process_env_default$7.NODE_ENV !== "production") && vnode.patchFlag > 0 && vnode.patchFlag & 2048 && transition && !transition.persisted) { 5728 vnode.children.forEach((child) => { 5729 if (child.type === Comment) { 5730 hostRemove(child.el); 5731 } else { 5732 remove2(child); 5733 } 5734 }); 5735 } else { 5736 removeFragment(el, anchor); 5737 } 5738 return; 5739 } 5740 if (type === Static) { 5741 removeStaticNode(vnode); 5742 return; 5743 } 5744 const performRemove = () => { 5745 hostRemove(el); 5746 if (transition && !transition.persisted && transition.afterLeave) { 5747 transition.afterLeave(); 5748 } 5749 }; 5750 if (vnode.shapeFlag & 1 && transition && !transition.persisted) { 5751 const { leave, delayLeave } = transition; 5752 const performLeave = () => leave(el, performRemove); 5753 if (delayLeave) { 5754 delayLeave(vnode.el, performRemove, performLeave); 5755 } else { 5756 performLeave(); 5757 } 5758 } else { 5759 performRemove(); 5760 } 5761 }; 5762 const removeFragment = (cur, end) => { 5763 let next; 5764 while (cur !== end) { 5765 next = hostNextSibling(cur); 5766 hostRemove(cur); 5767 cur = next; 5768 } 5769 hostRemove(end); 5770 }; 5771 const unmountComponent = (instance, parentSuspense, doRemove) => { 5772 if (!!(define_process_env_default$7.NODE_ENV !== "production") && instance.type.__hmrId) { 5773 unregisterHMR(instance); 5774 } 5775 const { bum, scope, job, subTree, um, m, a } = instance; 5776 invalidateMount(m); 5777 invalidateMount(a); 5778 if (bum) { 5779 invokeArrayFns(bum); 5780 } 5781 scope.stop(); 5782 if (job) { 5783 job.flags |= 8; 5784 unmount(subTree, instance, parentSuspense, doRemove); 5785 } 5786 if (um) { 5787 queuePostRenderEffect(um, parentSuspense); 5788 } 5789 queuePostRenderEffect(() => { 5790 instance.isUnmounted = true; 5791 }, parentSuspense); 5792 if (!!(define_process_env_default$7.NODE_ENV !== "production") || false) { 5793 devtoolsComponentRemoved(instance); 5794 } 5795 }; 5796 const unmountChildren = (children, parentComponent, parentSuspense, doRemove = false, optimized = false, start = 0) => { 5797 for (let i = start; i < children.length; i++) { 5798 unmount(children[i], parentComponent, parentSuspense, doRemove, optimized); 5799 } 5800 }; 5801 const getNextHostNode = (vnode) => { 5802 if (vnode.shapeFlag & 6) { 5803 return getNextHostNode(vnode.component.subTree); 5804 } 5805 if (vnode.shapeFlag & 128) { 5806 return vnode.suspense.next(); 5807 } 5808 const el = hostNextSibling(vnode.anchor || vnode.el); 5809 const teleportEnd = el && el[TeleportEndKey]; 5810 return teleportEnd ? hostNextSibling(teleportEnd) : el; 5811 }; 5812 let isFlushing = false;
vendor: 7,216 bytes, lines 5813-6067
5813 const render2 = (vnode, container, namespace) => { 5814 if (vnode == null) { 5815 if (container._vnode) { 5816 unmount(container._vnode, null, null, true); 5817 } 5818 } else { 5819 patch( 5820 container._vnode || null, 5821 vnode, 5822 container, 5823 null, 5824 null, 5825 null, 5826 namespace 5827 ); 5828 } 5829 container._vnode = vnode; 5830 if (!isFlushing) { 5831 isFlushing = true; 5832 flushPreFlushCbs(); 5833 flushPostFlushCbs(); 5834 isFlushing = false; 5835 } 5836 }; 5837 const internals = { 5838 p: patch, 5839 um: unmount, 5840 m: move2, 5841 r: remove2, 5842 mt: mountComponent, 5843 mc: mountChildren, 5844 pc: patchChildren, 5845 pbc: patchBlockChildren, 5846 n: getNextHostNode, 5847 o: options 5848 }; 5849 let hydrate; 5850 return { 5851 render: render2, 5852 hydrate, 5853 createApp: createAppAPI(render2) 5854 }; 5855} 5856function resolveChildrenNamespace({ type, props }, currentNamespace) { 5857 return currentNamespace === "svg" && type === "foreignObject" || currentNamespace === "mathml" && type === "annotation-xml" && props && props.encoding && props.encoding.includes("html") ? void 0 : currentNamespace; 5858} 5859function toggleRecurse({ effect: effect2, job }, allowed) { 5860 if (allowed) { 5861 effect2.flags |= 32; 5862 job.flags |= 4; 5863 } else { 5864 effect2.flags &= -33; 5865 job.flags &= -5; 5866 } 5867} 5868function needTransition(parentSuspense, transition) { 5869 return (!parentSuspense || parentSuspense && !parentSuspense.pendingBranch) && transition && !transition.persisted; 5870} 5871function traverseStaticChildren(n1, n2, shallow = false) { 5872 const ch1 = n1.children; 5873 const ch2 = n2.children; 5874 if (isArray$1(ch1) && isArray$1(ch2)) { 5875 for (let i = 0; i < ch1.length; i++) { 5876 const c1 = ch1[i]; 5877 let c2 = ch2[i]; 5878 if (c2.shapeFlag & 1 && !c2.dynamicChildren) { 5879 if (c2.patchFlag <= 0 || c2.patchFlag === 32) { 5880 c2 = ch2[i] = cloneIfMounted(ch2[i]); 5881 c2.el = c1.el; 5882 } 5883 if (!shallow && c2.patchFlag !== -2) 5884 traverseStaticChildren(c1, c2); 5885 } 5886 if (c2.type === Text && // avoid cached text nodes retaining detached dom nodes 5887 c2.patchFlag !== -1) { 5888 c2.el = c1.el; 5889 } 5890 if (c2.type === Comment && !c2.el) { 5891 c2.el = c1.el; 5892 } 5893 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 5894 c2.el && (c2.el.__vnode = c2); 5895 } 5896 } 5897 } 5898} 5899function getSequence(arr) { 5900 const p2 = arr.slice(); 5901 const result = [0]; 5902 let i, j, u, v, c; 5903 const len = arr.length; 5904 for (i = 0; i < len; i++) { 5905 const arrI = arr[i]; 5906 if (arrI !== 0) { 5907 j = result[result.length - 1]; 5908 if (arr[j] < arrI) { 5909 p2[i] = j; 5910 result.push(i); 5911 continue; 5912 } 5913 u = 0; 5914 v = result.length - 1; 5915 while (u < v) { 5916 c = u + v >> 1; 5917 if (arr[result[c]] < arrI) { 5918 u = c + 1; 5919 } else { 5920 v = c; 5921 } 5922 } 5923 if (arrI < arr[result[u]]) { 5924 if (u > 0) { 5925 p2[i] = result[u - 1]; 5926 } 5927 result[u] = i; 5928 } 5929 } 5930 } 5931 u = result.length; 5932 v = result[u - 1]; 5933 while (u-- > 0) { 5934 result[u] = v; 5935 v = p2[v]; 5936 } 5937 return result; 5938} 5939function locateNonHydratedAsyncRoot(instance) { 5940 const subComponent = instance.subTree.component; 5941 if (subComponent) { 5942 if (subComponent.asyncDep && !subComponent.asyncResolved) { 5943 return subComponent; 5944 } else { 5945 return locateNonHydratedAsyncRoot(subComponent); 5946 } 5947 } 5948} 5949function invalidateMount(hooks) { 5950 if (hooks) { 5951 for (let i = 0; i < hooks.length; i++) 5952 hooks[i].flags |= 8; 5953 } 5954} 5955const ssrContextKey = Symbol.for("v-scx"); 5956const useSSRContext = () => { 5957 { 5958 const ctx = inject(ssrContextKey); 5959 if (!ctx) { 5960 !!(define_process_env_default$7.NODE_ENV !== "production") && warn$1$1( 5961 `Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build.` 5962 ); 5963 } 5964 return ctx; 5965 } 5966}; 5967function watch(source, cb, options) { 5968 if (!!(define_process_env_default$7.NODE_ENV !== "production") && !isFunction$1(cb)) { 5969 warn$1$1( 5970 `\`watch(fn, options?)\` signature has been moved to a separate API. Use \`watchEffect(fn, options?)\` instead. \`watch\` now only supports \`watch(source, cb, options?) signature.` 5971 ); 5972 } 5973 return doWatch(source, cb, options); 5974} 5975function doWatch(source, cb, options = EMPTY_OBJ) { 5976 const { immediate, deep, flush, once: once2 } = options; 5977 if (!!(define_process_env_default$7.NODE_ENV !== "production") && !cb) { 5978 if (immediate !== void 0) { 5979 warn$1$1( 5980 `watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.` 5981 ); 5982 } 5983 if (deep !== void 0) { 5984 warn$1$1( 5985 `watch() "deep" option is only respected when using the watch(source, callback, options?) signature.` 5986 ); 5987 } 5988 if (once2 !== void 0) { 5989 warn$1$1( 5990 `watch() "once" option is only respected when using the watch(source, callback, options?) signature.` 5991 ); 5992 } 5993 } 5994 const baseWatchOptions = extend({}, options); 5995 if (!!(define_process_env_default$7.NODE_ENV !== "production")) baseWatchOptions.onWarn = warn$1$1; 5996 const runsImmediately = cb && immediate || !cb && flush !== "post"; 5997 let ssrCleanup; 5998 if (isInSSRComponentSetup) { 5999 if (flush === "sync") { 6000 const ctx = useSSRContext(); 6001 ssrCleanup = ctx.__watcherHandles || (ctx.__watcherHandles = []); 6002 } else if (!runsImmediately) { 6003 const watchStopHandle = () => { 6004 }; 6005 watchStopHandle.stop = NOOP; 6006 watchStopHandle.resume = NOOP; 6007 watchStopHandle.pause = NOOP; 6008 return watchStopHandle; 6009 } 6010 } 6011 const instance = currentInstance$1; 6012 baseWatchOptions.call = (fn, type, args) => callWithAsyncErrorHandling(fn, instance, type, args); 6013 let isPre = false; 6014 if (flush === "post") { 6015 baseWatchOptions.scheduler = (job) => { 6016 queuePostRenderEffect(job, instance && instance.suspense); 6017 }; 6018 } else if (flush !== "sync") { 6019 isPre = true; 6020 baseWatchOptions.scheduler = (job, isFirstRun) => { 6021 if (isFirstRun) { 6022 job(); 6023 } else { 6024 queueJob(job); 6025 } 6026 }; 6027 } 6028 baseWatchOptions.augmentJob = (job) => { 6029 if (cb) { 6030 job.flags |= 4; 6031 } 6032 if (isPre) { 6033 job.flags |= 2; 6034 if (instance) { 6035 job.id = instance.uid; 6036 job.i = instance; 6037 } 6038 } 6039 }; 6040 const watchHandle = watch$1(source, cb, baseWatchOptions); 6041 if (isInSSRComponentSetup) { 6042 if (ssrCleanup) { 6043 ssrCleanup.push(watchHandle); 6044 } else if (runsImmediately) { 6045 watchHandle(); 6046 } 6047 } 6048 return watchHandle; 6049} 6050function instanceWatch(source, value, options) { 6051 const publicThis = this.proxy; 6052 const getter = isString$2(source) ? source.includes(".") ? createPathGetter(publicThis, source) : () => publicThis[source] : source.bind(publicThis, publicThis); 6053 let cb; 6054 if (isFunction$1(value)) { 6055 cb = value; 6056 } else { 6057 cb = value.handler; 6058 options = value; 6059 } 6060 const reset = setCurrentInstance(this); 6061 const res = doWatch(getter, cb.bind(publicThis), options); 6062 reset(); 6063 return res; 6064} 6065function createPathGetter(ctx, path) { 6066 const segments = path.split("."); 6067 return () => {
vendor: 4,484 bytes, lines 6068-6209
6068 let cur = ctx; 6069 for (let i = 0; i < segments.length && cur; i++) { 6070 cur = cur[segments[i]]; 6071 } 6072 return cur; 6073 }; 6074} 6075const getModelModifiers = (props, modelName) => { 6076 return modelName === "modelValue" || modelName === "model-value" ? props.modelModifiers : props[`${modelName}Modifiers`] || props[`${camelize(modelName)}Modifiers`] || props[`${hyphenate(modelName)}Modifiers`]; 6077}; 6078function emit(instance, event, ...rawArgs) { 6079 if (instance.isUnmounted) return; 6080 const props = instance.vnode.props || EMPTY_OBJ; 6081 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 6082 const { 6083 emitsOptions, 6084 propsOptions: [propsOptions] 6085 } = instance; 6086 if (emitsOptions) { 6087 if (!(event in emitsOptions) && true) { 6088 if (!propsOptions || !(toHandlerKey(camelize(event)) in propsOptions)) { 6089 warn$1$1( 6090 `Component emitted event "${event}" but it is neither declared in the emits option nor as an "${toHandlerKey(camelize(event))}" prop.` 6091 ); 6092 } 6093 } else { 6094 const validator = emitsOptions[event]; 6095 if (isFunction$1(validator)) { 6096 const isValid = validator(...rawArgs); 6097 if (!isValid) { 6098 warn$1$1( 6099 `Invalid event arguments: event validation failed for event "${event}".` 6100 ); 6101 } 6102 } 6103 } 6104 } 6105 } 6106 let args = rawArgs; 6107 const isModelListener2 = event.startsWith("update:"); 6108 const modifiers = isModelListener2 && getModelModifiers(props, event.slice(7)); 6109 if (modifiers) { 6110 if (modifiers.trim) { 6111 args = rawArgs.map((a) => isString$2(a) ? a.trim() : a); 6112 } 6113 if (modifiers.number) { 6114 args = rawArgs.map(looseToNumber); 6115 } 6116 } 6117 if (!!(define_process_env_default$7.NODE_ENV !== "production") || false) { 6118 devtoolsComponentEmit(instance, event, args); 6119 } 6120 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 6121 const lowerCaseEvent = event.toLowerCase(); 6122 if (lowerCaseEvent !== event && props[toHandlerKey(lowerCaseEvent)]) { 6123 warn$1$1( 6124 `Event "${lowerCaseEvent}" is emitted in component ${formatComponentName( 6125 instance, 6126 instance.type 6127 )} but the handler is registered for "${event}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${hyphenate( 6128 event 6129 )}" instead of "${event}".` 6130 ); 6131 } 6132 } 6133 let handlerName; 6134 let handler = props[handlerName = toHandlerKey(event)] || // also try camelCase event handler (#2249) 6135 props[handlerName = toHandlerKey(camelize(event))]; 6136 if (!handler && isModelListener2) { 6137 handler = props[handlerName = toHandlerKey(hyphenate(event))]; 6138 } 6139 if (handler) { 6140 callWithAsyncErrorHandling( 6141 handler, 6142 instance, 6143 6, 6144 args 6145 ); 6146 } 6147 const onceHandler = props[handlerName + `Once`]; 6148 if (onceHandler) { 6149 if (!instance.emitted) { 6150 instance.emitted = {}; 6151 } else if (instance.emitted[handlerName]) { 6152 return; 6153 } 6154 instance.emitted[handlerName] = true; 6155 callWithAsyncErrorHandling( 6156 onceHandler, 6157 instance, 6158 6, 6159 args 6160 ); 6161 } 6162} 6163const mixinEmitsCache = /* @__PURE__ */ new WeakMap(); 6164function normalizeEmitsOptions(comp, appContext, asMixin = false) { 6165 const cache2 = asMixin ? mixinEmitsCache : appContext.emitsCache; 6166 const cached = cache2.get(comp); 6167 if (cached !== void 0) { 6168 return cached; 6169 } 6170 const raw = comp.emits; 6171 let normalized = {}; 6172 let hasExtends = false; 6173 if (!isFunction$1(comp)) { 6174 const extendEmits = (raw2) => { 6175 const normalizedFromExtend = normalizeEmitsOptions(raw2, appContext, true); 6176 if (normalizedFromExtend) { 6177 hasExtends = true; 6178 extend(normalized, normalizedFromExtend); 6179 } 6180 }; 6181 if (!asMixin && appContext.mixins.length) { 6182 appContext.mixins.forEach(extendEmits); 6183 } 6184 if (comp.extends) { 6185 extendEmits(comp.extends); 6186 } 6187 if (comp.mixins) { 6188 comp.mixins.forEach(extendEmits); 6189 } 6190 } 6191 if (!raw && !hasExtends) { 6192 if (isObject$3(comp)) { 6193 cache2.set(comp, null); 6194 } 6195 return null; 6196 } 6197 if (isArray$1(raw)) { 6198 raw.forEach((key) => normalized[key] = null); 6199 } else { 6200 extend(normalized, raw); 6201 } 6202 if (isObject$3(comp)) { 6203 cache2.set(comp, normalized); 6204 } 6205 return normalized; 6206} 6207function isEmitListener(options, key) { 6208 if (!options || !isOn(key)) { 6209 return false;
vendor: 8,233 bytes, lines 6210-6450
6210 } 6211 key = key.slice(2).replace(/Once$/, ""); 6212 return hasOwn$1(options, key[0].toLowerCase() + key.slice(1)) || hasOwn$1(options, hyphenate(key)) || hasOwn$1(options, key); 6213} 6214let accessedAttrs = false; 6215function markAttrsAccessed() { 6216 accessedAttrs = true; 6217} 6218function renderComponentRoot(instance) { 6219 const { 6220 type: Component, 6221 vnode, 6222 proxy, 6223 withProxy, 6224 propsOptions: [propsOptions], 6225 slots, 6226 attrs, 6227 emit: emit2, 6228 render: render2, 6229 renderCache, 6230 props, 6231 data, 6232 setupState, 6233 ctx, 6234 inheritAttrs 6235 } = instance; 6236 const prev = setCurrentRenderingInstance(instance); 6237 let result; 6238 let fallthroughAttrs; 6239 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 6240 accessedAttrs = false; 6241 } 6242 try { 6243 if (vnode.shapeFlag & 4) { 6244 const proxyToUse = withProxy || proxy; 6245 const thisProxy = !!(define_process_env_default$7.NODE_ENV !== "production") && setupState.__isScriptSetup ? new Proxy(proxyToUse, { 6246 get(target, key, receiver) { 6247 warn$1$1( 6248 `Property '${String( 6249 key 6250 )}' was accessed via 'this'. Avoid using 'this' in templates.` 6251 ); 6252 return Reflect.get(target, key, receiver); 6253 } 6254 }) : proxyToUse; 6255 result = normalizeVNode( 6256 render2.call( 6257 thisProxy, 6258 proxyToUse, 6259 renderCache, 6260 !!(define_process_env_default$7.NODE_ENV !== "production") ? shallowReadonly(props) : props, 6261 setupState, 6262 data, 6263 ctx 6264 ) 6265 ); 6266 fallthroughAttrs = attrs; 6267 } else { 6268 const render22 = Component; 6269 if (!!(define_process_env_default$7.NODE_ENV !== "production") && attrs === props) { 6270 markAttrsAccessed(); 6271 } 6272 result = normalizeVNode( 6273 render22.length > 1 ? render22( 6274 !!(define_process_env_default$7.NODE_ENV !== "production") ? shallowReadonly(props) : props, 6275 !!(define_process_env_default$7.NODE_ENV !== "production") ? { 6276 get attrs() { 6277 markAttrsAccessed(); 6278 return shallowReadonly(attrs); 6279 }, 6280 slots, 6281 emit: emit2 6282 } : { attrs, slots, emit: emit2 } 6283 ) : render22( 6284 !!(define_process_env_default$7.NODE_ENV !== "production") ? shallowReadonly(props) : props, 6285 null 6286 ) 6287 ); 6288 fallthroughAttrs = Component.props ? attrs : getFunctionalFallthrough(attrs); 6289 } 6290 } catch (err) { 6291 blockStack.length = 0; 6292 handleError(err, instance, 1); 6293 result = createVNode(Comment); 6294 } 6295 let root = result; 6296 let setRoot = void 0; 6297 if (!!(define_process_env_default$7.NODE_ENV !== "production") && result.patchFlag > 0 && result.patchFlag & 2048) { 6298 [root, setRoot] = getChildRoot(result); 6299 } 6300 if (fallthroughAttrs && inheritAttrs !== false) { 6301 const keys = Object.keys(fallthroughAttrs); 6302 const { shapeFlag } = root; 6303 if (keys.length) { 6304 if (shapeFlag & (1 | 6)) { 6305 if (propsOptions && keys.some(isModelListener)) { 6306 fallthroughAttrs = filterModelListeners( 6307 fallthroughAttrs, 6308 propsOptions 6309 ); 6310 } 6311 root = cloneVNode(root, fallthroughAttrs, false, true); 6312 } else if (!!(define_process_env_default$7.NODE_ENV !== "production") && !accessedAttrs && root.type !== Comment) { 6313 const allAttrs = Object.keys(attrs); 6314 const eventAttrs = []; 6315 const extraAttrs = []; 6316 for (let i = 0, l = allAttrs.length; i < l; i++) { 6317 const key = allAttrs[i]; 6318 if (isOn(key)) { 6319 if (!isModelListener(key)) { 6320 eventAttrs.push(key[2].toLowerCase() + key.slice(3)); 6321 } 6322 } else { 6323 extraAttrs.push(key); 6324 } 6325 } 6326 if (extraAttrs.length) { 6327 warn$1$1( 6328 `Extraneous non-props attributes (${extraAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.` 6329 ); 6330 } 6331 if (eventAttrs.length) { 6332 warn$1$1( 6333 `Extraneous non-emits event listeners (${eventAttrs.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.` 6334 ); 6335 } 6336 } 6337 } 6338 } 6339 if (vnode.dirs) { 6340 if (!!(define_process_env_default$7.NODE_ENV !== "production") && !isElementRoot(root)) { 6341 warn$1$1( 6342 `Runtime directive used on component with non-element root node. The directives will not function as intended.` 6343 ); 6344 } 6345 root = cloneVNode(root, null, false, true); 6346 root.dirs = root.dirs ? root.dirs.concat(vnode.dirs) : vnode.dirs; 6347 } 6348 if (vnode.transition) { 6349 if (!!(define_process_env_default$7.NODE_ENV !== "production") && !isElementRoot(root)) { 6350 warn$1$1( 6351 `Component inside <Transition> renders non-element root node that cannot be animated.` 6352 ); 6353 } 6354 setTransitionHooks(root, vnode.transition); 6355 } 6356 if (!!(define_process_env_default$7.NODE_ENV !== "production") && setRoot) { 6357 setRoot(root); 6358 } else { 6359 result = root; 6360 } 6361 setCurrentRenderingInstance(prev); 6362 return result; 6363} 6364const getChildRoot = (vnode) => { 6365 const rawChildren = vnode.children; 6366 const dynamicChildren = vnode.dynamicChildren; 6367 const childRoot = filterSingleRoot(rawChildren, false); 6368 if (!childRoot) { 6369 return [vnode, void 0]; 6370 } else if (!!(define_process_env_default$7.NODE_ENV !== "production") && childRoot.patchFlag > 0 && childRoot.patchFlag & 2048) { 6371 return getChildRoot(childRoot); 6372 } 6373 const index = rawChildren.indexOf(childRoot); 6374 const dynamicIndex = dynamicChildren ? dynamicChildren.indexOf(childRoot) : -1; 6375 const setRoot = (updatedRoot) => { 6376 rawChildren[index] = updatedRoot; 6377 if (dynamicChildren) { 6378 if (dynamicIndex > -1) { 6379 dynamicChildren[dynamicIndex] = updatedRoot; 6380 } else if (updatedRoot.patchFlag > 0) { 6381 vnode.dynamicChildren = [...dynamicChildren, updatedRoot]; 6382 } 6383 } 6384 }; 6385 return [normalizeVNode(childRoot), setRoot]; 6386}; 6387function filterSingleRoot(children, recurse = true) { 6388 let singleRoot; 6389 for (let i = 0; i < children.length; i++) { 6390 const child = children[i]; 6391 if (isVNode$1(child)) { 6392 if (child.type !== Comment || child.children === "v-if") { 6393 if (singleRoot) { 6394 return; 6395 } else { 6396 singleRoot = child; 6397 if (!!(define_process_env_default$7.NODE_ENV !== "production") && recurse && singleRoot.patchFlag > 0 && singleRoot.patchFlag & 2048) { 6398 return filterSingleRoot(singleRoot.children); 6399 } 6400 } 6401 } 6402 } else { 6403 return; 6404 } 6405 } 6406 return singleRoot; 6407} 6408const getFunctionalFallthrough = (attrs) => { 6409 let res; 6410 for (const key in attrs) { 6411 if (key === "class" || key === "style" || isOn(key)) { 6412 (res || (res = {}))[key] = attrs[key]; 6413 } 6414 } 6415 return res; 6416}; 6417const filterModelListeners = (attrs, props) => { 6418 const res = {}; 6419 for (const key in attrs) { 6420 if (!isModelListener(key) || !(key.slice(9) in props)) { 6421 res[key] = attrs[key]; 6422 } 6423 } 6424 return res; 6425}; 6426const isElementRoot = (vnode) => { 6427 return vnode.shapeFlag & (6 | 1) || vnode.type === Comment; 6428}; 6429function shouldUpdateComponent(prevVNode, nextVNode, optimized) { 6430 const { props: prevProps, children: prevChildren, component } = prevVNode; 6431 const { props: nextProps, children: nextChildren, patchFlag } = nextVNode; 6432 const emits = component.emitsOptions; 6433 if (!!(define_process_env_default$7.NODE_ENV !== "production") && (prevChildren || nextChildren) && isHmrUpdating) { 6434 return true; 6435 } 6436 if (nextVNode.dirs || nextVNode.transition) { 6437 return true; 6438 } 6439 if (optimized && patchFlag >= 0) { 6440 if (patchFlag & 1024) { 6441 return true; 6442 } 6443 if (patchFlag & 16) { 6444 if (!prevProps) { 6445 return !!nextProps; 6446 } 6447 return hasPropsChanged(prevProps, nextProps, emits); 6448 } else if (patchFlag & 8) { 6449 const dynamicProps = nextVNode.dynamicProps; 6450 for (let i = 0; i < dynamicProps.length; i++) {
vendor: 4,908 bytes, lines 6451-6636
6451 const key = dynamicProps[i]; 6452 if (nextProps[key] !== prevProps[key] && !isEmitListener(emits, key)) { 6453 return true; 6454 } 6455 } 6456 } 6457 } else { 6458 if (prevChildren || nextChildren) { 6459 if (!nextChildren || !nextChildren.$stable) { 6460 return true; 6461 } 6462 } 6463 if (prevProps === nextProps) { 6464 return false; 6465 } 6466 if (!prevProps) { 6467 return !!nextProps; 6468 } 6469 if (!nextProps) { 6470 return true; 6471 } 6472 return hasPropsChanged(prevProps, nextProps, emits); 6473 } 6474 return false; 6475} 6476function hasPropsChanged(prevProps, nextProps, emitsOptions) { 6477 const nextKeys = Object.keys(nextProps); 6478 if (nextKeys.length !== Object.keys(prevProps).length) { 6479 return true; 6480 } 6481 for (let i = 0; i < nextKeys.length; i++) { 6482 const key = nextKeys[i]; 6483 if (nextProps[key] !== prevProps[key] && !isEmitListener(emitsOptions, key)) { 6484 return true; 6485 } 6486 } 6487 return false; 6488} 6489function updateHOCHostEl({ vnode, parent }, el) { 6490 while (parent) { 6491 const root = parent.subTree; 6492 if (root.suspense && root.suspense.activeBranch === vnode) { 6493 root.el = vnode.el; 6494 } 6495 if (root === vnode) { 6496 (vnode = parent.vnode).el = el; 6497 parent = parent.parent; 6498 } else { 6499 break; 6500 } 6501 } 6502} 6503const isSuspense = (type) => type.__isSuspense; 6504function queueEffectWithSuspense(fn, suspense) { 6505 if (suspense && suspense.pendingBranch) { 6506 if (isArray$1(fn)) { 6507 suspense.effects.push(...fn); 6508 } else { 6509 suspense.effects.push(fn); 6510 } 6511 } else { 6512 queuePostFlushCb(fn); 6513 } 6514} 6515const Fragment = Symbol.for("v-fgt"); 6516const Text = Symbol.for("v-txt"); 6517const Comment = Symbol.for("v-cmt"); 6518const Static = Symbol.for("v-stc"); 6519const blockStack = []; 6520let currentBlock = null; 6521function openBlock(disableTracking = false) { 6522 blockStack.push(currentBlock = disableTracking ? null : []); 6523} 6524function closeBlock() { 6525 blockStack.pop(); 6526 currentBlock = blockStack[blockStack.length - 1] || null; 6527} 6528let isBlockTreeEnabled = 1; 6529function setBlockTracking(value, inVOnce = false) { 6530 isBlockTreeEnabled += value; 6531 if (value < 0 && currentBlock && inVOnce) { 6532 currentBlock.hasOnce = true; 6533 } 6534} 6535function setupBlock(vnode) { 6536 vnode.dynamicChildren = isBlockTreeEnabled > 0 ? currentBlock || EMPTY_ARR : null; 6537 closeBlock(); 6538 if (isBlockTreeEnabled > 0 && currentBlock) { 6539 currentBlock.push(vnode); 6540 } 6541 return vnode; 6542} 6543function createElementBlock(type, props, children, patchFlag, dynamicProps, shapeFlag) { 6544 return setupBlock( 6545 createBaseVNode( 6546 type, 6547 props, 6548 children, 6549 patchFlag, 6550 dynamicProps, 6551 shapeFlag, 6552 true 6553 ) 6554 ); 6555} 6556function createBlock(type, props, children, patchFlag, dynamicProps) { 6557 return setupBlock( 6558 createVNode( 6559 type, 6560 props, 6561 children, 6562 patchFlag, 6563 dynamicProps, 6564 true 6565 ) 6566 ); 6567} 6568function isVNode$1(value) { 6569 return value ? value.__v_isVNode === true : false; 6570} 6571function isSameVNodeType(n1, n2) { 6572 if (!!(define_process_env_default$7.NODE_ENV !== "production") && n2.shapeFlag & 6 && n1.component) { 6573 const dirtyInstances = hmrDirtyComponents.get(n2.type); 6574 if (dirtyInstances && dirtyInstances.has(n1.component)) { 6575 n1.shapeFlag &= -257; 6576 n2.shapeFlag &= -513; 6577 return false; 6578 } 6579 } 6580 return n1.type === n2.type && n1.key === n2.key; 6581} 6582const createVNodeWithArgsTransform = (...args) => { 6583 return _createVNode( 6584 ...args 6585 ); 6586}; 6587const normalizeKey = ({ key }) => key != null ? key : null; 6588const normalizeRef = ({ 6589 ref: ref3, 6590 ref_key, 6591 ref_for 6592}) => { 6593 if (typeof ref3 === "number") { 6594 ref3 = "" + ref3; 6595 } 6596 return ref3 != null ? isString$2(ref3) || isRef(ref3) || isFunction$1(ref3) ? { i: currentRenderingInstance, r: ref3, k: ref_key, f: !!ref_for } : ref3 : null; 6597}; 6598function createBaseVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, shapeFlag = type === Fragment ? 0 : 1, isBlockNode = false, needFullChildrenNormalization = false) { 6599 const vnode = { 6600 __v_isVNode: true, 6601 __v_skip: true, 6602 type, 6603 props, 6604 key: props && normalizeKey(props), 6605 ref: props && normalizeRef(props), 6606 scopeId: currentScopeId, 6607 slotScopeIds: null, 6608 children, 6609 component: null, 6610 suspense: null, 6611 ssContent: null, 6612 ssFallback: null, 6613 dirs: null, 6614 transition: null, 6615 el: null, 6616 anchor: null, 6617 target: null, 6618 targetStart: null, 6619 targetAnchor: null, 6620 staticCount: 0, 6621 shapeFlag, 6622 patchFlag, 6623 dynamicProps, 6624 dynamicChildren: null, 6625 appContext: null, 6626 ctx: currentRenderingInstance 6627 }; 6628 if (needFullChildrenNormalization) { 6629 normalizeChildren(vnode, children); 6630 if (shapeFlag & 128) { 6631 type.normalize(vnode); 6632 } 6633 } else if (children) { 6634 vnode.shapeFlag |= isString$2(children) ? 8 : 16; 6635 } 6636 if (!!(define_process_env_default$7.NODE_ENV !== "production") && vnode.key !== vnode.key) {
vendor: 4,529 bytes, lines 6637-6748
6637 warn$1$1(`VNode created with invalid key (NaN). VNode type:`, vnode.type); 6638 } 6639 if (isBlockTreeEnabled > 0 && // avoid a block node from tracking itself 6640 !isBlockNode && // has current parent block 6641 currentBlock && // presence of a patch flag indicates this node needs patching on updates. 6642 // component nodes also should always be patched, because even if the 6643 // component doesn't need to update, it needs to persist the instance on to 6644 // the next vnode so that it can be properly unmounted later. 6645 (vnode.patchFlag > 0 || shapeFlag & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the 6646 // vnode should not be considered dynamic due to handler caching. 6647 vnode.patchFlag !== 32) { 6648 currentBlock.push(vnode); 6649 } 6650 return vnode; 6651} 6652const createVNode = !!(define_process_env_default$7.NODE_ENV !== "production") ? createVNodeWithArgsTransform : _createVNode; 6653function _createVNode(type, props = null, children = null, patchFlag = 0, dynamicProps = null, isBlockNode = false) { 6654 if (!type || type === NULL_DYNAMIC_COMPONENT) { 6655 if (!!(define_process_env_default$7.NODE_ENV !== "production") && !type) { 6656 warn$1$1(`Invalid vnode type when creating vnode: ${type}.`); 6657 } 6658 type = Comment; 6659 } 6660 if (isVNode$1(type)) { 6661 const cloned = cloneVNode( 6662 type, 6663 props, 6664 true 6665 /* mergeRef: true */ 6666 ); 6667 if (children) { 6668 normalizeChildren(cloned, children); 6669 } 6670 if (isBlockTreeEnabled > 0 && !isBlockNode && currentBlock) { 6671 if (cloned.shapeFlag & 6) { 6672 currentBlock[currentBlock.indexOf(type)] = cloned; 6673 } else { 6674 currentBlock.push(cloned); 6675 } 6676 } 6677 cloned.patchFlag = -2; 6678 return cloned; 6679 } 6680 if (isClassComponent(type)) { 6681 type = type.__vccOpts; 6682 } 6683 if (props) { 6684 props = guardReactiveProps(props); 6685 let { class: klass, style } = props; 6686 if (klass && !isString$2(klass)) { 6687 props.class = normalizeClass(klass); 6688 } 6689 if (isObject$3(style)) { 6690 if (isProxy(style) && !isArray$1(style)) { 6691 style = extend({}, style); 6692 } 6693 props.style = normalizeStyle(style); 6694 } 6695 } 6696 const shapeFlag = isString$2(type) ? 1 : isSuspense(type) ? 128 : isTeleport(type) ? 64 : isObject$3(type) ? 4 : isFunction$1(type) ? 2 : 0; 6697 if (!!(define_process_env_default$7.NODE_ENV !== "production") && shapeFlag & 4 && isProxy(type)) { 6698 type = toRaw(type); 6699 warn$1$1( 6700 `Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with \`markRaw\` or using \`shallowRef\` instead of \`ref\`.`, 6701 ` 6702Component that was made reactive: `, 6703 type 6704 ); 6705 } 6706 return createBaseVNode( 6707 type, 6708 props, 6709 children, 6710 patchFlag, 6711 dynamicProps, 6712 shapeFlag, 6713 isBlockNode, 6714 true 6715 ); 6716} 6717function guardReactiveProps(props) { 6718 if (!props) return null; 6719 return isProxy(props) || isInternalObject(props) ? extend({}, props) : props; 6720} 6721function cloneVNode(vnode, extraProps, mergeRef = false, cloneTransition = false) { 6722 const { props, ref: ref3, patchFlag, children, transition } = vnode; 6723 const mergedProps = extraProps ? mergeProps(props || {}, extraProps) : props; 6724 const cloned = { 6725 __v_isVNode: true, 6726 __v_skip: true, 6727 type: vnode.type, 6728 props: mergedProps, 6729 key: mergedProps && normalizeKey(mergedProps), 6730 ref: extraProps && extraProps.ref ? ( 6731 // #2078 in the case of <component :is="vnode" ref="extra"/> 6732 // if the vnode itself already has a ref, cloneVNode will need to merge 6733 // the refs so the single vnode can be set on multiple refs 6734 mergeRef && ref3 ? isArray$1(ref3) ? ref3.concat(normalizeRef(extraProps)) : [ref3, normalizeRef(extraProps)] : normalizeRef(extraProps) 6735 ) : ref3, 6736 scopeId: vnode.scopeId, 6737 slotScopeIds: vnode.slotScopeIds, 6738 children: !!(define_process_env_default$7.NODE_ENV !== "production") && patchFlag === -1 && isArray$1(children) ? children.map(deepCloneVNode) : children, 6739 target: vnode.target, 6740 targetStart: vnode.targetStart, 6741 targetAnchor: vnode.targetAnchor, 6742 staticCount: vnode.staticCount, 6743 shapeFlag: vnode.shapeFlag, 6744 // if the vnode is cloned with extra props, we can no longer assume its 6745 // existing patch flag to be reliable and need to add the FULL_PROPS flag. 6746 // note: preserve flag for fragments since they use the flag for children 6747 // fast paths only. 6748 patchFlag: extraProps && vnode.type !== Fragment ? patchFlag === -1 ? 16
vendor: 4,164 bytes, lines 6748-6882
6748: patchFlag | 16 : patchFlag, 6749 dynamicProps: vnode.dynamicProps, 6750 dynamicChildren: vnode.dynamicChildren, 6751 appContext: vnode.appContext, 6752 dirs: vnode.dirs, 6753 transition, 6754 // These should technically only be non-null on mounted VNodes. However, 6755 // they *should* be copied for kept-alive vnodes. So we just always copy 6756 // them since them being non-null during a mount doesn't affect the logic as 6757 // they will simply be overwritten. 6758 component: vnode.component, 6759 suspense: vnode.suspense, 6760 ssContent: vnode.ssContent && cloneVNode(vnode.ssContent), 6761 ssFallback: vnode.ssFallback && cloneVNode(vnode.ssFallback), 6762 placeholder: vnode.placeholder, 6763 el: vnode.el, 6764 anchor: vnode.anchor, 6765 ctx: vnode.ctx, 6766 ce: vnode.ce 6767 }; 6768 if (transition && cloneTransition) { 6769 setTransitionHooks( 6770 cloned, 6771 transition.clone(cloned) 6772 ); 6773 } 6774 return cloned; 6775} 6776function deepCloneVNode(vnode) { 6777 const cloned = cloneVNode(vnode); 6778 if (isArray$1(vnode.children)) { 6779 cloned.children = vnode.children.map(deepCloneVNode); 6780 } 6781 return cloned; 6782} 6783function createTextVNode(text = " ", flag = 0) { 6784 return createVNode(Text, null, text, flag); 6785} 6786function createStaticVNode(content, numberOfNodes) { 6787 const vnode = createVNode(Static, null, content); 6788 vnode.staticCount = numberOfNodes; 6789 return vnode; 6790} 6791function createCommentVNode(text = "", asBlock = false) { 6792 return asBlock ? (openBlock(), createBlock(Comment, null, text)) : createVNode(Comment, null, text); 6793} 6794function normalizeVNode(child) { 6795 if (child == null || typeof child === "boolean") { 6796 return createVNode(Comment); 6797 } else if (isArray$1(child)) { 6798 return createVNode( 6799 Fragment, 6800 null, 6801 // #3666, avoid reference pollution when reusing vnode 6802 child.slice() 6803 ); 6804 } else if (isVNode$1(child)) { 6805 return cloneIfMounted(child); 6806 } else { 6807 return createVNode(Text, null, String(child)); 6808 } 6809} 6810function cloneIfMounted(child) { 6811 return child.el === null && child.patchFlag !== -1 || child.memo ? child : cloneVNode(child); 6812} 6813function normalizeChildren(vnode, children) { 6814 let type = 0; 6815 const { shapeFlag } = vnode; 6816 if (children == null) { 6817 children = null; 6818 } else if (isArray$1(children)) { 6819 type = 16; 6820 } else if (typeof children === "object") { 6821 if (shapeFlag & (1 | 64)) { 6822 const slot = children.default; 6823 if (slot) { 6824 slot._c && (slot._d = false); 6825 normalizeChildren(vnode, slot()); 6826 slot._c && (slot._d = true); 6827 } 6828 return; 6829 } else { 6830 type = 32; 6831 const slotFlag = children._; 6832 if (!slotFlag && !isInternalObject(children)) { 6833 children._ctx = currentRenderingInstance; 6834 } else if (slotFlag === 3 && currentRenderingInstance) { 6835 if (currentRenderingInstance.slots._ === 1) { 6836 children._ = 1; 6837 } else { 6838 children._ = 2; 6839 vnode.patchFlag |= 1024; 6840 } 6841 } 6842 } 6843 } else if (isFunction$1(children)) { 6844 children = { default: children, _ctx: currentRenderingInstance }; 6845 type = 32; 6846 } else { 6847 children = String(children); 6848 if (shapeFlag & 64) { 6849 type = 16; 6850 children = [createTextVNode(children)]; 6851 } else { 6852 type = 8; 6853 } 6854 } 6855 vnode.children = children; 6856 vnode.shapeFlag |= type; 6857} 6858function mergeProps(...args) { 6859 const ret = {}; 6860 for (let i = 0; i < args.length; i++) { 6861 const toMerge = args[i]; 6862 for (const key in toMerge) { 6863 if (key === "class") { 6864 if (ret.class !== toMerge.class) { 6865 ret.class = normalizeClass([ret.class, toMerge.class]); 6866 } 6867 } else if (key === "style") { 6868 ret.style = normalizeStyle([ret.style, toMerge.style]); 6869 } else if (isOn(key)) { 6870 const existing = ret[key]; 6871 const incoming = toMerge[key]; 6872 if (incoming && existing !== incoming && !(isArray$1(existing) && existing.includes(incoming))) { 6873 ret[key] = existing ? [].concat(existing, incoming) : incoming; 6874 } 6875 } else if (key !== "") { 6876 ret[key] = toMerge[key]; 6877 } 6878 } 6879 } 6880 return ret; 6881} 6882function invokeVNodeHook(hook, instance, vnode, prevVNode = null) {
vendor: 7,259 bytes, lines 6883-7115
6883 callWithAsyncErrorHandling(hook, instance, 7, [ 6884 vnode, 6885 prevVNode 6886 ]); 6887} 6888const emptyAppContext = createAppContext(); 6889let uid = 0; 6890function createComponentInstance(vnode, parent, suspense) { 6891 const type = vnode.type; 6892 const appContext = (parent ? parent.appContext : vnode.appContext) || emptyAppContext; 6893 const instance = { 6894 uid: uid++, 6895 vnode, 6896 type, 6897 parent, 6898 appContext, 6899 root: null, 6900 // to be immediately set 6901 next: null, 6902 subTree: null, 6903 // will be set synchronously right after creation 6904 effect: null, 6905 update: null, 6906 // will be set synchronously right after creation 6907 job: null, 6908 scope: new EffectScope( 6909 true 6910 /* detached */ 6911 ), 6912 render: null, 6913 proxy: null, 6914 exposed: null, 6915 exposeProxy: null, 6916 withProxy: null, 6917 provides: parent ? parent.provides : Object.create(appContext.provides), 6918 ids: parent ? parent.ids : ["", 0, 0], 6919 accessCache: null, 6920 renderCache: [], 6921 // local resolved assets 6922 components: null, 6923 directives: null, 6924 // resolved props and emits options 6925 propsOptions: normalizePropsOptions(type, appContext), 6926 emitsOptions: normalizeEmitsOptions(type, appContext), 6927 // emit 6928 emit: null, 6929 // to be set immediately 6930 emitted: null, 6931 // props default value 6932 propsDefaults: EMPTY_OBJ, 6933 // inheritAttrs 6934 inheritAttrs: type.inheritAttrs, 6935 // state 6936 ctx: EMPTY_OBJ, 6937 data: EMPTY_OBJ, 6938 props: EMPTY_OBJ, 6939 attrs: EMPTY_OBJ, 6940 slots: EMPTY_OBJ, 6941 refs: EMPTY_OBJ, 6942 setupState: EMPTY_OBJ, 6943 setupContext: null, 6944 // suspense related 6945 suspense, 6946 suspenseId: suspense ? suspense.pendingId : 0, 6947 asyncDep: null, 6948 asyncResolved: false, 6949 // lifecycle hooks 6950 // not using enums here because it results in computed properties 6951 isMounted: false, 6952 isUnmounted: false, 6953 isDeactivated: false, 6954 bc: null, 6955 c: null, 6956 bm: null, 6957 m: null, 6958 bu: null, 6959 u: null, 6960 um: null, 6961 bum: null, 6962 da: null, 6963 a: null, 6964 rtg: null, 6965 rtc: null, 6966 ec: null, 6967 sp: null 6968 }; 6969 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 6970 instance.ctx = createDevRenderContext(instance); 6971 } else { 6972 instance.ctx = { _: instance }; 6973 } 6974 instance.root = parent ? parent.root : instance; 6975 instance.emit = emit.bind(null, instance); 6976 if (vnode.ce) { 6977 vnode.ce(instance); 6978 } 6979 return instance; 6980} 6981let currentInstance$1 = null; 6982const getCurrentInstance = () => currentInstance$1 || currentRenderingInstance; 6983let internalSetCurrentInstance; 6984let setInSSRSetupState; 6985{ 6986 const g = getGlobalThis$1(); 6987 const registerGlobalSetter = (key, setter) => { 6988 let setters; 6989 if (!(setters = g[key])) setters = g[key] = []; 6990 setters.push(setter); 6991 return (v) => { 6992 if (setters.length > 1) setters.forEach((set2) => set2(v)); 6993 else setters[0](v); 6994 }; 6995 }; 6996 internalSetCurrentInstance = registerGlobalSetter( 6997 `__VUE_INSTANCE_SETTERS__`, 6998 (v) => currentInstance$1 = v 6999 ); 7000 setInSSRSetupState = registerGlobalSetter( 7001 `__VUE_SSR_SETTERS__`, 7002 (v) => isInSSRComponentSetup = v 7003 ); 7004} 7005const setCurrentInstance = (instance) => { 7006 const prev = currentInstance$1; 7007 internalSetCurrentInstance(instance); 7008 instance.scope.on(); 7009 return () => { 7010 instance.scope.off(); 7011 internalSetCurrentInstance(prev); 7012 }; 7013}; 7014const unsetCurrentInstance = () => { 7015 currentInstance$1 && currentInstance$1.scope.off(); 7016 internalSetCurrentInstance(null); 7017}; 7018const isBuiltInTag = /* @__PURE__ */ makeMap("slot,component"); 7019function validateComponentName(name, { isNativeTag }) { 7020 if (isBuiltInTag(name) || isNativeTag(name)) { 7021 warn$1$1( 7022 "Do not use built-in or reserved HTML elements as component id: " + name 7023 ); 7024 } 7025} 7026function isStatefulComponent(instance) { 7027 return instance.vnode.shapeFlag & 4; 7028} 7029let isInSSRComponentSetup = false; 7030function setupComponent(instance, isSSR = false, optimized = false) { 7031 isSSR && setInSSRSetupState(isSSR); 7032 const { props, children } = instance.vnode; 7033 const isStateful = isStatefulComponent(instance); 7034 initProps(instance, props, isStateful, isSSR); 7035 initSlots(instance, children, optimized || isSSR); 7036 const setupResult = isStateful ? setupStatefulComponent(instance, isSSR) : void 0; 7037 isSSR && setInSSRSetupState(false); 7038 return setupResult; 7039} 7040function setupStatefulComponent(instance, isSSR) { 7041 var _a2; 7042 const Component = instance.type; 7043 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 7044 if (Component.name) { 7045 validateComponentName(Component.name, instance.appContext.config); 7046 } 7047 if (Component.components) { 7048 const names = Object.keys(Component.components); 7049 for (let i = 0; i < names.length; i++) { 7050 validateComponentName(names[i], instance.appContext.config); 7051 } 7052 } 7053 if (Component.directives) { 7054 const names = Object.keys(Component.directives); 7055 for (let i = 0; i < names.length; i++) { 7056 validateDirectiveName(names[i]); 7057 } 7058 } 7059 if (Component.compilerOptions && isRuntimeOnly()) { 7060 warn$1$1( 7061 `"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.` 7062 ); 7063 } 7064 } 7065 instance.accessCache = /* @__PURE__ */ Object.create(null); 7066 instance.proxy = new Proxy(instance.ctx, PublicInstanceProxyHandlers); 7067 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 7068 exposePropsOnRenderContext(instance); 7069 } 7070 const { setup } = Component; 7071 if (setup) { 7072 pauseTracking(); 7073 const setupContext = instance.setupContext = setup.length > 1 ? createSetupContext(instance) : null; 7074 const reset = setCurrentInstance(instance); 7075 const setupResult = callWithErrorHandling( 7076 setup, 7077 instance, 7078 0, 7079 [ 7080 !!(define_process_env_default$7.NODE_ENV !== "production") ? shallowReadonly(instance.props) : instance.props, 7081 setupContext 7082 ] 7083 ); 7084 const isAsyncSetup = isPromise$2(setupResult); 7085 resetTracking(); 7086 reset(); 7087 if ((isAsyncSetup || instance.sp) && !isAsyncWrapper(instance)) { 7088 markAsyncBoundary(instance); 7089 } 7090 if (isAsyncSetup) { 7091 setupResult.then(unsetCurrentInstance, unsetCurrentInstance); 7092 if (isSSR) { 7093 return setupResult.then((resolvedResult) => { 7094 handleSetupResult(instance, resolvedResult, isSSR); 7095 }).catch((e) => { 7096 handleError(e, instance, 0); 7097 }); 7098 } else { 7099 instance.asyncDep = setupResult; 7100 if (!!(define_process_env_default$7.NODE_ENV !== "production") && !instance.suspense) { 7101 const name = (_a2 = Component.name) != null ? _a2 : "Anonymous"; 7102 warn$1$1( 7103 `Component <${name}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.` 7104 ); 7105 } 7106 } 7107 } else { 7108 handleSetupResult(instance, setupResult, isSSR); 7109 } 7110 } else { 7111 finishComponentSetup(instance, isSSR); 7112 } 7113} 7114function handleSetupResult(instance, setupResult, isSSR) { 7115 if (isFunction$1(setupResult)) {
7116 if (instance.type.__ssrInlineRender) { 7117 instance.ssrRender = setupResult; 7118 } else { 7119 instance.render = setupResult; 7120 } 7121 } else if (isObject$3(setupResult)) { 7122 if (!!(define_process_env_default$7.NODE_ENV !== "production") && isVNode$1(setupResult)) { 7123 warn$1$1( 7124 `setup() should not return VNodes directly - return a render function instead.` 7125 ); 7126 } 7127 if (!!(define_process_env_default$7.NODE_ENV !== "production") || false) { 7128 instance.devtoolsRawSetupState = setupResult; 7129 } 7130 instance.setupState = proxyRefs(setupResult); 7131 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 7132 exposeSetupStateOnRenderContext(instance); 7133 } 7134 } else if (!!(define_process_env_default$7.NODE_ENV !== "production") && setupResult !== void 0) { 7135 warn$1$1( 7136 `setup() should return an object. Received: ${setupResult === null ? "null" : typeof setupResult}` 7137 ); 7138 } 7139 finishComponentSetup(instance, isSSR); 7140} 7141const isRuntimeOnly = () => true; 7142function finishComponentSetup(instance, isSSR, skipOptions) { 7143 const Component = instance.type; 7144 if (!instance.render) { 7145 instance.render = Component.render || NOOP; 7146 } 7147 { 7148 const reset = setCurrentInstance(instance); 7149 pauseTracking(); 7150 try { 7151 applyOptions(instance); 7152 } finally { 7153 resetTracking(); 7154 reset(); 7155 } 7156 } 7157 if (!!(define_process_env_default$7.NODE_ENV !== "production") && !Component.render && instance.render === NOOP && !isSSR) { 7158 if (Component.template) { 7159 warn$1$1( 7160 `Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".` 7161 ); 7162 } else { 7163 warn$1$1(`Component is missing template or render function: `, Component); 7164 } 7165 } 7166} 7167const attrsProxyHandlers = !!(define_process_env_default$7.NODE_ENV !== "production") ? { 7168 get(target, key) { 7169 markAttrsAccessed(); 7170 track(target, "get", ""); 7171 return target[key]; 7172 }, 7173 set() { 7174 warn$1$1(`setupContext.attrs is readonly.`); 7175 return false; 7176 }, 7177 deleteProperty() { 7178 warn$1$1(`setupContext.attrs is readonly.`); 7179 return false; 7180 } 7181} : { 7182 get(target, key) { 7183 track(target, "get", ""); 7184 return target[key]; 7185 } 7186}; 7187function getSlotsProxy(instance) { 7188 return new Proxy(instance.slots, { 7189 get(target, key) { 7190 track(instance, "get", "$slots"); 7191 return target[key]; 7192 } 7193 }); 7194} 7195function createSetupContext(instance) { 7196 const expose = (exposed) => { 7197 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 7198 if (instance.exposed) { 7199 warn$1$1(`expose() should be called only once per setup().`); 7200 } 7201 if (exposed != null) { 7202 let exposedType = typeof exposed; 7203 if (exposedType === "object") { 7204 if (isArray$1(exposed)) { 7205 exposedType = "array"; 7206 } else if (isRef(exposed)) { 7207 exposedType = "ref"; 7208 } 7209 } 7210 if (exposedType !== "object") { 7211 warn$1$1( 7212 `expose() should be passed a plain object, received ${exposedType}.` 7213 ); 7214 } 7215 } 7216 } 7217 instance.exposed = exposed || {}; 7218 }; 7219 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 7220 let attrsProxy; 7221 let slotsProxy; 7222 return Object.freeze({ 7223 get attrs() { 7224 return attrsProxy || (attrsProxy = new Proxy(instance.attrs, attrsProxyHandlers)); 7225 }, 7226 get slots() { 7227 return slotsProxy || (slotsProxy = getSlotsProxy(instance)); 7228 },
vendor: 7,689 bytes, lines 7229-7505
7229 get emit() { 7230 return (event, ...args) => instance.emit(event, ...args); 7231 }, 7232 expose 7233 }); 7234 } else { 7235 return { 7236 attrs: new Proxy(instance.attrs, attrsProxyHandlers), 7237 slots: instance.slots, 7238 emit: instance.emit, 7239 expose 7240 }; 7241 } 7242} 7243function getComponentPublicInstance(instance) { 7244 if (instance.exposed) { 7245 return instance.exposeProxy || (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), { 7246 get(target, key) { 7247 if (key in target) { 7248 return target[key]; 7249 } else if (key in publicPropertiesMap) { 7250 return publicPropertiesMap[key](instance); 7251 } 7252 }, 7253 has(target, key) { 7254 return key in target || key in publicPropertiesMap; 7255 } 7256 })); 7257 } else { 7258 return instance.proxy; 7259 } 7260} 7261const classifyRE = /(?:^|[-_])\w/g; 7262const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, ""); 7263function getComponentName(Component, includeInferred = true) { 7264 return isFunction$1(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name; 7265} 7266function formatComponentName(instance, Component, isRoot = false) { 7267 let name = getComponentName(Component); 7268 if (!name && Component.__file) { 7269 const match = Component.__file.match(/([^/\\]+)\.\w+$/); 7270 if (match) { 7271 name = match[1]; 7272 } 7273 } 7274 if (!name && instance && instance.parent) { 7275 const inferFromRegistry = (registry) => { 7276 for (const key in registry) { 7277 if (registry[key] === Component) { 7278 return key; 7279 } 7280 } 7281 }; 7282 name = inferFromRegistry( 7283 instance.components || instance.parent.type.components 7284 ) || inferFromRegistry(instance.appContext.components); 7285 } 7286 return name ? classify(name) : isRoot ? `App` : `Anonymous`; 7287} 7288function isClassComponent(value) { 7289 return isFunction$1(value) && "__vccOpts" in value; 7290} 7291const computed = (getterOrOptions, debugOptions) => { 7292 const c = computed$1(getterOrOptions, debugOptions, isInSSRComponentSetup); 7293 if (!!(define_process_env_default$7.NODE_ENV !== "production")) { 7294 const i = getCurrentInstance(); 7295 if (i && i.appContext.config.warnRecursiveComputed) { 7296 c._warnRecursive = true; 7297 } 7298 } 7299 return c; 7300}; 7301function h(type, propsOrChildren, children) { 7302 try { 7303 setBlockTracking(-1); 7304 const l = arguments.length; 7305 if (l === 2) { 7306 if (isObject$3(propsOrChildren) && !isArray$1(propsOrChildren)) { 7307 if (isVNode$1(propsOrChildren)) { 7308 return createVNode(type, null, [propsOrChildren]); 7309 } 7310 return createVNode(type, propsOrChildren); 7311 } else { 7312 return createVNode(type, null, propsOrChildren); 7313 } 7314 } else { 7315 if (l > 3) { 7316 children = Array.prototype.slice.call(arguments, 2); 7317 } else if (l === 3 && isVNode$1(children)) { 7318 children = [children]; 7319 } 7320 return createVNode(type, propsOrChildren, children); 7321 } 7322 } finally { 7323 setBlockTracking(1); 7324 } 7325} 7326function initCustomFormatter() { 7327 if (!!!(define_process_env_default$7.NODE_ENV !== "production") || typeof window === "undefined") { 7328 return; 7329 } 7330 const vueStyle = { style: "color:#3ba776" }; 7331 const numberStyle = { style: "color:#1677ff" }; 7332 const stringStyle = { style: "color:#f5222d" }; 7333 const keywordStyle = { style: "color:#eb2f96" }; 7334 const formatter = { 7335 __vue_custom_formatter: true, 7336 header(obj) { 7337 if (!isObject$3(obj)) { 7338 return null; 7339 } 7340 if (obj.__isVue) { 7341 return ["div", vueStyle, `VueInstance`]; 7342 } else if (isRef(obj)) { 7343 pauseTracking(); 7344 const value = obj.value; 7345 resetTracking(); 7346 return [ 7347 "div", 7348 {}, 7349 ["span", vueStyle, genRefFlag(obj)], 7350 "<", 7351 formatValue(value), 7352 `>` 7353 ]; 7354 } else if (isReactive(obj)) { 7355 return [ 7356 "div", 7357 {}, 7358 ["span", vueStyle, isShallow(obj) ? "ShallowReactive" : "Reactive"], 7359 "<", 7360 formatValue(obj), 7361 `>${isReadonly(obj) ? ` (readonly)` : ``}` 7362 ]; 7363 } else if (isReadonly(obj)) { 7364 return [ 7365 "div", 7366 {}, 7367 ["span", vueStyle, isShallow(obj) ? "ShallowReadonly" : "Readonly"], 7368 "<", 7369 formatValue(obj), 7370 ">" 7371 ]; 7372 } 7373 return null; 7374 }, 7375 hasBody(obj) { 7376 return obj && obj.__isVue; 7377 }, 7378 body(obj) { 7379 if (obj && obj.__isVue) { 7380 return [ 7381 "div", 7382 {}, 7383 ...formatInstance(obj.$) 7384 ]; 7385 } 7386 } 7387 }; 7388 function formatInstance(instance) { 7389 const blocks = []; 7390 if (instance.type.props && instance.props) { 7391 blocks.push(createInstanceBlock("props", toRaw(instance.props))); 7392 } 7393 if (instance.setupState !== EMPTY_OBJ) { 7394 blocks.push(createInstanceBlock("setup", instance.setupState)); 7395 } 7396 if (instance.data !== EMPTY_OBJ) { 7397 blocks.push(createInstanceBlock("data", toRaw(instance.data))); 7398 } 7399 const computed2 = extractKeys(instance, "computed"); 7400 if (computed2) { 7401 blocks.push(createInstanceBlock("computed", computed2)); 7402 } 7403 const injected = extractKeys(instance, "inject"); 7404 if (injected) { 7405 blocks.push(createInstanceBlock("injected", injected)); 7406 } 7407 blocks.push([ 7408 "div", 7409 {}, 7410 [ 7411 "span", 7412 { 7413 style: keywordStyle.style + ";opacity:0.66" 7414 }, 7415 "$ (internal): " 7416 ], 7417 ["object", { object: instance }] 7418 ]); 7419 return blocks; 7420 } 7421 function createInstanceBlock(type, target) { 7422 target = extend({}, target); 7423 if (!Object.keys(target).length) { 7424 return ["span", {}]; 7425 } 7426 return [ 7427 "div", 7428 { style: "line-height:1.25em;margin-bottom:0.6em" }, 7429 [ 7430 "div", 7431 { 7432 style: "color:#476582" 7433 }, 7434 type 7435 ], 7436 [ 7437 "div", 7438 { 7439 style: "padding-left:1.25em" 7440 }, 7441 ...Object.keys(target).map((key) => { 7442 return [ 7443 "div", 7444 {}, 7445 ["span", keywordStyle, key + ": "], 7446 formatValue(target[key], false) 7447 ]; 7448 }) 7449 ] 7450 ]; 7451 } 7452 function formatValue(v, asRaw = true) { 7453 if (typeof v === "number") { 7454 return ["span", numberStyle, v]; 7455 } else if (typeof v === "string") { 7456 return ["span", stringStyle, JSON.stringify(v)]; 7457 } else if (typeof v === "boolean") { 7458 return ["span", keywordStyle, v]; 7459 } else if (isObject$3(v)) { 7460 return ["object", { object: asRaw ? toRaw(v) : v }]; 7461 } else { 7462 return ["span", stringStyle, String(v)]; 7463 } 7464 } 7465 function extractKeys(instance, type) { 7466 const Comp = instance.type; 7467 if (isFunction$1(Comp)) { 7468 return; 7469 } 7470 const extracted = {}; 7471 for (const key in instance.ctx) { 7472 if (isKeyOfType(Comp, key, type)) { 7473 extracted[key] = instance.ctx[key]; 7474 } 7475 } 7476 return extracted; 7477 } 7478 function isKeyOfType(Comp, key, type) { 7479 const opts = Comp[type]; 7480 if (isArray$1(opts) && opts.includes(key) || isObject$3(opts) && key in opts) { 7481 return true; 7482 } 7483 if (Comp.extends && isKeyOfType(Comp.extends, key, type)) { 7484 return true; 7485 } 7486 if (Comp.mixins && Comp.mixins.some((m) => isKeyOfType(m, key, type))) { 7487 return true; 7488 } 7489 } 7490 function genRefFlag(v) { 7491 if (isShallow(v)) { 7492 return `ShallowRef`; 7493 } 7494 if (v.effect) { 7495 return `ComputedRef`; 7496 } 7497 return `Ref`; 7498 } 7499 if (window.devtoolsFormatters) { 7500 window.devtoolsFormatters.push(formatter); 7501 } else { 7502 window.devtoolsFormatters = [formatter]; 7503 } 7504} 7505const version = "3.5.22";
vendor: 4,880 bytes, lines 7506-7649
7506const warn$2 = !!(define_process_env_default$7.NODE_ENV !== "production") ? warn$1$1 : NOOP; 7507var define_process_env_default$6 = {}; 7508let policy = void 0; 7509const tt = typeof window !== "undefined" && window.trustedTypes; 7510if (tt) { 7511 try { 7512 policy = /* @__PURE__ */ tt.createPolicy("vue", { 7513 createHTML: (val) => val 7514 }); 7515 } catch (e) { 7516 !!(define_process_env_default$6.NODE_ENV !== "production") && warn$2(`Error creating trusted types policy: ${e}`); 7517 } 7518} 7519const unsafeToTrustedHTML = policy ? (val) => policy.createHTML(val) : (val) => val; 7520const svgNS = "http://www.w3.org/2000/svg"; 7521const mathmlNS = "http://www.w3.org/1998/Math/MathML"; 7522const doc = typeof document !== "undefined" ? document : null; 7523const templateContainer = doc && /* @__PURE__ */ doc.createElement("template"); 7524const nodeOps = { 7525 insert: (child, parent, anchor) => { 7526 parent.insertBefore(child, anchor || null); 7527 }, 7528 remove: (child) => { 7529 const parent = child.parentNode; 7530 if (parent) { 7531 parent.removeChild(child); 7532 } 7533 }, 7534 createElement: (tag2, namespace, is, props) => { 7535 const el = namespace === "svg" ? doc.createElementNS(svgNS, tag2) : namespace === "mathml" ? doc.createElementNS(mathmlNS, tag2) : is ? doc.createElement(tag2, { is }) : doc.createElement(tag2); 7536 if (tag2 === "select" && props && props.multiple != null) { 7537 el.setAttribute("multiple", props.multiple); 7538 } 7539 return el; 7540 }, 7541 createText: (text) => doc.createTextNode(text), 7542 createComment: (text) => doc.createComment(text), 7543 setText: (node, text) => { 7544 node.nodeValue = text; 7545 }, 7546 setElementText: (el, text) => { 7547 el.textContent = text; 7548 }, 7549 parentNode: (node) => node.parentNode, 7550 nextSibling: (node) => node.nextSibling, 7551 querySelector: (selector) => doc.querySelector(selector), 7552 setScopeId(el, id) { 7553 el.setAttribute(id, ""); 7554 }, 7555 // __UNSAFE__ 7556 // Reason: innerHTML. 7557 // Static content here can only come from compiled templates. 7558 // As long as the user only uses trusted templates, this is safe. 7559 insertStaticContent(content, parent, anchor, namespace, start, end) { 7560 const before = anchor ? anchor.previousSibling : parent.lastChild; 7561 if (start && (start === end || start.nextSibling)) { 7562 while (true) { 7563 parent.insertBefore(start.cloneNode(true), anchor); 7564 if (start === end || !(start = start.nextSibling)) break; 7565 } 7566 } else { 7567 templateContainer.innerHTML = unsafeToTrustedHTML( 7568 namespace === "svg" ? `<svg>${content}</svg>` : namespace === "mathml" ? `<math>${content}</math>` : content 7569 ); 7570 const template = templateContainer.content; 7571 if (namespace === "svg" || namespace === "mathml") { 7572 const wrapper = template.firstChild; 7573 while (wrapper.firstChild) { 7574 template.appendChild(wrapper.firstChild); 7575 } 7576 template.removeChild(wrapper); 7577 } 7578 parent.insertBefore(template, anchor); 7579 } 7580 return [ 7581 // first 7582 before ? before.nextSibling : parent.firstChild, 7583 // last 7584 anchor ? anchor.previousSibling : parent.lastChild 7585 ]; 7586 } 7587}; 7588const vtcKey = Symbol("_vtc"); 7589function patchClass(el, value, isSVG) { 7590 const transitionClasses = el[vtcKey]; 7591 if (transitionClasses) { 7592 value = (value ? [value, ...transitionClasses] : [...transitionClasses]).join(" "); 7593 } 7594 if (value == null) { 7595 el.removeAttribute("class"); 7596 } else if (isSVG) { 7597 el.setAttribute("class", value); 7598 } else { 7599 el.className = value; 7600 } 7601} 7602const vShowOriginalDisplay = Symbol("_vod"); 7603const vShowHidden = Symbol("_vsh"); 7604const vShow = { 7605 // used for prop mismatch check during hydration 7606 name: "show", 7607 beforeMount(el, { value }, { transition }) { 7608 el[vShowOriginalDisplay] = el.style.display === "none" ? "" : el.style.display; 7609 if (transition && value) { 7610 transition.beforeEnter(el); 7611 } else { 7612 setDisplay(el, value); 7613 } 7614 }, 7615 mounted(el, { value }, { transition }) { 7616 if (transition && value) { 7617 transition.enter(el); 7618 } 7619 }, 7620 updated(el, { value, oldValue }, { transition }) { 7621 if (!value === !oldValue) return; 7622 if (transition) { 7623 if (value) { 7624 transition.beforeEnter(el); 7625 setDisplay(el, true); 7626 transition.enter(el); 7627 } else { 7628 transition.leave(el, () => { 7629 setDisplay(el, false); 7630 }); 7631 } 7632 } else { 7633 setDisplay(el, value); 7634 } 7635 }, 7636 beforeUnmount(el, { value }) { 7637 setDisplay(el, value); 7638 } 7639}; 7640function setDisplay(el, value) { 7641 el.style.display = value ? el[vShowOriginalDisplay] : "none"; 7642 el[vShowHidden] = !value; 7643} 7644const CSS_VAR_TEXT = Symbol(!!(define_process_env_default$6.NODE_ENV !== "production") ? "CSS_VAR_TEXT" : ""); 7645const displayRE = /(?:^|;)\s*display\s*:/; 7646function patchStyle(el, prev, next) { 7647 const style = el.style; 7648 const isCssString = isString$2(next); 7649 let hasControlledDisplay = false;
vendor: 4,531 bytes, lines 7650-7806
7650 if (next && !isCssString) { 7651 if (prev) { 7652 if (!isString$2(prev)) { 7653 for (const key in prev) { 7654 if (next[key] == null) { 7655 setStyle$1(style, key, ""); 7656 } 7657 } 7658 } else { 7659 for (const prevStyle of prev.split(";")) { 7660 const key = prevStyle.slice(0, prevStyle.indexOf(":")).trim(); 7661 if (next[key] == null) { 7662 setStyle$1(style, key, ""); 7663 } 7664 } 7665 } 7666 } 7667 for (const key in next) { 7668 if (key === "display") { 7669 hasControlledDisplay = true; 7670 } 7671 setStyle$1(style, key, next[key]); 7672 } 7673 } else { 7674 if (isCssString) { 7675 if (prev !== next) { 7676 const cssVarText = style[CSS_VAR_TEXT]; 7677 if (cssVarText) { 7678 next += ";" + cssVarText; 7679 } 7680 style.cssText = next; 7681 hasControlledDisplay = displayRE.test(next); 7682 } 7683 } else if (prev) { 7684 el.removeAttribute("style"); 7685 } 7686 } 7687 if (vShowOriginalDisplay in el) { 7688 el[vShowOriginalDisplay] = hasControlledDisplay ? style.display : ""; 7689 if (el[vShowHidden]) { 7690 style.display = "none"; 7691 } 7692 } 7693} 7694const semicolonRE = /[^\\];\s*$/; 7695const importantRE = /\s*!important$/; 7696function setStyle$1(style, name, val) { 7697 if (isArray$1(val)) { 7698 val.forEach((v) => setStyle$1(style, name, v)); 7699 } else { 7700 if (val == null) val = ""; 7701 if (!!(define_process_env_default$6.NODE_ENV !== "production")) { 7702 if (semicolonRE.test(val)) { 7703 warn$2( 7704 `Unexpected semicolon at the end of '${name}' style value: '${val}'` 7705 ); 7706 } 7707 } 7708 if (name.startsWith("--")) { 7709 style.setProperty(name, val); 7710 } else { 7711 const prefixed = autoPrefix(style, name); 7712 if (importantRE.test(val)) { 7713 style.setProperty( 7714 hyphenate(prefixed), 7715 val.replace(importantRE, ""), 7716 "important" 7717 ); 7718 } else { 7719 style[prefixed] = val; 7720 } 7721 } 7722 } 7723} 7724const prefixes = ["Webkit", "Moz", "ms"]; 7725const prefixCache = {}; 7726function autoPrefix(style, rawName) { 7727 const cached = prefixCache[rawName]; 7728 if (cached) { 7729 return cached; 7730 } 7731 let name = camelize(rawName); 7732 if (name !== "filter" && name in style) { 7733 return prefixCache[rawName] = name; 7734 } 7735 name = capitalize$1(name); 7736 for (let i = 0; i < prefixes.length; i++) { 7737 const prefixed = prefixes[i] + name; 7738 if (prefixed in style) { 7739 return prefixCache[rawName] = prefixed; 7740 } 7741 } 7742 return rawName; 7743} 7744const xlinkNS = "http://www.w3.org/1999/xlink"; 7745function patchAttr(el, key, value, isSVG, instance, isBoolean2 = isSpecialBooleanAttr(key)) { 7746 if (isSVG && key.startsWith("xlink:")) { 7747 if (value == null) { 7748 el.removeAttributeNS(xlinkNS, key.slice(6, key.length)); 7749 } else { 7750 el.setAttributeNS(xlinkNS, key, value); 7751 } 7752 } else { 7753 if (value == null || isBoolean2 && !includeBooleanAttr(value)) { 7754 el.removeAttribute(key); 7755 } else { 7756 el.setAttribute( 7757 key, 7758 isBoolean2 ? "" : isSymbol(value) ? String(value) : value 7759 ); 7760 } 7761 } 7762} 7763function patchDOMProp(el, key, value, parentComponent, attrName) { 7764 if (key === "innerHTML" || key === "textContent") { 7765 if (value != null) { 7766 el[key] = key === "innerHTML" ? unsafeToTrustedHTML(value) : value; 7767 } 7768 return; 7769 } 7770 const tag2 = el.tagName; 7771 if (key === "value" && tag2 !== "PROGRESS" && // custom elements may use _value internally 7772 !tag2.includes("-")) { 7773 const oldValue = tag2 === "OPTION" ? el.getAttribute("value") || "" : el.value; 7774 const newValue = value == null ? ( 7775 // #11647: value should be set as empty string for null and undefined, 7776 // but <input type="checkbox"> should be set as 'on'. 7777 el.type === "checkbox" ? "on" : "" 7778 ) : String(value); 7779 if (oldValue !== newValue || !("_value" in el)) { 7780 el.value = newValue; 7781 } 7782 if (value == null) { 7783 el.removeAttribute(key); 7784 } 7785 el._value = value; 7786 return; 7787 } 7788 let needRemove = false; 7789 if (value === "" || value == null) { 7790 const type = typeof el[key]; 7791 if (type === "boolean") { 7792 value = includeBooleanAttr(value); 7793 } else if (value == null && type === "string") { 7794 value = ""; 7795 needRemove = true; 7796 } else if (type === "number") { 7797 value = 0; 7798 needRemove = true; 7799 } 7800 } 7801 try { 7802 el[key] = value; 7803 } catch (e) { 7804 if (!!(define_process_env_default$6.NODE_ENV !== "production") && !needRemove) { 7805 warn$2( 7806 `Failed setting prop "${key}" on <${tag2.toLowerCase()}>: value ${value}
7806 is invalid.`, 7807 e 7808 ); 7809 } 7810 } 7811 needRemove && el.removeAttribute(attrName || key); 7812} 7813function addEventListener(el, event, handler, options) { 7814 el.addEventListener(event, handler, options); 7815} 7816function removeEventListener(el, event, handler, options) { 7817 el.removeEventListener(event, handler, options); 7818} 7819const veiKey = Symbol("_vei"); 7820function patchEvent(el, rawName, prevValue, nextValue, instance = null) { 7821 const invokers = el[veiKey] || (el[veiKey] = {}); 7822 const existingInvoker = invokers[rawName]; 7823 if (nextValue && existingInvoker) { 7824 existingInvoker.value = !!(define_process_env_default$6.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue; 7825 } else { 7826 const [name, options] = parseName(rawName); 7827 if (nextValue) { 7828 const invoker = invokers[rawName] = createInvoker( 7829 !!(define_process_env_default$6.NODE_ENV !== "production") ? sanitizeEventValue(nextValue, rawName) : nextValue, 7830 instance 7831 ); 7832 addEventListener(el, name, invoker, options); 7833 } else if (existingInvoker) { 7834 removeEventListener(el, name, existingInvoker, options); 7835 invokers[rawName] = void 0; 7836 } 7837 } 7838} 7839const optionsModifierRE = /(?:Once|Passive|Capture)$/; 7840function parseName(name) { 7841 let options; 7842 if (optionsModifierRE.test(name)) { 7843 options = {}; 7844 let m; 7845 while (m = name.match(optionsModifierRE)) { 7846 name = name.slice(0, name.length - m[0].length); 7847 options[m[0].toLowerCase()] = true; 7848 } 7849 } 7850 const event = name[2] === ":" ? name.slice(3) : hyphenate(name.slice(2)); 7851 return [event, options]; 7852} 7853let cachedNow = 0; 7854const p = /* @__PURE__ */ Promise.resolve(); 7855const getNow = () => cachedNow || (p.then(() => cachedNow = 0), cachedNow = Date.now()); 7856function createInvoker(initialValue, instance) { 7857 const invoker = (e) => { 7858 if (!e._vts) { 7859 e._vts = Date.now(); 7860 } else if (e._vts <= invoker.attached) { 7861 return; 7862 } 7863 callWithAsyncErrorHandling( 7864 patchStopImmediatePropagation(e, invoker.value), 7865 instance, 7866 5, 7867 [e] 7868 ); 7869 }; 7870 invoker.value = initialValue; 7871 invoker.attached = getNow(); 7872 return invoker; 7873} 7874function sanitizeEventValue(value, propName) { 7875 if (isFunction$1(value) || isArray$1(value)) { 7876 return value; 7877 } 7878 warn$2( 7879 `Wrong type passed as event handler to ${propName} - did you forget @ or : in front of your prop? 7880Expected function or array of functions, received type ${typeof value}.` 7881 ); 7882 return NOOP; 7883} 7884function patchStopImmediatePropagation(e, value) { 7885 if (isArray$1(value)) { 7886 const originalStop = e.stopImmediatePropagation; 7887 e.stopImmediatePropagation = () => { 7888 originalStop.call(e); 7889 e._stopped = true; 7890 }; 7891 return value.map( 7892 (fn) => (e2) => !e2._stopped && fn && fn(e2) 7893 ); 7894 } else { 7895 return value; 7896 } 7897} 7898const isNativeOn = (key) =>
vendor: 6,535 bytes, lines 7898-8095
7898 key.charCodeAt(0) === 111 && key.charCodeAt(1) === 110 && // lowercase letter 7899key.charCodeAt(2) > 96 && key.charCodeAt(2) < 123; 7900const patchProp = (el, key, prevValue, nextValue, namespace, parentComponent) => { 7901 const isSVG = namespace === "svg"; 7902 if (key === "class") { 7903 patchClass(el, nextValue, isSVG); 7904 } else if (key === "style") { 7905 patchStyle(el, prevValue, nextValue); 7906 } else if (isOn(key)) { 7907 if (!isModelListener(key)) { 7908 patchEvent(el, key, prevValue, nextValue, parentComponent); 7909 } 7910 } else if (key[0] === "." ? (key = key.slice(1), true) : key[0] === "^" ? (key = key.slice(1), false) : shouldSetAsProp(el, key, nextValue, isSVG)) { 7911 patchDOMProp(el, key, nextValue); 7912 if (!el.tagName.includes("-") && (key === "value" || key === "checked" || key === "selected")) { 7913 patchAttr(el, key, nextValue, isSVG, parentComponent, key !== "value"); 7914 } 7915 } else if ( 7916 // #11081 force set props for possible async custom element 7917 el._isVueCE && (/[A-Z]/.test(key) || !isString$2(nextValue)) 7918 ) { 7919 patchDOMProp(el, camelize(key), nextValue, parentComponent, key); 7920 } else { 7921 if (key === "true-value") { 7922 el._trueValue = nextValue; 7923 } else if (key === "false-value") { 7924 el._falseValue = nextValue; 7925 } 7926 patchAttr(el, key, nextValue, isSVG); 7927 } 7928}; 7929function shouldSetAsProp(el, key, value, isSVG) { 7930 if (isSVG) { 7931 if (key === "innerHTML" || key === "textContent") { 7932 return true; 7933 } 7934 if (key in el && isNativeOn(key) && isFunction$1(value)) { 7935 return true; 7936 } 7937 return false; 7938 } 7939 if (key === "spellcheck" || key === "draggable" || key === "translate" || key === "autocorrect") { 7940 return false; 7941 } 7942 if (key === "form") { 7943 return false; 7944 } 7945 if (key === "list" && el.tagName === "INPUT") { 7946 return false; 7947 } 7948 if (key === "type" && el.tagName === "TEXTAREA") { 7949 return false; 7950 } 7951 if (key === "width" || key === "height") { 7952 const tag2 = el.tagName; 7953 if (tag2 === "IMG" || tag2 === "VIDEO" || tag2 === "CANVAS" || tag2 === "SOURCE") { 7954 return false; 7955 } 7956 } 7957 if (isNativeOn(key) && isString$2(value)) { 7958 return false; 7959 } 7960 return key in el; 7961} 7962const getModelAssigner = (vnode) => { 7963 const fn = vnode.props["onUpdate:modelValue"] || false; 7964 return isArray$1(fn) ? (value) => invokeArrayFns(fn, value) : fn; 7965}; 7966function onCompositionStart(e) { 7967 e.target.composing = true; 7968} 7969function onCompositionEnd(e) { 7970 const target = e.target; 7971 if (target.composing) { 7972 target.composing = false; 7973 target.dispatchEvent(new Event("input")); 7974 } 7975} 7976const assignKey = Symbol("_assign"); 7977const vModelText = { 7978 created(el, { modifiers: { lazy, trim, number: number2 } }, vnode) { 7979 el[assignKey] = getModelAssigner(vnode); 7980 const castToNumber = number2 || vnode.props && vnode.props.type === "number"; 7981 addEventListener(el, lazy ? "change" : "input", (e) => { 7982 if (e.target.composing) return; 7983 let domValue = el.value; 7984 if (trim) { 7985 domValue = domValue.trim(); 7986 } 7987 if (castToNumber) { 7988 domValue = looseToNumber(domValue); 7989 } 7990 el[assignKey](domValue); 7991 }); 7992 if (trim) { 7993 addEventListener(el, "change", () => { 7994 el.value = el.value.trim(); 7995 }); 7996 } 7997 if (!lazy) { 7998 addEventListener(el, "compositionstart", onCompositionStart); 7999 addEventListener(el, "compositionend", onCompositionEnd); 8000 addEventListener(el, "change", onCompositionEnd); 8001 } 8002 }, 8003 // set value on mounted so it's after min/max for type="range" 8004 mounted(el, { value }) { 8005 el.value = value == null ? "" : value; 8006 }, 8007 beforeUpdate(el, { value, oldValue, modifiers: { lazy, trim, number: number2 } }, vnode) { 8008 el[assignKey] = getModelAssigner(vnode); 8009 if (el.composing) return; 8010 const elValue = (number2 || el.type === "number") && !/^0\d/.test(el.value) ? looseToNumber(el.value) : el.value; 8011 const newValue = value == null ? "" : value; 8012 if (elValue === newValue) { 8013 return; 8014 } 8015 if (document.activeElement === el && el.type !== "range") { 8016 if (lazy && value === oldValue) { 8017 return; 8018 } 8019 if (trim && el.value.trim() === newValue) { 8020 return; 8021 } 8022 } 8023 el.value = newValue; 8024 } 8025}; 8026const vModelCheckbox = { 8027 // #4096 array checkboxes need to be deep traversed 8028 deep: true, 8029 created(el, _, vnode) { 8030 el[assignKey] = getModelAssigner(vnode); 8031 addEventListener(el, "change", () => { 8032 const modelValue = el._modelValue; 8033 const elementValue = getValue(el); 8034 const checked = el.checked; 8035 const assign2 = el[assignKey]; 8036 if (isArray$1(modelValue)) { 8037 const index = looseIndexOf(modelValue, elementValue); 8038 const found = index !== -1; 8039 if (checked && !found) { 8040 assign2(modelValue.concat(elementValue)); 8041 } else if (!checked && found) { 8042 const filtered = [...modelValue]; 8043 filtered.splice(index, 1); 8044 assign2(filtered); 8045 } 8046 } else if (isSet(modelValue)) { 8047 const cloned = new Set(modelValue); 8048 if (checked) { 8049 cloned.add(elementValue); 8050 } else { 8051 cloned.delete(elementValue); 8052 } 8053 assign2(cloned); 8054 } else { 8055 assign2(getCheckboxValue$1(el, checked)); 8056 } 8057 }); 8058 }, 8059 // set initial checked on mount to wait for true-value/false-value 8060 mounted: setChecked, 8061 beforeUpdate(el, binding, vnode) { 8062 el[assignKey] = getModelAssigner(vnode); 8063 setChecked(el, binding, vnode); 8064 } 8065}; 8066function setChecked(el, { value, oldValue }, vnode) { 8067 el._modelValue = value; 8068 let checked; 8069 if (isArray$1(value)) { 8070 checked = looseIndexOf(value, vnode.props.value) > -1; 8071 } else if (isSet(value)) { 8072 checked = value.has(vnode.props.value); 8073 } else { 8074 if (value === oldValue) return; 8075 checked = looseEqual(value, getCheckboxValue$1(el, true)); 8076 } 8077 if (el.checked !== checked) { 8078 el.checked = checked; 8079 } 8080} 8081const vModelSelect = { 8082 // <select multiple> value need to be deep traversed 8083 deep: true, 8084 created(el, { value, modifiers: { number: number2 } }, vnode) { 8085 const isSetModel = isSet(value); 8086 addEventListener(el, "change", () => { 8087 const selectedVal = Array.prototype.filter.call(el.options, (o) => o.selected).map( 8088 (o) => number2 ? looseToNumber(getValue(o)) : getValue(o) 8089 ); 8090 el[assignKey]( 8091 el.multiple ? isSetModel ? new Set(selectedVal) : selectedVal : selectedVal[0] 8092 ); 8093 el._assigning = true; 8094 nextTick(() => { 8095 el._assigning = false;
vendor: 6,182 bytes, lines 8096-8271
8096 }); 8097 }); 8098 el[assignKey] = getModelAssigner(vnode); 8099 }, 8100 // set value in mounted & updated because <select> relies on its children 8101 // <option>s. 8102 mounted(el, { value }) { 8103 setSelected(el, value); 8104 }, 8105 beforeUpdate(el, _binding, vnode) { 8106 el[assignKey] = getModelAssigner(vnode); 8107 }, 8108 updated(el, { value }) { 8109 if (!el._assigning) { 8110 setSelected(el, value); 8111 } 8112 } 8113}; 8114function setSelected(el, value) { 8115 const isMultiple = el.multiple; 8116 const isArrayValue = isArray$1(value); 8117 if (isMultiple && !isArrayValue && !isSet(value)) { 8118 !!(define_process_env_default$6.NODE_ENV !== "production") && warn$2( 8119 `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(value).slice(8, -1)}.` 8120 ); 8121 return; 8122 } 8123 for (let i = 0, l = el.options.length; i < l; i++) { 8124 const option = el.options[i]; 8125 const optionValue = getValue(option); 8126 if (isMultiple) { 8127 if (isArrayValue) { 8128 const optionType = typeof optionValue; 8129 if (optionType === "string" || optionType === "number") { 8130 option.selected = value.some((v) => String(v) === String(optionValue)); 8131 } else { 8132 option.selected = looseIndexOf(value, optionValue) > -1; 8133 } 8134 } else { 8135 option.selected = value.has(optionValue); 8136 } 8137 } else if (looseEqual(getValue(option), value)) { 8138 if (el.selectedIndex !== i) el.selectedIndex = i; 8139 return; 8140 } 8141 } 8142 if (!isMultiple && el.selectedIndex !== -1) { 8143 el.selectedIndex = -1; 8144 } 8145} 8146function getValue(el) { 8147 return "_value" in el ? el._value : el.value; 8148} 8149function getCheckboxValue$1(el, checked) { 8150 const key = checked ? "_trueValue" : "_falseValue"; 8151 return key in el ? el[key] : checked; 8152} 8153const systemModifiers = ["ctrl", "shift", "alt", "meta"]; 8154const modifierGuards = { 8155 stop: (e) => e.stopPropagation(), 8156 prevent: (e) => e.preventDefault(), 8157 self: (e) => e.target !== e.currentTarget, 8158 ctrl: (e) => !e.ctrlKey, 8159 shift: (e) => !e.shiftKey, 8160 alt: (e) => !e.altKey, 8161 meta: (e) => !e.metaKey, 8162 left: (e) => "button" in e && e.button !== 0, 8163 middle: (e) => "button" in e && e.button !== 1, 8164 right: (e) => "button" in e && e.button !== 2, 8165 exact: (e, modifiers) => systemModifiers.some((m) => e[`${m}Key`] && !modifiers.includes(m)) 8166}; 8167const withModifiers = (fn, modifiers) => { 8168 const cache2 = fn._withMods || (fn._withMods = {}); 8169 const cacheKey = modifiers.join("."); 8170 return cache2[cacheKey] || (cache2[cacheKey] = ((event, ...args) => { 8171 for (let i = 0; i < modifiers.length; i++) { 8172 const guard = modifierGuards[modifiers[i]]; 8173 if (guard && guard(event, modifiers)) return; 8174 } 8175 return fn(event, ...args); 8176 })); 8177}; 8178const rendererOptions = /* @__PURE__ */ extend({ patchProp }, nodeOps); 8179let renderer; 8180function ensureRenderer() { 8181 return renderer || (renderer = createRenderer(rendererOptions)); 8182} 8183const createApp = ((...args) => { 8184 const app = ensureRenderer().createApp(...args); 8185 if (!!(define_process_env_default$6.NODE_ENV !== "production")) { 8186 injectNativeTagCheck(app); 8187 injectCompilerOptionsCheck(app); 8188 } 8189 const { mount } = app; 8190 app.mount = (containerOrSelector) => { 8191 const container = normalizeContainer(containerOrSelector); 8192 if (!container) return; 8193 const component = app._component; 8194 if (!isFunction$1(component) && !component.render && !component.template) { 8195 component.template = container.innerHTML; 8196 } 8197 if (container.nodeType === 1) { 8198 container.textContent = ""; 8199 } 8200 const proxy = mount(container, false, resolveRootNamespace(container)); 8201 if (container instanceof Element) { 8202 container.removeAttribute("v-cloak"); 8203 container.setAttribute("data-v-app", ""); 8204 } 8205 return proxy; 8206 }; 8207 return app; 8208}); 8209function resolveRootNamespace(container) { 8210 if (container instanceof SVGElement) { 8211 return "svg"; 8212 } 8213 if (typeof MathMLElement === "function" && container instanceof MathMLElement) { 8214 return "mathml"; 8215 } 8216} 8217function injectNativeTagCheck(app) { 8218 Object.defineProperty(app.config, "isNativeTag", { 8219 value: (tag2) => isHTMLTag(tag2) || isSVGTag(tag2) || isMathMLTag(tag2), 8220 writable: false 8221 }); 8222} 8223function injectCompilerOptionsCheck(app) { 8224 { 8225 const isCustomElement = app.config.isCustomElement; 8226 Object.defineProperty(app.config, "isCustomElement", { 8227 get() { 8228 return isCustomElement; 8229 }, 8230 set() { 8231 warn$2( 8232 `The \`isCustomElement\` config option is deprecated. Use \`compilerOptions.isCustomElement\` instead.` 8233 ); 8234 } 8235 }); 8236 const compilerOptions = app.config.compilerOptions; 8237 const msg = `The \`compilerOptions\` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, \`compilerOptions\` must be passed to \`@vue/compiler-dom\` in the build setup instead. 8238- For vue-loader: pass it via vue-loader's \`compilerOptions\` loader option. 8239- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader 8240- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc`; 8241 Object.defineProperty(app.config, "compilerOptions", { 8242 get() { 8243 warn$2(msg); 8244 return compilerOptions; 8245 }, 8246 set() { 8247 warn$2(msg); 8248 } 8249 }); 8250 } 8251} 8252function normalizeContainer(container) { 8253 if (isString$2(container)) { 8254 const res = document.querySelector(container); 8255 if (!!(define_process_env_default$6.NODE_ENV !== "production") && !res) { 8256 warn$2( 8257 `Failed to mount app: mount target selector "${container}" returned null.` 8258 ); 8259 } 8260 return res; 8261 } 8262 if (!!(define_process_env_default$6.NODE_ENV !== "production") && window.ShadowRoot && container instanceof window.ShadowRoot && container.mode === "closed") { 8263 warn$2( 8264 `mounting on a ShadowRoot with \`{mode: "closed"}\` may lead to unpredictable bugs` 8265 ); 8266 } 8267 return container; 8268} 8269var define_process_env_default$5 = {}; 8270function initDev() { 8271 {
8272 initCustomFormatter(); 8273 } 8274} 8275if (!!(define_process_env_default$5.NODE_ENV !== "production")) { 8276 initDev(); 8277} 8278const _export_sfc = (sfc, props) => { 8279 const target = sfc.__vccOpts || sfc; 8280 for (const [key, val] of props) { 8281 target[key] = val; 8282 } 8283 return target; 8284}; 8285const _sfc_main$3 = { 8286 props: { 8287 messageData: { 8288 type: Object, 8289 required: true 8290 }, 8291 reply_to: { 8292 type: String, 8293 default: "" 8294 } 8295 }, 8296 data() { 8297 return {}; 8298 }, 8299 computed: { 8300 head() { 8301 return this.messageData.body || ""; 8302 }, 8303 body() { 8304 return this.messageData.footer || ""; 8305 }, 8306 options() { 8307 return this.messageData.options || []; 8308 } 8309 }, 8310 methods: { 8311 handleOptionClick(option) { 8312 if (this.messageData.type === "calification") { 8313 let id = this.messageData.options.indexOf(option) + 1; 8314 let idString = "__CALIFICATION__" + id; 8315 this.$emit("option-selected", { option, reply_to: this.reply_to, id: idString, type: "calification_response" }); 8316 } else if (option.includes("|")) { 8317 this.$emit("option-selected", { option: option.split("|")[1].trim(), reply_to: this.reply_to, id: option.split("|")[1].trim() }); 8318 } else { 8319 this.$emit("option-selected", { option, reply_to: this.reply_to, id: option }); 8320 } 8321 } 8322 } 8323}; 8324const _hoisted_1$2 = { class: "max-w-sm" }; 8325const _hoisted_2$2 = { class: "interactive-message" }; 8326const _hoisted_3$2 = { class: "font-bold" }; 8327const _hoisted_4$2 = { class: "mt-2" }; 8328const _hoisted_5$2 = { 8329 key: 0, 8330 class: "overflow-auto w-full py-4 options flex gap-2" 8331}; 8332const _hoisted_6$2 = ["onClick"]; 8333function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) { 8334 return openBlock(), createElementBlock("div", _hoisted_1$2, [ 8335 createBaseVNode("div", _hoisted_2$2, [ 8336 createBaseVNode("h3", _hoisted_3$2, toDisplayString$1($options.head), 1), 8337 createBaseVNode("p", _hoisted_4$2, toDisplayString$1($options.body), 1), 8338 $options.options.length > 0 ? (openBlock(), createElementBlock("div", _hoisted_5$2, [ 8339 (openBlock(true), createElementBlock(Fragment, null, renderList($options.options, (option, index) => { 8340 return openBlock(), createElementBlock("button", { 8341 key: index, 8342 onClick: ($event) => $options.handleOptionClick(option), 8343 class: "bg-white border border-gray-300 text-black rounded-full px-4 py-2 flex-shrink-0" 8344 }, toDisplayString$1(option.split("|")[0].trim()), 9, _hoisted_6$2); 8345 }), 128)) 8346 ])) : createCommentVNode("", true) 8347 ]) 8348 ]); 8349} 8350const InteractiveMessage = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]); 8351function _getDefaults() { 8352 return { 8353 async: false, 8354 breaks: false, 8355 extensions: null, 8356 gfm: true, 8357 hooks: null, 8358 pedantic: false, 8359 renderer: null, 8360 silent: false, 8361 tokenizer: null, 8362 walkTokens: null 8363 }; 8364} 8365var _defaults = _getDefaults(); 8366function changeDefaults(newDefaults) { 8367 _defaults = newDefaults; 8368} 8369var noopTest = { exec: () => null }; 8370function edit(regex, opt = "") { 8371 let source = typeof regex === "string" ? regex : regex.source; 8372 const obj = { 8373 replace: (name, val) => { 8374 let valSource = typeof val === "string" ? val : val.source; 8375 valSource = valSource.replace(other.caret, "$1"); 8376 source = source.replace(name, valSource); 8377 return obj; 8378 }, 8379 getRegex: () => { 8380 return new RegExp(source, opt); 8381 } 8382 }; 8383 return obj; 8384} 8385var other = { 8386 codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, 8387 outputLinkReplace: /\\([\[\]])/g, 8388 indentCodeCompensation: /^(\s+)(?:```)/, 8389 beginningSpace: /^\s+/, 8390 endingHash: /#$/, 8391 startingSpaceChar: /^ /, 8392 endingSpaceChar: / $/, 8393 nonSpaceChar: /[^ ]/, 8394 newLineCharGlobal: /\n/g, 8395 tabCharGlobal: /\t/g, 8396 multipleSpaceGlobal: /\s+/g, 8397 blankLine: /^[ \t]*$/, 8398 doubleBlankLine: /\n[ \t]*\n[ \t]*$/, 8399 blockquoteStart: /^ {0,3}>/, 8400 blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, 8401 blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, 8402 listReplaceTabs: /^\t+/, 8403 listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, 8404 listIsTask: /^\[[ xX]\] /, 8405 listReplaceTask: /^\[[ xX]\] +/,
vendor: 4,109 bytes, lines 8406-8460
8406 anyLine: /\n.*\n/, 8407 hrefBrackets: /^<(.*)>$/, 8408 tableDelimiter: /[:|]/, 8409 tableAlignChars: /^\||\| *$/g, 8410 tableRowBlankLine: /\n[ \t]*$/, 8411 tableAlignRight: /^ *-+: *$/, 8412 tableAlignCenter: /^ *:-+: *$/, 8413 tableAlignLeft: /^ *:-+ *$/, 8414 startATag: /^<a /i, 8415 endATag: /^<\/a>/i, 8416 startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, 8417 endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, 8418 startAngleBracket: /^</, 8419 endAngleBracket: />$/, 8420 pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, 8421 unicodeAlphaNumeric: /[\p{L}\p{N}]/u, 8422 escapeTest: /[&<>"']/, 8423 escapeReplace: /[&<>"']/g, 8424 escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, 8425 escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, 8426 unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, 8427 caret: /(^|[^\[])\^/g, 8428 percentDecode: /%25/g, 8429 findPipe: /\|/g, 8430 splitPipe: / \|/, 8431 slashPipe: /\\\|/g, 8432 carriageReturn: /\r\n|\r/g, 8433 spaceLine: /^ +$/gm, 8434 notSpaceStart: /^\S*/, 8435 endingNewline: /\n$/, 8436 listItemRegex: (bull) => new RegExp(`^( {0,3}${bull})((?:[ ][^\\n]*)?(?:\\n|$))`), 8437 nextBulletRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), 8438 hrRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), 8439 fencesBeginRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}(?:\`\`\`|~~~)`), 8440 headingBeginRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}#`), 8441 htmlBeginRegex: (indent) => new RegExp(`^ {0,${Math.min(3, indent - 1)}}<(?:[a-z].*>|!--)`, "i") 8442}; 8443var newline = /^(?:[ \t]*(?:\n|$))+/; 8444var blockCode = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/; 8445var fences = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/; 8446var hr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/; 8447var heading = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/; 8448var bullet = /(?:[*+-]|\d{1,9}[.)])/; 8449var lheadingCore = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/; 8450var lheading = edit(lheadingCore).replace(/bull/g, bullet).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(); 8451var lheadingGfm = edit(lheadingCore).replace(/bull/g, bullet).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(); 8452var _paragraph = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/; 8453var blockText = /^[^\n]+/; 8454var _blockLabel = /(?!\s*\])(?:\\.|[^\[\]\\])+/; 8455var def = edit(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", _blockLabel).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(); 8456var list = edit(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, bullet).getRegex(); 8457var _tag = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul"; 8458var _comment = /<!--(?:-?>|[\s\S]*?(?:-->|$))/; 8459var html = edit( 8460 "^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>
8460(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", 8461 "i" 8462).replace("comment", _comment).replace("tag", _tag).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(); 8463var paragraph = edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex(); 8464var blockquote = edit(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", paragraph).getRegex(); 8465var blockNormal = { 8466 blockquote, 8467 code: blockCode, 8468 def, 8469 fences, 8470 heading, 8471 hr, 8472 html, 8473 lheading, 8474 list, 8475 newline, 8476 paragraph, 8477 table: noopTest, 8478 text: blockText 8479}; 8480var gfmTable = edit( 8481 "^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)" 8482).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex(); 8483var blockGfm = { 8484 ...blockNormal, 8485 lheading: lheadingGfm, 8486 table: gfmTable, 8487 paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", gfmTable).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _tag).getRegex() 8488}; 8489var blockPedantic = { 8490 ...blockNormal, 8491 html: edit( 8492 `^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))` 8493 ).replace("comment", _comment).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), 8494 def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, 8495 heading: /^(#{1,6})(.*)(?:\n+|$)/, 8496 fences: noopTest, 8497 // fences not supported 8498 lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, 8499 paragraph: edit(_paragraph).replace("hr", hr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", lheading).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() 8500}; 8501var escape$1 = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/; 8502var inlineCode = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/; 8503var br = /^( {2,}|\\)\n(?!\s*$)/; 8504var inlineText = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/; 8505var _punctuation = /[\p{P}\p{S}]/u; 8506var _punctuationOrSpace = /[\s\p{P}\p{S}]/u; 8507var _notPunctuationOrSpace = /[^\s\p{P}\p{S}]/u; 8508var punctuation = edit(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, _punctuationOrSpace).getRegex(); 8509var _punctuationGfmStrongEm = /(?!~)[\p{P}\p{S}]/u; 8510var _punctuationOrSpaceGfmStrongEm = /(?!~)[\s\p{P}\p{S}]/u; 8511var _notPunctuationOrSpaceGfmStrongEm = /(?:[^\s\p{P}\p{S}]|~)/u; 8512var blockSkip = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g; 8513var emStrongLDelimCore = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/; 8514var emStrongLDelim = edit(emStrongLDelimCore, "u").replace(/punct/g, _punctuation).getRegex(); 8515var emStrongLDelimGfm = edit(emStrongLDelimCore, "u").replace(/punct/g, _punctuationGfmStrongEm).getRegex(); 8516var emStrongRDelimAstCore = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)"; 8517var emStrongRDelimAst = edit(emStrongRDelimAstCore, "gu").replace(/notPunctSpace/g, _notPunctuationOrSpace).replace(/punctSpace/g, _punctuationOrSpace).replace(/punct/g, _punctuation).getRegex(); 8518var emStrongRDelimAstGfm = edit(emStrongRDelimAstCore, "gu").replace(/notPunctSpace/g, _notPunctuationOrSpaceGfmStrongEm).replace(/punctSpace/g, _punctuationOrSpaceGfmStrongEm).replace(/punct/g, _punctuationGfmStrongEm).getRegex(); 8519var emStrongRDelimUnd = edit( 8520 "^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", 8521 "gu" 8522).replace(/notPunctSpace/g, _notPunctuationOrSpace).replace(/punctSpace/g, _punctuationOrSpace).replace(/punct/g, _punctuation).getRegex(); 8523var anyPunctuation = edit(/\\(punct)/, "gu").replace(/punct/g, _punctuation).getRegex(); 8524var autolink = edit(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(); 8525var _inlineComment = edit(_comment).replace("(?:-->|$)", "-->").getRegex(); 8526var tag = edit( 8527 "^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>" 8528).replace("comment", _inlineComment).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(); 8529var _inlineLabel = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/; 8530var link = edit(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", _inlineLabel).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(); 8531var reflink = edit(/^!?\[(label)\]\[(ref)\]/).replace("label", _inlineLabel).replace("ref", _blockLabel).getRegex(); 8532var nolink = edit(/^!?\[(ref)\](?:\[\])?/).replace("ref", _blockLabel).getRegex(); 8533var reflinkSearch = edit("reflink|nolink(?!\\()", "g").replace("reflink", reflink).replace("nolink", nolink).getRegex(); 8534var inlineNormal = { 8535 _backpedal: noopTest, 8536 // only used for GFM url 8537 anyPunctuation, 8538 autolink, 8539 blockSkip, 8540 br,
vendor: 17,491 bytes, lines 8541-9113
8541 code: inlineCode, 8542 del: noopTest, 8543 emStrongLDelim, 8544 emStrongRDelimAst, 8545 emStrongRDelimUnd, 8546 escape: escape$1, 8547 link, 8548 nolink, 8549 punctuation, 8550 reflink, 8551 reflinkSearch, 8552 tag, 8553 text: inlineText, 8554 url: noopTest 8555}; 8556var inlinePedantic = { 8557 ...inlineNormal, 8558 link: edit(/^!?\[(label)\]\((.*?)\)/).replace("label", _inlineLabel).getRegex(), 8559 reflink: edit(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", _inlineLabel).getRegex() 8560}; 8561var inlineGfm = { 8562 ...inlineNormal, 8563 emStrongRDelimAst: emStrongRDelimAstGfm, 8564 emStrongLDelim: emStrongLDelimGfm, 8565 url: edit(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), 8566 _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, 8567 del: /^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/, 8568 text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/ 8569}; 8570var inlineBreaks = { 8571 ...inlineGfm, 8572 br: edit(br).replace("{2,}", "*").getRegex(), 8573 text: edit(inlineGfm.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() 8574}; 8575var block = { 8576 normal: blockNormal, 8577 gfm: blockGfm, 8578 pedantic: blockPedantic 8579}; 8580var inline = { 8581 normal: inlineNormal, 8582 gfm: inlineGfm, 8583 breaks: inlineBreaks, 8584 pedantic: inlinePedantic 8585}; 8586var escapeReplacements = { 8587 "&": "&", 8588 "<": "<", 8589 ">": ">", 8590 '"': """, 8591 "'": "'" 8592}; 8593var getEscapeReplacement = (ch) => escapeReplacements[ch]; 8594function escape2(html2, encode) { 8595 if (encode) { 8596 if (other.escapeTest.test(html2)) { 8597 return html2.replace(other.escapeReplace, getEscapeReplacement); 8598 } 8599 } else { 8600 if (other.escapeTestNoEncode.test(html2)) { 8601 return html2.replace(other.escapeReplaceNoEncode, getEscapeReplacement); 8602 } 8603 } 8604 return html2; 8605} 8606function cleanUrl(href) { 8607 try { 8608 href = encodeURI(href).replace(other.percentDecode, "%"); 8609 } catch { 8610 return null; 8611 } 8612 return href; 8613} 8614function splitCells(tableRow, count) { 8615 var _a2; 8616 const row = tableRow.replace(other.findPipe, (match, offset, str) => { 8617 let escaped = false; 8618 let curr = offset; 8619 while (--curr >= 0 && str[curr] === "\\") escaped = !escaped; 8620 if (escaped) { 8621 return "|"; 8622 } else { 8623 return " |"; 8624 } 8625 }), cells = row.split(other.splitPipe); 8626 let i = 0; 8627 if (!cells[0].trim()) { 8628 cells.shift(); 8629 } 8630 if (cells.length > 0 && !((_a2 = cells.at(-1)) == null ? void 0 : _a2.trim())) { 8631 cells.pop(); 8632 } 8633 if (count) { 8634 if (cells.length > count) { 8635 cells.splice(count); 8636 } else { 8637 while (cells.length < count) cells.push(""); 8638 } 8639 } 8640 for (; i < cells.length; i++) { 8641 cells[i] = cells[i].trim().replace(other.slashPipe, "|"); 8642 } 8643 return cells; 8644} 8645function rtrim(str, c, invert) { 8646 const l = str.length; 8647 if (l === 0) { 8648 return ""; 8649 } 8650 let suffLen = 0; 8651 while (suffLen < l) { 8652 const currChar = str.charAt(l - suffLen - 1); 8653 if (currChar === c && true) { 8654 suffLen++; 8655 } else { 8656 break; 8657 } 8658 } 8659 return str.slice(0, l - suffLen); 8660} 8661function findClosingBracket(str, b) { 8662 if (str.indexOf(b[1]) === -1) { 8663 return -1; 8664 } 8665 let level = 0; 8666 for (let i = 0; i < str.length; i++) { 8667 if (str[i] === "\\") { 8668 i++; 8669 } else if (str[i] === b[0]) { 8670 level++; 8671 } else if (str[i] === b[1]) { 8672 level--; 8673 if (level < 0) { 8674 return i; 8675 } 8676 } 8677 } 8678 if (level > 0) { 8679 return -2; 8680 } 8681 return -1; 8682} 8683function outputLink(cap, link2, raw, lexer2, rules) { 8684 const href = link2.href; 8685 const title = link2.title || null; 8686 const text = cap[1].replace(rules.other.outputLinkReplace, "$1"); 8687 lexer2.state.inLink = true; 8688 const token = { 8689 type: cap[0].charAt(0) === "!" ? "image" : "link", 8690 raw, 8691 href, 8692 title, 8693 text, 8694 tokens: lexer2.inlineTokens(text) 8695 }; 8696 lexer2.state.inLink = false; 8697 return token; 8698} 8699function indentCodeCompensation(raw, text, rules) { 8700 const matchIndentToCode = raw.match(rules.other.indentCodeCompensation); 8701 if (matchIndentToCode === null) { 8702 return text; 8703 } 8704 const indentToCode = matchIndentToCode[1]; 8705 return text.split("\n").map((node) => { 8706 const matchIndentInNode = node.match(rules.other.beginningSpace); 8707 if (matchIndentInNode === null) { 8708 return node; 8709 } 8710 const [indentInNode] = matchIndentInNode; 8711 if (indentInNode.length >= indentToCode.length) { 8712 return node.slice(indentToCode.length); 8713 } 8714 return node; 8715 }).join("\n"); 8716} 8717var _Tokenizer = class { 8718 // set by the lexer 8719 constructor(options2) { 8720 __publicField(this, "options"); 8721 __publicField(this, "rules"); 8722 // set by the lexer 8723 __publicField(this, "lexer"); 8724 this.options = options2 || _defaults; 8725 } 8726 space(src) { 8727 const cap = this.rules.block.newline.exec(src); 8728 if (cap && cap[0].length > 0) { 8729 return { 8730 type: "space", 8731 raw: cap[0] 8732 }; 8733 } 8734 } 8735 code(src) { 8736 const cap = this.rules.block.code.exec(src); 8737 if (cap) { 8738 const text = cap[0].replace(this.rules.other.codeRemoveIndent, ""); 8739 return { 8740 type: "code", 8741 raw: cap[0], 8742 codeBlockStyle: "indented", 8743 text: !this.options.pedantic ? rtrim(text, "\n") : text 8744 }; 8745 } 8746 } 8747 fences(src) { 8748 const cap = this.rules.block.fences.exec(src); 8749 if (cap) { 8750 const raw = cap[0]; 8751 const text = indentCodeCompensation(raw, cap[3] || "", this.rules); 8752 return { 8753 type: "code", 8754 raw, 8755 lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : cap[2], 8756 text 8757 }; 8758 } 8759 } 8760 heading(src) { 8761 const cap = this.rules.block.heading.exec(src); 8762 if (cap) { 8763 let text = cap[2].trim(); 8764 if (this.rules.other.endingHash.test(text)) { 8765 const trimmed = rtrim(text, "#"); 8766 if (this.options.pedantic) { 8767 text = trimmed.trim(); 8768 } else if (!trimmed || this.rules.other.endingSpaceChar.test(trimmed)) { 8769 text = trimmed.trim(); 8770 } 8771 } 8772 return { 8773 type: "heading", 8774 raw: cap[0], 8775 depth: cap[1].length, 8776 text, 8777 tokens: this.lexer.inline(text) 8778 }; 8779 } 8780 } 8781 hr(src) { 8782 const cap = this.rules.block.hr.exec(src); 8783 if (cap) { 8784 return { 8785 type: "hr", 8786 raw: rtrim(cap[0], "\n") 8787 }; 8788 } 8789 } 8790 blockquote(src) { 8791 const cap = this.rules.block.blockquote.exec(src); 8792 if (cap) { 8793 let lines = rtrim(cap[0], "\n").split("\n"); 8794 let raw = ""; 8795 let text = ""; 8796 const tokens = []; 8797 while (lines.length > 0) { 8798 let inBlockquote = false; 8799 const currentLines = []; 8800 let i; 8801 for (i = 0; i < lines.length; i++) { 8802 if (this.rules.other.blockquoteStart.test(lines[i])) { 8803 currentLines.push(lines[i]); 8804 inBlockquote = true; 8805 } else if (!inBlockquote) { 8806 currentLines.push(lines[i]); 8807 } else { 8808 break; 8809 } 8810 } 8811 lines = lines.slice(i); 8812 const currentRaw = currentLines.join("\n"); 8813 const currentText = currentRaw.replace(this.rules.other.blockquoteSetextReplace, "\n $1").replace(this.rules.other.blockquoteSetextReplace2, ""); 8814 raw = raw ? `${raw} 8815${currentRaw}` : currentRaw; 8816 text = text ? `${text} 8817${currentText}` : currentText; 8818 const top = this.lexer.state.top; 8819 this.lexer.state.top = true; 8820 this.lexer.blockTokens(currentText, tokens, true); 8821 this.lexer.state.top = top; 8822 if (lines.length === 0) { 8823 break; 8824 } 8825 const lastToken = tokens.at(-1); 8826 if ((lastToken == null ? void 0 : lastToken.type) === "code") { 8827 break; 8828 } else if ((lastToken == null ? void 0 : lastToken.type) === "blockquote") { 8829 const oldToken = lastToken; 8830 const newText = oldToken.raw + "\n" + lines.join("\n"); 8831 const newToken = this.blockquote(newText); 8832 tokens[tokens.length - 1] = newToken; 8833 raw = raw.substring(0, raw.length - oldToken.raw.length) + newToken.raw; 8834 text = text.substring(0, text.length - oldToken.text.length) + newToken.text; 8835 break; 8836 } else if ((lastToken == null ? void 0 : lastToken.type) === "list") { 8837 const oldToken = lastToken; 8838 const newText = oldToken.raw + "\n" + lines.join("\n"); 8839 const newToken = this.list(newText); 8840 tokens[tokens.length - 1] = newToken; 8841 raw = raw.substring(0, raw.length - lastToken.raw.length) + newToken.raw; 8842 text = text.substring(0, text.length - oldToken.raw.length) + newToken.raw; 8843 lines = newText.substring(tokens.at(-1).raw.length).split("\n"); 8844 continue; 8845 } 8846 } 8847 return { 8848 type: "blockquote", 8849 raw, 8850 tokens, 8851 text 8852 }; 8853 } 8854 } 8855 list(src) { 8856 let cap = this.rules.block.list.exec(src); 8857 if (cap) { 8858 let bull = cap[1].trim(); 8859 const isordered = bull.length > 1; 8860 const list2 = { 8861 type: "list", 8862 raw: "", 8863 ordered: isordered, 8864 start: isordered ? +bull.slice(0, -1) : "", 8865 loose: false, 8866 items: [] 8867 }; 8868 bull = isordered ? `\\d{1,9}\\${bull.slice(-1)}` : `\\${bull}`; 8869 if (this.options.pedantic) { 8870 bull = isordered ? bull : "[*+-]"; 8871 } 8872 const itemRegex = this.rules.other.listItemRegex(bull); 8873 let endsWithBlankLine = false; 8874 while (src) { 8875 let endEarly = false; 8876 let raw = ""; 8877 let itemContents = ""; 8878 if (!(cap = itemRegex.exec(src))) { 8879 break; 8880 } 8881 if (this.rules.block.hr.test(src)) { 8882 break; 8883 } 8884 raw = cap[0]; 8885 src = src.substring(raw.length); 8886 let line = cap[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, (t) => " ".repeat(3 * t.length)); 8887 let nextLine = src.split("\n", 1)[0]; 8888 let blankLine = !line.trim(); 8889 let indent = 0; 8890 if (this.options.pedantic) { 8891 indent = 2; 8892 itemContents = line.trimStart(); 8893 } else if (blankLine) { 8894 indent = cap[1].length + 1; 8895 } else { 8896 indent = cap[2].search(this.rules.other.nonSpaceChar); 8897 indent = indent > 4 ? 1 : indent; 8898 itemContents = line.slice(indent); 8899 indent += cap[1].length; 8900 } 8901 if (blankLine && this.rules.other.blankLine.test(nextLine)) { 8902 raw += nextLine + "\n"; 8903 src = src.substring(nextLine.length + 1); 8904 endEarly = true; 8905 } 8906 if (!endEarly) { 8907 const nextBulletRegex = this.rules.other.nextBulletRegex(indent); 8908 const hrRegex = this.rules.other.hrRegex(indent); 8909 const fencesBeginRegex = this.rules.other.fencesBeginRegex(indent); 8910 const headingBeginRegex = this.rules.other.headingBeginRegex(indent); 8911 const htmlBeginRegex = this.rules.other.htmlBeginRegex(indent); 8912 while (src) { 8913 const rawLine = src.split("\n", 1)[0]; 8914 let nextLineWithoutTabs; 8915 nextLine = rawLine; 8916 if (this.options.pedantic) { 8917 nextLine = nextLine.replace(this.rules.other.listReplaceNesting, " "); 8918 nextLineWithoutTabs = nextLine; 8919 } else { 8920 nextLineWithoutTabs = nextLine.replace(this.rules.other.tabCharGlobal, " "); 8921 } 8922 if (fencesBeginRegex.test(nextLine)) { 8923 break; 8924 } 8925 if (headingBeginRegex.test(nextLine)) { 8926 break; 8927 } 8928 if (htmlBeginRegex.test(nextLine)) { 8929 break; 8930 } 8931 if (nextBulletRegex.test(nextLine)) { 8932 break; 8933 } 8934 if (hrRegex.test(nextLine)) { 8935 break; 8936 } 8937 if (nextLineWithoutTabs.search(this.rules.other.nonSpaceChar) >= indent || !nextLine.trim()) { 8938 itemContents += "\n" + nextLineWithoutTabs.slice(indent); 8939 } else { 8940 if (blankLine) { 8941 break; 8942 } 8943 if (line.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4) { 8944 break; 8945 } 8946 if (fencesBeginRegex.test(line)) { 8947 break; 8948 } 8949 if (headingBeginRegex.test(line)) { 8950 break; 8951 } 8952 if (hrRegex.test(line)) { 8953 break; 8954 } 8955 itemContents += "\n" + nextLine; 8956 } 8957 if (!blankLine && !nextLine.trim()) { 8958 blankLine = true; 8959 } 8960 raw += rawLine + "\n"; 8961 src = src.substring(rawLine.length + 1); 8962 line = nextLineWithoutTabs.slice(indent); 8963 } 8964 } 8965 if (!list2.loose) { 8966 if (endsWithBlankLine) { 8967 list2.loose = true; 8968 } else if (this.rules.other.doubleBlankLine.test(raw)) { 8969 endsWithBlankLine = true; 8970 } 8971 } 8972 let istask = null; 8973 let ischecked; 8974 if (this.options.gfm) { 8975 istask = this.rules.other.listIsTask.exec(itemContents); 8976 if (istask) { 8977 ischecked = istask[0] !== "[ ] "; 8978 itemContents = itemContents.replace(this.rules.other.listReplaceTask, ""); 8979 } 8980 } 8981 list2.items.push({ 8982 type: "list_item", 8983 raw, 8984 task: !!istask, 8985 checked: ischecked, 8986 loose: false, 8987 text: itemContents, 8988 tokens: [] 8989 }); 8990 list2.raw += raw; 8991 } 8992 const lastItem = list2.items.at(-1); 8993 if (lastItem) { 8994 lastItem.raw = lastItem.raw.trimEnd(); 8995 lastItem.text = lastItem.text.trimEnd(); 8996 } else { 8997 return; 8998 } 8999 list2.raw = list2.raw.trimEnd(); 9000 for (let i = 0; i < list2.items.length; i++) { 9001 this.lexer.state.top = false; 9002 list2.items[i].tokens = this.lexer.blockTokens(list2.items[i].text, []); 9003 if (!list2.loose) { 9004 const spacers = list2.items[i].tokens.filter((t) => t.type === "space"); 9005 const hasMultipleLineBreaks = spacers.length > 0 && spacers.some((t) => this.rules.other.anyLine.test(t.raw)); 9006 list2.loose = hasMultipleLineBreaks; 9007 } 9008 } 9009 if (list2.loose) { 9010 for (let i = 0; i < list2.items.length; i++) { 9011 list2.items[i].loose = true; 9012 } 9013 } 9014 return list2; 9015 } 9016 } 9017 html(src) { 9018 const cap = this.rules.block.html.exec(src); 9019 if (cap) { 9020 const token = { 9021 type: "html", 9022 block: true, 9023 raw: cap[0], 9024 pre: cap[1] === "pre" || cap[1] === "script" || cap[1] === "style", 9025 text: cap[0] 9026 }; 9027 return token; 9028 } 9029 } 9030 def(src) { 9031 const cap = this.rules.block.def.exec(src); 9032 if (cap) { 9033 const tag2 = cap[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "); 9034 const href = cap[2] ? cap[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : ""; 9035 const title = cap[3] ? cap[3].substring(1, cap[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : cap[3]; 9036 return { 9037 type: "def", 9038 tag: tag2, 9039 raw: cap[0], 9040 href, 9041 title 9042 }; 9043 } 9044 } 9045 table(src) { 9046 var _a2; 9047 const cap = this.rules.block.table.exec(src); 9048 if (!cap) { 9049 return; 9050 } 9051 if (!this.rules.other.tableDelimiter.test(cap[2])) { 9052 return; 9053 } 9054 const headers = splitCells(cap[1]); 9055 const aligns = cap[2].replace(this.rules.other.tableAlignChars, "").split("|"); 9056 const rows = ((_a2 = cap[3]) == null ? void 0 : _a2.trim()) ? cap[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : []; 9057 const item = { 9058 type: "table", 9059 raw: cap[0], 9060 header: [], 9061 align: [], 9062 rows: [] 9063 }; 9064 if (headers.length !== aligns.length) { 9065 return; 9066 } 9067 for (const align of aligns) { 9068 if (this.rules.other.tableAlignRight.test(align)) { 9069 item.align.push("right"); 9070 } else if (this.rules.other.tableAlignCenter.test(align)) { 9071 item.align.push("center"); 9072 } else if (this.rules.other.tableAlignLeft.test(align)) { 9073 item.align.push("left"); 9074 } else { 9075 item.align.push(null); 9076 } 9077 } 9078 for (let i = 0; i < headers.length; i++) { 9079 item.header.push({ 9080 text: headers[i], 9081 tokens: this.lexer.inline(headers[i]), 9082 header: true, 9083 align: item.align[i] 9084 }); 9085 } 9086 for (const row of rows) { 9087 item.rows.push(splitCells(row, item.header.length).map((cell, i) => { 9088 return { 9089 text: cell, 9090 tokens: this.lexer.inline(cell), 9091 header: false, 9092 align: item.align[i] 9093 }; 9094 })); 9095 } 9096 return item; 9097 } 9098 lheading(src) { 9099 const cap = this.rules.block.lheading.exec(src); 9100 if (cap) { 9101 return { 9102 type: "heading", 9103 raw: cap[0], 9104 depth: cap[2].charAt(0) === "=" ? 1 : 2, 9105 text: cap[1], 9106 tokens: this.lexer.inline(cap[1]) 9107 }; 9108 } 9109 } 9110 paragraph(src) { 9111 const cap = this.rules.block.paragraph.exec(src); 9112 if (cap) { 9113 const text = cap[1].charAt(cap[1].length - 1) === "\n"
vendor: 3,800 bytes, lines 9113-9234
9113 ? cap[1].slice(0, -1) : cap[1]; 9114 return { 9115 type: "paragraph", 9116 raw: cap[0], 9117 text, 9118 tokens: this.lexer.inline(text) 9119 }; 9120 } 9121 } 9122 text(src) { 9123 const cap = this.rules.block.text.exec(src); 9124 if (cap) { 9125 return { 9126 type: "text", 9127 raw: cap[0], 9128 text: cap[0], 9129 tokens: this.lexer.inline(cap[0]) 9130 }; 9131 } 9132 } 9133 escape(src) { 9134 const cap = this.rules.inline.escape.exec(src); 9135 if (cap) { 9136 return { 9137 type: "escape", 9138 raw: cap[0], 9139 text: cap[1] 9140 }; 9141 } 9142 } 9143 tag(src) { 9144 const cap = this.rules.inline.tag.exec(src); 9145 if (cap) { 9146 if (!this.lexer.state.inLink && this.rules.other.startATag.test(cap[0])) { 9147 this.lexer.state.inLink = true; 9148 } else if (this.lexer.state.inLink && this.rules.other.endATag.test(cap[0])) { 9149 this.lexer.state.inLink = false; 9150 } 9151 if (!this.lexer.state.inRawBlock && this.rules.other.startPreScriptTag.test(cap[0])) { 9152 this.lexer.state.inRawBlock = true; 9153 } else if (this.lexer.state.inRawBlock && this.rules.other.endPreScriptTag.test(cap[0])) { 9154 this.lexer.state.inRawBlock = false; 9155 } 9156 return { 9157 type: "html", 9158 raw: cap[0], 9159 inLink: this.lexer.state.inLink, 9160 inRawBlock: this.lexer.state.inRawBlock, 9161 block: false, 9162 text: cap[0] 9163 }; 9164 } 9165 } 9166 link(src) { 9167 const cap = this.rules.inline.link.exec(src); 9168 if (cap) { 9169 const trimmedUrl = cap[2].trim(); 9170 if (!this.options.pedantic && this.rules.other.startAngleBracket.test(trimmedUrl)) { 9171 if (!this.rules.other.endAngleBracket.test(trimmedUrl)) { 9172 return; 9173 } 9174 const rtrimSlash = rtrim(trimmedUrl.slice(0, -1), "\\"); 9175 if ((trimmedUrl.length - rtrimSlash.length) % 2 === 0) { 9176 return; 9177 } 9178 } else { 9179 const lastParenIndex = findClosingBracket(cap[2], "()"); 9180 if (lastParenIndex === -2) { 9181 return; 9182 } 9183 if (lastParenIndex > -1) { 9184 const start = cap[0].indexOf("!") === 0 ? 5 : 4; 9185 const linkLen = start + cap[1].length + lastParenIndex; 9186 cap[2] = cap[2].substring(0, lastParenIndex); 9187 cap[0] = cap[0].substring(0, linkLen).trim(); 9188 cap[3] = ""; 9189 } 9190 } 9191 let href = cap[2]; 9192 let title = ""; 9193 if (this.options.pedantic) { 9194 const link2 = this.rules.other.pedanticHrefTitle.exec(href); 9195 if (link2) { 9196 href = link2[1]; 9197 title = link2[3]; 9198 } 9199 } else { 9200 title = cap[3] ? cap[3].slice(1, -1) : ""; 9201 } 9202 href = href.trim(); 9203 if (this.rules.other.startAngleBracket.test(href)) { 9204 if (this.options.pedantic && !this.rules.other.endAngleBracket.test(trimmedUrl)) { 9205 href = href.slice(1); 9206 } else { 9207 href = href.slice(1, -1); 9208 } 9209 } 9210 return outputLink(cap, { 9211 href: href ? href.replace(this.rules.inline.anyPunctuation, "$1") : href, 9212 title: title ? title.replace(this.rules.inline.anyPunctuation, "$1") : title 9213 }, cap[0], this.lexer, this.rules); 9214 } 9215 } 9216 reflink(src, links) { 9217 let cap; 9218 if ((cap = this.rules.inline.reflink.exec(src)) || (cap = this.rules.inline.nolink.exec(src))) { 9219 const linkString = (cap[2] || cap[1]).replace(this.rules.other.multipleSpaceGlobal, " "); 9220 const link2 = links[linkString.toLowerCase()]; 9221 if (!link2) { 9222 const text = cap[0].charAt(0); 9223 return { 9224 type: "text", 9225 raw: text, 9226 text 9227 }; 9228 } 9229 return outputLink(cap, link2, cap[0], this.lexer, this.rules); 9230 } 9231 } 9232 emStrong(src, maskedSrc, prevChar = "") { 9233 let match = this.rules.inline.emStrongLDelim.exec(src); 9234 if (!match)
vendor: 6,663 bytes, lines 9234-9478
9234 return; 9235 if (match[3] && prevChar.match(this.rules.other.unicodeAlphaNumeric)) return; 9236 const nextChar = match[1] || match[2] || ""; 9237 if (!nextChar || !prevChar || this.rules.inline.punctuation.exec(prevChar)) { 9238 const lLength = [...match[0]].length - 1; 9239 let rDelim, rLength, delimTotal = lLength, midDelimTotal = 0; 9240 const endReg = match[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd; 9241 endReg.lastIndex = 0; 9242 maskedSrc = maskedSrc.slice(-1 * src.length + lLength); 9243 while ((match = endReg.exec(maskedSrc)) != null) { 9244 rDelim = match[1] || match[2] || match[3] || match[4] || match[5] || match[6]; 9245 if (!rDelim) continue; 9246 rLength = [...rDelim].length; 9247 if (match[3] || match[4]) { 9248 delimTotal += rLength; 9249 continue; 9250 } else if (match[5] || match[6]) { 9251 if (lLength % 3 && !((lLength + rLength) % 3)) { 9252 midDelimTotal += rLength; 9253 continue; 9254 } 9255 } 9256 delimTotal -= rLength; 9257 if (delimTotal > 0) continue; 9258 rLength = Math.min(rLength, rLength + delimTotal + midDelimTotal); 9259 const lastCharLength = [...match[0]][0].length; 9260 const raw = src.slice(0, lLength + match.index + lastCharLength + rLength); 9261 if (Math.min(lLength, rLength) % 2) { 9262 const text2 = raw.slice(1, -1); 9263 return { 9264 type: "em", 9265 raw, 9266 text: text2, 9267 tokens: this.lexer.inlineTokens(text2) 9268 }; 9269 } 9270 const text = raw.slice(2, -2); 9271 return { 9272 type: "strong", 9273 raw, 9274 text, 9275 tokens: this.lexer.inlineTokens(text) 9276 }; 9277 } 9278 } 9279 } 9280 codespan(src) { 9281 const cap = this.rules.inline.code.exec(src); 9282 if (cap) { 9283 let text = cap[2].replace(this.rules.other.newLineCharGlobal, " "); 9284 const hasNonSpaceChars = this.rules.other.nonSpaceChar.test(text); 9285 const hasSpaceCharsOnBothEnds = this.rules.other.startingSpaceChar.test(text) && this.rules.other.endingSpaceChar.test(text); 9286 if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) { 9287 text = text.substring(1, text.length - 1); 9288 } 9289 return { 9290 type: "codespan", 9291 raw: cap[0], 9292 text 9293 }; 9294 } 9295 } 9296 br(src) { 9297 const cap = this.rules.inline.br.exec(src); 9298 if (cap) { 9299 return { 9300 type: "br", 9301 raw: cap[0] 9302 }; 9303 } 9304 } 9305 del(src) { 9306 const cap = this.rules.inline.del.exec(src); 9307 if (cap) { 9308 return { 9309 type: "del", 9310 raw: cap[0], 9311 text: cap[2], 9312 tokens: this.lexer.inlineTokens(cap[2]) 9313 }; 9314 } 9315 } 9316 autolink(src) { 9317 const cap = this.rules.inline.autolink.exec(src); 9318 if (cap) { 9319 let text, href; 9320 if (cap[2] === "@") { 9321 text = cap[1]; 9322 href = "mailto:" + text; 9323 } else { 9324 text = cap[1]; 9325 href = text; 9326 } 9327 return { 9328 type: "link", 9329 raw: cap[0], 9330 text, 9331 href, 9332 tokens: [ 9333 { 9334 type: "text", 9335 raw: text, 9336 text 9337 } 9338 ] 9339 }; 9340 } 9341 } 9342 url(src) { 9343 var _a2; 9344 let cap; 9345 if (cap = this.rules.inline.url.exec(src)) { 9346 let text, href; 9347 if (cap[2] === "@") { 9348 text = cap[0]; 9349 href = "mailto:" + text; 9350 } else { 9351 let prevCapZero; 9352 do { 9353 prevCapZero = cap[0]; 9354 cap[0] = ((_a2 = this.rules.inline._backpedal.exec(cap[0])) == null ? void 0 : _a2[0]) ?? ""; 9355 } while (prevCapZero !== cap[0]); 9356 text = cap[0]; 9357 if (cap[1] === "www.") { 9358 href = "http://" + cap[0]; 9359 } else { 9360 href = cap[0]; 9361 } 9362 } 9363 return { 9364 type: "link", 9365 raw: cap[0], 9366 text, 9367 href, 9368 tokens: [ 9369 { 9370 type: "text", 9371 raw: text, 9372 text 9373 } 9374 ] 9375 }; 9376 } 9377 } 9378 inlineText(src) { 9379 const cap = this.rules.inline.text.exec(src); 9380 if (cap) { 9381 const escaped = this.lexer.state.inRawBlock; 9382 return { 9383 type: "text", 9384 raw: cap[0], 9385 text: cap[0], 9386 escaped 9387 }; 9388 } 9389 } 9390}; 9391var _Lexer = class __Lexer { 9392 constructor(options2) { 9393 __publicField(this, "tokens"); 9394 __publicField(this, "options"); 9395 __publicField(this, "state"); 9396 __publicField(this, "tokenizer"); 9397 __publicField(this, "inlineQueue"); 9398 this.tokens = []; 9399 this.tokens.links = /* @__PURE__ */ Object.create(null); 9400 this.options = options2 || _defaults; 9401 this.options.tokenizer = this.options.tokenizer || new _Tokenizer(); 9402 this.tokenizer = this.options.tokenizer; 9403 this.tokenizer.options = this.options; 9404 this.tokenizer.lexer = this; 9405 this.inlineQueue = []; 9406 this.state = { 9407 inLink: false, 9408 inRawBlock: false, 9409 top: true 9410 }; 9411 const rules = { 9412 other, 9413 block: block.normal, 9414 inline: inline.normal 9415 }; 9416 if (this.options.pedantic) { 9417 rules.block = block.pedantic; 9418 rules.inline = inline.pedantic; 9419 } else if (this.options.gfm) { 9420 rules.block = block.gfm; 9421 if (this.options.breaks) { 9422 rules.inline = inline.breaks; 9423 } else { 9424 rules.inline = inline.gfm; 9425 } 9426 } 9427 this.tokenizer.rules = rules; 9428 } 9429 /** 9430 * Expose Rules 9431 */ 9432 static get rules() { 9433 return { 9434 block, 9435 inline 9436 }; 9437 } 9438 /** 9439 * Static Lex Method 9440 */ 9441 static lex(src, options2) { 9442 const lexer2 = new __Lexer(options2); 9443 return lexer2.lex(src); 9444 } 9445 /** 9446 * Static Lex Inline Method 9447 */ 9448 static lexInline(src, options2) { 9449 const lexer2 = new __Lexer(options2); 9450 return lexer2.inlineTokens(src); 9451 } 9452 /** 9453 * Preprocessing 9454 */ 9455 lex(src) { 9456 src = src.replace(other.carriageReturn, "\n"); 9457 this.blockTokens(src, this.tokens); 9458 for (let i = 0; i < this.inlineQueue.length; i++) { 9459 const next = this.inlineQueue[i]; 9460 this.inlineTokens(next.src, next.tokens); 9461 } 9462 this.inlineQueue = []; 9463 return this.tokens; 9464 } 9465 blockTokens(src, tokens = [], lastParagraphClipped = false) { 9466 var _a2, _b, _c; 9467 if (this.options.pedantic) { 9468 src = src.replace(other.tabCharGlobal, " ").replace(other.spaceLine, ""); 9469 } 9470 while (src) { 9471 let token; 9472 if ((_b = (_a2 = this.options.extensions) == null ? void 0 : _a2.block) == null ? void 0 : _b.some((extTokenizer) => { 9473 if (token = extTokenizer.call({ lexer: this }, src, tokens)) { 9474 src = src.substring(token.raw.length); 9475 tokens.push(token); 9476 return true; 9477 } 9478 return false;
9479 })) { 9480 continue; 9481 } 9482 if (token = this.tokenizer.space(src)) { 9483 src = src.substring(token.raw.length); 9484 const lastToken = tokens.at(-1); 9485 if (token.raw.length === 1 && lastToken !== void 0) { 9486 lastToken.raw += "\n"; 9487 } else { 9488 tokens.push(token); 9489 } 9490 continue; 9491 } 9492 if (token = this.tokenizer.code(src)) { 9493 src = src.substring(token.raw.length); 9494 const lastToken = tokens.at(-1); 9495 if ((lastToken == null ? void 0 : lastToken.type) === "paragraph" || (lastToken == null ? void 0 : lastToken.type) === "text") { 9496 lastToken.raw += "\n" + token.raw; 9497 lastToken.text += "\n" + token.text; 9498 this.inlineQueue.at(-1).src = lastToken.text; 9499 } else { 9500 tokens.push(token); 9501 } 9502 continue; 9503 } 9504 if (token = this.tokenizer.fences(src)) { 9505 src = src.substring(token.raw.length); 9506 tokens.push(token); 9507 continue; 9508 } 9509 if (token = this.tokenizer.heading(src)) { 9510 src = src.substring(token.raw.length); 9511 tokens.push(token); 9512 continue; 9513 } 9514 if (token = this.tokenizer.hr(src)) { 9515 src = src.substring(token.raw.length); 9516 tokens.push(token); 9517 continue; 9518 } 9519 if (token = this.tokenizer.blockquote(src)) { 9520 src = src.substring(token.raw.length); 9521 tokens.push(token); 9522 continue; 9523 } 9524 if (token = this.tokenizer.list(src)) { 9525 src = src.substring(token.raw.length); 9526 tokens.push(token); 9527 continue; 9528 } 9529 if (token = this.tokenizer.html(src)) { 9530 src = src.substring(token.raw.length); 9531 tokens.push(token); 9532 continue; 9533 } 9534 if (token = this.tokenizer.def(src)) { 9535 src = src.substring(token.raw.length); 9536 const lastToken = tokens.at(-1); 9537 if ((lastToken == null ? void 0 : lastToken.type) === "paragraph" || (lastToken == null ? void 0 : lastToken.type) === "text") { 9538 lastToken.raw += "\n" + token.raw; 9539 lastToken.text += "\n" + token.raw; 9540 this.inlineQueue.at(-1).src = lastToken.text; 9541 } else if (!this.tokens.links[token.tag]) { 9542 this.tokens.links[token.tag] = { 9543 href: token.href, 9544 title: token.title 9545 }; 9546 } 9547 continue; 9548 } 9549 if (token = this.tokenizer.table(src)) { 9550 src = src.substring(token.raw.length); 9551 tokens.push(token); 9552 continue; 9553 } 9554 if (token = this.tokenizer.lheading(src)) { 9555 src = src.substring(token.raw.length); 9556 tokens.push(token); 9557 continue; 9558 } 9559 let cutSrc = src; 9560 if ((_c = this.options.extensions) == null ? void 0 : _c.startBlock) { 9561 let startIndex = Infinity; 9562 const tempSrc = src.slice(1); 9563 let tempStart; 9564 this.options.extensions.startBlock.forEach((getStartIndex) => { 9565 tempStart = getStartIndex.call({ lexer: this }, tempSrc); 9566 if (typeof tempStart === "number" && tempStart >= 0) { 9567 startIndex = Math.min(startIndex, tempStart); 9568 } 9569 }); 9570 if (startIndex < Infinity && startIndex >= 0) { 9571 cutSrc = src.substring(0, startIndex + 1); 9572 } 9573 } 9574 if (this.state.top && (token = this.tokenizer.paragraph(cutSrc))) { 9575 const lastToken = tokens.at(-1); 9576 if (lastParagraphClipped && (lastToken == null ? void 0 : lastToken.type) === "paragraph") { 9577 lastToken.raw += "\n" + token.raw; 9578 lastToken.text += "\n" + token.text; 9579 this.inlineQueue.pop(); 9580 this.inlineQueue.at(-1).src = lastToken.text; 9581 } else { 9582 tokens.push(token); 9583 } 9584 lastParagraphClipped = cutSrc.length !== src.length; 9585 src = src.substring(token.raw.length); 9586 continue; 9587 } 9588 if (token = this.tokenizer.text(src)) { 9589 src = src.substring(token.raw.length); 9590 const lastToken = tokens.at(-1); 9591 if ((lastToken == null ? void 0 : lastToken.type) === "text") { 9592 lastToken.raw += "\n" + token.raw; 9593 lastToken.text += "\n" + token.text; 9594 this.inlineQueue.pop(); 9595 this.inlineQueue.at(-1).src = lastToken.text; 9596 } else { 9597 tokens.push(token); 9598 } 9599 continue; 9600 } 9601 if (src) {
vendor: 4,959 bytes, lines 9602-9745
9602 const errMsg = "Infinite loop on byte: " + src.charCodeAt(0); 9603 if (this.options.silent) { 9604 console.error(errMsg); 9605 break; 9606 } else { 9607 throw new Error(errMsg); 9608 } 9609 } 9610 } 9611 this.state.top = true; 9612 return tokens; 9613 } 9614 inline(src, tokens = []) { 9615 this.inlineQueue.push({ src, tokens }); 9616 return tokens; 9617 } 9618 /** 9619 * Lexing/Compiling 9620 */ 9621 inlineTokens(src, tokens = []) { 9622 var _a2, _b, _c; 9623 let maskedSrc = src; 9624 let match = null; 9625 if (this.tokens.links) { 9626 const links = Object.keys(this.tokens.links); 9627 if (links.length > 0) { 9628 while ((match = this.tokenizer.rules.inline.reflinkSearch.exec(maskedSrc)) != null) { 9629 if (links.includes(match[0].slice(match[0].lastIndexOf("[") + 1, -1))) { 9630 maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex); 9631 } 9632 } 9633 } 9634 } 9635 while ((match = this.tokenizer.rules.inline.anyPunctuation.exec(maskedSrc)) != null) { 9636 maskedSrc = maskedSrc.slice(0, match.index) + "++" + maskedSrc.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex); 9637 } 9638 while ((match = this.tokenizer.rules.inline.blockSkip.exec(maskedSrc)) != null) { 9639 maskedSrc = maskedSrc.slice(0, match.index) + "[" + "a".repeat(match[0].length - 2) + "]" + maskedSrc.slice(this.tokenizer.rules.inline.blockSkip.lastIndex); 9640 } 9641 let keepPrevChar = false; 9642 let prevChar = ""; 9643 while (src) { 9644 if (!keepPrevChar) { 9645 prevChar = ""; 9646 } 9647 keepPrevChar = false; 9648 let token; 9649 if ((_b = (_a2 = this.options.extensions) == null ? void 0 : _a2.inline) == null ? void 0 : _b.some((extTokenizer) => { 9650 if (token = extTokenizer.call({ lexer: this }, src, tokens)) { 9651 src = src.substring(token.raw.length); 9652 tokens.push(token); 9653 return true; 9654 } 9655 return false; 9656 })) { 9657 continue; 9658 } 9659 if (token = this.tokenizer.escape(src)) { 9660 src = src.substring(token.raw.length); 9661 tokens.push(token); 9662 continue; 9663 } 9664 if (token = this.tokenizer.tag(src)) { 9665 src = src.substring(token.raw.length); 9666 tokens.push(token); 9667 continue; 9668 } 9669 if (token = this.tokenizer.link(src)) { 9670 src = src.substring(token.raw.length); 9671 tokens.push(token); 9672 continue; 9673 } 9674 if (token = this.tokenizer.reflink(src, this.tokens.links)) { 9675 src = src.substring(token.raw.length); 9676 const lastToken = tokens.at(-1); 9677 if (token.type === "text" && (lastToken == null ? void 0 : lastToken.type) === "text") { 9678 lastToken.raw += token.raw; 9679 lastToken.text += token.text; 9680 } else { 9681 tokens.push(token); 9682 } 9683 continue; 9684 } 9685 if (token = this.tokenizer.emStrong(src, maskedSrc, prevChar)) { 9686 src = src.substring(token.raw.length); 9687 tokens.push(token); 9688 continue; 9689 } 9690 if (token = this.tokenizer.codespan(src)) { 9691 src = src.substring(token.raw.length); 9692 tokens.push(token); 9693 continue; 9694 } 9695 if (token = this.tokenizer.br(src)) { 9696 src = src.substring(token.raw.length); 9697 tokens.push(token); 9698 continue; 9699 } 9700 if (token = this.tokenizer.del(src)) { 9701 src = src.substring(token.raw.length); 9702 tokens.push(token); 9703 continue; 9704 } 9705 if (token = this.tokenizer.autolink(src)) { 9706 src = src.substring(token.raw.length); 9707 tokens.push(token); 9708 continue; 9709 } 9710 if (!this.state.inLink && (token = this.tokenizer.url(src))) { 9711 src = src.substring(token.raw.length); 9712 tokens.push(token); 9713 continue; 9714 } 9715 let cutSrc = src; 9716 if ((_c = this.options.extensions) == null ? void 0 : _c.startInline) { 9717 let startIndex = Infinity; 9718 const tempSrc = src.slice(1); 9719 let tempStart; 9720 this.options.extensions.startInline.forEach((getStartIndex) => { 9721 tempStart = getStartIndex.call({ lexer: this }, tempSrc); 9722 if (typeof tempStart === "number" && tempStart >= 0) { 9723 startIndex = Math.min(startIndex, tempStart); 9724 } 9725 }); 9726 if (startIndex < Infinity && startIndex >= 0) { 9727 cutSrc = src.substring(0, startIndex + 1); 9728 } 9729 } 9730 if (token = this.tokenizer.inlineText(cutSrc)) { 9731 src = src.substring(token.raw.length); 9732 if (token.raw.slice(-1) !== "_") { 9733 prevChar = token.raw.slice(-1); 9734 } 9735 keepPrevChar = true; 9736 const lastToken = tokens.at(-1); 9737 if ((lastToken == null ? void 0 : lastToken.type) === "text") { 9738 lastToken.raw += token.raw; 9739 lastToken.text += token.text; 9740 } else { 9741 tokens.push(token); 9742 } 9743 continue; 9744 } 9745 if (src) {
vendor: 4,498 bytes, lines 9746-9900
9746 const errMsg = "Infinite loop on byte: " + src.charCodeAt(0); 9747 if (this.options.silent) { 9748 console.error(errMsg); 9749 break; 9750 } else { 9751 throw new Error(errMsg); 9752 } 9753 } 9754 } 9755 return tokens; 9756 } 9757}; 9758var _Renderer = class { 9759 // set by the parser 9760 constructor(options2) { 9761 __publicField(this, "options"); 9762 __publicField(this, "parser"); 9763 this.options = options2 || _defaults; 9764 } 9765 space(token) { 9766 return ""; 9767 } 9768 code({ text, lang, escaped }) { 9769 var _a2; 9770 const langString = (_a2 = (lang || "").match(other.notSpaceStart)) == null ? void 0 : _a2[0]; 9771 const code2 = text.replace(other.endingNewline, "") + "\n"; 9772 if (!langString) { 9773 return "<pre><code>" + (escaped ? code2 : escape2(code2, true)) + "</code></pre>\n"; 9774 } 9775 return '<pre><code class="language-' + escape2(langString) + '">' + (escaped ? code2 : escape2(code2, true)) + "</code></pre>\n"; 9776 } 9777 blockquote({ tokens }) { 9778 const body = this.parser.parse(tokens); 9779 return `<blockquote> 9780${body}</blockquote> 9781`; 9782 } 9783 html({ text }) { 9784 return text; 9785 } 9786 heading({ tokens, depth }) { 9787 return `<h${depth}>${this.parser.parseInline(tokens)}</h${depth}> 9788`; 9789 } 9790 hr(token) { 9791 return "<hr>\n"; 9792 } 9793 list(token) { 9794 const ordered = token.ordered; 9795 const start = token.start; 9796 let body = ""; 9797 for (let j = 0; j < token.items.length; j++) { 9798 const item = token.items[j]; 9799 body += this.listitem(item); 9800 } 9801 const type = ordered ? "ol" : "ul"; 9802 const startAttr = ordered && start !== 1 ? ' start="' + start + '"' : ""; 9803 return "<" + type + startAttr + ">\n" + body + "</" + type + ">\n"; 9804 } 9805 listitem(item) { 9806 var _a2; 9807 let itemBody = ""; 9808 if (item.task) { 9809 const checkbox = this.checkbox({ checked: !!item.checked }); 9810 if (item.loose) { 9811 if (((_a2 = item.tokens[0]) == null ? void 0 : _a2.type) === "paragraph") { 9812 item.tokens[0].text = checkbox + " " + item.tokens[0].text; 9813 if (item.tokens[0].tokens && item.tokens[0].tokens.length > 0 && item.tokens[0].tokens[0].type === "text") { 9814 item.tokens[0].tokens[0].text = checkbox + " " + escape2(item.tokens[0].tokens[0].text); 9815 item.tokens[0].tokens[0].escaped = true; 9816 } 9817 } else { 9818 item.tokens.unshift({ 9819 type: "text", 9820 raw: checkbox + " ", 9821 text: checkbox + " ", 9822 escaped: true 9823 }); 9824 } 9825 } else { 9826 itemBody += checkbox + " "; 9827 } 9828 } 9829 itemBody += this.parser.parse(item.tokens, !!item.loose); 9830 return `<li>${itemBody}</li> 9831`; 9832 } 9833 checkbox({ checked }) { 9834 return "<input " + (checked ? 'checked="" ' : "") + 'disabled="" type="checkbox">'; 9835 } 9836 paragraph({ tokens }) { 9837 return `<p>${this.parser.parseInline(tokens)}</p> 9838`; 9839 } 9840 table(token) { 9841 let header = ""; 9842 let cell = ""; 9843 for (let j = 0; j < token.header.length; j++) { 9844 cell += this.tablecell(token.header[j]); 9845 } 9846 header += this.tablerow({ text: cell }); 9847 let body = ""; 9848 for (let j = 0; j < token.rows.length; j++) { 9849 const row = token.rows[j]; 9850 cell = ""; 9851 for (let k = 0; k < row.length; k++) { 9852 cell += this.tablecell(row[k]); 9853 } 9854 body += this.tablerow({ text: cell }); 9855 } 9856 if (body) body = `<tbody>${body}</tbody>`; 9857 return "<table>\n<thead>\n" + header + "</thead>\n" + body + "</table>\n"; 9858 } 9859 tablerow({ text }) { 9860 return `<tr> 9861${text}</tr> 9862`; 9863 } 9864 tablecell(token) { 9865 const content = this.parser.parseInline(token.tokens); 9866 const type = token.header ? "th" : "td"; 9867 const tag2 = token.align ? `<${type} align="${token.align}">` : `<${type}>`; 9868 return tag2 + content + `</${type}> 9869`; 9870 } 9871 /** 9872 * span level renderer 9873 */ 9874 strong({ tokens }) { 9875 return `<strong>${this.parser.parseInline(tokens)}</strong>`; 9876 } 9877 em({ tokens }) { 9878 return `<em>${this.parser.parseInline(tokens)}</em>`; 9879 } 9880 codespan({ text }) { 9881 return `<code>${escape2(text, true)}</code>`; 9882 } 9883 br(token) { 9884 return "<br>"; 9885 } 9886 del({ tokens }) { 9887 return `<del>${this.parser.parseInline(tokens)}</del>`; 9888 } 9889 link({ href, title, tokens }) { 9890 const text = this.parser.parseInline(tokens); 9891 const cleanHref = cleanUrl(href); 9892 if (cleanHref === null) { 9893 return text; 9894 } 9895 href = cleanHref; 9896 let out = '<a href="' + href + '"'; 9897 if (title) { 9898 out += ' title="' + escape2(title) + '"'; 9899 } 9900 out += ">
9900" + text + "</a>"; 9901 return out; 9902 } 9903 image({ href, title, text, tokens }) { 9904 if (tokens) { 9905 text = this.parser.parseInline(tokens, this.parser.textRenderer); 9906 } 9907 const cleanHref = cleanUrl(href); 9908 if (cleanHref === null) { 9909 return escape2(text); 9910 } 9911 href = cleanHref; 9912 let out = `<img src="${href}" alt="${text}"`; 9913 if (title) { 9914 out += ` title="${escape2(title)}"`; 9915 } 9916 out += ">"; 9917 return out; 9918 } 9919 text(token) { 9920 return "tokens" in token && token.tokens ? this.parser.parseInline(token.tokens) : "escaped" in token && token.escaped ? token.text : escape2(token.text); 9921 } 9922}; 9923var _TextRenderer = class { 9924 // no need for block level renderers 9925 strong({ text }) { 9926 return text; 9927 } 9928 em({ text }) { 9929 return text; 9930 } 9931 codespan({ text }) { 9932 return text; 9933 } 9934 del({ text }) { 9935 return text; 9936 } 9937 html({ text }) { 9938 return text; 9939 } 9940 text({ text }) { 9941 return text; 9942 } 9943 link({ text }) { 9944 return "" + text; 9945 } 9946 image({ text }) { 9947 return "" + text; 9948 } 9949 br() { 9950 return ""; 9951 } 9952}; 9953var _Parser = class __Parser { 9954 constructor(options2) { 9955 __publicField(this, "options"); 9956 __publicField(this, "renderer"); 9957 __publicField(this, "textRenderer"); 9958 this.options = options2 || _defaults; 9959 this.options.renderer = this.options.renderer || new _Renderer(); 9960 this.renderer = this.options.renderer; 9961 this.renderer.options = this.options; 9962 this.renderer.parser = this; 9963 this.textRenderer = new _TextRenderer(); 9964 } 9965 /** 9966 * Static Parse Method 9967 */ 9968 static parse(tokens, options2) { 9969 const parser2 = new __Parser(options2); 9970 return parser2.parse(tokens); 9971 } 9972 /** 9973 * Static Parse Inline Method 9974 */ 9975 static parseInline(tokens, options2) { 9976 const parser2 = new __Parser(options2); 9977 return parser2.parseInline(tokens); 9978 } 9979 /** 9980 * Parse Loop 9981 */ 9982 parse(tokens, top = true) { 9983 var _a2, _b; 9984 let out = ""; 9985 for (let i = 0; i < tokens.length; i++) { 9986 const anyToken = tokens[i]; 9987 if ((_b = (_a2 = this.options.extensions) == null ? void 0 : _a2.renderers) == null ? void 0 : _b[anyToken.type]) { 9988 const genericToken = anyToken; 9989 const ret = this.options.extensions.renderers[genericToken.type].call({ parser: this }, genericToken); 9990 if (ret !== false || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(genericToken.type)) { 9991 out += ret || ""; 9992 continue; 9993 } 9994 } 9995 const token = anyToken; 9996 switch (token.type) { 9997 case "space": { 9998 out += this.renderer.space(token); 9999 continue; 10000 } 10001 case "hr": { 10002 out += this.renderer.hr(token); 10003 continue; 10004 } 10005 case "heading": { 10006 out += this.renderer.heading(token); 10007 continue; 10008 } 10009 case "code": { 10010 out += this.renderer.code(token); 10011 continue; 10012 } 10013 case "table": { 10014 out += this.renderer.table(token); 10015 continue; 10016 } 10017 case "blockquote": { 10018 out += this.renderer.blockquote(token); 10019 continue; 10020 } 10021 case "list": { 10022 out += this.renderer.list(token); 10023 continue; 10024 } 10025 case "html": { 10026 out += this.renderer.html(token); 10027 continue; 10028 } 10029 case "paragraph": { 10030 out += this.renderer.paragraph(token); 10031 continue; 10032 } 10033 case "text": { 10034 let textToken = token; 10035 let body = this.renderer.text(textToken); 10036 while (i + 1 < tokens.length && tokens[i + 1].type === "text") { 10037 textToken = tokens[++i]; 10038 body += "\n" + this.renderer.text(textToken); 10039 } 10040 if (top) { 10041 out += this.renderer.paragraph({ 10042 type: "paragraph", 10043 raw: body, 10044 text: body, 10045 tokens: [{ type: "text", raw: body, text: body, escaped: true }] 10046 }); 10047 } else { 10048 out += body; 10049 } 10050 continue; 10051 } 10052 default: { 10053 const errMsg = 'Token with "' + token.type + '" type was not found.'; 10054 if (this.options.silent) { 10055 console.error(errMsg); 10056 return ""; 10057 } else { 10058 throw new Error(errMsg); 10059 } 10060 } 10061 } 10062 } 10063 return out; 10064 } 10065 /** 10066 * Parse Inline Tokens 10067 */ 10068 parseInline(tokens, renderer2 = this.renderer) { 10069 var _a2, _b; 10070 let out = ""; 10071 for (let i = 0; i < tokens.length; i++) { 10072 const anyToken = tokens[i]; 10073 if ((_b = (_a2 = this.options.extensions) == null ? void 0 : _a2.renderers) == null ? void 0 : _b[anyToken.type]) { 10074 const ret = this.options.extensions.renderers[anyToken.type].call({ parser: this }, anyToken); 10075 if (ret !== false || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(anyToken.type)) { 10076 out += ret || ""; 10077 continue; 10078 } 10079 } 10080 const token = anyToken; 10081 switch (token.type) { 10082 case "escape": { 10083 out += renderer2.text(token); 10084 break; 10085 } 10086 case "html": { 10087 out += renderer2.html(token); 10088 break; 10089 } 10090 case "link": { 10091 out += renderer2.link(token); 10092 break; 10093 } 10094 case "image": { 10095 out += renderer2.image(token); 10096 break; 10097 } 10098 case "strong": { 10099 out += renderer2.strong(token); 10100 break; 10101 } 10102 case "em": { 10103 out += renderer2.em(token); 10104 break; 10105 } 10106 case "codespan": { 10107 out += renderer2.codespan(token); 10108 break; 10109 } 10110 case "br": { 10111 out += renderer2.br(token); 10112 break; 10113 } 10114 case "del": { 10115 out += renderer2.del(token); 10116 break; 10117 } 10118 case "text": { 10119 out += renderer2.text(token); 10120 break; 10121 } 10122 default: { 10123 const errMsg = 'Token with "' + token.type + '" type was not found.'; 10124 if (this.options.silent) { 10125 console.error(errMsg); 10126 return ""; 10127 } else { 10128 throw new Error(errMsg); 10129 } 10130 } 10131 } 10132 } 10133 return out; 10134 } 10135}; 10136var _Hooks = (_a = class { 10137 constructor(options2) { 10138 __publicField(this, "options"); 10139 __publicField(this, "block"); 10140 this.options = options2 || _defaults; 10141 } 10142 /** 10143 * Process markdown before marked 10144 */ 10145 preprocess(markdown) { 10146 return markdown; 10147 } 10148 /** 10149 * Process HTML after marked is finished 10150 */ 10151 postprocess(html2) { 10152 return html2; 10153 } 10154 /** 10155 * Process all tokens before walk tokens 10156 */ 10157 processAllTokens(tokens) { 10158 return tokens; 10159 } 10160 /** 10161 * Provide function to tokenize markdown 10162 */ 10163 provideLexer() { 10164 return this.block ? _Lexer.lex : _Lexer.lexInline; 10165 } 10166 /** 10167 * Provide function to parse tokens 10168 */ 10169 provideParser() { 10170 return this.block ? _Parser.parse : _Parser.parseInline; 10171 } 10172}
10172, __publicField(_a, "passThroughHooks", /* @__PURE__ */ new Set([ 10173 "preprocess", 10174 "postprocess", 10175 "processAllTokens" 10176])), _a); 10177var Marked = class { 10178 constructor(...args) { 10179 __publicField(this, "defaults", _getDefaults()); 10180 __publicField(this, "options", this.setOptions); 10181 __publicField(this, "parse", this.parseMarkdown(true)); 10182 __publicField(this, "parseInline", this.parseMarkdown(false)); 10183 __publicField(this, "Parser", _Parser); 10184 __publicField(this, "Renderer", _Renderer); 10185 __publicField(this, "TextRenderer", _TextRenderer); 10186 __publicField(this, "Lexer", _Lexer); 10187 __publicField(this, "Tokenizer", _Tokenizer); 10188 __publicField(this, "Hooks", _Hooks); 10189 this.use(...args); 10190 } 10191 /** 10192 * Run callback for every token 10193 */ 10194 walkTokens(tokens, callback) { 10195 var _a2, _b; 10196 let values = []; 10197 for (const token of tokens) { 10198 values = values.concat(callback.call(this, token)); 10199 switch (token.type) { 10200 case "table": { 10201 const tableToken = token; 10202 for (const cell of tableToken.header) { 10203 values = values.concat(this.walkTokens(cell.tokens, callback)); 10204 } 10205 for (const row of tableToken.rows) { 10206 for (const cell of row) { 10207 values = values.concat(this.walkTokens(cell.tokens, callback)); 10208 } 10209 } 10210 break; 10211 } 10212 case "list": { 10213 const listToken = token; 10214 values = values.concat(this.walkTokens(listToken.items, callback)); 10215 break; 10216 } 10217 default: { 10218 const genericToken = token; 10219 if ((_b = (_a2 = this.defaults.extensions) == null ? void 0 : _a2.childTokens) == null ? void 0 : _b[genericToken.type]) { 10220 this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => { 10221 const tokens2 = genericToken[childTokens].flat(Infinity); 10222 values = values.concat(this.walkTokens(tokens2, callback)); 10223 }); 10224 } else if (genericToken.tokens) { 10225 values = values.concat(this.walkTokens(genericToken.tokens, callback)); 10226 } 10227 } 10228 } 10229 } 10230 return values; 10231 } 10232 use(...args) { 10233 const extensions = this.defaults.extensions || { renderers: {}, childTokens: {} }; 10234 args.forEach((pack) => { 10235 const opts = { ...pack }; 10236 opts.async = this.defaults.async || opts.async || false; 10237 if (pack.extensions) { 10238 pack.extensions.forEach((ext) => { 10239 if (!ext.name) { 10240 throw new Error("extension name required"); 10241 } 10242 if ("renderer" in ext) { 10243 const prevRenderer = extensions.renderers[ext.name]; 10244 if (prevRenderer) { 10245 extensions.renderers[ext.name] = function(...args2) { 10246 let ret = ext.renderer.apply(this, args2); 10247 if (ret === false) { 10248 ret = prevRenderer.apply(this, args2); 10249 } 10250 return ret; 10251 }; 10252 } else { 10253 extensions.renderers[ext.name] = ext.renderer; 10254 } 10255 } 10256 if ("tokenizer" in ext) { 10257 if (!ext.level || ext.level !== "block" && ext.level !== "inline") { 10258 throw new Error("extension level must be 'block' or 'inline'"); 10259 } 10260 const extLevel = extensions[ext.level]; 10261 if (extLevel) { 10262 extLevel.unshift(ext.tokenizer); 10263 } else { 10264 extensions[ext.level] = [ext.tokenizer]; 10265 } 10266 if (ext.start) { 10267 if (ext.level === "block") { 10268 if (extensions.startBlock) { 10269 extensions.startBlock.push(ext.start); 10270 } else { 10271 extensions.startBlock = [ext.start]; 10272 } 10273 } else if (ext.level === "inline") { 10274 if (extensions.startInline) { 10275 extensions.startInline.push(ext.start); 10276 } else { 10277 extensions.startInline = [ext.start]; 10278 } 10279 } 10280 } 10281 } 10282 if ("childTokens" in ext && ext.childTokens) { 10283 extensions.childTokens[ext.name] = ext.childTokens; 10284 } 10285 }); 10286 opts.extensions = extensions; 10287 } 10288 if (pack.renderer) { 10289 const renderer2 = this.defaults.renderer || new _Renderer(this.defaults); 10290 for (const prop in pack.renderer) { 10291 if (!(prop in renderer2)) { 10292 throw new Error(`renderer '${prop}' does not exist`); 10293 } 10294 if (["options", "parser"].includes(prop)) { 10295 continue; 10296 } 10297 const rendererProp = prop;
vendor: 4,808 bytes, lines 10298-10414
10298 const rendererFunc = pack.renderer[rendererProp]; 10299 const prevRenderer = renderer2[rendererProp]; 10300 renderer2[rendererProp] = (...args2) => { 10301 let ret = rendererFunc.apply(renderer2, args2); 10302 if (ret === false) { 10303 ret = prevRenderer.apply(renderer2, args2); 10304 } 10305 return ret || ""; 10306 }; 10307 } 10308 opts.renderer = renderer2; 10309 } 10310 if (pack.tokenizer) { 10311 const tokenizer = this.defaults.tokenizer || new _Tokenizer(this.defaults); 10312 for (const prop in pack.tokenizer) { 10313 if (!(prop in tokenizer)) { 10314 throw new Error(`tokenizer '${prop}' does not exist`); 10315 } 10316 if (["options", "rules", "lexer"].includes(prop)) { 10317 continue; 10318 } 10319 const tokenizerProp = prop; 10320 const tokenizerFunc = pack.tokenizer[tokenizerProp]; 10321 const prevTokenizer = tokenizer[tokenizerProp]; 10322 tokenizer[tokenizerProp] = (...args2) => { 10323 let ret = tokenizerFunc.apply(tokenizer, args2); 10324 if (ret === false) { 10325 ret = prevTokenizer.apply(tokenizer, args2); 10326 } 10327 return ret; 10328 }; 10329 } 10330 opts.tokenizer = tokenizer; 10331 } 10332 if (pack.hooks) { 10333 const hooks = this.defaults.hooks || new _Hooks(); 10334 for (const prop in pack.hooks) { 10335 if (!(prop in hooks)) { 10336 throw new Error(`hook '${prop}' does not exist`); 10337 } 10338 if (["options", "block"].includes(prop)) { 10339 continue; 10340 } 10341 const hooksProp = prop; 10342 const hooksFunc = pack.hooks[hooksProp]; 10343 const prevHook = hooks[hooksProp]; 10344 if (_Hooks.passThroughHooks.has(prop)) { 10345 hooks[hooksProp] = (arg) => { 10346 if (this.defaults.async) { 10347 return Promise.resolve(hooksFunc.call(hooks, arg)).then((ret2) => { 10348 return prevHook.call(hooks, ret2); 10349 }); 10350 } 10351 const ret = hooksFunc.call(hooks, arg); 10352 return prevHook.call(hooks, ret); 10353 }; 10354 } else { 10355 hooks[hooksProp] = (...args2) => { 10356 let ret = hooksFunc.apply(hooks, args2); 10357 if (ret === false) { 10358 ret = prevHook.apply(hooks, args2); 10359 } 10360 return ret; 10361 }; 10362 } 10363 } 10364 opts.hooks = hooks; 10365 } 10366 if (pack.walkTokens) { 10367 const walkTokens2 = this.defaults.walkTokens; 10368 const packWalktokens = pack.walkTokens; 10369 opts.walkTokens = function(token) { 10370 let values = []; 10371 values.push(packWalktokens.call(this, token)); 10372 if (walkTokens2) { 10373 values = values.concat(walkTokens2.call(this, token)); 10374 } 10375 return values; 10376 }; 10377 } 10378 this.defaults = { ...this.defaults, ...opts }; 10379 }); 10380 return this; 10381 } 10382 setOptions(opt) { 10383 this.defaults = { ...this.defaults, ...opt }; 10384 return this; 10385 } 10386 lexer(src, options2) { 10387 return _Lexer.lex(src, options2 ?? this.defaults); 10388 } 10389 parser(tokens, options2) { 10390 return _Parser.parse(tokens, options2 ?? this.defaults); 10391 } 10392 parseMarkdown(blockType) { 10393 const parse2 = (src, options2) => { 10394 const origOpt = { ...options2 }; 10395 const opt = { ...this.defaults, ...origOpt }; 10396 const throwError = this.onError(!!opt.silent, !!opt.async); 10397 if (this.defaults.async === true && origOpt.async === false) { 10398 return throwError(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise.")); 10399 } 10400 if (typeof src === "undefined" || src === null) { 10401 return throwError(new Error("marked(): input parameter is undefined or null")); 10402 } 10403 if (typeof src !== "string") { 10404 return throwError(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(src) + ", string expected")); 10405 } 10406 if (opt.hooks) { 10407 opt.hooks.options = opt; 10408 opt.hooks.block = blockType; 10409 } 10410 const lexer2 = opt.hooks ? opt.hooks.provideLexer() : blockType ? _Lexer.lex : _Lexer.lexInline; 10411 const parser2 = opt.hooks ? opt.hooks.provideParser() : blockType ? _Parser.parse : _Parser.parseInline; 10412 if (opt.async) { 10413 return Promise.resolve(opt.hooks ? opt.hooks.preprocess(src) : src).then((src2) => lexer2(src2, opt)).then((tokens) => opt.hooks ? opt.hooks.processAllTokens(tokens) : tokens).then((tokens) => opt.walkTokens ? Promise.all(this.walkTokens(tokens, opt.walkTokens)).then(() => tokens) : tokens).then((tokens) => parser2(tokens, opt)).then((html2) => opt.hooks ? opt.hooks.postprocess(html2) : html2).catch(throwError); 10414 }
10415 try { 10416 if (opt.hooks) { 10417 src = opt.hooks.preprocess(src); 10418 } 10419 let tokens = lexer2(src, opt); 10420 if (opt.hooks) { 10421 tokens = opt.hooks.processAllTokens(tokens); 10422 } 10423 if (opt.walkTokens) { 10424 this.walkTokens(tokens, opt.walkTokens); 10425 } 10426 let html2 = parser2(tokens, opt); 10427 if (opt.hooks) { 10428 html2 = opt.hooks.postprocess(html2); 10429 } 10430 return html2; 10431 } catch (e) { 10432 return throwError(e); 10433 } 10434 }; 10435 return parse2; 10436 } 10437 onError(silent, async) { 10438 return (e) => { 10439 e.message += "\nPlease report this to https://github.com/markedjs/marked."; 10440 if (silent) { 10441 const msg = "<p>An error occurred:</p><pre>" + escape2(e.message + "", true) + "</pre>"; 10442 if (async) { 10443 return Promise.resolve(msg); 10444 } 10445 return msg; 10446 } 10447 if (async) { 10448 return Promise.reject(e); 10449 } 10450 throw e; 10451 }; 10452 } 10453}; 10454var markedInstance = new Marked(); 10455function marked(src, opt) { 10456 return markedInstance.parse(src, opt); 10457} 10458marked.options = marked.setOptions = function(options2) { 10459 markedInstance.setOptions(options2); 10460 marked.defaults = markedInstance.defaults; 10461 changeDefaults(marked.defaults); 10462 return marked; 10463}; 10464marked.getDefaults = _getDefaults; 10465marked.defaults = _defaults; 10466marked.use = function(...args) { 10467 markedInstance.use(...args); 10468 marked.defaults = markedInstance.defaults; 10469 changeDefaults(marked.defaults); 10470 return marked; 10471}; 10472marked.walkTokens = function(tokens, callback) { 10473 return markedInstance.walkTokens(tokens, callback); 10474}; 10475marked.parseInline = markedInstance.parseInline; 10476marked.Parser = _Parser; 10477marked.parser = _Parser.parse; 10478marked.Renderer = _Renderer; 10479marked.TextRenderer = _TextRenderer; 10480marked.Lexer = _Lexer; 10481marked.lexer = _Lexer.lex; 10482marked.Tokenizer = _Tokenizer; 10483marked.Hooks = _Hooks; 10484marked.parse = marked; 10485marked.options; 10486marked.setOptions; 10487marked.use; 10488marked.walkTokens; 10489marked.parseInline; 10490_Parser.parse; 10491_Lexer.lex; 10492var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; 10493var lodash$1 = { exports: {} }; 10494/** 10495 * @license 10496 * Lodash <https://lodash.com/> 10497 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> 10498 * Released under MIT license <https://lodash.com/license> 10499 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> 10500 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 10501 */ 10502var lodash = lodash$1.exports; 10503var hasRequiredLodash; 10504function requireLodash() { 10505 if (hasRequiredLodash) return lodash$1.exports; 10506 hasRequiredLodash = 1; 10507 (function(module, exports) { 10508 (function() { 10509 var undefined$1; 10510 var VERSION2 = "4.17.21"; 10511 var LARGE_ARRAY_SIZE = 200; 10512 var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`"; 10513 var HASH_UNDEFINED = "__lodash_hash_undefined__"; 10514 var MAX_MEMOIZE_SIZE = 500; 10515 var PLACEHOLDER = "__lodash_placeholder__"; 10516 var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; 10517 var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; 10518 var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; 10519 var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "..."; 10520 var HOT_COUNT = 800, HOT_SPAN = 16; 10521 var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3; 10522 var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0; 10523 var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; 10524 var wrapFlags = [ 10525 ["ary", WRAP_ARY_FLAG], 10526 ["bind", WRAP_BIND_FLAG], 10527 ["bindKey", WRAP_BIND_KEY_FLAG], 10528 ["curry", WRAP_CURRY_FLAG], 10529 ["curryRight", WRAP_CURRY_RIGHT_FLAG], 10530 ["flip", WRAP_FLIP_FLAG], 10531 ["partial", WRAP_PARTIAL_FLAG], 10532 ["partialRight", WRAP_PARTIAL_RIGHT_FLAG], 10533 ["rearg", WRAP_REARG_FLAG] 10534 ]; 10535 var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undef
10535ined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]"; 10536 var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]"; 10537 var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; 10538 var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); 10539 var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; 10540 var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; 10541 var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); 10542 var reTrimStart = /^\s+/; 10543 var reWhitespace = /\s/; 10544 var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; 10545 var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; 10546 var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; 10547 var reEscapeChar = /\\(\\)?/g; 10548 var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; 10549 var reFlags = /\w*$/; 10550 var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; 10551 var reIsBinary = /^0b[01]+$/i; 10552 var reIsHostCtor = /^\[object .+?Constructor\]$/; 10553 var reIsOctal = /^0o[0-7]+$/i; 10554 var reIsUint = /^(?:0|[1-9]\d*)$/;
vendor: 4,291 bytes, lines 10555-10611
10555 var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; 10556 var reNoMatch = /($^)/; 10557 var reUnescapedString = /['\n\r\u2028\u2029\\]/g; 10558 var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; 10559 var rsApos = "['â]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d"; 10560 var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")"; 10561 var reApos = RegExp(rsApos, "g"); 10562 var reComboMark = RegExp(rsCombo, "g"); 10563 var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"); 10564 var reUnicodeWord = RegExp([ 10565 rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")", 10566 rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")", 10567 rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower, 10568 rsUpper + "+" + rsOptContrUpper, 10569 rsOrdUpper, 10570 rsOrdLower, 10571 rsDigits, 10572 rsEmoji 10573 ].join("|"), "g"); 10574 var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]"); 10575 var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; 10576 var contextProps = [ 10577 "Array", 10578 "Buffer", 10579 "DataView", 10580 "Date", 10581 "Error", 10582 "Float32Array", 10583 "Float64Array", 10584 "Function", 10585 "Int8Array", 10586 "Int16Array", 10587 "Int32Array", 10588 "Map", 10589 "Math", 10590 "Object", 10591 "Promise", 10592 "RegExp", 10593 "Set", 10594 "String", 10595 "Symbol", 10596 "TypeError", 10597 "Uint8Array", 10598 "Uint8ClampedArray", 10599 "Uint16Array", 10600 "Uint32Array", 10601 "WeakMap", 10602 "_", 10603 "clearTimeout", 10604 "isFinite", 10605 "parseInt", 10606 "setTimeout" 10607 ]; 10608 var templateCounter = -1; 10609 var typedArrayTags = {}; 10610 typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; 10611 typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag]
vendor: 5,826 bytes, lines 10611-10838
10611= typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; 10612 var cloneableTags = {}; 10613 cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; 10614 cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; 10615 var deburredLetters = { 10616 // Latin-1 Supplement block. 10617 "Ã": "A", 10618 "Ã": "A", 10619 "Ã": "A", 10620 "Ã": "A", 10621 "Ã": "A", 10622 "à ": "A", 10623 "à ": "a", 10624 "á": "a", 10625 "â": "a", 10626 "ã": "a", 10627 "ä": "a", 10628 "Ã¥": "a", 10629 "Ã": "C", 10630 "ç": "c", 10631 "Ã": "D", 10632 "ð": "d", 10633 "Ã": "E", 10634 "Ã": "E", 10635 "Ã": "E", 10636 "Ã": "E", 10637 "è": "e", 10638 "é": "e", 10639 "ê": "e", 10640 "ë": "e", 10641 "Ã": "I", 10642 "Ã": "I", 10643 "Ã": "I", 10644 "Ã": "I", 10645 "ì": "i", 10646 "Ã": "i", 10647 "î": "i", 10648 "ï": "i", 10649 "Ã": "N", 10650 "ñ": "n", 10651 "Ã": "O", 10652 "Ã": "O", 10653 "Ã": "O", 10654 "Ã": "O", 10655 "Ã": "O", 10656 "Ã": "O", 10657 "ò": "o", 10658 "ó": "o", 10659 "ô": "o", 10660 "õ": "o", 10661 "ö": "o", 10662 "ø": "o", 10663 "Ã": "U", 10664 "Ã": "U", 10665 "Ã": "U", 10666 "Ã": "U", 10667 "ù": "u", 10668 "ú": "u", 10669 "û": "u", 10670 "ü": "u", 10671 "Ã": "Y", 10672 "ý": "y", 10673 "ÿ": "y", 10674 "Ã": "Ae", 10675 "æ": "ae", 10676 "Ã": "Th", 10677 "þ": "th", 10678 "Ã": "ss", 10679 // Latin Extended-A block. 10680 "Ä": "A", 10681 "Ä": "A", 10682 "Ä": "A", 10683 "Ä": "a", 10684 "Ä": "a", 10685 "Ä ": "a", 10686 "Ä": "C", 10687 "Ä": "C", 10688 "Ä": "C", 10689 "Ä": "C", 10690 "Ä": "c", 10691 "Ä": "c", 10692 "Ä": "c", 10693 "Ä": "c", 10694 "Ä": "D", 10695 "Ä": "D", 10696 "Ä": "d", 10697 "Ä": "d", 10698 "Ä": "E", 10699 "Ä": "E", 10700 "Ä": "E", 10701 "Ä": "E", 10702 "Ä": "E", 10703 "Ä": "e", 10704 "Ä": "e", 10705 "Ä": "e", 10706 "Ä": "e", 10707 "Ä": "e", 10708 "Ä": "G", 10709 "Ä": "G", 10710 "Ä ": "G", 10711 "Ä¢": "G", 10712 "Ä": "g", 10713 "Ä": "g", 10714 "Ä¡": "g", 10715 "Ä£": "g", 10716 "Ĥ": "H", 10717 "Ħ": "H", 10718 "Ä¥": "h", 10719 "ħ": "h", 10720 "Ĩ": "I", 10721 "Ī": "I", 10722 "Ĭ": "I", 10723 "Ä®": "I", 10724 "İ": "I", 10725 "Ä©": "i", 10726 "Ä«": "i", 10727 "Ä": "i", 10728 "į": "i", 10729 "ı": "i", 10730 "Ä´": "J", 10731 "ĵ": "j", 10732 "Ķ": "K", 10733 "Ä·": "k", 10734 "ĸ": "k", 10735 "Ĺ": "L", 10736 "Ä»": "L", 10737 "Ľ": "L", 10738 "Ä¿": "L", 10739 "Å": "L", 10740 "ĺ": "l", 10741 "ļ": "l", 10742 "ľ": "l", 10743 "Å": "l", 10744 "Å": "l", 10745 "Å": "N", 10746 "Å ": "N", 10747 "Å": "N", 10748 "Å": "N", 10749 "Å": "n", 10750 "Å": "n", 10751 "Å": "n", 10752 "Å": "n", 10753 "Å": "O", 10754 "Å": "O", 10755 "Å": "O", 10756 "Å": "o", 10757 "Å": "o", 10758 "Å": "o", 10759 "Å": "R", 10760 "Å": "R", 10761 "Å": "R", 10762 "Å": "r", 10763 "Å": "r", 10764 "Å": "r", 10765 "Å": "S", 10766 "Å": "S", 10767 "Å": "S", 10768 "Å ": "S", 10769 "Å": "s", 10770 "Å": "s", 10771 "Å": "s", 10772 "Å¡": "s", 10773 "Å¢": "T", 10774 "Ť": "T", 10775 "Ŧ": "T", 10776 "Å£": "t", 10777 "Å¥": "t", 10778 "ŧ": "t", 10779 "Ũ": "U", 10780 "Ū": "U", 10781 "Ŭ": "U", 10782 "Å®": "U", 10783 "Ű": "U", 10784 "Ų": "U", 10785 "Å©": "u", 10786 "Å«": "u", 10787 "Å": "u", 10788 "ů": "u", 10789 "ű": "u", 10790 "ų": "u", 10791 "Å´": "W", 10792 "ŵ": "w", 10793 "Ŷ": "Y", 10794 "Å·": "y", 10795 "Ÿ": "Y", 10796 "Ź": "Z", 10797 "Å»": "Z", 10798 "Ž": "Z", 10799 "ź": "z", 10800 "ż": "z", 10801 "ž": "z", 10802 "IJ": "IJ", 10803 "ij": "ij", 10804 "Å": "Oe", 10805 "Å": "oe", 10806 "Å": "'n", 10807 "Å¿": "s" 10808 }; 10809 var htmlEscapes = { 10810 "&": "&", 10811 "<": "<", 10812 ">": ">", 10813 '"': """, 10814 "'": "'" 10815 }; 10816 var htmlUnescapes = { 10817 "&": "&", 10818 "<": "<", 10819 ">": ">", 10820 """: '"', 10821 "'": "'" 10822 }; 10823 var stringEscapes = { 10824 "\\": "\\", 10825 "'": "'", 10826 "\n": "n", 10827 "\r": "r", 10828 "\u2028": "u2028", 10829 "\u2029": "u2029" 10830 }; 10831 var freeParseFloat = parseFloat, freeParseInt = parseInt; 10832 var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; 10833 var freeSelf = typeof self == "object" && self && self.Object === Object && self; 10834 var root = freeGlobal || freeSelf || Function("return this")(); 10835 var freeExports = exports && !exports.nodeType && exports; 10836 var freeModule = freeExports && true && module && !module.nodeType && module; 10837 var moduleExports = freeModule && freeModule.exports === freeExports; 10838 var freeProcess = moduleExports && freeGlobal.process;
vendor: 4,521 bytes, lines 10839-10962
10839 var nodeUtil = (function() { 10840 try { 10841 var types = freeModule && freeModule.require && freeModule.require("util").types; 10842 if (types) { 10843 return types; 10844 } 10845 return freeProcess && freeProcess.binding && freeProcess.binding("util"); 10846 } catch (e) { 10847 } 10848 })(); 10849 var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; 10850 function apply2(func, thisArg, args) { 10851 switch (args.length) { 10852 case 0: 10853 return func.call(thisArg); 10854 case 1: 10855 return func.call(thisArg, args[0]); 10856 case 2: 10857 return func.call(thisArg, args[0], args[1]); 10858 case 3: 10859 return func.call(thisArg, args[0], args[1], args[2]); 10860 } 10861 return func.apply(thisArg, args); 10862 } 10863 function arrayAggregator(array, setter, iteratee, accumulator) { 10864 var index = -1, length = array == null ? 0 : array.length; 10865 while (++index < length) { 10866 var value = array[index]; 10867 setter(accumulator, value, iteratee(value), array); 10868 } 10869 return accumulator; 10870 } 10871 function arrayEach(array, iteratee) { 10872 var index = -1, length = array == null ? 0 : array.length; 10873 while (++index < length) { 10874 if (iteratee(array[index], index, array) === false) { 10875 break; 10876 } 10877 } 10878 return array; 10879 } 10880 function arrayEachRight(array, iteratee) { 10881 var length = array == null ? 0 : array.length; 10882 while (length--) { 10883 if (iteratee(array[length], length, array) === false) { 10884 break; 10885 } 10886 } 10887 return array; 10888 } 10889 function arrayEvery(array, predicate) { 10890 var index = -1, length = array == null ? 0 : array.length; 10891 while (++index < length) { 10892 if (!predicate(array[index], index, array)) { 10893 return false; 10894 } 10895 } 10896 return true; 10897 } 10898 function arrayFilter(array, predicate) { 10899 var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; 10900 while (++index < length) { 10901 var value = array[index]; 10902 if (predicate(value, index, array)) { 10903 result[resIndex++] = value; 10904 } 10905 } 10906 return result; 10907 } 10908 function arrayIncludes(array, value) { 10909 var length = array == null ? 0 : array.length; 10910 return !!length && baseIndexOf(array, value, 0) > -1; 10911 } 10912 function arrayIncludesWith(array, value, comparator) { 10913 var index = -1, length = array == null ? 0 : array.length; 10914 while (++index < length) { 10915 if (comparator(value, array[index])) { 10916 return true; 10917 } 10918 } 10919 return false; 10920 } 10921 function arrayMap(array, iteratee) { 10922 var index = -1, length = array == null ? 0 : array.length, result = Array(length); 10923 while (++index < length) { 10924 result[index] = iteratee(array[index], index, array); 10925 } 10926 return result; 10927 } 10928 function arrayPush(array, values) { 10929 var index = -1, length = values.length, offset = array.length; 10930 while (++index < length) { 10931 array[offset + index] = values[index]; 10932 } 10933 return array; 10934 } 10935 function arrayReduce(array, iteratee, accumulator, initAccum) { 10936 var index = -1, length = array == null ? 0 : array.length; 10937 if (initAccum && length) { 10938 accumulator = array[++index]; 10939 } 10940 while (++index < length) { 10941 accumulator = iteratee(accumulator, array[index], index, array); 10942 } 10943 return accumulator; 10944 } 10945 function arrayReduceRight(array, iteratee, accumulator, initAccum) { 10946 var length = array == null ? 0 : array.length; 10947 if (initAccum && length) { 10948 accumulator = array[--length]; 10949 } 10950 while (length--) { 10951 accumulator = iteratee(accumulator, array[length], length, array); 10952 } 10953 return accumulator; 10954 } 10955 function arraySome(array, predicate) { 10956 var index = -1, length = array == null ? 0 : array.length; 10957 while (++index < length) { 10958 if (predicate(array[index], index, array)) { 10959 return true; 10960 } 10961 } 10962 return false;
vendor: 8,355 bytes, lines 10963-11203
10963 } 10964 var asciiSize = baseProperty("length"); 10965 function asciiToArray(string) { 10966 return string.split(""); 10967 } 10968 function asciiWords(string) { 10969 return string.match(reAsciiWord) || []; 10970 } 10971 function baseFindKey(collection, predicate, eachFunc) { 10972 var result; 10973 eachFunc(collection, function(value, key, collection2) { 10974 if (predicate(value, key, collection2)) { 10975 result = key; 10976 return false; 10977 } 10978 }); 10979 return result; 10980 } 10981 function baseFindIndex(array, predicate, fromIndex, fromRight) { 10982 var length = array.length, index = fromIndex + (fromRight ? 1 : -1); 10983 while (fromRight ? index-- : ++index < length) { 10984 if (predicate(array[index], index, array)) { 10985 return index; 10986 } 10987 } 10988 return -1; 10989 } 10990 function baseIndexOf(array, value, fromIndex) { 10991 return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); 10992 } 10993 function baseIndexOfWith(array, value, fromIndex, comparator) { 10994 var index = fromIndex - 1, length = array.length; 10995 while (++index < length) { 10996 if (comparator(array[index], value)) { 10997 return index; 10998 } 10999 } 11000 return -1; 11001 } 11002 function baseIsNaN(value) { 11003 return value !== value; 11004 } 11005 function baseMean(array, iteratee) { 11006 var length = array == null ? 0 : array.length; 11007 return length ? baseSum(array, iteratee) / length : NAN; 11008 } 11009 function baseProperty(key) { 11010 return function(object) { 11011 return object == null ? undefined$1 : object[key]; 11012 }; 11013 } 11014 function basePropertyOf(object) { 11015 return function(key) { 11016 return object == null ? undefined$1 : object[key]; 11017 }; 11018 } 11019 function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { 11020 eachFunc(collection, function(value, index, collection2) { 11021 accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection2); 11022 }); 11023 return accumulator; 11024 } 11025 function baseSortBy(array, comparer) { 11026 var length = array.length; 11027 array.sort(comparer); 11028 while (length--) { 11029 array[length] = array[length].value; 11030 } 11031 return array; 11032 } 11033 function baseSum(array, iteratee) { 11034 var result, index = -1, length = array.length; 11035 while (++index < length) { 11036 var current = iteratee(array[index]); 11037 if (current !== undefined$1) { 11038 result = result === undefined$1 ? current : result + current; 11039 } 11040 } 11041 return result; 11042 } 11043 function baseTimes(n, iteratee) { 11044 var index = -1, result = Array(n); 11045 while (++index < n) { 11046 result[index] = iteratee(index); 11047 } 11048 return result; 11049 } 11050 function baseToPairs(object, props) { 11051 return arrayMap(props, function(key) { 11052 return [key, object[key]]; 11053 }); 11054 } 11055 function baseTrim(string) { 11056 return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string; 11057 } 11058 function baseUnary(func) { 11059 return function(value) { 11060 return func(value); 11061 }; 11062 } 11063 function baseValues(object, props) { 11064 return arrayMap(props, function(key) { 11065 return object[key]; 11066 }); 11067 } 11068 function cacheHas(cache2, key) { 11069 return cache2.has(key); 11070 } 11071 function charsStartIndex(strSymbols, chrSymbols) { 11072 var index = -1, length = strSymbols.length; 11073 while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { 11074 } 11075 return index; 11076 } 11077 function charsEndIndex(strSymbols, chrSymbols) { 11078 var index = strSymbols.length; 11079 while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { 11080 } 11081 return index; 11082 } 11083 function countHolders(array, placeholder) { 11084 var length = array.length, result = 0; 11085 while (length--) { 11086 if (array[length] === placeholder) { 11087 ++result; 11088 } 11089 } 11090 return result; 11091 } 11092 var deburrLetter = basePropertyOf(deburredLetters); 11093 var escapeHtmlChar = basePropertyOf(htmlEscapes); 11094 function escapeStringChar(chr) { 11095 return "\\" + stringEscapes[chr]; 11096 } 11097 function getValue2(object, key) { 11098 return object == null ? undefined$1 : object[key]; 11099 } 11100 function hasUnicode(string) { 11101 return reHasUnicode.test(string); 11102 } 11103 function hasUnicodeWord(string) { 11104 return reHasUnicodeWord.test(string); 11105 } 11106 function iteratorToArray(iterator2) { 11107 var data, result = []; 11108 while (!(data = iterator2.next()).done) { 11109 result.push(data.value); 11110 } 11111 return result; 11112 } 11113 function mapToArray(map2) { 11114 var index = -1, result = Array(map2.size); 11115 map2.forEach(function(value, key) { 11116 result[++index] = [key, value]; 11117 }); 11118 return result; 11119 } 11120 function overArg(func, transform2) { 11121 return function(arg) { 11122 return func(transform2(arg)); 11123 }; 11124 } 11125 function replaceHolders(array, placeholder) { 11126 var index = -1, length = array.length, resIndex = 0, result = []; 11127 while (++index < length) { 11128 var value = array[index]; 11129 if (value === placeholder || value === PLACEHOLDER) { 11130 array[index] = PLACEHOLDER; 11131 result[resIndex++] = index; 11132 } 11133 } 11134 return result; 11135 } 11136 function setToArray(set2) { 11137 var index = -1, result = Array(set2.size); 11138 set2.forEach(function(value) { 11139 result[++index] = value; 11140 }); 11141 return result; 11142 } 11143 function setToPairs(set2) { 11144 var index = -1, result = Array(set2.size); 11145 set2.forEach(function(value) { 11146 result[++index] = [value, value]; 11147 }); 11148 return result; 11149 } 11150 function strictIndexOf(array, value, fromIndex) { 11151 var index = fromIndex - 1, length = array.length; 11152 while (++index < length) { 11153 if (array[index] === value) { 11154 return index; 11155 } 11156 } 11157 return -1; 11158 } 11159 function strictLastIndexOf(array, value, fromIndex) { 11160 var index = fromIndex + 1; 11161 while (index--) { 11162 if (array[index] === value) { 11163 return index; 11164 } 11165 } 11166 return index; 11167 } 11168 function stringSize(string) { 11169 return hasUnicode(string) ? unicodeSize(string) : asciiSize(string); 11170 } 11171 function stringToArray(string) { 11172 return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); 11173 } 11174 function trimmedEndIndex(string) { 11175 var index = string.length; 11176 while (index-- && reWhitespace.test(string.charAt(index))) { 11177 } 11178 return index; 11179 } 11180 var unescapeHtmlChar = basePropertyOf(htmlUnescapes); 11181 function unicodeSize(string) { 11182 var result = reUnicode.lastIndex = 0; 11183 while (reUnicode.test(string)) { 11184 ++result; 11185 } 11186 return result; 11187 } 11188 function unicodeToArray(string) { 11189 return string.match(reUnicode) || []; 11190 } 11191 function unicodeWords(string) { 11192 return string.match(reUnicodeWord) || []; 11193 } 11194 var runInContext = (function runInContext2(context) { 11195 context = context == null ? root : _.defaults(root.Object(), context, _.pick(root, contextProps)); 11196 var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError; 11197 var arrayProto2 = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype; 11198 var coreJsData = context["__core-js_shared__"]; 11199 var funcToString = funcProto.toString; 11200 var hasOwnProperty2 = objectProto.hasOwnProperty; 11201 var idCounter = 0; 11202 var maskSrcKey = (function() { 11203 var uid2 = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
11204 return uid2 ? "Symbol(src)_1." + uid2 : ""; 11205 })(); 11206 var nativeObjectToString = objectProto.toString; 11207 var objectCtorString = funcToString.call(Object2); 11208 var oldDash = root._; 11209 var reIsNative = RegExp2( 11210 "^" + funcToString.call(hasOwnProperty2).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" 11211 ); 11212 var Buffer2 = moduleExports ? context.Buffer : undefined$1, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined$1, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto2.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined$1, symIterator = Symbol2 ? Symbol2.iterator : undefined$1, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined$1; 11213 var defineProperty = (function() { 11214 try { 11215 var func = getNative(Object2, "defineProperty"); 11216 func({}, "", {}); 11217 return func; 11218 } catch (e) { 11219 } 11220 })(); 11221 var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; 11222 var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined$1, nativeIsFinite = context.
vendor: 36,097 bytes, lines 11222-12105
11222isFinite, nativeJoin = arrayProto2.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto2.reverse; 11223 var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"), WeakMap2 = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create"); 11224 var metaMap = WeakMap2 && new WeakMap2(); 11225 var realNames = {}; 11226 var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2); 11227 var symbolProto = Symbol2 ? Symbol2.prototype : undefined$1, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined$1, symbolToString = symbolProto ? symbolProto.toString : undefined$1; 11228 function lodash2(value) { 11229 if (isObjectLike(value) && !isArray2(value) && !(value instanceof LazyWrapper)) { 11230 if (value instanceof LodashWrapper) { 11231 return value; 11232 } 11233 if (hasOwnProperty2.call(value, "__wrapped__")) { 11234 return wrapperClone(value); 11235 } 11236 } 11237 return new LodashWrapper(value); 11238 } 11239 var baseCreate = /* @__PURE__ */ (function() { 11240 function object() { 11241 } 11242 return function(proto) { 11243 if (!isObject2(proto)) { 11244 return {}; 11245 } 11246 if (objectCreate) { 11247 return objectCreate(proto); 11248 } 11249 object.prototype = proto; 11250 var result2 = new object(); 11251 object.prototype = undefined$1; 11252 return result2; 11253 }; 11254 })(); 11255 function baseLodash() { 11256 } 11257 function LodashWrapper(value, chainAll) { 11258 this.__wrapped__ = value; 11259 this.__actions__ = []; 11260 this.__chain__ = !!chainAll; 11261 this.__index__ = 0; 11262 this.__values__ = undefined$1; 11263 } 11264 lodash2.templateSettings = { 11265 /** 11266 * Used to detect `data` property values to be HTML-escaped. 11267 * 11268 * @memberOf _.templateSettings 11269 * @type {RegExp} 11270 */ 11271 "escape": reEscape, 11272 /** 11273 * Used to detect code to be evaluated. 11274 * 11275 * @memberOf _.templateSettings 11276 * @type {RegExp} 11277 */ 11278 "evaluate": reEvaluate, 11279 /** 11280 * Used to detect `data` property values to inject. 11281 * 11282 * @memberOf _.templateSettings 11283 * @type {RegExp} 11284 */ 11285 "interpolate": reInterpolate, 11286 /** 11287 * Used to reference the data object in the template text. 11288 * 11289 * @memberOf _.templateSettings 11290 * @type {string} 11291 */ 11292 "variable": "", 11293 /** 11294 * Used to import variables into the compiled template. 11295 * 11296 * @memberOf _.templateSettings 11297 * @type {Object} 11298 */ 11299 "imports": { 11300 /** 11301 * A reference to the `lodash` function. 11302 * 11303 * @memberOf _.templateSettings.imports 11304 * @type {Function} 11305 */ 11306 "_": lodash2 11307 } 11308 }; 11309 lodash2.prototype = baseLodash.prototype; 11310 lodash2.prototype.constructor = lodash2; 11311 LodashWrapper.prototype = baseCreate(baseLodash.prototype); 11312 LodashWrapper.prototype.constructor = LodashWrapper; 11313 function LazyWrapper(value) { 11314 this.__wrapped__ = value; 11315 this.__actions__ = []; 11316 this.__dir__ = 1; 11317 this.__filtered__ = false; 11318 this.__iteratees__ = []; 11319 this.__takeCount__ = MAX_ARRAY_LENGTH; 11320 this.__views__ = []; 11321 } 11322 function lazyClone() { 11323 var result2 = new LazyWrapper(this.__wrapped__); 11324 result2.__actions__ = copyArray(this.__actions__); 11325 result2.__dir__ = this.__dir__; 11326 result2.__filtered__ = this.__filtered__; 11327 result2.__iteratees__ = copyArray(this.__iteratees__); 11328 result2.__takeCount__ = this.__takeCount__; 11329 result2.__views__ = copyArray(this.__views__); 11330 return result2; 11331 } 11332 function lazyReverse() { 11333 if (this.__filtered__) { 11334 var result2 = new LazyWrapper(this); 11335 result2.__dir__ = -1; 11336 result2.__filtered__ = true; 11337 } else { 11338 result2 = this.clone(); 11339 result2.__dir__ *= -1; 11340 } 11341 return result2; 11342 } 11343 function lazyValue() { 11344 var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray2(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start = view.start, end = view.end, length = end - start, index = isRight ? end : start - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__); 11345 if (!isArr || !isRight && arrLength == length && takeCount == length) { 11346 return baseWrapperValue(array, this.__actions__); 11347 } 11348 var result2 = []; 11349 outer: 11350 while (length-- && resIndex < takeCount) { 11351 index += dir; 11352 var iterIndex = -1, value = array[index]; 11353 while (++iterIndex < iterLength) { 11354 var data = iteratees[iterIndex], iteratee2 = data.iteratee, type = data.type, computed2 = iteratee2(value); 11355 if (type == LAZY_MAP_FLAG) { 11356 value = computed2; 11357 } else if (!computed2) { 11358 if (type == LAZY_FILTER_FLAG) { 11359 continue outer; 11360 } else { 11361 break outer; 11362 } 11363 } 11364 } 11365 result2[resIndex++] = value; 11366 } 11367 return result2; 11368 } 11369 LazyWrapper.prototype = baseCreate(baseLodash.prototype); 11370 LazyWrapper.prototype.constructor = LazyWrapper; 11371 function Hash(entries) { 11372 var index = -1, length = entries == null ? 0 : entries.length; 11373 this.clear(); 11374 while (++index < length) { 11375 var entry = entries[index]; 11376 this.set(entry[0], entry[1]); 11377 } 11378 } 11379 function hashClear() { 11380 this.__data__ = nativeCreate ? nativeCreate(null) : {}; 11381 this.size = 0; 11382 } 11383 function hashDelete(key) { 11384 var result2 = this.has(key) && delete this.__data__[key]; 11385 this.size -= result2 ? 1 : 0; 11386 return result2; 11387 } 11388 function hashGet(key) { 11389 var data = this.__data__; 11390 if (nativeCreate) { 11391 var result2 = data[key]; 11392 return result2 === HASH_UNDEFINED ? undefined$1 : result2; 11393 } 11394 return hasOwnProperty2.call(data, key) ? data[key] : undefined$1; 11395 } 11396 function hashHas(key) { 11397 var data = this.__data__; 11398 return nativeCreate ? data[key] !== undefined$1 : hasOwnProperty2.call(data, key); 11399 } 11400 function hashSet(key, value) { 11401 var data = this.__data__; 11402 this.size += this.has(key) ? 0 : 1; 11403 data[key] = nativeCreate && value === undefined$1 ? HASH_UNDEFINED : value; 11404 return this; 11405 } 11406 Hash.prototype.clear = hashClear; 11407 Hash.prototype["delete"] = hashDelete; 11408 Hash.prototype.get = hashGet; 11409 Hash.prototype.has = hashHas; 11410 Hash.prototype.set = hashSet; 11411 function ListCache(entries) { 11412 var index = -1, length = entries == null ? 0 : entries.length; 11413 this.clear(); 11414 while (++index < length) { 11415 var entry = entries[index]; 11416 this.set(entry[0], entry[1]); 11417 } 11418 } 11419 function listCacheClear() { 11420 this.__data__ = []; 11421 this.size = 0; 11422 } 11423 function listCacheDelete(key) { 11424 var data = this.__data__, index = assocIndexOf(data, key); 11425 if (index < 0) { 11426 return false; 11427 } 11428 var lastIndex = data.length - 1; 11429 if (index == lastIndex) { 11430 data.pop(); 11431 } else { 11432 splice.call(data, index, 1); 11433 } 11434 --this.size; 11435 return true; 11436 } 11437 function listCacheGet(key) { 11438 var data = this.__data__, index = assocIndexOf(data, key); 11439 return index < 0 ? undefined$1 : data[index][1]; 11440 } 11441 function listCacheHas(key) { 11442 return assocIndexOf(this.__data__, key) > -1; 11443 } 11444 function listCacheSet(key, value) { 11445 var data = this.__data__, index = assocIndexOf(data, key); 11446 if (index < 0) { 11447 ++this.size; 11448 data.push([key, value]); 11449 } else { 11450 data[index][1] = value; 11451 } 11452 return this; 11453 } 11454 ListCache.prototype.clear = listCacheClear; 11455 ListCache.prototype["delete"] = listCacheDelete; 11456 ListCache.prototype.get = listCacheGet; 11457 ListCache.prototype.has = listCacheHas; 11458 ListCache.prototype.set = listCacheSet; 11459 function MapCache(entries) { 11460 var index = -1, length = entries == null ? 0 : entries.length; 11461 this.clear(); 11462 while (++index < length) { 11463 var entry = entries[index]; 11464 this.set(entry[0], entry[1]); 11465 } 11466 } 11467 function mapCacheClear() { 11468 this.size = 0; 11469 this.__data__ = { 11470 "hash": new Hash(), 11471 "map": new (Map2 || ListCache)(), 11472 "string": new Hash() 11473 }; 11474 } 11475 function mapCacheDelete(key) { 11476 var result2 = getMapData(this, key)["delete"](key); 11477 this.size -= result2 ? 1 : 0; 11478 return result2; 11479 } 11480 function mapCacheGet(key) { 11481 return getMapData(this, key).get(key); 11482 } 11483 function mapCacheHas(key) { 11484 return getMapData(this, key).has(key); 11485 } 11486 function mapCacheSet(key, value) { 11487 var data = getMapData(this, key), size2 = data.size; 11488 data.set(key, value); 11489 this.size += data.size == size2 ? 0 : 1; 11490 return this; 11491 } 11492 MapCache.prototype.clear = mapCacheClear; 11493 MapCache.prototype["delete"] = mapCacheDelete; 11494 MapCache.prototype.get = mapCacheGet; 11495 MapCache.prototype.has = mapCacheHas; 11496 MapCache.prototype.set = mapCacheSet; 11497 function SetCache(values2) { 11498 var index = -1, length = values2 == null ? 0 : values2.length; 11499 this.__data__ = new MapCache(); 11500 while (++index < length) { 11501 this.add(values2[index]); 11502 } 11503 } 11504 function setCacheAdd(value) { 11505 this.__data__.set(value, HASH_UNDEFINED); 11506 return this; 11507 } 11508 function setCacheHas(value) { 11509 return this.__data__.has(value); 11510 } 11511 SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; 11512 SetCache.prototype.has = setCacheHas; 11513 function Stack(entries) { 11514 var data = this.__data__ = new ListCache(entries); 11515 this.size = data.size; 11516 } 11517 function stackClear() { 11518 this.__data__ = new ListCache(); 11519 this.size = 0; 11520 } 11521 function stackDelete(key) { 11522 var data = this.__data__, result2 = data["delete"](key); 11523 this.size = data.size; 11524 return result2; 11525 } 11526 function stackGet(key) { 11527 return this.__data__.get(key); 11528 } 11529 function stackHas(key) { 11530 return this.__data__.has(key); 11531 } 11532 function stackSet(key, value) { 11533 var data = this.__data__; 11534 if (data instanceof ListCache) { 11535 var pairs = data.__data__; 11536 if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) { 11537 pairs.push([key, value]); 11538 this.size = ++data.size; 11539 return this; 11540 } 11541 data = this.__data__ = new MapCache(pairs); 11542 } 11543 data.set(key, value); 11544 this.size = data.size; 11545 return this; 11546 } 11547 Stack.prototype.clear = stackClear; 11548 Stack.prototype["delete"] = stackDelete; 11549 Stack.prototype.get = stackGet; 11550 Stack.prototype.has = stackHas; 11551 Stack.prototype.set = stackSet; 11552 function arrayLikeKeys(value, inherited) { 11553 var isArr = isArray2(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result2 = skipIndexes ? baseTimes(value.length, String2) : [], length = result2.length; 11554 for (var key in value) { 11555 if ((inherited || hasOwnProperty2.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode. 11556 (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. 11557 isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. 11558 isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties. 11559 isIndex(key, length)))) { 11560 result2.push(key); 11561 } 11562 } 11563 return result2; 11564 } 11565 function arraySample(array) { 11566 var length = array.length; 11567 return length ? array[baseRandom(0, length - 1)] : undefined$1; 11568 } 11569 function arraySampleSize(array, n) { 11570 return shuffleSelf(copyArray(array), baseClamp(n, 0, array.length)); 11571 } 11572 function arrayShuffle(array) { 11573 return shuffleSelf(copyArray(array)); 11574 } 11575 function assignMergeValue(object, key, value) { 11576 if (value !== undefined$1 && !eq(object[key], value) || value === undefined$1 && !(key in object)) { 11577 baseAssignValue(object, key, value); 11578 } 11579 } 11580 function assignValue(object, key, value) { 11581 var objValue = object[key]; 11582 if (!(hasOwnProperty2.call(object, key) && eq(objValue, value)) || value === undefined$1 && !(key in object)) { 11583 baseAssignValue(object, key, value); 11584 } 11585 } 11586 function assocIndexOf(array, key) { 11587 var length = array.length; 11588 while (length--) { 11589 if (eq(array[length][0], key)) { 11590 return length; 11591 } 11592 } 11593 return -1; 11594 } 11595 function baseAggregator(collection, setter, iteratee2, accumulator) { 11596 baseEach(collection, function(value, key, collection2) { 11597 setter(accumulator, value, iteratee2(value), collection2); 11598 }); 11599 return accumulator; 11600 } 11601 function baseAssign(object, source) { 11602 return object && copyObject(source, keys(source), object); 11603 } 11604 function baseAssignIn(object, source) { 11605 return object && copyObject(source, keysIn(source), object); 11606 } 11607 function baseAssignValue(object, key, value) { 11608 if (key == "__proto__" && defineProperty) { 11609 defineProperty(object, key, { 11610 "configurable": true, 11611 "enumerable": true, 11612 "value": value, 11613 "writable": true 11614 }); 11615 } else { 11616 object[key] = value; 11617 } 11618 } 11619 function baseAt(object, paths) { 11620 var index = -1, length = paths.length, result2 = Array2(length), skip = object == null; 11621 while (++index < length) { 11622 result2[index] = skip ? undefined$1 : get(object, paths[index]); 11623 } 11624 return result2; 11625 } 11626 function baseClamp(number2, lower, upper) { 11627 if (number2 === number2) { 11628 if (upper !== undefined$1) { 11629 number2 = number2 <= upper ? number2 : upper; 11630 } 11631 if (lower !== undefined$1) { 11632 number2 = number2 >= lower ? number2 : lower; 11633 } 11634 } 11635 return number2; 11636 } 11637 function baseClone(value, bitmask, customizer, key, object, stack2) { 11638 var result2, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; 11639 if (customizer) { 11640 result2 = object ? customizer(value, key, object, stack2) : customizer(value); 11641 } 11642 if (result2 !== undefined$1) { 11643 return result2; 11644 } 11645 if (!isObject2(value)) { 11646 return value; 11647 } 11648 var isArr = isArray2(value); 11649 if (isArr) { 11650 result2 = initCloneArray(value); 11651 if (!isDeep) { 11652 return copyArray(value, result2); 11653 } 11654 } else { 11655 var tag2 = getTag(value), isFunc = tag2 == funcTag || tag2 == genTag; 11656 if (isBuffer(value)) { 11657 return cloneBuffer(value, isDeep); 11658 } 11659 if (tag2 == objectTag || tag2 == argsTag || isFunc && !object) { 11660 result2 = isFlat || isFunc ? {} : initCloneObject(value); 11661 if (!isDeep) { 11662 return isFlat ? copySymbolsIn(value, baseAssignIn(result2, value)) : copySymbols(value, baseAssign(result2, value)); 11663 } 11664 } else { 11665 if (!cloneableTags[tag2]) { 11666 return object ? value : {}; 11667 } 11668 result2 = initCloneByTag(value, tag2, isDeep); 11669 } 11670 } 11671 stack2 || (stack2 = new Stack()); 11672 var stacked = stack2.get(value); 11673 if (stacked) { 11674 return stacked; 11675 } 11676 stack2.set(value, result2); 11677 if (isSet2(value)) { 11678 value.forEach(function(subValue) { 11679 result2.add(baseClone(subValue, bitmask, customizer, subValue, value, stack2)); 11680 }); 11681 } else if (isMap2(value)) { 11682 value.forEach(function(subValue, key2) { 11683 result2.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack2)); 11684 }); 11685 } 11686 var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys; 11687 var props = isArr ? undefined$1 : keysFunc(value); 11688 arrayEach(props || value, function(subValue, key2) { 11689 if (props) { 11690 key2 = subValue; 11691 subValue = value[key2]; 11692 } 11693 assignValue(result2, key2, baseClone(subValue, bitmask, customizer, key2, value, stack2)); 11694 }); 11695 return result2; 11696 } 11697 function baseConforms(source) { 11698 var props = keys(source); 11699 return function(object) { 11700 return baseConformsTo(object, source, props); 11701 }; 11702 } 11703 function baseConformsTo(object, source, props) { 11704 var length = props.length; 11705 if (object == null) { 11706 return !length; 11707 } 11708 object = Object2(object); 11709 while (length--) { 11710 var key = props[length], predicate = source[key], value = object[key]; 11711 if (value === undefined$1 && !(key in object) || !predicate(value)) { 11712 return false; 11713 } 11714 } 11715 return true; 11716 } 11717 function baseDelay(func, wait, args) { 11718 if (typeof func != "function") { 11719 throw new TypeError2(FUNC_ERROR_TEXT); 11720 } 11721 return setTimeout2(function() { 11722 func.apply(undefined$1, args); 11723 }, wait); 11724 } 11725 function baseDifference(array, values2, iteratee2, comparator) { 11726 var index = -1, includes2 = arrayIncludes, isCommon = true, length = array.length, result2 = [], valuesLength = values2.length; 11727 if (!length) { 11728 return result2; 11729 } 11730 if (iteratee2) { 11731 values2 = arrayMap(values2, baseUnary(iteratee2)); 11732 } 11733 if (comparator) { 11734 includes2 = arrayIncludesWith; 11735 isCommon = false; 11736 } else if (values2.length >= LARGE_ARRAY_SIZE) { 11737 includes2 = cacheHas; 11738 isCommon = false; 11739 values2 = new SetCache(values2); 11740 } 11741 outer: 11742 while (++index < length) { 11743 var value = array[index], computed2 = iteratee2 == null ? value : iteratee2(value); 11744 value = comparator || value !== 0 ? value : 0; 11745 if (isCommon && computed2 === computed2) { 11746 var valuesIndex = valuesLength; 11747 while (valuesIndex--) { 11748 if (values2[valuesIndex] === computed2) { 11749 continue outer; 11750 } 11751 } 11752 result2.push(value); 11753 } else if (!includes2(values2, computed2, comparator)) { 11754 result2.push(value); 11755 } 11756 } 11757 return result2; 11758 } 11759 var baseEach = createBaseEach(baseForOwn); 11760 var baseEachRight = createBaseEach(baseForOwnRight, true); 11761 function baseEvery(collection, predicate) { 11762 var result2 = true; 11763 baseEach(collection, function(value, index, collection2) { 11764 result2 = !!predicate(value, index, collection2); 11765 return result2; 11766 }); 11767 return result2; 11768 } 11769 function baseExtremum(array, iteratee2, comparator) { 11770 var index = -1, length = array.length; 11771 while (++index < length) { 11772 var value = array[index], current = iteratee2(value); 11773 if (current != null && (computed2 === undefined$1 ? current === current && !isSymbol2(current) : comparator(current, computed2))) { 11774 var computed2 = current, result2 = value; 11775 } 11776 } 11777 return result2; 11778 } 11779 function baseFill(array, value, start, end) { 11780 var length = array.length; 11781 start = toInteger(start); 11782 if (start < 0) { 11783 start = -start > length ? 0 : length + start; 11784 } 11785 end = end === undefined$1 || end > length ? length : toInteger(end); 11786 if (end < 0) { 11787 end += length; 11788 } 11789 end = start > end ? 0 : toLength(end); 11790 while (start < end) { 11791 array[start++] = value; 11792 } 11793 return array; 11794 } 11795 function baseFilter(collection, predicate) { 11796 var result2 = []; 11797 baseEach(collection, function(value, index, collection2) { 11798 if (predicate(value, index, collection2)) { 11799 result2.push(value); 11800 } 11801 }); 11802 return result2; 11803 } 11804 function baseFlatten(array, depth, predicate, isStrict, result2) { 11805 var index = -1, length = array.length; 11806 predicate || (predicate = isFlattenable); 11807 result2 || (result2 = []); 11808 while (++index < length) { 11809 var value = array[index]; 11810 if (depth > 0 && predicate(value)) { 11811 if (depth > 1) { 11812 baseFlatten(value, depth - 1, predicate, isStrict, result2); 11813 } else { 11814 arrayPush(result2, value); 11815 } 11816 } else if (!isStrict) { 11817 result2[result2.length] = value; 11818 } 11819 } 11820 return result2; 11821 } 11822 var baseFor = createBaseFor(); 11823 var baseForRight = createBaseFor(true); 11824 function baseForOwn(object, iteratee2) { 11825 return object && baseFor(object, iteratee2, keys); 11826 } 11827 function baseForOwnRight(object, iteratee2) { 11828 return object && baseForRight(object, iteratee2, keys); 11829 } 11830 function baseFunctions(object, props) { 11831 return arrayFilter(props, function(key) { 11832 return isFunction2(object[key]); 11833 }); 11834 } 11835 function baseGet(object, path) { 11836 path = castPath(path, object); 11837 var index = 0, length = path.length; 11838 while (object != null && index < length) { 11839 object = object[toKey(path[index++])]; 11840 } 11841 return index && index == length ? object : undefined$1; 11842 } 11843 function baseGetAllKeys(object, keysFunc, symbolsFunc) { 11844 var result2 = keysFunc(object); 11845 return isArray2(object) ? result2 : arrayPush(result2, symbolsFunc(object)); 11846 } 11847 function baseGetTag(value) { 11848 if (value == null) { 11849 return value === undefined$1 ? undefinedTag : nullTag; 11850 } 11851 return symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString2(value); 11852 } 11853 function baseGt(value, other2) { 11854 return value > other2; 11855 } 11856 function baseHas(object, key) { 11857 return object != null && hasOwnProperty2.call(object, key); 11858 } 11859 function baseHasIn(object, key) { 11860 return object != null && key in Object2(object); 11861 } 11862 function baseInRange(number2, start, end) { 11863 return number2 >= nativeMin(start, end) && number2 < nativeMax(start, end); 11864 } 11865 function baseIntersection(arrays, iteratee2, comparator) { 11866 var includes2 = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result2 = []; 11867 while (othIndex--) { 11868 var array = arrays[othIndex]; 11869 if (othIndex && iteratee2) { 11870 array = arrayMap(array, baseUnary(iteratee2)); 11871 } 11872 maxLength = nativeMin(array.length, maxLength); 11873 caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined$1; 11874 } 11875 array = arrays[0]; 11876 var index = -1, seen = caches[0]; 11877 outer: 11878 while (++index < length && result2.length < maxLength) { 11879 var value = array[index], computed2 = iteratee2 ? iteratee2(value) : value; 11880 value = comparator || value !== 0 ? value : 0; 11881 if (!(seen ? cacheHas(seen, computed2) : includes2(result2, computed2, comparator))) { 11882 othIndex = othLength; 11883 while (--othIndex) { 11884 var cache2 = caches[othIndex]; 11885 if (!(cache2 ? cacheHas(cache2, computed2) : includes2(arrays[othIndex], computed2, comparator))) { 11886 continue outer; 11887 } 11888 } 11889 if (seen) { 11890 seen.push(computed2); 11891 } 11892 result2.push(value); 11893 } 11894 } 11895 return result2; 11896 } 11897 function baseInverter(object, setter, iteratee2, accumulator) { 11898 baseForOwn(object, function(value, key, object2) { 11899 setter(accumulator, iteratee2(value), key, object2); 11900 }); 11901 return accumulator; 11902 } 11903 function baseInvoke(object, path, args) { 11904 path = castPath(path, object); 11905 object = parent(object, path); 11906 var func = object == null ? object : object[toKey(last(path))]; 11907 return func == null ? undefined$1 : apply2(func, object, args); 11908 } 11909 function baseIsArguments(value) { 11910 return isObjectLike(value) && baseGetTag(value) == argsTag; 11911 } 11912 function baseIsArrayBuffer(value) { 11913 return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; 11914 } 11915 function baseIsDate(value) { 11916 return isObjectLike(value) && baseGetTag(value) == dateTag; 11917 } 11918 function baseIsEqual(value, other2, bitmask, customizer, stack2) { 11919 if (value === other2) { 11920 return true; 11921 } 11922 if (value == null || other2 == null || !isObjectLike(value) && !isObjectLike(other2)) { 11923 return value !== value && other2 !== other2; 11924 } 11925 return baseIsEqualDeep(value, other2, bitmask, customizer, baseIsEqual, stack2); 11926 } 11927 function baseIsEqualDeep(object, other2, bitmask, customizer, equalFunc, stack2) { 11928 var objIsArr = isArray2(object), othIsArr = isArray2(other2), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other2); 11929 objTag = objTag == argsTag ? objectTag : objTag; 11930 othTag = othTag == argsTag ? objectTag : othTag; 11931 var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; 11932 if (isSameTag && isBuffer(object)) { 11933 if (!isBuffer(other2)) { 11934 return false; 11935 } 11936 objIsArr = true; 11937 objIsObj = false; 11938 } 11939 if (isSameTag && !objIsObj) { 11940 stack2 || (stack2 = new Stack()); 11941 return objIsArr || isTypedArray(object) ? equalArrays(object, other2, bitmask, customizer, equalFunc, stack2) : equalByTag(object, other2, objTag, bitmask, customizer, equalFunc, stack2); 11942 } 11943 if (!(bitmask & COMPARE_PARTIAL_FLAG)) { 11944 var objIsWrapped = objIsObj && hasOwnProperty2.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty2.call(other2, "__wrapped__"); 11945 if (objIsWrapped || othIsWrapped) { 11946 var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other2.value() : other2; 11947 stack2 || (stack2 = new Stack()); 11948 return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack2); 11949 } 11950 } 11951 if (!isSameTag) { 11952 return false; 11953 } 11954 stack2 || (stack2 = new Stack()); 11955 return equalObjects(object, other2, bitmask, customizer, equalFunc, stack2); 11956 } 11957 function baseIsMap(value) { 11958 return isObjectLike(value) && getTag(value) == mapTag; 11959 } 11960 function baseIsMatch(object, source, matchData, customizer) { 11961 var index = matchData.length, length = index, noCustomizer = !customizer; 11962 if (object == null) { 11963 return !length; 11964 } 11965 object = Object2(object); 11966 while (index--) { 11967 var data = matchData[index]; 11968 if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) { 11969 return false; 11970 } 11971 } 11972 while (++index < length) { 11973 data = matchData[index]; 11974 var key = data[0], objValue = object[key], srcValue = data[1]; 11975 if (noCustomizer && data[2]) { 11976 if (objValue === undefined$1 && !(key in object)) { 11977 return false; 11978 } 11979 } else { 11980 var stack2 = new Stack(); 11981 if (customizer) { 11982 var result2 = customizer(objValue, srcValue, key, object, source, stack2); 11983 } 11984 if (!(result2 === undefined$1 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack2) : result2)) { 11985 return false; 11986 } 11987 } 11988 } 11989 return true; 11990 } 11991 function baseIsNative(value) { 11992 if (!isObject2(value) || isMasked(value)) { 11993 return false; 11994 } 11995 var pattern = isFunction2(value) ? reIsNative : reIsHostCtor; 11996 return pattern.test(toSource(value)); 11997 } 11998 function baseIsRegExp(value) { 11999 return isObjectLike(value) && baseGetTag(value) == regexpTag; 12000 } 12001 function baseIsSet(value) { 12002 return isObjectLike(value) && getTag(value) == setTag; 12003 } 12004 function baseIsTypedArray(value) { 12005 return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; 12006 } 12007 function baseIteratee(value) { 12008 if (typeof value == "function") { 12009 return value; 12010 } 12011 if (value == null) { 12012 return identity; 12013 } 12014 if (typeof value == "object") { 12015 return isArray2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); 12016 } 12017 return property(value); 12018 } 12019 function baseKeys(object) { 12020 if (!isPrototype(object)) { 12021 return nativeKeys(object); 12022 } 12023 var result2 = []; 12024 for (var key in Object2(object)) { 12025 if (hasOwnProperty2.call(object, key) && key != "constructor") { 12026 result2.push(key); 12027 } 12028 } 12029 return result2; 12030 } 12031 function baseKeysIn(object) { 12032 if (!isObject2(object)) { 12033 return nativeKeysIn(object); 12034 } 12035 var isProto = isPrototype(object), result2 = []; 12036 for (var key in object) { 12037 if (!(key == "constructor" && (isProto || !hasOwnProperty2.call(object, key)))) { 12038 result2.push(key); 12039 } 12040 } 12041 return result2; 12042 } 12043 function baseLt(value, other2) { 12044 return value < other2; 12045 } 12046 function baseMap(collection, iteratee2) { 12047 var index = -1, result2 = isArrayLike(collection) ? Array2(collection.length) : []; 12048 baseEach(collection, function(value, key, collection2) { 12049 result2[++index] = iteratee2(value, key, collection2); 12050 }); 12051 return result2; 12052 } 12053 function baseMatches(source) { 12054 var matchData = getMatchData(source); 12055 if (matchData.length == 1 && matchData[0][2]) { 12056 return matchesStrictComparable(matchData[0][0], matchData[0][1]); 12057 } 12058 return function(object) { 12059 return object === source || baseIsMatch(object, source, matchData); 12060 }; 12061 } 12062 function baseMatchesProperty(path, srcValue) { 12063 if (isKey(path) && isStrictComparable(srcValue)) { 12064 return matchesStrictComparable(toKey(path), srcValue); 12065 } 12066 return function(object) { 12067 var objValue = get(object, path); 12068 return objValue === undefined$1 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); 12069 }; 12070 } 12071 function baseMerge(object, source, srcIndex, customizer, stack2) { 12072 if (object === source) { 12073 return; 12074 } 12075 baseFor(source, function(srcValue, key) { 12076 stack2 || (stack2 = new Stack()); 12077 if (isObject2(srcValue)) { 12078 baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack2); 12079 } else { 12080 var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack2) : undefined$1; 12081 if (newValue === undefined$1) { 12082 newValue = srcValue; 12083 } 12084 assignMergeValue(object, key, newValue); 12085 } 12086 }, keysIn); 12087 } 12088 function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack2) { 12089 var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack2.get(srcValue); 12090 if (stacked) { 12091 assignMergeValue(object, key, stacked); 12092 return; 12093 } 12094 var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack2) : undefined$1; 12095 var isCommon = newValue === undefined$1; 12096 if (isCommon) { 12097 var isArr = isArray2(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); 12098 newValue = srcValue; 12099 if (isArr || isBuff || isTyped) { 12100 if (isArray2(objValue)) { 12101 newValue = objValue; 12102 } else if (isArrayLikeObject(objValue)) { 12103 newValue = copyArray(objValue); 12104 } else if (isBuff) { 12105 isCommon = false;
vendor: 5,018 bytes, lines 12106-12239
12106 newValue = cloneBuffer(srcValue, true); 12107 } else if (isTyped) { 12108 isCommon = false; 12109 newValue = cloneTypedArray(srcValue, true); 12110 } else { 12111 newValue = []; 12112 } 12113 } else if (isPlainObject2(srcValue) || isArguments(srcValue)) { 12114 newValue = objValue; 12115 if (isArguments(objValue)) { 12116 newValue = toPlainObject(objValue); 12117 } else if (!isObject2(objValue) || isFunction2(objValue)) { 12118 newValue = initCloneObject(srcValue); 12119 } 12120 } else { 12121 isCommon = false; 12122 } 12123 } 12124 if (isCommon) { 12125 stack2.set(srcValue, newValue); 12126 mergeFunc(newValue, srcValue, srcIndex, customizer, stack2); 12127 stack2["delete"](srcValue); 12128 } 12129 assignMergeValue(object, key, newValue); 12130 } 12131 function baseNth(array, n) { 12132 var length = array.length; 12133 if (!length) { 12134 return; 12135 } 12136 n += n < 0 ? length : 0; 12137 return isIndex(n, length) ? array[n] : undefined$1; 12138 } 12139 function baseOrderBy(collection, iteratees, orders) { 12140 if (iteratees.length) { 12141 iteratees = arrayMap(iteratees, function(iteratee2) { 12142 if (isArray2(iteratee2)) { 12143 return function(value) { 12144 return baseGet(value, iteratee2.length === 1 ? iteratee2[0] : iteratee2); 12145 }; 12146 } 12147 return iteratee2; 12148 }); 12149 } else { 12150 iteratees = [identity]; 12151 } 12152 var index = -1; 12153 iteratees = arrayMap(iteratees, baseUnary(getIteratee())); 12154 var result2 = baseMap(collection, function(value, key, collection2) { 12155 var criteria = arrayMap(iteratees, function(iteratee2) { 12156 return iteratee2(value); 12157 }); 12158 return { "criteria": criteria, "index": ++index, "value": value }; 12159 }); 12160 return baseSortBy(result2, function(object, other2) { 12161 return compareMultiple(object, other2, orders); 12162 }); 12163 } 12164 function basePick(object, paths) { 12165 return basePickBy(object, paths, function(value, path) { 12166 return hasIn(object, path); 12167 }); 12168 } 12169 function basePickBy(object, paths, predicate) { 12170 var index = -1, length = paths.length, result2 = {}; 12171 while (++index < length) { 12172 var path = paths[index], value = baseGet(object, path); 12173 if (predicate(value, path)) { 12174 baseSet(result2, castPath(path, object), value); 12175 } 12176 } 12177 return result2; 12178 } 12179 function basePropertyDeep(path) { 12180 return function(object) { 12181 return baseGet(object, path); 12182 }; 12183 } 12184 function basePullAll(array, values2, iteratee2, comparator) { 12185 var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values2.length, seen = array; 12186 if (array === values2) { 12187 values2 = copyArray(values2); 12188 } 12189 if (iteratee2) { 12190 seen = arrayMap(array, baseUnary(iteratee2)); 12191 } 12192 while (++index < length) { 12193 var fromIndex = 0, value = values2[index], computed2 = iteratee2 ? iteratee2(value) : value; 12194 while ((fromIndex = indexOf2(seen, computed2, fromIndex, comparator)) > -1) { 12195 if (seen !== array) { 12196 splice.call(seen, fromIndex, 1); 12197 } 12198 splice.call(array, fromIndex, 1); 12199 } 12200 } 12201 return array; 12202 } 12203 function basePullAt(array, indexes) { 12204 var length = array ? indexes.length : 0, lastIndex = length - 1; 12205 while (length--) { 12206 var index = indexes[length]; 12207 if (length == lastIndex || index !== previous) { 12208 var previous = index; 12209 if (isIndex(index)) { 12210 splice.call(array, index, 1); 12211 } else { 12212 baseUnset(array, index); 12213 } 12214 } 12215 } 12216 return array; 12217 } 12218 function baseRandom(lower, upper) { 12219 return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); 12220 } 12221 function baseRange(start, end, step, fromRight) { 12222 var index = -1, length = nativeMax(nativeCeil((end - start) / (step || 1)), 0), result2 = Array2(length); 12223 while (length--) { 12224 result2[fromRight ? length : ++index] = start; 12225 start += step; 12226 } 12227 return result2; 12228 } 12229 function baseRepeat(string, n) { 12230 var result2 = ""; 12231 if (!string || n < 1 || n > MAX_SAFE_INTEGER) { 12232 return result2; 12233 } 12234 do { 12235 if (n % 2) { 12236 result2 += string; 12237 } 12238 n = nativeFloor(n / 2); 12239 if (n) {
vendor: 136,589 bytes, lines 12240-15535
12240 string += string; 12241 } 12242 } while (n); 12243 return result2; 12244 } 12245 function baseRest(func, start) { 12246 return setToString(overRest(func, start, identity), func + ""); 12247 } 12248 function baseSample(collection) { 12249 return arraySample(values(collection)); 12250 } 12251 function baseSampleSize(collection, n) { 12252 var array = values(collection); 12253 return shuffleSelf(array, baseClamp(n, 0, array.length)); 12254 } 12255 function baseSet(object, path, value, customizer) { 12256 if (!isObject2(object)) { 12257 return object; 12258 } 12259 path = castPath(path, object); 12260 var index = -1, length = path.length, lastIndex = length - 1, nested = object; 12261 while (nested != null && ++index < length) { 12262 var key = toKey(path[index]), newValue = value; 12263 if (key === "__proto__" || key === "constructor" || key === "prototype") { 12264 return object; 12265 } 12266 if (index != lastIndex) { 12267 var objValue = nested[key]; 12268 newValue = customizer ? customizer(objValue, key, nested) : undefined$1; 12269 if (newValue === undefined$1) { 12270 newValue = isObject2(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {}; 12271 } 12272 } 12273 assignValue(nested, key, newValue); 12274 nested = nested[key]; 12275 } 12276 return object; 12277 } 12278 var baseSetData = !metaMap ? identity : function(func, data) { 12279 metaMap.set(func, data); 12280 return func; 12281 }; 12282 var baseSetToString = !defineProperty ? identity : function(func, string) { 12283 return defineProperty(func, "toString", { 12284 "configurable": true, 12285 "enumerable": false, 12286 "value": constant(string), 12287 "writable": true 12288 }); 12289 }; 12290 function baseShuffle(collection) { 12291 return shuffleSelf(values(collection)); 12292 } 12293 function baseSlice(array, start, end) { 12294 var index = -1, length = array.length; 12295 if (start < 0) { 12296 start = -start > length ? 0 : length + start; 12297 } 12298 end = end > length ? length : end; 12299 if (end < 0) { 12300 end += length; 12301 } 12302 length = start > end ? 0 : end - start >>> 0; 12303 start >>>= 0; 12304 var result2 = Array2(length); 12305 while (++index < length) { 12306 result2[index] = array[index + start]; 12307 } 12308 return result2; 12309 } 12310 function baseSome(collection, predicate) { 12311 var result2; 12312 baseEach(collection, function(value, index, collection2) { 12313 result2 = predicate(value, index, collection2); 12314 return !result2; 12315 }); 12316 return !!result2; 12317 } 12318 function baseSortedIndex(array, value, retHighest) { 12319 var low = 0, high = array == null ? low : array.length; 12320 if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) { 12321 while (low < high) { 12322 var mid = low + high >>> 1, computed2 = array[mid]; 12323 if (computed2 !== null && !isSymbol2(computed2) && (retHighest ? computed2 <= value : computed2 < value)) { 12324 low = mid + 1; 12325 } else { 12326 high = mid; 12327 } 12328 } 12329 return high; 12330 } 12331 return baseSortedIndexBy(array, value, identity, retHighest); 12332 } 12333 function baseSortedIndexBy(array, value, iteratee2, retHighest) { 12334 var low = 0, high = array == null ? 0 : array.length; 12335 if (high === 0) { 12336 return 0; 12337 } 12338 value = iteratee2(value); 12339 var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol2(value), valIsUndefined = value === undefined$1; 12340 while (low < high) { 12341 var mid = nativeFloor((low + high) / 2), computed2 = iteratee2(array[mid]), othIsDefined = computed2 !== undefined$1, othIsNull = computed2 === null, othIsReflexive = computed2 === computed2, othIsSymbol = isSymbol2(computed2); 12342 if (valIsNaN) { 12343 var setLow = retHighest || othIsReflexive; 12344 } else if (valIsUndefined) { 12345 setLow = othIsReflexive && (retHighest || othIsDefined); 12346 } else if (valIsNull) { 12347 setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); 12348 } else if (valIsSymbol) { 12349 setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); 12350 } else if (othIsNull || othIsSymbol) { 12351 setLow = false; 12352 } else { 12353 setLow = retHighest ? computed2 <= value : computed2 < value; 12354 } 12355 if (setLow) { 12356 low = mid + 1; 12357 } else { 12358 high = mid; 12359 } 12360 } 12361 return nativeMin(high, MAX_ARRAY_INDEX); 12362 } 12363 function baseSortedUniq(array, iteratee2) { 12364 var index = -1, length = array.length, resIndex = 0, result2 = []; 12365 while (++index < length) { 12366 var value = array[index], computed2 = iteratee2 ? iteratee2(value) : value; 12367 if (!index || !eq(computed2, seen)) { 12368 var seen = computed2; 12369 result2[resIndex++] = value === 0 ? 0 : value; 12370 } 12371 } 12372 return result2; 12373 } 12374 function baseToNumber(value) { 12375 if (typeof value == "number") { 12376 return value; 12377 } 12378 if (isSymbol2(value)) { 12379 return NAN; 12380 } 12381 return +value; 12382 } 12383 function baseToString(value) { 12384 if (typeof value == "string") { 12385 return value; 12386 } 12387 if (isArray2(value)) { 12388 return arrayMap(value, baseToString) + ""; 12389 } 12390 if (isSymbol2(value)) { 12391 return symbolToString ? symbolToString.call(value) : ""; 12392 } 12393 var result2 = value + ""; 12394 return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2; 12395 } 12396 function baseUniq(array, iteratee2, comparator) { 12397 var index = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2; 12398 if (comparator) { 12399 isCommon = false; 12400 includes2 = arrayIncludesWith; 12401 } else if (length >= LARGE_ARRAY_SIZE) { 12402 var set3 = iteratee2 ? null : createSet(array); 12403 if (set3) { 12404 return setToArray(set3); 12405 } 12406 isCommon = false; 12407 includes2 = cacheHas; 12408 seen = new SetCache(); 12409 } else { 12410 seen = iteratee2 ? [] : result2; 12411 } 12412 outer: 12413 while (++index < length) { 12414 var value = array[index], computed2 = iteratee2 ? iteratee2(value) : value; 12415 value = comparator || value !== 0 ? value : 0; 12416 if (isCommon && computed2 === computed2) { 12417 var seenIndex = seen.length; 12418 while (seenIndex--) { 12419 if (seen[seenIndex] === computed2) { 12420 continue outer; 12421 } 12422 } 12423 if (iteratee2) { 12424 seen.push(computed2); 12425 } 12426 result2.push(value); 12427 } else if (!includes2(seen, computed2, comparator)) { 12428 if (seen !== result2) { 12429 seen.push(computed2); 12430 } 12431 result2.push(value); 12432 } 12433 } 12434 return result2; 12435 } 12436 function baseUnset(object, path) { 12437 path = castPath(path, object); 12438 object = parent(object, path); 12439 return object == null || delete object[toKey(last(path))]; 12440 } 12441 function baseUpdate(object, path, updater, customizer) { 12442 return baseSet(object, path, updater(baseGet(object, path)), customizer); 12443 } 12444 function baseWhile(array, predicate, isDrop, fromRight) { 12445 var length = array.length, index = fromRight ? length : -1; 12446 while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) { 12447 } 12448 return isDrop ? baseSlice(array, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array, fromRight ? index + 1 : 0, fromRight ? length : index); 12449 } 12450 function baseWrapperValue(value, actions) { 12451 var result2 = value; 12452 if (result2 instanceof LazyWrapper) { 12453 result2 = result2.value(); 12454 } 12455 return arrayReduce(actions, function(result3, action) { 12456 return action.func.apply(action.thisArg, arrayPush([result3], action.args)); 12457 }, result2); 12458 } 12459 function baseXor(arrays, iteratee2, comparator) { 12460 var length = arrays.length; 12461 if (length < 2) { 12462 return length ? baseUniq(arrays[0]) : []; 12463 } 12464 var index = -1, result2 = Array2(length); 12465 while (++index < length) { 12466 var array = arrays[index], othIndex = -1; 12467 while (++othIndex < length) { 12468 if (othIndex != index) { 12469 result2[index] = baseDifference(result2[index] || array, arrays[othIndex], iteratee2, comparator); 12470 } 12471 } 12472 } 12473 return baseUniq(baseFlatten(result2, 1), iteratee2, comparator); 12474 } 12475 function baseZipObject(props, values2, assignFunc) { 12476 var index = -1, length = props.length, valsLength = values2.length, result2 = {}; 12477 while (++index < length) { 12478 var value = index < valsLength ? values2[index] : undefined$1; 12479 assignFunc(result2, props[index], value); 12480 } 12481 return result2; 12482 } 12483 function castArrayLikeObject(value) { 12484 return isArrayLikeObject(value) ? value : []; 12485 } 12486 function castFunction(value) { 12487 return typeof value == "function" ? value : identity; 12488 } 12489 function castPath(value, object) { 12490 if (isArray2(value)) { 12491 return value; 12492 } 12493 return isKey(value, object) ? [value] : stringToPath(toString2(value)); 12494 } 12495 var castRest = baseRest; 12496 function castSlice(array, start, end) { 12497 var length = array.length; 12498 end = end === undefined$1 ? length : end; 12499 return !start && end >= length ? array : baseSlice(array, start, end); 12500 } 12501 var clearTimeout2 = ctxClearTimeout || function(id) { 12502 return root.clearTimeout(id); 12503 }; 12504 function cloneBuffer(buffer2, isDeep) { 12505 if (isDeep) { 12506 return buffer2.slice(); 12507 } 12508 var length = buffer2.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer2.constructor(length); 12509 buffer2.copy(result2); 12510 return result2; 12511 } 12512 function cloneArrayBuffer(arrayBuffer) { 12513 var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength); 12514 new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer)); 12515 return result2; 12516 } 12517 function cloneDataView(dataView, isDeep) { 12518 var buffer2 = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; 12519 return new dataView.constructor(buffer2, dataView.byteOffset, dataView.byteLength); 12520 } 12521 function cloneRegExp(regexp) { 12522 var result2 = new regexp.constructor(regexp.source, reFlags.exec(regexp)); 12523 result2.lastIndex = regexp.lastIndex; 12524 return result2; 12525 } 12526 function cloneSymbol(symbol) { 12527 return symbolValueOf ? Object2(symbolValueOf.call(symbol)) : {}; 12528 } 12529 function cloneTypedArray(typedArray, isDeep) { 12530 var buffer2 = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; 12531 return new typedArray.constructor(buffer2, typedArray.byteOffset, typedArray.length); 12532 } 12533 function compareAscending(value, other2) { 12534 if (value !== other2) { 12535 var valIsDefined = value !== undefined$1, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol2(value); 12536 var othIsDefined = other2 !== undefined$1, othIsNull = other2 === null, othIsReflexive = other2 === other2, othIsSymbol = isSymbol2(other2); 12537 if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other2 || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) { 12538 return 1; 12539 } 12540 if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other2 || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) { 12541 return -1; 12542 } 12543 } 12544 return 0; 12545 } 12546 function compareMultiple(object, other2, orders) { 12547 var index = -1, objCriteria = object.criteria, othCriteria = other2.criteria, length = objCriteria.length, ordersLength = orders.length; 12548 while (++index < length) { 12549 var result2 = compareAscending(objCriteria[index], othCriteria[index]); 12550 if (result2) { 12551 if (index >= ordersLength) { 12552 return result2; 12553 } 12554 var order = orders[index]; 12555 return result2 * (order == "desc" ? -1 : 1); 12556 } 12557 } 12558 return object.index - other2.index; 12559 } 12560 function composeArgs(args, partials, holders, isCurried) { 12561 var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(leftLength + rangeLength), isUncurried = !isCurried; 12562 while (++leftIndex < leftLength) { 12563 result2[leftIndex] = partials[leftIndex]; 12564 } 12565 while (++argsIndex < holdersLength) { 12566 if (isUncurried || argsIndex < argsLength) { 12567 result2[holders[argsIndex]] = args[argsIndex]; 12568 } 12569 } 12570 while (rangeLength--) { 12571 result2[leftIndex++] = args[argsIndex++]; 12572 } 12573 return result2; 12574 } 12575 function composeArgsRight(args, partials, holders, isCurried) { 12576 var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(rangeLength + rightLength), isUncurried = !isCurried; 12577 while (++argsIndex < rangeLength) { 12578 result2[argsIndex] = args[argsIndex]; 12579 } 12580 var offset = argsIndex; 12581 while (++rightIndex < rightLength) { 12582 result2[offset + rightIndex] = partials[rightIndex]; 12583 } 12584 while (++holdersIndex < holdersLength) { 12585 if (isUncurried || argsIndex < argsLength) { 12586 result2[offset + holders[holdersIndex]] = args[argsIndex++]; 12587 } 12588 } 12589 return result2; 12590 } 12591 function copyArray(source, array) { 12592 var index = -1, length = source.length; 12593 array || (array = Array2(length)); 12594 while (++index < length) { 12595 array[index] = source[index]; 12596 } 12597 return array; 12598 } 12599 function copyObject(source, props, object, customizer) { 12600 var isNew = !object; 12601 object || (object = {}); 12602 var index = -1, length = props.length; 12603 while (++index < length) { 12604 var key = props[index]; 12605 var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined$1; 12606 if (newValue === undefined$1) { 12607 newValue = source[key]; 12608 } 12609 if (isNew) { 12610 baseAssignValue(object, key, newValue); 12611 } else { 12612 assignValue(object, key, newValue); 12613 } 12614 } 12615 return object; 12616 } 12617 function copySymbols(source, object) { 12618 return copyObject(source, getSymbols(source), object); 12619 } 12620 function copySymbolsIn(source, object) { 12621 return copyObject(source, getSymbolsIn(source), object); 12622 } 12623 function createAggregator(setter, initializer) { 12624 return function(collection, iteratee2) { 12625 var func = isArray2(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; 12626 return func(collection, setter, getIteratee(iteratee2, 2), accumulator); 12627 }; 12628 } 12629 function createAssigner(assigner) { 12630 return baseRest(function(object, sources) { 12631 var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined$1, guard = length > 2 ? sources[2] : undefined$1; 12632 customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined$1; 12633 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 12634 customizer = length < 3 ? undefined$1 : customizer; 12635 length = 1; 12636 } 12637 object = Object2(object); 12638 while (++index < length) { 12639 var source = sources[index]; 12640 if (source) { 12641 assigner(object, source, index, customizer); 12642 } 12643 } 12644 return object; 12645 }); 12646 } 12647 function createBaseEach(eachFunc, fromRight) { 12648 return function(collection, iteratee2) { 12649 if (collection == null) { 12650 return collection; 12651 } 12652 if (!isArrayLike(collection)) { 12653 return eachFunc(collection, iteratee2); 12654 } 12655 var length = collection.length, index = fromRight ? length : -1, iterable = Object2(collection); 12656 while (fromRight ? index-- : ++index < length) { 12657 if (iteratee2(iterable[index], index, iterable) === false) { 12658 break; 12659 } 12660 } 12661 return collection; 12662 }; 12663 } 12664 function createBaseFor(fromRight) { 12665 return function(object, iteratee2, keysFunc) { 12666 var index = -1, iterable = Object2(object), props = keysFunc(object), length = props.length; 12667 while (length--) { 12668 var key = props[fromRight ? length : ++index]; 12669 if (iteratee2(iterable[key], key, iterable) === false) { 12670 break; 12671 } 12672 } 12673 return object; 12674 }; 12675 } 12676 function createBind(func, bitmask, thisArg) { 12677 var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); 12678 function wrapper() { 12679 var fn = this && this !== root && this instanceof wrapper ? Ctor : func; 12680 return fn.apply(isBind ? thisArg : this, arguments); 12681 } 12682 return wrapper; 12683 } 12684 function createCaseFirst(methodName) { 12685 return function(string) { 12686 string = toString2(string); 12687 var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined$1; 12688 var chr = strSymbols ? strSymbols[0] : string.charAt(0); 12689 var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1); 12690 return chr[methodName]() + trailing; 12691 }; 12692 } 12693 function createCompounder(callback) { 12694 return function(string) { 12695 return arrayReduce(words(deburr(string).replace(reApos, "")), callback, ""); 12696 }; 12697 } 12698 function createCtor(Ctor) { 12699 return function() { 12700 var args = arguments; 12701 switch (args.length) { 12702 case 0: 12703 return new Ctor(); 12704 case 1: 12705 return new Ctor(args[0]); 12706 case 2: 12707 return new Ctor(args[0], args[1]); 12708 case 3: 12709 return new Ctor(args[0], args[1], args[2]); 12710 case 4: 12711 return new Ctor(args[0], args[1], args[2], args[3]); 12712 case 5: 12713 return new Ctor(args[0], args[1], args[2], args[3], args[4]); 12714 case 6: 12715 return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); 12716 case 7: 12717 return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); 12718 } 12719 var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args); 12720 return isObject2(result2) ? result2 : thisBinding; 12721 }; 12722 } 12723 function createCurry(func, bitmask, arity) { 12724 var Ctor = createCtor(func); 12725 function wrapper() { 12726 var length = arguments.length, args = Array2(length), index = length, placeholder = getHolder(wrapper); 12727 while (index--) { 12728 args[index] = arguments[index]; 12729 } 12730 var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder); 12731 length -= holders.length; 12732 if (length < arity) { 12733 return createRecurry( 12734 func, 12735 bitmask, 12736 createHybrid, 12737 wrapper.placeholder, 12738 undefined$1, 12739 args, 12740 holders, 12741 undefined$1, 12742 undefined$1, 12743 arity - length 12744 ); 12745 } 12746 var fn = this && this !== root && this instanceof wrapper ? Ctor : func; 12747 return apply2(fn, this, args); 12748 } 12749 return wrapper; 12750 } 12751 function createFind(findIndexFunc) { 12752 return function(collection, predicate, fromIndex) { 12753 var iterable = Object2(collection); 12754 if (!isArrayLike(collection)) { 12755 var iteratee2 = getIteratee(predicate, 3); 12756 collection = keys(collection); 12757 predicate = function(key) { 12758 return iteratee2(iterable[key], key, iterable); 12759 }; 12760 } 12761 var index = findIndexFunc(collection, predicate, fromIndex); 12762 return index > -1 ? iterable[iteratee2 ? collection[index] : index] : undefined$1; 12763 }; 12764 } 12765 function createFlow(fromRight) { 12766 return flatRest(function(funcs) { 12767 var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru; 12768 if (fromRight) { 12769 funcs.reverse(); 12770 } 12771 while (index--) { 12772 var func = funcs[index]; 12773 if (typeof func != "function") { 12774 throw new TypeError2(FUNC_ERROR_TEXT); 12775 } 12776 if (prereq && !wrapper && getFuncName(func) == "wrapper") { 12777 var wrapper = new LodashWrapper([], true); 12778 } 12779 } 12780 index = wrapper ? index : length; 12781 while (++index < length) { 12782 func = funcs[index]; 12783 var funcName = getFuncName(func), data = funcName == "wrapper" ? getData(func) : undefined$1; 12784 if (data && isLaziable(data[0]) && data[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data[4].length && data[9] == 1) { 12785 wrapper = wrapper[getFuncName(data[0])].apply(wrapper, data[3]); 12786 } else { 12787 wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func); 12788 } 12789 } 12790 return function() { 12791 var args = arguments, value = args[0]; 12792 if (wrapper && args.length == 1 && isArray2(value)) { 12793 return wrapper.plant(value).value(); 12794 } 12795 var index2 = 0, result2 = length ? funcs[index2].apply(this, args) : value; 12796 while (++index2 < length) { 12797 result2 = funcs[index2].call(this, result2); 12798 } 12799 return result2; 12800 }; 12801 }); 12802 } 12803 function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) { 12804 var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined$1 : createCtor(func); 12805 function wrapper() { 12806 var length = arguments.length, args = Array2(length), index = length; 12807 while (index--) { 12808 args[index] = arguments[index]; 12809 } 12810 if (isCurried) { 12811 var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder); 12812 } 12813 if (partials) { 12814 args = composeArgs(args, partials, holders, isCurried); 12815 } 12816 if (partialsRight) { 12817 args = composeArgsRight(args, partialsRight, holdersRight, isCurried); 12818 } 12819 length -= holdersCount; 12820 if (isCurried && length < arity) { 12821 var newHolders = replaceHolders(args, placeholder); 12822 return createRecurry( 12823 func, 12824 bitmask, 12825 createHybrid, 12826 wrapper.placeholder, 12827 thisArg, 12828 args, 12829 newHolders, 12830 argPos, 12831 ary2, 12832 arity - length 12833 ); 12834 } 12835 var thisBinding = isBind ? thisArg : this, fn = isBindKey ? thisBinding[func] : func; 12836 length = args.length; 12837 if (argPos) { 12838 args = reorder(args, argPos); 12839 } else if (isFlip && length > 1) { 12840 args.reverse(); 12841 } 12842 if (isAry && ary2 < length) { 12843 args.length = ary2; 12844 } 12845 if (this && this !== root && this instanceof wrapper) { 12846 fn = Ctor || createCtor(fn); 12847 } 12848 return fn.apply(thisBinding, args); 12849 } 12850 return wrapper; 12851 } 12852 function createInverter(setter, toIteratee) { 12853 return function(object, iteratee2) { 12854 return baseInverter(object, setter, toIteratee(iteratee2), {}); 12855 }; 12856 } 12857 function createMathOperation(operator, defaultValue) { 12858 return function(value, other2) { 12859 var result2; 12860 if (value === undefined$1 && other2 === undefined$1) { 12861 return defaultValue; 12862 } 12863 if (value !== undefined$1) { 12864 result2 = value; 12865 } 12866 if (other2 !== undefined$1) { 12867 if (result2 === undefined$1) { 12868 return other2; 12869 } 12870 if (typeof value == "string" || typeof other2 == "string") { 12871 value = baseToString(value); 12872 other2 = baseToString(other2); 12873 } else { 12874 value = baseToNumber(value); 12875 other2 = baseToNumber(other2); 12876 } 12877 result2 = operator(value, other2); 12878 } 12879 return result2; 12880 }; 12881 } 12882 function createOver(arrayFunc) { 12883 return flatRest(function(iteratees) { 12884 iteratees = arrayMap(iteratees, baseUnary(getIteratee())); 12885 return baseRest(function(args) { 12886 var thisArg = this; 12887 return arrayFunc(iteratees, function(iteratee2) { 12888 return apply2(iteratee2, thisArg, args); 12889 }); 12890 }); 12891 }); 12892 } 12893 function createPadding(length, chars) { 12894 chars = chars === undefined$1 ? " " : baseToString(chars); 12895 var charsLength = chars.length; 12896 if (charsLength < 2) { 12897 return charsLength ? baseRepeat(chars, length) : chars; 12898 } 12899 var result2 = baseRepeat(chars, nativeCeil(length / stringSize(chars))); 12900 return hasUnicode(chars) ? castSlice(stringToArray(result2), 0, length).join("") : result2.slice(0, length); 12901 } 12902 function createPartial(func, bitmask, thisArg, partials) { 12903 var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); 12904 function wrapper() { 12905 var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn = this && this !== root && this instanceof wrapper ? Ctor : func; 12906 while (++leftIndex < leftLength) { 12907 args[leftIndex] = partials[leftIndex]; 12908 } 12909 while (argsLength--) { 12910 args[leftIndex++] = arguments[++argsIndex]; 12911 } 12912 return apply2(fn, isBind ? thisArg : this, args); 12913 } 12914 return wrapper; 12915 } 12916 function createRange(fromRight) { 12917 return function(start, end, step) { 12918 if (step && typeof step != "number" && isIterateeCall(start, end, step)) { 12919 end = step = undefined$1; 12920 } 12921 start = toFinite(start); 12922 if (end === undefined$1) { 12923 end = start; 12924 start = 0; 12925 } else { 12926 end = toFinite(end); 12927 } 12928 step = step === undefined$1 ? start < end ? 1 : -1 : toFinite(step); 12929 return baseRange(start, end, step, fromRight); 12930 }; 12931 } 12932 function createRelationalOperation(operator) { 12933 return function(value, other2) { 12934 if (!(typeof value == "string" && typeof other2 == "string")) { 12935 value = toNumber(value); 12936 other2 = toNumber(other2); 12937 } 12938 return operator(value, other2); 12939 }; 12940 } 12941 function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) { 12942 var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined$1, newHoldersRight = isCurry ? undefined$1 : holders, newPartials = isCurry ? partials : undefined$1, newPartialsRight = isCurry ? undefined$1 : partials; 12943 bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG; 12944 bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); 12945 if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { 12946 bitmask &= -4; 12947 } 12948 var newData = [ 12949 func, 12950 bitmask, 12951 thisArg, 12952 newPartials, 12953 newHolders, 12954 newPartialsRight, 12955 newHoldersRight, 12956 argPos, 12957 ary2, 12958 arity 12959 ]; 12960 var result2 = wrapFunc.apply(undefined$1, newData); 12961 if (isLaziable(func)) { 12962 setData(result2, newData); 12963 } 12964 result2.placeholder = placeholder; 12965 return setWrapToString(result2, func, bitmask); 12966 } 12967 function createRound(methodName) { 12968 var func = Math2[methodName]; 12969 return function(number2, precision) { 12970 number2 = toNumber(number2); 12971 precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); 12972 if (precision && nativeIsFinite(number2)) { 12973 var pair = (toString2(number2) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision)); 12974 pair = (toString2(value) + "e").split("e"); 12975 return +(pair[0] + "e" + (+pair[1] - precision)); 12976 } 12977 return func(number2); 12978 }; 12979 } 12980 var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop2 : function(values2) { 12981 return new Set2(values2); 12982 }; 12983 function createToPairs(keysFunc) { 12984 return function(object) { 12985 var tag2 = getTag(object); 12986 if (tag2 == mapTag) { 12987 return mapToArray(object); 12988 } 12989 if (tag2 == setTag) { 12990 return setToPairs(object); 12991 } 12992 return baseToPairs(object, keysFunc(object)); 12993 }; 12994 } 12995 function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) { 12996 var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; 12997 if (!isBindKey && typeof func != "function") { 12998 throw new TypeError2(FUNC_ERROR_TEXT); 12999 } 13000 var length = partials ? partials.length : 0; 13001 if (!length) { 13002 bitmask &= -97; 13003 partials = holders = undefined$1; 13004 } 13005 ary2 = ary2 === undefined$1 ? ary2 : nativeMax(toInteger(ary2), 0); 13006 arity = arity === undefined$1 ? arity : toInteger(arity); 13007 length -= holders ? holders.length : 0; 13008 if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { 13009 var partialsRight = partials, holdersRight = holders; 13010 partials = holders = undefined$1; 13011 } 13012 var data = isBindKey ? undefined$1 : getData(func); 13013 var newData = [ 13014 func, 13015 bitmask, 13016 thisArg, 13017 partials, 13018 holders, 13019 partialsRight, 13020 holdersRight, 13021 argPos, 13022 ary2, 13023 arity 13024 ]; 13025 if (data) { 13026 mergeData(newData, data); 13027 } 13028 func = newData[0]; 13029 bitmask = newData[1]; 13030 thisArg = newData[2]; 13031 partials = newData[3]; 13032 holders = newData[4]; 13033 arity = newData[9] = newData[9] === undefined$1 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0); 13034 if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { 13035 bitmask &= -25; 13036 } 13037 if (!bitmask || bitmask == WRAP_BIND_FLAG) { 13038 var result2 = createBind(func, bitmask, thisArg); 13039 } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { 13040 result2 = createCurry(func, bitmask, arity); 13041 } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { 13042 result2 = createPartial(func, bitmask, thisArg, partials); 13043 } else { 13044 result2 = createHybrid.apply(undefined$1, newData); 13045 } 13046 var setter = data ? baseSetData : setData; 13047 return setWrapToString(setter(result2, newData), func, bitmask); 13048 } 13049 function customDefaultsAssignIn(objValue, srcValue, key, object) { 13050 if (objValue === undefined$1 || eq(objValue, objectProto[key]) && !hasOwnProperty2.call(object, key)) { 13051 return srcValue; 13052 } 13053 return objValue; 13054 } 13055 function customDefaultsMerge(objValue, srcValue, key, object, source, stack2) { 13056 if (isObject2(objValue) && isObject2(srcValue)) { 13057 stack2.set(srcValue, objValue); 13058 baseMerge(objValue, srcValue, undefined$1, customDefaultsMerge, stack2); 13059 stack2["delete"](srcValue); 13060 } 13061 return objValue; 13062 } 13063 function customOmitClone(value) { 13064 return isPlainObject2(value) ? undefined$1 : value; 13065 } 13066 function equalArrays(array, other2, bitmask, customizer, equalFunc, stack2) { 13067 var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other2.length; 13068 if (arrLength != othLength && !(isPartial && othLength > arrLength)) { 13069 return false; 13070 } 13071 var arrStacked = stack2.get(array); 13072 var othStacked = stack2.get(other2); 13073 if (arrStacked && othStacked) { 13074 return arrStacked == other2 && othStacked == array; 13075 } 13076 var index = -1, result2 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined$1; 13077 stack2.set(array, other2); 13078 stack2.set(other2, array); 13079 while (++index < arrLength) { 13080 var arrValue = array[index], othValue = other2[index]; 13081 if (customizer) { 13082 var compared = isPartial ? customizer(othValue, arrValue, index, other2, array, stack2) : customizer(arrValue, othValue, index, array, other2, stack2); 13083 } 13084 if (compared !== undefined$1) { 13085 if (compared) { 13086 continue; 13087 } 13088 result2 = false; 13089 break; 13090 } 13091 if (seen) { 13092 if (!arraySome(other2, function(othValue2, othIndex) { 13093 if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack2))) { 13094 return seen.push(othIndex); 13095 } 13096 })) { 13097 result2 = false; 13098 break; 13099 } 13100 } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack2))) { 13101 result2 = false; 13102 break; 13103 } 13104 } 13105 stack2["delete"](array); 13106 stack2["delete"](other2); 13107 return result2; 13108 } 13109 function equalByTag(object, other2, tag2, bitmask, customizer, equalFunc, stack2) { 13110 switch (tag2) { 13111 case dataViewTag: 13112 if (object.byteLength != other2.byteLength || object.byteOffset != other2.byteOffset) { 13113 return false; 13114 } 13115 object = object.buffer; 13116 other2 = other2.buffer; 13117 case arrayBufferTag: 13118 if (object.byteLength != other2.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other2))) { 13119 return false; 13120 } 13121 return true; 13122 case boolTag: 13123 case dateTag: 13124 case numberTag: 13125 return eq(+object, +other2); 13126 case errorTag: 13127 return object.name == other2.name && object.message == other2.message; 13128 case regexpTag: 13129 case stringTag: 13130 return object == other2 + ""; 13131 case mapTag: 13132 var convert = mapToArray; 13133 case setTag: 13134 var isPartial = bitmask & COMPARE_PARTIAL_FLAG; 13135 convert || (convert = setToArray); 13136 if (object.size != other2.size && !isPartial) { 13137 return false; 13138 } 13139 var stacked = stack2.get(object); 13140 if (stacked) { 13141 return stacked == other2; 13142 } 13143 bitmask |= COMPARE_UNORDERED_FLAG; 13144 stack2.set(object, other2); 13145 var result2 = equalArrays(convert(object), convert(other2), bitmask, customizer, equalFunc, stack2); 13146 stack2["delete"](object); 13147 return result2; 13148 case symbolTag: 13149 if (symbolValueOf) { 13150 return symbolValueOf.call(object) == symbolValueOf.call(other2); 13151 } 13152 } 13153 return false; 13154 } 13155 function equalObjects(object, other2, bitmask, customizer, equalFunc, stack2) { 13156 var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other2), othLength = othProps.length; 13157 if (objLength != othLength && !isPartial) { 13158 return false; 13159 } 13160 var index = objLength; 13161 while (index--) { 13162 var key = objProps[index]; 13163 if (!(isPartial ? key in other2 : hasOwnProperty2.call(other2, key))) { 13164 return false; 13165 } 13166 } 13167 var objStacked = stack2.get(object); 13168 var othStacked = stack2.get(other2); 13169 if (objStacked && othStacked) { 13170 return objStacked == other2 && othStacked == object; 13171 } 13172 var result2 = true; 13173 stack2.set(object, other2); 13174 stack2.set(other2, object); 13175 var skipCtor = isPartial; 13176 while (++index < objLength) { 13177 key = objProps[index]; 13178 var objValue = object[key], othValue = other2[key]; 13179 if (customizer) { 13180 var compared = isPartial ? customizer(othValue, objValue, key, other2, object, stack2) : customizer(objValue, othValue, key, object, other2, stack2); 13181 } 13182 if (!(compared === undefined$1 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack2) : compared)) { 13183 result2 = false; 13184 break; 13185 } 13186 skipCtor || (skipCtor = key == "constructor"); 13187 } 13188 if (result2 && !skipCtor) { 13189 var objCtor = object.constructor, othCtor = other2.constructor; 13190 if (objCtor != othCtor && ("constructor" in object && "constructor" in other2) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { 13191 result2 = false; 13192 } 13193 } 13194 stack2["delete"](object); 13195 stack2["delete"](other2); 13196 return result2; 13197 } 13198 function flatRest(func) { 13199 return setToString(overRest(func, undefined$1, flatten), func + ""); 13200 } 13201 function getAllKeys(object) { 13202 return baseGetAllKeys(object, keys, getSymbols); 13203 } 13204 function getAllKeysIn(object) { 13205 return baseGetAllKeys(object, keysIn, getSymbolsIn); 13206 } 13207 var getData = !metaMap ? noop2 : function(func) { 13208 return metaMap.get(func); 13209 }; 13210 function getFuncName(func) { 13211 var result2 = func.name + "", array = realNames[result2], length = hasOwnProperty2.call(realNames, result2) ? array.length : 0; 13212 while (length--) { 13213 var data = array[length], otherFunc = data.func; 13214 if (otherFunc == null || otherFunc == func) { 13215 return data.name; 13216 } 13217 } 13218 return result2; 13219 } 13220 function getHolder(func) { 13221 var object = hasOwnProperty2.call(lodash2, "placeholder") ? lodash2 : func; 13222 return object.placeholder; 13223 } 13224 function getIteratee() { 13225 var result2 = lodash2.iteratee || iteratee; 13226 result2 = result2 === iteratee ? baseIteratee : result2; 13227 return arguments.length ? result2(arguments[0], arguments[1]) : result2; 13228 } 13229 function getMapData(map3, key) { 13230 var data = map3.__data__; 13231 return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; 13232 } 13233 function getMatchData(object) { 13234 var result2 = keys(object), length = result2.length; 13235 while (length--) { 13236 var key = result2[length], value = object[key]; 13237 result2[length] = [key, value, isStrictComparable(value)]; 13238 } 13239 return result2; 13240 } 13241 function getNative(object, key) { 13242 var value = getValue2(object, key); 13243 return baseIsNative(value) ? value : undefined$1; 13244 } 13245 function getRawTag(value) { 13246 var isOwn = hasOwnProperty2.call(value, symToStringTag), tag2 = value[symToStringTag]; 13247 try { 13248 value[symToStringTag] = undefined$1; 13249 var unmasked = true; 13250 } catch (e) { 13251 } 13252 var result2 = nativeObjectToString.call(value); 13253 if (unmasked) { 13254 if (isOwn) { 13255 value[symToStringTag] = tag2; 13256 } else { 13257 delete value[symToStringTag]; 13258 } 13259 } 13260 return result2; 13261 } 13262 var getSymbols = !nativeGetSymbols ? stubArray : function(object) { 13263 if (object == null) { 13264 return []; 13265 } 13266 object = Object2(object); 13267 return arrayFilter(nativeGetSymbols(object), function(symbol) { 13268 return propertyIsEnumerable.call(object, symbol); 13269 }); 13270 }; 13271 var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { 13272 var result2 = []; 13273 while (object) { 13274 arrayPush(result2, getSymbols(object)); 13275 object = getPrototype(object); 13276 } 13277 return result2; 13278 }; 13279 var getTag = baseGetTag; 13280 if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) { 13281 getTag = function(value) { 13282 var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined$1, ctorString = Ctor ? toSource(Ctor) : ""; 13283 if (ctorString) { 13284 switch (ctorString) { 13285 case dataViewCtorString: 13286 return dataViewTag; 13287 case mapCtorString: 13288 return mapTag; 13289 case promiseCtorString: 13290 return promiseTag; 13291 case setCtorString: 13292 return setTag; 13293 case weakMapCtorString: 13294 return weakMapTag; 13295 } 13296 } 13297 return result2; 13298 }; 13299 } 13300 function getView(start, end, transforms) { 13301 var index = -1, length = transforms.length; 13302 while (++index < length) { 13303 var data = transforms[index], size2 = data.size; 13304 switch (data.type) { 13305 case "drop": 13306 start += size2; 13307 break; 13308 case "dropRight": 13309 end -= size2; 13310 break; 13311 case "take": 13312 end = nativeMin(end, start + size2); 13313 break; 13314 case "takeRight": 13315 start = nativeMax(start, end - size2); 13316 break; 13317 } 13318 } 13319 return { "start": start, "end": end }; 13320 } 13321 function getWrapDetails(source) { 13322 var match = source.match(reWrapDetails); 13323 return match ? match[1].split(reSplitDetails) : []; 13324 } 13325 function hasPath(object, path, hasFunc) { 13326 path = castPath(path, object); 13327 var index = -1, length = path.length, result2 = false; 13328 while (++index < length) { 13329 var key = toKey(path[index]); 13330 if (!(result2 = object != null && hasFunc(object, key))) { 13331 break; 13332 } 13333 object = object[key]; 13334 } 13335 if (result2 || ++index != length) { 13336 return result2; 13337 } 13338 length = object == null ? 0 : object.length; 13339 return !!length && isLength(length) && isIndex(key, length) && (isArray2(object) || isArguments(object)); 13340 } 13341 function initCloneArray(array) { 13342 var length = array.length, result2 = new array.constructor(length); 13343 if (length && typeof array[0] == "string" && hasOwnProperty2.call(array, "index")) { 13344 result2.index = array.index; 13345 result2.input = array.input; 13346 } 13347 return result2; 13348 } 13349 function initCloneObject(object) { 13350 return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {}; 13351 } 13352 function initCloneByTag(object, tag2, isDeep) { 13353 var Ctor = object.constructor; 13354 switch (tag2) { 13355 case arrayBufferTag: 13356 return cloneArrayBuffer(object); 13357 case boolTag: 13358 case dateTag: 13359 return new Ctor(+object); 13360 case dataViewTag: 13361 return cloneDataView(object, isDeep); 13362 case float32Tag: 13363 case float64Tag: 13364 case int8Tag: 13365 case int16Tag: 13366 case int32Tag: 13367 case uint8Tag: 13368 case uint8ClampedTag: 13369 case uint16Tag: 13370 case uint32Tag: 13371 return cloneTypedArray(object, isDeep); 13372 case mapTag: 13373 return new Ctor(); 13374 case numberTag: 13375 case stringTag: 13376 return new Ctor(object); 13377 case regexpTag: 13378 return cloneRegExp(object); 13379 case setTag: 13380 return new Ctor(); 13381 case symbolTag: 13382 return cloneSymbol(object); 13383 } 13384 } 13385 function insertWrapDetails(source, details) { 13386 var length = details.length; 13387 if (!length) { 13388 return source; 13389 } 13390 var lastIndex = length - 1; 13391 details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex]; 13392 details = details.join(length > 2 ? ", " : " "); 13393 return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n"); 13394 } 13395 function isFlattenable(value) { 13396 return isArray2(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); 13397 } 13398 function isIndex(value, length) { 13399 var type = typeof value; 13400 length = length == null ? MAX_SAFE_INTEGER : length; 13401 return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); 13402 } 13403 function isIterateeCall(value, index, object) { 13404 if (!isObject2(object)) { 13405 return false; 13406 } 13407 var type = typeof index; 13408 if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) { 13409 return eq(object[index], value); 13410 } 13411 return false; 13412 } 13413 function isKey(value, object) { 13414 if (isArray2(value)) { 13415 return false; 13416 } 13417 var type = typeof value; 13418 if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol2(value)) { 13419 return true; 13420 } 13421 return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object2(object); 13422 } 13423 function isKeyable(value) { 13424 var type = typeof value; 13425 return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; 13426 } 13427 function isLaziable(func) { 13428 var funcName = getFuncName(func), other2 = lodash2[funcName]; 13429 if (typeof other2 != "function" || !(funcName in LazyWrapper.prototype)) { 13430 return false; 13431 } 13432 if (func === other2) { 13433 return true; 13434 } 13435 var data = getData(other2); 13436 return !!data && func === data[0]; 13437 } 13438 function isMasked(func) { 13439 return !!maskSrcKey && maskSrcKey in func; 13440 } 13441 var isMaskable = coreJsData ? isFunction2 : stubFalse; 13442 function isPrototype(value) { 13443 var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; 13444 return value === proto; 13445 } 13446 function isStrictComparable(value) { 13447 return value === value && !isObject2(value); 13448 } 13449 function matchesStrictComparable(key, srcValue) { 13450 return function(object) { 13451 if (object == null) { 13452 return false; 13453 } 13454 return object[key] === srcValue && (srcValue !== undefined$1 || key in Object2(object)); 13455 }; 13456 } 13457 function memoizeCapped(func) { 13458 var result2 = memoize(func, function(key) { 13459 if (cache2.size === MAX_MEMOIZE_SIZE) { 13460 cache2.clear(); 13461 } 13462 return key; 13463 }); 13464 var cache2 = result2.cache; 13465 return result2; 13466 } 13467 function mergeData(data, source) { 13468 var bitmask = data[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); 13469 var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG; 13470 if (!(isCommon || isCombo)) { 13471 return data; 13472 } 13473 if (srcBitmask & WRAP_BIND_FLAG) { 13474 data[2] = source[2]; 13475 newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; 13476 } 13477 var value = source[3]; 13478 if (value) { 13479 var partials = data[3]; 13480 data[3] = partials ? composeArgs(partials, value, source[4]) : value; 13481 data[4] = partials ? replaceHolders(data[3], PLACEHOLDER) : source[4]; 13482 } 13483 value = source[5]; 13484 if (value) { 13485 partials = data[5]; 13486 data[5] = partials ? composeArgsRight(partials, value, source[6]) : value; 13487 data[6] = partials ? replaceHolders(data[5], PLACEHOLDER) : source[6]; 13488 } 13489 value = source[7]; 13490 if (value) { 13491 data[7] = value; 13492 } 13493 if (srcBitmask & WRAP_ARY_FLAG) { 13494 data[8] = data[8] == null ? source[8] : nativeMin(data[8], source[8]); 13495 } 13496 if (data[9] == null) { 13497 data[9] = source[9]; 13498 } 13499 data[0] = source[0]; 13500 data[1] = newBitmask; 13501 return data; 13502 } 13503 function nativeKeysIn(object) { 13504 var result2 = []; 13505 if (object != null) { 13506 for (var key in Object2(object)) { 13507 result2.push(key); 13508 } 13509 } 13510 return result2; 13511 } 13512 function objectToString2(value) { 13513 return nativeObjectToString.call(value); 13514 } 13515 function overRest(func, start, transform3) { 13516 start = nativeMax(start === undefined$1 ? func.length - 1 : start, 0); 13517 return function() { 13518 var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array2(length); 13519 while (++index < length) { 13520 array[index] = args[start + index]; 13521 } 13522 index = -1; 13523 var otherArgs = Array2(start + 1); 13524 while (++index < start) { 13525 otherArgs[index] = args[index]; 13526 } 13527 otherArgs[start] = transform3(array); 13528 return apply2(func, this, otherArgs); 13529 }; 13530 } 13531 function parent(object, path) { 13532 return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); 13533 } 13534 function reorder(array, indexes) { 13535 var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array); 13536 while (length--) { 13537 var index = indexes[length]; 13538 array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined$1; 13539 } 13540 return array; 13541 } 13542 function safeGet(object, key) { 13543 if (key === "constructor" && typeof object[key] === "function") { 13544 return; 13545 } 13546 if (key == "__proto__") { 13547 return; 13548 } 13549 return object[key]; 13550 } 13551 var setData = shortOut(baseSetData); 13552 var setTimeout2 = ctxSetTimeout || function(func, wait) { 13553 return root.setTimeout(func, wait); 13554 }; 13555 var setToString = shortOut(baseSetToString); 13556 function setWrapToString(wrapper, reference, bitmask) { 13557 var source = reference + ""; 13558 return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); 13559 } 13560 function shortOut(func) { 13561 var count = 0, lastCalled = 0; 13562 return function() { 13563 var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); 13564 lastCalled = stamp; 13565 if (remaining > 0) { 13566 if (++count >= HOT_COUNT) { 13567 return arguments[0]; 13568 } 13569 } else { 13570 count = 0; 13571 } 13572 return func.apply(undefined$1, arguments); 13573 }; 13574 } 13575 function shuffleSelf(array, size2) { 13576 var index = -1, length = array.length, lastIndex = length - 1; 13577 size2 = size2 === undefined$1 ? length : size2; 13578 while (++index < size2) { 13579 var rand = baseRandom(index, lastIndex), value = array[rand]; 13580 array[rand] = array[index]; 13581 array[index] = value; 13582 } 13583 array.length = size2; 13584 return array; 13585 } 13586 var stringToPath = memoizeCapped(function(string) { 13587 var result2 = []; 13588 if (string.charCodeAt(0) === 46) { 13589 result2.push(""); 13590 } 13591 string.replace(rePropName, function(match, number2, quote, subString) { 13592 result2.push(quote ? subString.replace(reEscapeChar, "$1") : number2 || match); 13593 }); 13594 return result2; 13595 }); 13596 function toKey(value) { 13597 if (typeof value == "string" || isSymbol2(value)) { 13598 return value; 13599 } 13600 var result2 = value + ""; 13601 return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2; 13602 } 13603 function toSource(func) { 13604 if (func != null) { 13605 try { 13606 return funcToString.call(func); 13607 } catch (e) { 13608 } 13609 try { 13610 return func + ""; 13611 } catch (e) { 13612 } 13613 } 13614 return ""; 13615 } 13616 function updateWrapDetails(details, bitmask) { 13617 arrayEach(wrapFlags, function(pair) { 13618 var value = "_." + pair[0]; 13619 if (bitmask & pair[1] && !arrayIncludes(details, value)) { 13620 details.push(value); 13621 } 13622 }); 13623 return details.sort(); 13624 } 13625 function wrapperClone(wrapper) { 13626 if (wrapper instanceof LazyWrapper) { 13627 return wrapper.clone(); 13628 } 13629 var result2 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); 13630 result2.__actions__ = copyArray(wrapper.__actions__); 13631 result2.__index__ = wrapper.__index__; 13632 result2.__values__ = wrapper.__values__; 13633 return result2; 13634 } 13635 function chunk(array, size2, guard) { 13636 if (guard ? isIterateeCall(array, size2, guard) : size2 === undefined$1) { 13637 size2 = 1; 13638 } else { 13639 size2 = nativeMax(toInteger(size2), 0); 13640 } 13641 var length = array == null ? 0 : array.length; 13642 if (!length || size2 < 1) { 13643 return []; 13644 } 13645 var index = 0, resIndex = 0, result2 = Array2(nativeCeil(length / size2)); 13646 while (index < length) { 13647 result2[resIndex++] = baseSlice(array, index, index += size2); 13648 } 13649 return result2; 13650 } 13651 function compact(array) { 13652 var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = []; 13653 while (++index < length) { 13654 var value = array[index]; 13655 if (value) { 13656 result2[resIndex++] = value; 13657 } 13658 } 13659 return result2; 13660 } 13661 function concat() { 13662 var length = arguments.length; 13663 if (!length) { 13664 return []; 13665 } 13666 var args = Array2(length - 1), array = arguments[0], index = length; 13667 while (index--) { 13668 args[index - 1] = arguments[index]; 13669 } 13670 return arrayPush(isArray2(array) ? copyArray(array) : [array], baseFlatten(args, 1)); 13671 } 13672 var difference = baseRest(function(array, values2) { 13673 return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true)) : []; 13674 }); 13675 var differenceBy = baseRest(function(array, values2) { 13676 var iteratee2 = last(values2); 13677 if (isArrayLikeObject(iteratee2)) { 13678 iteratee2 = undefined$1; 13679 } 13680 return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : []; 13681 }); 13682 var differenceWith = baseRest(function(array, values2) { 13683 var comparator = last(values2); 13684 if (isArrayLikeObject(comparator)) { 13685 comparator = undefined$1; 13686 } 13687 return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), undefined$1, comparator) : []; 13688 }); 13689 function drop(array, n, guard) { 13690 var length = array == null ? 0 : array.length; 13691 if (!length) { 13692 return []; 13693 } 13694 n = guard || n === undefined$1 ? 1 : toInteger(n); 13695 return baseSlice(array, n < 0 ? 0 : n, length); 13696 } 13697 function dropRight(array, n, guard) { 13698 var length = array == null ? 0 : array.length; 13699 if (!length) { 13700 return []; 13701 } 13702 n = guard || n === undefined$1 ? 1 : toInteger(n); 13703 n = length - n; 13704 return baseSlice(array, 0, n < 0 ? 0 : n); 13705 } 13706 function dropRightWhile(array, predicate) { 13707 return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : []; 13708 } 13709 function dropWhile(array, predicate) { 13710 return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : []; 13711 } 13712 function fill(array, value, start, end) { 13713 var length = array == null ? 0 : array.length; 13714 if (!length) { 13715 return []; 13716 } 13717 if (start && typeof start != "number" && isIterateeCall(array, value, start)) { 13718 start = 0; 13719 end = length; 13720 } 13721 return baseFill(array, value, start, end); 13722 } 13723 function findIndex(array, predicate, fromIndex) { 13724 var length = array == null ? 0 : array.length; 13725 if (!length) { 13726 return -1; 13727 } 13728 var index = fromIndex == null ? 0 : toInteger(fromIndex); 13729 if (index < 0) { 13730 index = nativeMax(length + index, 0); 13731 } 13732 return baseFindIndex(array, getIteratee(predicate, 3), index); 13733 } 13734 function findLastIndex(array, predicate, fromIndex) { 13735 var length = array == null ? 0 : array.length; 13736 if (!length) { 13737 return -1; 13738 } 13739 var index = length - 1; 13740 if (fromIndex !== undefined$1) { 13741 index = toInteger(fromIndex); 13742 index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); 13743 } 13744 return baseFindIndex(array, getIteratee(predicate, 3), index, true); 13745 } 13746 function flatten(array) { 13747 var length = array == null ? 0 : array.length; 13748 return length ? baseFlatten(array, 1) : []; 13749 } 13750 function flattenDeep(array) { 13751 var length = array == null ? 0 : array.length; 13752 return length ? baseFlatten(array, INFINITY) : []; 13753 } 13754 function flattenDepth(array, depth) { 13755 var length = array == null ? 0 : array.length; 13756 if (!length) { 13757 return []; 13758 } 13759 depth = depth === undefined$1 ? 1 : toInteger(depth); 13760 return baseFlatten(array, depth); 13761 } 13762 function fromPairs(pairs) { 13763 var index = -1, length = pairs == null ? 0 : pairs.length, result2 = {}; 13764 while (++index < length) { 13765 var pair = pairs[index]; 13766 result2[pair[0]] = pair[1]; 13767 } 13768 return result2; 13769 } 13770 function head(array) { 13771 return array && array.length ? array[0] : undefined$1; 13772 } 13773 function indexOf(array, value, fromIndex) { 13774 var length = array == null ? 0 : array.length; 13775 if (!length) { 13776 return -1; 13777 } 13778 var index = fromIndex == null ? 0 : toInteger(fromIndex); 13779 if (index < 0) { 13780 index = nativeMax(length + index, 0); 13781 } 13782 return baseIndexOf(array, value, index); 13783 } 13784 function initial(array) { 13785 var length = array == null ? 0 : array.length; 13786 return length ? baseSlice(array, 0, -1) : []; 13787 } 13788 var intersection = baseRest(function(arrays) { 13789 var mapped = arrayMap(arrays, castArrayLikeObject); 13790 return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : []; 13791 }); 13792 var intersectionBy = baseRest(function(arrays) { 13793 var iteratee2 = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); 13794 if (iteratee2 === last(mapped)) { 13795 iteratee2 = undefined$1; 13796 } else { 13797 mapped.pop(); 13798 } 13799 return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : []; 13800 }); 13801 var intersectionWith = baseRest(function(arrays) { 13802 var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); 13803 comparator = typeof comparator == "function" ? comparator : undefined$1; 13804 if (comparator) { 13805 mapped.pop(); 13806 } 13807 return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined$1, comparator) : []; 13808 }); 13809 function join2(array, separator) { 13810 return array == null ? "" : nativeJoin.call(array, separator); 13811 } 13812 function last(array) { 13813 var length = array == null ? 0 : array.length; 13814 return length ? array[length - 1] : undefined$1; 13815 } 13816 function lastIndexOf(array, value, fromIndex) { 13817 var length = array == null ? 0 : array.length; 13818 if (!length) { 13819 return -1; 13820 } 13821 var index = length; 13822 if (fromIndex !== undefined$1) { 13823 index = toInteger(fromIndex); 13824 index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); 13825 } 13826 return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true); 13827 } 13828 function nth(array, n) { 13829 return array && array.length ? baseNth(array, toInteger(n)) : undefined$1; 13830 } 13831 var pull = baseRest(pullAll); 13832 function pullAll(array, values2) { 13833 return array && array.length && values2 && values2.length ? basePullAll(array, values2) : array; 13834 } 13835 function pullAllBy(array, values2, iteratee2) { 13836 return array && array.length && values2 && values2.length ? basePullAll(array, values2, getIteratee(iteratee2, 2)) : array; 13837 } 13838 function pullAllWith(array, values2, comparator) { 13839 return array && array.length && values2 && values2.length ? basePullAll(array, values2, undefined$1, comparator) : array; 13840 } 13841 var pullAt = flatRest(function(array, indexes) { 13842 var length = array == null ? 0 : array.length, result2 = baseAt(array, indexes); 13843 basePullAt(array, arrayMap(indexes, function(index) { 13844 return isIndex(index, length) ? +index : index; 13845 }).sort(compareAscending)); 13846 return result2; 13847 }); 13848 function remove2(array, predicate) { 13849 var result2 = []; 13850 if (!(array && array.length)) { 13851 return result2; 13852 } 13853 var index = -1, indexes = [], length = array.length; 13854 predicate = getIteratee(predicate, 3); 13855 while (++index < length) { 13856 var value = array[index]; 13857 if (predicate(value, index, array)) { 13858 result2.push(value); 13859 indexes.push(index); 13860 } 13861 } 13862 basePullAt(array, indexes); 13863 return result2; 13864 } 13865 function reverse(array) { 13866 return array == null ? array : nativeReverse.call(array); 13867 } 13868 function slice(array, start, end) { 13869 var length = array == null ? 0 : array.length; 13870 if (!length) { 13871 return []; 13872 } 13873 if (end && typeof end != "number" && isIterateeCall(array, start, end)) { 13874 start = 0; 13875 end = length; 13876 } else { 13877 start = start == null ? 0 : toInteger(start); 13878 end = end === undefined$1 ? length : toInteger(end); 13879 } 13880 return baseSlice(array, start, end); 13881 } 13882 function sortedIndex(array, value) { 13883 return baseSortedIndex(array, value); 13884 } 13885 function sortedIndexBy(array, value, iteratee2) { 13886 return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2)); 13887 } 13888 function sortedIndexOf(array, value) { 13889 var length = array == null ? 0 : array.length; 13890 if (length) { 13891 var index = baseSortedIndex(array, value); 13892 if (index < length && eq(array[index], value)) { 13893 return index; 13894 } 13895 } 13896 return -1; 13897 } 13898 function sortedLastIndex(array, value) { 13899 return baseSortedIndex(array, value, true); 13900 } 13901 function sortedLastIndexBy(array, value, iteratee2) { 13902 return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2), true); 13903 } 13904 function sortedLastIndexOf(array, value) { 13905 var length = array == null ? 0 : array.length; 13906 if (length) { 13907 var index = baseSortedIndex(array, value, true) - 1; 13908 if (eq(array[index], value)) { 13909 return index; 13910 } 13911 } 13912 return -1; 13913 } 13914 function sortedUniq(array) { 13915 return array && array.length ? baseSortedUniq(array) : []; 13916 } 13917 function sortedUniqBy(array, iteratee2) { 13918 return array && array.length ? baseSortedUniq(array, getIteratee(iteratee2, 2)) : []; 13919 } 13920 function tail(array) { 13921 var length = array == null ? 0 : array.length; 13922 return length ? baseSlice(array, 1, length) : []; 13923 } 13924 function take(array, n, guard) { 13925 if (!(array && array.length)) { 13926 return []; 13927 } 13928 n = guard || n === undefined$1 ? 1 : toInteger(n); 13929 return baseSlice(array, 0, n < 0 ? 0 : n); 13930 } 13931 function takeRight(array, n, guard) { 13932 var length = array == null ? 0 : array.length; 13933 if (!length) { 13934 return []; 13935 } 13936 n = guard || n === undefined$1 ? 1 : toInteger(n); 13937 n = length - n; 13938 return baseSlice(array, n < 0 ? 0 : n, length); 13939 } 13940 function takeRightWhile(array, predicate) { 13941 return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : []; 13942 } 13943 function takeWhile(array, predicate) { 13944 return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : []; 13945 } 13946 var union = baseRest(function(arrays) { 13947 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); 13948 }); 13949 var unionBy = baseRest(function(arrays) { 13950 var iteratee2 = last(arrays); 13951 if (isArrayLikeObject(iteratee2)) { 13952 iteratee2 = undefined$1; 13953 } 13954 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)); 13955 }); 13956 var unionWith = baseRest(function(arrays) { 13957 var comparator = last(arrays); 13958 comparator = typeof comparator == "function" ? comparator : undefined$1; 13959 return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined$1, comparator); 13960 }); 13961 function uniq(array) { 13962 return array && array.length ? baseUniq(array) : []; 13963 } 13964 function uniqBy(array, iteratee2) { 13965 return array && array.length ? baseUniq(array, getIteratee(iteratee2, 2)) : []; 13966 } 13967 function uniqWith(array, comparator) { 13968 comparator = typeof comparator == "function" ? comparator : undefined$1; 13969 return array && array.length ? baseUniq(array, undefined$1, comparator) : []; 13970 } 13971 function unzip(array) { 13972 if (!(array && array.length)) { 13973 return []; 13974 } 13975 var length = 0; 13976 array = arrayFilter(array, function(group) { 13977 if (isArrayLikeObject(group)) { 13978 length = nativeMax(group.length, length); 13979 return true; 13980 } 13981 }); 13982 return baseTimes(length, function(index) { 13983 return arrayMap(array, baseProperty(index)); 13984 }); 13985 } 13986 function unzipWith(array, iteratee2) { 13987 if (!(array && array.length)) { 13988 return []; 13989 } 13990 var result2 = unzip(array); 13991 if (iteratee2 == null) { 13992 return result2; 13993 } 13994 return arrayMap(result2, function(group) { 13995 return apply2(iteratee2, undefined$1, group); 13996 }); 13997 } 13998 var without = baseRest(function(array, values2) { 13999 return isArrayLikeObject(array) ? baseDifference(array, values2) : []; 14000 }); 14001 var xor = baseRest(function(arrays) { 14002 return baseXor(arrayFilter(arrays, isArrayLikeObject)); 14003 }); 14004 var xorBy = baseRest(function(arrays) { 14005 var iteratee2 = last(arrays); 14006 if (isArrayLikeObject(iteratee2)) { 14007 iteratee2 = undefined$1; 14008 } 14009 return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2)); 14010 }); 14011 var xorWith = baseRest(function(arrays) { 14012 var comparator = last(arrays); 14013 comparator = typeof comparator == "function" ? comparator : undefined$1; 14014 return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined$1, comparator); 14015 }); 14016 var zip = baseRest(unzip); 14017 function zipObject(props, values2) { 14018 return baseZipObject(props || [], values2 || [], assignValue); 14019 } 14020 function zipObjectDeep(props, values2) { 14021 return baseZipObject(props || [], values2 || [], baseSet); 14022 } 14023 var zipWith = baseRest(function(arrays) { 14024 var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined$1; 14025 iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined$1; 14026 return unzipWith(arrays, iteratee2); 14027 }); 14028 function chain(value) { 14029 var result2 = lodash2(value); 14030 result2.__chain__ = true; 14031 return result2; 14032 } 14033 function tap(value, interceptor) { 14034 interceptor(value); 14035 return value; 14036 } 14037 function thru(value, interceptor) { 14038 return interceptor(value); 14039 } 14040 var wrapperAt = flatRest(function(paths) { 14041 var length = paths.length, start = length ? paths[0] : 0, value = this.__wrapped__, interceptor = function(object) { 14042 return baseAt(object, paths); 14043 }; 14044 if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) { 14045 return this.thru(interceptor); 14046 } 14047 value = value.slice(start, +start + (length ? 1 : 0)); 14048 value.__actions__.push({ 14049 "func": thru, 14050 "args": [interceptor], 14051 "thisArg": undefined$1 14052 }); 14053 return new LodashWrapper(value, this.__chain__).thru(function(array) { 14054 if (length && !array.length) { 14055 array.push(undefined$1); 14056 } 14057 return array; 14058 }); 14059 }); 14060 function wrapperChain() { 14061 return chain(this); 14062 } 14063 function wrapperCommit() { 14064 return new LodashWrapper(this.value(), this.__chain__); 14065 } 14066 function wrapperNext() { 14067 if (this.__values__ === undefined$1) { 14068 this.__values__ = toArray(this.value()); 14069 } 14070 var done = this.__index__ >= this.__values__.length, value = done ? undefined$1 : this.__values__[this.__index__++]; 14071 return { "done": done, "value": value }; 14072 } 14073 function wrapperToIterator() { 14074 return this; 14075 } 14076 function wrapperPlant(value) { 14077 var result2, parent2 = this; 14078 while (parent2 instanceof baseLodash) { 14079 var clone2 = wrapperClone(parent2); 14080 clone2.__index__ = 0; 14081 clone2.__values__ = undefined$1; 14082 if (result2) { 14083 previous.__wrapped__ = clone2; 14084 } else { 14085 result2 = clone2; 14086 } 14087 var previous = clone2; 14088 parent2 = parent2.__wrapped__; 14089 } 14090 previous.__wrapped__ = value; 14091 return result2; 14092 } 14093 function wrapperReverse() { 14094 var value = this.__wrapped__; 14095 if (value instanceof LazyWrapper) { 14096 var wrapped = value; 14097 if (this.__actions__.length) { 14098 wrapped = new LazyWrapper(this); 14099 } 14100 wrapped = wrapped.reverse(); 14101 wrapped.__actions__.push({ 14102 "func": thru, 14103 "args": [reverse], 14104 "thisArg": undefined$1 14105 }); 14106 return new LodashWrapper(wrapped, this.__chain__); 14107 } 14108 return this.thru(reverse); 14109 } 14110 function wrapperValue() { 14111 return baseWrapperValue(this.__wrapped__, this.__actions__); 14112 } 14113 var countBy = createAggregator(function(result2, value, key) { 14114 if (hasOwnProperty2.call(result2, key)) { 14115 ++result2[key]; 14116 } else { 14117 baseAssignValue(result2, key, 1); 14118 } 14119 }); 14120 function every(collection, predicate, guard) { 14121 var func = isArray2(collection) ? arrayEvery : baseEvery; 14122 if (guard && isIterateeCall(collection, predicate, guard)) { 14123 predicate = undefined$1; 14124 } 14125 return func(collection, getIteratee(predicate, 3)); 14126 } 14127 function filter(collection, predicate) { 14128 var func = isArray2(collection) ? arrayFilter : baseFilter; 14129 return func(collection, getIteratee(predicate, 3)); 14130 } 14131 var find = createFind(findIndex); 14132 var findLast = createFind(findLastIndex); 14133 function flatMap(collection, iteratee2) { 14134 return baseFlatten(map2(collection, iteratee2), 1); 14135 } 14136 function flatMapDeep(collection, iteratee2) { 14137 return baseFlatten(map2(collection, iteratee2), INFINITY); 14138 } 14139 function flatMapDepth(collection, iteratee2, depth) { 14140 depth = depth === undefined$1 ? 1 : toInteger(depth); 14141 return baseFlatten(map2(collection, iteratee2), depth); 14142 } 14143 function forEach(collection, iteratee2) { 14144 var func = isArray2(collection) ? arrayEach : baseEach; 14145 return func(collection, getIteratee(iteratee2, 3)); 14146 } 14147 function forEachRight(collection, iteratee2) { 14148 var func = isArray2(collection) ? arrayEachRight : baseEachRight; 14149 return func(collection, getIteratee(iteratee2, 3)); 14150 } 14151 var groupBy = createAggregator(function(result2, value, key) { 14152 if (hasOwnProperty2.call(result2, key)) { 14153 result2[key].push(value); 14154 } else { 14155 baseAssignValue(result2, key, [value]); 14156 } 14157 }); 14158 function includes(collection, value, fromIndex, guard) { 14159 collection = isArrayLike(collection) ? collection : values(collection); 14160 fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0; 14161 var length = collection.length; 14162 if (fromIndex < 0) { 14163 fromIndex = nativeMax(length + fromIndex, 0); 14164 } 14165 return isString2(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1; 14166 } 14167 var invokeMap = baseRest(function(collection, path, args) { 14168 var index = -1, isFunc = typeof path == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : []; 14169 baseEach(collection, function(value) { 14170 result2[++index] = isFunc ? apply2(path, value, args) : baseInvoke(value, path, args); 14171 }); 14172 return result2; 14173 }); 14174 var keyBy = createAggregator(function(result2, value, key) { 14175 baseAssignValue(result2, key, value); 14176 }); 14177 function map2(collection, iteratee2) { 14178 var func = isArray2(collection) ? arrayMap : baseMap; 14179 return func(collection, getIteratee(iteratee2, 3)); 14180 } 14181 function orderBy(collection, iteratees, orders, guard) { 14182 if (collection == null) { 14183 return []; 14184 } 14185 if (!isArray2(iteratees)) { 14186 iteratees = iteratees == null ? [] : [iteratees]; 14187 } 14188 orders = guard ? undefined$1 : orders; 14189 if (!isArray2(orders)) { 14190 orders = orders == null ? [] : [orders]; 14191 } 14192 return baseOrderBy(collection, iteratees, orders); 14193 } 14194 var partition = createAggregator(function(result2, value, key) { 14195 result2[key ? 0 : 1].push(value); 14196 }, function() { 14197 return [[], []]; 14198 }); 14199 function reduce2(collection, iteratee2, accumulator) { 14200 var func = isArray2(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; 14201 return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach); 14202 } 14203 function reduceRight(collection, iteratee2, accumulator) { 14204 var func = isArray2(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3; 14205 return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight); 14206 } 14207 function reject(collection, predicate) { 14208 var func = isArray2(collection) ? arrayFilter : baseFilter; 14209 return func(collection, negate(getIteratee(predicate, 3))); 14210 } 14211 function sample(collection) { 14212 var func = isArray2(collection) ? arraySample : baseSample; 14213 return func(collection); 14214 } 14215 function sampleSize(collection, n, guard) { 14216 if (guard ? isIterateeCall(collection, n, guard) : n === undefined$1) { 14217 n = 1; 14218 } else { 14219 n = toInteger(n); 14220 } 14221 var func = isArray2(collection) ? arraySampleSize : baseSampleSize; 14222 return func(collection, n); 14223 } 14224 function shuffle(collection) { 14225 var func = isArray2(collection) ? arrayShuffle : baseShuffle; 14226 return func(collection); 14227 } 14228 function size(collection) { 14229 if (collection == null) { 14230 return 0; 14231 } 14232 if (isArrayLike(collection)) { 14233 return isString2(collection) ? stringSize(collection) : collection.length; 14234 } 14235 var tag2 = getTag(collection); 14236 if (tag2 == mapTag || tag2 == setTag) { 14237 return collection.size; 14238 } 14239 return baseKeys(collection).length; 14240 } 14241 function some(collection, predicate, guard) { 14242 var func = isArray2(collection) ? arraySome : baseSome; 14243 if (guard && isIterateeCall(collection, predicate, guard)) { 14244 predicate = undefined$1; 14245 } 14246 return func(collection, getIteratee(predicate, 3)); 14247 } 14248 var sortBy = baseRest(function(collection, iteratees) { 14249 if (collection == null) { 14250 return []; 14251 } 14252 var length = iteratees.length; 14253 if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { 14254 iteratees = []; 14255 } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { 14256 iteratees = [iteratees[0]]; 14257 } 14258 return baseOrderBy(collection, baseFlatten(iteratees, 1), []); 14259 }); 14260 var now2 = ctxNow || function() { 14261 return root.Date.now(); 14262 }; 14263 function after(n, func) { 14264 if (typeof func != "function") { 14265 throw new TypeError2(FUNC_ERROR_TEXT); 14266 } 14267 n = toInteger(n); 14268 return function() { 14269 if (--n < 1) { 14270 return func.apply(this, arguments); 14271 } 14272 }; 14273 } 14274 function ary(func, n, guard) { 14275 n = guard ? undefined$1 : n; 14276 n = func && n == null ? func.length : n; 14277 return createWrap(func, WRAP_ARY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, n); 14278 } 14279 function before(n, func) { 14280 var result2; 14281 if (typeof func != "function") { 14282 throw new TypeError2(FUNC_ERROR_TEXT); 14283 } 14284 n = toInteger(n); 14285 return function() { 14286 if (--n > 0) { 14287 result2 = func.apply(this, arguments); 14288 } 14289 if (n <= 1) { 14290 func = undefined$1; 14291 } 14292 return result2; 14293 }; 14294 } 14295 var bind = baseRest(function(func, thisArg, partials) { 14296 var bitmask = WRAP_BIND_FLAG; 14297 if (partials.length) { 14298 var holders = replaceHolders(partials, getHolder(bind)); 14299 bitmask |= WRAP_PARTIAL_FLAG; 14300 } 14301 return createWrap(func, bitmask, thisArg, partials, holders); 14302 }); 14303 var bindKey = baseRest(function(object, key, partials) { 14304 var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; 14305 if (partials.length) { 14306 var holders = replaceHolders(partials, getHolder(bindKey)); 14307 bitmask |= WRAP_PARTIAL_FLAG; 14308 } 14309 return createWrap(key, bitmask, object, partials, holders); 14310 }); 14311 function curry(func, arity, guard) { 14312 arity = guard ? undefined$1 : arity; 14313 var result2 = createWrap(func, WRAP_CURRY_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity); 14314 result2.placeholder = curry.placeholder; 14315 return result2; 14316 } 14317 function curryRight(func, arity, guard) { 14318 arity = guard ? undefined$1 : arity; 14319 var result2 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined$1, undefined$1, undefined$1, undefined$1, undefined$1, arity); 14320 result2.placeholder = curryRight.placeholder; 14321 return result2; 14322 } 14323 function debounce(func, wait, options) { 14324 var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; 14325 if (typeof func != "function") { 14326 throw new TypeError2(FUNC_ERROR_TEXT); 14327 } 14328 wait = toNumber(wait) || 0; 14329 if (isObject2(options)) { 14330 leading = !!options.leading; 14331 maxing = "maxWait" in options; 14332 maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; 14333 trailing = "trailing" in options ? !!options.trailing : trailing; 14334 } 14335 function invokeFunc(time) { 14336 var args = lastArgs, thisArg = lastThis; 14337 lastArgs = lastThis = undefined$1; 14338 lastInvokeTime = time; 14339 result2 = func.apply(thisArg, args); 14340 return result2; 14341 } 14342 function leadingEdge(time) { 14343 lastInvokeTime = time; 14344 timerId = setTimeout2(timerExpired, wait); 14345 return leading ? invokeFunc(time) : result2; 14346 } 14347 function remainingWait(time) { 14348 var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; 14349 return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; 14350 } 14351 function shouldInvoke(time) { 14352 var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; 14353 return lastCallTime === undefined$1 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; 14354 } 14355 function timerExpired() { 14356 var time = now2(); 14357 if (shouldInvoke(time)) { 14358 return trailingEdge(time); 14359 } 14360 timerId = setTimeout2(timerExpired, remainingWait(time)); 14361 } 14362 function trailingEdge(time) { 14363 timerId = undefined$1; 14364 if (trailing && lastArgs) { 14365 return invokeFunc(time); 14366 } 14367 lastArgs = lastThis = undefined$1; 14368 return result2; 14369 } 14370 function cancel() { 14371 if (timerId !== undefined$1) { 14372 clearTimeout2(timerId); 14373 } 14374 lastInvokeTime = 0; 14375 lastArgs = lastCallTime = lastThis = timerId = undefined$1; 14376 } 14377 function flush() { 14378 return timerId === undefined$1 ? result2 : trailingEdge(now2()); 14379 } 14380 function debounced() { 14381 var time = now2(), isInvoking = shouldInvoke(time); 14382 lastArgs = arguments; 14383 lastThis = this; 14384 lastCallTime = time; 14385 if (isInvoking) { 14386 if (timerId === undefined$1) { 14387 return leadingEdge(lastCallTime); 14388 } 14389 if (maxing) { 14390 clearTimeout2(timerId); 14391 timerId = setTimeout2(timerExpired, wait); 14392 return invokeFunc(lastCallTime); 14393 } 14394 } 14395 if (timerId === undefined$1) { 14396 timerId = setTimeout2(timerExpired, wait); 14397 } 14398 return result2; 14399 } 14400 debounced.cancel = cancel; 14401 debounced.flush = flush; 14402 return debounced; 14403 } 14404 var defer = baseRest(function(func, args) { 14405 return baseDelay(func, 1, args); 14406 }); 14407 var delay = baseRest(function(func, wait, args) { 14408 return baseDelay(func, toNumber(wait) || 0, args); 14409 }); 14410 function flip(func) { 14411 return createWrap(func, WRAP_FLIP_FLAG); 14412 } 14413 function memoize(func, resolver) { 14414 if (typeof func != "function" || resolver != null && typeof resolver != "function") { 14415 throw new TypeError2(FUNC_ERROR_TEXT); 14416 } 14417 var memoized = function() { 14418 var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache2 = memoized.cache; 14419 if (cache2.has(key)) { 14420 return cache2.get(key); 14421 } 14422 var result2 = func.apply(this, args); 14423 memoized.cache = cache2.set(key, result2) || cache2; 14424 return result2; 14425 }; 14426 memoized.cache = new (memoize.Cache || MapCache)(); 14427 return memoized; 14428 } 14429 memoize.Cache = MapCache; 14430 function negate(predicate) { 14431 if (typeof predicate != "function") { 14432 throw new TypeError2(FUNC_ERROR_TEXT); 14433 } 14434 return function() { 14435 var args = arguments; 14436 switch (args.length) { 14437 case 0: 14438 return !predicate.call(this); 14439 case 1: 14440 return !predicate.call(this, args[0]); 14441 case 2: 14442 return !predicate.call(this, args[0], args[1]); 14443 case 3: 14444 return !predicate.call(this, args[0], args[1], args[2]); 14445 } 14446 return !predicate.apply(this, args); 14447 }; 14448 } 14449 function once2(func) { 14450 return before(2, func); 14451 } 14452 var overArgs = castRest(function(func, transforms) { 14453 transforms = transforms.length == 1 && isArray2(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); 14454 var funcsLength = transforms.length; 14455 return baseRest(function(args) { 14456 var index = -1, length = nativeMin(args.length, funcsLength); 14457 while (++index < length) { 14458 args[index] = transforms[index].call(this, args[index]); 14459 } 14460 return apply2(func, this, args); 14461 }); 14462 }); 14463 var partial = baseRest(function(func, partials) { 14464 var holders = replaceHolders(partials, getHolder(partial)); 14465 return createWrap(func, WRAP_PARTIAL_FLAG, undefined$1, partials, holders); 14466 }); 14467 var partialRight = baseRest(function(func, partials) { 14468 var holders = replaceHolders(partials, getHolder(partialRight)); 14469 return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined$1, partials, holders); 14470 }); 14471 var rearg = flatRest(function(func, indexes) { 14472 return createWrap(func, WRAP_REARG_FLAG, undefined$1, undefined$1, undefined$1, indexes); 14473 }); 14474 function rest(func, start) { 14475 if (typeof func != "function") { 14476 throw new TypeError2(FUNC_ERROR_TEXT); 14477 } 14478 start = start === undefined$1 ? start : toInteger(start); 14479 return baseRest(func, start); 14480 } 14481 function spread(func, start) { 14482 if (typeof func != "function") { 14483 throw new TypeError2(FUNC_ERROR_TEXT); 14484 } 14485 start = start == null ? 0 : nativeMax(toInteger(start), 0); 14486 return baseRest(function(args) { 14487 var array = args[start], otherArgs = castSlice(args, 0, start); 14488 if (array) { 14489 arrayPush(otherArgs, array); 14490 } 14491 return apply2(func, this, otherArgs); 14492 }); 14493 } 14494 function throttle(func, wait, options) { 14495 var leading = true, trailing = true; 14496 if (typeof func != "function") { 14497 throw new TypeError2(FUNC_ERROR_TEXT); 14498 } 14499 if (isObject2(options)) { 14500 leading = "leading" in options ? !!options.leading : leading; 14501 trailing = "trailing" in options ? !!options.trailing : trailing; 14502 } 14503 return debounce(func, wait, { 14504 "leading": leading, 14505 "maxWait": wait, 14506 "trailing": trailing 14507 }); 14508 } 14509 function unary(func) { 14510 return ary(func, 1); 14511 } 14512 function wrap(value, wrapper) { 14513 return partial(castFunction(wrapper), value); 14514 } 14515 function castArray() { 14516 if (!arguments.length) { 14517 return []; 14518 } 14519 var value = arguments[0]; 14520 return isArray2(value) ? value : [value]; 14521 } 14522 function clone(value) { 14523 return baseClone(value, CLONE_SYMBOLS_FLAG); 14524 } 14525 function cloneWith(value, customizer) { 14526 customizer = typeof customizer == "function" ? customizer : undefined$1; 14527 return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); 14528 } 14529 function cloneDeep(value) { 14530 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); 14531 } 14532 function cloneDeepWith(value, customizer) { 14533 customizer = typeof customizer == "function" ? customizer : undefined$1; 14534 return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); 14535 } 14536 function conformsTo(object, source) { 14537 return source == null || baseConformsTo(object, source, keys(source)); 14538 } 14539 function eq(value, other2) { 14540 return value === other2 || value !== value && other2 !== other2; 14541 } 14542 var gt = createRelationalOperation(baseGt); 14543 var gte = createRelationalOperation(function(value, other2) { 14544 return value >= other2; 14545 }); 14546 var isArguments = baseIsArguments(/* @__PURE__ */ (function() { 14547 return arguments; 14548 })()) ? baseIsArguments : function(value) { 14549 return isObjectLike(value) && hasOwnProperty2.call(value, "callee") && !propertyIsEnumerable.call(value, "callee"); 14550 }; 14551 var isArray2 = Array2.isArray; 14552 var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; 14553 function isArrayLike(value) { 14554 return value != null && isLength(value.length) && !isFunction2(value); 14555 } 14556 function isArrayLikeObject(value) { 14557 return isObjectLike(value) && isArrayLike(value); 14558 } 14559 function isBoolean2(value) { 14560 return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag; 14561 } 14562 var isBuffer = nativeIsBuffer || stubFalse; 14563 var isDate2 = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; 14564 function isElement2(value) { 14565 return isObjectLike(value) && value.nodeType === 1 && !isPlainObject2(value); 14566 } 14567 function isEmpty(value) { 14568 if (value == null) { 14569 return true; 14570 } 14571 if (isArrayLike(value) && (isArray2(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) { 14572 return !value.length; 14573 } 14574 var tag2 = getTag(value); 14575 if (tag2 == mapTag || tag2 == setTag) { 14576 return !value.size; 14577 } 14578 if (isPrototype(value)) { 14579 return !baseKeys(value).length; 14580 } 14581 for (var key in value) { 14582 if (hasOwnProperty2.call(value, key)) { 14583 return false; 14584 } 14585 } 14586 return true; 14587 } 14588 function isEqual(value, other2) { 14589 return baseIsEqual(value, other2); 14590 } 14591 function isEqualWith(value, other2, customizer) { 14592 customizer = typeof customizer == "function" ? customizer : undefined$1; 14593 var result2 = customizer ? customizer(value, other2) : undefined$1; 14594 return result2 === undefined$1 ? baseIsEqual(value, other2, undefined$1, customizer) : !!result2; 14595 } 14596 function isError(value) { 14597 if (!isObjectLike(value)) { 14598 return false; 14599 } 14600 var tag2 = baseGetTag(value); 14601 return tag2 == errorTag || tag2 == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject2(value); 14602 } 14603 function isFinite2(value) { 14604 return typeof value == "number" && nativeIsFinite(value); 14605 } 14606 function isFunction2(value) { 14607 if (!isObject2(value)) { 14608 return false; 14609 } 14610 var tag2 = baseGetTag(value); 14611 return tag2 == funcTag || tag2 == genTag || tag2 == asyncTag || tag2 == proxyTag; 14612 } 14613 function isInteger(value) { 14614 return typeof value == "number" && value == toInteger(value); 14615 } 14616 function isLength(value) { 14617 return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; 14618 } 14619 function isObject2(value) { 14620 var type = typeof value; 14621 return value != null && (type == "object" || type == "function"); 14622 } 14623 function isObjectLike(value) { 14624 return value != null && typeof value == "object"; 14625 } 14626 var isMap2 = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; 14627 function isMatch(object, source) { 14628 return object === source || baseIsMatch(object, source, getMatchData(source)); 14629 } 14630 function isMatchWith(object, source, customizer) { 14631 customizer = typeof customizer == "function" ? customizer : undefined$1; 14632 return baseIsMatch(object, source, getMatchData(source), customizer); 14633 } 14634 function isNaN2(value) { 14635 return isNumber2(value) && value != +value; 14636 } 14637 function isNative(value) { 14638 if (isMaskable(value)) { 14639 throw new Error2(CORE_ERROR_TEXT); 14640 } 14641 return baseIsNative(value); 14642 } 14643 function isNull(value) { 14644 return value === null; 14645 } 14646 function isNil(value) { 14647 return value == null; 14648 } 14649 function isNumber2(value) { 14650 return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag; 14651 } 14652 function isPlainObject2(value) { 14653 if (!isObjectLike(value) || baseGetTag(value) != objectTag) { 14654 return false; 14655 } 14656 var proto = getPrototype(value); 14657 if (proto === null) { 14658 return true; 14659 } 14660 var Ctor = hasOwnProperty2.call(proto, "constructor") && proto.constructor; 14661 return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; 14662 } 14663 var isRegExp2 = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; 14664 function isSafeInteger(value) { 14665 return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; 14666 } 14667 var isSet2 = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; 14668 function isString2(value) { 14669 return typeof value == "string" || !isArray2(value) && isObjectLike(value) && baseGetTag(value) == stringTag; 14670 } 14671 function isSymbol2(value) { 14672 return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag; 14673 } 14674 var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; 14675 function isUndefined(value) { 14676 return value === undefined$1; 14677 } 14678 function isWeakMap(value) { 14679 return isObjectLike(value) && getTag(value) == weakMapTag; 14680 } 14681 function isWeakSet(value) { 14682 return isObjectLike(value) && baseGetTag(value) == weakSetTag; 14683 } 14684 var lt = createRelationalOperation(baseLt); 14685 var lte = createRelationalOperation(function(value, other2) { 14686 return value <= other2; 14687 }); 14688 function toArray(value) { 14689 if (!value) { 14690 return []; 14691 } 14692 if (isArrayLike(value)) { 14693 return isString2(value) ? stringToArray(value) : copyArray(value); 14694 } 14695 if (symIterator && value[symIterator]) { 14696 return iteratorToArray(value[symIterator]()); 14697 } 14698 var tag2 = getTag(value), func = tag2 == mapTag ? mapToArray : tag2 == setTag ? setToArray : values; 14699 return func(value); 14700 } 14701 function toFinite(value) { 14702 if (!value) { 14703 return value === 0 ? value : 0; 14704 } 14705 value = toNumber(value); 14706 if (value === INFINITY || value === -INFINITY) { 14707 var sign = value < 0 ? -1 : 1; 14708 return sign * MAX_INTEGER; 14709 } 14710 return value === value ? value : 0; 14711 } 14712 function toInteger(value) { 14713 var result2 = toFinite(value), remainder = result2 % 1; 14714 return result2 === result2 ? remainder ? result2 - remainder : result2 : 0; 14715 } 14716 function toLength(value) { 14717 return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; 14718 } 14719 function toNumber(value) { 14720 if (typeof value == "number") { 14721 return value; 14722 } 14723 if (isSymbol2(value)) { 14724 return NAN; 14725 } 14726 if (isObject2(value)) { 14727 var other2 = typeof value.valueOf == "function" ? value.valueOf() : value; 14728 value = isObject2(other2) ? other2 + "" : other2; 14729 } 14730 if (typeof value != "string") { 14731 return value === 0 ? value : +value; 14732 } 14733 value = baseTrim(value); 14734 var isBinary = reIsBinary.test(value); 14735 return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; 14736 } 14737 function toPlainObject(value) { 14738 return copyObject(value, keysIn(value)); 14739 } 14740 function toSafeInteger(value) { 14741 return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0; 14742 } 14743 function toString2(value) { 14744 return value == null ? "" : baseToString(value); 14745 } 14746 var assign2 = createAssigner(function(object, source) { 14747 if (isPrototype(source) || isArrayLike(source)) { 14748 copyObject(source, keys(source), object); 14749 return; 14750 } 14751 for (var key in source) { 14752 if (hasOwnProperty2.call(source, key)) { 14753 assignValue(object, key, source[key]); 14754 } 14755 } 14756 }); 14757 var assignIn = createAssigner(function(object, source) { 14758 copyObject(source, keysIn(source), object); 14759 }); 14760 var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { 14761 copyObject(source, keysIn(source), object, customizer); 14762 }); 14763 var assignWith = createAssigner(function(object, source, srcIndex, customizer) { 14764 copyObject(source, keys(source), object, customizer); 14765 }); 14766 var at = flatRest(baseAt); 14767 function create2(prototype, properties) { 14768 var result2 = baseCreate(prototype); 14769 return properties == null ? result2 : baseAssign(result2, properties); 14770 } 14771 var defaults = baseRest(function(object, sources) { 14772 object = Object2(object); 14773 var index = -1; 14774 var length = sources.length; 14775 var guard = length > 2 ? sources[2] : undefined$1; 14776 if (guard && isIterateeCall(sources[0], sources[1], guard)) { 14777 length = 1; 14778 } 14779 while (++index < length) { 14780 var source = sources[index]; 14781 var props = keysIn(source); 14782 var propsIndex = -1; 14783 var propsLength = props.length; 14784 while (++propsIndex < propsLength) { 14785 var key = props[propsIndex]; 14786 var value = object[key]; 14787 if (value === undefined$1 || eq(value, objectProto[key]) && !hasOwnProperty2.call(object, key)) { 14788 object[key] = source[key]; 14789 } 14790 } 14791 } 14792 return object; 14793 }); 14794 var defaultsDeep = baseRest(function(args) { 14795 args.push(undefined$1, customDefaultsMerge); 14796 return apply2(mergeWith, undefined$1, args); 14797 }); 14798 function findKey(object, predicate) { 14799 return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); 14800 } 14801 function findLastKey(object, predicate) { 14802 return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); 14803 } 14804 function forIn(object, iteratee2) { 14805 return object == null ? object : baseFor(object, getIteratee(iteratee2, 3), keysIn); 14806 } 14807 function forInRight(object, iteratee2) { 14808 return object == null ? object : baseForRight(object, getIteratee(iteratee2, 3), keysIn); 14809 } 14810 function forOwn(object, iteratee2) { 14811 return object && baseForOwn(object, getIteratee(iteratee2, 3)); 14812 } 14813 function forOwnRight(object, iteratee2) { 14814 return object && baseForOwnRight(object, getIteratee(iteratee2, 3)); 14815 } 14816 function functions(object) { 14817 return object == null ? [] : baseFunctions(object, keys(object)); 14818 } 14819 function functionsIn(object) { 14820 return object == null ? [] : baseFunctions(object, keysIn(object)); 14821 } 14822 function get(object, path, defaultValue) { 14823 var result2 = object == null ? undefined$1 : baseGet(object, path); 14824 return result2 === undefined$1 ? defaultValue : result2; 14825 } 14826 function has(object, path) { 14827 return object != null && hasPath(object, path, baseHas); 14828 } 14829 function hasIn(object, path) { 14830 return object != null && hasPath(object, path, baseHasIn); 14831 } 14832 var invert = createInverter(function(result2, value, key) { 14833 if (value != null && typeof value.toString != "function") { 14834 value = nativeObjectToString.call(value); 14835 } 14836 result2[value] = key; 14837 }, constant(identity)); 14838 var invertBy = createInverter(function(result2, value, key) { 14839 if (value != null && typeof value.toString != "function") { 14840 value = nativeObjectToString.call(value); 14841 } 14842 if (hasOwnProperty2.call(result2, value)) { 14843 result2[value].push(key); 14844 } else { 14845 result2[value] = [key]; 14846 } 14847 }, getIteratee); 14848 var invoke = baseRest(baseInvoke); 14849 function keys(object) { 14850 return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); 14851 } 14852 function keysIn(object) { 14853 return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); 14854 } 14855 function mapKeys(object, iteratee2) { 14856 var result2 = {}; 14857 iteratee2 = getIteratee(iteratee2, 3); 14858 baseForOwn(object, function(value, key, object2) { 14859 baseAssignValue(result2, iteratee2(value, key, object2), value); 14860 }); 14861 return result2; 14862 } 14863 function mapValues(object, iteratee2) { 14864 var result2 = {}; 14865 iteratee2 = getIteratee(iteratee2, 3); 14866 baseForOwn(object, function(value, key, object2) { 14867 baseAssignValue(result2, key, iteratee2(value, key, object2)); 14868 }); 14869 return result2; 14870 } 14871 var merge = createAssigner(function(object, source, srcIndex) { 14872 baseMerge(object, source, srcIndex); 14873 }); 14874 var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { 14875 baseMerge(object, source, srcIndex, customizer); 14876 }); 14877 var omit = flatRest(function(object, paths) { 14878 var result2 = {}; 14879 if (object == null) { 14880 return result2; 14881 } 14882 var isDeep = false; 14883 paths = arrayMap(paths, function(path) { 14884 path = castPath(path, object); 14885 isDeep || (isDeep = path.length > 1); 14886 return path; 14887 }); 14888 copyObject(object, getAllKeysIn(object), result2); 14889 if (isDeep) { 14890 result2 = baseClone(result2, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); 14891 } 14892 var length = paths.length; 14893 while (length--) { 14894 baseUnset(result2, paths[length]); 14895 } 14896 return result2; 14897 }); 14898 function omitBy(object, predicate) { 14899 return pickBy(object, negate(getIteratee(predicate))); 14900 } 14901 var pick = flatRest(function(object, paths) { 14902 return object == null ? {} : basePick(object, paths); 14903 }); 14904 function pickBy(object, predicate) { 14905 if (object == null) { 14906 return {}; 14907 } 14908 var props = arrayMap(getAllKeysIn(object), function(prop) { 14909 return [prop]; 14910 }); 14911 predicate = getIteratee(predicate); 14912 return basePickBy(object, props, function(value, path) { 14913 return predicate(value, path[0]); 14914 }); 14915 } 14916 function result(object, path, defaultValue) { 14917 path = castPath(path, object); 14918 var index = -1, length = path.length; 14919 if (!length) { 14920 length = 1; 14921 object = undefined$1; 14922 } 14923 while (++index < length) { 14924 var value = object == null ? undefined$1 : object[toKey(path[index])]; 14925 if (value === undefined$1) { 14926 index = length; 14927 value = defaultValue; 14928 } 14929 object = isFunction2(value) ? value.call(object) : value; 14930 } 14931 return object; 14932 } 14933 function set2(object, path, value) { 14934 return object == null ? object : baseSet(object, path, value); 14935 } 14936 function setWith(object, path, value, customizer) { 14937 customizer = typeof customizer == "function" ? customizer : undefined$1; 14938 return object == null ? object : baseSet(object, path, value, customizer); 14939 } 14940 var toPairs = createToPairs(keys); 14941 var toPairsIn = createToPairs(keysIn); 14942 function transform2(object, iteratee2, accumulator) { 14943 var isArr = isArray2(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object); 14944 iteratee2 = getIteratee(iteratee2, 4); 14945 if (accumulator == null) { 14946 var Ctor = object && object.constructor; 14947 if (isArrLike) { 14948 accumulator = isArr ? new Ctor() : []; 14949 } else if (isObject2(object)) { 14950 accumulator = isFunction2(Ctor) ? baseCreate(getPrototype(object)) : {}; 14951 } else { 14952 accumulator = {}; 14953 } 14954 } 14955 (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object2) { 14956 return iteratee2(accumulator, value, index, object2); 14957 }); 14958 return accumulator; 14959 } 14960 function unset(object, path) { 14961 return object == null ? true : baseUnset(object, path); 14962 } 14963 function update2(object, path, updater) { 14964 return object == null ? object : baseUpdate(object, path, castFunction(updater)); 14965 } 14966 function updateWith(object, path, updater, customizer) { 14967 customizer = typeof customizer == "function" ? customizer : undefined$1; 14968 return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); 14969 } 14970 function values(object) { 14971 return object == null ? [] : baseValues(object, keys(object)); 14972 } 14973 function valuesIn(object) { 14974 return object == null ? [] : baseValues(object, keysIn(object)); 14975 } 14976 function clamp(number2, lower, upper) { 14977 if (upper === undefined$1) { 14978 upper = lower; 14979 lower = undefined$1; 14980 } 14981 if (upper !== undefined$1) { 14982 upper = toNumber(upper); 14983 upper = upper === upper ? upper : 0; 14984 } 14985 if (lower !== undefined$1) { 14986 lower = toNumber(lower); 14987 lower = lower === lower ? lower : 0; 14988 } 14989 return baseClamp(toNumber(number2), lower, upper); 14990 } 14991 function inRange(number2, start, end) { 14992 start = toFinite(start); 14993 if (end === undefined$1) { 14994 end = start; 14995 start = 0; 14996 } else { 14997 end = toFinite(end); 14998 } 14999 number2 = toNumber(number2); 15000 return baseInRange(number2, start, end); 15001 } 15002 function random(lower, upper, floating) { 15003 if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) { 15004 upper = floating = undefined$1; 15005 } 15006 if (floating === undefined$1) { 15007 if (typeof upper == "boolean") { 15008 floating = upper; 15009 upper = undefined$1; 15010 } else if (typeof lower == "boolean") { 15011 floating = lower; 15012 lower = undefined$1; 15013 } 15014 } 15015 if (lower === undefined$1 && upper === undefined$1) { 15016 lower = 0; 15017 upper = 1; 15018 } else { 15019 lower = toFinite(lower); 15020 if (upper === undefined$1) { 15021 upper = lower; 15022 lower = 0; 15023 } else { 15024 upper = toFinite(upper); 15025 } 15026 } 15027 if (lower > upper) { 15028 var temp = lower; 15029 lower = upper; 15030 upper = temp; 15031 } 15032 if (floating || lower % 1 || upper % 1) { 15033 var rand = nativeRandom(); 15034 return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper); 15035 } 15036 return baseRandom(lower, upper); 15037 } 15038 var camelCase = createCompounder(function(result2, word, index) { 15039 word = word.toLowerCase(); 15040 return result2 + (index ? capitalize2(word) : word); 15041 }); 15042 function capitalize2(string) { 15043 return upperFirst(toString2(string).toLowerCase()); 15044 } 15045 function deburr(string) { 15046 string = toString2(string); 15047 return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ""); 15048 } 15049 function endsWith(string, target, position) { 15050 string = toString2(string); 15051 target = baseToString(target); 15052 var length = string.length; 15053 position = position === undefined$1 ? length : baseClamp(toInteger(position), 0, length); 15054 var end = position; 15055 position -= target.length; 15056 return position >= 0 && string.slice(position, end) == target; 15057 } 15058 function escape3(string) { 15059 string = toString2(string); 15060 return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; 15061 } 15062 function escapeRegExp(string) { 15063 string = toString2(string); 15064 return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string; 15065 } 15066 var kebabCase = createCompounder(function(result2, word, index) { 15067 return result2 + (index ? "-" : "") + word.toLowerCase(); 15068 }); 15069 var lowerCase = createCompounder(function(result2, word, index) { 15070 return result2 + (index ? " " : "") + word.toLowerCase(); 15071 }); 15072 var lowerFirst = createCaseFirst("toLowerCase"); 15073 function pad(string, length, chars) { 15074 string = toString2(string); 15075 length = toInteger(length); 15076 var strLength = length ? stringSize(string) : 0; 15077 if (!length || strLength >= length) { 15078 return string; 15079 } 15080 var mid = (length - strLength) / 2; 15081 return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars); 15082 } 15083 function padEnd(string, length, chars) { 15084 string = toString2(string); 15085 length = toInteger(length); 15086 var strLength = length ? stringSize(string) : 0; 15087 return length && strLength < length ? string + createPadding(length - strLength, chars) : string; 15088 } 15089 function padStart(string, length, chars) { 15090 string = toString2(string); 15091 length = toInteger(length); 15092 var strLength = length ? stringSize(string) : 0; 15093 return length && strLength < length ? createPadding(length - strLength, chars) + string : string; 15094 } 15095 function parseInt2(string, radix, guard) { 15096 if (guard || radix == null) { 15097 radix = 0; 15098 } else if (radix) { 15099 radix = +radix; 15100 } 15101 return nativeParseInt(toString2(string).replace(reTrimStart, ""), radix || 0); 15102 } 15103 function repeat(string, n, guard) { 15104 if (guard ? isIterateeCall(string, n, guard) : n === undefined$1) { 15105 n = 1; 15106 } else { 15107 n = toInteger(n); 15108 } 15109 return baseRepeat(toString2(string), n); 15110 } 15111 function replace() { 15112 var args = arguments, string = toString2(args[0]); 15113 return args.length < 3 ? string : string.replace(args[1], args[2]); 15114 } 15115 var snakeCase = createCompounder(function(result2, word, index) { 15116 return result2 + (index ? "_" : "") + word.toLowerCase(); 15117 }); 15118 function split(string, separator, limit) { 15119 if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) { 15120 separator = limit = undefined$1; 15121 } 15122 limit = limit === undefined$1 ? MAX_ARRAY_LENGTH : limit >>> 0; 15123 if (!limit) { 15124 return []; 15125 } 15126 string = toString2(string); 15127 if (string && (typeof separator == "string" || separator != null && !isRegExp2(separator))) { 15128 separator = baseToString(separator); 15129 if (!separator && hasUnicode(string)) { 15130 return castSlice(stringToArray(string), 0, limit); 15131 } 15132 } 15133 return string.split(separator, limit); 15134 } 15135 var startCase = createCompounder(function(result2, word, index) { 15136 return result2 + (index ? " " : "") + upperFirst(word); 15137 }); 15138 function startsWith(string, target, position) { 15139 string = toString2(string); 15140 position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length); 15141 target = baseToString(target); 15142 return string.slice(position, position + target.length) == target; 15143 } 15144 function template(string, options, guard) { 15145 var settings = lodash2.templateSettings; 15146 if (guard && isIterateeCall(string, options, guard)) { 15147 options = undefined$1; 15148 } 15149 string = toString2(string); 15150 options = assignInWith({}, options, settings, customDefaultsAssignIn); 15151 var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys); 15152 var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '"; 15153 var reDelimiters = RegExp2( 15154 (options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$", 15155 "g" 15156 ); 15157 var sourceURL = "//# sourceURL=" + (hasOwnProperty2.call(options, "sourceURL") ? (options.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n"; 15158 string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset) { 15159 interpolateValue || (interpolateValue = esTemplateValue); 15160 source += string.slice(index, offset).replace(reUnescapedString, escapeStringChar); 15161 if (escapeValue) { 15162 isEscaping = true; 15163 source += "' +\n__e(" + escapeValue + ") +\n'"; 15164 } 15165 if (evaluateValue) { 15166 isEvaluating = true; 15167 source += "';\n" + evaluateValue + ";\n__p += '"; 15168 } 15169 if (interpolateValue) { 15170 source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; 15171 } 15172 index = offset + match.length; 15173 return match; 15174 }); 15175 source += "';\n"; 15176 var variable = hasOwnProperty2.call(options, "variable") && options.variable; 15177 if (!variable) { 15178 source = "with (obj) {\n" + source + "\n}\n"; 15179 } else if (reForbiddenIdentifierChars.test(variable)) { 15180 throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT); 15181 } 15182 source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;"); 15183 source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}"; 15184 var result2 = attempt(function() { 15185 return Function2(importsKeys, sourceURL + "return " + source).apply(undefined$1, importsValues); 15186 }); 15187 result2.source = source; 15188 if (isError(result2)) { 15189 throw result2; 15190 } 15191 return result2; 15192 } 15193 function toLower(value) { 15194 return toString2(value).toLowerCase(); 15195 } 15196 function toUpper(value) { 15197 return toString2(value).toUpperCase(); 15198 } 15199 function trim(string, chars, guard) { 15200 string = toString2(string); 15201 if (string && (guard || chars === undefined$1)) { 15202 return baseTrim(string); 15203 } 15204 if (!string || !(chars = baseToString(chars))) { 15205 return string; 15206 } 15207 var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start = charsStartIndex(strSymbols, chrSymbols), end = charsEndIndex(strSymbols, chrSymbols) + 1; 15208 return castSlice(strSymbols, start, end).join(""); 15209 } 15210 function trimEnd(string, chars, guard) { 15211 string = toString2(string); 15212 if (string && (guard || chars === undefined$1)) { 15213 return string.slice(0, trimmedEndIndex(string) + 1); 15214 } 15215 if (!string || !(chars = baseToString(chars))) { 15216 return string; 15217 } 15218 var strSymbols = stringToArray(string), end = charsEndIndex(strSymbols, stringToArray(chars)) + 1; 15219 return castSlice(strSymbols, 0, end).join(""); 15220 } 15221 function trimStart(string, chars, guard) { 15222 string = toString2(string); 15223 if (string && (guard || chars === undefined$1)) { 15224 return string.replace(reTrimStart, ""); 15225 } 15226 if (!string || !(chars = baseToString(chars))) { 15227 return string; 15228 } 15229 var strSymbols = stringToArray(string), start = charsStartIndex(strSymbols, stringToArray(chars)); 15230 return castSlice(strSymbols, start).join(""); 15231 } 15232 function truncate(string, options) { 15233 var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION; 15234 if (isObject2(options)) { 15235 var separator = "separator" in options ? options.separator : separator; 15236 length = "length" in options ? toInteger(options.length) : length; 15237 omission = "omission" in options ? baseToString(options.omission) : omission; 15238 } 15239 string = toString2(string); 15240 var strLength = string.length; 15241 if (hasUnicode(string)) { 15242 var strSymbols = stringToArray(string); 15243 strLength = strSymbols.length; 15244 } 15245 if (length >= strLength) { 15246 return string; 15247 } 15248 var end = length - stringSize(omission); 15249 if (end < 1) { 15250 return omission; 15251 } 15252 var result2 = strSymbols ? castSlice(strSymbols, 0, end).join("") : string.slice(0, end); 15253 if (separator === undefined$1) { 15254 return result2 + omission; 15255 } 15256 if (strSymbols) { 15257 end += result2.length - end; 15258 } 15259 if (isRegExp2(separator)) { 15260 if (string.slice(end).search(separator)) { 15261 var match, substring = result2; 15262 if (!separator.global) { 15263 separator = RegExp2(separator.source, toString2(reFlags.exec(separator)) + "g"); 15264 } 15265 separator.lastIndex = 0; 15266 while (match = separator.exec(substring)) { 15267 var newEnd = match.index; 15268 } 15269 result2 = result2.slice(0, newEnd === undefined$1 ? end : newEnd); 15270 } 15271 } else if (string.indexOf(baseToString(separator), end) != end) { 15272 var index = result2.lastIndexOf(separator); 15273 if (index > -1) { 15274 result2 = result2.slice(0, index); 15275 } 15276 } 15277 return result2 + omission; 15278 } 15279 function unescape(string) { 15280 string = toString2(string); 15281 return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string; 15282 } 15283 var upperCase = createCompounder(function(result2, word, index) { 15284 return result2 + (index ? " " : "") + word.toUpperCase(); 15285 }); 15286 var upperFirst = createCaseFirst("toUpperCase"); 15287 function words(string, pattern, guard) { 15288 string = toString2(string); 15289 pattern = guard ? undefined$1 : pattern; 15290 if (pattern === undefined$1) { 15291 return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); 15292 } 15293 return string.match(pattern) || []; 15294 } 15295 var attempt = baseRest(function(func, args) { 15296 try { 15297 return apply2(func, undefined$1, args); 15298 } catch (e) { 15299 return isError(e) ? e : new Error2(e); 15300 } 15301 }); 15302 var bindAll = flatRest(function(object, methodNames) { 15303 arrayEach(methodNames, function(key) { 15304 key = toKey(key); 15305 baseAssignValue(object, key, bind(object[key], object)); 15306 }); 15307 return object; 15308 }); 15309 function cond(pairs) { 15310 var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee(); 15311 pairs = !length ? [] : arrayMap(pairs, function(pair) { 15312 if (typeof pair[1] != "function") { 15313 throw new TypeError2(FUNC_ERROR_TEXT); 15314 } 15315 return [toIteratee(pair[0]), pair[1]]; 15316 }); 15317 return baseRest(function(args) { 15318 var index = -1; 15319 while (++index < length) { 15320 var pair = pairs[index]; 15321 if (apply2(pair[0], this, args)) { 15322 return apply2(pair[1], this, args); 15323 } 15324 } 15325 }); 15326 } 15327 function conforms(source) { 15328 return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); 15329 } 15330 function constant(value) { 15331 return function() { 15332 return value; 15333 }; 15334 } 15335 function defaultTo(value, defaultValue) { 15336 return value == null || value !== value ? defaultValue : value; 15337 } 15338 var flow = createFlow(); 15339 var flowRight = createFlow(true); 15340 function identity(value) { 15341 return value; 15342 } 15343 function iteratee(func) { 15344 return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG)); 15345 } 15346 function matches(source) { 15347 return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); 15348 } 15349 function matchesProperty(path, srcValue) { 15350 return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); 15351 } 15352 var method = baseRest(function(path, args) { 15353 return function(object) { 15354 return baseInvoke(object, path, args); 15355 }; 15356 }); 15357 var methodOf = baseRest(function(object, args) { 15358 return function(path) { 15359 return baseInvoke(object, path, args); 15360 }; 15361 }); 15362 function mixin2(object, source, options) { 15363 var props = keys(source), methodNames = baseFunctions(source, props); 15364 if (options == null && !(isObject2(source) && (methodNames.length || !props.length))) { 15365 options = source; 15366 source = object; 15367 object = this; 15368 methodNames = baseFunctions(source, keys(source)); 15369 } 15370 var chain2 = !(isObject2(options) && "chain" in options) || !!options.chain, isFunc = isFunction2(object); 15371 arrayEach(methodNames, function(methodName) { 15372 var func = source[methodName]; 15373 object[methodName] = func; 15374 if (isFunc) { 15375 object.prototype[methodName] = function() { 15376 var chainAll = this.__chain__; 15377 if (chain2 || chainAll) { 15378 var result2 = object(this.__wrapped__), actions = result2.__actions__ = copyArray(this.__actions__); 15379 actions.push({ "func": func, "args": arguments, "thisArg": object }); 15380 result2.__chain__ = chainAll; 15381 return result2; 15382 } 15383 return func.apply(object, arrayPush([this.value()], arguments)); 15384 }; 15385 } 15386 }); 15387 return object; 15388 } 15389 function noConflict() { 15390 if (root._ === this) { 15391 root._ = oldDash; 15392 } 15393 return this; 15394 } 15395 function noop2() { 15396 } 15397 function nthArg(n) { 15398 n = toInteger(n); 15399 return baseRest(function(args) { 15400 return baseNth(args, n); 15401 }); 15402 } 15403 var over = createOver(arrayMap); 15404 var overEvery = createOver(arrayEvery); 15405 var overSome = createOver(arraySome); 15406 function property(path) { 15407 return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); 15408 } 15409 function propertyOf(object) { 15410 return function(path) { 15411 return object == null ? undefined$1 : baseGet(object, path); 15412 }; 15413 } 15414 var range = createRange(); 15415 var rangeRight = createRange(true); 15416 function stubArray() { 15417 return []; 15418 } 15419 function stubFalse() { 15420 return false; 15421 } 15422 function stubObject() { 15423 return {}; 15424 } 15425 function stubString() { 15426 return ""; 15427 } 15428 function stubTrue() { 15429 return true; 15430 } 15431 function times(n, iteratee2) { 15432 n = toInteger(n); 15433 if (n < 1 || n > MAX_SAFE_INTEGER) { 15434 return []; 15435 } 15436 var index = MAX_ARRAY_LENGTH, length = nativeMin(n, MAX_ARRAY_LENGTH); 15437 iteratee2 = getIteratee(iteratee2); 15438 n -= MAX_ARRAY_LENGTH; 15439 var result2 = baseTimes(length, iteratee2); 15440 while (++index < n) { 15441 iteratee2(index); 15442 } 15443 return result2; 15444 } 15445 function toPath(value) { 15446 if (isArray2(value)) { 15447 return arrayMap(value, toKey); 15448 } 15449 return isSymbol2(value) ? [value] : copyArray(stringToPath(toString2(value))); 15450 } 15451 function uniqueId(prefix) { 15452 var id = ++idCounter; 15453 return toString2(prefix) + id; 15454 } 15455 var add = createMathOperation(function(augend, addend) { 15456 return augend + addend; 15457 }, 0); 15458 var ceil = createRound("ceil"); 15459 var divide = createMathOperation(function(dividend, divisor) { 15460 return dividend / divisor; 15461 }, 1); 15462 var floor = createRound("floor"); 15463 function max(array) { 15464 return array && array.length ? baseExtremum(array, identity, baseGt) : undefined$1; 15465 } 15466 function maxBy(array, iteratee2) { 15467 return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseGt) : undefined$1; 15468 } 15469 function mean(array) { 15470 return baseMean(array, identity); 15471 } 15472 function meanBy(array, iteratee2) { 15473 return baseMean(array, getIteratee(iteratee2, 2)); 15474 } 15475 function min(array) { 15476 return array && array.length ? baseExtremum(array, identity, baseLt) : undefined$1; 15477 } 15478 function minBy(array, iteratee2) { 15479 return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseLt) : undefined$1; 15480 } 15481 var multiply = createMathOperation(function(multiplier, multiplicand) { 15482 return multiplier * multiplicand; 15483 }, 1); 15484 var round = createRound("round"); 15485 var subtract = createMathOperation(function(minuend, subtrahend) { 15486 return minuend - subtrahend; 15487 }, 0); 15488 function sum(array) { 15489 return array && array.length ? baseSum(array, identity) : 0; 15490 } 15491 function sumBy(array, iteratee2) { 15492 return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0; 15493 } 15494 lodash2.after = after; 15495 lodash2.ary = ary; 15496 lodash2.assign = assign2; 15497 lodash2.assignIn = assignIn; 15498 lodash2.assignInWith = assignInWith; 15499 lodash2.assignWith = assignWith; 15500 lodash2.at = at; 15501 lodash2.before = before; 15502 lodash2.bind = bind; 15503 lodash2.bindAll = bindAll; 15504 lodash2.bindKey = bindKey; 15505 lodash2.castArray = castArray; 15506 lodash2.chain = chain; 15507 lodash2.chunk = chunk; 15508 lodash2.compact = compact; 15509 lodash2.concat = concat; 15510 lodash2.cond = cond; 15511 lodash2.conforms = conforms; 15512 lodash2.constant = constant; 15513 lodash2.countBy = countBy; 15514 lodash2.create = create2; 15515 lodash2.curry = curry; 15516 lodash2.curryRight = curryRight; 15517 lodash2.debounce = debounce; 15518 lodash2.defaults = defaults; 15519 lodash2.defaultsDeep = defaultsDeep; 15520 lodash2.defer = defer; 15521 lodash2.delay = delay; 15522 lodash2.difference = difference; 15523 lodash2.differenceBy = differenceBy; 15524 lodash2.differenceWith = differenceWith; 15525 lodash2.drop = drop; 15526 lodash2.dropRight = dropRight; 15527 lodash2.dropRightWhile = dropRightWhile; 15528 lodash2.dropWhile = dropWhile; 15529 lodash2.fill = fill; 15530 lodash2.filter = filter; 15531 lodash2.flatMap = flatMap; 15532 lodash2.flatMapDeep = flatMapDeep; 15533 lodash2.flatMapDepth = flatMapDepth; 15534 lodash2.flatten = flatten; 15535 lodash2.flattenDeep = flattenDeep;
15536 lodash2.flattenDepth = flattenDepth; 15537 lodash2.flip = flip; 15538 lodash2.flow = flow; 15539 lodash2.flowRight = flowRight; 15540 lodash2.fromPairs = fromPairs; 15541 lodash2.functions = functions; 15542 lodash2.functionsIn = functionsIn; 15543 lodash2.groupBy = groupBy; 15544 lodash2.initial = initial; 15545 lodash2.intersection = intersection; 15546 lodash2.intersectionBy = intersectionBy; 15547 lodash2.intersectionWith = intersectionWith; 15548 lodash2.invert = invert; 15549 lodash2.invertBy = invertBy; 15550 lodash2.invokeMap = invokeMap; 15551 lodash2.iteratee = iteratee; 15552 lodash2.keyBy = keyBy; 15553 lodash2.keys = keys; 15554 lodash2.keysIn = keysIn; 15555 lodash2.map = map2; 15556 lodash2.mapKeys = mapKeys; 15557 lodash2.mapValues = mapValues; 15558 lodash2.matches = matches; 15559 lodash2.matchesProperty = matchesProperty; 15560 lodash2.memoize = memoize; 15561 lodash2.merge = merge; 15562 lodash2.mergeWith = mergeWith; 15563 lodash2.method = method; 15564 lodash2.methodOf = methodOf; 15565 lodash2.mixin = mixin2; 15566 lodash2.negate = negate; 15567 lodash2.nthArg = nthArg; 15568 lodash2.omit = omit; 15569 lodash2.omitBy = omitBy; 15570 lodash2.once = once2; 15571 lodash2.orderBy = orderBy; 15572 lodash2.over = over; 15573 lodash2.overArgs = overArgs; 15574 lodash2.overEvery = overEvery; 15575 lodash2.overSome = overSome; 15576 lodash2.partial = partial; 15577 lodash2.partialRight = partialRight; 15578 lodash2.partition = partition; 15579 lodash2.pick = pick; 15580 lodash2.pickBy = pickBy; 15581 lodash2.property = property; 15582 lodash2.propertyOf = propertyOf; 15583 lodash2.pull = pull; 15584 lodash2.pullAll = pullAll; 15585 lodash2.pullAllBy = pullAllBy; 15586 lodash2.pullAllWith = pullAllWith; 15587 lodash2.pullAt = pullAt; 15588 lodash2.range = range; 15589 lodash2.rangeRight = rangeRight; 15590 lodash2.rearg = rearg; 15591 lodash2.reject = reject; 15592 lodash2.remove = remove2; 15593 lodash2.rest = rest; 15594 lodash2.reverse = reverse; 15595 lodash2.sampleSize = sampleSize; 15596 lodash2.set = set2; 15597 lodash2.setWith = setWith; 15598 lodash2.shuffle = shuffle; 15599 lodash2.slice = slice; 15600 lodash2.sortBy = sortBy; 15601 lodash2.sortedUniq = sortedUniq; 15602 lodash2.sortedUniqBy = sortedUniqBy; 15603 lodash2.split = split; 15604 lodash2.spread = spread; 15605 lodash2.tail = tail; 15606 lodash2.take = take; 15607 lodash2.takeRight = takeRight; 15608 lodash2.takeRightWhile = takeRightWhile; 15609 lodash2.takeWhile = takeWhile; 15610 lodash2.tap = tap; 15611 lodash2.throttle = throttle; 15612 lodash2.thru = thru; 15613 lodash2.toArray = toArray; 15614 lodash2.toPairs = toPairs; 15615 lodash2.toPairsIn = toPairsIn; 15616 lodash2.toPath = toPath; 15617 lodash2.toPlainObject = toPlainObject; 15618 lodash2.transform = transform2; 15619 lodash2.unary = unary; 15620 lodash2.union = union; 15621 lodash2.unionBy = unionBy; 15622 lodash2.unionWith = unionWith; 15623 lodash2.uniq = uniq; 15624 lodash2.uniqBy = uniqBy; 15625 lodash2.uniqWith = uniqWith; 15626 lodash2.unset = unset; 15627 lodash2.unzip = unzip; 15628 lodash2.unzipWith = unzipWith; 15629 lodash2.update = update2; 15630 lodash2.updateWith = updateWith; 15631 lodash2.values = values; 15632 lodash2.valuesIn = valuesIn; 15633 lodash2.without = without; 15634 lodash2.words = words; 15635 lodash2.wrap = wrap; 15636 lodash2.xor = xor; 15637 lodash2.xorBy = xorBy; 15638 lodash2.xorWith = xorWith; 15639 lodash2.zip = zip; 15640 lodash2.zipObject = zipObject; 15641 lodash2.zipObjectDeep = zipObjectDeep; 15642 lodash2.zipWith = zipWith; 15643 lodash2.entries = toPairs; 15644 lodash2.entriesIn = toPairsIn; 15645 lodash2.extend = assignIn; 15646 lodash2.extendWith = assignInWith; 15647 mixin2(lodash2, lodash2); 15648 lodash2.add = add; 15649 lodash2.attempt = attempt; 15650 lodash2.camelCase = camelCase; 15651 lodash2.capitalize = capitalize2; 15652 lodash2.ceil = ceil; 15653 lodash2.clamp = clamp; 15654 lodash2.clone = clone; 15655 lodash2.cloneDeep = cloneDeep; 15656 lodash2.cloneDeepWith = cloneDeepWith; 15657 lodash2.cloneWith = cloneWith; 15658 lodash2.conformsTo = conformsTo; 15659 lodash2.deburr = deburr; 15660 lodash2.defaultTo = defaultTo; 15661 lodash2.divide = divide; 15662 lodash2.endsWith = endsWith; 15663 lodash2.eq = eq; 15664 lodash2.escape = escape3; 15665 lodash2.escapeRegExp = escapeRegExp; 15666 lodash2.every = every; 15667 lodash2.find = find; 15668 lodash2.findIndex = findIndex; 15669 lodash2.findKey = findKey; 15670 lodash2.findLast = findLast; 15671 lodash2.findLastIndex = findLastIndex; 15672 lodash2.findLastKey = findLastKey; 15673 lodash2.floor = floor; 15674 lodash2.forEach = forEach; 15675 lodash2.forEachRight = forEachRight; 15676 lodash2.forIn = forIn; 15677 lodash2.forInRight = forInRight; 15678 lodash2.forOwn = forOwn; 15679 lodash2.forOwnRight = forOwnRight; 15680 lodash2.get = get; 15681 lodash2.gt = gt; 15682 lodash2.gte = gte; 15683 lodash2.has = has; 15684 lodash2.hasIn = hasIn; 15685 lodash2.head = head; 15686 lodash2.identity = identity; 15687 lodash2.includes = includes; 15688 lodash2.indexOf = indexOf; 15689 lodash2.inRange = inRange; 15690 lodash2.invoke = invoke; 15691 lodash2.isArguments = isArguments; 15692 lodash2.isArray = isArray2; 15693 lodash2.isArrayBuffer = isArrayBuffer; 15694 lodash2.isArrayLike = isArrayLike; 15695 lodash2.isArrayLikeObject = isArrayLikeObject; 15696 lodash2.isBoolean = isBoolean2; 15697 lodash2.isBuffer = isBuffer; 15698 lodash2.isDate = isDate2; 15699 lodash2.isElement = isElement2; 15700 lodash2.isEmpty = isEmpty; 15701 lodash2.isEqual = isEqual; 15702 lodash2.isEqualWith = isEqualWith; 15703 lodash2.isError = isError; 15704 lodash2.isFinite = isFinite2; 15705 lodash2.isFunction = isFunction2; 15706 lodash2.isInteger = isInteger; 15707 lodash2.isLength = isLength; 15708 lodash2.isMap = isMap2; 15709 lodash2.isMatch = isMatch; 15710 lodash2.isMatchWith = isMatchWith; 15711 lodash2.isNaN = isNaN2; 15712 lodash2.isNative = isNative; 15713 lodash2.isNil = isNil; 15714 lodash2.isNull = isNull; 15715 lodash2.isNumber = isNumber2; 15716 lodash2.isObject = isObject2; 15717 lodash2.isObjectLike = isObjectLike; 15718 lodash2.isPlainObject = isPlainObject2; 15719 lodash2.isRegExp = isRegExp2; 15720 lodash2.isSafeInteger = isSafeInteger; 15721 lodash2.isSet = isSet2; 15722 lodash2.isString = isString2; 15723 lodash2.isSymbol = isSymbol2; 15724 lodash2.isTypedArray = isTypedArray; 15725 lodash2.isUndefined = isUndefined; 15726 lodash2.isWeakMap = isWeakMap; 15727 lodash2.isWeakSet = isWeakSet; 15728 lodash2.join = join2; 15729 lodash2.kebabCase = kebabCase; 15730 lodash2.last = last; 15731 lodash2.lastIndexOf = lastIndexOf; 15732 lodash2.lowerCase = lowerCase; 15733 lodash2.lowerFirst = lowerFirst; 15734 lodash2.lt = lt; 15735 lodash2.lte = lte; 15736 lodash2.max = max; 15737 lodash2.maxBy = maxBy; 15738 lodash2.mean = mean; 15739 lodash2.meanBy = meanBy; 15740 lodash2.min = min; 15741 lodash2.minBy = minBy; 15742 lodash2.stubArray = stubArray; 15743 lodash2.stubFalse = stubFalse; 15744 lodash2.stubObject = stubObject; 15745 lodash2.stubString = stubString; 15746 lodash2.stubTrue = stubTrue; 15747 lodash2.multiply = multiply; 15748 lodash2.nth = nth; 15749 lodash2.noConflict = noConflict; 15750 lodash2.noop = noop2; 15751 lodash2.now = now2; 15752 lodash2.pad = pad; 15753 lodash2.padEnd = padEnd; 15754 lodash2.padStart = padStart; 15755 lodash2.parseInt = parseInt2; 15756 lodash2.random = random; 15757 lodash2.reduce = reduce2; 15758 lodash2.reduceRight = reduceRight; 15759 lodash2.repeat = repeat; 15760 lodash2.replace = replace; 15761 lodash2.result = result; 15762 lodash2.round = round; 15763 lodash2.runInContext = runInContext2; 15764 lodash2.sample = sample; 15765 lodash2.size = size; 15766 lodash2.snakeCase = snakeCase; 15767 lodash2.some = some; 15768 lodash2.sortedIndex = sortedIndex; 15769 lodash2.sortedIndexBy = sortedIndexBy; 15770 lodash2.sortedIndexOf = sortedIndexOf; 15771 lodash2.sortedLastIndex = sortedLastIndex; 15772 lodash2.sortedLastIndexBy = sortedLastIndexBy; 15773 lodash2.sortedLastIndexOf = sortedLastIndexOf; 15774 lodash2.startCase = startCase; 15775 lodash2.startsWith = startsWith; 15776 lodash2.subtract = subtract; 15777 lodash2.sum = sum; 15778 lodash2.sumBy = sumBy; 15779 lodash2.template = template; 15780 lodash2.times = times; 15781 lodash2.toFinite = toFinite; 15782 lodash2.toInteger = toInteger; 15783 lodash2.toLength = toLength; 15784 lodash2.toLower = toLower; 15785 lodash2.toNumber = toNumber; 15786 lodash2.toSafeInteger = toSafeInteger; 15787 lodash2.toString = toString2; 15788 lodash2.toUpper = toUpper; 15789 lodash2.trim = trim; 15790 lodash2.trimEnd = trimEnd; 15791 lodash2.trimStart = trimStart; 15792 lodash2.truncate = truncate; 15793 lodash2.unescape = unescape; 15794 lodash2.uniqueId = uniqueId; 15795 lodash2.upperCase = upperCase; 15796 lodash2.upperFirst = upperFirst; 15797 lodash2.each = forEach; 15798 lodash2.eachRight = forEachRight; 15799 lodash2.first = head; 15800 mixin2(lodash2, (function() { 15801 var source = {}; 15802 baseForOwn(lodash2, function(func, methodName) { 15803 if (!hasOwnProperty2.call(lodash2.prototype, methodName)) { 15804 source[methodName] = func; 15805 } 15806 }); 15807 return source; 15808 })(), { "chain": false }); 15809 lodash2.VERSION = VERSION2; 15810 arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) { 15811 lodash2[methodName].placeholder = lodash2; 15812 }); 15813 arrayEach(["drop", "take"], function(methodName, index) { 15814 LazyWrapper.prototype[methodName] = function(n) {
vendor: 4,416 bytes, lines 15815-15910
15815 n = n === undefined$1 ? 1 : nativeMax(toInteger(n), 0); 15816 var result2 = this.__filtered__ && !index ? new LazyWrapper(this) : this.clone(); 15817 if (result2.__filtered__) { 15818 result2.__takeCount__ = nativeMin(n, result2.__takeCount__); 15819 } else { 15820 result2.__views__.push({ 15821 "size": nativeMin(n, MAX_ARRAY_LENGTH), 15822 "type": methodName + (result2.__dir__ < 0 ? "Right" : "") 15823 }); 15824 } 15825 return result2; 15826 }; 15827 LazyWrapper.prototype[methodName + "Right"] = function(n) { 15828 return this.reverse()[methodName](n).reverse(); 15829 }; 15830 }); 15831 arrayEach(["filter", "map", "takeWhile"], function(methodName, index) { 15832 var type = index + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; 15833 LazyWrapper.prototype[methodName] = function(iteratee2) { 15834 var result2 = this.clone(); 15835 result2.__iteratees__.push({ 15836 "iteratee": getIteratee(iteratee2, 3), 15837 "type": type 15838 }); 15839 result2.__filtered__ = result2.__filtered__ || isFilter; 15840 return result2; 15841 }; 15842 }); 15843 arrayEach(["head", "last"], function(methodName, index) { 15844 var takeName = "take" + (index ? "Right" : ""); 15845 LazyWrapper.prototype[methodName] = function() { 15846 return this[takeName](1).value()[0]; 15847 }; 15848 }); 15849 arrayEach(["initial", "tail"], function(methodName, index) { 15850 var dropName = "drop" + (index ? "" : "Right"); 15851 LazyWrapper.prototype[methodName] = function() { 15852 return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); 15853 }; 15854 }); 15855 LazyWrapper.prototype.compact = function() { 15856 return this.filter(identity); 15857 }; 15858 LazyWrapper.prototype.find = function(predicate) { 15859 return this.filter(predicate).head(); 15860 }; 15861 LazyWrapper.prototype.findLast = function(predicate) { 15862 return this.reverse().find(predicate); 15863 }; 15864 LazyWrapper.prototype.invokeMap = baseRest(function(path, args) { 15865 if (typeof path == "function") { 15866 return new LazyWrapper(this); 15867 } 15868 return this.map(function(value) { 15869 return baseInvoke(value, path, args); 15870 }); 15871 }); 15872 LazyWrapper.prototype.reject = function(predicate) { 15873 return this.filter(negate(getIteratee(predicate))); 15874 }; 15875 LazyWrapper.prototype.slice = function(start, end) { 15876 start = toInteger(start); 15877 var result2 = this; 15878 if (result2.__filtered__ && (start > 0 || end < 0)) { 15879 return new LazyWrapper(result2); 15880 } 15881 if (start < 0) { 15882 result2 = result2.takeRight(-start); 15883 } else if (start) { 15884 result2 = result2.drop(start); 15885 } 15886 if (end !== undefined$1) { 15887 end = toInteger(end); 15888 result2 = end < 0 ? result2.dropRight(-end) : result2.take(end - start); 15889 } 15890 return result2; 15891 }; 15892 LazyWrapper.prototype.takeRightWhile = function(predicate) { 15893 return this.reverse().takeWhile(predicate).reverse(); 15894 }; 15895 LazyWrapper.prototype.toArray = function() { 15896 return this.take(MAX_ARRAY_LENGTH); 15897 }; 15898 baseForOwn(LazyWrapper.prototype, function(func, methodName) { 15899 var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash2[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName); 15900 if (!lodashFunc) { 15901 return; 15902 } 15903 lodash2.prototype[methodName] = function() { 15904 var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray2(value); 15905 var interceptor = function(value2) { 15906 var result3 = lodashFunc.apply(lodash2, arrayPush([value2], args)); 15907 return isTaker && chainAll ? result3[0] : result3; 15908 }; 15909 if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) { 15910 isLazy = useLazy = false;
15911 } 15912 var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid; 15913 if (!retUnwrapped && useLazy) { 15914 value = onlyLazy ? value : new LazyWrapper(this); 15915 var result2 = func.apply(value, args); 15916 result2.__actions__.push({ "func": thru, "args": [interceptor], "thisArg": undefined$1 }); 15917 return new LodashWrapper(result2, chainAll); 15918 } 15919 if (isUnwrapped && onlyLazy) { 15920 return func.apply(this, args); 15921 } 15922 result2 = this.thru(interceptor); 15923 return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2; 15924 }; 15925 }); 15926 arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) { 15927 var func = arrayProto2[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName); 15928 lodash2.prototype[methodName] = function() { 15929 var args = arguments; 15930 if (retUnwrapped && !this.__chain__) { 15931 var value = this.value(); 15932 return func.apply(isArray2(value) ? value : [], args); 15933 } 15934 return this[chainName](function(value2) { 15935 return func.apply(isArray2(value2) ? value2 : [], args); 15936 }); 15937 }; 15938 }); 15939 baseForOwn(LazyWrapper.prototype, function(func, methodName) { 15940 var lodashFunc = lodash2[methodName]; 15941 if (lodashFunc) { 15942 var key = lodashFunc.name + ""; 15943 if (!hasOwnProperty2.call(realNames, key)) { 15944 realNames[key] = []; 15945 } 15946 realNames[key].push({ "name": methodName, "func": lodashFunc }); 15947 } 15948 }); 15949 realNames[createHybrid(undefined$1, WRAP_BIND_KEY_FLAG).name] = [{ 15950 "name": "wrapper", 15951 "func": undefined$1 15952 }]; 15953 LazyWrapper.prototype.clone = lazyClone; 15954 LazyWrapper.prototype.reverse = lazyReverse; 15955 LazyWrapper.prototype.value = lazyValue; 15956 lodash2.prototype.at = wrapperAt; 15957 lodash2.prototype.chain = wrapperChain; 15958 lodash2.prototype.commit = wrapperCommit; 15959 lodash2.prototype.next = wrapperNext; 15960 lodash2.prototype.plant = wrapperPlant; 15961 lodash2.prototype.reverse = wrapperReverse; 15962 lodash2.prototype.toJSON = lodash2.prototype.valueOf = lodash2.prototype.value = wrapperValue; 15963 lodash2.prototype.first = lodash2.prototype.head; 15964 if (symIterator) { 15965 lodash2.prototype[symIterator] = wrapperToIterator; 15966 } 15967 return lodash2; 15968 }); 15969 var _ = runInContext(); 15970 if (freeModule) { 15971 (freeModule.exports = _)._ = _; 15972 freeExports._ = _; 15973 } else { 15974 root._ = _; 15975 } 15976 }).call(lodash); 15977 })(lodash$1, lodash$1.exports); 15978 return lodash$1.exports; 15979} 15980requireLodash(); 15981var define_process_env_default$4 = {}; 15982/*! 15983 * shared v9.14.5 15984 * (c) 2025 kazuya kawaguchi 15985 * Released under the MIT License. 15986 */ 15987function warn$1(msg, err) { 15988 if (typeof console !== "undefined") { 15989 console.warn(`[intlify] ` + msg); 15990 if (err) { 15991 console.warn(err.stack); 15992 } 15993 } 15994} 15995const hasWarned = {}; 15996function warnOnce$1(msg) { 15997 if (!hasWarned[msg]) { 15998 hasWarned[msg] = true; 15999 warn$1(msg); 16000 } 16001} 16002const inBrowser = typeof window !== "undefined"; 16003let mark; 16004let measure; 16005if (define_process_env_default$4.NODE_ENV !== "production") { 16006 const perf2 = inBrowser && window.performance; 16007 if (perf2 && perf2.mark && perf2.measure && perf2.clearMarks && // @ts-ignore browser compat 16008 perf2.clearMeasures) { 16009 mark = (tag2) => { 16010 perf2.mark(tag2); 16011 }; 16012 measure = (name, startTag, endTag) => { 16013 perf2.measure(name, startTag, endTag); 16014 perf2.clearMarks(startTag); 16015 perf2.clearMarks(endTag); 16016 }; 16017 } 16018} 16019const RE_ARGS$1 = /\{([0-9a-zA-Z]+)\}/g; 16020function format$2(message, ...args) { 16021 if (args.length === 1 && isObject$2(args[0])) { 16022 args = args[0]; 16023 } 16024 if (!args || !args.hasOwnProperty) { 16025 args = {}; 16026 } 16027 return message.replace(RE_ARGS$1, (match, identifier) => { 16028 return args.hasOwnProperty(identifier) ? args[identifier] : ""; 16029 }); 16030} 16031const makeSymbol = (name, shareable = false) => !shareable ? Symbol(name) : Symbol.for(name); 16032const generateFormatCacheKey = (locale, key, source) => friendlyJSONstringify({ l: locale, k: key, s: source }); 16033const friendlyJSONstringify = (json) => JSON.stringify(json).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/\u0027/g, "\\u0027"); 16034const isNumber = (val) => typeof val === "number" && isFinite(val); 16035const isDate = (val) => toTypeString(val) === "[object Date]"; 16036const isRegExp = (val) => toTypeString(val) === "[object RegExp]"; 16037const isEmptyObject = (val) => isPlainObject$1(val) && Object.keys(val).length === 0; 16038const assign$2 = Object.assign; 16039const _create = Object.create; 16040const create = (obj = null) => _create(obj); 16041let _globalThis; 16042const getGlobalThis = () => { 16043 return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : create()); 16044}; 16045function escapeHtml(rawText) { 16046 return rawText.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'").replace(/\//g, "/").replace(/=/g, "="); 16047} 16048function escapeAttributeValue(value) { 16049 return value.replace(/&(?![a-zA-Z0-9#]{2,6};)/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">"); 16050} 16051function sanitizeTranslatedHtml(html2) { 16052 html2 = html2.replace(/(\w+)\s*=\s*"([^"]*)"/g, (_, attrName, attrValue) => `${attrName}="${escapeAttributeValue(attrValue)}"`); 16053 html2 = html2.replace(/(\w+)\s*=\s*'([^']*)'/g, (_, attrName, attrValue) => `${attrName}='${escapeAttributeValue(attrValue)}'`); 16054 const eventHandlerPattern = /\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi; 16055 if (eventHandlerPattern.test(html2)) { 16056 if (define_process_env_default$4.NODE_ENV !== "production") { 16057 warn$1("Potentially dangerous event handlers detected in translation. Consider removing onclick, onerror, etc. from your translation messages."); 16058 } 16059 html2 = html2.replace(/(\s+)(on)(\w+\s*=)/gi, "$1on$3"); 16060 } 16061 const javascriptUrlPattern = [ 16062 // In href, src, action, formaction attributes 16063 /(\s+(?:href|src|action|formaction)\s*=\s*["']?)\s*javascript:/gi, 16064 // In style attributes within url() 16065 /(style\s*=\s*["'][^"']*url\s*\(\s*)javascript:/gi 16066 ];
16067 javascriptUrlPattern.forEach((pattern) => { 16068 html2 = html2.replace(pattern, "$1javascript:"); 16069 }); 16070 return html2; 16071} 16072const hasOwnProperty = Object.prototype.hasOwnProperty; 16073function hasOwn(obj, key) { 16074 return hasOwnProperty.call(obj, key); 16075} 16076const isArray = Array.isArray; 16077const isFunction = (val) => typeof val === "function"; 16078const isString$1 = (val) => typeof val === "string"; 16079const isBoolean = (val) => typeof val === "boolean"; 16080const isObject$2 = (val) => val !== null && typeof val === "object"; 16081const isPromise$1 = (val) => { 16082 return isObject$2(val) && isFunction(val.then) && isFunction(val.catch); 16083}; 16084const objectToString = Object.prototype.toString; 16085const toTypeString = (value) => objectToString.call(value); 16086const isPlainObject$1 = (val) => { 16087 if (!isObject$2(val)) 16088 return false; 16089 const proto = Object.getPrototypeOf(val); 16090 return proto === null || proto.constructor === Object; 16091}; 16092const toDisplayString = (val) => { 16093 return val == null ? "" : isArray(val) || isPlainObject$1(val) && val.toString === objectToString ? JSON.stringify(val, null, 2) : String(val); 16094}; 16095function join$1(items, separator = "") { 16096 return items.reduce((str, item, index) => index === 0 ? str + item : str + separator + item, ""); 16097} 16098const RANGE = 2; 16099function generateCodeFrame(source, start = 0, end = source.length) { 16100 const lines = source.split(/\r?\n/); 16101 let count = 0; 16102 const res = []; 16103 for (let i = 0; i < lines.length; i++) { 16104 count += lines[i].length + 1; 16105 if (count >= start) { 16106 for (let j = i - RANGE; j <= i + RANGE || end > count; j++) { 16107 if (j < 0 || j >= lines.length) 16108 continue; 16109 const line = j + 1; 16110 res.push(`${line}${" ".repeat(3 - String(line).length)}| ${lines[j]}`); 16111 const lineLength = lines[j].length; 16112 if (j === i) { 16113 const pad = start - (count - lineLength) + 1; 16114 const length = Math.max(1, end > count ? lineLength - pad : end - start); 16115 res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); 16116 } else if (j > i) { 16117 if (end > count) { 16118 const length = Math.max(Math.min(end - count, lineLength), 1); 16119 res.push(` | ` + "^".repeat(length)); 16120 } 16121 count += lineLength + 1; 16122 } 16123 } 16124 break; 16125 } 16126 } 16127 return res.join("\n"); 16128} 16129function incrementer(code2) { 16130 let current = code2; 16131 return () => ++current; 16132} 16133function createEmitter() { 16134 const events = /* @__PURE__ */ new Map(); 16135 const emitter = { 16136 events, 16137 on(event, handler) { 16138 const handlers2 = events.get(event); 16139 const added = handlers2 && handlers2.push(handler); 16140 if (!added) { 16141 events.set(event, [handler]); 16142 } 16143 }, 16144 off(event, handler) { 16145 const handlers2 = events.get(event); 16146 if (handlers2) { 16147 handlers2.splice(handlers2.indexOf(handler) >>> 0, 1); 16148 } 16149 }, 16150 emit(event, payload) { 16151 (events.get(event) || []).slice().map((handler) => handler(payload)); 16152 (events.get("*") || []).slice().map((handler) => handler(event, payload)); 16153 } 16154 }; 16155 return emitter; 16156} 16157const isNotObjectOrIsArray = (val) => !isObject$2(val) || isArray(val); 16158function deepCopy(src, des) { 16159 if (isNotObjectOrIsArray(src) || isNotObjectOrIsArray(des)) { 16160 throw new Error("Invalid value"); 16161 } 16162 const stack2 = [{ src, des }]; 16163 while (stack2.length) { 16164 const { src: src2, des: des2 } = stack2.pop(); 16165 Object.keys(src2).forEach((key) => { 16166 if (key === "__proto__") { 16167 return; 16168 } 16169 if (isObject$2(src2[key]) && !isObject$2(des2[key])) { 16170 des2[key] = Array.isArray(src2[key]) ? [] : create(); 16171 } 16172 if (isNotObjectOrIsArray(des2[key]) || isNotObjectOrIsArray(src2[key])) { 16173 des2[key] = src2[key]; 16174 } else { 16175 stack2.push({ src: src2[key], des: des2[key] }); 16176 } 16177 }); 16178 } 16179} 16180/*! 16181 * message-compiler v9.14.5 16182 * (c) 2025 kazuya kawaguchi 16183 * Released under the MIT License. 16184 */ 16185function createPosition(line, column, offset) { 16186 return { line, column, offset }; 16187} 16188function createLocation(start, end, source) { 16189 const loc = { start, end }; 16190 return loc; 16191} 16192const RE_ARGS = /\{([0-9a-zA-Z]+)\}/g; 16193function format$1(message, ...args) { 16194 if (args.length === 1 && isObject$1(args[0])) { 16195 args = args[0]; 16196 } 16197 if (!args || !args.hasOwnProperty) { 16198 args = {}; 16199 } 16200 return message.replace(RE_ARGS, (match, identifier) => { 16201 return args.hasOwnProperty(identifier) ? args[identifier] : ""; 16202 }); 16203} 16204const assign$1 = Object.assign; 16205const isString = (val) => typeof val === "string"; 16206const isObject$1 = (val) => val !== null && typeof val === "object"; 16207function join(items, separator = "") { 16208 return items.reduce((str, item, index) => index === 0 ? str + item : str + separator + item, ""); 16209} 16210const CompileWarnCodes = { 16211 USE_MODULO_SYNTAX: 1, 16212 __EXTEND_POINT__: 2 16213}; 16214const warnMessages$2 = { 16215 [CompileWarnCodes.USE_MODULO_SYNTAX]: `Use modulo before '{{0}}'.` 16216}; 16217function createCompileWarn(code2, loc, ...args) { 16218 const msg = format$1(warnMessages$2[code2], ...args || []); 16219 const message = { message: String(msg), code: code2 }; 16220 if (loc) { 16221 message.location = loc; 16222 } 16223 return message; 16224} 16225const CompileErrorCodes = { 16226 // tokenizer error codes 16227 EXPECTED_TOKEN: 1, 16228 INVALID_TOKEN_IN_PLACEHOLDER: 2, 16229 UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER: 3, 16230 UNKNOWN_ESCAPE_SEQUENCE: 4, 16231 INVALID_UNICODE_ESCAPE_SEQUENCE: 5, 16232 UNBALANCED_CLOSING_BRACE: 6,
vendor: 13,495 bytes, lines 16233-16709
16233 UNTERMINATED_CLOSING_BRACE: 7, 16234 EMPTY_PLACEHOLDER: 8, 16235 NOT_ALLOW_NEST_PLACEHOLDER: 9, 16236 INVALID_LINKED_FORMAT: 10, 16237 // parser error codes 16238 MUST_HAVE_MESSAGES_IN_PLURAL: 11, 16239 UNEXPECTED_EMPTY_LINKED_MODIFIER: 12, 16240 UNEXPECTED_EMPTY_LINKED_KEY: 13, 16241 UNEXPECTED_LEXICAL_ANALYSIS: 14, 16242 // generator error codes 16243 UNHANDLED_CODEGEN_NODE_TYPE: 15, 16244 // minifier error codes 16245 UNHANDLED_MINIFIER_NODE_TYPE: 16, 16246 // Special value for higher-order compilers to pick up the last code 16247 // to avoid collision of error codes. This should always be kept as the last 16248 // item. 16249 __EXTEND_POINT__: 17 16250}; 16251const errorMessages$2 = { 16252 // tokenizer error messages 16253 [CompileErrorCodes.EXPECTED_TOKEN]: `Expected token: '{0}'`, 16254 [CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER]: `Invalid token in placeholder: '{0}'`, 16255 [CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER]: `Unterminated single quote in placeholder`, 16256 [CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE]: `Unknown escape sequence: \\{0}`, 16257 [CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE]: `Invalid unicode escape sequence: {0}`, 16258 [CompileErrorCodes.UNBALANCED_CLOSING_BRACE]: `Unbalanced closing brace`, 16259 [CompileErrorCodes.UNTERMINATED_CLOSING_BRACE]: `Unterminated closing brace`, 16260 [CompileErrorCodes.EMPTY_PLACEHOLDER]: `Empty placeholder`, 16261 [CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER]: `Not allowed nest placeholder`, 16262 [CompileErrorCodes.INVALID_LINKED_FORMAT]: `Invalid linked format`, 16263 // parser error messages 16264 [CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL]: `Plural must have messages`, 16265 [CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER]: `Unexpected empty linked modifier`, 16266 [CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY]: `Unexpected empty linked key`, 16267 [CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS]: `Unexpected lexical analysis in token: '{0}'`, 16268 // generator error messages 16269 [CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE]: `unhandled codegen node type: '{0}'`, 16270 // minimizer error messages 16271 [CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE]: `unhandled mimifier node type: '{0}'` 16272}; 16273function createCompileError(code2, loc, options = {}) { 16274 const { domain, messages, args } = options; 16275 const msg = format$1((messages || errorMessages$2)[code2] || "", ...args || []); 16276 const error2 = new SyntaxError(String(msg)); 16277 error2.code = code2; 16278 if (loc) { 16279 error2.location = loc; 16280 } 16281 error2.domain = domain; 16282 return error2; 16283} 16284function defaultOnError(error2) { 16285 throw error2; 16286} 16287const RE_HTML_TAG = /<\/?[\w\s="/.':;#-\/]+>/; 16288const detectHtmlTag = (source) => RE_HTML_TAG.test(source); 16289const CHAR_SP = " "; 16290const CHAR_CR = "\r"; 16291const CHAR_LF = "\n"; 16292const CHAR_LS = String.fromCharCode(8232); 16293const CHAR_PS = String.fromCharCode(8233); 16294function createScanner(str) { 16295 const _buf = str; 16296 let _index = 0; 16297 let _line = 1; 16298 let _column = 1; 16299 let _peekOffset = 0; 16300 const isCRLF = (index2) => _buf[index2] === CHAR_CR && _buf[index2 + 1] === CHAR_LF; 16301 const isLF = (index2) => _buf[index2] === CHAR_LF; 16302 const isPS = (index2) => _buf[index2] === CHAR_PS; 16303 const isLS = (index2) => _buf[index2] === CHAR_LS; 16304 const isLineEnd = (index2) => isCRLF(index2) || isLF(index2) || isPS(index2) || isLS(index2); 16305 const index = () => _index; 16306 const line = () => _line; 16307 const column = () => _column; 16308 const peekOffset = () => _peekOffset; 16309 const charAt = (offset) => isCRLF(offset) || isPS(offset) || isLS(offset) ? CHAR_LF : _buf[offset]; 16310 const currentChar = () => charAt(_index); 16311 const currentPeek = () => charAt(_index + _peekOffset); 16312 function next() { 16313 _peekOffset = 0; 16314 if (isLineEnd(_index)) { 16315 _line++; 16316 _column = 0; 16317 } 16318 if (isCRLF(_index)) { 16319 _index++; 16320 } 16321 _index++; 16322 _column++; 16323 return _buf[_index]; 16324 } 16325 function peek() { 16326 if (isCRLF(_index + _peekOffset)) { 16327 _peekOffset++; 16328 } 16329 _peekOffset++; 16330 return _buf[_index + _peekOffset]; 16331 } 16332 function reset() { 16333 _index = 0; 16334 _line = 1; 16335 _column = 1; 16336 _peekOffset = 0; 16337 } 16338 function resetPeek(offset = 0) { 16339 _peekOffset = offset; 16340 } 16341 function skipToPeek() { 16342 const target = _index + _peekOffset; 16343 while (target !== _index) { 16344 next(); 16345 } 16346 _peekOffset = 0; 16347 } 16348 return { 16349 index, 16350 line, 16351 column, 16352 peekOffset, 16353 charAt, 16354 currentChar, 16355 currentPeek, 16356 next, 16357 peek, 16358 reset, 16359 resetPeek, 16360 skipToPeek 16361 }; 16362} 16363const EOF = void 0; 16364const DOT = "."; 16365const LITERAL_DELIMITER = "'"; 16366const ERROR_DOMAIN$3 = "tokenizer"; 16367function createTokenizer(source, options = {}) { 16368 const location = options.location !== false; 16369 const _scnr = createScanner(source); 16370 const currentOffset = () => _scnr.index(); 16371 const currentPosition = () => createPosition(_scnr.line(), _scnr.column(), _scnr.index()); 16372 const _initLoc = currentPosition(); 16373 const _initOffset = currentOffset(); 16374 const _context = { 16375 currentType: 14, 16376 offset: _initOffset, 16377 startLoc: _initLoc, 16378 endLoc: _initLoc, 16379 lastType: 14, 16380 lastOffset: _initOffset, 16381 lastStartLoc: _initLoc, 16382 lastEndLoc: _initLoc, 16383 braceNest: 0, 16384 inLinked: false, 16385 text: "" 16386 }; 16387 const context = () => _context; 16388 const { onError } = options; 16389 function emitError(code2, pos, offset, ...args) { 16390 const ctx = context(); 16391 pos.column += offset; 16392 pos.offset += offset; 16393 if (onError) { 16394 const loc = location ? createLocation(ctx.startLoc, pos) : null; 16395 const err = createCompileError(code2, loc, { 16396 domain: ERROR_DOMAIN$3, 16397 args 16398 }); 16399 onError(err); 16400 } 16401 } 16402 function getToken(context2, type, value) { 16403 context2.endLoc = currentPosition(); 16404 context2.currentType = type; 16405 const token = { type }; 16406 if (location) { 16407 token.loc = createLocation(context2.startLoc, context2.endLoc); 16408 } 16409 if (value != null) { 16410 token.value = value; 16411 } 16412 return token; 16413 } 16414 const getEndToken = (context2) => getToken( 16415 context2, 16416 14 16417 /* TokenTypes.EOF */ 16418 ); 16419 function eat(scnr, ch) { 16420 if (scnr.currentChar() === ch) { 16421 scnr.next(); 16422 return ch; 16423 } else { 16424 emitError(CompileErrorCodes.EXPECTED_TOKEN, currentPosition(), 0, ch); 16425 return ""; 16426 } 16427 } 16428 function peekSpaces(scnr) { 16429 let buf = ""; 16430 while (scnr.currentPeek() === CHAR_SP || scnr.currentPeek() === CHAR_LF) { 16431 buf += scnr.currentPeek(); 16432 scnr.peek(); 16433 } 16434 return buf; 16435 } 16436 function skipSpaces(scnr) { 16437 const buf = peekSpaces(scnr); 16438 scnr.skipToPeek(); 16439 return buf; 16440 } 16441 function isIdentifierStart(ch) { 16442 if (ch === EOF) { 16443 return false; 16444 } 16445 const cc = ch.charCodeAt(0); 16446 return cc >= 97 && cc <= 122 || // a-z 16447 cc >= 65 && cc <= 90 || // A-Z 16448 cc === 95; 16449 } 16450 function isNumberStart(ch) { 16451 if (ch === EOF) { 16452 return false; 16453 } 16454 const cc = ch.charCodeAt(0); 16455 return cc >= 48 && cc <= 57; 16456 } 16457 function isNamedIdentifierStart(scnr, context2) { 16458 const { currentType } = context2; 16459 if (currentType !== 2) { 16460 return false; 16461 } 16462 peekSpaces(scnr); 16463 const ret = isIdentifierStart(scnr.currentPeek()); 16464 scnr.resetPeek(); 16465 return ret; 16466 } 16467 function isListIdentifierStart(scnr, context2) { 16468 const { currentType } = context2; 16469 if (currentType !== 2) { 16470 return false; 16471 } 16472 peekSpaces(scnr); 16473 const ch = scnr.currentPeek() === "-" ? scnr.peek() : scnr.currentPeek(); 16474 const ret = isNumberStart(ch); 16475 scnr.resetPeek(); 16476 return ret; 16477 } 16478 function isLiteralStart(scnr, context2) { 16479 const { currentType } = context2; 16480 if (currentType !== 2) { 16481 return false; 16482 } 16483 peekSpaces(scnr); 16484 const ret = scnr.currentPeek() === LITERAL_DELIMITER; 16485 scnr.resetPeek(); 16486 return ret; 16487 } 16488 function isLinkedDotStart(scnr, context2) { 16489 const { currentType } = context2; 16490 if (currentType !== 8) { 16491 return false; 16492 } 16493 peekSpaces(scnr); 16494 const ret = scnr.currentPeek() === "."; 16495 scnr.resetPeek(); 16496 return ret; 16497 } 16498 function isLinkedModifierStart(scnr, context2) { 16499 const { currentType } = context2; 16500 if (currentType !== 9) { 16501 return false; 16502 } 16503 peekSpaces(scnr); 16504 const ret = isIdentifierStart(scnr.currentPeek()); 16505 scnr.resetPeek(); 16506 return ret; 16507 } 16508 function isLinkedDelimiterStart(scnr, context2) { 16509 const { currentType } = context2; 16510 if (!(currentType === 8 || currentType === 12)) { 16511 return false; 16512 } 16513 peekSpaces(scnr); 16514 const ret = scnr.currentPeek() === ":"; 16515 scnr.resetPeek(); 16516 return ret; 16517 } 16518 function isLinkedReferStart(scnr, context2) { 16519 const { currentType } = context2; 16520 if (currentType !== 10) { 16521 return false; 16522 } 16523 const fn = () => { 16524 const ch = scnr.currentPeek(); 16525 if (ch === "{") { 16526 return isIdentifierStart(scnr.peek()); 16527 } else if (ch === "@" || ch === "%" || ch === "|" || ch === ":" || ch === "." || ch === CHAR_SP || !ch) { 16528 return false; 16529 } else if (ch === CHAR_LF) { 16530 scnr.peek(); 16531 return fn(); 16532 } else { 16533 return isTextStart(scnr, false); 16534 } 16535 }; 16536 const ret = fn(); 16537 scnr.resetPeek(); 16538 return ret; 16539 } 16540 function isPluralStart(scnr) { 16541 peekSpaces(scnr); 16542 const ret = scnr.currentPeek() === "|"; 16543 scnr.resetPeek(); 16544 return ret; 16545 } 16546 function detectModuloStart(scnr) { 16547 const spaces = peekSpaces(scnr); 16548 const ret = scnr.currentPeek() === "%" && scnr.peek() === "{"; 16549 scnr.resetPeek(); 16550 return { 16551 isModulo: ret, 16552 hasSpace: spaces.length > 0 16553 }; 16554 } 16555 function isTextStart(scnr, reset = true) { 16556 const fn = (hasSpace = false, prev = "", detectModulo = false) => { 16557 const ch = scnr.currentPeek(); 16558 if (ch === "{") { 16559 return prev === "%" ? false : hasSpace; 16560 } else if (ch === "@" || !ch) { 16561 return prev === "%" ? true : hasSpace; 16562 } else if (ch === "%") { 16563 scnr.peek(); 16564 return fn(hasSpace, "%", true); 16565 } else if (ch === "|") { 16566 return prev === "%" || detectModulo ? true : !(prev === CHAR_SP || prev === CHAR_LF); 16567 } else if (ch === CHAR_SP) { 16568 scnr.peek(); 16569 return fn(true, CHAR_SP, detectModulo); 16570 } else if (ch === CHAR_LF) { 16571 scnr.peek(); 16572 return fn(true, CHAR_LF, detectModulo); 16573 } else { 16574 return true; 16575 } 16576 }; 16577 const ret = fn(); 16578 reset && scnr.resetPeek(); 16579 return ret; 16580 } 16581 function takeChar(scnr, fn) { 16582 const ch = scnr.currentChar(); 16583 if (ch === EOF) { 16584 return EOF; 16585 } 16586 if (fn(ch)) { 16587 scnr.next(); 16588 return ch; 16589 } 16590 return null; 16591 } 16592 function isIdentifier(ch) { 16593 const cc = ch.charCodeAt(0); 16594 return cc >= 97 && cc <= 122 || // a-z 16595 cc >= 65 && cc <= 90 || // A-Z 16596 cc >= 48 && cc <= 57 || // 0-9 16597 cc === 95 || // _ 16598 cc === 36; 16599 } 16600 function takeIdentifierChar(scnr) { 16601 return takeChar(scnr, isIdentifier); 16602 } 16603 function isNamedIdentifier(ch) { 16604 const cc = ch.charCodeAt(0); 16605 return cc >= 97 && cc <= 122 || // a-z 16606 cc >= 65 && cc <= 90 || // A-Z 16607 cc >= 48 && cc <= 57 || // 0-9 16608 cc === 95 || // _ 16609 cc === 36 || // $ 16610 cc === 45; 16611 } 16612 function takeNamedIdentifierChar(scnr) { 16613 return takeChar(scnr, isNamedIdentifier); 16614 } 16615 function isDigit(ch) { 16616 const cc = ch.charCodeAt(0); 16617 return cc >= 48 && cc <= 57; 16618 } 16619 function takeDigit(scnr) { 16620 return takeChar(scnr, isDigit); 16621 } 16622 function isHexDigit(ch) { 16623 const cc = ch.charCodeAt(0); 16624 return cc >= 48 && cc <= 57 || // 0-9 16625 cc >= 65 && cc <= 70 || // A-F 16626 cc >= 97 && cc <= 102; 16627 } 16628 function takeHexDigit(scnr) { 16629 return takeChar(scnr, isHexDigit); 16630 } 16631 function getDigits(scnr) { 16632 let ch = ""; 16633 let num = ""; 16634 while (ch = takeDigit(scnr)) { 16635 num += ch; 16636 } 16637 return num; 16638 } 16639 function readModulo(scnr) { 16640 skipSpaces(scnr); 16641 const ch = scnr.currentChar(); 16642 if (ch !== "%") { 16643 emitError(CompileErrorCodes.EXPECTED_TOKEN, currentPosition(), 0, ch); 16644 } 16645 scnr.next(); 16646 return "%"; 16647 } 16648 function readText(scnr) { 16649 let buf = ""; 16650 while (true) { 16651 const ch = scnr.currentChar(); 16652 if (ch === "{" || ch === "}" || ch === "@" || ch === "|" || !ch) { 16653 break; 16654 } else if (ch === "%") { 16655 if (isTextStart(scnr)) { 16656 buf += ch; 16657 scnr.next(); 16658 } else { 16659 break; 16660 } 16661 } else if (ch === CHAR_SP || ch === CHAR_LF) { 16662 if (isTextStart(scnr)) { 16663 buf += ch; 16664 scnr.next(); 16665 } else if (isPluralStart(scnr)) { 16666 break; 16667 } else { 16668 buf += ch; 16669 scnr.next(); 16670 } 16671 } else { 16672 buf += ch; 16673 scnr.next(); 16674 } 16675 } 16676 return buf; 16677 } 16678 function readNamedIdentifier(scnr) { 16679 skipSpaces(scnr); 16680 let ch = ""; 16681 let name = ""; 16682 while (ch = takeNamedIdentifierChar(scnr)) { 16683 name += ch; 16684 } 16685 if (scnr.currentChar() === EOF) { 16686 emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0); 16687 } 16688 return name; 16689 } 16690 function readListIdentifier(scnr) { 16691 skipSpaces(scnr); 16692 let value = ""; 16693 if (scnr.currentChar() === "-") { 16694 scnr.next(); 16695 value += `-${getDigits(scnr)}`; 16696 } else { 16697 value += getDigits(scnr); 16698 } 16699 if (scnr.currentChar() === EOF) { 16700 emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0); 16701 } 16702 return value; 16703 } 16704 function isLiteral2(ch) { 16705 return ch !== LITERAL_DELIMITER && ch !== CHAR_LF; 16706 } 16707 function readLiteral(scnr) { 16708 skipSpaces(scnr); 16709 eat(scnr, `'`);
vendor: 4,365 bytes, lines 16710-16861
16710 let ch = ""; 16711 let literal = ""; 16712 while (ch = takeChar(scnr, isLiteral2)) { 16713 if (ch === "\\") { 16714 literal += readEscapeSequence(scnr); 16715 } else { 16716 literal += ch; 16717 } 16718 } 16719 const current = scnr.currentChar(); 16720 if (current === CHAR_LF || current === EOF) { 16721 emitError(CompileErrorCodes.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER, currentPosition(), 0); 16722 if (current === CHAR_LF) { 16723 scnr.next(); 16724 eat(scnr, `'`); 16725 } 16726 return literal; 16727 } 16728 eat(scnr, `'`); 16729 return literal; 16730 } 16731 function readEscapeSequence(scnr) { 16732 const ch = scnr.currentChar(); 16733 switch (ch) { 16734 case "\\": 16735 case `'`: 16736 scnr.next(); 16737 return `\\${ch}`; 16738 case "u": 16739 return readUnicodeEscapeSequence(scnr, ch, 4); 16740 case "U": 16741 return readUnicodeEscapeSequence(scnr, ch, 6); 16742 default: 16743 emitError(CompileErrorCodes.UNKNOWN_ESCAPE_SEQUENCE, currentPosition(), 0, ch); 16744 return ""; 16745 } 16746 } 16747 function readUnicodeEscapeSequence(scnr, unicode, digits) { 16748 eat(scnr, unicode); 16749 let sequence = ""; 16750 for (let i = 0; i < digits; i++) { 16751 const ch = takeHexDigit(scnr); 16752 if (!ch) { 16753 emitError(CompileErrorCodes.INVALID_UNICODE_ESCAPE_SEQUENCE, currentPosition(), 0, `\\${unicode}${sequence}${scnr.currentChar()}`); 16754 break; 16755 } 16756 sequence += ch; 16757 } 16758 return `\\${unicode}${sequence}`; 16759 } 16760 function isInvalidIdentifier(ch) { 16761 return ch !== "{" && ch !== "}" && ch !== CHAR_SP && ch !== CHAR_LF; 16762 } 16763 function readInvalidIdentifier(scnr) { 16764 skipSpaces(scnr); 16765 let ch = ""; 16766 let identifiers = ""; 16767 while (ch = takeChar(scnr, isInvalidIdentifier)) { 16768 identifiers += ch; 16769 } 16770 return identifiers; 16771 } 16772 function readLinkedModifier(scnr) { 16773 let ch = ""; 16774 let name = ""; 16775 while (ch = takeIdentifierChar(scnr)) { 16776 name += ch; 16777 } 16778 return name; 16779 } 16780 function readLinkedRefer(scnr) { 16781 const fn = (buf) => { 16782 const ch = scnr.currentChar(); 16783 if (ch === "{" || ch === "%" || ch === "@" || ch === "|" || ch === "(" || ch === ")" || !ch) { 16784 return buf; 16785 } else if (ch === CHAR_SP) { 16786 return buf; 16787 } else if (ch === CHAR_LF || ch === DOT) { 16788 buf += ch; 16789 scnr.next(); 16790 return fn(buf); 16791 } else { 16792 buf += ch; 16793 scnr.next(); 16794 return fn(buf); 16795 } 16796 }; 16797 return fn(""); 16798 } 16799 function readPlural(scnr) { 16800 skipSpaces(scnr); 16801 const plural = eat( 16802 scnr, 16803 "|" 16804 /* TokenChars.Pipe */ 16805 ); 16806 skipSpaces(scnr); 16807 return plural; 16808 } 16809 function readTokenInPlaceholder(scnr, context2) { 16810 let token = null; 16811 const ch = scnr.currentChar(); 16812 switch (ch) { 16813 case "{": 16814 if (context2.braceNest >= 1) { 16815 emitError(CompileErrorCodes.NOT_ALLOW_NEST_PLACEHOLDER, currentPosition(), 0); 16816 } 16817 scnr.next(); 16818 token = getToken( 16819 context2, 16820 2, 16821 "{" 16822 /* TokenChars.BraceLeft */ 16823 ); 16824 skipSpaces(scnr); 16825 context2.braceNest++; 16826 return token; 16827 case "}": 16828 if (context2.braceNest > 0 && context2.currentType === 2) { 16829 emitError(CompileErrorCodes.EMPTY_PLACEHOLDER, currentPosition(), 0); 16830 } 16831 scnr.next(); 16832 token = getToken( 16833 context2, 16834 3, 16835 "}" 16836 /* TokenChars.BraceRight */ 16837 ); 16838 context2.braceNest--; 16839 context2.braceNest > 0 && skipSpaces(scnr); 16840 if (context2.inLinked && context2.braceNest === 0) { 16841 context2.inLinked = false; 16842 } 16843 return token; 16844 case "@": 16845 if (context2.braceNest > 0) { 16846 emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0); 16847 } 16848 token = readTokenInLinked(scnr, context2) || getEndToken(context2); 16849 context2.braceNest = 0; 16850 return token; 16851 default: { 16852 let validNamedIdentifier = true; 16853 let validListIdentifier = true; 16854 let validLiteral = true; 16855 if (isPluralStart(scnr)) { 16856 if (context2.braceNest > 0) { 16857 emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0); 16858 } 16859 token = getToken(context2, 1, readPlural(scnr)); 16860 context2.braceNest = 0; 16861 context2.inLinked = false;
vendor: 26,698 bytes, lines 16862-17734
16862 return token; 16863 } 16864 if (context2.braceNest > 0 && (context2.currentType === 5 || context2.currentType === 6 || context2.currentType === 7)) { 16865 emitError(CompileErrorCodes.UNTERMINATED_CLOSING_BRACE, currentPosition(), 0); 16866 context2.braceNest = 0; 16867 return readToken(scnr, context2); 16868 } 16869 if (validNamedIdentifier = isNamedIdentifierStart(scnr, context2)) { 16870 token = getToken(context2, 5, readNamedIdentifier(scnr)); 16871 skipSpaces(scnr); 16872 return token; 16873 } 16874 if (validListIdentifier = isListIdentifierStart(scnr, context2)) { 16875 token = getToken(context2, 6, readListIdentifier(scnr)); 16876 skipSpaces(scnr); 16877 return token; 16878 } 16879 if (validLiteral = isLiteralStart(scnr, context2)) { 16880 token = getToken(context2, 7, readLiteral(scnr)); 16881 skipSpaces(scnr); 16882 return token; 16883 } 16884 if (!validNamedIdentifier && !validListIdentifier && !validLiteral) { 16885 token = getToken(context2, 13, readInvalidIdentifier(scnr)); 16886 emitError(CompileErrorCodes.INVALID_TOKEN_IN_PLACEHOLDER, currentPosition(), 0, token.value); 16887 skipSpaces(scnr); 16888 return token; 16889 } 16890 break; 16891 } 16892 } 16893 return token; 16894 } 16895 function readTokenInLinked(scnr, context2) { 16896 const { currentType } = context2; 16897 let token = null; 16898 const ch = scnr.currentChar(); 16899 if ((currentType === 8 || currentType === 9 || currentType === 12 || currentType === 10) && (ch === CHAR_LF || ch === CHAR_SP)) { 16900 emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0); 16901 } 16902 switch (ch) { 16903 case "@": 16904 scnr.next(); 16905 token = getToken( 16906 context2, 16907 8, 16908 "@" 16909 /* TokenChars.LinkedAlias */ 16910 ); 16911 context2.inLinked = true; 16912 return token; 16913 case ".": 16914 skipSpaces(scnr); 16915 scnr.next(); 16916 return getToken( 16917 context2, 16918 9, 16919 "." 16920 /* TokenChars.LinkedDot */ 16921 ); 16922 case ":": 16923 skipSpaces(scnr); 16924 scnr.next(); 16925 return getToken( 16926 context2, 16927 10, 16928 ":" 16929 /* TokenChars.LinkedDelimiter */ 16930 ); 16931 default: 16932 if (isPluralStart(scnr)) { 16933 token = getToken(context2, 1, readPlural(scnr)); 16934 context2.braceNest = 0; 16935 context2.inLinked = false; 16936 return token; 16937 } 16938 if (isLinkedDotStart(scnr, context2) || isLinkedDelimiterStart(scnr, context2)) { 16939 skipSpaces(scnr); 16940 return readTokenInLinked(scnr, context2); 16941 } 16942 if (isLinkedModifierStart(scnr, context2)) { 16943 skipSpaces(scnr); 16944 return getToken(context2, 12, readLinkedModifier(scnr)); 16945 } 16946 if (isLinkedReferStart(scnr, context2)) { 16947 skipSpaces(scnr); 16948 if (ch === "{") { 16949 return readTokenInPlaceholder(scnr, context2) || token; 16950 } else { 16951 return getToken(context2, 11, readLinkedRefer(scnr)); 16952 } 16953 } 16954 if (currentType === 8) { 16955 emitError(CompileErrorCodes.INVALID_LINKED_FORMAT, currentPosition(), 0); 16956 } 16957 context2.braceNest = 0; 16958 context2.inLinked = false; 16959 return readToken(scnr, context2); 16960 } 16961 } 16962 function readToken(scnr, context2) { 16963 let token = { 16964 type: 14 16965 /* TokenTypes.EOF */ 16966 }; 16967 if (context2.braceNest > 0) { 16968 return readTokenInPlaceholder(scnr, context2) || getEndToken(context2); 16969 } 16970 if (context2.inLinked) { 16971 return readTokenInLinked(scnr, context2) || getEndToken(context2); 16972 } 16973 const ch = scnr.currentChar(); 16974 switch (ch) { 16975 case "{": 16976 return readTokenInPlaceholder(scnr, context2) || getEndToken(context2); 16977 case "}": 16978 emitError(CompileErrorCodes.UNBALANCED_CLOSING_BRACE, currentPosition(), 0); 16979 scnr.next(); 16980 return getToken( 16981 context2, 16982 3, 16983 "}" 16984 /* TokenChars.BraceRight */ 16985 ); 16986 case "@": 16987 return readTokenInLinked(scnr, context2) || getEndToken(context2); 16988 default: { 16989 if (isPluralStart(scnr)) { 16990 token = getToken(context2, 1, readPlural(scnr)); 16991 context2.braceNest = 0; 16992 context2.inLinked = false; 16993 return token; 16994 } 16995 const { isModulo, hasSpace } = detectModuloStart(scnr); 16996 if (isModulo) { 16997 return hasSpace ? getToken(context2, 0, readText(scnr)) : getToken(context2, 4, readModulo(scnr)); 16998 } 16999 if (isTextStart(scnr)) { 17000 return getToken(context2, 0, readText(scnr)); 17001 } 17002 break; 17003 } 17004 } 17005 return token; 17006 } 17007 function nextToken() { 17008 const { currentType, offset, startLoc, endLoc } = _context; 17009 _context.lastType = currentType; 17010 _context.lastOffset = offset; 17011 _context.lastStartLoc = startLoc; 17012 _context.lastEndLoc = endLoc; 17013 _context.offset = currentOffset(); 17014 _context.startLoc = currentPosition(); 17015 if (_scnr.currentChar() === EOF) { 17016 return getToken( 17017 _context, 17018 14 17019 /* TokenTypes.EOF */ 17020 ); 17021 } 17022 return readToken(_scnr, _context); 17023 } 17024 return { 17025 nextToken, 17026 currentOffset, 17027 currentPosition, 17028 context 17029 }; 17030} 17031const ERROR_DOMAIN$2 = "parser"; 17032const KNOWN_ESCAPES = /(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g; 17033function fromEscapeSequence(match, codePoint4, codePoint6) { 17034 switch (match) { 17035 case `\\\\`: 17036 return `\\`; 17037 // eslint-disable-next-line no-useless-escape 17038 case `\\'`: 17039 return `'`; 17040 default: { 17041 const codePoint = parseInt(codePoint4 || codePoint6, 16); 17042 if (codePoint <= 55295 || codePoint >= 57344) { 17043 return String.fromCodePoint(codePoint); 17044 } 17045 return "�"; 17046 } 17047 } 17048} 17049function createParser(options = {}) { 17050 const location = options.location !== false; 17051 const { onError, onWarn } = options; 17052 function emitError(tokenzer, code2, start, offset, ...args) { 17053 const end = tokenzer.currentPosition(); 17054 end.offset += offset; 17055 end.column += offset; 17056 if (onError) { 17057 const loc = location ? createLocation(start, end) : null; 17058 const err = createCompileError(code2, loc, { 17059 domain: ERROR_DOMAIN$2, 17060 args 17061 }); 17062 onError(err); 17063 } 17064 } 17065 function emitWarn(tokenzer, code2, start, offset, ...args) { 17066 const end = tokenzer.currentPosition(); 17067 end.offset += offset; 17068 end.column += offset; 17069 if (onWarn) { 17070 const loc = location ? createLocation(start, end) : null; 17071 onWarn(createCompileWarn(code2, loc, args)); 17072 } 17073 } 17074 function startNode(type, offset, loc) { 17075 const node = { type }; 17076 if (location) { 17077 node.start = offset; 17078 node.end = offset; 17079 node.loc = { start: loc, end: loc }; 17080 } 17081 return node; 17082 } 17083 function endNode(node, offset, pos, type) { 17084 if (location) { 17085 node.end = offset; 17086 if (node.loc) { 17087 node.loc.end = pos; 17088 } 17089 } 17090 } 17091 function parseText(tokenizer, value) { 17092 const context = tokenizer.context(); 17093 const node = startNode(3, context.offset, context.startLoc); 17094 node.value = value; 17095 endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition()); 17096 return node; 17097 } 17098 function parseList(tokenizer, index) { 17099 const context = tokenizer.context(); 17100 const { lastOffset: offset, lastStartLoc: loc } = context; 17101 const node = startNode(5, offset, loc); 17102 node.index = parseInt(index, 10); 17103 tokenizer.nextToken(); 17104 endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition()); 17105 return node; 17106 } 17107 function parseNamed(tokenizer, key, modulo) { 17108 const context = tokenizer.context(); 17109 const { lastOffset: offset, lastStartLoc: loc } = context; 17110 const node = startNode(4, offset, loc); 17111 node.key = key; 17112 if (modulo === true) { 17113 node.modulo = true; 17114 } 17115 tokenizer.nextToken(); 17116 endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition()); 17117 return node; 17118 } 17119 function parseLiteral(tokenizer, value) { 17120 const context = tokenizer.context(); 17121 const { lastOffset: offset, lastStartLoc: loc } = context; 17122 const node = startNode(9, offset, loc); 17123 node.value = value.replace(KNOWN_ESCAPES, fromEscapeSequence); 17124 tokenizer.nextToken(); 17125 endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition()); 17126 return node; 17127 } 17128 function parseLinkedModifier(tokenizer) { 17129 const token = tokenizer.nextToken(); 17130 const context = tokenizer.context(); 17131 const { lastOffset: offset, lastStartLoc: loc } = context; 17132 const node = startNode(8, offset, loc); 17133 if (token.type !== 12) { 17134 emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_MODIFIER, context.lastStartLoc, 0); 17135 node.value = ""; 17136 endNode(node, offset, loc); 17137 return { 17138 nextConsumeToken: token, 17139 node 17140 }; 17141 } 17142 if (token.value == null) { 17143 emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token)); 17144 } 17145 node.value = token.value || ""; 17146 endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition()); 17147 return { 17148 node 17149 }; 17150 } 17151 function parseLinkedKey(tokenizer, value) { 17152 const context = tokenizer.context(); 17153 const node = startNode(7, context.offset, context.startLoc); 17154 node.value = value; 17155 endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition()); 17156 return node; 17157 } 17158 function parseLinked(tokenizer) { 17159 const context = tokenizer.context(); 17160 const linkedNode = startNode(6, context.offset, context.startLoc); 17161 let token = tokenizer.nextToken(); 17162 if (token.type === 9) { 17163 const parsed = parseLinkedModifier(tokenizer); 17164 linkedNode.modifier = parsed.node; 17165 token = parsed.nextConsumeToken || tokenizer.nextToken(); 17166 } 17167 if (token.type !== 10) { 17168 emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token)); 17169 } 17170 token = tokenizer.nextToken(); 17171 if (token.type === 2) { 17172 token = tokenizer.nextToken(); 17173 } 17174 switch (token.type) { 17175 case 11: 17176 if (token.value == null) { 17177 emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token)); 17178 } 17179 linkedNode.key = parseLinkedKey(tokenizer, token.value || ""); 17180 break; 17181 case 5: 17182 if (token.value == null) { 17183 emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token)); 17184 } 17185 linkedNode.key = parseNamed(tokenizer, token.value || ""); 17186 break; 17187 case 6: 17188 if (token.value == null) { 17189 emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token)); 17190 } 17191 linkedNode.key = parseList(tokenizer, token.value || ""); 17192 break; 17193 case 7: 17194 if (token.value == null) { 17195 emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token)); 17196 } 17197 linkedNode.key = parseLiteral(tokenizer, token.value || ""); 17198 break; 17199 default: { 17200 emitError(tokenizer, CompileErrorCodes.UNEXPECTED_EMPTY_LINKED_KEY, context.lastStartLoc, 0); 17201 const nextContext = tokenizer.context(); 17202 const emptyLinkedKeyNode = startNode(7, nextContext.offset, nextContext.startLoc); 17203 emptyLinkedKeyNode.value = ""; 17204 endNode(emptyLinkedKeyNode, nextContext.offset, nextContext.startLoc); 17205 linkedNode.key = emptyLinkedKeyNode; 17206 endNode(linkedNode, nextContext.offset, nextContext.startLoc); 17207 return { 17208 nextConsumeToken: token, 17209 node: linkedNode 17210 }; 17211 } 17212 } 17213 endNode(linkedNode, tokenizer.currentOffset(), tokenizer.currentPosition()); 17214 return { 17215 node: linkedNode 17216 }; 17217 } 17218 function parseMessage(tokenizer) { 17219 const context = tokenizer.context(); 17220 const startOffset = context.currentType === 1 ? tokenizer.currentOffset() : context.offset; 17221 const startLoc = context.currentType === 1 ? context.endLoc : context.startLoc; 17222 const node = startNode(2, startOffset, startLoc); 17223 node.items = []; 17224 let nextToken = null; 17225 let modulo = null; 17226 do { 17227 const token = nextToken || tokenizer.nextToken(); 17228 nextToken = null; 17229 switch (token.type) { 17230 case 0: 17231 if (token.value == null) { 17232 emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token)); 17233 } 17234 node.items.push(parseText(tokenizer, token.value || "")); 17235 break; 17236 case 6: 17237 if (token.value == null) { 17238 emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token)); 17239 } 17240 node.items.push(parseList(tokenizer, token.value || "")); 17241 break; 17242 case 4: 17243 modulo = true; 17244 break; 17245 case 5: 17246 if (token.value == null) { 17247 emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token)); 17248 } 17249 node.items.push(parseNamed(tokenizer, token.value || "", !!modulo)); 17250 if (modulo) { 17251 emitWarn(tokenizer, CompileWarnCodes.USE_MODULO_SYNTAX, context.lastStartLoc, 0, getTokenCaption(token)); 17252 modulo = null; 17253 } 17254 break; 17255 case 7: 17256 if (token.value == null) { 17257 emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, getTokenCaption(token)); 17258 } 17259 node.items.push(parseLiteral(tokenizer, token.value || "")); 17260 break; 17261 case 8: { 17262 const parsed = parseLinked(tokenizer); 17263 node.items.push(parsed.node); 17264 nextToken = parsed.nextConsumeToken || null; 17265 break; 17266 } 17267 } 17268 } while (context.currentType !== 14 && context.currentType !== 1); 17269 const endOffset = context.currentType === 1 ? context.lastOffset : tokenizer.currentOffset(); 17270 const endLoc = context.currentType === 1 ? context.lastEndLoc : tokenizer.currentPosition(); 17271 endNode(node, endOffset, endLoc); 17272 return node; 17273 } 17274 function parsePlural(tokenizer, offset, loc, msgNode) { 17275 const context = tokenizer.context(); 17276 let hasEmptyMessage = msgNode.items.length === 0; 17277 const node = startNode(1, offset, loc); 17278 node.cases = []; 17279 node.cases.push(msgNode); 17280 do { 17281 const msg = parseMessage(tokenizer); 17282 if (!hasEmptyMessage) { 17283 hasEmptyMessage = msg.items.length === 0; 17284 } 17285 node.cases.push(msg); 17286 } while (context.currentType !== 14); 17287 if (hasEmptyMessage) { 17288 emitError(tokenizer, CompileErrorCodes.MUST_HAVE_MESSAGES_IN_PLURAL, loc, 0); 17289 } 17290 endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition()); 17291 return node; 17292 } 17293 function parseResource(tokenizer) { 17294 const context = tokenizer.context(); 17295 const { offset, startLoc } = context; 17296 const msgNode = parseMessage(tokenizer); 17297 if (context.currentType === 14) { 17298 return msgNode; 17299 } else { 17300 return parsePlural(tokenizer, offset, startLoc, msgNode); 17301 } 17302 } 17303 function parse2(source) { 17304 const tokenizer = createTokenizer(source, assign$1({}, options)); 17305 const context = tokenizer.context(); 17306 const node = startNode(0, context.offset, context.startLoc); 17307 if (location && node.loc) { 17308 node.loc.source = source; 17309 } 17310 node.body = parseResource(tokenizer); 17311 if (options.onCacheKey) { 17312 node.cacheKey = options.onCacheKey(source); 17313 } 17314 if (context.currentType !== 14) { 17315 emitError(tokenizer, CompileErrorCodes.UNEXPECTED_LEXICAL_ANALYSIS, context.lastStartLoc, 0, source[context.offset] || ""); 17316 } 17317 endNode(node, tokenizer.currentOffset(), tokenizer.currentPosition()); 17318 return node; 17319 } 17320 return { parse: parse2 }; 17321} 17322function getTokenCaption(token) { 17323 if (token.type === 14) { 17324 return "EOF"; 17325 } 17326 const name = (token.value || "").replace(/\r?\n/gu, "\\n"); 17327 return name.length > 10 ? name.slice(0, 9) + "â¦" : name; 17328} 17329function createTransformer(ast, options = {}) { 17330 const _context = { 17331 ast, 17332 helpers: /* @__PURE__ */ new Set() 17333 }; 17334 const context = () => _context; 17335 const helper = (name) => { 17336 _context.helpers.add(name); 17337 return name; 17338 }; 17339 return { context, helper }; 17340} 17341function traverseNodes(nodes, transformer) { 17342 for (let i = 0; i < nodes.length; i++) { 17343 traverseNode(nodes[i], transformer); 17344 } 17345} 17346function traverseNode(node, transformer) { 17347 switch (node.type) { 17348 case 1: 17349 traverseNodes(node.cases, transformer); 17350 transformer.helper( 17351 "plural" 17352 /* HelperNameMap.PLURAL */ 17353 ); 17354 break; 17355 case 2: 17356 traverseNodes(node.items, transformer); 17357 break; 17358 case 6: { 17359 const linked = node; 17360 traverseNode(linked.key, transformer); 17361 transformer.helper( 17362 "linked" 17363 /* HelperNameMap.LINKED */ 17364 ); 17365 transformer.helper( 17366 "type" 17367 /* HelperNameMap.TYPE */ 17368 ); 17369 break; 17370 } 17371 case 5: 17372 transformer.helper( 17373 "interpolate" 17374 /* HelperNameMap.INTERPOLATE */ 17375 ); 17376 transformer.helper( 17377 "list" 17378 /* HelperNameMap.LIST */ 17379 ); 17380 break; 17381 case 4: 17382 transformer.helper( 17383 "interpolate" 17384 /* HelperNameMap.INTERPOLATE */ 17385 ); 17386 transformer.helper( 17387 "named" 17388 /* HelperNameMap.NAMED */ 17389 ); 17390 break; 17391 } 17392} 17393function transform(ast, options = {}) { 17394 const transformer = createTransformer(ast); 17395 transformer.helper( 17396 "normalize" 17397 /* HelperNameMap.NORMALIZE */ 17398 ); 17399 ast.body && traverseNode(ast.body, transformer); 17400 const context = transformer.context(); 17401 ast.helpers = Array.from(context.helpers); 17402} 17403function optimize(ast) { 17404 const body = ast.body; 17405 if (body.type === 2) { 17406 optimizeMessageNode(body); 17407 } else { 17408 body.cases.forEach((c) => optimizeMessageNode(c)); 17409 } 17410 return ast; 17411} 17412function optimizeMessageNode(message) { 17413 if (message.items.length === 1) { 17414 const item = message.items[0]; 17415 if (item.type === 3 || item.type === 9) { 17416 message.static = item.value; 17417 delete item.value; 17418 } 17419 } else { 17420 const values = []; 17421 for (let i = 0; i < message.items.length; i++) { 17422 const item = message.items[i]; 17423 if (!(item.type === 3 || item.type === 9)) { 17424 break; 17425 } 17426 if (item.value == null) { 17427 break; 17428 } 17429 values.push(item.value); 17430 } 17431 if (values.length === message.items.length) { 17432 message.static = join(values); 17433 for (let i = 0; i < message.items.length; i++) { 17434 const item = message.items[i]; 17435 if (item.type === 3 || item.type === 9) { 17436 delete item.value; 17437 } 17438 } 17439 } 17440 } 17441} 17442const ERROR_DOMAIN$1 = "minifier"; 17443function minify(node) { 17444 node.t = node.type; 17445 switch (node.type) { 17446 case 0: { 17447 const resource = node; 17448 minify(resource.body); 17449 resource.b = resource.body; 17450 delete resource.body; 17451 break; 17452 } 17453 case 1: { 17454 const plural = node; 17455 const cases = plural.cases; 17456 for (let i = 0; i < cases.length; i++) { 17457 minify(cases[i]); 17458 } 17459 plural.c = cases; 17460 delete plural.cases; 17461 break; 17462 } 17463 case 2: { 17464 const message = node; 17465 const items = message.items; 17466 for (let i = 0; i < items.length; i++) { 17467 minify(items[i]); 17468 } 17469 message.i = items; 17470 delete message.items; 17471 if (message.static) { 17472 message.s = message.static; 17473 delete message.static; 17474 } 17475 break; 17476 } 17477 case 3: 17478 case 9: 17479 case 8: 17480 case 7: { 17481 const valueNode = node; 17482 if (valueNode.value) { 17483 valueNode.v = valueNode.value; 17484 delete valueNode.value; 17485 } 17486 break; 17487 } 17488 case 6: { 17489 const linked = node; 17490 minify(linked.key); 17491 linked.k = linked.key; 17492 delete linked.key; 17493 if (linked.modifier) { 17494 minify(linked.modifier); 17495 linked.m = linked.modifier; 17496 delete linked.modifier; 17497 } 17498 break; 17499 } 17500 case 5: { 17501 const list2 = node; 17502 list2.i = list2.index; 17503 delete list2.index; 17504 break; 17505 } 17506 case 4: { 17507 const named = node; 17508 named.k = named.key; 17509 delete named.key; 17510 break; 17511 } 17512 default: { 17513 throw createCompileError(CompileErrorCodes.UNHANDLED_MINIFIER_NODE_TYPE, null, { 17514 domain: ERROR_DOMAIN$1, 17515 args: [node.type] 17516 }); 17517 } 17518 } 17519 delete node.type; 17520} 17521const ERROR_DOMAIN = "parser"; 17522function createCodeGenerator(ast, options) { 17523 const { filename, breakLineCode, needIndent: _needIndent } = options; 17524 const location = options.location !== false; 17525 const _context = { 17526 filename, 17527 code: "", 17528 column: 1, 17529 line: 1, 17530 offset: 0, 17531 map: void 0, 17532 breakLineCode, 17533 needIndent: _needIndent, 17534 indentLevel: 0 17535 }; 17536 if (location && ast.loc) { 17537 _context.source = ast.loc.source; 17538 } 17539 const context = () => _context; 17540 function push(code2, node) { 17541 _context.code += code2; 17542 } 17543 function _newline(n, withBreakLine = true) { 17544 const _breakLineCode = withBreakLine ? breakLineCode : ""; 17545 push(_needIndent ? _breakLineCode + ` `.repeat(n) : _breakLineCode); 17546 } 17547 function indent(withNewLine = true) { 17548 const level = ++_context.indentLevel; 17549 withNewLine && _newline(level); 17550 } 17551 function deindent(withNewLine = true) { 17552 const level = --_context.indentLevel; 17553 withNewLine && _newline(level); 17554 } 17555 function newline2() { 17556 _newline(_context.indentLevel); 17557 } 17558 const helper = (key) => `_${key}`; 17559 const needIndent = () => _context.needIndent; 17560 return { 17561 context, 17562 push, 17563 indent, 17564 deindent, 17565 newline: newline2, 17566 helper, 17567 needIndent 17568 }; 17569} 17570function generateLinkedNode(generator, node) { 17571 const { helper } = generator; 17572 generator.push(`${helper( 17573 "linked" 17574 /* HelperNameMap.LINKED */ 17575 )}(`); 17576 generateNode(generator, node.key); 17577 if (node.modifier) { 17578 generator.push(`, `); 17579 generateNode(generator, node.modifier); 17580 generator.push(`, _type`); 17581 } else { 17582 generator.push(`, undefined, _type`); 17583 } 17584 generator.push(`)`); 17585} 17586function generateMessageNode(generator, node) { 17587 const { helper, needIndent } = generator; 17588 generator.push(`${helper( 17589 "normalize" 17590 /* HelperNameMap.NORMALIZE */ 17591 )}([`); 17592 generator.indent(needIndent()); 17593 const length = node.items.length; 17594 for (let i = 0; i < length; i++) { 17595 generateNode(generator, node.items[i]); 17596 if (i === length - 1) { 17597 break; 17598 } 17599 generator.push(", "); 17600 } 17601 generator.deindent(needIndent()); 17602 generator.push("])"); 17603} 17604function generatePluralNode(generator, node) { 17605 const { helper, needIndent } = generator; 17606 if (node.cases.length > 1) { 17607 generator.push(`${helper( 17608 "plural" 17609 /* HelperNameMap.PLURAL */ 17610 )}([`); 17611 generator.indent(needIndent()); 17612 const length = node.cases.length; 17613 for (let i = 0; i < length; i++) { 17614 generateNode(generator, node.cases[i]); 17615 if (i === length - 1) { 17616 break; 17617 } 17618 generator.push(", "); 17619 } 17620 generator.deindent(needIndent()); 17621 generator.push(`])`); 17622 } 17623} 17624function generateResource(generator, node) { 17625 if (node.body) { 17626 generateNode(generator, node.body); 17627 } else { 17628 generator.push("null"); 17629 } 17630} 17631function generateNode(generator, node) { 17632 const { helper } = generator; 17633 switch (node.type) { 17634 case 0: 17635 generateResource(generator, node); 17636 break; 17637 case 1: 17638 generatePluralNode(generator, node); 17639 break; 17640 case 2: 17641 generateMessageNode(generator, node); 17642 break; 17643 case 6: 17644 generateLinkedNode(generator, node); 17645 break; 17646 case 8: 17647 generator.push(JSON.stringify(node.value), node); 17648 break; 17649 case 7: 17650 generator.push(JSON.stringify(node.value), node); 17651 break; 17652 case 5: 17653 generator.push(`${helper( 17654 "interpolate" 17655 /* HelperNameMap.INTERPOLATE */ 17656 )}(${helper( 17657 "list" 17658 /* HelperNameMap.LIST */ 17659 )}(${node.index}))`, node); 17660 break; 17661 case 4: 17662 generator.push(`${helper( 17663 "interpolate" 17664 /* HelperNameMap.INTERPOLATE */ 17665 )}(${helper( 17666 "named" 17667 /* HelperNameMap.NAMED */ 17668 )}(${JSON.stringify(node.key)}))`, node); 17669 break; 17670 case 9: 17671 generator.push(JSON.stringify(node.value), node); 17672 break; 17673 case 3: 17674 generator.push(JSON.stringify(node.value), node); 17675 break; 17676 default: { 17677 throw createCompileError(CompileErrorCodes.UNHANDLED_CODEGEN_NODE_TYPE, null, { 17678 domain: ERROR_DOMAIN, 17679 args: [node.type] 17680 }); 17681 } 17682 } 17683} 17684const generate = (ast, options = {}) => { 17685 const mode = isString(options.mode) ? options.mode : "normal"; 17686 const filename = isString(options.filename) ? options.filename : "message.intl"; 17687 !!options.sourceMap; 17688 const breakLineCode = options.breakLineCode != null ? options.breakLineCode : mode === "arrow" ? ";" : "\n"; 17689 const needIndent = options.needIndent ? options.needIndent : mode !== "arrow"; 17690 const helpers = ast.helpers || []; 17691 const generator = createCodeGenerator(ast, { 17692 filename, 17693 breakLineCode, 17694 needIndent 17695 }); 17696 generator.push(mode === "normal" ? `function __msg__ (ctx) {` : `(ctx) => {`); 17697 generator.indent(needIndent); 17698 if (helpers.length > 0) { 17699 generator.push(`const { ${join(helpers.map((s) => `${s}: _${s}`), ", ")} } = ctx`); 17700 generator.newline(); 17701 } 17702 generator.push(`return `); 17703 generateNode(generator, ast); 17704 generator.deindent(needIndent); 17705 generator.push(`}`); 17706 delete ast.helpers; 17707 const { code: code2, map: map2 } = generator.context(); 17708 return { 17709 ast, 17710 code: code2, 17711 map: map2 ? map2.toJSON() : void 0 17712 // eslint-disable-line @typescript-eslint/no-explicit-any 17713 }; 17714}; 17715function baseCompile$1(source, options = {}) { 17716 const assignedOptions = assign$1({}, options); 17717 const jit = !!assignedOptions.jit; 17718 const enalbeMinify = !!assignedOptions.minify; 17719 const enambeOptimize = assignedOptions.optimize == null ? true : assignedOptions.optimize; 17720 const parser = createParser(assignedOptions); 17721 const ast = parser.parse(source); 17722 if (!jit) { 17723 transform(ast, assignedOptions); 17724 return generate(ast, assignedOptions); 17725 } else { 17726 enambeOptimize && optimize(ast); 17727 enalbeMinify && minify(ast); 17728 return { ast, code: "" }; 17729 } 17730} 17731var define_process_env_default$3 = {}; 17732function initFeatureFlags$1() { 17733 if (typeof __INTLIFY_PROD_DEVTOOLS__ !== "boolean") { 17734 getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
vendor: 4,145 bytes, lines 17735-17983
17735 } 17736 if (typeof __INTLIFY_JIT_COMPILATION__ !== "boolean") { 17737 getGlobalThis().__INTLIFY_JIT_COMPILATION__ = false; 17738 } 17739 if (typeof __INTLIFY_DROP_MESSAGE_COMPILER__ !== "boolean") { 17740 getGlobalThis().__INTLIFY_DROP_MESSAGE_COMPILER__ = false; 17741 } 17742} 17743function isMessageAST(val) { 17744 return isObject$2(val) && resolveType(val) === 0 && (hasOwn(val, "b") || hasOwn(val, "body")); 17745} 17746const PROPS_BODY = ["b", "body"]; 17747function resolveBody(node) { 17748 return resolveProps(node, PROPS_BODY); 17749} 17750const PROPS_CASES = ["c", "cases"]; 17751function resolveCases(node) { 17752 return resolveProps(node, PROPS_CASES, []); 17753} 17754const PROPS_STATIC = ["s", "static"]; 17755function resolveStatic(node) { 17756 return resolveProps(node, PROPS_STATIC); 17757} 17758const PROPS_ITEMS = ["i", "items"]; 17759function resolveItems(node) { 17760 return resolveProps(node, PROPS_ITEMS, []); 17761} 17762const PROPS_TYPE = ["t", "type"]; 17763function resolveType(node) { 17764 return resolveProps(node, PROPS_TYPE); 17765} 17766const PROPS_VALUE = ["v", "value"]; 17767function resolveValue$1(node, type) { 17768 const resolved = resolveProps(node, PROPS_VALUE); 17769 if (resolved != null) { 17770 return resolved; 17771 } else { 17772 throw createUnhandleNodeError(type); 17773 } 17774} 17775const PROPS_MODIFIER = ["m", "modifier"]; 17776function resolveLinkedModifier(node) { 17777 return resolveProps(node, PROPS_MODIFIER); 17778} 17779const PROPS_KEY = ["k", "key"]; 17780function resolveLinkedKey(node) { 17781 const resolved = resolveProps(node, PROPS_KEY); 17782 if (resolved) { 17783 return resolved; 17784 } else { 17785 throw createUnhandleNodeError( 17786 6 17787 /* NodeTypes.Linked */ 17788 ); 17789 } 17790} 17791function resolveProps(node, props, defaultValue) { 17792 for (let i = 0; i < props.length; i++) { 17793 const prop = props[i]; 17794 if (hasOwn(node, prop) && node[prop] != null) { 17795 return node[prop]; 17796 } 17797 } 17798 return defaultValue; 17799} 17800const AST_NODE_PROPS_KEYS = [ 17801 ...PROPS_BODY, 17802 ...PROPS_CASES, 17803 ...PROPS_STATIC, 17804 ...PROPS_ITEMS, 17805 ...PROPS_KEY, 17806 ...PROPS_MODIFIER, 17807 ...PROPS_VALUE, 17808 ...PROPS_TYPE 17809]; 17810function createUnhandleNodeError(type) { 17811 return new Error(`unhandled node type: ${type}`); 17812} 17813const pathStateMachine = []; 17814pathStateMachine[ 17815 0 17816 /* States.BEFORE_PATH */ 17817] = { 17818 [ 17819 "w" 17820 /* PathCharTypes.WORKSPACE */ 17821 ]: [ 17822 0 17823 /* States.BEFORE_PATH */ 17824 ], 17825 [ 17826 "i" 17827 /* PathCharTypes.IDENT */ 17828 ]: [ 17829 3, 17830 0 17831 /* Actions.APPEND */ 17832 ], 17833 [ 17834 "[" 17835 /* PathCharTypes.LEFT_BRACKET */ 17836 ]: [ 17837 4 17838 /* States.IN_SUB_PATH */ 17839 ], 17840 [ 17841 "o" 17842 /* PathCharTypes.END_OF_FAIL */ 17843 ]: [ 17844 7 17845 /* States.AFTER_PATH */ 17846 ] 17847}; 17848pathStateMachine[ 17849 1 17850 /* States.IN_PATH */ 17851] = { 17852 [ 17853 "w" 17854 /* PathCharTypes.WORKSPACE */ 17855 ]: [ 17856 1 17857 /* States.IN_PATH */ 17858 ], 17859 [ 17860 "." 17861 /* PathCharTypes.DOT */ 17862 ]: [ 17863 2 17864 /* States.BEFORE_IDENT */ 17865 ], 17866 [ 17867 "[" 17868 /* PathCharTypes.LEFT_BRACKET */ 17869 ]: [ 17870 4 17871 /* States.IN_SUB_PATH */ 17872 ], 17873 [ 17874 "o" 17875 /* PathCharTypes.END_OF_FAIL */ 17876 ]: [ 17877 7 17878 /* States.AFTER_PATH */ 17879 ] 17880}; 17881pathStateMachine[ 17882 2 17883 /* States.BEFORE_IDENT */ 17884] = { 17885 [ 17886 "w" 17887 /* PathCharTypes.WORKSPACE */ 17888 ]: [ 17889 2 17890 /* States.BEFORE_IDENT */ 17891 ], 17892 [ 17893 "i" 17894 /* PathCharTypes.IDENT */ 17895 ]: [ 17896 3, 17897 0 17898 /* Actions.APPEND */ 17899 ], 17900 [ 17901 "0" 17902 /* PathCharTypes.ZERO */ 17903 ]: [ 17904 3, 17905 0 17906 /* Actions.APPEND */ 17907 ] 17908}; 17909pathStateMachine[ 17910 3 17911 /* States.IN_IDENT */ 17912] = { 17913 [ 17914 "i" 17915 /* PathCharTypes.IDENT */ 17916 ]: [ 17917 3, 17918 0 17919 /* Actions.APPEND */ 17920 ], 17921 [ 17922 "0" 17923 /* PathCharTypes.ZERO */ 17924 ]: [ 17925 3, 17926 0 17927 /* Actions.APPEND */ 17928 ], 17929 [ 17930 "w" 17931 /* PathCharTypes.WORKSPACE */ 17932 ]: [ 17933 1, 17934 1 17935 /* Actions.PUSH */ 17936 ], 17937 [ 17938 "." 17939 /* PathCharTypes.DOT */ 17940 ]: [ 17941 2, 17942 1 17943 /* Actions.PUSH */ 17944 ], 17945 [ 17946 "[" 17947 /* PathCharTypes.LEFT_BRACKET */ 17948 ]: [ 17949 4, 17950 1 17951 /* Actions.PUSH */ 17952 ], 17953 [ 17954 "o" 17955 /* PathCharTypes.END_OF_FAIL */ 17956 ]: [ 17957 7, 17958 1 17959 /* Actions.PUSH */ 17960 ] 17961}; 17962pathStateMachine[ 17963 4 17964 /* States.IN_SUB_PATH */ 17965] = { 17966 [ 17967 "'" 17968 /* PathCharTypes.SINGLE_QUOTE */ 17969 ]: [ 17970 5, 17971 0 17972 /* Actions.APPEND */ 17973 ], 17974 [ 17975 '"' 17976 /* PathCharTypes.DOUBLE_QUOTE */ 17977 ]: [ 17978 6, 17979 0 17980 /* Actions.APPEND */ 17981 ], 17982 [ 17983 "["
vendor: 13,890 bytes, lines 17984-18507
17984 /* PathCharTypes.LEFT_BRACKET */ 17985 ]: [ 17986 4, 17987 2 17988 /* Actions.INC_SUB_PATH_DEPTH */ 17989 ], 17990 [ 17991 "]" 17992 /* PathCharTypes.RIGHT_BRACKET */ 17993 ]: [ 17994 1, 17995 3 17996 /* Actions.PUSH_SUB_PATH */ 17997 ], 17998 [ 17999 "o" 18000 /* PathCharTypes.END_OF_FAIL */ 18001 ]: 8, 18002 [ 18003 "l" 18004 /* PathCharTypes.ELSE */ 18005 ]: [ 18006 4, 18007 0 18008 /* Actions.APPEND */ 18009 ] 18010}; 18011pathStateMachine[ 18012 5 18013 /* States.IN_SINGLE_QUOTE */ 18014] = { 18015 [ 18016 "'" 18017 /* PathCharTypes.SINGLE_QUOTE */ 18018 ]: [ 18019 4, 18020 0 18021 /* Actions.APPEND */ 18022 ], 18023 [ 18024 "o" 18025 /* PathCharTypes.END_OF_FAIL */ 18026 ]: 8, 18027 [ 18028 "l" 18029 /* PathCharTypes.ELSE */ 18030 ]: [ 18031 5, 18032 0 18033 /* Actions.APPEND */ 18034 ] 18035}; 18036pathStateMachine[ 18037 6 18038 /* States.IN_DOUBLE_QUOTE */ 18039] = { 18040 [ 18041 '"' 18042 /* PathCharTypes.DOUBLE_QUOTE */ 18043 ]: [ 18044 4, 18045 0 18046 /* Actions.APPEND */ 18047 ], 18048 [ 18049 "o" 18050 /* PathCharTypes.END_OF_FAIL */ 18051 ]: 8, 18052 [ 18053 "l" 18054 /* PathCharTypes.ELSE */ 18055 ]: [ 18056 6, 18057 0 18058 /* Actions.APPEND */ 18059 ] 18060}; 18061const literalValueRE = /^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/; 18062function isLiteral(exp) { 18063 return literalValueRE.test(exp); 18064} 18065function stripQuotes(str) { 18066 const a = str.charCodeAt(0); 18067 const b = str.charCodeAt(str.length - 1); 18068 return a === b && (a === 34 || a === 39) ? str.slice(1, -1) : str; 18069} 18070function getPathCharType(ch) { 18071 if (ch === void 0 || ch === null) { 18072 return "o"; 18073 } 18074 const code2 = ch.charCodeAt(0); 18075 switch (code2) { 18076 case 91: 18077 // [ 18078 case 93: 18079 // ] 18080 case 46: 18081 // . 18082 case 34: 18083 // " 18084 case 39: 18085 return ch; 18086 case 95: 18087 // _ 18088 case 36: 18089 // $ 18090 case 45: 18091 return "i"; 18092 case 9: 18093 // Tab (HT) 18094 case 10: 18095 // Newline (LF) 18096 case 13: 18097 // Return (CR) 18098 case 160: 18099 // No-break space (NBSP) 18100 case 65279: 18101 // Byte Order Mark (BOM) 18102 case 8232: 18103 // Line Separator (LS) 18104 case 8233: 18105 return "w"; 18106 } 18107 return "i"; 18108} 18109function formatSubPath(path) { 18110 const trimmed = path.trim(); 18111 if (path.charAt(0) === "0" && isNaN(parseInt(path))) { 18112 return false; 18113 } 18114 return isLiteral(trimmed) ? stripQuotes(trimmed) : "*" + trimmed; 18115} 18116function parse(path) { 18117 const keys = []; 18118 let index = -1; 18119 let mode = 0; 18120 let subPathDepth = 0; 18121 let c; 18122 let key; 18123 let newChar; 18124 let type; 18125 let transition; 18126 let action; 18127 let typeMap; 18128 const actions = []; 18129 actions[ 18130 0 18131 /* Actions.APPEND */ 18132 ] = () => { 18133 if (key === void 0) { 18134 key = newChar; 18135 } else { 18136 key += newChar; 18137 } 18138 }; 18139 actions[ 18140 1 18141 /* Actions.PUSH */ 18142 ] = () => { 18143 if (key !== void 0) { 18144 keys.push(key); 18145 key = void 0; 18146 } 18147 }; 18148 actions[ 18149 2 18150 /* Actions.INC_SUB_PATH_DEPTH */ 18151 ] = () => { 18152 actions[ 18153 0 18154 /* Actions.APPEND */ 18155 ](); 18156 subPathDepth++; 18157 }; 18158 actions[ 18159 3 18160 /* Actions.PUSH_SUB_PATH */ 18161 ] = () => { 18162 if (subPathDepth > 0) { 18163 subPathDepth--; 18164 mode = 4; 18165 actions[ 18166 0 18167 /* Actions.APPEND */ 18168 ](); 18169 } else { 18170 subPathDepth = 0; 18171 if (key === void 0) { 18172 return false; 18173 } 18174 key = formatSubPath(key); 18175 if (key === false) { 18176 return false; 18177 } else { 18178 actions[ 18179 1 18180 /* Actions.PUSH */ 18181 ](); 18182 } 18183 } 18184 }; 18185 function maybeUnescapeQuote() { 18186 const nextChar = path[index + 1]; 18187 if (mode === 5 && nextChar === "'" || mode === 6 && nextChar === '"') { 18188 index++; 18189 newChar = "\\" + nextChar; 18190 actions[ 18191 0 18192 /* Actions.APPEND */ 18193 ](); 18194 return true; 18195 } 18196 } 18197 while (mode !== null) { 18198 index++; 18199 c = path[index]; 18200 if (c === "\\" && maybeUnescapeQuote()) { 18201 continue; 18202 } 18203 type = getPathCharType(c); 18204 typeMap = pathStateMachine[mode]; 18205 transition = typeMap[type] || typeMap[ 18206 "l" 18207 /* PathCharTypes.ELSE */ 18208 ] || 8; 18209 if (transition === 8) { 18210 return; 18211 } 18212 mode = transition[0]; 18213 if (transition[1] !== void 0) { 18214 action = actions[transition[1]]; 18215 if (action) { 18216 newChar = c; 18217 if (action() === false) { 18218 return; 18219 } 18220 } 18221 } 18222 if (mode === 7) { 18223 return keys; 18224 } 18225 } 18226} 18227const cache = /* @__PURE__ */ new Map(); 18228function resolveWithKeyValue(obj, path) { 18229 return isObject$2(obj) ? obj[path] : null; 18230} 18231function resolveValue(obj, path) { 18232 if (!isObject$2(obj)) { 18233 return null; 18234 } 18235 let hit = cache.get(path); 18236 if (!hit) { 18237 hit = parse(path); 18238 if (hit) { 18239 cache.set(path, hit); 18240 } 18241 } 18242 if (!hit) { 18243 return null; 18244 } 18245 const len = hit.length; 18246 let last = obj; 18247 let i = 0; 18248 while (i < len) { 18249 const key = hit[i]; 18250 if (AST_NODE_PROPS_KEYS.includes(key) && isMessageAST(last)) { 18251 return null; 18252 } 18253 const val = last[key]; 18254 if (val === void 0) { 18255 return null; 18256 } 18257 if (isFunction(last)) { 18258 return null; 18259 } 18260 last = val; 18261 i++; 18262 } 18263 return last; 18264} 18265const DEFAULT_MODIFIER = (str) => str; 18266const DEFAULT_MESSAGE = (ctx) => ""; 18267const DEFAULT_MESSAGE_DATA_TYPE = "text"; 18268const DEFAULT_NORMALIZE = (values) => values.length === 0 ? "" : join$1(values); 18269const DEFAULT_INTERPOLATE = toDisplayString; 18270function pluralDefault(choice, choicesLength) { 18271 choice = Math.abs(choice); 18272 if (choicesLength === 2) { 18273 return choice ? choice > 1 ? 1 : 0 : 1; 18274 } 18275 return choice ? Math.min(choice, 2) : 0; 18276} 18277function getPluralIndex(options) { 18278 const index = isNumber(options.pluralIndex) ? options.pluralIndex : -1; 18279 return options.named && (isNumber(options.named.count) || isNumber(options.named.n)) ? isNumber(options.named.count) ? options.named.count : isNumber(options.named.n) ? options.named.n : index : index; 18280} 18281function normalizeNamed(pluralIndex, props) { 18282 if (!props.count) { 18283 props.count = pluralIndex; 18284 } 18285 if (!props.n) { 18286 props.n = pluralIndex; 18287 } 18288} 18289function createMessageContext(options = {}) { 18290 const locale = options.locale; 18291 const pluralIndex = getPluralIndex(options); 18292 const pluralRule = isObject$2(options.pluralRules) && isString$1(locale) && isFunction(options.pluralRules[locale]) ? options.pluralRules[locale] : pluralDefault; 18293 const orgPluralRule = isObject$2(options.pluralRules) && isString$1(locale) && isFunction(options.pluralRules[locale]) ? pluralDefault : void 0; 18294 const plural = (messages) => { 18295 return messages[pluralRule(pluralIndex, messages.length, orgPluralRule)]; 18296 }; 18297 const _list = options.list || []; 18298 const list2 = (index) => _list[index]; 18299 const _named = options.named || create(); 18300 isNumber(options.pluralIndex) && normalizeNamed(pluralIndex, _named); 18301 const named = (key) => _named[key]; 18302 function message(key) { 18303 const msg = isFunction(options.messages) ? options.messages(key) : isObject$2(options.messages) ? options.messages[key] : false; 18304 return !msg ? options.parent ? options.parent.message(key) : DEFAULT_MESSAGE : msg; 18305 } 18306 const _modifier = (name) => options.modifiers ? options.modifiers[name] : DEFAULT_MODIFIER; 18307 const normalize = isPlainObject$1(options.processor) && isFunction(options.processor.normalize) ? options.processor.normalize : DEFAULT_NORMALIZE; 18308 const interpolate = isPlainObject$1(options.processor) && isFunction(options.processor.interpolate) ? options.processor.interpolate : DEFAULT_INTERPOLATE; 18309 const type = isPlainObject$1(options.processor) && isString$1(options.processor.type) ? options.processor.type : DEFAULT_MESSAGE_DATA_TYPE; 18310 const linked = (key, ...args) => { 18311 const [arg1, arg2] = args; 18312 let type2 = "text"; 18313 let modifier = ""; 18314 if (args.length === 1) { 18315 if (isObject$2(arg1)) { 18316 modifier = arg1.modifier || modifier; 18317 type2 = arg1.type || type2; 18318 } else if (isString$1(arg1)) { 18319 modifier = arg1 || modifier; 18320 } 18321 } else if (args.length === 2) { 18322 if (isString$1(arg1)) { 18323 modifier = arg1 || modifier; 18324 } 18325 if (isString$1(arg2)) { 18326 type2 = arg2 || type2; 18327 } 18328 } 18329 const ret = message(key)(ctx); 18330 const msg = ( 18331 // The message in vnode resolved with linked are returned as an array by processor.nomalize 18332 type2 === "vnode" && isArray(ret) && modifier ? ret[0] : ret 18333 ); 18334 return modifier ? _modifier(modifier)(msg, type2) : msg; 18335 }; 18336 const ctx = { 18337 [ 18338 "list" 18339 /* HelperNameMap.LIST */ 18340 ]: list2, 18341 [ 18342 "named" 18343 /* HelperNameMap.NAMED */ 18344 ]: named, 18345 [ 18346 "plural" 18347 /* HelperNameMap.PLURAL */ 18348 ]: plural, 18349 [ 18350 "linked" 18351 /* HelperNameMap.LINKED */ 18352 ]: linked, 18353 [ 18354 "message" 18355 /* HelperNameMap.MESSAGE */ 18356 ]: message, 18357 [ 18358 "type" 18359 /* HelperNameMap.TYPE */ 18360 ]: type, 18361 [ 18362 "interpolate" 18363 /* HelperNameMap.INTERPOLATE */ 18364 ]: interpolate, 18365 [ 18366 "normalize" 18367 /* HelperNameMap.NORMALIZE */ 18368 ]: normalize, 18369 [ 18370 "values" 18371 /* HelperNameMap.VALUES */ 18372 ]: assign$2(create(), _list, _named) 18373 }; 18374 return ctx; 18375} 18376let devtools = null; 18377function setDevToolsHook(hook) { 18378 devtools = hook; 18379} 18380function initI18nDevTools(i18n2, version2, meta) { 18381 devtools && devtools.emit("i18n:init", { 18382 timestamp: Date.now(), 18383 i18n: i18n2, 18384 version: version2, 18385 meta 18386 }); 18387} 18388const translateDevTools = /* @__PURE__ */ createDevToolsHook( 18389 "function:translate" 18390 /* IntlifyDevToolsHooks.FunctionTranslate */ 18391); 18392function createDevToolsHook(hook) { 18393 return (payloads) => devtools && devtools.emit(hook, payloads); 18394} 18395const code$1$1 = CompileWarnCodes.__EXTEND_POINT__; 18396const inc$1$1 = incrementer(code$1$1); 18397const CoreWarnCodes = { 18398 NOT_FOUND_KEY: code$1$1, 18399 // 2 18400 FALLBACK_TO_TRANSLATE: inc$1$1(), 18401 // 3 18402 CANNOT_FORMAT_NUMBER: inc$1$1(), 18403 // 4 18404 FALLBACK_TO_NUMBER_FORMAT: inc$1$1(), 18405 // 5 18406 CANNOT_FORMAT_DATE: inc$1$1(), 18407 // 6 18408 FALLBACK_TO_DATE_FORMAT: inc$1$1(), 18409 // 7 18410 EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER: inc$1$1(), 18411 // 8 18412 __EXTEND_POINT__: inc$1$1() 18413 // 9 18414}; 18415const warnMessages$1 = { 18416 [CoreWarnCodes.NOT_FOUND_KEY]: `Not found '{key}' key in '{locale}' locale messages.`, 18417 [CoreWarnCodes.FALLBACK_TO_TRANSLATE]: `Fall back to translate '{key}' key with '{target}' locale.`, 18418 [CoreWarnCodes.CANNOT_FORMAT_NUMBER]: `Cannot format a number value due to not supported Intl.NumberFormat.`, 18419 [CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT]: `Fall back to number format '{key}' key with '{target}' locale.`, 18420 [CoreWarnCodes.CANNOT_FORMAT_DATE]: `Cannot format a date value due to not supported Intl.DateTimeFormat.`, 18421 [CoreWarnCodes.FALLBACK_TO_DATE_FORMAT]: `Fall back to datetime format '{key}' key with '{target}' locale.`, 18422 [CoreWarnCodes.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER]: `This project is using Custom Message Compiler, which is an experimental feature. It may receive breaking changes or be removed in the future.` 18423}; 18424function getWarnMessage$1(code2, ...args) { 18425 return format$2(warnMessages$1[code2], ...args); 18426} 18427const code$2 = CompileErrorCodes.__EXTEND_POINT__; 18428const inc$2 = incrementer(code$2); 18429const CoreErrorCodes = { 18430 INVALID_ARGUMENT: code$2, 18431 // 17 18432 INVALID_DATE_ARGUMENT: inc$2(), 18433 // 18 18434 INVALID_ISO_DATE_ARGUMENT: inc$2(), 18435 // 19 18436 NOT_SUPPORT_NON_STRING_MESSAGE: inc$2(), 18437 // 20 18438 NOT_SUPPORT_LOCALE_PROMISE_VALUE: inc$2(), 18439 // 21 18440 NOT_SUPPORT_LOCALE_ASYNC_FUNCTION: inc$2(), 18441 // 22 18442 NOT_SUPPORT_LOCALE_TYPE: inc$2(), 18443 // 23 18444 __EXTEND_POINT__: inc$2() 18445 // 24 18446}; 18447function createCoreError(code2) { 18448 return createCompileError(code2, null, define_process_env_default$3.NODE_ENV !== "production" ? { messages: errorMessages$1 } : void 0); 18449} 18450const errorMessages$1 = { 18451 [CoreErrorCodes.INVALID_ARGUMENT]: "Invalid arguments", 18452 [CoreErrorCodes.INVALID_DATE_ARGUMENT]: "The date provided is an invalid Date object.Make sure your Date represents a valid date.", 18453 [CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT]: "The argument provided is not a valid ISO date string", 18454 [CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE]: "Not support non-string message", 18455 [CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE]: "cannot support promise value", 18456 [CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION]: "cannot support async function", 18457 [CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE]: "cannot support locale type" 18458}; 18459function getLocale(context, options) { 18460 return options.locale != null ? resolveLocale(options.locale) : resolveLocale(context.locale); 18461} 18462let _resolveLocale; 18463function resolveLocale(locale) { 18464 if (isString$1(locale)) { 18465 return locale; 18466 } else { 18467 if (isFunction(locale)) { 18468 if (locale.resolvedOnce && _resolveLocale != null) { 18469 return _resolveLocale; 18470 } else if (locale.constructor.name === "Function") { 18471 const resolve2 = locale(); 18472 if (isPromise$1(resolve2)) { 18473 throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_PROMISE_VALUE); 18474 } 18475 return _resolveLocale = resolve2; 18476 } else { 18477 throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION); 18478 } 18479 } else { 18480 throw createCoreError(CoreErrorCodes.NOT_SUPPORT_LOCALE_TYPE); 18481 } 18482 } 18483} 18484function fallbackWithSimple(ctx, fallback, start) { 18485 return [.../* @__PURE__ */ new Set([ 18486 start, 18487 ...isArray(fallback) ? fallback : isObject$2(fallback) ? Object.keys(fallback) : isString$1(fallback) ? [fallback] : [start] 18488 ])]; 18489} 18490function fallbackWithLocaleChain(ctx, fallback, start) { 18491 const startLocale = isString$1(start) ? start : DEFAULT_LOCALE; 18492 const context = ctx; 18493 if (!context.__localeChainCache) { 18494 context.__localeChainCache = /* @__PURE__ */ new Map(); 18495 } 18496 let chain = context.__localeChainCache.get(startLocale); 18497 if (!chain) { 18498 chain = []; 18499 let block2 = [start]; 18500 while (isArray(block2)) { 18501 block2 = appendBlockToChain(chain, block2, fallback); 18502 } 18503 const defaults = isArray(fallback) || !isPlainObject$1(fallback) ? fallback : fallback["default"] ? fallback["default"] : null; 18504 block2 = isString$1(defaults) ? [defaults] : defaults; 18505 if (isArray(block2)) { 18506 appendBlockToChain(chain, block2, false); 18507 }
vendor: 4,660 bytes, lines 18508-18610
18508 context.__localeChainCache.set(startLocale, chain); 18509 } 18510 return chain; 18511} 18512function appendBlockToChain(chain, block2, blocks) { 18513 let follow = true; 18514 for (let i = 0; i < block2.length && isBoolean(follow); i++) { 18515 const locale = block2[i]; 18516 if (isString$1(locale)) { 18517 follow = appendLocaleToChain(chain, block2[i], blocks); 18518 } 18519 } 18520 return follow; 18521} 18522function appendLocaleToChain(chain, locale, blocks) { 18523 let follow; 18524 const tokens = locale.split("-"); 18525 do { 18526 const target = tokens.join("-"); 18527 follow = appendItemToChain(chain, target, blocks); 18528 tokens.splice(-1, 1); 18529 } while (tokens.length && follow === true); 18530 return follow; 18531} 18532function appendItemToChain(chain, target, blocks) { 18533 let follow = false; 18534 if (!chain.includes(target)) { 18535 follow = true; 18536 if (target) { 18537 follow = target[target.length - 1] !== "!"; 18538 const locale = target.replace(/!/g, ""); 18539 chain.push(locale); 18540 if ((isArray(blocks) || isPlainObject$1(blocks)) && blocks[locale]) { 18541 follow = blocks[locale]; 18542 } 18543 } 18544 } 18545 return follow; 18546} 18547const VERSION$1 = "9.14.5"; 18548const NOT_REOSLVED = -1; 18549const DEFAULT_LOCALE = "en-US"; 18550const MISSING_RESOLVE_VALUE = ""; 18551const capitalize = (str) => `${str.charAt(0).toLocaleUpperCase()}${str.substr(1)}`; 18552function getDefaultLinkedModifiers() { 18553 return { 18554 upper: (val, type) => { 18555 return type === "text" && isString$1(val) ? val.toUpperCase() : type === "vnode" && isObject$2(val) && "__v_isVNode" in val ? val.children.toUpperCase() : val; 18556 }, 18557 lower: (val, type) => { 18558 return type === "text" && isString$1(val) ? val.toLowerCase() : type === "vnode" && isObject$2(val) && "__v_isVNode" in val ? val.children.toLowerCase() : val; 18559 }, 18560 capitalize: (val, type) => { 18561 return type === "text" && isString$1(val) ? capitalize(val) : type === "vnode" && isObject$2(val) && "__v_isVNode" in val ? capitalize(val.children) : val; 18562 } 18563 }; 18564} 18565let _compiler; 18566function registerMessageCompiler(compiler) { 18567 _compiler = compiler; 18568} 18569let _resolver; 18570function registerMessageResolver(resolver) { 18571 _resolver = resolver; 18572} 18573let _fallbacker; 18574function registerLocaleFallbacker(fallbacker) { 18575 _fallbacker = fallbacker; 18576} 18577let _additionalMeta = null; 18578const setAdditionalMeta = /* @__NO_SIDE_EFFECTS__ */ (meta) => { 18579 _additionalMeta = meta; 18580}; 18581const getAdditionalMeta = /* @__NO_SIDE_EFFECTS__ */ () => _additionalMeta; 18582let _fallbackContext = null; 18583const setFallbackContext = (context) => { 18584 _fallbackContext = context; 18585}; 18586const getFallbackContext = () => _fallbackContext; 18587let _cid = 0; 18588function createCoreContext(options = {}) { 18589 const onWarn = isFunction(options.onWarn) ? options.onWarn : warn$1; 18590 const version2 = isString$1(options.version) ? options.version : VERSION$1; 18591 const locale = isString$1(options.locale) || isFunction(options.locale) ? options.locale : DEFAULT_LOCALE; 18592 const _locale = isFunction(locale) ? DEFAULT_LOCALE : locale; 18593 const fallbackLocale = isArray(options.fallbackLocale) || isPlainObject$1(options.fallbackLocale) || isString$1(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale; 18594 const messages = isPlainObject$1(options.messages) ? options.messages : createResources(_locale); 18595 const datetimeFormats = isPlainObject$1(options.datetimeFormats) ? options.datetimeFormats : createResources(_locale); 18596 const numberFormats = isPlainObject$1(options.numberFormats) ? options.numberFormats : createResources(_locale); 18597 const modifiers = assign$2(create(), options.modifiers, getDefaultLinkedModifiers()); 18598 const pluralRules = options.pluralRules || create(); 18599 const missing = isFunction(options.missing) ? options.missing : null; 18600 const missingWarn = isBoolean(options.missingWarn) || isRegExp(options.missingWarn) ? options.missingWarn : true; 18601 const fallbackWarn = isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn) ? options.fallbackWarn : true; 18602 const fallbackFormat = !!options.fallbackFormat; 18603 const unresolving = !!options.unresolving; 18604 const postTranslation = isFunction(options.postTranslation) ? options.postTranslation : null; 18605 const processor = isPlainObject$1(options.processor) ? options.processor : null; 18606 const warnHtmlMessage = isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true; 18607 const escapeParameter = !!options.escapeParameter; 18608 const messageCompiler = isFunction(options.messageCompiler) ? options.messageCompiler : _compiler; 18609 if (define_process_env_default$3.NODE_ENV !== "production" && true && true && isFunction(options.messageCompiler)) { 18610 warnOnce$1(getWarnMessage$1(CoreWarnCodes.EXPERIMENTAL_CUSTOM_MESSAGE_COMPILER)
18610); 18611 } 18612 const messageResolver = isFunction(options.messageResolver) ? options.messageResolver : _resolver || resolveWithKeyValue; 18613 const localeFallbacker = isFunction(options.localeFallbacker) ? options.localeFallbacker : _fallbacker || fallbackWithSimple; 18614 const fallbackContext = isObject$2(options.fallbackContext) ? options.fallbackContext : void 0; 18615 const internalOptions = options; 18616 const __datetimeFormatters = isObject$2(internalOptions.__datetimeFormatters) ? internalOptions.__datetimeFormatters : /* @__PURE__ */ new Map(); 18617 const __numberFormatters = isObject$2(internalOptions.__numberFormatters) ? internalOptions.__numberFormatters : /* @__PURE__ */ new Map(); 18618 const __meta = isObject$2(internalOptions.__meta) ? internalOptions.__meta : {}; 18619 _cid++; 18620 const context = { 18621 version: version2, 18622 cid: _cid, 18623 locale, 18624 fallbackLocale, 18625 messages, 18626 modifiers, 18627 pluralRules, 18628 missing, 18629 missingWarn, 18630 fallbackWarn, 18631 fallbackFormat, 18632 unresolving, 18633 postTranslation, 18634 processor, 18635 warnHtmlMessage, 18636 escapeParameter, 18637 messageCompiler, 18638 messageResolver, 18639 localeFallbacker, 18640 fallbackContext, 18641 onWarn, 18642 __meta 18643 }; 18644 { 18645 context.datetimeFormats = datetimeFormats; 18646 context.numberFormats = numberFormats; 18647 context.__datetimeFormatters = __datetimeFormatters; 18648 context.__numberFormatters = __numberFormatters; 18649 } 18650 if (define_process_env_default$3.NODE_ENV !== "production") { 18651 context.__v_emitter = internalOptions.__v_emitter != null ? internalOptions.__v_emitter : void 0; 18652 } 18653 if (define_process_env_default$3.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) { 18654 initI18nDevTools(context, version2, __meta); 18655 } 18656 return context; 18657} 18658const createResources = (locale) => ({ [locale]: create() }); 18659function isTranslateFallbackWarn(fallback, key) { 18660 return fallback instanceof RegExp ? fallback.test(key) : fallback; 18661} 18662function isTranslateMissingWarn(missing, key) { 18663 return missing instanceof RegExp ? missing.test(key) : missing; 18664} 18665function handleMissing(context, key, locale, missingWarn, type) { 18666 const { missing, onWarn } = context; 18667 if (define_process_env_default$3.NODE_ENV !== "production") { 18668 const emitter = context.__v_emitter; 18669 if (emitter) { 18670 emitter.emit("missing", { 18671 locale, 18672 key, 18673 type, 18674 groupId: `${type}:${key}` 18675 }); 18676 } 18677 } 18678 if (missing !== null) { 18679 const ret = missing(context, locale, key, type); 18680 return isString$1(ret) ? ret : key; 18681 } else { 18682 if (define_process_env_default$3.NODE_ENV !== "production" && isTranslateMissingWarn(missingWarn, key)) { 18683 onWarn(getWarnMessage$1(CoreWarnCodes.NOT_FOUND_KEY, { key, locale })); 18684 } 18685 return key; 18686 } 18687} 18688function updateFallbackLocale(ctx, locale, fallback) { 18689 const context = ctx; 18690 context.__localeChainCache = /* @__PURE__ */ new Map(); 18691 ctx.localeFallbacker(ctx, fallback, locale); 18692} 18693function isAlmostSameLocale(locale, compareLocale) { 18694 if (locale === compareLocale) 18695 return false; 18696 return locale.split("-")[0] === compareLocale.split("-")[0]; 18697} 18698function isImplicitFallback(targetLocale, locales) { 18699 const index = locales.indexOf(targetLocale); 18700 if (index === -1) { 18701 return false; 18702 } 18703 for (let i = index + 1; i < locales.length; i++) { 18704 if (isAlmostSameLocale(targetLocale, locales[i])) { 18705 return true; 18706 } 18707 } 18708 return false; 18709} 18710function format(ast) { 18711 const msg = (ctx) => formatParts(ctx, ast); 18712 return msg; 18713} 18714function formatParts(ctx, ast) { 18715 const body = resolveBody(ast); 18716 if (body == null) { 18717 throw createUnhandleNodeError( 18718 0 18719 /* NodeTypes.Resource */ 18720 ); 18721 } 18722 const type = resolveType(body); 18723 if (type === 1) { 18724 const plural = body; 18725 const cases = resolveCases(plural); 18726 return ctx.plural(cases.reduce((messages, c) => [ 18727 ...messages, 18728 formatMessageParts(ctx, c) 18729 ], [])); 18730 } else { 18731 return formatMessageParts(ctx, body); 18732 } 18733} 18734function formatMessageParts(ctx, node) { 18735 const static_ = resolveStatic(node); 18736 if (static_ != null) { 18737 return ctx.type === "text" ? static_ : ctx.normalize([static_]); 18738 } else { 18739 const messages = resolveItems(node).reduce((acm, c) => [...acm, formatMessagePart(ctx, c)], []); 18740 return ctx.normalize(messages); 18741 } 18742} 18743function formatMessagePart(ctx, node) { 18744 const type = resolveType(node); 18745 switch (type) { 18746 case 3: { 18747 return resolveValue$1(node, type); 18748 } 18749 case 9: { 18750 return resolveValue$1(node, type); 18751 } 18752 case 4: { 18753 const named = node;
18754 if (hasOwn(named, "k") && named.k) { 18755 return ctx.interpolate(ctx.named(named.k)); 18756 } 18757 if (hasOwn(named, "key") && named.key) { 18758 return ctx.interpolate(ctx.named(named.key)); 18759 } 18760 throw createUnhandleNodeError(type); 18761 } 18762 case 5: { 18763 const list2 = node; 18764 if (hasOwn(list2, "i") && isNumber(list2.i)) { 18765 return ctx.interpolate(ctx.list(list2.i)); 18766 } 18767 if (hasOwn(list2, "index") && isNumber(list2.index)) { 18768 return ctx.interpolate(ctx.list(list2.index)); 18769 } 18770 throw createUnhandleNodeError(type); 18771 } 18772 case 6: { 18773 const linked = node; 18774 const modifier = resolveLinkedModifier(linked); 18775 const key = resolveLinkedKey(linked); 18776 return ctx.linked(formatMessagePart(ctx, key), modifier ? formatMessagePart(ctx, modifier) : void 0, ctx.type); 18777 } 18778 case 7: { 18779 return resolveValue$1(node, type); 18780 } 18781 case 8: { 18782 return resolveValue$1(node, type); 18783 } 18784 default: 18785 throw new Error(`unhandled node on format message part: ${type}`); 18786 } 18787} 18788const WARN_MESSAGE = `Detected HTML in '{source}' message. Recommend not using HTML messages to avoid XSS.`; 18789function checkHtmlMessage(source, warnHtmlMessage) { 18790 if (warnHtmlMessage && detectHtmlTag(source)) { 18791 warn$1(format$2(WARN_MESSAGE, { source })); 18792 } 18793} 18794const defaultOnCacheKey = (message) => message; 18795let compileCache = create(); 18796function onCompileWarn(_warn) { 18797 if (_warn.code === CompileWarnCodes.USE_MODULO_SYNTAX) { 18798 warn$1(`The use of named interpolation with modulo syntax is deprecated. It will be removed in v10. 18799reference: https://vue-i18n.intlify.dev/guide/essentials/syntax#rails-i18n-format 18800(message compiler warning message: ${_warn.message})`); 18801 } 18802} 18803function baseCompile(message, options = {}) { 18804 let detectError = false; 18805 const onError = options.onError || defaultOnError; 18806 options.onError = (err) => { 18807 detectError = true; 18808 onError(err); 18809 }; 18810 return { ...baseCompile$1(message, options), detectError }; 18811} 18812const compileToFunction = /* @__NO_SIDE_EFFECTS__ */ (message, context) => { 18813 if (!isString$1(message)) { 18814 throw createCoreError(CoreErrorCodes.NOT_SUPPORT_NON_STRING_MESSAGE); 18815 } 18816 if (define_process_env_default$3.NODE_ENV !== "production") { 18817 context.onWarn = onCompileWarn; 18818 } 18819 { 18820 const warnHtmlMessage = isBoolean(context.warnHtmlMessage) ? context.warnHtmlMessage : true; 18821 define_process_env_default$3.NODE_ENV !== "production" && checkHtmlMessage(message, warnHtmlMessage); 18822 const onCacheKey = context.onCacheKey || defaultOnCacheKey; 18823 const cacheKey = onCacheKey(message); 18824 const cached = compileCache[cacheKey]; 18825 if (cached) { 18826 return cached; 18827 } 18828 const { code: code2, detectError } = baseCompile(message, context); 18829 const msg = new Function(`return ${code2}`)(); 18830 return !detectError ? compileCache[cacheKey] = msg : msg; 18831 } 18832}; 18833function compile(message, context) { 18834 if (define_process_env_default$3.NODE_ENV !== "production") { 18835 context.onWarn = onCompileWarn; 18836 } 18837 if (__INTLIFY_JIT_COMPILATION__ && !__INTLIFY_DROP_MESSAGE_COMPILER__ && isString$1(message)) { 18838 const warnHtmlMessage = isBoolean(context.warnHtmlMessage) ? context.warnHtmlMessage : true; 18839 define_process_env_default$3.NODE_ENV !== "production" && checkHtmlMessage(message, warnHtmlMessage); 18840 const onCacheKey = context.onCacheKey || defaultOnCacheKey; 18841 const cacheKey = onCacheKey(message); 18842 const cached = compileCache[cacheKey]; 18843 if (cached) { 18844 return cached; 18845 } 18846 const { ast, detectError } = baseCompile(message, { 18847 ...context, 18848 location: define_process_env_default$3.NODE_ENV !== "production", 18849 jit: true 18850 }); 18851 const msg = format(ast); 18852 return !detectError ? compileCache[cacheKey] = msg : msg; 18853 } else { 18854 if (define_process_env_default$3.NODE_ENV !== "production" && !isMessageAST(message)) { 18855 warn$1(`the message that is resolve with key '${context.key}' is not supported for jit compilation`); 18856 return (() => message); 18857 } 18858 const cacheKey = message.cacheKey; 18859 if (cacheKey) { 18860 const cached = compileCache[cacheKey]; 18861 if (cached) { 18862 return cached; 18863 } 18864 return compileCache[cacheKey] = format(message); 18865 } else { 18866 return format(message); 18867 } 18868 } 18869} 18870const NOOP_MESSAGE_FUNCTION = () => ""; 18871const isMessageFunction = (val) => isFunction(val); 18872function translate(context, ...args) { 18873 const { fallbackFormat, postTranslation, unresolving, messageCompiler, fallbackLocale, messages } = context; 18874 const [key, options] = parseTranslateArgs(...args); 18875 const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn; 18876 const fallbackWarn = isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn; 18877 const escapeParameter = isBoolean(options.escapeParameter) ? options.escapeParameter : context.escapeParameter; 18878 const resolvedMessage = !!options.resolvedMessage; 18879 const defaultMsgOrKey = isString$1(options.default) || isBoolean(options.default) ? !isBoolean(options.default) ? options.default : !message
18879Compiler ? () => key : key : fallbackFormat ? !messageCompiler ? () => key : key : ""; 18880 const enableDefaultMsg = fallbackFormat || defaultMsgOrKey !== ""; 18881 const locale = getLocale(context, options); 18882 escapeParameter && escapeParams(options); 18883 let [formatScope, targetLocale, message] = !resolvedMessage ? resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) : [ 18884 key, 18885 locale, 18886 messages[locale] || create() 18887 ]; 18888 let format2 = formatScope; 18889 let cacheBaseKey = key; 18890 if (!resolvedMessage && !(isString$1(format2) || isMessageAST(format2) || isMessageFunction(format2))) { 18891 if (enableDefaultMsg) { 18892 format2 = defaultMsgOrKey; 18893 cacheBaseKey = format2; 18894 } 18895 } 18896 if (!resolvedMessage && (!(isString$1(format2) || isMessageAST(format2) || isMessageFunction(format2)) || !isString$1(targetLocale))) { 18897 return unresolving ? NOT_REOSLVED : key; 18898 } 18899 if (define_process_env_default$3.NODE_ENV !== "production" && isString$1(format2) && context.messageCompiler == null) { 18900 warn$1(`The message format compilation is not supported in this build. Because message compiler isn't included. You need to pre-compilation all message format. So translate function return '${key}'.`); 18901 return key; 18902 } 18903 let occurred = false; 18904 const onError = () => { 18905 occurred = true; 18906 }; 18907 const msg = !isMessageFunction(format2) ? compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey, onError) : format2; 18908 if (occurred) { 18909 return format2; 18910 } 18911 const ctxOptions = getMessageContextOptions(context, targetLocale, message, options); 18912 const msgContext = createMessageContext(ctxOptions); 18913 const messaged = evaluateMessage(context, msg, msgContext); 18914 let ret = postTranslation ? postTranslation(messaged, key) : messaged; 18915 if (escapeParameter && isString$1(ret)) { 18916 ret = sanitizeTranslatedHtml(ret); 18917 } 18918 if (define_process_env_default$3.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) { 18919 const payloads = { 18920 timestamp: Date.now(), 18921 key: isString$1(key) ? key : isMessageFunction(format2) ? format2.key : "", 18922 locale: targetLocale || (isMessageFunction(format2) ? format2.locale : ""), 18923 format: isString$1(format2) ? format2 : isMessageFunction(format2) ? format2.source : "", 18924 message: ret 18925 }; 18926 payloads.meta = assign$2({}, context.__meta, /* @__PURE__ */ getAdditionalMeta() || {}); 18927 translateDevTools(payloads); 18928 } 18929 return ret; 18930} 18931function escapeParams(options) { 18932 if (isArray(options.list)) { 18933 options.list = options.list.map((item) => isString$1(item) ? escapeHtml(item) : item); 18934 } else if (isObject$2(options.named)) { 18935 Object.keys(options.named).forEach((key) => { 18936 if (isString$1(options.named[key])) { 18937 options.named[key] = escapeHtml(options.named[key]); 18938 } 18939 }); 18940 } 18941} 18942function resolveMessageFormat(context, key, locale, fallbackLocale, fallbackWarn, missingWarn) { 18943 const { messages, onWarn, messageResolver: resolveValue2, localeFallbacker } = context; 18944 const locales = localeFallbacker(context, fallbackLocale, locale); 18945 let message = create(); 18946 let targetLocale; 18947 let format2 = null; 18948 let from = locale; 18949 let to = null; 18950 const type = "translate"; 18951 for (let i = 0; i < locales.length; i++) { 18952 targetLocale = to = locales[i]; 18953 if (define_process_env_default$3.NODE_ENV !== "production" && locale !== targetLocale && !isAlmostSameLocale(locale, targetLocale) && isTranslateFallbackWarn(fallbackWarn, key)) { 18954 onWarn(getWarnMessage$1(CoreWarnCodes.FALLBACK_TO_TRANSLATE, { 18955 key, 18956 target: targetLocale 18957 })); 18958 } 18959 if (define_process_env_default$3.NODE_ENV !== "production" && locale !== targetLocale) { 18960 const emitter = context.__v_emitter; 18961 if (emitter) { 18962 emitter.emit("fallback", { 18963 type, 18964 key, 18965 from, 18966 to, 18967 groupId: `${type}:${key}` 18968 }); 18969 } 18970 } 18971 message = messages[targetLocale] || create(); 18972 let start = null; 18973 let startTag; 18974 let endTag; 18975 if (define_process_env_default$3.NODE_ENV !== "production" && inBrowser) { 18976 start = window.performance.now(); 18977 startTag = "intlify-message-resolve-start"; 18978 endTag = "intlify-message-resolve-end"; 18979 mark && mark(startTag); 18980 } 18981 if ((format2 = resolveValue2(message, key)) === null) { 18982 format2 = message[key]; 18983 } 18984 if (define_process_env_default$3.NODE_ENV !== "production" && inBrowser) { 18985 const end = window.performance.now(); 18986 const emitter = context.__v_emitter; 18987 if (emitter && start && format2) { 18988 emitter.emit("message-resolve", { 18989 type: "message-resolve", 18990 key, 18991 message: format2, 18992 time: end - start, 18993 groupId: `${type}:${key}` 18994 }); 18995 } 18996 if (startTag && endTag && mark && measure) { 18997 mark(endTag); 18998 measure("intlify message resolve", startTag, endTag); 18999 } 19000 } 19001 if (isString$1(format2) || isMessageAST(format2) || isMessageFunction(format2)) { 19002 break; 19003 } 19004 if (!isImplicitFallback(targetLocale, locales)) { 19005 const missingRet = handleMissing( 19006 context, 19007 // eslint-disable-line @typescript-eslint/no-explicit-any 19008 key,
19009 targetLocale, 19010 missingWarn, 19011 type 19012 ); 19013 if (missingRet !== key) { 19014 format2 = missingRet; 19015 } 19016 } 19017 from = to; 19018 } 19019 return [format2, targetLocale, message]; 19020} 19021function compileMessageFormat(context, key, targetLocale, format2, cacheBaseKey, onError) { 19022 const { messageCompiler, warnHtmlMessage } = context; 19023 if (isMessageFunction(format2)) { 19024 const msg2 = format2; 19025 msg2.locale = msg2.locale || targetLocale; 19026 msg2.key = msg2.key || key; 19027 return msg2; 19028 } 19029 if (messageCompiler == null) { 19030 const msg2 = (() => format2); 19031 msg2.locale = targetLocale; 19032 msg2.key = key; 19033 return msg2; 19034 } 19035 let start = null; 19036 let startTag; 19037 let endTag; 19038 if (define_process_env_default$3.NODE_ENV !== "production" && inBrowser) { 19039 start = window.performance.now(); 19040 startTag = "intlify-message-compilation-start"; 19041 endTag = "intlify-message-compilation-end"; 19042 mark && mark(startTag); 19043 } 19044 const msg = messageCompiler(format2, getCompileContext(context, targetLocale, cacheBaseKey, format2, warnHtmlMessage, onError)); 19045 if (define_process_env_default$3.NODE_ENV !== "production" && inBrowser) { 19046 const end = window.performance.now(); 19047 const emitter = context.__v_emitter; 19048 if (emitter && start) { 19049 emitter.emit("message-compilation", { 19050 type: "message-compilation", 19051 message: format2, 19052 time: end - start, 19053 groupId: `${"translate"}:${key}` 19054 }); 19055 } 19056 if (startTag && endTag && mark && measure) { 19057 mark(endTag); 19058 measure("intlify message compilation", startTag, endTag); 19059 } 19060 } 19061 msg.locale = targetLocale; 19062 msg.key = key; 19063 msg.source = format2; 19064 return msg; 19065} 19066function evaluateMessage(context, msg, msgCtx) { 19067 let start = null; 19068 let startTag; 19069 let endTag; 19070 if (define_process_env_default$3.NODE_ENV !== "production" && inBrowser) { 19071 start = window.performance.now(); 19072 startTag = "intlify-message-evaluation-start"; 19073 endTag = "intlify-message-evaluation-end"; 19074 mark && mark(startTag); 19075 } 19076 const messaged = msg(msgCtx); 19077 if (define_process_env_default$3.NODE_ENV !== "production" && inBrowser) { 19078 const end = window.performance.now(); 19079 const emitter = context.__v_emitter; 19080 if (emitter && start) { 19081 emitter.emit("message-evaluation", { 19082 type: "message-evaluation", 19083 value: messaged, 19084 time: end - start, 19085 groupId: `${"translate"}:${msg.key}` 19086 }); 19087 } 19088 if (startTag && endTag && mark && measure) { 19089 mark(endTag); 19090 measure("intlify message evaluation", startTag, endTag); 19091 } 19092 } 19093 return messaged; 19094} 19095function parseTranslateArgs(...args) { 19096 const [arg1, arg2, arg3] = args; 19097 const options = create(); 19098 if (!isString$1(arg1) && !isNumber(arg1) && !isMessageFunction(arg1) && !isMessageAST(arg1)) { 19099 throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT); 19100 } 19101 const key = isNumber(arg1) ? String(arg1) : isMessageFunction(arg1) ? arg1 : arg1; 19102 if (isNumber(arg2)) { 19103 options.plural = arg2; 19104 } else if (isString$1(arg2)) { 19105 options.default = arg2; 19106 } else if (isPlainObject$1(arg2) && !isEmptyObject(arg2)) { 19107 options.named = arg2; 19108 } else if (isArray(arg2)) { 19109 options.list = arg2; 19110 } 19111 if (isNumber(arg3)) { 19112 options.plural = arg3; 19113 } else if (isString$1(arg3)) { 19114 options.default = arg3; 19115 } else if (isPlainObject$1(arg3)) { 19116 assign$2(options, arg3); 19117 } 19118 return [key, options]; 19119} 19120function getCompileContext(context, locale, key, source, warnHtmlMessage, onError) { 19121 return { 19122 locale, 19123 key, 19124 warnHtmlMessage, 19125 onError: (err) => { 19126 onError && onError(err); 19127 if (define_process_env_default$3.NODE_ENV !== "production") { 19128 const _source = getSourceForCodeFrame(source); 19129 const message = `Message compilation error: ${err.message}`; 19130 const codeFrame = err.location && _source && generateCodeFrame(_source, err.location.start.offset, err.location.end.offset); 19131 const emitter = context.__v_emitter; 19132 if (emitter && _source) { 19133 emitter.emit("compile-error", { 19134 message: _source, 19135 error: err.message, 19136 start: err.location && err.location.start.offset, 19137 end: err.location && err.location.end.offset, 19138 groupId: `${"translate"}:${key}` 19139 }); 19140 } 19141 console.error(codeFrame ? `${message} 19142${codeFrame}` : message); 19143 } else { 19144 throw err; 19145 } 19146 }, 19147 onCacheKey: (source2) => generateFormatCacheKey(locale, key, source2) 19148 }; 19149} 19150function getSourceForCodeFrame(source) { 19151 if (isString$1(source)) { 19152 return source; 19153 } else { 19154 if (source.loc && source.loc.source) { 19155 return source.loc.source; 19156 } 19157 } 19158}
19159function getMessageContextOptions(context, locale, message, options) { 19160 const { modifiers, pluralRules, messageResolver: resolveValue2, fallbackLocale, fallbackWarn, missingWarn, fallbackContext } = context; 19161 const resolveMessage = (key) => { 19162 let val = resolveValue2(message, key); 19163 if (val == null && fallbackContext) { 19164 const [, , message2] = resolveMessageFormat(fallbackContext, key, locale, fallbackLocale, fallbackWarn, missingWarn); 19165 val = resolveValue2(message2, key); 19166 } 19167 if (isString$1(val) || isMessageAST(val)) { 19168 let occurred = false; 19169 const onError = () => { 19170 occurred = true; 19171 }; 19172 const msg = compileMessageFormat(context, key, locale, val, key, onError); 19173 return !occurred ? msg : NOOP_MESSAGE_FUNCTION; 19174 } else if (isMessageFunction(val)) { 19175 return val; 19176 } else { 19177 return NOOP_MESSAGE_FUNCTION; 19178 } 19179 }; 19180 const ctxOptions = { 19181 locale, 19182 modifiers, 19183 pluralRules, 19184 messages: resolveMessage 19185 }; 19186 if (context.processor) { 19187 ctxOptions.processor = context.processor; 19188 } 19189 if (options.list) { 19190 ctxOptions.list = options.list; 19191 } 19192 if (options.named) { 19193 ctxOptions.named = options.named; 19194 } 19195 if (isNumber(options.plural)) { 19196 ctxOptions.pluralIndex = options.plural; 19197 } 19198 return ctxOptions; 19199} 19200const intlDefined = typeof Intl !== "undefined"; 19201const Availabilities = { 19202 dateTimeFormat: intlDefined && typeof Intl.DateTimeFormat !== "undefined", 19203 numberFormat: intlDefined && typeof Intl.NumberFormat !== "undefined" 19204}; 19205function datetime(context, ...args) { 19206 const { datetimeFormats, unresolving, fallbackLocale, onWarn, localeFallbacker } = context; 19207 const { __datetimeFormatters } = context; 19208 if (define_process_env_default$3.NODE_ENV !== "production" && !Availabilities.dateTimeFormat) { 19209 onWarn(getWarnMessage$1(CoreWarnCodes.CANNOT_FORMAT_DATE)); 19210 return MISSING_RESOLVE_VALUE; 19211 } 19212 const [key, value, options, overrides] = parseDateTimeArgs(...args); 19213 const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn; 19214 const fallbackWarn = isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn; 19215 const part = !!options.part; 19216 const locale = getLocale(context, options); 19217 const locales = localeFallbacker( 19218 context, 19219 // eslint-disable-line @typescript-eslint/no-explicit-any 19220 fallbackLocale, 19221 locale 19222 ); 19223 if (!isString$1(key) || key === "") { 19224 return new Intl.DateTimeFormat(locale, overrides).format(value); 19225 } 19226 let datetimeFormat = {}; 19227 let targetLocale; 19228 let format2 = null; 19229 let from = locale; 19230 let to = null; 19231 const type = "datetime format"; 19232 for (let i = 0; i < locales.length; i++) { 19233 targetLocale = to = locales[i]; 19234 if (define_process_env_default$3.NODE_ENV !== "production" && locale !== targetLocale && isTranslateFallbackWarn(fallbackWarn, key)) { 19235 onWarn(getWarnMessage$1(CoreWarnCodes.FALLBACK_TO_DATE_FORMAT, { 19236 key, 19237 target: targetLocale 19238 })); 19239 } 19240 if (define_process_env_default$3.NODE_ENV !== "production" && locale !== targetLocale) { 19241 const emitter = context.__v_emitter; 19242 if (emitter) { 19243 emitter.emit("fallback", { 19244 type, 19245 key, 19246 from, 19247 to, 19248 groupId: `${type}:${key}` 19249 }); 19250 } 19251 } 19252 datetimeFormat = datetimeFormats[targetLocale] || {}; 19253 format2 = datetimeFormat[key]; 19254 if (isPlainObject$1(format2)) 19255 break; 19256 handleMissing(context, key, targetLocale, missingWarn, type); 19257 from = to; 19258 } 19259 if (!isPlainObject$1(format2) || !isString$1(targetLocale)) { 19260 return unresolving ? NOT_REOSLVED : key; 19261 } 19262 let id = `${targetLocale}__${key}`; 19263 if (!isEmptyObject(overrides)) { 19264 id = `${id}__${JSON.stringify(overrides)}`; 19265 } 19266 let formatter = __datetimeFormatters.get(id); 19267 if (!formatter) { 19268 formatter = new Intl.DateTimeFormat(targetLocale, assign$2({}, format2, overrides)); 19269 __datetimeFormatters.set(id, formatter); 19270 } 19271 return !part ? formatter.format(value) : formatter.formatToParts(value); 19272} 19273const DATETIME_FORMAT_OPTIONS_KEYS = [ 19274 "localeMatcher", 19275 "weekday", 19276 "era", 19277 "year", 19278 "month", 19279 "day", 19280 "hour", 19281 "minute", 19282 "second", 19283 "timeZoneName", 19284 "formatMatcher", 19285 "hour12", 19286 "timeZone", 19287 "dateStyle", 19288 "timeStyle", 19289 "calendar", 19290 "dayPeriod", 19291 "numberingSystem", 19292 "hourCycle", 19293 "fractionalSecondDigits" 19294]; 19295function parseDateTimeArgs(...args) { 19296 const [arg1, arg2, arg3, arg4] = args; 19297 const options = create(); 19298 let overrides = create(); 19299 let value; 19300 if (isString$1(arg1)) { 19301 const matches = arg1.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/); 19302 if (!matches) { 19303 throw createCoreError(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT); 19304 } 19305 const dateTime = matches[3] ? matches[3].trim().startsWith("T") ? `${matches[1].trim()}${matches[3].trim()}` : `${matches[1].trim()}T${matches[3].trim()}` : matches[1].trim(); 19306 value = new Date(dateTime); 19307 try { 19308 value.toISOString(); 19309 } catch (e) { 19310 throw createCoreError(CoreErrorCodes.INVALID_ISO_DATE_ARGUMENT); 19311 } 19312 } else if (isDate(arg1)) { 19313 if (isNaN(arg1.getTime())) { 19314 throw createCoreError(CoreErrorCodes.INVALID_DATE_ARGUMENT); 19315 } 19316 value = arg1; 19317 } else if (isNumber(arg1)) { 19318 value = arg1; 19319 } else { 19320 throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT); 19321 } 19322 if (isString$1(arg2)) { 19323 options.key = arg2; 19324 } else if (isPlainObject$1(arg2)) { 19325 Object.keys(arg2).forEach((key) => { 19326 if (DATETIME_FORMAT_OPTIONS_KEYS.includes(key)) { 19327 overrides[key] = arg2[key]; 19328 } else { 19329 options[key] = arg2[key]; 19330 } 19331 }); 19332 } 19333 if (isString$1(arg3)) { 19334 options.locale = arg3; 19335 } else if (isPlainObject$1(arg3)) { 19336 overrides = arg3; 19337 } 19338 if (isPlainObject$1(arg4)) { 19339 overrides = arg4; 19340 } 19341 return [options.key || "", value, options, overrides]; 19342} 19343function clearDateTimeFormat(ctx, locale, format2) { 19344 const context = ctx; 19345 for (const key in format2) { 19346 const id = `${locale}__${key}`; 19347 if (!context.__datetimeFormatters.has(id)) { 19348 continue; 19349 } 19350 context.__datetimeFormatters.delete(id); 19351 } 19352} 19353function number(context, ...args) { 19354 const { numberFormats, unresolving, fallbackLocale, onWarn, localeFallbacker } = context; 19355 const { __numberFormatters } = context; 19356 if (define_process_env_default$3.NODE_ENV !== "production" && !Availabilities.numberFormat) {
19357 onWarn(getWarnMessage$1(CoreWarnCodes.CANNOT_FORMAT_NUMBER)); 19358 return MISSING_RESOLVE_VALUE; 19359 } 19360 const [key, value, options, overrides] = parseNumberArgs(...args); 19361 const missingWarn = isBoolean(options.missingWarn) ? options.missingWarn : context.missingWarn; 19362 const fallbackWarn = isBoolean(options.fallbackWarn) ? options.fallbackWarn : context.fallbackWarn; 19363 const part = !!options.part; 19364 const locale = getLocale(context, options); 19365 const locales = localeFallbacker( 19366 context, 19367 // eslint-disable-line @typescript-eslint/no-explicit-any 19368 fallbackLocale, 19369 locale 19370 ); 19371 if (!isString$1(key) || key === "") { 19372 return new Intl.NumberFormat(locale, overrides).format(value); 19373 } 19374 let numberFormat = {}; 19375 let targetLocale; 19376 let format2 = null; 19377 let from = locale; 19378 let to = null; 19379 const type = "number format"; 19380 for (let i = 0; i < locales.length; i++) { 19381 targetLocale = to = locales[i]; 19382 if (define_process_env_default$3.NODE_ENV !== "production" && locale !== targetLocale && isTranslateFallbackWarn(fallbackWarn, key)) { 19383 onWarn(getWarnMessage$1(CoreWarnCodes.FALLBACK_TO_NUMBER_FORMAT, { 19384 key, 19385 target: targetLocale 19386 })); 19387 } 19388 if (define_process_env_default$3.NODE_ENV !== "production" && locale !== targetLocale) { 19389 const emitter = context.__v_emitter; 19390 if (emitter) { 19391 emitter.emit("fallback", { 19392 type, 19393 key, 19394 from, 19395 to, 19396 groupId: `${type}:${key}` 19397 }); 19398 } 19399 } 19400 numberFormat = numberFormats[targetLocale] || {}; 19401 format2 = numberFormat[key]; 19402 if (isPlainObject$1(format2)) 19403 break; 19404 handleMissing(context, key, targetLocale, missingWarn, type); 19405 from = to; 19406 } 19407 if (!isPlainObject$1(format2) || !isString$1(targetLocale)) { 19408 return unresolving ? NOT_REOSLVED : key; 19409 } 19410 let id = `${targetLocale}__${key}`; 19411 if (!isEmptyObject(overrides)) { 19412 id = `${id}__${JSON.stringify(overrides)}`; 19413 } 19414 let formatter = __numberFormatters.get(id); 19415 if (!formatter) { 19416 formatter = new Intl.NumberFormat(targetLocale, assign$2({}, format2, overrides)); 19417 __numberFormatters.set(id, formatter); 19418 } 19419 return !part ? formatter.format(value) : formatter.formatToParts(value); 19420} 19421const NUMBER_FORMAT_OPTIONS_KEYS = [ 19422 "localeMatcher", 19423 "style", 19424 "currency", 19425 "currencyDisplay", 19426 "currencySign", 19427 "useGrouping", 19428 "minimumIntegerDigits", 19429 "minimumFractionDigits", 19430 "maximumFractionDigits", 19431 "minimumSignificantDigits", 19432 "maximumSignificantDigits", 19433 "compactDisplay", 19434 "notation", 19435 "signDisplay", 19436 "unit", 19437 "unitDisplay", 19438 "roundingMode", 19439 "roundingPriority", 19440 "roundingIncrement", 19441 "trailingZeroDisplay" 19442]; 19443function parseNumberArgs(...args) { 19444 const [arg1, arg2, arg3, arg4] = args; 19445 const options = create(); 19446 let overrides = create(); 19447 if (!isNumber(arg1)) { 19448 throw createCoreError(CoreErrorCodes.INVALID_ARGUMENT); 19449 } 19450 const value = arg1; 19451 if (isString$1(arg2)) { 19452 options.key = arg2; 19453 } else if (isPlainObject$1(arg2)) { 19454 Object.keys(arg2).forEach((key) => { 19455 if (NUMBER_FORMAT_OPTIONS_KEYS.includes(key)) { 19456 overrides[key] = arg2[key]; 19457 } else { 19458 options[key] = arg2[key]; 19459 } 19460 }); 19461 } 19462 if (isString$1(arg3)) { 19463 options.locale = arg3; 19464 } else if (isPlainObject$1(arg3)) { 19465 overrides = arg3; 19466 } 19467 if (isPlainObject$1(arg4)) { 19468 overrides = arg4; 19469 } 19470 return [options.key || "", value, options, overrides]; 19471} 19472function clearNumberFormat(ctx, locale, format2) { 19473 const context = ctx; 19474 for (const key in format2) { 19475 const id = `${locale}__${key}`; 19476 if (!context.__numberFormatters.has(id)) { 19477 continue; 19478 } 19479 context.__numberFormatters.delete(id); 19480 } 19481} 19482{ 19483 initFeatureFlags$1(); 19484} 19485function getDevtoolsGlobalHook() { 19486 return getTarget$1().__VUE_DEVTOOLS_GLOBAL_HOOK__; 19487} 19488function getTarget$1() { 19489 return typeof navigator !== "undefined" && typeof window !== "undefined" ? window : typeof globalThis !== "undefined" ? globalThis : {}; 19490} 19491const isProxyAvailable = typeof Proxy === "function"; 19492const HOOK_SETUP = "devtools-plugin:setup"; 19493const HOOK_PLUGIN_SETTINGS_SET = "plugin:settings:set"; 19494let supported; 19495let perf; 19496function isPerformanceSupported() { 19497 var _a2; 19498 if (supported !== void 0) { 19499 return supported; 19500 } 19501 if (typeof window !== "undefined" && window.performance) { 19502 supported = true; 19503 perf = window.performance; 19504 } else if (typeof globalThis !== "undefined" && ((_a2 = globalThis.perf_hooks) === null || _a2 === void 0 ? void 0 : _a2.performance)) { 19505 supported = true; 19506 perf = globalThis.perf_hooks.performance; 19507 } else { 19508 supported = false;
19509 } 19510 return supported; 19511} 19512function now() { 19513 return isPerformanceSupported() ? perf.now() : Date.now(); 19514} 19515class ApiProxy { 19516 constructor(plugin, hook) { 19517 this.target = null; 19518 this.targetQueue = []; 19519 this.onQueue = []; 19520 this.plugin = plugin; 19521 this.hook = hook; 19522 const defaultSettings = {}; 19523 if (plugin.settings) { 19524 for (const id in plugin.settings) { 19525 const item = plugin.settings[id]; 19526 defaultSettings[id] = item.defaultValue; 19527 } 19528 } 19529 const localSettingsSaveId = `__vue-devtools-plugin-settings__${plugin.id}`; 19530 let currentSettings = Object.assign({}, defaultSettings); 19531 try { 19532 const raw = localStorage.getItem(localSettingsSaveId); 19533 const data = JSON.parse(raw); 19534 Object.assign(currentSettings, data); 19535 } catch (e) { 19536 } 19537 this.fallbacks = { 19538 getSettings() { 19539 return currentSettings; 19540 }, 19541 setSettings(value) { 19542 try { 19543 localStorage.setItem(localSettingsSaveId, JSON.stringify(value)); 19544 } catch (e) { 19545 } 19546 currentSettings = value; 19547 }, 19548 now() { 19549 return now(); 19550 } 19551 }; 19552 if (hook) { 19553 hook.on(HOOK_PLUGIN_SETTINGS_SET, (pluginId, value) => { 19554 if (pluginId === this.plugin.id) { 19555 this.fallbacks.setSettings(value); 19556 } 19557 }); 19558 } 19559 this.proxiedOn = new Proxy({}, { 19560 get: (_target, prop) => { 19561 if (this.target) { 19562 return this.target.on[prop]; 19563 } else { 19564 return (...args) => { 19565 this.onQueue.push({ 19566 method: prop, 19567 args 19568 }); 19569 }; 19570 } 19571 } 19572 }); 19573 this.proxiedTarget = new Proxy({}, { 19574 get: (_target, prop) => { 19575 if (this.target) { 19576 return this.target[prop]; 19577 } else if (prop === "on") { 19578 return this.proxiedOn; 19579 } else if (Object.keys(this.fallbacks).includes(prop)) { 19580 return (...args) => { 19581 this.targetQueue.push({ 19582 method: prop, 19583 args, 19584 resolve: () => { 19585 } 19586 }); 19587 return this.fallbacks[prop](...args); 19588 }; 19589 } else { 19590 return (...args) => { 19591 return new Promise((resolve2) => { 19592 this.targetQueue.push({ 19593 method: prop, 19594 args, 19595 resolve: resolve2 19596 }); 19597 }); 19598 }; 19599 } 19600 } 19601 }); 19602 } 19603 async setRealTarget(target) { 19604 this.target = target; 19605 for (const item of this.onQueue) { 19606 this.target.on[item.method](...item.args); 19607 } 19608 for (const item of this.targetQueue) { 19609 item.resolve(await this.target[item.method](...item.args)); 19610 } 19611 } 19612} 19613function setupDevtoolsPlugin(pluginDescriptor, setupFn) { 19614 const descriptor = pluginDescriptor; 19615 const target = getTarget$1(); 19616 const hook = getDevtoolsGlobalHook(); 19617 const enableProxy = isProxyAvailable && descriptor.enableEarlyProxy; 19618 if (hook && (target.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !enableProxy)) { 19619 hook.emit(HOOK_SETUP, pluginDescriptor, setupFn); 19620 } else { 19621 const proxy = enableProxy ? new ApiProxy(descriptor, hook) : null; 19622 const list2 = target.__VUE_DEVTOOLS_PLUGINS__ = target.__VUE_DEVTOOLS_PLUGINS__ || []; 19623 list2.push({ 19624 pluginDescriptor: descriptor, 19625 setupFn, 19626 proxy 19627 }); 19628 if (proxy) { 19629 setupFn(proxy.proxiedTarget); 19630 } 19631 } 19632} 19633var define_process_env_default$2 = {}; 19634const VERSION = "9.14.5"; 19635function initFeatureFlags() { 19636 if (typeof __VUE_I18N_FULL_INSTALL__ !== "boolean") { 19637 getGlobalThis().__VUE_I18N_FULL_INSTALL__ = true; 19638 } 19639 if (typeof __VUE_I18N_LEGACY_API__ !== "boolean") { 19640 getGlobalThis().__VUE_I18N_LEGACY_API__ = true; 19641 } 19642 if (typeof __INTLIFY_JIT_COMPILATION__ !== "boolean") { 19643 getGlobalThis().__INTLIFY_JIT_COMPILATION__ = false; 19644 } 19645 if (typeof __INTLIFY_DROP_MESSAGE_COMPILER__ !== "boolean") { 19646 getGlobalThis().__INTLIFY_DROP_MESSAGE_COMPILER__ = false; 19647 } 19648 if (typeof __INTLIFY_PROD_DEVTOOLS__ !== "boolean") { 19649 getGlobalThis().__INTLIFY_PROD_DEVTOOLS__ = false;
19650 } 19651} 19652const code$1 = CoreWarnCodes.__EXTEND_POINT__; 19653const inc$1 = incrementer(code$1); 19654const I18nWarnCodes = { 19655 FALLBACK_TO_ROOT: code$1, 19656 // 9 19657 NOT_SUPPORTED_PRESERVE: inc$1(), 19658 // 10 19659 NOT_SUPPORTED_FORMATTER: inc$1(), 19660 // 11 19661 NOT_SUPPORTED_PRESERVE_DIRECTIVE: inc$1(), 19662 // 12 19663 NOT_SUPPORTED_GET_CHOICE_INDEX: inc$1(), 19664 // 13 19665 COMPONENT_NAME_LEGACY_COMPATIBLE: inc$1(), 19666 // 14 19667 NOT_FOUND_PARENT_SCOPE: inc$1(), 19668 // 15 19669 IGNORE_OBJ_FLATTEN: inc$1(), 19670 // 16 19671 NOTICE_DROP_ALLOW_COMPOSITION: inc$1(), 19672 // 17 19673 NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG: inc$1() 19674 // 18 19675}; 19676const warnMessages = { 19677 [I18nWarnCodes.FALLBACK_TO_ROOT]: `Fall back to {type} '{key}' with root locale.`, 19678 [I18nWarnCodes.NOT_SUPPORTED_PRESERVE]: `Not supported 'preserve'.`, 19679 [I18nWarnCodes.NOT_SUPPORTED_FORMATTER]: `Not supported 'formatter'.`, 19680 [I18nWarnCodes.NOT_SUPPORTED_PRESERVE_DIRECTIVE]: `Not supported 'preserveDirectiveContent'.`, 19681 [I18nWarnCodes.NOT_SUPPORTED_GET_CHOICE_INDEX]: `Not supported 'getChoiceIndex'.`, 19682 [I18nWarnCodes.COMPONENT_NAME_LEGACY_COMPATIBLE]: `Component name legacy compatible: '{name}' -> 'i18n'`, 19683 [I18nWarnCodes.NOT_FOUND_PARENT_SCOPE]: `Not found parent scope. use the global scope.`, 19684 [I18nWarnCodes.IGNORE_OBJ_FLATTEN]: `Ignore object flatten: '{key}' key has an string value`, 19685 [I18nWarnCodes.NOTICE_DROP_ALLOW_COMPOSITION]: `'allowComposition' option will be dropped in the next major version. For more information, please see ð https://tinyurl.com/2p97mcze`, 19686 [I18nWarnCodes.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG]: `'translateExistCompatible' option will be dropped in the next major version.` 19687}; 19688function getWarnMessage(code2, ...args) { 19689 return format$2(warnMessages[code2], ...args); 19690} 19691const code = CoreErrorCodes.__EXTEND_POINT__; 19692const inc = incrementer(code); 19693const I18nErrorCodes = { 19694 // composer module errors 19695 UNEXPECTED_RETURN_TYPE: code, 19696 // 24 19697 // legacy module errors 19698 INVALID_ARGUMENT: inc(), 19699 // 25 19700 // i18n module errors 19701 MUST_BE_CALL_SETUP_TOP: inc(), 19702 // 26 19703 NOT_INSTALLED: inc(), 19704 // 27 19705 NOT_AVAILABLE_IN_LEGACY_MODE: inc(), 19706 // 28 19707 // directive module errors 19708 REQUIRED_VALUE: inc(), 19709 // 29 19710 INVALID_VALUE: inc(), 19711 // 30 19712 // vue-devtools errors 19713 CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN: inc(), 19714 // 31 19715 NOT_INSTALLED_WITH_PROVIDE: inc(), 19716 // 32 19717 // unexpected error 19718 UNEXPECTED_ERROR: inc(), 19719 // 33 19720 // not compatible legacy vue-i18n constructor 19721 NOT_COMPATIBLE_LEGACY_VUE_I18N: inc(), 19722 // 34 19723 // bridge support vue 2.x only 19724 BRIDGE_SUPPORT_VUE_2_ONLY: inc(), 19725 // 35 19726 // need to define `i18n` option in `allowComposition: true` and `useScope: 'local' at `useI18n`` 19727 MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION: inc(), 19728 // 36 19729 // Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly 19730 NOT_AVAILABLE_COMPOSITION_IN_LEGACY: inc(), 19731 // 37 19732 // for enhancement 19733 __EXTEND_POINT__: inc() 19734 // 38 19735}; 19736function createI18nError(code2, ...args) { 19737 return createCompileError(code2, null, define_process_env_default$2.NODE_ENV !== "production" ? { messages: errorMessages, args } : void 0); 19738} 19739const errorMessages = { 19740 [I18nErrorCodes.UNEXPECTED_RETURN_TYPE]: "Unexpected return type in composer", 19741 [I18nErrorCodes.INVALID_ARGUMENT]: "Invalid argument", 19742 [I18nErrorCodes.MUST_BE_CALL_SETUP_TOP]: "Must be called at the top of a `setup` function", 19743 [I18nErrorCodes.NOT_INSTALLED]: "Need to install with `app.use` function", 19744 [I18nErrorCodes.UNEXPECTED_ERROR]: "Unexpected error", 19745 [I18nErrorCodes.NOT_AVAILABLE_IN_LEGACY_MODE]: "Not available in legacy mode", 19746 [I18nErrorCodes.REQUIRED_VALUE]: `Required in value: {0}`, 19747 [I18nErrorCodes.INVALID_VALUE]: `Invalid value`, 19748 [I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN]: `Cannot setup vue-devtools plugin`, 19749 [I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE]: "Need to install with `provide` function", 19750 [I18nErrorCodes.NOT_COMPATIBLE_LEGACY_VUE_I18N]: "Not compatible legacy VueI18n.", 19751 [I18nErrorCodes.BRIDGE_SUPPORT_VUE_2_ONLY]: "vue-i18n-bridge support Vue 2.x only", 19752 [I18nErrorCodes.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION]: "Must define âi18nâ option or custom block in Composition API with using local scope in Legacy API mode", 19753 [I18nErrorCodes.NOT_AVAILABLE_COMPOSITION_IN_LEGACY]: "Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly" 19754}; 19755const TranslateVNodeSymbol = /* @__PURE__ */ makeSymbol("__translateVNode"); 19756const DatetimePartsSymbol = /* @__PURE__ */ makeSymbol("__datetimeParts"); 19757const NumberPartsSymbol = /* @__PURE__ */ makeSymbol("__numberParts"); 19758const EnableEmitter = /* @__PURE__ */ makeSymbol("__enableEmitter"); 19759const DisableEmitter = /* @__PURE__ */ makeSymbol("__disableEmitter"); 19760const SetPluralRulesSymbol = makeSymbol("__setPluralRules"); 19761const InejctWithOptionSymbol = /* @__PURE__ */ makeSymbol("__injectWithOption"); 19762const DisposeSymbol = /* @__PURE__ */ makeSymbol("__dispose"); 19763function handleFlatJson(obj) { 19764 if (!isObject$2(obj)) { 19765 return obj; 19766 } 19767 if (isMessageAST(obj)) { 19768 return obj; 19769 } 19770 for (const key in obj) { 19771 if (!hasOwn(obj, key)) { 19772 continue; 19773 } 19774 if (!key.includes(".")) { 19775 if (isObject$2(obj[key])) { 19776 handleFlatJson(obj[key]); 19777 } 19778 } else { 19779 const subKeys = key.split("."); 19780 const lastIndex = subKeys.length - 1; 19781 let currentObj = obj; 19782 let hasStringValue = false;
19783 for (let i = 0; i < lastIndex; i++) { 19784 if (subKeys[i] === "__proto__") { 19785 throw new Error(`unsafe key: ${subKeys[i]}`); 19786 } 19787 if (!(subKeys[i] in currentObj)) { 19788 currentObj[subKeys[i]] = create(); 19789 } 19790 if (!isObject$2(currentObj[subKeys[i]])) { 19791 define_process_env_default$2.NODE_ENV !== "production" && warn$1(getWarnMessage(I18nWarnCodes.IGNORE_OBJ_FLATTEN, { 19792 key: subKeys[i] 19793 })); 19794 hasStringValue = true; 19795 break; 19796 } 19797 currentObj = currentObj[subKeys[i]]; 19798 } 19799 if (!hasStringValue) { 19800 if (!isMessageAST(currentObj)) { 19801 currentObj[subKeys[lastIndex]] = obj[key]; 19802 delete obj[key]; 19803 } else { 19804 if (!AST_NODE_PROPS_KEYS.includes(subKeys[lastIndex])) { 19805 delete obj[key]; 19806 } 19807 } 19808 } 19809 if (!isMessageAST(currentObj)) { 19810 const target = currentObj[subKeys[lastIndex]]; 19811 if (isObject$2(target)) { 19812 handleFlatJson(target); 19813 } 19814 } 19815 } 19816 } 19817 return obj; 19818} 19819function getLocaleMessages(locale, options) { 19820 const { messages, __i18n, messageResolver, flatJson } = options; 19821 const ret = isPlainObject$1(messages) ? messages : isArray(__i18n) ? create() : { [locale]: create() }; 19822 if (isArray(__i18n)) { 19823 __i18n.forEach((custom) => { 19824 if ("locale" in custom && "resource" in custom) { 19825 const { locale: locale2, resource } = custom; 19826 if (locale2) { 19827 ret[locale2] = ret[locale2] || create(); 19828 deepCopy(resource, ret[locale2]); 19829 } else { 19830 deepCopy(resource, ret); 19831 } 19832 } else { 19833 isString$1(custom) && deepCopy(JSON.parse(custom), ret); 19834 } 19835 }); 19836 } 19837 if (messageResolver == null && flatJson) { 19838 for (const key in ret) { 19839 if (hasOwn(ret, key)) { 19840 handleFlatJson(ret[key]); 19841 } 19842 } 19843 } 19844 return ret; 19845} 19846function getComponentOptions(instance) { 19847 return instance.type; 19848} 19849function adjustI18nResources(gl, options, componentOptions) { 19850 let messages = isObject$2(options.messages) ? options.messages : create(); 19851 if ("__i18nGlobal" in componentOptions) { 19852 messages = getLocaleMessages(gl.locale.value, { 19853 messages, 19854 __i18n: componentOptions.__i18nGlobal 19855 }); 19856 } 19857 const locales = Object.keys(messages); 19858 if (locales.length) { 19859 locales.forEach((locale) => { 19860 gl.mergeLocaleMessage(locale, messages[locale]); 19861 }); 19862 } 19863 { 19864 if (isObject$2(options.datetimeFormats)) { 19865 const locales2 = Object.keys(options.datetimeFormats); 19866 if (locales2.length) { 19867 locales2.forEach((locale) => { 19868 gl.mergeDateTimeFormat(locale, options.datetimeFormats[locale]); 19869 }); 19870 } 19871 } 19872 if (isObject$2(options.numberFormats)) { 19873 const locales2 = Object.keys(options.numberFormats); 19874 if (locales2.length) { 19875 locales2.forEach((locale) => { 19876 gl.mergeNumberFormat(locale, options.numberFormats[locale]); 19877 }); 19878 } 19879 } 19880 } 19881} 19882function createTextNode(key) { 19883 return createVNode(Text, null, key, 0); 19884} 19885const DEVTOOLS_META = "__INTLIFY_META__"; 19886const NOOP_RETURN_ARRAY = () => []; 19887const NOOP_RETURN_FALSE = () => false; 19888let composerID = 0; 19889function defineCoreMissingHandler(missing) { 19890 return ((ctx, locale, key, type) => { 19891 return missing(locale, key, getCurrentInstance() || void 0, type); 19892 }); 19893} 19894const getMetaInfo = /* @__NO_SIDE_EFFECTS__ */ () => { 19895 const instance = getCurrentInstance(); 19896 let meta = null; 19897 return instance && (meta = getComponentOptions(instance)[DEVTOOLS_META]) ? { [DEVTOOLS_META]: meta } : null; 19898}; 19899function createComposer(options = {}, VueI18nLegacy) { 19900 const { __root, __injectWithOption } = options; 19901 const _isGlobal = __root === void 0; 19902 const flatJson = options.flatJson; 19903 const _ref = inBrowser ? ref : shallowRef; 19904 const translateExistCompatible = !!options.translateExistCompatible; 19905 if (define_process_env_default$2.NODE_ENV !== "production") { 19906 if (translateExistCompatible && true) { 19907 warnOnce$1(getWarnMessage(I18nWarnCodes.NOTICE_DROP_TRANSLATE_EXIST_COMPATIBLE_FLAG)); 19908 } 19909 } 19910 let _inheritLocale = isBoolean(options.inheritLocale) ? options.inheritLocale : true; 19911 const _locale = _ref( 19912 // prettier-ignore 19913 __root && _inheritLocale ? __root.locale.value : isString$1(options.locale) ? options.locale : DEFAULT_LOCALE 19914 ); 19915 const _fallbackLocale = _ref( 19916 // prettier-ignore 19917 __root && _inheritLocale ? __root.fallbackLocale.value : isString$1(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject$1(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value 19918 ); 19919 const _messages = _ref(getLocaleMessages(_locale.value, options)); 19920 const _datetimeFormats = _ref(isPlainObject$1(options.datetimeFormats) ? options.datetimeFormats : { [_locale.value]: {} }); 19921 const _numberFormats = _ref(isPlainObject$1(options.numberFormats) ? options.numberFormats : { [_locale.value]: {} }); 19922 let _missingWarn = __root ? __root.missingWarn : isBoolean(options.missingWarn) || isRegExp(options.missingWarn) ? options.missingWarn : true; 19923 let _fallbackWarn = __root ? __root.fallbackWarn : isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn) ? options.fallbackWarn : true; 19924 let _fallbackRoot = __root ? __root.fallbackRoot : isBoolean(options.fallbackRoot) ? options.fallbackRoot : true; 19925 let _fallbackFormat = !!options.fallbackFormat; 19926 let _missing = isFunction(options.missing) ? options.missing : null; 19927 let _runtimeMissing = isFunction(options.missing) ? defineCoreMissingHandler(options.missing) : null; 19928 let _postTranslation = isFunction(options.postTranslation) ? options.postTranslation : null; 19929 let _warnHtmlMessage = __root ? __root.warnHtmlMessage : isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true; 19930 let _escapeParameter = !!options.escapeParameter; 19931 const _modifiers = __root ? __root.modifiers : isPlainObject$1(options.modifiers) ? options.modifiers : {}; 19932 let _pluralRules = options.pluralRules || __root && __root.pluralRules; 19933 let _context; 19934 const getCoreContext = () => { 19935 _isGlobal && setFallbackContext(null); 19936 const ctxOptions = { 19937 version: VERSION, 19938 locale: _locale.value, 19939 fallbackLocale: _fallbackLocale.value, 19940 messages: _messages.value, 19941 modifiers: _modifiers, 19942 pluralRules: _pluralRules, 19943 missing: _runtimeMissing === null ? void 0 : _runtimeMissing, 19944 missingWarn: _missingWarn, 19945 fallbackWarn: _fallbackWarn, 19946 fallbackFormat: _fallbackFormat, 19947 unresolving: true, 19948 postTranslation: _postTranslation === null ? void 0 : _postTranslation, 19949 warnHtmlMessage: _warnHtmlMessage, 19950 escapeParameter: _escapeParameter, 19951 messageResolver: options.messageResolver, 19952 messageCompiler: options.messageCompiler, 19953 __meta: { framework: "vue" } 19954 }; 19955 { 19956 ctxOptions.datetimeFormats = _datetimeFormats.value; 19957 ctxOptions.numberFormats = _numberFormats.value; 19958 ctxOptions.__datetimeFormatters = isPlainObject$1(_context) ? _context.__datetimeFormatters : void 0; 19959 ctxOptions.__numberFormatters = isPlainObject$1(_context) ? _context.__numberFormatters : void 0; 19960 } 19961 if (define_process_env_default$2.NODE_ENV !== "production") { 19962 ctxOptions.__v_emitter = isPlainObject$1(_context) ? _context.__v_emitter : void 0; 19963 } 19964 const ctx = createCoreContext(ctxOptions); 19965 _isGlobal && setFallbackContext(ctx); 19966 return ctx; 19967 }; 19968 _context = getCoreContext(); 19969 updateFallbackLocale(_context, _locale.value, _fallbackLocale.value); 19970 function trackReactivityValues() { 19971 return [ 19972 _locale.value, 19973 _fallbackLocale.value, 19974 _messages.value, 19975 _datetimeFormats.value, 19976 _numberFormats.value 19977 ]; 19978 } 19979 const locale = computed({ 19980 get: () => _locale.value, 19981 set: (val) => { 19982 _locale.value = val; 19983 _context.locale = _locale.value; 19984 } 19985 }); 19986 const fallbackLocale = computed({ 19987 get: () => _fallbackLocale.value, 19988 set: (val) => { 19989 _fallbackLocale.value = val; 19990 _context.fallbackLocale = _fallbackLocale.value; 19991 updateFallbackLocale(_context, _locale.value, val); 19992 } 19993 }); 19994 const messages = computed(() => _messages.value); 19995 const datetimeFormats = /* @__PURE__ */ computed(() => _datetimeFormats.value); 19996 const numberFormats = /* @__PURE__ */ computed(() => _numberFormats.value); 19997 function getPostTranslationHandler() { 19998 return isFunction(_postTranslation) ? _postTranslation : null; 19999 } 20000 function setPostTranslationHandler(handler) { 20001 _postTranslation = handler; 20002 _context.postTranslation = handler; 20003 } 20004 function getMissingHandler() { 20005 return _missing; 20006 } 20007 function setMissingHandler(handler) { 20008 if (handler !== null) { 20009 _runtimeMissing = defineCoreMissingHandler(handler); 20010 } 20011 _missing = handler; 20012 _context.missing = _runtimeMissing; 20013 } 20014 function isResolvedTranslateMessage(type, arg) { 20015 return type !== "translate" || !arg.resolvedMessage; 20016 } 20017 const wrapWithDeps = (fn, argumentParser, warnType, fallbackSuccess, fallbackFail, successCondition) => { 20018 trackReactivityValues(); 20019 let ret; 20020 try { 20021 if (define_process_env_default$2.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) {
20022 /* @__PURE__ */ setAdditionalMeta(/* @__PURE__ */ getMetaInfo()); 20023 } 20024 if (!_isGlobal) { 20025 _context.fallbackContext = __root ? getFallbackContext() : void 0; 20026 } 20027 ret = fn(_context); 20028 } finally { 20029 if (define_process_env_default$2.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) ; 20030 if (!_isGlobal) { 20031 _context.fallbackContext = void 0; 20032 } 20033 } 20034 if (warnType !== "translate exists" && // for not `te` (e.g `t`) 20035 isNumber(ret) && ret === NOT_REOSLVED || warnType === "translate exists" && !ret) { 20036 const [key, arg2] = argumentParser(); 20037 if (define_process_env_default$2.NODE_ENV !== "production" && __root && isString$1(key) && isResolvedTranslateMessage(warnType, arg2)) { 20038 if (_fallbackRoot && (isTranslateFallbackWarn(_fallbackWarn, key) || isTranslateMissingWarn(_missingWarn, key))) { 20039 warn$1(getWarnMessage(I18nWarnCodes.FALLBACK_TO_ROOT, { 20040 key, 20041 type: warnType 20042 })); 20043 } 20044 if (define_process_env_default$2.NODE_ENV !== "production") { 20045 const { __v_emitter: emitter } = _context; 20046 if (emitter && _fallbackRoot) { 20047 emitter.emit("fallback", { 20048 type: warnType, 20049 key, 20050 to: "global", 20051 groupId: `${warnType}:${key}` 20052 }); 20053 } 20054 } 20055 } 20056 return __root && _fallbackRoot ? fallbackSuccess(__root) : fallbackFail(key); 20057 } else if (successCondition(ret)) { 20058 return ret; 20059 } else { 20060 throw createI18nError(I18nErrorCodes.UNEXPECTED_RETURN_TYPE); 20061 } 20062 }; 20063 function t(...args) { 20064 return wrapWithDeps((context) => Reflect.apply(translate, null, [context, ...args]), () => parseTranslateArgs(...args), "translate", (root) => Reflect.apply(root.t, root, [...args]), (key) => key, (val) => isString$1(val)); 20065 } 20066 function rt(...args) { 20067 const [arg1, arg2, arg3] = args; 20068 if (arg3 && !isObject$2(arg3)) { 20069 throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT); 20070 } 20071 return t(...[arg1, arg2, assign$2({ resolvedMessage: true }, arg3 || {})]); 20072 } 20073 function d(...args) { 20074 return wrapWithDeps((context) => Reflect.apply(datetime, null, [context, ...args]), () => parseDateTimeArgs(...args), "datetime format", (root) => Reflect.apply(root.d, root, [...args]), () => MISSING_RESOLVE_VALUE, (val) => isString$1(val)); 20075 } 20076 function n(...args) { 20077 return wrapWithDeps((context) => Reflect.apply(number, null, [context, ...args]), () => parseNumberArgs(...args), "number format", (root) => Reflect.apply(root.n, root, [...args]), () => MISSING_RESOLVE_VALUE, (val) => isString$1(val)); 20078 } 20079 function normalize(values) { 20080 return values.map((val) => isString$1(val) || isNumber(val) || isBoolean(val) ? createTextNode(String(val)) : val); 20081 } 20082 const interpolate = (val) => val; 20083 const processor = { 20084 normalize, 20085 interpolate, 20086 type: "vnode" 20087 }; 20088 function translateVNode(...args) { 20089 return wrapWithDeps( 20090 (context) => { 20091 let ret; 20092 const _context2 = context; 20093 try { 20094 _context2.processor = processor; 20095 ret = Reflect.apply(translate, null, [_context2, ...args]); 20096 } finally { 20097 _context2.processor = null; 20098 } 20099 return ret; 20100 }, 20101 () => parseTranslateArgs(...args), 20102 "translate", 20103 // eslint-disable-next-line @typescript-eslint/no-explicit-any 20104 (root) => root[TranslateVNodeSymbol](...args), 20105 (key) => [createTextNode(key)], 20106 (val) => isArray(val) 20107 ); 20108 } 20109 function numberParts(...args) { 20110 return wrapWithDeps( 20111 (context) => Reflect.apply(number, null, [context, ...args]), 20112 () => parseNumberArgs(...args), 20113 "number format", 20114 // eslint-disable-next-line @typescript-eslint/no-explicit-any 20115 (root) => root[NumberPartsSymbol](...args), 20116 NOOP_RETURN_ARRAY, 20117 (val) => isString$1(val) || isArray(val) 20118 ); 20119 } 20120 function datetimeParts(...args) { 20121 return wrapWithDeps( 20122 (context) => Reflect.apply(datetime, null, [context, ...args]), 20123 () => parseDateTimeArgs(...args), 20124 "datetime format", 20125 // eslint-disable-next-line @typescript-eslint/no-explicit-any 20126 (root) => root[DatetimePartsSymbol](...args), 20127 NOOP_RETURN_ARRAY, 20128 (val) => isString$1(val) || isArray(val) 20129 ); 20130 } 20131 function setPluralRules(rules) { 20132 _pluralRules = rules; 20133 _context.pluralRules = _pluralRules; 20134 } 20135 function te(key, locale2) { 20136 return wrapWithDeps(() => { 20137 if (!key) { 20138 return false;
vendor: 5,323 bytes, lines 20139-20308
20139 } 20140 const targetLocale = isString$1(locale2) ? locale2 : _locale.value; 20141 const message = getLocaleMessage(targetLocale); 20142 const resolved = _context.messageResolver(message, key); 20143 return !translateExistCompatible ? isMessageAST(resolved) || isMessageFunction(resolved) || isString$1(resolved) : resolved != null; 20144 }, () => [key], "translate exists", (root) => { 20145 return Reflect.apply(root.te, root, [key, locale2]); 20146 }, NOOP_RETURN_FALSE, (val) => isBoolean(val)); 20147 } 20148 function resolveMessages(key) { 20149 let messages2 = null; 20150 const locales = fallbackWithLocaleChain(_context, _fallbackLocale.value, _locale.value); 20151 for (let i = 0; i < locales.length; i++) { 20152 const targetLocaleMessages = _messages.value[locales[i]] || {}; 20153 const messageValue = _context.messageResolver(targetLocaleMessages, key); 20154 if (messageValue != null) { 20155 messages2 = messageValue; 20156 break; 20157 } 20158 } 20159 return messages2; 20160 } 20161 function tm(key) { 20162 const messages2 = resolveMessages(key); 20163 return messages2 != null ? messages2 : __root ? __root.tm(key) || {} : {}; 20164 } 20165 function getLocaleMessage(locale2) { 20166 return _messages.value[locale2] || {}; 20167 } 20168 function setLocaleMessage(locale2, message) { 20169 if (flatJson) { 20170 const _message = { [locale2]: message }; 20171 for (const key in _message) { 20172 if (hasOwn(_message, key)) { 20173 handleFlatJson(_message[key]); 20174 } 20175 } 20176 message = _message[locale2]; 20177 } 20178 _messages.value[locale2] = message; 20179 _context.messages = _messages.value; 20180 } 20181 function mergeLocaleMessage(locale2, message) { 20182 _messages.value[locale2] = _messages.value[locale2] || {}; 20183 const _message = { [locale2]: message }; 20184 if (flatJson) { 20185 for (const key in _message) { 20186 if (hasOwn(_message, key)) { 20187 handleFlatJson(_message[key]); 20188 } 20189 } 20190 } 20191 message = _message[locale2]; 20192 deepCopy(message, _messages.value[locale2]); 20193 _context.messages = _messages.value; 20194 } 20195 function getDateTimeFormat(locale2) { 20196 return _datetimeFormats.value[locale2] || {}; 20197 } 20198 function setDateTimeFormat(locale2, format2) { 20199 _datetimeFormats.value[locale2] = format2; 20200 _context.datetimeFormats = _datetimeFormats.value; 20201 clearDateTimeFormat(_context, locale2, format2); 20202 } 20203 function mergeDateTimeFormat(locale2, format2) { 20204 _datetimeFormats.value[locale2] = assign$2(_datetimeFormats.value[locale2] || {}, format2); 20205 _context.datetimeFormats = _datetimeFormats.value; 20206 clearDateTimeFormat(_context, locale2, format2); 20207 } 20208 function getNumberFormat(locale2) { 20209 return _numberFormats.value[locale2] || {}; 20210 } 20211 function setNumberFormat(locale2, format2) { 20212 _numberFormats.value[locale2] = format2; 20213 _context.numberFormats = _numberFormats.value; 20214 clearNumberFormat(_context, locale2, format2); 20215 } 20216 function mergeNumberFormat(locale2, format2) { 20217 _numberFormats.value[locale2] = assign$2(_numberFormats.value[locale2] || {}, format2); 20218 _context.numberFormats = _numberFormats.value; 20219 clearNumberFormat(_context, locale2, format2); 20220 } 20221 composerID++; 20222 if (__root && inBrowser) { 20223 watch(__root.locale, (val) => { 20224 if (_inheritLocale) { 20225 _locale.value = val; 20226 _context.locale = val; 20227 updateFallbackLocale(_context, _locale.value, _fallbackLocale.value); 20228 } 20229 }); 20230 watch(__root.fallbackLocale, (val) => { 20231 if (_inheritLocale) { 20232 _fallbackLocale.value = val; 20233 _context.fallbackLocale = val; 20234 updateFallbackLocale(_context, _locale.value, _fallbackLocale.value); 20235 } 20236 }); 20237 } 20238 const composer = { 20239 id: composerID, 20240 locale, 20241 fallbackLocale, 20242 get inheritLocale() { 20243 return _inheritLocale; 20244 }, 20245 set inheritLocale(val) { 20246 _inheritLocale = val; 20247 if (val && __root) { 20248 _locale.value = __root.locale.value; 20249 _fallbackLocale.value = __root.fallbackLocale.value; 20250 updateFallbackLocale(_context, _locale.value, _fallbackLocale.value); 20251 } 20252 }, 20253 get availableLocales() { 20254 return Object.keys(_messages.value).sort(); 20255 }, 20256 messages, 20257 get modifiers() { 20258 return _modifiers; 20259 }, 20260 get pluralRules() { 20261 return _pluralRules || {}; 20262 }, 20263 get isGlobal() { 20264 return _isGlobal; 20265 }, 20266 get missingWarn() { 20267 return _missingWarn; 20268 }, 20269 set missingWarn(val) { 20270 _missingWarn = val; 20271 _context.missingWarn = _missingWarn; 20272 }, 20273 get fallbackWarn() { 20274 return _fallbackWarn; 20275 }, 20276 set fallbackWarn(val) { 20277 _fallbackWarn = val; 20278 _context.fallbackWarn = _fallbackWarn; 20279 }, 20280 get fallbackRoot() { 20281 return _fallbackRoot; 20282 }, 20283 set fallbackRoot(val) { 20284 _fallbackRoot = val; 20285 }, 20286 get fallbackFormat() { 20287 return _fallbackFormat; 20288 }, 20289 set fallbackFormat(val) { 20290 _fallbackFormat = val; 20291 _context.fallbackFormat = _fallbackFormat; 20292 }, 20293 get warnHtmlMessage() { 20294 return _warnHtmlMessage; 20295 }, 20296 set warnHtmlMessage(val) { 20297 _warnHtmlMessage = val; 20298 _context.warnHtmlMessage = val; 20299 }, 20300 get escapeParameter() { 20301 return _escapeParameter; 20302 }, 20303 set escapeParameter(val) { 20304 _escapeParameter = val; 20305 _context.escapeParameter = val; 20306 }, 20307 t, 20308 getLocaleMessage,
20309 setLocaleMessage, 20310 mergeLocaleMessage, 20311 getPostTranslationHandler, 20312 setPostTranslationHandler, 20313 getMissingHandler, 20314 setMissingHandler, 20315 [SetPluralRulesSymbol]: setPluralRules 20316 }; 20317 { 20318 composer.datetimeFormats = datetimeFormats; 20319 composer.numberFormats = numberFormats; 20320 composer.rt = rt; 20321 composer.te = te; 20322 composer.tm = tm; 20323 composer.d = d; 20324 composer.n = n; 20325 composer.getDateTimeFormat = getDateTimeFormat; 20326 composer.setDateTimeFormat = setDateTimeFormat; 20327 composer.mergeDateTimeFormat = mergeDateTimeFormat; 20328 composer.getNumberFormat = getNumberFormat; 20329 composer.setNumberFormat = setNumberFormat; 20330 composer.mergeNumberFormat = mergeNumberFormat; 20331 composer[InejctWithOptionSymbol] = __injectWithOption; 20332 composer[TranslateVNodeSymbol] = translateVNode; 20333 composer[DatetimePartsSymbol] = datetimeParts; 20334 composer[NumberPartsSymbol] = numberParts; 20335 } 20336 if (define_process_env_default$2.NODE_ENV !== "production") { 20337 composer[EnableEmitter] = (emitter) => { 20338 _context.__v_emitter = emitter; 20339 }; 20340 composer[DisableEmitter] = () => { 20341 _context.__v_emitter = void 0; 20342 }; 20343 } 20344 return composer; 20345} 20346function convertComposerOptions(options) { 20347 const locale = isString$1(options.locale) ? options.locale : DEFAULT_LOCALE; 20348 const fallbackLocale = isString$1(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject$1(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : locale; 20349 const missing = isFunction(options.missing) ? options.missing : void 0; 20350 const missingWarn = isBoolean(options.silentTranslationWarn) || isRegExp(options.silentTranslationWarn) ? !options.silentTranslationWarn : true; 20351 const fallbackWarn = isBoolean(options.silentFallbackWarn) || isRegExp(options.silentFallbackWarn) ? !options.silentFallbackWarn : true; 20352 const fallbackRoot = isBoolean(options.fallbackRoot) ? options.fallbackRoot : true; 20353 const fallbackFormat = !!options.formatFallbackMessages; 20354 const modifiers = isPlainObject$1(options.modifiers) ? options.modifiers : {}; 20355 const pluralizationRules = options.pluralizationRules; 20356 const postTranslation = isFunction(options.postTranslation) ? options.postTranslation : void 0; 20357 const warnHtmlMessage = isString$1(options.warnHtmlInMessage) ? options.warnHtmlInMessage !== "off" : true; 20358 const escapeParameter = !!options.escapeParameterHtml; 20359 const inheritLocale = isBoolean(options.sync) ? options.sync : true; 20360 if (define_process_env_default$2.NODE_ENV !== "production" && options.formatter) { 20361 warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_FORMATTER)); 20362 } 20363 if (define_process_env_default$2.NODE_ENV !== "production" && options.preserveDirectiveContent) { 20364 warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_PRESERVE_DIRECTIVE)); 20365 } 20366 let messages = options.messages; 20367 if (isPlainObject$1(options.sharedMessages)) { 20368 const sharedMessages = options.sharedMessages; 20369 const locales = Object.keys(sharedMessages); 20370 messages = locales.reduce((messages2, locale2) => { 20371 const message = messages2[locale2] || (messages2[locale2] = {}); 20372 assign$2(message, sharedMessages[locale2]); 20373 return messages2; 20374 }, messages || {}); 20375 } 20376 const { __i18n, __root, __injectWithOption } = options; 20377 const datetimeFormats = options.datetimeFormats; 20378 const numberFormats = options.numberFormats; 20379 const flatJson = options.flatJson; 20380 const translateExistCompatible = options.translateExistCompatible; 20381 return { 20382 locale, 20383 fallbackLocale, 20384 messages, 20385 flatJson, 20386 datetimeFormats, 20387 numberFormats, 20388 missing, 20389 missingWarn, 20390 fallbackWarn, 20391 fallbackRoot, 20392 fallbackFormat, 20393 modifiers, 20394 pluralRules: pluralizationRules, 20395 postTranslation, 20396 warnHtmlMessage, 20397 escapeParameter, 20398 messageResolver: options.messageResolver, 20399 inheritLocale, 20400 translateExistCompatible, 20401 __i18n, 20402 __root, 20403 __injectWithOption 20404 }; 20405} 20406function createVueI18n(options = {}, VueI18nLegacy) { 20407 { 20408 const composer = createComposer(convertComposerOptions(options)); 20409 const { __extender } = options; 20410 const vueI18n = { 20411 // id 20412 id: composer.id, 20413 // locale 20414 get locale() { 20415 return composer.locale.value; 20416 }, 20417 set locale(val) { 20418 composer.locale.value = val; 20419 }, 20420 // fallbackLocale 20421 get fallbackLocale() { 20422 return composer.fallbackLocale.value; 20423 }, 20424 set fallbackLocale(val) { 20425 composer.fallbackLocale.value = val; 20426 }, 20427 // messages 20428 get messages() { 20429 return composer.messages.value; 20430 }, 20431 // datetimeFormats 20432 get datetimeFormats() { 20433 return composer.datetimeFormats.value; 20434 }, 20435 // numberFormats 20436 get numberFormats() { 20437 return composer.numberFormats.value; 20438 }, 20439 // availableLocales 20440 get availableLocales() { 20441 return composer.availableLocales; 20442 }, 20443 // formatter 20444 get formatter() { 20445 define_process_env_default$2.NODE_ENV !== "production" && warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_FORMATTER)); 20446 return { 20447 interpolate() { 20448 return []; 20449 } 20450 }; 20451 }, 20452 set formatter(val) { 20453 define_process_env_default$2.NODE_ENV !== "production" && warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_FORMATTER)); 20454 }, 20455 // missing 20456 get missing() { 20457 return composer.getMissingHandler(); 20458 }, 20459 set missing(handler) { 20460 composer.setMissingHandler(handler); 20461 }, 20462 // silentTranslationWarn 20463 get silentTranslationWarn() { 20464 return isBoolean(composer.missingWarn) ? !composer.missingWarn : composer.missingWarn; 20465 }, 20466 set silentTranslationWarn(val) { 20467 composer.missingWarn = isBoolean(val) ? !val : val; 20468 }, 20469 // silentFallbackWarn 20470 get silentFallbackWarn() { 20471 return isBoolean(composer.fallbackWarn) ? !composer.fallbackWarn : composer.fallbackWarn; 20472 }, 20473 set silentFallbackWarn(val) { 20474 composer.fallbackWarn = isBoolean(val) ? !val : val; 20475 }, 20476 // modifiers 20477 get modifiers() { 20478 return composer.modifiers; 20479 }, 20480 // formatFallbackMessages 20481 get formatFallbackMessages() { 20482 return composer.fallbackFormat; 20483 }, 20484 set formatFallbackMessages(val) { 20485 composer.fallbackFormat = val; 20486 }, 20487 // postTranslation 20488 get postTranslation() { 20489 return composer.getPostTranslationHandler(); 20490 }, 20491 set postTranslation(handler) { 20492 composer.setPostTranslationHandler(handler); 20493 }, 20494 // sync 20495 get sync() { 20496 return composer.inheritLocale; 20497 }, 20498 set sync(val) { 20499 composer.inheritLocale = val; 20500 }, 20501 // warnInHtmlMessage 20502 get warnHtmlInMessage() { 20503 return composer.warnHtmlMessage ? "warn" : "off"; 20504 }, 20505 set warnHtmlInMessage(val) { 20506 composer.warnHtmlMessage = val !== "off"; 20507 }, 20508 // escapeParameterHtml 20509 get escapeParameterHtml() { 20510 return composer.escapeParameter; 20511 }, 20512 set escapeParameterHtml(val) { 20513 composer.escapeParameter = val; 20514 }, 20515 // preserveDirectiveContent 20516 get preserveDirectiveContent() { 20517 define_process_env_default$2.NODE_ENV !== "production" && warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_PRESERVE_DIRECTIVE)); 20518 return true; 20519 }, 20520 set preserveDirectiveContent(val) { 20521 define_process_env_default$2.NODE_ENV !== "production" && warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_PRESERVE_DIRECTIVE)); 20522 }, 20523 // pluralizationRules 20524 get pluralizationRules() { 20525 return composer.pluralRules || {}; 20526 }, 20527 // for internal 20528 __composer: composer, 20529 // t 20530 t(...args) { 20531 const [arg1, arg2, arg3] = args; 20532 const options2 = {}; 20533 let list2 = null; 20534 let named = null; 20535 if (!isString$1(arg1)) { 20536 throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT); 20537 }
20538 const key = arg1; 20539 if (isString$1(arg2)) { 20540 options2.locale = arg2; 20541 } else if (isArray(arg2)) { 20542 list2 = arg2; 20543 } else if (isPlainObject$1(arg2)) { 20544 named = arg2; 20545 } 20546 if (isArray(arg3)) { 20547 list2 = arg3; 20548 } else if (isPlainObject$1(arg3)) { 20549 named = arg3; 20550 } 20551 return Reflect.apply(composer.t, composer, [ 20552 key, 20553 list2 || named || {}, 20554 options2 20555 ]); 20556 }, 20557 rt(...args) { 20558 return Reflect.apply(composer.rt, composer, [...args]); 20559 }, 20560 // tc 20561 tc(...args) { 20562 const [arg1, arg2, arg3] = args; 20563 const options2 = { plural: 1 }; 20564 let list2 = null; 20565 let named = null; 20566 if (!isString$1(arg1)) { 20567 throw createI18nError(I18nErrorCodes.INVALID_ARGUMENT); 20568 } 20569 const key = arg1; 20570 if (isString$1(arg2)) { 20571 options2.locale = arg2; 20572 } else if (isNumber(arg2)) { 20573 options2.plural = arg2; 20574 } else if (isArray(arg2)) { 20575 list2 = arg2; 20576 } else if (isPlainObject$1(arg2)) { 20577 named = arg2; 20578 } 20579 if (isString$1(arg3)) { 20580 options2.locale = arg3; 20581 } else if (isArray(arg3)) { 20582 list2 = arg3; 20583 } else if (isPlainObject$1(arg3)) { 20584 named = arg3; 20585 } 20586 return Reflect.apply(composer.t, composer, [ 20587 key, 20588 list2 || named || {}, 20589 options2 20590 ]); 20591 }, 20592 // te 20593 te(key, locale) { 20594 return composer.te(key, locale); 20595 }, 20596 // tm 20597 tm(key) { 20598 return composer.tm(key); 20599 }, 20600 // getLocaleMessage 20601 getLocaleMessage(locale) { 20602 return composer.getLocaleMessage(locale); 20603 }, 20604 // setLocaleMessage 20605 setLocaleMessage(locale, message) { 20606 composer.setLocaleMessage(locale, message); 20607 }, 20608 // mergeLocaleMessage 20609 mergeLocaleMessage(locale, message) { 20610 composer.mergeLocaleMessage(locale, message); 20611 }, 20612 // d 20613 d(...args) { 20614 return Reflect.apply(composer.d, composer, [...args]); 20615 }, 20616 // getDateTimeFormat 20617 getDateTimeFormat(locale) { 20618 return composer.getDateTimeFormat(locale); 20619 }, 20620 // setDateTimeFormat 20621 setDateTimeFormat(locale, format2) { 20622 composer.setDateTimeFormat(locale, format2); 20623 }, 20624 // mergeDateTimeFormat 20625 mergeDateTimeFormat(locale, format2) { 20626 composer.mergeDateTimeFormat(locale, format2); 20627 }, 20628 // n 20629 n(...args) { 20630 return Reflect.apply(composer.n, composer, [...args]); 20631 }, 20632 // getNumberFormat 20633 getNumberFormat(locale) { 20634 return composer.getNumberFormat(locale); 20635 }, 20636 // setNumberFormat 20637 setNumberFormat(locale, format2) { 20638 composer.setNumberFormat(locale, format2); 20639 }, 20640 // mergeNumberFormat 20641 mergeNumberFormat(locale, format2) { 20642 composer.mergeNumberFormat(locale, format2); 20643 }, 20644 // getChoiceIndex 20645 // eslint-disable-next-line @typescript-eslint/no-unused-vars 20646 getChoiceIndex(choice, choicesLength) { 20647 define_process_env_default$2.NODE_ENV !== "production" && warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_GET_CHOICE_INDEX)); 20648 return -1; 20649 } 20650 }; 20651 vueI18n.__extender = __extender; 20652 if (define_process_env_default$2.NODE_ENV !== "production") { 20653 vueI18n.__enableEmitter = (emitter) => { 20654 const __composer = composer; 20655 __composer[EnableEmitter] && __composer[EnableEmitter](emitter); 20656 }; 20657 vueI18n.__disableEmitter = () => { 20658 const __composer = composer; 20659 __composer[DisableEmitter] && __composer[DisableEmitter](); 20660 }; 20661 } 20662 return vueI18n; 20663 } 20664} 20665const baseFormatProps = { 20666 tag: { 20667 type: [String, Object] 20668 }, 20669 locale: { 20670 type: String 20671 }, 20672 scope: { 20673 type: String, 20674 // NOTE: avoid https://github.com/microsoft/rushstack/issues/1050 20675 validator: (val) => val === "parent" || val === "global", 20676 default: "parent" 20677 /* ComponentI18nScope */ 20678 }, 20679 i18n: { 20680 type: Object 20681 } 20682}; 20683function getInterpolateArg({ slots }, keys) { 20684 if (keys.length === 1 && keys[0] === "default") { 20685 const ret = slots.default ? slots.default() : []; 20686 return ret.reduce((slot, current) => { 20687 return [ 20688 ...slot, 20689 // prettier-ignore 20690 ...current.type === Fragment ? current.children : [current] 20691 ]; 20692 }, []); 20693 } else { 20694 return keys.reduce((arg, key) => { 20695 const slot = slots[key]; 20696 if (slot) { 20697 arg[key] = slot(); 20698 } 20699 return arg; 20700 }, create()); 20701 } 20702} 20703function getFragmentableTag(tag2) { 20704 return Fragment; 20705} 20706const TranslationImpl = /* @__PURE__ */ defineComponent({ 20707 /* eslint-disable */ 20708 name: "i18n-t", 20709 props: assign$2({ 20710 keypath: { 20711 type: String, 20712 required: true 20713 }, 20714 plural: { 20715 type: [Number, String], 20716 // eslint-disable-next-line @typescript-eslint/no-explicit-any 20717 validator: (val) => isNumber(val) || !isNaN(val) 20718 } 20719 }, baseFormatProps), 20720 /* eslint-enable */ 20721 // eslint-disable-next-line @typescript-eslint/no-explicit-any 20722 setup(props, context) { 20723 const { slots, attrs } = context; 20724 const i18n2 = props.i18n || useI18n({ 20725 useScope: props.scope, 20726 __useComponent: true 20727 }); 20728 return () => {
20729 const keys = Object.keys(slots).filter((key) => key !== "_"); 20730 const options = create(); 20731 if (props.locale) { 20732 options.locale = props.locale; 20733 } 20734 if (props.plural !== void 0) { 20735 options.plural = isString$1(props.plural) ? +props.plural : props.plural; 20736 } 20737 const arg = getInterpolateArg(context, keys); 20738 const children = i18n2[TranslateVNodeSymbol](props.keypath, arg, options); 20739 const assignedAttrs = assign$2(create(), attrs); 20740 const tag2 = isString$1(props.tag) || isObject$2(props.tag) ? props.tag : getFragmentableTag(); 20741 return h(tag2, assignedAttrs, children); 20742 }; 20743 } 20744}); 20745const Translation = TranslationImpl; 20746function isVNode(target) { 20747 return isArray(target) && !isString$1(target[0]); 20748} 20749function renderFormatter(props, context, slotKeys, partFormatter) { 20750 const { slots, attrs } = context; 20751 return () => { 20752 const options = { part: true }; 20753 let overrides = create(); 20754 if (props.locale) { 20755 options.locale = props.locale; 20756 } 20757 if (isString$1(props.format)) { 20758 options.key = props.format; 20759 } else if (isObject$2(props.format)) { 20760 if (isString$1(props.format.key)) { 20761 options.key = props.format.key; 20762 } 20763 overrides = Object.keys(props.format).reduce((options2, prop) => { 20764 return slotKeys.includes(prop) ? assign$2(create(), options2, { [prop]: props.format[prop] }) : options2; 20765 }, create()); 20766 } 20767 const parts = partFormatter(...[props.value, options, overrides]); 20768 let children = [options.key]; 20769 if (isArray(parts)) { 20770 children = parts.map((part, index) => { 20771 const slot = slots[part.type]; 20772 const node = slot ? slot({ [part.type]: part.value, index, parts }) : [part.value]; 20773 if (isVNode(node)) { 20774 node[0].key = `${part.type}-${index}`; 20775 } 20776 return node; 20777 }); 20778 } else if (isString$1(parts)) { 20779 children = [parts]; 20780 } 20781 const assignedAttrs = assign$2(create(), attrs); 20782 const tag2 = isString$1(props.tag) || isObject$2(props.tag) ? props.tag : getFragmentableTag(); 20783 return h(tag2, assignedAttrs, children); 20784 }; 20785} 20786const NumberFormatImpl = /* @__PURE__ */ defineComponent({ 20787 /* eslint-disable */ 20788 name: "i18n-n", 20789 props: assign$2({ 20790 value: { 20791 type: Number, 20792 required: true 20793 }, 20794 format: { 20795 type: [String, Object] 20796 } 20797 }, baseFormatProps), 20798 /* eslint-enable */ 20799 // eslint-disable-next-line @typescript-eslint/no-explicit-any 20800 setup(props, context) { 20801 const i18n2 = props.i18n || useI18n({ 20802 useScope: props.scope, 20803 __useComponent: true 20804 }); 20805 return renderFormatter(props, context, NUMBER_FORMAT_OPTIONS_KEYS, (...args) => ( 20806 // eslint-disable-next-line @typescript-eslint/no-explicit-any 20807 i18n2[NumberPartsSymbol](...args) 20808 )); 20809 } 20810}); 20811const NumberFormat = NumberFormatImpl; 20812const DatetimeFormatImpl = /* @__PURE__ */ defineComponent({ 20813 /* eslint-disable */ 20814 name: "i18n-d", 20815 props: assign$2({ 20816 value: { 20817 type: [Number, Date], 20818 required: true 20819 }, 20820 format: { 20821 type: [String, Object] 20822 } 20823 }, baseFormatProps), 20824 /* eslint-enable */ 20825 // eslint-disable-next-line @typescript-eslint/no-explicit-any 20826 setup(props, context) { 20827 const i18n2 = props.i18n || useI18n({ 20828 useScope: props.scope, 20829 __useComponent: true 20830 }); 20831 return renderFormatter(props, context, DATETIME_FORMAT_OPTIONS_KEYS, (...args) => ( 20832 // eslint-disable-next-line @typescript-eslint/no-explicit-any 20833 i18n2[DatetimePartsSymbol](...args) 20834 )); 20835 } 20836}); 20837const DatetimeFormat = DatetimeFormatImpl; 20838function getComposer$2(i18n2, instance) { 20839 const i18nInternal = i18n2; 20840 if (i18n2.mode === "composition") { 20841 return i18nInternal.__getInstance(instance) || i18n2.global; 20842 } else { 20843 const vueI18n = i18nInternal.__getInstance(instance); 20844 return vueI18n != null ? vueI18n.__composer : i18n2.global.__composer; 20845 } 20846} 20847function vTDirective(i18n2) { 20848 const _process = (binding) => { 20849 const { instance, modifiers, value } = binding; 20850 if (!instance || !instance.$) { 20851 throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR); 20852 } 20853 const composer = getComposer$2(i18n2, instance.$); 20854 if (define_process_env_default$2.NODE_ENV !== "production" && modifiers.preserve) { 20855 warn$1(getWarnMessage(I18nWarnCodes.NOT_SUPPORTED_PRESERVE)); 20856 } 20857 const parsedValue = parseValue(value); 20858 return [ 20859 Reflect.apply(composer.t, composer, [...makeParams(parsedValue)]), 20860 composer 20861 ]; 20862 }; 20863 const register = (el, binding) => { 20864 const [textContent, composer] = _process(binding); 20865 if (inBrowser && i18n2.global === composer) { 20866 el.__i18nWatcher = watch(composer.locale, () => { 20867 binding.instance && binding.instance.$forceUpdate(); 20868 }); 20869 } 20870 el.__composer = composer; 20871 el.textContent = textContent; 20872 }; 20873 const unregister = (el) => { 20874 if (inBrowser && el.__i18nWatcher) { 20875 el.__i18nWatcher(); 20876 el.__i18nWatcher = void 0; 20877 delete el.__i18nWatcher; 20878 } 20879 if (el.__composer) { 20880 el.__composer = void 0; 20881 delete el.__composer; 20882 } 20883 }; 20884 const update2 = (el, { value }) => { 20885 if (el.__composer) { 20886 const composer = el.__composer; 20887 const parsedValue = parseValue(value); 20888 el.textContent = Reflect.apply(composer.t, composer, [ 20889 ...makeParams(parsedValue) 20890 ]); 20891 } 20892 }; 20893 const getSSRProps = (binding) => { 20894 const [textContent] = _process(binding); 20895 return { textContent }; 20896 }; 20897 return { 20898 created: register, 20899 unmounted: unregister, 20900 beforeUpdate: update2, 20901 getSSRProps 20902 }; 20903} 20904function parseValue(value) { 20905 if (isString$1(value)) { 20906 return { path: value }; 20907 } else if (isPlainObject$1(value)) { 20908 if (!("path" in value)) { 20909 throw createI18nError(I18nErrorCodes.REQUIRED_VALUE, "path"); 20910 } 20911 return value; 20912 } else { 20913 throw createI18nError(I18nErrorCodes.INVALID_VALUE); 20914 } 20915} 20916function makeParams(value) { 20917 const { path, locale, args, choice, plural } = value; 20918 const options = {}; 20919 const named = args || {}; 20920 if (isString$1(locale)) { 20921 options.locale = locale; 20922 } 20923 if (isNumber(choice)) { 20924 options.plural = choice; 20925 } 20926 if (isNumber(plural)) { 20927 options.plural = plural; 20928 } 20929 return [path, named, options]; 20930} 20931function apply(app, i18n2, ...options) { 20932 const pluginOptions = isPlainObject$1(options[0]) ? options[0] : {}; 20933 const useI18nComponentName = !!pluginOptions.useI18nComponentName; 20934 const globalInstall = isBoolean(pluginOptions.globalInstall) ? pluginOptions.globalInstall : true; 20935 if (define_process_env_default$2.NODE_ENV !== "production" && globalInstall && useI18nComponentName) { 20936 warn$1(getWarnMessage(I18nWarnCodes.COMPONENT_NAME_LEGACY_COMPATIBLE, { 20937 name: Translation.name 20938 })); 20939 } 20940 if (globalInstall) { 20941 [!useI18nComponentName ? Translation.name : "i18n", "I18nT"].forEach((name) => app.component(name, Translation)); 20942 [NumberFormat.name, "I18nN"].forEach((name) => app.component(name, NumberFormat)); 20943 [DatetimeFormat.name, "I18nD"].forEach((name) => app.component(name, DatetimeFormat)); 20944 } 20945 { 20946 app.directive("t", vTDirective(i18n2)); 20947 } 20948} 20949const VueDevToolsLabels = { 20950 [ 20951 "vue-devtools-plugin-vue-i18n" 20952 /* VueDevToolsIDs.PLUGIN */ 20953 ]: "Vue I18n devtools", 20954 [ 20955 "vue-i18n-resource-inspector" 20956 /* VueDevToolsIDs.CUSTOM_INSPECTOR */ 20957 ]: "I18n Resources", 20958 [ 20959 "vue-i18n-timeline" 20960 /* VueDevToolsIDs.TIMELINE */ 20961 ]: "Vue I18n" 20962}; 20963const VueDevToolsPlaceholders = { 20964 [ 20965 "vue-i18n-resource-inspector" 20966 /* VueDevToolsIDs.CUSTOM_INSPECTOR */ 20967 ]: "Search for scopes ..." 20968}; 20969const VueDevToolsTimelineColors = { 20970 [ 20971 "vue-i18n-timeline" 20972 /* VueDevToolsIDs.TIMELINE */ 20973 ]: 16764185 20974}; 20975const VUE_I18N_COMPONENT_TYPES = "vue-i18n: composer properties"; 20976let devtoolsApi; 20977async function enableDevTools(app, i18n2) { 20978 return new Promise((resolve2, reject) => { 20979 try { 20980 setupDevtoolsPlugin({ 20981 id: "vue-devtools-plugin-vue-i18n", 20982 label: VueDevToolsLabels[ 20983 "vue-devtools-plugin-vue-i18n" 20984 /* VueDevToolsIDs.PLUGIN */ 20985 ], 20986 packageName: "vue-i18n", 20987 homepage: "https://vue-i18n.intlify.dev", 20988 logo: "https://vue-i18n.intlify.dev/vue-i18n-devtools-logo.png", 20989 componentStateTypes: [VUE_I18N_COMPONENT_TYPES], 20990 app 20991 // eslint-disable-line @typescript-eslint/no-explicit-any 20992 }, (api) => { 20993 devtoolsApi = api; 20994 api.on.visitComponentTree(({ componentInstance, treeNode }) => { 20995 updateComponentTreeTags(componentInstance, treeNode, i18n2); 20996 }); 20997 api.on.inspectComponent(({ componentInstance, instanceData }) => { 20998 if (componentInstance.vnode.el && componentInstance.vnode.el.__VUE_I18N__ && instanceData) { 20999 if (i18n2.mode === "legacy") { 21000 if (componentInstance.vnode.el.__VUE_I18N__ !== i18n2.global.__composer) { 21001 inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__); 21002 } 21003 } else { 21004 inspectComposer(instanceData, componentInstance.vnode.el.__VUE_I18N__); 21005 } 21006 } 21007 }); 21008 api.addInspector({ 21009 id: "vue-i18n-resource-inspector", 21010 label: VueDevToolsLabels[ 21011 "vue-i18n-resource-inspector" 21012 /* VueDevToolsIDs.CUSTOM_INSPECTOR */ 21013 ], 21014 icon: "language", 21015 treeFilterPlaceholder: VueDevToolsPlaceholders[ 21016 "vue-i18n-resource-inspector" 21017 /* VueDevToolsIDs.CUSTOM_INSPECTOR */ 21018 ] 21019 }); 21020 api.on.getInspectorTree((payload) => { 21021 if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") { 21022 registerScope(payload, i18n2); 21023 } 21024 }); 21025 const roots = /* @__PURE__ */ new Map(); 21026 api.on.getInspectorState(async (payload) => { 21027 if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") { 21028 api.unhighlightElement(); 21029 inspectScope(payload, i18n2); 21030 if (payload.nodeId === "global") { 21031 if (!roots.has(payload.app)) { 21032 const [root] = await api.getComponentInstances(payload.app); 21033 roots.set(payload.app, root); 21034 } 21035 api.highlightElement(roots.get(payload.app)); 21036 } else { 21037 const instance = getComponentInstance(payload.nodeId, i18n2); 21038 instance && api.highlightElement(instance); 21039 } 21040 } 21041 }); 21042 api.on.editInspectorState((payload) => { 21043 if (payload.app === app && payload.inspectorId === "vue-i18n-resource-inspector") { 21044 editScope(payload, i18n2); 21045 } 21046 }); 21047 api.addTimelineLayer({ 21048 id: "vue-i18n-timeline", 21049 label: VueDevToolsLabels[ 21050 "vue-i18n-timeline" 21051 /* VueDevToolsIDs.TIMELINE */ 21052 ], 21053 color: VueDevToolsTimelineColors[ 21054 "vue-i18n-timeline" 21055 /* VueDevToolsIDs.TIMELINE */ 21056 ] 21057 }); 21058 resolve2(true); 21059 }); 21060 } catch (e) { 21061 console.error(e); 21062 reject(false); 21063 } 21064 }); 21065} 21066function getI18nScopeLable(instance) {
vendor: 7,466 bytes, lines 21067-21332
21067 return instance.type.name || instance.type.displayName || instance.type.__file || "Anonymous"; 21068} 21069function updateComponentTreeTags(instance, treeNode, i18n2) { 21070 const global2 = i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer; 21071 if (instance && instance.vnode.el && instance.vnode.el.__VUE_I18N__) { 21072 if (instance.vnode.el.__VUE_I18N__ !== global2) { 21073 const tag2 = { 21074 label: `i18n (${getI18nScopeLable(instance)} Scope)`, 21075 textColor: 0, 21076 backgroundColor: 16764185 21077 }; 21078 treeNode.tags.push(tag2); 21079 } 21080 } 21081} 21082function inspectComposer(instanceData, composer) { 21083 const type = VUE_I18N_COMPONENT_TYPES; 21084 instanceData.state.push({ 21085 type, 21086 key: "locale", 21087 editable: true, 21088 value: composer.locale.value 21089 }); 21090 instanceData.state.push({ 21091 type, 21092 key: "availableLocales", 21093 editable: false, 21094 value: composer.availableLocales 21095 }); 21096 instanceData.state.push({ 21097 type, 21098 key: "fallbackLocale", 21099 editable: true, 21100 value: composer.fallbackLocale.value 21101 }); 21102 instanceData.state.push({ 21103 type, 21104 key: "inheritLocale", 21105 editable: true, 21106 value: composer.inheritLocale 21107 }); 21108 instanceData.state.push({ 21109 type, 21110 key: "messages", 21111 editable: false, 21112 value: getLocaleMessageValue(composer.messages.value) 21113 }); 21114 { 21115 instanceData.state.push({ 21116 type, 21117 key: "datetimeFormats", 21118 editable: false, 21119 value: composer.datetimeFormats.value 21120 }); 21121 instanceData.state.push({ 21122 type, 21123 key: "numberFormats", 21124 editable: false, 21125 value: composer.numberFormats.value 21126 }); 21127 } 21128} 21129function getLocaleMessageValue(messages) { 21130 const value = {}; 21131 Object.keys(messages).forEach((key) => { 21132 const v = messages[key]; 21133 if (isFunction(v) && "source" in v) { 21134 value[key] = getMessageFunctionDetails(v); 21135 } else if (isMessageAST(v) && v.loc && v.loc.source) { 21136 value[key] = v.loc.source; 21137 } else if (isObject$2(v)) { 21138 value[key] = getLocaleMessageValue(v); 21139 } else { 21140 value[key] = v; 21141 } 21142 }); 21143 return value; 21144} 21145const ESC = { 21146 "<": "<", 21147 ">": ">", 21148 '"': """, 21149 "&": "&" 21150}; 21151function escape(s) { 21152 return s.replace(/[<>"&]/g, escapeChar); 21153} 21154function escapeChar(a) { 21155 return ESC[a] || a; 21156} 21157function getMessageFunctionDetails(func) { 21158 const argString = func.source ? `("${escape(func.source)}")` : `(?)`; 21159 return { 21160 _custom: { 21161 type: "function", 21162 display: `<span>Æ</span> ${argString}` 21163 } 21164 }; 21165} 21166function registerScope(payload, i18n2) { 21167 payload.rootNodes.push({ 21168 id: "global", 21169 label: "Global Scope" 21170 }); 21171 const global2 = i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer; 21172 for (const [keyInstance, instance] of i18n2.__instances) { 21173 const composer = i18n2.mode === "composition" ? instance : instance.__composer; 21174 if (global2 === composer) { 21175 continue; 21176 } 21177 payload.rootNodes.push({ 21178 id: composer.id.toString(), 21179 label: `${getI18nScopeLable(keyInstance)} Scope` 21180 }); 21181 } 21182} 21183function getComponentInstance(nodeId, i18n2) { 21184 let instance = null; 21185 if (nodeId !== "global") { 21186 for (const [component, composer] of i18n2.__instances.entries()) { 21187 if (composer.id.toString() === nodeId) { 21188 instance = component; 21189 break; 21190 } 21191 } 21192 } 21193 return instance; 21194} 21195function getComposer$1(nodeId, i18n2) { 21196 if (nodeId === "global") { 21197 return i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer; 21198 } else { 21199 const instance = Array.from(i18n2.__instances.values()).find((item) => item.id.toString() === nodeId); 21200 if (instance) { 21201 return i18n2.mode === "composition" ? instance : instance.__composer; 21202 } else { 21203 return null; 21204 } 21205 } 21206} 21207function inspectScope(payload, i18n2) { 21208 const composer = getComposer$1(payload.nodeId, i18n2); 21209 if (composer) { 21210 payload.state = makeScopeInspectState(composer); 21211 } 21212 return null; 21213} 21214function makeScopeInspectState(composer) { 21215 const state = {}; 21216 const localeType = "Locale related info"; 21217 const localeStates = [ 21218 { 21219 type: localeType, 21220 key: "locale", 21221 editable: true, 21222 value: composer.locale.value 21223 }, 21224 { 21225 type: localeType, 21226 key: "fallbackLocale", 21227 editable: true, 21228 value: composer.fallbackLocale.value 21229 }, 21230 { 21231 type: localeType, 21232 key: "availableLocales", 21233 editable: false, 21234 value: composer.availableLocales 21235 }, 21236 { 21237 type: localeType, 21238 key: "inheritLocale", 21239 editable: true, 21240 value: composer.inheritLocale 21241 } 21242 ]; 21243 state[localeType] = localeStates; 21244 const localeMessagesType = "Locale messages info"; 21245 const localeMessagesStates = [ 21246 { 21247 type: localeMessagesType, 21248 key: "messages", 21249 editable: false, 21250 value: getLocaleMessageValue(composer.messages.value) 21251 } 21252 ]; 21253 state[localeMessagesType] = localeMessagesStates; 21254 { 21255 const datetimeFormatsType = "Datetime formats info"; 21256 const datetimeFormatsStates = [ 21257 { 21258 type: datetimeFormatsType, 21259 key: "datetimeFormats", 21260 editable: false, 21261 value: composer.datetimeFormats.value 21262 } 21263 ]; 21264 state[datetimeFormatsType] = datetimeFormatsStates; 21265 const numberFormatsType = "Datetime formats info"; 21266 const numberFormatsStates = [ 21267 { 21268 type: numberFormatsType, 21269 key: "numberFormats", 21270 editable: false, 21271 value: composer.numberFormats.value 21272 } 21273 ]; 21274 state[numberFormatsType] = numberFormatsStates; 21275 } 21276 return state; 21277} 21278function addTimelineEvent(event, payload) { 21279 if (devtoolsApi) { 21280 let groupId; 21281 if (payload && "groupId" in payload) { 21282 groupId = payload.groupId; 21283 delete payload.groupId; 21284 } 21285 devtoolsApi.addTimelineEvent({ 21286 layerId: "vue-i18n-timeline", 21287 event: { 21288 title: event, 21289 groupId, 21290 time: Date.now(), 21291 meta: {}, 21292 data: payload || {}, 21293 logType: event === "compile-error" ? "error" : event === "fallback" || event === "missing" ? "warning" : "default" 21294 } 21295 }); 21296 } 21297} 21298function editScope(payload, i18n2) { 21299 const composer = getComposer$1(payload.nodeId, i18n2); 21300 if (composer) { 21301 const [field] = payload.path; 21302 if (field === "locale" && isString$1(payload.state.value)) { 21303 composer.locale.value = payload.state.value; 21304 } else if (field === "fallbackLocale" && (isString$1(payload.state.value) || isArray(payload.state.value) || isObject$2(payload.state.value))) { 21305 composer.fallbackLocale.value = payload.state.value; 21306 } else if (field === "inheritLocale" && isBoolean(payload.state.value)) { 21307 composer.inheritLocale = payload.state.value; 21308 } 21309 } 21310} 21311function defineMixin(vuei18n, composer, i18n2) { 21312 return { 21313 beforeCreate() { 21314 const instance = getCurrentInstance(); 21315 if (!instance) { 21316 throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR); 21317 } 21318 const options = this.$options; 21319 if (options.i18n) { 21320 const optionsI18n = options.i18n; 21321 if (options.__i18n) { 21322 optionsI18n.__i18n = options.__i18n; 21323 } 21324 optionsI18n.__root = composer; 21325 if (this === this.$root) { 21326 this.$i18n = mergeToGlobal(vuei18n, optionsI18n); 21327 } else { 21328 optionsI18n.__injectWithOption = true; 21329 optionsI18n.__extender = i18n2.__vueI18nExtend; 21330 this.$i18n = createVueI18n(optionsI18n); 21331 const _vueI18n = this.$i18n; 21332 if (_vueI18n.__extender) {
21333 _vueI18n.__disposer = _vueI18n.__extender(this.$i18n); 21334 } 21335 } 21336 } else if (options.__i18n) { 21337 if (this === this.$root) { 21338 this.$i18n = mergeToGlobal(vuei18n, options); 21339 } else { 21340 this.$i18n = createVueI18n({ 21341 __i18n: options.__i18n, 21342 __injectWithOption: true, 21343 __extender: i18n2.__vueI18nExtend, 21344 __root: composer 21345 }); 21346 const _vueI18n = this.$i18n; 21347 if (_vueI18n.__extender) { 21348 _vueI18n.__disposer = _vueI18n.__extender(this.$i18n); 21349 } 21350 } 21351 } else { 21352 this.$i18n = vuei18n; 21353 } 21354 if (options.__i18nGlobal) { 21355 adjustI18nResources(composer, options, options); 21356 } 21357 this.$t = (...args) => this.$i18n.t(...args); 21358 this.$rt = (...args) => this.$i18n.rt(...args); 21359 this.$tc = (...args) => this.$i18n.tc(...args); 21360 this.$te = (key, locale) => this.$i18n.te(key, locale); 21361 this.$d = (...args) => this.$i18n.d(...args); 21362 this.$n = (...args) => this.$i18n.n(...args); 21363 this.$tm = (key) => this.$i18n.tm(key); 21364 i18n2.__setInstance(instance, this.$i18n); 21365 }, 21366 mounted() { 21367 if ((define_process_env_default$2.NODE_ENV !== "production" || false) && true && this.$el && this.$i18n) { 21368 const _vueI18n = this.$i18n; 21369 this.$el.__VUE_I18N__ = _vueI18n.__composer; 21370 const emitter = this.__v_emitter = createEmitter(); 21371 _vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter); 21372 emitter.on("*", addTimelineEvent); 21373 } 21374 }, 21375 unmounted() { 21376 const instance = getCurrentInstance(); 21377 if (!instance) { 21378 throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR); 21379 } 21380 const _vueI18n = this.$i18n; 21381 if ((define_process_env_default$2.NODE_ENV !== "production" || false) && true && this.$el && this.$el.__VUE_I18N__) { 21382 if (this.__v_emitter) { 21383 this.__v_emitter.off("*", addTimelineEvent); 21384 delete this.__v_emitter; 21385 } 21386 if (this.$i18n) { 21387 _vueI18n.__disableEmitter && _vueI18n.__disableEmitter(); 21388 delete this.$el.__VUE_I18N__; 21389 } 21390 } 21391 delete this.$t; 21392 delete this.$rt; 21393 delete this.$tc; 21394 delete this.$te; 21395 delete this.$d; 21396 delete this.$n; 21397 delete this.$tm; 21398 if (_vueI18n.__disposer) { 21399 _vueI18n.__disposer(); 21400 delete _vueI18n.__disposer; 21401 delete _vueI18n.__extender; 21402 } 21403 i18n2.__deleteInstance(instance); 21404 delete this.$i18n; 21405 } 21406 }; 21407} 21408function mergeToGlobal(g, options) { 21409 g.locale = options.locale || g.locale; 21410 g.fallbackLocale = options.fallbackLocale || g.fallbackLocale; 21411 g.missing = options.missing || g.missing; 21412 g.silentTranslationWarn = options.silentTranslationWarn || g.silentFallbackWarn; 21413 g.silentFallbackWarn = options.silentFallbackWarn || g.silentFallbackWarn; 21414 g.formatFallbackMessages = options.formatFallbackMessages || g.formatFallbackMessages; 21415 g.postTranslation = options.postTranslation || g.postTranslation; 21416 g.warnHtmlInMessage = options.warnHtmlInMessage || g.warnHtmlInMessage; 21417 g.escapeParameterHtml = options.escapeParameterHtml || g.escapeParameterHtml; 21418 g.sync = options.sync || g.sync; 21419 g.__composer[SetPluralRulesSymbol](options.pluralizationRules || g.pluralizationRules); 21420 const messages = getLocaleMessages(g.locale, { 21421 messages: options.messages, 21422 __i18n: options.__i18n 21423 }); 21424 Object.keys(messages).forEach((locale) => g.mergeLocaleMessage(locale, messages[locale])); 21425 if (options.datetimeFormats) { 21426 Object.keys(options.datetimeFormats).forEach((locale) => g.mergeDateTimeFormat(locale, options.datetimeFormats[locale])); 21427 } 21428 if (options.numberFormats) { 21429 Object.keys(options.numberFormats).forEach((locale) => g.mergeNumberFormat(locale, options.numberFormats[locale])); 21430 } 21431 return g; 21432} 21433const I18nInjectionKey = /* @__PURE__ */ makeSymbol("global-vue-i18n"); 21434function createI18n(options = {}, VueI18nLegacy) { 21435 const __legacyMode = __VUE_I18N_LEGACY_API__ && isBoolean(options.legacy) ? options.legacy : __VUE_I18N_LEGACY_API__; 21436 const __globalInjection = isBoolean(options.globalInjection) ? options.globalInjection : true; 21437 const __allowComposition = __VUE_I18N_LEGACY_API__ && __legacyMode ? !!options.allowComposition : true; 21438 const __instances = /* @__PURE__ */ new Map(); 21439 const [globalScope, __global] = createGlobal(options, __legacyMode); 21440 const symbol = /* @__PURE__ */ makeSymbol(define_process_env_default$2.NODE_ENV !== "production" ? "vue-i18n" : ""); 21441 if (define_process_env_default$2.NODE_ENV !== "production") { 21442 if (__legacyMode && __allowComposition && true) { 21443 warn$1(getWarnMessage(I18nWarnCodes.NOTICE_DROP_ALLOW_COMPOSITION)
21443); 21444 } 21445 } 21446 function __getInstance(component) { 21447 return __instances.get(component) || null; 21448 } 21449 function __setInstance(component, instance) { 21450 __instances.set(component, instance); 21451 } 21452 function __deleteInstance(component) { 21453 __instances.delete(component); 21454 } 21455 { 21456 const i18n2 = { 21457 // mode 21458 get mode() { 21459 return __VUE_I18N_LEGACY_API__ && __legacyMode ? "legacy" : "composition"; 21460 }, 21461 // allowComposition 21462 get allowComposition() { 21463 return __allowComposition; 21464 }, 21465 // install plugin 21466 async install(app, ...options2) { 21467 if ((define_process_env_default$2.NODE_ENV !== "production" || false) && true) { 21468 app.__VUE_I18N__ = i18n2; 21469 } 21470 app.__VUE_I18N_SYMBOL__ = symbol; 21471 app.provide(app.__VUE_I18N_SYMBOL__, i18n2); 21472 if (isPlainObject$1(options2[0])) { 21473 const opts = options2[0]; 21474 i18n2.__composerExtend = opts.__composerExtend; 21475 i18n2.__vueI18nExtend = opts.__vueI18nExtend; 21476 } 21477 let globalReleaseHandler = null; 21478 if (!__legacyMode && __globalInjection) { 21479 globalReleaseHandler = injectGlobalFields(app, i18n2.global); 21480 } 21481 if (__VUE_I18N_FULL_INSTALL__) { 21482 apply(app, i18n2, ...options2); 21483 } 21484 if (__VUE_I18N_LEGACY_API__ && __legacyMode) { 21485 app.mixin(defineMixin(__global, __global.__composer, i18n2)); 21486 } 21487 const unmountApp = app.unmount; 21488 app.unmount = () => { 21489 globalReleaseHandler && globalReleaseHandler(); 21490 i18n2.dispose(); 21491 unmountApp(); 21492 }; 21493 if ((define_process_env_default$2.NODE_ENV !== "production" || false) && true) { 21494 const ret = await enableDevTools(app, i18n2); 21495 if (!ret) { 21496 throw createI18nError(I18nErrorCodes.CANNOT_SETUP_VUE_DEVTOOLS_PLUGIN); 21497 } 21498 const emitter = createEmitter(); 21499 if (__legacyMode) { 21500 const _vueI18n = __global; 21501 _vueI18n.__enableEmitter && _vueI18n.__enableEmitter(emitter); 21502 } else { 21503 const _composer = __global; 21504 _composer[EnableEmitter] && _composer[EnableEmitter](emitter); 21505 } 21506 emitter.on("*", addTimelineEvent); 21507 } 21508 }, 21509 // global accessor 21510 get global() { 21511 return __global; 21512 }, 21513 dispose() { 21514 globalScope.stop(); 21515 }, 21516 // @internal 21517 __instances, 21518 // @internal 21519 __getInstance, 21520 // @internal 21521 __setInstance, 21522 // @internal 21523 __deleteInstance 21524 }; 21525 return i18n2; 21526 } 21527} 21528function useI18n(options = {}) { 21529 const instance = getCurrentInstance(); 21530 if (instance == null) { 21531 throw createI18nError(I18nErrorCodes.MUST_BE_CALL_SETUP_TOP); 21532 } 21533 if (!instance.isCE && instance.appContext.app != null && !instance.appContext.app.__VUE_I18N_SYMBOL__) { 21534 throw createI18nError(I18nErrorCodes.NOT_INSTALLED); 21535 } 21536 const i18n2 = getI18nInstance(instance); 21537 const gl = getGlobalComposer(i18n2); 21538 const componentOptions = getComponentOptions(instance); 21539 const scope = getScope(options, componentOptions); 21540 if (__VUE_I18N_LEGACY_API__) { 21541 if (i18n2.mode === "legacy" && !options.__useComponent) { 21542 if (!i18n2.allowComposition) { 21543 throw createI18nError(I18nErrorCodes.NOT_AVAILABLE_IN_LEGACY_MODE); 21544 } 21545 return useI18nForLegacy(instance, scope, gl, options); 21546 } 21547 } 21548 if (scope === "global") { 21549 adjustI18nResources(gl, options, componentOptions); 21550 return gl; 21551 } 21552 if (scope === "parent") { 21553 let composer2 = getComposer(i18n2, instance, options.__useComponent); 21554 if (composer2 == null) { 21555 if (define_process_env_default$2.NODE_ENV !== "production") { 21556 warn$1(getWarnMessage(I18nWarnCodes.NOT_FOUND_PARENT_SCOPE)); 21557 } 21558 composer2 = gl; 21559 } 21560 return composer2; 21561 } 21562 const i18nInternal = i18n2; 21563 let composer = i18nInternal.__getInstance(instance); 21564 if (composer == null) { 21565 const composerOptions = assign$2({}, options); 21566 if ("__i18n" in componentOptions) { 21567 composerOptions.__i18n = componentOptions.__i18n; 21568 } 21569 if (gl) { 21570 composerOptions.__root = gl; 21571 } 21572 composer = createComposer(composerOptions); 21573 if (i18nInternal.__composerExtend) { 21574 composer[DisposeSymbol] = i18nInternal.__composerExtend(composer); 21575 } 21576 setupLifeCycle(i18nInternal, instance, composer); 21577 i18nInternal.__setInstance(instance, composer); 21578 } 21579 return composer; 21580} 21581function createGlobal(options, legacyMode, VueI18nLegacy) { 21582 const scope = effectScope(); 21583 { 21584 const obj = __VUE_I18N_LEGACY_API__ && legacyMode ? scope.run(() => createVueI18n(options)) : scope.run(() => createComposer(options)); 21585 if (obj == null) { 21586 throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR); 21587 } 21588 return [scope, obj]; 21589 } 21590} 21591function getI18nInstance(instance) { 21592 { 21593 const i18n2 = inject(!instance.isCE ? instance.appContext.app.__VUE_I18N_SYMBOL__ : I18nInjectionKey); 21594 if (!i18n2) { 21595 throw createI18nError(!instance.isCE ? I18nErrorCodes.UNEXPECTED_ERROR : I18nErrorCodes.NOT_INSTALLED_WITH_PROVIDE); 21596 } 21597 return i18n2; 21598 } 21599} 21600function getScope(options, componentOptions) { 21601 return isEmptyObject(options) ? "__i18n" in componentOptions ? "local" : "global" : !options.useScope ? "local" : options.useScope; 21602} 21603function getGlobalComposer(i18n2) { 21604 return i18n2.mode === "composition" ? i18n2.global : i18n2.global.__composer; 21605} 21606function getComposer(i18n2, target, useComponent = false) { 21607 let composer = null; 21608 const root = target.root; 21609 let current = getParentComponentInstance(target, useComponent); 21610 while (current != null) { 21611 const i18nInternal = i18n2; 21612 if (i18n2.mode === "composition") { 21613 composer = i18nInternal.__getInstance(current); 21614 } else { 21615 if (__VUE_I18N_LEGACY_API__) { 21616 const vueI18n = i18nInternal.__getInstance(current); 21617 if (vueI18n != null) { 21618 composer = vueI18n.__composer; 21619 if (useComponent && composer && !composer[InejctWithOptionSymbol]) { 21620 composer = null; 21621 } 21622 } 21623 } 21624 } 21625 if (composer != null) { 21626 break; 21627 } 21628 if (root === current) { 21629 break; 21630 } 21631 current = current.parent; 21632 } 21633 return composer; 21634} 21635function getParentComponentInstance(target, useComponent = false) { 21636 if (target == null) { 21637 return null; 21638 } 21639 { 21640 return !useComponent ? target.parent : target.vnode.ctx || target.parent; 21641 } 21642} 21643function setupLifeCycle(i18n2, target, composer) { 21644 let emitter = null; 21645 { 21646 onMounted(() => { 21647 if ((define_process_env_default$2.NODE_ENV !== "production" || false) && true && target.vnode.el) { 21648 target.vnode.el.__VUE_I18N__ = composer; 21649 emitter = createEmitter(); 21650 const _composer = composer; 21651 _composer[EnableEmitter] && _composer[EnableEmitter](emitter); 21652 emitter.on("*", addTimelineEvent); 21653 } 21654 }, target); 21655 onUnmounted(() => { 21656 const _composer = composer; 21657 if ((define_process_env_default$2.NODE_ENV !== "production" || false) && true && target.vnode.el && target.vnode.el.__VUE_I18N__) { 21658 emitter && emitter.off("*", addTimelineEvent); 21659 _composer[DisableEmitter] && _composer[DisableEmitter](); 21660 delete target.vnode.el.__VUE_I18N__; 21661 } 21662 i18n2.__deleteInstance(target); 21663 const dispose = _composer[DisposeSymbol]; 21664 if (dispose) { 21665 dispose(); 21666 delete _composer[DisposeSymbol]; 21667 } 21668 }, target); 21669 } 21670} 21671function useI18nForLegacy(instance, scope, root, options = {}) { 21672 const isLocalScope = scope === "local"; 21673 const _composer = shallowRef(null); 21674 if (isLocalScope && instance.proxy && !(instance.proxy.$options.i18n || instance.proxy.$options.__i18n)) { 21675 throw createI18nError(I18nErrorCodes.MUST_DEFINE_I18N_OPTION_IN_ALLOW_COMPOSITION); 21676 } 21677 const _inheritLocale = isBoolean(options.inheritLocale) ? options.inheritLocale : !isString$1(options.locale); 21678 const _locale = ref( 21679 // prettier-ignore 21680 !isLocalScope || _inheritLocale ? root.locale.value : isString$1(options.locale) ? options.locale : DEFAULT_LOCALE 21681 ); 21682 const _fallbackLocale = ref( 21683 // prettier-ignore 21684 !isLocalScope || _inheritLocale ? root.fallbackLocale.value : isString$1(options.fallbackLocale) || isArray(options.fallbackLocale) || isPlainObject$1(options.fallbackLocale) || options.fallbackLocale === false ? options.fallbackLocale : _locale.value 21685 ); 21686 const _messages = ref(getLocaleMessages(_locale.value, options)); 21687 const _datetimeFormats = ref(isPlainObject$1(options.datetimeFormats) ? options.datetimeFormats : { [_locale.value]: {} }); 21688 const _numberFormats = ref(isPlainObject$1(options.numberFormats) ? options.numberFormats : { [_locale.value]: {} }); 21689 const _missingWarn = isLocalScope ? root.missingWarn : isBoolean(options.missingWarn) || isRegExp(options.missingWarn) ? options.missingWarn : true; 21690 const _fallbackWarn = isLocalScope ? root.fallbackWarn : isBoolean(options.fallbackWarn) || isRegExp(options.fallbackWarn) ? options.fallbackWarn : true; 21691 const _fallbackRoot = isLocalScope ? root.fallbackRoot : isBoolean(options.fallbackRoot) ? options.fallbackRoot : true; 21692 const _fallbackFormat = !!options.fallbackFormat; 21693 const _missing = isFunction(options.missing) ? options.missing : null; 21694 const _postTranslation = isFunction(options.postTranslation) ? options.postTranslation : null; 21695 const _warnHtmlMessage = isLocalScope ? root.warnHtmlMessage : isBoolean(options.warnHtmlMessage) ? options.warnHtmlMessage : true; 21696 const _escapeParameter = !!options.escapeParameter; 21697 const _modifiers = isLocalScope ? root.modifiers : isPlainObject$1(options.modifiers) ? options.modifiers : {}; 21698 const _pluralRules = options.pluralRules || isLocalScope && root.pluralRules; 21699 function trackReactivityValues() { 21700 return [ 21701 _locale.value, 21702 _fallbackLocale.value, 21703 _messages.value, 21704 _datetimeFormats.value, 21705 _numberFormats.value 21706 ]; 21707 } 21708 const locale = computed({ 21709 get: () => { 21710 return _composer.value ? _composer.value.locale.value : _locale.value; 21711 }, 21712 set: (val) => { 21713 if (_composer.value) { 21714 _composer.value.locale.value = val; 21715 } 21716 _locale.value = val; 21717 } 21718 }); 21719 const fallbackLocale = computed({ 21720 get: () => { 21721 return _composer.value ? _composer.value.fallbackLocale.value : _fallbackLocale.value; 21722 }, 21723 set: (val) => { 21724 if (_composer.value) { 21725 _composer.value.fallbackLocale.value = val; 21726 } 21727 _fallbackLocale.value = val; 21728 } 21729 }); 21730 const messages = computed(() => { 21731 if (_composer.value) { 21732 return _composer.value.messages.value; 21733 } else { 21734 return _messages.value; 21735 } 21736 }); 21737 const datetimeFormats = computed(() => _datetimeFormats.value); 21738 const numberFormats = computed(() => _numberFormats.value); 21739 function getPostTranslationHandler() { 21740 return _composer.value ? _composer.value.getPostTranslationHandler() : _postTranslation; 21741 } 21742 function setPostTranslationHandler(handler) { 21743 if (_composer.value) { 21744 _composer.value.setPostTranslationHandler(handler); 21745 } 21746 } 21747 function getMissingHandler() { 21748 return _composer.value ? _composer.value.getMissingHandler() : _missing; 21749 } 21750 function setMissingHandler(handler) { 21751 if (_composer.value) { 21752 _composer.value.setMissingHandler(handler); 21753 } 21754 } 21755 function warpWithDeps(fn) { 21756 trackReactivityValues(); 21757 return fn(); 21758 } 21759 function t(...args) { 21760 return _composer.value ? warpWithDeps(() => Reflect.apply(_composer.value.t, null, [...args])) : warpWithDeps(() => ""); 21761 } 21762 function rt(...args) { 21763 return _composer.value ? Reflect.apply(_composer.value.rt, null, [...args]) : ""; 21764 } 21765 function d(...args) { 21766 return _composer.value ? warpWithDeps(() => Reflect.apply(_composer.value.d, null, [...args])) : warpWithDeps(() => ""); 21767 } 21768 function n(...args) { 21769 return _composer.value ? warpWithDeps(() => Reflect.apply(_composer.value.n, null, [...args])) : warpWithDeps(() => ""); 21770 } 21771 function tm(key) { 21772 return _composer.value ? _composer.value.tm(key) : {}; 21773 } 21774 function te(key, locale2) { 21775 return _composer.value ? _composer.value.te(key, locale2) : false;
21776 } 21777 function getLocaleMessage(locale2) { 21778 return _composer.value ? _composer.value.getLocaleMessage(locale2) : {}; 21779 } 21780 function setLocaleMessage(locale2, message) { 21781 if (_composer.value) { 21782 _composer.value.setLocaleMessage(locale2, message); 21783 _messages.value[locale2] = message; 21784 } 21785 } 21786 function mergeLocaleMessage(locale2, message) { 21787 if (_composer.value) { 21788 _composer.value.mergeLocaleMessage(locale2, message); 21789 } 21790 } 21791 function getDateTimeFormat(locale2) { 21792 return _composer.value ? _composer.value.getDateTimeFormat(locale2) : {}; 21793 } 21794 function setDateTimeFormat(locale2, format2) { 21795 if (_composer.value) { 21796 _composer.value.setDateTimeFormat(locale2, format2); 21797 _datetimeFormats.value[locale2] = format2; 21798 } 21799 } 21800 function mergeDateTimeFormat(locale2, format2) { 21801 if (_composer.value) { 21802 _composer.value.mergeDateTimeFormat(locale2, format2); 21803 } 21804 } 21805 function getNumberFormat(locale2) { 21806 return _composer.value ? _composer.value.getNumberFormat(locale2) : {}; 21807 } 21808 function setNumberFormat(locale2, format2) { 21809 if (_composer.value) { 21810 _composer.value.setNumberFormat(locale2, format2); 21811 _numberFormats.value[locale2] = format2; 21812 } 21813 } 21814 function mergeNumberFormat(locale2, format2) { 21815 if (_composer.value) { 21816 _composer.value.mergeNumberFormat(locale2, format2); 21817 } 21818 } 21819 const wrapper = { 21820 get id() { 21821 return _composer.value ? _composer.value.id : -1; 21822 }, 21823 locale, 21824 fallbackLocale, 21825 messages, 21826 datetimeFormats, 21827 numberFormats, 21828 get inheritLocale() { 21829 return _composer.value ? _composer.value.inheritLocale : _inheritLocale; 21830 }, 21831 set inheritLocale(val) { 21832 if (_composer.value) { 21833 _composer.value.inheritLocale = val; 21834 } 21835 }, 21836 get availableLocales() { 21837 return _composer.value ? _composer.value.availableLocales : Object.keys(_messages.value); 21838 }, 21839 get modifiers() { 21840 return _composer.value ? _composer.value.modifiers : _modifiers; 21841 }, 21842 get pluralRules() { 21843 return _composer.value ? _composer.value.pluralRules : _pluralRules; 21844 }, 21845 get isGlobal() { 21846 return _composer.value ? _composer.value.isGlobal : false; 21847 }, 21848 get missingWarn() { 21849 return _composer.value ? _composer.value.missingWarn : _missingWarn; 21850 }, 21851 set missingWarn(val) { 21852 if (_composer.value) { 21853 _composer.value.missingWarn = val; 21854 } 21855 }, 21856 get fallbackWarn() { 21857 return _composer.value ? _composer.value.fallbackWarn : _fallbackWarn; 21858 }, 21859 set fallbackWarn(val) { 21860 if (_composer.value) { 21861 _composer.value.missingWarn = val; 21862 } 21863 }, 21864 get fallbackRoot() { 21865 return _composer.value ? _composer.value.fallbackRoot : _fallbackRoot; 21866 }, 21867 set fallbackRoot(val) { 21868 if (_composer.value) { 21869 _composer.value.fallbackRoot = val; 21870 } 21871 }, 21872 get fallbackFormat() { 21873 return _composer.value ? _composer.value.fallbackFormat : _fallbackFormat; 21874 }, 21875 set fallbackFormat(val) { 21876 if (_composer.value) { 21877 _composer.value.fallbackFormat = val; 21878 } 21879 }, 21880 get warnHtmlMessage() { 21881 return _composer.value ? _composer.value.warnHtmlMessage : _warnHtmlMessage; 21882 }, 21883 set warnHtmlMessage(val) { 21884 if (_composer.value) { 21885 _composer.value.warnHtmlMessage = val; 21886 } 21887 }, 21888 get escapeParameter() { 21889 return _composer.value ? _composer.value.escapeParameter : _escapeParameter; 21890 }, 21891 set escapeParameter(val) { 21892 if (_composer.value) { 21893 _composer.value.escapeParameter = val; 21894 } 21895 }, 21896 t, 21897 getPostTranslationHandler, 21898 setPostTranslationHandler, 21899 getMissingHandler, 21900 setMissingHandler, 21901 rt, 21902 d, 21903 n, 21904 tm, 21905 te, 21906 getLocaleMessage, 21907 setLocaleMessage, 21908 mergeLocaleMessage, 21909 getDateTimeFormat, 21910 setDateTimeFormat, 21911 mergeDateTimeFormat, 21912 getNumberFormat, 21913 setNumberFormat, 21914 mergeNumberFormat 21915 }; 21916 function sync(composer) { 21917 composer.locale.value = _locale.value; 21918 composer.fallbackLocale.value = _fallbackLocale.value; 21919 Object.keys(_messages.value).forEach((locale2) => { 21920 composer.mergeLocaleMessage(locale2, _messages.value[locale2]); 21921 });
21922 Object.keys(_datetimeFormats.value).forEach((locale2) => { 21923 composer.mergeDateTimeFormat(locale2, _datetimeFormats.value[locale2]); 21924 }); 21925 Object.keys(_numberFormats.value).forEach((locale2) => { 21926 composer.mergeNumberFormat(locale2, _numberFormats.value[locale2]); 21927 }); 21928 composer.escapeParameter = _escapeParameter; 21929 composer.fallbackFormat = _fallbackFormat; 21930 composer.fallbackRoot = _fallbackRoot; 21931 composer.fallbackWarn = _fallbackWarn; 21932 composer.missingWarn = _missingWarn; 21933 composer.warnHtmlMessage = _warnHtmlMessage; 21934 } 21935 onBeforeMount(() => { 21936 if (instance.proxy == null || instance.proxy.$i18n == null) { 21937 throw createI18nError(I18nErrorCodes.NOT_AVAILABLE_COMPOSITION_IN_LEGACY); 21938 } 21939 const composer = _composer.value = instance.proxy.$i18n.__composer; 21940 if (scope === "global") { 21941 _locale.value = composer.locale.value; 21942 _fallbackLocale.value = composer.fallbackLocale.value; 21943 _messages.value = composer.messages.value; 21944 _datetimeFormats.value = composer.datetimeFormats.value; 21945 _numberFormats.value = composer.numberFormats.value; 21946 } else if (isLocalScope) { 21947 sync(composer); 21948 } 21949 }); 21950 return wrapper; 21951} 21952const globalExportProps = [ 21953 "locale", 21954 "fallbackLocale", 21955 "availableLocales" 21956]; 21957const globalExportMethods = ["t", "rt", "d", "n", "tm", "te"]; 21958function injectGlobalFields(app, composer) { 21959 const i18n2 = /* @__PURE__ */ Object.create(null); 21960 globalExportProps.forEach((prop) => { 21961 const desc = Object.getOwnPropertyDescriptor(composer, prop); 21962 if (!desc) { 21963 throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR); 21964 } 21965 const wrap = isRef(desc.value) ? { 21966 get() { 21967 return desc.value.value; 21968 }, 21969 // eslint-disable-next-line @typescript-eslint/no-explicit-any 21970 set(val) { 21971 desc.value.value = val; 21972 } 21973 } : { 21974 get() { 21975 return desc.get && desc.get(); 21976 } 21977 }; 21978 Object.defineProperty(i18n2, prop, wrap); 21979 }); 21980 app.config.globalProperties.$i18n = i18n2; 21981 globalExportMethods.forEach((method) => { 21982 const desc = Object.getOwnPropertyDescriptor(composer, method); 21983 if (!desc || !desc.value) { 21984 throw createI18nError(I18nErrorCodes.UNEXPECTED_ERROR); 21985 } 21986 Object.defineProperty(app.config.globalProperties, `$${method}`, desc); 21987 }); 21988 const dispose = () => { 21989 delete app.config.globalProperties.$i18n; 21990 globalExportMethods.forEach((method) => { 21991 delete app.config.globalProperties[`$${method}`]; 21992 }); 21993 };
21994 return dispose; 21995} 21996{ 21997 initFeatureFlags(); 21998} 21999if (__INTLIFY_JIT_COMPILATION__) { 22000 registerMessageCompiler(compile); 22001} else { 22002 registerMessageCompiler(compileToFunction); 22003} 22004registerMessageResolver(resolveValue); 22005registerLocaleFallbacker(fallbackWithLocaleChain); 22006if (define_process_env_default$2.NODE_ENV !== "production" || __INTLIFY_PROD_DEVTOOLS__) { 22007 const target = getGlobalThis(); 22008 target.__INTLIFY__ = true; 22009 setDevToolsHook(target.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__); 22010} 22011const es = { 22012 // Formulario de contacto 22013 form: { 22014 title: "ð Preséntate, por favor", 22015 description: "Usaremos tu información de contacto solo si todos los agentes están ocupados en ese momento y no pueden responder de inmediato.", 22016 name: "Nombre", 22017 namePlaceholder: "Escribe tu nombre", 22018 nameRequired: "El nombre es obligatorio.", 22019 email: "Email", 22020 emailPlaceholder: "Escribe tu correo electrónico", 22021 emailRequired: "El email es obligatorio.", 22022 emailInvalid: "Introduce un correo electrónico válido (ejemplo: [email protected]).", 22023 phone: "Teléfono", 22024 phoneRequired: "El télefono es Obligatorio y debe ser válido.", 22025 privacyNotice: "Privacidad de datos", 22026 privacyAccept: "Acepto la polÃtica de", 22027 privacyAcceptRequired: "Debes leer y aceptar la politica de", 22028 sendMessage: "Enviar mensaje" 22029 }, 22030 // Calificación 22031 rating: { 22032 title: "CalifÃcanos", 22033 description: "¿Que tal te ha parecido esta conversación?" 22034 }, 22035 // Mensajes del sistema 22036 system: { 22037 messagesDeleted: "Mensajes eliminados", 22038 videoConferenceTitle: "Comenzar vÃdeo conferencia", 22039 videoConferenceDescription: "¿Deseas abrir una videoconferencia con el usuario?", 22040 videoConferenceRequestSent: "La solicitud de videoconferencia ha sido enviada.", 22041 aiMessage: "mensaje de IA" 22042 }, 22043 // Estados de conexión 22044 status: { 22045 online: "EnvÃenos un mensaje", 22046 offline: "No estamos", 22047 welcome: "Bienvenido", 22048 comeBackSoon: "Vuelve pronto" 22049 }, 22050 // Ãrea de texto 22051 textArea: { 22052 placeholder: "Escribe un mensaje" 22053 }, 22054 // Texto de la burbuja 22055 bubble: { 22056 text: "chat" 22057 }, 22058 // Entrada de teléfono 22059 phoneInput: { 22060 label: "Teléfono", 22061 placeholder: "Introduce tu teléfono", 22062 completeNumber: "Número completo: +{prefix} {number}", 22063 errorPrefixes: "Error al obtener los prefijos", 22064 errorRequest: "Error al realizar la solicitud", 22065 errorValidation: "El número de teléfono debe contener entre 7 y 15 dÃgitos sin espacios." 22066 } 22067}; 22068const en = { 22069 // Contact form 22070 form: { 22071 title: "ð Please introduce yourself", 22072 description: "We will only use your contact information if all agents are busy at that moment and cannot respond immediately.", 22073 name: "Name", 22074 namePlaceholder: "Write your name", 22075 nameRequired: "Name is required.", 22076 email: "Email", 22077 emailPlaceholder: "Write your email", 22078 emailRequired: "Email is required.", 22079 emailInvalid: "Enter a valid email address (example: [email protected]).", 22080 phone: "Phone", 22081 phoneRequired: "Phone is required and must be valid.", 22082 privacyNotice: "Data privacy", 22083 privacyAccept: "I accept the", 22084 privacyAcceptRequired: "You must read and accept the", 22085 sendMessage: "Send message" 22086 }, 22087 // Rating 22088 rating: { 22089 title: "Rate us", 22090 description: "How did you find this conversation?" 22091 }, 22092 // System messages 22093 system: { 22094 messagesDeleted: "Messages deleted", 22095 videoConferenceTitle: "Start video conference", 22096 videoConferenceDescription: "Do you want to open a video conference with the user?", 22097 videoConferenceRequestSent: "The video conference request has been sent.", 22098 aiMessage: "AI message" 22099 }, 22100 // Connection status 22101 status: { 22102 online: "Send us a message", 22103 offline: "We are not", 22104 welcome: "Welcome", 22105 comeBackSoon: "Come back soon" 22106 }, 22107 // Text area 22108 textArea: { 22109 placeholder: "Write a message" 22110 }, 22111 // Bubble text 22112 bubble: { 22113 text: "chat" 22114 }, 22115 // Phone input 22116 phoneInput: { 22117 label: "Phone", 22118 placeholder: "Enter your phone number", 22119 completeNumber: "Complete number: +{prefix} {number}", 22120 errorPrefixes: "Error getting prefixes", 22121 errorRequest: "Error making request", 22122 errorValidation: "The phone number must contain between 7 and 15 digits without spaces." 22123 } 22124}; 22125let serverLanguage = "es"; 22126function setServerLanguage(lang) { 22127 const normalizedLang = (lang == null ? void 0 : lang.toLowerCase()) || "es"; 22128 serverLanguage = normalizedLang; 22129} 22130function getServerLanguage() { 22131 return serverLanguage; 22132} 22133const i18n = createI18n({
22134 legacy: false, 22135 // Usar Composition API 22136 locale: serverLanguage, 22137 fallbackLocale: "es", 22138 messages: { 22139 es, 22140 en 22141 }, 22142 globalInjection: true, 22143 // Inyectar $t globalmente 22144 silentTranslationWarn: true, 22145 // Silenciar advertencias de traducciones faltantes 22146 missingWarn: false, 22147 fallbackWarn: false 22148}); 22149function setLocale(locale) { 22150 i18n.global.locale.value = locale; 22151 serverLanguage = locale; 22152} 22153function getAvailableLocales() { 22154 return [ 22155 { code: "es", name: "Español" }, 22156 { code: "en", name: "English" } 22157 ]; 22158} 22159function useI18nComposable() { 22160 const { t, locale } = useI18n(); 22161 const currentLocale = ref(locale.value); 22162 watch(locale, (newLocale) => { 22163 currentLocale.value = newLocale; 22164 }); 22165 const availableLocales = computed(() => getAvailableLocales()); 22166 const setLanguageFromServer = (serverLang) => { 22167 setServerLanguage(serverLang); 22168 const normalizedLang = serverLang.toLowerCase(); 22169 setLocale(normalizedLang); 22170 currentLocale.value = normalizedLang; 22171 locale.value = normalizedLang; 22172 }; 22173 const changeLocale = (newLocale) => { 22174 setLocale(newLocale); 22175 currentLocale.value = newLocale; 22176 locale.value = newLocale; 22177 }; 22178 const getCurrentServerLanguage = () => { 22179 return getServerLanguage(); 22180 }; 22181 const getCurrentLocale = () => { 22182 return currentLocale.value; 22183 }; 22184 const isCurrentLocale = (localeCode) => { 22185 return currentLocale.value === localeCode; 22186 }; 22187 const formatDate = (date2, options = {}) => { 22188 const defaultOptions = { 22189 year: "numeric", 22190 month: "long", 22191 day: "numeric" 22192 }; 22193 const finalOptions = { ...defaultOptions, ...options }; 22194 return new Intl.DateTimeFormat(currentLocale.value, finalOptions).format(date2); 22195 }; 22196 const formatNumber = (number2, options = {}) => { 22197 const defaultOptions = { 22198 minimumFractionDigits: 0, 22199 maximumFractionDigits: 2 22200 }; 22201 const finalOptions = { ...defaultOptions, ...options }; 22202 return new Intl.NumberFormat(currentLocale.value, finalOptions).format(number2); 22203 }; 22204 const formatCurrency = (amount, currency = "USD", options = {}) => { 22205 const defaultOptions = { 22206 style: "currency", 22207 currency 22208 }; 22209 const finalOptions = { ...defaultOptions, ...options }; 22210 return new Intl.NumberFormat(currentLocale.value, finalOptions).format(amount); 22211 }; 22212 const formatRelativeTime = (date2) => { 22213 const now2 = /* @__PURE__ */ new Date(); 22214 const diffInSeconds = Math.floor((now2 - date2) / 1e3); 22215 if (diffInSeconds < 60) { 22216 return t("now"); 22217 } else if (diffInSeconds < 3600) { 22218 const minutes = Math.floor(diffInSeconds / 60); 22219 return `${minutes} ${t("minutes")}`; 22220 } else if (diffInSeconds < 86400) { 22221 const hours = Math.floor(diffInSeconds / 3600); 22222 return `${hours} ${t("hours")}`; 22223 } else { 22224 const days = Math.floor(diffInSeconds / 86400); 22225 return `${days} ${t("days")}`; 22226 } 22227 }; 22228 return { 22229 // Funciones de traducción 22230 t, 22231 // Estado del idioma 22232 currentLocale, 22233 availableLocales, 22234 // Funciones de cambio de idioma 22235 setLanguageFromServer, 22236 changeLocale, 22237 isCurrentLocale, 22238 getCurrentServerLanguage, 22239 getCurrentLocale, 22240 // Funciones de formateo 22241 formatDate, 22242 formatNumber, 22243 formatCurrency, 22244 formatRelativeTime 22245 }; 22246} 22247var define_process_env_default$1 = {}; 22248const _sfc_main$2 = { 22249 props: { 22250 prevPhone: { 22251 type: String, 22252 required: true 22253 }, 22254 apiUrl: { 22255 type: String, 22256 required: true 22257 }, 22258 testMode: { 22259 type: Boolean, 22260 required: false 22261 }, 22262 modelValue: { 22263 type: String, 22264 required: true 22265 } 22266 }, 22267 setup() { 22268 const { t, currentLocale } = useI18nComposable(); 22269 return { t, currentLocale }; 22270 }, 22271 data() { 22272 return { 22273 internalPrefix: "", 22274 // Prefijo inicial por defecto 22275 internalPhoneNumber: "", 22276 errorMessage: "", 22277 // Mensaje de error 22278 prefixes: [] 22279 // Prefijos disponibles 22280 }; 22281 }, 22282 watch: { 22283 // Combina el prefijo y el número cuando cambian y lo emite al padre 22284 internalPrefix: "validateAndEmit", 22285 internalPhoneNumber: "validateAndEmit" 22286 }, 22287 computed: { 22288 computedPhoneNumber: { 22289 get() { 22290 return this.internalPhoneNumber; 22291 }, 22292 set(value) { 22293 this.internalPhoneNumber = value; 22294 } 22295 }, 22296 getCountryName() { 22297 return (prefix) => { 22298 return this.currentLocale === "en" ? prefix.nameEN : prefix.nameES; 22299 }; 22300 } 22301 }, 22302 methods: { 22303 async fetchPrefixes() {
22304 try { 22305 if (define_process_env_default$1.NODE_ENV === "development") { 22306 console.log(this.apiUrl); 22307 } 22308 const response = await fetch(this.apiUrl + "/get-countries"); 22309 if (response.ok) { 22310 const data = await response.json(); 22311 this.prefixes = data; 22312 if (data.length > 0) { 22313 const defaultPrefix = data.find((r) => r.phoneCode == 34); 22314 if (defaultPrefix && !this.internalPrefix) { 22315 this.internalPrefix = defaultPrefix.phoneCode; 22316 } 22317 } 22318 } else { 22319 console.error(this.t("phoneInput.errorPrefixes")); 22320 } 22321 } catch (error2) { 22322 console.error(this.t("phoneInput.errorRequest"), error2); 22323 } 22324 }, 22325 validatePhone() { 22326 const phoneRegex = /^\d{7,15}$/; 22327 if (!phoneRegex.test(this.internalPhoneNumber)) { 22328 this.errorMessage = this.t("phoneInput.errorValidation"); 22329 console.log(this.errorMessage); 22330 return false; 22331 } 22332 this.errorMessage = ""; 22333 return true; 22334 }, 22335 validateAndEmit() { 22336 const prefixWithPlus = `+${this.internalPrefix}`; 22337 this.internalPhoneNumber = this.internalPhoneNumber.startsWith(prefixWithPlus) ? this.internalPhoneNumber.substring(prefixWithPlus.length) : this.internalPhoneNumber; 22338 this.internalPhoneNumber = this.internalPhoneNumber.replace(/\D/g, ""); 22339 this.internalPhoneNumber = this.internalPhoneNumber.startsWith(this.internalPrefix) ? this.internalPhoneNumber.substring(this.internalPrefix.length) : this.internalPhoneNumber; 22340 if (this.validatePhone()) { 22341 const fullNumber = `+${this.internalPrefix}${this.internalPhoneNumber}`; 22342 this.$emit("update:modelValue", fullNumber); 22343 } else { 22344 this.$emit("update:modelValue", ""); 22345 } 22346 } 22347 }, 22348 mounted() { 22349 if (this.prevPhone) { 22350 const phoneRegex = /^(\+\d{0,2})(\d{7,15})$/; 22351 const match = this.prevPhone.match(phoneRegex); 22352 if (match) { 22353 this.internalPrefix = match[1].replace("+", ""); 22354 this.internalPhoneNumber = match[2]; 22355 console.log(this.internalPrefix, this.internalPhoneNumber); 22356 } 22357 } 22358 this.fetchPrefixes(); 22359 } 22360}; 22361const _hoisted_1$1 = { class: "phone-input" }; 22362const _hoisted_2$1 = { 22363 for: "telefono", 22364 class: "block mt-4" 22365}; 22366const _hoisted_3$1 = { class: "block text" }; 22367const _hoisted_4$1 = { class: "mt-1 flex rounded-md" }; 22368const _hoisted_5$1 = ["disabled"]; 22369const _hoisted_6$1 = ["value"]; 22370const _hoisted_7$1 = ["disabled", "placeholder"]; 22371const _hoisted_8$1 = { 22372 key: 0, 22373 class: "mt-2 text-xs text-gray-500 italic" 22374}; 22375const _hoisted_9$1 = { 22376 key: 1, 22377 class: "mt-2 text-xs text-red-200 italic" 22378}; 22379function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) { 22380 return openBlock(), createElementBlock("div", _hoisted_1$1, [ 22381 createBaseVNode("label", _hoisted_2$1, [ 22382 createBaseVNode("span", _hoisted_3$1, toDisplayString$1($setup.t("phoneInput.label")), 1), 22383 createBaseVNode("div", _hoisted_4$1, [ 22384 createBaseVNode("span", { 22385 class: normalizeClass(["inline-flex items-center px-3 rounded-l-md border border-r-0 bg-gray-50 text-gray-500 sm:text-sm relative", { "border-red-200": !$data.internalPhoneNumber, "border-gray-200": $data.internalPhoneNumber }]) 22386 }, [ 22387 withDirectives(createBaseVNode("select", { 22388 "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => $data.internalPrefix = $event), 22389 class: "outline-none bg-gray-50 w-32", 22390 disabled: $props.testMode 22391 }, [ 22392 (openBlock(true), createElementBlock(Fragment, null, renderList($data.prefixes, (prefix) => { 22393 return openBlock(), createElementBlock("option", { 22394 key: prefix, 22395 value: prefix.phoneCode 22396 }, toDisplayString$1($options.getCountryName(prefix)) + " (+" + toDisplayString$1(prefix.phoneCode) + ")", 9, _hoisted_6$1); 22397 }), 128)) 22398 ], 8, _hoisted_5$1), [ 22399 [vModelSelect, $data.internalPrefix] 22400 ]) 22401 ], 2), 22402 withDirectives(createBaseVNode("input", { 22403 type: "tel", 22404 "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => $data.internalPhoneNumber = $event), 22405 id: "phone", 22406 class: normalizeClass(["p-2 flex-1 block w-full rounded-none rounded-r-md sm:text-sm focus:ring-indigo-500 focus:border-indigo-500 bg-transparent border", { "border-red-200": !$data.internalPhoneNumber, "border-gray-200": $data.internalPhoneNumber }]), 22407 disabled: $props.testMode, 22408 placeholder: $setup.t("phoneInput.placeholder"), 22409 autocomplete: "phone" 22410 }, null, 10, _hoisted_7$1), [ 22411 [vModelText, $data.internalPhoneNumber] 22412 ]) 22413 ]) 22414 ]), 22415 !$data.errorMessage ? (openBlock(), createElementBlock("p", _hoisted_8$1, toDisplayString$1($setup.t("phoneInput.completeNumber", { prefix: $data.internalPrefix, number: $data.internalPhoneNumber })), 1)) : createCommentVNode("", true), 22416 $data.internalPhoneNumber && $data.errorMessage ? (openBlock(), createElementBlock("p", _hoisted_9$1, toDisplayString$1($data.errorMessage), 1)) : createCommentVNode("", true) 22417 ]); 22418} 22419const PhoneInput = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]); 22420function set(target, key, val) { 22421 if (Array.isArray(target)) { 22422 target.length = Math.max(target.length, key); 22423 target.splice(key, 1, val); 22424 return val; 22425 } 22426 target[key] = val; 22427 return val; 22428} 22429function del(target, key) { 22430 if (Array.isArray(target)) { 22431 target.splice(key, 1); 22432 return; 22433 } 22434 delete target[key]; 22435} 22436var define_process_env_default = {}; 22437let activePinia; 22438const setActivePinia = (pinia) => activePinia = pinia; 22439const piniaSymbol = define_process_env_default.NODE_ENV !== "production" ? Symbol("pinia") : ( 22440 /* istanbul ignore next */ 22441 Symbol() 22442); 22443function isPlainObject(o) { 22444 return o && typeof o === "object" && Object.prototype.toString.call(o) === "[object Object]" && typeof o.toJSON !== "function"; 22445} 22446var MutationType; 22447(function(MutationType2) { 22448 MutationType2["direct"] = "direct"; 22449 MutationType2["patchObject"] = "patch object"; 22450 MutationType2["patchFunction"] = "patch function"; 22451})(MutationType || (MutationType = {})); 22452const IS_CLIENT = typeof window !== "undefined"; 22453function patchObject(newState, oldState) { 22454 for (const key in oldState) { 22455 const subPatch = oldState[key]; 22456 if (!(key in newState)) { 22457 continue; 22458 } 22459 const targetValue = newState[key]; 22460 if (isPlainObject(targetValue) && isPlainObject(subPatch) && !isRef(subPatch) && !isReactive(subPatch)) { 22461 newState[key] = patchObject(targetValue, subPatch); 22462 } else { 22463 { 22464 newState[key] = subPatch; 22465 } 22466 } 22467 } 22468 return newState; 22469} 22470const noop$1 = () => { 22471}; 22472function addSubscription(subscriptions, callback, detached, onCleanup = noop$1) { 22473 subscriptions.push(callback); 22474 const removeSubscription = () => { 22475 const idx = subscriptions.indexOf(callback); 22476 if (idx > -1) { 22477 subscriptions.splice(idx, 1); 22478 onCleanup(); 22479 } 22480 }; 22481 if (!detached && getCurrentScope()) { 22482 onScopeDispose(removeSubscription); 22483 } 22484 return removeSubscription; 22485} 22486function triggerSubscriptions(subscriptions, ...args) {
22487 subscriptions.slice().forEach((callback) => { 22488 callback(...args); 22489 }); 22490} 22491const fallbackRunWithContext = (fn) => fn(); 22492const ACTION_MARKER = Symbol(); 22493const ACTION_NAME = Symbol(); 22494function mergeReactiveObjects(target, patchToApply) { 22495 if (target instanceof Map && patchToApply instanceof Map) { 22496 patchToApply.forEach((value, key) => target.set(key, value)); 22497 } else if (target instanceof Set && patchToApply instanceof Set) { 22498 patchToApply.forEach(target.add, target); 22499 } 22500 for (const key in patchToApply) { 22501 if (!patchToApply.hasOwnProperty(key)) 22502 continue; 22503 const subPatch = patchToApply[key]; 22504 const targetValue = target[key]; 22505 if (isPlainObject(targetValue) && isPlainObject(subPatch) && target.hasOwnProperty(key) && !isRef(subPatch) && !isReactive(subPatch)) { 22506 target[key] = mergeReactiveObjects(targetValue, subPatch); 22507 } else { 22508 target[key] = subPatch; 22509 } 22510 } 22511 return target; 22512} 22513const skipHydrateSymbol = define_process_env_default.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : ( 22514 /* istanbul ignore next */ 22515 Symbol() 22516); 22517function shouldHydrate(obj) { 22518 return !isPlainObject(obj) || !obj.hasOwnProperty(skipHydrateSymbol); 22519} 22520const { assign } = Object; 22521function isComputed(o) { 22522 return !!(isRef(o) && o.effect); 22523} 22524function createOptionsStore(id, options, pinia, hot) { 22525 const { state, actions, getters } = options; 22526 const initialState = pinia.state.value[id]; 22527 let store; 22528 function setup() { 22529 if (!initialState && (!(define_process_env_default.NODE_ENV !== "production") || !hot)) { 22530 { 22531 pinia.state.value[id] = state ? state() : {}; 22532 } 22533 } 22534 const localState = define_process_env_default.NODE_ENV !== "production" && hot ? ( 22535 // use ref() to unwrap refs inside state TODO: check if this is still necessary 22536 toRefs(ref(state ? state() : {}).value) 22537 ) : toRefs(pinia.state.value[id]); 22538 return assign(localState, actions, Object.keys(getters || {}).reduce((computedGetters, name) => { 22539 if (define_process_env_default.NODE_ENV !== "production" && name in localState) { 22540 console.warn(`[ð]: A getter cannot have the same name as another state property. Rename one of them. Found with "${name}" in store "${id}".`); 22541 } 22542 computedGetters[name] = markRaw(computed(() => { 22543 setActivePinia(pinia); 22544 const store2 = pinia._s.get(id); 22545 return getters[name].call(store2, store2); 22546 })); 22547 return computedGetters; 22548 }, {})); 22549 } 22550 store = createSetupStore(id, setup, options, pinia, hot, true); 22551 return store; 22552} 22553function createSetupStore($id, setup, options = {}, pinia, hot, isOptionsStore) { 22554 let scope; 22555 const optionsForPlugin = assign({ actions: {} }, options); 22556 if (define_process_env_default.NODE_ENV !== "production" && !pinia._e.active) { 22557 throw new Error("Pinia destroyed"); 22558 } 22559 const $subscribeOptions = { deep: true }; 22560 if (define_process_env_default.NODE_ENV !== "production" && true) { 22561 $subscribeOptions.onTrigger = (event) => { 22562 if (isListening) { 22563 debuggerEvents = event; 22564 } else if (isListening == false && !store._hotUpdating) { 22565 if (Array.isArray(debuggerEvents)) { 22566 debuggerEvents.push(event); 22567 } else { 22568 console.error("ð debuggerEvents should be an array. This is most likely an internal Pinia bug."); 22569 } 22570 } 22571 }; 22572 } 22573 let isListening; 22574 let isSyncListening; 22575 let subscriptions = []; 22576 let actionSubscriptions = []; 22577 let debuggerEvents; 22578 const initialState = pinia.state.value[$id]; 22579 if (!isOptionsStore && !initialState && (!(define_process_env_default.NODE_ENV !== "production") || !hot)) { 22580 { 22581 pinia.state.value[$id] = {}; 22582 } 22583 } 22584 const hotState = ref({}); 22585 let activeListener; 22586 function $patch(partialStateOrMutator) { 22587 let subscriptionMutation; 22588 isListening = isSyncListening = false; 22589 if (define_process_env_default.NODE_ENV !== "production") { 22590 debuggerEvents = []; 22591 } 22592 if (typeof partialStateOrMutator === "function") { 22593 partialStateOrMutator(pinia.state.value[$id]); 22594 subscriptionMutation = { 22595 type: MutationType.patchFunction, 22596 storeId: $id, 22597 events: debuggerEvents 22598 }; 22599 } else { 22600 mergeReactiveObjects(pinia.state.value[$id], partialStateOrMutator); 22601 subscriptionMutation = { 22602 type: MutationType.patchObject, 22603 payload: partialStateOrMutator, 22604 storeId: $id, 22605 events: debuggerEvents 22606 }; 22607 } 22608 const myListenerId = activeListener = Symbol(); 22609 nextTick().then(() => { 22610 if (activeListener === myListenerId) { 22611 isListening = true; 22612 } 22613 }); 22614 isSyncListening = true; 22615 triggerSubscriptions(subscriptions, subscriptionMutation, pinia.state.value[$id]); 22616 } 22617 const $reset = isOptionsStore ? function $reset2() { 22618 const { state } = options; 22619 const newState = state ? state() : {}; 22620 this.$patch(($state) => { 22621 assign($state, newState); 22622 }); 22623 } : ( 22624 /* istanbul ignore next */ 22625 define_process_env_default.NODE_ENV !== "production" ? () => { 22626 throw new Error(`ð: Store "${$id}" is built using the setup syntax and does not implement $reset().`); 22627 } : noop$1 22628 ); 22629 function $dispose() { 22630 scope.stop(); 22631 subscriptions = []; 22632 actionSubscriptions = []; 22633 pinia._s.delete($id); 22634 } 22635 const action = (fn, name = "") => { 22636 if (ACTION_MARKER in fn) { 22637 fn[ACTION_NAME] = name; 22638 return fn; 22639 } 22640 const wrappedAction = function() {
22641 setActivePinia(pinia); 22642 const args = Array.from(arguments); 22643 const afterCallbackList = []; 22644 const onErrorCallbackList = []; 22645 function after(callback) { 22646 afterCallbackList.push(callback); 22647 } 22648 function onError(callback) { 22649 onErrorCallbackList.push(callback); 22650 } 22651 triggerSubscriptions(actionSubscriptions, { 22652 args, 22653 name: wrappedAction[ACTION_NAME], 22654 store, 22655 after, 22656 onError 22657 }); 22658 let ret; 22659 try { 22660 ret = fn.apply(this && this.$id === $id ? this : store, args); 22661 } catch (error2) { 22662 triggerSubscriptions(onErrorCallbackList, error2); 22663 throw error2; 22664 } 22665 if (ret instanceof Promise) { 22666 return ret.then((value) => { 22667 triggerSubscriptions(afterCallbackList, value); 22668 return value; 22669 }).catch((error2) => { 22670 triggerSubscriptions(onErrorCallbackList, error2); 22671 return Promise.reject(error2); 22672 }); 22673 } 22674 triggerSubscriptions(afterCallbackList, ret); 22675 return ret; 22676 }; 22677 wrappedAction[ACTION_MARKER] = true; 22678 wrappedAction[ACTION_NAME] = name; 22679 return wrappedAction; 22680 }; 22681 const _hmrPayload = /* @__PURE__ */ markRaw({ 22682 actions: {}, 22683 getters: {}, 22684 state: [], 22685 hotState 22686 }); 22687 const partialStore = { 22688 _p: pinia, 22689 // _s: scope, 22690 $id, 22691 $onAction: addSubscription.bind(null, actionSubscriptions), 22692 $patch, 22693 $reset, 22694 $subscribe(callback, options2 = {}) { 22695 const removeSubscription = addSubscription(subscriptions, callback, options2.detached, () => stopWatcher()); 22696 const stopWatcher = scope.run(() => watch(() => pinia.state.value[$id], (state) => { 22697 if (options2.flush === "sync" ? isSyncListening : isListening) { 22698 callback({ 22699 storeId: $id, 22700 type: MutationType.direct, 22701 events: debuggerEvents 22702 }, state); 22703 } 22704 }, assign({}, $subscribeOptions, options2))); 22705 return removeSubscription; 22706 }, 22707 $dispose 22708 }; 22709 const store = reactive(define_process_env_default.NODE_ENV !== "production" || (define_process_env_default.NODE_ENV !== "production" || false) && !(define_process_env_default.NODE_ENV === "test") && IS_CLIENT ? assign( 22710 { 22711 _hmrPayload, 22712 _customProperties: markRaw(/* @__PURE__ */ new Set()) 22713 // devtools custom properties 22714 }, 22715 partialStore 22716 // must be added later 22717 // setupStore 22718 ) : partialStore); 22719 pinia._s.set($id, store); 22720 const runWithContext = pinia._a && pinia._a.runWithContext || fallbackRunWithContext; 22721 const setupStore = runWithContext(() => pinia._e.run(() => (scope = effectScope()).run(() => setup({ action })))); 22722 for (const key in setupStore) { 22723 const prop = setupStore[key]; 22724 if (isRef(prop) && !isComputed(prop) || isReactive(prop)) { 22725 if (define_process_env_default.NODE_ENV !== "production" && hot) { 22726 set(hotState.value, key, toRef(setupStore, key)); 22727 } else if (!isOptionsStore) { 22728 if (initialState && shouldHydrate(prop)) { 22729 if (isRef(prop)) { 22730 prop.value = initialState[key]; 22731 } else { 22732 mergeReactiveObjects(prop, initialState[key]); 22733 } 22734 } 22735 { 22736 pinia.state.value[$id][key] = prop; 22737 } 22738 } 22739 if (define_process_env_default.NODE_ENV !== "production") { 22740 _hmrPayload.state.push(key); 22741 } 22742 } else if (typeof prop === "function") { 22743 const actionValue = define_process_env_default.NODE_ENV !== "production" && hot ? prop : action(prop, key); 22744 { 22745 setupStore[key] = actionValue; 22746 } 22747 if (define_process_env_default.NODE_ENV !== "production") { 22748 _hmrPayload.actions[key] = prop; 22749 } 22750 optionsForPlugin.actions[key] = prop; 22751 } else if (define_process_env_default.NODE_ENV !== "production") { 22752 if (isComputed(prop)) { 22753 _hmrPayload.getters[key] = isOptionsStore ? ( 22754 // @ts-expect-error 22755 options.getters[key] 22756 ) : prop; 22757 if (IS_CLIENT) { 22758 const getters = setupStore._getters || // @ts-expect-error: same 22759 (setupStore._getters = markRaw([])); 22760 getters.push(key); 22761 } 22762 } 22763 } 22764 } 22765 { 22766 assign(store, setupStore); 22767 assign(toRaw(store), setupStore); 22768 } 22769 Object.defineProperty(store, "$state", { 22770 get: () => define_process_env_default.NODE_ENV !== "production" && hot ? hotState.value : pinia.state.value[$id], 22771 set: (state) => { 22772 if (define_process_env_default.NODE_ENV !== "production" && hot) { 22773 throw new Error("cannot set hotState"); 22774 } 22775 $patch(($state) => { 22776 assign($state, state); 22777 }); 22778 } 22779 }); 22780 if (define_process_env_default.NODE_ENV !== "production") { 22781 store._hotUpdate = markRaw((newStore) => { 22782 store._hotUpdating = true; 22783 newStore._hmrPayload.state.forEach((stateKey) => { 22784 if (stateKey in store.$state) { 22785 const newStateTarget = newStore.$state[stateKey]; 22786 const oldStateSource = store.$state[stateKey]; 22787 if (typeof newStateTarget === "object" && isPlainObject(newStateTarget) && isPlainObject(oldStateSource)) { 22788 patchObject(newStateTarget, oldStateSource); 22789 } else { 22790 newStore.$state[stateKey] = oldStateSource; 22791 } 22792 } 22793 set(store, stateKey, toRef(newStore.$state, stateKey)); 22794 }); 22795 Object.keys(store.$state).forEach((stateKey) => { 22796 if (!(stateKey in newStore.$state)) { 22797 del(store, stateKey); 22798 } 22799 }); 22800 isListening = false;
22801 isSyncListening = false; 22802 pinia.state.value[$id] = toRef(newStore._hmrPayload, "hotState"); 22803 isSyncListening = true; 22804 nextTick().then(() => { 22805 isListening = true; 22806 }); 22807 for (const actionName in newStore._hmrPayload.actions) { 22808 const actionFn = newStore[actionName]; 22809 set(store, actionName, action(actionFn, actionName)); 22810 } 22811 for (const getterName in newStore._hmrPayload.getters) { 22812 const getter = newStore._hmrPayload.getters[getterName]; 22813 const getterValue = isOptionsStore ? ( 22814 // special handling of options api 22815 computed(() => { 22816 setActivePinia(pinia); 22817 return getter.call(store, store); 22818 }) 22819 ) : getter; 22820 set(store, getterName, getterValue); 22821 } 22822 Object.keys(store._hmrPayload.getters).forEach((key) => { 22823 if (!(key in newStore._hmrPayload.getters)) { 22824 del(store, key); 22825 } 22826 }); 22827 Object.keys(store._hmrPayload.actions).forEach((key) => { 22828 if (!(key in newStore._hmrPayload.actions)) { 22829 del(store, key); 22830 } 22831 }); 22832 store._hmrPayload = newStore._hmrPayload; 22833 store._getters = newStore._getters; 22834 store._hotUpdating = false; 22835 }); 22836 } 22837 if ((define_process_env_default.NODE_ENV !== "production" || false) && !(define_process_env_default.NODE_ENV === "test") && IS_CLIENT) { 22838 const nonEnumerable = { 22839 writable: true, 22840 configurable: true, 22841 // avoid warning on devtools trying to display this property 22842 enumerable: false 22843 }; 22844 ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((p2) => { 22845 Object.defineProperty(store, p2, assign({ value: store[p2] }, nonEnumerable)); 22846 }); 22847 } 22848 pinia._p.forEach((extender) => { 22849 if ((define_process_env_default.NODE_ENV !== "production" || false) && !(define_process_env_default.NODE_ENV === "test") && IS_CLIENT) { 22850 const extensions = scope.run(() => extender({ 22851 store, 22852 app: pinia._a, 22853 pinia, 22854 options: optionsForPlugin 22855 })); 22856 Object.keys(extensions || {}).forEach((key) => store._customProperties.add(key)); 22857 assign(store, extensions); 22858 } else { 22859 assign(store, scope.run(() => extender({ 22860 store, 22861 app: pinia._a, 22862 pinia, 22863 options: optionsForPlugin 22864 }))); 22865 } 22866 }); 22867 if (define_process_env_default.NODE_ENV !== "production" && store.$state && typeof store.$state === "object" && typeof store.$state.constructor === "function" && !store.$state.constructor.toString().includes("[native code]")) { 22868 console.warn(`[ð]: The "state" must be a plain object. It cannot be 22869 state: () => new MyClass() 22870Found in store "${store.$id}".`); 22871 } 22872 if (initialState && isOptionsStore && options.hydrate) { 22873 options.hydrate(store.$state, initialState); 22874 } 22875 isListening = true; 22876 isSyncListening = true; 22877 return store; 22878} 22879/*! #__NO_SIDE_EFFECTS__ */ 22880// @__NO_SIDE_EFFECTS__ 22881function defineStore(idOrOptions, setup, setupOptions) { 22882 let id; 22883 let options; 22884 const isSetupStore = typeof setup === "function"; 22885 { 22886 id = idOrOptions; 22887 options = isSetupStore ? setupOptions : setup; 22888 } 22889 function useStore(pinia, hot) { 22890 const hasContext = hasInjectionContext(); 22891 pinia = // in test mode, ignore the argument provided as we can always retrieve a 22892 // pinia instance with getActivePinia() 22893 (define_process_env_default.NODE_ENV === "test" && activePinia && activePinia._testing ? null : pinia) || (hasContext ? inject(piniaSymbol, null) : null); 22894 if (pinia) 22895 setActivePinia(pinia); 22896 if (define_process_env_default.NODE_ENV !== "production" && !activePinia) { 22897 throw new Error(`[ð]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"? 22898See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help. 22899This will fail in production.`); 22900 } 22901 pinia = activePinia; 22902 if (!pinia._s.has(id)) { 22903 if (isSetupStore) { 22904 createSetupStore(id, setup, options, pinia); 22905 } else { 22906 createOptionsStore(id, options, pinia); 22907 } 22908 if (define_process_env_default.NODE_ENV !== "production") { 22909 useStore._pinia = pinia; 22910 } 22911 } 22912 const store = pinia._s.get(id); 22913 if (define_process_env_default.NODE_ENV !== "production" && hot) { 22914 const hotId = "__hot:" + id; 22915 const newStore = isSetupStore ? createSetupStore(hotId, setup, options, pinia, true) : createOptionsStore(hotId, assign({}, options), pinia, true); 22916 hot._hotUpdate(newStore); 22917 delete pinia.state.value[hotId]; 22918 pinia._s.delete(hotId); 22919 } 22920 if (define_process_env_default.NODE_ENV !== "production" && IS_CLIENT) { 22921 const currentInstance2 = getCurrentInstance(); 22922 if (currentInstance2 && currentInstance2.proxy && // avoid adding stores that are just built for hot module replacement 22923 !hot) { 22924 const vm = currentInstance2.proxy; 22925 const cache2 = "_pStores" in vm ? vm._pStores : vm._pStores = {}; 22926 cache2[id] = store; 22927 } 22928 } 22929 return store; 22930 } 22931 useStore.$id = id; 22932 return useStore; 22933} 22934function tryOnScopeDispose(fn) { 22935 if (getCurrentScope()) { 22936 onScopeDispose(fn); 22937 return true; 22938 } 22939 return false;
22940} 22941function toValue(r) { 22942 return typeof r === "function" ? r() : unref(r); 22943} 22944const isClient = typeof window !== "undefined" && typeof document !== "undefined"; 22945typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope; 22946const toString = Object.prototype.toString; 22947const isObject = (val) => toString.call(val) === "[object Object]"; 22948const noop = () => { 22949}; 22950function createFilterWrapper(filter, fn) { 22951 function wrapper(...args) { 22952 return new Promise((resolve2, reject) => { 22953 Promise.resolve(filter(() => fn.apply(this, args), { fn, thisArg: this, args })).then(resolve2).catch(reject); 22954 }); 22955 } 22956 return wrapper; 22957} 22958const bypassFilter = (invoke2) => { 22959 return invoke2(); 22960}; 22961function pausableFilter(extendFilter = bypassFilter) { 22962 const isActive = ref(true); 22963 function pause() { 22964 isActive.value = false; 22965 } 22966 function resume() { 22967 isActive.value = true; 22968 } 22969 const eventFilter = (...args) => { 22970 if (isActive.value) 22971 extendFilter(...args); 22972 }; 22973 return { isActive: readonly(isActive), pause, resume, eventFilter }; 22974} 22975function getLifeCycleTarget(target) { 22976 return getCurrentInstance(); 22977} 22978function watchWithFilter(source, cb, options = {}) { 22979 const { 22980 eventFilter = bypassFilter, 22981 ...watchOptions 22982 } = options; 22983 return watch( 22984 source, 22985 createFilterWrapper( 22986 eventFilter, 22987 cb 22988 ), 22989 watchOptions 22990 ); 22991} 22992function watchPausable(source, cb, options = {}) { 22993 const { 22994 eventFilter: filter, 22995 ...watchOptions 22996 } = options; 22997 const { eventFilter, pause, resume, isActive } = pausableFilter(filter); 22998 const stop = watchWithFilter( 22999 source, 23000 cb, 23001 { 23002 ...watchOptions, 23003 eventFilter 23004 } 23005 ); 23006 return { stop, pause, resume, isActive }; 23007} 23008function tryOnMounted(fn, sync = true, target) { 23009 const instance = getLifeCycleTarget(); 23010 if (instance) 23011 onMounted(fn, target); 23012 else if (sync) 23013 fn(); 23014 else 23015 nextTick(fn); 23016} 23017function unrefElement(elRef) { 23018 var _a2; 23019 const plain = toValue(elRef); 23020 return (_a2 = plain == null ? void 0 : plain.$el) != null ? _a2 : plain; 23021} 23022const defaultWindow = isClient ? window : void 0; 23023function useEventListener(...args) { 23024 let target; 23025 let events2; 23026 let listeners; 23027 let options; 23028 if (typeof args[0] === "string" || Array.isArray(args[0])) { 23029 [events2, listeners, options] = args; 23030 target = defaultWindow; 23031 } else { 23032 [target, events2, listeners, options] = args; 23033 } 23034 if (!target) 23035 return noop; 23036 if (!Array.isArray(events2)) 23037 events2 = [events2]; 23038 if (!Array.isArray(listeners)) 23039 listeners = [listeners]; 23040 const cleanups = []; 23041 const cleanup = () => { 23042 cleanups.forEach((fn) => fn()); 23043 cleanups.length = 0; 23044 }; 23045 const register = (el, event, listener, options2) => { 23046 el.addEventListener(event, listener, options2); 23047 return () => el.removeEventListener(event, listener, options2); 23048 }; 23049 const stopWatch = watch( 23050 () => [unrefElement(target), toValue(options)], 23051 ([el, options2]) => { 23052 cleanup(); 23053 if (!el) 23054 return; 23055 const optionsClone = isObject(options2) ? { ...options2 } : options2; 23056 cleanups.push( 23057 ...events2.flatMap((event) => { 23058 return listeners.map((listener) => register(el, event, listener, optionsClone)); 23059 }) 23060 ); 23061 }, 23062 { immediate: true, flush: "post" } 23063 ); 23064 const stop = () => { 23065 stopWatch(); 23066 cleanup(); 23067 }; 23068 tryOnScopeDispose(stop); 23069 return stop; 23070} 23071const _global = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; 23072const globalKey = "__vueuse_ssr_handlers__"; 23073const handlers = /* @__PURE__ */ getHandlers(); 23074function getHandlers() { 23075 if (!(globalKey in _global)) 23076 _global[globalKey] = _global[globalKey] || {}; 23077 return _global[globalKey]; 23078} 23079function getSSRHandler(key, fallback) { 23080 return handlers[key] || fallback; 23081} 23082function guessSerializerType(rawInit) { 23083 return rawInit == null ? "any" : rawInit instanceof Set ? "set" : rawInit instanceof Map ? "map" : rawInit instanceof Date ? "date" : typeof rawInit === "boolean" ? "boolean" : typeof rawInit === "string" ? "string" : typeof rawInit === "object" ? "object" : !Number.isNaN(rawInit) ? "number" : "any"; 23084} 23085const StorageSerializers = { 23086 boolean: { 23087 read: (v) => v === "true", 23088 write: (v) => String(v) 23089 }, 23090 object: { 23091 read: (v) => JSON.parse(v), 23092 write: (v) => JSON.stringify(v) 23093 }, 23094 number: { 23095 read: (v) => Number.parseFloat(v), 23096 write: (v) => String(v) 23097 }, 23098 any: { 23099 read: (v) => v, 23100 write: (v) => String(v) 23101 }, 23102 string: { 23103 read: (v) => v, 23104 write: (v) => String(v) 23105 }, 23106 map: { 23107 read: (v) => new Map(JSON.parse(v)), 23108 write: (v) => JSON.stringify(Array.from(v.entries())) 23109 }, 23110 set: { 23111 read: (v) => new Set(JSON.parse(v)), 23112 write: (v) => JSON.stringify(Array.from(v)) 23113 }, 23114 date: { 23115 read: (v) => new Date(v), 23116 write: (v) => v.toISOString() 23117 } 23118}; 23119const customStorageEventName = "vueuse-storage"; 23120function useStorage(key, defaults2, storage, options = {}) { 23121 var _a2; 23122 const { 23123 flush = "pre", 23124 deep = true, 23125 listenToStorageChanges = true, 23126 writeDefaults = true, 23127 mergeDefaults = false, 23128 shallow, 23129 window: window2 = defaultWindow, 23130 eventFilter, 23131 onError = (e) => { 23132 console.error(e); 23133 }, 23134 initOnMounted 23135 } = options; 23136 const data = (shallow ? shallowRef : ref)(typeof defaults2 === "function" ? defaults2() : defaults2); 23137 if (!storage) { 23138 try { 23139 storage = getSSRHandler("getDefaultStorage", () => { 23140 var _a22; 23141 return (_a22 = defaultWindow) == null ? void 0 : _a22.localStorage; 23142 })(); 23143 } catch (e) { 23144 onError(e); 23145 } 23146 } 23147 if (!storage) 23148 return data; 23149 const rawInit = toValue(defaults2); 23150 const type = guessSerializerType(rawInit); 23151 const serializer = (_a2 = options.serializer) != null ? _a2 : StorageSerializers[type]; 23152 const { pause: pauseWatch, resume: resumeWatch } = watchPausable( 23153 data, 23154 () => write(data.value), 23155 { flush, deep, eventFilter } 23156 ); 23157 if (window2 && listenToStorageChanges) { 23158 tryOnMounted(() => { 23159 useEventListener(window2, "storage", update2); 23160 useEventListener(window2, customStorageEventName, updateFromCustomEvent); 23161 if (initOnMounted) 23162 update2(); 23163 }); 23164 } 23165 if (!initOnMounted) 23166 update2(); 23167 function dispatchWriteEvent(oldValue, newValue) { 23168 if (window2) { 23169 window2.dispatchEvent(new CustomEvent(customStorageEventName, { 23170 detail: { 23171 key, 23172 oldValue, 23173 newValue, 23174 storageArea: storage 23175 } 23176 })); 23177 } 23178 } 23179 function write(v) { 23180 try { 23181 const oldValue = storage.getItem(key); 23182 if (v == null) { 23183 dispatchWriteEvent(oldValue, null); 23184 storage.removeItem(key); 23185 } else { 23186 const serialized = serializer.write(v); 23187 if (oldValue !== serialized) { 23188 storage.setItem(key, serialized);
23189 dispatchWriteEvent(oldValue, serialized); 23190 } 23191 } 23192 } catch (e) { 23193 onError(e); 23194 } 23195 } 23196 function read(event) { 23197 const rawValue = event ? event.newValue : storage.getItem(key); 23198 if (rawValue == null) { 23199 if (writeDefaults && rawInit != null) 23200 storage.setItem(key, serializer.write(rawInit)); 23201 return rawInit; 23202 } else if (!event && mergeDefaults) { 23203 const value = serializer.read(rawValue); 23204 if (typeof mergeDefaults === "function") 23205 return mergeDefaults(value, rawInit); 23206 else if (type === "object" && !Array.isArray(value)) 23207 return { ...rawInit, ...value }; 23208 return value; 23209 } else if (typeof rawValue !== "string") { 23210 return rawValue; 23211 } else { 23212 return serializer.read(rawValue); 23213 } 23214 } 23215 function update2(event) { 23216 if (event && event.storageArea !== storage) 23217 return; 23218 if (event && event.key == null) { 23219 data.value = rawInit; 23220 return; 23221 } 23222 if (event && event.key !== key) 23223 return; 23224 pauseWatch(); 23225 try { 23226 if ((event == null ? void 0 : event.newValue) !== serializer.write(data.value)) 23227 data.value = read(event); 23228 } catch (e) { 23229 onError(e); 23230 } finally { 23231 if (event) 23232 nextTick(resumeWatch); 23233 else 23234 resumeWatch(); 23235 } 23236 } 23237 function updateFromCustomEvent(event) { 23238 update2(event.detail); 23239 } 23240 return data; 23241} 23242const useDarkModeStore = /* @__PURE__ */ defineStore("darkMode", () => { 23243 const darkMode = useStorage("darkMode", ref(false)); 23244 document.documentElement.classList.toggle("dark", darkMode.value); 23245 function toggleDarkMode() { 23246 darkMode.value = !darkMode.value; 23247 document.documentElement.classList.toggle("dark", darkMode.value); 23248 } 23249 return { darkMode, toggleDarkMode }; 23250}); 23251var _freeGlobal; 23252var hasRequired_freeGlobal; 23253function require_freeGlobal() { 23254 if (hasRequired_freeGlobal) return _freeGlobal; 23255 hasRequired_freeGlobal = 1; 23256 var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal; 23257 _freeGlobal = freeGlobal; 23258 return _freeGlobal; 23259} 23260var _root; 23261var hasRequired_root; 23262function require_root() { 23263 if (hasRequired_root) return _root; 23264 hasRequired_root = 1; 23265 var freeGlobal = require_freeGlobal(); 23266 var freeSelf = typeof self == "object" && self && self.Object === Object && self; 23267 var root = freeGlobal || freeSelf || Function("return this")(); 23268 _root = root; 23269 return _root; 23270} 23271var now_1; 23272var hasRequiredNow; 23273function requireNow() { 23274 if (hasRequiredNow) return now_1; 23275 hasRequiredNow = 1; 23276 var root = require_root(); 23277 var now2 = function() { 23278 return root.Date.now(); 23279 }; 23280 now_1 = now2; 23281 return now_1; 23282} 23283var date; 23284var hasRequiredDate; 23285function requireDate() { 23286 if (hasRequiredDate) return date; 23287 hasRequiredDate = 1; 23288 date = { 23289 "now": requireNow() 23290 }; 23291 return date; 23292} 23293requireDate(); 23294/*! 23295* sweetalert2 v11.26.3 23296* Released under the MIT License. 23297*/ 23298function _assertClassBrand(e, t, n) { 23299 if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; 23300 throw new TypeError("Private element is not present on this object"); 23301} 23302function _checkPrivateRedeclaration(e, t) { 23303 if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); 23304} 23305function _classPrivateFieldGet2(s, a) { 23306 return s.get(_assertClassBrand(s, a)); 23307} 23308function _classPrivateFieldInitSpec(e, t, a) { 23309 _checkPrivateRedeclaration(e, t), t.set(e, a); 23310} 23311function _classPrivateFieldSet2(s, a, r) { 23312 return s.set(_assertClassBrand(s, a), r), r; 23313} 23314const RESTORE_FOCUS_TIMEOUT = 100; 23315const globalState = {}; 23316const focusPreviousActiveElement = () => { 23317 if (globalState.previousActiveElement instanceof HTMLElement) { 23318 globalState.previousActiveElement.focus(); 23319 globalState.previousActiveElement = null; 23320 } else if (document.body) { 23321 document.body.focus(); 23322 } 23323}; 23324const restoreActiveElement = (returnFocus) => { 23325 return new Promise((resolve2) => { 23326 if (!returnFocus) { 23327 return resolve2(); 23328 } 23329 const x = window.scrollX; 23330 const y = window.scrollY; 23331 globalState.restoreFocusTimeout = setTimeout(() => { 23332 focusPreviousActiveElement(); 23333 resolve2(); 23334 }, RESTORE_FOCUS_TIMEOUT); 23335 window.scrollTo(x, y); 23336 }); 23337}; 23338const swalPrefix = "swal2-"; 23339const classNames = ["container", "shown", "height-auto", "iosfix", "popup", "modal", "no-backdrop", "no-transition", "toast", "toast-shown", "show", "hide", "close", "title", "html-container", "actions", "confirm", "deny", "cancel", "footer", "icon", "icon-content", "image", "input", "file", "range", "select", "radio", "checkbox", "label", "textarea", "inputerror", "input-label", "validation-message", "progress-steps", "active-progress-step", "progress-step", "progress-step-line", "loader", "loading", "styled", "top", "top-start", "top-end", "top-left", "top-right", "center", "center-start", "center-end", "center-left", "center-right", "bottom", "bottom-start", "bottom-end", "bottom-left", "bottom-right", "grow-row", "grow-column", "grow-fullscreen", "rtl", "timer-progress-bar", "timer-progress-bar-container", "scrollbar-measure", "icon-success", "icon-warning", "icon-info", "icon-question", "icon-error", "draggable", "dragging"]; 23340const swalClasses = classNames.reduce( 23341 (acc, className) => { 23342 acc[className] = swalPrefix + className; 23343 return acc; 23344 }, 23345 /** @type {SwalClasses} */ 23346 {} 23347); 23348const icons = ["success", "warning", "info", "question", "error"]; 23349const iconTypes = icons.reduce( 23350 (acc, icon) => { 23351 acc[icon] = swalPrefix + icon; 23352 return acc; 23353 }, 23354 /** @type {SwalIcons} */ 23355 {} 23356); 23357const consolePrefix = "SweetAlert2:"; 23358const capitalizeFirstLetter = (str) => str.charAt(0).toUpperCase() + str.slice(1); 23359const warn = (message) => { 23360 console.warn(`${consolePrefix} ${typeof message === "object" ? message.join(" ") : message}`); 23361}; 23362const error = (message) => { 23363 console.error(`${consolePrefix} ${message}`); 23364}; 23365const previousWarnOnceMessages = []; 23366const warnOnce = (message) => { 23367 if (!previousWarnOnceMessages.includes(message)) { 23368 previousWarnOnceMessages.push(message); 23369 warn(message); 23370 } 23371}; 23372const warnAboutDeprecation = (deprecatedParam, useInstead = null) => { 23373 warnOnce(`"${deprecatedParam}" is deprecated and will be removed in the next major release.${useInstead ? ` Use "${useInstead}" instead.` : ""}`); 23374}; 23375const callIfFunction = (arg) => typeof arg === "function" ? arg() : arg;
23376const hasToPromiseFn = (arg) => arg && typeof arg.toPromise === "function"; 23377const asPromise = (arg) => hasToPromiseFn(arg) ? arg.toPromise() : Promise.resolve(arg); 23378const isPromise = (arg) => arg && Promise.resolve(arg) === arg; 23379const getContainer = () => document.body.querySelector(`.${swalClasses.container}`); 23380const elementBySelector = (selectorString) => { 23381 const container = getContainer(); 23382 return container ? container.querySelector(selectorString) : null; 23383}; 23384const elementByClass = (className) => { 23385 return elementBySelector(`.${className}`); 23386}; 23387const getPopup = () => elementByClass(swalClasses.popup); 23388const getIcon = () => elementByClass(swalClasses.icon); 23389const getIconContent = () => elementByClass(swalClasses["icon-content"]); 23390const getTitle = () => elementByClass(swalClasses.title); 23391const getHtmlContainer = () => elementByClass(swalClasses["html-container"]); 23392const getImage = () => elementByClass(swalClasses.image); 23393const getProgressSteps = () => elementByClass(swalClasses["progress-steps"]); 23394const getValidationMessage = () => elementByClass(swalClasses["validation-message"]); 23395const getConfirmButton = () => ( 23396 /** @type {HTMLButtonElement} */ 23397 elementBySelector(`.${swalClasses.actions} .${swalClasses.confirm}`) 23398); 23399const getCancelButton = () => ( 23400 /** @type {HTMLButtonElement} */ 23401 elementBySelector(`.${swalClasses.actions} .${swalClasses.cancel}`) 23402); 23403const getDenyButton = () => ( 23404 /** @type {HTMLButtonElement} */ 23405 elementBySelector(`.${swalClasses.actions} .${swalClasses.deny}`) 23406); 23407const getInputLabel = () => elementByClass(swalClasses["input-label"]); 23408const getLoader = () => elementBySelector(`.${swalClasses.loader}`); 23409const getActions = () => elementByClass(swalClasses.actions); 23410const getFooter = () => elementByClass(swalClasses.footer); 23411const getTimerProgressBar = () => elementByClass(swalClasses["timer-progress-bar"]); 23412const getCloseButton = () => elementByClass(swalClasses.close); 23413const focusable = ` 23414 a[href], 23415 area[href], 23416 input:not([disabled]), 23417 select:not([disabled]), 23418 textarea:not([disabled]), 23419 button:not([disabled]), 23420 iframe, 23421 object, 23422 embed, 23423 [tabindex="0"], 23424 [contenteditable], 23425 audio[controls], 23426 video[controls], 23427 summary 23428`; 23429const getFocusableElements = () => { 23430 const popup = getPopup(); 23431 if (!popup) { 23432 return []; 23433 } 23434 const focusableElementsWithTabindex = popup.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'); 23435 const focusableElementsWithTabindexSorted = Array.from(focusableElementsWithTabindex).sort((a, b) => { 23436 const tabindexA = parseInt(a.getAttribute("tabindex") || "0"); 23437 const tabindexB = parseInt(b.getAttribute("tabindex") || "0"); 23438 if (tabindexA > tabindexB) { 23439 return 1; 23440 } else if (tabindexA < tabindexB) { 23441 return -1; 23442 } 23443 return 0; 23444 }); 23445 const otherFocusableElements = popup.querySelectorAll(focusable); 23446 const otherFocusableElementsFiltered = Array.from(otherFocusableElements).filter((el) => el.getAttribute("tabindex") !== "-1"); 23447 return [...new Set(focusableElementsWithTabindexSorted.concat(otherFocusableElementsFiltered))].filter((el) => isVisible$1(el)); 23448}; 23449const isModal = () => { 23450 return hasClass(document.body, swalClasses.shown) && !hasClass(document.body, swalClasses["toast-shown"]) && !hasClass(document.body, swalClasses["no-backdrop"]); 23451}; 23452const isToast = () => { 23453 const popup = getPopup(); 23454 if (!popup) { 23455 return false; 23456 } 23457 return hasClass(popup, swalClasses.toast); 23458}; 23459const isLoading = () => { 23460 const popup = getPopup(); 23461 if (!popup) { 23462 return false; 23463 } 23464 return popup.hasAttribute("data-loading"); 23465}; 23466const setInnerHtml = (elem, html2) => { 23467 elem.textContent = ""; 23468 if (html2) { 23469 const parser = new DOMParser(); 23470 const parsed = parser.parseFromString(html2, `text/html`); 23471 const head = parsed.querySelector("head"); 23472 if (head) { 23473 Array.from(head.childNodes).forEach((child) => { 23474 elem.appendChild(child); 23475 }); 23476 } 23477 const body = parsed.querySelector("body"); 23478 if (body) { 23479 Array.from(body.childNodes).forEach((child) => { 23480 if (child instanceof HTMLVideoElement || child instanceof HTMLAudioElement) { 23481 elem.appendChild(child.cloneNode(true)); 23482 } else { 23483 elem.appendChild(child); 23484 } 23485 }); 23486 } 23487 } 23488}; 23489const hasClass = (elem, className) => { 23490 if (!className) { 23491 return false;
23492 } 23493 const classList = className.split(/\s+/); 23494 for (let i = 0; i < classList.length; i++) { 23495 if (!elem.classList.contains(classList[i])) { 23496 return false; 23497 } 23498 } 23499 return true; 23500}; 23501const removeCustomClasses = (elem, params) => { 23502 Array.from(elem.classList).forEach((className) => { 23503 if (!Object.values(swalClasses).includes(className) && !Object.values(iconTypes).includes(className) && !Object.values(params.showClass || {}).includes(className)) { 23504 elem.classList.remove(className); 23505 } 23506 }); 23507}; 23508const applyCustomClass = (elem, params, className) => { 23509 removeCustomClasses(elem, params); 23510 if (!params.customClass) { 23511 return; 23512 } 23513 const customClass = params.customClass[ 23514 /** @type {keyof SweetAlertCustomClass} */ 23515 className 23516 ]; 23517 if (!customClass) { 23518 return; 23519 } 23520 if (typeof customClass !== "string" && !customClass.forEach) { 23521 warn(`Invalid type of customClass.${className}! Expected string or iterable object, got "${typeof customClass}"`); 23522 return; 23523 } 23524 addClass(elem, customClass); 23525}; 23526const getInput$1 = (popup, inputClass) => { 23527 if (!inputClass) { 23528 return null; 23529 } 23530 switch (inputClass) { 23531 case "select": 23532 case "textarea": 23533 case "file": 23534 return popup.querySelector(`.${swalClasses.popup} > .${swalClasses[inputClass]}`); 23535 case "checkbox": 23536 return popup.querySelector(`.${swalClasses.popup} > .${swalClasses.checkbox} input`); 23537 case "radio": 23538 return popup.querySelector(`.${swalClasses.popup} > .${swalClasses.radio} input:checked`) || popup.querySelector(`.${swalClasses.popup} > .${swalClasses.radio} input:first-child`); 23539 case "range": 23540 return popup.querySelector(`.${swalClasses.popup} > .${swalClasses.range} input`); 23541 default: 23542 return popup.querySelector(`.${swalClasses.popup} > .${swalClasses.input}`); 23543 } 23544}; 23545const focusInput = (input) => { 23546 input.focus(); 23547 if (input.type !== "file") { 23548 const val = input.value; 23549 input.value = ""; 23550 input.value = val; 23551 } 23552}; 23553const toggleClass = (target, classList, condition) => { 23554 if (!target || !classList) { 23555 return; 23556 } 23557 if (typeof classList === "string") { 23558 classList = classList.split(/\s+/).filter(Boolean); 23559 } 23560 classList.forEach((className) => { 23561 if (Array.isArray(target)) { 23562 target.forEach((elem) => { 23563 if (condition) { 23564 elem.classList.add(className); 23565 } else { 23566 elem.classList.remove(className); 23567 } 23568 }); 23569 } else { 23570 if (condition) { 23571 target.classList.add(className); 23572 } else { 23573 target.classList.remove(className); 23574 } 23575 } 23576 }); 23577}; 23578const addClass = (target, classList) => { 23579 toggleClass(target, classList, true); 23580}; 23581const removeClass = (target, classList) => { 23582 toggleClass(target, classList, false); 23583}; 23584const getDirectChildByClass = (elem, className) => { 23585 const children = Array.from(elem.children); 23586 for (let i = 0; i < children.length; i++) { 23587 const child = children[i]; 23588 if (child instanceof HTMLElement && hasClass(child, className)) { 23589 return child; 23590 } 23591 } 23592}; 23593const applyNumericalStyle = (elem, property, value) => { 23594 if (value === `${parseInt(`${value}`)}`) { 23595 value = parseInt(value); 23596 } 23597 if (value || parseInt(`${value}`) === 0) { 23598 elem.style.setProperty(property, typeof value === "number" ? `${value}px` : value); 23599 } else { 23600 elem.style.removeProperty(property); 23601 } 23602}; 23603const show = (elem, display = "flex") => { 23604 if (!elem) { 23605 return; 23606 } 23607 elem.style.display = display; 23608}; 23609const hide = (elem) => { 23610 if (!elem) { 23611 return; 23612 } 23613 elem.style.display = "none"; 23614}; 23615const showWhenInnerHtmlPresent = (elem, display = "block") => { 23616 if (!elem) { 23617 return; 23618 } 23619 new MutationObserver(() => { 23620 toggle(elem, elem.innerHTML, display); 23621 }).observe(elem, { 23622 childList: true, 23623 subtree: true 23624 }); 23625}; 23626const setStyle = (parent, selector, property, value) => { 23627 const el = parent.querySelector(selector); 23628 if (el) { 23629 el.style.setProperty(property, value); 23630 } 23631}; 23632const toggle = (elem, condition, display = "flex") => { 23633 if (condition) { 23634 show(elem, display); 23635 } else { 23636 hide(elem); 23637 } 23638}; 23639const isVisible$1 = (elem) => !!(elem && (elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length)); 23640const allButtonsAreHidden = () => !isVisible$1(getConfirmButton()) && !isVisible$1(getDenyButton()) && !isVisible$1(getCancelButton()); 23641const isScrollable = (elem) => !!(elem.scrollHeight > elem.clientHeight); 23642const selfOrParentIsScrollable = (element, stopElement) => { 23643 let parent = element; 23644 while (parent && parent !== stopElement) { 23645 if (isScrollable(parent)) { 23646 return true; 23647 } 23648 parent = parent.parentElement; 23649 } 23650 return false;
vendor: 8,766 bytes, lines 23651-23878
23651}; 23652const hasCssAnimation = (elem) => { 23653 const style = window.getComputedStyle(elem); 23654 const animDuration = parseFloat(style.getPropertyValue("animation-duration") || "0"); 23655 const transDuration = parseFloat(style.getPropertyValue("transition-duration") || "0"); 23656 return animDuration > 0 || transDuration > 0; 23657}; 23658const animateTimerProgressBar = (timer, reset = false) => { 23659 const timerProgressBar = getTimerProgressBar(); 23660 if (!timerProgressBar) { 23661 return; 23662 } 23663 if (isVisible$1(timerProgressBar)) { 23664 if (reset) { 23665 timerProgressBar.style.transition = "none"; 23666 timerProgressBar.style.width = "100%"; 23667 } 23668 setTimeout(() => { 23669 timerProgressBar.style.transition = `width ${timer / 1e3}s linear`; 23670 timerProgressBar.style.width = "0%"; 23671 }, 10); 23672 } 23673}; 23674const stopTimerProgressBar = () => { 23675 const timerProgressBar = getTimerProgressBar(); 23676 if (!timerProgressBar) { 23677 return; 23678 } 23679 const timerProgressBarWidth = parseInt(window.getComputedStyle(timerProgressBar).width); 23680 timerProgressBar.style.removeProperty("transition"); 23681 timerProgressBar.style.width = "100%"; 23682 const timerProgressBarFullWidth = parseInt(window.getComputedStyle(timerProgressBar).width); 23683 const timerProgressBarPercent = timerProgressBarWidth / timerProgressBarFullWidth * 100; 23684 timerProgressBar.style.width = `${timerProgressBarPercent}%`; 23685}; 23686const isNodeEnv = () => typeof window === "undefined" || typeof document === "undefined"; 23687const sweetHTML = ` 23688 <div aria-labelledby="${swalClasses.title}" aria-describedby="${swalClasses["html-container"]}" class="${swalClasses.popup}" tabindex="-1"> 23689 <button type="button" class="${swalClasses.close}"></button> 23690 <ul class="${swalClasses["progress-steps"]}"></ul> 23691 <div class="${swalClasses.icon}"></div> 23692 <img class="${swalClasses.image}" /> 23693 <h2 class="${swalClasses.title}" id="${swalClasses.title}"></h2> 23694 <div class="${swalClasses["html-container"]}" id="${swalClasses["html-container"]}"></div> 23695 <input class="${swalClasses.input}" id="${swalClasses.input}" /> 23696 <input type="file" class="${swalClasses.file}" /> 23697 <div class="${swalClasses.range}"> 23698 <input type="range" /> 23699 <output></output> 23700 </div> 23701 <select class="${swalClasses.select}" id="${swalClasses.select}"></select> 23702 <div class="${swalClasses.radio}"></div> 23703 <label class="${swalClasses.checkbox}"> 23704 <input type="checkbox" id="${swalClasses.checkbox}" /> 23705 <span class="${swalClasses.label}"></span> 23706 </label> 23707 <textarea class="${swalClasses.textarea}" id="${swalClasses.textarea}"></textarea> 23708 <div class="${swalClasses["validation-message"]}" id="${swalClasses["validation-message"]}"></div> 23709 <div class="${swalClasses.actions}"> 23710 <div class="${swalClasses.loader}"></div> 23711 <button type="button" class="${swalClasses.confirm}"></button> 23712 <button type="button" class="${swalClasses.deny}"></button> 23713 <button type="button" class="${swalClasses.cancel}"></button> 23714 </div> 23715 <div class="${swalClasses.footer}"></div> 23716 <div class="${swalClasses["timer-progress-bar-container"]}"> 23717 <div class="${swalClasses["timer-progress-bar"]}"></div> 23718 </div> 23719 </div> 23720`.replace(/(^|\n)\s*/g, ""); 23721const resetOldContainer = () => { 23722 const oldContainer = getContainer(); 23723 if (!oldContainer) { 23724 return false; 23725 } 23726 oldContainer.remove(); 23727 removeClass([document.documentElement, document.body], [swalClasses["no-backdrop"], swalClasses["toast-shown"], swalClasses["has-column"]]); 23728 return true; 23729}; 23730const resetValidationMessage$1 = () => { 23731 globalState.currentInstance.resetValidationMessage(); 23732}; 23733const addInputChangeListeners = () => { 23734 const popup = getPopup(); 23735 const input = getDirectChildByClass(popup, swalClasses.input); 23736 const file = getDirectChildByClass(popup, swalClasses.file); 23737 const range = popup.querySelector(`.${swalClasses.range} input`); 23738 const rangeOutput = popup.querySelector(`.${swalClasses.range} output`); 23739 const select = getDirectChildByClass(popup, swalClasses.select); 23740 const checkbox = popup.querySelector(`.${swalClasses.checkbox} input`); 23741 const textarea = getDirectChildByClass(popup, swalClasses.textarea); 23742 input.oninput = resetValidationMessage$1; 23743 file.onchange = resetValidationMessage$1; 23744 select.onchange = resetValidationMessage$1; 23745 checkbox.onchange = resetValidationMessage$1; 23746 textarea.oninput = resetValidationMessage$1; 23747 range.oninput = () => { 23748 resetValidationMessage$1(); 23749 rangeOutput.value = range.value; 23750 }; 23751 range.onchange = () => { 23752 resetValidationMessage$1(); 23753 rangeOutput.value = range.value; 23754 }; 23755}; 23756const getTarget = (target) => typeof target === "string" ? document.querySelector(target) : target; 23757const setupAccessibility = (params) => { 23758 const popup = getPopup(); 23759 popup.setAttribute("role", params.toast ? "alert" : "dialog"); 23760 popup.setAttribute("aria-live", params.toast ? "polite" : "assertive"); 23761 if (!params.toast) { 23762 popup.setAttribute("aria-modal", "true"); 23763 } 23764}; 23765const setupRTL = (targetElement) => { 23766 if (window.getComputedStyle(targetElement).direction === "rtl") { 23767 addClass(getContainer(), swalClasses.rtl); 23768 } 23769}; 23770const init$1 = (params) => { 23771 const oldContainerExisted = resetOldContainer(); 23772 if (isNodeEnv()) { 23773 error("SweetAlert2 requires document to initialize"); 23774 return; 23775 } 23776 const container = document.createElement("div"); 23777 container.className = swalClasses.container; 23778 if (oldContainerExisted) { 23779 addClass(container, swalClasses["no-transition"]); 23780 } 23781 setInnerHtml(container, sweetHTML); 23782 container.dataset["swal2Theme"] = params.theme; 23783 const targetElement = getTarget(params.target); 23784 targetElement.appendChild(container); 23785 if (params.topLayer) { 23786 container.setAttribute("popover", ""); 23787 container.showPopover(); 23788 } 23789 setupAccessibility(params); 23790 setupRTL(targetElement); 23791 addInputChangeListeners(); 23792}; 23793const parseHtmlToContainer = (param, target) => { 23794 if (param instanceof HTMLElement) { 23795 target.appendChild(param); 23796 } else if (typeof param === "object") { 23797 handleObject(param, target); 23798 } else if (param) { 23799 setInnerHtml(target, param); 23800 } 23801}; 23802const handleObject = (param, target) => { 23803 if (param.jquery) { 23804 handleJqueryElem(target, param); 23805 } else { 23806 setInnerHtml(target, param.toString()); 23807 } 23808}; 23809const handleJqueryElem = (target, elem) => { 23810 target.textContent = ""; 23811 if (0 in elem) { 23812 for (let i = 0; i in elem; i++) { 23813 target.appendChild(elem[i].cloneNode(true)); 23814 } 23815 } else { 23816 target.appendChild(elem.cloneNode(true)); 23817 } 23818}; 23819const renderActions = (instance, params) => { 23820 const actions = getActions(); 23821 const loader = getLoader(); 23822 if (!actions || !loader) { 23823 return; 23824 } 23825 if (!params.showConfirmButton && !params.showDenyButton && !params.showCancelButton) { 23826 hide(actions); 23827 } else { 23828 show(actions); 23829 } 23830 applyCustomClass(actions, params, "actions"); 23831 renderButtons(actions, loader, params); 23832 setInnerHtml(loader, params.loaderHtml || ""); 23833 applyCustomClass(loader, params, "loader"); 23834}; 23835function renderButtons(actions, loader, params) { 23836 const confirmButton = getConfirmButton(); 23837 const denyButton = getDenyButton(); 23838 const cancelButton = getCancelButton(); 23839 if (!confirmButton || !denyButton || !cancelButton) { 23840 return; 23841 } 23842 renderButton(confirmButton, "confirm", params); 23843 renderButton(denyButton, "deny", params); 23844 renderButton(cancelButton, "cancel", params); 23845 handleButtonsStyling(confirmButton, denyButton, cancelButton, params); 23846 if (params.reverseButtons) { 23847 if (params.toast) { 23848 actions.insertBefore(cancelButton, confirmButton); 23849 actions.insertBefore(denyButton, confirmButton); 23850 } else { 23851 actions.insertBefore(cancelButton, loader); 23852 actions.insertBefore(denyButton, loader); 23853 actions.insertBefore(confirmButton, loader); 23854 } 23855 } 23856} 23857function handleButtonsStyling(confirmButton, denyButton, cancelButton, params) { 23858 if (!params.buttonsStyling) { 23859 removeClass([confirmButton, denyButton, cancelButton], swalClasses.styled); 23860 return; 23861 } 23862 addClass([confirmButton, denyButton, cancelButton], swalClasses.styled); 23863 if (params.confirmButtonColor) { 23864 confirmButton.style.setProperty("--swal2-confirm-button-background-color", params.confirmButtonColor); 23865 } 23866 if (params.denyButtonColor) { 23867 denyButton.style.setProperty("--swal2-deny-button-background-color", params.denyButtonColor); 23868 } 23869 if (params.cancelButtonColor) { 23870 cancelButton.style.setProperty("--swal2-cancel-button-background-color", params.cancelButtonColor); 23871 } 23872 applyOutlineColor(confirmButton); 23873 applyOutlineColor(denyButton); 23874 applyOutlineColor(cancelButton); 23875} 23876function applyOutlineColor(button) { 23877 const buttonStyle = window.getComputedStyle(button); 23878 if (buttonStyle.getPropertyValue("--swal2-action-button-focus-box-sha
vendor: 5,954 bytes, lines 23878-24056
23878dow")) { 23879 return; 23880 } 23881 const outlineColor = buttonStyle.backgroundColor.replace(/rgba?\((\d+), (\d+), (\d+).*/, "rgba($1, $2, $3, 0.5)"); 23882 button.style.setProperty("--swal2-action-button-focus-box-shadow", buttonStyle.getPropertyValue("--swal2-outline").replace(/ rgba\(.*/, ` ${outlineColor}`)); 23883} 23884function renderButton(button, buttonType, params) { 23885 const buttonName = ( 23886 /** @type {'Confirm' | 'Deny' | 'Cancel'} */ 23887 capitalizeFirstLetter(buttonType) 23888 ); 23889 toggle(button, params[`show${buttonName}Button`], "inline-block"); 23890 setInnerHtml(button, params[`${buttonType}ButtonText`] || ""); 23891 button.setAttribute("aria-label", params[`${buttonType}ButtonAriaLabel`] || ""); 23892 button.className = swalClasses[buttonType]; 23893 applyCustomClass(button, params, `${buttonType}Button`); 23894} 23895const renderCloseButton = (instance, params) => { 23896 const closeButton = getCloseButton(); 23897 if (!closeButton) { 23898 return; 23899 } 23900 setInnerHtml(closeButton, params.closeButtonHtml || ""); 23901 applyCustomClass(closeButton, params, "closeButton"); 23902 toggle(closeButton, params.showCloseButton); 23903 closeButton.setAttribute("aria-label", params.closeButtonAriaLabel || ""); 23904}; 23905const renderContainer = (instance, params) => { 23906 const container = getContainer(); 23907 if (!container) { 23908 return; 23909 } 23910 handleBackdropParam(container, params.backdrop); 23911 handlePositionParam(container, params.position); 23912 handleGrowParam(container, params.grow); 23913 applyCustomClass(container, params, "container"); 23914}; 23915function handleBackdropParam(container, backdrop) { 23916 if (typeof backdrop === "string") { 23917 container.style.background = backdrop; 23918 } else if (!backdrop) { 23919 addClass([document.documentElement, document.body], swalClasses["no-backdrop"]); 23920 } 23921} 23922function handlePositionParam(container, position) { 23923 if (!position) { 23924 return; 23925 } 23926 if (position in swalClasses) { 23927 addClass(container, swalClasses[position]); 23928 } else { 23929 warn('The "position" parameter is not valid, defaulting to "center"'); 23930 addClass(container, swalClasses.center); 23931 } 23932} 23933function handleGrowParam(container, grow) { 23934 if (!grow) { 23935 return; 23936 } 23937 addClass(container, swalClasses[`grow-${grow}`]); 23938} 23939var privateProps = { 23940 innerParams: /* @__PURE__ */ new WeakMap(), 23941 domCache: /* @__PURE__ */ new WeakMap() 23942}; 23943const inputClasses = ["input", "file", "range", "select", "radio", "checkbox", "textarea"]; 23944const renderInput = (instance, params) => { 23945 const popup = getPopup(); 23946 if (!popup) { 23947 return; 23948 } 23949 const innerParams = privateProps.innerParams.get(instance); 23950 const rerender2 = !innerParams || params.input !== innerParams.input; 23951 inputClasses.forEach((inputClass) => { 23952 const inputContainer = getDirectChildByClass(popup, swalClasses[inputClass]); 23953 if (!inputContainer) { 23954 return; 23955 } 23956 setAttributes(inputClass, params.inputAttributes); 23957 inputContainer.className = swalClasses[inputClass]; 23958 if (rerender2) { 23959 hide(inputContainer); 23960 } 23961 }); 23962 if (params.input) { 23963 if (rerender2) { 23964 showInput(params); 23965 } 23966 setCustomClass(params); 23967 } 23968}; 23969const showInput = (params) => { 23970 if (!params.input) { 23971 return; 23972 } 23973 if (!renderInputType[params.input]) { 23974 error(`Unexpected type of input! Expected ${Object.keys(renderInputType).join(" | ")}, got "${params.input}"`); 23975 return; 23976 } 23977 const inputContainer = getInputContainer(params.input); 23978 if (!inputContainer) { 23979 return; 23980 } 23981 const input = renderInputType[params.input](inputContainer, params); 23982 show(inputContainer); 23983 if (params.inputAutoFocus) { 23984 setTimeout(() => { 23985 focusInput(input); 23986 }); 23987 } 23988}; 23989const removeAttributes = (input) => { 23990 for (let i = 0; i < input.attributes.length; i++) { 23991 const attrName = input.attributes[i].name; 23992 if (!["id", "type", "value", "style"].includes(attrName)) { 23993 input.removeAttribute(attrName); 23994 } 23995 } 23996}; 23997const setAttributes = (inputClass, inputAttributes) => { 23998 const popup = getPopup(); 23999 if (!popup) { 24000 return; 24001 } 24002 const input = getInput$1(popup, inputClass); 24003 if (!input) { 24004 return; 24005 } 24006 removeAttributes(input); 24007 for (const attr in inputAttributes) { 24008 input.setAttribute(attr, inputAttributes[attr]); 24009 } 24010}; 24011const setCustomClass = (params) => { 24012 if (!params.input) { 24013 return; 24014 } 24015 const inputContainer = getInputContainer(params.input); 24016 if (inputContainer) { 24017 applyCustomClass(inputContainer, params, "input"); 24018 } 24019}; 24020const setInputPlaceholder = (input, params) => { 24021 if (!input.placeholder && params.inputPlaceholder) { 24022 input.placeholder = params.inputPlaceholder; 24023 } 24024}; 24025const setInputLabel = (input, prependTo, params) => { 24026 if (params.inputLabel) { 24027 const label = document.createElement("label"); 24028 const labelClass = swalClasses["input-label"]; 24029 label.setAttribute("for", input.id); 24030 label.className = labelClass; 24031 if (typeof params.customClass === "object") { 24032 addClass(label, params.customClass.inputLabel); 24033 } 24034 label.innerText = params.inputLabel; 24035 prependTo.insertAdjacentElement("beforebegin", label); 24036 } 24037}; 24038const getInputContainer = (inputType) => { 24039 const popup = getPopup(); 24040 if (!popup) { 24041 return; 24042 } 24043 return getDirectChildByClass(popup, swalClasses[ 24044 /** @type {SwalClass} */ 24045 inputType 24046 ] || swalClasses.input); 24047}; 24048const checkAndSetInputValue = (input, inputValue) => { 24049 if (["string", "number"].includes(typeof inputValue)) { 24050 input.value = `${inputValue}`; 24051 } else if (!isPromise(inputValue)) { 24052 warn(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof inputValue}"`); 24053 } 24054}; 24055const renderInputType = {}; 24056renderInputType.text = renderInputType.email = renderInputType.password = renderInputType.number = renderInputType.tel = renderInputType.url = renderInputType.search = renderInputType.date = renderInputType["datetime-local"] = renderInputType.time = renderInputType.week = renderInputType.month = /** @type {(input: Input | HTMLElement, params: SweetAlertOptions) =>
vendor: 4,310 bytes, lines 24056-24185
24056 Input} */ 24057(input, params) => { 24058 checkAndSetInputValue(input, params.inputValue); 24059 setInputLabel(input, input, params); 24060 setInputPlaceholder(input, params); 24061 input.type = params.input; 24062 return input; 24063}; 24064renderInputType.file = (input, params) => { 24065 setInputLabel(input, input, params); 24066 setInputPlaceholder(input, params); 24067 return input; 24068}; 24069renderInputType.range = (range, params) => { 24070 const rangeInput = range.querySelector("input"); 24071 const rangeOutput = range.querySelector("output"); 24072 checkAndSetInputValue(rangeInput, params.inputValue); 24073 rangeInput.type = params.input; 24074 checkAndSetInputValue(rangeOutput, params.inputValue); 24075 setInputLabel(rangeInput, range, params); 24076 return range; 24077}; 24078renderInputType.select = (select, params) => { 24079 select.textContent = ""; 24080 if (params.inputPlaceholder) { 24081 const placeholder = document.createElement("option"); 24082 setInnerHtml(placeholder, params.inputPlaceholder); 24083 placeholder.value = ""; 24084 placeholder.disabled = true; 24085 placeholder.selected = true; 24086 select.appendChild(placeholder); 24087 } 24088 setInputLabel(select, select, params); 24089 return select; 24090}; 24091renderInputType.radio = (radio) => { 24092 radio.textContent = ""; 24093 return radio; 24094}; 24095renderInputType.checkbox = (checkboxContainer, params) => { 24096 const checkbox = getInput$1(getPopup(), "checkbox"); 24097 checkbox.value = "1"; 24098 checkbox.checked = Boolean(params.inputValue); 24099 const label = checkboxContainer.querySelector("span"); 24100 setInnerHtml(label, params.inputPlaceholder || params.inputLabel); 24101 return checkbox; 24102}; 24103renderInputType.textarea = (textarea, params) => { 24104 checkAndSetInputValue(textarea, params.inputValue); 24105 setInputPlaceholder(textarea, params); 24106 setInputLabel(textarea, textarea, params); 24107 const getMargin = (el) => parseInt(window.getComputedStyle(el).marginLeft) + parseInt(window.getComputedStyle(el).marginRight); 24108 setTimeout(() => { 24109 if ("MutationObserver" in window) { 24110 const initialPopupWidth = parseInt(window.getComputedStyle(getPopup()).width); 24111 const textareaResizeHandler = () => { 24112 if (!document.body.contains(textarea)) { 24113 return; 24114 } 24115 const textareaWidth = textarea.offsetWidth + getMargin(textarea); 24116 if (textareaWidth > initialPopupWidth) { 24117 getPopup().style.width = `${textareaWidth}px`; 24118 } else { 24119 applyNumericalStyle(getPopup(), "width", params.width); 24120 } 24121 }; 24122 new MutationObserver(textareaResizeHandler).observe(textarea, { 24123 attributes: true, 24124 attributeFilter: ["style"] 24125 }); 24126 } 24127 }); 24128 return textarea; 24129}; 24130const renderContent = (instance, params) => { 24131 const htmlContainer = getHtmlContainer(); 24132 if (!htmlContainer) { 24133 return; 24134 } 24135 showWhenInnerHtmlPresent(htmlContainer); 24136 applyCustomClass(htmlContainer, params, "htmlContainer"); 24137 if (params.html) { 24138 parseHtmlToContainer(params.html, htmlContainer); 24139 show(htmlContainer, "block"); 24140 } else if (params.text) { 24141 htmlContainer.textContent = params.text; 24142 show(htmlContainer, "block"); 24143 } else { 24144 hide(htmlContainer); 24145 } 24146 renderInput(instance, params); 24147}; 24148const renderFooter = (instance, params) => { 24149 const footer = getFooter(); 24150 if (!footer) { 24151 return; 24152 } 24153 showWhenInnerHtmlPresent(footer); 24154 toggle(footer, Boolean(params.footer), "block"); 24155 if (params.footer) { 24156 parseHtmlToContainer(params.footer, footer); 24157 } 24158 applyCustomClass(footer, params, "footer"); 24159}; 24160const renderIcon = (instance, params) => { 24161 const innerParams = privateProps.innerParams.get(instance); 24162 const icon = getIcon(); 24163 if (!icon) { 24164 return; 24165 } 24166 if (innerParams && params.icon === innerParams.icon) { 24167 setContent(icon, params); 24168 applyStyles(icon, params); 24169 return; 24170 } 24171 if (!params.icon && !params.iconHtml) { 24172 hide(icon); 24173 return; 24174 } 24175 if (params.icon && Object.keys(iconTypes).indexOf(params.icon) === -1) { 24176 error(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${params.icon}"`); 24177 hide(icon); 24178 return; 24179 } 24180 show(icon); 24181 setContent(icon, params); 24182 applyStyles(icon, params); 24183 addClass(icon, params.showClass && params.showClass.icon); 24184 const colorSchemeQueryList = window.matchMedia("(prefers-color-scheme: dark)"); 24185 colorSchemeQueryList.addEventListener("change", adjustSuccessIconBackgroun
vendor: 3,973 bytes, lines 24185-24298
24185dColor); 24186}; 24187const applyStyles = (icon, params) => { 24188 for (const [iconType, iconClassName] of Object.entries(iconTypes)) { 24189 if (params.icon !== iconType) { 24190 removeClass(icon, iconClassName); 24191 } 24192 } 24193 addClass(icon, params.icon && iconTypes[params.icon]); 24194 setColor(icon, params); 24195 adjustSuccessIconBackgroundColor(); 24196 applyCustomClass(icon, params, "icon"); 24197}; 24198const adjustSuccessIconBackgroundColor = () => { 24199 const popup = getPopup(); 24200 if (!popup) { 24201 return; 24202 } 24203 const popupBackgroundColor = window.getComputedStyle(popup).getPropertyValue("background-color"); 24204 const successIconParts = popup.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix"); 24205 for (let i = 0; i < successIconParts.length; i++) { 24206 successIconParts[i].style.backgroundColor = popupBackgroundColor; 24207 } 24208}; 24209const successIconHtml = (params) => ` 24210 ${params.animation ? '<div class="swal2-success-circular-line-left"></div>' : ""} 24211 <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span> 24212 <div class="swal2-success-ring"></div> 24213 ${params.animation ? '<div class="swal2-success-fix"></div>' : ""} 24214 ${params.animation ? '<div class="swal2-success-circular-line-right"></div>' : ""} 24215`; 24216const errorIconHtml = ` 24217 <span class="swal2-x-mark"> 24218 <span class="swal2-x-mark-line-left"></span> 24219 <span class="swal2-x-mark-line-right"></span> 24220 </span> 24221`; 24222const setContent = (icon, params) => { 24223 if (!params.icon && !params.iconHtml) { 24224 return; 24225 } 24226 let oldContent = icon.innerHTML; 24227 let newContent = ""; 24228 if (params.iconHtml) { 24229 newContent = iconContent(params.iconHtml); 24230 } else if (params.icon === "success") { 24231 newContent = successIconHtml(params); 24232 oldContent = oldContent.replace(/ style=".*?"/g, ""); 24233 } else if (params.icon === "error") { 24234 newContent = errorIconHtml; 24235 } else if (params.icon) { 24236 const defaultIconHtml = { 24237 question: "?", 24238 warning: "!", 24239 info: "i" 24240 }; 24241 newContent = iconContent(defaultIconHtml[params.icon]); 24242 } 24243 if (oldContent.trim() !== newContent.trim()) { 24244 setInnerHtml(icon, newContent); 24245 } 24246}; 24247const setColor = (icon, params) => { 24248 if (!params.iconColor) { 24249 return; 24250 } 24251 icon.style.color = params.iconColor; 24252 icon.style.borderColor = params.iconColor; 24253 for (const sel of [".swal2-success-line-tip", ".swal2-success-line-long", ".swal2-x-mark-line-left", ".swal2-x-mark-line-right"]) { 24254 setStyle(icon, sel, "background-color", params.iconColor); 24255 } 24256 setStyle(icon, ".swal2-success-ring", "border-color", params.iconColor); 24257}; 24258const iconContent = (content) => `<div class="${swalClasses["icon-content"]}">${content}</div>`; 24259const renderImage = (instance, params) => { 24260 const image = getImage(); 24261 if (!image) { 24262 return; 24263 } 24264 if (!params.imageUrl) { 24265 hide(image); 24266 return; 24267 } 24268 show(image, ""); 24269 image.setAttribute("src", params.imageUrl); 24270 image.setAttribute("alt", params.imageAlt || ""); 24271 applyNumericalStyle(image, "width", params.imageWidth); 24272 applyNumericalStyle(image, "height", params.imageHeight); 24273 image.className = swalClasses.image; 24274 applyCustomClass(image, params, "image"); 24275}; 24276let dragging = false; 24277let mousedownX = 0; 24278let mousedownY = 0; 24279let initialX = 0; 24280let initialY = 0; 24281const addDraggableListeners = (popup) => { 24282 popup.addEventListener("mousedown", down); 24283 document.body.addEventListener("mousemove", move); 24284 popup.addEventListener("mouseup", up); 24285 popup.addEventListener("touchstart", down); 24286 document.body.addEventListener("touchmove", move); 24287 popup.addEventListener("touchend", up); 24288}; 24289const removeDraggableListeners = (popup) => { 24290 popup.removeEventListener("mousedown", down); 24291 document.body.removeEventListener("mousemove", move); 24292 popup.removeEventListener("mouseup", up); 24293 popup.removeEventListener("touchstart", down); 24294 document.body.removeEventListener("touchmove", move); 24295 popup.removeEventListener("touchend", up); 24296}; 24297const down = (event) => { 24298 const popup = getPopup();
vendor: 21,522 bytes, lines 24299-24950
24299 if (event.target === popup || getIcon().contains( 24300 /** @type {HTMLElement} */ 24301 event.target 24302 )) { 24303 dragging = true; 24304 const clientXY = getClientXY(event); 24305 mousedownX = clientXY.clientX; 24306 mousedownY = clientXY.clientY; 24307 initialX = parseInt(popup.style.insetInlineStart) || 0; 24308 initialY = parseInt(popup.style.insetBlockStart) || 0; 24309 addClass(popup, "swal2-dragging"); 24310 } 24311}; 24312const move = (event) => { 24313 const popup = getPopup(); 24314 if (dragging) { 24315 let { 24316 clientX, 24317 clientY 24318 } = getClientXY(event); 24319 popup.style.insetInlineStart = `${initialX + (clientX - mousedownX)}px`; 24320 popup.style.insetBlockStart = `${initialY + (clientY - mousedownY)}px`; 24321 } 24322}; 24323const up = () => { 24324 const popup = getPopup(); 24325 dragging = false; 24326 removeClass(popup, "swal2-dragging"); 24327}; 24328const getClientXY = (event) => { 24329 let clientX = 0, clientY = 0; 24330 if (event.type.startsWith("mouse")) { 24331 clientX = /** @type {MouseEvent} */ 24332 event.clientX; 24333 clientY = /** @type {MouseEvent} */ 24334 event.clientY; 24335 } else if (event.type.startsWith("touch")) { 24336 clientX = /** @type {TouchEvent} */ 24337 event.touches[0].clientX; 24338 clientY = /** @type {TouchEvent} */ 24339 event.touches[0].clientY; 24340 } 24341 return { 24342 clientX, 24343 clientY 24344 }; 24345}; 24346const renderPopup = (instance, params) => { 24347 const container = getContainer(); 24348 const popup = getPopup(); 24349 if (!container || !popup) { 24350 return; 24351 } 24352 if (params.toast) { 24353 applyNumericalStyle(container, "width", params.width); 24354 popup.style.width = "100%"; 24355 const loader = getLoader(); 24356 if (loader) { 24357 popup.insertBefore(loader, getIcon()); 24358 } 24359 } else { 24360 applyNumericalStyle(popup, "width", params.width); 24361 } 24362 applyNumericalStyle(popup, "padding", params.padding); 24363 if (params.color) { 24364 popup.style.color = params.color; 24365 } 24366 if (params.background) { 24367 popup.style.background = params.background; 24368 } 24369 hide(getValidationMessage()); 24370 addClasses$1(popup, params); 24371 if (params.draggable && !params.toast) { 24372 addClass(popup, swalClasses.draggable); 24373 addDraggableListeners(popup); 24374 } else { 24375 removeClass(popup, swalClasses.draggable); 24376 removeDraggableListeners(popup); 24377 } 24378}; 24379const addClasses$1 = (popup, params) => { 24380 const showClass = params.showClass || {}; 24381 popup.className = `${swalClasses.popup} ${isVisible$1(popup) ? showClass.popup : ""}`; 24382 if (params.toast) { 24383 addClass([document.documentElement, document.body], swalClasses["toast-shown"]); 24384 addClass(popup, swalClasses.toast); 24385 } else { 24386 addClass(popup, swalClasses.modal); 24387 } 24388 applyCustomClass(popup, params, "popup"); 24389 if (typeof params.customClass === "string") { 24390 addClass(popup, params.customClass); 24391 } 24392 if (params.icon) { 24393 addClass(popup, swalClasses[`icon-${params.icon}`]); 24394 } 24395}; 24396const renderProgressSteps = (instance, params) => { 24397 const progressStepsContainer = getProgressSteps(); 24398 if (!progressStepsContainer) { 24399 return; 24400 } 24401 const { 24402 progressSteps, 24403 currentProgressStep 24404 } = params; 24405 if (!progressSteps || progressSteps.length === 0 || currentProgressStep === void 0) { 24406 hide(progressStepsContainer); 24407 return; 24408 } 24409 show(progressStepsContainer); 24410 progressStepsContainer.textContent = ""; 24411 if (currentProgressStep >= progressSteps.length) { 24412 warn("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"); 24413 } 24414 progressSteps.forEach((step, index) => { 24415 const stepEl = createStepElement(step); 24416 progressStepsContainer.appendChild(stepEl); 24417 if (index === currentProgressStep) { 24418 addClass(stepEl, swalClasses["active-progress-step"]); 24419 } 24420 if (index !== progressSteps.length - 1) { 24421 const lineEl = createLineElement(params); 24422 progressStepsContainer.appendChild(lineEl); 24423 } 24424 }); 24425}; 24426const createStepElement = (step) => { 24427 const stepEl = document.createElement("li"); 24428 addClass(stepEl, swalClasses["progress-step"]); 24429 setInnerHtml(stepEl, step); 24430 return stepEl; 24431}; 24432const createLineElement = (params) => { 24433 const lineEl = document.createElement("li"); 24434 addClass(lineEl, swalClasses["progress-step-line"]); 24435 if (params.progressStepsDistance) { 24436 applyNumericalStyle(lineEl, "width", params.progressStepsDistance); 24437 } 24438 return lineEl; 24439}; 24440const renderTitle = (instance, params) => { 24441 const title = getTitle(); 24442 if (!title) { 24443 return; 24444 } 24445 showWhenInnerHtmlPresent(title); 24446 toggle(title, Boolean(params.title || params.titleText), "block"); 24447 if (params.title) { 24448 parseHtmlToContainer(params.title, title); 24449 } 24450 if (params.titleText) { 24451 title.innerText = params.titleText; 24452 } 24453 applyCustomClass(title, params, "title"); 24454}; 24455const render = (instance, params) => { 24456 renderPopup(instance, params); 24457 renderContainer(instance, params); 24458 renderProgressSteps(instance, params); 24459 renderIcon(instance, params); 24460 renderImage(instance, params); 24461 renderTitle(instance, params); 24462 renderCloseButton(instance, params); 24463 renderContent(instance, params); 24464 renderActions(instance, params); 24465 renderFooter(instance, params); 24466 const popup = getPopup(); 24467 if (typeof params.didRender === "function" && popup) { 24468 params.didRender(popup); 24469 } 24470 globalState.eventEmitter.emit("didRender", popup); 24471}; 24472const isVisible = () => { 24473 return isVisible$1(getPopup()); 24474}; 24475const clickConfirm = () => { 24476 var _dom$getConfirmButton; 24477 return (_dom$getConfirmButton = getConfirmButton()) === null || _dom$getConfirmButton === void 0 ? void 0 : _dom$getConfirmButton.click(); 24478}; 24479const clickDeny = () => { 24480 var _dom$getDenyButton; 24481 return (_dom$getDenyButton = getDenyButton()) === null || _dom$getDenyButton === void 0 ? void 0 : _dom$getDenyButton.click(); 24482}; 24483const clickCancel = () => { 24484 var _dom$getCancelButton; 24485 return (_dom$getCancelButton = getCancelButton()) === null || _dom$getCancelButton === void 0 ? void 0 : _dom$getCancelButton.click(); 24486}; 24487const DismissReason = Object.freeze({ 24488 cancel: "cancel", 24489 backdrop: "backdrop", 24490 close: "close", 24491 esc: "esc", 24492 timer: "timer" 24493}); 24494const removeKeydownHandler = (globalState2) => { 24495 if (globalState2.keydownTarget && globalState2.keydownHandlerAdded) { 24496 globalState2.keydownTarget.removeEventListener("keydown", globalState2.keydownHandler, { 24497 capture: globalState2.keydownListenerCapture 24498 }); 24499 globalState2.keydownHandlerAdded = false; 24500 } 24501}; 24502const addKeydownHandler = (globalState2, innerParams, dismissWith) => { 24503 removeKeydownHandler(globalState2); 24504 if (!innerParams.toast) { 24505 globalState2.keydownHandler = (e) => keydownHandler(innerParams, e, dismissWith); 24506 globalState2.keydownTarget = innerParams.keydownListenerCapture ? window : getPopup(); 24507 globalState2.keydownListenerCapture = innerParams.keydownListenerCapture; 24508 globalState2.keydownTarget.addEventListener("keydown", globalState2.keydownHandler, { 24509 capture: globalState2.keydownListenerCapture 24510 }); 24511 globalState2.keydownHandlerAdded = true; 24512 } 24513}; 24514const setFocus = (index, increment) => { 24515 var _dom$getPopup; 24516 const focusableElements = getFocusableElements(); 24517 if (focusableElements.length) { 24518 index = index + increment; 24519 if (index === -2) { 24520 index = focusableElements.length - 1; 24521 } 24522 if (index === focusableElements.length) { 24523 index = 0; 24524 } else if (index === -1) { 24525 index = focusableElements.length - 1; 24526 } 24527 focusableElements[index].focus(); 24528 return; 24529 } 24530 (_dom$getPopup = getPopup()) === null || _dom$getPopup === void 0 || _dom$getPopup.focus(); 24531}; 24532const arrowKeysNextButton = ["ArrowRight", "ArrowDown"]; 24533const arrowKeysPreviousButton = ["ArrowLeft", "ArrowUp"]; 24534const keydownHandler = (innerParams, event, dismissWith) => { 24535 if (!innerParams) { 24536 return; 24537 } 24538 if (event.isComposing || event.keyCode === 229) { 24539 return; 24540 } 24541 if (innerParams.stopKeydownPropagation) { 24542 event.stopPropagation(); 24543 } 24544 if (event.key === "Enter") { 24545 handleEnter(event, innerParams); 24546 } else if (event.key === "Tab") { 24547 handleTab(event); 24548 } else if ([...arrowKeysNextButton, ...arrowKeysPreviousButton].includes(event.key)) { 24549 handleArrows(event.key); 24550 } else if (event.key === "Escape") { 24551 handleEsc(event, innerParams, dismissWith); 24552 } 24553}; 24554const handleEnter = (event, innerParams) => { 24555 if (!callIfFunction(innerParams.allowEnterKey)) { 24556 return; 24557 } 24558 const input = getInput$1(getPopup(), innerParams.input); 24559 if (event.target && input && event.target instanceof HTMLElement && event.target.outerHTML === input.outerHTML) { 24560 if (["textarea", "file"].includes(innerParams.input)) { 24561 return; 24562 } 24563 clickConfirm(); 24564 event.preventDefault(); 24565 } 24566}; 24567const handleTab = (event) => { 24568 const targetElement = event.target; 24569 const focusableElements = getFocusableElements(); 24570 let btnIndex = -1; 24571 for (let i = 0; i < focusableElements.length; i++) { 24572 if (targetElement === focusableElements[i]) { 24573 btnIndex = i; 24574 break; 24575 } 24576 } 24577 if (!event.shiftKey) { 24578 setFocus(btnIndex, 1); 24579 } else { 24580 setFocus(btnIndex, -1); 24581 } 24582 event.stopPropagation(); 24583 event.preventDefault(); 24584}; 24585const handleArrows = (key) => { 24586 const actions = getActions(); 24587 const confirmButton = getConfirmButton(); 24588 const denyButton = getDenyButton(); 24589 const cancelButton = getCancelButton(); 24590 if (!actions || !confirmButton || !denyButton || !cancelButton) { 24591 return; 24592 } 24593 const buttons = [confirmButton, denyButton, cancelButton]; 24594 if (document.activeElement instanceof HTMLElement && !buttons.includes(document.activeElement)) { 24595 return; 24596 } 24597 const sibling = arrowKeysNextButton.includes(key) ? "nextElementSibling" : "previousElementSibling"; 24598 let buttonToFocus = document.activeElement; 24599 if (!buttonToFocus) { 24600 return; 24601 } 24602 for (let i = 0; i < actions.children.length; i++) { 24603 buttonToFocus = buttonToFocus[sibling]; 24604 if (!buttonToFocus) { 24605 return; 24606 } 24607 if (buttonToFocus instanceof HTMLButtonElement && isVisible$1(buttonToFocus)) { 24608 break; 24609 } 24610 } 24611 if (buttonToFocus instanceof HTMLButtonElement) { 24612 buttonToFocus.focus(); 24613 } 24614}; 24615const handleEsc = (event, innerParams, dismissWith) => { 24616 event.preventDefault(); 24617 if (callIfFunction(innerParams.allowEscapeKey)) { 24618 dismissWith(DismissReason.esc); 24619 } 24620}; 24621var privateMethods = { 24622 swalPromiseResolve: /* @__PURE__ */ new WeakMap(), 24623 swalPromiseReject: /* @__PURE__ */ new WeakMap() 24624}; 24625const setAriaHidden = () => { 24626 const container = getContainer(); 24627 const bodyChildren = Array.from(document.body.children); 24628 bodyChildren.forEach((el) => { 24629 if (el.contains(container)) { 24630 return; 24631 } 24632 if (el.hasAttribute("aria-hidden")) { 24633 el.setAttribute("data-previous-aria-hidden", el.getAttribute("aria-hidden") || ""); 24634 } 24635 el.setAttribute("aria-hidden", "true"); 24636 }); 24637}; 24638const unsetAriaHidden = () => { 24639 const bodyChildren = Array.from(document.body.children); 24640 bodyChildren.forEach((el) => { 24641 if (el.hasAttribute("data-previous-aria-hidden")) { 24642 el.setAttribute("aria-hidden", el.getAttribute("data-previous-aria-hidden") || ""); 24643 el.removeAttribute("data-previous-aria-hidden"); 24644 } else { 24645 el.removeAttribute("aria-hidden"); 24646 } 24647 }); 24648}; 24649const isSafariOrIOS = typeof window !== "undefined" && !!window.GestureEvent; 24650const iOSfix = () => { 24651 if (isSafariOrIOS && !hasClass(document.body, swalClasses.iosfix)) { 24652 const offset = document.body.scrollTop; 24653 document.body.style.top = `${offset * -1}px`; 24654 addClass(document.body, swalClasses.iosfix); 24655 lockBodyScroll(); 24656 } 24657}; 24658const lockBodyScroll = () => { 24659 const container = getContainer(); 24660 if (!container) { 24661 return; 24662 } 24663 let preventTouchMove; 24664 container.ontouchstart = (event) => { 24665 preventTouchMove = shouldPreventTouchMove(event); 24666 }; 24667 container.ontouchmove = (event) => { 24668 if (preventTouchMove) { 24669 event.preventDefault(); 24670 event.stopPropagation(); 24671 } 24672 }; 24673}; 24674const shouldPreventTouchMove = (event) => { 24675 const target = event.target; 24676 const container = getContainer(); 24677 const htmlContainer = getHtmlContainer(); 24678 if (!container || !htmlContainer) { 24679 return false; 24680 } 24681 if (isStylus(event) || isZoom(event)) { 24682 return false; 24683 } 24684 if (target === container) { 24685 return true; 24686 } 24687 if (!isScrollable(container) && target instanceof HTMLElement && !selfOrParentIsScrollable(target, htmlContainer) && // #2823 24688 target.tagName !== "INPUT" && // #1603 24689 target.tagName !== "TEXTAREA" && // #2266 24690 !(isScrollable(htmlContainer) && // #1944 24691 htmlContainer.contains(target))) { 24692 return true; 24693 } 24694 return false; 24695}; 24696const isStylus = (event) => { 24697 return event.touches && event.touches.length && event.touches[0].touchType === "stylus"; 24698}; 24699const isZoom = (event) => { 24700 return event.touches && event.touches.length > 1; 24701}; 24702const undoIOSfix = () => { 24703 if (hasClass(document.body, swalClasses.iosfix)) { 24704 const offset = parseInt(document.body.style.top, 10); 24705 removeClass(document.body, swalClasses.iosfix); 24706 document.body.style.top = ""; 24707 document.body.scrollTop = offset * -1; 24708 } 24709}; 24710const measureScrollbar = () => { 24711 const scrollDiv = document.createElement("div"); 24712 scrollDiv.className = swalClasses["scrollbar-measure"]; 24713 document.body.appendChild(scrollDiv); 24714 const scrollbarWidth = scrollDiv.getBoundingClientRect().width - scrollDiv.clientWidth; 24715 document.body.removeChild(scrollDiv); 24716 return scrollbarWidth; 24717}; 24718let previousBodyPadding = null; 24719const replaceScrollbarWithPadding = (initialBodyOverflow) => { 24720 if (previousBodyPadding !== null) { 24721 return; 24722 } 24723 if (document.body.scrollHeight > window.innerHeight || initialBodyOverflow === "scroll") { 24724 previousBodyPadding = parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")); 24725 document.body.style.paddingRight = `${previousBodyPadding + measureScrollbar()}px`; 24726 } 24727}; 24728const undoReplaceScrollbarWithPadding = () => { 24729 if (previousBodyPadding !== null) { 24730 document.body.style.paddingRight = `${previousBodyPadding}px`; 24731 previousBodyPadding = null; 24732 } 24733}; 24734function removePopupAndResetState(instance, container, returnFocus, didClose) { 24735 if (isToast()) { 24736 triggerDidCloseAndDispose(instance, didClose); 24737 } else { 24738 restoreActiveElement(returnFocus).then(() => triggerDidCloseAndDispose(instance, didClose)); 24739 removeKeydownHandler(globalState); 24740 } 24741 if (isSafariOrIOS) { 24742 container.setAttribute("style", "display:none !important"); 24743 container.removeAttribute("class"); 24744 container.innerHTML = ""; 24745 } else { 24746 container.remove(); 24747 } 24748 if (isModal()) { 24749 undoReplaceScrollbarWithPadding(); 24750 undoIOSfix(); 24751 unsetAriaHidden(); 24752 } 24753 removeBodyClasses(); 24754} 24755function removeBodyClasses() { 24756 removeClass([document.documentElement, document.body], [swalClasses.shown, swalClasses["height-auto"], swalClasses["no-backdrop"], swalClasses["toast-shown"]]); 24757} 24758function close(resolveValue2) { 24759 resolveValue2 = prepareResolveValue(resolveValue2); 24760 const swalPromiseResolve = privateMethods.swalPromiseResolve.get(this); 24761 const didClose = triggerClosePopup(this); 24762 if (this.isAwaitingPromise) { 24763 if (!resolveValue2.isDismissed) { 24764 handleAwaitingPromise(this); 24765 swalPromiseResolve(resolveValue2); 24766 } 24767 } else if (didClose) { 24768 swalPromiseResolve(resolveValue2); 24769 } 24770} 24771const triggerClosePopup = (instance) => { 24772 const popup = getPopup(); 24773 if (!popup) { 24774 return false; 24775 } 24776 const innerParams = privateProps.innerParams.get(instance); 24777 if (!innerParams || hasClass(popup, innerParams.hideClass.popup)) { 24778 return false; 24779 } 24780 removeClass(popup, innerParams.showClass.popup); 24781 addClass(popup, innerParams.hideClass.popup); 24782 const backdrop = getContainer(); 24783 removeClass(backdrop, innerParams.showClass.backdrop); 24784 addClass(backdrop, innerParams.hideClass.backdrop); 24785 handlePopupAnimation(instance, popup, innerParams); 24786 return true; 24787}; 24788function rejectPromise(error2) { 24789 const rejectPromise2 = privateMethods.swalPromiseReject.get(this); 24790 handleAwaitingPromise(this); 24791 if (rejectPromise2) { 24792 rejectPromise2(error2); 24793 } 24794} 24795const handleAwaitingPromise = (instance) => { 24796 if (instance.isAwaitingPromise) { 24797 delete instance.isAwaitingPromise; 24798 if (!privateProps.innerParams.get(instance)) { 24799 instance._destroy(); 24800 } 24801 } 24802}; 24803const prepareResolveValue = (resolveValue2) => { 24804 if (typeof resolveValue2 === "undefined") { 24805 return { 24806 isConfirmed: false, 24807 isDenied: false, 24808 isDismissed: true 24809 }; 24810 } 24811 return Object.assign({ 24812 isConfirmed: false, 24813 isDenied: false, 24814 isDismissed: false 24815 }, resolveValue2); 24816}; 24817const handlePopupAnimation = (instance, popup, innerParams) => { 24818 var _globalState$eventEmi; 24819 const container = getContainer(); 24820 const animationIsSupported = hasCssAnimation(popup); 24821 if (typeof innerParams.willClose === "function") { 24822 innerParams.willClose(popup); 24823 } 24824 (_globalState$eventEmi = globalState.eventEmitter) === null || _globalState$eventEmi === void 0 || _globalState$eventEmi.emit("willClose", popup); 24825 if (animationIsSupported) { 24826 animatePopup(instance, popup, container, innerParams.returnFocus, innerParams.didClose); 24827 } else { 24828 removePopupAndResetState(instance, container, innerParams.returnFocus, innerParams.didClose); 24829 } 24830}; 24831const animatePopup = (instance, popup, container, returnFocus, didClose) => { 24832 globalState.swalCloseEventFinishedCallback = removePopupAndResetState.bind(null, instance, container, returnFocus, didClose); 24833 const swalCloseAnimationFinished = function(e) { 24834 if (e.target === popup) { 24835 var _globalState$swalClos; 24836 (_globalState$swalClos = globalState.swalCloseEventFinishedCallback) === null || _globalState$swalClos === void 0 || _globalState$swalClos.call(globalState); 24837 delete globalState.swalCloseEventFinishedCallback; 24838 popup.removeEventListener("animationend", swalCloseAnimationFinished); 24839 popup.removeEventListener("transitionend", swalCloseAnimationFinished); 24840 } 24841 }; 24842 popup.addEventListener("animationend", swalCloseAnimationFinished); 24843 popup.addEventListener("transitionend", swalCloseAnimationFinished); 24844}; 24845const triggerDidCloseAndDispose = (instance, didClose) => { 24846 setTimeout(() => { 24847 var _globalState$eventEmi2; 24848 if (typeof didClose === "function") { 24849 didClose.bind(instance.params)(); 24850 } 24851 (_globalState$eventEmi2 = globalState.eventEmitter) === null || _globalState$eventEmi2 === void 0 || _globalState$eventEmi2.emit("didClose"); 24852 if (instance._destroy) { 24853 instance._destroy(); 24854 } 24855 }); 24856}; 24857const showLoading = (buttonToReplace) => { 24858 let popup = getPopup(); 24859 if (!popup) { 24860 new Swal(); 24861 } 24862 popup = getPopup(); 24863 if (!popup) { 24864 return; 24865 } 24866 const loader = getLoader(); 24867 if (isToast()) { 24868 hide(getIcon()); 24869 } else { 24870 replaceButton(popup, buttonToReplace); 24871 } 24872 show(loader); 24873 popup.setAttribute("data-loading", "true"); 24874 popup.setAttribute("aria-busy", "true"); 24875 popup.focus(); 24876}; 24877const replaceButton = (popup, buttonToReplace) => { 24878 const actions = getActions(); 24879 const loader = getLoader(); 24880 if (!actions || !loader) { 24881 return; 24882 } 24883 if (!buttonToReplace && isVisible$1(getConfirmButton())) { 24884 buttonToReplace = getConfirmButton(); 24885 } 24886 show(actions); 24887 if (buttonToReplace) { 24888 hide(buttonToReplace); 24889 loader.setAttribute("data-button-to-replace", buttonToReplace.className); 24890 actions.insertBefore(loader, buttonToReplace); 24891 } 24892 addClass([popup, actions], swalClasses.loading); 24893}; 24894const handleInputOptionsAndValue = (instance, params) => { 24895 if (params.input === "select" || params.input === "radio") { 24896 handleInputOptions(instance, params); 24897 } else if (["text", "email", "number", "tel", "textarea"].some((i) => i === params.input) && (hasToPromiseFn(params.inputValue) || isPromise(params.inputValue))) { 24898 showLoading(getConfirmButton()); 24899 handleInputValue(instance, params); 24900 } 24901}; 24902const getInputValue = (instance, innerParams) => { 24903 const input = instance.getInput(); 24904 if (!input) { 24905 return null; 24906 } 24907 switch (innerParams.input) { 24908 case "checkbox": 24909 return getCheckboxValue(input); 24910 case "radio": 24911 return getRadioValue(input); 24912 case "file": 24913 return getFileValue(input); 24914 default: 24915 return innerParams.inputAutoTrim ? input.value.trim() : input.value; 24916 } 24917}; 24918const getCheckboxValue = (input) => input.checked ? 1 : 0; 24919const getRadioValue = (input) => input.checked ? input.value : null; 24920const getFileValue = (input) => input.files && input.files.length ? input.getAttribute("multiple") !== null ? input.files : input.files[0] : null; 24921const handleInputOptions = (instance, params) => { 24922 const popup = getPopup(); 24923 if (!popup) { 24924 return; 24925 } 24926 const processInputOptions = (inputOptions) => { 24927 if (params.input === "select") { 24928 populateSelectOptions(popup, formatInputOptions(inputOptions), params); 24929 } else if (params.input === "radio") { 24930 populateRadioOptions(popup, formatInputOptions(inputOptions), params); 24931 } 24932 }; 24933 if (hasToPromiseFn(params.inputOptions) || isPromise(params.inputOptions)) { 24934 showLoading(getConfirmButton()); 24935 asPromise(params.inputOptions).then((inputOptions) => { 24936 instance.hideLoading(); 24937 processInputOptions(inputOptions); 24938 }); 24939 } else if (typeof params.inputOptions === "object") { 24940 processInputOptions(params.inputOptions); 24941 } else { 24942 error(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof params.inputOptions}`); 24943 } 24944}; 24945const handleInputValue = (instance, params) => { 24946 const input = instance.getInput(); 24947 if (!input) { 24948 return; 24949 } 24950 hide(input);
24951 asPromise(params.inputValue).then((inputValue) => { 24952 input.value = params.input === "number" ? `${parseFloat(inputValue) || 0}` : `${inputValue}`; 24953 show(input); 24954 input.focus(); 24955 instance.hideLoading(); 24956 }).catch((err) => { 24957 error(`Error in inputValue promise: ${err}`); 24958 input.value = ""; 24959 show(input); 24960 input.focus(); 24961 instance.hideLoading(); 24962 }); 24963}; 24964function populateSelectOptions(popup, inputOptions, params) { 24965 const select = getDirectChildByClass(popup, swalClasses.select); 24966 if (!select) { 24967 return; 24968 } 24969 const renderOption = (parent, optionLabel, optionValue) => { 24970 const option = document.createElement("option"); 24971 option.value = optionValue; 24972 setInnerHtml(option, optionLabel); 24973 option.selected = isSelected(optionValue, params.inputValue); 24974 parent.appendChild(option); 24975 }; 24976 inputOptions.forEach((inputOption) => { 24977 const optionValue = inputOption[0]; 24978 const optionLabel = inputOption[1]; 24979 if (Array.isArray(optionLabel)) { 24980 const optgroup = document.createElement("optgroup"); 24981 optgroup.label = optionValue; 24982 optgroup.disabled = false; 24983 select.appendChild(optgroup); 24984 optionLabel.forEach((o) => renderOption(optgroup, o[1], o[0])); 24985 } else { 24986 renderOption(select, optionLabel, optionValue); 24987 } 24988 }); 24989 select.focus(); 24990} 24991function populateRadioOptions(popup, inputOptions, params) { 24992 const radio = getDirectChildByClass(popup, swalClasses.radio); 24993 if (!radio) { 24994 return; 24995 } 24996 inputOptions.forEach((inputOption) => { 24997 const radioValue = inputOption[0]; 24998 const radioLabel = inputOption[1]; 24999 const radioInput = document.createElement("input"); 25000 const radioLabelElement = document.createElement("label"); 25001 radioInput.type = "radio"; 25002 radioInput.name = swalClasses.radio; 25003 radioInput.value = radioValue; 25004 if (isSelected(radioValue, params.inputValue)) { 25005 radioInput.checked = true; 25006 } 25007 const label = document.createElement("span"); 25008 setInnerHtml(label, radioLabel); 25009 label.className = swalClasses.label; 25010 radioLabelElement.appendChild(radioInput); 25011 radioLabelElement.appendChild(label); 25012 radio.appendChild(radioLabelElement); 25013 }); 25014 const radios = radio.querySelectorAll("input"); 25015 if (radios.length) { 25016 radios[0].focus(); 25017 } 25018} 25019const formatInputOptions = (inputOptions) => { 25020 const result = []; 25021 if (inputOptions instanceof Map) { 25022 inputOptions.forEach((value, key) => { 25023 let valueFormatted = value; 25024 if (typeof valueFormatted === "object") { 25025 valueFormatted = formatInputOptions(valueFormatted); 25026 } 25027 result.push([key, valueFormatted]); 25028 }); 25029 } else { 25030 Object.keys(inputOptions).forEach((key) => { 25031 let valueFormatted = inputOptions[key]; 25032 if (typeof valueFormatted === "object") { 25033 valueFormatted = formatInputOptions(valueFormatted); 25034 } 25035 result.push([key, valueFormatted]); 25036 }); 25037 } 25038 return result; 25039}; 25040const isSelected = (optionValue, inputValue) => { 25041 return !!inputValue && inputValue.toString() === optionValue.toString(); 25042}; 25043const handleConfirmButtonClick = (instance) => { 25044 const innerParams = privateProps.innerParams.get(instance); 25045 instance.disableButtons(); 25046 if (innerParams.input) { 25047 handleConfirmOrDenyWithInput(instance, "confirm"); 25048 } else { 25049 confirm(instance, true); 25050 } 25051}; 25052const handleDenyButtonClick = (instance) => { 25053 const innerParams = privateProps.innerParams.get(instance); 25054 instance.disableButtons(); 25055 if (innerParams.returnInputValueOnDeny) { 25056 handleConfirmOrDenyWithInput(instance, "deny"); 25057 } else { 25058 deny(instance, false); 25059 } 25060}; 25061const handleCancelButtonClick = (instance, dismissWith) => { 25062 instance.disableButtons(); 25063 dismissWith(DismissReason.cancel); 25064}; 25065const handleConfirmOrDenyWithInput = (instance, type) => { 25066 const innerParams = privateProps.innerParams.get(instance); 25067 if (!innerParams.input) { 25068 error(`The "input" parameter is needed to be set when using returnInputValueOn${capitalizeFirstLetter(type)}`); 25069 return; 25070 } 25071 const input = instance.getInput(); 25072 const inputValue = getInputValue(instance, innerParams); 25073 if (innerParams.inputValidator) { 25074 handleInputValidator(instance, inputValue, type); 25075 } else if (input && !input.checkValidity()) { 25076 instance.enableButtons(); 25077 instance.showValidationMessage(innerParams.validationMessage || input.validationMessage); 25078 } else if (type === "deny") { 25079 deny(instance, inputValue); 25080 } else { 25081 confirm(instance, inputValue); 25082 } 25083}; 25084const handleInputValidator = (instance, inputValue, type) => { 25085 const innerParams = privateProps.innerParams.get(instance); 25086 instance.disableInput(); 25087 const validationPromise = Promise.resolve().then(() => asPromise(innerParams.inputValidator(inputValue, innerParams.validationMessage))); 25088 validationPromise.then((validationMessage) => { 25089 instance.enableButtons(); 25090 instance.enableInput(); 25091 if (validationMessage) { 25092 instance.showValidationMessage(validationMessage); 25093 } else if (type === "deny") { 25094 deny(instance, inputValue); 25095 } else { 25096 confirm(instance, inputValue); 25097 } 25098 }); 25099}; 25100const deny = (instance, value) => { 25101 const innerParams = privateProps.innerParams.get(instance || void 0); 25102 if (innerParams.showLoaderOnDeny) { 25103 showLoading(getDenyButton()); 25104 } 25105 if (innerParams.preDeny) { 25106 instance.isAwaitingPromise = true; 25107 const preDenyPromise = Promise.resolve().then(() => asPromise(innerParams.preDeny(value, innerParams.validationMessage))); 25108 preDenyPromise.then((preDenyValue) => { 25109 if (preDenyValue === false) { 25110 instance.hideLoading(); 25111 handleAwaitingPromise(instance); 25112 } else { 25113 instance.close( 25114 /** @type SweetAlertResult */ 25115 { 25116 isDenied: true, 25117 value: typeof preDenyValue === "undefined" ? value : preDenyValue 25118 } 25119 ); 25120 } 25121 }).catch((error2) => rejectWith(instance || void 0, error2)); 25122 } else { 25123 instance.close( 25124 /** @type SweetAlertResult */ 25125 { 25126 isDenied: true, 25127 value 25128 } 25129 ); 25130 } 25131}; 25132const succeedWith = (instance, value) => { 25133 instance.close( 25134 /** @type SweetAlertResult */ 25135 { 25136 isConfirmed: true, 25137 value 25138 } 25139 ); 25140}; 25141const rejectWith = (instance, error2) => { 25142 instance.rejectPromise(error2); 25143}; 25144const confirm = (instance, value) => { 25145 const innerParams = privateProps.innerParams.get(instance || void 0); 25146 if (innerParams.showLoaderOnConfirm) { 25147 showLoading(); 25148 } 25149 if (innerParams.preConfirm) { 25150 instance.resetValidationMessage(); 25151 instance.isAwaitingPromise = true; 25152 const preConfirmPromise = Promise.resolve().then(() => asPromise(innerParams.preConfirm(value, innerParams.validationMessage))); 25153 preConfirmPromise.then((preConfirmValue) => { 25154 if (isVisible$1(getValidationMessage()) || preConfirmValue === false) { 25155 instance.hideLoading(); 25156 handleAwaitingPromise(instance); 25157 } else { 25158 succeedWith(instance, typeof preConfirmValue === "undefined" ? value : preConfirmValue); 25159 } 25160 }).catch((error2) => rejectWith(instance || void 0, error2)); 25161 } else { 25162 succeedWith(instance, value); 25163 } 25164}; 25165function hideLoading() { 25166 const innerParams = privateProps.innerParams.get(this); 25167 if (!innerParams) { 25168 return; 25169 } 25170 const domCache = privateProps.domCache.get(this); 25171 hide(domCache.loader); 25172 if (isToast()) { 25173 if (innerParams.icon) { 25174 show(getIcon()); 25175 } 25176 } else { 25177 showRelatedButton(domCache); 25178 } 25179 removeClass([domCache.popup, domCache.actions], swalClasses.loading); 25180 domCache.popup.removeAttribute("aria-busy"); 25181 domCache.popup.removeAttribute("data-loading"); 25182 domCache.confirmButton.disabled = false;
vendor: 3,367 bytes, lines 25183-25298
25183 domCache.denyButton.disabled = false; 25184 domCache.cancelButton.disabled = false; 25185} 25186const showRelatedButton = (domCache) => { 25187 const buttonToReplace = domCache.popup.getElementsByClassName(domCache.loader.getAttribute("data-button-to-replace")); 25188 if (buttonToReplace.length) { 25189 show(buttonToReplace[0], "inline-block"); 25190 } else if (allButtonsAreHidden()) { 25191 hide(domCache.actions); 25192 } 25193}; 25194function getInput() { 25195 const innerParams = privateProps.innerParams.get(this); 25196 const domCache = privateProps.domCache.get(this); 25197 if (!domCache) { 25198 return null; 25199 } 25200 return getInput$1(domCache.popup, innerParams.input); 25201} 25202function setButtonsDisabled(instance, buttons, disabled) { 25203 const domCache = privateProps.domCache.get(instance); 25204 buttons.forEach((button) => { 25205 domCache[button].disabled = disabled; 25206 }); 25207} 25208function setInputDisabled(input, disabled) { 25209 const popup = getPopup(); 25210 if (!popup || !input) { 25211 return; 25212 } 25213 if (input.type === "radio") { 25214 const radios = popup.querySelectorAll(`[name="${swalClasses.radio}"]`); 25215 for (let i = 0; i < radios.length; i++) { 25216 radios[i].disabled = disabled; 25217 } 25218 } else { 25219 input.disabled = disabled; 25220 } 25221} 25222function enableButtons() { 25223 setButtonsDisabled(this, ["confirmButton", "denyButton", "cancelButton"], false); 25224} 25225function disableButtons() { 25226 setButtonsDisabled(this, ["confirmButton", "denyButton", "cancelButton"], true); 25227} 25228function enableInput() { 25229 setInputDisabled(this.getInput(), false); 25230} 25231function disableInput() { 25232 setInputDisabled(this.getInput(), true); 25233} 25234function showValidationMessage(error2) { 25235 const domCache = privateProps.domCache.get(this); 25236 const params = privateProps.innerParams.get(this); 25237 setInnerHtml(domCache.validationMessage, error2); 25238 domCache.validationMessage.className = swalClasses["validation-message"]; 25239 if (params.customClass && params.customClass.validationMessage) { 25240 addClass(domCache.validationMessage, params.customClass.validationMessage); 25241 } 25242 show(domCache.validationMessage); 25243 const input = this.getInput(); 25244 if (input) { 25245 input.setAttribute("aria-invalid", "true"); 25246 input.setAttribute("aria-describedby", swalClasses["validation-message"]); 25247 focusInput(input); 25248 addClass(input, swalClasses.inputerror); 25249 } 25250} 25251function resetValidationMessage() { 25252 const domCache = privateProps.domCache.get(this); 25253 if (domCache.validationMessage) { 25254 hide(domCache.validationMessage); 25255 } 25256 const input = this.getInput(); 25257 if (input) { 25258 input.removeAttribute("aria-invalid"); 25259 input.removeAttribute("aria-describedby"); 25260 removeClass(input, swalClasses.inputerror); 25261 } 25262} 25263const defaultParams = { 25264 title: "", 25265 titleText: "", 25266 text: "", 25267 html: "", 25268 footer: "", 25269 icon: void 0, 25270 iconColor: void 0, 25271 iconHtml: void 0, 25272 template: void 0, 25273 toast: false, 25274 draggable: false, 25275 animation: true, 25276 theme: "light", 25277 showClass: { 25278 popup: "swal2-show", 25279 backdrop: "swal2-backdrop-show", 25280 icon: "swal2-icon-show" 25281 }, 25282 hideClass: { 25283 popup: "swal2-hide", 25284 backdrop: "swal2-backdrop-hide", 25285 icon: "swal2-icon-hide" 25286 }, 25287 customClass: {}, 25288 target: "body", 25289 color: void 0, 25290 backdrop: true, 25291 heightAuto: true, 25292 allowOutsideClick: true, 25293 allowEscapeKey: true, 25294 allowEnterKey: true, 25295 stopKeydownPropagation: true, 25296 keydownListenerCapture: false, 25297 showConfirmButton: true, 25298 showDenyButton: false,
25299 showCancelButton: false, 25300 preConfirm: void 0, 25301 preDeny: void 0, 25302 confirmButtonText: "OK", 25303 confirmButtonAriaLabel: "", 25304 confirmButtonColor: void 0, 25305 denyButtonText: "No", 25306 denyButtonAriaLabel: "", 25307 denyButtonColor: void 0, 25308 cancelButtonText: "Cancel", 25309 cancelButtonAriaLabel: "", 25310 cancelButtonColor: void 0, 25311 buttonsStyling: true, 25312 reverseButtons: false, 25313 focusConfirm: true, 25314 focusDeny: false, 25315 focusCancel: false, 25316 returnFocus: true, 25317 showCloseButton: false, 25318 closeButtonHtml: "×", 25319 closeButtonAriaLabel: "Close this dialog", 25320 loaderHtml: "", 25321 showLoaderOnConfirm: false, 25322 showLoaderOnDeny: false, 25323 imageUrl: void 0, 25324 imageWidth: void 0, 25325 imageHeight: void 0, 25326 imageAlt: "", 25327 timer: void 0, 25328 timerProgressBar: false, 25329 width: void 0, 25330 padding: void 0, 25331 background: void 0, 25332 input: void 0, 25333 inputPlaceholder: "", 25334 inputLabel: "", 25335 inputValue: "", 25336 inputOptions: {}, 25337 inputAutoFocus: true, 25338 inputAutoTrim: true, 25339 inputAttributes: {}, 25340 inputValidator: void 0, 25341 returnInputValueOnDeny: false, 25342 validationMessage: void 0, 25343 grow: false, 25344 position: "center", 25345 progressSteps: [], 25346 currentProgressStep: void 0, 25347 progressStepsDistance: void 0, 25348 willOpen: void 0, 25349 didOpen: void 0, 25350 didRender: void 0, 25351 willClose: void 0, 25352 didClose: void 0, 25353 didDestroy: void 0, 25354 scrollbarPadding: true, 25355 topLayer: false 25356}; 25357const updatableParams = ["allowEscapeKey", "allowOutsideClick", "background", "buttonsStyling", "cancelButtonAriaLabel", "cancelButtonColor", "cancelButtonText", "closeButtonAriaLabel", "closeButtonHtml", "color", "confirmButtonAriaLabel", "confirmButtonColor", "confirmButtonText", "currentProgressStep", "customClass", "denyButtonAriaLabel", "denyButtonColor", "denyButtonText", "didClose", "didDestroy", "draggable", "footer", "hideClass", "html", "icon", "iconColor", "iconHtml", "imageAlt", "imageHeight", "imageUrl", "imageWidth", "preConfirm", "preDeny", "progressSteps", "returnFocus", "reverseButtons", "showCancelButton", "showCloseButton", "showConfirmButton", "showDenyButton", "text", "title", "titleText", "theme", "willClose"]; 25358const deprecatedParams = { 25359 allowEnterKey: void 0 25360}; 25361const toastIncompatibleParams = ["allowOutsideClick", "allowEnterKey", "backdrop", "draggable", "focusConfirm", "focusDeny", "focusCancel", "returnFocus", "heightAuto", "keydownListenerCapture"]; 25362const isValidParameter = (paramName) => { 25363 return Object.prototype.hasOwnProperty.call(defaultParams, paramName); 25364}; 25365const isUpdatableParameter = (paramName) => { 25366 return updatableParams.indexOf(paramName) !== -1; 25367}; 25368const isDeprecatedParameter = (paramName) => { 25369 return deprecatedParams[paramName]; 25370}; 25371const checkIfParamIsValid = (param) => { 25372 if (!isValidParameter(param)) { 25373 warn(`Unknown parameter "${param}"`); 25374 } 25375}; 25376const checkIfToastParamIsValid = (param) => { 25377 if (toastIncompatibleParams.includes(param)) { 25378 warn(`The parameter "${param}" is incompatible with toasts`); 25379 } 25380}; 25381const checkIfParamIsDeprecated = (param) => { 25382 const isDeprecated = isDeprecatedParameter(param); 25383 if (isDeprecated) { 25384 warnAboutDeprecation(param, isDeprecated); 25385 } 25386}; 25387const showWarningsForParams = (params) => { 25388 if (params.backdrop === false && params.allowOutsideClick) { 25389 warn('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'); 25390 } 25391 if (params.theme && !["light", "dark", "auto", "minimal", "borderless", "bootstrap-4", "bootstrap-4-light", "bootstrap-4-dark", "bootstrap-5", "bootstrap-5-light", "bootstrap-5-dark", "material-ui", "material-ui-light", "material-ui-dark", "embed-iframe", "bulma", "bulma-light", "bulma-dark"].includes(params.theme)) { 25392 warn(`Invalid theme "${params.theme}"`); 25393 } 25394 for (const param in params) { 25395 checkIfParamIsValid(param); 25396 if (params.toast) { 25397 checkIfToastParamIsValid(param); 25398 } 25399 checkIfParamIsDeprecated(param); 25400 } 25401}; 25402function update(params) { 25403 const container = getContainer(); 25404 const popup = getPopup(); 25405 const innerParams = privateProps.innerParams.get(this); 25406 if (!popup || hasClass(popup, innerParams.hideClass.popup)) { 25407 warn(`You're trying to update the closed or closing popup, that won't work. Use the update() method in preConfirm parameter or show a new popup.`); 25408 return; 25409 } 25410 const validUpdatableParams = filterValidParams(params); 25411 const updatedParams = Object.assign({}, innerParams, validUpdatableParams); 25412 showWarningsForParams(updatedParams); 25413 container.dataset["swal2Theme"] = updatedParams.theme; 25414 render(this, updatedParams); 25415 privateProps.innerParams.set(this, updatedParams); 25416 Object.defineProperties(this, { 25417 params: { 25418 value: Object.assign({}, this.params, params), 25419 writable: false, 25420 enumerable: true 25421 } 25422 }); 25423} 25424const filterValidParams = (params) => { 25425 const validUpdatableParams = {};
25426 Object.keys(params).forEach((param) => { 25427 if (isUpdatableParameter(param)) { 25428 validUpdatableParams[param] = params[param]; 25429 } else { 25430 warn(`Invalid parameter to update: ${param}`); 25431 } 25432 }); 25433 return validUpdatableParams; 25434}; 25435function _destroy() { 25436 const domCache = privateProps.domCache.get(this); 25437 const innerParams = privateProps.innerParams.get(this); 25438 if (!innerParams) { 25439 disposeWeakMaps(this); 25440 return; 25441 } 25442 if (domCache.popup && globalState.swalCloseEventFinishedCallback) { 25443 globalState.swalCloseEventFinishedCallback(); 25444 delete globalState.swalCloseEventFinishedCallback; 25445 } 25446 if (typeof innerParams.didDestroy === "function") { 25447 innerParams.didDestroy(); 25448 } 25449 globalState.eventEmitter.emit("didDestroy"); 25450 disposeSwal(this); 25451} 25452const disposeSwal = (instance) => { 25453 disposeWeakMaps(instance); 25454 delete instance.params; 25455 delete globalState.keydownHandler; 25456 delete globalState.keydownTarget; 25457 delete globalState.currentInstance; 25458}; 25459const disposeWeakMaps = (instance) => { 25460 if (instance.isAwaitingPromise) { 25461 unsetWeakMaps(privateProps, instance); 25462 instance.isAwaitingPromise = true; 25463 } else { 25464 unsetWeakMaps(privateMethods, instance); 25465 unsetWeakMaps(privateProps, instance); 25466 delete instance.isAwaitingPromise; 25467 delete instance.disableButtons; 25468 delete instance.enableButtons; 25469 delete instance.getInput; 25470 delete instance.disableInput; 25471 delete instance.enableInput; 25472 delete instance.hideLoading; 25473 delete instance.disableLoading; 25474 delete instance.showValidationMessage; 25475 delete instance.resetValidationMessage; 25476 delete instance.close; 25477 delete instance.closePopup; 25478 delete instance.closeModal; 25479 delete instance.closeToast; 25480 delete instance.rejectPromise; 25481 delete instance.update; 25482 delete instance._destroy; 25483 } 25484}; 25485const unsetWeakMaps = (obj, instance) => { 25486 for (const i in obj) { 25487 obj[i].delete(instance); 25488 } 25489}; 25490var instanceMethods = /* @__PURE__ */ Object.freeze({ 25491 __proto__: null, 25492 _destroy, 25493 close, 25494 closeModal: close, 25495 closePopup: close, 25496 closeToast: close, 25497 disableButtons, 25498 disableInput, 25499 disableLoading: hideLoading, 25500 enableButtons, 25501 enableInput, 25502 getInput, 25503 handleAwaitingPromise, 25504 hideLoading, 25505 rejectPromise, 25506 resetValidationMessage, 25507 showValidationMessage, 25508 update 25509}); 25510const handlePopupClick = (innerParams, domCache, dismissWith) => { 25511 if (innerParams.toast) { 25512 handleToastClick(innerParams, domCache, dismissWith); 25513 } else { 25514 handleModalMousedown(domCache); 25515 handleContainerMousedown(domCache); 25516 handleModalClick(innerParams, domCache, dismissWith); 25517 } 25518}; 25519const handleToastClick = (innerParams, domCache, dismissWith) => { 25520 domCache.popup.onclick = () => { 25521 if (innerParams && (isAnyButtonShown(innerParams) || innerParams.timer || innerParams.input)) { 25522 return; 25523 } 25524 dismissWith(DismissReason.close); 25525 }; 25526}; 25527const isAnyButtonShown = (innerParams) => { 25528 return !!(innerParams.showConfirmButton || innerParams.showDenyButton || innerParams.showCancelButton || innerParams.showCloseButton); 25529}; 25530let ignoreOutsideClick = false; 25531const handleModalMousedown = (domCache) => { 25532 domCache.popup.onmousedown = () => { 25533 domCache.container.onmouseup = function(e) { 25534 domCache.container.onmouseup = () => { 25535 }; 25536 if (e.target === domCache.container) { 25537 ignoreOutsideClick = true; 25538 } 25539 }; 25540 }; 25541}; 25542const handleContainerMousedown = (domCache) => { 25543 domCache.container.onmousedown = (e) => { 25544 if (e.target === domCache.container) { 25545 e.preventDefault(); 25546 } 25547 domCache.popup.onmouseup = function(e2) { 25548 domCache.popup.onmouseup = () => { 25549 }; 25550 if (e2.target === domCache.popup || e2.target instanceof HTMLElement && domCache.popup.contains(e2.target)) { 25551 ignoreOutsideClick = true; 25552 } 25553 }; 25554 }; 25555}; 25556const handleModalClick = (innerParams, domCache, dismissWith) => { 25557 domCache.container.onclick = (e) => { 25558 if (ignoreOutsideClick) { 25559 ignoreOutsideClick = false; 25560 return; 25561 } 25562 if (e.target === domCache.container && callIfFunction(innerParams.allowOutsideClick)) {
vendor: 5,732 bytes, lines 25563-25795
25563 dismissWith(DismissReason.backdrop); 25564 } 25565 }; 25566}; 25567const isJqueryElement = (elem) => typeof elem === "object" && elem.jquery; 25568const isElement = (elem) => elem instanceof Element || isJqueryElement(elem); 25569const argsToParams = (args) => { 25570 const params = {}; 25571 if (typeof args[0] === "object" && !isElement(args[0])) { 25572 Object.assign(params, args[0]); 25573 } else { 25574 ["title", "html", "icon"].forEach((name, index) => { 25575 const arg = args[index]; 25576 if (typeof arg === "string" || isElement(arg)) { 25577 params[name] = arg; 25578 } else if (arg !== void 0) { 25579 error(`Unexpected type of ${name}! Expected "string" or "Element", got ${typeof arg}`); 25580 } 25581 }); 25582 } 25583 return params; 25584}; 25585function fire(...args) { 25586 return new this(...args); 25587} 25588function mixin(mixinParams) { 25589 class MixinSwal extends this { 25590 _main(params, priorityMixinParams) { 25591 return super._main(params, Object.assign({}, mixinParams, priorityMixinParams)); 25592 } 25593 } 25594 return MixinSwal; 25595} 25596const getTimerLeft = () => { 25597 return globalState.timeout && globalState.timeout.getTimerLeft(); 25598}; 25599const stopTimer = () => { 25600 if (globalState.timeout) { 25601 stopTimerProgressBar(); 25602 return globalState.timeout.stop(); 25603 } 25604}; 25605const resumeTimer = () => { 25606 if (globalState.timeout) { 25607 const remaining = globalState.timeout.start(); 25608 animateTimerProgressBar(remaining); 25609 return remaining; 25610 } 25611}; 25612const toggleTimer = () => { 25613 const timer = globalState.timeout; 25614 return timer && (timer.running ? stopTimer() : resumeTimer()); 25615}; 25616const increaseTimer = (ms) => { 25617 if (globalState.timeout) { 25618 const remaining = globalState.timeout.increase(ms); 25619 animateTimerProgressBar(remaining, true); 25620 return remaining; 25621 } 25622}; 25623const isTimerRunning = () => { 25624 return !!(globalState.timeout && globalState.timeout.isRunning()); 25625}; 25626let bodyClickListenerAdded = false; 25627const clickHandlers = {}; 25628function bindClickHandler(attr = "data-swal-template") { 25629 clickHandlers[attr] = this; 25630 if (!bodyClickListenerAdded) { 25631 document.body.addEventListener("click", bodyClickListener); 25632 bodyClickListenerAdded = true; 25633 } 25634} 25635const bodyClickListener = (event) => { 25636 for (let el = event.target; el && el !== document; el = el.parentNode) { 25637 for (const attr in clickHandlers) { 25638 const template = el.getAttribute(attr); 25639 if (template) { 25640 clickHandlers[attr].fire({ 25641 template 25642 }); 25643 return; 25644 } 25645 } 25646 } 25647}; 25648class EventEmitter { 25649 constructor() { 25650 this.events = {}; 25651 } 25652 /** 25653 * @param {string} eventName 25654 * @returns {EventHandlers} 25655 */ 25656 _getHandlersByEventName(eventName) { 25657 if (typeof this.events[eventName] === "undefined") { 25658 this.events[eventName] = []; 25659 } 25660 return this.events[eventName]; 25661 } 25662 /** 25663 * @param {string} eventName 25664 * @param {EventHandler} eventHandler 25665 */ 25666 on(eventName, eventHandler) { 25667 const currentHandlers = this._getHandlersByEventName(eventName); 25668 if (!currentHandlers.includes(eventHandler)) { 25669 currentHandlers.push(eventHandler); 25670 } 25671 } 25672 /** 25673 * @param {string} eventName 25674 * @param {EventHandler} eventHandler 25675 */ 25676 once(eventName, eventHandler) { 25677 const onceFn = (...args) => { 25678 this.removeListener(eventName, onceFn); 25679 eventHandler.apply(this, args); 25680 }; 25681 this.on(eventName, onceFn); 25682 } 25683 /** 25684 * @param {string} eventName 25685 * @param {Array} args 25686 */ 25687 emit(eventName, ...args) { 25688 this._getHandlersByEventName(eventName).forEach( 25689 /** 25690 * @param {EventHandler} eventHandler 25691 */ 25692 (eventHandler) => { 25693 try { 25694 eventHandler.apply(this, args); 25695 } catch (error2) { 25696 console.error(error2); 25697 } 25698 } 25699 ); 25700 } 25701 /** 25702 * @param {string} eventName 25703 * @param {EventHandler} eventHandler 25704 */ 25705 removeListener(eventName, eventHandler) { 25706 const currentHandlers = this._getHandlersByEventName(eventName); 25707 const index = currentHandlers.indexOf(eventHandler); 25708 if (index > -1) { 25709 currentHandlers.splice(index, 1); 25710 } 25711 } 25712 /** 25713 * @param {string} eventName 25714 */ 25715 removeAllListeners(eventName) { 25716 if (this.events[eventName] !== void 0) { 25717 this.events[eventName].length = 0; 25718 } 25719 } 25720 reset() { 25721 this.events = {}; 25722 } 25723} 25724globalState.eventEmitter = new EventEmitter(); 25725const on = (eventName, eventHandler) => { 25726 globalState.eventEmitter.on(eventName, eventHandler); 25727}; 25728const once = (eventName, eventHandler) => { 25729 globalState.eventEmitter.once(eventName, eventHandler); 25730}; 25731const off = (eventName, eventHandler) => { 25732 if (!eventName) { 25733 globalState.eventEmitter.reset(); 25734 return; 25735 } 25736 if (eventHandler) { 25737 globalState.eventEmitter.removeListener(eventName, eventHandler); 25738 } else { 25739 globalState.eventEmitter.removeAllListeners(eventName); 25740 } 25741}; 25742var staticMethods = /* @__PURE__ */ Object.freeze({ 25743 __proto__: null, 25744 argsToParams, 25745 bindClickHandler, 25746 clickCancel, 25747 clickConfirm, 25748 clickDeny, 25749 enableLoading: showLoading, 25750 fire, 25751 getActions, 25752 getCancelButton, 25753 getCloseButton, 25754 getConfirmButton, 25755 getContainer, 25756 getDenyButton, 25757 getFocusableElements, 25758 getFooter, 25759 getHtmlContainer, 25760 getIcon, 25761 getIconContent, 25762 getImage, 25763 getInputLabel, 25764 getLoader, 25765 getPopup, 25766 getProgressSteps, 25767 getTimerLeft, 25768 getTimerProgressBar, 25769 getTitle, 25770 getValidationMessage, 25771 increaseTimer, 25772 isDeprecatedParameter, 25773 isLoading, 25774 isTimerRunning, 25775 isUpdatableParameter, 25776 isValidParameter, 25777 isVisible, 25778 mixin, 25779 off, 25780 on, 25781 once, 25782 resumeTimer, 25783 showLoading, 25784 stopTimer, 25785 toggleTimer 25786}); 25787class Timer { 25788 /** 25789 * @param {() => void} callback 25790 * @param {number} delay 25791 */ 25792 constructor(callback, delay) { 25793 this.callback = callback; 25794 this.remaining = delay; 25795 this.running = false;
25796 this.start(); 25797 } 25798 /** 25799 * @returns {number} 25800 */ 25801 start() { 25802 if (!this.running) { 25803 this.running = true; 25804 this.started = /* @__PURE__ */ new Date(); 25805 this.id = setTimeout(this.callback, this.remaining); 25806 } 25807 return this.remaining; 25808 } 25809 /** 25810 * @returns {number} 25811 */ 25812 stop() { 25813 if (this.started && this.running) { 25814 this.running = false; 25815 clearTimeout(this.id); 25816 this.remaining -= (/* @__PURE__ */ new Date()).getTime() - this.started.getTime(); 25817 } 25818 return this.remaining; 25819 } 25820 /** 25821 * @param {number} n 25822 * @returns {number} 25823 */ 25824 increase(n) { 25825 const running = this.running; 25826 if (running) { 25827 this.stop(); 25828 } 25829 this.remaining += n; 25830 if (running) { 25831 this.start(); 25832 } 25833 return this.remaining; 25834 } 25835 /** 25836 * @returns {number} 25837 */ 25838 getTimerLeft() { 25839 if (this.running) { 25840 this.stop(); 25841 this.start(); 25842 } 25843 return this.remaining; 25844 } 25845 /** 25846 * @returns {boolean} 25847 */ 25848 isRunning() { 25849 return this.running; 25850 } 25851} 25852const swalStringParams = ["swal-title", "swal-html", "swal-footer"]; 25853const getTemplateParams = (params) => { 25854 const template = typeof params.template === "string" ? ( 25855 /** @type {HTMLTemplateElement} */ 25856 document.querySelector(params.template) 25857 ) : params.template; 25858 if (!template) { 25859 return {}; 25860 } 25861 const templateContent = template.content; 25862 showWarningsForElements(templateContent); 25863 const result = Object.assign(getSwalParams(templateContent), getSwalFunctionParams(templateContent), getSwalButtons(templateContent), getSwalImage(templateContent), getSwalIcon(templateContent), getSwalInput(templateContent), getSwalStringParams(templateContent, swalStringParams)); 25864 return result; 25865}; 25866const getSwalParams = (templateContent) => { 25867 const result = {}; 25868 const swalParams = Array.from(templateContent.querySelectorAll("swal-param")); 25869 swalParams.forEach((param) => { 25870 showWarningsForAttributes(param, ["name", "value"]); 25871 const paramName = ( 25872 /** @type {keyof SweetAlertOptions} */ 25873 param.getAttribute("name") 25874 ); 25875 const value = param.getAttribute("value"); 25876 if (!paramName || !value) { 25877 return; 25878 } 25879 if (typeof defaultParams[paramName] === "boolean") { 25880 result[paramName] = value !== "false"; 25881 } else if (typeof defaultParams[paramName] === "object") { 25882 result[paramName] = JSON.parse(value); 25883 } else { 25884 result[paramName] = value; 25885 } 25886 }); 25887 return result; 25888}; 25889const getSwalFunctionParams = (templateContent) => { 25890 const result = {}; 25891 const swalFunctions = Array.from(templateContent.querySelectorAll("swal-function-param")); 25892 swalFunctions.forEach((param) => { 25893 const paramName = ( 25894 /** @type {keyof SweetAlertOptions} */ 25895 param.getAttribute("name") 25896 ); 25897 const value = param.getAttribute("value"); 25898 if (!paramName || !value) { 25899 return; 25900 } 25901 result[paramName] = new Function(`return ${value}`)(); 25902 }); 25903 return result; 25904}; 25905const getSwalButtons = (templateContent) => { 25906 const result = {}; 25907 const swalButtons = Array.from(templateContent.querySelectorAll("swal-button")); 25908 swalButtons.forEach((button) => { 25909 showWarningsForAttributes(button, ["type", "color", "aria-label"]); 25910 const type = button.getAttribute("type"); 25911 if (!type || !["confirm", "cancel", "deny"].includes(type)) { 25912 return; 25913 } 25914 result[`${type}ButtonText`] = button.innerHTML; 25915 result[`show${capitalizeFirstLetter(type)}Button`] = true; 25916 if (button.hasAttribute("color")) { 25917 result[`${type}ButtonColor`] = button.getAttribute("color"); 25918 } 25919 if (button.hasAttribute("aria-label")) { 25920 result[`${type}ButtonAriaLabel`] = button.getAttribute("aria-label"); 25921 } 25922 }); 25923 return result; 25924}; 25925const getSwalImage = (templateContent) => { 25926 const result = {}; 25927 const image = templateContent.querySelector("swal-image"); 25928 if (image) { 25929 showWarningsForAttributes(image, ["src", "width", "height", "alt"]); 25930 if (image.hasAttribute("src")) { 25931 result.imageUrl = image.getAttribute("src") || void 0; 25932 } 25933 if (image.hasAttribute("width")) { 25934 result.imageWidth = image.getAttribute("width") || void 0; 25935 } 25936 if (image.hasAttribute("height")) { 25937 result.imageHeight = image.getAttribute("height") || void 0; 25938 } 25939 if (image.hasAttribute("alt")) { 25940 result.imageAlt = image.getAttribute("alt") || void 0; 25941 } 25942 } 25943 return result; 25944}; 25945const getSwalIcon = (templateContent) => { 25946 const result = {}; 25947 const icon = templateContent.querySelector("swal-icon"); 25948 if (icon) { 25949 showWarningsForAttributes(icon, ["type", "color"]); 25950 if (icon.hasAttribute("type")) { 25951 result.icon = icon.getAttribute("type"); 25952 } 25953 if (icon.hasAttribute("color")) { 25954 result.iconColor = icon.getAttribute("color"); 25955 } 25956 result.iconHtml = icon.innerHTML; 25957 } 25958 return result; 25959}; 25960const getSwalInput = (templateContent) => { 25961 const result = {}; 25962 const input = templateContent.querySelector("swal-input"); 25963 if (input) { 25964 showWarningsForAttributes(input, ["type", "label", "placeholder", "value"]); 25965 result.input = input.getAttribute("type") || "text"; 25966 if (input.hasAttribute("label")) { 25967 result.inputLabel = input.getAttribute("label"); 25968 } 25969 if (input.hasAttribute("placeholder")) { 25970 result.inputPlaceholder = input.getAttribute("placeholder"); 25971 } 25972 if (input.hasAttribute("value")) { 25973 result.inputValue = input.getAttribute("value"); 25974 } 25975 } 25976 const inputOptions = Array.from(templateContent.querySelectorAll("swal-input-option")); 25977 if (inputOptions.length) { 25978 result.inputOptions = {}; 25979 inputOptions.forEach((option) => { 25980 showWarningsForAttributes(option, ["value"]); 25981 const optionValue = option.getAttribute("value"); 25982 if (!optionValue) { 25983 return; 25984 } 25985 const optionName = option.innerHTML; 25986 result.inputOptions[optionValue] = optionName; 25987 }); 25988 } 25989 return result; 25990}; 25991const getSwalStringParams = (templateContent, paramNames) => { 25992 const result = {}; 25993 for (const i in paramNames) { 25994 const paramName = paramNames[i]; 25995 const tag2 = templateContent.querySelector(paramName); 25996 if (tag2) { 25997 showWarningsForAttributes(tag2, []); 25998 result[paramName.replace(/^swal-/, "")] = tag2.innerHTML.trim(); 25999 } 26000 } 26001 return result; 26002}; 26003const showWarningsForElements = (templateContent) => { 26004 const allowedElements = swalStringParams.concat(["swal-param", "swal-function-param", "swal-button", "swal-image", "swal-icon", "swal-input", "swal-input-option"]);
vendor: 4,395 bytes, lines 26005-26121
26005 Array.from(templateContent.children).forEach((el) => { 26006 const tagName = el.tagName.toLowerCase(); 26007 if (!allowedElements.includes(tagName)) { 26008 warn(`Unrecognized element <${tagName}>`); 26009 } 26010 }); 26011}; 26012const showWarningsForAttributes = (el, allowedAttributes) => { 26013 Array.from(el.attributes).forEach((attribute) => { 26014 if (allowedAttributes.indexOf(attribute.name) === -1) { 26015 warn([`Unrecognized attribute "${attribute.name}" on <${el.tagName.toLowerCase()}>.`, `${allowedAttributes.length ? `Allowed attributes are: ${allowedAttributes.join(", ")}` : "To set the value, use HTML within the element."}`]); 26016 } 26017 }); 26018}; 26019const SHOW_CLASS_TIMEOUT = 10; 26020const openPopup = (params) => { 26021 const container = getContainer(); 26022 const popup = getPopup(); 26023 if (typeof params.willOpen === "function") { 26024 params.willOpen(popup); 26025 } 26026 globalState.eventEmitter.emit("willOpen", popup); 26027 const bodyStyles = window.getComputedStyle(document.body); 26028 const initialBodyOverflow = bodyStyles.overflowY; 26029 addClasses(container, popup, params); 26030 setTimeout(() => { 26031 setScrollingVisibility(container, popup); 26032 }, SHOW_CLASS_TIMEOUT); 26033 if (isModal()) { 26034 fixScrollContainer(container, params.scrollbarPadding, initialBodyOverflow); 26035 setAriaHidden(); 26036 } 26037 if (!isToast() && !globalState.previousActiveElement) { 26038 globalState.previousActiveElement = document.activeElement; 26039 } 26040 if (typeof params.didOpen === "function") { 26041 setTimeout(() => params.didOpen(popup)); 26042 } 26043 globalState.eventEmitter.emit("didOpen", popup); 26044}; 26045const swalOpenAnimationFinished = (event) => { 26046 const popup = getPopup(); 26047 if (event.target !== popup) { 26048 return; 26049 } 26050 const container = getContainer(); 26051 popup.removeEventListener("animationend", swalOpenAnimationFinished); 26052 popup.removeEventListener("transitionend", swalOpenAnimationFinished); 26053 container.style.overflowY = "auto"; 26054 removeClass(container, swalClasses["no-transition"]); 26055}; 26056const setScrollingVisibility = (container, popup) => { 26057 if (hasCssAnimation(popup)) { 26058 container.style.overflowY = "hidden"; 26059 popup.addEventListener("animationend", swalOpenAnimationFinished); 26060 popup.addEventListener("transitionend", swalOpenAnimationFinished); 26061 } else { 26062 container.style.overflowY = "auto"; 26063 } 26064}; 26065const fixScrollContainer = (container, scrollbarPadding, initialBodyOverflow) => { 26066 iOSfix(); 26067 if (scrollbarPadding && initialBodyOverflow !== "hidden") { 26068 replaceScrollbarWithPadding(initialBodyOverflow); 26069 } 26070 setTimeout(() => { 26071 container.scrollTop = 0; 26072 }); 26073}; 26074const addClasses = (container, popup, params) => { 26075 addClass(container, params.showClass.backdrop); 26076 if (params.animation) { 26077 popup.style.setProperty("opacity", "0", "important"); 26078 show(popup, "grid"); 26079 setTimeout(() => { 26080 addClass(popup, params.showClass.popup); 26081 popup.style.removeProperty("opacity"); 26082 }, SHOW_CLASS_TIMEOUT); 26083 } else { 26084 show(popup, "grid"); 26085 } 26086 addClass([document.documentElement, document.body], swalClasses.shown); 26087 if (params.heightAuto && params.backdrop && !params.toast) { 26088 addClass([document.documentElement, document.body], swalClasses["height-auto"]); 26089 } 26090}; 26091var defaultInputValidators = { 26092 /** 26093 * @param {string} string 26094 * @param {string} [validationMessage] 26095 * @returns {Promise<string | void>} 26096 */ 26097 email: (string, validationMessage) => { 26098 return /^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || "Invalid email address"); 26099 }, 26100 /** 26101 * @param {string} string 26102 * @param {string} [validationMessage] 26103 * @returns {Promise<string | void>} 26104 */ 26105 url: (string, validationMessage) => { 26106 return /^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(string) ? Promise.resolve() : Promise.resolve(validationMessage || "Invalid URL"); 26107 } 26108}; 26109function setDefaultInputValidators(params) { 26110 if (params.inputValidator) { 26111 return; 26112 } 26113 if (params.input === "email") { 26114 params.inputValidator = defaultInputValidators["email"]; 26115 } 26116 if (params.input === "url") { 26117 params.inputValidator = defaultInputValidators["url"]; 26118 } 26119} 26120function validateCustomTargetElement(params) { 26121 if (!params.target || typeof params.target === "string" && !document.querySelector(params.target) || typeof params.target !== "string" && !params.target.appendChild) {
vendor: 4,438 bytes, lines 26122-26247
26122 warn('Target parameter is not valid, defaulting to "body"'); 26123 params.target = "body"; 26124 } 26125} 26126function setParameters(params) { 26127 setDefaultInputValidators(params); 26128 if (params.showLoaderOnConfirm && !params.preConfirm) { 26129 warn("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"); 26130 } 26131 validateCustomTargetElement(params); 26132 if (typeof params.title === "string") { 26133 params.title = params.title.split("\n").join("<br />"); 26134 } 26135 init$1(params); 26136} 26137let currentInstance; 26138var _promise = /* @__PURE__ */ new WeakMap(); 26139class SweetAlert { 26140 /** 26141 * @param {...(SweetAlertOptions | string)} args 26142 * @this {SweetAlert} 26143 */ 26144 constructor(...args) { 26145 _classPrivateFieldInitSpec(this, _promise, void 0); 26146 if (typeof window === "undefined") { 26147 return; 26148 } 26149 currentInstance = this; 26150 const outerParams = Object.freeze(this.constructor.argsToParams(args)); 26151 this.params = outerParams; 26152 this.isAwaitingPromise = false; 26153 _classPrivateFieldSet2(_promise, this, this._main(currentInstance.params)); 26154 } 26155 _main(userParams, mixinParams = {}) { 26156 showWarningsForParams(Object.assign({}, mixinParams, userParams)); 26157 if (globalState.currentInstance) { 26158 const swalPromiseResolve = privateMethods.swalPromiseResolve.get(globalState.currentInstance); 26159 const { 26160 isAwaitingPromise 26161 } = globalState.currentInstance; 26162 globalState.currentInstance._destroy(); 26163 if (!isAwaitingPromise) { 26164 swalPromiseResolve({ 26165 isDismissed: true 26166 }); 26167 } 26168 if (isModal()) { 26169 unsetAriaHidden(); 26170 } 26171 } 26172 globalState.currentInstance = currentInstance; 26173 const innerParams = prepareParams(userParams, mixinParams); 26174 setParameters(innerParams); 26175 Object.freeze(innerParams); 26176 if (globalState.timeout) { 26177 globalState.timeout.stop(); 26178 delete globalState.timeout; 26179 } 26180 clearTimeout(globalState.restoreFocusTimeout); 26181 const domCache = populateDomCache(currentInstance); 26182 render(currentInstance, innerParams); 26183 privateProps.innerParams.set(currentInstance, innerParams); 26184 return swalPromise(currentInstance, domCache, innerParams); 26185 } 26186 // `catch` cannot be the name of a module export, so we define our thenable methods here instead 26187 then(onFulfilled) { 26188 return _classPrivateFieldGet2(_promise, this).then(onFulfilled); 26189 } 26190 finally(onFinally) { 26191 return _classPrivateFieldGet2(_promise, this).finally(onFinally); 26192 } 26193} 26194const swalPromise = (instance, domCache, innerParams) => { 26195 return new Promise((resolve2, reject) => { 26196 const dismissWith = (dismiss) => { 26197 instance.close({ 26198 isDismissed: true, 26199 dismiss, 26200 isConfirmed: false, 26201 isDenied: false 26202 }); 26203 }; 26204 privateMethods.swalPromiseResolve.set(instance, resolve2); 26205 privateMethods.swalPromiseReject.set(instance, reject); 26206 domCache.confirmButton.onclick = () => { 26207 handleConfirmButtonClick(instance); 26208 }; 26209 domCache.denyButton.onclick = () => { 26210 handleDenyButtonClick(instance); 26211 }; 26212 domCache.cancelButton.onclick = () => { 26213 handleCancelButtonClick(instance, dismissWith); 26214 }; 26215 domCache.closeButton.onclick = () => { 26216 dismissWith(DismissReason.close); 26217 }; 26218 handlePopupClick(innerParams, domCache, dismissWith); 26219 addKeydownHandler(globalState, innerParams, dismissWith); 26220 handleInputOptionsAndValue(instance, innerParams); 26221 openPopup(innerParams); 26222 setupTimer(globalState, innerParams, dismissWith); 26223 initFocus(domCache, innerParams); 26224 setTimeout(() => { 26225 domCache.container.scrollTop = 0; 26226 }); 26227 }); 26228}; 26229const prepareParams = (userParams, mixinParams) => { 26230 const templateParams = getTemplateParams(userParams); 26231 const params = Object.assign({}, defaultParams, mixinParams, templateParams, userParams); 26232 params.showClass = Object.assign({}, defaultParams.showClass, params.showClass); 26233 params.hideClass = Object.assign({}, defaultParams.hideClass, params.hideClass); 26234 if (params.animation === false) { 26235 params.showClass = { 26236 backdrop: "swal2-noanimation" 26237 }; 26238 params.hideClass = {}; 26239 } 26240 return params; 26241}; 26242const populateDomCache = (instance) => { 26243 const domCache = { 26244 popup: getPopup(), 26245 container: getContainer(), 26246 actions: getActions(), 26247 confirmButton: getConfirmButton(),
vendor: 3,692 bytes, lines 26248-26361
26248 denyButton: getDenyButton(), 26249 cancelButton: getCancelButton(), 26250 loader: getLoader(), 26251 closeButton: getCloseButton(), 26252 validationMessage: getValidationMessage(), 26253 progressSteps: getProgressSteps() 26254 }; 26255 privateProps.domCache.set(instance, domCache); 26256 return domCache; 26257}; 26258const setupTimer = (globalState2, innerParams, dismissWith) => { 26259 const timerProgressBar = getTimerProgressBar(); 26260 hide(timerProgressBar); 26261 if (innerParams.timer) { 26262 globalState2.timeout = new Timer(() => { 26263 dismissWith("timer"); 26264 delete globalState2.timeout; 26265 }, innerParams.timer); 26266 if (innerParams.timerProgressBar) { 26267 show(timerProgressBar); 26268 applyCustomClass(timerProgressBar, innerParams, "timerProgressBar"); 26269 setTimeout(() => { 26270 if (globalState2.timeout && globalState2.timeout.running) { 26271 animateTimerProgressBar(innerParams.timer); 26272 } 26273 }); 26274 } 26275 } 26276}; 26277const initFocus = (domCache, innerParams) => { 26278 if (innerParams.toast) { 26279 return; 26280 } 26281 if (!callIfFunction(innerParams.allowEnterKey)) { 26282 warnAboutDeprecation("allowEnterKey"); 26283 blurActiveElement(); 26284 return; 26285 } 26286 if (focusAutofocus(domCache)) { 26287 return; 26288 } 26289 if (focusButton(domCache, innerParams)) { 26290 return; 26291 } 26292 setFocus(-1, 1); 26293}; 26294const focusAutofocus = (domCache) => { 26295 const autofocusElements = Array.from(domCache.popup.querySelectorAll("[autofocus]")); 26296 for (const autofocusElement of autofocusElements) { 26297 if (autofocusElement instanceof HTMLElement && isVisible$1(autofocusElement)) { 26298 autofocusElement.focus(); 26299 return true; 26300 } 26301 } 26302 return false; 26303}; 26304const focusButton = (domCache, innerParams) => { 26305 if (innerParams.focusDeny && isVisible$1(domCache.denyButton)) { 26306 domCache.denyButton.focus(); 26307 return true; 26308 } 26309 if (innerParams.focusCancel && isVisible$1(domCache.cancelButton)) { 26310 domCache.cancelButton.focus(); 26311 return true; 26312 } 26313 if (innerParams.focusConfirm && isVisible$1(domCache.confirmButton)) { 26314 domCache.confirmButton.focus(); 26315 return true; 26316 } 26317 return false; 26318}; 26319const blurActiveElement = () => { 26320 if (document.activeElement instanceof HTMLElement && typeof document.activeElement.blur === "function") { 26321 document.activeElement.blur(); 26322 } 26323}; 26324SweetAlert.prototype.disableButtons = disableButtons; 26325SweetAlert.prototype.enableButtons = enableButtons; 26326SweetAlert.prototype.getInput = getInput; 26327SweetAlert.prototype.disableInput = disableInput; 26328SweetAlert.prototype.enableInput = enableInput; 26329SweetAlert.prototype.hideLoading = hideLoading; 26330SweetAlert.prototype.disableLoading = hideLoading; 26331SweetAlert.prototype.showValidationMessage = showValidationMessage; 26332SweetAlert.prototype.resetValidationMessage = resetValidationMessage; 26333SweetAlert.prototype.close = close; 26334SweetAlert.prototype.closePopup = close; 26335SweetAlert.prototype.closeModal = close; 26336SweetAlert.prototype.closeToast = close; 26337SweetAlert.prototype.rejectPromise = rejectPromise; 26338SweetAlert.prototype.update = update; 26339SweetAlert.prototype._destroy = _destroy; 26340Object.assign(SweetAlert, staticMethods); 26341Object.keys(instanceMethods).forEach((key) => { 26342 SweetAlert[key] = function(...args) { 26343 if (currentInstance && currentInstance[key]) { 26344 return currentInstance[key](...args); 26345 } 26346 return null; 26347 }; 26348}); 26349SweetAlert.DismissReason = DismissReason; 26350SweetAlert.version = "11.26.3"; 26351const Swal = SweetAlert; 26352Swal.default = Swal; 26353"undefined" != typeof document && (function(e, t) { 26354 var n = e.createElement("style"); 26355 if (e.getElementsByTagName("head")[0].appendChild(n), n.styleSheet) n.styleSheet.disabled || (n.styleSheet.cssText = t); 26356 else try { 26357 n.innerHTML = t; 26358 } catch (e2) { 26359 n.innerText = t; 26360 } 26361})
vendor: 12,098 bytes, line 26361
26361(document, ':root{--swal2-outline: 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-container-padding: 0.625em;--swal2-backdrop: rgba(0, 0, 0, 0.4);--swal2-backdrop-transition: background-color 0.15s;--swal2-width: 32em;--swal2-padding: 0 0 1.25em;--swal2-border: none;--swal2-border-radius: 0.3125rem;--swal2-background: white;--swal2-color: #545454;--swal2-show-animation: swal2-show 0.3s;--swal2-hide-animation: swal2-hide 0.15s forwards;--swal2-icon-zoom: 1;--swal2-icon-animations: true;--swal2-title-padding: 0.8em 1em 0;--swal2-html-container-padding: 1em 1.6em 0.3em;--swal2-input-border: 1px solid #d9d9d9;--swal2-input-border-radius: 0.1875em;--swal2-input-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-background: transparent;--swal2-input-transition: border-color 0.2s, box-shadow 0.2s;--swal2-input-hover-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px transparent;--swal2-input-focus-border: 1px solid #b4dbed;--swal2-input-focus-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.06), 0 0 0 3px rgba(100, 150, 200, 0.5);--swal2-progress-step-background: #add8e6;--swal2-validation-message-background: #f0f0f0;--swal2-validation-message-color: #666;--swal2-footer-border-color: #eee;--swal2-footer-background: transparent;--swal2-footer-color: inherit;--swal2-timer-progress-bar-background: rgba(0, 0, 0, 0.3);--swal2-close-button-position: initial;--swal2-close-button-inset: auto;--swal2-close-button-font-size: 2.5em;--swal2-close-button-color: #ccc;--swal2-close-button-transition: color 0.2s, box-shadow 0.2s;--swal2-close-button-outline: initial;--swal2-close-button-box-shadow: inset 0 0 0 3px transparent;--swal2-close-button-focus-box-shadow: inset var(--swal2-outline);--swal2-close-button-hover-transform: none;--swal2-actions-justify-content: center;--swal2-actions-width: auto;--swal2-actions-margin: 1.25em auto 0;--swal2-actions-padding: 0;--swal2-actions-border-radius: 0;--swal2-actions-background: transparent;--swal2-action-button-transition: background-color 0.2s, box-shadow 0.2s;--swal2-action-button-hover: black 10%;--swal2-action-button-active: black 10%;--swal2-confirm-button-box-shadow: none;--swal2-confirm-button-border-radius: 0.25em;--swal2-confirm-button-background-color: #7066e0;--swal2-confirm-button-color: #fff;--swal2-deny-button-box-shadow: none;--swal2-deny-button-border-radius: 0.25em;--swal2-deny-button-background-color: #dc3741;--swal2-deny-button-color: #fff;--swal2-cancel-button-box-shadow: none;--swal2-cancel-button-border-radius: 0.25em;--swal2-cancel-button-background-color: #6e7881;--swal2-cancel-button-color: #fff;--swal2-toast-show-animation: swal2-toast-show 0.5s;--swal2-toast-hide-animation: swal2-toast-hide 0.1s forwards;--swal2-toast-border: none;--swal2-toast-box-shadow: 0 0 1px hsl(0deg 0% 0% / 0.075), 0 1px 2px hsl(0deg 0% 0% / 0.075), 1px 2px 4px hsl(0deg 0% 0% / 0.075), 1px 3px 8px hsl(0deg 0% 0% / 0.075), 2px 4px 16px hsl(0deg 0% 0% / 0.075)}[data-swal2-theme=dark]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}@media(prefers-color-scheme: dark){[data-swal2-theme=auto]{--swal2-dark-theme-black: #19191a;--swal2-dark-theme-white: #e1e1e1;--swal2-background: var(--swal2-dark-theme-black);--swal2-color: var(--swal2-dark-theme-white);--swal2-footer-border-color: #555;--swal2-input-background: color-mix(in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10%);--swal2-validation-message-background: color-mix( in srgb, var(--swal2-dark-theme-black), var(--swal2-dark-theme-white) 10% );--swal2-validation-message-color: var(--swal2-dark-theme-white);--swal2-timer-progress-bar-background: rgba(255, 255, 255, 0.7)}}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px var(--swal2-backdrop)}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}@media print{body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop,.swal2-toast-shown) .swal2-container{position:static !important}}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:var(--swal2-container-padding);overflow-x:hidden;transition:var(--swal2-backdrop-transition);-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:var(--swal2-backdrop)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container)[popover]{width:auto;border:0}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:var(--swal2-width);max-width:100%;padding:var(--swal2-padding);border:var(--swal2-border);border-radius:var(--swal2-border-radius);background:var(--swal2-background);color:var(--swal2-color);font-family:inherit;font-size:1rem;container-name:swal2-popup}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable{cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-draggable div:where(.swal2-icon){cursor:grab}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging{cursor:grabbing}div:where(.swal2-container) div:where(.swal2-popup).swal2-dragging div:where(.swal2-icon){cursor:grabbing}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:var(--swal2-title-padding);color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;overflow-wrap:break-word;cursor:initial}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:var(--swal2-actions-justify-content);width:var(--swal2-actions-width);margin:var(--swal2-actions-margin);padding:var(--swal2-actions-padding);border-radius:var(--swal2-actions-border-radius);background:var(--swal2-actions-background)}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:var(--swal2-action-button-transition);border:none;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm){border-radius:var(--swal2-confirm-button-border-radius);background:initial;background-color:var(--swal2-confirm-button-background-color);box-shadow:var(--swal2-confirm-button-box-shadow);color:var(--swal2-confirm-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):hover{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-confirm):active{background-color:color-mix(in srgb, var(--swal2-confirm-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny){border-radius:var(--swal2-deny-button-border-radius);background:initial;background-color:var(--swal2-deny-button-background-color);
vendor: 5,100 bytes, line 26361
26361box-shadow:var(--swal2-deny-button-box-shadow);color:var(--swal2-deny-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):hover{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-deny):active{background-color:color-mix(in srgb, var(--swal2-deny-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel){border-radius:var(--swal2-cancel-button-border-radius);background:initial;background-color:var(--swal2-cancel-button-background-color);box-shadow:var(--swal2-cancel-button-box-shadow);color:var(--swal2-cancel-button-color);font-size:1em}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):hover{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-hover))}div:where(.swal2-container) button:where(.swal2-styled):where(.swal2-cancel):active{background-color:color-mix(in srgb, var(--swal2-cancel-button-background-color), var(--swal2-action-button-active))}div:where(.swal2-container) button:where(.swal2-styled):focus-visible{outline:none;box-shadow:var(--swal2-action-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-styled)[disabled]:not(.swal2-loading){opacity:.4}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid var(--swal2-footer-border-color);background:var(--swal2-footer-background);color:var(--swal2-footer-color);font-size:1em;text-align:center;cursor:initial}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:var(--swal2-border-radius);border-bottom-left-radius:var(--swal2-border-radius)}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:var(--swal2-timer-progress-bar-background)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em;cursor:initial}div:where(.swal2-container) button:where(.swal2-close){position:var(--swal2-close-button-position);inset:var(--swal2-close-button-inset);z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:var(--swal2-close-button-transition);border:none;border-radius:var(--swal2-border-radius);outline:var(--swal2-close-button-outline);background:rgba(0,0,0,0);color:var(--swal2-close-button-color);font-family:monospace;font-size:var(--swal2-close-button-font-size);cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:var(--swal2-close-button-hover-transform);background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus-visible{outline:none;box-shadow:var(--swal2-close-button-focus-box-shadow)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-html-container){z-index:1;justify-content:center;margin:0;padding:var(--swal2-html-container-padding);overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;overflow-wrap:break-word;word-break:break-word;cursor:initial}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:var(--swal2-input-transition);border:var(--swal2-input-border);border-radius:var(--swal2-input-border-radius);background:var(--swal2-input-background);box-shadow:var(--swal2-input-box-shadow);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):hover,div:where(.swal2-container) input:where(.swal2-file):hover,div:where(.swal2-container) textarea:where(.swal2-textarea):hover{box-shadow:var(--swal2-input-hover-box-shadow)}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:var(--swal2-input-focus-border);outline:none;
vendor: 13,489 bytes, lines 26361-26362
26361box-shadow:var(--swal2-input-focus-box-shadow)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:var(--swal2-background)}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:var(--swal2-input-background);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:var(--swal2-input-background);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:var(--swal2-background);color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:var(--swal2-validation-message-background);color:var(--swal2-validation-message-color);font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:var(--swal2-progress-step-background);color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:var(--swal2-progress-step-background)}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;zoom:var(--swal2-icon-zoom);border:.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}}div:where(.swal2-icon).swal2-warning{border-color:#f8bb86;color:#f8bb86}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}}div:where(.swal2-icon).swal2-info{border-color:#3fc3ee;color:#3fc3ee}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}}div:where(.swal2-icon).swal2-question{border-color:#87adbd;color:#87adbd}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}@container swal2-popup style(--swal2-icon-animations:true){div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:var(--swal2-show-animation)}.swal2-hide{animation:var(--swal2-hide-animation)}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;border:var(--swal2-toast-border);background:var(--swal2-background);box-shadow:var(--swal2-toast-box-shadow);pointer-events:all}.swal2-toast>*{grid-column:2}.swal2-toast h2:where(.swal2-title){margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-toast .swal2-loading{justify-content:center}.swal2-toast input:where(.swal2-input){height:2em;margin:.5em;font-size:1em}.swal2-toast .swal2-validation-message{font-size:1em}.swal2-toast div:where(.swal2-footer){margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-toast button:where(.swal2-close){grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-toast div:where(.swal2-html-container){margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-toast div:where(.swal2-html-container):empty{padding:0}.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-toast div:where(.swal2-actions){justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-toast button:where(.swal2-styled){margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}@container swal2-popup style(--swal2-icon-animations:true){.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}}.swal2-toast.swal2-show{animation:var(--swal2-toast-show-animation)}.swal2-toast.swal2-hide{animation:var(--swal2-toast-hide-animation)}@keyframes swal2-show{0%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}100%{transform:translate3d(0, 0, 0) scale(1);opacity:1}}@keyframes swal2-hide{0%{transform:translate3d(0, 0, 0) scale(1);opacity:1}100%{transform:translate3d(0, -50px, 0) scale(0.9);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}'); 26362const
26362useSweetAlert = () => { 26363 const baseCustomClass = { 26364 popup: "rounded-xl dark:bg-gray-800 dark:text-white", 26365 icon: "text-xs", 26366 confirmButton: "rounded-lg active:outline-none", 26367 cancelButton: "rounded-lg active:outline-none" 26368 }; 26369 const showAlert = (options) => { 26370 return Swal.fire({ 26371 ...options, 26372 customClass: { 26373 ...baseCustomClass, 26374 ...options.customClass 26375 } 26376 }); 26377 }; 26378 const showAlertOption = (options) => { 26379 return Swal.fire({ 26380 ...options, 26381 showCancelButton: true, 26382 confirmButtonText: options.confirmButtonText || "SÃ", 26383 cancelButtonText: options.cancelButtonText || "No", 26384 confirmButtonColor: options.confirmButtonColor || "#0ea5e9", 26385 cancelButtonColor: options.cancelButtonColor || "#6366f1", 26386 customClass: { 26387 ...baseCustomClass, 26388 ...options.customClass 26389 } 26390 }); 26391 }; 26392 const showSuccess = (message) => { 26393 return Swal.fire({ 26394 icon: "success", 26395 title: "¡Ãxito!", 26396 text: message, 26397 confirmButtonColor: "#0ea5e9", 26398 cancelButtonColor: "#6366f1", 26399 customClass: baseCustomClass 26400 }); 26401 }; 26402 const showSuccessAutoDestroy = (message) => { 26403 return Swal.fire({ 26404 icon: "success", 26405 title: "¡Ãxito!", 26406 text: message, 26407 timer: 1500,
26408 showConfirmButton: false, 26409 allowOutsideClick: false, 26410 customClass: baseCustomClass 26411 }); 26412 }; 26413 const showHtml = (message) => { 26414 return Swal.fire({ 26415 html: `<div style='text-align:left'>${message}</div>`, 26416 confirmButtonColor: "#0ea5e9", 26417 cancelButtonColor: "#6366f1", 26418 customClass: { 26419 ...baseCustomClass, 26420 popup: "rounded-xl max-w-4xl w-full dark:bg-gray-800 dark:text-white" 26421 } 26422 }); 26423 }; 26424 const showError = (message) => { 26425 return Swal.fire({ 26426 icon: "error", 26427 title: "Error", 26428 text: message, 26429 confirmButtonColor: "#0ea5e9", 26430 cancelButtonColor: "#6366f1", 26431 customClass: baseCustomClass 26432 }); 26433 }; 26434 const showErrorAutoDestroy = (message) => { 26435 return Swal.fire({ 26436 icon: "error", 26437 title: "Error", 26438 text: message, 26439 timer: 1500, 26440 showConfirmButton: false, 26441 allowOutsideClick: false, 26442 customClass: baseCustomClass 26443 }); 26444 }; 26445 return { 26446 showAlert, 26447 showSuccess, 26448 showSuccessAutoDestroy, 26449 showErrorAutoDestroy, 26450 showHtml, 26451 showError, 26452 showAlertOption 26453 }; 26454}; 26455const chatBubbleImage = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAQAElEQVR4AeydC3LjOLJ21X/cfXXPynpmZXd6Xzeifp2yadM2JfGBRyZwKgyTIkEg8wDI/EjJqv93858EJCABCUhAAtMRUABMN+Q6LAEJSEACErjdFADOAglIQAISkMCEBBQAEw66LktAAhKQwNwE8F4BAAWLBCQgAQlIYDICCoDJBlx3JSABCUhgdgJv/isA3jj4WwISkIAEJDAVAQXAVMOtsxKQgAQkMDuBxX8FwELCrQQkIAEJSGAiAgqAiQZbVyUgAQlIYHYCn/4rAD5ZuCcBCUhAAhKYhoACYJqh1lEJSEACEpidwNp/BcCahvsSkIAEJCCBSQgoACYZaN2UgAQkIIHZCXz1XwHwlYevJ
26455CABCUhAAlMQUABMMcw6KQEJSEACsxP47r8C4DsRX0tAAhKQgAQmIKAAmGCQdVECEpCABGYn8NN/BcBPJh6RgAQkIAEJDE9AATD8EOugBCQgAQnMTmDLfwXAFhWPSUACEpCABAYnoAAYfIB1bwoCf929XJd/31+/Kv97r7OUV3XX59f93JvwRwISiE9g20IFwDYXj0qgJ4F1kl2S75Ksl+2vu4FLWY4t27/v516VdR+v6q7PL32wXfpfthyjLDYvW/q6m+SPBCQQiYACINJoaMssBEiISyFJkjSXQjJd9tkuyXepv2wjslpsW2xetviBX0vhNX4vhesi+qNNEhiCwCMnFACPyHhcAtcJkNgoJDqSHoUkyHYpJEnqLOV6r/FbwFf8Xgos4EJhH14U6sX3RgslkJSAAiDpwGl2OAIkKwoJjLIkM/ZJdJyjhDM8mEEwghcFdnCksI8ooFAnmNmaI4GoBB7bpQB4zMYzEnhEgAREISlRlgTFPscpj64tcvyPIq2kagSmiAIKnGFOQRBQOJ/KIY2VQG8CCoDeI2D/GQiQXEgyS+JhS+E4pbkPZL7mncbsEEFAYTzAwjhRuoxLTERaNTOBZ74rAJ7R8dysBEgeJBQKSYUtSYbjszLJ4jfjRGHMlrFDEFCy+KCdEmhCQAHQBLOdBCdAYqeskwavKcFN17wXBBhDBAFlLQg4/uJST0sgO4Hn9isAnvPx7LgESAAk/HXh2Lge6xkEGGPEAOOOIODJAIVzFglMRUABMNVwT+0sgZ+yBH62vKZMDWZy5xEDFMQAcwIx4JyYfFKM4v4rPxQArwh5PjMBAjlBfV04ltknba9HgLmBGGC+IAgUA/VY23IAAgqAAIOgCUUJEMQJ4EvhNaVoJzY2BQHFwBTDPKqTr/1SALxmZI34BEjwS8Jny2tKfMu1MAuB72Igi93aKYGHBBQAD9F4IjgBEjyFhE9hnxLcbM0bgABigLcImHe8TTCAS7owGoE9/igA9lCyTiQCJHkC71J4Hck+bZmHAHNvEQMIAco83utpegIKgPRDOIUDBNol4bPl9RSO62QaAggBCk8GFAJphm1UQ/f5pQDYx8lafQiQ6En4FPYpfSyxVwnsJ7AWAoqB/dys2ZiAAqAxcLt7SYAkT8LnTootr19eZAUJBCSAEKAwlxUCAQdoVJP2+qUA2EvKerUJkOhJ+BT2a/dn+xJoSWAtBBQDLcnb10MCCoCHaDzRiADJnqRPYb9Rt3YjgS4EEAIU5rtCoMsQjN7pfv8UAPtZWbMsAZI9QZDCftnWbU0CsQkw5xECvj0Qe5yGtk4BMPTwhnOOoMddD0HPxB9ueDSoEwGFQCfwI3Z7xCcFwBFa1j1LgMRPwqcQ7M6243USGJkAawNxjEge2U99C0JAARBkIAY1Y5342R/UTd2SQFECCoGiOGdq7JivCoBjvKy9jwDJnrt9Cvv7rrKWBCSwJqAQWNNwvzgBBUBxpFM3SLIn6VPYnxqGzkugEAGFQCGQozdz1D8FwFFi1n9EgPctTfyP6KQ9/kdaywc0XCEw4KD2dEkB0JP+GH2T+PngEsFpDI/0YkWAoV293NhVImxAqXuItcbAsPbq9mTriQgcN1UBcJyZV7wR4BE/QYhg9HbE31MSYBJM6Xh/p1l74FcI9B+LlBYoAFIOW1ejSfw86qd0NcTOJSCB3wQQAqxHhcBvHHP+OuO1AuAMtTmvWSd+9uekkMZrH8ynGaoyhrImEQKKgDI8p2hFATDFMF92kqDCHQZB5nJjNtCCAE+GW/RjH8EIIAIYfNZsMNM0px6Bcy0rAM5xm+UqEj7BhKAyi8/6KYERCLBmWbsKgRFGs5IPCoBKYJM3S+Lnjp+S3BXNl8ArAkO/XYIQQASwpl+B8HxSAmfNVgCcJTfudQQLEr8Bo8kYD518mhC83gk3ytdbCdwCIoA1zdoObKamtSagAGhNPG5/JHyCBMEirpUdLauTqodPPh1HzK6/EWBtM+EUAt/A5H553noFwHl2I11JQCD5IwJG8quoL0TOog3amAT6EEAIsOb79G6vYQgoAMIMRRdDSPjkNQJCFwPsVAIS6EKANc/aVwh0wV+u0ystKQCu0Mt9LXf8lNxeaL0EJHCFAEJAEXCFYOJrFQCJB++k6Sx2lD93/yeb8DIJSGAgAogAYgKxYSC3ZnDlmo8KgGv8sl3NHT+LPZvd2isBCdQnQGxQBNTnHKYHBUCYoahqCHf7JH+2VTs63Hidj9YfNsMLJCCB3wQQAT4N+I0i/q+rFioArhKMfz2KPmbyhx2hhq3lKIH/3i9Yyn/u+0v5133/UUFu7S1bbSx9LNulf7b3bv0ZiABCgNgxkEu68p2AAuA7kXFec7dP4mchj+PV6J6Qnm83EupSSLbrZEwNyvoYgXopy3Vb29uBf1vXL30s27UN2ERZjmH3Upa2DnRv1QAEiB3EEGJJAHM04SuB668UANcZRmyBAJ1+4ZJNIsItaNOSGEmUb4nz1w233/ZvN7aM5VKPbcHuqzSFjRTsXgp+UBbf8Hcp1K1iiI0WIUDyJ5YwlkUatJE4BBQAccailCUsVpR7qfa6tfOrW89VOibRkfRIhJQlGbJPcOU8pUrngRrFR/xdCv7DggIfCnUCmawpdwLEFMbsvutPBAIlbFAAlKAYo41FqbONYdG8VpDAKCQ3CsmNLQGU45R56Tz2HD4UWC3MEAQUmT3m1uoMIgBdboxpRbxyPwqAyoAbNU/Q5M7fhdkI+LduSE4kqXXiYp/jlG/VfbmTAOyY2xR4rkUB53Y2Y7XCBIg1jEnhZm1uP4EyNRUAZTj2bIWFiDLvacNsfZN8KOukxDhwbDYWrf2FMawX9ggvCsdb2zJzf8QcxmFmBul9VwDkHULu9lHiLMS8XuSxnASzJB22FI7l8WBMS0lCFMaDJwSIAcqY3sbyithDDIpl1QTWlHJRAVCKZNt2luTPtm3P8/RGcqcsiYUtr+chkNNTxAAFMcCYKQbqjiMxiM8FwLxuT7ZenIACoDjS6g2y0FTddTCT4EkYJI6lcKxOb7ZamwBjx3pZiwGO1e53xvZ5GgDrGX1v7HO57hQA5Vi2aInEz0Jr0dcsfZAQlmTPliDGsVn8n8VPxpSxZYwRBAi9WXxv5SexCcat+rOfiwQUABcBNryc5M/jtoZdDt0VCYFkQGGfMrTDOveFAIkKIcD4Kwa+oLn0AhFArLrUiBc/JlDyjAKgJM06bZH0eY+NbZ0e5mmVJE/AXwI/r+fxXk+3CDAHFjGAEKBs1fPYfgLEKmPWfl7daioAuqHf1TELSTW9C9XDSgR4k/5DPJ5YEUAIUBCICoEVmJO7xC54nrzcy34SKHtEAVCWZ8nWWDgsoJJtztTWkvhJ/uzP5Lu+XifA+luEgGLgPE/eEoDl+Ra8shoBBUA1tJcaZsGwcC41MunFBGuSPsXEP+kkKOg2a5GyiIGCTU/TFLEMhtM4XMvR0u0qAEoTvd4eC4UFc72leVog0ZPwCdLw4/U83utpKwLMLeYYItM5dow6MQ1+x66ydlUCCoCqeA83ziN/FsrhCye9gCBM4qewPykG3W5MgETGnEMIUBp3n7Y7YhsxLq0DfQ0v37sCoDzTMy0uH/Zje+b62a4h2ROAKezP5r/+xiCAEKAgAigxrIptBTEOEcA2tqUTWKcA6D/ILAQXxL5xINmT9Cns77vKWhKoSwARQFneHqjbW/7WjXknxrDGJQqAGlT3t7kshP1XzFmTZE/Sp7A/JwW9zkBAIbB/lLzx2c+qSk0FQBWsuxo1+b/GRLIn6VPYf32FNSQQg0BQIcBDihiA3q1QBLyDeL6pc1YBUIfrq1ZN/s8JkexJ+hT2
26455n9f2rATiEkAIMI+DfEaAL+gLB0sR0GlIFADtwcdO/n1vEEj2BEsK++1Hxx4lUJ4AcxkhgAhgv3wP+VtEBMAovycVPKjVpAKgFtntdpngTPTtsw2PPszzfW4QCIokfQr7DUnYlQSaEWD9M8cRAs06TdQRfyYIo0Qm5zZVAdBu/JjYTPB2PT7pqU+e3zSIYEhQNPFv4vHggASIBWhw5v6A7l1yiRgJn0uNjHVxPW8UAPXYrltmQjOx18dm3yfhEwRhMzsL/Z+TAHOfNaAQ+Dr+xErYfD3qq+IEFADFkf5okInMhP5xYtIDJH7u+CmTItBtCXwhQIxQBHxBciNmwuXr0Qlf1XRZAVCT7u3GBGYi3/z3mwBBjsSPCPh9wF8SkMBvAsQKnwb8RvHxi9j518crd4oTUAAUR/rRIBOXCfxxYO8OUWBv3ST1SPgkfoJcEpM1UwJdCLBGCAGI5S4GPO0Uy55WKH6SD00TS4s3nKPBulYqAOrwZcIycU+1HugDeqfsX120JH6SP/urU+5KQAJPCCAE4omAPsGJWEpMfYLLU2cIKADOUHt+DROVCfu81vhnCV4m/vHHWQ/rEUAEcM/NWqrXS46WianE1hzWFrKydjMKgLKEmaBM1LKt5muNxE/wyme5FksgHgHWkiLgdiO2EmPjjVBSixQA5QaOickELddivpZ4zM8dC9t81muxBOISQASwtmYXAsRYYm3ckSpmWf2GFADlGJ/6wF+57ru3xF0/pbshGiCBgQkgBGYXAbPH2mLTWwFQBuXMqpS7fRI/2zI0bUUCEnhGABEw89MAngAQc58xSn+uhQMKgOuUWYxMyOst5WuBOxGTf75x0+IxCBB7WINjeHPMC2Iu/h+7ytpfCCgAvuA4/IIJOOPjKO72Sfz4fxiaF0hAAsUIsAZZi8UaTNQQsRf/E5m819Q29RQA5zkz8ZiA51u4eCXPAC82cebyJfmzPXO910hAAmUJsBYJBzM+DSAGE4vLEp2kNQXAuYFmwjHxzl1d6KoO38lBgJn1bqPQqNmMBKoRIC6xRqt1ELRhYjFvCQQ177hZra5QABwnzURjwh2/MvcVJH4CTG4vtF4CYxNgjc4oAvhQILF57NEt7J0C4DhQJtrxq/JesTxeZJvXCy2XwDwEEAEzviUwSGxuN1EVAMdYzzbBuJPgzv8YJWtLQAIRCCAEWMMRbGllw2wx+hJXBcB+fCymmR4xETjweT8ha0pAAtEIsIZZy9HsqmUPMTq1CKgFe1JSCQAAEABJREFUZqtdBcAWlZ/HWESh3/fned9Ps08f4a4fn0834IUSkEAYAqxl1nQYgyobggjA58rd5G9eAfB6DJlIoZM/LhT6iwDe5ydQsKVZiwQkMAYB1vRMa5uYjRBINnptzVUAvObNRHpdK3+N2QJE/hHTAwkcIzDbGuetAEXAkzmiAHgC536KCXTfDP/De4TcHQzvqA5KQAI31jprfgYUqW7gWg+IAuAxcR7991ePhd/c33CXQICvG6c8JAEJDEqANc/aH9S9D7eI4fj6ccCdTwIKgE8W6z0mTAzlWOjN/bVzq30CAL6uDrkrAQlMQoC1TwwY3V1iOb4G97O9eQqAn8xRjEyYn2fGOsLCd1GMNaZ6I4GjBIgBxIKj1z2vX//J5fP+f54lphPbf56Z+IgC4Ofgz/C+P+8BsvB/eu8RCUhgNgLEAmJCOb/rPrk8ayci4Oy11a/r0YEC4Ct1FsLXI+O9YqHzaeDxPNMjCUjgLAFiArHh7PUZruMJwAw3eLvHQgHwiYrkP7pCZIGz0D+9dk8CEpDAGwFiAzHi7dWYvxEBxPpg3vUxRwHwxp1JYfJ/Y+FvCUhgXgL1RECczwUQ64n5847yu+cKgDcQTIi3vVq/+03+ZUGzreWd7UpAAuMQIFaUfxIQ63MB9WP+gfnQq6oC4HbjcdBft9r/Wkz+bZHBQmZB1/bQ9iUggXEIEDOIKGzH8erTE2I+sf/zyIR7swsAJsA4SvCnyCD5TzitdVkCEihEoPyfCBYyrEAzxH6EQIGmrjTR79rZBQAToB/9uj2T/EdV73XJ2boEJLAQIIYQS5bXo21HzgEvx2pmAcDd/0tASSuwYFm4Sc3XbAlIIBABYgkxJZBJxUzhCUDXPw0s5smJhmYVACT/UZUfC5UFe2I6eIkEJCCBTQLEFGLL5snkBxEB5ITkbhw3f1YBYPI/Ple8QgISmJvAyCKgU07oO6FmFACjKj0+rMMC7Tuj7F0CEhiZADGGWDOij9O9FTCbACD5j6j0WJD4NuKi1CcJSCAWAWINMSeWVdet4a0AyvWWdrbQu9psAsDk33vG2b8EJDACgVFFwFRPAWYSAEzYERbe2gdU+Ih+rX10XwISiEmA2EMMimndeavw6/zVu6/sX3EWAcCAjnb3z3tx+NV/FmmBBCQwKwFiELFoJP/JFVO8FTCLAGBAR5qgLLhR/yRnpHHSFwnMQIBYRExK6ivfePzD9Oo540ePHQ7MIABQqB3QVu1yxMduVYHZuAQkUJVA4pj08zvU76R4AjBi7ri79vkzugBgEEdTcsnV9ufkc08CEhiGAE8AiE3DOHR3hNxBDrnvlv6J0d4MAiAG6TJWoLJZaGVasxUJSEAC5QgQm4hR5Vrs3xIioL8VlSwYWQDw+GakwWNh4VOlqWCzEpCABC4TIEYRqy43FKQBngBQipoTpbGRBYDJP8os0w4JSGAmAogAngaM4vOw3w0wqgBgAo4y+fBjNH/wySIBCYxLYLTPAxSMwXEGfVQBMNrdf5wZoyUSkIAE9hEYSQSQU4Z7K2BEATCSUuO9tJH82Rc2rCUBCYxAgLcBiGEj+IIPiAC2l0qki0cTACTLUQaJhYM/keaLtkhAAhI4QoAYhhA4ck3UujwBoES177BdowmAPw8TiHsBCyeudVomAQlIYB8B3goYRQRcvMHcB6xVrZEEAAlzFHXGgmk1B+xHAhKQQG0CPNGs3UeL9skxlBZ9Ve9jJAEwijJjoYyilqtPYDuQgARSECCmEdtSGPvCyNN/Fvii3eanRxEA3P03h1ehQxbIKL5UwGOTEpBAYgLENoRAYhc+TMeXjxdZd0YRAKPc/Q8xqbIuBu2WgASqE+Amp3onDTo4kXMaWHWwixEEwChJc5SFcXAKWl0CEpiIAE8ARvmMU/rcM4IAGEGJkfzTT6aJgpiuSkAC5wkgAijnW4hxJbln9wcCY5j81YrsAmCUpDmKH19nl68kIAEJbBMY5SkAImDbwwRHswuA1PDf5wd3/++7biQgAQlMQ2AEEcATAMqLQYt5OrMAGOGumeQ/gh8xZ7dWSUACkQnwNgAxMLKNe2xLeyOaWQCkhb6aUSb/FQx3JSCB6QgQAxECmR3nCQDloQ9RT2QVAEyaqEz32jWC8t3rq/UkIAEJPCIwQixMeUOaVQCkhL2a/Uz4EUTMyiV3JSABCZwiwBMAyqmLg1zEEwDKhjlxD2UUACMkzhF8iDurtUwCEshGgJuibDZ/tzfdjWlGAZAO8rdZMsJE/+aSLyUgAQlcIsATgOyxkScAlC8gIr/IJgBGuHMewYfIc1rbJCCBnASIjQiBnNa/Wa0AeONQ5bd3/1Ww2qgEJCCBEASyPwX4lqNCMH1oRKYnAKjDh44kOMHEzu5DAsyaKAEJJCbAEwBKYhduaZ4CZBIAqZTV7ec/k/9PJh6RgAQk8J1A9m8I/MhV3x2L9jqLAMiePLn7jzb22iMBCUggKoHMMZMnAJSobD/syiIA/vywOOdOdgGTk7pWS0ACWQkQMzO/FfD37RYffQYBwERIoaYeDHdmJfvAJQ9LQAISqE4gc+wkZ1GqQ7rSQQYBcMW/3teiYBEwve2wfwlIQALZCBA/Kdns/m3v/Vf4zwJkEADhId4H+tHPP49OeFwCEpCABF4S8CnAS0TnK0QXAJnvnpm4me0/P6u8UgISkEAZAjwBoJRprVkrHx2FvoGNLgBCw/sY4u2dzJN22yOPSkACEmhPgJup9r2W6TH05wAiC4DMd89MWAVAmQVkKxKQwNwEiKWUNBS+GRpWBEQWAN8YpnqZWbykAq2xEpDAFAS4qcrqaNgn2ZEFQFhoL2Zh5on6wjVPS0ACEuhCgCcAlC6dH+v0R22eAFB+nOh9IKoAyHwHndn23vPR/iUgAQk8IpD55irkDW1UARAS1qNZuTqeeYKu3HBXAhKQQDgCPAGghDNsbVCm/YgCIPMddGbbM81bbZWABOYkkPUmi7cAKKFGLaIACAXogDFZJ+YBF60qAQlIoCsBngBQuhrxuPOnZ8I92Y4oAMJBejqknpSABCQggZYEst5s8QSA0pLV076iCYCsj9CZkFltfzpBPCkBCUggGAGeAFCCmXW7ZTMomgD4MxtA7ZWABCQggeYEuOlq3mmBDkM94Y4mAEI9Htk52ChR7/53wrKaBCQggQIEiLuUAk2VamJXO+Q4yq7KtStFEgBZk6j/41/tWWr7EpCABH4S8CnATyaHjkQSAKEejRygmFW4HHDRqhKQgATCEQj1BCAcnR0GRREAYR6J7GC2rpJVga59cF8CEpBAVgKVYvAfNXmQ7yg1+9jVtgJgF6aHlbz7f4jGExKQgASqE6j0FODXQcMPVw/xxDuKAAgB4+AQVlKeB62wugQkIIF5CSAAKPMSuOB5BAEQ4lHIBYZeKgEJSEAC/Qh0vxk74Tp5j3Li0nKXKADOs/Tx/3l2XikBCUigFAGeAFBKtdeqne5PviMIgO4QTox2RsV5wk0vkYAEJJCCQMeYnILPppG9BUD3RyCbVF4f9O7/NSNrSEACEmhFIOMTAPIfpRWjH/0oAH4geXlApfkSkRUkIAEJNCfQRQQ097Jgh70FgN/9X3AwbUoCEpDAxAQy3px1fQu8twDo+vjj5ELx8f9JcF4mAQlIoCKBDk8Afnpz8CuEuubAngIgYyLNqDB/zlCPSEACEhiTQHcRcOIrhLqJgJ4CIOP06z65MkLTZglIQAKNCDS9SSvkU7e3AXoKgG5OXxg0BcAFeF4qAQlIoDIBYjSlcjdjNN9LAHR75HFh2DIqywvueqkEJCCBlAQaxepibMiHlGIN7m0ohgA4+KmJvc4VrpfxMwuFEdicBCQgAQmMQqCXAPj6538nPjXReAB8pNQYuN1JQAISOEmAeE05efm+ywrX6vKWeC8B0OVxx4UB++fCtV4qAQlIQAJtCWSL2V1yYg8BkPFRejY12Xap2ZsEJCCBWAQqx+wqzjYXAT0EQBVypRp98HGEjJOpFBLbkYAEJJCNADGbksnu5m8D9BAAX9//DzY8Gx9HyPaJ0mBENUcCEpDAWARG8aaHAGj+mOPiYGVTkRfd9XIJSEACQxDIdvPWPDe2FgDNHSwwjRUABSDahAQkIIHGBCrF7qpeNM2RCoDnY5lNQT73xrMSkIAE5iKQTQQMLQDmmnp6KwEJSEACPQkUv4mr7EzTz8i1fgLQ/FOOFwcr458sXnTZyyUgAQkMQ8AnAE+GsqUAaPpo44nPe09lmzh7/bKeBCQggZkIFIzlTbA1y5UKgMfjme2bpB574hkJSEACEpDANwItBcC3rn0pAQlIQAISqE6g2OcAqlv61kGzt8pbCoBmTr0xvPzb9/8vI7QBCUhAAt0JZHsLoBmwlgKgmVMFOnLCFIBoExKQgASCECgQ06968uCL5n82O9xnAJo59JPlqSO+/38KmxdJQAISCEkgQEzf+KL5x6ia5MxWTwCaOPOY5eEzAdTiYZu9QAISkIAEtglcjunbzeY+2koAZKPkZMk2YtorAQlI4DGBbDG9yWfmWgmApt9u9HgO7DqTbaLscspKEpCABCYncCG2j0mulQDI9BZAgPeKxpxseiUBCUhAArsINMmZrQTALo+tJAEJSEACEqhE4PT3AVSy51Wz1UVACwFQ3YlXFA+e9zHRQWBWl4AEJCCBfAQUAD/HTAHwk4lHJCABCWQncDK2d3O7+s1zCwHQjd6JjrNNkBMueokEJCCBaQlkivHVPzzfQgBUd6LgVPYDgAVh2pQEJCCBYAQOx/hg9hc1p4UAqP4YoygRG5OABCQggVEJZHoCUD13thAAmSaS/wFQptHSVglIQAJVCXRvvKoIqC0AqhrffWg0QAISkIAEMhHI9ASgOlcFwCdiJ8YnC/ckIAEJjEpgd6wfFcDiV20BsPSTYeuHQzKMkjZKQAISmIdA1afoCoB5JpKeSkACEpDA7bbzZi8Eqqp/RVdbAFQ1PsTwaIQEJCABCWQi4FsA76NVWwBUfXzx7sOFzR/ra50UaxruS0ACEpiYwA
26455yu1xYAwRn+WtunAFjTcF8CEpDAmAQyxfqqN9GTC4CP2Z1pQnwY7Y4EJCABCZwi8CLmn2qz1kXVREBNAVDN6FqUbVcCEpCABCQwCwEFwNtIZ/pU6JvF/paABCQggSoEZmm0pgCYhaF+SkACEpBALgKZbvqqPU1XAOSatForAQlIQALXCTz5DMD1xrO0oAB4GyknwxsHf0tAAhKQwEMCX/50/GGtwieqfZ9OTQFQzejCcG1OAhKQgAQk8JvA819f/nT8edUEZ2sKgATuf5joE4APFO5IQAISGJ6AMf8+xDUFQLUPLtzt9kcCEpCABCRQmMBczdUUAFlIqgSzjJR2SkACEihHIEvsr3YzrQAoN5lsSQISkIAEEhOYzXQFwGwjrr8SkIAEJCCBO4FaAqDaI4u7zaV/Mn0hRGnfbU8CEpDArAS+xf7QGKrk1FoCIDRJjacbz3IAABAASURBVJOABCQgAQnMTkABMPsM0H8JSEACErjNiKCWAKjyuGLGAdJnCUhAAhKoQiDLXwFUcZ5GawkA2s5Spp8EWQZKOyUgAQnUIRC+1So31QqA8OOugRKQgAQkMA+Bdv/fgAJgnlmlpxKQgAQksEEg1qF2/9+AAiDWyGuNBCQgAQlIoAkBBUATzHYiAQlIQAIxCcxrlQLgdvNDgDf/SUACEpDAbAQUALONuP5KQAISkAAEft/8sTNrUQDMOvL6LQEJSEACUxNQAEw9/DovAQlIYGYCc/uuAJh7/PVeAhKQgATiE/izhom1BEAVY2sAsE0JSEACEpiTwOxe1xIAs3PVfwlIQAISkEBoArUEwD+hvdY4CUhAAhKYnEAq96vk1FoCIBVZjZWABCQgAQnMRkABMNuI668EJCABCdxEcLspAJwFEpCABCQggQkJKAAmHHRdloAEJDA3Ab2HQC0BkOkrFv8ChEUCEpCABKYiMH3sryUApppFOisBCUhAAnkI1LL0j1oNV2pXAVAJrM1KQAISkEBgAv9T3rZf5Zus2qICoCpeG5eABCQggVgE3q35v/ftxBsFwMSDr+sSkIAEJDAvAQXAvGOv5xKQgASmI7By2A8BrmCU3PWvAErStC0JSEACEpiZQJWc6hOAmaeUvktAAhKYioDOrgkoANY03I9IgMd0lIi2aZMEJCCBtAQUALfbn2lHb2zDSfr/e3eR8vd9648EMhH4991Y/iqMLeX+0p/eBL71nyn2+xbAt8Hz5ZgE1omffbxkS2HfIoEMBBbRypaCCKBksF0bJyHgE4BJBjqBmwRH7vYpW8l+61gCtzRxQgLM5e9uIwIoy1OB7+d9XZ2AHXwnUFMA/PeW7XsRv9PxdW0CJHUSPkGR4MjrR31y/tE5j0sgEoFXc5XzzPktoRDJj9FteRZvRvf9t381BcDtxhT/3U3oX9NPgg6jA3MSP4X9vSYcqbu3TetJoCSBI0n973vHREmuodxf+lOLQOJ2/1vL9roCoJbV5ds1sZRnutUinEn6FPa36jw7RsB8dt5zEuhN4MwHy5jXlEUM9PZhhv7PxJ/huCgAhhvScA6x0Ej4BDe2vD5rJNdSzl7vdRKoSYC7+KvzUyFQZYRSN/pPLetrCoBqRteCYbtFCRAISfgU9ks1ToAs1ZbtSCAqAeY5ohlRQYlqZ1a7SsakrAxuNQVAtfctKtB2MpSDCkuSPoX9ci2/tUSblLdX/pZAHAIk7dLW0CaF9aQQOEnXy7YJ1BQA2z16dFQCBCfuWAhUtRM0AXFUjvqVkwDzv6blrCnmPWusdl81/bDtQAQUAG+DceaDO29Xzv2boETCJygRnFrRoN9WfdmPBPYQaDn/6Ys1hxBwLbwcnc0KmWJ+tafpNQVANaM3h9ODLQkQdEj8FPZb9r301avfpX+3ElgIkIiX/ZZbhABrkP4pLfu2r3YEquXSmgIAPNUMp/GCxWSyDyacCDgU9vddVacWwa9Oy7YqgWMEes9F+qcsTwWOWT947Qfu9Y5fD8xqe7i2AGjrzbXenBDb/OBCwie4sOX1ds22R7GD0rZXe5PAVwLR7rwVAl/HZ+uVceOdigLgHYSbHwRYJCR8Cvs/KgQ4QLALYIYmSCAcAdYGoh2BQglnYBuDNnuJGs+2jK36FL22AMj0XQCZJsXWRCl1DA4kfQr7pdqt0Q72UWq0bZsS2EOARLunXq862EdhPSsEeo3C+X6r5tDaAqCqejnPdPPKTJ8K3XTg4kGCA3cMBIpMSZXgdtF1L5fAKQKsmVMXdriINc1aYY1nsvsSKi9+TqC2AHjeu2clcJ0Age16K7YggeMESKjHr/KK3gRmv9n74F9bAGR6AjB7Isl8V5DZ9o/F6E4qApnnXGbbD0ySh1UzxfqqObS2AHg4AkFPZJoYNRBWnWw1DH5v0zuxdxBumhHIOuf+04yQHZUgUDUmtxAAVR0oQdg2PghkDg6zi7ePQXSnOoHMd9DTxOMHsyDz2D1w6fzhFgLgvHXtr5w9iRAcKPvJ/7G/auWaWe/IKmOx+QoEss41BP6x9V0Bnk3uJlB9rFoIgKp/xgDKgjnID4fcbgQJsO4rfKZ4X83atf66d0C5b/yRQDUC3kFWQ1uy4YdtZYrx1XNnCwFQXcXEyUEPJ12mE4wXJZPNi61Z78wW+93GJ5B5jilebjdvEm6f/1oIgM/e4u8xOSjxLa1r4bGnAHVtOdI6Y0c5co11JbCXQOYEmnVN7x2bL/UevMgWG6rfiCkAHsyUyQ9Xn3gV+Wa+Q6uIxaYLEMg8tzKLlwJD97sJBcBvDJ+/WgiAbMkk2yT5HM2ye+XGreCHNHa4yPgZ7HaAssohApnn1GR3/4fGderKLQQAgMslE1qrWzJ9SKQmiXJBo/2HNDLfqdUcU9s+TyDznMosXs6P2M8rM8X2JjmzlQD4ORRxj3AHGde6dpYxASnteizbE/+nQdkWbW1WApkTaDkhn2T0n5iZKbZX/wsAOLUSADEn4eNH05kmCuNYq8Qct33eMoaUfbWtJYFtAsyhrnf/j8PUtsEe3STAOG6emPlg
26455KwEQk3H7R9MxOTy2iicAlMc1Yp/pGrhjo9G6nQS6z6GLYSrz04udQ7Su9nA/mwBoEndbCQCcoTwcnWAnui/6QDyyPwUwAAaaTMlMYe5kSxxrxJnX7tqPEvuZ3v/H3yb5spUAwKFMJfOiL825yUQsbfSqPcSc47kC4u4uAswZ5s6uykErIWCCmlbHrCetMp5PTs95qqUAyKZGnTCfayLb2H1a/raXPZC/eeHvlgSyr//sa7bkWGcTQs3GrqUAKDmgLdrKHgBKMsr+FICxzBYESo6fbR0jwFzJLhrx4ZjX6WvrwFECLQVAtiSS7T2jo2N/pD5jRzlyTeW6hz8bTUBHCFS2y+aTE2COMFcyu9HsDjIJpECxfFfcahZrWwoA5kozx+hsF2oqbhcCwfaZOY8GCyqnPhvtdwPMOXePeD3CHGkaZ4/ArVn3SduBYvmuuNVs/FoLgCdjVP7ULtTPuw00cZ4b2uAsk5LSoKuqXYwQ4KsCmrjxER6bI9RHWKelpmG2MWX8Svn+sp3WAqCpcy+9f10h+6PA1x4eq5Ft/La8Q9RlCwpbfnisLAHmhOu9LNOGrdnVGQKtBUAnZXrxzYAzZMe8hvGjZPeOQE/Az+6H9pchwFxgTpRprV8rCHR86WdBvJ6zjWvT+NpaADA9mjpIh7fb6TcDuFukvDXjbwgQZNhmL3/fHXBs7xAm/2EOMBcmx5Db/QfWM7YPToU93DQ/9hAAYck/MCzjJHrgSpHDTFBKkcY6N8LnARzfzoPQsXvGnjnQ0YRiXSPMvfv/ipPx/Xok9qvmcbWHAGCixh6Gr9YF+hOSr4Z1fJVtDJ+hGiUBPPPRc9sEHPttLsmOPjQ325OdJv8D4JpWDwGw7j/DPiqSksHWVjaiVCmt+qvdj4mgNuF47Y825t79f51jxuyvPDZf9RAAIyWOTaiTHBzpKQDBYrSEMMk0POUmY82Yn7o44EUjrcXDeB9ckHF8m4u4HgKA8comArI9SoJx7cIYUmr306p9AgaJoVV/9tOHAGPMWPfpvXyvJP/miaO8G8VbzPbWbZdY2ksANH+v4+L0GilgXETx5XKCz5cDyV8wziSI5G5o/gMCjC1j/OC0h/MReGhxtnHukhN7CYAuaufhVNl3ItuE2ufVtVqMI+VaK7GuZpxJFLGs0pqrBBhTxvZqO5GuR4B79/9zRDIy6RJHewqALg7/nCu7j/g2wDYqgtD2mbxHSRQkjLweaPmaAGPJmK6PjbCfMdEV5f6gsYyxuks+7CUAHoxb6MMEEEpoIzsYx8QdVQTwDVKOeYdJVahLxm7UMRxxzZUYdsa8RDst2+g2lj0FQDenL4xsRmV5wd3dl3InghDYfUGiitw94l8ikzX1ToAxY+zuu0P+4N+Qju13arNmRgGw6UiLgz0FwD1h+B39LQa5UR8ZBd1eNAg/A+5eWv3rMVaMWX9L6lgw8lq7SizjuDNfr/p96vqeAuBu8K+7CLhv8vygLil5LG5nKWNJaddj254ILN0WaltXU/fGXT9jldqJJ8aT/J2Ht9ttg1FGLl1jZmcBcGMyb4xj6EMjB5er4DOO5xGfGftf9wsyBpq72UP/IMxJ/mxHdtS5N9bodvnzvwVhbwHQVf0sEA5uRw8wB3F8qc54ji4CcBghYCCGRIzCWMyQ/GdYWztn1GY11uXmicAHiZndzOstAHC8KwAMOFEUAY+hEYwzjuljj7bPEGxmSDrb3sc4yjpkDBiLGBbVs4Lkz9qq10PulrOy6RorIwgAJna2qTdDwLkyJhnH9Iy/SwLKGnzO+BzlGpiT/BmDKDbVtAN/a7afqu0NYzPG5O5xMoIA6KqANibSnkMEHcqeujPWYUy7T+6G4Ak+JCODdH3orDtYw7x+bzF6mGktnSGedd0RJ8/4W+yaCAIAZz5B5PnLwJkCEGN0tLAoP8f16NX56pOYmBP4nc/6HBaT+CmwzmHxdStJ/s6pLxyHedE9PkYRAEzyt1HlM9Zve9F/zxSEzo7F57iebSHada8FKiKAWWzQLjd2sITpjGsO38uRHLMl1lw2z0LExigCoLsSOjl7XJzPwTGuISb6czMPnCUN7atOUKK2c2Qfr61aJHzu+GG5dX70Y2OtnUKj9a2ZrOuL2PjNlfYvowgAPA8BBEMOlD8P1J21Kgt05kBG8lIIHJv9S+In+bN/7OoxarNmWDtjeFPPC9ZXvdbrtRwi30USAEz4erjrtExwotRpfZxWCWQhJnxHpAQqhcDzAWAtkfQp7D+vPe5Z1gprZlwPT3v25cKsjMLkukgC4MvIJnpBYE9kbjdT/9Wt51gdM18UAp9jQqIn4cOELa8/z86551rZN+5tn8C+/vzPPqtvtzDCJZIAQPVSbsn+/XW3l3Lf+POCgIHtE9BaCIQJCJ/mVd9jzZDwKexX7zBJB2HuDiPyWtnEmmk7b5CoKwNO7obKcZEEADyzTn6COfZbnhNg8mcd4+eenT/L3KEQXtoHtfN2n7mSgE3CXwqvz7Qz6jWsDebAqP7p1+3W9bv/vw9ANAHw3b4srwlklCz29rSTAIcQ6GlD1L4RAiTHkcQA6wKflsJrStQx6GWXyf8l+Y8KxBDWyseBRDvYHsbcaAKAxEAJA+iAIVkn5AEXi1XlrYCs41wMwouGmE8kzUUMEDgyJE5spCy2s+U15YXL055mLTC+0wKYxHFEXihXowkA4ISDhFE7CgGOsqOqVe4EFAF3CDt/EAMUkmk0QcCcJ3kttrGlcHyne1NXI/mzFqaGsMf5VR3Wwuqlu2cJRBQALAjKWZ96XufEPEY/q9g75mX52swzCokWQUBhn0RMIflSSvVMWxTaph8KfVLYxxbOl+pvpnZcA8dGmzl47Io4tcPZHlEAMFxZFwVBkIIPltcEEHre/bzmtKcG845ETCEpU0hDHltnAAAQAElEQVTQS+H1kbJcx3a5jrbph7LHJus8J8DcZw08r+XZ2+32AYE5+PEi0U7InBZVAGReFFknaK+1xFgTCHv1P0u/JO0jZRYuvfwkITD3e/Wfsd9wd9AHIIa0PaoAgGvWxUGQxX7LfgKMNQFx/xXWlEBeAsz1kAkhKtJ3u7LeXDHe7y7E2kQWAGGh7RhCF/cOSN+qwCzzmH9zx5cS2CTAHGeub5704EMCMnuI5vyJyAKAu0LKee/6XYlS9UnAcf4scgLk8Su9QgLxCTC3mePxLQ1l4Y1YSky9Jf0XdswjCwDGmgXDNmPJPGF78maxZB73nuzsOy4B5jRzO66FcS1DAMS17rlljPvzGh3PRhcAPAGgdER0umsmLeV0AxNfSKAMvXAmHhtdP06AucycPn6lV/z7jiDezdT+/xgo9LhHFwD3sY/13ckYdKDEm7gHjO9clYVD4Oxsht1L4BIB5jBz+VIjE1/c9n/82wuaP459XZexf12rY40MAiDrEwCGlScAFPYtxwkQOMMvouNuecUkBJi7zOFJ3C3u5r9vt5vx81bvXxYBkFkE+BTg2vwlgBJIr7Xi1RJoS4A5y9xt2+tYvWWOneSs8OOfQQAwpVlMbDMWFCwlo+1RbGYhZZ4DUThqRxsCfLEVc7ZNb2P28ptfYtf+yWB7FgGAmqJkYLplI1+lunXcY/sJEBAIrPuvsKYE2hIgRjFH2bbtebzeMt/9MxrEK7ahSxYBAMTsd4ApJgSgAxcCK5+/ZRvYTE2bkABz0uRfZuDfY2WZxjq0kiZXZRIALLAOY1msSxStbwWUwUmgTbPIyrhsK4EJMBeZk4FNTGMayZ9YmcbgDUPxYeNwvEOZBAD0RhAB+GG5ToBFRuC93pItSOA8AeYgc/F8C165JvCR/NcHE+0zH9KYm00AZFfZPAEwWJRbHrBMteDKuW5LAQgQj5iDAUwZwoQRWKbyIZsAYJZnD/jZFS5jEKmw4AjE2Z8ORWKqLc8J3Ofa/zjnnjM6c3YVG89c3v2adLkpowAg4Hcf6YsG+FcBFwF+u/wekG8E5HQL8JsfvoxPgDl2n2v/x5yLb20eC0eI6+l8yCgAmNIsQrZZC28FULLaH9VuFmD2uRGVrXbdfotM5pgsyhKA6Ze7/7LNN2ktZdzJKgCYME1GtWIn2Sd8RTSXmmZu8KeCKRfkJc+9uBYB7vaZU2xr9TFzuyPEQuJOujHMKgAAnT3A8wQg5aQBfoIC2+xzJAHm4U1kDt0f+Q/vZy8HWaff+k73kjmSzmgMziwAmDjZFTnKFyHAWFjKE2COELyzz5PyZGzxFQHmDHOHOfSqrufPEYAtMfDc1XGuwo841hywJLMAwM20ygvj38sIC+DdlZCbJZCPMFdCAh7QKOYKyZ+5M6B7YVzajH1hrNtnCHNlX82AtbILABYoJSDa3SbxBCCtgtztZf+KMOZ93NQLtj/GoS0glpD4mStDOxrAuVEYp/YjuwBgHo8Q0FHCCAH8sdQlwIIdYc7UpTRX60viJ/mzP5f37b1lDRLzNnpOdSh9HBlBALBgKalmzoaxfjfABpRKhwhAPg2oBDdZswRxE3/bQRsh+UOMOMI2bRlBAACfRcw2e1EEtB1BFrBCoC3zpr0xuA865KaBxM8ceFDFwxUIPOVdob9aTQ6Rc0YRACxmSq3BbtUubwOMskBaMSvRD8xZ0JQS7dlGEAK/ftpBnCDxU9j/WcMjtQiwzrz7r0X3RLujCABcHyV4s0AQAvhkaUeA4ERhHlHa9WxPLQiQ7En6FPZb9GkfnwSIacS2zyM/9tIcGCY+jCQAWNSUNLPoiaGjLJQnLoY9hQigsMgpYQ3VsF0EiAkkfQr7uy6yUnECT97efPJGTXEzLjfIHCI+XG4oQgMjCQB41gvYbecoavnJgsFVS2UCLHIKc4pSuTubL0yAQE3Sp7BfuHmbO0CAdfSk+tsbNU8qRDr1TyRjrtoymgBgoVOucvl5ffs5igh4sXB+mumR4gQYAwoigFK8Axu83Qrqa9Y/SZ/C/s1/XQmwdkZ5osn6x5+uQEt2PpoAgA2DxHaEwsJBCIzgS3YfWPgUctVIcyzEuBTQ1yR7kj6F/RB+TW4E64UYtgNDiir4k8LQvUaOKABY/CMF6JEW0N55Gb0egWARAsy36PaOah/sSfiMBVtej+prRr9Gil0j5ZSPuTSiAMA5AvQowYAnAH4egFGNV5hnJB7KkAEiHvLfFrG2YU5h//dBf4UiwNrYbVCCiqP58xv5qAIA50YKyIiAIScgAzVAIQkxPtyJMu8oA7gVygUYk/BhzJbXoQzUmA8CrAXv/j9wxN0ZWQAQIEYKxCwoFlbc2aRlEGCMKCQq5h+F45bjBFjDJHtYsuX18Va8oiUB5j6x6kCfoauyfvEptJFnjRtZAMBktIFjYfE0AN8s8Qkw/ygkMAIJJb7VfS0kyZPsYcaW130tsve9BIhNxKi99TPUG3r+jS4AmGAEEbajFD4PwEIbxZ9Z/EAIUJbEhhgYOrjsHFgYwIJ1urDh2M7LrRaEADGJ2HTYnMAXMC+HnoszCAAGkBJ4nh02bTSVfRhA8guYj4iBddIbPti8jxm+4+vad1hw/L2Km4QERoxJzMuEQ7Hf5BkEADQIOGxHKajt4SfnKIO1ww+SH+O5TorMWQrndjQRsgq2U/CLstzh4yvHQxqtUYcJcOdPTDp84e0W9hLWXljjShk2iwAg2Iw2oChuAmmpuWA7cQgwXxlbypI4l+TJPKZQJ4rF2ELBLuylLPayzzlKFHu1oxwB5uiIyR+/ylEK2tIsAgD8DOhoQUgRwMjOU5i/zGMKiZUkuxReU0jCS6H+9/KK1vf6y+ulTfpYyve+sWup/6ofz+cnwHgTg057EvRC/ApqWlmzZhIAkCOIsR2psACnmbAjDVxhX5bEy1xYypKo19slaT/aruuu95c2l37YFnbB5hIRYD4QeyqazBSt2Px20yPmiG1P70dnEwAErREHmIXIgrwPqT8SkIAEqhIg1hBzLnby6vIC/0PEqy6+nic34NvXowO/mk0AMJQMMEKA/ZEKC3K09+JGGh99kcAIBIgxxJoRfPnuA7nh+7GhX88oABhQlB7b0cqIn8YdbYz0RwJZCZD8iTFF7A/WyKg54SnmWQUATwAoT+EkPckCZaEmNV+zJSCBgASIKcSWgKZdNonkP93dP9RmFQD4zgec2O4qXT6OssuyzUqjLtRNZz0oAQlUJVAh+Ve192jjUyZ/IM0sAPB/twho/nEUrLtWFAHX+Hm1BCRwu42e/Ln7v836b3YBwNsADSZAl+cHoy/cWdesfkugJYEqNxItHXjSF7F/2rt/uMwuAGDABEAIsF+pdHt+oAioNKI2K4HBCYweO4j5xP7Bh/G5ewqANz673wp4q57q9+gLOdVgaKwEEhBYYgbbCuaGaJK7/xCG9DRCAfBJXxHwycI9CUhgTgIk/ZEf+zOqJH+eALA/dVEAfA4/E4KJ8XlkrD0W9vSPvMYaUr2RQFECxIjqyb+oxccbI8YbB9+5KQDeQbxvmBgIgfeXw234Bi98HM4xHZKABC4RmCH5A8j4B4X3ogB4B7Ha8FaAImAFxF0JSGBoAiTFRnf+XTkS27saEK1zBcD2iPCYaPvMGEd9EjDGOOqFBK4SIPkTD662E/16YvrIN3an+CsAtrExUZgw22fHOMqi57HfGN7ohQQkcJRA8+R/1MBC9Ynl+FqouXGaUQA8HksmDELgcY3cZ1gUI/uXe3S0XgJ1CRDfuAmo20v/1olx+NrfkoAWKACeDwrvGTGBntfKedZFkXPctFoCVwnwfn+H5H/V7FPXE8NPXTjDRQqA16PMnfLrWrlqjOhTrhHQWgm0J8BbfiR/tu17b9+jce4FcwXAC0D30zwBGG0iefd/H1h/JDARAZJ+1+TfmDUx2zj3AroC4AWg99NMJCbU+8vUm1H8SD0IGi+BhgSIXyT/hl127YoYh89djcjQuQJg/yiNMqFG8WP/yFlTAvMSYL0HeL+/2QDwxBafm3WYuSMFwP7RG2FSoYz3e2xNCUggMwHu+mdK/oyVH/qDws6iANgJ6l4t+0Ii+Y8gYu5D4Y8EJPCEAO/383+Qs31Srd2pRj2Z/A+CVgDsA2bi3MfJWhKQQF8CxCru/Pta0b53bnB4/N++58Q9KgD2DZ53//s4WUsCEuhHgMQfMFZVB0LyR/hU72i0DhQAr0d0hIk1gg+vR8oaEpiTAI/6Sf5sZyNg8r8w4gqA5/BInNkVNQvkuZeelYAEshIgRoVO/hXBEtvwv2IXYzetAHg+vn8+P53irAskxTBppAQOEeBun8Sf/QblkNOryrzfb2xbATmzqwB4TI3JxSJ7XCP+GRRyfCu1UAISOEKAuETyZ3vkug51q3RJ8vcT/wXQKgAeQxxBWSNiHnvoGQlIIBsBEj8lm90l7fXGphBNBcA2yBESp4tke2w9KoGMBLjbT/e3/RVAc+fPE4AKTc/XpAJge8yz3/2T/EcQMduj41EJzEWAtVz8rv+PfAxN/oXHTAHwEyiL
264557edRj0hAAhJoS4C7fhJ/lRsSHifUdado6yb/ojjfGlMAvHFY/66y2NYdVN737r8yYJuXQGUCS+In+bNfubvwzZv8Kw2RAuAr2BHu/kfw4euo+EoC8xBg/Q6R+AsNGTc0vudfCOb3ZhQAn0RYeCPc/X965J4EJJCFAHf6JP7sMagkb5I/cblkm7a1IqAA+IThl/58snBPAhJoR4DET0EEtOu1ak+XGzf5X0b4ugEFwBsjVGb2xceCefPG3xKQQAYCxB0+i5c99pRmTSyDTel2be8bAQXAG5ARHru5YN7G0t8SiE6AhM8d/whxZ5P1hYMm/wvwjl6qALjdRkicLJqb/yQggdAE/rpbR+KnsH9/6c+KAJ/2HyEer1yKvasAuN2yq3CSv4sm9jrTurkJkOxJ+hT2B6dxyj2Sv5/2P4Xu/EWzCwAT5/m545USkMBzAiR7kj6F/ee15z1r8u809rMLAO/+O008u5XAwARI9iR9CvsDu/rTtYNHTP4HgZWsPrMAGOHufwQfSs5n25JATwIke5I+hf2etmTo2+TfeZRmFQAkzhHu/jtPH7uXgATuBEj2JH0K+/dDs/7s8pv3+k3+u1DVrTSrAPizLtYmrSNimnRkJxKQwCYBkj1Jn8L+ZiUPfiFg8v+Co++LGQUAiTP7YuWT/31njr1LYF4CxA+SPoX9eUl88/zFS+IWd/4vqnm6FYEZBUD2R//MDUQMW4sEJNCGAImedcc395n4jzMn+cPv+JVeUY3AbAJghAnIQqo2IWxYAhL4QoDET8KnjHDz8MW5si8etkbMGiH2PnQw64nZBED2BexCyrrStDsbgXXiZz+b/VHs5ZG/yT/KaHyzYyYB4CT8Nvi+lIAEvhAg0XOn72P+L1j2vdioRfLnQ38bpzwUgcBMAsC7/wgzThskEIuASb/8eJD0/7g3je7cPQAACGpJREFUy/a+8ScqgVkEwAh3/yP4EHUdaNdcBEj6FO72KezPRaC4tx8NkvS58/844E5cAjMIABLnCHf/cWeRlkkgPgGSPLGAhL8UjsW3PI+FfEbJ5J9nvG4zCAC/9CfRhNRUCRQkQIJfkj1bbgQ4VrALm4LAvZD4EVj3XX+yEBhdADAhsy94VHWW+aSdEuhNgPVOsl9/kI9jve0atf/lkT/bUX0c1q/RBQCKP/vgIWKy+6D9EqhFgOROwqesk36t/mz3kwA3J/+63W4m/1vOfyMLgBESJwss58zSagnUIUDCZ21/T/gcr9OjrW4RIDYxDlvnPJaEwMgCIPvdvwssySLSzGoESOoUkj1lucNnbXO8Wsc2/JAAd/tf3u9/WNMT4QmMKgBUpuGnngZK4AsBEjqFtbtO9uxznPLlgrYv+LP2tj0G7G1J/mwDmqdJRwmMKgC4QzjKIlJ97/4jjYa2lCRAIqcsiZ4Ev9zZs8/a5XzJPgu0hYkFmsnbBDGJO/9vHvgyM4ERBQCBJfOYYPsIPuCHZT4CJO+lMI9J6kshiy77S6Kn7nyU8njM3T6Jn7HMY7WW7iIwmgBgkhJYdjkftBJKO6hpmjUJAZLyo8IaW8qSzNmS3CnsL4W1uG5nEnzDuEksIvkjAjad8mBuAqMJgBG+9IegSSC13G4y6MNgSeBb27/vIW8pJvc7jAF/SPgkfoTegO7p0kJgJAHAZCUgLb65lYAEJCCBYwSW5M/2xZWezk5gJAHAXUn28dB+CU
26455hAAr0ILI/8e/Vvv40JjCIAuPtvjM7uJCABCQxBgLt9/s7xUBwdwvPJnRhFAHj3P/lE1n0JSOAUAd7rp5y62ItyExhBAKhac89BrZeABNoT4HE/d/3c/Z/o3UtGIDCCAPDu/+xMZPmfvTbKdSP4EIWldsxAgITPHb83TjOM9gsfswsAJ/GLAX56mj+ye1ohwckRfEiAWROHIMBdP8kfEXDJIS8eg0BmAUDy9+5/jHmoFxKQQD0CJHwSPzGzXi+2nI5AZgEwwpf+pJswGiwBCaQiQOKnIAIKGW4zoxDIKgBQsn7pzyizUD8kIIHSBHjczydkTPylyQ7UXlYBkPDRP2sxw8zJYmcGltoogeYESPjc8XOTVKVzGx2HQEYBkHRiZ/m0WhY7x1mEeiKBAgSWxE/yZ79AkzYxOoGMAiDh3f/o00j/JCCBjgRI+pQGib+jl3ZdnEA2AZD07v/FuPnU/QUgT0tAAhsEfJ9/A4qH9hPIJgDGvPv3qfv+GWtNCUhgSfzNb4hEPxaBTALAyT7W3NOb8AR8NBVsiHjEz6N+Y2GwgclqThYBwIQf8+4/68zR7gkI+GgqyCAviZ/kz34ns+x2NAJZBIBf+jPazNMfCUjgFQGSPUmfwv6r+p6XwCECGQQAd/+DfemPj1YPzVIrS2AuAiR7kj6F/RDea8R4BDIIgAEf/ftodbylpEcSuEyAD/eR9Ckm/ss4beAVgegCgLv/Vz54XgISkEBWAiR6Ej6PBYl3vA7oiyaNSCC6ABjw7n/EaaRPEpDAQQIkehI/hf2Dl1tdAtcJRBYAqOHrHtqCBCQggTgESPYkfQr7cSx7YomnxiQQVQDwoT/v/secc3olgRkJkOxJ+hT2Z2Sgz8EIRBYAwVBpjgQkIIFDBEj0JHze32fL60MNxKisFaMSiCgAePTv3f+oM06/JDA2AZI8hYRPYX9sj/UuLYGIAsDk/3Q6cTPxtIInJSCB9gRI9CT8pfC6vRUVerTJcQlEEwDc/Y9Lu4hnfodAEYw2IoHrBEjyS8Jny+vrrdqCBBoRiCYAvPtvNPB2IwEJnCJAkqeQ8CnsU041Fv8iLRyZQCQB4N3/yDNN3ySQlwAJnkLCXwqv83qk5RK4E4gkALz7vw+IPxKQQAgCJHjKkvDZ8jqEca2MsJ+xCUQRAN79jz3P9E4CMQl8/UwtCZ5Evy4ci2m7VkngIoEIAsAv/bk4iF4uAQmcIvDf268bCZ6EjxRgy2vKzX8SGJ1AFAEwOmf9k4AEYhAguZPo14VjMazTCgk0JNBbAPDo3/f+Gw64XUlgMgIkdwoJ37v8A4Nv1fEJ9BYAJv/x55geSqAlAZL9f+4drhM++xy/H/ZHAhJYCPQUANz9L3aMseX+YgxPxvDC8RhjHB97QVKnkOApjDhbYgvHH1/pmRcEPD0DgZ4CYLy7f7+kL9aacTxijcc1a0joFBI8ZUn27HOccq0Hr5bAZAR6CQAU+mSodVcCEthBgEROWR7jk+BN9jvAlaxiW3MQ6CUAxrv7n2O+6KUErhIguS9lneS/J3puEpZ6V/v0eglIYINADwHAwt4wxUMSkEBiAkuyXrYkdwqJfSnrO3mOEQuW+mwTuz+S6foyC4EeAuDPO1wWu+V2k4EMoswBkvWrQtJeFxL6UtbH2Se5U9b+3fwnAQnEIdBDABAcLLebDGQQaQ6QrF+VdTJnP04k05JiBGxoHgI9BMA8dPVUAhKQgAQkEJSAAiDowGiWBCQggfYE7HEmAgqAmUZbXyUgAQlIQALvBBQA7yDcSEACEpidgP7PRUABMNd4660EJCABCUjgNwEFwG8M/pKABCQwOwH9n42AAmC2EddfCUhAAhKQwJ2AAuAOwR8JSEACsxPQ//kIKADmG3M9loAEJCABCdwUAE4CCUhAAtMTEMCMBBQAM466PktAAhKQwPQEFADTTwEBSEACsxPQ/zkJKADmHHe9loAEJCCByQkoACafALovAQnMTkD/ZyWgAJh15PVbAhKQgASmJqAAmHr4dV4CEpidgP7PS0ABMO/Y67kEJCABCUxMQAEw8eDrugQkMDsB/Z+ZgAJg5tHXdwlIQAISmJaAAmDaoddxCUhgdgL6PzeB/w8AAP//5ptSHAAAAAZJREFUAwBXzZyIR1iXYgAAAABJRU5ErkJggg=="; 26456marked.setOptions({ 26457 breaks: true, 26458 // Convertir saltos de lÃnea en <br> 26459 gfm: true, 26460 // GitHub Flavored Markdown 26461 headerIds: false, 26462 mangle: false 26463}); 26464const _sfc_main$1 = { 26465 name: "ChatWidgetContent", 26466 components: { 26467 PhoneInput, 26468 useDarkModeStore, 26469 InteractiveMessage 26470 }, 26471 setup() { 26472 var _a2; 26473 const { setLanguageFromServer, t, getCurrentLocale } = useI18nComposable(); 26474 const loading = ref(false); 26475 const localCookie = ref({}); 26476 const stars = ref(Array(5).fill(0)); 26477 const hoveredIndex = ref(-1); 26478 const selectedIndex = ref(-1); 26479 const canWrite = ref(true); 26480 const readingActive = ref(false); 26481 const toggledSocialNetworks = ref(false); 26482 const bubbleBadge = ref(false); 26483 const lastMessage = ref(null); 26484 const hoveredChannel = ref(null); 26485 let userFields = {}; 26486 let options = {}; 26487 const sendedEvents = ref([]); 26488 const pendingOutgoingMessage = ref(null); 26489 let sendCustomData = null; 26490 const hoverStars = (index) => { 26491 hoveredIndex.value = index; 26492 }; 26493 const resetHover = () => { 26494 hoveredIndex.value = -1; 26495 }; 26496 const selectStars = (index) => { 26497 selectedIndex.value = index; 26498 }; 26499 const isOpen = ref(false); 26500 const fullView = ref(false); 26501 const messages = ref([]); 26502 const newMessage = ref(""); 26503 const connected = ref(false); 26504 const messagesContainer = ref(null); 26505 const avatar = ref("https://files.smartsuppcdn.com/files/agents/avatars/439730-err4BybFxN.jpg?size=80"); 26506 const audio = ref(null); 26507 const soundConfig = ref({ 26508 enableNotificationSounds: true, 26509 newMessageSound: "default", 26510 notificationVolume: 50, 26511 customSoundUrl: "" 26512 }); 26513 const testMode = ref(false); 26514 let userData = ref({ 26515 name: "", 26516 email: "", 26517 telefono: "" 26518 }); 26519 let showUserDataForm = ref(false); 26520 let showUserCalification = ref(false); 26521 const normalizedEmail = computed(() => String(userData.value.email || "").trim().toLowerCase()); 26522 const isEmailValid = computed(() => /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(normalizedEmail.value)); 26523 const isFormValid = computed(() => { 26524 return userData.value.name && isEmailValid.value && userData.value.telefono && (!widgetData.privacyNoticeCheckRequired || widgetData.checkPrivacy); 26525 }); 26526 let ws = null; 26527 const userHash = ref(null); 26528 const $q = ((_a2 = getCurrentInstance()) == null ? void 0 : _a2.appContext.config.globalProperties.$quantum) || {}; 26529 let quantumKey = $q.key; 26530 let quantumUuid = $q.uuid; 26531 $q.devMode; 26532 let tabSelected = $q.tab; 26533 let quantumBotId = $q.botId; 26534 let quantumUserHash = $q.userHash; 26535 const customSession = !!quantumUserHash; 26536 if (quantumUuid === "test-widget" && !customSession) { 26537 testMode.value = true; 26538 userData.value = { 26539 name: "Usuario Panel de Quantum Asis", 26540 email: "[email protected]", 26541 telefono: "+34650000000" 26542 }; 26543 localCookie.value["chat_user_data"] = encodeURIComponent(JSON.stringify(userData.value)); 26544 } 26545 if (!quantumKey) { 26546 quantumKey = "693c40a0dc1936b8212e4d3d2c9a9ad55025cd42a2fd6e5aa982adad544f19f3";
26547 } 26548 let host = "quantum-server-kpiav.ondigitalocean.app"; 26549 let hostHttp = "quantum-server-kpiav.ondigitalocean.app"; 26550 let protocol = "wss"; 26551 let protocolHttp = "https"; 26552 let domain = ""; 26553 let chatbot_conf = null; 26554 let aditional_data = null; 26555 const predefinedSounds = [ 26556 { value: "default", label: "Signal One (Por defecto)", url: "https://quantumasis.com/template/estandar/modulos/cuentadashboard_38o4db/images/notification.mp3" }, 26557 { value: "nebulatap", label: "Nebula Tap", url: "https://quantumasis.com/template/estandar/modulos/cuentadashboard_38o4db/sounds/notifications/nebulatap.mp3" }, 26558 { value: "ionspark", label: "Ion Spark", url: "https://quantumasis.com/template/estandar/modulos/cuentadashboard_38o4db/sounds/notifications/ionspark.mp3" }, 26559 { value: "quanta", label: "Quanta", url: "https://quantumasis.com/template/estandar/modulos/cuentadashboard_38o4db/sounds/notifications/quanta.mp3" }, 26560 { value: "bytepop", label: "BytePop", url: "https://quantumasis.com/template/estandar/modulos/cuentadashboard_38o4db/sounds/notifications/bytepop.mp3" }, 26561 { value: "corepulse", label: "Core Pulse", url: "https://quantumasis.com/template/estandar/modulos/cuentadashboard_38o4db/sounds/notifications/corepulse.mp3" }, 26562 { value: "datadrop", label: "DataDrop", url: "https://quantumasis.com/template/estandar/modulos/cuentadashboard_38o4db/sounds/notifications/datadrop.mp3" }, 26563 { value: "glitchtick", label: "GlitchTick", url: "https://quantumasis.com/template/estandar/modulos/cuentadashboard_38o4db/sounds/notifications/glitchtick.mp3" } 26564 ]; 26565 const getSoundUrl = (soundType, customUrl) => { 26566 if (soundType === "custom" && customUrl) { 26567 return customUrl; 26568 } 26569 const selectedSound = predefinedSounds.find((sound) => sound.value === soundType); 26570 return (selectedSound == null ? void 0 : selectedSound.url) || predefinedSounds[0].url; 26571 }; 26572 const getNotificationSoundConfig = () => { 26573 if (window.quantumWidget && window.quantumWidget.options && window.quantumWidget.options.soundConfig) { 26574 soundConfig.value = window.quantumWidget.options.soundConfig; 26575 } 26576 const soundUrl = getSoundUrl(soundConfig.value.newMessageSound, soundConfig.value.customSoundUrl); 26577 audio.value = new Audio(soundUrl); 26578 audio.value.volume = soundConfig.value.notificationVolume / 100; 26579 }; 26580 const playNotificationSound = () => { 26581 if (!soundConfig.value.enableNotificationSounds || !audio.value) { 26582 return; 26583 } 26584 audio.value.volume = soundConfig.value.notificationVolume / 100; 26585 audio.value.play().catch((error2) => { 26586 console.log("Error playing notification sound:", error2); 26587 }); 26588 }; 26589 const haveChannels = (todos, id = false) => { 26590 if (!widgetData.channels) { 26591 return false; 26592 } 26593 if (todos) { 26594 return widgetData.channels.filter((canal) => canal.active).length; 26595 } 26596 if (id) { 26597 return widgetData.channels.filter((canal) => canal.active && canal.id == id).length; 26598 } else { 26599 return widgetData.channels.filter((canal) => canal.active && canal.id != 2).length; 26600 } 26601 }; 26602 const widgetData = reactive( 26603 { 26604 bubbleText: "chat", 26605 computedBackgroud: "linear-gradient(45deg, rgb(14, 110, 173), rgb(167, 190, 250))", 26606 status: "EnvÃenos un mensaje", 26607 title: "Bienvenido", 26608 statusOffline: "No estamos", 26609 titleOffline: "Vuelve pronto", 26610 theme: "Burbuja", 26611 position: "Derecho", 26612 textArea: "Escribe un mensaje", 26613 ratingEnabled: false, 26614 hideOfflineChat: false, 26615 hideWidget: false, 26616 privacyNoticeEnabled: false, 26617 privacyNoticeCheckRequired: false,
26618 checkPrivacy: false, 26619 startMessages: [], 26620 helpMessages: [], 26621 infoHours: [], 26622 infoGeneral: [], 26623 privacyNoticeUrl: "", 26624 formTitle: "ð Preséntate, por favor", 26625 formDescription: "Usaremos tu información de contacto solo si todos los agentes están ocupados en ese momento y no pueden responder de inmediato.", 26626 // Icon configuration 26627 selectedSvg: "chat-dots-fill", 26628 // Icono del canal web 26629 selectedMainIcon: "default", 26630 // 'default', 'custom-upload', o 'custom-inline' para el botón/burbuja principal 26631 customIconData: "", 26632 customSvgMarkup: "", 26633 channels: [], 26634 // Inicializar canales como array vacÃo 26635 showWebTooltip: false, 26636 imageFraming: { 26637 scale: 1, 26638 positionX: 50, 26639 positionY: 50 26640 } 26641 } 26642 ); 26643 const svgOptions = ref([ 26644 { 26645 id: "chat-dots-fill", 26646 viewBox: "0 0 14 14", 26647 paths: [ 26648 { 26649 d: "M6.998.56a6.44 6.44 0 0 0-5.36 10.007L.558 13.44l3.617-.654A6.44 6.44 0 1 0 6.998.56", 26650 fill: "none", 26651 stroke: "currentColor", 26652 strokeWidth: 1, 26653 strokeLinecap: "round", 26654 strokeLinejoin: "round" 26655 }, 26656 { 26657 d: "M3.7 8c.5 1.8 2.5 2.9 4.3 2.4c1.1-.4 2-1.3 2.3-2.4", 26658 fill: "none", 26659 stroke: "currentColor", 26660 strokeWidth: 1, 26661 strokeLinecap: "round", 26662 strokeLinejoin: "round" 26663 } 26664 ] 26665 }, 26666 { 26667 id: "chat-fill",
26668 viewBox: "0 0 32 32", 26669 paths: [ 26670 { 26671 d: "M16 19a6.99 6.99 0 0 1-5.833-3.129l1.666-1.107a5 5 0 0 0 8.334 0l1.666 1.107A6.99 6.99 0 0 1 16 19zm4-11a2 2 0 1 0 2 2a1.98 1.98 0 0 0-2-2zm-8 0a2 2 0 1 0 2 2a1.98 1.98 0 0 0-2-2z", 26672 fill: "currentColor" 26673 }, 26674 { 26675 d: "M17.736 30L16 29l4-7h6a1.997 1.997 0 0 0 2-2V6a1.997 1.997 0 0 0-2-2H6a1.997 1.997 0 0 0-2 2v14a1.997 1.997 0 0 0 2 2h9v2H6a4 4 0 0 1-4-4V6a3.999 3.999 0 0 1 4-4h20a3.999 3.999 0 0 1 4 4v14a4 4 0 0 1-4 4h-4.835Z", 26676 fill: "currentColor" 26677 } 26678 ] 26679 }, 26680 { 26681 id: "chat-text-fill", 26682 viewBox: "0 0 512 512", 26683 paths: [ 26684 { 26685 d: "M431 320.6c-1-3.6 1.2-8.6 3.3-12.2a33.68 33.68 0 0 1 2.1-3.1A162 162 0 0 0 464 215c.3-92.2-77.5-167-173.7-167c-83.9 0-153.9 57.1-170.3 132.9a160.7 160.7 0 0 0-3.7 34.2c0 92.3 74.8 169.1 171 169.1c15.3 0 35.9-4.6 47.2-7.7s22.5-7.2 25.4-8.3a26.44 26.44 0 0 1 9.3-1.7a26 26 0 0 1 10.1 2l56.7 20.1a13.52 13.52 0 0 0 3.9 1a8 8 0 0 0 8-8a12.85 12.85 0 0 0-.5-2.7Z", 26686 fill: "none", 26687 stroke: "currentColor", 26688 strokeWidth: 32, 26689 strokeLinecap: "round" 26690 }, 26691 { 26692 d: "M66.46 232a146.23 146.23 0 0 0 6.39 152.67c2.31 3.49 3.61 6.19 3.21 8s-11.93 61.87-11.93 61.87a8 8 0 0 0 2.71 7.68A8.17 8.17 0 0 0 72 464a7.26 7.26 0 0 0 2.91-.6l56.21-22a15.7 15.7 0 0 1 12 .2c18.94 7.38 39.88 12 60.83 12A159.21 159.21 0 0 0 284 432.11", 26693 fill: "none", 26694 stroke: "currentColor", 26695 strokeWidth: 32, 26696 strokeLinecap: "round" 26697 } 26698 ] 26699 }, 26700 { 26701 id: "chat-heart-fill",
26702 viewBox: "0 0 28 28", 26703 paths: [ 26704 { 26705 d: "M18.171 6.829a3.157 3.157 0 0 1 .761 1.238l.498 1.53a.605.605 0 0 0 1.14 0l.498-1.53a3.15 3.15 0 0 1 1.998-1.996l1.53-.497a.605.605 0 0 0 0-1.14l-.03-.008l-1.531-.497a3.154 3.154 0 0 1-1.998-1.996L20.54.403a.604.604 0 0 0-1.14 0l-.498 1.53l-.013.038a3.152 3.152 0 0 1-1.955 1.958l-1.53.497a.605.605 0 0 0 0 1.14l1.53.497c.467.156.89.418 1.237.766Zm8.65 3.529l.918.298l.019.004a.362.362 0 0 1 0 .684l-.919.299a1.892 1.892 0 0 0-1.198 1.197l-.299.918a.363.363 0 0 1-.684 0l-.299-.918a1.891 1.891 0 0 0-1.198-1.202l-.919-.298a.362.362 0 0 1 0-.684l.919-.299a1.892 1.892 0 0 0 1.18-1.197l.299-.918a.363.363 0 0 1 .684 0l.298.918a1.89 1.89 0 0 0 1.199 1.197ZM14 2c1.198 0 2.356.176 3.448.503a2.13 2.13 0 0 1-.839.496l-1.52.5a2.06 2.06 0 0 0-.118.045c-.32-.029-.644-.044-.971-.044C8.201 3.5 3.5 8.201 3.5 14c0 1.884.496 3.65 1.363 5.178a.75.75 0 0 1 .07.575l-1.318 4.634l4.634-1.318a.75.75 0 0 1 .576.07A10.449 10.449 0 0 0 14 24.5c5.499 0 10.01-4.227 10.463-9.61a1.371 1.371 0 0 0 1.523-.31C25.684 20.938 20.433 26 14 26a11.95 11.95 0 0 1-5.637-1.404l-4.77 1.357a1.25 1.25 0 0 1-1.544-1.544l1.356-4.77A11.95 11.95 0 0 1 2 14C2 7.373 7.373 2 14 2Z", 26706 fill: "currentColor" 26707 } 26708 ] 26709 }, 26710 { 26711 id: "chat-square-fill",
26712 viewBox: "0 0 24 24", 26713 paths: [ 26714 { 26715 d: "m13.087 21.388l.645.382l-.645-.382Zm.542-.916l-.646-.382l.646.382Zm-3.258 0l-.645.382l.645-.382Zm.542.916l.646-.382l-.646.382Zm-8.532-5.475l.693-.287l-.693.287Zm5.409 3.078l-.013.75l.013-.75Zm-2.703-.372l-.287.693l.287-.693Zm16.532-2.706l.693.287l-.693-.287Zm-5.409 3.078l-.012-.75l.012.75Zm2.703-.372l.287.693l-.287-.693Zm.7-15.882l-.392.64l.392-.64Zm1.65 1.65l.64-.391l-.64.392ZM4.388 2.738l-.392-.64l.392.64Zm-1.651 1.65l-.64-.391l.64.392ZM9.403 19.21l.377-.649l-.377.649Zm4.33 2.56l.541-.916l-1.29-.764l-.543.916l1.291.764Zm-4.007-.916l.542.916l1.29-.764l-.541-.916l-1.291.764Zm2.715.152a.52.52 0 0 1-.882 0l-1.291.764c.773 1.307 2.69 1.307 3.464 0l-1.29-.764ZM10.5 2.75h3v-1.5h-3v1.5Zm10.75 7.75v1h1.5v-1h-1.5Zm-18.5 1v-1h-1.5v1h1.5Zm-1.5 0c0 1.155 0 2.058.05 2.787c.05.735.153 1.347.388 1.913l1.386-.574c-.147-.352-.233-.782-.278-1.441c-.046-.666-.046-1.51-.046-2.685h-1.5Zm6.553 6.742c-1.256-.022-1.914-.102-2.43-.316L4.8 19.313c.805.334 1.721.408 2.977.43l.026-1.5ZM1.688 16.2A5.75 5.75 0 0 0 4.8 19.312l.574-1.386a4.25 4.25 0 0 1-2.3-2.3l-1.386.574Zm19.562-4.7c0 1.175 0 2.019-.046 2.685c-.045.659-.131 1.089-.277 1.441l1.385.574c.235-.566.338-1.178.389-1.913c.05-.729.049-1.632.049-2.787h-1.5Zm-5.027 8.241c1.256-.021 2.172-.095 2.977-.429l-.574-1.386c-.515.214-1.173.294-2.428.316l.025 1.5Zm4.704-4.115a4.25 4.25 0 0 1-2.3 2.3l.573 1.386a5.75 5.75 0 0 0 3.112-3.112l-1.386-.574ZM13.5 2.75c1.651 0 2.837 0 3.762.089c.914.087 1.495.253 1.959.537l.783-1.279c-.739-.452-1.577-.654-2.6-.752c-1.012-.096-2.282-.095-3.904-.095v1.5Zm9.25 7.75c0-1.622 0-2.891-.096-3.904c-.097-1.023-.299-1.862-.751-2.6l-1.28.783c.285.464.451 1.045.538 1.96c.088.924.089 2.11.089 3.761h1.5Zm-3.53-7.124a4.25 4.25 0 0 1 1.404 1.403l1.279-.783a5.75 5.75 0 0 0-1.899-1.899l-.783 1.28ZM10.5 1.25c-1.622 0-2.891 0-3.904.095c-1.023.098-1.862.3-2.6.752l.783 1.28c.464-.285 1.045-.451 1.96-.538c.924-.088 2.11-.089 3.761-.089v-1.5ZM2.75 10.5c0-1.651 0-2.837.089-3.762c.087-.914.253-1.495.537-1.959l-1.279-.783c-.452.738-.654 1.577-.752 2.6C1.25 7.61 1.25 8.878 1.25 10.5h1.5Zm1.246-8.403a5.75 5.75 0 0 0-1.899 1.899l1.28.783a4.25 4.25 0 0 1 1.402-1.403l-.783-1.279Zm7.02 17.993c-.202-.343-.38-.646-.554-.884a2.229 2.229 0 0 0-.682-.645l-.754 1.297c.047.028.112.078.224.232c.121.166.258.396.476.764l1.29-.764Zm-3.24-.349c.44.008.718.014.93.037c.198.022.275.054.32.08l.754-1.297a2.244 2.244 0 0 0-.909-.274c-.298-.033-.657-.038-1.069-.045l-.025 1.5Zm6.498 1.113c.218-.367.355-.598.476-.764c.112-.154.177-.204.224-.232l-.754-1.297c-.29.17-.5.395-.682.645c-.173.238-.352.54-.555.884l1.291.764Zm1.924-2.612c-.412.007-.771.012-1.069.045c-.311.035-.616.104-.909.274l.754 1.297c.045-.026.122-.058.32-.08c.212-.023.49-.03.93-.037l-.026-1.5Z", 26716 fill: "currentColor" 26717 }, 26718 { 26719 d: "M12 15V7m-4 6V9m8 4V9", 26720 fill: "none", 26721 stroke: "currentColor", 26722 strokeWidth: 1.5, 26723 strokeLinecap: "round" 26724 } 26725 ] 26726 }, 26727 { 26728 id: "chat-square-dots-fill",
26729 viewBox: "0 0 24 24", 26730 paths: [ 26731 { 26732 d: "M11.5 2C6.21 2.25 2 6.435 2 11.56c0 2.54 1.033 4.848 2.719 6.56c.371.378.619.893.519 1.423a5.3 5.3 0 0 1-1.087 2.35a6.5 6.5 0 0 0 4.224-.657c.454-.242.681-.363.842-.387s.39.019.848.105a10.4 10.4 0 0 0 1.935.179c5.522 0 10-4.286 10-9.572q 0-.286-.017-.568", 26733 fill: "none", 26734 stroke: "currentColor", 26735 strokeWidth: 1.5, 26736 strokeLinecap: "round", 26737 strokeLinejoin: "round" 26738 }, 26739 { 26740 d: "M15.015 2.387c1.073-.64 2.009-.382 2.571.028c.23.169.346.253.414.253s.183-.084.414-.253c.562-.41 1.498-.668 2.571-.028c1.408.84 1.726 3.609-1.52 5.945c-.62.445-.928.668-1.465.668s-.846-.223-1.464-.668c-3.247-2.336-2.929-5.106-1.521-5.945", 26741 fill: "none", 26742 stroke: "currentColor", 26743 strokeWidth: 1.5, 26744 strokeLinecap: "round", 26745 strokeLinejoin: "round" 26746 }, 26747 { 26748 d: "M11.996 12h.008m3.987 0H16m-8 0h.009", 26749 fill: "none", 26750 stroke: "currentColor", 26751 strokeWidth: 1.5, 26752 strokeLinecap: "round", 26753 strokeLinejoin: "round" 26754 } 26755 ] 26756 }, 26757 { 26758 id: "chat-square-text-fill",
26759 viewBox: "0 0 256 256", 26760 paths: [ 26761 { 26762 d: "M132 24A100.11 100.11 0 0 0 32 124v84.33A15.69 15.69 0 0 0 47.67 224H132a100 100 0 0 0 0-200Zm0 184H48v-84a84 84 0 1 1 84 84Z", 26763 fill: "currentColor" 26764 } 26765 ] 26766 }, 26767 { 26768 id: "chat-square-heart-fill", 26769 viewBox: "0 0 24 24", 26770 paths: [ 26771 { 26772 d: "M10.46 1.25h3.08c1.603 0 2.86 0 3.864.095c1.023.098 1.861.3 2.6.752a5.75 5.75 0 0 1 1.899 1.899c.452.738.654 1.577.752 2.6c.095 1.004.095 2.261.095 3.865v1.067c0 1.141 0 2.036-.05 2.759c-.05.735-.153 1.347-.388 1.913a5.75 5.75 0 0 1-3.112 3.112c-.805.334-1.721.408-2.977.43a10.81 10.81 0 0 0-.929.036c-.198.022-.275.054-.32.08c-.047.028-.112.078-.224.232c-.121.166-.258.396-.476.764l-.542.916c-.773 1.307-2.69 1.307-3.464 0l-.542-.916a10.605 10.605 0 0 0-.476-.764c-.112-.154-.177-.204-.224-.232c-.045-.026-.122-.058-.32-.08c-.212-.023-.49-.03-.93-.037c-1.255-.021-2.171-.095-2.976-.429A5.75 5.75 0 0 1 1.688 16.2c-.235-.566-.339-1.178-.389-1.913c-.049-.723-.049-1.618-.049-2.76v-1.066c0-1.604 0-2.86.095-3.865c.098-1.023.3-1.862.752-2.6a5.75 5.75 0 0 1 1.899-1.899c.738-.452 1.577-.654 2.6-.752C7.6 1.25 8.857 1.25 10.461 1.25ZM6.739 2.839c-.914.087-1.495.253-1.959.537A4.25 4.25 0 0 0 3.376 4.78c-.284.464-.45 1.045-.537 1.96c-.088.924-.089 2.11-.089 3.761v1c0 1.175 0 2.019.046 2.685c.045.659.131 1.089.278 1.441a4.25 4.25 0 0 0 2.3 2.3c.515.214 1.173.294 2.429.316h.031c.398.007.747.013 1.037.045c.311.035.616.104.909.274c.29.17.5.395.682.645c.169.232.342.525.538.856l.559.944a.52.52 0 0 0 .882 0l.559-.944c.196-.331.37-.624.538-.856c.182-.25.392-.476.682-.645c.293-.17.598-.24.909-.274c.29-.032.639-.038 1.037-.045h.032c1.255-.022 1.913-.102 2.428-.316a4.25 4.25 0 0 0 2.3-2.3c.147-.352.233-.782.278-1.441c.046-.666.046-1.51.046-2.685v-1c0-1.651 0-2.837-.089-3.762c-.087-.914-.253-1.495-.537-1.959a4.25 4.25 0 0 0-1.403-1.403c-.464-.284-1.045-.45-1.96-.537c-.924-.088-2.11-.089-3.761-.089h-3c-1.651 0-2.837 0-3.762.089ZM7.25 9A.75.75 0 0 1 8 8.25h8a.75.75 0 0 1 0 1.5H8A.75.75 0 0 1 7.25 9Zm0 3.5a.75.75 0 0 1 .75-.75h5.5a.75.75 0 0 1 0 1.5H8a.75.75 0 0 1-.75-.75Z", 26773 fill: "currentColor", 26774 fillRule: "evenodd" 26775 } 26776 ] 26777 } 26778 ]); 26779 const getSelectedSvgOption = () => { 26780 return svgOptions.value.find((opt) => opt.id === widgetData.selectedSvg) || svgOptions.value[0]; 26781 }; 26782 const isWebChannelActive = computed(() => { 26783 if (!widgetData.channels || !Array.isArray(widgetData.channels)) return false; 26784 const webChannel = widgetData.channels.find((c) => c.id === 2); 26785 if (!webChannel) return false; 26786 return testMode.value || customSession ? true : webChannel.active === true; 26787 }); 26788 const apiUrl = ref(`${protocolHttp}://${hostHttp}/v2`); 26789 const wsUrl = ref(`${protocol}://${host}/v2/ws`); 26790 const resetUserData = () => { 26791 userData.value = { 26792 name: "", 26793 email: "", 26794 telefono: "" 26795 }; 26796 setCookie( 26797 "chat_user_data", 26798 JSON.stringify(userData.value), 26799 60 * 60 * 24 * 30 26800 ); 26801 }; 26802 const sendToGtag = (eventName, eventParams) => { 26803 if (typeof gtag === "function") { 26804 sendedEvents.value.push(eventName); 26805 gtag("event", eventName, { 26806 event_category: "engagement", 26807 event_label: "quantum-widget", 26808 value: 1 26809 }); 26810 } else if (Array.isArray(window.dataLayer)) { 26811 sendedEvents.value.push(eventName); 26812 window.dataLayer.push({ 26813 event: eventName 26814 }); 26815 } 26816 }; 26817 const getMessagePosition = (type) => { 26818 let typeResult = type === "sent" ? "text-right" : "text-left"; 26819 if (type === "report") { 26820 typeResult = "text-center"; 26821 } 26822 return typeResult; 26823 }; 26824 const forceOpenChat = async () => { 26825 if (isOpen.value) { 26826 return; 26827 } 26828 if (!isWebChannelActive.value) { 26829 return; 26830 } 26831 isOpen.value = true; 26832 await initConnection(); 26833 nextTick(() => { 26834 if (messagesContainer && messagesContainer.value) messagesContainer.value.scrollTop = messagesContainer.value.scrollHeight; 26835 }); 26836 }; 26837 const getDomainData = async () => { 26838 loading.value = true; 26839 await fetch(apiUrl.value + "/action/getDomainByHash/", { 26840 method: "POST", 26841 headers: { 26842 "Content-Type": "application/json" 26843 }, 26844 body: JSON.stringify({ 26845 hash: quantumKey 26846 }) 26847 }).then((data) => data.json()).then((data) => { 26848 if (tabSelected !== "" && testMode) { 26849 switch (tabSelected) { 26850 case "Apariencia": 26851 break; 26852 case "Opciones": 26853 showUserCalification.value = true; 26854 forceOpenChat(); 26855 break; 26856 case "FormularioContacto": 26857 showUserDataForm.value = true; 26858 forceOpenChat(); 26859 break; 26860 } 26861 } 26862 if (data.success) { 26863 domain = data.data.dominio; 26864 chatbot_conf = data.data.num; 26865 aditional_data = data.data.aditional_data; 26866 if (data.data.lang) { 26867 setLanguageFromServer(data.data.lang); 26868 } 26869 const widgetDesignData = aditional_data.find( 26870 (item) => item.key === "widget_design" 26871 ); 26872 const widgetOptionsData = aditional_data.find( 26873 (item) => item.key === "widget_settings" 26874 ); 26875 const widgetFormsData = aditional_data.find( 26876 (item) => item.key === "widget_forms" 26877 ); 26878 const avatarData = aditional_data.find( 26879 (item) => item.key === "custom_domain" 26880 ); 26881 const startMessages = aditional_data.find( 26882 (item) => item.key === "start_messages" 26883 ); 26884 const startMessagesType = aditional_data.find( 26885 (item) => item.key === "welcome_type" 26886 ); 26887 const startMessagesFlow = aditional_data.find( 26888 (item) => item.key === "flow_data" 26889 ); 26890 const helpMessages = aditional_data.find( 26891 (item) => item.key === "help_messages" 26892 ); 26893 avatar.value = avatarData.value; 26894 const infoHours = aditional_data.find( 26895 (item) => item.key === "info_hours" 26896 ); 26897 const infoGeneral = aditional_data.find( 26898 (item) => item.key === "info_general" 26899 ); 26900 let LwidgetDesign = JSON.parse(widgetDesignData.value); 26901 let LwidgetOptions = JSON.parse(widgetOptionsData.value); 26902 let LwidgetForms = JSON.parse(widgetFormsData.value); 26903 let LstartMessages = JSON.parse((startMessages == null ? void 0 : startMessages.value) || "[]"); 26904 let LstartMessagesType = (startMessagesType == null ? void 0 : startMessagesType.value) || "desactivado"; 26905 let LstartMessagesFlow = JSON.parse((startMessagesFlow == null ? void 0 : startMessagesFlow.value) || "{}"); 26906 let LhelpMessages = JSON.parse((helpMessages == null ? void 0 : helpMessages.value) || "[]"); 26907 let LwidgetHours = JSON.parse(infoHours.value); 26908 let LinfoGeneral = JSON.parse(infoGeneral.value); 26909 widgetData.bubbleText = LwidgetDesign.bubbleText; 26910 widgetData.computedBackgroud = LwidgetDesign.colorMode === "degradadoPersonalizado" ? LwidgetDesign.customGradient : LwidgetDesign.colorMode === "solidos" ? LwidgetDesign.selectedColor : LwidgetDesign.colorMode === "degradados" ? LwidgetDesign.selectedGradient : "linear-gradient(45deg, rgb(14, 110, 173), rgb(167, 190, 250))"; 26911 widgetData.status = LwidgetDesign.status; 26912 widgetData.theme = LwidgetDesign.theme; 26913 widgetData.position = LwidgetDesign.position; 26914 widgetData.title = LwidgetDesign.title; 26915 widgetData.statusOffline = LwidgetDesign.statusOffline; 26916 widgetData.titleOffline = LwidgetDesign.titleOffline; 26917 widgetData.textArea = LwidgetDesign.textArea; 26918 widgetData.selectedSvg = LwidgetDesign.selectedSvg || "chat-dots-fill"; 26919 widgetData.selectedMainIcon = LwidgetDesign.selectedMainIcon || "default"; 26920 widgetData.customIconData = LwidgetDesign.customIconData || ""; 26921 widgetData.customSvgMarkup = LwidgetDesign.customSvgMarkup || ""; 26922 widgetData.imageFraming = LwidgetDesign.imageFraming || { 26923 scale: 1, 26924 positionX: 50, 26925 positionY: 50 26926 }; 26927 widgetData.ratingEnabled = LwidgetOptions.ratingEnabled; 26928 widgetData.hideOfflineChat = LwidgetOptions.hideOfflineChat; 26929 widgetData.hideWidget = LwidgetOptions.hideWidget; 26930 widgetData.channels = LwidgetOptions.canales_visibles; 26931 widgetData.formTitle = LwidgetForms.title; 26932 widgetData.formDescription = LwidgetForms.description; 26933 widgetData.privacyNoticeEnabled = LwidgetForms.privacyNoticeEnabled; 26934 widgetData.privacyNoticeCheckRequired = LwidgetForms.privacyNoticeCheckRequired; 26935 widgetData.privacyNoticeUrl = LwidgetForms.privacyNoticeUrl; 26936 widgetData.startMessages = LstartMessages; 26937 widgetData.startMessagesType = LstartMessagesType; 26938 widgetData.startMessagesFlow = LstartMessagesFlow; 26939 widgetData.helpMessages = LhelpMessages; 26940 widgetData.infoHours = LwidgetHours; 26941 widgetData.infoGeneral = LinfoGeneral; 26942 try { 26943 const fecha = /* @__PURE__ */ new Date(); 26944 if (isNaN(fecha.getTime())) { 26945 throw new Error("Fecha inválida."); 26946 } 26947 const diaOriginal = fecha.getDay(); 26948 const diaSemanaAjustado = diaOriginal === 0 ? 6 : diaOriginal - 1; 26949 if (!LinfoGeneral || !LinfoGeneral.ubicacion) { 26950 throw new Error("Ubicación no definida en LinfoGeneral."); 26951 } 26952 const opciones = { 26953 hour: "2-digit", 26954 minute: "2-digit", 26955 hour12: false, 26956 timeZone: LinfoGeneral.ubicacion 26957 }; 26958 let horaConZona; 26959 try { 26960 horaConZona = new Intl.DateTimeFormat("es-ES", opciones).format(fecha); 26961 } catch (error2) { 26962 throw new Error("Error al obtener la hora con la zona horaria: " + error2.message); 26963 } 26964 if (!widgetData || !widgetData.infoHours || !widgetData.infoHours.schedule) { 26965 throw new Error("Datos de horarios no definidos correctamente en widgetData."); 26966 } 26967 const horarioDia = widgetData.infoHours.schedule[diaSemanaAjustado]; 26968 if (!horarioDia || !horarioDia.start || !horarioDia.end) { 26969 throw new Error(`No hay horario definido para el dÃa ${diaSemanaAjustado}.`); 26970 } 26971 if (!widgetData.infoHours.allWeekEnabled) { 26972 connected.value = true; 26973 } else { 26974 connected.value = horarioDia.active && isInRange(horaConZona, horarioDia.start, horarioDia.end); 26975 } 26976 } catch (error2) { 26977 console.error("Error en la detección de estado conectado/desconectado:", error2.message); 26978 } 26979 } 26980 loading.value = false;
26981 if (options.fullView === true) { 26982 manageOptions(); 26983 } 26984 }); 26985 return true; 26986 }; 26987 const timeInSeconds = (tiempo) => { 26988 const [min, seg] = tiempo.split(":").map(Number); 26989 return min * 60 + seg; 26990 }; 26991 const isInRange = (hora, inicio, fin) => { 26992 const segundosHora = timeInSeconds(hora); 26993 const segundosInicio = timeInSeconds(inicio); 26994 const segundosFin = timeInSeconds(fin); 26995 return segundosHora >= segundosInicio && segundosHora <= segundosFin; 26996 }; 26997 watch(fullView, (newValue) => { 26998 scrollToBottom(); 26999 focusInput2(); 27000 }); 27001 watch(isOpen, (newValue) => { 27002 if (newValue) { 27003 if (lastMessage.value) { 27004 if (lastMessage.value.message_num) { 27005 localStorage.setItem("quantumLastMessageReaded", lastMessage.value.message_num); 27006 bubbleBadge.value = false; 27007 } 27008 } 27009 nextTick(() => { 27010 scrollToBottom(); 27011 focusInput2(); 27012 }); 27013 } 27014 }); 27015 watch(messages, (newValue) => { 27016 if (newValue) { 27017 lastMessage.value = newValue[newValue.length - 1]; 27018 if (isOpen.value && lastMessage.value) { 27019 localStorage.setItem("quantumLastMessageReaded", lastMessage.value.message_num); 27020 } 27021 if (lastMessage.value !== "sent" && !isReadedLastMessage()) { 27022 bubbleBadge.value = true; 27023 } 27024 } 27025 }, { deep: true }); 27026 const isReadedLastMessage = () => { 27027 const lastMessageReaded = localStorage.getItem("quantumLastMessageReaded"); 27028 if (lastMessage.value && lastMessage.value.message_num && lastMessageReaded) { 27029 return lastMessage.value.message_num == lastMessageReaded; 27030 } 27031 return false; 27032 }; 27033 const focusInput2 = () => { 27034 var _a3; 27035 const input = (_a3 = messagesContainer.value) == null ? void 0 : _a3.parentNode.querySelector("#chat-input"); 27036 if (input) input.focus(); 27037 };
27038 const setCookie = (name, value, ttl) => { 27039 const now2 = /* @__PURE__ */ new Date(); 27040 now2.setTime(now2.getTime() + ttl); 27041 if (testMode.value) { 27042 localCookie.value[name] = encodeURIComponent(value); 27043 } else { 27044 document.cookie = `${name}=${encodeURIComponent(value)}; expires=${now2.toUTCString()}; path=/`; 27045 } 27046 }; 27047 const deleteCookie = (name) => { 27048 if (testMode.value) { 27049 localCookie.value[name] = ""; 27050 } else { 27051 document.cookie = name + "=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;"; 27052 } 27053 }; 27054 const getCookie = (name) => { 27055 let cookies; 27056 if (testMode.value) { 27057 if (!localCookie.value[name]) { 27058 return ""; 27059 } 27060 return decodeURIComponent(localCookie.value[name]); 27061 } else { 27062 cookies = document.cookie.split("; "); 27063 for (let i = 0; i < cookies.length; i++) { 27064 const [key, value] = cookies[i].split("="); 27065 if (key === name) { 27066 return decodeURIComponent(value); 27067 } 27068 } 27069 } 27070 return null; 27071 }; 27072 const storeUserData = () => { 27073 userData.value.email = normalizedEmail.value; 27074 setCookie( 27075 "chat_user_data", 27076 JSON.stringify(userData.value), 27077 60 * 60 * 24 * 30 27078 ); 27079 showUserDataForm.value = false; 27080 showUserCalification.value = false; 27081 sendMessage(); 27082 }; 27083 const buildMessagePayload = (message, reply_to = null, message_type = null) => { 27084 let dataToSendWS = { 27085 type: "message", 27086 domain, 27087 userHash: userHash.value, 27088 message, 27089 userData: JSON.parse(getCookie("chat_user_data")), 27090 language: getCurrentLocale() || "es" 27091 }; 27092 if (quantumBotId) { 27093 dataToSendWS.bot_id = quantumBotId; 27094 } 27095 if (reply_to) { 27096 dataToSendWS.reply_to = reply_to; 27097 } 27098 if (message_type) { 27099 dataToSendWS.message_type = message_type; 27100 } 27101 return dataToSendWS; 27102 }; 27103 const flushPendingOutgoingMessage = () => { 27104 var _a3; 27105 if (!pendingOutgoingMessage.value || !ws || ws.readyState !== WebSocket.OPEN) { 27106 return false; 27107 } 27108 ws.send(JSON.stringify(pendingOutgoingMessage.value)); 27109 sendExtraDataToWebsocket(); 27110 if (!sendedEvents.value.includes("send_message")) { 27111 sendToGtag("send_message"); 27112 } 27113 if (quantumUuid === "test-widget") { 27114 (_a3 = window.QuantumAnalytics) == null ? void 0 : _a3.trackTestMessage(quantumBotId, "simulador"); 27115 if (window.parent !== window) { 27116 window.parent.postMessage({ type: "quantumTestMessage", botId: quantumBotId, channel: "simulador" }, "*"); 27117 } 27118 } 27119 newMessage.value = ""; 27120 pendingOutgoingMessage.value = null; 27121 scrollToBottom(); 27122 return true; 27123 }; 27124 const initConnection = async () => { 27125 if (!ws || ws && ws.readyState === WebSocket.CLOSED || ws && ws.readyState === WebSocket.CLOSING) { 27126 window.dispatchEvent(new CustomEvent("quantumGetCustomData")); 27127 await connect(); 27128 sessionStorage.setItem("quantumConnectionInitiated", 1); 27129 } 27130 }; 27131 const connect = () => { 27132 return new Promise((resolve2, reject) => { 27133 if (!getCookie("chat_session")) { 27134 setCookie( 27135 "chat_session", 27136 Math.random().toString(36).substring(7), 27137 60 * 60 * 24 * 30 27138 ); 27139 } 27140 console.log("Connecting to WebSocket server..."); 27141 if (ws && (ws.readyState === WebSocket.CONNECTING || ws.readyState === WebSocket.OPEN)) { 27142 console.log("Ya existe una conexión WebSocket activa"); 27143 reject(); 27144 return; 27145 } 27146 userHash.value = (quantumUserHash || getCookie("chat_session")) + "_" + chatbot_conf; 27147 try { 27148 ws = new WebSocket(wsUrl.value); 27149 ws.onopen = () => { 27150 console.log("Connected to server"); 27151 const connectData = { 27152 type: "connect", 27153 domain, 27154 userHash: userHash.value, 27155 chatInfo: getCookie("chat_info") ? JSON.parse(getCookie("chat_info")) : {}, 27156 language: getCurrentLocale() || "es" 27157 // Agregar idioma del usuario 27158 }; 27159 if (quantumBotId) { 27160 connectData.bot_id = quantumBotId; 27161 } 27162 const data = JSON.stringify(connectData); 27163 ws.send(data); 27164 flushPendingOutgoingMessage(); 27165 resolve2(); 27166 }; 27167 ws.onmessage = (event) => { 27168 const data = JSON.parse(event.data); 27169 displayMessage(data); 27170 }; 27171 ws.onclose = () => { 27172 console.log("Conexión WebSocket cerrada"); 27173 setTimeout(connect, 5e3); 27174 }; 27175 ws.onerror = (error2) => { 27176 console.error("Error en WebSocket:", error2); 27177 }; 27178 } catch (error2) { 27179 console.error("Error al conectar:", error2); 27180 } 27181 }); 27182 }; 27183 const getBrowserInfo = () => { 27184 const ua = navigator.userAgent; 27185 let tem; 27186 let M = ua.match( 27187 /(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i 27188 ) || []; 27189 if (/trident/i.test(M[1])) { 27190 tem = /\brv[ :]+(\d+)/g.exec(ua) || []; 27191 return { name: "IE", version: tem[1] || "" }; 27192 } 27193 if (M[1] === "Chrome") { 27194 tem = ua.match(/\bOPR\/(\d+)/); 27195 if (tem != null) return { name: "Opera", version: tem[1] }; 27196 } 27197 M = M[2] ? [M[1], M[2]] : [navigator.appName, navigator.appVersion, "-?"]; 27198 if ((tem = ua.match(/version\/(\d+)/i)) != null) M.splice(1, 1, tem[1]); 27199 return { 27200 name: M[0], 27201 version: M[1] 27202 }; 27203 }; 27204 const getDeviceInfo = () => { 27205 return { 27206 userAgent: navigator.userAgent, 27207 platform: navigator.platform 27208 }; 27209 }; 27210 const getUrlInfo = () => { 27211 return { 27212 url: window.location.href, 27213 title: document.title, 27214 timestamp: Date.now() 27215 }; 27216 }; 27217 const storeInfo = () => { 27218 var _a3; 27219 const dataToStore = { 27220 extraData: { userFields: userFields ? userFields : {}, options: options ? options : {} }, 27221 browserInfo: getBrowserInfo(), 27222 deviceInfo: getDeviceInfo(), 27223 urlInfo: [], 27224 timestamp: Date.now() 27225 }; 27226 if (!getCookie("chat_info")) {
27227 setCookie("chat_info", JSON.stringify(dataToStore), 60 * 60 * 24 * 30); 27228 } else { 27229 const lastData = JSON.parse(getCookie("chat_info")); 27230 if (((_a3 = lastData.urlInfo[lastData.urlInfo.length - 1]) == null ? void 0 : _a3.url) !== window.location.href) { 27231 lastData.urlInfo.push(getUrlInfo()); 27232 } 27233 lastData.extraData = dataToStore.extraData; 27234 setCookie("chat_info", JSON.stringify(lastData), 60 * 60 * 24 * 30); 27235 } 27236 }; 27237 const sendSystemMessage = (message) => { 27238 if (ws && ws.readyState === WebSocket.OPEN) { 27239 const msgData = { 27240 type: "message", 27241 domain, 27242 userHash: userHash.value, 27243 userAgent: "IA", 27244 message, 27245 language: getCurrentLocale() || "es" 27246 }; 27247 if (quantumBotId) { 27248 msgData.bot_id = quantumBotId; 27249 } 27250 ws.send(JSON.stringify(msgData)); 27251 } 27252 }; 27253 const sendMessage = async (reply_to = null, message_type = null) => { 27254 const message = newMessage.value.trim(); 27255 if (getCookie("chat_user_data") && JSON.parse(getCookie("chat_user_data")).name == "Desconocido") { 27256 resetUserData(); 27257 showUserDataForm.value = true; 27258 return; 27259 } 27260 if (!getCookie("chat_user_data") || getCookie("chat_user_data") && !JSON.parse(getCookie("chat_user_data")).name) { 27261 showUserDataForm.value = true; 27262 return; 27263 } 27264 if (message) { 27265 pendingOutgoingMessage.value = buildMessagePayload(message, reply_to, message_type); 27266 if (!ws || ws.readyState === WebSocket.CLOSED || ws.readyState === WebSocket.CLOSING) { 27267 await initConnection(); 27268 } 27269 if (ws && ws.readyState === WebSocket.OPEN) { 27270 flushPendingOutgoingMessage(); 27271 } 27272 } 27273 }; 27274 const displayMessage = (data) => { 27275 if (data.type === "system") ; 27276 else if (data.type === "videocall") { 27277 useSweetAlert().showAlertOption({ html: `<img src="https://quantumasis.com/template/estandar/modulos/cuentadashboard_38o4db/images/aplicacion-de-videollamadas.png" class="h-32 mx-auto mb-8" style="height:8rem;margin-bottom:2rem;margin:0 auto;"><p class="text-xl font-bold" style="font-family: ui-sans-serif, system-ui, sans-serif; font-weight:700;">${t("system.videoConferenceTitle")}</p><p style="font-family: ui-sans-serif, system-ui, sans-serif">${t("system.videoConferenceDescription")}</p>` }).then((dataSweet) => { 27278 if (dataSweet.isConfirmed) { 27279 let data2 = data; 27280 data2.type = "videocall_accepted"; 27281 if (ws && ws.readyState === WebSocket.OPEN) { 27282 ws.send(JSON.stringify(data2)); 27283 } 27284 useSweetAlert().showSuccessAutoDestroy(t("system.videoConferenceRequestSent")); 27285 setTimeout(() => { 27286 window.open(data.url, "_blank"); 27287 }, 2e3); 27288 } 27289 }); 27290 scrollToBottom(); 27291 } else if (data.type === "writing") { 27292 readingActive.value = true; 27293 scrollToBottom(); 27294 } else if (data.type === "stopWriting") { 27295 readingActive.value = false; 27296 } else if (data.type === "ping") { 27297 if (ws && ws.readyState === WebSocket.OPEN) { 27298 ws.send(JSON.stringify({ type: "pong" })); 27299 } 27300 } else if (data.type === "history") { 27301 readingActive.value = false; 27302 if (data.messages.length) { 27303 if (fullView.value) { 27304 isOpen.value = true; 27305 } else if (isWebChannelActive.value && sessionStorage.getItem("quantumChatOpen") == null) { 27306 isOpen.value = true; 27307 } else if (isWebChannelActive.value) { 27308 isOpen.value = sessionStorage.getItem("quantumChatOpen") == 0 ? false : true; 27309 } 27310 } 27311 if (data.contact && !testMode.value && data.contact.email !== "[email protected]" && data.contact.name !== "Desconocido") { 27312 userData.value = { 27313 name: data.contact.name, 27314 email: data.contact.email, 27315 telefono: data.contact.telefono 27316 }; 27317 setCookie( 27318 "chat_user_data", 27319 JSON.stringify(userData.value), 27320 60 * 60 * 24 * 30 27321 ); 27322 }
27323 data.messages.forEach((msg) => { 27324 if (msg.type !== "system" && msg.message_type !== "system") { 27325 let type = msg.userHash === userHash.value ? "sent" : "received"; 27326 if (msg.message_type === "report") { 27327 type = "report"; 27328 } 27329 messages.value.push({ 27330 type, 27331 message: msg.message, 27332 timestamp: msg.timestamp, 27333 user: msg.user, 27334 message_num: msg.message_num, 27335 message_type: msg.message_type 27336 }); 27337 } 27338 }); 27339 scrollToBottom(); 27340 } else if (data.type === "message" && data.message_type !== "system") { 27341 readingActive.value = false; 27342 const isSent = data.userHash === userHash.value; 27343 if (!isSent) playNotificationSound(); 27344 let type = isSent ? "sent" : "received"; 27345 if (data.message_type === "report") { 27346 type = "report"; 27347 } 27348 messages.value.push({ 27349 type, 27350 message: data.message, 27351 timestamp: data.timestamp, 27352 user: data.user, 27353 message_num: data.message_num, 27354 message_type: data.message_type 27355 }); 27356 scrollToBottom(); 27357 } 27358 }; 27359 const formatMessageContent = (message, msgData) => { 27360 switch (msgData.message_type) { 27361 case "calification": 27362 try { 27363 return { 27364 isComponent: true, 27365 messageData: JSON.parse(message) 27366 }; 27367 } catch (e) { 27368 console.log("Error al parsear el mensaje de calificación:", e); 27369 return message; 27370 } 27371 case "interactive": 27372 try { 27373 return { 27374 isComponent: true, 27375 messageData: JSON.parse(message) 27376 }; 27377 } catch (e) { 27378 console.log("Error al parsear el mensaje interactivo:", e); 27379 return message; 27380 } 27381 default: 27382 const urlPattern = /(https?:\/\/[^\s]+)/g; 27383 const imagePattern = /(https?:\/\/[^\s]+(\.jpg|\.jpeg|\.png|\.gif|\.bmp|\.webp))/i; 27384 const htmlPattern = /<[^>]*>/g; 27385 if (htmlPattern.test(message)) { 27386 return message; 27387 } else if (imagePattern.test(message)) { 27388 return `<a href="${message}" target="_blank" rel="noopener noreferrer"><img src="${message}" alt="Image" class="h-32 rounded" /></a>`; 27389 } else if (urlPattern.test(message) && message.indexOf("http") === 0) { 27390 return `<a href="${message}" target="_blank" rel="noopener noreferrer" class="text-blue-500 underline">${message}</a>`; 27391 } else { 27392 let formattedMessage = message; 27393 const foundUrls = []; 27394 formattedMessage = formattedMessage.replace(/https?:\/\/[^\s]+/g, (url) => { 27395 foundUrls.push(url.replace(/[.,;:)\]]+$/, "")); 27396 return `\0${foundUrls.length - 1}\0` + url.slice(foundUrls[foundUrls.length - 1].length); 27397 }); 27398 formattedMessage = formattedMessage.replace(new RegExp("(?<!\\*)\\*([^*]+)\\*(?!\\*)", "g"), "<strong>$1</strong>"); 27399 formattedMessage = formattedMessage.replace(/_([^_]+)_/g, "<em>$1</em>"); 27400 formattedMessage = formattedMessage.replace(/\n/g, "<br>"); 27401 formattedMessage = formattedMessage.replace(/\u0000(\d+)\u0000/g, (_m, i) => `<a href="${foundUrls[i]}" target="_blank" rel="noopener noreferrer" class="text-blue-500 underline">${foundUrls[i]}</a>`); 27402 return formattedMessage; 27403 } 27404 } 27405 }; 27406 const formatTimestamp = (timestamp) => { 27407 const timezoneOffset = -1 * (/* @__PURE__ */ new Date()).getTimezoneOffset() * 60 * 1e3; 27408 return new Date(new Date(timestamp).getTime() + timezoneOffset).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }); 27409 }; 27410 const toggleChat = async () => { 27411 isOpen.value = !isOpen.value; 27412 sessionStorage.setItem("quantumChatOpen", isOpen.value ? 1 : 0); 27413 if (isOpen.value) { 27414 if (!sendedEvents.value.includes("open_chat")) { 27415 sendToGtag("open_chat"); 27416 } 27417 await initConnection(); 27418 setTimeout(() => { 27419 focusInput2(); 27420 }, 100); 27421 } 27422 }; 27423 const onWidgetClick = () => { 27424 if (haveChannels(true) > 1) { 27425 toggledSocialNetworks.value = !toggledSocialNetworks.value; 27426 } else { 27427 toggleChat(); 27428 } 27429 }; 27430 const scrollToBottom = () => { 27431 nextTick(() => { 27432 if (messagesContainer.value) { 27433 messagesContainer.value.scrollTop = messagesContainer.value.scrollHeight; 27434 } 27435 }); 27436 }; 27437 const resetChat = async () => { 27438 await fetch(apiUrl.value + "/action/reset_test_chat/", { 27439 method: "POST", 27440 headers: { 27441 "Content-Type": "application/json" 27442 }, 27443 body: JSON.stringify({ 27444 hash: quantumKey, 27445 bot_id: quantumBotId, 27446 user_id: userHash.value 27447 }) 27448 }).then((data) => data.json()).then((data) => { 27449 if (data.result && data.result.success) { 27450 messages.value = []; 27451 messages.value.push({ 27452 type: "system", 27453 message: t("system.messagesDeleted"), 27454 timestamp: (/* @__PURE__ */ new Date()).getTime(), 27455 user: "" 27456 }); 27457 } 27458 }); 27459 }; 27460 if (quantumUuid) { 27461 if (getCookie("chat_session")) { 27462 deleteCookie("chat_session"); 27463 }
27464 setCookie( 27465 "chat_session", 27466 quantumUuid.split("_")[0], 27467 60 * 60 * 24 * 30 27468 ); 27469 } 27470 onMounted(async () => { 27471 await getDomainData(); 27472 getNotificationSoundConfig(); 27473 if (sessionStorage.getItem("quantumConnectionInitiated") == 1 || fullView.value) { 27474 await initConnection(); 27475 } 27476 storeInfo(); 27477 }); 27478 onUnmounted(() => { 27479 if (ws) ws.close(); 27480 }); 27481 const getFlowConnectedNodes = (node) => { 27482 let nodes = widgetData.startMessagesFlow.nodes || []; 27483 let edges = widgetData.startMessagesFlow.edges; 27484 let connectedEdges = edges.filter((edge) => edge.source === node.id); 27485 let connectedNodes = nodes.filter((node2) => connectedEdges.map((edge) => edge.target).includes(node2.id)); 27486 return connectedNodes; 27487 }; 27488 const renderFlowConnected = (node) => { 27489 let connectedNodes = getFlowConnectedNodes(node); 27490 if (connectedNodes.length > 0) { 27491 let optionsNodes = []; 27492 connectedNodes.forEach((node2) => { 27493 switch (node2.data.action) { 27494 case "Opción": 27495 optionsNodes.push(node2); 27496 break; 27497 default: 27498 sendFlowData(node2.id); 27499 } 27500 }); 27501 if (optionsNodes.length > 0) { 27502 let message = ` 27503 <ul class="flex gap-4"> 27504 ${optionsNodes.map((node2) => ` 27505 <li> 27506 <button onclick="window.dispatchEvent(new CustomEvent('quantumFlowOptionSelected',{detail:'${node2.id}'}));this.parentNode.parentNode.style.pointerEvents = 'none'" class="bg-white text-black rounded-lg font-normal border border-gray-300 p-2">${node2.data.label}</button> 27507 </li> 27508 `).join("")} 27509 </ul>`; 27510 sendFlowData(optionsNodes[0].id, message); 27511 } 27512 return connectedNodes; 27513 } else { 27514 return null; 27515 } 27516 }; 27517 const sendFlowData = (nodeId, message, click) => { 27518 let node = widgetData.startMessagesFlow.nodes.find((node2) => node2.id === nodeId); 27519 let resultConnected; 27520 switch (node.data.action) { 27521 case "Mensaje": 27522 sendSystemMessage(message ? message : node.data.label.replace(/{USERNAME}/g, userData.value.name)); 27523 resultConnected = renderFlowConnected(node); 27524 if (!resultConnected) { 27525 resetUserData(); 27526 canWrite.value = true; 27527 } 27528 break; 27529 case "Opción": 27530 sendSystemMessage(message ? message : node.data.label.replace(/{USERNAME}/g, userData.value.name)); 27531 canWrite.value = false; 27532 break; 27533 case "Respuesta IA": 27534 handleFlowIAResponse(node.id).then((response) => { 27535 if (response) { 27536 sendSystemMessage(response ? response : node.data.label.replace(/{USERNAME}/g, userData.value.name)); 27537 resultConnected = renderFlowConnected(node); 27538 if (!resultConnected) { 27539 resetUserData(); 27540 canWrite.value = true; 27541 } 27542 } 27543 }); 27544 break; 27545 } 27546 }; 27547 const handleFlowIAResponse = async (nodeId) => { 27548 return new Promise((resolve2, reject) => { 27549 fetch(apiUrl.value + "/action/getFlowIAResponse/", { 27550 method: "POST", 27551 headers: { 27552 "Content-Type": "application/json" 27553 }, 27554 body: JSON.stringify({ 27555 hash: quantumKey, 27556 nodeId, 27557 userHash: userHash.value 27558 }) 27559 }).then((data) => data.json()).then((data) => { 27560 if (data.message) { 27561 resolve2(data.message); 27562 } else { 27563 reject(); 27564 } 27565 }); 27566 }); 27567 }; 27568 const manageOptions = async () => { 27569 if (options.fullView === true) { 27570 if (testMode.value || isWebChannelActive.value) { 27571 fullView.value = true; 27572 } 27573 } 27574 if (fullView.value) { 27575 await forceOpenChat(); 27576 } 27577 sendExtraDataToWebsocket(); 27578 }; 27579 const manageUserFields = () => { 27580 sendExtraDataToWebsocket(); 27581 }; 27582 const sendExtraDataToWebsocket = () => { 27583 if (sendCustomData) { 27584 clearTimeout(sendCustomData); 27585 } 27586 sendCustomData = setTimeout(() => { 27587 storeInfo(); 27588 const data = JSON.stringify({ 27589 type: "chatInfo", 27590 domain, 27591 userHash: userHash.value, 27592 chatInfo: JSON.parse(getCookie("chat_info")), 27593 language: getCurrentLocale() || "es" 27594 // Agregar idioma del usuario 27595 }); 27596 if (ws && ws.readyState === WebSocket.OPEN) { 27597 ws.send(data); 27598 } 27599 }, 1e3); 27600 }; 27601 window.addEventListener("quantumFlowOptionSelected", (event) => { 27602 if (canWrite.value) { 27603 return; 27604 } 27605 let node = widgetData.startMessagesFlow.nodes.find((node2) => node2.id === event.detail); 27606 renderFlowConnected(node); 27607 }); 27608 window.addEventListener("quantumCustomFieldAdded", (event) => { 27609 userFields = event.detail; 27610 manageUserFields(); 27611 }); 27612 window.addEventListener("quantumOptionsAdded", (event) => { 27613 options = event.detail; 27614 manageOptions(); 27615 }); 27616 const toggleFullView = () => { 27617 fullView.value = !fullView.value; 27618 }; 27619 const handleInteractiveOption = (optionData) => { 27620 newMessage.value = optionData.id; 27621 sendMessage(optionData.reply_to, optionData.type || null); 27622 }; 27623 return { 27624 toggleFullView, 27625 loading, 27626 fullView, 27627 userData, 27628 showUserDataForm, 27629 showUserCalification, 27630 isOpen, 27631 canWrite, 27632 messages, 27633 newMessage, 27634 toggledSocialNetworks, 27635 readingActive, 27636 connected, 27637 connect, 27638 sendMessage, 27639 resetChat, 27640 formatMessageContent, 27641 storeUserData, 27642 formatTimestamp, 27643 toggleChat, 27644 onWidgetClick, 27645 getSelectedSvgOption, 27646 isWebChannelActive, 27647 testMode, 27648 getMessagePosition, 27649 messagesContainer, 27650 widgetData, 27651 apiUrl, 27652 haveChannels, 27653 avatar, 27654 stars, 27655 hoveredIndex, 27656 selectedIndex, 27657 hoverStars, 27658 resetHover, 27659 selectStars, 27660 isFormValid, 27661 isEmailValid, 27662 bubbleBadge, 27663 handleInteractiveOption, 27664 chatBubbleImage, 27665 hoveredChannel, 27666 t 27667 }; 27668 } 27669}; 27670const _hoisted_1 = { 27671 key: 0, 27672 class: "chat-widget" 27673}; 27674const _hoisted_2 = { 27675 key: 0, 27676 class: "flex flex-col items-center justify-center", 27677 style: { "pointer-events": "all" } 27678}; 27679const _hoisted_3 = { 27680 key: 0, 27681 class: "flex items-center justify-center text-white cursor-pointer rounded-2xl p-2" 27682}; 27683const _hoisted_4 = { 27684 key: 0, 27685 class: "flex flex-col items-center gap-1 dropdown-menu" 27686}; 27687const _hoisted_5 = ["onMouseenter"]; 27688const _hoisted_6 = ["href"]; 27689const _hoisted_7 = ["src"]; 27690const _hoisted_8 = { class: "flex items-center justify-center w-10 h-10" }; 27691const _hoisted_9 = { class: "w-10 h-10 rounded-full bg-white p-1 shadow flex items-center justify-center" }; 27692const _hoisted_10 = ["viewBox"]; 27693const _hoisted_11 = ["d", "fill", "stroke", "stroke-width", "stroke-linecap", "fill-rule", "stroke-linejoin", "stroke-miterlimit"]; 27694const _hoisted_12 = ["d"]; 27695const _hoisted_13 = { 27696 key: 1, 27697 class: "flex items-center justify-center text-white cursor-pointer rounded-full" 27698}; 27699const _hoisted_14 = ["onMouseenter"]; 27700const _hoisted_15 = ["href"]; 27701const _hoisted_16 = ["src"]; 27702const _hoisted_17 = ["src"]; 27703const _hoisted_18 = ["innerHTML"]; 27704const _hoisted_19 = ["viewBox"]; 27705const _hoisted_20 = ["d", "fill", "stroke", "stroke-width", "stroke-linecap", "fill-rule", "stroke-linejoin", "stroke-miterlimit"]; 27706const _hoisted_21 = ["d"]; 27707const _hoisted_22 = ["src"]; 27708const _hoisted_23 = { 27709 key: 1, 27710 class: "flex items-center gap-3" 27711}; 27712const _hoisted_24 = ["src"]; 27713const _hoisted_25 = ["innerHTML"]; 27714const _hoisted_26 = ["viewBox"]; 27715const _hoisted_27 = ["d", "fill", "stroke", "stroke-width", "stroke-linecap", "fill-rule", "stroke-linejoin", "stroke-miterlimit"]; 27716const _hoisted_28 = ["d"]; 27717const _hoisted_29 = ["src"]; 27718const _hoisted_30 = { 27719 class: "text-base font-medium flex-shrink-0", 27720 style: { "margin-left": "0.75rem" } 27721}; 27722const _hoisted_31 = { 27723 key: 2, 27724 class: "absolute top-[0.35rem] right-[0.55rem] w-4 h-4 bg-red-600 rounded-full border-2 border-white" 27725}; 27726const _hoisted_32 = { 27727 key: 1, 27728 class: "absolute top-0 right-0 w-full h-full z-10", 27729 style: { "pointer-events": "all" } 27730}; 27731const _hoisted_33 = { class: "w-full bg-white absolute bottom-0 left-0 rounded-2xl p-8 text-black text-left" }; 27732const _hoisted_34 = { class: "text-lg font-bold" }; 27733const _hoisted_35 = { class: "text-gray-600 mt-4" }; 27734const _hoisted_36 = { 27735 for: "nombre", 27736 class: "block mt-4" 27737}; 27738const _hoisted_37 = { class: "block text" }; 27739const _hoisted_38 = ["disabled", "placeholder"]; 27740const _hoisted_39 = { 27741 key: 0, 27742 class: "mt-2 text-xs text-gray-600 italic" 27743}; 27744const _hoisted_40 = { 27745 for: "email", 27746 class: "block mt-4" 27747}; 27748const _hoisted_41 = { class: "block text" }; 27749const _hoisted_42 = ["disabled", "placeholder"]; 27750const _hoisted_43 = { 27751 key: 1, 27752 class: "mt-2 text-xs text-gray-600 italic" 27753}; 27754const _hoisted_44 = { 27755 key: 2, 27756 class: "mt-2 text-xs text-gray-600 italic" 27757}; 27758const _hoisted_45 = { 27759 key: 3, 27760 class: "flex flex-col mt-4 w-full items-center justify-center" 27761}; 27762const _hoisted_46 = { 27763 key: 0, 27764 class: "text-xs" 27765}; 27766const _hoisted_47 = ["href"]; 27767const _hoisted_48 = { 27768 key: 1, 27769 class: "text-xs flex items-center" 27770}; 27771const _hoisted_49 = ["disabled"]; 27772const _hoisted_50 = { 27773 for: "checkPrivacy", 27774 class: "ml-2" 27775}; 27776const _hoisted_51 = ["href"]; 27777const _hoisted_52 = { 27778 key: 2, 27779 class: "mt-2 text-xs text-gray-600 italic" 27780}; 27781const _hoisted_53 = ["href"]; 27782const _hoisted_54 = ["disabled"]; 27783const _hoisted_55 = { 27784 key: 2, 27785 class: "absolute top-0 right-0 w-full h-full z-10", 27786 style: { "pointer-events": "all" } 27787}; 27788const _hoisted_56 = { class: "w-full bg-white absolute bottom-0 left-0 rounded-2xl p-8 text-left" }; 27789const _hoisted_57 = { class: "text-lg font-bold" }; 27790const _hoisted_58 = { class: "text-gray-600 mt-4" }; 27791const _hoisted_59 = { class: "flex mt-4 gap-4" }; 27792const _hoisted_60 = ["onMouseover", "onClick"]; 27793const _hoisted_61 = { class: "w-12 h-12 border-2 bg-white shadow-sm rounded-full flex items-center justify-center flex-shrink-0 mr-4 relative cursor-pointer" }; 27794const _hoisted_62 = ["src"]; 27795const _hoisted_63 = { class: "select-none flex flex-col justify-between items-start leading-none w-full" }; 27796const _hoisted_64 = { class: "text-lg font-semibold" }; 27797const _hoisted_65 = { 27798 key: 0, 27799 xmlns: "http://www.w3.org/2000/svg", 27800 viewBox: "0 0 24 24", 27801 fill: "none", 27802 stroke: "currentColor", 27803 "stroke-linecap": "round", 27804 "stroke-linejoin": "round", 27805 width: "24", 27806 height: "24", 27807 "stroke-width": "2" 27808}; 27809const _hoisted_66 = { 27810 key: 1, 27811 xmlns: "http://www.w3.org/2000/svg", 27812 viewBox: "0 0 24 24", 27813 fill: "none", 27814 stroke: "currentColor", 27815 "stroke-linecap": "round", 27816 "stroke-linejoin": "round", 27817 width: "24", 27818 height: "24", 27819 "stroke-width": "2" 27820}; 27821const _hoisted_67 = ["innerHTML"]; 27822const _hoisted_68 = { 27823 key: 1, 27824 class: "inline-block px-6 py-4 italic bg-gray-100 text-gray-400 text-xs rounded-xl", 27825 style: { background: "" } 27826}; 27827const _hoisted_69 = ["innerHTML"]; 27828const _hoisted_70 = ["innerHTML"]; 27829const _hoisted_71 = ["innerHTML"]; 27830const _hoisted_72 = { 27831 key: 0, 27832 class: "writing border bg-gray-200 text-white rounded-xl rounded-tl-none px-4 py-2 text-sm w-20 flex justify-center py-4" 27833}; 27834const _hoisted_73 = { 27835 class: "w-full p-4 border-t border-gray-200 bg-white rounded-b-lg", 27836 style: { "pointer-events": "all" } 27837}; 27838const _hoisted_74 = ["placeholder", "disabled"]; 27839const _hoisted_75 = ["disabled"]; 27840function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
27841 const _component_PhoneInput = resolveComponent("PhoneInput"); 27842 const _component_InteractiveMessage = resolveComponent("InteractiveMessage"); 27843 return !$setup.connected && !$setup.widgetData.hideOfflineChat || $setup.haveChannels(true) ? (openBlock(), createElementBlock("div", _hoisted_1, [ 27844 _cache[28] || (_cache[28] = createBaseVNode("div", { class: "h-32 mx-auto mb-8 text-xl font-bold hidden" }, null, -1)), 27845 !$setup.loading ? (openBlock(), createElementBlock("div", { 27846 key: 0, 27847 class: normalizeClass([{ "fixed top-0 left-0 z-[99999] w-full": $setup.fullView, "fixed bottom-4 right-4 z-[99999]": !$setup.fullView && $setup.widgetData.position === "Derecho", "fixed bottom-4 left-4 z-[99999]": !$setup.fullView && $setup.widgetData.position !== "Derecho" }, "pointer-events-none"]) 27848 }, [ 27849 createBaseVNode("div", { 27850 class: normalizeClass([{ "shadow-lg min-h-[600px]": $setup.isOpen, "w-full h-screen justify-between": $setup.fullView, "w-96 max-h-[600px] rounded-lg": !$setup.fullView, "items-end": $setup.widgetData.position === "Derecho", "items-start": $setup.widgetData.position !== "Derecho" }, "flex flex-col"]) 27851 }, [ 27852 !$setup.fullView ? (openBlock(), createElementBlock("div", _hoisted_2, [ 27853 !$setup.isOpen && $setup.haveChannels(true) >= 2 ? (openBlock(), createElementBlock("div", _hoisted_3, [ 27854 $setup.toggledSocialNetworks ? (openBlock(), createElementBlock("ul", _hoisted_4, [ 27855 (openBlock(true), createElementBlock(Fragment, null, renderList($setup.widgetData.channels, (canal) => { 27856 return openBlock(), createElementBlock(Fragment, { 27857 key: canal.id 27858 }, [ 27859 canal.id != 2 && canal.active ? (openBlock(), createElementBlock("div", { 27860 key: 0, 27861 class: "channel-item", 27862 style: { "position": "relative" }, 27863 onMouseenter: ($event) => $setup.hoveredChannel = canal.id, 27864 onMouseleave: _cache[0] || (_cache[0] = ($event) => $setup.hoveredChannel = null) 27865 }, [ 27866 createBaseVNode("a", { 27867 href: canal.link, 27868 target: "_blank", 27869 class: "flex items-center justify-center w-10 h-10" 27870 }, [ 27871 createBaseVNode("img", { 27872 src: canal.icon, 27873 alt: "", 27874 class: "w-10 h-10 rounded-full bg-white rounded-full overflow-hidden p-1 shadow object-contain flex-shrink-0" 27875 }, null, 8, _hoisted_7) 27876 ], 8, _hoisted_6), 27877 $setup.hoveredChannel === canal.id ? (openBlock(), createElementBlock("span", { 27878 key: 0, 27879 class: "whitespace-nowrap text-xs px-3 py-2 rounded pointer-events-none", 27880 style: normalizeStyle({ 27881 position: "absolute", 27882 top: "50%", 27883 [$setup.widgetData.position === "Derecho" ? "right" : "left"]: "3rem", 27884 transform: "translateY(-50%)", 27885 zIndex: 999999, 27886 backgroundColor: "#1f2937", 27887 color: "white", 27888 boxShadow: "0 4px 6px rgba(0,0,0,0.3)" 27889 }) 27890 }, toDisplayString$1(canal.name), 5)) : createCommentVNode("", true) 27891 ], 40, _hoisted_5)) : createCommentVNode("", true) 27892 ], 64); 27893 }), 128)), 27894 $setup.isWebChannelActive ? (openBlock(), createElementBlock("div", { 27895 key: 0, 27896 class: "channel-item cursor-pointer", 27897 style: { "position": "relative" }, 27898 onMouseenter: _cache[1] || (_cache[1] = ($event) => $setup.widgetData.showWebTooltip = true), 27899 onMouseleave: _cache[2] || (_cache[2] = ($event) => $setup.widgetData.showWebTooltip = false), 27900 onClick: _cache[3] || (_cache[3] = (...args) => $setup.toggleChat && $setup.toggleChat(...args)) 27901 }, [ 27902 createBaseVNode("div", _hoisted_8, [ 27903 createBaseVNode("div", _hoisted_9, [ 27904 createBaseVNode("div", { 27905 class: "w-full h-full rounded-full flex items-center justify-center", 27906 style: normalizeStyle({ background: $setup.widgetData.computedBackgroud }) 27907 }, [ 27908 (openBlock(), createElementBlock("svg", {
27909 viewBox: $setup.getSelectedSvgOption().viewBox, 27910 xmlns: "http://www.w3.org/2000/svg", 27911 width: "20", 27912 height: "20", 27913 fill: "currentColor", 27914 class: "w-5 h-5 flex-shrink-0 text-white" 27915 }, [ 27916 $setup.getSelectedSvgOption().paths ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList($setup.getSelectedSvgOption().paths, (p2, idx) => { 27917 return openBlock(), createElementBlock("path", { 27918 key: idx, 27919 d: p2.d, 27920 fill: p2.fill || "currentColor", 27921 stroke: p2.stroke, 27922 "stroke-width": p2.strokeWidth, 27923 "stroke-linecap": p2.strokeLinecap, 27924 "fill-rule": p2.fillRule, 27925 "stroke-linejoin": p2.strokeLinejoin, 27926 "stroke-miterlimit": p2.strokeMiterlimit 27927 }, null, 8, _hoisted_11); 27928 }), 128)) : (openBlock(), createElementBlock("path", { 27929 key: 1, 27930 d: $setup.getSelectedSvgOption().path 27931 }, null, 8, _hoisted_12)) 27932 ], 8, _hoisted_10)) 27933 ], 4) 27934 ]) 27935 ]), 27936 $setup.widgetData.showWebTooltip ? (openBlock(), createElementBlock("span", { 27937 key: 0, 27938 class: "whitespace-nowrap text-xs px-3 py-2 rounded pointer-events-none", 27939 style: normalizeStyle({ 27940 position: "absolute", 27941 top: "50%", 27942 [$setup.widgetData.position === "Derecho" ? "right" : "left"]: "3rem", 27943 transform: "translateY(-50%)", 27944 zIndex: 999999, 27945 backgroundColor: "#1f2937", 27946 color: "white", 27947 boxShadow: "0 4px 6px rgba(0,0,0,0.3)" 27948 }) 27949 }, " Web ", 4)) : createCommentVNode("", true) 27950 ], 32)) : createCommentVNode("", true) 27951 ])) : createCommentVNode("", true) 27952 ])) : createCommentVNode("", true), 27953 !$setup.isOpen && $setup.haveChannels(true) === 1 && !$setup.isWebChannelActive ? (openBlock(), createElementBlock("div", _hoisted_13, [ 27954 (openBlock(true), createElementBlock(Fragment, null, renderList($setup.widgetData.channels, (canal) => { 27955 return withDirectives((openBlock(), createElementBlock("div", { 27956 key: canal.id, 27957 style: { "position": "relative" }, 27958 onMouseenter: ($event) => $setup.hoveredChannel = canal.id, 27959 onMouseleave: _cache[4] || (_cache[4] = ($event) => $setup.hoveredChannel = null) 27960 }, [ 27961 createBaseVNode("a", { 27962 href: canal.link, 27963 target: "_blank", 27964 class: "flex items-center justify-center w-14 h-14" 27965 }, [ 27966 createBaseVNode("img", { 27967 src: canal.icon, 27968 alt: "", 27969 class: "w-14 h-14 rounded-full overflow-hidden object-contain flex-shrink-0 shadow" 27970 }, null, 8, _hoisted_16) 27971 ], 8, _hoisted_15), 27972 $setup.hoveredChannel === canal.id ? (openBlock(), createElementBlock("span", { 27973 key: 0, 27974 class: "whitespace-nowrap text-xs px-3 py-2 rounded pointer-events-none", 27975 style: normalizeStyle({ 27976 position: "absolute", 27977 top: "50%", 27978 [$setup.widgetData.position === "Derecho" ? "right" : "left"]: "4rem", 27979 transform: "translateY(-50%)", 27980 zIndex: 999999, 27981 backgroundColor: "#1f2937", 27982 color: "white", 27983 boxShadow: "0 4px 6px rgba(0,0,0,0.3)" 27984 }) 27985 }
27985, toDisplayString$1(canal.name), 5)) : createCommentVNode("", true) 27986 ], 40, _hoisted_14)), [ 27987 [vShow, canal.id != 2 && canal.active] 27988 ]); 27989 }), 128)) 27990 ])) : createCommentVNode("", true), 27991 !$setup.isOpen && ($setup.haveChannels(true) >= 2 || $setup.haveChannels(true) === 1 && $setup.isWebChannelActive) ? (openBlock(), createElementBlock("div", { 27992 key: 2, 27993 onClick: _cache[5] || (_cache[5] = (...args) => $setup.onWidgetClick && $setup.onWidgetClick(...args)), 27994 class: normalizeClass(["cursor-pointer mt-2 relative flex items-center justify-center", $setup.widgetData.theme === "Burbuja" ? "rounded-full text-white p-2 overflow-hidden" : "rounded-full text-white shadow-sm"]), 27995 style: normalizeStyle([{ background: $setup.widgetData.computedBackgroud }, $setup.widgetData.theme === "Burbuja" ? { width: "72px", height: "72px" } : { padding: "0.75rem 1.5rem" }]) 27996 }, [ 27997 $setup.widgetData.theme === "Burbuja" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [ 27998 $setup.widgetData.selectedMainIcon === "custom-upload" && $setup.widgetData.customIconData ? (openBlock(), createElementBlock("img", { 27999 key: 0, 28000 src: $setup.widgetData.customIconData, 28001 alt: "custom icon", 28002 class: "w-14 h-14 object-cover", 28003 style: normalizeStyle({ 28004 transform: `scale(${$setup.widgetData.imageFraming.scale}) translate(${($setup.widgetData.imageFraming.positionX - 50) * 1}%, ${($setup.widgetData.imageFraming.positionY - 50) * 1}%)` 28005 }), 28006 draggable: "false" 28007 }, null, 12, _hoisted_17)) : $setup.widgetData.selectedMainIcon === "custom-inline" && $setup.widgetData.customSvgMarkup ? (openBlock(), createElementBlock("div", { 28008 key: 1, 28009 class: "w-12 h-12 text-white custom-svg-preview", 28010 innerHTML: $setup.widgetData.customSvgMarkup 28011 }, null, 8, _hoisted_18)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [ 28012 $setup.haveChannels(true) === 1 && $setup.isWebChannelActive ? (openBlock(), createElementBlock("svg", { 28013 key: 0,
28014 viewBox: $setup.getSelectedSvgOption().viewBox, 28015 xmlns: "http://www.w3.org/2000/svg", 28016 width: "48", 28017 height: "48", 28018 fill: "currentColor", 28019 class: "w-12 h-12 flex-shrink-0 text-white" 28020 }, [ 28021 $setup.getSelectedSvgOption().paths ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList($setup.getSelectedSvgOption().paths, (p2, idx) => { 28022 return openBlock(), createElementBlock("path", { 28023 key: idx, 28024 d: p2.d, 28025 fill: p2.fill || "currentColor", 28026 stroke: p2.stroke, 28027 "stroke-width": p2.strokeWidth, 28028 "stroke-linecap": p2.strokeLinecap, 28029 "fill-rule": p2.fillRule, 28030 "stroke-linejoin": p2.strokeLinejoin, 28031 "stroke-miterlimit": p2.strokeMiterlimit 28032 }, null, 8, _hoisted_20); 28033 }), 128)) : (openBlock(), createElementBlock("path", { 28034 key: 1, 28035 d: $setup.getSelectedSvgOption().path 28036 }, null, 8, _hoisted_21)) 28037 ], 8, _hoisted_19)) : (openBlock(), createElementBlock("img", { 28038 key: 1, 28039 src: $setup.chatBubbleImage, 28040 alt: "QBot", 28041 class: "w-12 h-12 mb-1 object-contain invert", 28042 style: { "filter": "invert(1)" } 28043 }, null, 8, _hoisted_22)) 28044 ], 64)) 28045 ], 64)) : (openBlock(), createElementBlock("div", _hoisted_23, [ 28046 createBaseVNode("div", { 28047 class: normalizeClass([($setup.widgetData.selectedMainIcon === "custom-upload" || $setup.widgetData.selectedMainIcon === "custom-inline") && ($setup.widgetData.customIconData || $setup.widgetData.customSvgMarkup) ? "overflow-hidden" : "", "rounded-full flex-shrink-0 flex items-center justify-center"]), 28048 style: { "width": "36px", "height": "36px", "min-width": "36px", "min-height": "36px" } 28049 }, [ 28050 $setup.widgetData.selectedMainIcon === "custom-upload" && $setup.widgetData.customIconData ? (openBlock(), createElementBlock("img", { 28051 key: 0, 28052 src: $setup.widgetData.customIconData, 28053 alt: "custom icon", 28054 class: "w-full h-full object-cover", 28055 style: normalizeStyle({ 28056 transform: `scale(${$setup.widgetData.imageFraming.scale}) translate(${($setup.widgetData.imageFraming.positionX - 50) * 1}%, ${($setup.widgetData.imageFraming.positionY - 50) * 1}%)` 28057 }), 28058 draggable: "false" 28059 }, null, 12, _hoisted_24)) : $setup.widgetData.selectedMainIcon === "custom-inline" && $setup.widgetData.customSvgMarkup ? (openBlock(), createElementBlock("div", { 28060 key: 1, 28061 class: "text-white custom-svg-preview", 28062 innerHTML: $setup.widgetData.customSvgMarkup, 28063 style: { "width": "36px", "height": "36px" } 28064 }, null, 8, _hoisted_25)) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [ 28065 $setup.haveChannels(true) === 1 && $setup.isWebChannelActive ? (openBlock(), createElementBlock("svg", { 28066 key: 0,
28067 viewBox: $setup.getSelectedSvgOption().viewBox, 28068 xmlns: "http://www.w3.org/2000/svg", 28069 width: "36", 28070 height: "36", 28071 fill: "currentColor", 28072 class: "w-full h-full flex-shrink-0 text-white" 28073 }, [ 28074 $setup.getSelectedSvgOption().paths ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList($setup.getSelectedSvgOption().paths, (p2, idx) => { 28075 return openBlock(), createElementBlock("path", { 28076 key: idx, 28077 d: p2.d, 28078 fill: p2.fill || "currentColor", 28079 stroke: p2.stroke, 28080 "stroke-width": p2.strokeWidth, 28081 "stroke-linecap": p2.strokeLinecap, 28082 "fill-rule": p2.fillRule, 28083 "stroke-linejoin": p2.strokeLinejoin, 28084 "stroke-miterlimit": p2.strokeMiterlimit 28085 }, null, 8, _hoisted_27); 28086 }), 128)) : (openBlock(), createElementBlock("path", { 28087 key: 1, 28088 d: $setup.getSelectedSvgOption().path 28089 }, null, 8, _hoisted_28)) 28090 ], 8, _hoisted_26)) : (openBlock(), createElementBlock("img", { 28091 key: 1, 28092 src: $setup.chatBubbleImage, 28093 alt: "QBot", 28094 class: "w-full h-full object-contain invert", 28095 style: { "filter": "invert(1)" } 28096 }, null, 8, _hoisted_29)) 28097 ], 64)) 28098 ], 2), 28099 createBaseVNode("span", _hoisted_30, toDisplayString$1($setup.widgetData.bubbleText), 1) 28100 ])), 28101 $setup.bubbleBadge ? (openBlock(), createElementBlock("div", _hoisted_31)) : createCommentVNode("", true) 28102 ], 6)) : createCommentVNode("", true) 28103 ])) : createCommentVNode("", true), 28104 $setup.showUserDataForm && $setup.isOpen || $setup.isOpen && $setup.testMode && $setup.showUserDataForm ? (openBlock(), createElementBlock("div", _hoisted_32, [ 28105 _cache[18] || (_cache[18] = createBaseVNode("div", { class: "absolute top-0 left-0 w-full h-full bg-black opacity-25" }, null, -1)), 28106 createBaseVNode("div", _hoisted_33, [ 28107 createBaseVNode("h2", _hoisted_34, toDisplayString$1($setup.widgetData.formTitle), 1), 28108 createBaseVNode("p", _hoisted_35, toDisplayString$1($setup.widgetData.formDescription), 1), 28109 createBaseVNode("label", _hoisted_36, [ 28110 createBaseVNode("span", _hoisted_37, toDisplayString$1($setup.t("form.name")), 1), 28111 withDirectives(createBaseVNode("input", { 28112 type: "text", 28113 id: "nombre", 28114 "onUpdate:modelValue": _cache[6] || (_cache[6] = ($event) => $setup.userData.name = $event), 28115 class: normalizeClass([{ "border-red-200": !$setup.userData.name }, "mt-2 w-full border border-gray-200 rounded-lg p-2 focus:outline-none bg-transparent"]), 28116 disabled: $setup.testMode, 28117 placeholder: $setup.t("form.namePlaceholder") 28118 }, null, 10, _hoisted_38), [ 28119 [vModelText, $setup.userData.name] 28120 ]) 28121 ]), 28122 !$setup.isFormValid && !$setup.userData.name ? (openBlock(), createElementBlock("p", _hoisted_39, toDisplayString$1($setup.t("form.nameRequired")), 1)) : createCommentVNode("", true), 28123 createBaseVNode("label", _hoisted_40, [ 28124 createBaseVNode("span", _hoisted_41, toDisplayString$1($setup.t("form.email")), 1), 28125 withDirectives(createBaseVNode("input", { 28126 type: "email", 28127 id: "email", 28128 "onUpdate:modelValue": _cache[7] || (_cache[7] = ($event) => $setup.userData.email = $event), 28129 class: normalizeClass([{ "border-red-200": !$setup.isEmailValid }, "mt-2 w-full border border-gray-200 rounded-lg p-2 focus:outline-none bg-transparent"]), 28130 disabled: $setup.testMode, 28131 placeholder: $setup.t("form.emailPlaceholder") 28132 }, null, 10, _hoisted_42), [ 28133 [vModelText, $setup.userData.email] 28134 ]) 28135 ]), 28136 !$setup.isFormValid && !$setup.isEmailValid ? (openBlock(), createElementBlock("p", _hoisted_43, toDisplayString$1($setup.t($setup.userData.email ? "form.emailInvalid" : "form.emailRequired")), 1)) : createCommentVNode("", true), 28137 createVNode(_component_PhoneInput, { 28138 modelValue: $setup.userData.telefono, 28139 "onUpdate:modelValue": _cache[8] || (_cache[8] = ($event) => $setup.userData.telefono = $event),
28140 apiUrl: $setup.apiUrl, 28141 testMode: $setup.testMode, 28142 prevPhone: $setup.userData.telefono 28143 }, null, 8, ["modelValue", "apiUrl", "testMode", "prevPhone"]), 28144 !$setup.isFormValid && !$setup.userData.telefono ? (openBlock(), createElementBlock("p", _hoisted_44, toDisplayString$1($setup.t("form.phoneRequired")), 1)) : createCommentVNode("", true), 28145 $setup.widgetData.privacyNoticeEnabled && $setup.widgetData.privacyNoticeUrl !== "" || $setup.widgetData.privacyNoticeCheckRequired ? (openBlock(), createElementBlock("div", _hoisted_45, [ 28146 $setup.widgetData.privacyNoticeEnabled && !$setup.widgetData.privacyNoticeCheckRequired ? (openBlock(), createElementBlock("div", _hoisted_46, [ 28147 createBaseVNode("a", { 28148 href: $setup.widgetData.privacyNoticeUrl, 28149 target: "_blank" 28150 }, toDisplayString$1($setup.t("form.privacyNotice")), 9, _hoisted_47) 28151 ])) : createCommentVNode("", true), 28152 $setup.widgetData.privacyNoticeCheckRequired ? (openBlock(), createElementBlock("div", _hoisted_48, [ 28153 withDirectives(createBaseVNode("input", { 28154 type: "checkbox", 28155 id: "checkPrivacy", 28156 "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => $setup.widgetData.checkPrivacy = $event), 28157 class: "align-middle", 28158 required: "", 28159 disabled: $setup.testMode 28160 }, null, 8, _hoisted_49), [ 28161 [vModelCheckbox, $setup.widgetData.checkPrivacy] 28162 ]), 28163 createBaseVNode("label", _hoisted_50, [ 28164 createTextVNode(toDisplayString$1($setup.t("form.privacyAccept")) + " ", 1), 28165 createBaseVNode("a", { 28166 href: $setup.widgetData.privacyNoticeUrl, 28167 target: "_blank" 28168 }, toDisplayString$1($setup.t("form.privacyNotice")), 9, _hoisted_51) 28169 ]) 28170 ])) : createCommentVNode("", true), 28171 !$setup.isFormValid && !$setup.widgetData.checkPrivacy ? (openBlock(), createElementBlock("p", _hoisted_52, [ 28172 createTextVNode(toDisplayString$1($setup.t("form.privacyAcceptRequired")) + " ", 1), 28173 createBaseVNode("a", { 28174 href: $setup.widgetData.privacyNoticeUrl, 28175 target: "_blank" 28176 }, toDisplayString$1($setup.t("form.privacyNotice")), 9, _hoisted_53), 28177 _cache[17] || (_cache[17] = createTextVNode(". ", -1)) 28178 ])) : createCommentVNode("", true) 28179 ])) : createCommentVNode("", true), 28180 createBaseVNode("button", { 28181 type: "button", 28182 onClick: _cache[10] || (_cache[10] = (...args) => $setup.storeUserData && $setup.storeUserData(...args)), 28183 tabindex: "0", 28184 form: "auth-form", 28185 class: "bg-purple-600 text-white mt-8 hover:bg-black text-sm w-full cursor-pointer disabled:bg-gray-400 disabled:border-transparent disabled:text-black", 28186 disabled: !$setup.isFormValid || $setup.testMode, 28187 style: normalizeStyle({ 28188 background: !$setup.isFormValid ? "#e1e1e1" : $setup.widgetData.computedBackgroud, 28189 cursor: !$setup.isFormValid ? "not-allowed" : "pointer" 28190 }) 28191 }, toDisplayString$1($setup.t("form.sendMessage")), 13, _hoisted_54) 28192 ]) 28193 ])) : createCommentVNode("", true), 28194 $setup.isOpen && $setup.showUserCalification && $setup.widgetData.ratingEnabled ? (openBlock(), createElementBlock("div", _hoisted_55, [ 28195 _cache[20] || (_cache[20] = createBaseVNode("div", { class: "absolute top-0 left-0 w-full h-full bg-black opacity-25" }, null, -1)), 28196 createBaseVNode("div", _hoisted_56, [ 28197 createBaseVNode("h2", _hoisted_57, toDisplayString$1($setup.t("rating.title")), 1), 28198 createBaseVNode("p", _hoisted_58, toDisplayString$1($setup.t("rating.description")), 1), 28199 createBaseVNode("div", _hoisted_59, [ 28200 (openBlock(true), createElementBlock(Fragment, null, renderList($setup.stars, (star, index) => { 28201 return openBlock(), createElementBlock("p", { 28202 key: index, 28203 onMouseover: ($event) => $setup.hoverStars(index), 28204 onMouseleave: _cache[11] || (_cache[11] = (...args) => $setup.resetHover && $setup.resetHover(...args)), 28205 onClick: ($event) => $setup.selectStars(index), 28206 class: normalizeClass([{ 28207 "text-yellow-400": index <= $setup.hoveredIndex || index <= $setup.selectedIndex, 28208 "text-yellow-600": index > $setup.hoveredIndex && index > $setup.selectedIndex 28209 }, "text-xl cursor-pointer transition-colors"]) 28210 }, [ 28211 (openBlock(), createElementBlock("svg", { 28212 xmlns: "http://www.w3.org/2000/svg",
28213 viewBox: "0 0 24 24", 28214 fill: "none", 28215 width: "24", 28216 height: "24", 28217 "stroke-width": "2", 28218 "stroke-linejoin": "round", 28219 "stroke-linecap": "round", 28220 stroke: "currentColor", 28221 class: normalizeClass({ 28222 "fill-yellow-400 text-yellow-600": index <= $setup.hoveredIndex || index <= $setup.selectedIndex, 28223 "fill-none": index > $setup.hoveredIndex && index > $setup.selectedIndex 28224 }) 28225 }, [..._cache[19] || (_cache[19] = [ 28226 createBaseVNode("path", { d: "M17.286 21.09q-1.69 .001 -5.288 -2.615q-3.596 2.617 -5.288 2.616q-2.726 0 -.495 -6.8q-9.389 -6.775 2.135 -6.775h.076q1.785 -5.516 3.574 -5.516q1.785 0 3.574 5.516h.076q11.525 0 2.133 6.774q2.23 6.802 -.497 6.8" }, null, -1) 28227 ])], 2)) 28228 ], 42, _hoisted_60); 28229 }), 128)) 28230 ]) 28231 ]) 28232 ])) : createCommentVNode("", true), 28233 $setup.isOpen ? (openBlock(), createElementBlock("div", { 28234 key: 3, 28235 class: normalizeClass(["w-full flex justify-between items-center leading-tight text-white p-4 rounded-t-lg", $setup.isOpen ? "rounded-b-none" : "rounded-lg"]), 28236 style: normalizeStyle([{ background: $setup.widgetData.computedBackgroud }, { "pointer-events": "all" }]) 28237 }, [ 28238 createBaseVNode("div", _hoisted_61, [ 28239 createBaseVNode("img", { 28240 src: $setup.avatar, 28241 alt: "", 28242 class: "w-full h-full absolute top-0 left-0 object-cover rounded-full" 28243 }, null, 8, _hoisted_62) 28244 ]), 28245 createBaseVNode("div", _hoisted_63, [ 28246 createBaseVNode("h2", _hoisted_64, toDisplayString$1($setup.connected ? $setup.widgetData.title : $setup.widgetData.titleOffline), 1), 28247 createBaseVNode("p", null, toDisplayString$1($setup.connected ? $setup.widgetData.status : $setup.widgetData.statusOffline), 1) 28248 ]), 28249 !$setup.fullView ? (openBlock(), createElementBlock("div", { 28250 key: 0, 28251 onClick: _cache[12] || (_cache[12] = withModifiers((...args) => $setup.toggleChat && $setup.toggleChat(...args), ["stop"])), 28252 class: "cursor-pointer hover:opacity-50" 28253 }, [..._cache[21] || (_cache[21] = [ 28254 createBaseVNode("svg", { 28255 xmlns: "http://www.w3.org/2000/svg",
28256 viewBox: "0 0 24 24", 28257 fill: "none", 28258 stroke: "currentColor", 28259 "stroke-linecap": "round", 28260 "stroke-linejoin": "round", 28261 width: "24", 28262 height: "24", 28263 "stroke-width": "2" 28264 }, [ 28265 createBaseVNode("path", { d: "M3 5a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14z" }), 28266 createBaseVNode("path", { d: "M9 9l6 6m0 -6l-6 6" }) 28267 ], -1) 28268 ])])) : createCommentVNode("", true), 28269 createBaseVNode("div", { 28270 onClick: _cache[13] || (_cache[13] = withModifiers((...args) => $setup.toggleFullView && $setup.toggleFullView(...args), ["stop"])), 28271 class: "cursor-pointer hover:opacity-50 ml-2" 28272 }, [ 28273 !$setup.fullView ? (openBlock(), createElementBlock("svg", _hoisted_65, [..._cache[22] || (_cache[22] = [ 28274 createStaticVNode('<path d="M16 4l4 0l0 4" data-v-00fc86b1></path><path d="M14 10l6 -6" data-v-00fc86b1></path><path d="M8 20l-4 0l0 -4" data-v-00fc86b1></path><path d="M4 20l6 -6" data-v-00fc86b1></path><path d="M16 20l4 0l0 -4" data-v-00fc86b1></path><path d="M14 14l6 6" data-v-00fc86b1></path><path d="M8 4l-4 0l0 4" data-v-00fc86b1></path><path d="M4 4l6 6" data-v-00fc86b1></path>', 8) 28275 ])])) : createCommentVNode("", true), 28276 $setup.fullView ? (openBlock(), createElementBlock("svg", _hoisted_66, [..._cache[23] || (_cache[23] = [ 28277 createStaticVNode('<path d="M5 9l4 0l0 -4" data-v-00fc86b1></path><path d="M3 3l6 6" data-v-00fc86b1></path><path d="M5 15l4 0l0 4" data-v-00fc86b1></path><path d="M3 21l6 -6" data-v-00fc86b1></path><path d="M19 9l-4 0l0 -4" data-v-00fc86b1></path><path d="M15 9l6 -6" data-v-00fc86b1></path><path d="M19 15l-4 0l0 4" data-v-00fc86b1></path><path d="M15 15l6 6" data-v-00fc86b1></path>', 8) 28278 ])])) : createCommentVNode("", true) 28279 ]) 28280 ], 6)) : createCommentVNode("", true), 28281 withDirectives(createBaseVNode("div", { 28282 class: normalizeClass([$setup.fullView ? "h-full" : "flex-1", "p-4 overflow-y-auto w-full bg-white text-sm"]), 28283 ref: "messagesContainer", 28284 style: { "pointer-events": "all" } 28285 }, [ 28286 (openBlock(true), createElementBlock(Fragment, null, renderList($setup.messages, (msg, index) => { 28287 return openBlock(), createElementBlock("div", { 28288 key: index, 28289 class: normalizeClass(["mb-2", $setup.getMessagePosition(msg.type)]) 28290 }, [ 28291 msg.type != "report" ? (openBlock(), createElementBlock("div", { 28292 key: 0, 28293 class: normalizeClass([ 28294 "inline-block px-4 py-4", 28295 msg.type === "sent" ? "bg-blue-500 text-white rounded-xl rounded-tr-none" : "bg-gray-200 text-gray-800 rounded-xl rounded-tl-none" 28296 ]), 28297 style: normalizeStyle({ background: msg.type === "sent" ? $setup.widgetData.computedBackgroud : "" }) 28298 }, [ 28299 typeof $setup.formatMessageContent(msg.message, msg) === "object" && $setup.formatMessageContent(msg.message, msg).isComponent ? (openBlock(), createBlock(_component_InteractiveMessage, { 28300 key: 0, 28301 messageData: $setup.formatMessageContent(msg.message, msg).messageData, 28302 reply_to: msg.message_num, 28303 onOptionSelected: $setup.handleInteractiveOption 28304 }, null, 8, ["messageData", "reply_to", "onOptionSelected"])) : (openBlock(), createElementBlock("span", { 28305 key: 1, 28306 innerHTML: $setup.formatMessageContent(msg.message, msg) 28307 }, null, 8, _hoisted_67)) 28308 ], 6)) : createCommentVNode("", true), 28309 msg.type == "report" ? (openBlock(), createElementBlock("div", _hoisted_68, [ 28310 typeof $setup.formatMessageContent(msg.message, msg) === "object" && $setup.formatMessageContent(msg.message, msg).isComponent ? (openBlock(), createBlock(_component_InteractiveMessage, { 28311 key: 0, 28312 messageData: $setup.formatMessageContent(msg.message, msg).messageData, 28313 reply_to: msg.message_num, 28314 onOptionSelected: $setup.handleInteractiveOption 28315 }, null, 8, ["messageData", "reply_to", "onOptionSelected"])) : (openBlock(), createElementBlock("span", { 28316 key: 1, 28317 innerHTML: $setup.formatMessageContent(msg.message, msg) 28318 }, null, 8, _hoisted_69)), 28319 createBaseVNode("span", { 28320 class: "text-xs text-gray-400 mt-1 flex items-center justify-center", 28321 innerHTML: $setup.formatTimestamp(msg.timestamp) + (msg.user == "IA" ? "<span class='opacity-50 ml-2 italic'>" + $setup.t("system.aiMessage") + "</span>" : "") 28322 }, null, 8, _hoisted_70) 28323 ])) : createCommentVNode("", true), 28324 msg.type != "report" ? (openBlock(), createElementBlock("div", { 28325 key: 2, 28326 class: "text-xs text-gray-500 mt-1", 28327 innerHTML: $setup.formatTimestamp(msg.timestamp) + (msg.user == "IA" ? "<span class='opacity-50 ml-2 italic'>" + $setup.t("system.aiMessage") + "</span>" : "") 28328 }, null, 8, _hoisted_71)) : createCommentVNode("", true) 28329 ], 2); 28330 }), 128)), 28331 $setup.readingActive ? (openBlock(), createElementBlock("div", _hoisted_72, [..._cache[24] || (_cache[24] = [ 28332 createBaseVNode("span", { class: "w-2 h-2 bg-gray-400 rounded-full inline-block animate mr-2" }, null, -1), 28333 createBaseVNode("span", { class: "w-2 h-2 bg-gray-400 rounded-full inline-block animate-pulse mr-2" }, null, -1), 28334 createBaseVNode("span", { class: "w-2 h-2 bg-gray-400 rounded-full inline-block animate-pulse" }, null, -1) 28335 ])])) : createCommentVNode("", true) 28336 ], 2), [ 28337 [vShow, $setup.isOpen] 28338 ]), 28339 withDirectives(createBaseVNode("div", _hoisted_73, [ 28340 createBaseVNode("form", { 28341 onSubmit: _cache[16] || (_cache[16] = withModifiers(($event) => $setup.sendMessage(), ["prevent"])), 28342 class: "flex" 28343 }, [ 28344 withDirectives(createBaseVNode("input", { 28345 "onUpdate:modelValue": _cache[14] || (_cache[14] = ($event) => $setup.newMessage = $event), 28346 id: "chat-input", 28347 type: "text", 28348 placeholder: $setup.widgetData.textArea, 28349 class: "flex-1 border bg-gray-200 border-transparent roun
28349ded-full px-4 py-2 focus:outline-none text-black disabled:opacity-50", 28350 autocomplete: "off", 28351 disabled: !$setup.canWrite 28352 }, null, 8, _hoisted_74), [ 28353 [vModelText, $setup.newMessage] 28354 ]), 28355 createBaseVNode("div", { 28356 class: "group rounded-full ml-2 w-10 h-10", 28357 style: normalizeStyle({ 28358 background: $setup.widgetData.computedBackgroud 28359 }) 28360 }, [ 28361 createBaseVNode("button", { 28362 type: "submit", 28363 class: "text-white w-10 h-10 p-0 flex items-center justify-center rounded-full bg-transparent hover:bg-white hover:bg-opacity-25 disabled:bg-gray-400 dark:bg-black", 28364 disabled: !$setup.newMessage.trim() 28365 }, [..._cache[25] || (_cache[25] = [ 28366 createBaseVNode("svg", { 28367 xmlns: "http://www.w3.org/2000/svg", 28368 width: "24", 28369 height: "24", 28370 class: "w-5 h-5",
28371 viewBox: "0 0 24 24", 28372 fill: "none", 28373 stroke: "currentColor", 28374 "stroke-width": "2", 28375 "stroke-linecap": "round", 28376 "stroke-linejoin": "round" 28377 }, [ 28378 createBaseVNode("path", { d: "M4.698 4.034l16.302 7.966l-16.302 7.966a.503 .503 0 0 1 -.546 -.124a.555 .555 0 0 1 -.12 -.568l2.468 -7.274l-2.468 -7.274a.555 .555 0 0 1 .12 -.568a.503 .503 0 0 1 .546 -.124z" }), 28379 createBaseVNode("path", { d: "M6.5 12h14.5" }) 28380 ], -1) 28381 ])], 8, _hoisted_75) 28382 ], 4), 28383 $setup.testMode ? (openBlock(), createElementBlock("div", { 28384 key: 0, 28385 class: "group rounded-full ml-2 w-10 h-10", 28386 style: normalizeStyle({ 28387 background: $setup.widgetData.computedBackgroud 28388 }) 28389 }, [ 28390 createBaseVNode("button", { 28391 type: "button", 28392 class: "text-white w-10 h-10 p-0 flex items-center bg-transparent justify-center rounded-full hover:bg-white hover:bg-opacity-25 disabled:bg-gray-400", 28393 onClick: _cache[15] || (_cache[15] = ($event) => $setup.resetChat()) 28394 }, [..._cache[26] || (_cache[26] = [ 28395 createStaticVNode('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-trash" data-v-00fc86b1><path stroke="none" d="M0 0h24v24H0z" fill="none" data-v-00fc86b1></path><path d="M4 7l16 0" data-v-00fc86b1></path><path d="M10 11l0 6" data-v-00fc86b1></path><path d="M14 11l0 6" data-v-00fc86b1></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" data-v-00fc86b1></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" data-v-00fc86b1></path></svg>', 1) 28396 ])]) 28397 ], 4)) : createCommentVNode("", true) 28398 ], 32), 28399 _cache[27] || (_cache[27] = createBaseVNode("div", { 28400 class: "text-center text-gray-500 pt-3", 28401 style: { "font-size": "0.65rem", "margin-top": "12px" } 28402 }, [ 28403 createTextVNode(" Powered by "), 28404 createBaseVNode("a", { 28405 href: "https://quantumasis.com", 28406 target: "_blank", 28407 style: { "background": "linear-gradient(to right, #6841e5, #16e2b5)", "-webkit-background-clip": "text", "-webkit-text-fill-color": "transparent", "background-clip": "text", "font-weight": "600" } 28408 }, "QuantumAsis®") 28409 ], -1)) 28410 ], 512), [ 28411 [vShow, $setup.isOpen] 28412 ]) 28413 ], 2) 28414 ], 2)) : createCommentVNode("", true) 28415 ])) : createCommentVNode("", true); 28416} 28417const ChatWidgetContent = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-00fc86b1"]]); 28418const _sfc_main = { 28419 name: "ChatWidget", 28420 components: { 28421 ChatWidgetContent 28422 } 28423}; 28424function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) { 28425 const _component_ChatWidgetContent = resolveComponent("ChatWidgetContent"); 28426 return openBlock(), createBlock(_component_ChatWidgetContent); 28427} 28428const ChatWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]); 28429const css = '*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;
vendor: 3,088 bytes, line 28429
28429--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }\n/*! tailwindcss v3.4.18 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #f5f1f9}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}
28429[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}@media (min-width:1536px){.container{max-width:1536px}}.pointer-events-none{pointer-events:none}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.bottom-0{bottom:0}.bottom-4{bottom:1rem}.left-0{left:0}.left-4{left:1rem}.right-0{right:0}.right-4{right:1rem}.right-\\[0\\.55rem\\]{right:.55rem}.top-0{top:0}.top-\\[0\\.35rem\\]{top:.35rem}.z-10{z-index:10}.z-\\[99999\\]{z-index:99999}.mx-auto{margin-left:auto;margin-right:auto}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-8{margin-bottom:2rem}.ml-2{margin-left:.5rem}.mr-2{margin-right:.5rem}.mr-4{margin-right:1rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-32{height:8rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-9{height:2.25rem}.h-full{height:100%}.h-screen{height:100vh}.max-h-\\[600px\\]{max-height:600px}.min-h-\\[600px\\]{min-height:600px}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-20{width:5rem}.w-32{width:8rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-9{width:2.25rem}.w-96{width:24rem}.w-full{width:100%}.max-w-4xl{max-width:56rem}.max-w-sm{max-width:24rem}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.flex-col{flex-direction:column}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}
28429.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-none{border-radius:0}.rounded-xl{border-radius:.75rem}.rounded-b-lg{border-bottom-right-radius:.5rem;border-bottom-left-radius:.5rem}.rounded-b-none{border-bottom-right-radius:0;border-bottom-left-radius:0}.rounded-l-md{border-top-left-radius:.375rem;border-bottom-left-radius:.375rem}.rounded-r-md{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}.rounded-t-lg{border-top-left-radius:.5rem;border-top-right-radius:.5rem}.rounded-tl-none{border-top-left-radius:0}.rounded-tr-none{border-top-right-radius:0}.border{border-width:1px}.border-2{border-width:2px}.border-r-0{border-right-width:0}.border-t{border-top-width:1px}.border-gray-200{--tw-border-opacity:1;border-color:rgb(245 241 249/var(--tw-border-opacity,1))}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity,1))}.border-red-200{--tw-border-opacity:1;border-color:rgb(254 202 202/var(--tw-border-opacity,1))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity,1))}.bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity,1))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity,1))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(245 241 249/var(--tw-bg-opacity,1))}.bg-gray-400{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity,1))}.bg-purple-600{--tw-bg-opacity:1;background-color:rgb(147 51 234/var(--tw-bg-opacity,1))}.bg-red-600{--tw-bg-opacity:1;background-color:rgb(220 38 38/var(--tw-bg-opacity,1))}.bg-transparent{background-color:transparent}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.fill-none{fill:none}.fill-yellow-400{fill:#facc15}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-8{padding:2rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pt-3{padding-top:.75rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-middle{vertical-align:middle}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.italic{font-style:italic}.leading-none{line-height:1}.leading-tight{line-height:1.25}.text-black{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity,1))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity,1))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity,1))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity,1))}.text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity,1))}.text-red-200{--tw-text-opacity:1;color:rgb(254 202 202/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.text-yellow-400{--tw-text-opacity:1;color:rgb(250 204 21/var(--tw-text-opacity,1))}.text-yellow-600{--tw-text-opacity:1;color:rgb(202 138 4/var(--tw-text-opacity,1))}.underline{text-decoration-line:underline}.opacity-25{opacity:.25}.opacity-50{opacity:.5}.opacity-75{opacity:.75}.shadow{--tw-shadow:0 1px 3px 0 rgba(0,0,0,.1),0 1px 2px -1px rgba(0,0,0,.1);
28429--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),0 1px 2px -1px var(--tw-shadow-color)}.shadow,.shadow-lg{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.invert{--tw-invert:invert(100%)}.filter,.invert{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}:root{font-family:Inter,system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:hsla(0,0%,100%,.87);background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;display:flex;place-items:center;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}.card{padding:2em}#app{max-width:1280px;margin:0 auto;padding:2rem;text-align:center}@media (prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}.loader{width:32px;height:32px;border-radius:50%;position:relative;animation:rotate 1s linear infinite}.loader:after,.loader:before{content:"";box-sizing:border-box;position:absolute;inset:0;border-radius:50%;border:5px solid transparent;animation:prixClipFix 1.5s cubic-bezier(.4,0,.2,1) infinite}.loader:before{border-color:#6366f2}.loader:after{inset:4px;border-color:#01d0f4;transform:rotate3d(1,1,0,180deg)}@keyframes rotate{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes prixClipFix{0%{clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,0 100%)}50%{clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,100% 100%)}to{clip-path:polygon(50% 50%,0 0,100% 0,100% 100%,0 100%)}}.hover\\:bg-black:hover{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.hover\\:bg-white:hover{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity,1))}.hover\\:bg-opacity-25:hover{--tw-bg-opacity:0.25}.hover\\:opacity-50:hover{opacity:.5}.focus\\:border-indigo-500:focus{--tw-border-opacity:1;border-color:rgb(99 102 241/var(--tw-border-opacity,1))}.focus\\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\\:ring-indigo-500:focus{--tw-ring-opacity:1;--tw-ring-color:rgb(99 102 241/var(--tw-ring-opacity,1))}.active\\:outline-none:active{outline:2px solid transparent;outline-offset:2px}.disabled\\:border-transparent:disabled{border-color:transparent}.disabled\\:bg-gray-400:disabled{--tw-bg-opacity:1;background-color:rgb(156 163 175/var(--tw-bg-opacity,1))}.disabled\\:text-black:disabled{--tw-text-opacity:1;color:rgb(0 0 0/var(--tw-text-opacity,1))}.disabled\\:opacity-50:disabled{opacity:.5}@media (min-width:640px){.sm\\:text-sm{font-size:.875rem;line-height:1.25rem}}@media (prefers-color-scheme:dark){.dark\\:bg-black{--tw-bg-opacity:1;background-color:rgb(0 0 0/var(--tw-bg-opacity,1))}.dark\\:bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity,1))}.dark\\:text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}}'; 28430function mountWidget(config = {}) { 28431 const { target, key, botId, uuid, devMode, tab, chatNum, userHash } = config; 28432 const widgetContainer = document.createElement("div"); 28433 widgetContainer.id = "chat-widget-container"; 28434 widgetContainer.setAttribute("data-quantum-key", key || ""); 28435 if (chatNum) { 28436 widgetContainer.setAttribute("data-quantum-chat-num", chatNum); 28437 } 28438 if (uuid) { 28439 widgetContainer.setAttribute("data-quantum-uuid", uuid); 28440 } 28441 if (tab) { 28442 widgetContainer.setAttribute("data-quantum-tab", tab); 28443 } 28444 if (botId) { 28445 widgetContainer.setAttribute("data-quantum-bot-id", botId); 28446 } 28447 if (userHash) { 28448 widgetContainer.setAttribute("data-quantum-user-hash", userHash); 28449 } 28450 widgetContainer.setAttribute("data-quantum-dev-mode", devMode ? "1" : ""); 28451 if (target) { 28452 target.appendChild(widgetContainer); 28453 } else { 28454 document.body.appendChild(widgetContainer); 28455 } 28456 const shadowRoot = widgetContainer.attachShadow({ mode: "open" }); 28457 const style = document.createElement("style"); 28458 style.textContent = css; 28459 shadowRoot.appendChild(style); 28460 const app = createApp(ChatWidget); 28461 app.use(i18n); 28462 app.config.globalProperties.$quantum = { 28463 key: key || "", 28464 uuid: uuid || "", 28465 devMode: devMode ? "1" : "", 28466 tab: tab || "", 28467 botId: botId || "", 28468 chatNum: chatNum || "", 28469 userHash: userHash || "" 28470 }; 28471 app.userFields = {}; 28472 app.options = {}; 28473 app.addCustomField = function(key2, value) { 28474 app.userFields[key2] = value === true || value === false ? value : String(value).replace(/</g, "<").replace(/>/g, ">"); 28475 localStorage.setItem("quantumUserFields", JSON.stringify(app.userFields)); 28476 window.dispatchEvent(new CustomEvent("quantumCustomFieldAdded", { detail: app.userFields })); 28477 return true; 28478 }; 28479 app.setUserData = function(data) { 28480 const d = data || {}; 28481 const identity = { name: String(d.name || "").trim(), email: String(d.email || "").trim(), telefono: String(d.telefono || d.phone || "").trim() }; 28482 if (d.id) identity.id = String(d.id).trim(); 28483 if (!identity.name && !identity.email && !identity.telefono) return false;
28484 document.cookie = `chat_user_data=${encodeURIComponent(JSON.stringify(identity))}; expires=${new Date(Date.now() + 30 * 24 * 60 * 60 * 1e3).toUTCString()}; path=/`; 28485 return true; 28486 }; 28487 app.getUserData = function() { 28488 let cookies = document.cookie.split("; "); 28489 let userData = null; 28490 for (let i = 0; i < cookies.length; i++) { 28491 const [key2, value] = cookies[i].split("="); 28492 if (key2 === "chat_user_data") { 28493 userData = JSON.parse(decodeURIComponent(value)); 28494 break; 28495 } 28496 } 28497 return userData; 28498 }; 28499 app.addOption = function(key2, value) { 28500 app.options[key2] = value === true || value === false ? value : String(value).replace(/</g, "<").replace(/>/g, ">"); 28501 localStorage.setItem("quantumOptions", JSON.stringify(app.options)); 28502 window.dispatchEvent(new CustomEvent("quantumOptionsAdded", { detail: app.options })); 28503 return true; 28504 }; 28505 app.mount(shadowRoot); 28506 return { app, container: widgetContainer, shadowRoot }; 28507} 28508const init = () => { 28509 const scriptUrl = import.meta.url; 28510 const params = new URLSearchParams(new URL(scriptUrl).search); 28511 const { app } = mountWidget({ 28512 key: params.get("key"), 28513 botId: params.get("bot_id"), 28514 uuid: params.get("uuid"), 28515 devMode: params.get("devMode"), 28516 tab: params.get("tab"), 28517 chatNum: params.get("chatNum"), 28518 userHash: params.get("userHash") 28519 }); 28520 window.quantumWidget = app; 28521 window.dispatchEvent(new Event("quantumWidgetReady")); 28522 window.addEventListener("quantumGetCustomData", () => { 28523 window.dispatchEvent(new CustomEvent("quantumOptionsAdded", { detail: app.options })); 28524 window.dispatchEvent(new CustomEvent("quantumCustomFieldAdded", { detail: app.userFields })); 28525 }); 28526}; 28527init();
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.