1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./BgpILpws.js","./qGUnmkIO.js","./R1HQS0-G.js","./main.CXT05u31.css","./BndPH7Nt.js","./_I6ndPCp.js","./B2nSegMF.js","./Dl6H9rkb.js","./D9QN8i5R.js","./activities-by-time.CvhOAoqv.css","./BswYsTUm.js","./CP8-iGWH.js","./As9gMayj.js","./B5wgKkrJ.js","./BeQ9i0De.js","./DuUMSwZ4.js","./BEtFAnFB.js","./Up5TaAvr.js","./jNweRM85.js","./D9FjbYN7.js","./CcZEz2t_.js","./iyrv_x1o.js","./resultEmail.CQ3tvBRP.css","./B-YGbAXf.js","./gjpcu06c.js","./DaLUHD30.js","./Di3L3Vev.js","./BY5-5V-N.js","./CYXGsI_q.js","./BkjFUCtL.js","./a1U70nBt.js","./-Wpko77v.js","./ChS2FMg0.js","./DateField.TlyPsrp8.css","./fBi0bisG.js","./expense.BqKP18bP.css","./Da3hVJif.js","./D0C5YVc8.js","./menu.BeS2ht1m.css","./10nt8a6J.js","./J1___ccd.js","./C_JzSgNn.js","./CZ4CFdZO.js","./PrintTimeShift.Ckb-vZGi.css","./Dgdt-TE0.js","./BP5pWSRL.js","./pos.D_sOM-wt.css","./D82mP724.js","./DgR46LWM.js","./Cwj4MixS.js","./StockSummaryView.aiEHRGvX.css","./reports.Bu1TdmCz.css","./C-dH-SmL.js","./r54GteK6.js","./B5NA8_Zi.js","./stockPermissions.CJGO9RXb.css","./settings.DrJVCHKW.css","./Bas2raVR.js","./stock.zlw4G29-.css","./BjmXN5Lu.js","./n6QQMFX6.js","./top-up.BD7RH-6V.css","./DSkofBne.js","./waiting-for-shop.B2NFOpGU.css","./Bg54QVma.js","./D9GDNpk2.js","./download.tn0RQdqM.css","./BkZJRs7I.js","./BWdyVOhH.js","./EvDmEVFo.js","./login.BSNXg2cb.css","./a3g7Jh3w.js","./no-permission.aFhunJLF.css","./31277awR.js","./openShop.B_kT24vj.css","./JBuZ2jxy.js","./poc-rtdb.BAPcw9qS.css","./mO41DfHz.js","./pos.oELg3_yW.css","./BbwfBO56.js","./register.ChFufu36.css","./oiKf0-Bl.js","./runMode.B469iaGQ.css","./BT-WTgmC.js","./index.QwJ1R8ES.css","./BiNOwJOe.js","./index.CgJWYJ1q.css","./Q-MmA_hJ.js","./index.CR9fU-Gw.css","./BDTKtHtc.js","./DlmO52m5.js","./Bl5RrQF8.js","./ServiceAnnouncementBanner.Crs9jCfH.css","./CZ8fyd2o.js","./Dm8WR60f.js","./ExpiryWarningBanner.B6087crk.css","./v2-scroll.DQktCFCE.css","./Drv5Jw0u.js","./v2.BYYSpIPQ.css","./D36nqd-u.js","./error-404.C3kT2QX-.css","./CU1xs4rU.js","./error-500.BW0Y54Of.css"])))=>i.map(i=>d[i]); 2(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};
vendor: 4,234 bytes, line 2
2t.SENTRY_RELEASE={id:"[email protected]"};var e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="79470495-2e68-4700-93f4-12645f60ad10",t._sentryDebugIdIdentifier="sentry-dbid-79470495-2e68-4700-93f4-12645f60ad10")}catch{}})();(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function Ei(t){const e=Object.create(null);for(const n of t.split(","))e[n]=1;return n=>n in e}const Jt={},Id=[],Vi=()=>{},uP=()=>!1,mp=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&(t.charCodeAt(2)>122||t.charCodeAt(2)<97),U_=t=>t.startsWith("onUpdate:"),Rn=Object.assign,hT=(t,e)=>{const n=t.indexOf(e);n>-1&&t.splice(n,1)},lX=Object.prototype.hasOwnProperty,on=(t,e)=>lX.call(t,e),rt=Array.isArray,Cd=t=>ih(t)==="[object Map]",Su=t=>ih(t)==="[object Set]",qC=t=>ih(t)==="[object Date]",o$=t=>ih(t)==="[object RegExp]",yt=t=>typeof t=="function",vn=t=>typeof t=="string",Si=t=>typeof t=="symbol",fn=t=>t!==null&&typeof t=="object",H_=t=>(fn(t)||yt(t))&&yt(t.then)&&yt(t.catch),dP=Object.prototype.toString,ih=t=>dP.call(t),a$=t=>ih(t).slice(8,-1),gp=t=>ih(t)==="[object Object]",q_=t=>vn(t)&&t!=="NaN"&&t[0]!=="-"&&""+parseInt(t,10)===t,jl=Ei(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),uX=Ei("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),fT=t=>{const e=Object.create(null);return(n=>e[n]||(e[n]=t(n)))},dX=/-\w/g,xr=fT(t=>t.replace(dX,e=>e.slice(1).toUpperCase())),hX=/\B([A-Z])/g,Rs=fT(t=>t.replace(hX,"-$1").toLowerCase()),_p=fT(t=>t.charAt(0).toUpperCase()+t.slice(1)),mf=fT(t=>t?`on${_p(t)}`:""),cs=(t,e)=>!Object.is(t,e),Ad=(t,...e)=>{for(let n=0;n<t.length;n++)t[n](...e)},hP=(t,e,n,r=!1)=>{Object.defineProperty(t,e,{configurable:!0,enumerable:!1,writable:r,value:n})},j_=t=>{const e=parseFloat(t);return isNaN(e)?t:e},Kg=t=>{const e=vn(t)?Number(t):NaN;return isNaN(e)?t:e};let ix;const W_=()=>ix||(ix=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),fX=/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;function pX(t){return fX.test(t)?`__props.${t}`:`__props[${JSON.stringify(t)}]`}function mX(t,e){return t+JSON.stringify(e,(n,r)=>typeof r=="function"?r.toString():r)}const gX={TEXT:1,1:"TEXT",CLASS:2,2:"CLASS",STYLE:4,4:"STYLE",PROPS:8,8:"PROPS",FULL_PROPS:16,16:"FULL_PROPS",NEED_HYDRATION:32,32:"NEED_HYDRATION",STABLE_FRAGMENT:64,64:"STABLE_FRAGMENT",KEYED_FRAGMENT:128,128:"KEYED_FRAGMENT",UNKEYED_FRAGMENT:256,256:"UNKEYED_FRAGMENT",NEED_PATCH:512,512:"NEED_PATCH",DYNAMIC_SLOTS:1024,1024:"DYNAMIC_SLOTS",DEV_ROOT_FRAGMENT:2048,2048:"DEV_ROOT_FRAGMENT",CACHED:-1,"-1":"CACHED",BAIL:-2,"-2":"BAIL"},_X={1:"TEXT",2:"CLASS",4:"STYLE",8:"PROPS",16:"FULL_PROPS",32:"NEED_HYDRATION",64:"STABLE_FRAGMENT",128:"KEYED_FRAGMENT",256:"UNKEYED_FRAGMENT",512:"NEED_PATCH",1024:"DYNAMIC_SLOTS",2048:"DEV_ROOT_FRAGMENT",[-1]:"CACHED",[-2]:"BAIL"},yX={ELEMENT:1,1:"ELEMENT",FUNCTIONAL_COMPONENT:2,2:"FUNCTIONAL_COMPONENT",STATEFUL_COMPONENT:4,4:"STATEFUL_COMPONENT",TEXT_CHILDREN:8,8:"TEXT_CHILDREN",ARRAY_CHILDREN:16,16:"ARRAY_CHILDREN",SLOTS_CHILDREN:32,32:"SLOTS_CHILDREN",TELEPORT:64,64:"TELEPORT",SUSPENSE:128,128:"SUSPENSE",COMPONENT_SHOULD_KEEP_ALIVE:256,256:"COMPONENT_SHOULD_KEEP_ALIVE",COMPONENT_KEPT_ALIVE:512,512:"COMPONENT_KEPT_ALIVE",COMPONENT:6,6:"COMPONENT"},vX={STABLE:1,1:"STABLE",DYNAMIC:2,2:"DYNAMIC",FORWARDED:3,3:"FORWARDED"},bX={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},wX="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decode
2URI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",fP=Ei(wX),SX=fP,ox=2;function TX(t,e=0,n=t.length){if(e=Math.max(0,Math.min(e,t.length)),n=Math.max(0,Math.min(n,t.length)),e>n)return"";let r=t.split(/(\r?\n)/);const s=r.filter((a,c)=>c%2===1);r=r.filter((a,c)=>c%2===0);let i=0;const o=[];for(let a=0;a<r.length;a++)if(i+=r[a].length+(s[a]&&s[a].length||0),i>=e){for(let c=a-ox;c<=a+ox||n>i;c++){if(c<0||c>=r.length)continue;const l=c+1;o.push(`${l}${" ".repeat(Math.max(3-String(l).length,0))}| ${r[c]}`);const d=r[c].length,h=s[c]&&s[c].length||0;if(c===a){const p=e-(i-(d+h)),g=Math.max(1,n>i?d-p:n-e);o.push(" | "+" ".repeat(p)+"^".repeat(g))}else if(c>a){if(n>i){const p=Math.max(Math.min(n-i,d),1);o.push(" | "+"^".repeat(p))}i+=d+h}}break}return o.join(` 3`)}function yp(t){if(rt(t)){const e={};for(let n=0;n<t.length;n++){const r=t[n],s=vn(r)?c$(r):yp(r);if(s)for(const i in s)e[i]=s[i]}return e}else if(vn(t)||fn(t))return t}const EX=/;(?![^(]*\))/g,IX=/:([^]+)/,CX=/\/\*[^]*?\*\//g;function c$(t){const e={};return t.replace(CX,"").split(EX).forEach(n=>{if(n){const r=n.split(IX);r.length>1&&(e[r[0].trim()]=r[1].trim())}}),e}function AX(t){if(!t)return"";if(vn(t))return t;let e="";for(const n in t){const r=t[n];if(vn(r)||typeof r=="number"){const s=n.startsWith("--")?n:Rs(n);e+=`${s}:${r};`}}return e}function cu(t){let e="";if(vn(t))e=t;else if(rt(t))for(let n=0;n<t.length;n++){const r=cu(t[n]);r&&(e+=r+" ")}else if(fn(t))for(const n in t)t[n]&&(e+=n+" ");return e.trim()}function pP(t){if(!t)return null;let{class:e,style:n}=t;return e&&!vn(e)&&(t.class=cu(e)),n&&(t.style=yp(n)),t}const RX="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",PX="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",kX="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",NX="area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr",DX=Ei(RX),OX=Ei(PX),xX=Ei(kX),LX=Ei(NX),l$="itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly",u$=Ei(l$),MX=Ei(l$+",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected");function mP(t){return!!t||t===""}const VX=/[>/="'\u0009\u000a\u000c\u0020]/,d0={};function FX(t){if(d0.hasOwnProperty(t))return d0[t];const e=VX.test(t);return e&&console.error(`unsafe attribute name: ${t}`),d0[t]=!e}const BX={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},$X=Ei("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,c
3olspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap"),UX=Ei("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode
3-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan"),HX=Ei("accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns");function qX(t){if(t==null)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"}const jX=/["'&<>]/;function WX(t){const e=""+t,n=jX.exec(e);if(!n)return e;let r="",s,i,o=0;for(i=n.index;i<e.length;i++){switch(e.charCodeAt(i)){case 34:s=""";break;case 38:s="&";break;case 39:s="'";break;case 60:s="<";break;case 62:s=">";break;default:continue}o!==i&&(r+=e.slice(o,i)),o=i+1,r+=s}return o!==i?r+e.slice(o,i):r}const GX=/^-?>|<!--|-->|--!>|<!-$/g;function KX(t){return t.replace(GX,"")}const d$=/[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;function zX(t,e){return t.replace(d$,n=>e?n==='"'?'\\\\\\"':`\\\\${n}`:`\\${n}`)}function YX(t,e){if(t.length!==e.length)return!1;let n=!0;for(let r=0;n&&r<t.length;r++)n=Pa(t[r],e[r]);return n}function Pa(t,e){if(t===e)return!0;let n=qC(t),r=qC(e);if(n||r)return n&&r?t.getTime()===e.getTime():!1;if(n=Si(t),r=Si(e),n||r)return t===e;if(n=rt(t),r=rt(e),n||r)return n&&r?YX(t,e):!1;if(n=fn(t),r=fn(e),n||r){if(!n||!r)return!1;const s=Object.keys(t).length,i=Object.keys(e).length;if(s!==i)return!1;for(const o in t){const a=t.hasOwnProperty(o),c=e.hasOwnProperty(o);if(a&&!c||!a&&c||!Pa(t[o],e[o]))return!1}}return String(t)===String(e)}function G_(t,e){return t.findIndex(n=>Pa(n,e))}const h$=t=>!!(t&&t.__v_isRef===!0),md=t=>vn(t)?t:t==null?"":rt(t)||fn(t)&&(t.toString===dP||!yt(t.toString))?h$(t)?md(t.value):JSON.stringify(t,f$,2):String(t),f$=(t,e)=>h$(e)?f$(t,e.value):Cd(e)?{[`Map(${e.size})`]:[...e.entries()].reduce((n,[r,s],i)=>(n[h0(r,i)+" =>"]=s,n),{})}:Su(e)?{[`Set(${e.size})`]:[...e.values()].map(n=>h0(n))}:Si(e)?h0(e):fn(e)&&!rt(e)&&!gp(e)?String(e):e,h0=(t,e="")=>{var n;return Si(t)?`Symbol(${(n=t.description)!=null?n:e})`:t};function p$(t){return t==null?"initial":typeof t=="string"?t===""?" ":t:String(t)}const D2e=Object.freeze(Object.defineProperty({__proto__:null,EMPTY_ARR:Id,EMPTY_OBJ:Jt,NO:uP,NOOP:Vi,PatchFlagNames:_X,PatchFlags:gX,ShapeFlags:yX,SlotFlags:vX,camelize:xr,capitalize:_p,cssVarNameEscapeSymbolsRE:d$,def:hP,escapeHtml:WX,escapeHtmlComment:KX,extend:Rn,genCacheKey:mX,genPropsAccessExp:pX,generateCodeFrame:TX,getEscapedCssVarName:zX,getGlobalThis:W_,hasChanged:cs,hasOwn:on,hyphenate:Rs,includeBooleanAttr:mP,invokeArrayFns:Ad,isArray:rt,isBooleanAttr:MX,isBuiltInDirective:uX,isDate:qC,isFunction:yt,isGloballyAllowed:fP,isGloballyWhitelisted:SX,isHTMLTag:DX,isIntegerKey:q_,isKnownHtmlAttr:$X,isKnownMathMLAttr:HX,isKnownSvgAttr:UX,isMap:Cd,isMathMLTag:xX,isModelListener:U_,isObject:fn,isOn:mp,isPlainObject:gp,isPromise:H_,isRegExp:o$,isRenderableAttrValue:qX,isReservedProp:jl,isSSRSafeAttrName:FX,isSVGTag:OX,isSet:Su,isSpecialBooleanAttr:u$,isString:vn,isSymbol:Si,isVoidTag:LX,looseEqual:Pa,looseIndexOf:G_,looseToNumber:j_,makeMap:Ei,normalizeClass:cu,normalizeCssVarValue:p$,normalizeProps:pP,normalizeStyle:yp,objectToString:dP,parseStringStyle:c$,propsToAttrMap:BX,remove:hT,slotFlagsText:b
vendor: 10,645 bytes, line 3
3X,stringifyStyle:AX,toDisplayString:md,toHandlerKey:mf,toNumber:Kg,toRawType:a$,toTypeString:ih},Symbol.toStringTag,{value:"Module"}));let Yr;class gP{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!e&&Yr&&(Yr.active?(this.parent=Yr,this.index=(Yr.scopes||(Yr.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].pause();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,n;if(this.scopes)for(e=0,n=this.scopes.length;e<n;e++)this.scopes[e].resume();for(e=0,n=this.effects.length;e<n;e++)this.effects[e].resume()}}run(e){if(this._active){const n=Yr;try{return Yr=this,e()}finally{Yr=n}}}on(){++this._on===1&&(this.prevScope=Yr,Yr=this)}off(){if(this._on>0&&--this._on===0){if(Yr===this)Yr=this.prevScope;else{let e=Yr;for(;e;){if(e.prevScope===this){e.prevScope=this.prevScope;break}e=e.prevScope}}this.prevScope=void 0}}stop(e){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n<r;n++)this.effects[n].stop();for(this.effects.length=0,n=0,r=this.cleanups.length;n<r;n++)this.cleanups[n]();if(this.cleanups.length=0,this.scopes){for(n=0,r=this.scopes.length;n<r;n++)this.scopes[n].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const s=this.parent.scopes.pop();s&&s!==this&&(this.parent.scopes[this.index]=s,s.index=this.index)}this.parent=void 0}}}function oh(t){return new gP(t)}function Ba(){return Yr}function $c(t,e=!1){Yr&&Yr.cleanups.push(t)}let Wn;const f0=new WeakSet;class zg{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,Yr&&(Yr.active?Yr.effects.push(this):this.flags&=-2)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,f0.has(this)&&(f0.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||g$(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,ax(this),_$(this);const e=Wn,n=Ho;Wn=this,Ho=!0;try{return this.fn()}finally{y$(this),Wn=e,Ho=n,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)vP(e);this.deps=this.depsTail=void 0,ax(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?f0.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){jC(this)&&this.run()}get dirty(){return jC(this)}}let m$=0,_g,yg;function g$(t,e=!1){if(t.flags|=8,e){t.next=yg,yg=t;return}t.next=_g,_g=t}function _P(){m$++}function yP(){if(--m$>0)return;if(yg){let e=yg;for(yg=void 0;e;){const n=e.next;e.next=void 0,e.flags&=-9,e=n}}let t;for(;_g;){let e=_g;for(_g=void 0;e;){const n=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(r){t||(t=r)}e=n}}if(t)throw t}function _$(t){for(let e=t.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function y$(t){let e,n=t.depsTail,r=n;for(;r;){const s=r.prevDep;r.version===-1?(r===n&&(n=s),vP(r),JX(r)):e=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=s}t.deps=e,t.depsTail=n}function jC(t){for(let e=t.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(v$(e.dep.computed)||e.dep.version!==e.version))return!0;return!!t._dirty}function v$(t){if(t.flags&4&&!(t.flags&16)||(t.flags&=-17,t.globalVersion===Yg)||(t.globalVersion=Yg,!t.isSSR&&t.flags&128&&(!t.deps&&!t._dirty||!jC(t))))return;t.flags|=2;const e=t.dep,n=Wn,r=Ho;Wn=t,Ho=!0;try{_$(t);const s=t.fn(t._value);(e.version===0||cs(s,t._value))&&(t.flags|=128,t._value=s,e.version++)}catch(s){throw e.version++,s}finally{Wn=n,Ho=r,y$(t),t.flags&=-3}}function vP(t,e=!1){const{dep:n,prevSub:r,nextSub:s}=t;if(r&&(r.nextSub=s,t.prevSub=void 0),s&&(s.prevSub=r,t.nextSub=void 0),n.subs===t&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let i=n.computed.deps;i;i=i.nextDep)vP(i,!0)}!e&&!--n.sc&&n.map&&n.map.delete(n.key)}function JX(t){const{prevDep:e,nextDep:n}=t;e&&(e.nextDep=n,t.prevDep=void 0),n&&(n.prevDep=e,t.nextDep=void 0)}function QX(t,e){t.effect instanceof zg&&(t=t.effect.fn);const n=new zg(t);e&&Rn(n,e);try{n.run()}catch(s){throw n.stop(),s}const r=n.run.bind(n);return r.effect=n,r}function XX(t){t.effect.stop()}let Ho=!0;const b$=[];function Uc(){b$.push(Ho),Ho=!1}function Hc(){const t=b$.pop();Ho=t===void 0?!0:t}function ax(t){const{cleanup:e}=t;if(t.cleanup=void 0,e){const n=Wn;Wn=void 0;try{e()}finally{Wn=n}}}let Yg=0;class ZX{constructor(e,n){this.sub=e,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class pT{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Wn||!Ho||Wn===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==Wn)n=this.activeLink=new ZX(Wn,this),Wn.deps?(n.prevDep=Wn.depsTail,Wn.depsTail.nextDep=n,Wn.depsTail=n):Wn.deps=Wn.depsTail=n,w$(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=Wn.depsTail,n.nextDep=void 0,Wn.depsTail.nextDep=n,Wn.depsTail=n,Wn.deps===n&&(Wn.deps=r)}return n}trigger(e){this.version++,Yg++,this.notify(e)}notify(e){_P();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{yP()}}}function w$(t){if(t.dep.sc++,t.sub.flags&4){const e=t.dep.computed;if(e&&!t.dep.subs){e.flags|=20;for(let r=e.deps;r;r=r.nextDep)w$(r)}const n=t.dep.subs;n!==t&&(t.prevSub=n,n&&(n.nextSub=t)),t.dep.subs=t}}const Tw=new WeakMap,Rd=Symbol(""),WC=Symbol(""),Jg=Symbol("");function Cs(t,e,n){if(Ho&&Wn){let r=Tw.get(t);r||Tw.set(t,r=new Map);let s=r.get(n);s||(r.set(n,s=new pT),s.map=r,s.key=n),s.track()}}function _c(t,e,n,r,s,i){const o=Tw.get(t);if(!o){Yg++;return}const a=c=>{c&&c.trigger()};if(_P(),e==="clear")o.forEach(a);else{const c=rt(t),l=c&&q_(n);if(c&&n==="length"){const d=Number(r);o.forEach((h,p)=>{(p==="length"||p===Jg||!Si(p)&&p>=d)&&a(h)})}else switch((n!==void 0||o.has(void 0))&&a(o.get(n)),l&&a(o.get(Jg)),e){case"add":c?l&&a(o.get("length")):(a(o.get(Rd)),Cd(t)&&a(o.get(WC)));break;case"delete":c||(a(o.get(Rd)),Cd(t)&&a(o.get(WC)));break;case"set":Cd(t)&&a(o.get(Rd));break}}yP()}function eZ(t,e){const n=Tw.get(t);return n&&n.get(e)}function Bh(t){const e=jt(t);return e===t?e:(Cs(e,"iterate",Jg),mi(t)?e:e.map(Ko))}function mT(t){return Cs(t=jt(t),"iterate",Jg),t}function ya(t,e){return Go(t)?Nf(ho(t)?Ko(e):e):Ko(e)}const tZ={__proto__:null,[Symbol.iterator](){return p0(this,Symbol.iterator,t=>ya(this,t))},concat(...t){return Bh(this).concat(...t.map(e=>rt(e)?Bh(e):e))},entries(){return p0(this,"entries",t=>(t[1]=ya(this,t[1]),t))},every(t,e){return lc(this,"every",t,e,void 0,arguments)},filter(t,e){return lc(this,"filter",t,e,n=>n.map(r=>ya(this,r)),arguments)},find(t,e){return lc(this,"find",t,e,n=>ya(this,n),arguments)},findIndex(t,e){return lc(this,"findIndex",t,e,void 0,arguments)},findLast(t,e){return lc(this,"findLast",t,e,n=>ya(this,n),arguments)},findLastIndex(t,e){return lc(this,"findLastIndex",t,e,void 0,arguments)},forEach(t,e){return lc(this,"forEach",t,e,void 0,arguments)},includes(...t){return m0(this,"includes",t)},indexOf(...t){return m0(this,"indexOf",t)},join(t){return Bh(this).join(t)},lastIndexOf(...t){return m0(this,"lastIndexOf",t)},map(t,e){return lc(this,"map",t,e,void 0,arguments)},pop(){return Fm(this,"pop")},push(...t){return Fm(this,"push",t)},reduce(t,...e){return cx(this,"reduce",t,e)},reduceRight(t,...e){return cx(this,"reduceRight",t,e)},shift(){return Fm(this,"shift")},some(t,e){return lc(this,"some",t,e,void 0,arguments)},splice(...t){return Fm(this,"splice",t)},toReversed(){return Bh(this).toReversed()},toSorted(t){return Bh(this).toSorted(t)},toSpliced(...t){return Bh(this).toSpliced(...t)},unshift(...t){return Fm(this,"unshift",t)},values(){return p0(this,"values",t=>ya(this,t))}};function p0(t,e,n){const r=mT(t),s=r[e]();return r!==t&&!mi(t)&&(s._next=s.next,s.next=()=>{const i=s._next();return i.done||(i.value=n(i.value)),i}),s}const nZ=Array.prototype;function lc(t,e,n,r,s,i){const o=mT(t),a=o!==t&&!mi(t),c=o[e];if(c!==nZ[e]){const h=c.apply(t,i);return a?Ko(h):h}let l=n;o!==t&&(a?l=function(h,p){return n.call(this,ya(t,h),p,t)}:n.length>2&&(l=function(h,p){return n.call(this,h,p,t)}));const d=c.call(o,l,r);return a&&s?s(d):d}function cx(t,e,n,r){const s=mT(t),i=s!==t&&!mi(t);let o=n,a=!1;s!==t&&(i?(a=r.length===0,o=function(l,d,h){return a&&(a=!1,l=ya(t,l)),n.call(this,l,ya(t,d),h,t)}):n.length>3&&(o=function(l,d,h){return n.call(this,l,d,h,t)}));const c=s[e](o,...r);return a?ya(t,c):c}function m0(t,e,n){const r=jt(t);Cs(r,"iterate",Jg);const s=r[e](...n);return(s===-1||s===!1)&&K_(n[0])?(n[0]=jt(n[0]),r[e](...n)):s}function Fm(t,e,n=[]){Uc(),_P();const r=jt(t)[e].apply(t,n);return yP(),Hc(),r}const rZ=Ei("__proto__,__v_isRef,__isVue"),S$=new Set(Object.getOwnPropertyNames(Symbol).filter(t=>t!=="arguments"&&t!=="caller").map(t=>Symbol[t]).filter(Si));function sZ(t){Si(t)||(t=String(t));const e=jt(this);return Cs(e,"has",t),e.hasOwnProperty(t)}class T${constructor(e=!1,n=!1){this._isReadonly=e,this._isShallow=n}get(e,n,r){if(n==="__v_skip")return e.__v_skip;const s=this._isReadonly,i=this._isShallow;if(n==="__v_isReactive")return!s;if(n==="__v_isReadonly")return s;if(n==="__v_isShallow")return i;if(n==="__v_raw")return r===(s?i?P$:R$:i?A$:C$).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(r)?e:void 0;const o=rt(e);if(!s){let c;if(o&&(c=tZ[n]))return c;if(n==="hasOwnProperty")return sZ}const a=Reflect.get(e,n,Pn(e)?e:r);if((Si(n)?S$.has(n):rZ(n))||(s||Cs(e,"get",n),i))return a;if(Pn(a)){const c=o&&q_(n)?a:a.value;return s&&fn(c)?Ac(c):c}return fn(a)?s?Ac(a):Xs(a):a}}class E$ extends T${constructor(e=!1){super(!1,e)}set(e,n,r,s){let i=e[n];const o=rt(e)&&q_(n);if(!this._isShallow){const l=Go(i);if(!mi(r)&&!Go(r)&&(i=jt(i),r=jt(r)),!o&&Pn(i)&&!Pn(r))return l||(i.value=r),!0}const a=o?Number(n)<e.length:on(e,n),c=Reflect.set(e,n,r,Pn(e)?e:s);return e===jt(s)&&(a?cs(r,i)&&_c(e,"set",n,r):_c(e,"add",n,r)),c}deleteProperty(e,n){const r=on(e,n);e[n];const s=Reflect.deleteProperty(e,n);return s&&r&&_c(e,"delete",n,void 0),s}has(e,n){const r=Reflect.has(e,n);return(!Si(n)||!S$.has(n))&&Cs(e,"has",n),r}ownKeys(e){return Cs(e,"iterate",rt(e)?"length":Rd),Reflect.ownKeys(e)}}class I$ extends T${constructor(e=!1){super(!0,e)}set(e,n){return!0}deleteProperty(e,n){return!0}}
vendor: 4,390 bytes, line 3
3const iZ=new E$,oZ=new I$,aZ=new E$(!0),cZ=new I$(!0),GC=t=>t,tb=t=>Reflect.getPrototypeOf(t);function lZ(t,e,n){return function(...r){const s=this.__v_raw,i=jt(s),o=Cd(i),a=t==="entries"||t===Symbol.iterator&&o,c=t==="keys"&&o,l=s[t](...r),d=n?GC:e?Nf:Ko;return!e&&Cs(i,"iterate",c?WC:Rd),Rn(Object.create(l),{next(){const{value:h,done:p}=l.next();return p?{value:h,done:p}:{value:a?[d(h[0]),d(h[1])]:d(h),done:p}}})}}function nb(t){return function(...e){return t==="delete"?!1:t==="clear"?void 0:this}}function uZ(t,e){const n={get(s){const i=this.__v_raw,o=jt(i),a=jt(s);t||(cs(s,a)&&Cs(o,"get",s),Cs(o,"get",a));const{has:c}=tb(o),l=e?GC:t?Nf:Ko;if(c.call(o,s))return l(i.get(s));if(c.call(o,a))return l(i.get(a));i!==o&&i.get(s)},get size(){const s=this.__v_raw;return!t&&Cs(jt(s),"iterate",Rd),s.size},has(s){const i=this.__v_raw,o=jt(i),a=jt(s);return t||(cs(s,a)&&Cs(o,"has",s),Cs(o,"has",a)),s===a?i.has(s):i.has(s)||i.has(a)},forEach(s,i){const o=this,a=o.__v_raw,c=jt(a),l=e?GC:t?Nf:Ko;return!t&&Cs(c,"iterate",Rd),a.forEach((d,h)=>s.call(i,l(d),l(h),o))}};return Rn(n,t?{add:nb("add"),set:nb("set"),delete:nb("delete"),clear:nb("clear")}:{add(s){const i=jt(this),o=tb(i),a=jt(s),c=!e&&!mi(s)&&!Go(s)?a:s;return o.has.call(i,c)||cs(s,c)&&o.has.call(i,s)||cs(a,c)&&o.has.call(i,a)||(i.add(c),_c(i,"add",c,c)),this},set(s,i){!e&&!mi(i)&&!Go(i)&&(i=jt(i));const o=jt(this),{has:a,get:c}=tb(o);let l=a.call(o,s);l||(s=jt(s),l=a.call(o,s));const d=c.call(o,s);return o.set(s,i),l?cs(i,d)&&_c(o,"set",s,i):_c(o,"add",s,i),this},delete(s){const i=jt(this),{has:o,get:a}=tb(i);let c=o.call(i,s);c||(s=jt(s),c=o.call(i,s)),a&&a.call(i,s);const l=i.delete(s);return c&&_c(i,"delete",s,void 0),l},clear(){const s=jt(this),i=s.size!==0,o=s.clear();return i&&_c(s,"clear",void 0,void 0),o}}),["keys","values","entries",Symbol.iterator].forEach(s=>{n[s]=lZ(s,t,e)}),n}function gT(t,e){const n=uZ(t,e);return(r,s,i)=>s==="__v_isReactive"?!t:s==="__v_isReadonly"?t:s==="__v_raw"?r:Reflect.get(on(n,s)&&s in r?n:r,s,i)}const dZ={get:gT(!1,!1)},hZ={get:gT(!1,!0)},fZ={get:gT(!0,!1)},pZ={get:gT(!0,!0)},C$=new WeakMap,A$=new WeakMap,R$=new WeakMap,P$=new WeakMap;function mZ(t){switch(t){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Xs(t){return Go(t)?t:_T(t,!1,iZ,dZ,C$)}function ao(t){return _T(t,!1,aZ,hZ,A$)}function Ac(t){return _T(t,!0,oZ,fZ,R$)}function gZ(t){return _T(t,!0,cZ,pZ,P$)}function _T(t,e,n,r,s){if(!fn(t)||t.__v_raw&&!(e&&t.__v_isReactive)||t.__v_skip||!Object.isExtensible(t))return t;const i=s.get(t);if(i)return i;const o=mZ(a$(t));if(o===0)return t;const a=new Proxy(t,o===2?r:n);return s.set(t,a),a}function ho(t){return Go(t)?ho(t.__v_raw):!!(t&&t.__v_isReactive)}function Go(t){return!!(t&&t.__v_isReadonly)}function mi(t){return!!(t&&t.__v_isShallow)}function K_(t){return t?!!t.__v_raw:!1}function jt(t){const e=t&&t.__v_raw;return e?jt(e):t}function yT(t){return!on(t,"__v_skip")&&Object.isExtensible(t)&&hP(t,"__v_skip",!0),t}const Ko=t=>fn(t)?Xs(t):t,Nf=t=>fn(t)?Ac(t):t;function Pn(t){return t?t.__v_isRef===!0:!1}function Ae(t){return k$(t,!1)}function ht(t){return k$(t,!0)}function k$(t,e){return Pn(t)?t:new _Z(t,e)}class _Z{constructor(e,n){this.dep=new pT,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?e:jt(e),this._value=n?e:Ko(e),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(e){const n=this._rawValue,r=this.__v_isShallow||mi(e)||Go(e);e=r?e:jt(e),cs(e,n)&&(this._rawValue=e,this._value=r?e:Ko(e),this.dep.trigger())}}function yZ(t){t.dep&&t.dep.trigger()}function Wt(t){return Pn(t)?t.value:t}function Pr(t){return yt(t)?t():Wt(t)}const vZ={get:(t,e,n)=>e==="__v_raw"?t:Wt(Reflect.get(t,e,n)),set:(t,e,n,r)=>{const s=t[e];return Pn(s)&&!Pn(n)?(s.value=n,!0):Reflect.set(t,e,n,r)}};function bP(t){return ho(t)?t:new Proxy(t,vZ)}class bZ{constructor(e){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new pT,{get:r,set:s}=e(n.track.bind(n),n.trigger.bind(n));this._get=r,this._set=s}get value(){return this._value=this._get()}set value(e){this._set(e)}}function vT(t){return new bZ(t)}function N$(t){const e=rt(t)?new Array(t.length):{};for(const n in t)e[n]=D$(t,n);return e}class wZ{constructor(e,n,r){this._object=e,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0,this._key=Si(n)?n:String(n),this._raw=jt(e);let s=!0,i=e;
vendor: 1,838 bytes, line 3
3if(!rt(e)||Si(this._key)||!q_(this._key))do s=!K_(i)||mi(i);while(s&&(i=i.__v_raw));this._shallow=s}get value(){let e=this._object[this._key];return this._shallow&&(e=Wt(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&Pn(this._raw[this._key])){const n=this._object[this._key];if(Pn(n)){n.value=e;return}}this._object[this._key]=e}get dep(){return eZ(this._raw,this._key)}}class SZ{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function vp(t,e,n){return Pn(t)?t:yt(t)?new SZ(t):fn(t)&&arguments.length>1?D$(t,e,n):Ae(t)}function D$(t,e,n){return new wZ(t,e,n)}class TZ{constructor(e,n,r){this.fn=e,this.setter=n,this._value=void 0,this.dep=new pT(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=Yg-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Wn!==this)return g$(this,!0),!0}get value(){const e=this.dep.track();return v$(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function EZ(t,e,n=!1){let r,s;return yt(t)?r=t:(r=t.get,s=t.set),new TZ(r,s,n)}const IZ={GET:"get",HAS:"has",ITERATE:"iterate"},CZ={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},rb={},Ew=new WeakMap;let Dl;function AZ(){return Dl}function O$(t,e=!1,n=Dl){if(n){let r=Ew.get(n);r||Ew.set(n,r=[]),r.push(t)}}function RZ(t,e,n=Jt){const{immediate:r,deep:s,once:i,scheduler:o,augmentJob:a,call:c}=n,l=R=>s?R:mi(R)||s===!1||s===0?yc(R,1):yc(R);let d,h,p,g,_=!1,v=!1;if(Pn(t)?(h=()=>t.value,_=mi(t)):ho(t)?(h=()=>l(t),_=!0):rt(t)?(v=!0,_=t.some(R=>ho(R)||mi(R)),h=()=>t.map(R=>{if(Pn(R))return R.value;if(ho(R))return l(R);if(yt(R))return c?c(R,2):R()})):yt(t)?e?h=c?()=>c(t,2):t:h=()=>
vendor: 5,987 bytes, line 3
3{if(p){Uc();try{p()}finally{Hc()}}const R=Dl;Dl=d;try{return c?c(t,3,[g]):t(g)}finally{Dl=R}}:h=Vi,e&&s){const R=h,N=s===!0?1/0:s;h=()=>yc(R(),N)}const b=Ba(),w=()=>{d.stop(),b&&b.active&&hT(b.effects,d)};if(i&&e){const R=e;e=(...N)=>{R(...N),w()}}let E=v?new Array(t.length).fill(rb):rb;const T=R=>{if(!(!(d.flags&1)||!d.dirty&&!R))if(e){const N=d.run();if(s||_||(v?N.some((O,S)=>cs(O,E[S])):cs(N,E))){p&&p();const O=Dl;Dl=d;try{const S=[N,E===rb?void 0:v&&E[0]===rb?[]:E,g];E=N,c?c(e,3,S):e(...S)}finally{Dl=O}}}else d.run()};return a&&a(T),d=new zg(h),d.scheduler=o?()=>o(T,!1):T,g=R=>O$(R,!1,d),p=d.onStop=()=>{const R=Ew.get(d);if(R){if(c)c(R,4);else for(const N of R)N();Ew.delete(d)}},e?r?T(!0):E=d.run():o?o(T.bind(null,!0),!0):d.run(),w.pause=d.pause.bind(d),w.resume=d.resume.bind(d),w.stop=w,w}function yc(t,e=1/0,n){if(e<=0||!fn(t)||t.__v_skip||(n=n||new Map,(n.get(t)||0)>=e))return t;if(n.set(t,e),e--,Pn(t))yc(t.value,e,n);else if(rt(t))for(let r=0;r<t.length;r++)yc(t[r],e,n);else if(Su(t)||Cd(t))t.forEach(r=>{yc(r,e,n)});else if(gp(t)){for(const r in t)yc(t[r],e,n);for(const r of Object.getOwnPropertySymbols(t))Object.prototype.propertyIsEnumerable.call(t,r)&&yc(t[r],e,n)}return t}const x$=[];function PZ(t){x$.push(t)}function kZ(){x$.pop()}function NZ(t,e){}const DZ={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},OZ={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function bp(t,e,n,r){try{return r?t(...r):t()}catch(s){ah(s,e,n)}}function $i(t,e,n,r){if(yt(t)){const s=bp(t,e,n,r);return s&&H_(s)&&s.catch(i=>{ah(i,e,n)}),s}if(rt(t)){const s=[];for(let i=0;i<t.length;i++)s.push($i(t[i],e,n,r));return s}}function ah(t,e,n,r=!0){const s=e?e.vnode:null,{errorHandler:i,throwUnhandledErrorInProduction:o}=e&&e.appContext.config||Jt;if(e){let a=e.parent;const c=e.proxy,l=`https://vuejs.org/error-reference/#runtime-${n}`;for(;a;){const d=a.ec;if(d){for(let h=0;h<d.length;h++)if(d[h](t,c,l)===!1)return}a=a.parent}if(i){Uc(),bp(i,null,10,[t,c,l]),Hc();return}}xZ(t,n,s,r,o)}function xZ(t,e,n,r=!0,s=!1){if(s)throw t;console.error(t)}const js=[];let pa=-1;const gf=[];let Ol=null,ef=0;const L$=Promise.resolve();let Iw=null;function zs(t){const e=Iw||L$;return t?e.then(this?t.bind(this):t):e}function LZ(t){let e=pa+1,n=js.length;for(;e<n;){const r=e+n>>>1,s=js[r],i=Qg(s);i<t||i===t&&s.flags&2?e=r+1:n=r}return e}function wP(t){if(!(t.flags&1)){const e=Qg(t),n=js[js.length-1];!n||!(t.flags&2)&&e>=Qg(n)?js.push(t):js.splice(LZ(e),0,t),t.flags|=1,M$()}}function M$(){Iw||(Iw=L$.then(V$))}function Ud(t){rt(t)?gf.push(...t):Ol&&t.id===-1?Ol.splice(ef+1,0,t):t.flags&1||(gf.push(t),t.flags|=1),M$()}function lx(t,e,n=pa+1){for(;n<js.length;n++){const r=js[n];if(r&&r.flags&2){if(t&&r.id!==t.uid)continue;js.splice(n,1),n--,r.flags&4&&(r.flags&=-2),r(),r.flags&4||(r.flags&=-2)}}}function Cw(t){if(gf.length){const e=[...new Set(gf)].sort((n,r)=>Qg(n)-Qg(r));if(gf.length=0,Ol){Ol.push(...e);return}for(Ol=e,ef=0;ef<Ol.length;ef++){const n=Ol[ef];n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2}Ol=null,ef=0}}const Qg=t=>t.id==null?t.flags&2?-1:1/0:t.id;function V$(t){try{for(pa=0;pa<js.length;pa++){const e=js[pa];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),bp(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;pa<js.length;pa++){const e=js[pa];e&&(e.flags&=-2)}pa=-1,js.length=0,Cw(),Iw=null,(js.length||gf.length)&&V$()}}let tf,sb=[];function F$(t,e){var n,r;tf=t,tf?(tf.enabled=!0,sb.forEach(({event:s,args:i})=>tf.emit(s,...i)),sb=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.includes("jsdom"))?((e.__VUE_DEVTOOLS_HOOK_REPLAY__=e.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(i=>{F$(i,e)}),setTimeout(()=>{tf||(e.__VUE_DEVTOOLS_HOOK_REPLAY__=null,sb=[])},3e3)):sb=[]}let ys=null,bT=null;function Xg(t){const e=ys;return ys=t,bT=t&&t.type.__scopeId||null,e}function MZ(t){bT=t}function VZ(){bT=null}const FZ=t=>z_;function z_(t,e=ys,n){if(!e||t._n)return t;const r=(...s)=>{r._d&&t_(-1);const i=Xg(e);let o;try{o=t(...s)}finally{Xg(i),r._d&&t_(1)}return o};return r._n=!0,r._c=!0,r._d=!0,r}function KC(t,e){if(ys===null)return t;const n=Q_(ys),r=t.dirs||(t.dirs=[]);for(let s=0;s<e.length;s++){let[i,o,a,c=Jt]=e[s];i&&(yt(i)&&(i={mounted:i,updated:i}),i.deep&&yc(o),r.push({dir:i,instance:n,value:o,oldValue:void 0,arg:a,modifiers:c}))}return t}function ma(t,e,n,r){const s=t.dirs,i=e&&e.dirs;for(let o=0;o<s.length;o++){const a=s[o];i&&(a.oldValue=i[o].value);let c=a.dir[r];c&&(Uc(),$i(c,n,8,[t.el,a,t,e]),Hc())}}function Sa(t,e){if(gs){let n=gs.provides;const r=gs.parent&&gs.parent.provides;r===n&&(n=gs.provides=Object.create(r)),n[t]=e}}function vr(t,e,n=!1){const r=Sr();if(r||Pd){let s=Pd?Pd._context.provides:r?r.parent==null||r.ce?r.vnode.appContext&&r.vnode.appContext.provides:r.parent.provides:void 0;if(s&&t in s)return s[t];
vendor: 4,458 bytes, line 3
3if(arguments.length>1)return n&&yt(e)?e.call(r&&r.proxy):e}}function wp(){return!!(Sr()||Pd)}const B$=Symbol.for("v-scx"),$$=()=>vr(B$);function SP(t,e){return Y_(t,null,e)}function BZ(t,e){return Y_(t,null,{flush:"post"})}function U$(t,e){return Y_(t,null,{flush:"sync"})}function ft(t,e,n){return Y_(t,e,n)}function Y_(t,e,n=Jt){const{immediate:r,deep:s,flush:i,once:o}=n,a=Rn({},n),c=e&&r||!e&&i!=="post";let l;if(qd){if(i==="sync"){const g=$$();l=g.__watcherHandles||(g.__watcherHandles=[])}else if(!c){const g=()=>{};return g.stop=Vi,g.resume=Vi,g.pause=Vi,g}}const d=gs;a.call=(g,_,v)=>$i(g,d,_,v);let h=!1;i==="post"?a.scheduler=g=>{Ur(g,d&&d.suspense)}:i!=="sync"&&(h=!0,a.scheduler=(g,_)=>{_?g():wP(g)}),a.augmentJob=g=>{e&&(g.flags|=4),h&&(g.flags|=2,d&&(g.id=d.uid,g.i=d))};const p=RZ(t,e,a);return qd&&(l?l.push(p):c&&p()),p}function $Z(t,e,n){const r=this.proxy,s=vn(t)?t.includes(".")?H$(r,t):()=>r[t]:t.bind(r,r);let i;yt(e)?i=e:(i=e.handler,n=e);const o=Ep(this),a=Y_(s,i.bind(r),n);return o(),a}function H$(t,e){const n=e.split(".");return()=>{let r=t;for(let s=0;s<n.length&&r;s++)r=r[n[s]];return r}}const Pl=new WeakMap,q$=Symbol("_vte"),j$=t=>t.__isTeleport,ld=t=>t&&(t.disabled||t.disabled===""),UZ=t=>t&&(t.defer||t.defer===""),ux=t=>typeof SVGElement<"u"&&t instanceof SVGElement,dx=t=>typeof MathMLElement=="function"&&t instanceof MathMLElement,zC=(t,e)=>{const n=t&&t.to;return vn(n)?e?e(n):null:n},HZ={name:"Teleport",__isTeleport:!0,process(t,e,n,r,s,i,o,a,c,l){const{mc:d,pc:h,pbc:p,o:{insert:g,querySelector:_,createText:v,createComment:b,parentNode:w}}=l,E=ld(e.props);let{dynamicChildren:T}=e;const R=(S,I,P)=>{S.shapeFlag&16&&d(S.children,I,P,s,i,o,a,c)},N=(S=e)=>{const I=ld(S.props),P=S.target=zC(S.props,_),k=YC(P,S,v,g);P&&(o!=="svg"&&ux(P)?o="svg":o!=="mathml"&&dx(P)&&(o="mathml"),s&&s.isCE&&(s.ce._teleportTargets||(s.ce._teleportTargets=new Set)).add(P),I||(R(S,P,k),sg(S,!1)))},O=S=>{const I=()=>{if(Pl.get(S)===I){if(Pl.delete(S),ld(S.props)){const P=w(S.el)||n;R(S,P,S.anchor),sg(S,!0)}N(S)}};Pl.set(S,I),Ur(I,i)};if(t==null){const S=e.el=v(""),I=e.anchor=v("");if(g(S,n,r),g(I,n,r),UZ(e.props)||i&&i.pendingBranch){O(e);return}E&&(R(e,n,I),sg(e,!0)),N()}else{e.el=t.el;const S=e.anchor=t.anchor,I=Pl.get(t);if(I){I.flags|=8,Pl.delete(t),O(e);return}e.targetStart=t.targetStart;const P=e.target=t.target,k=e.targetAnchor=t.targetAnchor,L=ld(t.props),M=L?n:P,V=L?S:k;if(o==="svg"||ux(P)?o="svg":(o==="mathml"||dx(P))&&(o="mathml"),T?(p(t.dynamicChildren,T,M,s,i,o,a),VP(t,e,!0)):c||h(t,e,M,V,s,i,o,a,!1),E)L?e.props&&t.props&&e.props.to!==t.props.to&&(e.props.to=t.props.to):ib(e,n,S,l,1);else if((e.props&&e.props.to)!==(t.props&&t.props.to)){const z=e.target=zC(e.props,_);z&&ib(e,z,null,l,0)}else L&&ib(e,P,k,l,1);sg(e,E)}},remove(t,e,n,{um:r,o:{remove:s}},i){const{shapeFlag:o,children:a,anchor:c,targetStart:l,targetAnchor:d,target:h,props:p}=t,g=i||!ld(p),_=Pl.get(t);if(_&&(_.flags|=8,Pl.delete(t)),h&&(s(l),s(d)),i&&s(c),!_&&o&16)for(let v=0;v<a.length;v++){const b=a[v];r(b,e,n,g,!!b.dynamicChildren)}},move:ib,hydrate:qZ};function ib(t,e,n,{o:{insert:r},m:s},i=2){i===0&&r(t.targetAnchor,e,n);const{el:o,anchor:a,shapeFlag:c,children:l,props:d}=t,h=i===2;if(h&&r(o,e,n),!Pl.has(t)&&(!h||ld(d))&&c&16)for(let p=0;p<l.length;p++)s(l[p],e,n,2);h&&r(a,e,n)}function qZ(t,e,n,r,s,i,{o:{nextSibling:o,parentNode:a,querySelector:c,insert:l,createText:d}},h){function p(b,w){let E=w;for(;E;){if(E&&E.nodeType===8){if(E.data==="teleport start anchor")e.targetStart=E;else if(E.data==="teleport anchor"){e.targetAnchor=E,b._lpa=e.targetAnchor&&o(e.targetAnchor);break}}E=o(E)}}function g(b,w){w.anchor=h(o(b),w,a(b),n,r,s,i)}const _=e.target=zC(e.props,c),v=ld(e.props);if(_){const b=_._lpa||_.firstChild;e.shapeFlag&16&&(v?(g(t,e),p(_,b),e.targetAnchor||YC(_,e,d,l,a(t)===_?t:null)):(e.anchor=o(t),p(_,b),e.targetAnchor||YC(_,e,d,l),h(b&&o(b),e,_,n,r,s,i))),sg(e,v)}else v&&e.shapeFlag&16&&(g(t,e),e.targetStart=t,e.targetAnchor=o(t));return e.anchor&&o(e.anchor)}const jZ=HZ;function sg(t,e){const n=t.ctx;if(n&&n.ut){let r,s;for(e?(r=t.el,s=t.anchor):(r=t.targetStart,s=t.targetAnchor);r&&r!==s;)r.nodeType===1&&r.setAttribute("data-v-owner",n.uid),r=r.nextSibling;n.ut()}}function YC(t,e,n,r,s=null){const i=e.targetStart=n(""),o=e.targetAnchor=n("");return i[q$]=o,t&&(r(i,t,s),r(o,t,s)),o}const io=Symbol("_leaveCb"),Bm=Symbol("_enterCb");function TP(){const t={isMounted:!1,isLeaving:!1,isUnmounting:!1,leav
vendor: 26,469 bytes, lines 3-5
3ingVNodes:new Map};return ka(()=>{t.isMounted=!0}),Sp(()=>{t.isUnmounting=!0}),t}const eo=[Function,Array],EP={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:eo,onEnter:eo,onAfterEnter:eo,onEnterCancelled:eo,onBeforeLeave:eo,onLeave:eo,onAfterLeave:eo,onLeaveCancelled:eo,onBeforeAppear:eo,onAppear:eo,onAfterAppear:eo,onAppearCancelled:eo},W$=t=>{const e=t.subTree;return e.component?W$(e.component):e},WZ={name:"BaseTransition",props:EP,setup(t,{slots:e}){const n=Sr(),r=TP();return()=>{const s=e.default&&wT(e.default(),!0),i=s&&s.length?G$(s):n.subTree?Nw():void 0;if(!i)return;const o=jt(t),{mode:a}=o;if(r.isLeaving)return g0(i);const c=hx(i);if(!c)return g0(i);let l=Df(c,o,r,n,h=>l=h);c.type!==Nr&&qc(c,l);let d=n.subTree&&hx(n.subTree);if(d&&d.type!==Nr&&!Oo(d,c)&&W$(n).type!==Nr){let h=Df(d,o,r,n);if(qc(d,h),a==="out-in"&&c.type!==Nr)return r.isLeaving=!0,h.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete h.afterLeave,d=void 0},g0(i);a==="in-out"&&c.type!==Nr?h.delayLeave=(p,g,_)=>{const v=z$(r,d);v[String(d.key)]=d,p[io]=()=>{g(),p[io]=void 0,delete l.delayedLeave,d=void 0},l.delayedLeave=()=>{_(),delete l.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return i}}};function G$(t){let e=t[0];if(t.length>1){for(const n of t)if(n.type!==Nr){e=n;break}}return e}const K$=WZ;function z$(t,e){const{leavingVNodes:n}=t;let r=n.get(e.type);return r||(r=Object.create(null),n.set(e.type,r)),r}function Df(t,e,n,r,s){const{appear:i,mode:o,persisted:a=!1,onBeforeEnter:c,onEnter:l,onAfterEnter:d,onEnterCancelled:h,onBeforeLeave:p,onLeave:g,onAfterLeave:_,onLeaveCancelled:v,onBeforeAppear:b,onAppear:w,onAfterAppear:E,onAppearCancelled:T}=e,R=String(t.key),N=z$(n,t),O=(P,k)=>{P&&$i(P,r,9,k)},S=(P,k)=>{const L=k[1];O(P,k),rt(P)?P.every(M=>M.length<=1)&&L():P.length<=1&&L()},I={mode:o,persisted:a,beforeEnter(P){let k=c;if(!n.isMounted)if(i)k=b||c;else return;P[io]&&P[io](!0);const L=N[R];L&&Oo(t,L)&&L.el[io]&&L.el[io](),O(k,[P])},enter(P){if(N[R]===t)return;let k=l,L=d,M=h;if(!n.isMounted)if(i)k=w||l,L=E||d,M=T||h;else return;let V=!1;P[Bm]=ie=>{V||(V=!0,ie?O(M,[P]):O(L,[P]),I.delayedLeave&&I.delayedLeave(),P[Bm]=void 0)};const z=P[Bm].bind(null,!1);k?S(k,[P,z]):z()},leave(P,k){const L=String(t.key);if(P[Bm]&&P[Bm](!0),n.isUnmounting)return k();O(p,[P]);let M=!1;P[io]=z=>{M||(M=!0,k(),z?O(v,[P]):O(_,[P]),P[io]=void 0,N[L]===t&&delete N[L])};const V=P[io].bind(null,!1);N[L]=t,g?S(g,[P,V]):V()},clone(P){const k=Df(P,e,n,r,s);return s&&s(k),k}};return I}function g0(t){if(J_(t))return t=gi(t),t.children=null,t}function hx(t){if(!J_(t))return j$(t.type)&&t.children?G$(t.children):t;if(t.component)return t.component.subTree;const{shapeFlag:e,children:n}=t;if(n){if(e&16)return n[0];if(e&32&&yt(n.default))return n.default()}}function qc(t,e){t.shapeFlag&6&&t.component?(t.transition=e,qc(t.component.subTree,e)):t.shapeFlag&128?(t.ssContent.transition=e.clone(t.ssContent),t.ssFallback.transition=e.clone(t.ssFallback)):t.transition=e}function wT(t,e=!1,n){let r=[],s=0;for(let i=0;i<t.length;i++){let o=t[i];const a=n==null?o.key:String(n)+String(o.key!=null?o.key:i);o.type===kr?(o.patchFlag&128&&s++,r=r.concat(wT(o.children,e,a))):(e||o.type!==Nr)&&r.push(a!=null?gi(o,{key:a}):o)}if(s>1)for(let i=0;i<r.length;i++)r[i].patchFlag=-2;return r}function Ls(t,e){return yt(t)?Rn({name:t.name},e,{setup:t}):t}function GZ(){const t=Sr();return t?(t.appContext.config.idPrefix||"v")+"-"+t.ids[0]+t.ids[1]++:""}function IP(t){t.ids=[t.ids[0]+t.ids[2]+++"-",0,0]}function KZ(t){const e=Sr(),n=ht(null);if(e){const s=e.refs===Jt?e.refs={}:e.refs;Object.defineProperty(s,t,{enumerable:!0,get:()=>n.value,set:i=>n.value=i})}return n}function fx(t,e){let n;return!!((n=Object.getOwnPropertyDescriptor(t,e))&&!n.configurable)}const Aw=new WeakMap;function _f(t,e,n,r,s=!1){if(rt(t)){t.forEach((v,b)=>_f(v,e&&(rt(e)?e[b]:e),n,r,s));return}if(Rc(r)&&!s){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&_f(t,e,n,r.component.subTree);return}const i=r.shapeFlag&4?Q_(r.component):r.el,o=s?null:i,{i:a,r:c}=t,l=e&&e.r,d=a.refs===Jt?a.refs={}:a.refs,h=a.setupState,p=jt(h),g=h===Jt?uP:v=>fx(d,v)?!1:on(p,v),_=(v,b)=>!(b&&fx(d,b));if(l!=null&&l!==c){if(px(e),vn(l))d[l]=null,g(l)&&(h[l]=null);else if(Pn(l)){const v=e;_(l,v.k)&&(l.value=null),v.k&&(d[v.k]=null)}}if(yt(c))bp(c,a,12,[o,d]);else{const v=vn(c),b=Pn(c);if(v||b){const w=()=>{if(t.f){const E=v?g(c)?h[c]:d[c]:_()||!t.k?c.value:d[t.k];if(s)rt(E)&&hT(E,i);else if(rt(E))E.includes(i)||E.push(i);else if(v)d[c]=[i],g(c)&&(h[c]=d[c]);else{const T=[i];_(c,t.k)&&(c.value=T),t.k&&(d[t.k]=T)}}else v?(d[c]=o,g(c)&&(h[c]=o)):b&&(_(c,t.k)&&(c.value=o),t.k&&(d[t.k]=o))};if(o){const E=()=>{w(),Aw.delete(t)};E.id=-1,Aw.set(t,E),Ur(E,n)}else px(t),w()}}}function px(t){const e=Aw.get(t);e&&(e.flags|=8,Aw.delete(t))}let mx=!1;const $h=()=>{mx||(console.error("Hydration completed but contains mismatches."),mx=!0)},zZ=t=>t.namespaceURI.includes("svg")&&t.tagName!=="foreignObject",YZ=t=>t.namespaceURI.includes("MathML"),ob=t=>{if(t.nodeType===1){if(zZ(t))return"svg";if(YZ(t))return"mathml"}},df=t=>t.nodeType===8;function JZ(t){const{mt:e,p:n,o:{patchProp:r,createText:s,nextSibling:i,parentNode:o,remove:a,insert:c,createComment:l}}=t,d=(T,R)=>{if(!R.hasChildNodes()){n(null,T,R),Cw(),R._vnode=T;return}h(R.firstChild,T,null,null,null),Cw(),R._vnode=T},h=(T,R,N,O,S,I=!1)=>{I=I||!!R.dynamicChildren;const P=df(T)&&T.data==="[",k=()=>v(T,R,N,O,S,P),{type:L,ref:M,shapeFlag:V,patchFlag:z}=R;let ie=T.nodeType;R.el=T,z===-2&&(I=!1,R.dynamicChildren=null);let K=null;switch(L){case Pc:ie!==3?R.children===""?(c(R.el=s(""),o(T),T),K=T):K=k():(T.data!==R.children&&($h(),T.data=R.children),K=i(T));break;case Nr:E(T)?(K=i(T),w(R.el=T.content.firstChild,T,N)):ie!==8||P?K=k():K=i(T);break;case kd:if(P&&(T=i(T),ie=T.nodeType),ie===1||ie===3){K=T;const ce=!R.children.length;for(let G=0;G<R.staticCount;G++)ce&&(R.children+=K.nodeType===1?K.outerHTML:K.data),G===R.staticCount-1&&(R.anchor=K),K=i(K);return P?i(K):K}else k();break;case kr:P?K=_(T,R,N,O,S,I):K=k();break;default:if(V&1)(ie!==1||R.type.toLowerCase()!==T.tagName.toLowerCase())&&!E(T)?K=k():K=p(T,R,N,O,S,I);else if(V&6){R.slotScopeIds=S;const ce=o(T);if(P?K=b(T):df(T)&&T.data==="teleport start"?K=b(T,T.data,"teleport end"):K=i(T),e(R,ce,null,N,O,ob(ce),I),Rc(R)&&!R.type.__asyncResolved){let G;P?(G=Un(kr),G.anchor=K?K.previousSibling:ce.lastChild):G=T.nodeType===3?BP(""):Un("div"),G.el=T,R.component.subTree=G}}else V&64?ie!==8?K=k():K=R.type.hydrate(T,R,N,O,S,I,t,g):V&128&&(K=R.type.hydrate(T,R,N,O,ob(o(T)),S,I,t,h))}return M!=null&&_f(M,null,O,R),K},p=(T,R,N,O,S,I)=>{I=I||!!R.dynamicChildren;const{type:P,props:k,patchFlag:L,shapeFlag:M,dirs:V,transition:z}=R,ie=P==="input"||P==="option";if(ie||L!==-1){V&&ma(R,null,N,"created");let K=!1;if(E(T)){K=vU(null,z)&&N&&N.vnode.props&&N.vnode.props.appear;const G=T.content.firstChild;if(K){const Z=G.getAttribute("class");Z&&(G.$cls=Z),z.beforeEnter(G)}w(G,T,N),R.el=T=G}if(M&16&&!(k&&(k.innerHTML||k.textContent))){let G=g(T.firstChild,R,T,N,O,S,I);for(G&&!ab(T,1)&&$h();G;){const Z=G;G=G.nextSibling,a(Z)}}else if(M&8){let G=R.children;G[0]===` 4`&&(T.tagName==="PRE"||T.tagName==="TEXTAREA")&&(G=G.slice(1));const{textContent:Z}=T;Z!==G&&Z!==G.replace(/\r\n|\r/g,` 5`)&&(ab(T,0)||$h(),T.textContent=R.children)}if(k){if(ie||!I||L&48){const G=T.tagName.includes("-");for(const Z in k)(ie&&(Z.endsWith("value")||Z==="indeterminate")||mp(Z)&&!jl(Z)||Z[0]==="."||G&&!jl(Z))&&r(T,Z,null,k[Z],void 0,N)}else if(k.onClick)r(T,"onClick",null,k.onClick,void 0,N);else if(L&4&&ho(k.style))for(const G in k.style)k.style[G]}let ce;(ce=k&&k.onVnodeBeforeMount)&&ci(ce,N,R),V&&ma(R,null,N,"beforeMount"),((ce=k&&k.onVnodeMounted)||V||K)&&TU(()=>{ce&&ci(ce,N,R),K&&z.enter(T),V&&ma(R,null,N,"mounted")},O)}return T.nextSibling},g=(T,R,N,O,S,I,P)=>{P=P||!!R.dynamicChildren;const k=R.children,L=k.length;let M=!1;for(let V=0;V<L;V++){const z=P?k[V]:k[V]=li(k[V]),ie=z.type===Pc;T?(ie&&!P&&V+1<L&&li(k[V+1]).type===Pc&&(c(s(T.data.slice(z.children.length)),N,i(T)),T.data=z.children),T=h(T,z,O,S,I,P)):ie&&!z.children?c(z.el=s(""),N):(M||(M=!0,ab(N,1)||$h()),n(null,z,N,null,O,S,ob(N),I))}return T},_=(T,R,N,O,S,I)=>{const{slotScopeIds:P}=R;P&&(S=S?S.concat(P):P);const k=o(T),L=g(i(T),R,k,N,O,S,I);return L&&df(L)&&L.data==="]"?i(R.anchor=L):($h(),c(R.anchor=l("]"),k,L),L)},v=(T,R,N,O,S,I)=>{if(ab(T.parentElement,1)||$h(),R.el=null,I){const L=b(T);for(;;){const M=i(T);if(M&&M!==L)a(M);else break}}const P=i(T),k=o(T);return a(T),n(null,R,k,P,N,O,ob(k),S),N&&(N.vnode.el=R.el,IT(N,R.el)),P},b=(T,R="[",N="]")=>{let O=0;for(;T;)if(T=i(T),T&&df(T)&&(T.data===R&&O++,T.data===N)){if(O===0)return i(T);O--}return T},w=(T,R,N)=>{const O=R.parentNode;O&&O.replaceChild(T,R);let S=N;for(;S;)S.vnode.el===R&&(S.vnode.el=S.subTree.el=T),S=S.parent},E=T=>T.nodeType===1&&T.tagName==="TEMPLATE";return[d,h]}const gx="data-allow-mismatch",QZ={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function ab(t,e){if(e===0||e===1)for(;t&&!t.hasAttribute(gx);)t=t.parentElement;const n=t&&t.getAttribute(gx);if(n==null)return!1;if(n==="")return!0;{const r=n.split(",");return e===0&&r.includes("children")?!0:r.includes(QZ[e])}}const XZ=W_().requestIdleCallback||(t=>setTimeout(t,1)),ZZ=W_().cancelIdleCallback||(t=>clearTimeout(t)),eee=(t=1e4)=>e=>{const n=XZ(e,{timeout:t});return()=>ZZ(n)};function tee(t){const{top:e,left:n,bottom:r,right:s}=t.getBoundingClientRect(),{innerHeight:i,innerWidth:o}=window;return(e>0&&e<i||r>0&&r<i)&&(n>0&&n<o||s>0&&s<o)}const nee=t=>(e,n)=>{const r=new IntersectionObserver(s=>{for(const i of s)if(i.isIntersecting){r.disconnect(),e();break}},t);return n(s=>{if(s instanceof Element){if(tee(s))return e(),r.disconnect(),!1;r.observe(s)}}),()=>r.disconnect()},ree=t=>e=>{if(t){const n=matchMedia(t);if(n.matches)e();else return n.addEventListener("change",e,{once:!0}),()=>n.removeEventListener("change",e)}},see=(t=[])=>(e,n)=>{vn(t)&&(t=[t]);let r=!1;const s=o=>{r||(r=!0,i(),e(),o.target.dispatchEvent(new o.constructor(o.type,o)))},i=()=>{n(o=>{for(const a of t)o.removeEventListener(a,s)})};return n(o=>{for(const a of t)o.addEventListener(a,s,{once:!0})}),i};function iee(t,e){if(df(t)&&t.data==="["){let n=1,r=t.nextSibling;for(;r;){if(r.nodeType===1){if(e(r)===!1)break}else if(df(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else e(t)}const Rc=t=>!!t.type.__asyncLoader;function mc(t){yt(t)&&(t={loader:t});const{loader:e,loadingComponent:n,errorComponent:r,delay:s=200,hydrate:i,timeout:o,suspensible:a=!0,onError:c}=t;let l=null,d,h=0;const p=()=>(h++,l=null,g()),g=()=>{let _;return l||(_=l=e().catch(v=>{if(v=v instanceof Error?v:new Error(String(v)),c)return new Promise((b,w)=>{c(v,()=>b(p()),()=>w(v),h+1)});throw v}).then(v=>_!==l&&l?l:(v&&(v.__esModule||v[Symbol.toStringTag]==="Module")&&(v=v.default),d=v,v)))};return Ls({name:"AsyncComponentWrapper",__asyncLoader:g,__asyncHydrate(_,v,b){let w=!1;(v.bu||(v.bu=[])).push(()=>w=!0);const E=()=>{w||b()},T=i?()=>{const R=i(E,N=>iee(_,N));R&&(v.bum||(v.bum=[])).push(R)}:E;d?T():g().then(()=>!v.isUnmounted&&T())},get __asyncResolved(){return d},setup(){const _=gs;if(IP(_),d)return()=>cb(d,_);const v=T=>{l=null,ah(T,_,13,!r)};if(a&&_.suspense||qd)return g().then(T=>()=>cb(T,_)).catch(T=>(v(T),()=>r?Un(r,{error:T}):null));const b=Ae(!1),w=Ae(),E=Ae(!!s);return s&&setTimeout(()=>{E.value=!1},s),o!=null&&setTimeout(()=>{if(!b.value&&!w.value){const T=new Error(`Async component timed out after ${o}ms.`);v(T),w.value=T}},o),g().then(()=>{b.value=!0,_.parent&&J_(_.parent.vnode)&&_.parent.update()}).catch(T=>{v(T),w.value=T}),()=>{if(b.value&&d)return cb(d,_);if(w.value&&r)return Un(r,{error:w.value});if(n&&!E.value)return cb(n,_)}}})}function cb(t,e){const{ref:n,props:r,children:s,ce:i}=e.vnode,o=Un(t,r,s);return o.ref=n,o.ce=i,delete e.vnode.ce,o}const J_=t=>t.type.__isKeepAlive,oee={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(t,{slots:e}){const n=Sr(),r=n.ctx;if(!r.renderer)return()=>{const E=e.default&&e.default();return E&&E.length===1?E[0]:E};const s=new Map,i=new Set;let o=null;const a=n.suspense,{renderer:{p:c,m:l,um:d,o:{createElement:h}}}=r,p=h("div");r.activate=(E,T,R,N,O)=>{const S=E.component;l(E,T,R,0,a),c(S.vnode,E,T,R,S,a,N,E.slotScopeIds,O),Ur(()=>{S.isDeactivated=!1,S.a&&Ad(S.a);const I=E.props&&E.props.onVnodeMounted;I&&ci(I,S.parent,E)},a)},r.deactivate=E=>{const T=E.component;Pw(T.m),Pw(T.a),l(E,p,null,1,a),Ur(()=>{T.da&&Ad(T.da);const R=E.props&&E.props.onVnodeUnmounted;R&&ci(R,T.parent,E),T.isDeactivated=!0},a)};function g(E){_0(E),d(E,n,a,!0)}function _(E){s.forEach((T,R)=>{const N=sA(Rc(T)?T.type.__asyncResolved||{}:T.type);N&&!E(N)&&v(R)})}function v(E){const T=s.get(E);T&&(!o||!Oo(T,o))?g(T):o&&_0(o),s.delete(E),i.delete(E)}ft(()=>[t.include,t.exclude],([E,T])=>{E&&_(R=>ig(E,R)),T&&_(R=>!ig(T,R))},{flush:"post",deep:!0});let b=null;const w=()=>{b!=null&&(kw(n.subTree.type)?Ur(()=>{s.set(b,lb(n.subTree))},n.subTree.suspense):s.set(b,lb(n.subTree)))};return ka(w),TT(w),Sp(()=>{s.forEach(E=>{const{subTree:T,suspense:R}=n,N=lb(T);if(E.type===N.type&&E.key===N.key){_0(N);const O=N.component.da;O&&Ur(O,R);return}g(E)})}),()=>{if(b=null,!e.default)return o=null;const E=e.default(),T=E[0];if(E.length>1)return o=null,E;if(!jc(T)||!(T.shapeFlag&4)&&!(T.shapeFlag&128))return o=null,T;let R=lb(T);if(R.type===Nr)return o=null,R;const N=R.type,O=sA(Rc(R)?R.type.__asyncResolved||{}:N),{include:S,exclude:I,max:P}=t;if(S&&(!O||!ig(S,O))||I&&O&&ig(I,O))return R.shapeFlag&=-257,o=R,T;const k=R.key==null?N:R.key,L=s.get(k);return R.el&&(R=gi(R),T.shapeFlag&128&&(T.ssContent=R)),b=k,L?(R.el=L.el,R.component=L.component,R.transition&&qc(R,R.transition),R.shapeFlag|=512,i.delete(k),i.add(k)):(i.add(k),P&&i.size>parseInt(P,10)&&v(i.values().next().value)),R.shapeFlag|=256,o=R,kw(T.type)?T:R}}},Y$=oee;function ig(t,e){return rt(t)?t.some(n=>ig(n,e)):vn(t)?t.split(",").includes(e):o$(t)?(t.lastIndex=0,t.test(e)):!1}function CP(t,e){J$(t,"a",e)}function AP(t,e){J$(t,"da",e)}function J$(t,e,n=gs){const r=t.__wdc||(t.__wdc=()=>{let s=n;for(;s;){if(s.isDeactivated)return;s=s.parent}return t()});if(ST(e,r,n),n){let s=n.parent;for(;s&&s.parent;)J_(s.parent.vnode)&&aee(r,e,n,s),s=s.parent}}function aee(t,e,n,r){const s=ST(e,t,r,!0);Tp(()=>{hT(r[e],s)},n)}function _0(t){t.shapeFlag&=-257,t.shapeFlag&=-513}function lb(t){return t.shapeFlag&128?t.ssContent:t}function ST(t,e,n=gs,r=!1){if(n){const s=n[t]||(n[t]=[]),i=e.__weh||(e.__weh=(...o)=>{Uc();const a=Ep(n),c=$i(e,n,t,o);return a(),Hc(),c});return r?s.unshift(i):s.push(i),i}}const tl=t=>(e,n=gs)=>{(!qd||t==="sp")&&ST(t,(...r)=>e(...r),n)},RP=tl("bm"),ka=tl("m"),PP=tl("bu"),TT=tl("u"),Sp=tl("bum"),Tp=tl("um"),Q$=tl("sp"),X$=tl("rtg"),Z$=tl("rtc");function kP(t,e=gs){ST("ec",t,e)}const NP="components",cee="directives";function lee(t,e){return DP(NP,t,!0,e)||t}const eU=Symbol.for("v-ndc");function tU(t){return vn(t)?DP(NP,t,!1)||t:t||eU}function uee(t){return DP(cee,t)}function DP(t,e,n=!0,r=!1){const s=ys||gs;if(s){const i=s.type;if(t===NP){const a=sA(i,!1);if(a&&(a===e||a===xr(e)||a===_p(xr(e))))return i}const o=_x(s[t]||i[t],e)||_x(s.appContext[t],e);return!o&&r?i:o}}function _x(t,e){return t&&(t[e]||t[xr(e)]||t[_p(xr(e))])}function dee(t,e,n,r){let s;const i=n&&n[r],o=rt(t);if(o||vn(t)){const a=o&&ho(t);let c=!1,l=!1;a&&(c=!mi(t),l=Go(t),t=mT(t)),s=new Array(t.length);for(let d=0,h=t.length;d<h;d++)s[d]=e(c?l?Nf(Ko(t[d])):Ko(t[d]):t[d],d,void 0,i&&i[d])}else if(typeof t=="number"){s=new Array(t);for(let a=0;a<t;a++)s[a]=e(a+1,a,void 0,i&&i[a])}else if(fn(t))if(t[Symbol.iterator])s=Array.from(t,(a,c)=>e(a,c,void 0,i&&i[c]));else{const a=Object.keys(t);s=new Array(a.length);for(let c=0,l=a.length;c<l;c++){const d=a[c];s[c]=e(t[d],d,c,i&&i[c])}}else s=[];return n&&(n[r]=s),s}function hee(t,e){for(let n=0;n<e.length;n++){const r=e[n];if(rt(r))for(let s=0;s<r.length;s++)t[r[s].name]=r[s].fn;else r&&(t[r.name]=r.key?(...s)=>{const i=r.fn(...s);return i&&(i.key=r.key),i}:r.fn)}return t}function fee(t,e,n={},r,s){if(ys.ce||ys.parent&&Rc(ys.parent)&&ys.parent.ce){const l=Object.keys(n).length>0;return e!=="default"&&(n.name=e),ls(),Do(kr,null,[Un("slot",n,r&&r())],l?-2:64)}let i=t[e];i&&i._c&&(i._d=!1),ls();const o=i&&OP(i(n)),a=n.key||o&&o.key,c=Do(kr,{key:(a&&!Si(a)?a:`_${e}`)+(!o&&r?"_fb":"")},o||(r?r():[]),o&&t._===1?64:-2);return!s&&c.scopeId&&(c.slotScopeIds=[c.scopeId+"-s"]),i&&i._c&&(i._d=!0),c}function OP(t){return t.some(e=>jc(e)?!(e.type===Nr||e.type===kr&&!OP(e.children)):!0)?t:null}function pee(t,e){const n={};for(const r in t)n[e&&/[A-Z]/.test(r)?`on:${r}`:mf(r)]=t[r];return n}const JC=t=>t?PU(t)?Q_(t):JC(t.parent):null,vg=Rn(Object.create(null),{$:t=>t,$el:t=>t.vnode.el,$data:t=>t.data,$props:t=>t.props,$attrs:t=>t.attrs,$slots:t=>t.slots,$refs:t=>t.refs,$parent:t=>JC(t.parent),$root:t=>JC(t.root),$host:t=>t.ce,$emit:t=>t.emit,$options:t=>xP(t),$forceUpdate:t=>t.f||(t.f=()=>{wP(t.update)}),$nextTick:t=>t.n||(t.n=zs.bind(t.proxy)),$watch:t=>$Z.bind(t)}),y0=(t,e)=>t!==Jt&&!t.__isScriptSetup&&on(t,e),QC={get({_:t},e){if(e==="__v_skip")return!0;const{ctx:n,setupState:r,data:s,props:i,accessCache:o,type:a,appContext:c}=t;if(e[0]!=="$"){const p=o[e];if(p!==void 0)switch(p){case 1:return r[e];case 2:return s[e];case 4:return n[e];case 3:return i[e]}else{if(y0(r,e))return o[e]=1,r[e];if(s!==Jt&&on(s,e))return o[e]=2,s[e];if(on(i,e))return o[e]=3,i[e];if(n!==Jt&&on(n,e))return o[e]=4,n[e];XC&&(o[e]=0)}}const l=vg[e];let d,h;if(l)return e==="$attrs"&&Cs(t.attrs,"get",""),l(t);if((d=a.__cssModules)&&(d=d[e]))return d;if(n!==Jt&&on(n,e))return o[e]=4,n[e];if(h=c.config.globalProperties,on(h,e))return h[e]},set({_:t},e,n){const{data:r,setupState:s,ctx:i}=t;return y0(s,e)?(s[e]=n,!0):r!==Jt&&on(r,e)?(r[e]=n,!0):on(t.props,e)||e[0]==="$"&&e.slice(1)in t?!1:(i[e]=n,!0)},has({_:{data:t,setupState:e,accessCache:n,ctx:r,appContext:s,props:i,type:o}},a){let c;return!!(n[a]||t!==Jt&&a[0]!=="$"&&on(t,a)||y0(e,a)||on(i,a)||on(r,a)||on(vg,a)||on(s.config.globalProperties,a)||(c=o.__cssModules)&&c[a])},defineProperty(t,e,n){return n.get!=null?t._.accessCache[e]=0:on(n,"value")&&this.set(t,e,n.value,null),Reflect.defineProperty(t,e,n)}},mee=Rn({},QC,{get(t,e){if(e!==Symbol.unscopables)return QC.get(t,e,t)},has(t,e){return e[0]!=="_"&&!fP(e)}});function gee(){return null}function _ee(){return null}function yee(t){}function vee(t){}function bee(){return null}function wee(){}function See(t,e){return null}function Tee(){return nU().slots}function Eee(){return nU().attrs}function nU(t){const e=Sr();return e.setupContext||(e.setupContext=DU(e))}function Zg(t){return rt(t)?t.reduce((e,n)=>(e[n]=null,e),{}):t}function Iee(t,e){const n=Zg(t);for(const r in e){if(r.startsWith("__skip"))continue;let s=n[r];s?rt(s)||yt(s)?s=n[r]={type:s,default:e[r]}:s.default=e[r]:s===null&&(s=n[r]={default:e[r]}),s&&e[`__skip_${r}`]&&(s.skipFactory=!0)}return n}function Cee(t,e){return!t||!e?t||e:rt(t)&&rt(e)?t.concat(e):Rn({},Zg(t),Zg(e))}function Aee(t,e){const n={};for(const r in t)e.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>t[r]});return n}function Ree(t){const e=Sr(),n=qd;let r=t();n_(),n&&vf(!1);const s=()=>{Ep(e),n&&vf(!0)},i=()=>{Sr()!==e&&e.scope.off(),n_(),n&&vf(!1)};return H_(r)&&(r=r.catch(o=>{throw s(),Promise.resolve().then(()=>Promise.resolve().then(i)),o})),[r,()=>{s(),Promise.resolve().then(i)}]}let XC=!0;function Pee(t){const e=xP(t),n=t.proxy,r=t.ctx;XC=!1,e.beforeCreate&&yx(e.beforeCreate,t,"bc");const{data:s,computed:i,methods:o,watch:a,provide:c,inject:l,created:d,beforeMount:h,mounted:p,beforeUpdate:g,updated:_,activated:v,deactivated:b,beforeDestroy:w,beforeUnmount:E,destroyed:T,unmounted:R,render:N,renderTracked:O,renderTriggered:S,errorCaptured:I,serverPrefetch:P,expose:k,inheritAttrs:L,components:M,directives:V,filters:z}=e;if(l&&kee(l,r,null),o)for(const ce in o){const G=o[ce];yt(G)&&(r[ce]=G.bind(n))}if(s){const ce=s.call(n,n);fn(ce)&&(t.data=Xs(ce))}if(XC=!0,i)for(const ce in i){const G=i[ce],Z=yt(G)?G.bind(n,n):yt(G.get)?G.get.bind(n,n):Vi,de=!yt(G)&&yt(G.set)?G.set.bind(n):Vi,fe=$e({get:Z,set:de});Object.defineProperty(r,ce,{enumerable:!0,configurable:!0,get:()=>fe.value,set:ee=>fe.value=ee})}if(a)for(const ce in a)rU(a[ce],r,n,ce);if(c){const ce=yt(c)?c.call(n):c;Reflect.ownKeys(ce).forEach(G=>{Sa(G,ce[G])})}d&&yx(d,t,"c");function K(ce,G){rt(G)?G.forEach(Z=>ce(Z.bind(n))):G&&ce(G.bind(n))}if(K(RP,h),K(ka,p),K(PP,g),K(TT,_),K(CP,v),K(AP,b),K(kP,I),K(Z$,O),K(X$,S),K(Sp,E),K(Tp,R),K(Q$,P),rt(k))if(k.length){const ce=t.exposed||(t.exposed={});k.forEach(G=>{Object.defineProperty(ce,G,{get:()=>n[G],set:Z=>n[G]=Z,enumerable:!0})})}else t.exposed||(t.exposed={});N&&t.render===Vi&&(t.render=N),L!=null&&(t.inheritAttrs=L),M&&(t.components=M),V&&(t.directives=V),P&&IP(t)}function kee(t,e,n=Vi){rt(t)&&(t=ZC(t));for(const r in t){const s=t[r];let i;fn(s)?"default"in s?i=vr(s.from||r,s.default,!0):i=vr(s.from||r):i=vr(s),Pn(i)?Object.defineProperty(e,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:o=>i.value=o}):e[r]=i}}function yx(t,e,n){$i(rt(t)?t.map(r=>r.bind(e.proxy)):t.bind(e.proxy),e,n)}function rU(t,e,n,r){let s=r.includes(".")?H$(n,r):()=>n[r];if(vn(t)){const i=e[t];yt(i)&&ft(s,i)}else if(yt(t))ft(s,t.bind(n));else if(fn(t))if(rt(t))t.forEach(i=>rU(i,e,n,r));else{const i=yt(t.handler)?t.handler.bind(n):e[t.handler];yt(i)&&ft(s,i,t)}}function xP(t){const e=t.type,{mixins:n,extends:r}=e,{mixins:s,optionsCache:i,config:{optionMergeStrategies:o}}=t.appContext,a=i.get(e);let c;return a?c=a:!s.length&&!n&&!r?c=e:(c={},s.length&&s.forEach(l=>Rw(c,l,o,!0)),Rw(c,e,o)),fn(e)&&i.set(e,c),c}function Rw(t,e,n,r=!1){const{mixins:s,extends:i}=e;i&&Rw(t,i,n,!0),s&&s.forEach(o=>Rw(t,o,n,!0));for(const o in e)if(!(r&&o==="expose")){const a=Nee[o]||n&&n[o];t[o]=a?a(t[o],e[o]):e[o]}return t}const Nee={data:vx,props:bx,emits:bx,methods:og,computed:og,beforeCreate:Us,created:Us,beforeMount:Us,mounted:Us,beforeUpdate:Us,updated:Us,beforeDestroy:Us,beforeUnmount:Us,destroyed:Us,unmounted:Us,activated:Us,deactivated:Us,errorCaptured:Us,serverPrefetch:Us,components:og,directives:og,watch:Oee,provide:vx,inject:Dee};function vx(t,e){return e?t?function(){return Rn(yt(t)?t.call(this,this):t,yt(e)?e.call(this,this):e)}:e:t}function Dee(t,e){return og(ZC(t),ZC(e))}function ZC(t){if(rt(t)){const e={};for(let n=0;n<t.length;n++)e[t[n]]=t[n];return e}return t}function Us(t,e){return t?[...new Set([].concat(t,e))]:e}function og(t,e){return t?Rn(Object.create(null),t,e):e}function bx(t,e){return t?rt(t)&&rt(e)?[...new Set([...t,...e])]:Rn(Object.create(null),Zg(t),Zg(e??{})):e}function Oee(t,e){if(!t)return e;if(!e)return t;const n=Rn(Object.create(null),t);for(const r in e)n[r]=Us(t[r],e[r]);return n}function sU(){return{app:null,config:{isNativeTag:uP,performance:!1,globalProperties:{},optionMergeStrategies:{},errorHandler:void 0,warnHandler:void 0,compilerOptions:{}},mixins:[],components:{},directives:{},provides:Object.create(null),optionsCache:new WeakMap,propsCache:new WeakMap,emitsCache:new WeakMap}}let xee=0;function Lee(t,e){return function(r,s=null){yt(r)||(r=Rn({},r)),s!=null&&!fn(s)&&(s=null);const i=sU(),o=new WeakSet,a=[];let c=!1;const l=i.app={_uid:xee++,_component:r,_props:s,_container:null,_context:i,_instance:null,version:xU,get config(){return i.config},set config(d){},use(d,...h){return o.has(d)||(d&&yt(d.install)?(o.add(d),d.install(l,...h)):yt(d)&&(o.add(d),d(l,...h))),l},mixin(d){return i.mixins.includes(d)||i.mixins.push(d),l},component(d,h){return h?(i.components[d]=h,l):i.components[d]},directive(d,h){return h?(i.directives[d]=h,l):i.directives[d]},mount(d,h,p){if(!c){const g=l._ceVNode||Un(r,s);return g.appContext=i,p===!0?p="svg":p===!1&&(p=void 0),h&&e?e(g,d):t(g,d,p),c=!0,l._container=d,d.__vue_app__=l,Q_(g.component)}},onUnmount(d){a.push(d)},unmount(){c&&($i(a,l._instance,16),t(null,l._container),delete l._container.__vue_app__)},provide(d,h){return i.provides[d]=h,l},runWithContext(d){const h=Pd;Pd=l;try{return d()}finally{Pd=h}}};return l}}let Pd=null;function Mee(t,e,n=Jt){const r=Sr(),s=xr(e),i=Rs(e),o=iU(t,s),a=vT((c,l)=>{let d,h=Jt,p;return U$(()=>{const g=t[s];cs(d,g)&&(d=g,l())}),{get(){return c(),n.get?n.get(d):d},set(g){const _=n.set?n.set(g):g;if(!cs(_,d)&&!(h!==Jt&&cs(g,h)))return;const v=r.vnode.props;v&&(e in v||s in v||i in v)&&(`onUpdate:${e}`in v||`onUpdate:${s}`in v||`onUpdate:${i}`in v)||(d=g,l()),r.emit(`update:${e}`,_),cs(g,_)&&cs(g,h)&&!cs(_,p)&&l(),h=g,p=_}}});return a[Symbol.iterator]=()=>{let c=0;return{next(){return c<2?{value:c++?o||Jt:a,done:!1}:{done:!0}}}},a}const iU=(t,e)=>e==="modelValue"||e==="model-value"?t.modelModifiers:t[`${e}Modifiers`]||t[`${xr(e)}Modifiers`]||t[`${Rs(e)}Modifiers`];function Vee(t,e,...n){if(t.isUnmounted)return;const r=t.vnode.props||Jt;let s=n;const i=e.startsWith("update:"),o=i&&iU(r,e.slice(7));o&&(o.trim&&(s=n.map(d=>vn(d)?d.trim():d)),o.number&&(s=n.map(j_)));let a,c=r[a=mf(e)]||r[a=mf(xr(e))];!c&&i&&(c=r[a=mf(Rs(e))]),c&&$i(c,t,6,s);const l=r[a+"Once"];if(l){if(!t.emitted)t.emitted={};else if(t.emitted[a])return;t.emitted[a]=!0,$i(l,t,6,s)}}const Fee=new WeakMap;function oU(t,e,n=!1){const r=n?Fee:e.emitsCache,s=r.get(t);if(s!==void 0)return s;const i=t.emits;let o={},a=!1;if(!yt(t)){const c=l=>{const d=oU(l,e,!0);d&&(a=!0,Rn(o,d))};!n&&e.mixins.length&&e.mixins.forEach(c),t.extends&&c(t.extends),t.mixins&&t.mixins.forEach(c)}return!i&&!a?(fn(t)&&r.set(t,null),null):(rt(i)?i.forEach(c=>o[c]=null):Rn(o,i),fn(t)&&r.set(t,o),o)}function ET(t,e){return!t||!mp(e)?!1:(e=e.slice(2).replace(/Once$/,""),on(t,e[0].toLowerCase()+e.slice(1))||on(t,Rs(e))||on(t,e))}function qb(t){const{type:e,vnode:n,proxy:r,withProxy:s,propsOptions:[i],slots:o,attrs:a,emit:c,render:l,renderCache:d,props:h,data:p,setupState:g,ctx:_,inheritAttrs:v}=t,b=Xg(t);let w,E;try{if(n.shapeFlag&4){const R=s||r,N=R;w=li(l.call(N,R,d,h,g,p,_)),E=a}else{const R=e;w=li(R.length>1?R(h,{attrs:a,slots:o,emit:c}):R(h,null)),E=e.props?a:$ee(a)}}catch(R){bg.length=0,ah(R,t,1),w=Un(Nr)}let T=w;if(E&&v!==!1){const R=Object.keys(E),{shapeFlag:N}=T;R.length&&N&7&&(i&&R.some(U_)&&(E=Uee(E,i)),T=gi(T,E,!1,!0))}return n.dirs&&(T=gi(T,null,!1,!0),T.dirs=T.dirs?T.dirs.concat(n.dirs):n.dirs),n.transition&&qc(T,n.transition),w=T,Xg(b),w}function Bee(t,e=!0){let n;for(let r=0;r<t.length;r++){const s=t[r];
vendor: 19,172 bytes, line 5
5if(jc(s)){if(s.type!==Nr||s.children==="v-if"){if(n)return;n=s}}else return}return n}const $ee=t=>{let e;for(const n in t)(n==="class"||n==="style"||mp(n))&&((e||(e={}))[n]=t[n]);return e},Uee=(t,e)=>{const n={};for(const r in t)(!U_(r)||!(r.slice(9)in e))&&(n[r]=t[r]);return n};function Hee(t,e,n){const{props:r,children:s,component:i}=t,{props:o,children:a,patchFlag:c}=e,l=i.emitsOptions;if(e.dirs||e.transition)return!0;if(n&&c>=0){if(c&1024)return!0;if(c&16)return r?wx(r,o,l):!!o;if(c&8){const d=e.dynamicProps;for(let h=0;h<d.length;h++){const p=d[h];if(aU(o,r,p)&&!ET(l,p))return!0}}}else return(s||a)&&(!a||!a.$stable)?!0:r===o?!1:r?o?wx(r,o,l):!0:!!o;return!1}function wx(t,e,n){const r=Object.keys(e);if(r.length!==Object.keys(t).length)return!0;for(let s=0;s<r.length;s++){const i=r[s];if(aU(e,t,i)&&!ET(n,i))return!0}return!1}function aU(t,e,n){const r=t[n],s=e[n];return n==="style"&&fn(r)&&fn(s)?!Pa(r,s):r!==s}function IT({vnode:t,parent:e,suspense:n},r){for(;e;){const s=e.subTree;if(s.suspense&&s.suspense.activeBranch===t&&(s.suspense.vnode.el=s.el=r,t=s),s===t)(t=e.vnode).el=r,e=e.parent;else break}n&&n.activeBranch===t&&(n.vnode.el=r)}const cU={},lU=()=>Object.create(cU),uU=t=>Object.getPrototypeOf(t)===cU;function qee(t,e,n,r=!1){const s={},i=lU();t.propsDefaults=Object.create(null),dU(t,e,s,i);for(const o in t.propsOptions[0])o in s||(s[o]=void 0);n?t.props=r?s:ao(s):t.type.props?t.props=s:t.props=i,t.attrs=i}function jee(t,e,n,r){const{props:s,attrs:i,vnode:{patchFlag:o}}=t,a=jt(s),[c]=t.propsOptions;let l=!1;if((r||o>0)&&!(o&16)){if(o&8){const d=t.vnode.dynamicProps;for(let h=0;h<d.length;h++){let p=d[h];if(ET(t.emitsOptions,p))continue;const g=e[p];if(c)if(on(i,p))g!==i[p]&&(i[p]=g,l=!0);else{const _=xr(p);s[_]=eA(c,a,_,g,t,!1)}else g!==i[p]&&(i[p]=g,l=!0)}}}else{dU(t,e,s,i)&&(l=!0);let d;for(const h in a)(!e||!on(e,h)&&((d=Rs(h))===h||!on(e,d)))&&(c?n&&(n[h]!==void 0||n[d]!==void 0)&&(s[h]=eA(c,a,h,void 0,t,!0)):delete s[h]);if(i!==a)for(const h in i)(!e||!on(e,h))&&(delete i[h],l=!0)}l&&_c(t.attrs,"set","")}function dU(t,e,n,r){const[s,i]=t.propsOptions;let o=!1,a;if(e)for(let c in e){if(jl(c))continue;const l=e[c];let d;s&&on(s,d=xr(c))?!i||!i.includes(d)?n[d]=l:(a||(a={}))[d]=l:ET(t.emitsOptions,c)||(!(c in r)||l!==r[c])&&(r[c]=l,o=!0)}if(i){const c=jt(n),l=a||Jt;for(let d=0;d<i.length;d++){const h=i[d];n[h]=eA(s,c,h,l[h],t,!on(l,h))}}return o}function eA(t,e,n,r,s,i){const o=t[n];if(o!=null){const a=on(o,"default");if(a&&r===void 0){const c=o.default;if(o.type!==Function&&!o.skipFactory&&yt(c)){const{propsDefaults:l}=s;if(n in l)r=l[n];else{const d=Ep(s);r=l[n]=c.call(null,e),d()}}else r=c;s.ce&&s.ce._setProp(n,r)}o[0]&&(i&&!a?r=!1:o[1]&&(r===""||r===Rs(n))&&(r=!0))}return r}const Wee=new WeakMap;function hU(t,e,n=!1){const r=n?Wee:e.propsCache,s=r.get(t);if(s)return s;const i=t.props,o={},a=[];let c=!1;if(!yt(t)){const d=h=>{c=!0;const[p,g]=hU(h,e,!0);Rn(o,p),g&&a.push(...g)};!n&&e.mixins.length&&e.mixins.forEach(d),t.extends&&d(t.extends),t.mixins&&t.mixins.forEach(d)}if(!i&&!c)return fn(t)&&r.set(t,Id),Id;if(rt(i))for(let d=0;d<i.length;d++){const h=xr(i[d]);Sx(h)&&(o[h]=Jt)}else if(i)for(const d in i){const h=xr(d);if(Sx(h)){const p=i[d],g=o[h]=rt(p)||yt(p)?{type:p}:Rn({},p),_=g.type;let v=!1,b=!0;if(rt(_))for(let w=0;w<_.length;++w){const E=_[w],T=yt(E)&&E.name;if(T==="Boolean"){v=!0;break}else T==="String"&&(b=!1)}else v=yt(_)&&_.name==="Boolean";g[0]=v,g[1]=b,(v||on(g,"default"))&&a.push(h)}}const l=[o,a];return fn(t)&&r.set(t,l),l}function Sx(t){return t[0]!=="$"&&!jl(t)}const LP=t=>t==="_"||t==="_ctx"||t==="$stable",MP=t=>rt(t)?t.map(li):[li(t)],Gee=(t,e,n)=>{if(e._n)return e;const r=z_((...s)=>MP(e(...s)),n);return r._c=!1,r},fU=(t,e,n)=>{const r=t._ctx;for(const s in t){if(LP(s))continue;const i=t[s];if(yt(i))e[s]=Gee(s,i,r);else if(i!=null){const o=MP(i);e[s]=()=>o}}},pU=(t,e)=>{const n=MP(e);t.slots.default=()=>n},mU=(t,e,n)=>{for(const r in e)(n||!LP(r))&&(t[r]=e[r])},Kee=(t,e,n)=>{const r=t.slots=lU();if(t.vnode.shapeFlag&32){const s=e._;s?(mU(r,e,n),n&&hP(r,"_",s,!0)):fU(e,r)}else e&&pU(t,e)},zee=(t,e,n)=>{const{vnode:r,slots:s}=t;let i=!0,o=Jt;if(r.shapeFlag&32){const a=e._;a?n&&a===1?i=!1:mU(s,e,n):(i=!e.$stable,fU(e,s)),o=e}else e&&(pU(t,e),o={default:1});if(i)for(const a in s)!LP(a)&&o[a]==null&&delete s[a]},Ur=TU;function gU(t){return yU(t)}function _U(t){return yU(t,JZ)}function yU(t,e){const n=W_();n.__VUE__=!0;const{insert:r,remove:s,patchProp:i,createElement:o,createText:a,createComment:c,setText:l,setElementText:d,parentNode:h,nextSibling:p,setScopeId:g=Vi,insertStaticContent:_}=t,v=(H,j,re,Re=null,ge=null,B=null,q=void 0,J=null,se=!!j.dynamicChildren)=>{if(H===j)return;H&&!Oo(H,j)&&(Re=Y(H),ee(H,ge,B,!0),H=null),j.patchFlag===-2&&(se=!1,j.dynamicChildren=null);const{type:be,ref:xe,shapeFlag:X}=j;switch(be){case Pc:b(H,j,re,Re);break;case Nr:w(H,j,re,Re);break;case kd:H==null&&E(j,re,Re,q);break;case kr:M(H,j,re,Re,ge,B,q,J,se);break;default:X&1?N(H,j,re,Re,ge,B,q,J,se):X&6?V(H,j,re,Re,ge,B,q,J,se):(X&64||X&128)&&be.process(H,j,re,Re,ge,B,q,J,se,Me)}xe!=null&&ge?_f(xe,H&&H.ref,B,j||H,!j):xe==null&&H&&H.ref!=null&&_f(H.ref,null,B,H,!0)},b=(H,j,re,Re)=>{if(H==null)r(j.el=a(j.children),re,Re);else{const ge=j.el=H.el;j.children!==H.children&&l(ge,j.children)}},w=(H,j,re,Re)=>{H==null?r(j.el=c(j.children||""),re,Re):j.el=H.el},E=(H,j,re,Re)=>{[H.el,H.anchor]=_(H.children,j,re,Re,H.el,H.anchor)},T=({el:H,anchor:j},re,Re)=>{let ge;for(;H&&H!==j;)ge=p(H),r(H,re,Re),H=ge;r(j,re,Re)},R=({el:H,anchor:j})=>{let re;for(;H&&H!==j;)re=p(H),s(H),H=re;s(j)},N=(H,j,re,Re,ge,B,q,J,se)=>{if(j.type==="svg"?q="svg":j.type==="math"&&(q="mathml"),H==null)O(j,re,Re,ge,B,q,J,se);else{const be=H.el&&H.el._isVueCE?H.el:null;try{be&&be._beginPatch(),P(H,j,ge,B,q,J,se)}finally{be&&be._endPatch()}}},O=(H,j,re,Re,ge,B,q,J)=>{let se,be;const{props:xe,shapeFlag:X,transition:le,dirs:je}=H;if(se=H.el=o(H.type,B,xe&&xe.is,xe),X&8?d(se,H.children):X&16&&I(H.children,se,null,Re,ge,v0(H,B),q,J),je&&ma(H,null,Re,"created"),S(se,H,H.scopeId,q,Re),xe){for(const vt in xe)vt!=="value"&&!jl(vt)&&i(se,vt,null,xe[vt],B,Re);"value"in xe&&i(se,"value",null,xe.value,B),(be=xe.onVnodeBeforeMount)&&ci(be,Re,H)}je&&ma(H,null,Re,"beforeMount");const Ye=vU(ge,le);Ye&&le.beforeEnter(se),r(se,j,re),((be=xe&&xe.onVnodeMounted)||Ye||je)&&Ur(()=>{be&&ci(be,Re,H),Ye&&le.enter(se),je&&ma(H,null,Re,"mounted")},ge)},S=(H,j,re,Re,ge)=>{if(re&&g(H,re),Re)for(let B=0;B<Re.length;B++)g(H,Re[B]);if(ge){let B=ge.subTree;if(j===B||kw(B.type)&&(B.ssContent===j||B.ssFallback===j)){const q=ge.vnode;S(H,q,q.scopeId,q.slotScopeIds,ge.parent)}}},I=(H,j,re,Re,ge,B,q,J,se=0)=>{for(let be=se;be<H.length;be++){const xe=H[be]=J?gc(H[be]):li(H[be]);v(null,xe,j,re,Re,ge,B,q,J)}},P=(H,j,re,Re,ge,B,q)=>{const J=j.el=H.el;let{patchFlag:se,dynamicChildren:be,dirs:xe}=j;se|=H.patchFlag&16;const X=H.props||Jt,le=j.props||Jt;let je;if(re&&zu(re,!1),(je=le.onVnodeBeforeUpdate)&&ci(je,re,j,H),xe&&ma(j,H,re,"beforeUpdate"),re&&zu(re,!0),(X.innerHTML&&le.innerHTML==null||X.textContent&&le.textContent==null)&&d(J,""),be?k(H.dynamicChildren,be,J,re,Re,v0(j,ge),B):q||G(H,j,J,null,re,Re,v0(j,ge),B,!1),se>0){if(se&16)L(J,X,le,re,ge);else if(se&2&&X.class!==le.class&&i(J,"class",null,le.class,ge),se&4&&i(J,"style",X.style,le.style,ge),se&8){const Ye=j.dynamicProps;for(let vt=0;vt<Ye.length;vt++){const oe=Ye[vt],ye=X[oe],Fe=le[oe];(Fe!==ye||oe==="value")&&i(J,oe,ye,Fe,ge,re)}}se&1&&H.children!==j.children&&d(J,j.children)}else!q&&be==null&&L(J,X,le,re,ge);((je=le.onVnodeUpdated)||xe)&&Ur(()=>{je&&ci(je,re,j,H),xe&&ma(j,H,re,"updated")},Re)},k=(H,j,re,Re,ge,B,q)=>{for(let J=0;J<j.length;J++){const se=H[J],be=j[J],xe=se.el&&(se.type===kr||!Oo(se,be)||se.shapeFlag&198)?h(se.el):re;v(se,be,xe,null,Re,ge,B,q,!0)}},L=(H,j,re,Re,ge)=>{if(j!==re){if(j!==Jt)for(const B in j)!jl(B)&&!(B in re)&&i(H,B,j[B],null,ge,Re);for(const B in re){if(jl(B))continue;const q=re[B],J=j[B];q!==J&&B!=="value"&&i(H,B,J,q,ge,Re)}"value"in re&&i(H,"value",j.value,re.value,ge)}},M=(H,j,re,Re,ge,B,q,J,se)=>{const be=j.el=H?H.el:a(""),xe=j.anchor=H?H.anchor:a("");let{patchFlag:X,dynamicChildren:le,slotScopeIds:je}=j;je&&(J=J?J.concat(je):je),H==null?(r(be,re,Re),r(xe,re,Re),I(j.children||[],re,xe,ge,B,q,J,se)):X>0&&X&64&&le&&H.dynamicChildren&&H.dynamicChildren.length===le.length?(k(H.dynamicChildren,le,re,ge,B,q,J),(j.key!=null||ge&&j===ge.subTree)&&VP(H,j,!0)):G(H,j,re,xe,ge,B,q,J,se)},V=(H,j,re,Re,ge,B,q,J,se)=>{j.slotScopeIds=J,H==null?j.shapeFlag&512?ge.ctx.activate(j,re,Re,q,se):z(j,re,Re,ge,B,q,se):ie(H,j,se)},z=(H,j,re,Re,ge,B,q)=>{const J=H.component=RU(H,Re,ge);if(J_(H)&&(J.ctx.renderer=Me),kU(J,!1,q),J.asyncDep){if(ge&&ge.registerDep(J,K,q),!H.el){const se=J.subTree=Un(Nr);w(null,se,j,re),H.placeholder=se.el}}else K(J,H,j,re,ge,B,q)},ie=(H,j,re)=>{const Re=j.component=H.component;if(Hee(H,j,re))if(Re.asyncDep&&!Re.asyncResolved){ce(Re,j,re);return}else Re.next=j,Re.update();else j.el=H.el,Re.vnode=j},K=(H,j,re,Re,ge,B,q)=>{const J=()=>{if(H.isMounted){let{next:X,bu:le,u:je,parent:Ye,vnode:vt}=H;{const dt=bU(H);if(dt){X&&(X.el=vt.el,ce(H,X,q)),dt.asyncDep.then(()=>{Ur(()=>{H.isUnmounted||be()},ge)});return}}let oe=X,ye;zu(H,!1),X?(X.el=vt.el,ce(H,X,q)):X=vt,le&&Ad(le),(ye=X.props&&X.props.onVnodeBeforeUpdate)&&ci(ye,Ye,X,vt),zu(H,!0);const Fe=qb(H),ot=H.subTree;H.subTree=Fe,v(ot,Fe,h(ot.el),Y(ot),H,ge,B),X.el=Fe.el,oe===null&&IT(H,Fe.el),je&&Ur(je,ge),(ye=X.props&&X.props.onVnodeUpdated)&&Ur(()=>ci(ye,Ye,X,vt),ge)}else{let X;const{el:le,props:je}=j,{bm:Ye,m:vt,parent:oe,root:ye,type:Fe}=H,ot=Rc(j);if(zu(H,!1),Ye&&Ad(Ye),!ot&&(X=je&&je.onVnodeBeforeMount)&&ci(X,oe,j),zu(H,!0),le&&ut){const dt=()=>{H.subTree=qb(H),ut(le,H.subTree,H,ge,null)};ot&&Fe.__asyncHydrate?Fe.__asyncHydrate(le,H,dt):dt()}else{ye.ce&&ye.ce._hasShadowRoot()&&ye.ce._injectChildStyle(Fe,H.parent?H.parent.type:void 0);const dt=H.subTree=qb(H);v(null,dt,re,Re,H,ge,B),j.el=dt.el}if(vt&&Ur(vt,ge),!ot&&(X=je&&je.onVnodeMounted)){const dt=j;Ur(()=>ci(X,oe,dt),ge)}(j.shapeFlag&256||oe&&Rc(oe.vnode)&&oe.vnode.shapeFlag&256)&&H.a&&Ur(H.a,ge),H.isMounted=!0,j=re=Re=null}};H.scope.on();const se=H.effect=new zg(J);H.scope.off();const be=H.update=se.run.bind(se),xe=H.job=se.runIfDirty.bind(se);xe.i=H,xe.id=H.uid,se.scheduler=()=>wP(xe),zu(H,!0),be()},ce=(H,j,re)=>{j.component=H;const Re=H.vnode.props;H.vnode=j,H.next=null,jee(H,j.props,Re,re),zee(H,j.children,re),Uc(),lx(H),Hc()},G=(H,j,re,Re,ge,B,q,J,se=!1)=>{const be=H&&H.children,xe=H?H.shapeFlag:0,X=j.children,{patchFlag:le,shapeFlag:je}=j;if(le>0){if(le&128){de(be,X,re,Re,ge,B,q,J,se);return}else if(le&256){Z(be,X,re,Re,ge,B,q,J,se);return}}je&8?(xe&16&&Ve(be,ge,B),X!==be&&d(re,X)):xe&16?je&16?de(be,X,re,Re,ge,B,q,J,se):Ve(be,ge,B,!0):(xe&8&&d(re,""),je&16&&I(X,re,Re,ge,B,q,J,se))},Z=(H,j,re,Re,ge,B,q,J,se)=>{H=H||Id,j=j||Id;const be=H.length,xe=j.length,X=Math.min(be,xe);let le;for(le=0;le<X;le++){const je=j[le]=se?gc(j[le]):li(j[le]);v(H[le],je,re,null,ge,B,q,J,se)}be>xe?Ve(H,ge,B,!0,!1,X):I(j,re,Re,ge,B,q,J,se,X)},de=(H,j,re,Re,ge,B,q,J,se)=>{let be=0;const xe=j.length;let X=H.length-1,le=xe-1;for(;be<=X&&be<=le;){const je=H[be],Ye=j[be]=se?gc(j[be]):li(j[be]);if(Oo(je,Ye))v(je,Ye,re,null,ge,B,q,J,se);else break;be++}for(;be<=X&&be<=le;){const je=H[X],Ye=j[le]=se?gc(j[le]):li(j[le]);if(Oo(je,Ye))v(je,Ye,re,null,ge,B,q,J,se);else break;X--,le--}if(be>X){if(be<=le){const je=le+1,Ye=je<xe?j[je].el:Re;for(;be<=le;)v(null,j[be]=se?gc(j[be]):li(j[be]),re,Ye,ge,B,q,J,se),be++}}else if(be>le)for(;be<=X;)ee(H[be],ge,B,!0),be++;else{const je=be,Ye=be,vt=new Map;for(be=Ye;be<=le;be++){const kn=j[be]=se?gc(j[be]):li(j[be]);kn.key!=null&&vt.set(kn.key,be)}let oe,ye=0;const Fe=le-Ye+1;let ot=!1,dt=0;const Vr=new Array(Fe);for(be=0;be<Fe;be++)Vr[be]=0;for(be=je;be<=X;be++){const kn=H[be];if(ye>=Fe){ee(kn,ge,B,!0);continue}let Tr;if(kn.key!=null)Tr=vt.get(kn.key);else for(oe=Ye;oe<=le;oe++)if(Vr[oe-Ye]===0&&Oo(kn,j[oe])){Tr=oe;break}Tr===void 0?ee(kn,ge,B,!0):(Vr[Tr-Ye]=be+1,Tr>=dt?dt=Tr:ot=!0,v(kn,j[Tr],re,null,ge,B,q,J,se),ye++)}const jn=ot?Yee(Vr):Id;for(oe=jn.length-1,be=Fe-1;be>=0;be--){const kn=Ye+be,Tr=j[kn],wo=j[kn+1],Ga=kn+1<xe?wo.el||wU(wo):Re;Vr[be]===0?v(null,Tr,re,Ga,ge,B,q,J,se):ot&&(oe<0||be!==jn[oe]?fe(Tr,re,Ga,2):oe--)}}},fe=(H,j,re,Re,ge=null)=>{const{el:B,type:q,transition:J,children:se,shapeFlag:be}=H;if(be&6){fe(H.component.subTree,j,re,Re);return}if(be&128){H.suspense.move(j,re,Re);return}if(be&64){q.move(H,j,re,Me);return}if(q===kr){r(B,j,re);for(let X=0;X<se.length;X++)fe(se[X],j,re,Re);r(H.anchor,j,re);return}if(q===kd){T(H,j,re);return}if(Re!==2&&be&1&&J)if(Re===0)J.persisted&&!B[io]?r(B,j,re):(J.beforeEnter(B),r(B,j,re),Ur(()=>J.enter(B),ge));else{const{leave:X,delayLeave:le,afterLeave:je}=J,Ye=()=>{H.ctx.isUnmounted?s(B):r(B,j,re)},vt=()=>{const oe=B._isLeaving||!!B[io];B._isLeaving&&B[io](!0),J.persisted&&!oe?Ye():X(B,()=>{Ye(),je&&je()})};le?le(B,Ye,vt):vt()}else r(B,j,re)},ee=(H,j,re,Re=!1,ge=!1)=>{const{type:B,props:q,ref:J,children:se,dynamicChildren:be,shapeFlag:xe,patchFlag:X,dirs:le,cacheIndex:je,memo:Ye}=H;if(X===-2&&(ge=!1),J!=null&&(Uc(),_f(J,null,re,H,!0),Hc()),je!=null&&(j.renderCache[je]=void 0),xe&256){j.ctx.deactivate(H);return}const vt=xe&1&&le,oe=!Rc(H);let ye;if(oe&&(ye=q&&q.onVnodeBeforeUnmount)&&ci(ye,j,H),xe&6)Ce(H.component,re,Re);else{if(xe&128){H.suspense.unmount(re,Re);return}vt&&ma(H,null,j,"beforeUnmount"),xe&64?H.type.remove(H,j,re,Me,Re):be&&!be.hasOnce&&(B!==kr||X>0&&X&64)?Ve(be,j,re,!1,!0):(B===kr&&X&384||!ge&&xe&16)&&Ve(se,j,re),Re&&Te(H)}const Fe=Ye!=null&&je==null;(oe&&(ye=q&&q.onVnodeUnmounted)||vt||Fe)&&Ur(()=>{ye&&ci(ye,j,H),vt&&ma(H,null,j,"unmounted"),Fe&&(H.el=null)},re)},Te=H=>{const{type:j,el:re,anchor:Re,transition:ge}=H;if(j===kr){pe(re,Re);return}if(j===kd){R(H);return}const B=()=>{s(re),ge&&!ge.persisted&&ge.afterLeave&&ge.afterLeave()};if(H.shapeFlag&1&&ge&&!ge.persisted){const{leave:q,delayLeave:J}=ge,se=()=>q(re,B);J?J(H.el,B,se):se()}else B()},pe=(H,j)=>{let re;for(;H!==j;)re=p(H),s(H),H=re;s(j)},Ce=(H,j,re)=>{const{bum:Re,scope:ge,job:B,subTree:q,um:J,m:se,a:be}=H;Pw(se),Pw(be),Re&&Ad(Re),ge.stop(),B&&(B.flags|=8,ee(q,H,j,re)),J&&Ur(J,j),Ur(()=>{H.isUnmounted=!0},j)},Ve=(H,j,re,Re=!1,ge=!1,B=0)=>{for(let q=B;q<H.length;q++)ee(H[q],j,re,Re,ge)},Y=H=>{if(H.shapeFlag&6)return Y(H.component.subTree);if(H.shapeFlag&128)return H.suspense.next();const j=p(H.anchor||H.el),re=j&&j[q$];return re?p(re):j};let ve=!1;const Ee=(H,j,re)=>{let Re;H==null?j._vnode&&(ee(j._vnode,null,null,!0),Re=j._vnode.component):v(j._vnode||null,H,j,null,null,null,re),j._vnode=H,ve||(ve=!0,lx(Re),Cw(),ve=!1)},Me={p:v,um:ee,m:fe,r:Te,mt:z,mc:I,pc:G,pbc:k,n:Y,o:t};let Ke,ut;return e&&([Ke,ut]=e(Me)),{render:Ee,hydrate:Ke,createApp:Lee(Ee,Ke)}}function v0({type:t,props:e},n){return n==="svg"&&t==="foreignObject"||n==="mathml"&&t==="annotation-xml"&&e&&e.encoding&&e.encoding.includes("html")?void 0:n}function zu({effect:t,job:e},n){n?(t.flags|=32,e.flags|=4):(t.flags&=-33,e.flags&=-5)}function vU(t,e){return(!t||t&&!t.pendingBranch)&&e&&!e.persisted}function VP(t,e,n=!1){const r=t.children,s=e.children;if(rt(r)&&rt(s))for(let i=0;i<r.length;i++){const o=r[i];let a=s[i];a.shapeFlag&1&&!a.dynamicChildren&&((a.patchFlag<=0||a.patchFlag===32)&&(a=s[i]=gc(s[i]),a.el=o.el),!n&&a.patchFlag!==-2&&VP(o,a)),a.type===Pc&&(a.patchFlag===-1&&(a=s[i]=gc(a)),a.el=o.el),a.type===Nr&&!a.el&&(a.el=o.el)}}function Yee(t){const e=t.slice(),n=[0];let r,s,i,o,a;const c=t.length;for(r=0;r<c;r++){const l=t[r];if(l!==0){if(s=n[n.length-1],t[s]<l){e[r]=s,n.push(r);continue}for(i=0,o=n.length-1;i<o;)a=i+o>>1,t[n[a]]<l?i=a+1:o=a;l<t[n[i]]&&(i>0&&(e[r]=n[i-1]),n[i]=r)}}for(i=n.length,o=n[i-1];i-- >0;)n[i]=o,o=e[o];return n}function bU(t){const e=t.subTree.component;if(e)return e.asyncDep&&!e.asyncResolved?e:bU(e)}function Pw(t){if(t)for(let e=0;e<t.length;e++)t[e].flags|=8}function wU(t){if(t.placeholder)return t.placeholder;const e=t.component;return e?wU(e.subTree):null}const kw=t=>t.__isSuspense;let tA=0;const Jee={name:"Suspense",__isSuspense:!0,process(t,e,n,r,s,i,o,a,c,l){if(t==null)Qee(e,n,r,s,i,o,a,c,l);else{if(i&&i.deps>0&&!t.suspense.isInFallback){e.suspense=t.suspense,e.suspense.vnode=e,e.el=t.el;return}Xee(t,e,n,r,s,o,a,c,l)}},hydrate:Zee,normalize:ete},CT=Jee;function e_(t,e){const n=t.props&&t.props[e];yt(n)&&n()}function Qee(t,e,n,r,s,i,o,a,c){const{p:l,o:{createElement:d}}=c,h=d("div"),p=t.suspense=SU(t,s,r,e,h,n,i,o,a,c);l(null,p.pendingBranch=t.ssContent,h,null,r,p,i,o),p.deps>0?(e_(t,"onPending"),e_(t,"onFallback"),l(null,t.ssFallback,e,n,r,null,i,o),yf(p,t.ssFallback)):p.resolve(!1,!0)}function Xee(t,e,n,r,s,i,o,a,{p:c,um:l,o:{createElement:d}}){const h=e.suspense=t.suspense;h.vnode=e,e.el=t.el;const p=e.ssContent,g=e.ssFallback,{activeBranch:_,pendingBranch:v,isInFallback:b,isHydrating:w}=h;if(v)h.pendingBranch=p,Oo(v,p)?(c(v,p,h.hiddenContainer,null,s,h,i,o,a),h.deps<=0?h.resolve():b&&(w||(c(_,g,n,r,s,null,i,o,a),yf(h,g)))):(h.pendingId=tA++,w?(h.isHydrating=!1,h.activeBranch=v):l(v,s,h),h.deps=0,h.effects.length=0,h.hiddenContainer=d("div"),b?(c(null,p,h.hiddenContainer,null,s,h,i,o,a),h.deps<=0?h.resolve():(c(_,g,n,r,s,null,i,o,a),yf(h,g))):_&&Oo(_,p)?(c(_,p,n,r,s,h,i,o,a),h.resolve(!0)):(c(null,p,h.hiddenContainer,null,s,h,i,o,a),h.deps<=0&&h.resolve()));else if(_&&Oo(_,p))c(_,p,n,r,s,h,i,o,a),yf(h,p);else if(e_(e,"onPending"),h.pendingBranch=p,p.shapeFlag&512?h.pendingId=p.component.suspenseId:h.pendingId=tA++,c(null,p,h.hiddenContainer,null,s,h,i,o,a),h.deps<=0)h.resolve();else{const{timeout:E,pendingId:T}=h;E>0?setTimeout(()=>{h.pendingId===T&&h.fallback(g)},E):E===0&&h.fallback(g)}}function SU(t,e,n,r,s,i,o,a,c,l,d=!1){const{p:h,m:p,um:g,n:_,o:{parentNode:v,remove:b}}=l;let w;const E=tte(t);E&&e&&e.pendingBranch&&(w=e.pendingId,e.deps++);const T=t.props?Kg(t.props.timeout):void 0,R=i,N={vnode:t,parent:e,parentComponent:n,namespace:o,container:r,hiddenContainer:s,deps:0,pendingId:tA++,timeout:typeof T=="number"?T:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!d,isHydrating:d,isUnmounted:!1,effects:[],resolve(O=!1,S=!1){const{vnode:I,activeBranch:P,pendingBranch:k,pendingId:L,effects:M,parentComponent:V,container:z,isInFallback:ie}=N;let K=!1;if(N.isHydrating)N.isHydrating=!1;else if(!O){K=P&&k.transition&&k.transition.mode==="out-in";let Z=!1;K&&(P.transition.afterLeave=()=>{L===N.pendingId&&(p(k,z,i===R&&!Z?_(P):i,0),Ud(M),ie&&I.ssFallback&&(I.ssFallback.el=null))}),P&&!N.isFallbackMountPending&&(v(P.el)===z&&(i=_(P),Z=!0),g(P,V,N,!0),!K&&ie&&I.ssFallback&&Ur(()=>I.ssFallback.el=null,N)),K||p(k,z,i,0)}N.isFallbackMountPending=!1,yf(N,k),N.pendingBranch=null,N.isInFallback=!1;let ce=N.parent,G=!1;for(;ce;){if(ce.pendingBranch){ce.effects.push(...M),G=!0;break}ce=ce.parent}!G&&!K&&Ud(M),N.effects=[],E&&e&&e.pendingBranch&&w===e.pendingId&&(e.deps--,e.deps===0&&!S&&e.resolve()),e_(I,"onResolve")},fallback(O){if(!N.pendingBranch)return;const{vnode:S,activeBranch:I,parentComponent:P,container:k,namespace:L}=N;e_(S,"onFallback");const M=_(I),V=()=>{N.isFallbackMountPending=!1,N.isInFallback&&(h(null,O,k,M,P,null,L,a,
vendor: 15,065 bytes, line 5
5c),yf(N,O))},z=O.transition&&O.transition.mode==="out-in";z&&(N.isFallbackMountPending=!0,I.transition.afterLeave=V),N.isInFallback=!0,g(I,P,null,!0),z||V()},move(O,S,I){N.activeBranch&&p(N.activeBranch,O,S,I),N.container=O},next(){return N.activeBranch&&_(N.activeBranch)},registerDep(O,S,I){const P=!!N.pendingBranch;P&&N.deps++;const k=O.vnode.el;O.asyncDep.catch(L=>{ah(L,O,0)}).then(L=>{if(O.isUnmounted||N.isUnmounted||N.pendingId!==O.suspenseId)return;n_(),O.asyncResolved=!0;const{vnode:M}=O;nA(O,L,!1),k&&(M.el=k);const V=!k&&O.subTree.el;S(O,M,v(k||O.subTree.el),k?null:_(O.subTree),N,o,I),V&&(M.placeholder=null,b(V)),IT(O,M.el),P&&--N.deps===0&&N.resolve()})},unmount(O,S){N.isUnmounted=!0,N.activeBranch&&g(N.activeBranch,n,O,S),N.pendingBranch&&g(N.pendingBranch,n,O,S)}};return N}function Zee(t,e,n,r,s,i,o,a,c){const l=e.suspense=SU(e,r,n,t.parentNode,document.createElement("div"),null,s,i,o,a,!0),d=c(t,l.pendingBranch=e.ssContent,n,l,i,o);return l.deps===0&&l.resolve(!1,!0),d}function ete(t){const{shapeFlag:e,children:n}=t,r=e&32;t.ssContent=Tx(r?n.default:n),t.ssFallback=r?Tx(n.fallback):Un(Nr)}function Tx(t){let e;if(yt(t)){const n=Hd&&t._c;n&&(t._d=!1,ls()),t=t(),n&&(t._d=!0,e=ks,EU())}return rt(t)&&(t=Bee(t)),t=li(t),e&&!t.dynamicChildren&&(t.dynamicChildren=e.filter(n=>n!==t)),t}function TU(t,e){e&&e.pendingBranch?rt(t)?e.effects.push(...t):e.effects.push(t):Ud(t)}function yf(t,e){t.activeBranch=e;const{vnode:n,parentComponent:r}=t;let s=e.el;for(;!s&&e.component;)e=e.component.subTree,s=e.el;n.el=s,r&&r.subTree===n&&(r.vnode.el=s,IT(r,s))}function tte(t){const e=t.props&&t.props.suspensible;return e!=null&&e!==!1}const kr=Symbol.for("v-fgt"),Pc=Symbol.for("v-txt"),Nr=Symbol.for("v-cmt"),kd=Symbol.for("v-stc"),bg=[];let ks=null;function ls(t=!1){bg.push(ks=t?null:[])}function EU(){bg.pop(),ks=bg[bg.length-1]||null}let Hd=1;function t_(t,e=!1){Hd+=t,t<0&&ks&&e&&(ks.hasOnce=!0)}function IU(t){return t.dynamicChildren=Hd>0?ks||Id:null,EU(),Hd>0&&ks&&ks.push(t),t}function Ll(t,e,n,r,s,i){return IU(Br(t,e,n,r,s,i,!0))}function Do(t,e,n,r,s){return IU(Un(t,e,n,r,s,!0))}function jc(t){return t?t.__v_isVNode===!0:!1}function Oo(t,e){return t.type===e.type&&t.key===e.key}function nte(t){}const CU=({key:t})=>t??null,jb=({ref:t,ref_key:e,ref_for:n})=>(typeof t=="number"&&(t=""+t),t!=null?vn(t)||Pn(t)||yt(t)?{i:ys,r:t,k:e,f:!!n}:t:null);function Br(t,e=null,n=null,r=0,s=null,i=t===kr?0:1,o=!1,a=!1){const c={__v_isVNode:!0,__v_skip:!0,type:t,props:e,key:e&&CU(e),ref:e&&jb(e),scopeId:bT,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:s,dynamicChildren:null,appContext:null,ctx:ys};return a?($P(c,n),i&128&&t.normalize(c)):n&&(c.shapeFlag|=vn(n)?8:16),Hd>0&&!o&&ks&&(c.patchFlag>0||i&6)&&c.patchFlag!==32&&ks.push(c),c}const Un=rte;function rte(t,e=null,n=null,r=0,s=null,i=!1){if((!t||t===eU)&&(t=Nr),jc(t)){const a=gi(t,e,!0);return n&&$P(a,n),Hd>0&&!i&&ks&&(a.shapeFlag&6?ks[ks.indexOf(t)]=a:ks.push(a)),a.patchFlag=-2,a}if(ute(t)&&(t=t.__vccOpts),e){e=FP(e);let{class:a,style:c}=e;a&&!vn(a)&&(e.class=cu(a)),fn(c)&&(K_(c)&&!rt(c)&&(c=Rn({},c)),e.style=yp(c))}const o=vn(t)?1:kw(t)?128:j$(t)?64:fn(t)?4:yt(t)?2:0;return Br(t,e,n,r,s,o,i,!0)}function FP(t){return t?K_(t)||uU(t)?Rn({},t):t:null}function gi(t,e,n=!1,r=!1){const{props:s,ref:i,patchFlag:o,children:a,transition:c}=t,l=e?UP(s||{},e):s,d={__v_isVNode:!0,__v_skip:!0,type:t.type,props:l,key:l&&CU(l),ref:e&&e.ref?n&&i?rt(i)?i.concat(jb(e)):[i,jb(e)]:jb(e):i,scopeId:t.scopeId,slotScopeIds:t.slotScopeIds,children:a,target:t.target,targetStart:t.targetStart,targetAnchor:t.targetAnchor,staticCount:t.staticCount,shapeFlag:t.shapeFlag,patchFlag:e&&t.type!==kr?o===-1?16:o|16:o,dynamicProps:t.dynamicProps,dynamicChildren:t.dynamicChildren,appContext:t.appContext,dirs:t.dirs,transition:c,component:t.component,suspense:t.suspense,ssContent:t.ssContent&&gi(t.ssContent),ssFallback:t.ssFallback&&gi(t.ssFallback),placeholder:t.placeholder,el:t.el,anchor:t.anchor,ctx:t.ctx,ce:t.ce};return c&&r&&qc(d,c.clone(d)),d}function BP(t=" ",e=0){return Un(Pc,null,t,e)}function AU(t,e){const n=Un(kd,null,t);return n.staticCount=e,n}function Nw(t="",e=!1){return e?(ls(),Do(Nr,null,t)):Un(Nr,null,t)}function li(t){return t==null||typeof t=="boolean"?Un(Nr):rt(t)?Un(kr,null,t.slice()):jc(t)?gc(t):Un(Pc,null,String(t))}function gc(t){return t.el===null&&t.patchFlag!==-1||t.memo?t:gi(t)}function $P(t,e){let n=0;const{shapeFlag:r}=t;if(e==null)e=null;else if(rt(e))n=16;else if(typeof e=="object")if(r&65){const s=e.default;s&&(s._c&&(s._d=!1),$P(t,s()),s._c&&(s._d=!0));return}else{n=32;const s=e._;!s&&!uU(e)?e._ctx=ys:s===3&&ys&&(ys.slots._===1?e._=1:(e._=2,t.patchFlag|=1024))}else yt(e)?(e={default:e,_ctx:ys},n=32):(e=String(e),r&64?(n=16,e=[BP(e)]):n=8);t.children=e,t.shapeFlag|=n}function UP(...t){const e={};for(let n=0;n<t.length;n++){const r=t[n];for(const s in r)if(s==="class")e.class!==r.class&&(e.class=cu([e.class,r.class]));else if(s==="style")e.style=yp([e.style,r.style]);else if(mp(s)){const i=e[s],o=r[s];o&&i!==o&&!(rt(i)&&i.includes(o))?e[s]=i?[].concat(i,o):o:o==null&&i==null&&!U_(s)&&(e[s]=o)}else s!==""&&(e[s]=r[s])}return e}function ci(t,e,n,r=null){$i(t,e,7,[n,r])}const ste=sU();let ite=0;function RU(t,e,n){const r=t.type,s=(e?e.appContext:t.appContext)||ste,i={uid:ite++,vnode:t,type:r,parent:e,appContext:s,root:null,next:null,subTree:null,effect:null,update:null,job:null,scope:new gP(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:e?e.provides:Object.create(s.provides),ids:e?e.ids:["",0,0],accessCache:null,renderCache:[],components:null,directives:null,propsOptions:hU(r,s),emitsOptions:oU(r,s),emit:null,emitted:null,propsDefaults:Jt,inheritAttrs:r.inheritAttrs,ctx:Jt,data:Jt,props:Jt,attrs:Jt,slots:Jt,refs:Jt,setupState:Jt,setupContext:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return i.ctx={_:i},i.root=e?e.root:i,i.emit=Vee.bind(null,i),t.ce&&t.ce(i),i}let gs=null;const Sr=()=>gs||ys;let Dw,vf;{const t=W_(),e=(n,r)=>{let s;return(s=t[n])||(s=t[n]=[]),s.push(r),i=>{s.length>1?s.forEach(o=>o(i)):s[0](i)}};Dw=e("__VUE_INSTANCE_SETTERS__",n=>gs=n),vf=e("__VUE_SSR_SETTERS__",n=>qd=n)}const Ep=t=>{const e=gs;return Dw(t),t.scope.on(),()=>{t.scope.off(),Dw(e)}},n_=()=>{gs&&gs.scope.off(),Dw(null)};function PU(t){return t.vnode.shapeFlag&4}let qd=!1;function kU(t,e=!1,n=!1){e&&vf(e);const{props:r,children:s}=t.vnode,i=PU(t);qee(t,r,i,e),Kee(t,s,n||e);const o=i?ote(t,e):void 0;return e&&vf(!1),o}function ote(t,e){const n=t.type;t.accessCache=Object.create(null),t.proxy=new Proxy(t.ctx,QC);const{setup:r}=n;if(r){Uc();const s=t.setupContext=r.length>1?DU(t):null,i=Ep(t),o=bp(r,t,0,[t.props,s]),a=H_(o);if(Hc(),i(),(a||t.sp)&&!Rc(t)&&IP(t),a){if(o.then(n_,n_),e)return o.then(c=>{nA(t,c,e)}).catch(c=>{ah(c,t,0)});t.asyncDep=o}else nA(t,o,e)}else NU(t,e)}function nA(t,e,n){yt(e)?t.type.__ssrInlineRender?t.ssrRender=e:t.render=e:fn(e)&&(t.setupState=bP(e)),NU(t,n)}let Ow,rA;function ate(t){Ow=t,rA=e=>{e.render._rc&&(e.withProxy=new Proxy(e.ctx,mee))}}const cte=()=>!Ow;function NU(t,e,n){const r=t.type;if(!t.render){if(!e&&Ow&&!r.render){const s=r.template||xP(t).template;if(s){const{isCustomElement:i,compilerOptions:o}=t.appContext.config,{delimiters:a,compilerOptions:c}=r,l=Rn(Rn({isCustomElement:i,delimiters:a},o),c);r.render=Ow(s,l)}}t.render=r.render||Vi,rA&&rA(t)}{const s=Ep(t);Uc();try{Pee(t)}finally{Hc(),s()}}}const lte={get(t,e){return Cs(t,"get",""),t[e]}};function DU(t){const e=n=>{t.exposed=n||{}};return{attrs:new Proxy(t.attrs,lte),slots:t.slots,emit:t.emit,expose:e}}function Q_(t){return t.exposed?t.exposeProxy||(t.exposeProxy=new Proxy(bP(yT(t.exposed)),{get(e,n){if(n in e)return e[n];if(n in vg)return vg[n](t)},has(e,n){return n in e||n in vg}})):t.proxy}function sA(t,e=!0){return yt(t)?t.displayName||t.name:t.name||e&&t.__name}function ute(t){return yt(t)&&"__vccOpts"in t}const $e=(t,e)=>EZ(t,e,qd);function On(t,e,n){try{t_(-1);const r=arguments.length;return r===2?fn(e)&&!rt(e)?jc(e)?Un(t,null,[e]):Un(t,e):Un(t,null,e):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&jc(n)&&(n=[n]),Un(t,e,n))}finally{t_(1)}}function dte(){}function hte(t,e,n,r){const s=n[r];if(s&&OU(s,t))return s;const i=e();return i.memo=t.slice(),i.cacheIndex=r,n[r]=i}function OU(t,e){const n=t.memo;if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(cs(n[r],e[r]))return!1;return Hd>0&&ks&&ks.push(t),!0}const xU="3.5.35",fte=Vi,pte=OZ,mte=tf,gte=F$,_te={createComponentInstance:RU,setupComponent:kU,renderComponentRoot:qb,setCurrentRenderingInstance:Xg,isVNode:jc,normalizeVNode:li,getComponentPublicInstance:Q_,ensureValidVNode:OP,pushWarningContext:PZ,popWarningContext:kZ},yte=_te,vte=null,bte=null,wte=null;let iA;const Ex=typeof window<"u"&&window.trustedTypes;if(Ex)try{iA=Ex.createPolicy("vue",{createHTML:t=>t})}catch{}const LU=iA?t=>iA.createHTML(t):t=>t,Ste="http://www.w3.org/2000/svg",Tte="http://www.w3.org/1998/Math/MathML",fc=typeof document<"u"?document:null,Ix=fc&&fc.createElement("template"),MU={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,r)=>{const s=e==="svg"?fc.createElementNS(Ste,t):e==="mathml"?fc.createElementNS(Tte,t):n?fc.createElement(t,{is:n}):fc.createElement(t);return t==="select"&&r&&r.multiple!=null&&s.setAttribute("multiple",r.multiple),s},createText:t=>fc.createTextNode(t),createComment:t=>fc.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>fc.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,r,s,i){const o=n?n.previousSibling:e.lastChild;if(s&&(s===i||s.nextSibling))for(;e.insertBefore(s.cloneNode(!0),n),!(s===i||!(s=s.nextSibling)););else{Ix.innerHTML=LU(r==="svg"?`<svg>${t}</svg>`:r==="mathml"?`<math>${t}</math>`:t);const a=Ix.content;if(r==="svg"||r==="mathml"){const c=a.firstChild;for(;c.firstChild;)a.appendChild(c.firstChild);a.removeChild(c)}e.insertBefore(a,n)}return[o?o.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},Sl="transition",$m="animation",Of=Symbol("_vtc"),VU={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},FU=Rn({},EP,VU),Ete=t=>(t.displayName="Transition",t.props=FU,t),BU=Ete((t,{slots:e})=>On(K$,$U(t),e)),Yu=(t,e=[])=>{rt(t)?t.forEach(n=>n(...e)):t&&t(...e)},Cx=t=>t?rt(t)?t.some(e=>e.length>1):t.length>1:!1;function $U(t){const e={};for(const M in t)M in VU||(e[M]=t[M]);if(t.css===!1)return e;const{name:n="v",type:r,duration:s,enterFromClass:i=`${n}-enter-from`,enterActiveClass:o=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:c=i,appearActiveClass:l=o,appearToClass:d=a,leaveFromClass:h=`${n}-leave-from`,leaveActiveClass:p=`${n}-leave-active`,leaveToClass:g=`${n}-leave-to`}=t,_=Ite(s),v=_&&_[0],b=_&&_[1],{onBeforeEnter:w,onEnter:E,onEnterCancelled:T,onLeave:R,onLeaveCancelled:N,onBeforeAppear:O=w,onAppear:S=E,onAppearCancelled:I=T}=e,P=(M,V,z,ie)=>{M._enterCancelled=ie,kl(M,V?d:a),kl(M,V?l:o),z&&z()},k=(M,V)=>{M._isLeaving=!1,kl(M,h),kl(M,g),kl(M,p),V&&V()},L=M=>(V,z)=>{const ie=M?S:E,K=()=>P(V,M,z);Yu(ie,[V,K]),Ax(()=>{kl(V,M?c:i),fa(V,M?d:a),Cx(ie)||Rx(V,r,v,K)})};return Rn(e,{onBeforeEnter(M){Yu(w,[M]),fa(M,i),fa(M,o)},onBeforeAppear(M){Yu(O,[M]),fa(M,c),fa(M,l)},onEnter:L(!1),onAppear:L(!0),onLeave(M,V){M._isLeaving=!0;const z=()=>k(M,V);fa(M,h),M._enterCancelled?(fa(M,p),oA(M)):(oA(M),fa(M,p)),Ax(()=>{M._isLeaving&&(kl(M,h),fa(M,g),Cx(R)||Rx(M,r,b,z))}),Yu(R,[M,z])},onEnterCancelled(M){P(M,!1,void 0,!0),Yu(T,[M])},onAppearCancelled(M){P(M,!0,void 0,!0),Yu(I,[M])},onLeaveCancelled(M){k(M),Yu(N,[M])}})}function Ite(t){if(t==null)return null;if(fn(t))return[b0(t.enter),b0(t.leave)];{const e=b0(t);return[e,e]}}function b0(t){return Kg(t)}function fa(t,e){e.split(/\s+/).forEach(n=>n&&t.classList.add(n)),(t[Of]||(t[Of]=new Set)).add(e)}function kl(t,e){e.split(/\s+/).forEach(r=>r&&t.classList.remove(r));const n=t[Of];n&&(n.delete(e),n.size||(t[Of]=void 0))}function Ax(t){requestAnimationFrame(()=>{requestAnimationFrame(t)})}let Cte=0;function Rx(t,e,n,r){const s=t._endId=++Cte,i=()=>{s===t._endId&&r()};if(n!=null)return setTimeout(i,n);const{type:o,timeout:a,propCount:c}=UU(t,e);if(!o)return r();const l=o+"end";let d=0;const h=()=>{t.removeEventListener(l,p),i()},p=g=>{g.target===t&&++d>=c&&h()};setTimeout(()=>{d<c&&h()},a+1),t.addEventListener(l,p)}function UU(t,e){const n=window.getComputedStyle(t),r=_=>(n[_]||"").split(", "),s=r(`${Sl}Delay`),i=r(`${Sl}Duration`),o=Px(s,i),a=r(`${$m}Delay`),c=r(`${$m}Duration`),l=Px(a,c);let d=null,h=0,p=0;e===Sl?o>0&&(d=Sl,h=o,p=i.length):e===$m?l>0&&(d=$m,h=l,p=c.length):(h=Math.max(o,l),d=h>0?o>l?Sl:$m:null,p=d?d===Sl?i.length:c.length:0);const g=d===Sl&&/\b(?:transform|all)(?:,|$)/.test(r(`${Sl}Property`).toString());return{type:d,timeout:h,propCount:p,hasTransform:g}}function Px(t,e){for(;t.length<e.length;)t=t.concat(t);return Math.max(...e.map((n,r)=>kx(n)+kx(t[r])))}function kx(t){return t==="auto"?0:Number(t.slice(0,-1).replace(",","."))*1e3}function oA(t){return(t?t.ownerDocument:document).body.offsetHeight}function Ate(t,e,n){const r=t[Of];r&&(e=(e?[e,...r]:[...r]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const xw=Symbol("_vod"),HU=Symbol("_vsh"),qU={name:"show",beforeMount(t,{value:e},{transition:n}){t[xw]=t.style.display==="none"?"":t.style.display,n&&e?n.beforeEnter(t):Um(t,e)},mounted(t,{value:e},{transition:n}){n&&e&&n.enter(t)},updated(t,{value:e,oldValue:n},{transition:r}){!e!=!n&&(r?e?(r.beforeEnter(t),Um(t,!0),r.enter(t)):r.leave(t,()=>{Um(t,!1)}):Um(t,e))},beforeUnmount(t,{value:e}){Um(t,e)}};function Um(t,e){t.style.display=e?t[xw]:"none",t[HU]=!e}function Rte(){qU.getSSRProps=({value:t})=>{if(!t)return{style:{display:"none"}}}}const jU=Symbol("");function Pte(t){const e=Sr();if(!e)return;const n=e.ut=(s=t(e.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${e.uid}"]`)).forEach(i=>Lw(i,s))},r=()=>{const s=t(e.proxy);e.ce?Lw(e.ce,s):aA(e.subTree,s),n(s)};PP(()=>{Ud(r)}),ka(()=>{ft(r,Vi,{flush:"post"});const s=new MutationObserver(r);s.observe(e.subTree.el.parentNode,{childList:!0}),Tp(()=>s.disconnect())})}function aA(t,e){if(t.shapeFlag&128){const n=t.suspense;t=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{aA(n.activeBranch,e)})}for(;t.component;)t=t.component.subTree;if(t.shapeFlag&1&&t.el)Lw(t.el,e);
5else if(t.type===kr)t.children.forEach(n=>aA(n,e));else if(t.type===kd){let{el:n,anchor:r}=t;for(;n&&(Lw(n,e),n!==r);)n=n.nextSibling}}function Lw(t,e){if(t.nodeType===1){const n=t.style;let r="";for(const s in e){const i=p$(e[s]);n.setProperty(`--${s}`,i),r+=`--${s}: ${i};`}n[jU]=r}}const kte=/(?:^|;)\s*display\s*:/;function Nte(t,e,n){const r=t.style,s=vn(n);let i=!1;if(n&&!s){if(e)if(vn(e))for(const o of e.split(";")){const a=o.slice(0,o.indexOf(":")).trim();n[a]==null&&ag(r,a,"")}else for(const o in e)n[o]==null&&ag(r,o,"");for(const o in n){o==="display"&&(i=!0);const a=n[o];a!=null?Ote(t,o,!vn(e)&&e?e[o]:void 0,a)||ag(r,o,a):ag(r,o,"")}}else if(s){if(e!==n){const o=r[jU];o&&(n+=";"+o),r.cssText=n,i=kte.test(n)}}else e&&t.removeAttribute("style");xw in t&&(t[xw]=i?r.display:"",t[HU]&&(r.display="none"))}const Nx=/\s*!important$/;function ag(t,e,n){if(rt(n))n.forEach(r=>ag(t,e,r));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const r=Dte(t,e);Nx.test(n)?t.setProperty(Rs(r),n.replace(Nx,""),"important"):t[r]=n}}const Dx=["Webkit","Moz","ms"],w0={};function Dte(t,e){const n=w0[e];if(n)return n;let r=xr(e);if(r!=="filter"&&r in t)return w0[e]=r;r=_p(r);for(let s=0;s<Dx.length;s++){const i=Dx[s]+r;if(i in t)return w0[e]=i}return e}function Ote(t,e,n,r){return t.tagName==="TEXTAREA"&&(e==="width"||e==="height")&&vn(r)&&n===r}const Ox="http://www.w3.org/1999/xlink";function xx(t,e,n,r,s,i=u$(e)){r&&e.startsWith("xlink:")?n==null?t.removeAttributeNS(Ox,e.slice(6,e.length)):t.setAttributeNS(Ox,e,n):n==null||i&&!mP(n)?t.removeAttribute(e):t.setAttribute(e,i?"":Si(n)?String(n):n)}function Lx(t,e,n,r,s){if(e==="innerHTML"||e==="textContent"){n!=null&&(t[e]=e==="innerHTML"?LU(n):n);return}const i=t.tagName;if(e==="value"&&i!=="PROGRESS"&&!i.includes("-")){const a=i==="OPTION"?t.getAttribute("value")||"":t.value,c=n==null?t.type==="checkbox"?"on":"":String(n);(a!==c||!("_value"in t))&&(t.value=c),n==null&&t.removeAttribute(e),t._value=n;return}let o=!1;if(n===""||n==null){const a=typeof t[e];a==="boolean"?n=mP(n):n==null&&a==="string"?(n="",o=!0):a==="number"&&(n=0,o=!0)}try{t[e]=n}catch{}o&&t.removeAttribute(s||e)}function vc(t,e,n,r){t.addEventListener(e,n,r)}function xte(t,e,n,r){t.removeEventListener(e,n,r)}const Mx=Symbol("_vei");function Lte(t,e,n,r,s=null){const i=t[Mx]||(t[Mx]={}),o=i[e];if(r&&o)o.value=r;else{const[a,c]=Mte(e);
vendor: 5,621 bytes, line 5
5if(r){const l=i[e]=Bte(r,s);vc(t,a,l,c)}else o&&(xte(t,a,o,c),i[e]=void 0)}}const Vx=/(?:Once|Passive|Capture)$/;function Mte(t){let e;if(Vx.test(t)){e={};let r;for(;r=t.match(Vx);)t=t.slice(0,t.length-r[0].length),e[r[0].toLowerCase()]=!0}return[t[2]===":"?t.slice(3):Rs(t.slice(2)),e]}let S0=0;const Vte=Promise.resolve(),Fte=()=>S0||(Vte.then(()=>S0=0),S0=Date.now());function Bte(t,e){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;const s=n.value;if(rt(s)){const i=r.stopImmediatePropagation;r.stopImmediatePropagation=()=>{i.call(r),r._stopped=!0};const o=s.slice(),a=[r];for(let c=0;c<o.length&&!r._stopped;c++){const l=o[c];l&&$i(l,e,5,a)}}else $i(s,e,5,[r])};return n.value=t,n.attached=Fte(),n}const Fx=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,WU=(t,e,n,r,s,i)=>{const o=s==="svg";e==="class"?Ate(t,r,o):e==="style"?Nte(t,n,r):mp(e)?U_(e)||Lte(t,e,n,r,i):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):$te(t,e,r,o))?(Lx(t,e,r),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&xx(t,e,r,o,i,e!=="value")):t._isVueCE&&(Ute(t,e)||t._def.__asyncLoader&&(/[A-Z]/.test(e)||!vn(r)))?Lx(t,xr(e),r,i,e):(e==="true-value"?t._trueValue=r:e==="false-value"&&(t._falseValue=r),xx(t,e,r,o))};function $te(t,e,n,r){if(r)return!!(e==="innerHTML"||e==="textContent"||e in t&&Fx(e)&&yt(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="autocorrect"||e==="sandbox"&&t.tagName==="IFRAME"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const s=t.tagName;if(s==="IMG"||s==="VIDEO"||s==="CANVAS"||s==="SOURCE")return!1}return Fx(e)&&vn(n)?!1:e in t}function Ute(t,e){const n=t._def.props;if(!n)return!1;const r=xr(e);return Array.isArray(n)?n.some(s=>xr(s)===r):Object.keys(n).some(s=>xr(s)===r)}const Bx={};function GU(t,e,n){let r=Ls(t,e);gp(r)&&(r=Rn({},r,e));class s extends AT{constructor(o){super(r,o,n)}}return s.def=r,s}const Hte=((t,e)=>GU(t,e,jP)),qte=typeof HTMLElement<"u"?HTMLElement:class{};class AT extends qte{constructor(e,n={},r=Vw){super(),this._def=e,this._props=n,this._createApp=r,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&r!==Vw?this._root=this.shadowRoot:e.shadowRoot!==!1?(this.attachShadow(Rn({},e.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let e=this;for(;e=e&&(e.assignedSlot||e.parentNode||e.host);)if(e instanceof AT){this._parent=e;break}this._instance||(this._resolved?this._mount(this._def):e&&e._pendingResolve?this._pendingResolve=e._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(e=this._parent){e&&(this._instance.parent=e._instance,this._inheritParentContext(e))}_inheritParentContext(e=this._parent){e&&this._app&&Object.setPrototypeOf(this._app._context.provides,e._instance.provides)}disconnectedCallback(){this._connected=!1,zs(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(e){for(const n of e)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let r=0;r<this.attributes.length;r++)this._setAttr(this.attributes[r].name);this._ob=new MutationObserver(this._processMutations.bind(this)),this._ob.observe(this,{attributes:!0});const e=(r,s=!1)=>{this._resolved=!0,this._pendingResolve=void 0;const{props:i,styles:o}=r;let a;if(i&&!rt(i))for(const c in i){const l=i[c];(l===Number||l&&l.type===Number)&&(c in this._props&&(this._props[c]=Kg(this._props[c])),(a||(a=Object.create(null)))[xr(c)]=!0)}this._numberProps=a,this._resolveProps(r),this.shadowRoot&&this._applyStyles(o),this._mount(r)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(r=>{r.configureApp=this._def.configureApp,e(this._def=r,!0)}):e(this._def)}_mount(e){this._app=this._createApp(e),this._inheritParentContext(),e.configureApp&&e.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const r in n)on(this,r)||Object.defineProperty(this,r,{get:()=>Wt(n[r])})}_resolveProps(e){const{props:n}=e,r=rt(n)?n:Object.keys(n||{});for(const s of Object.keys(this))s[0]!=="_"&&r.includes(s)&&this._setProp(s,this[s]);for(const s of r.map(xr))Object.defineProperty(this,s,{get(){return this._getProp(s)},set(i){this._setProp(s,i,!0,!this._patching)}})}_setAttr(e){if(e.startsWith("data-v-"))return;const n=this.hasAttribute(e);let r=n?this.getAttribute(e):Bx;const s=xr(e);n&&this._numberProps&&this._numberProps[s]&&(r=Kg(r)),this._setProp(s,r,!1,!0)}_getProp(e){return this._props[e]}_setProp(e,n,r=!0,s=!1){if(n!==this._props[e]&&(this._dirty=!0,n===Bx?delete this._props[e]:(this._props[e]=n,e==="key"&&this._app&&(this._app._ceVNode.key=n)),s&&this._instance&&this._update(),r)){const i=this._ob;i&&(this._processMutations(i.takeRecords()),i.disconnect()),n===!0?this.setAttribute(Rs(e),""):typeof n=="string"||typeof n=="number"?this.setAttribute(Rs(e),n+""):n||this.removeAttribute(Rs(e)),i&&i.observe(this,{attributes:!0})}}
5_update(){const e=this._createVNode();this._app&&(e.appContext=this._app._context),iH(e,this._root)}_createVNode(){const e={};this.shadowRoot||(e.onVnodeMounted=e.onVnodeUpdated=this._renderSlots.bind(this));const n=Un(this._def,Rn(e,this._props));return this._instance||(n.ce=r=>{this._instance=r,r.ce=this,r.isCE=!0;const s=(i,o)=>{this.dispatchEvent(new CustomEvent(i,gp(o[0])?Rn({detail:o},o[0]):{detail:o}))};r.emit=(i,...o)=>{s(i,o),Rs(i)!==i&&s(Rs(i),o)},this._setParent()}),n}_applyStyles(e,n,r){if(!e)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const s=this._nonce,i=this.shadowRoot,o=r?this._getStyleAnchor(r)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(i);let a=null;for(let c=e.length-1;c>=0;c--){const l=document.createElement("style");s&&l.setAttribute("nonce",s),l.textContent=e[c],i.insertBefore(l,a||o),a=l,c===0&&(r||this._styleAnchors.set(this._def,l),n&&this._styleAnchors.set(n,l))}}_getStyleAnchor(e){if(!e)return null;const n=this._styleAnchors.get(e);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(e),null)}_getRootStyleInsertionAnchor(e){for(let n=0;n<e.childNodes.length;n++){const r=e.childNodes[n];if(!(r instanceof HTMLStyleElement))return r}return null}_parseSlots(){const e=this._slots={};let n;for(;n=this.firstChild;){const r=n.nodeType===1&&n.getAttribute("slot")||"default";(e[r]||(e[r]=[])).push(n),this.removeChild(n)}}_renderSlots(){const e=this._getSlots(),n=this._instance.type.__scopeId;for(let r=0;r<e.length;r++){const s=e[r],i=s.getAttribute("name")||"default",o=this._slots[i],a=s.parentNode;if(o)for(const c of o){if(n&&c.nodeType===1){const l=n+"-s",d=document.createTreeWalker(c,1);c.setAttribute(l,"");let h;for(;h=d.nextNode();)h.setAttribute(l,"")}a.insertBefore(c,s)}else for(;s.firstChild;)a.insertBefore(s.firstChild,s);a.removeChild(s)}}_getSlots(){const e=[this];this._teleportTargets&&e.push(...this._teleportTargets);const n=new Set;for(const r of e){const s=r.querySelectorAll("slot");for(let i=0;i<s.length;i++)n.add(s[i])}return Array.from(n)}_injectChildStyle(e,n){this._applyStyles(e.styles,e,n)}_beginPatch(){this._patching=!0,this._dirty=!1}_endPatch(){this._patching=!1,this._dirty&&this._instance&&this._update()}_hasShadowRoot(){return this._def.shadowRoot!==!1}_removeChildStyle(e){}}function KU(t){const e=Sr(),n=e&&e.ce;return n||null}function jte(){const t=KU();return t&&t.shadowRoot}function Wte(t="$style"){{const e=Sr();if(!e)return Jt;const n=e.type.__cssModules;if(!n)return Jt;const r=n[t];return r||Jt}}const zU=new WeakMap,YU=new WeakMap,Mw=Symbol("_moveCb"),$x=Symbol("_enterCb"),Gte=t=>(delete t.props.mode,t),Kte=Gte({name:"TransitionGroup",props:Rn({},FU,{tag:String,moveClass:String}),setup(t,{slots:e}){const n=Sr(),r=TP();let s,i;return TT(()=>{if(!s.length)return;const o=t.moveClass||`${t.name||"v"}-move`;if(!Xte(s[0].el,n.vnode.el,o)){s=[];return}s.forEach(Yte),s.forEach(Jte);const a=s.filter(Qte);oA(n.vnode.el),a.forEach(c=>{const l=c.el,d=l.style;fa(l,o),d.transform=d.webkitTransform=d.transitionDuration="";const h=l[Mw]=p=>{p&&p.target!==l||(!p||p.propertyName.endsWith("transform"))&&(l.removeEventListener("transitionend",h),l[Mw]=null,kl(l,o))};l.addEventListener("transitionend",h)}),s=[]}),()=>{const o=jt(t),a=$U(o);let c=o.tag||kr;if(s=[],i)for(let l=0;l<i.length;l++){const d=i[l];d.el&&d.el instanceof Element&&(s.push(d),qc(d,Df(d,a,r,n)),zU.set(d,JU(d.el)))}i=e.default?wT(e.default()):[];for(let l=0;l<i.length;l++){const d=i[l];d.key!=null&&qc(d,Df(d,a,r,n))}return Un(c,null,i)}}}),zte=Kte;function Yte(t){const e=t.el;e[Mw]&&e[Mw](),e[$x]&&e[$x]()}function Jte(t){YU.set(t,JU(t.el))}function Qte(t){const e=zU.get(t),n=YU.get(t),r=e.left-n.left,s=e.top-n.top;if(r||s){const i=t.el,o=i.style,a=i.getBoundingClientRect();let c=1,l=1;return i.offsetWidth&&(c=a.width/i.offsetWidth),i.offsetHeight&&(l=a.height/i.offsetHeight),(!Number.isFinite(c)||c===0)&&(c=1),(!Number.isFinite(l)||l===0)&&(l=1),Math.abs(c-1)<.01&&(c=1),Math.abs(l-1)<.01&&(l=1),o.transform=o.webkitTransform=`translate(${r/c}px,${s/l}px)`,o.transitionDuration="0s",t}}function JU(t){const e=t.getBoundingClientRect();return{left:e.left,top:e.top}}function Xte(t,e,n){const r=t.cloneNode(),s=t[Of];
vendor: 6,218 bytes, line 5
5s&&s.forEach(a=>{a.split(/\s+/).forEach(c=>c&&r.classList.remove(c))}),n.split(/\s+/).forEach(a=>a&&r.classList.add(a)),r.style.display="none";const i=e.nodeType===1?e:e.parentNode;i.appendChild(r);const{hasTransform:o}=UU(r);return i.removeChild(r),o}const lu=t=>{const e=t.props["onUpdate:modelValue"]||!1;return rt(e)?n=>Ad(e,n):e};function Zte(t){t.target.composing=!0}function Ux(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const fo=Symbol("_assign");function Hx(t,e,n){return e&&(t=t.trim()),n&&(t=j_(t)),t}const xf={created(t,{modifiers:{lazy:e,trim:n,number:r}},s){t[fo]=lu(s);const i=r||s.props&&s.props.type==="number";vc(t,e?"change":"input",o=>{o.target.composing||t[fo](Hx(t.value,n,i))}),(n||i)&&vc(t,"change",()=>{t.value=Hx(t.value,n,i)}),e||(vc(t,"compositionstart",Zte),vc(t,"compositionend",Ux),vc(t,"change",Ux))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:r,trim:s,number:i}},o){if(t[fo]=lu(o),t.composing)return;const a=(i||t.type==="number")&&!/^0\d/.test(t.value)?j_(t.value):t.value,c=e??"";if(a===c)return;const l=t.getRootNode();(l instanceof Document||l instanceof ShadowRoot)&&l.activeElement===t&&t.type!=="range"&&(r&&e===n||s&&t.value.trim()===c)||(t.value=c)}},HP={deep:!0,created(t,e,n){t[fo]=lu(n),vc(t,"change",()=>{const r=t._modelValue,s=Lf(t),i=t.checked,o=t[fo];if(rt(r)){const a=G_(r,s),c=a!==-1;if(i&&!c)o(r.concat(s));else if(!i&&c){const l=[...r];l.splice(a,1),o(l)}}else if(Su(r)){const a=new Set(r);i?a.add(s):a.delete(s),o(a)}else o(XU(t,i))})},mounted:qx,beforeUpdate(t,e,n){t[fo]=lu(n),qx(t,e,n)}};function qx(t,{value:e,oldValue:n},r){t._modelValue=e;let s;if(rt(e))s=G_(e,r.props.value)>-1;else if(Su(e))s=e.has(r.props.value);else{if(e===n)return;s=Pa(e,XU(t,!0))}t.checked!==s&&(t.checked=s)}const qP={created(t,{value:e},n){t.checked=Pa(e,n.props.value),t[fo]=lu(n),vc(t,"change",()=>{t[fo](Lf(t))})},beforeUpdate(t,{value:e,oldValue:n},r){t[fo]=lu(r),e!==n&&(t.checked=Pa(e,r.props.value))}},QU={deep:!0,created(t,{value:e,modifiers:{number:n}},r){const s=Su(e);vc(t,"change",()=>{const i=Array.prototype.filter.call(t.options,o=>o.selected).map(o=>n?j_(Lf(o)):Lf(o));t[fo](t.multiple?s?new Set(i):i:i[0]),t._assigning=!0,zs(()=>{t._assigning=!1})}),t[fo]=lu(r)},mounted(t,{value:e}){jx(t,e)},beforeUpdate(t,e,n){t[fo]=lu(n)},updated(t,{value:e}){t._assigning||jx(t,e)}};function jx(t,e){const n=t.multiple,r=rt(e);if(!(n&&!r&&!Su(e))){for(let s=0,i=t.options.length;s<i;s++){const o=t.options[s],a=Lf(o);if(n)if(r){const c=typeof a;c==="string"||c==="number"?o.selected=e.some(l=>String(l)===String(a)):o.selected=G_(e,a)>-1}else o.selected=e.has(a);else if(Pa(Lf(o),e)){t.selectedIndex!==s&&(t.selectedIndex=s);return}}!n&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function Lf(t){return"_value"in t?t._value:t.value}function XU(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}const ZU={created(t,e,n){ub(t,e,n,null,"created")},mounted(t,e,n){ub(t,e,n,null,"mounted")},beforeUpdate(t,e,n,r){ub(t,e,n,r,"beforeUpdate")},updated(t,e,n,r){ub(t,e,n,r,"updated")}};function eH(t,e){switch(t){case"SELECT":return QU;case"TEXTAREA":return xf;default:switch(e){case"checkbox":return HP;case"radio":return qP;default:return xf}}}function ub(t,e,n,r,s){const o=eH(t.tagName,n.props&&n.props.type)[s];o&&o(t,e,n,r)}function ene(){xf.getSSRProps=({value:t})=>({value:t}),qP.getSSRProps=({value:t},e)=>{if(e.props&&Pa(e.props.value,t))return{checked:!0}},HP.getSSRProps=({value:t},e)=>{if(rt(t)){if(e.props&&G_(t,e.props.value)>-1)return{checked:!0}}else if(Su(t)){if(e.props&&t.has(e.props.value))return{checked:!0}}else if(t)return{checked:!0}},ZU.getSSRProps=(t,e)=>{if(typeof e.type!="string")return;const n=eH(e.type.toUpperCase(),e.props&&e.props.type);if(n.getSSRProps)return n.getSSRProps(t,e)}}const tne=["ctrl","shift","alt","meta"],nne={stop:t=>t.stopPropagation(),prevent:t=>t.preventDefault(),self:t=>t.target!==t.currentTarget,ctrl:t=>!t.ctrlKey,shift:t=>!t.shiftKey,alt:t=>!t.altKey,meta:t=>!t.metaKey,left:t=>"button"in t&&t.button!==0,middle:t=>"button"in t&&t.button!==1,right:t=>"button"in t&&t.button!==2,exact:(t,e)=>tne.some(n=>t[`${n}Key`]&&!e.includes(n))},tH=(t,e)=>{if(!t)return t;const n=t._withMods||(t._withMods={}),r=e.join(".");return n[r]||(n[r]=((s,...i)=>{for(let o=0;o<e.length;o++){const a=nne[e[o]];if(a&&a(s,e))return}return t(s,...i)}))},rne={esc:"escape",space:" ",up:"arrow-up",left:"arrow-left",right:"arrow-right",down:"arrow-down",delete:"backspace"},sne=(t,e)=>{const n=t._withKeys||(t._withKeys={}),r=e.join(".");return n[r]||(n[r]=(s=>{if(!("key"in s))return;const i=Rs(s.key);if(e.some(o=>o===i||rne[o]===i))return t(s)}))},nH=Rn({patchProp:WU},MU);let wg,Wx=!1;function rH(){return wg||(wg=gU(nH))}function sH(){return wg=Wx?wg:_U(nH),Wx=!0,wg}const iH=((...t)=>{rH().render(...t)}),ine=((...t)=>{sH().hydrate(...t)}),Vw=((...t)=>{const e=rH().createApp(...t),{mount:n}=e;return e.mount=r=>{const s=aH(r);if(!s)return;const i=e._component;!yt(i)&&!i.render&&!i.template&&(i.template=s.innerHTML),s.nodeType===1&&(s.textContent="");const o=n(s,!1,oH(s));return s instanceof Element&&(s.removeAttribute("v-cloak"),s.setAttribute("data-v-app","")),o},e}),jP=((...t)=>{const e=sH().createApp(...t),{mount:n}=e;return e.mount=r=>{const s=aH(r);if(s)return n(s,!0,oH(s))},e});function oH(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function aH(t){return vn(t)?document.querySelector(t):t}let Gx=!1;const one=()=>{Gx||(Gx=!0,ene(),Rte())},O2e=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:K$,BaseTransitionPropsValidators:EP,Comment:Nr,DeprecationTypes:wte,EffectScope:gP,ErrorCodes:DZ,ErrorTypeStrings:pte,Fragment:kr,KeepAlive:Y$,ReactiveEffect:zg,Static:kd,Suspense:CT,Teleport:jZ,Text:Pc,TrackOpTypes:IZ,Transition:BU,TransitionGroup:zte,TriggerOpTypes:CZ,VueElement:AT,assertNumber:NZ,callWithAsyncErrorHandling:$i,callWithErrorHandling:bp,camelize:xr,capitalize:_p,cloneVNode:gi,compatUtils:bte,computed:$e,createApp:Vw,createBlock:Do,createCommentVNode:Nw,createElementBlock:Ll,createElementVNode:Br,createHydrationRenderer:_
5U,createPropsRestProxy:Aee,createRenderer:gU,createSSRApp:jP,createSlots:hee,createStaticVNode:AU,createTextVNode:BP,createVNode:Un,customRef:vT,defineAsyncComponent:mc,defineComponent:Ls,defineCustomElement:GU,defineEmits:_ee,defineExpose:yee,defineModel:wee,defineOptions:vee,defineProps:gee,defineSSRCustomElement:Hte,defineSlots:bee,devtools:mte,effect:QX,effectScope:oh,getCurrentInstance:Sr,getCurrentScope:Ba,getCurrentWatcher:AZ,getTransitionRawChildren:wT,guardReactiveProps:FP,h:On,handleError:ah,hasInjectionContext:wp,hydrate:ine,hydrateOnIdle:eee,hydrateOnInteraction:see,hydrateOnMediaQuery:ree,hydrateOnVisible:nee,initCustomFormatter:dte,initDirectivesForSSR:one,inject:vr,isMemoSame:OU,isProxy:K_,isReactive:ho,isReadonly:Go,isRef:Pn,isRuntimeOnly:cte,isShallow:mi,isVNode:jc,markRaw:yT,mergeDefaults:Iee,mergeModels:Cee,mergeProps:UP,nextTick:zs,nodeOps:MU,normalizeClass:cu,normalizeProps:pP,normalizeStyle:yp,onActivated:CP,onBeforeMount:RP,onBeforeUnmount:Sp,onBeforeUpdate:PP,onDeactivated:AP,onErrorCaptured:kP,onMounted:ka,onRenderTracked:Z$,onRenderTriggered:X$,onScopeDispose:$c,onServerPrefetch:Q$,onUnmounted:Tp,onUpdated:TT,onWatcherCleanup:O$,openBlock:ls,patchProp:WU,popScopeId:VZ,provide:Sa,proxyRefs:bP,pushScopeId:MZ,queuePostFlushCb:Ud,reactive:Xs,readonly:Ac,ref:Ae,registerRuntimeCompiler:ate,render:iH,renderList:dee,render
5Slot:fee,resolveComponent:lee,resolveDirective:uee,resolveDynamicComponent:tU,resolveFilter:vte,resolveTransitionHooks:Df,setBlockTracking:t_,setDevtoolsHook:gte,setTransitionHooks:qc,shallowReactive:ao,shallowReadonly:gZ,shallowRef:ht,ssrContextKey:B$,ssrUtils:yte,stop:XX,toDisplayString:md,toHandlerKey:mf,toHandlers:pee,toRaw:jt,toRef:vp,toRefs:N$,toValue:Pr,transformVNodeArgs:nte,triggerRef:yZ,unref:Wt,useAttrs:Eee,useCssModule:Wte,useCssVars:Pte,useHost:KU,useId:GZ,useModel:Mee,useSSRContext:$$,useShadowRoot:jte,useSlots:Tee,useTemplateRef:KZ,useTransitionState:TP,vModelCheckbox:HP,vModelDynamic:ZU,vModelRadio:qP,vModelSelect:QU,vModelText:xf,vShow:qU,version:xU,warn:fte,watch:ft,watchEffect:SP,watchPostEffect:BZ,watchSyncEffect:U$,withAsyncContext:Ree,withCtx:z_,withDefaults:See,withDirectives:KC,withKeys:sne,withMemo:hte,withModifiers:tH,withScopeId:FZ},Symbol.toStringTag,{value:"Module"})),ane=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,cne=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,lne=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function une(t,e){if(t==="__proto__"||t==="constructor"&&e&&typeof e=="object"&&"prototype"in e){dne(t);return}return e}function dne(t){console.warn(`[destr] Dropping "${t}" key to prevent prototype pollution.`)}function hne(t,e={}){if(typeof t!="string")return t;if(t[0]==='"'&&t[t.length-1]==='"'&&t.indexOf("\\")===-1)return t.slice(1,-1);const n=t.trim();if(n.length<=9)switch(n.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!lne.test(t)){if(e.strict)throw new SyntaxError("[destr] Invalid JSON");return t}try{if(ane.test(t)||cne.test(t)){if(e.strict)throw new Error("[destr] Possible prototype pollution");return JSON.parse(t,une)}return JSON.parse(t)}catch(r){if(e.strict)throw r;return t}}const cH=/#/g,lH=/&/g,fne=/\//g,pne=/=/g,mne=/\?/g,RT=/\+/g,gne=/%5e/gi,_ne=/%60/gi,yne=/%7c/gi,vne=/%20/gi,bne=/%2f/gi,wne=/%252f/gi;function uH(t){return encodeURI(""+t).replace(yne,"|")}function cA(t){return uH(typeof t=="string"?t:JSON.stringify(t)).replace(RT,"%2B").replace(vne,"+").replace(cH,"%23").replace(lH,"%26").replace(_ne,"`").replace(gne,"^").replace(fne,"%2F")}function T0(t){return cA(t).replace(pne,"%3D")}function Sne(t){return uH(t).replace(cH,"%23").replace(mne,"%3F").replace(wne,"%2F").replace(lH,"%26").replace(RT,"%2B")}function r_(t=""){try{return decodeURIComponent(""+t)}catch{return""+t}}function Tne(t){return r_(t.replace(bne,"%252F"))}function Ene(t){return r_(t.replace(RT," "))}function Ine(t){return r_(t.replace(RT," "))}function WP(t=""){const e=Object.create(null);t[0]==="?"&&(t=t.slice(1));for(const n of t.split("&")){const r=n.match(/([^=]+)=?(.*)/)||[];if(r.length<2)continue;const s=Ene(r[1]);if(s==="__proto__"||s==="constructor")continue;const i=Ine(r[2]||"");e[s]===void 0?e[s]=i:Array.isArray(e[s])?e[s].push(i):e[s]=[e[s],i]}return e}function Cne(t,e){return(typeof e=="number"||typeof e=="boolean")&&(e=String(e)),e?Array.isArray(e)?e.map(n=>`${T0(t)}=${cA(n)}`).join("&"):`${T0(t)}=${cA(e)}`:T0(t)}function Ane(t){return Object.keys(t).filter(e=>t[e]!==void 0).map(e=>Cne(e,t[e])).filter(Boolean).join("&")}const Rne=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,Pne=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,kne=/^([/\\]\s*){2,}[^/\\]/,Nne=/^[\s\0]*(blob|data|javascript|vbscript):$/i,Dne=/\/$|\/\?|\/#/,One=/^\.?\//;function nl(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?Rne.test(t):Pne.test(t)||(e.acceptRelative?kne.test(t):!1)}function xne(t){return!!t&&Nne.test(t)}function lA(t="",e){return e?Dne.test(t):t.endsWith("/")}function s_(t="",e){if(!e)return(lA(t)?t.slice(0,-1):t)||"/";if(!lA(t,!0))return t||"/";let n=t,r="";const s=t.indexOf("#");s!==-1&&(n=t.slice(0,s),r=t.slice(s));const[i,...o]=n.split("?");return((i.endsWith("/")?i.slice(0,-1):i)||"/")+(o.length>0?`?${o.join("?")}`:"")+r}function Lne(t="",e){if(!e)return t.endsWith("/")?t:t+"/";if(lA(t,!0))return t||"/";let n=t,r="";const s=t.indexOf("#");if(s!==-1&&(n=t.slice(0,s),r=t.slice(s),!n))return r;const[i,...o]=n.split("?");return i+"/"+(o.length>0?`?${o.join("?")}`:"")+r}function Mne(t,e){if(dH(e)||nl(t))return t;const n=s_(e);if(t.startsWith(n)){const r=t[n.length];if(!r||r==="/"||r==="?")return t}return Nd(n,t)}function Kx(t,e){if(dH(e))return t;const n=s_(e);if(!t.startsWith(n))return t;const r=t[n.length];return r&&r!=="/"&&r!=="?"?t:"/"+t.slice(n.length).replace(/^\/+/,"")}function PT(t,e){const n=GP(t),r={...WP(n.search),...e};return n.search=Ane(r),Fne(n)}function dH(t){return!t||t==="/"}function Vne(t){return t&&t!=="/"}function Nd(t,...e){let n=t||"";for(const r of e.filter(s=>Vne(s)))if(n){const s=r.replace(One,"");n=Lne(n)+s}else n=r;return n}function hH(...t){const e=/\/(?!\/)/,n=t.filter(Boolean),r=[];let s=0;for(const o of n)if(!(!o||o==="/")){for(const[a,c]of o.split(e).entries())if(!(!c||c===".")){if(c===".."){if(r.length===1&&nl(r[0]))continue;r.pop(),s--;continue}if(a===1&&r[r.length-1]?.endsWith(":/")){r[r.length-1]+="/"+c;continue}r.push(c),s++}}let i=r.join("/");return s>=0?n[0]?.startsWith("/")&&!i.startsWith("/")?i="/"+i:n[0]?.startsWith("./")&&!i.startsWith("./")&&(i="./"
5+i):i="../".repeat(-1*s)+i,n[n.length-1]?.endsWith("/")&&!i.endsWith("/")&&(i+="/"),i}function fH(t,e){return r_(s_(t))===r_(s_(e))}const pH=Symbol.for("ufo:protocolRelative");function GP(t="",e){const n=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){const[,h,p=""]=n;return{protocol:h.toLowerCase(),pathname:p,href:h+p,auth:"",host:"",search:"",hash:""}}if(!nl(t,{acceptRelative:!0}))return uA(t);const[,r="",s,i=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[];let[,o="",a=""]=i.match(/([^#/?]*)(.*)?/)||[];r==="file:"&&(a=a.replace(/\/(?=[A-Za-z]:)/,""));const{pathname:c,search:l,hash:d}=uA(a);return{protocol:r.toLowerCase(),auth:s?s.slice(0,Math.max(0,s.length-1)):"",host:o,pathname:c,search:l,hash:d,[pH]:!r}}function uA(t=""){const[e="",n="",r=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}function Fne(t){const e=t.pathname||"",n=t.search?(t.search.startsWith("?")?"":"?")+t.search:"",r=t.hash||"",s=t.auth?t.auth+"@":"",i=t.host||"";return(t.protocol||t[pH]?(t.protocol||"")+"//":"")+s+i+e+n+r}class Bne extends Error{constructor(e,n){super(e,n),this.name="FetchError",n?.cause&&!this.cause&&(this.cause=n.cause)}}function $ne(t){const e=t.error?.message||t.error?.toString()||"",n=t.request?.method||t.options?.method||"GET",r=t.request?.url||String(t.request)||"/",s=`[${n}] ${JSON.stringify(r)}`,i=t.response?`${t.response.status} ${t.response.statusText}`:"<no response>",o=`${s}: ${i}${e?` ${e}`:""}`,a=new Bne(o,t.error?{cause:t.error}:void 0);for(const c of["request","options","response"])Object.defineProperty(a,c,{get(){return t[c]}});for(const[c,l]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(a,c,{get(){return t.response&&t.response[l]}});return a}const Une=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function zx(t="GET"){return Une.has(t.toUpperCase())}function Hne(t){if(t===void 0)return!1;const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e===null?!0:e!=="object"?!1:Array.isArray(t)?!0:t.buffer||t instanceof FormData||t instanceof URLSearchParams?!1:t.constructor&&t.constructor.name==="Object"||typeof t.toJSON=="function"}const qne=new Set(["image/svg","application/xml","application/xhtml","application/html"]),jne=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function Wne(t=""){if(!t)return"json";const e=t.split(";").shift()||"";return jne.test(e)?"json":e==="text/event-stream"?"stream":qne.has(e)||e.startsWith("text/")?"text":"blob"}function Gne(t,e,n,r){const s=Kne(e?.headers??t?.headers,n?.headers,r);let i;return(n?.query||n?.params||e?.params||e?.query)&&(i={...n?.params,...n?.query,...e?.params,...e?.query}),{...n,...e,query:i,params:i,headers:s}}function Kne(t,e,n){if(!e)return new n(t);const r=new n(e);if(t)for(const[s,i]of Symbol.iterator in t||Array.isArray(t)?t:new n(t))r.set(s,i);return r}async function db(t,e){if(e)if(Array.isArray(e))for(const n of e)await n(t);else await e(t)}const zne=new Set([408,409,425,429,500,502,503,504]),Yne=new Set([101,204,205,304]);function mH(t={}){const{fetch:e=globalThis.fetch,Headers:n=globalThis.Headers,AbortController:r=globalThis.AbortController}=t;async function s(a){const c=a.error&&a.error.name==="AbortError"&&!a.options.timeout||!1;if(a.options.retry!==!1&&!c){let d;typeof a.options.retry=="number"?d=a.options.retry:d=zx(a.options.method)?0:1;const h=a.response&&a.response.status||500;if(d>0&&(Array.isArray(a.options.retryStatusCodes)?a.options.retryStatusCodes.includes(h):zne.has(h))){const p=typeof a.options.retryDelay=="function"?a.options.retryDelay(a):a.options.retryDelay||0;return p>0&&await new Promise(g=>setTimeout(g,p)),i(a.request,{...a.options,retry:d-1})}}const l=$ne(a);throw Error.captureStackTrace&&Error.captureStackTrace(l,i),l}const i=async function(c,l={}){const d={request:c,options:Gne(c,l,t.defaults,n),response:void 0,error:void 0};if(d.options.method&&(d.options.method=d.options.method.toUpperCase()),d.options.onRequest&&(await db(d,d.options.onRequest),d.options.headers instanceof n||(d.options.headers=new n(d.options.headers||{}))),typeof d.request=="string"&&(d.options.baseURL&&(d.request=Mne(d.request,d.options.baseURL)),d.options.query&&(d.request=PT(d.request,d.options.query),delete d.options.query),"query"in d.options&&delete d.options.query,"params"in d.options&&delete d.options.params),d.options.body&&zx(d.options.method))if(Hne(d.options.body)){const g=d.options.headers.get("content-type");typeof d.options.body!="string"&&(d.options.body=g==="application/x-www-form-urlencoded"?new URLSearchParams(d.options.body).toString():JSON.stringify(d.options.body)),g||d.options.headers.set("content-type","application/json"),d.options.headers.has("accept")||d.options.headers.set("accept","application/json")}else("pipeTo"in d.options.body&&typeof d.options.body.pipeTo=="function"||typeof d.options.body.pipe=="function")&&("duplex"in d.options||(d.options.duplex="half"));let h;if(!d.options.signal&&d.options.timeout){const g=new r;h=setTimeout(()=>{const _=new Error("[TimeoutError]: The operation was aborted due to timeout");_.name="TimeoutError",_.code=23,g.abort(_)},d.options.timeout),d.options.signal=g.signal}try{d.response=await e(d.request,d.options)}catch(g){return d.error=g,d.options.onRequestError&&await db(d,d.options.onRequestError),await s(d)}finally{h&&clearTimeout(h)}if((d.response.body||d.response._bodyInit)&&!Yne.has(d.response.status)&&d.options.method!=="HEAD"){const g=(d.options.parseResponse?"json":d.options.responseType)||Wne(d.response.headers.get("content-type")||"");switch(g){case"json":{const _=await d.response.text(),v=d.options.parseResponse||hne;d.response._data=v(_);break}case"stream":{d.response._data=d.response.body||d.response._bodyInit;break}default:d.response._data=await d.response[g]()}}return d.options.onResponse&&await db(d,d.options.onResponse),!d.options.ignoreResponseError&&d.response.status>=400&&d.response.status<600?(d.options.onResponseError&&await db(d,d.options.onResponseError),await s(d)):d.response},o=async function(c,l){return(await i(c,l))._data};return o.raw=i,o.native=(...a)=>e(...a),o.create=(a={},c={})=>mH({...t,...c,defaults:{...t.defaults,...c.defaults,...a}}),o}const Fw=(function(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")})(),Jne=Fw.fetch?(...t)=>Fw.fetch(...t):()=>Promise.reject(new Error("[ofetch] global.fetch is not supported!")),Qne=Fw.Headers,Xne=Fw.AbortController,Zne=mH({fetch:Jne,Headers:Qne,AbortController:Xne}),ere=Zne,tre=()=>window?.__NUXT__?.config||window?.useNuxtApp?.().payload?.config,KP=()=>tre().app,nre=()=>KP().baseURL,rre=()=>KP().buildAssetsDir,zP=(...t)=>hH(gH(),rre(),...t),gH=(...t)=>{const e=KP(),n=e.cdnURL||e.baseURL;return t.length?hH(n,...t):n};globalThis.__buildAssetsURL=zP,globalThis.__publicAssetsURL=gH;globalThis.$fetch||(globalThis.$fetch=ere.create({baseURL:nre()}));"global"in globalThis||(globalThis.global=globalThis);function dA(t,e={},n){for(const r in t){const s=t[r],i=n?`${n}:${r}`:r;typeof s=="object"&&s!==null?dA(s,e,i):typeof s=="function"&&(e[i]=s)}return e}const _H=(()=>
5{if(console.createTask)return console.createTask;const t={run:e=>e()};return()=>t})();function yH(t,e,n,r){for(let s=n;s<t.length;s+=1)try{const i=r?r.run(()=>t[s](...e)):t[s](...e);if(i&&typeof i.then=="function")return Promise.resolve(i).then(()=>yH(t,e,s+1,r))}catch(i){return Promise.reject(i)}}function sre(t,e,n){if(t.length>0)return yH(t,e,0,_H(n))}function ire(t,e,n){if(t.length>0){const r=_H(n);return Promise.all(t.map(s=>r.run(()=>s(...e))))}}function E0(t,e){for(const n of[...t])n(e)}var ore=class{_hooks;_before;_after;_deprecatedHooks;_deprecatedMessages;constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(t,e,n={}){if(!t||typeof e!="function")return()=>{};const r=t;let s;for(;this._deprecatedHooks[t];)s=this._deprecatedHooks[t],t=s.to;if(s&&!n.allowDeprecated){let i=s.message;i||(i=`${r} hook has been deprecated`+(s.to?`, please use ${s.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(i)||(console.warn(i),this._deprecatedMessages.add(i))}if(!e.name)try{Object.defineProperty(e,"name",{get:()=>"_"+t.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(e),()=>{e&&(this.removeHook(t,e),e=void 0)}}hookOnce(t,e){let n,r=(...s)=>(typeof n=="function"&&n(),n=void 0,r=void 0,e(...s));return n=this.hook(t,r),n}removeHook(t,e){const n=this._hooks[t];if(n){const r=n.indexOf(e);r!==-1&&n.splice(r,1),n.length===0&&(this._hooks[t]=void 0)}}clearHook(t){this._hooks[t]=void 0}deprecateHook(t,e){this._deprecatedHooks[t]=typeof e=="string"?{to:e}:e;const n=this._hooks[t]||[];this._hooks[t]=void 0;for(const r of n)this.hook(t,r)}deprecateHooks(t){for(const e in t)this.deprecateHook(e,t[e])}addHooks(t){const e=dA(t),n=Object.keys(e).map(r=>this.hook(r,e[r]));return()=>{for(const r of n)r();n.length=0}}removeHooks(t){const e=dA(t);for(const n in e)this.removeHook(n,e[n])}removeAllHooks(){this._hooks={}}callHook(t,...e){return this.callHookWith(sre,t,e)}callHookParallel(t,...e){return this.callHookWith(ire,t,e)}callHookWith(t,e,n){const r=this._before||this._after?{name:e,args:n,context:{}}:void 0;this._before&&E0(this._before,r);const s=t(this._hooks[e]?[...this._hooks[e]]:[],n,e);return s instanceof Promise?s.finally(()=>{this._after&&r&&E0(this._after,r)}):(this._after&&r&&E0(this._after,r),s)}beforeEach(t){return this._before=this._before||[],this._before.push(t),()=>{if(this._before!==void 0){const e=this._before.indexOf(t);e!==-1&&this._before.splice(e,1)}}}afterEach(t){return this._after=this._after||[],this._after.push(t),()=>{if(this._after!==void 0){const e=this._after.indexOf(t);e!==-1&&this._after.splice(e,1)}}}};function vH(){return new ore}function are(t={}){let e,n=!1;const r=o=>{if(e&&e!==o)throw new Error("Context conflict")};let s;if(t.asyncContext){const o=t.AsyncLocalStorage||globalThis.AsyncLocalStorage;o?s=new o:console.warn("[unctx] `AsyncLocalStorage` is not provided.")}const i=()=>{if(s){const o=s.getStore();if(o!==void 0)return o}return e};return{use:()=>{const o=i();if(o===void 0)throw new Error("Context is not available");return o},tryUse:()=>i(),set:(o,a)=>{a||r(o),e=o,n=!0},unset:()=>{e=void 0,n=!1},call:(o,a)=>{r(o),e=o;try{return s?s.run(o,a):a()}finally{n||(e=void 0)}},async callAsync(o,a){e=o;const c=()=>{e=o},l=()=>e===o?c:void 0;hA.add(l);try{const d=s?s.run(o,a):a();return n||(e=void 0),await d}finally{hA.delete(l)}}}}function cre(t={}){const e={};return{get(n,r={}){return e[n]||(e[n]=are({...t,...r})),e[n]}}}const Bw=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof global<"u"?global:typeof window<"u"?window:{},Yx="__unctx__",lre=Bw[Yx]||(Bw[Yx]=cre()),ure=(t,e={})=>lre.get(t,e),Jx="__unctx_async_handlers__",hA=Bw[Jx]||(Bw[Jx]=new Set);function Wl(t){const e=[];for(const s of hA){const i=s();i&&e.push(i)}const n=()=>{for(const s of e)s()};let r=t();return r&&typeof r=="object"&&"catch"in r&&(r=r.catch(s=>{throw n(),s})),[r,n]}
5const Qx=!1,Xx=!1,dre=!1,Zx={id:"__nuxt-loader"},x2e={componentName:"NuxtLink",prefetch:!0,prefetchOn:{visibility:!0}},hre={deep:!1},fre={},pre="#__nuxt",bH="nuxt-app",eL=36e5,mre="vite:preloadError";function wH(t=bH){return ure(t,{asyncContext:!1})}const gre="__nuxt_plugin";function _re(t){let e=0;const n={_id:t.id||bH||"nuxt-app",_scope:oh(),provide:void 0,versions:{get nuxt(){return"4.4.6"},get vue(){return n.vueApp.version}},payload:ao({...t.ssrContext?.payload||{},data:ao({}),state:Xs({}),once:new Set,_errors:ao({})}),static:{data:{}},runWithContext(s){return n._scope.active&&!Ba()?n._scope.run(()=>tL(n,s)):tL(n,s)},isHydrating:!0,deferHydration(){if(!n.isHydrating)return()=>{};e++;let s=!1;return()=>{if(!s&&(s=!0,e--,e===0))return n.isHydrating=!1,n.callHook("app:suspense:resolve")}},_asyncDataPromises:{},_asyncData:ao({}),_state:ao({}),_payloadRevivers:{},...t};{const s=window.__NUXT__;if(s)for(const i in s)switch(i){case"data":case"state":case"_errors":Object.assign(n.payload[i],s[i]);break;default:n.payload[i]=s[i]}}n.hooks=vH(),n.hook=n.hooks.hook;{const s=n.hooks.callHook;n.hooks.callHook=(i,...o)=>Promise.resolve().then(()=>s(i,...o))}n.callHook=n.hooks.callHook,n.provide=(s,i)=>{const o="$"+s;hb(n,o,i),hb(n.vueApp.config.globalProperties,o,i)},hb(n.vueApp,"$nuxt",n),hb(n.vueApp.config.globalProperties,"$nuxt",n);{window.addEventListener(mre,i=>{n.callHook("app:chunkError",{error:i.payload}),i.payload.message.includes("Unable to preload CSS")&&i.preventDefault()}),window.useNuxtApp||=xt;const s=n.hook("app:error",(...i)=>{console.error("[nuxt] error caught during app initialization",...i)});n.hook("app:mounted",s)}const r=n.payload.config;return n.provide("config",r),n}function yre(t,e){e.hooks&&t.hooks.addHooks(e.hooks)}async function vre(t,e){if(typeof e=="function"){const{provide:n}=await t.runWithContext(()=>e(t))||{};if(n&&typeof n=="object")for(const r in n)t.provide(r,n[r])}}async function bre(t,e){const n=new Set,r=[],s=[];let i,o=0;async function a(c){const l=c.dependsOn?.filter(d=>e.some(h=>h._name===d)&&!n.has(d))??[];if(l.length>0)r.push([new Set(l),c]);else{const d=vre(t,c).then(async()=>{c._name&&(n.add(c._name),await Promise.all(r.map(async([h,p])=>{h.has(c._name)&&(h.delete(c._name),h.size===0&&(o++,await a(p)))})))}).catch(h=>{if(!c.parallel&&!t.payload.error)throw h;i||=h});c.parallel?s.push(d):await d}}for(const c of e)yre(t,c);for(const c of e)await a(c);if(await Promise.all(s),o)for(let c=0;c<o;c++)await Promise.all(s);if(i)throw t.payload.error||i}function At(t){if(typeof t=="function")return t;const e=t._name||t.name;return delete t.name,Object.assign(t.setup||(()=>{}),t,{[gre]:!0,_name:e})}const wre=At;function tL(t,e,n){const r=()=>e();return wH(t._id).set(t),t.vueApp.runWithContext(r)}function Sre(t){let e;return wp()&&(e=Sr()?.appContext.app.$nuxt),e||=wH(t).tryUse(),e||null}function xt(t){const e=Sre(t);if(!e)throw new Error("[nuxt] instance unavailable");return e}function Ks(t){return xt().$config}function hb(t,e,n){Object.defineProperty(t,e,{get:()=>n})}function I0(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function fA(t,e,n=".",r){if(!I0(e))return fA(t,{},n,r);const s={...e};for(const i of Object.keys(t)){if(i==="__proto__"||i==="constructor")continue;const o=t[i];o!=null&&(r&&r(s,i,o,n)||(Array.isArray(o)&&Array.isArray(s[i])?s[i]=[...o,...s[i]]:I0(o)&&I0(s[i])?s[i]=fA(o,s[i],(n?`${n}.`:"")+i.toString(),r):s[i]=o))}return s}function SH(t){return(...e)=>e.reduce((n,r)=>fA(n,r,"",t),{})}const TH=SH();function Tre(t,e){try{return e in t}catch{return!1}}
5class nL extends Error{static __h3_error__=!0;statusCode=500;fatal=!1;unhandled=!1;statusMessage;data;cause;constructor(e,n={}){super(e,n),n.cause&&!this.cause&&(this.cause=n.cause)}toJSON(){const e={message:this.message,statusCode:pA(this.statusCode,500)};return this.statusMessage&&(e.statusMessage=EH(this.statusMessage)),this.data!==void 0&&(e.data=this.data),e}}function Ere(t){if(typeof t=="string")return new nL(t);if(Ire(t))return t;const e=new nL(t.message??t.statusMessage??"",{cause:t.cause||t});if(Tre(t,"stack"))try{Object.defineProperty(e,"stack",{get(){return t.stack}})}catch{try{e.stack=t.stack}catch{}}if(t.data&&(e.data=t.data),t.statusCode?e.statusCode=pA(t.statusCode,e.statusCode):t.status&&(e.statusCode=pA(t.status,e.statusCode)),t.statusMessage?e.statusMessage=t.statusMessage:t.statusText&&(e.statusMessage=t.statusText),e.statusMessage){const n=e.statusMessage;EH(e.statusMessage)!==n&&console.warn("[h3] Please prefer using `message` for longer error messages instead of `statusMessage`. In the future, `statusMessage` will be sanitized by default.")}return t.fatal!==void 0&&(e.fatal=t.fatal),t.unhandled!==void 0&&(e.unhandled=t.unhandled),e}function Ire(t){return t?.constructor?.__h3_error__===!0}const Cre=/[^\u0009\u0020-\u007E]/g;function EH(t=""){return t.replace(Cre,"")}function pA(t,e=200){return!t||(typeof t=="string"&&(t=Number.parseInt(t,10)),t<100||t>999)?e:t}const IH=Symbol("layout-meta"),jd=Symbol("route");import.meta.url.replace(/\/app\/.*$/,"/");const Os=()=>xt()?.$router,kT=()=>wp()?vr(jd,xt()._route):xt()._route;function L2e(t){return t}const Are=()=>{try{if(xt()._processingMiddleware)return!0}catch{return!1}return!1},co=(t,e)=>{t||="/";const n=typeof t=="string"?t:"path"in t?Rre(t):Os().resolve(t).href;if(e?.open){const{target:l="_blank",windowFeatures:d={}}=e.open,h=[];for(const[p,g]of Object.entries(d))g!==void 0&&h.push(`${p.toLowerCase()}=${g}`);return open(n,l,h.join(", ")),Promise.resolve()}const r=nl(n,{acceptRelative:!0}),s=e?.external||r;if(s){if(!e?.external)throw new Error("Navigating to an external URL is not allowed by default. Use `navigateTo(url, { external: true })`.");const{protocol:l}=new URL(n,window.location.href);if(l&&xne(l))throw new Error(`Cannot navigate to a URL with '${l}' protocol.`)}const i=Are();if(!s&&i){if(e?.replace){if(typeof t=="string"){const{pathname:l,search:d,hash:h}=GP(t);return{path:l,...d&&{query:WP(d)},...h&&{hash:h},replace:!0}}return{...t,replace:!0}}return t}const o=Os(),a=xt();if(s)return a._scope.stop(),e?.replace?location.replace(n):location.href=n,i?a.isHydrating?new Promise(()=>{}):!1:Promise.resolve();const c=typeof t=="string"?Pre(t):t;return e?.replace?o.replace(c):o.push(c)};function Rre(t){return PT(t.path||"",t.query||{})+(t.hash||"")}function Pre(t){const e=GP(t);return Sne(Tne(e.pathname))+e.search+e.hash}const CH="__nuxt_error",NT=()=>vp(xt().payload,"error"),rd=t=>{const e=Gl(t);try{const n=NT();xt().hooks.callHook("app:error",e),n.value||=e}catch{throw e}return e},kre=async(t={})=>{const e=xt(),n=NT();e.callHook("app:error:cleared",t),t.redirect&&await Os().replace(t.redirect),n.value=void 0},YP=t=>!!t&&typeof t=="object"&&CH in t,Gl=t=>{typeof t!="string"&&t.statusText&&(t.message??=t.statusText);const e=Ere(t);return Object.defineProperty(e,CH,{value:!0,configurable:!1,writable:!1}),Object.defineProperty(e,"status",{get:()=>e.statusCode,configurable:!0}),Object.defineProperty(e,"statusText",{get:()=>e.statusMessage,configurable:!0}),e};let AH;const Mf=t=>AH=t,RH=Symbol();function mA(t){return t&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Object]"&&typeof t.toJSON!="function"}var Sg;(function(t){t.direct="direct",t.patchObject="patch object",t.patchFunction="patch function"})(Sg||(Sg={}));function Nre(){const t=oh(!0),e=t.run(()=>Ae({}));let n=[],r=[];const s=yT({install(i){Mf(s),s._a=i,i.provide(RH,s),i.config.globalProperties.$pinia=s,r.forEach(o=>n.push(o)),r=[]},use(i){return this._a?n.push(i):r.push(i),this},_p:n,_a:null,_e:t,_s:new Map,state:e});return s}const PH=()=>{};function rL(t,e,n,r=PH){t.add(e);const s=()=>{t.delete(e)&&r()};return!n&&Ba()&&$c(s),s}function Uh(t,...e){t.forEach(n=>
5{n(...e)})}const Dre=t=>t(),sL=Symbol(),C0=Symbol();function gA(t,e){t instanceof Map&&e instanceof Map?e.forEach((n,r)=>t.set(r,n)):t instanceof Set&&e instanceof Set&&e.forEach(t.add,t);for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n],s=t[n];mA(s)&&mA(r)&&t.hasOwnProperty(n)&&!Pn(r)&&!ho(r)?t[n]=gA(s,r):t[n]=r}return t}const Ore=Symbol();function xre(t){return!mA(t)||!Object.prototype.hasOwnProperty.call(t,Ore)}const{assign:Nl}=Object;function Lre(t){return!!(Pn(t)&&t.effect)}function Mre(t,e,n,r){const{state:s,actions:i,getters:o}=e,a=n.state.value[t];let c;function l(){a||(n.state.value[t]=s?s():{});const d=N$(n.state.value[t]);return Nl(d,i,Object.keys(o||{}).reduce((h,p)=>(h[p]=yT($e(()=>{Mf(n);const g=n._s.get(t);return o[p].call(g,g)})),h),{}))}return c=kH(t,l,e,n,r,!0),c}function kH(t,e,n={},r,s,i){let o;const a=Nl({actions:{}},n),c={deep:!0};let l,d,h=new Set,p=new Set,g;const _=r.state.value[t];!i&&!_&&(r.state.value[t]={});let v;function b(I){let P;l=d=!1,typeof I=="function"?(I(r.state.value[t]),P={type:Sg.patchFunction,storeId:t,events:g}):(gA(r.state.value[t],I),P={type:Sg.patchObject,payload:I,storeId:t,events:g});const k=v=Symbol();zs().then(()=>{v===k&&(l=!0)}),d=!0,Uh(h,P,r.state.value[t])}const w=i?function(){const{state:P}=n,k=P?P():{};this.$patch(L=>{Nl(L,k)})}:PH;function E(){o.stop(),h.clear(),p.clear(),r._s.delete(t)}const T=(I,P="")=>{if(sL in I)return I[C0]=P,I;const k=function(){Mf(r);const L=Array.from(arguments),M=new Set,V=new Set;function z(ce){M.add(ce)}function ie(ce){V.add(ce)}Uh(p,{args:L,name:k[C0],store:N,after:z,onError:ie});let K;try{K=I.apply(this&&this.$id===t?this:N,L)}catch(ce){throw Uh(V,ce),ce}return K instanceof Promise?K.then(ce=>(Uh(M,ce),ce)).catch(ce=>(Uh(V,ce),Promise.reject(ce))):(Uh(M,K),K)};return k[sL]=!0,k[C0]=P,k},R={_p:r,$id:t,$onAction:rL.bind(null,p),$patch:b,$reset:w,$subscribe(I,P={}){const k=rL(h,I,P.detached,()=>L()),L=o.run(()=>ft(()=>r.state.value[t],M=>{(P.flush==="sync"?d:l)&&I({storeId:t,type:Sg.direct,events:g},M)},Nl({},c,P)));return k},$dispose:E},N=Xs(R);r._s.set(t,N);const S=(r._a&&r._a.runWithContext||Dre)(()=>r._e.run(()=>(o=oh()).run(()=>e({action:T}))));for(const I in S){const P=S[I];if(Pn(P)&&!Lre(P)||ho(P))i||(_&&xre(P)&&(Pn(P)?P.value=_[I]:gA(P,_[I])),r.state.value[t][I]=P);else if(typeof P=="function"){const k=T(P,I);S[I]=k,a.actions[I]=P}}return Nl(N,S),Nl(jt(N),S),Object.defineProperty(N,"$state",{get:()=>r.state.value[t],set:I=>{b(P=>{Nl(P,I)})}}),r._p.forEach(I=>{Nl(N,o.run(()=>I({store:N,app:r._a,pinia:r,options:a})))}),_&&i&&n.hydrate&&n.hydrate(N.$state,_),l=!0,d=!0,N}function qn(t,e,n){let r;const s=typeof e=="function";r=s?n:e;function i(o,a){const c=wp();return o=o||(c?vr(RH,null):null),o&&Mf(o),o=AH,o._s.has(t)||(s?kH(t,e,r,o):Mre(t,r,o)),o._s.get(t)}return i.$id=t,i}function M2e(t){const e=jt(t),n={};for(const r in e){const s=e[r];s.effect?n[r]=$e({get:()=>t[r],set(i){t[r]=i}}):(Pn(s)||ho(s))&&(n[r]=vp(t,r))}return n}const Vre=-1,Fre=-2,Bre=-3,$re=-4,Ure=-5,Hre=-6,qre=-7,NH=2**32-1,_A=NH-1;function jre(t){return!(!Number.isInteger(t)||t<0||t>_A)}function Wre(t){return!(!Number.isInteger(t)||t<0||t>NH)}function Gre(t){return Uint8Array.fromBase64(t).buffer}function Kre(t){return Uint8Array.from(Buffer.from(t,"base64")).buffer}function zre(t){const e=atob(t),n=e.length,r=new Uint8Array(n);for(let s=0;s<n;s++)r[s]=e.charCodeAt(s);return r.buffer}const Yre=typeof Uint8Array.fromBase64=="function",Jre=typeof process=="object"&&process.versions?.node!==void 0,Qre=Yre?Gre:Jre?Kre:zre;function Xre(t,e){return Zre(JSON.parse(t),e)}function Zre(t,e){if(typeof t=="number")return i(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const n=t,r=Array(n.length);let s=null;function i(o,a=!1){if(o===Vre)return;if(o===Bre)return NaN;if(o===$re)return 1/0;if(o===Ure)return-1/0;if(o===Hre)return-0;if(a||typeof o!="number")throw new Error("Invalid input");if(o in r)return r[o];const c=n[o];if(!c||typeof c!="object")r[o]=c;else if(Array.isArray(c))if(typeof c[0]=="string"){const l=c[0],d=e&&Object.hasOwn(e,l)?e[l]:void 0;if(d){let h=c[1];if(typeof h!="number"&&(h=n.push(c[1])-1),s??=new Set,s.has(h))throw new Error("Invalid circular reference");return s.add(h),r[o]=d(i(h)),s.delete(h),r[o]}switch(l){case"Date":r[o]=new Date(c[1]);break;case"Set":const h=new Set;r[o]=h;for(let _=1;_<c.length;_+=1)h.add(i(c[_]));break;case"Map":const p=new Map;r[o]=p;for(let _=1;_<c.length;_+=2)p.set(i(c[_]),i(c[_+1]));break;case"RegExp":r[o]=new RegExp(c[1],c[2]);break;case"Object":{const _=c[1];if(typeof n[_]=="object"&&n[_][0]!=="BigInt")throw new Error("Invalid input");r[o]=Object(i(_));break}case"BigInt":r[o]=BigInt(c[1]);break;case"null":const g=Object.create(null);r[o]=g;for(let _=1;_<c.length;_+=2){if(c[_]==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");g[c[_]]=i(c[_+1])}break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Float16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":case"DataView":{if(n[c[1]][0]!=="ArrayBuffer")throw new Error("Invalid data");const _=globalThis[l],v=i(c[1]);r[o]=c[2]!==void 0?new _(v,c[2],c[3]):new _(v);break}case"ArrayBuffer":{const _=c[1];if(typeof _!="string")throw new Error("Invalid ArrayBuffer encoding");const v=Qre(_);r[o]=v;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const _=l.slice(9);r[o]=Temporal[_].from(c[1]);break}case"URL":{const _=new URL(c[1]);r[o]=_;break}case"URLSearchParams":{const _=new URLSearchParams(c[1]);r[o]=_;break}default:throw new Error(`Unknown type ${l}`)}}else if(c[0]===qre){const l=c[1];if(!Wre(l))throw new Error("Invalid input");const d=[];r[o]=d,d[_A]=void 0,delete d[_A];for(let h=2;h<c.length;h+=2){const p=c[h];if(!jre(p)||p>=l)throw new Error("Invalid input");d[p]=i(c[h+1])}d.length=l}else{const l=new Array(c.length);r[o]=l;for(let d=0;d<c.length;d+=1){const h=c[d];h!==Fre&&(l[d]=i(h))}}else{const l={};r[o]=l;
5for(const d of Object.keys(c)){if(d==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const h=c[d];l[d]=i(h)}}return r[o]}return i(0)}const ese=new Set(["link","style","script","noscript"]),tse=new Set(["title","titleTemplate","script","style","noscript"]),yA=new Set(["base","meta","link","style","script","noscript"]),nse=new Set(["title","base","htmlAttrs","bodyAttrs","meta","link","style","script","noscript"]),rse=new Set(["base","title","titleTemplate","bodyAttrs","htmlAttrs","templateParams"]),sse=new Set(["key","tagPosition","tagPriority","tagDuplicateStrategy","innerHTML","textContent","processTemplateParams"]),ise=new Set(["templateParams","htmlAttrs","bodyAttrs"]),ose=new Set(["theme-color","google-site-verification","og","article","book","profile","twitter","author"]),ase=["name","property","http-equiv"],cse=new Set(["viewport","description","keywords","robots"]);function DH(t){const e=t.split(":");return e.length?ose.has(e[1]):!1}function vA(t){const{props:e,tag:n}=t;if(rse.has(n))return n;if(n==="link"&&e.rel==="canonical")return"canonical";if(n==="link"&&e.rel==="alternate"){if(e.hreflang)return`alternate:${e.hreflang}`;if(e.type)return`alternate:${e.type}:${e.href||""}`}if(e.charset)return"charset";if(t.tag==="meta"){for(const r of ase)if(e[r]!==void 0){const s=e[r],i=s&&typeof s=="string"&&s.includes(":"),o=s&&cse.has(s),c=!(i||o)&&t.key?`:key:${t.key}`:"";return`${n}:${s}${c}`}}if(t.key)return`${n}:key:${t.key}`;if(e.id)return`${n}:id:${e.id}`;if(n==="link"&&e.rel==="alternate")return`alternate:${e.href||""}`;if(tse.has(n)){const r=t.textContent||t.innerHTML;if(r)return`${n}:content:${r}`}}function OH(t){const e=t._h||t._d;if(e)return e;const n=t.textContent||t.innerHTML;return n||`${t.tag}:${Object.entries(t.props).map(([r,s])=>`${r}:${String(s)}`).join(",")}`}function $w(t,e,n){typeof t==="function"&&(!n||n!=="titleTemplate"&&!(n[0]==="o"&&n[1]==="n"))&&(t=t());const s=e?e(n,t):t;if(Array.isArray(s))return s.map(i=>$w(i,e));if(s?.constructor===Object){const i={};for(const o of Object.keys(s))i[o]=$w(s[o],e,o);return i}return s}function lse(t,e){const n=t==="style"?new Map:new Set;function r(s){if(s==null||s===void 0)return;const i=String(s).trim();if(i)if(t==="style"){const[o,...a]=i.split(":").map(c=>c?c.trim():"");o&&a.length&&n.set(o,a.join(":"))}else i.split(" ").filter(Boolean).forEach(o=>n.add(o))}return typeof e=="string"?t==="style"?e.split(";").forEach(r):r(e):Array.isArray(e)?e.forEach(s=>r(s)):e&&typeof e=="object"&&Object.entries(e).forEach(([s,i])=>{i&&i!=="false"&&(t==="style"?n.set(String(s).trim(),String(i)):r(s))}),n}function xH(t,e){if(t.props=t.props||{},!e)return t;if(t.tag==="templateParams")return t.props=e,t;const n=yA.has(t.tag)||t.tag==="htmlAttrs"||t.tag==="bodyAttrs";return Object.entries(e).forEach(([r,s])=>{if(r==="__proto__"||r==="constructor"||r==="prototype")return;if(s===null){t.props[r]=null;return}if(r==="class"||r==="style"){t.props[r]=lse(r,s);return}if(sse.has(r)){if((r==="textContent"||r==="innerHTML")&&typeof s=="object"){let l=e.type;if(e.type||(l="application/json"),!l?.endsWith("json")&&l!=="speculationrules")return;e.type=l,t.props.type=l,t[r]=JSON.stringify(s)}else t[r]=s;return}const i=r.startsWith("data-"),o=n&&!i?r.toLowerCase():r,a=String(s),c=t.tag==="meta"&&o==="content";a==="true"||a===""?t.props[o]=i||c?a:!0:!s&&i&&a==="false"?t.props[o]="false":s!==void 0&&(t.props[o]=s)}),t}function use(t,e){const n=typeof e=="object"&&typeof e!="function"?e:{[t==="script"||t==="noscript"||t==="style"?"innerHTML":"textContent"]:e},r=xH({tag:t,props:{}},n);return r.key&&ese.has(r.tag)&&(r.props["data-hid"]=r._h=r.key),r.tag==="script"&&typeof r.innerHTML=="object"&&(r.innerHTML=JSON.stringify(r.innerHTML),r.props.type=r.props.type||"application/json"),Array.isArray(r.props.content)?r.props.content.map(s=>({...r,props:{...r.props,content:s}})):r}function dse(t,e){if(!t)return[];typeof t=="function"&&(t=t());const n=(s,i)=>{for(let o=0;o<e.length;o++)i=e[o](s,i);return i};t=n(void 0,t);const r=[];return t=$w(t,n),Object.entries(t||{}
5).forEach(([s,i])=>{if(i!==void 0)for(const o of Array.isArray(i)?i:[i])r.push(use(s,o))}),r.flat()}const iL=(t,e)=>t._w===e._w?t._p-e._p:t._w-e._w,oL={base:-10,title:10},hse={critical:-8,high:-1,low:2},aL={meta:{"content-security-policy":-30,charset:-20,viewport:-15},link:{preconnect:20,stylesheet:60,preload:70,modulepreload:70,prefetch:90,"dns-prefetch":90,prerender:90},script:{async:30,defer:80,sync:50},style:{imported:40,sync:60}},fse=/@import/,Hm=t=>t===""||t===!0;function pse(t,e){if(typeof e.tagPriority=="number")return e.tagPriority;let n=100;const r=hse[e.tagPriority]||0,s=t.resolvedOptions.disableCapoSorting?{link:{},script:{},style:{}}:aL;if(e.tag in oL)n=oL[e.tag];else if(e.tag==="meta"){const i=e.props["http-equiv"]==="content-security-policy"?"content-security-policy":e.props.charset?"charset":e.props.name==="viewport"?"viewport":null;i&&(n=aL.meta[i])}else if(e.tag==="link"&&e.props.rel)n=s.link[e.props.rel];else if(e.tag==="script"){const i=String(e.props.type);Hm(e.props.async)?n=s.script.async:e.props.src&&!Hm(e.props.defer)&&!Hm(e.props.async)&&i!=="module"&&!i.endsWith("json")||e.innerHTML&&!i.endsWith("json")?n=s.script.sync:(Hm(e.props.defer)&&e.props.src&&!Hm(e.props.async)||i==="module")&&(n=s.script.defer)}else e.tag==="style"&&(n=e.innerHTML&&fse.test(e.innerHTML)?s.style.imported:s.style.sync);return(n||100)+r}function cL(t,e){const n=typeof e=="function"?e(t):e,r=n.key||String(t.plugins.size+1);t.plugins.get(r)||(t.plugins.set(r,n),t.hooks.addHooks(n.hooks||{}))}function mse(t={}){const e=vH();e.addHooks(t.hooks||{});const n=!t.document,r=new Map,s=new Map,i=new Set,o={_entryCount:1,plugins:s,dirty:!1,resolvedOptions:t,hooks:e,ssr:n,entries:r,headEntries(){return[...r.values()]},use:a=>cL(o,a),push(a,c){const l={...c||{}};delete l.head;const d=l._index??o._entryCount++,h={_i:d,input:a,options:l},p={_poll(g=!1){o.dirty=!0,!g&&i.add(d),e.callHook("entries:updated",o)},dispose(){r.delete(d)&&o.invalidate()},patch(g){(!l.mode||l.mode==="server"&&n||l.mode==="client"&&!n)&&(h.input=g,r.set(d,h),p._poll())}};return p.patch(a),p},async resolveTags(){const a={tagMap:new Map,tags:[],entries:[...o.entries.values()]};for(await e.callHook("entries:resolve",a);i.size;){const p=i.values().next().value;i.delete(p);const g=r.get(p);if(g){const _={tags:dse(g.input,t.propResolvers||[]).map(v=>Object.assign(v,g.options)),entry:g};await e.callHook("entries:normalize",_),g._tags=_.tags.map((v,b)=>(v._w=pse(o,v),v._p=(g._i<<10)+b,v._d=vA(v),v._d||(v._h=OH(v)),v))}}let c=!1;a.entries.flatMap(p=>(p._tags||[]).map(g=>({...g,props:{...g.props}}))).sort(iL).reduce((p,g)=>{const _=g._d||g._h;if(!p.has(_))return p.set(_,g);const v=p.get(_);if((g?.tagDuplicateStrategy||(ise.has(g.tag)?"merge":null)||(g.key&&g.key===v.key?"merge":null))==="merge"){const w={...v.props};Object.entries(g.props).forEach(([E,T])=>w[E]=E==="style"?new Map([...v.props.style||new Map,...T]):E==="class"?new Set([...v.props.class||new Set,...T]):T),p.set(_,{...g,props:w})}else g._p>>10===v._p>>10&&g.tag==="meta"&&DH(_)?(p.set(_,Object.assign([...Array.isArray(v)?v:[v],g],g)),c=!0):(g._w===v._w?g._p>v._p:g?._w<v?._w)&&p.set(_,g);return p},a.tagMap);const l=a.tagMap.get("title"),d=a.tagMap.get("titleTemplate");if(o._title=l?.textContent,d){const p=d?.textContent;if(o._titleTemplate=p,p){let g=typeof p=="function"?p(l?.textContent):p;typeof g=="string"&&!o.plugins.has("template-params")&&(g=g.replace("%s",l?.textContent||"")),l?g===null?a.tagMap.delete("title"):a.tagMap.set("title",{...l,textContent:g}):(d.tag="title",d.textContent=g)}}a.tags=Array.from(a.tagMap.values()),c&&(a.tags=a.tags.flat().sort(iL)),await e.callHook("tags:beforeResolve",a),await e.callHook("tags:resolve",a),await e.callHook("tags:afterResolve",a);const h=[];for(const p of a.tags){const{innerHTML:g,tag:_,props:v}=p;if(nse.has(_)&&!(Object.keys(v).length===0&&!p.innerHTML&&!p.textContent)&&!(_==="meta"&&!v.content&&!v["http-equiv"]&&!v.charset)){if(_==="script"&&g){if(String(v.type).endsWith("json")){const b=typeof g=="string"?g:JSON.stringify(g);p.innerHTML=b.replace(/</g,"\\u003C")}else typeof g=="string"&&(p.innerHTML=g.replace(new RegExp(`</${_}`,"g"),`<\\/${_}`));p._d=vA(p)}h.push(p)}}return h},invalidate(){for(const a of r.values())i.add(a._i);o.dirty=!0,e.callHook("entries:updated",o)}};
5return(t?.plugins||[]).forEach(a=>cL(o,a)),o.hooks.callHook("init",o),t.init?.forEach(a=>a&&o.push(a)),o}const gse=(t,e)=>Pn(e)?Pr(e):e,JP="usehead";function _se(t){return{install(n){n.config.globalProperties.$unhead=t,n.config.globalProperties.$head=t,n.provide(JP,t)}}.install}function yse(){if(wp()){const t=vr(JP);if(t)return t}throw new Error("useHead() was called without provide context, ensure you call it through the setup() function.")}function vse(t,e={}){const n=e.head||yse();return n.ssr?n.push(t||{},e):bse(n,t,e)}function bse(t,e,n={}){const r=Ae(!1);let s;return SP(()=>{const o=r.value?{}:$w(e,gse);s?s.patch(o):s=t.push(o,n)}),Sr()&&(Sp(()=>{s.dispose()}),AP(()=>{r.value=!0}),CP(()=>{r.value=!1})),s}function LH(t){const e=t||xt();return e.ssrContext?.head||e.runWithContext(()=>{if(wp()){const n=vr(JP);if(!n)throw new Error("[nuxt] [unhead] Missing Unhead instance.");return n}})}function wse(t,e={}){const n=e.head||LH(e.nuxt);return vse(t,{head:n,...e})}const Sse=(t,e)=>[],MH=t=>TH({},...Sse().map(e=>e.data).reverse()),Tse=MH;let Wb;function Ese(){let t;return t=$fetch(zP(`builds/meta/${Ks().app.buildId}.json`),{responseType:"json"}).then(e=>{if(!e||typeof e!="object"||!Array.isArray(e.prerendered))throw new Error("[nuxt] Received malformed app manifest. Ensure that `builds/meta/*.json` is served as JSON by your hosting/proxy and not rewritten to an HTML fallback.");return e}),Wb=t,t.catch(e=>{Wb===t&&(Wb=void 0),console.error("[nuxt] Error fetching app manifest.",e)}),t}function Ise(){return Wb||Ese()}function VH(t){const e=typeof t=="string"?t:t.path;try{return Tse(e)}catch(n){return console.error("[nuxt] Error matching route rules.",n),{}}}async function Cse(t){return null}let Ju=null;async function Ase(){if(Ju)return Ju;const t=document.getElementById("__NUXT_DATA__");if(!t)return{};const e=await Rse(t.textContent||""),n=t.dataset.src?await Cse(t.dataset.src):void 0;return Ju={...e,...n,...window.__NUXT__},Ju.config?.public&&(Ju.config.public=Xs(Ju.config.public)),Ju}async function Rse(t){return await Xre(t,xt()._payloadRevivers)}function FH(t,e){xt()._payloadRevivers[t]=e}const Pse=wre(()=>{FH("skipHydrate",t=>{})});function lL(t){try{return JSON.parse(t)}catch{return t}}const kse=[["NuxtError",t=>Gl(t)],["EmptyShallowRef",t=>ht(t==="_"?void 0:t==="0n"?BigInt(0):lL(t))],["EmptyRef",t=>Ae(t==="_"?void 0:t==="0n"?BigInt(0):lL(t))],["ShallowRef",t=>ht(t)],["ShallowReactive",t=>
5ao(t)],["Ref",t=>Ae(t)],["Reactive",t=>Xs(t)]],Nse=At({name:"nuxt:revive-payload:client",order:-30,async setup(t){let e,n;for(const[r,s]of kse)FH(r,s);Object.assign(t.payload,([e,n]=Wl(()=>t.runWithContext(Ase)),e=await e,n(),e)),delete window.__NUXT__}});async function QP(t,e={}){const n=e.document||t.resolvedOptions.document;if(!n||!t.dirty)return;const r={shouldRender:!0,tags:[]};if(await t.hooks.callHook("dom:beforeRender",r),!!r.shouldRender)return t._domUpdatePromise||(t._domUpdatePromise=new Promise(async s=>{const i=new Map,o=new Promise(g=>{t.resolveTags().then(_=>{g(_.map(v=>{const b=i.get(v._d)||0,w={tag:v,id:(b?`${v._d}:${b}`:v._d)||v._h,shouldRender:!0};return v._d&&DH(v._d)&&i.set(v._d,b+1),w}))})});let a=t._dom;if(!a){a={title:n.title,elMap:new Map().set("htmlAttrs",n.documentElement).set("bodyAttrs",n.body)};for(const g of["body","head"]){const _=n[g]?.children;for(const v of _){const b=v.tagName.toLowerCase();if(!yA.has(b))continue;const w=xH({tag:b,props:{}},{innerHTML:v.innerHTML,...v.getAttributeNames().reduce((E,T)=>(E[T]=v.getAttribute(T),E),{})||{}});if(w.key=v.getAttribute("data-hid")||void 0,w._d=vA(w)||OH(w),a.elMap.has(w._d)){let E=1,T=w._d;for(;a.elMap.has(T);)T=`${w._d}:${E++}`;a.elMap.set(T,v)}else a.elMap.set(w._d,v)}}}a.pendingSideEffects={...a.sideEffects},a.sideEffects={};function c(g,_,v){const b=`${g}:${_}`;a.sideEffects[b]=v,delete a.pendingSideEffects[b]}function l({id:g,$el:_,tag:v}){const b=v.tag.endsWith("Attrs");a.elMap.set(g,_),b||(v.textContent&&v.textContent!==_.textContent&&(_.textContent=v.textContent),v.innerHTML&&v.innerHTML!==_.innerHTML&&(_.innerHTML=v.innerHTML),c(g,"el",()=>{_?.remove(),a.elMap.delete(g)}));for(const w in v.props){if(!Object.prototype.hasOwnProperty.call(v.props,w))continue;const E=v.props[w];if(w.startsWith("on")&&typeof E=="function"){const R=_?.dataset;
5if(R&&R[`${w}fired`]){const N=w.slice(0,-5);E.call(_,new Event(N.substring(2)))}_.getAttribute(`data-${w}`)!==""&&((v.tag==="bodyAttrs"?n.defaultView:_).addEventListener(w.substring(2),E.bind(_)),_.setAttribute(`data-${w}`,""));continue}const T=`attr:${w}`;if(w==="class"){if(!E)continue;for(const R of E)b&&c(g,`${T}:${R}`,()=>_.classList.remove(R)),!_.classList.contains(R)&&_.classList.add(R)}else if(w==="style"){if(!E)continue;for(const[R,N]of E)c(g,`${T}:${R}`,()=>{_.style.removeProperty(R)}),_.style.setProperty(R,N)}else E!==!1&&E!==null&&(_.getAttribute(w)!==E&&_.setAttribute(w,E===!0?"":String(E)),b&&c(g,T,()=>_.removeAttribute(w)))}}const d=[],h={bodyClose:void 0,bodyOpen:void 0,head:void 0},p=await o;for(const g of p){const{tag:_,shouldRender:v,id:b}=g;if(v){if(_.tag==="title"){n.title=_.textContent,c("title","",()=>n.title=a.title);continue}g.$el=g.$el||a.elMap.get(b),g.$el?l(g):yA.has(_.tag)&&d.push(g)}}for(const g of d){const _=g.tag.tagPosition||"head";g.$el=n.createElement(g.tag.tag),l(g),h[_]=h[_]||n.createDocumentFragment(),h[_].appendChild(g.$el)}for(const g of p)await t.hooks.callHook("dom:renderTag",g,n,c);h.head&&n.head.appendChild(h.head),h.bodyOpen&&n.body.insertBefore(h.bodyOpen,n.body.firstChild),h.bodyClose&&n.body.appendChild(h.bodyClose);for(const g in a.pendingSideEffects)a.pendingSideEffects[g]();t._dom=a,await t.hooks.callHook("dom:rendered",{renders:p}),s()}).finally(()=>{t._domUpdatePromise=void 0,t.dirty=!1})),t._domUpdatePromise}function Dse(t={}){const e=t.domOptions?.render||QP;t.document=t.document||(typeof window<"u"?document:void 0);const n=t.document?.head.querySelector('script[id="unhead:payload"]')?.innerHTML||!1;return mse({...t,plugins:[...t.plugins||[],{key:"client",hooks:{"entries:updated":e}}],init:[n?JSON.parse(n):!1,...t.init||[]]})}function Ose(t,e){let n=0;return()=>{const r=++n;e(()=>{n===r&&t()})}}function xse(t={}){const e=Dse({domOptions:{render:Ose(()=>QP(e),n=>setTimeout(n,0))},...t});return e.install=_se(e),e}const Lse={disableDefaults:!0},Mse=At({name:"nuxt:head",enforce:"pre",setup(t){const e=xse(Lse);t.vueApp.use(e);{let n=!0;const r=async()=>{n=!1,await QP(e)};e.hooks.hook("dom:beforeRender",i=>{i.shouldRender=!n}),t.hooks.hook("page:start",()=>{n=!0}),t.hooks.hook("page:finish",()=>{t.isHydrating||r()}),t.hooks.hook("app:error",r),t.hooks.hook("app:suspense:resolve",r);const s=e.push.bind(e);e.push=((i,o)=>{const a=s(i,o),c=a.dispose.bind(a);return a.dispose=()=>{const l=t["~transitionPromise"];l?l.then(c):c()},a})}}});const nf=typeof document<"u";function BH(t){return typeof t=="object"||"displayName"in t||"props"in t||"__vccOpts"in t}function Vse(t){return t.__esModule||t[Symbol.toStringTag]==="Module"||t.default&&BH(t.default)}const En=Object.assign;function A0(t,e){const n={};for(const r in e){const s=e[r];n[r]=zo(s)?s.map(t):t(s)}return n}const Tg=()=>{},zo=Array.isArray;function uL(t,e){const n={};for(const r in t)n[r]=r in e?e[r]:t[r];return n}const $H=/#/g,Fse=/&/g,Bse=/\//g,$se=/=/g,Use=/\?/g,UH=/\+/g,Hse=/%5B/g,qse=/%5D/g,HH=/%5E/g,jse=/%60/g,qH=/%7B/g,Wse=/%7C/g,jH=/%7D/g,Gse=/%20/g;function XP(t){return t==null?"":encodeURI(""+t).replace(Wse,"|").replace(Hse,"[").replace(qse,"]")}function Kse(t){return XP(t).replace(qH,"{").replace(jH,"}").replace(HH,"^")}function bA(t){return XP(t).replace(UH,"%2B").replace(Gse,"+").replace($H,"%23").replace(Fse,"%26").replace(jse,"`").replace(qH,"{").replace(jH,"}").replace(HH,"^")}function zse(t){return bA(t).replace($se,"%3D")}function Yse(t){return XP(t).replace($H,"%23").replace(Use,"%3F")}function Jse(t){return Yse(t).replace(Bse,"%2F")}function i_(t){if(t==null)return null;try{return decodeURIComponent(""+t)}catch{}return""+t}const Qse=/\/$/,Xse=t=>t.replace(Qse,"");function R0(t,e,n="/"){let r,s={},i="",o="";const a=e.indexOf("#");let c=e.indexOf("?");return c=a>=0&&c>a?-1:c,c>=0&&(r=e.slice(0,c),i=e.slice(c,a>0?a:e.length),s=t(i.slice(1))),a>=0&&(r=r||e.slice(0,a),o=e.slice(a,e.length)),r=nie(r??e,n),{fullPath:r+i+o,path:r,query:s,hash:i_(o)}}function Zse(t,e){const n=e.query?t(e.query):"";return e.path+(n&&"?")+n+(e.hash||"")}function dL(t,e){return!e||!t.toLowerCase().startsWith(e.toLowerCase())?t:t.slice(e.length)||"/"}function eie(t,e,n){const r=e.matched.length-1,s=n.matched.length-1;return r>-1&&r===s&&Vf(e.matched[r],n.matched[s])&&WH(e.params,n.params)&&t(e.query)===t(n.query)&&e.hash===n.hash}function Vf(t,e){return(t.aliasOf||t)===(e.aliasOf||e)}function WH(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(!tie(t[n],e[n]))return!1;return!0}function tie(t,e){return zo(t)?hL(t,e):zo(e)?hL(e,t):t?.valueOf()===e?.valueOf()}function hL(t,e){return zo(e)?t.length===e.length&&t.every((n,r)=>n===e[r]):t.length===1&&t[0]===e}function nie(t,e){if(t.startsWith("/"))return t;if(!t)return e;const n=e.split("/"),r=t.split("/"),s=r[r.length-1];(s===".."||s===".")&&r.push("");let i=n.length-1,o,a;for(o=0;o<r.length;o++)if(a=r[o],a!==".")if(a==="..")i>1&&i--;else break;return n.slice(0,i).join("/")+"/"+r.slice(o).join("/")}const so={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};let wA=(function(t){return t.pop="pop",t.push="push",t})({}),P0=(function(t){return t.back="back",t.forward="forward",t.unknown="",t})({});function rie(t){if(!t)if(nf){const e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^\w+:\/\/[^\/]+/,"")}else t="/";return t[0]!=="/"&&t[0]!=="#"&&(t="/"+t),Xse(t)}const sie=/^[^#]+#/;function iie(t,e){return t.replace(sie,"#")+e}function oie(t,e){const n=document.documentElement.getBoundingClientRect(),r=t.getBoundingClientRect();return{behavior:e.behavior,left:r.left-n.left-(e.left||0),top:r.top-n.top-(e.top||0)}}const DT=()=>({left:window.scrollX,top:window.scrollY});function aie(t){let e;if("el"in t){const n=t.el,r=typeof n=="string"&&n.startsWith("#"),s=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!s)return;e=oie(s,t)}else e=t;"scrollBehavior"in document.documentElement.style?window.scrollTo(e):window.scrollTo(e.left!=null?e.left:window.scrollX,e.top!=null?e.top:window.scrollY)}
vendor: 19,397 bytes, line 5
5function fL(t,e){return(history.state?history.state.position-e:-1)+t}const SA=new Map;function cie(t,e){SA.set(t,e)}function lie(t){const e=SA.get(t);return SA.delete(t),e}function uie(t){return typeof t=="string"||t&&typeof t=="object"}function GH(t){return typeof t=="string"||typeof t=="symbol"}let gr=(function(t){return t[t.MATCHER_NOT_FOUND=1]="MATCHER_NOT_FOUND",t[t.NAVIGATION_GUARD_REDIRECT=2]="NAVIGATION_GUARD_REDIRECT",t[t.NAVIGATION_ABORTED=4]="NAVIGATION_ABORTED",t[t.NAVIGATION_CANCELLED=8]="NAVIGATION_CANCELLED",t[t.NAVIGATION_DUPLICATED=16]="NAVIGATION_DUPLICATED",t})({});const KH=Symbol("");gr.MATCHER_NOT_FOUND+"",gr.NAVIGATION_GUARD_REDIRECT+"",gr.NAVIGATION_ABORTED+"",gr.NAVIGATION_CANCELLED+"",gr.NAVIGATION_DUPLICATED+"";function Ff(t,e){return En(new Error,{type:t,[KH]:!0},e)}function uc(t,e){return t instanceof Error&&KH in t&&(e==null||!!(t.type&e))}const die=["params","query","hash"];function hie(t){if(typeof t=="string")return t;if(t.path!=null)return t.path;const e={};for(const n of die)n in t&&(e[n]=t[n]);return JSON.stringify(e,null,2)}function fie(t){const e={};if(t===""||t==="?")return e;const n=(t[0]==="?"?t.slice(1):t).split("&");for(let r=0;r<n.length;++r){const s=n[r].replace(UH," "),i=s.indexOf("="),o=i_(i<0?s:s.slice(0,i)),a=i<0?null:i_(s.slice(i+1));if(o in e){let c=e[o];zo(c)||(c=e[o]=[c]),c.push(a)}else e[o]=a}return e}function pL(t){let e="";for(let n in t){const r=t[n];if(n=zse(n),r==null){r!==void 0&&(e+=(e.length?"&":"")+n);continue}(zo(r)?r.map(s=>s&&bA(s)):[r&&bA(r)]).forEach(s=>{s!==void 0&&(e+=(e.length?"&":"")+n,s!=null&&(e+="="+s))})}return e}function pie(t){const e={};for(const n in t){const r=t[n];r!==void 0&&(e[n]=zo(r)?r.map(s=>s==null?null:""+s):r==null?r:""+r)}return e}const mie=Symbol(""),mL=Symbol(""),OT=Symbol(""),ZP=Symbol(""),TA=Symbol("");function qm(){let t=[];function e(r){return t.push(r),()=>{const s=t.indexOf(r);s>-1&&t.splice(s,1)}}function n(){t=[]}return{add:e,list:()=>t.slice(),reset:n}}function xl(t,e,n,r,s,i=o=>o()){const o=r&&(r.enterCallbacks[s]=r.enterCallbacks[s]||[]);return()=>new Promise((a,c)=>{const l=p=>{p===!1?c(Ff(gr.NAVIGATION_ABORTED,{from:n,to:e})):p instanceof Error?c(p):uie(p)?c(Ff(gr.NAVIGATION_GUARD_REDIRECT,{from:e,to:p})):(o&&r.enterCallbacks[s]===o&&typeof p=="function"&&o.push(p),a())},d=i(()=>t.call(r&&r.instances[s],e,n,l));let h=Promise.resolve(d);t.length<3&&(h=h.then(l)),h.catch(p=>c(p))})}function k0(t,e,n,r,s=i=>i()){const i=[];for(const o of t)for(const a in o.components){let c=o.components[a];if(!(e!=="beforeRouteEnter"&&!o.instances[a]))if(BH(c)){const l=(c.__vccOpts||c)[e];l&&i.push(xl(l,n,r,o,a,s))}else{let l=c();i.push(()=>l.then(d=>{if(!d)throw new Error(`Couldn't resolve component "${a}" at "${o.path}"`);const h=Vse(d)?d.default:d;o.mods[a]=d,o.components[a]=h;const p=(h.__vccOpts||h)[e];return p&&xl(p,n,r,o,a,s)()}))}}return i}function gie(t,e){const n=[],r=[],s=[],i=Math.max(e.matched.length,t.matched.length);for(let o=0;o<i;o++){const a=e.matched[o];a&&(t.matched.find(l=>Vf(l,a))?r.push(a):n.push(a));const c=t.matched[o];c&&(e.matched.find(l=>Vf(l,c))||s.push(c))}return[n,r,s]}let _ie=()=>location.protocol+"//"+location.host;function zH(t,e){const{pathname:n,search:r,hash:s}=e,i=t.indexOf("#");if(i>-1){let o=s.includes(t.slice(i))?t.slice(i).length:1,a=s.slice(o);return a[0]!=="/"&&(a="/"+a),dL(a,"")}return dL(n,t)+r+s}function yie(t,e,n,r){let s=[],i=[],o=null;const a=({state:p})=>{const g=zH(t,location),_=n.value,v=e.value;let b=0;if(p){if(n.value=g,e.value=p,o&&o===_){o=null;return}b=v?p.position-v.position:0}else r(g);s.forEach(w=>{w(n.value,_,{delta:b,type:wA.pop,direction:b?b>0?P0.forward:P0.back:P0.unknown})})};function c(){o=n.value}function l(p){s.push(p);const g=()=>{const _=s.indexOf(p);_>-1&&s.splice(_,1)};return i.push(g),g}function d(){if(document.visibilityState==="hidden"){const{history:p}=window;if(!p.state)return;p.replaceState(En({},p.state,{scroll:DT()}),"")}}function h(){for(const p of i)p();i=[],window.removeEventListener("popstate",a),window.removeEventListener("pagehide",d),document.removeEventListener("visibilitychange",d)}return window.addEventListener("popstate",a),window.addEventListener("pagehide",d),document.addEventListener("visibilitychange",d),{pauseListeners:c,listen:l,destroy:h}}function gL(t,e,n,r=!1,s=!1){return{back:t,current:e,forward:n,replaced:r,position:window.history.length,scroll:s?DT():null}}function vie(t){const{history:e,location:n}=window,r={value:zH(t,n)},s={value:e.state};s.value||i(r.value,{back:null,current:r.value,forward:null,position:e.length-1,replaced:!0,scroll:null},!0);function i(c,l,d){const h=t.indexOf("#"),p=h>-1?(n.host&&document.querySelector("base")?t:t.slice(h))+c:_ie()+t+c;try{e[d?"replaceState":"pushState"](l,"",p),s.value=l}catch(g){console.error(g),n[d?"replace":"assign"](p)}}function o(c,l){i(c,En({},e.state,gL(s.value.back,c,s.value.forward,!0),l,{position:s.value.position}),!0),r.value=c}function a(c,l){const d=En({},s.value,e.state,{forward:c,scroll:DT()});i(d.current,d,!0),i(c,En({},gL(r.value,c,null),{position:d.position+1},l),!1),r.value=c}return{location:r,state:s,push:a,replace:o}}function bie(t){t=rie(t);const e=vie(t),n=yie(t,e.state,e.location,e.replace);function r(i,o=!0){o||n.pauseListeners(),history.go(i)}const s=En({location:"",base:t,go:r,createHref:iie.bind(null,t)},e,n);return Object.defineProperty(s,"location",{enumerable:!0,get:()=>e.location.value}),Object.defineProperty(s,"state",{enumerable:!0,get:()=>e.state.value}),s}let gd=(function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.Group=2]="Group",t})({});var zr=(function(t){return t[t.Static=0]="Static",t[t.Param=1]="Param",t[t.ParamRegExp=2]="ParamRegExp",t[t.ParamRegExpEnd=3]="ParamRegExpEnd",t[t.EscapeNext=4]="EscapeNext",t})(zr||{});const wie={type:gd.Static,value:""},Sie=/[a-zA-Z0-9_]/;function Tie(t){if(!t)return[[]];if(t==="/")return[[wie]];if(!t.startsWith("/"))throw new Error(`Invalid path "${t}"`);function e(g){throw new Error(`ERR (${n})/"${l}": ${g}`)}let n=zr.Static,r=n;const s=[];let i;function o(){i&&s.push(i),i=[]}let a=0,c,l="",d="";function h(){l&&(n===zr.Static?i.push({type:gd.Static,value:l}):n===zr.Param||n===zr.ParamRegExp||n===zr.ParamRegExpEnd?(i.length>1&&(c==="*"||c==="+")&&e(`A repeatable param (${l}) must be alone in its segment. eg: '/:ids+.`),i.push({type:gd.Param,value:l,regexp:d,repeatable:c==="*"||c==="+",optional:c==="*"||c==="?"})):e("Invalid state to consume buffer"),l="")}function p(){l+=c}for(;a<t.length;){if(c=t[a++],c==="\\"&&n!==zr.ParamRegExp){r=n,n=zr.EscapeNext;continue}switch(n){case zr.Static:c==="/"?(l&&h(),o()):c===":"?(h(),n=zr.Param):p();break;case zr.EscapeNext:p(),n=r;break;case zr.Param:c==="("?n=zr.ParamRegExp:Sie.test(c)?p():(h(),n=zr.Static,c!=="*"&&c!=="?"&&c!=="+"&&a--);break;case zr.ParamRegExp:c===")"?d[d.length-1]=="\\"?d=d.slice(0,-1)+c:n=zr.ParamRegExpEnd:d+=c;break;case zr.ParamRegExpEnd:h(),n=zr.Static,c!=="*"&&c!=="?"&&c!=="+"&&a--,d="";break;default:e("Unknown state");break}}return n===zr.ParamRegExp&&e(`Unfinished custom RegExp for param "${l}"`),h(),o(),s}const _L="[^/]+?",Eie={sensitive:!1,strict:!1,start:!0,end:!0};var qs=(function(t){return t[t._multiplier=10]="_multiplier",t[t.Root=90]="Root",t[t.Segment=40]="Segment",t[t.SubSegment=30]="SubSegment",t[t.Static=40]="Static",t[t.Dynamic=20]="Dynamic",t[t.BonusCustomRegExp=10]="BonusCustomRegExp",t[t.BonusWildcard=-50]="BonusWildcard",t[t.BonusRepeatable=-20]="BonusRepeatable",t[t.BonusOptional=-8]="BonusOptional",t[t.BonusStrict=.7000000000000001]="BonusStrict",t[t.BonusCaseSensitive=.25]="BonusCaseSensitive",t})(qs||{});const Iie=/[.+*?^${}()[\]/\\]/g;function Cie(t,e){const n=En({},Eie,e),r=[];let s=n.start?"^":"";const i=[];for(const l of t){const d=l.length?[]:[qs.Root];n.strict&&!l.length&&(s+="/");for(let h=0;h<l.length;h++){const p=l[h];let g=qs.Segment+(n.sensitive?qs.BonusCaseSensitive:0);if(p.type===gd.Static)h||(s+="/"),s+=p.value.replace(Iie,"\\$&"),g+=qs.Static;else if(p.type===gd.Param){const{value:_,repeatable:v,optional:b,regexp:w}=p;i.push({name:_,repeatable:v,optional:b});const E=w||_L;if(E!==_L){g+=qs.BonusCustomRegExp;try{`${E}`}catch(R){throw new Error(`Invalid custom RegExp for param "${_}" (${E}): `+R.message)}}let T=v?`((?:${E})(?:/(?:${E}))*)`:`(${E})`;h||(T=b&&l.length<2?`(?:/${T})`:"/"+T),b&&(T+="?"),s+=T,g+=qs.Dynamic,b&&(g+=qs.BonusOptional),v&&(g+=qs.BonusRepeatable),E===".*"&&(g+=qs.BonusWildcard)}d.push(g)}r.push(d)}if(n.strict&&n.end){const l=r.length-1;r[l][r[l].length-1]+=qs.BonusStrict}n.strict||(s+="/?"),n.end?s+="$":n.strict&&!s.endsWith("/")&&(s+="(?:/|$)");const o=new RegExp(s,n.sensitive?"":"i");function a(l){const d=l.match(o),h={};if(!d)return null;for(let p=1;p<d.length;p++){const g=d[p]||"",_=i[p-1];h[_.name]=g&&_.repeatable?g.split("/"):g}return h}function c(l){let d="",h=!1;for(const p of t){(!h||!d.endsWith("/"))&&(d+="/"),h=!1;for(const g of p)if(g.type===gd.Static)d+=g.value;else if(g.type===gd.Param){const{value:_,repeatable:v,optional:b}=g,w=_ in l?l[_]:"";if(zo(w)&&!v)throw new Error(`Provided param "${_}" is an array but it is not repeatable (* or + modifiers)`);const E=zo(w)?w.join("/"):w;if(!E)if(b)p.length<2&&(d.endsWith("/")?d=d.slice(0,-1):h=!0);else throw new Error(`Missing required param "${_}"`);d+=E}}return d||"/"}return{re:o,score:r,keys:i,parse:a,stringify:c}}function Aie(t,e){let n=0;for(;n<t.length&&n<e.length;){const r=e[n]-t[n];if(r)return r;n++}return t.length<e.length?t.length===1&&t[0]===qs.Static+qs.Segment?-1:1:t.length>e.length?e.length===1&&e[0]===qs.Static+qs.Segment?1:-1:0}function YH(t,e){let n=0;const r=t.score,s=e.score;for(;n<r.length&&n<s.length;){const i=Aie(r[n],s[n]);if(i)return i;n++}if(Math.abs(s.length-r.length)===1){if(yL(r))return 1;if(yL(s))return-1}return s.length-r.length}function yL(t){const e=t[t.length-1];return t.length>0&&e[e.length-1]<0}const Rie={strict:!1,end:!0,sensitive:!1};function Pie(t,e,n){const r=Cie(Tie(t.path),n),s=En(r,{record:t,parent:e,children:[],alias:[]});return e&&!s.record.aliasOf==!e.record.aliasOf&&e.children.push(s),s}function kie(t,e){const n=[],r=new Map;e=uL(Rie,e);function s(h){return r.get(h)}function i(h,p,g){const _=!g,v=bL(h);v.aliasOf=g&&g.record;const b=uL(e,h),w=[v];if("alias"in h){const R=typeof h.alias=="string"?[h.alias]:h.alias;for(const N of R)w.push(bL(En({},v,{components:g?g.record.components:v.components,path:N,aliasOf:g?g.record:v})))}let E,T;for(const R of w){const{path:N}=R;if(p&&N[0]!=="/"){const O=p.record.path,S=O[O.length-1]==="/"?"":"/";R.path=p.record.path+(N&&S+N)}if(E=Pie(R,p,b),g?g.alias.push(E):(T=T||E,T!==E&&T.alias.push(E),_&&h.name&&!wL(E)&&o(h.name)),JH(E)&&c(E),v.children){const O=v.children;for(let S=0;S<O.length;S++)i(O[S],E,g&&g.children[S])}g=g||E}return T?()=>{o(T)}:Tg}function o(h){if(GH(h)){const p=r.get(h);p&&(r.delete(h),n.splice(n.indexOf(p),1),p.children.forEach(o),p.alias.forEach(o))}else{const p=n.indexOf(h);p>-1&&(n.splice(p,1),h.record.name&&r.delete(h.record.name),h.children.forEach(o),h.alias.forEach(o))}}function a(){return n}function c(h){const p=Oie(h,n);n.splice(p,0,h),h.record.name&&!wL(h)&&r.set(h.record.name,h)}function l(h,p){let g,_={},v,b;if("name"in h&&h.name){if(g=r.get(h.name),!g)throw Ff(gr.MATCHER_NOT_FOUND,{location:h});b=g.record.name,_=En(vL(p.params,g.keys.filter(T=>!T.optional).concat(g.parent?g.parent.keys.filter(T=>T.optional):[]).map(T=>T.name)),h.params&&vL(h.params,g.keys.map(T=>T.name))),v=g.stringify(_)}else if(h.path!=null)v=h.path,g=n.find(T=>T.re.test(v)),g&&(_=g.parse(v),b=g.record.name);else{if(g=p.name?r.get(p.name):n.find(T=>T.re.test(p.path)),!g)throw Ff(gr.MATCHER_NOT_FOUND,{location:h,currentLocation:p});b=g.record.name,_=En({},p.params,h.params),v=g.stringify(_)}const w=[];let E=g;for(;E;)w.unshift(E.record),E=E.parent;return{name:b,path:v,params:_,matched:w,meta:Die(w)}}t.forEach(h=>i(h));function d(){n.length=0,r.clear()}return{addRoute:i,resolve:l,removeRoute:o,clearRoutes:d,getRoutes:a,getRecordMatcher:s}}function vL(t,e){const n={};for(const r of e)r in t&&(n[r]=t[r]);return n}function bL(t){const e={path:t.path,redirect:t.redirect,name:t.name,meta:t.meta||{},aliasOf:t.aliasOf,beforeEnter:t.beforeEnter,props:Nie(t),children:t.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in t?t.components||null:t.component&&{default:t.component}};return Object.defineProperty(e,"mods",{value:{}}),e}function Nie(t){const e={},n=t.props||!1;if("component"in t)e.default=n;else for(const r in t.components)e[r]=typeof n=="object"?n[r]:n;return e}function wL(t){for(;t;){if(t.record.aliasOf)return!0;t=t.parent}return!1}function Die(t){return t.reduce((e,n)=>En(e,n.meta),{})}function Oie(t,e){let n=0,r=e.length;for(;n!==r;){const i=n+r>>1;YH(t,e[i])<0?r=i:n=i+1}const s=xie(t);return s&&(r=e.lastIndexOf(s,r-1)),r}function xie(t){let e=t;for(;e=e.parent;)if(JH(e)&&YH(t,e)===0)return e}function JH({record:t}){return!!(t.name||t.components&&Object.keys(t.components).length||t.redirect)}function SL(t){const e=vr(OT),n=vr(ZP),r=$e(()=>{const c=Wt(t.to);return e.resolve(c)}),s=$e(()=>{const{matched:c}=r.value,{length:l}=c,d=c[l-1],h=n.matched;if(!d||!h.length)return-1;const p=h.findIndex(Vf.bind(null,d));if(p>-1)return p;const g=TL(c[l-2]);return l>1&&TL(d)===g&&h[h.length-1].path!==g?h.findIndex(Vf.bind(null,c[l-2])):p}),i=$e(()=>s.value>-1&&Bie(n.params,r.value.params)),o=$e(()=>s.value>-1&&s.value===n.matched.length-1&&WH(n.params,r.value.params));function a(c={}){if(Fie(c)){const l=e[Wt(t.replace)?"replace":"push"](Wt(t.to)).catch(Tg);return t.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>l),l}return Promise.resolve()}return{route:r,href:$e(()=>r.value.href),isActive:i,isExactActive:o,navigate:a}}function Lie(t){return t.length===1?t[0]:t}const Mie=Ls({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:SL,setup(t,{slots:e}){const n=Xs(SL(t)),{options:r}=vr(OT),s=$e(()=>({[EL(t.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[EL(t.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const i=e.default&&Lie(e.default(n));return t.custom?i:On("a",{"aria-current":n.isExactActive?t.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:s.value},i)}}}),Vie=Mie;function Fie(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&!(t.button!==void 0&&t.button!==0)){if(t.currentTarget&&t.currentTarget.getAttribute){const e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function Bie(t,e){for(const n in e){const r=e[n],s=t[n];if(typeof r=="string"){if(r!==s)return!1}else if(!zo(s)||s.length!==r.length||r.some((i,o)=>i.valueOf()!==s[o].valueOf()))return!1}return!0}function TL(t){return t?t.aliasOf?t.aliasOf.path:t.path:""}const EL=(t,e,n)=>t??e??n,$ie=Ls({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(t,{attrs:e,slots:n}){const r=vr(TA),s=$e(()=>t.route||r.value),i=vr(mL,0),o=$e(()=>{let l=Wt(i);const{matched:d}=s.value;let h;for(;(h=d[l])&&!h.components;)l++;return l}),a=$e(()=>s.value.matched[o.value]);Sa(mL,$e(()=>o.value+1)),Sa(mie,a),Sa(TA,s);const c=Ae();return ft(()=>[c.value,a.value,t.name],([l,d,h],[p,g,_])=>{d&&(d.instances[h]=l,g&&g!==d&&l&&l===p&&(d.leaveGuards.size||(d.leaveGuards=g.leaveGuards),d.updateGuards.size||(d.updateGuards=g.updateGuards))),l&&d&&(!g||!Vf(d,g)||!p)&&(d.enterCallbacks[h]||[]).forEach(v=>v(l))},{flush:"post"}),()=>{const l=s.value,d=t.name,h=a.value,p=h&&h.components[d];if(!p)return IL(n.default,{Component:p,route:l});const g=h.props[d],_=g?g===!0?l.params:typeof g=="function"?g(l):g:null,b=On(p,En({},_,e,{onVnodeUnmounted:w=>{w.component.isUnmounted&&(h.instances[d]=null)},ref:c}));return IL(n.default,{Component:b,route:l})||b}}});function IL(t,e){if(!t)return null;const n=t(e);return n.length===1?n[0]:n}const QH=$ie;function Uie(t){const e=kie(t.routes,t),n=t.parseQuery||fie,r=t.stringifyQuery||pL,s=t.history,i=qm(),o=qm(),a=qm(),c=ht(so);let l=so;nf&&t.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const d=A0.bind(null,Y=>""+Y),h=A0.bind(null,Jse),p=A0.bind(null,i_);function g(Y,ve){let Ee,Me;return GH(Y)?(Ee=e.getRecordMatcher(Y),Me=ve):Me=Y,e.addRoute(Me,Ee)}function _(Y){const ve=e.getRecordMatcher(Y);ve&&e.removeRoute(ve)}function v(){return e.getRoutes().map(Y=>Y.record)}function b(Y){return!!e.getRecordMatcher(Y)}function w(Y,ve){if(ve=En({},ve||c.value),typeof Y=="string"){const j=R0(n,Y,ve.path),re=e.resolve({path:j.path},ve),Re=s.createHref(j.fullPath);return En(j,re,{params:p(re.params),hash:i_(j.hash),redirectedFrom:void 0,href:Re})}let Ee;if(Y.path!=null)Ee=En({},Y,{path:R0(n,Y.path,ve.path).path});else{const j=En({},Y.params);for(const re in j)j[re]==null&&delete j[re];Ee=En({},Y,{params:h(j)}),ve.params=h(ve.params)}const Me=e.resolve(Ee,ve),Ke=Y.hash||"";Me.params=d(p(Me.params));const ut=Zse(r,En({},Y,{hash:Kse(Ke),path:Me.path})),H=s.createHref(ut);return En({fullPath:ut,hash:Ke,query:r===pL?pie(Y.query):Y.query||{}},Me,{redirectedFrom:void 0,href:H})}function E(Y){return typeof Y=="string"?R0(n,Y,c.value.path):En({},Y)}function T(Y,ve){if(l!==Y)return Ff(gr.NAVIGATION_CANCELLED,{from:ve,to:Y})}function R(Y){return S(Y)}function N(Y){return R(En(E(Y),{replace:!0}))}function O(Y,ve){const Ee=Y.matched[Y.matched.length-1];if(Ee&&Ee.redirect){const{redirect:Me}=Ee;let Ke=typeof Me=="function"?Me(Y,ve):Me;return typeof Ke=="string"&&(Ke=Ke.includes("?")||Ke.includes("#")?Ke=E(Ke):{path:Ke},Ke.params={}),En({query:Y.query,hash:Y.hash,params:Ke.path!=null?{}:Y.params},Ke)}}function S(Y,ve){const Ee=l=w(Y),Me=c.value,Ke=Y.state,ut=Y.force,H=Y.replace===!0,j=O(Ee,Me);if(j)return S(En(E(j),{state:typeof j=="object"?En({},Ke,j.state):Ke,force:ut,replace:H}),ve||Ee);const re=Ee;re.redirectedFrom=ve;let Re;return!ut&&eie(r,Me,Ee)&&(Re=Ff(gr.NAVIGATION_DUPLICATED,{to:re,from:Me}),fe(Me,Me,!0,!1)),(Re?Promise.resolve(Re):k(re,Me)).catch(ge=>uc(ge)?uc(ge,gr.NAVIGATION_GUARD_REDIRECT)?ge:de(ge):G(ge,re,Me)).then(ge=>{if(ge){if(uc(ge,gr.NAVIGATION_GUARD_REDIRECT))return S(En({replace:H},E(ge.to),{state:typeof ge.to=="object"?En({},Ke,ge.to.state):Ke,force:ut}),ve||re)}else ge=M(re,Me,!0,H,Ke);return L(re,Me,ge),ge})}function I(Y,ve){const Ee=T(Y,ve);return Ee?Promise.reject(Ee):Promise.resolve()}function P(Y){const ve=pe.values().next().value;return ve&&typeof ve.runWithContext=="function"?ve.runWithContext(Y):Y()}function k(Y,ve){let Ee;const[Me,Ke,ut]=gie(Y,ve);Ee=k0(Me.reverse(),"beforeRouteLeave",Y,ve);for(const j of Me)j.leaveGuards.forEach(re=>{Ee.push(xl(re,Y,ve))});const H=I.bind(null,Y,ve);return Ee.push(H),Ve(Ee).then(()=>{Ee=[];for(const j of i.list())Ee.push(xl(j,Y,ve));return Ee.push(H),Ve(Ee)}).then(()=>{Ee=k0(Ke,"beforeRouteUpdate",Y,ve);for(const j of Ke)j.updateGuards.forEach(re=>{Ee.push(xl(re,Y,ve))});return Ee.push(H),Ve(Ee)}).then(()=>{Ee=[];for(const j of ut)if(j.beforeEnter)if(zo(j.beforeEnter))for(const re of j.beforeEnter)Ee.push(xl(re,Y,ve));
5else Ee.push(xl(j.beforeEnter,Y,ve));return Ee.push(H),Ve(Ee)}).then(()=>(Y.matched.forEach(j=>j.enterCallbacks={}),Ee=k0(ut,"beforeRouteEnter",Y,ve,P),Ee.push(H),Ve(Ee))).then(()=>{Ee=[];for(const j of o.list())Ee.push(xl(j,Y,ve));return Ee.push(H),Ve(Ee)}).catch(j=>uc(j,gr.NAVIGATION_CANCELLED)?j:Promise.reject(j))}function L(Y,ve,Ee){a.list().forEach(Me=>P(()=>Me(Y,ve,Ee)))}function M(Y,ve,Ee,Me,Ke){const ut=T(Y,ve);if(ut)return ut;const H=ve===so,j=nf?history.state:{};Ee&&(Me||H?s.replace(Y.fullPath,En({scroll:H&&j&&j.scroll},Ke)):s.push(Y.fullPath,Ke)),c.value=Y,fe(Y,ve,Ee,H),de()}let V;function z(){V||(V=s.listen((Y,ve,Ee)=>{if(!Ce.listening)return;const Me=w(Y),Ke=O(Me,Ce.currentRoute.value);if(Ke){S(En(Ke,{replace:!0,force:!0}),Me).catch(Tg);return}l=Me;const ut=c.value;nf&&cie(fL(ut.fullPath,Ee.delta),DT()),k(Me,ut).catch(H=>uc(H,gr.NAVIGATION_ABORTED|gr.NAVIGATION_CANCELLED)?H:uc(H,gr.NAVIGATION_GUARD_REDIRECT)?(S(En(E(H.to),{force:!0}),Me).then(j=>{uc(j,gr.NAVIGATION_ABORTED|gr.NAVIGATION_DUPLICATED)&&!Ee.delta&&Ee.type===wA.pop&&s.go(-1,!1)}).catch(Tg),Promise.reject()):(Ee.delta&&s.go(-Ee.delta,!1),G(H,Me,ut))).then(H=>{H=H||M(Me,ut,!1),H&&(Ee.delta&&!uc(H,gr.NAVIGATION_CANCELLED)?s.go(-Ee.delta,!1):Ee.type===wA.pop&&uc(H,gr.NAVIGATION_ABORTED|gr.NAVIGATION_DUPLICATED)&&s.go(-1,!1)),L(Me,ut,H)}).catch(Tg)}))}let ie=qm(),K=qm(),ce;function G(Y,ve,Ee){de(Y);const Me=K.list();return Me.length?Me.forEach(Ke=>Ke(Y,ve,Ee)):console.error(Y),Promise.reject(Y)}function Z(){return ce&&c.value!==so?Promise.resolve():new Promise((Y,ve)=>{ie.add([Y,ve])})}function de(Y){return ce||(ce=!Y,z(),ie.list().forEach(([ve,Ee])=>Y?Ee(Y):ve()),ie.reset()),Y}function fe(Y,ve,Ee,Me){const{scrollBehavior:Ke}=t;if(!nf||!Ke)return Promise.resolve();const ut=!Ee&&lie(fL(Y.fullPath,0))||(Me||!Ee)&&history.state&&history.state.scroll||null;return zs().then(()=>Ke(Y,ve,ut)).then(H=>H&&aie(H)).catch(H=>G(H,Y,ve))}const ee=Y=>s.go(Y);let Te;const pe=new Set,Ce={currentRoute:c,listening:!0,addRoute:g,removeRoute:_,clearRoutes:e.clearRoutes,hasRoute:b,getRoutes:v,resolve:w,options:t,push:R,replace:N,go:ee,back:()=>ee(-1),forward:()=>ee(1),beforeEach:i.add,beforeResolve:o.add,afterEach:a.add,onError:K.add,isReady:Z,install(Y){Y.component("RouterLink",Vie),Y.component("RouterView",QH),Y.config.globalProperties.$router=Ce,Object.defineProperty(Y.config.globalProperties,"$route",{enumerable:!0,get:()=>Wt(c)}),nf&&!Te&&c.value===so&&(Te=!0,R(s.location).catch(Me=>{}));const ve={};for(const Me in so)Object.defineProperty(ve,Me,{get:()=>c.value[Me],enumerable:!0});Y.provide(OT,Ce),Y.provide(ZP,ao(ve)),Y.provide(TA,c);const Ee=Y.unmount;pe.add(Y),Y.unmount=function(){pe.delete(Y),pe.size<1&&(l=so,V&&V(),V=null,c.value=so,Te=!1,ce=!1),Ee()}}};function Ve(Y){return Y.reduce((ve,Ee)=>ve.then(()=>P(Ee)),Promise.resolve())}return Ce}function V2e(){return vr(OT)}function XH(t){return vr(ZP)}const Hie=/(:\w+)\([^)]+\)/g,qie=/(:\w+)[?+*]/g,jie=/:\w+/g,Wie=(t,e)=>e.path.replace(Hie,"$1").replace(qie,"$1").replace(jie,n=>t.params[n.slice(1)]?.toString()||""),EA=(t,e)=>{const n=t.route.matched.find(s=>s.components?.default===t.Component.type),r=e??n?.meta.key??(n&&Wie(t.route,n));return typeof r=="function"?r(t.route):r},Gie=(t,e)=>({default:()=>t?On(Y$,t===!0?{}:t,e):e});function ZH(t){return Array.isArray(t)?t:[t]}const Kie="modulepreload",zie=function(t,e){return new URL(t,e).href},CL={},at=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let l=function(d){return Promise.all(d.map(h=>Promise.resolve(h).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};const o=document.getElementsByTagName("link"),a=document.querySelector("meta[property=csp-nonce]"),c=a?.nonce||a?.getAttribute("nonce");s=l(n.map(d=>{if(d=zie(d,r),d in CL)return;CL[d]=!0;const h=d.endsWith(".css"),p=h?'[rel="stylesheet"]':"";if(r)for(let _=o.length-1;_>=0;_--){const v=o[_];if(v.href===d&&(!h||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${d}"]${p}`))return;const g=document.createElement("link");if(g.rel=h?"stylesheet":Kie,h||(g.as="script"),g.crossOrigin="",g.href=d,c&&g.setAttribute("nonce",c),document.head.appendChild(g),h)return new Promise((_,v)=>{g.addEventListener("load",_),g.addEventListener("error",()=>
5v(new Error(`Unable to preload CSS for ${d}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})},Yie={layout:"owner-v2"},Jie={layout:"owner-v2"},Qie={layout:"owner-v2"},Xie={layout:"owner-v2"},Zie={layout:"owner-v2"},eoe={layout:"owner-v2"},toe={layout:"owner-v2"},noe={layout:"owner-v2"},roe={layout:"owner-v2"},soe={layout:"v2-scroll"},ioe={layout:"owner-v2"},ooe={layout:"owner-v2"},aoe={layout:"clear"},coe={layout:"clear"},loe={layout:"owner-v2"},uoe={layout:"v2-scroll"},doe={layout:"v2-scroll"},hoe={layout:"v2-scroll"},foe={layout:"v2"},poe={layout:"v2-scroll"},moe={layout:"v2-scroll"},goe={layout:"v2-scroll"},_oe={layout:"v2-scroll"},yoe={layout:"v2"},voe={layout:"clear"},boe={layout:!1},woe={layout:"clear"},Soe={layout:"v2"},Toe={layout:!1},Eoe={layout:"v2"},Ioe={layout:!1},Coe={layout:!1},Aoe={layout:"clear"},Roe={layout:"v2"},Poe={layout:!1},koe={layout:"clear"},Noe={layout:"v2-scroll",middleware:[t=>{if(t.query.enterPos==="1")return co("/v2/pos",{replace:!0})}]},Doe={layout:"clean"},N0=[{name:"v2-owner-report-mobile-reports-activities-by-time",path:"/v2-owner-report-mobile/reports/activities-by-time",meta:{...Yie||{},middleware:"owner-v2"},component:()=>at(()=>import("./BgpILpws.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]),import.meta.url)},{name:"v2-owner-report-mobile-reports-expense",path:"/v2-owner-report-mobile/reports/expense",meta:{...Jie||{},middleware:"owner-v2"},component:()=>at(()=>import("./BswYsTUm.js"),__vite__mapDeps([10,1,2,3,4,5,7,8]),import.meta.url)},{name:"v2-owner-report-mobile-reports-open-menu",path:"/v2-owner-report-mobile/reports/open-menu",meta:{...Qie||{},middleware:"owner-v2"},component:()=>at(()=>import("./CP8-iGWH.js"),__vite__mapDeps([11,1,2,3,4,5,7,12,8]),import.meta.url)},{name:"v2-owner-report-mobile-reports-prices",path:"/v2-owner-report-mobile/reports/prices",meta:{...Xie||{},middleware:"owner-v2"},component:()=>at(()=>import("./B5wgKkrJ.js"),__vite__mapDeps([13,1,2,3,4,5,7,8]),import.meta.url)},{name:"v2-owner-report-mobile-reports-products",path:"/v2-owner-report-mobile/reports/products",meta:{...Zie||{},middleware:"owner-v2"},component:()=>at(()=>import("./BeQ9i0De.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,8]),import.meta.url)},{name:"v2-owner-report-mobile-reports-receipts",path:"/v2-owner-report-mobile/reports/receipts",meta:{...eoe||{},middleware:"owner-v2"},component:()=>at(()=>import("./DuUMSwZ4.js"),__vite__mapDeps([15,2,3,4,5,7,8]),import.meta.url)},{name:"v2-owner-report-mobile-reports-stock",path:"/v2-owner-report-mobile/reports/stock",meta:{...toe||{},middleware:"owner-v2"},component:()=>at(()=>import("./BEtFAnFB.js"),__vite__mapDeps([16,1,4,5,17,8]),import.meta.url)},{name:"v2-owner-report-mobile-reports-summary-daily",path:"/v2-owner-report-mobile/reports/summary-daily",meta:{...noe||{},middleware:"owner-v2"},component:()=>at(()=>import("./jNweRM85.js"),__vite__mapDeps([18,1,2,3,4,5,6,7,8]),import.meta.url)},{name:"v2-owner-report-mobile-reports-void-items",path:"/v2-owner-report-mobile/reports/void-items",meta:{...roe||{},middleware:"owner-v2"},component:()=>at(()=>import("./D9FjbYN7.js"),__vite__mapDeps([19,1,2,3,4,5,7,8]),import.meta.url)},{name:"v2-payment-resultEmail",path:"/v2/payment/resultEmail",meta:soe||{},component:()=>at(()=>import("./CcZEz2t_.js"),__vite__mapDeps([20,21,22]),import.meta.url)},{name:"v2-owner-report-mobile-account",path:"/v2-owner-report-mobile/account",meta:{...ioe||{},middleware:"owner-v2"},component:()=>at(()=>import("./B-YGbAXf.js"),__vite__mapDeps([23,24,5]),import.meta.url)},{name:"v2-owner-report-mobile-dashboard",path:"/v2-owner-report-mobile/dashboard",meta:{...ooe||{},middleware:"owner-v2"},component:()=>at(()=>import("./DaLUHD30.js"),__vite__mapDeps([25,1]),import.meta.url)},{name:"v2-owner-report-mobile-link-shop",path:"/v2-owner-report-mobile/link-shop",meta:{...aoe||{},middleware:"owner-v2"},component:()=>at(()=>import("./CRCO37L2.js"),[],import.meta.url)},{name:"v2-owner-report-mobile-login",path:"/v2-owner-report-mobile/login",meta:{...coe||{},middleware:"owner-v2"},component:()=>at(()=>import("./Dk9Y-NdX.js"),[],import.meta.url)},{name:"v2-owner-report-mobile-reports",path:"/v2-owner-report-mobile/reports",meta:{...loe||{},middleware:"owner-v2"},component:()=>at(()=>import("./Di3L3Vev.js"),__vite__mapDeps([26,1,8]),import.meta.url)},{name:"v2-edit-bill",path:"/v2/edit-bill",meta:uoe||{},component:()=>at(()=>import("./BY5-5V-N.js"),__vite__mapDeps([27,21,28,29,30]),import.meta.url)},{name:"v2-expense",path:"/v2/expense",meta:doe||{},component:()=>at(()=>import("./-Wpko77v.js"),__vite__mapDeps([31,21,32,2,3,33,34,35]),import.meta.url)},{name:"v2-menu",path:"/v2/menu",meta:hoe||{},component:()=>at(()=>import("./Da3hVJif.js"),__vite__mapDeps([36,34,21,24,37,38]),import.meta.url)},{name:"v2-pos",path:"/v2/pos",meta:{...foe||{},middleware:"pos-expiry"},component:()=>at(()=>import("./10nt8a6J.js"),__vite__mapDeps([39,40,41,21,42,43,44,28,29,34,45,46]),import.meta.url)},{name:"v2-reports",path:"/v2/reports",meta:poe||{},component:()=>at(()=>import("./D82mP724.js"),__vite__mapDeps([47,21,32,2,3,33,48,37,30,17,49,50,28,29,6,12,51]),import.meta.url)},{name:"v2-settings",path:"/v2/settings",meta:moe||{},component:()=>at(()=>import("./C-dH-SmL.js"),__vite__mapDeps([52,21,34,53,54,55,56]),import.meta.url)},{name:"v2-stock",path:"/v2/stock",meta:goe||{},component:()=>at(()=>import("./Bas2raVR.js"),__vite__mapDeps([57,34,21,17,48,37,2,3,30,49,50,42,54,55,58]),import.meta.url)},{name:"v2-top-up",path:"/v2/top-up",meta:_oe||{},component:()=>at(()=>import("./BjmXN5Lu.js"),__vite__mapDeps([59,21,60,61]),import.meta.url)},{name:"v2-waiting-for-shop",path:"/v2/waiting-for-shop",meta:yoe||{},component:()=>at(()=>import("./DSkofBne.js"),__vite__mapDeps([62,63]),import.meta.url)},{name:"account-expired",path:"/account-expired",meta:voe||{},component:()=>at(()=>import("./BMxhG1VS.js"),[],import.meta.url)},{name:"add-day",path:"/add-day",component:()=>at(()=>import("./Bg54QVma.js"),__vite__mapDeps([64,60]),import.meta.url)},{name:"clear-cache",path:"/clear-cache",meta:boe||{},component:()=>at(()=>import("./d5tFRxd0.js"),[],import.meta.url)},{name:"download",path:"/download",component:()=>at(()=>import("./D9GDNpk2.js"),__vite__mapDeps([65,66]),import.meta.url)},{name:"home",path:"/home",component:()=>at(()=>import("./BkZJRs7I.js"),__vite__mapDeps([67,68,21]),import.meta.url)},{name:"login",path:"/login",meta:woe||{},component:()=>at(()=>import("./EvDmEVFo.js"),__vite__mapDeps([69,1,70]),import.meta.url)},{name:"logs",path:"/logs",component:()=>at(()=>import("./C7ZXS4hD.js"),[],import.meta.url)},{name:"maintainance",path:"/maintainance",component:()=>at(()=>import("./CYL6N5ay.js"),[],import.meta.url)},{name:"no-permission",path:"/no-permission",meta:Soe||{},component:()=>at(()=>import("./a3g7Jh3w.js"),__vite__mapDeps([71,72]),import.meta.url)},{name:"offline-blocked",path:"/offline-blocked",meta:Toe||{},component:()=>at(()=>import("./DhwUz-mT.js"),[],import.meta.url)},{name:"openShop",path:"/openShop",meta:Eoe||{},component:()=>at(()=>import("./31277awR.js"),__vite__mapDeps([73,74]),import.meta.url)},{name:"poc-rtdb",path:"/poc-rtdb",meta:Ioe||{},component:()=>at(()=>import("./JBuZ2jxy.js"),__vite__mapDeps([75,76]),import.meta.url)},{name:"pos",path:"/pos",meta:{middleware:"pos-expiry"},component:()=>at(()=>import("./mO41DfHz.js"),__vite__mapDeps([77,40,41,21,42,43,29,45,78]),import.meta.url)},{name:"pos-cashier-changed",path:"/pos-cashier-changed",meta:Coe||{},component:()=>at(()=>import("./D76axGi3.js"),[],import.meta.url)},{name:"register",path:"/register",meta:Aoe||{},component:()=>at(()=>import("./BbwfBO56.js"),__vite__mapDeps([79,80]),import.meta.url)},{name:"runMode",path:"/runMode",meta:Roe||{},component:()=>at(()=>import("./oiKf0-Bl.js"),__vite__mapDeps([81,45,82]),import.meta.url)},{name:"sentry-test",path:"/sentry-test",meta:Poe||{},component:()=>at(()=>import("./tN4IUqBD.js"),[],import.meta.url)},{name:"upgrade-package",path:"/upgrade-package",meta:koe||{},component:()=>at(()=>import("./B_WpL4mR.js"),[],import.meta.url)},{name:"v2",path:"/v2",meta:Noe||{},component:()=>at(()=>import("./BT-WTgmC.js"),__vite__mapDeps([83,1,21,68,84]),import.meta.url)},{name:"v2-owner-report-mobile",path:"/v2-owner-report-mobile",meta:{...Doe||{},middleware:"owner-v2"},component:()=>at(()=>import("./BiNOwJOe.js"),__vite__mapDeps([85,86]),import.meta.url)},{name:"index",path:"/",component:()=>at(()=>import("./Q-MmA_hJ.js"),__vite__mapDeps([87,88]),import.meta.url)}],e4=(t,e)=>({default:()=>t?On(BU,t===!0?{}:t,e):e.default?.()}
5),Ooe=/(:\w+)\([^)]+\)/g,xoe=/(:\w+)[?+*]/g,Loe=/:\w+/g;function AL(t){const e=t?.meta.key??t.path.replace(Ooe,"$1").replace(xoe,"$1").replace(Loe,n=>t.params[n.slice(1)]?.toString()||"");return typeof e=="function"?e(t):e}function Moe(t,e){return t===e||e===so?!1:AL(t)!==AL(e)?!0:!t.matched.every((r,s)=>r.components&&r.components.default===e.matched[s]?.components?.default)}function Voe(t,e=!1){if(t){if(t.nodeName==="#comment"&&t.nodeValue==="[")return t4(t,[],e);if(e){const n=t.cloneNode(!0);return n.querySelectorAll("[data-island-slot]").forEach(r=>{r.innerHTML=""}),[n.outerHTML]}return[t.outerHTML]}}function t4(t,e=[],n=!1){if(t&&t.nodeName){if($oe(t))return e;if(!Boe(t)){const r=t.cloneNode(!0);n&&r.querySelectorAll?.("[data-island-slot]").forEach(s=>{s.innerHTML=""}),e.push(r.outerHTML)}t4(t.nextSibling,e,n)}return e}function Foe(t,e){const n=t?Voe(t):[e];return n?AU(n.join(""),n.length):On("div")}function Boe(t){return t.nodeName==="#comment"&&t.nodeValue==="["}function $oe(t){return t.nodeName==="#comment"&&t.nodeValue==="]"}function RL(t){return Array.isArray(t)?t:[t]}function n4(t){const e=[];for(const n of t)n&&e.push({...n,onAfterLeave:n.onAfterLeave?RL(n.onAfterLeave):void 0,onBeforeLeave:n.onBeforeLeave?RL(n.onBeforeLeave):void 0});return TH(...e)}const Uoe={scrollBehavior(t,e,n){const r=xt(),s=Os().options?.scrollBehaviorType??"auto";return t.path.replace(/\/$/,"")===e.path.replace(/\/$/,"")?e.hash&&!t.hash?{left:0,top:0}:t.hash?{el:t.hash,top:r4(t.hash),behavior:s}:!1:(typeof t.meta.scrollToTop=="function"?t.meta.scrollToTop(t,e):t.meta.scrollToTop)===!1?!1:e===so?PL(t,e,n,s):new Promise(o=>{const a=()=>{requestAnimationFrame(()=>o(PL(t,e,n,s)))};r.hooks.hookOnce("page:loading:end",()=>{const c=r["~transitionPromise"];c?c.then(a):a()})})}};function r4(t){try{const e=document.querySelector(t);if(e)return(Number.parseFloat(getComputedStyle(e).scrollMarginTop)||0)+(Number.parseFloat(getComputedStyle(document.documentElement).scrollPaddingTop)||0)}catch{}return 0}function PL(t,e,n,r){return n||(t.hash?{el:t.hash,top:r4(t.hash),behavior:Moe(t,e)?r:"instant"}:{left:0,top:0})}const Hoe={hashMode:!1,scrollBehaviorType:"auto"},Tl={...Hoe,...Uoe},qoe=async(t,e)=>{let n,r;if(!t.meta?.validate)return;const s=([n,r]=Wl(()=>Promise.resolve(t.meta.validate(t))),n=await n,r(),n);if(s===!0)return;const i=Gl({fatal:!0,status:s&&(s.status||s.statusCode)||404,statusText:s&&(s.statusText||s.statusMessage)||`Page Not Found: ${t.fullPath}`,data:{path:t.fullPath}});return typeof window<"u"&&window.history.pushState({},"",e.fullPath),i},joe=()=>xt().$device,Woe=t=>{if(t.path.startsWith("/v2-owner-report-mobile")||!(t.path==="/"||t.path==="/login")||t.query.force==="desktop")return;if(t.query.force==="owner")return co("/v2-owner-report-mobile");const{isMobile:n}=joe();if(n)return co("/v2-owner-report-mobile")};function s4(t,e,n){if(typeof t=="function"?t===e:t.has(e))return arguments.length<3?e:n;throw new TypeError("Private element is not present on this object")}function Goe(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function kL(t,e){return t.get(s4(t,e))}function Koe(t,e,n){Goe(t,e),e.set(t,n)}function zoe(t,e,n){return t.set(s4(t,e),n),n}const Yoe=100,gt={},Joe=()=>{gt.previousActiveElement instanceof HTMLElement?(gt.previousActiveElement.focus(),gt.previousActiveElement=null):document.body&&document.body.focus()},Qoe=t=>new Promise(e=>{if(!t)return e();const n=window.scrollX,r=window.scrollY;gt.restoreFocusTimeout=setTimeout(()=>{Joe(),e()},Yoe),window.scrollTo(n,r)}),i4="swal2-",Xoe=["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"],Se=Xoe.reduce((t,e)=>(t[e]=i4+e,t),{}),Zoe=["success","warning","info","question","error"],Uw=Zoe.reduce((t,e)=>(t[e]=i4+e,t),{}),o4="SweetAlert2:",ek=t=>t.charAt(0).toUpperCase()+t.slice(1),Ys=t=>{console.warn(`${o4} ${typeof t=="object"?t.join(" "):t}`)},ch=t=>{console.error(`${o4} ${t}`)},NL=[],eae=t=>{NL.includes(t)||(NL.push(t),Ys(t))},a4=(t,e=null)=>{eae(`"${t}" is deprecated and will be removed in the next major release.${e?` Use "${e}" instead.`:""}`)},xT=t=>typeof t=="function"?t():t,tk=t=>t&&typeof t.toPromise=="function",X_=t=>tk(t)?t.toPromise():Promise.resolve(t),nk=t=>t&&Promise.resolve(t)===t,Zs=()=>document.body.querySelector(`.${Se.container}`),Z_=t=>{const e=Zs();return e?e.querySelector(t):null},qi=t=>Z_(`.${t}`),hn=()=>qi(Se.popup),Ip=()=>qi(Se.icon),tae=()=>qi(Se["icon-content"]),c4=()=>qi(Se.title),rk=()=>qi(Se["html-container"]),l4=()=>qi(Se.image),sk=()=>qi(Se["progress-steps"]),LT=()=>qi(Se["validation-message"]),Na=()=>Z_(`.${Se.actions} .${Se.confirm}`),Cp=()=>Z_(`.${Se.actions} .${Se.cancel}`),lh=()=>Z_(`.${Se.actions} .${Se.deny}`),nae=()=>qi(Se["input-label"]),Ap=()=>Z_(`.${Se.loader}`),ey=()=>qi(Se.actions),u4=()=>qi(Se.footer),MT=()=>qi(Se["timer-progress-bar"]),ik=()=>qi(Se.close),rae=` 6 a[href], 7 area[href], 8 input:not([disabled]), 9 select:not([disabled]), 10 textarea:not([disabled]), 11 button:not([disabled]), 12 iframe, 13 object, 14 embed, 15 [tabindex="0"], 16 [contenteditable], 17 audio[controls], 18 video[controls], 19 summary 20`,ok=()=>{const t=hn();if(!t)return[];
20const e=t.querySelectorAll('[tabindex]:not([tabindex="-1"]):not([tabindex="0"])'),n=Array.from(e).sort((i,o)=>{const a=parseInt(i.getAttribute("tabindex")||"0"),c=parseInt(o.getAttribute("tabindex")||"0");return a>c?1:a<c?-1:0}),r=t.querySelectorAll(rae),s=Array.from(r).filter(i=>i.getAttribute("tabindex")!=="-1");return[...new Set(n.concat(s))].filter(i=>_i(i))},ak=()=>kc(document.body,Se.shown)&&!kc(document.body,Se["toast-shown"])&&!kc(document.body,Se["no-backdrop"]),VT=()=>{const t=hn();return t?kc(t,Se.toast):!1},sae=()=>{const t=hn();return t?t.hasAttribute("data-loading"):!1},ji=(t,e)=>{if(t.textContent="",e){const r=new DOMParser().parseFromString(e,"text/html"),s=r.querySelector("head");s&&Array.from(s.childNodes).forEach(o=>{t.appendChild(o)});const i=r.querySelector("body");i&&Array.from(i.childNodes).forEach(o=>{o instanceof HTMLVideoElement||o instanceof HTMLAudioElement?t.appendChild(o.cloneNode(!0)):t.appendChild(o)})}},kc=(t,e)=>{if(!e)return!1;const n=e.split(/\s+/);for(let r=0;r<n.length;r++)if(!t.classList.contains(n[r]))return!1;return!0},iae=(t,e)=>{Array.from(t.classList).forEach(n=>{!Object.values(Se).includes(n)&&!Object.values(Uw).includes(n)&&!Object.values(e.showClass||{}).includes(n)&&t.classList.remove(n)})},Ui=(t,e,n)=>{if(iae(t,e),!e.customClass)return;const r=e.customClass[n];if(r){if(typeof r!="string"&&!r.forEach){Ys(`Invalid type of customClass.${n}! Expected string or iterable object, got "${typeof r}"`);return}_n(t,r)}},FT=(t,e)=>{if(!e)return null;switch(e){case"select":case"textarea":case"file":return t.querySelector(`.${Se.popup} > .${Se[e]}`);case"checkbox":return t.querySelector(`.${Se.popup} > .${Se.checkbox} input`);case"radio":return t.querySelector(`.${Se.popup} > .${Se.radio} input:checked`)||t.querySelector(`.${Se.popup} > .${Se.radio} input:first-child`);case"range":return t.querySelector(`.${Se.popup} > .${Se.range} input`);default:return t.querySelector(`.${Se.popup} > .${Se.input}`)}},d4=t=>{if(t.focus(),t.type!=="file"){const e=t.value;t.value="",t.value=e}},h4=(t,e,n)=>{!t||!e||(typeof e=="string"&&(e=e.split(/\s+/).filter(Boolean)),e.forEach(r=>{Array.isArray(t)?t.forEach(s=>{n?s.classList.add(r):s.classList.remove(r)}):n?t.classList.add(r):t.classList.remove(r)}))},_n=(t,e)=>{h4(t,e,!0)},yo=(t,e)=>{h4(t,e,!1)},$l=(t,e)=>{const n=Array.from(t.children);for(let r=0;r<n.length;r++){const s=n[r];if(s instanceof HTMLElement&&kc(s,e))return s}},Dd=(t,e,n)=>{n===`${parseInt(`${n}`)}`&&(n=parseInt(n)),n||parseInt(`${n}`)===0?t.style.setProperty(e,typeof n=="number"?`${n}px`:n):t.style.removeProperty(e)},fs=(t,e="flex")=>{t&&(t.style.display=e)},xs=t=>{t&&(t.style.display="none")},ck=(t,e="block")=>{t&&new MutationObserver(()=>{ty(t,t.innerHTML,e)}).observe(t,{childList:!0,subtree:!0})},DL=(t,e,n,r)=>{const s=t.querySelector(e);s&&s.style.setProperty(n,r)},ty=(t,e,n="flex")=>{e?fs(t,n):xs(t)},_i=t=>!!(t&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)),oae=()=>!_i(Na())&&!_i(lh())&&!_i(Cp()),IA=t=>t.scrollHeight>t.clientHeight,aae=(t,e)=>{let n=t;for(;n&&n!==e;){if(IA(n))return!0;n=n.parentElement}return!1},f4=t=>{const e=window.getComputedStyle(t),n=parseFloat(e.getPropertyValue("animation-duration")||"0"),r=parseFloat(e.getPropertyValue("transition-duration")||"0");return n>0||r>0},lk=(t,e=!1)=>{const n=MT();n&&_i(n)&&(e&&(n.style.transition="none",n.style.width="100%"),setTimeout(()=>{n.style.transition=`width ${t/1e3}s linear`,n.style.width="0%"},10))},cae=()=>{const t=MT();if(!t)return;const e=parseInt(window.getComputedStyle(t).width);t.style.removeProperty("transition"),t.style.width="100%";const n=parseInt(window.getComputedStyle(t).width),r=e/n*100;t.style.width=`${r}%`},lae=()=>typeof window>"u"||typeof document>"u",uae=` 21 <div aria-labelledby="${Se.title}" aria-describedby="${Se["html-container"]}" class="${Se.popup}" tabindex="-1"> 22 <button type="button" class="${Se.close}"></button> 23 <ul class="${Se["progress-steps"]}"></ul> 24 <div class="${Se.icon}"></div> 25 <img class="${Se.image}" /> 26 <h2 class="${Se.title}" id="${Se.title}"></h2> 27 <div class="${Se["html-container"]}" id="${Se["html-container"]}"></div> 28 <input class="${Se.input}" id="${Se.input}" /> 29 <input type="file" class="${Se.file}" /> 30 <div class="${Se.range}"> 31 <input type="range" /> 32 <output></output> 33 </div> 34 <select class="${Se.select}" id="${Se.select}"></select> 35 <div class="${Se.radio}"></div> 36 <label class="${Se.checkbox}"> 37 <input type="checkbox" id="${Se.checkbox}" /> 38 <span class="${Se.label}"></span> 39 </label> 40 <textarea class="${Se.textarea}" id="${Se.textarea}"></textarea> 41 <div class="${Se["validation-message"]}" id="${Se["validation-message"]}"></div> 42 <div class="${Se.actions}"> 43 <div class="${Se.loader}"></div> 44 <button type="button" class="${Se.confirm}"></button> 45 <button type="button" class="${Se.deny}"></button> 46 <button type="button" class="${Se.cancel}"></button> 47 </div> 48 <div class="${Se.footer}"></div> 49 <div class="${Se["timer-progress-bar-container"]}"> 50 <div class="${Se["timer-progress-bar"]}"></div> 51 </div> 52 </div> 53`.replace(/(^|\n)\s*/g,""),dae=()=>{const t=Zs();return t?(t.remove(),yo([document.documentElement,document.body],[Se["no-backdrop"],Se["toast-shown"],Se["has-column"]]),!0):!1},Qu=()=>{gt.currentInstance.resetValidationMessage()},hae=()=>{const t=hn(),e=$l(t,Se.input),n=$l(t,Se.file),r=t.querySelector(`.${Se.range} input`),s=t.querySelector(`.${Se.range} output`),i=$l(t,Se.select),o=t.querySelector(`.${Se.checkbox} input`),a=$l(t,Se.textarea);e.oninput=Qu,n.onchange=Qu,i.onchange=Qu,o.onchange=Qu,a.oninput=Qu,r.oninput=()=>{Qu(),s.value=r.value},r.onchange=()=>{Qu(),s.value=r.value}},fae=t=>typeof t=="string"?document.querySelector(t):t,pae=t=>{const e=hn();e.setAttribute("role",t.toast?"alert":"dialog"),e.setAttribute("aria-live",t.toast?"polite":"assertive"),t.toast||e.setAttribute("aria-modal","true")},mae=t=>{window.getComputedStyle(t).direction==="rtl"&&_n(Zs(),Se.rtl)},gae=t=>{const e=dae();if(lae()){ch("SweetAlert2 requires document to initialize");return}const n=document.createElement("div");
53n.className=Se.container,e&&_n(n,Se["no-transition"]),ji(n,uae),n.dataset.swal2Theme=t.theme;const r=fae(t.target);r.appendChild(n),t.topLayer&&(n.setAttribute("popover",""),n.showPopover()),pae(t),mae(r),hae()},uk=(t,e)=>{t instanceof HTMLElement?e.appendChild(t):typeof t=="object"?_ae(t,e):t&&ji(e,t)},_ae=(t,e)=>{t.jquery?yae(e,t):ji(e,t.toString())},yae=(t,e)=>{if(t.textContent="",0 in e)for(let n=0;n in e;n++)t.appendChild(e[n].cloneNode(!0));else t.appendChild(e.cloneNode(!0))},vae=(t,e)=>{const n=ey(),r=Ap();!n||!r||(!e.showConfirmButton&&!e.showDenyButton&&!e.showCancelButton?xs(n):fs(n),Ui(n,e,"actions"),bae(n,r,e),ji(r,e.loaderHtml||""),Ui(r,e,"loader"))};function bae(t,e,n){const r=Na(),s=lh(),i=Cp();!r||!s||!i||(O0(r,"confirm",n),O0(s,"deny",n),O0(i,"cancel",n),wae(r,s,i,n),n.reverseButtons&&(n.toast?(t.insertBefore(i,r),t.insertBefore(s,r)):(t.insertBefore(i,e),t.insertBefore(s,e),t.insertBefore(r,e))))}function wae(t,e,n,r){if(!r.buttonsStyling){yo([t,e,n],Se.styled);return}_n([t,e,n],Se.styled),r.confirmButtonColor&&t.style.setProperty("--swal2-confirm-button-background-color",r.confirmButtonColor),r.denyButtonColor&&e.style.setProperty("--swal2-deny-button-background-color",r.denyButtonColor),r.cancelButtonColor&&n.style.setProperty("--swal2-cancel-button-background-color",r.cancelButtonColor),D0(t),D0(e),D0(n)}function D0(t){const e=window.getComputedStyle(t);if(e.getPropertyValue("--swal2-action-button-focus-box-shadow"))return;const n=e.backgroundColor.replace(/rgba?\((\d+), (\d+), (\d+).*/,"rgba($1, $2, $3, 0.5)");t.style.setProperty("--swal2-action-button-focus-box-shadow",e.getPropertyValue("--swal2-outline").replace(/ rgba\(.*/,` ${n}`))}function O0(t,e,n){const r=ek(e);ty(t,n[`show${r}Button`],"inline-block"),ji(t,n[`${e}ButtonText`]||""),t.setAttribute("aria-label",n[`${e}ButtonAriaLabel`]||""),t.className=Se[e],Ui(t,n,`${e}Button`)}const Sae=(t,e)=>{const n=ik();n&&(ji(n,e.closeButtonHtml||""),Ui(n,e,"closeButton"),ty(n,e.showCloseButton),n.setAttribute("aria-label",e.closeButtonAriaLabel||""))},Tae=(t,e)=>{const n=Zs();n&&(Eae(n,e.backdrop),Iae(n,e.position),Cae(n,e.grow),Ui(n,e,"container"))};function Eae(t,e){typeof e=="string"?t.style.background=e:e||_n([document.documentElement,document.body],Se["no-backdrop"])}function Iae(t,e){e&&(e in Se?_n(t,Se[e]):(Ys('The "position" parameter is not valid, defaulting to "center"'),_n(t,Se.center)))}function Cae(t,e){e&&_n(t,Se[`grow-${e}`])}var zn={innerParams:new WeakMap,domCache:new WeakMap};const Aae=["input","file","range","select","radio","checkbox","textarea"],Rae=(t,e)=>{const n=hn();if(!n)return;const r=zn.innerParams.get(t),s=!r||e.input!==r.input;Aae.forEach(i=>{const o=$l(n,Se[i]);o&&(Nae(i,e.inputAttributes),o.className=Se[i],s&&xs(o))}),e.input&&(s&&Pae(e),Dae(e))},Pae=t=>{if(!t.input)return;if(!Rr[t.input]){ch(`Unexpected type of input! Expected ${Object.keys(Rr).join(" | ")}, got "${t.input}"`);return}const e=p4(t.input);if(!e)return;const n=Rr[t.input](e,t);fs(e),t.inputAutoFocus&&setTimeout(()=>{d4(n)})},kae=t=>{for(let e=0;e<t.attributes.length;e++){const n=t.attributes[e].name;["id","type","value","style"].includes(n)||t.removeAttribute(n)}},Nae=(t,e)=>{const n=hn();if(!n)return;const r=FT(n,t);if(r){kae(r);for(const s in e)r.setAttribute(s,e[s])}},Dae=t=>{if(!t.input)return;const e=p4(t.input);e&&Ui(e,t,"input")},dk=(t,e)=>{!t.placeholder&&e.inputPlaceholder&&(t.placeholder=e.inputPlaceholder)},ny=(t,e,n)=>{if(n.inputLabel){const r=document.createElement("label"),s=Se["input-label"];r.setAttribute("for",t.id),r.className=s,typeof n.customClass=="object"&&_n(r,n.customClass.inputLabel),r.innerText=n.inputLabel,e.insertAdjacentElement("beforebegin",r)}},p4=t=>{const e=hn();if(e)return $l(e,Se[t]||Se.input)},Hw=(t,e)=>{["string","number"].includes(typeof e)?t.value=`${e}`:nk(e)||Ys(`Unexpected type of inputValue! Expected "string", "number" or "Promise", got "${typeof e}"`)},Rr={};Rr.text=Rr.email=Rr.password=Rr.number=Rr.tel=Rr.url=Rr.search=Rr.date=Rr["datetime-local"]=Rr.time=Rr.week=Rr.month=(t,e)=>(Hw(t,e.inputValue),ny(t,t,e),dk(t,e),t.type=e.input,t);Rr.file=(t,e)=>(ny(t,t,e),dk(t,e),t);Rr.range=(t,e)=>{const n=t.querySelector("input"),r=t.querySelector("output");return Hw(n,e.inputValue),n.type=e.input,Hw(r,e.inputValue),ny(n,t,e),t};Rr.select=(t,e)=>{if(t.textContent="",e.inputPlaceholder){const n=document.createElement("option");ji(n,e.inputPlaceholder),n.value="",n.disabled=!0,n.selected=!0,t.appendChild(n)}return ny(t,t,e),t};Rr.radio=t=>(t.textContent="",t);Rr.checkbox=(t,e)=>{const n=FT(hn(),"checkbox");n.value="1",n.checked=!!e.inputValue;const r=t.querySelector("span");
53return ji(r,e.inputPlaceholder||e.inputLabel),n};Rr.textarea=(t,e)=>{Hw(t,e.inputValue),dk(t,e),ny(t,t,e);const n=r=>parseInt(window.getComputedStyle(r).marginLeft)+parseInt(window.getComputedStyle(r).marginRight);return setTimeout(()=>{if("MutationObserver"in window){const r=parseInt(window.getComputedStyle(hn()).width),s=()=>{if(!document.body.contains(t))return;const i=t.offsetWidth+n(t);i>r?hn().style.width=`${i}px`:Dd(hn(),"width",e.width)};new MutationObserver(s).observe(t,{attributes:!0,attributeFilter:["style"]})}}),t};const Oae=(t,e)=>{const n=rk();n&&(ck(n),Ui(n,e,"htmlContainer"),e.html?(uk(e.html,n),fs(n,"block")):e.text?(n.textContent=e.text,fs(n,"block")):xs(n),Rae(t,e))},xae=(t,e)=>{const n=u4();n&&(ck(n),ty(n,!!e.footer,"block"),e.footer&&uk(e.footer,n),Ui(n,e,"footer"))},Lae=(t,e)=>{const n=zn.innerParams.get(t),r=Ip();if(!r)return;if(n&&e.icon===n.icon){xL(r,e),OL(r,e);return}if(!e.icon&&!e.iconHtml){xs(r);return}if(e.icon&&Object.keys(Uw).indexOf(e.icon)===-1){ch(`Unknown icon! Expected "success", "error", "warning", "info" or "question", got "${e.icon}"`),xs(r);return}fs(r),xL(r,e),OL(r,e),_n(r,e.showClass&&e.showClass.icon),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",m4)},OL=(t,e)=>{for(const[n,r]of Object.entries(Uw))e.icon!==n&&yo(t,r);_n(t,e.icon&&Uw[e.icon]),Fae(t,e),m4(),Ui(t,e,"icon")},m4=()=>{const t=hn();if(!t)return;const e=window.getComputedStyle(t).getPropertyValue("background-color"),n=t.querySelectorAll("[class^=swal2-success-circular-line], .swal2-success-fix");for(let r=0;r<n.length;r++)n[r].style.backgroundColor=e},Mae=t=>` 54 ${t.animation?'<div class="swal2-success-circular-line-left"></div>':""} 55 <span class="swal2-success-line-tip"></span> <span class="swal2-success-line-long"></span> 56 <div class="swal2-success-ring"></div> 57 ${t.animation?'<div class="swal2-success-fix"></div>':""} 58 ${t.animation?'<div class="swal2-success-circular-line-right"></div>':""} 59`,Vae=` 60 <span class="swal2-x-mark"> 61 <span class="swal2-x-mark-line-left"></span> 62 <span class="swal2-x-mark-line-right"></span> 63 </span> 64`,xL=(t,e)=>{if(!e.icon&&!e.iconHtml)return;let n=t.innerHTML,r="";e.iconHtml?r=LL(e.iconHtml):e.icon==="success"?(r=Mae(e),n=n.replace(/ style=".*?"/g,"")):e.icon==="error"?r=Vae:e.icon&&(r=LL({question:"?",warning:"!",info:"i"}[e.icon])),n.trim()!==r.trim()&&ji(t,r)},Fae=(t,e)=>{if(e.iconColor){t.style.color=e.iconColor,t.style.borderColor=e.iconColor;for(const n of[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"])DL(t,n,"background-color",e.iconColor);DL(t,".swal2-success-ring","border-color",e.iconColor)}},LL=t=>`<div class="${Se["icon-content"]}">${t}</div>`,Bae=(t,e)=>{const n=l4();if(n){if(!e.imageUrl){xs(n);return}fs(n,""),n.setAttribute("src",e.imageUrl),n.setAttribute("alt",e.imageAlt||""),Dd(n,"width",e.imageWidth),Dd(n,"height",e.imageHeight),n.className=Se.image,Ui(n,e,"image")}};let hk=!1,g4=0,_4=0,y4=0,v4=0;const $ae=t=>{t.addEventListener("mousedown",qw),document.body.addEventListener("mousemove",jw),t.addEventListener("mouseup",Ww),t.addEventListener("touchstart",qw),document.body.addEventListener("touchmove",jw),t.addEventListener("touchend",Ww)},Uae=t=>{t.removeEventListener("mousedown",qw),document.body.removeEventListener("mousemove",jw),t.removeEventListener("mouseup",Ww),t.removeEventListener("touchstart",qw),document.body.removeEventListener("touchmove",jw),t.removeEventListener("touchend",Ww)},qw=t=>{const e=hn();if(t.target===e||Ip().contains(t.target)){hk=!0;const n=b4(t);g4=n.clientX,_4=n.clientY,y4=parseInt(e.style.insetInlineStart)||0,v4=parseInt(e.style.insetBlockStart)||0,_n(e,"swal2-dragging")}},jw=t=>{const e=hn();if(hk){let{clientX:n,clientY:r}=b4(t);e.style.insetInlineStart=`${y4+(n-g4)}px`,e.style.insetBlockStart=`${v4+(r-_4)}px`}},Ww=()=>{const t=hn();hk=!1,yo(t,"swal2-dragging")},b4=t=>{let e=0,n=0;return t.type.startsWith("mouse")?(e=t.clientX,n=t.clientY):t.type.startsWith("touch")&&(e=t.touches[0].clientX,n=t.touches[0].clientY),{clientX:e,clientY:n}},Hae=(t,e)=>{const n=Zs(),r=hn();if(!(!n||!r)){if(e.toast){Dd(n,"width",e.width),r.style.width="100%";const s=Ap();s&&r.insertBefore(s,Ip())}else Dd(r,"width",e.width);Dd(r,"padding",e.padding),e.color&&(r.style.color=e.color),e.background&&(r.style.background=e.background),xs(LT()),qae(r,e),e.draggable&&!e.toast?(_n(r,Se.draggable),$ae(r)):(yo(r,Se.draggable),Uae(r))}},qae=(t,e)=>{const n=e.showClass||{};t.className=`${Se.popup} ${_i(t)?n.popup:""}`,e.toast?(_n([document.documentElement,document.body],Se["toast-shown"]),_n(t,Se.toast)):_n(t,Se.modal),Ui(t,e,"popup"),typeof e.customClass=="string"&&_n(t,e.customClass),e.icon&&_n(t,Se[`icon-${e.icon}`])},jae=(t,e)=>{const n=sk();if(!n)return;const{progressSteps:r,currentProgressStep:s}=e;if(!r||r.length===0||s===void 0){xs(n);return}fs(n),n.textContent="",s>=r.length&&Ys("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),r.forEach((i,o)=>{const a=Wae(i);if(n.appendChild(a),o===s&&_n(a,Se["active-progress-step"]),o!==r.length-1){const c=Gae(e);n.appendChild(c)}})},Wae=t=>{const e=document.createElement("li");return _n(e,Se["progress-step"]),ji(e,t),e},Gae=t=>{const e=document.createElement("li");return _n(e,Se["progress-step-line"]),t.progressStepsDistance&&Dd(e,"width",t.progressStepsDistance),e},Kae=(t,e)=>{const n=c4();n&&(ck(n),ty(n,!!(e.title||e.titleText),"block"),e.title&&uk(e.title,n),e.titleText&&(n.innerText=e.titleText),Ui(n,e,"title"))},w4=(t,e)=>{Hae(t,e),Tae(t,e),jae(t,e),Lae(t,e),Bae(t,e),Kae(t,e),Sae(t,e),Oae(t,e),vae(t,e),xae(t,e);const n=hn();typeof e.didRender=="function"&&n&&e.didRender(n),gt.eventEmitter.emit("didRender",n)},zae=()=>_i(hn()),S4=()=>{var t;return(t=Na())===null||t===void 0?void 0:t.click()},Yae=()=>{var t;return(t=lh())===null||t===void 0?void 0:t.click()},Jae=()=>{var t;return(t=Cp())===null||t===void 0?void 0:t.click()},Rp=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),T4=t=>{t.keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1)},Qae=(t,e,n)=>{T4(t),e.toast||(t.keydownHandler=r=>Zae(e,r,n),t.keydownTarget=e.keydownListenerCapture?window:hn(),t.keydownListenerCapture=e.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)},CA=(t,e)=>{var n;const r=ok();if(r.length){t=t+e,t===-2&&(t=r.length-1),t===r.length?t=0:t===-1&&(t=r.length-1),r[t].focus();return}(n=hn())===null||n===void 0||n.focus()},E4=["ArrowRight","ArrowDown"],Xae=["ArrowLeft","ArrowUp"],Zae=(t,e,n)=>{t&&(e.isComposing||e.keyCode===229||(t.stopKeydownPropagation&&e.stopPropagation(),e.key==="Enter"?ece(e,t):e.ke
64y==="Tab"?tce(e):[...E4,...Xae].includes(e.key)?nce(e.key):e.key==="Escape"&&rce(e,t,n)))},ece=(t,e)=>{if(!xT(e.allowEnterKey))return;const n=FT(hn(),e.input);if(t.target&&n&&t.target instanceof HTMLElement&&t.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(e.input))return;S4(),t.preventDefault()}},tce=t=>{const e=t.target,n=ok();let r=-1;for(let s=0;s<n.length;s++)if(e===n[s]){r=s;break}t.shiftKey?CA(r,-1):CA(r,1),t.stopPropagation(),t.preventDefault()},nce=t=>{const e=ey(),n=Na(),r=lh(),s=Cp();if(!e||!n||!r||!s)return;const i=[n,r,s];if(document.activeElement instanceof HTMLElement&&!i.includes(document.activeElement))return;const o=E4.includes(t)?"nextElementSibling":"previousElementSibling";let a=document.activeElement;if(a){for(let c=0;c<e.children.length;c++){if(a=a[o],!a)return;if(a instanceof HTMLButtonElement&&_i(a))break}a instanceof HTMLButtonElement&&a.focus()}},rce=(t,e,n)=>{t.preventDefault(),xT(e.allowEscapeKey)&&n(Rp.esc)};var Bf={swalPromiseResolve:new WeakMap,swalPromiseReject:new WeakMap};const sce=()=>{const t=Zs();Array.from(document.body.children).forEach(n=>{n.contains(t)||(n.hasAttribute("aria-hidden")&&n.setAttribute("data-previous-aria-hidden",n.getAttribute("aria-hidden")||""),n.setAttribute("aria-hidden","true"))})},I4=()=>{Array.from(document.body.children).forEach(e=>{e.hasAttribute("data-previous-aria-hidden")?(e.setAttribute("aria-hidden",e.getAttribute("data-previous-aria-hidden")||""),e.removeAttribute("data-previous-aria-hidden")):e.removeAttribute("aria-hidden")})},C4=typeof window<"u"&&!!window.GestureEvent,ice=()=>{if(C4&&!kc(document.body,Se.iosfix)){const t=document.body.scrollTop;document.body.style.top=`${t*-1}px`,_n(document.body,Se.iosfix),oce()}},oce=()=>{const t=Zs();if(!t)return;let e;t.ontouchstart=n=>{e=ace(n)},t.ontouchmove=n=>{e&&(n.preventDefault(),n.stopPropagation())}},ace=t=>{const e=t.target,n=Zs(),r=rk();return!n||!r||cce(t)||lce(t)?!1:e===n||!IA(n)&&e instanceof HTMLElement&&!aae(e,r)&&e.tagName!=="INPUT"&&e.tagName!=="TEXTAREA"&&!(IA(r)&&r.contains(e))},cce=t=>t.touches&&t.touches.length&&t.touches[0].touchType==="stylus",lce=t=>t.touches&&t.touches.length>1,uce=()=>{if(kc(document.body,Se.iosfix)){const t=parseInt(document.body.style.top,10);yo(document.body,Se.iosfix),document.body.style.top="",document.body.scrollTop=t*-1}},dce=()=>{const t=document.createElement("div");t.className=Se["scrollbar-measure"],document.body.appendChild(t);const e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e};let bf=null;const hce=t=>{bf===null&&(document.body.scrollHeight>window.innerHeight||t==="scroll")&&(bf=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight=`${bf+dce()}px`)},fce=()=>{bf!==null&&(document.body.style.paddingRight=`${bf}px`,bf=null)};function A4(t,e,n,r){VT()?ML(t,r):(Qoe(n).then(()=>ML(t,r)),T4(gt)),C4?(e.setAttribute("style","display:none !important"),e.removeAttribute("class"),e.innerHTML=""):e.remove(),ak()&&(fce(),uce(),I4()),pce()}function pce(){yo([document.documentElement,document.body],[Se.shown,Se["height-auto"],Se["no-backdrop"],Se["toast-shown"]])}function Ul(t){t=gce(t);const e=Bf.swalPromiseResolve.get(this),n=mce(this);this.isAwaitingPromise?t.isDismissed||(ry(this),e(t)):n&&e(t)}const mce=t=>{const e=hn();if(!e)return!1;const n=zn.innerParams.get(t);if(!n||kc(e,n.hideClass.popup))return!1;yo(e,n.showClass.popup),_n(e,n.hideClass.popup);const r=Zs();return yo(r,n.showClass.backdrop),_n(r,n.hideClass.backdrop),_ce(t,e,n),!0};function R4(t){const e=Bf.swalPromiseReject.get(this);ry(this),e&&e(t)}const ry=t=>{t.isAwaitingPromise&&(delete t.isAwaitingPromise,zn.innerParams.get(t)||t._destroy())},gce=t=>typeof t>"u"?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},t),_ce=(t,e,n)=>{var r;const s=Zs(),i=f4(e);typeof n.willClose=="function"&&n.willClose(e),(r=gt.eventEmitter)===null||r===void 0||r.emit("willClose",e),i?yce(t,e,s,n.returnFocus,n.didClose):A4(t,s,n.returnFocus,n.didClose)},yce=(t,e,n,r,s)=>
64{gt.swalCloseEventFinishedCallback=A4.bind(null,t,n,r,s);const i=function(o){if(o.target===e){var a;(a=gt.swalCloseEventFinishedCallback)===null||a===void 0||a.call(gt),delete gt.swalCloseEventFinishedCallback,e.removeEventListener("animationend",i),e.removeEventListener("transitionend",i)}};e.addEventListener("animationend",i),e.addEventListener("transitionend",i)},ML=(t,e)=>{setTimeout(()=>{var n;typeof e=="function"&&e.bind(t.params)(),(n=gt.eventEmitter)===null||n===void 0||n.emit("didClose"),t._destroy&&t._destroy()})},$f=t=>{let e=hn();if(e||new Or,e=hn(),!e)return;const n=Ap();VT()?xs(Ip()):vce(e,t),fs(n),e.setAttribute("data-loading","true"),e.setAttribute("aria-busy","true"),e.focus()},vce=(t,e)=>{const n=ey(),r=Ap();!n||!r||(!e&&_i(Na())&&(e=Na()),fs(n),e&&(xs(e),r.setAttribute("data-button-to-replace",e.className),n.insertBefore(r,e)),_n([t,n],Se.loading))},bce=(t,e)=>{e.input==="select"||e.input==="radio"?Ice(t,e):["text","email","number","tel","textarea"].some(n=>n===e.input)&&(tk(e.inputValue)||nk(e.inputValue))&&($f(Na()),Cce(t,e))},wce=(t,e)=>{const n=t.getInput();if(!n)return null;switch(e.input){case"checkbox":return Sce(n);case"radio":return Tce(n);case"file":return Ece(n);default:return e.inputAutoTrim?n.value.trim():n.value}},Sce=t=>t.checked?1:0,Tce=t=>t.checked?t.value:null,Ece=t=>t.files&&t.files.length?t.getAttribute("multiple")!==null?t.files:t.files[0]:null,Ice=(t,e)=>{const n=hn();if(!n)return;const r=s=>{e.input==="select"?Ace(n,Gw(s),e):e.input==="radio"&&Rce(n,Gw(s),e)};tk(e.inputOptions)||nk(e.inputOptions)?($f(Na()),X_(e.inputOptions).then(s=>{t.hideLoading(),r(s)})):typeof e.inputOptions=="object"?r(e.inputOptions):ch(`Unexpected type of inputOptions! Expected object, Map or Promise, got ${typeof e.inputOptions}`)},Cce=(t,e)=>{const n=t.getInput();n&&(xs(n),X_(e.inputValue).then(r=>{n.value=e.input==="number"?`${parseFloat(r)||0}`:`${r}`,fs(n),n.focus(),t.hideLoading()}).catch(r=>{ch(`Error in inputValue promise: ${r}`),n.value="",fs(n),n.focus(),t.hideLoading()}))};function Ace(t,e,n){const r=$l(t,Se.select);if(!r)return;const s=(i,o,a)=>{const c=document.createElement("option");c.value=a,ji(c,o),c.selected=P4(a,n.inputValue),i.appendChild(c)};e.forEach(i=>{const o=i[0],a=i[1];if(Array.isArray(a)){const c=document.createElement("optgroup");c.label=o,c.disabled=!1,r.appendChild(c),a.forEach(l=>s(c,l[1],l[0]))}else s(r,a,o)}),r.focus()}function Rce(t,e,n){const r=$l(t,Se.radio);if(!r)return;e.forEach(i=>{const o=i[0],a=i[1],c=document.createElement("input"),l=document.createElement("label");c.type="radio",c.name=Se.radio,c.value=o,P4(o,n.inputValue)&&(c.checked=!0);const d=document.createElement("span");ji(d,a),d.className=Se.label,l.appendChild(c),l.appendChild(d),r.appendChild(l)});const s=r.querySelectorAll("input");s.length&&s[0].focus()}const Gw=t=>{const e=[];return t instanceof Map?t.forEach((n,r)=>{let s=n;typeof s=="object"&&(s=Gw(s)),e.push([r,s])}):Object.keys(t).forEach(n=>{let r=t[n];typeof r=="object"&&(r=Gw(r)),e.push([n,r])}),e},P4=(t,e)=>!!e&&e.toString()===t.toString(),Pce=t=>{const e=zn.innerParams.get(t);t.disableButtons(),e.input?k4(t,"confirm"):pk(t,!0)},kce=t=>{const e=zn.innerParams.get(t);t.disableButtons(),e.returnInputValueOnDeny?k4(t,"deny"):fk(t,!1)},Nce=(t,e)=>{t.disableButtons(),e(Rp.cancel)},k4=(t,e)=>{const n=zn.innerParams.get(t);if(!n.input){ch(`The "input" parameter is needed to be set when using returnInputValueOn${ek(e)}`);return}const r=t.getInput(),s=wce(t,n);n.inputValidator?Dce(t,s,e):r&&!r.checkValidity()?(t.enableButtons(),t.showValidationMessage(n.validationMessage||r.validationMessage)):e==="deny"?fk(t,s):pk(t,s)},Dce=(t,e,n)=>{const r=zn.innerParams.get(t);t.disableInput(),Promise.resolve().then(()=>X_(r.inputValidator(e,r.validationMessage))).then(i=>{t.enableButtons(),t.enableInput(),i?t.showValidationMessage(i):n==="deny"?fk(t,e):pk(t,e)})},fk=(t,e)=>{const n=zn.innerParams.get(t||void 0);n.showLoaderOnDeny&&$f(lh()),n.preDeny?(t.isAwaitingPromise=!0,Promise.resolve().then(()=>X_(n.preDeny(e,n.validationMessage))).then(s=>{s===!1?(t.hideLoading(),ry(t)):t.close({isDenied:!0,value:typeof s>"u"?e:s})}).catch(s=>N4(t||void 0,s))):t.close({isDenied:!0,value:e})},VL=(t,e)=>{t.close({isConfirmed:!0,value:e})},N4=(t,e)=>{t.rejectPromise(e)},pk=(t,e)=>{const n=zn.innerParams.get(t||void 0);n.showLoaderOnConfirm&&$f(),n.preConfirm?(t.resetValidationMessage(),t.isAwaitingPromise=!0,Promise.resolve().then(()=>X_(n.preConfirm(e,n.validationMessage))).then(s=>
64{_i(LT())||s===!1?(t.hideLoading(),ry(t)):VL(t,typeof s>"u"?e:s)}).catch(s=>N4(t||void 0,s))):VL(t,e)};function Kw(){const t=zn.innerParams.get(this);if(!t)return;const e=zn.domCache.get(this);xs(e.loader),VT()?t.icon&&fs(Ip()):Oce(e),yo([e.popup,e.actions],Se.loading),e.popup.removeAttribute("aria-busy"),e.popup.removeAttribute("data-loading"),e.confirmButton.disabled=!1,e.denyButton.disabled=!1,e.cancelButton.disabled=!1}const Oce=t=>{const e=t.popup.getElementsByClassName(t.loader.getAttribute("data-button-to-replace"));e.length?fs(e[0],"inline-block"):oae()&&xs(t.actions)};function D4(){const t=zn.innerParams.get(this),e=zn.domCache.get(this);return e?FT(e.popup,t.input):null}function O4(t,e,n){const r=zn.domCache.get(t);e.forEach(s=>{r[s].disabled=n})}function x4(t,e){const n=hn();if(!(!n||!t))if(t.type==="radio"){const r=n.querySelectorAll(`[name="${Se.radio}"]`);for(let s=0;s<r.length;s++)r[s].disabled=e}else t.disabled=e}function L4(){O4(this,["confirmButton","denyButton","cancelButton"],!1)}function M4(){O4(this,["confirmButton","denyButton","cancelButton"],!0)}function V4(){x4(this.getInput(),!1)}function F4(){x4(this.getInput(),!0)}function B4(t){const e=zn.domCache.get(this),n=zn.innerParams.get(this);ji(e.validationMessage,t),e.validationMessage.className=Se["validation-message"],n.customClass&&n.customClass.validationMessage&&_n(e.validationMessage,n.customClass.validationMessage),fs(e.validationMessage);const r=this.getInput();r&&(r.setAttribute("aria-invalid","true"),r.setAttribute("aria-describedby",Se["validation-message"]),d4(r),_n(r,Se.inputerror))}function $4(){const t=zn.domCache.get(this);t.validationMessage&&xs(t.validationMessage);const e=this.getInput();e&&(e.removeAttribute("aria-invalid"),e.removeAttribute("aria-describedby"),yo(e,Se.inputerror))}const wf={title:"",titleText:"",text:"",html:"",footer:"",icon:void 0,iconColor:void 0,iconHtml:void 0,template:void 0,toast:!1,draggable:!1,animation:!0,theme:"light",showClass:{popup:"swal2-show",backdrop:"swal2-backdrop-show",icon:"swal2-icon-show"},hideClass:{popup:"swal2-hide",backdrop:"swal2-backdrop-hide",icon:"swal2-icon-hide"},customClass:{},target:"body",color:void 0,backdrop:!0,heightAuto:!0,allowOutsideClick:!0,allowEscapeKey:!0,allowEnterKey:!0,stopKeydownPropagation:!0,keydownListenerCapture:!1,showConfirmButton:!0,showDenyButton:!1,showCancelButton:!1,preConfirm:void 0,preDeny:void 0,confirmButtonText:"OK",confirmButtonAriaLabel:"",confirmButtonColor:void 0,denyButtonText:"No",denyButtonAriaLabel:"",denyButtonColor:void 0,cancelButtonText:"Cancel",cancelButtonAriaLabel:"",cancelButtonColor:void 0,buttonsStyling:!0,reverseButtons:!1,focusConfirm:!0,focusDeny:!1,focusCancel:!1,returnFocus:!0,showCloseButton:!1,closeButtonHtml:"×",closeButtonAriaLabel:"Close this dialog",loaderHtml:"",showLoaderOnConfirm:!1,showLoaderOnDeny:!1,imageUrl:void 0,imageWidth:void 0,imageHeight:void 0,imageAlt:"",timer:void 0,timerProgressBar:!1,width:void 0,padding:void 0,background:void 0,input:void 0,inputPlaceholder:"",inputLabel:"",inputValue:"",inputOptions:{},inputAutoFocus:!0,inputAutoTrim:!0,inputAttributes:{},inputValidator:void 0,returnInputValueOnDeny:!1,validationMessage:void 0,grow:!1,position:"center",progressSteps:[],currentProgressStep:void 0,progressStepsDistance:void 0,willOpen:void 0,didOpen:void 0,didRender:void 0,willClose:void 0,didClose
64:void 0,didDestroy:void 0,scrollbarPadding:!0,topLayer:!1},xce=["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"],Lce={allowEnterKey:void 0},Mce=["allowOutsideClick","allowEnterKey","backdrop","draggable","focusConfirm","focusDeny","focusCancel","returnFocus","heightAuto","keydownListenerCapture"],U4=t=>Object.prototype.hasOwnProperty.call(wf,t),H4=t=>xce.indexOf(t)!==-1,q4=t=>Lce[t],Vce=t=>{U4(t)||Ys(`Unknown parameter "${t}"`)},Fce=t=>{Mce.includes(t)&&Ys(`The parameter "${t}" is incompatible with toasts`)},Bce=t=>{const e=q4(t);e&&a4(t,e)},j4=t=>{t.backdrop===!1&&t.allowOutsideClick&&Ys('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),t.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(t.theme)&&Ys(`Invalid theme "${t.theme}"`);for(const e in t)Vce(e),t.toast&&Fce(e),Bce(e)};function W4(t){const e=Zs(),n=hn(),r=zn.innerParams.get(this);if(!n||kc(n,r.hideClass.popup)){Ys("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.");return}const s=$ce(t),i=Object.assign({},r,s);j4(i),e.dataset.swal2Theme=i.theme,w4(this,i),zn.innerParams.set(this,i),Object.defineProperties(this,{params:{value:Object.assign({},this.params,t),writable:!1,enumerable:!0}})}const $ce=t=>{const e={};return Object.keys(t).forEach(n=>{H4(n)?e[n]=t[n]:Ys(`Invalid parameter to update: ${n}`)}),e};function G4(){const t=zn.domCache.get(this),e=zn.innerParams.get(this);if(!e){K4(this);return}t.popup&>.swalCloseEventFinishedCallback&&(gt.swalCloseEventFinishedCallback(),delete gt.swalCloseEventFinishedCallback),typeof e.didDestroy=="function"&&e.didDestroy(),gt.eventEmitter.emit("didDestroy"),Uce(this)}const Uce=t=>{K4(t),delete t.params,delete gt.keydownHandler,delete gt.keydownTarget,delete gt.currentInstance},K4=t=>{t.isAwaitingPromise?(x0(zn,t),t.isAwaitingPromise=!0):(x0(Bf,t),x0(zn,t),delete t.isAwaitingPromise,delete t.disableButtons,delete t.enableButtons,delete t.getInput,delete t.disableInput,delete t.enableInput,delete t.hideLoading,delete t.disableLoading,delete t.showValidationMessage,delete t.resetValidationMessage,delete t.close,delete t.closePopup,delete t.closeModal,delete t.closeToast,delete t.rejectPromise,delete t.update,delete t._destroy)},x0=(t,e)=>{for(const n in t)t[n].delete(e)};var Hce=Object.freeze({__proto__:null,_destroy:G4,close:Ul,closeModal:Ul,closePopup:Ul,closeToast:Ul,disableButtons:M4,disableInput:F4,disableLoading:Kw,enableButtons:L4,enableInput:V4,getInput:D4,handleAwaitingPromise:ry,hideLoading:Kw,rejectPromise:R4,resetValidationMessage:$4,showValidationMessage:B4,update:W4});const qce=(t,e,n)=>{t.toast?jce(t,e,n):(Gce(e),Kce(e),zce(t,e,n))},jce=(t,e,n)=>{e.popup.onclick=()=>{t&&(Wce(t)||t.timer||t.input)||n(Rp.close)}},Wce=t=>!!(t.showConfirmButton||t.showDenyButton||t.showCancelButton||t.showCloseButton);let zw=!1;const Gce=t=>{t.popup.onmousedown=()=>{t.container.onmouseup=function(e){t.container.onmouseup=()=>{},e.target===t.container&&(zw=!0)}}},Kce=t=>{t.container.onmousedown=e=>{e.target===t.container&&e.preventDefault(),t.popup.onmouseup=function(n){t.popup.onmouseup=()=>{},(n.target===t.popup||n.target instanceof HTMLElement&&t.popup.contains(n.target))&&(zw=!0)}}},zce=(t,e,n)=>{e.container.onclick=r=>{if(zw){zw=!1;return}r.target===e.container&&xT(t.allowOutsideClick)&&n(Rp.backdrop)}},Yce=t=>typeof t=="object"&&t.jquery,FL=t=>t instanceof Element||Yce(t),Jce=t=>{const e={};return typeof t[0]=="object"&&!FL(t[0])?Object.assign(e,t[0]):["title","html","icon"].forEach((n,r)=>{const s=t[r];typeof s=="string"||FL(s)?e[n]=s:s!==void 0&&ch(`Unexpected type of ${n}! Expected "string" or "Element", got ${typeof s}`)}),e};function Qce(...t){return new this(...t)}function Xce(t){class e extends this{_main(r,s){return super._main(r,Object.assign({},t,s))}}return e}const Zce=()=>gt.timeout&>.timeout.getTimerLeft(),z4=()=>{if(gt.timeout)return cae(),gt.timeout.stop()},Y4=()=>{if(gt.timeout){const t=gt.timeout.start();return lk(t),t}},ele=()=>{const t=gt.timeout;return t&&(t.running?z4():Y4())},tle=t=>{if(gt.timeout){const e=gt.timeout.increase(t);return lk(e,!0),e}},nle=()=>!!(gt.timeout&>.timeout.isRunning());let BL=!1;const AA={};function rle(t="data-swal-template"){AA[t]=this,BL||(document.body.addEventListener("click",
64sle),BL=!0)}const sle=t=>{for(let e=t.target;e&&e!==document;e=e.parentNode)for(const n in AA){const r=e.getAttribute(n);if(r){AA[n].fire({template:r});return}}};let ile=class{constructor(){this.events={}}_getHandlersByEventName(e){return typeof this.events[e]>"u"&&(this.events[e]=[]),this.events[e]}on(e,n){const r=this._getHandlersByEventName(e);r.includes(n)||r.push(n)}once(e,n){const r=(...s)=>{this.removeListener(e,r),n.apply(this,s)};this.on(e,r)}emit(e,...n){this._getHandlersByEventName(e).forEach(r=>{try{r.apply(this,n)}catch(s){console.error(s)}})}removeListener(e,n){const r=this._getHandlersByEventName(e),s=r.indexOf(n);s>-1&&r.splice(s,1)}removeAllListeners(e){this.events[e]!==void 0&&(this.events[e].length=0)}reset(){this.events={}}};gt.eventEmitter=new ile;const ole=(t,e)=>{gt.eventEmitter.on(t,e)},ale=(t,e)=>{gt.eventEmitter.once(t,e)},cle=(t,e)=>{if(!t){gt.eventEmitter.reset();return}e?gt.eventEmitter.removeListener(t,e):gt.eventEmitter.removeAllListeners(t)};var lle=Object.freeze({__proto__:null,argsToParams:Jce,bindClickHandler:rle,clickCancel:Jae,clickConfirm:S4,clickDeny:Yae,enableLoading:$f,fire:Qce,getActions:ey,getCancelButton:Cp,getCloseButton:ik,getConfirmButton:Na,getContainer:Zs,getDenyButton:lh,getFocusableElements:ok,getFooter:u4,getHtmlContainer:rk,getIcon:Ip,getIconContent:tae,getImage:l4,getInputLabel:nae,getLoader:Ap,getPopup:hn,getProgressSteps:sk,getTimerLeft:Zce,getTimerProgressBar:MT,getTitle:c4,getValidationMessage:LT,increaseTimer:tle,isDeprecatedParameter:q4,isLoading:sae,isTimerRunning:nle,isUpdatableParameter:H4,isValidParameter:U4,isVisible:zae,mixin:Xce,off:cle,on:ole,once:ale,resumeTimer:Y4,showLoading:$f,stopTimer:z4,toggleTimer:ele});class ule{constructor(e,n){this.callback=e,this.remaining=n,this.running=!1,this.start()}start(){return this.running||(this.running=!0,this.started=new Date,this.id=setTimeout(this.callback,this.remaining)),this.remaining}stop(){return this.started&&this.running&&(this.running=!1,clearTimeout(this.id),this.remaining-=new Date().getTime()-this.started.getTime()),this.remaining}increase(e){const n=this.running;return n&&this.stop(),this.remaining+=e,n&&this.start(),this.remaining}getTimerLeft(){return this.running&&(this.stop(),this.start()),this.remaining}isRunning(){return this.running}}const J4=["swal-title","swal-html","swal-footer"],dle=t=>{const e=typeof t.template=="string"?document.querySelector(t.template):t.template;if(!e)return{};const n=e.content;return vle(n),Object.assign(hle(n),fle(n),ple(n),mle(n),gle(n),_le(n),yle(n,J4))},hle=t=>{const e={};return Array.from(t.querySelectorAll("swal-param")).forEach(r=>{Wd(r,["name","value"]);const s=r.getAttribute("name"),i=r.getAttribute("value");!s||!i||(typeof wf[s]=="boolean"?e[s]=i!=="false":typeof wf[s]=="object"?e[s]=JSON.parse(i):e[s]=i)}),e},fle=t=>{const e={};return Array.from(t.querySelectorAll("swal-function-param")).forEach(r=>{const s=r.getAttribute("name"),i=r.getAttribute("value");!s||!i||(e[s]=new Function(`return ${i}`)())}),e},ple=t=>{const e={};return Array.from(t.querySelectorAll("swal-button")).forEach(r=>{Wd(r,["type","color","aria-label"]);const s=r.getAttribute("type");!s||!["confirm","cancel","deny"].includes(s)||(e[`${s}ButtonText`]=r.innerHTML,e[`show${ek(s)}Button`]=!0,r.hasAttribute("color")&&(e[`${s}ButtonColor`]=r.getAttribute("color")),r.hasAttribute("aria-label")&&(e[`${s}ButtonAriaLabel`]=r.getAttribute("aria-label")))}),e},mle=t=>{const e={},n=t.querySelector("swal-image");return n&&(Wd(n,["src","width","height","alt"]),n.hasAttribute("src")&&(e.imageUrl=n.getAttribute("src")||void 0),n.hasAttribute("width")&&(e.imageWidth=n.getAttribute("width")||void 0),n.hasAttribute("height")&&(e.imageHeight=n.getAttribute("height")||void 0),n.hasAttribute("alt")&&(e.imageAlt=n.getAttribute("alt")||void 0)),e},gle=t=>{const e={},n=t.querySelector("swal-icon");return n&&(Wd(n,["type","color"]),n.hasAttribute("type")&&(e.icon=n.getAttribute("type")),n.hasAttribute("color")&&(e.iconColor=n.getAttribute("color")),e.iconHtml=n.innerHTML),e},_le=t=>{const e={},n=t.querySelector("swal-input");n&&(Wd(n,["type","label","placeholder","value"]),e.input=n.getAttribute("type")||"text",n.hasAttribute("label")&&(e.inputLabel=n.getAttribute("label")),n.hasAttribute("placeholder")&&(e.inputPlaceholder=n.getAttribute("placeholder")),n.hasAttribute("value")&&(e.inputValue=n.getAttribute("value")));const r=Array.from(t.querySelectorAll("swal-input-option"));return r.length&&(e.inputOptions={},r.forEach(s=>{Wd(s,["value"]);const i=s.getAttribute("value");if(!i)return;const o=s.innerHTML;e.inputOptions[i]=o})),e},yle=(t,e)=>{const n={};for(const r in e){const s=e[r],i=t.querySelector(s);i&&(Wd(i,[]),n[s.replace(/^swal-/,"")]=i.innerHTML.trim())}return n},vle=t=>{const e=J4.concat(["swal-param","swal-function-param","swal-button","swal-image","swal-icon","swal-input","swal-input-option"]);
64Array.from(t.children).forEach(n=>{const r=n.tagName.toLowerCase();e.includes(r)||Ys(`Unrecognized element <${r}>`)})},Wd=(t,e)=>{Array.from(t.attributes).forEach(n=>{e.indexOf(n.name)===-1&&Ys([`Unrecognized attribute "${n.name}" on <${t.tagName.toLowerCase()}>.`,`${e.length?`Allowed attributes are: ${e.join(", ")}`:"To set the value, use HTML within the element."}`])})},Q4=10,ble=t=>{const e=Zs(),n=hn();typeof t.willOpen=="function"&&t.willOpen(n),gt.eventEmitter.emit("willOpen",n);const s=window.getComputedStyle(document.body).overflowY;Tle(e,n,t),setTimeout(()=>{wle(e,n)},Q4),ak()&&(Sle(e,t.scrollbarPadding,s),sce()),!VT()&&!gt.previousActiveElement&&(gt.previousActiveElement=document.activeElement),typeof t.didOpen=="function"&&setTimeout(()=>t.didOpen(n)),gt.eventEmitter.emit("didOpen",n)},Yw=t=>{const e=hn();if(t.target!==e)return;const n=Zs();e.removeEventListener("animationend",Yw),e.removeEventListener("transitionend",Yw),n.style.overflowY="auto",yo(n,Se["no-transition"])},wle=(t,e)=>{f4(e)?(t.style.overflowY="hidden",e.addEventListener("animationend",Yw),e.addEventListener("transitionend",Yw)):t.style.overflowY="auto"},Sle=(t,e,n)=>{ice(),e&&n!=="hidden"&&hce(n),setTimeout(()=>{t.scrollTop=0})},Tle=(t,e,n)=>{_n(t,n.showClass.backdrop),n.animation?(e.style.setProperty("opacity","0","important"),fs(e,"grid"),setTimeout(()=>{_n(e,n.showClass.popup),e.style.removeProperty("opacity")},Q4)):fs(e,"grid"),_n([document.documentElement,document.body],Se.shown),n.heightAuto&&n.backdrop&&!n.toast&&_n([document.documentElement,document.body],Se["height-auto"])};var $L={email:(t,e)=>/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid email address"),url:(t,e)=>/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid URL")};function Ele(t){t.inputValidator||(t.input==="email"&&(t.inputValidator=$L.email),t.input==="url"&&(t.inputValidator=$L.url))}function Ile(t){(!t.target||typeof t.target=="string"&&!document.querySelector(t.target)||typeof t.target!="string"&&!t.target.appendChild)&&(Ys('Target parameter is not valid, defaulting to "body"'),t.target="body")}function Cle(t){Ele(t),t.showLoaderOnConfirm&&!t.preConfirm&&Ys(`showLoaderOnConfirm is set to true, but preConfirm is not defined. 65showLoaderOnConfirm should be used together with preConfirm, see usage example: 66https://sweetalert2.github.io/#ajax-request`),Ile(t),typeof t.title=="string"&&(t.title=t.title.split(` 67`).join("<br />")),gae(t)}let ga;var fb=new WeakMap;class Mr{constructor(...e){if(Koe(this,fb,void 0),typeof window>"u")return;ga=this;const n=Object.freeze(this.constructor.argsToParams(e));this.params=n,this.isAwaitingPromise=!1,zoe(fb,this,this._main(ga.params))}_main(e,n={}){if(j4(Object.assign({},n,e)),gt.currentInstance){const i=Bf.swalPromiseResolve.get(gt.currentInstance),{isAwaitingPromise:o}=gt.currentInstance;gt.currentInstance._destroy(),o||i({isDismissed:!0}),ak()&&I4()}gt.currentInstance=ga;const r=Rle(e,n);Cle(r),Object.freeze(r),gt.timeout&&(gt.timeout.stop(),delete gt.timeout),clearTimeout(gt.restoreFocusTimeout);const s=Ple(ga);return w4(ga,r),zn.innerParams.set(ga,r),Ale(ga,s,r)}then(e){return kL(fb,this).then(e)}finally(e){return kL(fb,this).finally(e)}}const Ale=(t,e,n)=>new Promise((r,s)=>{const i=o=>{t.close({isDismissed:!0,dismiss:o,isConfirmed:!1,isDenied:!1})};Bf.swalPromiseResolve.set(t,r),Bf.swalPromiseReject.set(t,s),e.confirmButton.onclick=()=>{Pce(t)},e.denyButton.onclick=()=>{kce(t)},e.cancelButton.onclick=()=>{Nce(t,i)},e.closeButton.onclick=()=>{i(Rp.close)},qce(n,e,i),Qae(gt,n,i),bce(t,n),ble(n),kle(gt,n,i),Nle(e,n),setTimeout(()=>{e.container.scrollTop=0})}),Rle=(t,e)=>{const n=dle(t),r=Object.assign({},wf,e,n,t);return r.showClass=Object.assign({},wf.showClass,r.showClass),r.hideClass=Object.assign({},wf.hideClass,r.hideClass),r.animation===!1&&(r.showClass={backdrop:"swal2-noanimation"},r.hideClass={}),r},Ple=t=>{const e={popup:hn(),container:Zs(),actions:ey(),confirmButton:Na(),denyButton:lh(),cancelButton:Cp(),loader:Ap(),closeButton:ik(),validationMessage:LT(),progressSteps:sk()};return zn.domCache.set(t,e),e},kle=(t,e,n)=>{const r=MT();xs(r),e.timer&&(t.timeout=new ule(()=>{n("timer"),delete t.timeout},e.timer),e.timerProgressBar&&(fs(r),Ui(r,e,"timerProgressBar"),setTimeout(()=>{t.timeout&&t.timeout.running&&lk(e.timer)})))},Nle=(t,e)=>{if(!e.toast){if(!xT(e.allowEnterKey)){a4("allowEnterKey"),xle();return}Dle(t)||Ole(t,e)||CA(-1,1)}},Dle=t=>{const e=Array.from(t.popup.querySelectorAll("[autofocus]"));for(const n of e)if(n instanceof HTMLElement&&_i(n))return n.focus(),!0;return!1},Ole=(t,e)=>
67e.focusDeny&&_i(t.denyButton)?(t.denyButton.focus(),!0):e.focusCancel&&_i(t.cancelButton)?(t.cancelButton.focus(),!0):e.focusConfirm&&_i(t.confirmButton)?(t.confirmButton.focus(),!0):!1,xle=()=>{document.activeElement instanceof HTMLElement&&typeof document.activeElement.blur=="function"&&document.activeElement.blur()};Mr.prototype.disableButtons=M4;Mr.prototype.enableButtons=L4;Mr.prototype.getInput=D4;Mr.prototype.disableInput=F4;Mr.prototype.enableInput=V4;Mr.prototype.hideLoading=Kw;Mr.prototype.disableLoading=Kw;Mr.prototype.showValidationMessage=B4;Mr.prototype.resetValidationMessage=$4;Mr.prototype.close=Ul;Mr.prototype.closePopup=Ul;Mr.prototype.closeModal=Ul;Mr.prototype.closeToast=Ul;Mr.prototype.rejectPromise=R4;Mr.prototype.update=W4;Mr.prototype._destroy=G4;Object.assign(Mr,lle);Object.keys(Hce).forEach(t=>{Mr[t]=function(...e){return ga&&ga[t]?ga[t](...e):null}});Mr.DismissReason=Rp;Mr.version="11.26.2";const Or=Mr;Or.default=Or;typeof document<"u"&&(function(t,e){var n=t.createElement("style");if(t.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=e);else try{n.innerHTML=e}catch{n.innerText=e}})(document,
vendor: 12,087 bytes, line 67
67':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 67
67box-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,482 bytes, line 67
67box-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}}');
67const Lle=()=>{};var UL={};const X4={NODE_ADMIN:!1,SDK_VERSION:"${JSCORE_VERSION}"};const qe=function(t,e){if(!t)throw Pp(e)},Pp=function(t){return new Error("Firebase Database ("+X4.SDK_VERSION+") INTERNAL ASSERT FAILED: "+t)};const Z4=function(t){const e=[];let n=0;for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);s<128?e[n++]=s:s<2048?(e[n++]=s>>6|192,e[n++]=s&63|128):(s&64512)===55296&&r+1<t.length&&(t.charCodeAt(r+1)&64512)===56320?(s=65536+((s&1023)<<10)+(t.charCodeAt(++r)&1023),e[n++]=s>>18|240,e[n++]=s>>12&63|128,e[n++]=s>>6&63|128,e[n++]=s&63|128):(e[n++]=s>>12|224,e[n++]=s>>6&63|128,e[n++]=s&63|128)}return e},Mle=function(t){const e=[];let n=0,r=0;for(;n<t.length;){const s=t[n++];if(s<128)e[r++]=String.fromCharCode(s);else if(s>191&&s<224){const i=t[n++];e[r++]=String.fromCharCode((s&31)<<6|i&63)}else if(s>239&&s<365){const i=t[n++],o=t[n++],a=t[n++],c=((s&7)<<18|(i&63)<<12|(o&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(c>>10)),e[r++]=String.fromCharCode(56320+(c&1023))}else{const i=t[n++],o=t[n++];e[r++]=String.fromCharCode((s&15)<<12|(i&63)<<6|o&63)}}return e.join("")},mk={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let s=0;s<t.length;s+=3){const i=t[s],o=s+1<t.length,a=o?t[s+1]:0,c=s+2<t.length,l=c?t[s+2]:0,d=i>>2,h=(i&3)<<4|a>>4;let p=(a&15)<<2|l>>6,g=l&63;c||(g=64,o||(p=64)),r.push(n[d],n[h],n[p],n[g])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(Z4(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):Mle(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s<t.length;){const i=n[t.charAt(s++)],a=s<t.length?n[t.charAt(s)]:0;++s;const l=s<t.length?n[t.charAt(s)]:64;++s;const h=s<t.length?n[t.charAt(s)]:64;if(++s,i==null||a==null||l==null||h==null)throw new Vle;const p=i<<2|a>>4;if(r.push(p),l!==64){const g=a<<4&240|l>>2;if(r.push(g),h!==64){const _=l<<6&192|h;r.push(_)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class Vle extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const eq=function(t){const e=Z4(t);return mk.encodeByteArray(e,!0)},Jw=function(t){return eq(t).replace(/\./g,"")},Qw=function(t){try{return mk.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};function Fle(t){return tq(void 0,t)}function tq(t,e){if(!(e instanceof Object))return e;switch(e.constructor){case Date:const n=e;return new Date(n.getTime());case Object:t===void 0&&(t={});break;case Array:t=[];break;default:return e}for(const n in e)!e.hasOwnProperty(n)||!Ble(n)||(t[n]=tq(t[n],e[n]));return t}function Ble(t){return t!=="__proto__"}function nq(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}const $le=()=>nq().__FIREBASE_DEFAULTS__,Ule=()=>{if(typeof process>"u"||typeof UL>"u")return;const t=UL.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},Hle=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;
67]+)/)}catch{return}const e=t&&Qw(t[1]);return e&&JSON.parse(e)},BT=()=>{try{return Lle()||$le()||Ule()||Hle()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},rq=t=>BT()?.emulatorHosts?.[t],gk=t=>{const e=rq(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},sq=()=>BT()?.config,iq=t=>BT()?.[`_${t}`];class $T{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}}function $a(t){try{return(t.startsWith("http://")||t.startsWith("https://")?new URL(t).hostname:t).endsWith(".cloudworkstations.dev")}catch{return!1}}async function sy(t){return(await fetch(t,{credentials:"include"})).ok}function _k(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},r=e||"demo-project",s=t.iat||0,i=t.sub||t.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o={iss:`https://securetoken.google.com/${r}`,aud:r,iat:s,exp:s+3600,auth_time:s,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}},...t};return[Jw(JSON.stringify(n)),Jw(JSON.stringify(o)),""].join(".")}const Eg={};function qle(){const t={prod:[],emulator:[]};for(const e of Object.keys(Eg))Eg[e]?t.emulator.push(e):t.prod.push(e);return t}function jle(t){let e=document.getElementById(t),n=!1;return e||(e=document.createElement("div"),e.setAttribute("id",t),n=!0),{created:n,element:e}}let HL=!1;function UT(t,e){if(typeof window>"u"||typeof document>"u"||!$a(window.location.host)||Eg[t]===e||Eg[t]||HL)return;Eg[t]=e;function n(p){return`__firebase__banner__${p}`}const r="__firebase__banner",i=qle().prod.length>0;function o(){const p=document.getElementById(r);p&&p.remove()}function a(p){p.style.display="flex",p.style.background="#7faaf0",p.style.position="fixed",p.style.bottom="5px",p.style.left="5px",p.style.padding=".5em",p.style.borderRadius="5px",p.style.alignItems="center"}function c(p,g){p.setAttribute("width","24"),p.setAttribute("id",g),p.setAttribute("height","24"),p.setAttribute("viewBox","0 0 24 24"),p.setAttribute("fill","none"),p.style.marginLeft="-6px"}function l(){const p=document.createElement("span");return p.style.cursor="pointer",p.style.marginLeft="16px",p.style.fontSize="24px",p.innerHTML=" ×",p.onclick=()=>{HL=!0,o()},p}function d(p,g){p.setAttribute("id",g),p.innerText="Learn more",p.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",p.setAttribute("target","__blank"),p.style.paddingLeft="5px",p.style.textDecoration="underline"}function h(){const p=jle(r),g=n("text"),_=document.getElementById(g)||document.createElement("span"),v=n("learnmore"),b=document.getElementById(v)||document.createElement("a"),w=n("preprendIcon"),E=document.getElementById(w)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(p.created){const T=p.element;a(T),d(b,v);const R=l();c(E,w),T.append(E,_,b,R),document.body.appendChild(T)}i?(_.innerText="Preview backend disconnected.",E.innerHTML=`<g clip-path="url(#clip0_6013_33858)"> 68<path d="M4.8 17.6L12 5.6L19.2 17.6H4.8ZM6.91667 16.4H17.0833L12 7.93333L6.91667 16.4ZM12 15.6C12.1667 15.6 12.3056 15.5444 12.4167 15.4333C12.5389 15.3111 12.6 15.1667 12.6 15C12.6 14.8333 12.5389 14.6944 12.4167 14.5833C12.3056 14.4611 12.1667 14.4 12 14.4C11.8333 14.4 11.6889 14.4611 11.5667 14.5833C11.4556 14.6944 11.4 14.8333 11.4 15C11.4 15.1667 11.4556 15.3111 11.5667 15.4333C11.6889 15.5444 11.8333 15.6 12 15.6ZM11.4 13.6H12.6V10.4H11.4V13.6Z" fill="#212121"/> 69</g> 70<defs> 71<clipPath id="clip0_6013_33858"> 72<rect width="24" height="24" fill="white"/> 73</clipPath> 74</defs>`):(E.innerHTML=`<g clip-path="url(#clip0_6083_34804)"> 75<path d="M11.4 15.2H12.6V11.2H11.4V15.2ZM12 10C12.1667 10 12.3056 9.94444
7512.4167 9.83333C12.5389 9.71111 12.6 9.56667 12.6 9.4C12.6 9.23333 12.5389 9.09444 12.4167 8.98333C12.3056 8.86111 12.1667 8.8 12 8.8C11.8333 8.8 11.6889 8.86111 11.5667 8.98333C11.4556 9.09444 11.4 9.23333 11.4 9.4C11.4 9.56667 11.4556 9.71111 11.5667 9.83333C11.6889 9.94444 11.8333 10 12 10ZM12 18.4C11.1222 18.4 10.2944 18.2333 9.51667 17.9C8.73889 17.5667 8.05556 17.1111 7.46667 16.5333C6.88889 15.9444 6.43333 15.2611 6.1 14.4833C5.76667 13.7056 5.6 12.8778 5.6 12C5.6 11.1111 5.76667 10.2833 6.1 9.51667C6.43333 8.73889 6.88889 8.06111 7.46667 7.48333C8.05556 6.89444 8.73889 6.43333 9.51667 6.1C10.2944 5.76667 11.1222 5.6 12 5.6C12.8889 5.6 13.7167 5.76667 14.4833 6.1C15.2611 6.43333 15.9389 6.89444 16.5167 7.48333C17.1056 8.06111 17.5667 8.73889 17.9 9.51667C18.2333 10.2833 18.4 11.1111 18.4 12C18.4 12.8778 18.2333 13.7056 17.9 14.4833C17.5667 15.2611 17.1056 15.9444 16.5167 16.5333C15.9389 17.1111 15.2611 17.5667 14.4833 17.9C13.7167 18.2333 12.8889 18.4 12 18.4ZM12 17.2C13.4444 17.2 14.6722 16.6944 15.6833 15.6833C16.6944 14.6722 17.2 13.4444 17.2 12C17.2 10.5556 16.6944 9.32778 15.6833 8.31667C14.6722 7.30555 13.4444 6.8 12 6.8C10.5556 6.8 9.32778 7.30555 8.31667 8.31667C7.30556 9.32778 6.8 10.5556 6.8 12C6.8 13.4444 7.30556 14.6722 8.31667 15.6833C9.32778 16.6944 10.5556 17.2 12 17.2Z" fill="#212121"/> 76</g> 77<defs> 78<clipPath id="clip0_6083_34804"> 79<rect width="24" height="24" fill="white"/> 80</clipPath> 81</defs>`,_.innerText="Preview backend running in this workspace."),_.setAttribute("id",g)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",h):h()}function Xr(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function yk(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Xr())}function oq(){const t=BT()?.forceEnvironment;if(t==="node")return!0;if(t==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function Wle(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function Gle(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function aq(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Kle(){const t=Xr();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function zle(){return X4.NODE_ADMIN===!0}function cq(){return!oq()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function lq(){return!oq()&&!!navigator.userAgent&&(navigator.userAgent.includes("Safari")||navigator.userAgent.includes("WebKit"))&&!navigator.userAgent.includes("Chrome")}function uq(){try{return typeof indexedDB=="object"}catch{return!1}}function Yle(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(r);s.onsuccess=()=>{s.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},s.onupgradeneeded=()=>{n=!1},s.onerror=()=>{e(s.error?.message||"")}}catch(n){e(n)}})}const Jle="FirebaseError";class Ua extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=Jle,Object.setPrototypeOf(this,Ua.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,iy.prototype.create)}}class iy{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},s=`${this.service}/${e}`,i=this.errors[e],o=i?Qle(i,r):"Error",a=`${this.serviceName}: ${o} (${s}).`;return new Ua(s,a,r)}}function Qle(t,e){return t.replace(Xle,(n,r)=>{const s=e[r];return s!=null?String(s):`<${r}?>`})}const Xle=/\{\$([^}]+)}/g;function o_(t){return JSON.parse(t)}function Jr(t){return JSON.stringify(t)}const dq=function(t){let e={},n={},r={},s="";try{const i=t.split(".");e=o_(Qw(i[0])||""),n=o_(Qw(i[1])||""),s=i[2],r=n.d||{},delete n.d}catch{}return{header:e,claims:n,data:r,signature:s}},Zle=function(t){const e=dq(t),n=e.claims;return!!n&&typeof n=="object"&&n.hasOwnProperty("iat")},eue=function(t){const e=dq(t).claims;return typeof e=="object"&&e.admin===!0};function Ha(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Uf(t,e){if(Object.prototype.hasOwnProperty.call(t,e))return t[e]}function RA(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function Xw(t,e,n){const r={};for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=e.call(n,t[s],s,t));return r}function Wc(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const s of n){if(!r.includes(s))return!1;const i=t[s],o=e[s];if(qL(i)&&qL(o)){if(!Wc(i,o))return!1}else if(i!==o)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function qL(t){return t!==null&&typeof t=="object"}function kp(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(s=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(s))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}class tue{constructor(){this.chain_=[],this.buf_=[],this.W_=[],this.pad_=[],this.inbuf_=0,this.total_=0,this.blockSize=512/8,this.pad_[0]=128;for(let e=1;e<this.blockSize;++e)this.pad_[e]=0;this.reset()}reset(){this.chain_[0]=1732584193,this.chain_[1]=4023233417,this.chain_[2]=2562383102,this.chain_[3]=271733878,this.chain_[4]=3285377520,this.inbuf_=0,this.total_=0}compress_(e,n){n||(n=0);const r=this.W_;if(typeof e=="string")for(let h=0;h<16;h++)r[h]=e.charCodeAt(n)<<24|e.charCodeAt(n+1)<<16|e.charCodeAt(n+2)<<8|e.charCodeAt(n+3),n+=4;else for(let h=0;h<16;h++)r[h]=e[n]<<24|e[n+1]<<16|e[n+2]<<8|e[n+3],n+=4;for(let h=16;h<80;h++){const p=r[h-3]^r[h-8]^r[h-14]^r[h-16];r[h]=(p<<1|p>>>31)&4294967295}let s=this.chain_[0],i=this.chain_[1],o=this.chain_[2],a=this.chain_[3],c=this.chain_[4],l,d;for(let h=0;h<80;h++){h<40?h<20?(l=a^i&(o^a),d=1518500249):(l=i^o^a,d=1859775393):h<60?(l=i&o|a&(i|o),d=2400959708):(l=i^o^a,d=3395469782);const p=(s<<5|s>>>27)+l+c+d+r[h]&4294967295;c=a,a=o,o=(i<<30|i>>>2)&4294967295,i=s,s=p}this.chain_[0]=this.chain_[0]+s&4294967295,this.chain_[1]=this.chain_[1]+i&4294967295,this.chain_[2]=this.chain_[2]+o&4294967295,this.chain_[3]=this.chain_[3]+a&4294967295,this.chain_[4]=this.chain_[4]+c&4294967295}update(e,n){if(e==null)return;n===void 0&&(n=e.length);const r=n-this.blockSize;let s=0;const i=this.buf_;let o=this.inbuf_;for(;s<n;){if(o===0)for(;s<=r;)this.compress_(e,s),s+=this.blockSize;if(typeof e=="string"){for(;s<n;)if(i[o]=e.charCodeAt(s),++o,++s,o===this.blockSize){this.compress_(i),o=0;break}}else for(;s<n;)if(i[o]=e[s],++o,++s,o===this.blockSize){this.compress_(i),o=0;break}}this.inbuf_=o,this.total_+=n}
81digest(){const e=[];let n=this.total_*8;this.inbuf_<56?this.update(this.pad_,56-this.inbuf_):this.update(this.pad_,this.blockSize-(this.inbuf_-56));for(let s=this.blockSize-1;s>=56;s--)this.buf_[s]=n&255,n/=256;this.compress_(this.buf_);let r=0;for(let s=0;s<5;s++)for(let i=24;i>=0;i-=8)e[r]=this.chain_[s]>>i&255,++r;return e}}function nue(t,e){const n=new rue(t,e);return n.subscribe.bind(n)}class rue{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let s;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");sue(e,["next","error","complete"])?s=e:s={next:e,error:n,complete:r},s.next===void 0&&(s.next=L0),s.error===void 0&&(s.error=L0),s.complete===void 0&&(s.complete=L0);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?s.error(this.finalError):s.complete()}catch{}}),this.observers.push(s),i}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,e)}sendOne(e,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function sue(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function L0(){}function vk(t,e){return`${t} failed: ${e} argument `}const iue=function(t){const e=[];let n=0;for(let r=0;r<t.length;r++){let s=t.charCodeAt(r);if(s>=55296&&s<=56319){const i=s-55296;r++,qe(r<t.length,"Surrogate pair missing trail surrogate.");const o=t.charCodeAt(r)-56320;s=65536+(i<<10)+o}s<128?e[n++]=s:s<2048?(e[n++]=s>>6|192,e[n++]=s&63|128):s<65536?(e[n++]=s>>12|224,e[n++]=s>>6&63|128,e[n++]=s&63|128):(e[n++]=s>>18|240,e[n++]=s>>12&63|128,e[n++]=s>>6&63|128,e[n++]=s&63|128)}return e},HT=function(t){let e=0;for(let n=0;n<t.length;n++){const r=t.charCodeAt(n);r<128?e++:r<2048?e+=2:r>=55296&&r<=56319?(e+=4,n++):e+=3}return e};function wn(t){return t&&t._delegate?t._delegate:t}class Gc{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}const sd="[DEFAULT]";class oue{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new $T;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const s=this.getOrInitializeService({instanceIdentifier:n});s&&r.resolve(s)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){const n=this.normalizeInstanceIdentifier(e?.identifier),r=e?.optional??!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}catch(s){if(r)return null;throw s}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(cue(e))try{this.getOrInitializeService({instanceIdentifier:sd})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const s=this.normalizeInstanceIdentifier(n);try{const i=this.getOrInitializeService({instanceIdentifier:s});r.resolve(i)}catch{}}}}clearInstance(e=sd){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=sd){return this.instances.has(e)}getOptions(e=sd){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const s=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[i,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(i);r===a&&o.resolve(s)}return s}onInit(e,n){const r=this.normalizeInstanceIdentifier(n),s=this.onInitCallbacks.get(r)??new Set;s.add(e),this.onInitCallbacks.set(r,s);const i=this.instances.get(r);return i&&e(i,r),()=>{s.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const s of r)try{s(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:aue(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=sd){return this.component?this.component.multipleInstances?e:sd:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function aue(t){return t===sd?void 0:t}function cue(t){return t.instantiationMode==="EAGER"}class lue{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const n=new oue(e,this);return this.providers.set(e,n),n}getProviders(){return Array.from(this.providers.values())}}var Gt;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(Gt||(Gt={}));const uue={debug:Gt.DEBUG,verbose:Gt.VERBOSE,info:Gt.INFO,warn:Gt.WARN,error:Gt.ERROR,silent:Gt.SILENT},due=Gt.INFO,hue={[Gt.DEBUG]:"log",[Gt.VERBOSE]:"log",[Gt.INFO]:"info",[Gt.WARN]:"warn",[Gt.ERROR]:"error"},fue=(t,e,...n)=>{if(e<t.logLevel)return;const r=new Date().toISOString(),s=hue[e];if(s)console[s](`[${r}] ${t.name}:`,...n);
81else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class qT{constructor(e){this.name=e,this._logLevel=due,this._logHandler=fue,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in Gt))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?uue[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,Gt.DEBUG,...e),this._logHandler(this,Gt.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,Gt.VERBOSE,...e),this._logHandler(this,Gt.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,Gt.INFO,...e),this._logHandler(this,Gt.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,Gt.WARN,...e),this._logHandler(this,Gt.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,Gt.ERROR,...e),this._logHandler(this,Gt.ERROR,...e)}}const pue=(t,e)=>e.some(n=>t instanceof n);let jL,WL;function mue(){return jL||(jL=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function gue(){return WL||(WL=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const hq=new WeakMap,PA=new WeakMap,fq=new WeakMap,M0=new WeakMap,bk=new WeakMap;function _ue(t){const e=new Promise((n,r)=>{const s=()=>{t.removeEventListener("success",i),t.removeEventListener("error",o)},i=()=>{n(Kl(t.result)),s()},o=()=>{r(t.error),s()};t.addEventListener("success",i),t.addEventListener("error",o)});return e.then(n=>{n instanceof IDBCursor&&hq.set(n,t)}).catch(()=>{}),bk.set(e,t),e}function yue(t){if(PA.has(t))return;const e=new Promise((n,r)=>{const s=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",o),t.removeEventListener("abort",o)},i=()=>{n(),s()},o=()=>{r(t.error||new DOMException("AbortError","AbortError")),s()};t.addEventListener("complete",i),t.addEventListener("error",o),t.addEventListener("abort",o)});PA.set(t,e)}let kA={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return PA.get(t);if(e==="objectStoreNames")return t.objectStoreNames||fq.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Kl(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function vue(t){kA=t(kA)}function bue(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(V0(this),e,...n);return fq.set(r,e.sort?e.sort():[e]),Kl(r)}:gue().includes(t)?function(...e){return t.apply(V0(this),e),Kl(hq.get(this))}:function(...e){return Kl(t.apply(V0(this),e))}}function wue(t){return typeof t=="function"?bue(t):(t instanceof IDBTransaction&&yue(t),pue(t,mue())?new Proxy(t,kA):t)}function Kl(t){if(t instanceof IDBRequest)return _ue(t);if(M0.has(t))return M0.get(t);const e=wue(t);return e!==t&&(M0.set(t,e),bk.set(e,t)),e}const V0=t=>bk.get(t);function Sue(t,e,{blocked:n,upgrade:r,blocking:s,terminated:i}={}){const o=indexedDB.open(t,e),a=Kl(o);return r&&o.addEventListener("upgradeneeded",c=>{r(Kl(o.result),c.oldVersion,c.newVersion,Kl(o.transaction),c)}),n&&o.addEventListener("blocked",c=>n(c.oldVersion,c.newVersion,c)),a.then(c=>{i&&c.addEventListener("close",()=>i()),s&&c.addEventListener("versionchange",l=>s(l.oldVersion,l.newVersion,l))}).catch(()=>{}),a}const Tue=["get","getKey","getAll","getAllKeys","count"],Eue=["put","add","delete","clear"],F0=new Map;function GL(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(F0.get(e))return F0.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,s=Eue.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||Tue.includes(n)))return;const i=async function(o,...a){const c=this.transaction(o,s?"readwrite":"readonly");let l=c.store;
81return r&&(l=l.index(a.shift())),(await Promise.all([l[n](...a),s&&c.done]))[0]};return F0.set(e,i),i}vue(t=>({...t,get:(e,n,r)=>GL(e,n)||t.get(e,n,r),has:(e,n)=>!!GL(e,n)||t.has(e,n)}));class Iue{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(Cue(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function Cue(t){return t.getComponent()?.type==="VERSION"}const NA="@firebase/app",KL="0.14.4";const Kc=new qT("@firebase/app"),Aue="@firebase/app-compat",Rue="@firebase/analytics-compat",Pue="@firebase/analytics",kue="@firebase/app-check-compat",Nue="@firebase/app-check",Due="@firebase/auth",Oue="@firebase/auth-compat",xue="@firebase/database",Lue="@firebase/data-connect",Mue="@firebase/database-compat",Vue="@firebase/functions",Fue="@firebase/functions-compat",Bue="@firebase/installations",$ue="@firebase/installations-compat",Uue="@firebase/messaging",Hue="@firebase/messaging-compat",que="@firebase/performance",jue="@firebase/performance-compat",Wue="@firebase/remote-config",Gue="@firebase/remote-config-compat",Kue="@firebase/storage",zue="@firebase/storage-compat",Yue="@firebase/firestore",Jue="@firebase/ai",Que="@firebase/firestore-compat",Xue="firebase",Zue="12.4.0";const DA="[DEFAULT]",ede={[NA]:"fire-core",[Aue]:"fire-core-compat",[Pue]:"fire-analytics",[Rue]:"fire-analytics-compat",[Nue]:"fire-app-check",[kue]:"fire-app-check-compat",[Due]:"fire-auth",[Oue]:"fire-auth-compat",[xue]:"fire-rtdb",[Lue]:"fire-data-connect",[Mue]:"fire-rtdb-compat",[Vue]:"fire-fn",[Fue]:"fire-fn-compat",[Bue]:"fire-iid",[$ue]:"fire-iid-compat",[Uue]:"fire-fcm",[Hue]:"fire-fcm-compat",[que]:"fire-perf",[jue]:"fire-perf-compat",[Wue]:"fire-rc",[Gue]:"fire-rc-compat",[Kue]:"fire-g
81cs",[zue]:"fire-gcs-compat",[Yue]:"fire-fst",[Que]:"fire-fst-compat",[Jue]:"fire-vertex","fire-js":"fire-js",[Xue]:"fire-js-all"};const Zw=new Map,tde=new Map,OA=new Map;function zL(t,e){try{t.container.addComponent(e)}catch(n){Kc.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function uu(t){const e=t.name;if(OA.has(e))return Kc.debug(`There were multiple attempts to register component ${e}.`),!1;OA.set(e,t);for(const n of Zw.values())zL(n,t);for(const n of tde.values())zL(n,t);return!0}function Np(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function ui(t){return t==null?!1:t.settings!==void 0}const nde={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invali
81d-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},zl=new iy("app","Firebase",nde);class rde{constructor(e,n,r){this._isDeleted=!1,this._options={...e},this._config={...n},this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Gc("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw zl.create("app-deleted",{appName:this._name})}}const Tu=Zue;function pq(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r={name:DA,automaticDataCollectionEnabled:!0,...e},s=r.name;if(typeof s!="string"||!s)throw zl.create("bad-app-name",{appName:String(s)});if(n||(n=sq()),!n)throw zl.create("no-options");const i=Zw.get(s);if(i){if(Wc(n,i.options)&&Wc(r,i.config))return i;throw zl.create("duplicate-app",{appName:s})}const o=new lue(s);for(const c of OA.values())o.addComponent(c);const a=new rde(n,r,o);return Zw.set(s,a),a}function jT(t=DA){const e=Zw.get(t);if(!e&&t===DA&&sq())return pq();if(!e)throw zl.create("no-app",{appName:t});return e}function po(t,e,n){let r=ede[t]??t;n&&(r+=`-${n}`);const s=r.match(/\s|\//),i=e.match(/\s|\//);if(s||i){const o=[`Unable to register library "${r}" with version "${e}":`];s&&o.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&i&&o.push("and"),i&&o.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Kc.warn(o.join(" "));return}uu(new Gc(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}const sde="firebase-heartbeat-database",ide=1,a_="firebase-heartbeat-store";let B0=null;function mq(){return B0||(B0=Sue(sde,ide,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(a_)}catch(n){console.warn(n)}}}}).catch(t=>{throw zl.create("idb-open",{originalErrorMessage:t.message})})),B0}async function ode(t){try{const n=(await mq()).transaction(a_),r=await n.objectStore(a_).get(gq(t));return await n.done,r}catch(e){if(e instanceof Ua)Kc.warn(e.message);else{const n=zl.create("idb-get",{originalErrorMessage:e?.message});Kc.warn(n.message)}}}async function YL(t,e){try{const r=(await mq()).transaction(a_,"readwrite");await r.objectStore(a_).put(e,gq(t)),await r.done}catch(n){if(n instanceof Ua)Kc.warn(n.message);else{const r=zl.create("idb-set",{originalErrorMessage:n?.message});Kc.warn(r.message)}}}function gq(t){return`${t.name}!${t.options.appId}`}const ade=1024,cde=30;class lde{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new dde(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){try{const n=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),r=JL();if(this._heartbeatsCache?.heartbeats==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null)||this._heartbeatsCache.lastSentHeartbeatDate===r||this._heartbeatsCache.heartbeats.some(s=>s.date===r))return;if(this._heartbeatsCache.heartbeats.push({date:r,agent:n}),this._heartbeatsCache.heartbeats.length>cde){const s=hde(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(s,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(e){Kc.warn(e)}}async getHeartbeatsHeader(){try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,this._heartbeatsCache?.heartbeats==null||this._heartbeatsCache.heartbeats.length===0)return"";const e=JL(),{heartbeatsToSend:n,unsentEntries:r}=ude(this._heartbeatsCache.heartbeats),s=Jw(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=e,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),s}catch(e){return Kc.warn(e),""}}}function JL(){return new Date().toISOString().substring(0,10)}function ude(t,e=ade){const n=[];let r=t.slice();for(const s of t){const i=n.find(o=>o.agent===s.agent);if(i){if(i.dates.push(s.date),QL(n)>e){i.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),QL(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class dde{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return uq()?Yle().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await ode(this.app);return n?.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return YL(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return YL(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return}}function QL(t){return Jw(JSON.stringify({version:2,heartbeats:t})).length}function hde(t){if(t.length===0)return-1;let e=0,n=t[0].date;for(let r=1;r<t.length;r++)t[r].date<n&&(n=t[r].date,e=r);return e}function fde(t){uu(new Gc("platform-logger",e=>new Iue(e),"PRIVATE")),uu(new Gc("heartbeat",e=>new lde(e),"PRIVATE")),po(NA,KL,t),po(NA,KL,"esm2020"),po("fire-js","")}fde("");var pde="firebase",mde="12.4.0";po(pde,mde,"app");var XL=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};var Yl,_q;(function(){var t;function e(S,I){function P(){}P.prototype=I.prototype,S.F=I.prototype,S.prototype=new P,S.prototype.constructor=S,S.D=function(k,L,M){for(var V=Array(arguments.length-2),z=2;z<arguments.length;z++)V[z-2]=arguments[z];return I.prototype[L].apply(k,V)}}function n(){this.blockSize=-1}function r(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.C=Array(this.blockSize),this.o=this.h=0,this.u()}e(r,n),r.prototype.u=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function s(S,I,P){P||(P=0);const k=Array(16);
81if(typeof I=="string")for(var L=0;L<16;++L)k[L]=I.charCodeAt(P++)|I.charCodeAt(P++)<<8|I.charCodeAt(P++)<<16|I.charCodeAt(P++)<<24;else for(L=0;L<16;++L)k[L]=I[P++]|I[P++]<<8|I[P++]<<16|I[P++]<<24;I=S.g[0],P=S.g[1],L=S.g[2];let M=S.g[3],V;V=I+(M^P&(L^M))+k[0]+3614090360&4294967295,I=P+(V<<7&4294967295|V>>>25),V=M+(L^I&(P^L))+k[1]+3905402710&4294967295,M=I+(V<<12&4294967295|V>>>20),V=L+(P^M&(I^P))+k[2]+606105819&4294967295,L=M+(V<<17&4294967295|V>>>15),V=P+(I^L&(M^I))+k[3]+3250441966&4294967295,P=L+(V<<22&4294967295|V>>>10),V=I+(M^P&(L^M))+k[4]+4118548399&4294967295,I=P+(V<<7&4294967295|V>>>25),V=M+(L^I&(P^L))+k[5]+1200080426&4294967295,M=I+(V<<12&4294967295|V>>>20),V=L+(P^M&(I^P))+k[6]+2821735955&4294967295,L=M+(V<<17&4294967295|V>>>15),V=P+(I^L&(M^I))+k[7]+4249261313&4294967295,P=L+(V<<22&4294967295|V>>>10),V=I+(M^P&(L^M))+k[8]+1770035416&4294967295,I=P+(V<<7&4294967295|V>>>25),V=M+(L^I&(P^L))+k[9]+2336552879&4294967295,M=I+(V<<12&4294967295|V>>>20),V=L+(P^M&(I^P))+k[10]+4294925233&4294967295,L=M+(V<<17&4294967295|V>>>15),V=P+(I^L&(M^I))+k[11]+2304563134&4294967295,P=L+(V<<22&4294967295|V>>>10),V=I+(M^P&(L^M))+k[12]+1804603682&4294967295,I=P+(V<<7&4294967295|V>>>25),V=M+(L^I&(P^L))+k[13]+4254626195&4294967295,M=I+(V<<12&4294967295|V>>>20),V=L+(P^M&(I^P))+k[14]+2792965006&4294967295,L=M+(V<<17&4294967295|V>>>15),V=P+(I^L&(M^I))+k[15]+1236535329&4294967295,P=L+(V<<22&4294967295|V>>>10),V=I+(L^M&(P^L))+k[1]+4129170786&4294967295,I=P+(V<<5&4294967295|V>>>27),V=M+(P^L&(I^P))+k[6]+3225465664&4294967295,M=I+(V<<9&4294967295|V>>>23),V=L+(I^P&(M^I))+k[11]+643717713&4294967295,L=M+(V<<14&4294967295|V>>>18),V=P+(M^I&(L^M))+k[0]+3921069994&4294967295,P=L+(V<<20&4294967295|V>>>12),V=I+(L^M&(P^L))+k[5]+3593408605&4294967295,I=P+(V<<5&4294967295|V>>>27),V=M+(P^L&(I^P))+k[10]+38016083&4294967295,M=I+(V<<9&4294967295|V>>>23),V=L+(I^P&(M^I))+k[15]+3634488961&4294967295,L=M+(V<<14&4294967295|V>>>18),V=P+(M^I&(L^M))+k[4]+3889429448&4294967295,P=L+(V<<20&4294967295|V>>>12),V=I+(L^M&(P^L))+k[9]+568446438&4294967295,I=P+(V<<5&4294967295|V>>>27),V=M+(P^L&(I^P))+k[14]+3275163606&4294967295,M=I+(V<<9&4294967295|V>>>23),V=L+(I^P&(M^I))+k[3]+4107603335&4294967295,L=M+(V<<14&4294967295|V>>>18),V=P+(M^I&(L^M))+k[8]+1163531501&4294967295,P=L+(V<<20&4294967295|V>>>12),V=I+(L^M&(P^L))+k[13]+2850285829&4294967295,I=P+(V<<5&4294967295|V>>>27),V=M+(P^L&(I^P))+k[2]+4243563512&4294967295,M=I+(V<<9&4294967295|V>>>23),V=L+(I^P&(M^I))+k[7]+1735328473&4294967295,L=M+(V<<14&4294967295|V>>>18),V=P+(M^I&(L^M))+k[12]+2368359562&4294967295,P=L+(V<<20&4294967295|V>>>12),V=I+(P^L^M)+k[5]+4294588738&4294967295,I=P+(V<<4&4294967295|V>>>28),V=M+(I^P^L)+k[8]+2272392833&4294967295,M=I+(V<<11&4294967295|V>>>21),V=L+(M^I^P)+k[11]+1839030562&4294967295,L=M+(V<<16&4294967295|V>>>16),V=P+(L^M^I)+k[14]+4259657740&4294967295,P=L+(V<<23&4294967295|V>>>9),V=I+(P^L^M)+k[1]+2763975236&4294967295,I=P+(V<<4&4294967295|V>>>28),V=M+(I^P^L)+k[4]+1272893353&4294967295,M=I+(V<<11&4294967295|V>>>21),V=L+(M^I^P)+k[7]+4139469664&4294967295,L=M+(V<<16&4294967295|V>>>16),V=P+(L^M^I)+k[10]+3200236656&4294967295,P=L+(V<<23&4294967295|V>>>9),V=I+(P^L^M)+k[13]+681279174&4294967295,I=P+(V<<4&4294967295|V>>>28),V=M+(I^P^L)+k[0]+3936430074&4294967295,M=I+(V<<11&4294967295|V>>>21),V=L+(M^I^P)+k[3]+3572445317&4294967295,L=M+(V<<16&4294967295|V>>>16),V=P+(L^M^I)+k[6]+76029189&4294967295,P=L+(V<<23&4294967295|V>>>9),V=I+(P^L^M)+k[9]+3654602809&4294967295,I=P+(V<<4&4294967295|V>>>28),V=M+(I^P^L)+k[12]+3873151461&4294967295,M=I+(V<<11&4294967295|V>>>21),V=L+(M^I^P)+k[15]+530742520&4294967295,L=M+(V<<16&4294967295|V>>>16),V=P+(L^M^I)+k[2]+3299628645&4294967295,P=L+(V<<23&4294967295|V>>>9),V=I+(L^(P|~M))+k[0]+4096336452&4294967295,I=P+(V<<6&4294967295|V>>>26),V=M+(P^(I|~L))+k[7]+1126891415&4294967295,M=I+(V<<10&4294967295|V>>>22),V=L+(I^(M|~P))+k[14]+2878612391&4294967295,L=M+(V<<15&4294967295|V>>>17),V=P+(M^(L|~I))+k[5]+4237533241&4294967295,P=L+(V<<21&4294967295|V>>>11),V=I+(L^(P|~M))+k[12]+1700485571&4294967295,I=P+(V<<6&4294967295|V>>>26),V=M+(P^(I|~L))+k[3]+2399980690&4294967295,M=I+(V<<10&4294967295|V>>>22),V=L+(I^(M|~P))+k[10]+4293915773&4294967295,L=M+(V<<15&4294967295|V>>>17),V=P+(M^(L|~I))+k[1]+2240044497&4294967295,P=L+(V<<21&4294967295|V>>>11),V=I+(L^(P|~M))+k[8]+1873313359&4294967295,I=P+(V<<6&4294967295|V>>>26),V=M+(P^(I|~L))+k[15]+4264355552&4294967295,M=I+(V<<10&4294967295|V>>>22),V=L+(I^(M|~P))+k[6]+2734768916&4294967295,L=M+(V<<15&4294967295|V>>>17),V=P+(M^(L|~I))+k[13]+1309151649&4294967295,P=L+(V<<21&4294967295|V>>>11),V=I+(L^(P|~M))+k[4]+4149444226&4294967295,I=P+(V<<6&4294967295|V>>>26),V=M+(P^(I|~L))+k[11]+3174756917&4294967295,M=I+(V<<10&4294967295|V>>>22),V=L+(I^(M|~P))+k[2]+718787259&4294967295,L=M+(V<<15&4294967295|V>>>17),V=P+(M^(L|~I))+k[9]+3951481745&4294967295,S.g[0]=S.g[0]+I&4294967295,S.g[1]=S.g[1]+(L+(V<<21&4294967295|V>>>11))&4294967295,S.g[2]=S.g[2]+L&4294967295,S.g[3]=S.g[3]+M&4294967295}r.prototype.v=function(S,I){I===void 0&&(I=S.length);const P=I-this.blockSize,k=this.C;let L=this.h,M=0;for(;M<I;){if(L==0)for(;M<=P;)s(this,S,M),M+=this.blockSize;if(typeof S=="string"){for(;M<I;)if(k[L++]=S.charCodeAt(M++),L==this.blockSize){s(this,k),L=0;break}}else for(;M<I;)if(k[L++]=S[M++],L==this.blockSize){s(this,k),L=0;break}}this.h=L,this.o+=I},r.prototype.A=function(){var S=Array((this.h<56?this.blockSize:this.blockSize*2)-this.h);S[0]=128;for(var I=1;I<S.length-8;++I)S[I]=0;I=this.o*8;for(var P=S.length-8;P<S.length;++P)S[P]=I&255,I/=256;for(this.v(S),S=Array(16),I=0,P=0;P<4;++P)for(let k=0;k<32;k+=8)S[I++]=this.g[P]>>>k&255;return S};function i(S,I){var P=a;return Object.prototype.hasOwnProperty.call(P,S)?P[S]:P[S]=I(S)}function o(S,I){this.h=I;const P=[];let k=!0;for(let L=S.length-1;L>=0;L--){const M=S[L]|0;k&&M==I||(P[L]=M,k=!1)}this.g=P}var a={};function c(S){return-128<=S&&S<128?i(S,function(I){return new o([I|0],I<0?-1:0)}):new o([S|0],S<0?-1:0)}function l(S){if(isNaN(S)||!isFinite(S))return h;if(S<0)return b(l(-S));const I=[];let P=1;for(let k=0;S>=P;k++)I[k]=S/P|0,P*=4294967296;return new o(I,0)}function d(S,I){if(S.length==0)throw Error("number format error: empty string");if(I=I||10,I<2||36<I)throw Error("radix out of range: "+I);if(S.charAt(0)=="-")return b(d(S.substring(1),I));if(S.indexOf("-")>=0)throw Error('number format error: interior "-" character');const P=l(Math.pow(I,8));let k=h;for(let M=0;M<S.length;M+=8){var L=Math.min(8,S.length-M);const V=parseInt(S.substring(M,M+L),I);L<8?(L=l(Math.pow(I,L)),k=k.j(L).add(l(V))):(k=k.j(P),k=k.add(l(V)))}return k}var h=c(0),p=c(1),g=c(16777216);
81t=o.prototype,t.m=function(){if(v(this))return-b(this).m();let S=0,I=1;for(let P=0;P<this.g.length;P++){const k=this.i(P);S+=(k>=0?k:4294967296+k)*I,I*=4294967296}return S},t.toString=function(S){if(S=S||10,S<2||36<S)throw Error("radix out of range: "+S);if(_(this))return"0";if(v(this))return"-"+b(this).toString(S);const I=l(Math.pow(S,6));var P=this;let k="";for(;;){const L=R(P,I).g;P=w(P,L.j(I));let M=((P.g.length>0?P.g[0]:P.h)>>>0).toString(S);if(P=L,_(P))return M+k;for(;M.length<6;)M="0"+M;k=M+k}},t.i=function(S){return S<0?0:S<this.g.length?this.g[S]:this.h};function _(S){if(S.h!=0)return!1;for(let I=0;I<S.g.length;I++)if(S.g[I]!=0)return!1;return!0}function v(S){return S.h==-1}t.l=function(S){return S=w(this,S),v(S)?-1:_(S)?0:1};function b(S){const I=S.g.length,P=[];for(let k=0;k<I;k++)P[k]=~S.g[k];return new o(P,~S.h).add(p)}t.abs=function(){return v(this)?b(this):this},t.add=function(S){const I=Math.max(this.g.length,S.g.length),P=[];let k=0;for(let L=0;L<=I;L++){let M=k+(this.i(L)&65535)+(S.i(L)&65535),V=(M>>>16)+(this.i(L)>>>16)+(S.i(L)>>>16);k=V>>>16,M&=65535,V&=65535,P[L]=V<<16|M}return new o(P,P[P.length-1]&-2147483648?-1:0)};function w(S,I){return S.add(b(I))}t.j=function(S){if(_(this)||_(S))return h;if(v(this))return v(S)?b(this).j(b(S)):b(b(this).j(S));if(v(S))return b(this.j(b(S)));if(this.l(g)<0&&S.l(g)<0)return l(this.m()*S.m());const I=this.g.length+S.g.length,P=[];for(var k=0;k<2*I;k++)P[k]=0;for(k=0;k<this.g.length;k++)for(let L=0;L<S.g.length;L++){const M=this.i(k)>>>16,V=this.i(k)&65535,z=S.i(L)>>>16,ie=S.i(L)&65535;P[2*k+2*L]+=V*ie,E(P,2*k+2*L),P[2*k+2*L+1]+=M*ie,E(P,2*k+2*L+1),P[2*k+2*L+1]+=V*z,E(P,2*k+2*L+1),P[2*k+2*L+2]+=M*z,E(P,2*k+2*L+2)}for(S=0;S<I;S++)P[S]=P[2*S+1]<<16|P[2*S];for(S=I;S<2*I;S++)P[S]=0;return new o(P,0)};function E(S,I){for(;(S[I]&65535)!=S[I];)S[I+1]+=S[I]>>>16,S[I]&=65535,I++}function T(S,I){this.g=S,this.h=I}function R(S,I){if(_(I))throw Error("division by zero");if(_(S))return new T(h,h);if(v(S))return I=R(b(S),I),new T(b(I.g),b(I.h));if(v(I))return I=R(S,b(I)),new T(b(I.g),I.h);if(S.g.length>30){if(v(S)||v(I))throw Error("slowDivide_ only works with positive integers.");for(var P=p,k=I;k.l(S)<=0;)P=N(P),k=N(k);var L=O(P,1),M=O(k,1);for(k=O(k,2),P=O(P,2);!_(k);){var V=M.add(k);V.l(S)<=0&&(L=L.add(P),M=V),k=O(k,1),P=O(P,1)}return I=w(S,L.j(I)),new T(L,I)}for(L=h;S.l(I)>=0;){for(P=Math.max(1,Math.floor(S.m()/I.m())),k=Math.ceil(Math.log(P)/Math.LN2),k=k<=48?1:Math.pow(2,k-48),M=l(P),V=M.j(I);v(V)||V.l(S)>0;)P-=k,M=l(P),V=M.j(I);_(M)&&(M=p),L=L.add(M),S=w(S,V)}return new T(L,S)}t.B=function(S){return R(this,S).h},t.and=function(S){const I=Math.max(this.g.length,S.g.length),P=[];for(let k=0;k<I;k++)P[k]=this.i(k)&S.i(k);return new o(P,this.h&S.h)},t.or=function(S){const I=Math.max(this.g.length,S.g.length),P=[];for(let k=0;k<I;k++)P[k]=this.i(k)|S.i(k);return new o(P,this.h|S.h)},t.xor=function(S){const I=Math.max(this.g.length,S.g.length),P=[];for(let k=0;k<I;k++)P[k]=this.i(k)^S.i(k);return new o(P,this.h^S.h)};function N(S){const I=S.g.length+1,P=[];for(let k=0;k<I;k++)P[k]=S.i(k)<<1|S.i(k-1)>>>31;return new o(P,S.h)}function O(S,I){const P=I>>5;I%=32;const k=S.g.length-P,L=[];for(let M=0;M<k;M++)L[M]=I>0?S.i(M+P)>>>I|S.i(M+P+1)<<32-I:S.i(M+P);return new o(L,S.h)}r.prototype.digest=r.prototype.A,r.prototype.reset=r.prototype.u,r.prototype.update=r.prototype.v,_q=r,o.prototype.add=o.prototype.add,o.prototype.multiply=o.prototype.j,o.prototype.modulo=o.prototype.B,o.prototype.compare=o.prototype.l,o.prototype.toNumber=o.prototype.m,o.prototype.toString=o.prototype.toString,o.prototype.getBits=o.prototype.i,o.fromNumber=l,o.fromString=d,Yl=o}).apply(typeof XL<"u"?XL:typeof self<"u"?self:typeof window<"u"?window:{});var pb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};var yq,cg,vq,Gb,xA,bq,wq,Sq;(function(){var t,e=Object.defineProperty;function n(m){m=[typeof globalThis=="object"&&globalThis,m,typeof window=="object"&&window,typeof self=="object"&&self,typeof pb=="object"&&pb];for(var A=0;A<m.length;++A){var D=m[A];if(D&&D.Math==Math)return D}throw Error("Cannot find global object")}var r=n(this);function s(m,A){if(A)e:{var D=r;m=m.split(".");for(var U=0;U<m.length-1;U++){var ue=m[U];if(!(ue in D))break e;D=D[ue]}m=m[m.length-1],U=D[m],A=A(U),A!=U&&A!=null&&e(D,m,{configurable:!0,writable:!0,value:A})}}s("Symbol.dispose",function(m){return m||Symbol("Symbol.dispose")}),s("Array.prototype.values",function(m){return m||function(){return this[Symbol.iterator]()}}),s("Object.entries",function(m){return m||function(A){var D=[],U;for(U in A)Object.prototype.hasOwnProperty.call(A,U)&&D.push([U,A[U]]);return D}});var i=i||{},o=this||self;function a(m){var A=typeof m;return A=="object"&&m!=null||A=="function"}
81function c(m,A,D){return m.call.apply(m.bind,arguments)}function l(m,A,D){return l=c,l.apply(null,arguments)}function d(m,A){var D=Array.prototype.slice.call(arguments,1);return function(){var U=D.slice();return U.push.apply(U,arguments),m.apply(this,U)}}function h(m,A){function D(){}D.prototype=A.prototype,m.Z=A.prototype,m.prototype=new D,m.prototype.constructor=m,m.Ob=function(U,ue,he){for(var He=Array(arguments.length-2),kt=2;kt<arguments.length;kt++)He[kt-2]=arguments[kt];return A.prototype[ue].apply(U,He)}}var p=typeof AsyncContext<"u"&&typeof AsyncContext.Snapshot=="function"?m=>m&&AsyncContext.Snapshot.wrap(m):m=>m;function g(m){const A=m.length;if(A>0){const D=Array(A);for(let U=0;U<A;U++)D[U]=m[U];return D}return[]}function _(m,A){for(let U=1;U<arguments.length;U++){const ue=arguments[U];var D=typeof ue;if(D=D!="object"?D:ue?Array.isArray(ue)?"array":D:"null",D=="array"||D=="object"&&typeof ue.length=="number"){D=m.length||0;const he=ue.length||0;m.length=D+he;for(let He=0;He<he;He++)m[D+He]=ue[He]}else m.push(ue)}}class v{constructor(A,D){this.i=A,this.j=D,this.h=0,this.g=null}get(){let A;return this.h>0?(this.h--,A=this.g,this.g=A.next,A.next=null):A=this.i(),A}}function b(m){o.setTimeout(()=>{throw m},0)}function w(){var m=S;let A=null;return m.g&&(A=m.g,m.g=m.g.next,m.g||(m.h=null),A.next=null),A}class E{constructor(){this.h=this.g=null}add(A,D){const U=T.get();U.set(A,D),this.h?this.h.next=U:this.g=U,this.h=U}}var T=new v(()=>new R,m=>m.reset());class R{constructor(){this.next=this.g=this.h=null}set(A,D){this.h=A,this.g=D,this.next=null}reset(){this.next=this.g=this.h=null}}let N,O=!1,S=new E,I=()=>{const m=Promise.resolve(void 0);N=()=>{m.then(P)}};function P(){for(var m;m=w();){try{m.h.call(m.g)}catch(D){b(D)}var A=T;A.j(m),A.h<100&&(A.h++,m.next=A.g,A.g=m)}O=!1}function k(){this.u=this.u,this.C=this.C}k.prototype.u=!1,k.prototype.dispose=function(){this.u||(this.u=!0,this.N())},k.prototype[Symbol.dispose]=function(){this.dispose()},k.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function L(m,A){this.type=m,this.g=this.target=A,this.defaultPrevented=!1}L.prototype.h=function(){this.defaultPrevented=!0};var M=(function(){if(!o.addEventListener||!Object.defineProperty)return!1;var m=!1,A=Object.defineProperty({},"passive",{get:function(){m=!0}});try{const D=()=>{};o.addEventListener("test",D,A),o.removeEventListener("test",D,A)}catch{}return m})();function V(m){return/^[\s\xa0]*$/.test(m)}function z(m,A){L.call(this,m?m.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,m&&this.init(m,A)}h(z,L),z.prototype.init=function(m,A){const D=this.type=m.type,U=m.changedTouches&&m.changedTouches.length?m.changedTouches[0]:null;this.target=m.target||m.srcElement,this.g=A,A=m.relatedTarget,A||(D=="mouseover"?A=m.fromElement:D=="mouseout"&&(A=m.toElement)),this.relatedTarget=A,U?(this.clientX=U.clientX!==void 0?U.clientX:U.pageX,this.clientY=U.clientY!==void 0?U.clientY:U.pageY,this.screenX=U.screenX||0,this.screenY=U.screenY||0):(this.clientX=m.clientX!==void 0?m.clientX:m.pageX,this.clientY=m.clientY!==void 0?m.clientY:m.pageY,this.screenX=m.screenX||0,this.screenY=m.screenY||0),this.button=m.button,this.key=m.key||"",this.ctrlKey=m.ctrlKey,this.altKey=m.altKey,this.shiftKey=m.shiftKey,this.metaKey=m.metaKey,this.pointerId=m.pointerId||0,this.pointerType=m.pointerType,this.state=m.state,this.i=m,m.defaultPrevented&&z.Z.h.call(this)},z.prototype.h=function(){z.Z.h.call(this);const m=this.i;m.preventDefault?m.preventDefault():m.returnValue=!1};var ie="closure_listenable_"+(Math.random()*1e6|0),K=0;function ce(m,A,D,U,ue){this.listener=m,this.proxy=null,this.src=A,this.type=D,this.capture=!!U,this.ha=ue,this.key=++K,this.da=this.fa=!1}function G(m){m.da=!0,m.listener=null,m.proxy=null,m.src=null,m.ha=null}function Z(m,A,D){for(const U in m)A.call(D,m[U],U,m)}function de(m,A){for(const D in m)A.call(void 0,m[D],D,m)}function fe(m){const A={};for(const D in m)A[D]=m[D];return A}const ee="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleStr
81ing toString valueOf".split(" ");function Te(m,A){let D,U;for(let ue=1;ue<arguments.length;ue++){U=arguments[ue];for(D in U)m[D]=U[D];for(let he=0;he<ee.length;he++)D=ee[he],Object.prototype.hasOwnProperty.call(U,D)&&(m[D]=U[D])}}function pe(m){this.src=m,this.g={},this.h=0}pe.prototype.add=function(m,A,D,U,ue){const he=m.toString();m=this.g[he],m||(m=this.g[he]=[],this.h++);const He=Ve(m,A,U,ue);return He>-1?(A=m[He],D||(A.fa=!1)):(A=new ce(A,this.src,he,!!U,ue),A.fa=D,m.push(A)),A};function Ce(m,A){const D=A.type;if(D in m.g){var U=m.g[D],ue=Array.prototype.indexOf.call(U,A,void 0),he;(he=ue>=0)&&Array.prototype.splice.call(U,ue,1),he&&(G(A),m.g[D].length==0&&(delete m.g[D],m.h--))}}function Ve(m,A,D,U){for(let ue=0;ue<m.length;++ue){const he=m[ue];if(!he.da&&he.listener==A&&he.capture==!!D&&he.ha==U)return ue}return-1}var Y="closure_lm_"+(Math.random()*1e6|0),ve={};function Ee(m,A,D,U,ue){if(Array.isArray(A)){for(let he=0;he<A.length;he++)Ee(m,A[he],D,U,ue);return null}return D=B(D),m&&m[ie]?m.J(A,D,a(U)?!!U.capture:!1,ue):Me(m,A,D,!1,U,ue)}function Me(m,A,D,U,ue,he){if(!A)throw Error("Invalid event type");const He=a(ue)?!!ue.capture:!!ue;let kt=Re(m);if(kt||(m[Y]=kt=new pe(m)),D=kt.add(A,D,U,He,he),D.proxy)return D;if(U=Ke(),D.proxy=U,U.src=m,U.listener=D,m.addEventListener)M||(ue=He),ue===void 0&&(ue=!1),m.addEventListener(A.toString(),U,ue);else if(m.attachEvent)m.attachEvent(j(A.toString()),U);else if(m.addListener&&m.removeListener)m.addListener(U);else throw Error("addEventListener and attachEvent are unavailable.");return D}function Ke(){function m(D){return A.call(m.src,m.listener,D)}const A=re;return m}function ut(m,A,D,U,ue){if(Array.isArray(A))for(var he=0;he<A.length;he++)ut(m,A[he],D,U,ue);else U=a(U)?!!U.capture:!!U,D=B(D),m&&m[ie]?(m=m.i,he=String(A).toString(),he in m.g&&(A=m.g[he],D=Ve(A,D,U,ue),D>-1&&(G(A[D]),Array.prototype.splice.call(A,D,1),A.length==0&&(delete m.g[he],m.h--)))):m&&(m=Re(m))&&(A=m.g[A.toString()],m=-1,A&&(m=Ve(A,D,U,ue)),(D=m>-1?A[m]:null)&&H(D))}function H(m){if(typeof m!="number"&&m&&!m.da){var A=m.src;if(A&&A[ie])Ce(A.i,m);else{var D=m.type,U=m.proxy;A.removeEventListener?A.removeEventListener(D,U,m.capture):A.detachEvent?A.detachEvent(j(D),U):A.addListener&&A.removeListener&&A.removeListener(U),(D=Re(A))?(Ce(D,m),D.h==0&&(D.src=null,A[Y]=null)):G(m)}}}function j(m){return m in ve?ve[m]:ve[m]="on"+m}function re(m,A){if(m.da)m=!0;else{A=new z(A,this);const D=m.listener,U=m.ha||m.src;m.fa&&H(m),m=D.call(U,A)}return m}function Re(m){return m=m[Y],m instanceof pe?m:null}var ge="__closure_events_fn_"+(Math.random()*1e9>>>0);function B(m){return typeof m=="function"?m:(m[ge]||(m[ge]=function(A){return m.handleEvent(A)}),m[ge])}function q(){k.call(this),this.i=new pe(this),this.M=this,this.G=null}h(q,k),q.prototype[ie]=!0,q.prototype.removeEventListener=function(m,A,D,U){ut(this,m,A,D,U)};function J(m,A){var D,U=m.G;if(U)for(D=[];U;U=U.G)D.push(U);if(m=m.M,U=A.type||A,typeof A=="string")A=new L(A,m);else if(A instanceof L)A.target=A.target||m;else{var ue=A;A=new L(U,m),Te(A,ue)}ue=!0;let he,He;if(D)for(He=D.length-1;He>=0;He--)he=A.g=D[He],ue=se(he,U,!0,A)&&ue;if(he=A.g=m,ue=se(he,U,!0,A)&&ue,ue=se(he,U,!1,A)&&ue,D)for(He=0;He<D.length;He++)he=A.g=D[He],ue=se(he,U,!1,A)&&ue}q.prototype.N=function(){if(q.Z.N.call(this),this.i){var m=this.i;for(const A in m.g){const D=m.g[A];for(let U=0;U<D.length;U++)G(D[U]);delete m.g[A],m.h--}}this.G=null},q.prototype.J=function(m,A,D,U){return this.i.add(String(m),A,!1,D,U)},q.prototype.K=function(m,A,D,U){return this.i.add(String(m),A,!0,D,U)};function se(m,A,D,U){if(A=m.i.g[String(A)],!A)return!0;A=A.concat();let ue=!0;for(let he=0;he<A.length;++he){const He=A[he];if(He&&!He.da&&He.capture==D){const kt=He.listener,fr=He.ha||He.src;He.fa&&Ce(m.i,He),ue=kt.call(fr,U)!==!1&&ue}}return ue&&!U.defaultPrevented}function be(m,A){if(typeof m!="function")if(m&&typeof m.handleEvent=="function")m=l(m.handleEvent,m);else throw Error("Invalid listener argument");return Number(A)>2147483647?-1:o.setTimeout(m,A||0)}function xe(m){m.g=be(()=>{m.g=null,m.i&&(m.i=!1,xe(m))},m.l);const A=m.h;m.h=null,m.m.apply(null,A)}class X extends k{constructor(A,D){super(),this.m=A,this.l=D,this.h=null,this.i=!1,this.g=null}j(A){this.h=arguments,this.g?this.i=!0:xe(this)}N(){super.N(),this.g&&(o.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function le(m){k.call(this),this.h=m,this.g={}}h(le,k);var je=[];function Ye(m){Z(m.g,function(A,D){this.g.hasOwnProperty(D)&&H(A)},m),m.g={}}le.prototype.N=function(){le.Z.N.call(this),Ye(this)},le.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var vt=o.JSON.stringify,oe=o.JSON.parse,ye=class{stringify(m){return o.JSON.stringify(m,void 0)}parse(m){return o.JSON.parse(m,void 0)}};function Fe(){}function ot(){}var dt={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function Vr(){L.call(this,"d")}h(Vr,L);
81function jn(){L.call(this,"c")}h(jn,L);var kn={},Tr=null;function wo(){return Tr=Tr||new q}kn.Ia="serverreachability";function Ga(m){L.call(this,kn.Ia,m)}h(Ga,L);function So(m){const A=wo();J(A,new Ga(A))}kn.STAT_EVENT="statevent";function Qo(m,A){L.call(this,kn.STAT_EVENT,m),this.stat=A}h(Qo,L);function Er(m){const A=wo();J(A,new Qo(A,m))}kn.Ja="timingevent";function gh(m,A){L.call(this,kn.Ja,m),this.size=A}h(gh,L);function De(m,A){if(typeof m!="function")throw Error("Fn must not be null and must be a function");return o.setTimeout(function(){m()},A)}function We(){this.g=!0}We.prototype.ua=function(){this.g=!1};function Rt(m,A,D,U,ue,he){m.info(function(){if(m.g)if(he){var He="",kt=he.split("&");for(let Sn=0;Sn<kt.length;Sn++){var fr=kt[Sn].split("=");if(fr.length>1){const pr=fr[0];fr=fr[1];const ni=pr.split("_");He=ni.length>=2&&ni[1]=="type"?He+(pr+"="+fr+"&"):He+(pr+"=redacted&")}}}else He=null;else He=he;return"XMLHTTP REQ ("+U+") [attempt "+ue+"]: "+A+` 82`+D+` 83`+He})}function Ir(m,A,D,U,ue,he,He){m.info(function(){return"XMLHTTP RESP ("+U+") [ attempt "+ue+"]: "+A+` 84`+D+` 85`+he+" "+He})}function pn(m,A,D,U){m.info(function(){return"XMLHTTP TEXT ("+A+"): "+Xo(m,D)+(U?" "+U:"")})}function Ci(m,A){m.info(function(){return"TIMEOUT: "+A})}We.prototype.info=function(){};function Xo(m,A){if(!m.g)return A;if(!A)return null;try{const he=JSON.parse(A);if(he){for(m=0;m<he.length;m++)if(Array.isArray(he[m])){var D=he[m];if(!(D.length<2)){var U=D[1];if(Array.isArray(U)&&!(U.length<1)){var ue=U[0];if(ue!="noop"&&ue!="stop"&&ue!="close")for(let He=1;He<U.length;He++)U[He]=""}}}}return vt(he)}catch{return A}}var er={NO_ERROR:0,cb:1,qb:2,pb:3,kb:4,ob:5,rb:6,Ga:7,TIMEOUT:8,ub:9},ps={ib:"complete",Fb:"success",ERROR:"error",Ga:"abort",xb:"ready",yb:"readystatechange",TIMEOUT:"timeout",sb:"incrementaldata",wb:"progress",lb:"downloadprogress",Nb:"uploadprogress"},Vs;function Zo(){}h(Zo,Fe),Zo.prototype.g=function(){return new XMLHttpRequest},Vs=new Zo;function Ka(m){return encodeURIComponent(String(m))}function tm(m){var A=1;m=m.split(":");const D=[];for(;A>0&&m.length;)D.push(m.shift()),A--;return m.length&&D.push(m.join(":")),D}function Wi(m,A,D,U){this.j=m,this.i=A,this.l=D,this.S=U||1,this.V=new le(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new cl}function cl(){this.i=null,this.g="",this.h=!1}var ea={},xu={};function nm(m,A,D){m.M=1,m.A=Ja(Ai(A)),m.u=D,m.R=!0,rm(m,null)}function rm(m,A){m.F=Date.now(),_h(m),m.B=Ai(m.A);var D=m.B,U=m.S;Array.isArray(U)||(U=[String(U)]),hm(D.i,"t",U),m.C=0,D=m.j.L,m.h=new cl,m.g=Eo(m.j,D?A:null,!m.u),m.P>0&&(m.O=new X(l(m.Y,m,m.g),m.P)),A=m.V,D=m.g,U=m.ba;var ue="readystatechange";Array.isArray(ue)||(ue&&(je[0]=ue.toString()),ue=je);for(let he=0;he<ue.length;he++){const He=Ee(D,ue[he],U||A.handleEvent,!1,A.h||A);if(!He)break;A.g[He.key]=He}A=m.J?fe(m.J):{},m.u?(m.v||(m.v="POST"),A["Content-Type"]="application/x-www-form-urlencoded",m.g.ea(m.B,m.v,m.u,A)):(m.v="GET",m.g.ea(m.B,m.v,null,A)),So(),Rt(m.i,m.v,m.B,m.l,m.S,m.u)}Wi.prototype.ba=function(m){m=m.target;const A=this.O;A&&ra(m)==3?A.j():this.Y(m)},Wi.prototype.Y=function(m){try{if(m==this.g)e:{const kt=ra(this.g),fr=this.g.ya(),Sn=this.g.ca();if(!(kt<3)&&(kt!=3||this.g&&(this.h.h||this.g.la()||pv(this.g)))){this.K||kt!=4||fr==7||(fr==8||Sn<=0?So(3):So(2)),sm(this);var A=this.g.ca();this.X=A;var D=iI(this);if(this.o=A==200,Ir(this.i,this.v,this.B,this.l,this.S,kt,A),this.o){if(this.U&&!this.L){t:{if(this.g){var U,ue=this.g;if((U=ue.g?ue.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!V(U)){var he=U;break t}}he=null}if(m=he)pn(this.i,this.l,m,"Initial handshake response via X-HTTP-Initial-Response"),this.L=!0,ll(this,m);else{this.o=!1,this.m=3,Er(12),za(this),ta(this);break e}}if(this.R){m=!0;let pr;for(;!this.K&&this.C<D.length;)if(pr=oI(this,D),pr==xu){kt==4&&(this.m=4,Er(14),m=!1),pn(this.i,this.l,null,"[Incomplete Response]");break}else if(pr==ea){this.m=4,Er(15),pn(this.i,this.l,D,"[Invalid Chunk]"),m=!1;break}else pn(this.i,this.l,pr,null),ll(this,pr);if(Zy(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),kt!=4||D.length!=0||this.h.h||(this.m=1,Er(16),m=!1),this.o=this.o&&m,!m)pn(this.i,this.l,D,"[Invalid Chunked Response]"),za(this),ta(this);else if(D.length>0&&!this.W){this.W=!0;var He=this.j;He.g==this&&He.aa&&!He.P&&(He.j.info("Great, no buffering proxy detected. Bytes received: "+D.length),Ih(He),He.P=!0,Er(11))}}else pn(this.i,this.l,D,null),ll(this,D);kt==4&&za(this),this.o&&!this.K&&(kt==4?bs(this.j,this):(this.o=!1,_h(this)))}else pI(this.g),A==400&&D.indexOf("Unknown SID")>0?(this.m=3,Er(12)):(this.m=0,Er(13)),za(this),ta(this)}}}catch{}};function iI(m){if(!Zy(m))return m.g.la();const A=pv(m.g);if(A==="")return"";let D="";const U=A.length,ue=ra(m.g)==4;
85if(!m.h.i){if(typeof TextDecoder>"u")return za(m),ta(m),"";m.h.i=new o.TextDecoder}for(let he=0;he<U;he++)m.h.h=!0,D+=m.h.i.decode(A[he],{stream:!(ue&&he==U-1)});return A.length=0,m.h.g+=D,m.C=0,m.h.g}function Zy(m){return m.g?m.v=="GET"&&m.M!=2&&m.j.Aa:!1}function oI(m,A){var D=m.C,U=A.indexOf(` 86`,D);return U==-1?xu:(D=Number(A.substring(D,U)),isNaN(D)?ea:(U+=1,U+D>A.length?xu:(A=A.slice(U,U+D),m.C=U+D,A)))}Wi.prototype.cancel=function(){this.K=!0,za(this)};function _h(m){m.T=Date.now()+m.H,ev(m,m.H)}function ev(m,A){if(m.D!=null)throw Error("WatchDog timer not null");m.D=De(l(m.aa,m),A)}function sm(m){m.D&&(o.clearTimeout(m.D),m.D=null)}Wi.prototype.aa=function(){this.D=null;const m=Date.now();m-this.T>=0?(Ci(this.i,this.B),this.M!=2&&(So(),Er(17)),za(this),this.m=2,ta(this)):ev(this,this.T-m)};function ta(m){m.j.I==0||m.K||bs(m.j,m)}function za(m){sm(m);var A=m.O;A&&typeof A.dispose=="function"&&A.dispose(),m.O=null,Ye(m.V),m.g&&(A=m.g,m.g=null,A.abort(),A.dispose())}function ll(m,A){try{var D=m.j;if(D.I!=0&&(D.g==m||yh(D.h,m))){if(!m.L&&yh(D.h,m)&&D.I==3){try{var U=D.Ba.g.parse(A)}catch{U=null}if(Array.isArray(U)&&U.length==3){var ue=U;if(ue[0]==0){e:if(!D.v){if(D.g)if(D.g.F+3e3<m.F)Fu(D),hr(D);else break e;Eh(D),Er(18)}}else D.xa=ue[1],0<D.xa-D.K&&ue[2]<37500&&D.F&&D.A==0&&!D.C&&(D.C=De(l(D.Va,D),6e3));im(D.h)<=1&&D.ta&&(D.ta=void 0)}else Fr(D,11)}else if((m.L||D.g==m)&&Fu(D),!V(A))for(ue=D.Ba.g.parse(A),A=0;A<ue.length;A++){let Sn=ue[A];const pr=Sn[0];if(!(pr<=D.K))if(D.K=pr,Sn=Sn[1],D.I==2)if(Sn[0]=="c"){D.M=Sn[1],D.ba=Sn[2];const ni=Sn[3];ni!=null&&(D.ka=ni,D.j.info("VER="+D.ka));const sa=Sn[4];sa!=null&&(D.za=sa,D.j.info("SVER="+D.za));const ia=Sn[5];ia!=null&&typeof ia=="number"&&ia>0&&(U=1.5*ia,D.O=U,D.j.info("backChannelRequestTimeoutMs_="+U)),U=D;const Ki=m.g;if(Ki){const pl=Ki.g?Ki.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(pl){var he=U.h;he.g||pl.indexOf("spdy")==-1&&pl.indexOf("quic")==-1&&pl.indexOf("h2")==-1||(he.j=he.l,he.g=new Set,he.h&&(vh(he,he.h),he.h=null))}if(U.G){const Sm=Ki.g?Ki.g.getResponseHeader("X-HTTP-Session-Id"):null;Sm&&(U.wa=Sm,Mn(U.J,U.G,Sm))}}D.I=3,D.l&&D.l.ra(),D.aa&&(D.T=Date.now()-m.F,D.j.info("Handshake RTT: "+D.T+"ms")),U=D;var He=m;if(U.na=wm(U,U.L?U.ba:null,U.W),He.L){rv(U.h,He);var kt=He,fr=U.O;fr&&(kt.H=fr),kt.D&&(sm(kt),_h(kt)),U.g=He}else vm(U);D.i.length>0&&Gi(D)}else Sn[0]!="stop"&&Sn[0]!="close"||Fr(D,7);else D.I==3&&(Sn[0]=="stop"||Sn[0]=="close"?Sn[0]=="stop"?Fr(D,7):_m(D):Sn[0]!="noop"&&D.l&&D.l.qa(Sn),D.A=0)}}So(4)}catch{}}var aI=class{constructor(m,A){this.g=m,this.map=A}};function tv(m){this.l=m||10,o.PerformanceNavigationTiming?(m=o.performance.getEntriesByType("navigation"),m=m.length>0&&(m[0].nextHopProtocol=="hq"||m[0].nextHopProtocol=="h2")):m=!!(o.chrome&&o.chrome.loadTimes&&o.chrome.loadTimes()&&o.chrome.loadTimes().wasFetchedViaSpdy),this.j=m?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function nv(m){return m.h?!0:m.g?m.g.size>=m.j:!1}function im(m){return m.h?1:m.g?m.g.size:0}function yh(m,A){return m.h?m.h==A:m.g?m.g.has(A):!1}function vh(m,A){m.g?m.g.add(A):m.h=A}function rv(m,A){m.h&&m.h==A?m.h=null:m.g&&m.g.has(A)&&m.g.delete(A)}tv.prototype.cancel=function(){if(this.i=sv(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const m of this.g.values())m.cancel();this.g.clear()}};function sv(m){if(m.h!=null)return m.i.concat(m.h.G);if(m.g!=null&&m.g.size!==0){let A=m.i;for(const D of m.g.values())A=A.concat(D.G);return A}return g(m.i)}var iv=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function cI(m,A){if(m){m=m.split("&");for(let D=0;D<m.length;D++){const U=m[D].indexOf("=");let ue,he=null;U>=0?(ue=m[D].substring(0,U),he=m[D].substring(U+1)):ue=m[D],A(ue,he?decodeURIComponent(he.replace(/\+/g," ")):"")}}}function To(m){this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1;let A;m instanceof To?(this.l=m.l,ul(this,m.j),this.o=m.o,this.g=m.g,Ya(this,m.u),this.h=m.h,om(this,fm(m.i)),this.m=m.m):m&&(A=String(m).match(iv))?(this.l=!1,ul(this,A[1]||"",!0),this.o=dl(A[2]||""),this.g=dl(A[3]||"",!0),Ya(this,A[4]),this.h=dl(A[5]||"",!0),om(this,A[6]||"",!0),this.m=dl(A[7]||"")):(this.l=!1,this.i=new Qa(null,this.l))}To.prototype.toString=function(){const m=[];var A=this.j;A&&m.push(Lu(A,am,!0),":");var D=this.g;return(D||A=="file")&&(m.push("//"),(A=this.o)&&m.push(Lu(A,am,!0),"@"),m.push(Ka(D).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),D=this.u,D!=null&&m.push(":",String(D))),(D=this.h)&&(this.g&&D.charAt(0)!="/"&&m.push("/"),m.push(Lu(D,D.charAt(0)=="/"?lI:cm,!0))
86),(D=this.i.toString())&&m.push("?",D),(D=this.m)&&m.push("#",Lu(D,lm)),m.join("")},To.prototype.resolve=function(m){const A=Ai(this);let D=!!m.j;D?ul(A,m.j):D=!!m.o,D?A.o=m.o:D=!!m.g,D?A.g=m.g:D=m.u!=null;var U=m.h;if(D)Ya(A,m.u);else if(D=!!m.h){if(U.charAt(0)!="/")if(this.g&&!this.h)U="/"+U;else{var ue=A.h.lastIndexOf("/");ue!=-1&&(U=A.h.slice(0,ue+1)+U)}if(ue=U,ue==".."||ue==".")U="";else if(ue.indexOf("./")!=-1||ue.indexOf("/.")!=-1){U=ue.lastIndexOf("/",0)==0,ue=ue.split("/");const he=[];for(let He=0;He<ue.length;){const kt=ue[He++];kt=="."?U&&He==ue.length&&he.push(""):kt==".."?((he.length>1||he.length==1&&he[0]!="")&&he.pop(),U&&He==ue.length&&he.push("")):(he.push(kt),U=!0)}U=he.join("/")}else U=ue}return D?A.h=U:D=m.i.toString()!=="",D?om(A,fm(m.i)):D=!!m.m,D&&(A.m=m.m),A};function Ai(m){return new To(m)}function ul(m,A,D){m.j=D?dl(A,!0):A,m.j&&(m.j=m.j.replace(/:$/,""))}function Ya(m,A){if(A){if(A=Number(A),isNaN(A)||A<0)throw Error("Bad port number "+A);m.u=A}else m.u=null}function om(m,A,D){A instanceof Qa?(m.i=A,lv(m.i,m.l)):(D||(A=Lu(A,av)),m.i=new Qa(A,m.l))}function Mn(m,A,D){m.i.set(A,D)}function Ja(m){return Mn(m,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^Date.now()).toString(36)),m}function dl(m,A){return m?A?decodeURI(m.replace(/%25/g,"%2525")):decodeURIComponent(m):""}function Lu(m,A,D){return typeof m=="string"?(m=encodeURI(m).replace(A,ov),D&&(m=m.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),m):null}function ov(m){return m=m.charCodeAt(0),"%"+(m>>4&15).toString(16)+(m&15).toString(16)}var am=/[#\/\?@]/g,cm=/[#\?:]/g,lI=/[#\?]/g,av=/[#\?@]/g,lm=/#/g;function Qa(m,A){this.h=this.g=null,this.i=m||null,this.j=!!A}function ti(m){m.g||(m.g=new Map,m.h=0,m.i&&cI(m.i,function(A,D){m.add(decodeURIComponent(A.replace(/\+/g," ")),D)}))}t=Qa.prototype,t.add=function(m,A){ti(this),this.i=null,m=Xa(this,m);let D=this.g.get(m);return D||this.g.set(m,D=[]),D.push(A),this.h+=1,this};function um(m,A){ti(m),A=Xa(m,A),m.g.has(A)&&(m.i=null,m.h-=m.g.get(A).length,m.g.delete(A))}function dm(m,A){return ti(m),A=Xa(m,A),m.g.has(A)}t.forEach=function(m,A){ti(this),this.g.forEach(function(D,U){D.forEach(function(ue){m.call(A,ue,U,this)},this)},this)};function cv(m,A){ti(m);let D=[];if(typeof A=="string")dm(m,A)&&(D=D.concat(m.g.get(Xa(m,A))));else for(m=Array.from(m.g.values()),A=0;A<m.length;A++)D=D.concat(m[A]);return D}t.set=function(m,A){return ti(this),this.i=null,m=Xa(this,m),dm(this,m)&&(this.h-=this.g.get(m).length),this.g.set(m,[A]),this.h+=1,this},t.get=function(m,A){return m?(m=cv(this,m),m.length>0?String(m[0]):A):A};function hm(m,A,D){um(m,A),D.length>0&&(m.i=null,m.g.set(Xa(m,A),g(D)),m.h+=D.length)}t.toString=function(){if(this.i)return this.i;if(!this.g)return"";const m=[],A=Array.from(this.g.keys());for(let U=0;U<A.length;U++){var D=A[U];const ue=Ka(D);D=cv(this,D);for(let he=0;he<D.length;he++){let He=ue;D[he]!==""&&(He+="="+Ka(D[he])),m.push(He)}}return this.i=m.join("&")};function fm(m){const A=new Qa;return A.i=m.i,m.g&&(A.g=new Map(m.g),A.h=m.h),A}function Xa(m,A){return A=String(A),m.j&&(A=A.toLowerCase()),A}function lv(m,A){A&&!m.j&&(ti(m),m.i=null,m.g.forEach(function(D,U){const ue=U.toLowerCase();U!=ue&&(um(this,U),hm(this,ue,D))},m)),m.j=A}function uI(m,A){const D=new We;if(o.Image){const U=new Image;U.onload=d(na,D,"TestLoadImage: loaded",!0,A,U),U.onerror=d(na,D,"TestLoadImage: error",!1,A,U),U.onabort=d(na,D,"TestLoadImage: abort",!1,A,U),U.ontimeout=d(na,D,"TestLoadImage: timeout",!1,A,U),o.setTimeout(function(){U.ontimeout&&U.ontimeout()},1e4),U.src=m}else A(!1)}function dI(m,A){const D=new We,U=new AbortController,ue=setTimeout(()=>{U.abort(),na(D,"TestPingServer: timeout",!1,A)},1e4);fetch(m,{signal:U.signal}).then(he=>{clearTimeout(ue),he.ok?na(D,"TestPingServer: ok",!0,A):na(D,"TestPingServer: server error",!1,A)}).catch(()=>{clearTimeout(ue),na(D,"TestPingServer: error",!1,A)})}function na(m,A,D,U,ue){try{ue&&(ue.onload=null,ue.onerror=null,ue.onabort=null,ue.ontimeout=null),U(D)}catch{}}function uv(){this.g=new ye}function pm(m){this.i=m.Sb||null,this.h=m.ab||!1}h(pm,Fe),pm.prototype.g=function(){return new bh(this.i,this.h)};function bh(m,A){q.call(this),this.H=m,this.o=A,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}h(bh,q),t=bh.prototype,t.open=function(m,A){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.F=m,this.D=A,this.readyState=1,Za(this)},t.send=function(m){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");
86if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const A={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};m&&(A.body=m),(this.H||o).fetch(new Request(this.D,A)).then(this.Pa.bind(this),this.ga.bind(this))},t.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&this.readyState!=4&&(this.g=!1,Mu(this)),this.readyState=0},t.Pa=function(m){if(this.g&&(this.l=m,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=m.headers,this.readyState=2,Za(this)),this.g&&(this.readyState=3,Za(this),this.g)))if(this.responseType==="arraybuffer")m.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(typeof o.ReadableStream<"u"&&"body"in m){if(this.j=m.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.B=new TextDecoder;dv(this)}else m.text().then(this.Oa.bind(this),this.ga.bind(this))};function dv(m){m.j.read().then(m.Ma.bind(m)).catch(m.ga.bind(m))}t.Ma=function(m){if(this.g){if(this.o&&m.value)this.response.push(m.value);else if(!this.o){var A=m.value?m.value:new Uint8Array(0);(A=this.B.decode(A,{stream:!m.done}))&&(this.response=this.responseText+=A)}m.done?Mu(this):Za(this),this.readyState==3&&dv(this)}},t.Oa=function(m){this.g&&(this.response=this.responseText=m,Mu(this))},t.Na=function(m){this.g&&(this.response=m,Mu(this))},t.ga=function(){this.g&&Mu(this)};function Mu(m){m.readyState=4,m.l=null,m.j=null,m.B=null,Za(m)}t.setRequestHeader=function(m,A){this.A.append(m,A)},t.getResponseHeader=function(m){return this.h&&this.h.get(m.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const m=[],A=this.h.entries();for(var D=A.next();!D.done;)D=D.value,m.push(D[0]+": "+D[1]),D=A.next();return m.join(`\r 87`)};function Za(m){m.onreadystatechange&&m.onreadystatechange.call(m)}Object.defineProperty(bh.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(m){this.m=m?"include":"same-origin"}});function hv(m){let A="";return Z(m,function(D,U){A+=U,A+=":",A+=D,A+=`\r 88`}),A}function mm(m,A,D){e:{for(U in D){var U=!1;break e}U=!0}U||(D=hv(D),typeof m=="string"?D!=null&&Ka(D):Mn(m,A,D))}function tr(m){q.call(this),this.headers=new Map,this.L=m||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}h(tr,q);var hI=/^https?$/i,fI=["POST","PUT"];t=tr.prototype,t.Fa=function(m){this.H=m},t.ea=function(m,A,D,U){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+m);A=A?A.toUpperCase():"GET",this.D=m,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():Vs.g(),this.g.onreadystatechange=p(l(this.Ca,this));try{this.B=!0,this.g.open(A,String(m),!0),this.B=!1}catch(he){Vn(this,he);return}if(m=D||"",D=new Map(this.headers),U)if(Object.getPrototypeOf(U)===Object.prototype)for(var ue in U)D.set(ue,U[ue]);else if(typeof U.keys=="function"&&typeof U.get=="function")for(const he of U.keys())D.set(he,U.get(he));else throw Error("Unknown input type for opt_headers: "+String(U));U=Array.from(D.keys()).find(he=>he.toLowerCase()=="content-type"),ue=o.FormData&&m instanceof o.FormData,!(Array.prototype.indexOf.call(fI,A,void 0)>=0)||U||ue||D.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[he,He]of D)this.g.setRequestHeader(he,He);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(m),this.v=!1}catch(he){Vn(this,he)}};function Vn(m,A){m.h=!1,m.g&&(m.j=!0,m.g.abort(),m.j=!1),m.l=A,m.o=5,Nn(m),wh(m)}function Nn(m){m.A||(m.A=!0,J(m,"complete"),J(m,"error"))}t.abort=function(m){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=m||7,J(this,"complete"),J(this,"abort"),wh(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),wh(this,!0)),tr.Z.N.call(this)},t.Ca=function(){this.u||(this.B||this.v||this.j?fv(this):this.Xa())},t.Xa=function(){fv(this)};function fv(m){if(m.h&&typeof i<"u"){if(m.v&&ra(m)==4)setTimeout(m.Ca.bind(m),0);else if(J(m,"readystatechange"),ra(m)==4){m.h=!1;try{const he=m.ca();e:switch(he){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var A=!0;break e;default:A=!1}var D;if(!(D=A)){var U;if(U=he===0){let He=String(m.D).match(iv)[1]||null;!He&&o.self&&o.self.location&&(He=o.self.location.protocol.slice(0,-1)),U=!hI.test(He?He.toLowerCase():"")}D=U}if(D)J(m,"complete"),J(m,"success");else{m.o=6;try{var ue=ra(m)>2?m.g.statusText:""}catch{ue=""}m.l=ue+" ["+m.ca()+"]",Nn(m)}}finally{wh(m)}}}}function wh(m,A){if(m.g){m.m&&(clearTimeout(m.m),m.m=null);const D=m.g;m.g=null,A||J(m,"ready");try{D.onreadystatechange=null}catch{}}}t.isActive=function(){return!!this.g};function ra(m){return m.g?m.g.readyState:0}t.ca=function(){try{return ra(this)>2?this.g.status:-1}catch{return-1}},t.la=function(){try{return this.g?this.g.responseText:""}catch{return""}},t.La=function(m){if(this.g){var A=this.g.responseText;return m&&A.indexOf(m)==0&&(A=A.substring(m.length)),oe(A)}};function pv(m){try{if(!m.g)return null;if("response"in m.g)return m.g.response;switch(m.F){case"":case"text":return m.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in m.g)return m.g.mozResponseArrayBuffer}return null}catch{return null}}function pI(m){const A={};m=(m.g&&ra(m)>=2&&m.g.getAllResponseHeaders()||"").split(`\r 89`);for(let U=0;U<m.length;U++){if(V(m[U]))continue;var D=tm(m[U]);
89const ue=D[0];if(D=D[1],typeof D!="string")continue;D=D.trim();const he=A[ue]||[];A[ue]=he,he.push(D)}de(A,function(U){return U.join(", ")})}t.ya=function(){return this.o},t.Ha=function(){return typeof this.l=="string"?this.l:String(this.l)};function Vu(m,A,D){return D&&D.internalChannelParams&&D.internalChannelParams[m]||A}function gm(m){this.za=0,this.i=[],this.j=new We,this.ba=this.na=this.J=this.W=this.g=this.wa=this.G=this.H=this.u=this.U=this.o=null,this.Ya=this.V=0,this.Sa=Vu("failFast",!1,m),this.F=this.C=this.v=this.m=this.l=null,this.X=!0,this.xa=this.K=-1,this.Y=this.A=this.D=0,this.Qa=Vu("baseRetryDelayMs",5e3,m),this.Za=Vu("retryDelaySeedMs",1e4,m),this.Ta=Vu("forwardChannelMaxRetries",2,m),this.va=Vu("forwardChannelRequestTimeoutMs",2e4,m),this.ma=m&&m.xmlHttpFactory||void 0,this.Ua=m&&m.Rb||void 0,this.Aa=m&&m.useFetchStreams||!1,this.O=void 0,this.L=m&&m.supportsCrossDomainXhr||!1,this.M="",this.h=new tv(m&&m.concurrentRequestLimit),this.Ba=new uv,this.S=m&&m.fastHandshake||!1,this.R=m&&m.encodeInitMessageHeaders||!1,this.S&&this.R&&(this.R=!1),this.Ra=m&&m.Pb||!1,m&&m.ua&&this.j.ua(),m&&m.forceLongPolling&&(this.X=!1),this.aa=!this.S&&this.X&&m&&m.detectBufferingProxy||!1,this.ia=void 0,m&&m.longPollingTimeout&&m.longPollingTimeout>0&&(this.ia=m.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}t=gm.prototype,t.ka=8,t.I=1,t.connect=function(m,A,D,U){Er(0),this.W=m,this.H=A||{},D&&U!==void 0&&(this.H.OSID=D,this.H.OAID=U),this.F=this.X,this.J=wm(this,null,this.W),Gi(this)};function _m(m){if(Sh(m),m.I==3){var A=m.V++,D=Ai(m.J);if(Mn(D,"SID",m.M),Mn(D,"RID",A),Mn(D,"TYPE","terminate"),es(m,D),A=new Wi(m,m.j,A),A.M=2,A.A=Ja(Ai(D)),D=!1,o.navigator&&o.navigator.sendBeacon)try{D=o.navigator.sendBeacon(A.A.toString(),"")}catch{}!D&&o.Image&&(new Image().src=A.A,D=!0),D||(A.g=Eo(A.j,null),A.g.ea(A.A)),A.F=Date.now(),_h(A)}_v(m)}function hr(m){m.g&&(Ih(m),m.g.cancel(),m.g=null)}function Sh(m){hr(m),m.v&&(o.clearTimeout(m.v),m.v=null),Fu(m),m.h.cancel(),m.m&&(typeof m.m=="number"&&o.clearTimeout(m.m),m.m=null)}function Gi(m){if(!nv(m.h)&&!m.m){m.m=!0;var A=m.Ea;N||I(),O||(N(),O=!0),S.add(A,m),m.D=0}}function mv(m,A){return im(m.h)>=m.h.j-(m.m?1:0)?!1:m.m?(m.i=A.G.concat(m.i),!0):m.I==1||m.I==2||m.D>=(m.Sa?0:m.Ta)?!1:(m.m=De(l(m.Ea,m,A),gv(m,m.D)),m.D++,!0)}t.Ea=function(m){if(this.m)if(this.m=null,this.I==1){if(!m){this.V=Math.floor(Math.random()*1e5),m=this.V++;const ue=new Wi(this,this.j,m);let he=this.o;if(this.U&&(he?(he=fe(he),Te(he,this.U)):he=this.U),this.u!==null||this.R||(ue.J=he,he=null),this.S)e:{for(var A=0,D=0;D<this.i.length;D++){t:{var U=this.i[D];if("__data__"in U.map&&(U=U.map.__data__,typeof U=="string")){U=U.length;break t}U=void 0}if(U===void 0)break;if(A+=U,A>4096){A=D;break e}if(A===4096||D===this.i.length-1){A=D+1;break e}}A=1e3}else A=1e3;A=ym(this,ue,A),D=Ai(this.J),Mn(D,"RID",m),Mn(D,"CVER",22),this.G&&Mn(D,"X-HTTP-Session-Id",this.G),es(this,D),he&&(this.R?A="headers="+Ka(hv(he))+"&"+A:this.u&&mm(D,this.u,he)),vh(this.h,ue),this.Ra&&Mn(D,"TYPE","init"),this.S?(Mn(D,"$req",A),Mn(D,"SID","null"),ue.U=!0,nm(ue,D,null)):nm(ue,D,A),this.I=2}}else this.I==3&&(m?Th(this,m):this.i.length==0||nv(this.h)||Th(this))};function Th(m,A){var D;A?D=A.l:D=m.V++;const U=Ai(m.J);Mn(U,"SID",m.M),Mn(U,"RID",D),Mn(U,"AID",m.K),es(m,U),m.u&&m.o&&mm(U,m.u,m.o),D=new Wi(m,m.j,D,m.D+1),m.u===null&&(D.J=m.o),A&&(m.i=A.G.concat(m.i)),A=ym(m,D,1e3),D.H=Math.round(m.va*.5)+Math.round(m.va*.5*Math.random()),vh(m.h,D),nm(D,U,A)}function es(m,A){m.H&&Z(m.H,function(D,U){Mn(A,U,D)}),m.l&&Z({},function(D,U){Mn(A,U,D)})}function ym(m,A,D){D=Math.min(m.i.length,D);const U=m.l?l(m.l.Ka,m.l,m):null;e:{var ue=m.i;let kt=-1;for(;;){const fr=["count="+D];kt==-1?D>0?(kt=ue[0].g,fr.push("ofs="+kt)):kt=0:fr.push("ofs="+kt);let Sn=!0;for(let pr=0;pr<D;pr++){var he=ue[pr].g;const ni=ue[pr].map;if(he-=kt,he<0)kt=Math.max(0,ue[pr].g-100),Sn=!1;else try{he="req"+he+"_"||"";try{var He=ni instanceof Map?ni:Object.entries(ni);for(const[sa,ia]of He){let Ki=ia;a(ia)&&(Ki=vt(ia)),fr.push(he+sa+"="+encodeURIComponent(Ki))}}catch(sa){throw fr.push(he+"type="+encodeURIComponent("_badmap")),sa}}catch{U&&U(ni)}}if(Sn){He=fr.join("&");break e}}He=void 0}return m=m.i.splice(0,D),A.G=m,He}function vm(m){if(!m.g&&!m.v){m.Y=1;var A=m.Da;N||I(),O||(N(),O=!0),S.add(A,m),m.A=0}}function Eh(m){return m.g||m.v||m.A>=3?!1:(m.Y++,m.v=De(l(m.Da,m),gv(m,m.A)),m.A++,!0)}
vendor: 6,342 bytes, line 89
89t.Da=function(){if(this.v=null,bm(this),this.aa&&!(this.P||this.g==null||this.T<=0)){var m=4*this.T;this.j.info("BP detection timer enabled: "+m),this.B=De(l(this.Wa,this),m)}},t.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,Er(10),hr(this),bm(this))};function Ih(m){m.B!=null&&(o.clearTimeout(m.B),m.B=null)}function bm(m){m.g=new Wi(m,m.j,"rpc",m.Y),m.u===null&&(m.g.J=m.o),m.g.P=0;var A=Ai(m.na);Mn(A,"RID","rpc"),Mn(A,"SID",m.M),Mn(A,"AID",m.K),Mn(A,"CI",m.F?"0":"1"),!m.F&&m.ia&&Mn(A,"TO",m.ia),Mn(A,"TYPE","xmlhttp"),es(m,A),m.u&&m.o&&mm(A,m.u,m.o),m.O&&(m.g.H=m.O);var D=m.g;m=m.ba,D.M=1,D.A=Ja(Ai(A)),D.u=null,D.R=!0,rm(D,m)}t.Va=function(){this.C!=null&&(this.C=null,hr(this),Eh(this),Er(19))};function Fu(m){m.C!=null&&(o.clearTimeout(m.C),m.C=null)}function bs(m,A){var D=null;if(m.g==A){Fu(m),Ih(m),m.g=null;var U=2}else if(yh(m.h,A))D=A.G,rv(m.h,A),U=1;else return;if(m.I!=0){if(A.o)if(U==1){D=A.u?A.u.length:0,A=Date.now()-A.F;var ue=m.D;U=wo(),J(U,new gh(U,D)),Gi(m)}else vm(m);else if(ue=A.m,ue==3||ue==0&&A.X>0||!(U==1&&mv(m,A)||U==2&&Eh(m)))switch(D&&D.length>0&&(A=m.h,A.i=A.i.concat(D)),ue){case 1:Fr(m,5);break;case 4:Fr(m,10);break;case 3:Fr(m,6);break;default:Fr(m,2)}}}function gv(m,A){let D=m.Qa+Math.floor(Math.random()*m.Za);return m.isActive()||(D*=2),D*A}function Fr(m,A){if(m.j.info("Error code "+A),A==2){var D=l(m.bb,m),U=m.Ua;const ue=!U;U=new To(U||"//www.google.com/images/cleardot.gif"),o.location&&o.location.protocol=="http"||ul(U,"https"),Ja(U),ue?uI(U.toString(),D):dI(U.toString(),D)}else Er(2);m.I=0,m.l&&m.l.pa(A),_v(m),Sh(m)}t.bb=function(m){m?(this.j.info("Successfully pinged google.com"),Er(2)):(this.j.info("Failed to ping google.com"),Er(1))};function _v(m){if(m.I=0,m.ja=[],m.l){const A=sv(m.h);(A.length!=0||m.i.length!=0)&&(_(m.ja,A),_(m.ja,m.i),m.h.i.length=0,g(m.i),m.i.length=0),m.l.oa()}}function wm(m,A,D){var U=D instanceof To?Ai(D):new To(D);if(U.g!="")A&&(U.g=A+"."+U.g),Ya(U,U.u);else{var ue=o.location;U=ue.protocol,A=A?A+"."+ue.hostname:ue.hostname,ue=+ue.port;const he=new To(null);U&&ul(he,U),A&&(he.g=A),ue&&Ya(he,ue),D&&(he.h=D),U=he}return D=m.G,A=m.wa,D&&A&&Mn(U,D,A),Mn(U,"VER",m.ka),es(m,U),U}function Eo(m,A,D){if(A&&!m.L)throw Error("Can't create secondary domain capable XhrIo object.");return A=m.Aa&&!m.ma?new tr(new pm({ab:D})):new tr(m.ma),A.Fa(m.L),A}t.isActive=function(){return!!this.l&&this.l.isActive(this)};function Bu(){}t=Bu.prototype,t.ra=function(){},t.qa=function(){},t.pa=function(){},t.oa=function(){},t.isActive=function(){return!0},t.Ka=function(){};function hl(){}hl.prototype.g=function(m,A){return new Ft(m,A)};function Ft(m,A){q.call(this),this.g=new gm(A),this.l=m,this.h=A&&A.messageUrlParams||null,m=A&&A.messageHeaders||null,A&&A.clientProtocolHeaderRequired&&(m?m["X-Client-Protocol"]="webchannel":m={"X-Client-Protocol":"webchannel"}),this.g.o=m,m=A&&A.initMessageHeaders||null,A&&A.messageContentType&&(m?m["X-WebChannel-Content-Type"]=A.messageContentType:m={"X-WebChannel-Content-Type":A.messageContentType}),A&&A.sa&&(m?m["X-WebChannel-Client-Profile"]=A.sa:m={"X-WebChannel-Client-Profile":A.sa}),this.g.U=m,(m=A&&A.Qb)&&!V(m)&&(this.g.u=m),this.A=A&&A.supportsCrossDomainXhr||!1,this.v=A&&A.sendRawJson||!1,(A=A&&A.httpSessionIdParam)&&!V(A)&&(this.g.G=A,m=this.h,m!==null&&A in m&&(m=this.h,A in m&&delete m[A])),this.j=new fl(this)}h(Ft,q),Ft.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},Ft.prototype.close=function(){_m(this.g)},Ft.prototype.o=function(m){var A=this.g;if(typeof m=="string"){var D={};D.__data__=m,m=D}else this.v&&(D={},D.__data__=vt(m),m=D);A.i.push(new aI(A.Ya++,m)),A.I==3&&Gi(A)},Ft.prototype.N=function(){this.g.l=null,delete this.j,_m(this.g),delete this.g,Ft.Z.N.call(this)};function Io(m){Vr.call(this),m.__headers__&&(this.headers=m.__headers__,this.statusCode=m.__status__,delete m.__headers__,delete m.__status__);var A=m.__sm__;if(A){e:{for(const D in A){m=D;break e}m=void 0}(this.i=m)&&(m=this.i,A=A!==null&&m in A?A[m]:void 0),this.data=A}else this.data=m}h(Io,Vr);function Ch(){jn.call(this),this.status=1}h(Ch,jn);function fl(m){this.g=m}h(fl,Bu),fl.prototype.ra=function(){J(this.g,"a")},fl.prototype.qa=function(m){J(this.g,new Io(m))},fl.prototype.pa=function(m){J(this.g,new Ch)},fl.prototype.oa=function(){J(this.g,"b")},hl.prototype.createWebChannel=hl.prototype.g,Ft.prototype.send=Ft.prototype.o,Ft.prototype.open=Ft.prototype.m,Ft.prototype.close=Ft.prototype.close,Sq=function(){return new hl},wq=function(){return wo()},bq=kn,xA={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},er.NO_ERROR=0,er.TIMEOUT=8,er.HTTP_ERROR=6,Gb=er,ps.COMPLETE="complete",vq=ps,ot.EventType=dt,dt.OPEN="a",dt.CLOSE="b",dt.ERROR="c",dt.MESSAGE="d",q.prototype.listen=q.prototype.J,cg=ot,tr.prototype.listenOnce=tr.prototype.K,tr.prototype.getLastError=tr.prototype.Ha,tr.prototype.getLastErrorCode=tr.prototype.ya,tr.prototype.getStatus=tr.prototype.ca,tr.prototype.getResponseJson=tr.prototype.La,tr.prototype.getResponseText=tr.prototype.la,tr.prototype.send=tr.prototype.ea,tr.prototype.setWithCredentials=tr.prototype.Fa,yq=tr}).apply(typeof pb<"u"?pb:typeof self<"u"?self:typeof window<"u"?window:{});const ZL="@firebase/firestore",eM="4.9.2";class os{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}os.UNAUTHENTICATED=new os(null),os.GOOGLE_CREDENTIALS=new os("google-credentials-uid"),os.FIRST_PARTY=new os("first-party-uid"),os.MOCK_USER=new os("mock-user");let Dp="12.3.0";const Gd=new qT("@firebase/firestore");function rf(){return Gd.logLevel}function Le(t,...e){if(Gd.logLevel<=Gt.DEBUG){const n=e.map(wk);Gd.debug(`Firestore (${Dp}): ${t}`,...n)}}function Dr(t,...e){if(Gd.logLevel<=Gt.ERROR){const n=e.map(wk);Gd.error(`Firestore (${Dp}): ${t}`,...n)}}function Hf(t,...e){if(Gd.logLevel<=Gt.WARN){const n=e.map(wk);Gd.warn(`Firestore (${Dp}): ${t}`,...n)}}function wk(t){if(typeof t=="string")return t;try{return(function(n){return JSON.stringify(n)})(t)}catch{return t}}function Xe(t,e,n){let r="Unexpected state";
89typeof e=="string"?r=e:n=e,Tq(t,r,n)}function Tq(t,e,n){let r=`FIRESTORE (${Dp}) INTERNAL ASSERTION FAILED: ${e} (ID: ${t.toString(16)})`;if(n!==void 0)try{r+=" CONTEXT: "+JSON.stringify(n)}catch{r+=" CONTEXT: "+n}throw Dr(r),new Error(r)}function st(t,e,n,r){let s="Unexpected state";typeof n=="string"?s=n:r=n,t||Tq(e,s,r)}function nt(t,e){return t}const we={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class Be extends Ua{constructor(e,n){super(e,n),this.code=e,this.message=n,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}class mo{constructor(){this.promise=new Promise(((e,n)=>{this.resolve=e,this.reject=n}))}}class Eq{constructor(e,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class gde{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,n){e.enqueueRetryable((()=>n(os.UNAUTHENTICATED)))}shutdown(){}}class _de{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,n){this.changeListener=n,e.enqueueRetryable((()=>n(this.token.user)))}shutdown(){this.changeListener=null}}class yde{constructor(e){this.t=e,this.currentUser=os.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,n){st(this.o===void 0,42304);let r=this.i;const s=c=>this.i!==r?(r=this.i,n(c)):Promise.resolve();let i=new mo;this.o=()=>{this.i++,this.currentUser=this.u(),i.resolve(),i=new mo,e.enqueueRetryable((()=>s(this.currentUser)))};const o=()=>{const c=i;e.enqueueRetryable((async()=>{await c.promise,await s(this.currentUser)}))},a=c=>{Le("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=c,this.o&&(this.auth.addAuthTokenListener(this.o),o())};this.t.onInit((c=>a(c))),setTimeout((()=>{if(!this.auth){const c=this.t.getImmediate({optional:!0});c?a(c):(Le("FirebaseAuthCredentialsProvider","Auth not yet detected"),i.resolve(),i=new mo)}}),0),o()}getToken(){const e=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then((r=>this.i!==e?(Le("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(st(typeof r.accessToken=="string",31837,{l:r}),new Eq(r.accessToken,this.currentUser)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return st(e===null||typeof e=="string",2055,{h:e}),new os(e)}}class vde{constructor(e,n,r){this.P=e,this.T=n,this.I=r,this.type="FirstParty",this.user=os.FIRST_PARTY,this.A=new Map}R(){return this.I?this.I():null}get headers(){this.A.set("X-Goog-AuthUser",this.P);const e=this.R();return e&&this.A.set("Authorization",e),this.T&&this.A.set("X-Goog-Iam-Authorization-Token",this.T),this.A}}class bde{constructor(e,n,r){this.P=e,this.T=n,this.I=r}getToken(){return Promise.resolve(new vde(this.P,this.T,this.I))}start(e,n){e.enqueueRetryable((()=>n(os.FIRST_PARTY)))}shutdown(){}invalidateToken(){}}class tM{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class wde{constructor(e,n){this.V=n,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,ui(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,n){st(this.o===void 0,3512);const r=i=>{i.error!=null&&Le("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${i.error.message}`);const o=i.token!==this.m;return this.m=i.token,Le("FirebaseAppCheckTokenProvider",`Received ${o?"new":"existing"} token.`),o?n(i.token):Promise.resolve()};this.o=i=>{e.enqueueRetryable((()=>r(i)))};const s=i=>{Le("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=i,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit((i=>s(i))),setTimeout((()=>
89{if(!this.appCheck){const i=this.V.getImmediate({optional:!0});i?s(i):Le("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}}),0)}getToken(){if(this.p)return Promise.resolve(new tM(this.p));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then((n=>n?(st(typeof n.token=="string",44558,{tokenResult:n}),this.m=n.token,new tM(n.token)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}function Sde(t){const e=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(n);else for(let r=0;r<t;r++)n[r]=Math.floor(256*Math.random());return n}class Sk{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=62*Math.floor(4.129032258064516);let r="";for(;r.length<20;){const s=Sde(40);for(let i=0;i<s.length;++i)r.length<20&&s[i]<n&&(r+=e.charAt(s[i]%62))}return r}}function Et(t,e){return t<e?-1:t>e?1:0}function LA(t,e){const n=Math.min(t.length,e.length);for(let r=0;r<n;r++){const s=t.charAt(r),i=e.charAt(r);if(s!==i)return $0(s)===$0(i)?Et(s,i):$0(s)?1:-1}return Et(t.length,e.length)}const Tde=55296,Ede=57343;function $0(t){const e=t.charCodeAt(0);return e>=Tde&&e<=Ede}function qf(t,e,n){return t.length===e.length&&t.every(((r,s)=>n(r,e[s])))}function Iq(t){return t+"\0"}const nM="__name__";class _a{constructor(e,n,r){n===void 0?n=0:n>e.length&&Xe(637,{offset:n,range:e.length}),r===void 0?r=e.length-n:r>e.length-n&&Xe(1746,{length:r,range:e.length-n}),this.segments=e,this.offset=n,this.len=r}get length(){return this.len}isEqual(e){return _a.comparator(this,e)===0}child(e){const n=this.segments.slice(this.offset,this.limit());return e instanceof _a?e.forEach((r=>{n.push(r)})):n.push(e),this.construct(n)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length<this.length)return!1;for(let n=0;n<this.length;n++)if(this.get(n)!==e.get(n))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let n=0;n<this.length;n++)if(this.get(n)!==e.get(n))return!1;return!0}forEach(e){for(let n=this.offset,r=this.limit();n<r;n++)e(this.segments[n])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,n){const r=Math.min(e.length,n.length);for(let s=0;s<r;s++){const i=_a.compareSegments(e.get(s),n.get(s));if(i!==0)return i}return Et(e.length,n.length)}static compareSegments(e,n){const r=_a.isNumericId(e),s=_a.isNumericId(n);return r&&!s?-1:!r&&s?1:r&&s?_a.extractNumericId(e).compare(_a.extractNumericId(n)):LA(e,n)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return Yl.fromString(e.substring(4,e.length-2))}}class rn extends _a{construct(e,n,r){return new rn(e,n,r)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const n=[];for(const r of e){if(r.indexOf("//")>=0)throw new Be(we.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);n.push(...r.split("/").filter((s=>s.length>0)))}return new rn(n)}static emptyPath(){return new rn([])}}const Ide=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class cr extends _a{construct(e,n,r){return new cr(e,n,r)}static isValidIdentifier(e){return Ide.test(e)}canonicalString(){return this.toArray().map((e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),cr.isValidIdentifier(e)||(e="`"+e+"`"),e))).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===nM}static keyField(){return new cr([nM])}static fromServerFormat(e){const n=[];let r="",s=0;const i=()=>
89{if(r.length===0)throw new Be(we.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(r),r=""};let o=!1;for(;s<e.length;){const a=e[s];if(a==="\\"){if(s+1===e.length)throw new Be(we.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const c=e[s+1];if(c!=="\\"&&c!=="."&&c!=="`")throw new Be(we.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);r+=c,s+=2}else a==="`"?(o=!o,s++):a!=="."||o?(r+=a,s++):(i(),s++)}if(i(),o)throw new Be(we.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new cr(n)}static emptyPath(){return new cr([])}}class Ge{constructor(e){this.path=e}static fromPath(e){return new Ge(rn.fromString(e))}static fromName(e){return new Ge(rn.fromString(e).popFirst(5))}static empty(){return new Ge(rn.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&rn.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,n){return rn.comparator(e.path,n.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new Ge(new rn(e.slice()))}}function Cq(t,e,n){if(!n)throw new Be(we.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function Cde(t,e,n,r){if(e===!0&&r===!0)throw new Be(we.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function rM(t){if(!Ge.isDocumentKey(t))throw new Be(we.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function sM(t){if(Ge.isDocumentKey(t))throw new Be(we.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function Aq(t){return typeof t=="object"&&t!==null&&(Object.getPrototypeOf(t)===Object.prototype||Object.getPrototypeOf(t)===null)}function WT(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";{const e=(function(r){return r.constructor?r.constructor.name:null})(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":Xe(12329,{type:typeof t})}function ds(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new Be(we.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=WT(t);throw new Be(we.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return t}function jr(t,e){const n={typeString:t};return e&&(n.value=e),n}function oy(t,e){if(!Aq(t))throw new Be(we.INVALID_ARGUMENT,"JSON must be an object");let n;for(const r in e)if(e[r]){const s=e[r].typeString,i="value"in e[r]?{value:e[r].value}:void 0;if(!(r in t)){n=`JSON missing required field: '${r}'`;break}const o=t[r];if(s&&typeof o!==s){n=`JSON field '${r}' must be a ${s}.`;break}if(i!==void 0&&o!==i.value){n=`Expected '${r}' field to equal '${i.value}'`;break}}if(n)throw new Be(we.INVALID_ARGUMENT,n);return!0}const iM=-62135596800,oM=1e6;class an{static now(){return an.fromMillis(Date.now())}static fromDate(e){return an.fromMillis(e.getTime())}static fromMillis(e){const n=Math.floor(e/1e3),r=Math.floor((e-1e3*n)*oM);return new an(n,r)}constructor(e,n){if(this.seconds=e,this.nanoseconds=n,n<0)throw new Be(we.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(n>=1e9)throw new Be(we.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(e<iM)throw new Be(we.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new Be(we.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/oM}_compareTo(e){return this.seconds===e.seconds?Et(this.nanoseconds,e.nanoseconds):Et(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:an._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(oy(e,an._jsonSchema))return new an(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-iM;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}
89}an._jsonSchemaVersion="firestore/timestamp/1.0",an._jsonSchema={type:jr("string",an._jsonSchemaVersion),seconds:jr("number"),nanoseconds:jr("number")};class ct{static fromTimestamp(e){return new ct(e)}static min(){return new ct(new an(0,0))}static max(){return new ct(new an(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}const jf=-1;class eS{constructor(e,n,r,s){this.indexId=e,this.collectionGroup=n,this.fields=r,this.indexState=s}}function MA(t){return t.fields.find((e=>e.kind===2))}function id(t){return t.fields.filter((e=>e.kind!==2))}eS.UNKNOWN_ID=-1;class Kb{constructor(e,n){this.fieldPath=e,this.kind=n}}class c_{constructor(e,n){this.sequenceNumber=e,this.offset=n}static empty(){return new c_(0,Hi.min())}}function Rq(t,e){const n=t.toTimestamp().seconds,r=t.toTimestamp().nanoseconds+1,s=ct.fromTimestamp(r===1e9?new an(n+1,0):new an(n,r));return new Hi(s,Ge.empty(),e)}function Pq(t){return new Hi(t.readTime,t.key,jf)}class Hi{constructor(e,n,r){this.readTime=e,this.documentKey=n,this.largestBatchId=r}static min(){return new Hi(ct.min(),Ge.empty(),jf)}static max(){return new Hi(ct.max(),Ge.empty(),jf)}}function Tk(t,e){let n=t.readTime.compareTo(e.readTime);return n!==0?n:(n=Ge.comparator(t.documentKey,e.documentKey),n!==0?n:Et(t.largestBatchId,e.largestBatchId))}const kq="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class Nq{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach((e=>e()))}}async function Eu(t){if(t.code!==we.FAILED_PRECONDITION||t.message!==kq)throw t;Le("LocalStore","Unexpectedly lost primary lease")}class ae{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e((n=>{this.isDone=!0,this.result=n,this.nextCallback&&this.nextCallback(n)}),(n=>{this.isDone=!0,this.error=n,this.catchCallback&&this.catchCallback(n)}))}catch(e){return this.next(void 0,e)}next(e,n){return this.callbackAttached&&Xe(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new ae(((r,s)=>{this.nextCallback=i=>{this.wrapSuccess(e,i).next(r,s)},this.catchCallback=i=>{this.wrapFailure(n,i).next(r,s)}}))}toPromise(){return new Promise(((e,n)=>{this.next(e,n)}))}wrapUserFunction(e){try{const n=e();return n instanceof ae?n:ae.resolve(n)}catch(n){return ae.reject(n)}}wrapSuccess(e,n){return e?this.wrapUserFunction((()=>e(n))):ae.resolve(n)}wrapFailure(e,n){return e?this.wrapUserFunction((()=>e(n))):ae.reject(n)}static resolve(e){return new ae(((n,r)=>{n(e)}))}static reject(e){return new ae(((n,r)=>{r(e)}))}static waitFor(e){return new ae(((n,r)=>{let s=0,i=0,o=!1;e.forEach((a=>{++s,a.next((()=>{++i,o&&i===s&&n()}),(c=>r(c)))})),o=!0,i===s&&n()}))}static or(e){let n=ae.resolve(!1);for(const r of e)n=n.next((s=>s?ae.resolve(s):r()));return n}static forEach(e,n){const r=[];return e.forEach(((s,i)=>{r.push(n.call(this,s,i))})),this.waitFor(r)}static mapArray(e,n){return new ae(((r,s)=>{const i=e.length,o=new Array(i);let a=0;for(let c=0;c<i;c++){const l=c;n(e[l]).next((d=>{o[l]=d,++a,a===i&&r(o)}),(d=>s(d)))}}))}static doWhile(e,n){return new ae(((r,s)=>{const i=()=>{e()===!0?n().next((()=>{i()}),s):r()};i()}))}}const Oi="SimpleDb";class GT{static open(e,n,r,s){try{return new GT(n,e.transaction(s,r))}catch(i){throw new Ig(n,i)}}constructor(e,n){this.action=e,this.transaction=n,this.aborted=!1,this.S=new mo,this.transaction.oncomplete=()=>{this.S.resolve()},this.transaction.onabort=()=>{n.error?this.S.reject(new Ig(e,n.error)):this.S.resolve()},this.transaction.onerror=r=>{const s=Ek(r.target.error);this.S.reject(new Ig(e,s))}}get D(){return this.S.promise}abort(e){e&&this.S.reject(e),this.aborted||(Le(Oi,"Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}C(){const e=this.transaction;this.aborted||typeof e.commit!="function"||e.commit()}store(e){const n=this.transaction.objectStore(e);return new Rde(n)}}class Jl{static delete(e){return Le(Oi,"Removing database:",e),ud(nq().indexedDB.deleteDatabase(e)).toPromise()}static v(){if(!uq())return!1;if(Jl.F())return!0;
89const e=Xr(),n=Jl.M(e),r=0<n&&n<10,s=Dq(e),i=0<s&&s<4.5;return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||r||i)}static F(){return typeof process<"u"&&process.__PRIVATE_env?.__PRIVATE_USE_MOCK_PERSISTENCE==="YES"}static O(e,n){return e.store(n)}static M(e){const n=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),r=n?n[1].split("_").slice(0,2).join("."):"-1";return Number(r)}constructor(e,n,r){this.name=e,this.version=n,this.N=r,this.B=null,Jl.M(Xr())===12.2&&Dr("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}async L(e){return this.db||(Le(Oi,"Opening database:",this.name),this.db=await new Promise(((n,r)=>{const s=indexedDB.open(this.name,this.version);s.onsuccess=i=>{const o=i.target.result;n(o)},s.onblocked=()=>{r(new Ig(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},s.onerror=i=>{const o=i.target.error;o.name==="VersionError"?r(new Be(we.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):o.name==="InvalidStateError"?r(new Be(we.FAILED_PRECONDITION,"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: "+o)):r(new Ig(e,o))},s.onupgradeneeded=i=>{Le(Oi,'Database "'+this.name+'" requires upgrade from version:',i.oldVersion);const o=i.target.result;this.N.k(o,s.transaction,i.oldVersion,this.version).next((()=>{Le(Oi,"Database upgrade to version "+this.version+" complete")}))}}))),this.q&&(this.db.onversionchange=n=>this.q(n)),this.db}$(e){this.q=e,this.db&&(this.db.onversionchange=n=>e(n))}async runTransaction(e,n,r,s){const i=n==="readonly";let o=0;for(;;){++o;try{this.db=await this.L(e);const a=GT.open(this.db,e,i?"readonly":"readwrite",r),c=s(a).next((l=>(a.C(),l))).catch((l=>(a.abort(l),ae.reject(l)))).toPromise();return c.catch((()=>{})),await a.D,c}catch(a){const c=a,l=c.name!=="FirebaseError"&&o<3;if(Le(Oi,"Transaction failed with error:",c.message,"Retrying:",l),this.close(),!l)return Promise.reject(c)}}}close(){this.db&&this.db.close(),this.db=void 0}}function Dq(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}class Ade{constructor(e){this.U=e,this.K=!1,this.W=null}get isDone(){return this.K}get G(){return this.W}set cursor(e){this.U=e}done(){this.K=!0}j(e){this.W=e}delete(){return ud(this.U.delete())}}class Ig extends Be{constructor(e,n){super(we.UNAVAILABLE,`IndexedDB transaction '${e}' failed: ${n}`),this.name="IndexedDbTransactionError"}}function Iu(t){return t.name==="IndexedDbTransactionError"}class Rde{constructor(e){this.store=e}put(e,n){let r;return n!==void 0?(Le(Oi,"PUT",this.store.name,e,n),r=this.store.put(n,e)):(Le(Oi,"PUT",this.store.name,"<auto-key>",e),r=this.store.put(e)),ud(r)}add(e){return Le(Oi,"ADD",this.store.name,e,e),ud(this.store.add(e))}get(e){return ud(this.store.get(e)).next((n=>(n===void 0&&(n=null),Le(Oi,"GET",this.store.name,e,n),n)))}delete(e){return Le(Oi,"DELETE",this.store.name,e),ud(this.store.delete(e))}count(){return Le(Oi,"COUNT",this.store.name),ud(this.store.count())}J(e,n){const r=this.options(e,n),s=r.index?this.store.index(r.index):this.store;if(typeof s.getAll=="function"){const i=s.getAll(r.range);return new ae(((o,a)=>{i.onerror=c=>{a(c.target.error)},i.onsuccess=c=>{o(c.target.result)}}))}{const i=this.cursor(r),o=[];return this.H(i,((a,c)=>{o.push(c)})).next((()=>o))}}Y(e,n){const r=this.store.getAll(e,n===null?void 0:n);return new ae(((s,i)=>{r.onerror=o=>{i(o.target.error)},r.onsuccess=o=>{s(o.target.result)}}))}Z(e,n){Le(Oi,"DELETE ALL",this.store.name);const r=this.options(e,n);r.X=!1;const s=this.cursor(r);return this.H(s,((i,o,a)=>a.delete()))}ee(e,n){let r;n?r=e:(r={},n=e);const s=this.cursor(r);return this.H(s,n)}te(e){const n=this.cursor({});return new ae(((r,s)=>{n.onerror=i=>{const o=Ek(i.target.error);s(o)},n.onsuccess=i=>{const o=i.target.result;o?e(o.primaryKey,o.value).next((a=>{a?o.continue():r()}
89)):r()}}))}H(e,n){const r=[];return new ae(((s,i)=>{e.onerror=o=>{i(o.target.error)},e.onsuccess=o=>{const a=o.target.result;if(!a)return void s();const c=new Ade(a),l=n(a.primaryKey,a.value,c);if(l instanceof ae){const d=l.catch((h=>(c.done(),ae.reject(h))));r.push(d)}c.isDone?s():c.G===null?a.continue():a.continue(c.G)}})).next((()=>ae.waitFor(r)))}options(e,n){let r;return e!==void 0&&(typeof e=="string"?r=e:n=e),{index:r,range:n}}cursor(e){let n="next";if(e.reverse&&(n="prev"),e.index){const r=this.store.index(e.index);return e.X?r.openKeyCursor(e.range,n):r.openCursor(e.range,n)}return this.store.openCursor(e.range,n)}}function ud(t){return new ae(((e,n)=>{t.onsuccess=r=>{const s=r.target.result;e(s)},t.onerror=r=>{const s=Ek(r.target.error);n(s)}}))}let aM=!1;function Ek(t){const e=Jl.M(Xr());if(e>=12.2&&e<13){const n="An internal error was encountered in the Indexed Database server";if(t.message.indexOf(n)>=0){const r=new Be("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${n}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return aM||(aM=!0,setTimeout((()=>{throw r}),0)),r}}return t}const Cg="IndexBackfiller";class Pde{constructor(e,n){this.asyncQueue=e,this.ne=n,this.task=null}start(){this.re(15e3)}stop(){this.task&&(this.task.cancel(),this.task=null)}get started(){return this.task!==null}re(e){Le(Cg,`Scheduled in ${e}ms`),this.task=this.asyncQueue.enqueueAfterDelay("index_backfill",e,(async()=>{this.task=null;try{const n=await this.ne.ie();Le(Cg,`Documents written: ${n}`)}catch(n){Iu(n)?Le(Cg,"Ignoring IndexedDB error during index backfill: ",n):await Eu(n)}await this.re(6e4)}))}}class kde{constructor(e,n){this.localStore=e,this.persistence=n}async ie(e=50){return this.persistence.runTransaction("Backfill Indexes","readwrite-primary",(n=>this.se(n,e)))}se(e,n){const r=new Set;let s=n,i=!0;return ae.doWhile((()=>i===!0&&s>0),(()=>this.localStore.indexManager.getNextCollectionGroupToUpdate(e).next((o=>{if(o!==null&&!r.has(o))return Le(Cg,`Processing collection: ${o}`),this.oe(e,o,s).next((a=>{s-=a,r.add(o)}));i=!1})))).next((()=>n-s))}oe(e,n,r){return this.localStore.indexManager.getMinOffsetFromCollectionGroup(e,n).next((s=>this.localStore.localDocuments.getNextDocuments(e,n,s,r).next((i=>{const o=i.changes;return this.localStore.indexManager.updateIndexEntries(e,o).next((()=>this._e(s,i))).next((a=>(Le(Cg,`Updating offset: ${a}`),this.localStore.indexManager.updateCollectionGroup(e,n,a)))).next((()=>o.size))}))))}_e(e,n){let r=e;
89return n.changes.forEach(((s,i)=>{const o=Pq(i);Tk(o,r)>0&&(r=o)})),new Hi(r.readTime,r.documentKey,Math.max(n.batchId,e.largestBatchId))}}class hi{constructor(e,n){this.previousValue=e,n&&(n.sequenceNumberHandler=r=>this.ae(r),this.ue=r=>n.writeSequenceNumber(r))}ae(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ue&&this.ue(e),e}}hi.ce=-1;const Od=-1;function ay(t){return t==null}function l_(t){return t===0&&1/t==-1/0}function Oq(t){return typeof t=="number"&&Number.isInteger(t)&&!l_(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}const tS="�";function Ds(t){let e="";for(let n=0;n<t.length;n++)e.length>0&&(e=cM(e)),e=Nde(t.get(n),e);return cM(e)}function Nde(t,e){let n=e;const r=t.length;for(let s=0;s<r;s++){const i=t.charAt(s);switch(i){case"\0":n+="��";break;case tS:n+="��";break;default:n+=i}}return n}function cM(t){return t+tS+"�"}function ba(t){const e=t.length;if(st(e>=2,64408,{path:t}),e===2)return st(t.charAt(0)===tS&&t.charAt(1)==="�",56145,{path:t}),rn.emptyPath();const n=e-2,r=[];let s="";for(let i=0;i<e;){const o=t.indexOf(tS,i);switch((o<0||o>n)&&Xe(50515,{path:t}),t.charAt(o+1)){case"�":const a=t.substring(i,o);let c;s.length===0?c=a:(s+=a,c=s,s=""),r.push(c);break;case"�":s+=t.substring(i,o),s+="\0";break;case"�":s+=t.substring(i,o+1);break;default:Xe(61167,{path:t})}i=o+2}return new rn(r)}const od="remoteDocuments",cy="owner",Hh="owner",u_="mutationQueues",Dde="userId",No="mutations",lM="batchId",_d="userMutationsIndex",uM=["userId","batchId"];function zb(t,e){return[t,Ds(e)]}function xq(t,e,n){return[t,Ds(e),n]}const Ode={},Wf="documentMutations",nS="remoteDocumentsV14",xde=["prefixPath","collectionGroup","readTime","documentId"],Yb="documentKeyIndex",Lde=["prefixPath","collectionGroup","documentId"],Lq="collectionGroupIndex",Mde=["collectionGroup","readTime","prefixPath","documentId"],d_="remoteDocumentGlobal",VA="remoteDocumentGlobalKey",Gf="targets",Mq="queryTargetsIndex",Vde=["canonicalId","targetId"],Kf="targetDocuments",Fde=["targetId","path"],Ik="documentTargetsIndex",Bde=["path","targetId"],rS="targetGlobalKey",xd="targetGlobal",h_="collectionParents",$de=["collectionId","parent"],zf="clientMetadata",Ude="clientId",KT="bundles",Hde="bundleId",zT="namedQueries",qde="name",Ck="indexConfiguration",jde="indexId",FA="collectionGroupIndex",Wde="collectionGroup",Ag="indexState",Gde=["indexId","uid"],Vq="sequenceNumberIndex",Kde=["uid","sequenceNumber"],Rg="indexEntries",zde=["indexId","uid","arrayValue","directionalValue","orderedDocumentKey","documentKey"],Fq="documentKeyIndex",Yde=["indexId","uid","orderedDocumentKey"],YT="documentOverlays",Jde=["userId","collectionPath","documentId"],BA="collectionPathOverlayIndex",Qde=["userId","collectionPath","largestBatchId"],Bq="collectionGroupOverlayIndex",Xde=["userId","collectionGroup","largestBatchId"],Ak="globals",Zde="name",$q=[u_,No,Wf,od,Gf,cy,xd,Kf,zf,d_,h_,KT,zT],ehe=[...$q,YT],Uq=[u_,No,Wf,nS,Gf,cy,xd,Kf,zf,d_,h_,KT,zT,YT],Hq=Uq,Rk=[...Hq,Ck,Ag,Rg],the=Rk,qq=[...Rk,Ak],nhe=qq;class $A extends Nq{constructor(e,n){super(),this.le=e,this.currentSequenceNumber=n}}function Zr(t,e){const n=nt(t);return Jl.O(n.le,e)}function dM(t){let e=0;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e++;return e}function Cu(t,e){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&e(n,t[n])}function jq(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}let ur=class UA{constructor(e,n){this.comparator=e,this.root=n||Ql.EMPTY}insert(e,n){return new UA(this.comparator,this.root.insert(e,n,this.comparator).copy(null,null,Ql.BLACK,null,null))}remove(e){return new UA(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Ql.BLACK,null,null))}get(e){let n=this.root;for(;!n.isEmpty();){const r=this.comparator(e,n.key);if(r===0)return n.value;r<0?n=n.left:r>0&&(n=n.right)}return null}indexOf(e){let n=0,r=this.root;for(;!r.isEmpty();){const s=this.comparator(e,r.key);if(s===0)return n+r.left.size;s<0?r=r.left:(n+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal(((n,r)=>(e(n,r),!1)))}toString(){const e=[];return this.inorderTraversal(((n,r)=>(e.push(`${n}:${r}`),!1))),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new mb(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new mb(this.root,e,this.comparator,!1)}getReverseIterator(){return new mb(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new mb(this.root,e,this.comparator,!0)}},mb=class{constructor(e,n,r,s){this.isReverse=s,this.nodeStack=[];let i=1;for(;!e.isEmpty();)if(i=n?r(e.key,n):1,n&&s&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(i===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const n={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return n}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}},Ql=class hc{constructor(e,n,r,s,i){this.key=e,this.value=n,this.color=r??hc.RED,this.left=s??hc.EMPTY,this.right=i??hc.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,n,r,s,i){return new hc(e??this.key,n??this.value,r??this.color,s??this.left,i??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,n,r){let s=this;const i=r(e,s.key);return s=i<0?s.copy(null,null,null,s.left.insert(e,n,r),null):i===0?s.copy(null,n,null,null,null):s.copy(null,null,null,null,s.right.insert(e,n,r)),s.fixUp()}removeMin(){if(this.left.isEmpty())return hc.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,n){let r,s=this;if(n(e,s.key)<0)s.left.isEmpty()||s.left.isRed()||s.left.left.isRed()||(s=s.moveRedLeft()),s=s.copy(null,null,null,s.left.remove(e,n),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),n(e,s.key)===0){if(s.right.isEmpty())return hc.EMPTY;r=s.right.min(),s=s.copy(r.key,r.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(e,n))}return s.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,hc.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,hc.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw Xe(43730,{key:this.key,value:this.value});if(this.right.isRed())throw Xe(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw Xe(27949);return e+(this.isRed()?0:1)}};Ql.EMPTY=null,Ql.RED=!0,Ql.BLACK=!1;
89Ql.EMPTY=new class{constructor(){this.size=0}get key(){throw Xe(57766)}get value(){throw Xe(16141)}get color(){throw Xe(16727)}get left(){throw Xe(29726)}get right(){throw Xe(36894)}copy(e,n,r,s,i){return this}insert(e,n,r){return new Ql(e,n)}remove(e,n){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};class Ln{constructor(e){this.comparator=e,this.data=new ur(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal(((n,r)=>(e(n),!1)))}forEachInRange(e,n){const r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){const s=r.getNext();if(this.comparator(s.key,e[1])>=0)return;n(s.key)}}forEachWhile(e,n){let r;for(r=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){const n=this.data.getIteratorFrom(e);return n.hasNext()?n.getNext().key:null}getIterator(){return new hM(this.data.getIterator())}getIteratorFrom(e){return new hM(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let n=this;return n.size<e.size&&(n=e,e=this),e.forEach((r=>{n=n.add(r)})),n}isEqual(e){if(!(e instanceof Ln)||this.size!==e.size)return!1;const n=this.data.getIterator(),r=e.data.getIterator();for(;n.hasNext();){const s=n.getNext().key,i=r.getNext().key;if(this.comparator(s,i)!==0)return!1}return!0}toArray(){const e=[];return this.forEach((n=>{e.push(n)})),e}toString(){const e=[];return this.forEach((n=>e.push(n))),"SortedSet("+e.toString()+")"}copy(e){const n=new Ln(this.comparator);return n.data=e,n}}class hM{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}function qh(t){return t.hasNext()?t.getNext():void 0}class fi{constructor(e){this.fields=e,e.sort(cr.comparator)}static empty(){return new fi([])}unionWith(e){let n=new Ln(cr.comparator);for(const r of this.fields)n=n.add(r);for(const r of e)n=n.add(r);return new fi(n.toArray())}covers(e){for(const n of this.fields)if(n.isPrefixOf(e))return!0;return!1}isEqual(e){return qf(this.fields,e.fields,((n,r)=>n.isEqual(r)))}}class Wq extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}class Lr{constructor(e){this.binaryString=e}static fromBase64String(e){const n=(function(s){try{return atob(s)}catch(i){throw typeof DOMException<"u"&&i instanceof DOMException?new Wq("Invalid base64 string: "+i):i}})(e);return new Lr(n)}static fromUint8Array(e){const n=(function(s){let i="";for(let o=0;o<s.length;++o)i+=String.fromCharCode(s[o]);return i})(e);return new Lr(n)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return(function(n){return btoa(n)})(this.binaryString)}toUint8Array(){return(function(n){const r=new Uint8Array(n.length);for(let s=0;s<n.length;s++)r[s]=n.charCodeAt(s);return r})(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return Et(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}Lr.EMPTY_BYTE_STRING=new Lr("");const rhe=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function zc(t){if(st(!!t,39018),typeof t=="string"){let e=0;const n=rhe.exec(t);if(st(!!n,46558,{timestamp:t}),n[1]){let s=n[1];s=(s+"000000000").substr(0,9),e=Number(s)}const r=new Date(t);return{seconds:Math.floor(r.getTime()/1e3),nanos:e}}return{seconds:nr(t.seconds),nanos:nr(t.nanos)}}function nr(t){return typeof t=="number"?t:typeof t=="string"?Number(t):0}function Yc(t){return typeof t=="string"?Lr.fromBase64String(t):Lr.fromUint8Array(t)}const Gq="server_timestamp",Kq="__type__",zq="__previous_value__",Yq="__local_write_time__";function Pk(t){return(t?.mapValue?.fields||{})[Kq]?.stringValue===Gq}function JT(t){const e=t.mapValue.fields[zq];return Pk(e)?JT(e):e}function f_(t){const e=zc(t.mapValue.fields[Yq].timestampValue);return new an(e.seconds,e.nanos)}class she{constructor(e,n,r,s,i,o,a,c,l,d){this.databaseId=e,this.appId=n,this.persistenceKey=r,this.host=s,this.ssl=i,this.forceLongPolling=o,this.autoDetectLongPolling=a,this.longPollingOptions=c,this.useFetchStreams=l,this.isUsingEmulator=d}}const p_="(default)";class Kd{constructor(e,n){this.projectId=e,this.database=n||p_}static empty(){return new Kd("","")}get isDefaultDatabase(){return this.database===p_}isEqual(e){return e instanceof Kd&&e.projectId===this.projectId&&e.database===this.database}}const kk="__type__",Jq="__max__",Hl={mapValue:{fields:{__type__:{stringValue:Jq}}}},Nk="__vector__",Yf="value",Jb={nullValue:"NULL_VALUE"};function du(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?Pk(t)?4:Qq(t)?9007199254740991:QT(t)?10:11:Xe(28295,{value:t})}function Da(t,e){if(t===e)return!0;const n=du(t);if(n!==du(e))return!1;switch(n){case 0:case 9007199254740991:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return f_(t).isEqual(f_(e));
89case 3:return(function(s,i){if(typeof s.timestampValue=="string"&&typeof i.timestampValue=="string"&&s.timestampValue.length===i.timestampValue.length)return s.timestampValue===i.timestampValue;const o=zc(s.timestampValue),a=zc(i.timestampValue);return o.seconds===a.seconds&&o.nanos===a.nanos})(t,e);case 5:return t.stringValue===e.stringValue;case 6:return(function(s,i){return Yc(s.bytesValue).isEqual(Yc(i.bytesValue))})(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return(function(s,i){return nr(s.geoPointValue.latitude)===nr(i.geoPointValue.latitude)&&nr(s.geoPointValue.longitude)===nr(i.geoPointValue.longitude)})(t,e);case 2:return(function(s,i){if("integerValue"in s&&"integerValue"in i)return nr(s.integerValue)===nr(i.integerValue);if("doubleValue"in s&&"doubleValue"in i){const o=nr(s.doubleValue),a=nr(i.doubleValue);return o===a?l_(o)===l_(a):isNaN(o)&&isNaN(a)}return!1})(t,e);case 9:return qf(t.arrayValue.values||[],e.arrayValue.values||[],Da);case 10:case 11:return(function(s,i){const o=s.mapValue.fields||{},a=i.mapValue.fields||{};if(dM(o)!==dM(a))return!1;for(const c in o)if(o.hasOwnProperty(c)&&(a[c]===void 0||!Da(o[c],a[c])))return!1;return!0})(t,e);default:return Xe(52216,{left:t})}}function m_(t,e){return(t.values||[]).find((n=>Da(n,e)))!==void 0}function hu(t,e){if(t===e)return 0;const n=du(t),r=du(e);if(n!==r)return Et(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return Et(t.booleanValue,e.booleanValue);case 2:return(function(i,o){const a=nr(i.integerValue||i.doubleValue),c=nr(o.integerValue||o.doubleValue);return a<c?-1:a>c?1:a===c?0:isNaN(a)?isNaN(c)?0:-1:1})(t,e);case 3:return fM(t.timestampValue,e.timestampValue);case 4:return fM(f_(t),f_(e));case 5:return LA(t.stringValue,e.stringValue);case 6:return(function(i,o){const a=Yc(i),c=Yc(o);return a.compareTo(c)})(t.bytesValue,e.bytesValue);case 7:return(function(i,o){const a=i.split("/"),c=o.split("/");for(let l=0;l<a.length&&l<c.length;l++){const d=Et(a[l],c[l]);if(d!==0)return d}return Et(a.length,c.length)})(t.referenceValue,e.referenceValue);case 8:return(function(i,o){const a=Et(nr(i.latitude),nr(o.latitude));return a!==0?a:Et(nr(i.longitude),nr(o.longitude))})(t.geoPointValue,e.geoPointValue);case 9:return pM(t.arrayValue,e.arrayValue);case 10:return(function(i,o){const a=i.fields||{},c=o.fields||{},l=a[Yf]?.arrayValue,d=c[Yf]?.arrayValue,h=Et(l?.values?.length||0,d?.values?.length||0);return h!==0?h:pM(l,d)})(t.mapValue,e.mapValue);case 11:return(function(i,o){if(i===Hl.mapValue&&o===Hl.mapValue)return 0;if(i===Hl.mapValue)return 1;if(o===Hl.mapValue)return-1;const a=i.fields||{},c=Object.keys(a),l=o.fields||{},d=Object.keys(l);c.sort(),d.sort();for(let h=0;h<c.length&&h<d.length;++h){const p=LA(c[h],d[h]);if(p!==0)return p;const g=hu(a[c[h]],l[d[h]]);if(g!==0)return g}return Et(c.length,d.length)})(t.mapValue,e.mapValue);default:throw Xe(23264,{he:n})}}function fM(t,e){if(typeof t=="string"&&typeof e=="string"&&t.length===e.length)return Et(t,e);const n=zc(t),r=zc(e),s=Et(n.seconds,r.seconds);return s!==0?s:Et(n.nanos,r.nanos)}function pM(t,e){const n=t.values||[],r=e.values||[];for(let s=0;s<n.length&&s<r.length;++s){const i=hu(n[s],r[s]);if(i)return i}return Et(n.length,r.length)}function Jf(t){return HA(t)}function HA(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?(function(n){const r=zc(n);return`time(${r.seconds},${r.nanos})`})(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?(function(n){return Yc(n).toBase64()})(t.bytesValue):"referenceValue"in t?(function(n){return Ge.fromName(n).toString()})(t.referenceValue):"geoPointValue"in t?(function(n){return`geo(${n.latitude},${n.longitude})`})(t.geoPointValue):"arrayValue"in t?(function(n){let r="[",s=!0;for(const i of n.values||[])s?s=!1:r+=",",r+=HA(i);return r+"]"})(t.arrayValue):"mapValue"in t?(function(n){const r=Object.keys(n.fields||{}).sort();let s="{",i=!0;for(const o of r)i?i=!1:s+=",",s+=`${o}:${HA(n.fields[o])}`;return s+"}"})(t.mapValue):Xe(61005,{value:t})}function Qb(t){switch(du(t)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const e=JT(t);return e?16+Qb(e):16;case 5:return 2*t.stringValue.length;case 6:return Yc(t.bytesValue).approximateByteSize();case 7:return t.referenceValue.length;case 9:return(function(r){return(r.values||[]).reduce(((s,i)=>s+Qb(i)),0)})(t.arrayValue);case 10:case 11:return(function(r){let s=0;return Cu(r.fields,((i,o)=>{s+=i.length+Qb(o)})),s})(t.mapValue);default:throw Xe(13486,{value:t})}}function g_(t,e){return{referenceValue:`projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`}}function qA(t){return!!t&&"integerValue"in t}function __(t){return!!t&&"arrayValue"in t}function mM(t){return!!t&&"nullValue"in t}function gM(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function Xb(t){return!!t&&"mapValue"in t}function QT(t){return(t?.mapValue?.fields||{})[kk]?.stringValue===Nk}function Pg(t){if(t.geoPointValue)return{geoPointValue:{...t.geoPointValue}};if(t.timestampValue&&typeof t.timestampValue=="object")return{timestampValue:{...t.timestampValue}};if(t.mapValue){const e={mapValue:{fields:{}}};return Cu(t.mapValue.fields,((n,r)=>e.mapValue.fields[n]=Pg(r))),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=Pg(t.arrayValue.values[n]);return e}return{...t}}function Qq(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue===Jq}const Xq={mapValue:{fields:{[kk]:{stringValue:Nk},[Yf]:{arrayValue:{}}}}};function ihe(t){return"nullValue"in t?Jb:"booleanValue"in t?{booleanValue:!1}:"integerValue"in t||"doubleValue"in t?{doubleValue:NaN}:"timestampValue"in t?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"stringValue"in t?{stringValue:""}
vendor: 2,206 bytes, line 89
89:"bytesValue"in t?{bytesValue:""}:"referenceValue"in t?g_(Kd.empty(),Ge.empty()):"geoPointValue"in t?{geoPointValue:{latitude:-90,longitude:-180}}:"arrayValue"in t?{arrayValue:{}}:"mapValue"in t?QT(t)?Xq:{mapValue:{}}:Xe(35942,{value:t})}function ohe(t){return"nullValue"in t?{booleanValue:!1}:"booleanValue"in t?{doubleValue:NaN}:"integerValue"in t||"doubleValue"in t?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"timestampValue"in t?{stringValue:""}:"stringValue"in t?{bytesValue:""}:"bytesValue"in t?g_(Kd.empty(),Ge.empty()):"referenceValue"in t?{geoPointValue:{latitude:-90,longitude:-180}}:"geoPointValue"in t?{arrayValue:{}}:"arrayValue"in t?Xq:"mapValue"in t?QT(t)?{mapValue:{}}:Hl:Xe(61959,{value:t})}function _M(t,e){const n=hu(t.value,e.value);return n!==0?n:t.inclusive&&!e.inclusive?-1:!t.inclusive&&e.inclusive?1:0}function yM(t,e){const n=hu(t.value,e.value);return n!==0?n:t.inclusive&&!e.inclusive?1:!t.inclusive&&e.inclusive?-1:0}class _s{constructor(e){this.value=e}static empty(){return new _s({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let n=this.value;for(let r=0;r<e.length-1;++r)if(n=(n.mapValue.fields||{})[e.get(r)],!Xb(n))return null;return n=(n.mapValue.fields||{})[e.lastSegment()],n||null}}set(e,n){this.getFieldsMap(e.popLast())[e.lastSegment()]=Pg(n)}setAll(e){let n=cr.emptyPath(),r={},s=[];e.forEach(((o,a)=>{if(!n.isImmediateParentOf(a)){const c=this.getFieldsMap(n);this.applyChanges(c,r,s),r={},s=[],n=a.popLast()}o?r[a.lastSegment()]=Pg(o):s.push(a.lastSegment())}));const i=this.getFieldsMap(n);this.applyChanges(i,r,s)}delete(e){const n=this.field(e.popLast());Xb(n)&&n.mapValue.fields&&delete n.mapValue.fields[e.lastSegment()]}isEqual(e){return Da(this.value,e.value)}getFieldsMap(e){let n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(let r=0;r<e.length;++r){let s=n.mapValue.fields[e.get(r)];Xb(s)&&s.mapValue.fields||(s={mapValue:{fields:{}}},n.mapValue.fields[e.get(r)]=s),n=s}return n.mapValue.fields}applyChanges(e,n,r){Cu(n,((s,i)=>e[s]=i));for(const s of r)delete e[s]}clone(){return new _s(Pg(this.value))}}function Zq(t){const e=[];return Cu(t.fields,((n,r)=>{const s=new cr([n]);if(Xb(r)){const i=Zq(r.mapValue).fields;
89if(i.length===0)e.push(s);else for(const o of i)e.push(s.child(o))}else e.push(s)})),new fi(e)}class sr{constructor(e,n,r,s,i,o,a){this.key=e,this.documentType=n,this.version=r,this.readTime=s,this.createTime=i,this.data=o,this.documentState=a}static newInvalidDocument(e){return new sr(e,0,ct.min(),ct.min(),ct.min(),_s.empty(),0)}static newFoundDocument(e,n,r,s){return new sr(e,1,n,ct.min(),r,s,0)}static newNoDocument(e,n){return new sr(e,2,n,ct.min(),ct.min(),_s.empty(),0)}static newUnknownDocument(e,n){return new sr(e,3,n,ct.min(),ct.min(),_s.empty(),2)}convertToFoundDocument(e,n){return!this.createTime.isEqual(ct.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=n,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=_s.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=_s.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=ct.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof sr&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new sr(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}class Qf{constructor(e,n){this.position=e,this.inclusive=n}}function vM(t,e,n){let r=0;for(let s=0;s<t.position.length;s++){const i=e[s],o=t.position[s];if(i.field.isKeyField()?r=Ge.comparator(Ge.fromName(o.referenceValue),n.key):r=hu(o,n.data.field(i.field)),i.dir==="desc"&&(r*=-1),r!==0)break}return r}function bM(t,e){if(t===null)return e===null;if(e===null||t.inclusive!==e.inclusive||t.position.length!==e.position.length)return!1;for(let n=0;n<t.position.length;n++)if(!Da(t.position[n],e.position[n]))return!1;return!0}class sS{constructor(e,n="asc"){this.field=e,this.dir=n}}function ahe(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}class ej{}class Qt extends ej{constructor(e,n,r){super(),this.field=e,this.op=n,this.value=r}static create(e,n,r){return e.isKeyField()?n==="in"||n==="not-in"?this.createKeyFieldInFilter(e,n,r):new che(e,n,r):n==="array-contains"?new dhe(e,r):n==="in"?new oj(e,r):n==="not-in"?new hhe(e,r):n==="array-contains-any"?new fhe(e,r):new Qt(e,n,r)}static createKeyFieldInFilter(e,n,r){return n==="in"?new lhe(e,r):new uhe(e,r)}matches(e){const n=e.data.field(this.field);return this.op==="!="?n!==null&&n.nullValue===void 0&&this.matchesComparison(hu(n,this.value)):n!==null&&du(this.value)===du(n)&&this.matchesComparison(hu(n,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return Xe(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class xn extends ej{constructor(e,n){super(),this.filters=e,this.op=n,this.Pe=null}static create(e,n){return new xn(e,n)}matches(e){return Xf(this)?this.filters.find((n=>!n.matches(e)))===void 0:this.filters.find((n=>n.matches(e)))!==void 0}getFlattenedFilters(){return this.Pe!==null||(this.Pe=this.filters.reduce(((e,n)=>e.concat(n.getFlattenedFilters())),[])),this.Pe}getFilters(){return Object.assign([],this.filters)}}function Xf(t){return t.op==="and"}function jA(t){return t.op==="or"}function Dk(t){return tj(t)&&Xf(t)}function tj(t){for(const e of t.filters)if(e instanceof xn)return!1;return!0}function WA(t){if(t instanceof Qt)return t.field.canonicalString()+t.op.toString()+Jf(t.value);if(Dk(t))return t.filters.map((e=>WA(e))).join(",");{const e=t.filters.map((n=>WA(n))).join(",");return`${t.op}(${e})`}}function nj(t,e){return t instanceof Qt?(function(r,s){return s instanceof Qt&&r.op===s.op&&r.field.isEqual(s.field)&&Da(r.value,s.value)})(t,e):t instanceof xn?(function(r,s){return s instanceof xn&&r.op===s.op&&r.filters.length===s.filters.length?r.filters.reduce(((i,o,a)=>i&&nj(o,s.filters[a])),!0):!1})(t,e):void Xe(19439)}function rj(t,e){const n=t.filters.concat(e);return xn.create(n,t.op)}function sj(t){return t instanceof Qt?(function(n){return`${n.field.canonicalString()} ${n.op} ${Jf(n.value)}`})(t):t instanceof xn?(function(n){return n.op.toString()+" {"+n.getFilters().map(sj).join(" ,")+"}"})(t):"Filter"}class che extends Qt{constructor(e,n,r){super(e,n,r),this.key=Ge.fromName(r.referenceValue)}matches(e){const n=Ge.comparator(e.key,this.key);return this.matchesComparison(n)}}class lhe extends Qt{constructor(e,n){super(e,"in",n),this.keys=ij("in",n)}matches(e){return this.keys.some((n=>n.isEqual(e.key)))}}class uhe extends Qt{constructor(e,n){super(e,"not-in",n),this.keys=ij("not-in",n)}matches(e){return!this.keys.some((n=>n.isEqual(e.key)))}}function ij(t,e){return(e.arrayValue?.values||[]).map((n=>Ge.fromName(n.referenceValue)))}class dhe extends Qt{constructor(e,n){super(e,"array-contains",n)}matches(e){const n=e.data.field(this.field);return __(n)&&m_(n.arrayValue,this.value)}}class oj extends Qt{constructor(e,n){super(e,"in",n)}matches(e){const n=e.data.field(this.field);return n!==null&&m_(this.value.arrayValue,n)}}class hhe extends Qt{constructor(e,n){super(e,"not-in",n)}matches(e){if(m_(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const n=e.data.field(this.field);return n!==null&&n.nullValue===void 0&&!m_(this.value.arrayValue,n)}}class fhe extends Qt{constructor(e,n){super(e,"array-contains-any",n)}matches(e){const n=e.data.field(this.field);return!(!__(n)||!n.arrayValue.values)&&n.arrayValue.values.some((r=>m_(this.value.arrayValue,r)))}}class phe{constructor(e,n=null,r=[],s=[],i=null,o=null,a=null){this.path=e,this.collectionGroup=n,this.orderBy=r,this.filters=s,this.limit=i,this.startAt=o,this.endAt=a,this.Te=null}}function GA(t,e=null,n=[],r=[],s=null,i=null,o=null){return new phe(t,e,n,r,s,i,o)}function zd(t){const e=nt(t);if(e.Te===null){let n=e.path.canonicalString();e.collectionGroup!==null&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map((r=>WA(r))).join(","),n+="|ob:",n+=e.orderBy.map((r=>(function(i){return i.field.canonicalString()+i.dir})(r))).join(","),ay(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=e.startAt.inclusive?"b:":"a:",n+=e.startAt.position.map((r=>Jf(r))).join(",")),e.endAt&&(n+="|ub:",n+=e.endAt.inclusive?"a:":"b:",n+=e.endAt.position.map((r=>Jf(r))).join(",")),e.Te=n}return e.Te}function ly(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n<t.orderBy.length;n++)if(!ahe(t.orderBy[n],e.orderBy[n]))return!1;if(t.filters.length!==e.filters.length)return!1;for(let n=0;n<t.filters.length;n++)if(!nj(t.filters[n],e.filters[n]))return!1;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!bM(t.startAt,e.startAt)&&bM(t.endAt,e.endAt)}function iS(t){return Ge.isDocumentKey(t.path)&&t.collectionGroup===null&&t.filters.length===0}function oS(t,e){return t.filters.filter((n=>n instanceof Qt&&n.field.isEqual(e)))}function wM(t,e,n){let r=Jb,s=!0;for(const i of oS(t,e)){let o=Jb,a=!0;switch(i.op){case"<":case"<=":o=ihe(i.value);break;case"==":case"in":case">=":o=i.value;break;case">":o=i.value,a=!1;break;case"!=":case"not-in":o=Jb}_M({value:r,inclusive:s},{value:o,inclusive:a})<0&&(r=o,s=a)}if(n!==null){for(let i=0;i<t.orderBy.length;++i)if(t.orderBy[i].field.isEqual(e)){const o=n.position[i];_M({value:r,inclusive:s},{value:o,inclusive:n.inclusive})<0&&(r=o,s=n.inclusive);break}}return{value:r,inclusive:s}}function SM(t,e,n){let r=Hl,s=!0;for(const i of oS(t,e)){let o=Hl,a=!0;switch(i.op){case">=":case">":o=ohe(i.value),a=!1;break;case"==":case"in":case"<=":o=i.value;break;case"<":o=i.value,a=!1;break;case"!=":case"not-in":o=Hl}yM({value:r,inclusive:s},{value:o,inclusive:a})>0&&(r=o,s=a)}if(n!==null){for(let i=0;i<t.orderBy.length;++i)if(t.orderBy[i].field.isEqual(e)){const o=n.position[i];yM({value:r,inclusive:s},{value:o,inclusive:n.inclusive})>0&&(r=o,s=n.inclusive);break}}return{value:r,inclusive:s}}class uy{constructor(e,n=null,r=[],s=[],i=null,o="F",a=null,c=null){this.path=e,this.collectionGroup=n,this.explicitOrderBy=r,this.filters=s,this.limit=i,this.limitType=o,this.startAt=a,this.endAt=c,this.Ie=null,this.Ee=null,this.de=null,this.startAt,this.endAt}}function aj(t,e,n,r,s,i,o,a){return new uy(t,e,n,r,s,i,o,a)}function dy(t){return new uy(t)}function TM(t){return t.filters.length===0&&t.limit===null&&t.startAt==null&&t.endAt==null&&(t.explicitOrderBy.length===0||t.explicitOrderBy.length===1&&t.explicitOrderBy[0].field.isKeyField())}function cj(t){return t.collectionGroup!==null}function kg(t){const e=nt(t);if(e.Ie===null){e.Ie=[];const n=new Set;for(const i of e.explicitOrderBy)e.Ie.push(i),n.add(i.field.canonicalString());const r=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(o){let a=new Ln(cr.comparator);
89return o.filters.forEach((c=>{c.getFlattenedFilters().forEach((l=>{l.isInequality()&&(a=a.add(l.field))}))})),a})(e).forEach((i=>{n.has(i.canonicalString())||i.isKeyField()||e.Ie.push(new sS(i,r))})),n.has(cr.keyField().canonicalString())||e.Ie.push(new sS(cr.keyField(),r))}return e.Ie}function Fi(t){const e=nt(t);return e.Ee||(e.Ee=mhe(e,kg(t))),e.Ee}function mhe(t,e){if(t.limitType==="F")return GA(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map((s=>{const i=s.dir==="desc"?"asc":"desc";return new sS(s.field,i)}));const n=t.endAt?new Qf(t.endAt.position,t.endAt.inclusive):null,r=t.startAt?new Qf(t.startAt.position,t.startAt.inclusive):null;return GA(t.path,t.collectionGroup,e,t.filters,t.limit,n,r)}}function KA(t,e){const n=t.filters.concat([e]);return new uy(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}function zA(t,e,n){return new uy(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function XT(t,e){return ly(Fi(t),Fi(e))&&t.limitType===e.limitType}function lj(t){return`${zd(Fi(t))}|lt:${t.limitType}`}function sf(t){return`Query(target=${(function(n){let r=n.path.canonicalString();return n.collectionGroup!==null&&(r+=" collectionGroup="+n.collectionGroup),n.filters.length>0&&(r+=`, filters: [${n.filters.map((s=>sj(s))).join(", ")}]`),ay(n.limit)||(r+=", limit: "+n.limit),n.orderBy.length>0&&(r+=`, orderBy: [${n.orderBy.map((s=>(function(o){return`${o.field.canonicalString()} (${o.dir})`})(s))).join(", ")}]`),n.startAt&&(r+=", startAt: ",r+=n.startAt.inclusive?"b:":"a:",r+=n.startAt.position.map((s=>Jf(s))).join(",")),n.endAt&&(r+=", endAt: ",r+=n.endAt.inclusive?"a:":"b:",r+=n.endAt.position.map((s=>Jf(s))).join(",")),`Target(${r})`})(Fi(t))}; limitType=${t.limitType})`}function hy(t,e){return e.isFoundDocument()&&(function(r,s){const i=s.key.path;return r.collectionGroup!==null?s.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(i):Ge.isDocumentKey(r.path)?r.path.isEqual(i):r.path.isImmediateParentOf(i)})(t,e)&&(function(r,s){for(const i of kg(r))if(!i.field.isKeyField()&&s.data.field(i.field)===null)return!1;return!0})(t,e)&&(function(r,s){for(const i of r.filters)if(!i.matches(s))return!1;return!0})(t,e)&&(function(r,s){return!(r.startAt&&!(function(o,a,c){const l=vM(o,a,c);return o.inclusive?l<=0:l<0})(r.startAt,kg(r),s)||r.endAt&&!(function(o,a,c){const l=vM(o,a,c);return o.inclusive?l>=0:l>0})(r.endAt,kg(r),s))})(t,e)}function uj(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function dj(t){return(e,n)=>{let r=!1;for(const s of kg(t)){const i=ghe(s,e,n);if(i!==0)return i;r=r||s.field.isKeyField()}return 0}}function ghe(t,e,n){const r=t.field.isKeyField()?Ge.comparator(e.key,n.key):(function(i,o,a){const c=o.data.field(i),l=a.data.field(i);return c!==null&&l!==null?hu(c,l):Xe(42886)})(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return Xe(19790,{direction:t.dir})}}class rl{constructor(e,n){this.mapKeyFn=e,this.equalsFn=n,this.inner={},this.innerSize=0}get(e){const n=this.mapKeyFn(e),r=this.inner[n];if(r!==void 0){for(const[s,i]of r)if(this.equalsFn(s,e))return i}}has(e){return this.get(e)!==void 0}set(e,n){const r=this.mapKeyFn(e),s=this.inner[r];if(s===void 0)return this.inner[r]=[[e,n]],void this.innerSize++;for(let i=0;i<s.length;i++)if(this.equalsFn(s[i][0],e))return void(s[i]=[e,n]);s.push([e,n]),this.innerSize++}delete(e){const n=this.mapKeyFn(e),r=this.inner[n];if(r===void 0)return!1;for(let s=0;s<r.length;s++)if(this.equalsFn(r[s][0],e))return r.length===1?delete this.inner[n]:r.splice(s,1),this.innerSize--,!0;return!1}forEach(e){Cu(this.inner,((n,r)=>{for(const[s,i]of r)e(s,i)}))}isEmpty(){return jq(this.inner)}size(){return this.innerSize}}const _he=new ur(Ge.comparator);function Li(){return _he}const hj=new ur(Ge.comparator);function lg(...t){let e=hj;for(const n of t)e=e.insert(n.key,n);return e}function fj(t){let e=hj;return t.forEach(((n,r)=>e=e.insert(n,r.overlayedDocument))),e}function wa(){return Ng()}function pj(){return Ng()}function Ng(){return new rl((t=>t.toString()),((t,e)=>t.isEqual(e)))}const yhe=new ur(Ge.comparator),vhe=new Ln(Ge.comparator);function Vt(...t){let e=vhe;for(const n of t)e=e.add(n);return e}const bhe=new Ln(Et);function Ok(){return bhe}function xk(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:l_(e)?"-0":e}}function mj(t){return{integerValue:""+t}}function whe(t,e){return Oq(e)?mj(e):xk(t,e)}class ZT{constructor(){this._=void 0}}function She(t,e,n){return t instanceof Zf?(function(s,i){const o={fields:{[Kq]:{stringValue:Gq},[Yq]:{timestampValue:{seconds:s.seconds,nanos:s.nanoseconds}}}};return i&&Pk(i)&&(i=JT(i)),i&&(o.fields[zq]=i),{mapValue:o}})(n,e):t instanceof ep?_j(t,e):t instanceof tp?yj(t,e):(function(s,i){const o=gj(s,i),a=EM(o)+EM(s.Ae);return qA(o)&&qA(s.Ae)?mj(a):xk(s.serializer,a)})(t,e)}function The(t,e,n){return t instanceof ep?_j(t,e):t instanceof tp?yj(t,e):n}function gj(t,e){return t instanceof y_?(function(r){return qA(r)||(function(i){return!!i&&"doubleValue"in i})(r)})(e)?e:{integerValue:0}:null}class Zf extends ZT{}class ep extends ZT{constructor(e){super(),this.elements=e}}function _j(t,e){const n=vj(e);for(const r of t.elements)n.some((s=>Da(s,r)))||n.push(r);return{arrayValue:{values:n}}}class tp extends ZT{constructor(e){super(),this.elements=e}}function yj(t,e){let n=vj(e);for(const r of t.elements)n=n.filter((s=>!Da(s,r)));return{arrayValue:{values:n}}}
89class y_ extends ZT{constructor(e,n){super(),this.serializer=e,this.Ae=n}}function EM(t){return nr(t.integerValue||t.doubleValue)}function vj(t){return __(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}class bj{constructor(e,n){this.field=e,this.transform=n}}function Ehe(t,e){return t.field.isEqual(e.field)&&(function(r,s){return r instanceof ep&&s instanceof ep||r instanceof tp&&s instanceof tp?qf(r.elements,s.elements,Da):r instanceof y_&&s instanceof y_?Da(r.Ae,s.Ae):r instanceof Zf&&s instanceof Zf})(t.transform,e.transform)}class Ihe{constructor(e,n){this.version=e,this.transformResults=n}}class Hr{constructor(e,n){this.updateTime=e,this.exists=n}static none(){return new Hr}static exists(e){return new Hr(void 0,e)}static updateTime(e){return new Hr(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function Zb(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}class eE{}function wj(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new fy(t.key,Hr.none()):new Op(t.key,t.data,Hr.none());{const n=t.data,r=_s.empty();let s=new Ln(cr.comparator);for(let i of e.fields)if(!s.has(i)){let o=n.field(i);o===null&&i.length>1&&(i=i.popLast(),o=n.field(i)),o===null?r.delete(i):r.set(i,o),s=s.add(i)}return new sl(t.key,r,new fi(s.toArray()),Hr.none())}}function Che(t,e,n){t instanceof Op?(function(s,i,o){const a=s.value.clone(),c=CM(s.fieldTransforms,i,o.transformResults);a.setAll(c),i.convertToFoundDocument(o.version,a).setHasCommittedMutations()})(t,e,n):t instanceof sl?(function(s,i,o){if(!Zb(s.precondition,i))return void i.convertToUnknownDocument(o.version);const a=CM(s.fieldTransforms,i,o.transformResults),c=i.data;c.setAll(Sj(s)),c.setAll(a),i.convertToFoundDocument(o.version,c).setHasCommittedMutations()})(t,e,n):(function(s,i,o){i.convertToNoDocument(o.version).setHasCommittedMutations()})(0,e,n)}function Dg(t,e,n,r){return t instanceof Op?(function(i,o,a,c){if(!Zb(i.precondition,o))return a;const l=i.value.clone(),d=AM(i.fieldTransforms,c,o);return l.setAll(d),o.convertToFoundDocument(o.version,l).setHasLocalMutations(),null})(t,e,n,r):t instanceof sl?(function(i,o,a,c){if(!Zb(i.precondition,o))return a;const l=AM(i.fieldTransforms,c,o),d=o.data;return d.setAll(Sj(i)),d.setAll(l),o.convertToFoundDocument(o.version,d).setHasLocalMutations(),a===null?null:a.unionWith(i.fieldMask.fields).unionWith(i.fieldTransforms.map((h=>h.field)))})(t,e,n,r):(function(i,o,a){return Zb(i.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):a})(t,e,n)}function Ahe(t,e){let n=null;for(const r of t.fieldTransforms){const s=e.data.field(r.field),i=gj(r.transform,s||null);i!=null&&(n===null&&(n=_s.empty()),n.set(r.field,i))}return n||null}function IM(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!(function(r,s){return r===void 0&&s===void 0||!(!r||!s)&&qf(r,s,((i,o)=>Ehe(i,o)))})(t.fieldTransforms,e.fieldTransforms)&&(t.type===0?t.value.isEqual(e.value):t.type!==1||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}class Op extends eE{constructor(e,n,r,s=[]){super(),this.key=e,this.value=n,this.precondition=r,this.fieldTransforms=s,this.type=0}getFieldMask(){return null}}class sl extends eE{constructor(e,n,r,s,i=[]){super(),this.key=e,this.data=n,this.fieldMask=r,this.precondition=s,this.fieldTransforms=i,this.type=1}getFieldMask(){return this.fieldMask}}function Sj(t){const e=new Map;return t.fieldMask.fields.forEach((n=>{if(!n.isEmpty()){const r=t.data.field(n);e.set(n,r)}})),e}function CM(t,e,n){const r=new Map;st(t.length===n.length,32656,{Re:n.length,Ve:t.length});for(let s=0;s<n.length;s++){const i=t[s],o=i.transform,a=e.data.field(i.field);r.set(i.field,The(o,a,n[s]))}return r}function AM(t,e,n){const r=new Map;for(const s of t){const i=s.transform,o=n.data.field(s.field);r.set(s.field,She(i,o,e))}return r}class fy extends eE{constructor(e,n){super(),this.key=e,this.prec
89ondition=n,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class Lk extends eE{constructor(e,n){super(),this.key=e,this.precondition=n,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}class Mk{constructor(e,n,r,s){this.batchId=e,this.localWriteTime=n,this.baseMutations=r,this.mutations=s}applyToRemoteDocument(e,n){const r=n.mutationResults;for(let s=0;s<this.mutations.length;s++){const i=this.mutations[s];i.key.isEqual(e.key)&&Che(i,e,r[s])}}applyToLocalView(e,n){for(const r of this.baseMutations)r.key.isEqual(e.key)&&(n=Dg(r,e,n,this.localWriteTime));for(const r of this.mutations)r.key.isEqual(e.key)&&(n=Dg(r,e,n,this.localWriteTime));return n}applyToLocalDocumentSet(e,n){const r=pj();return this.mutations.forEach((s=>{const i=e.get(s.key),o=i.overlayedDocument;let a=this.applyToLocalView(o,i.mutatedFields);a=n.has(s.key)?null:a;const c=wj(o,a);c!==null&&r.set(s.key,c),o.isValidDocument()||o.convertToNoDocument(ct.min())})),r}keys(){return this.mutations.reduce(((e,n)=>e.add(n.key)),Vt())}isEqual(e){return this.batchId===e.batchId&&qf(this.mutations,e.mutations,((n,r)=>IM(n,r)))&&qf(this.baseMutations,e.baseMutations,((n,r)=>IM(n,r)))}}class Vk{constructor(e,n,r,s){this.batch=e,this.commitVersion=n,this.mutationResults=r,this.docVersions=s}static from(e,n,r){st(e.mutations.length===r.length,58842,{me:e.mutations.length,fe:r.length});let s=(function(){return yhe})();const i=e.mutations;for(let o=0;o<i.length;o++)s=s.insert(i[o].key,r[o].version);return new Vk(e,n,r,s)}}class Fk{constructor(e,n){this.largestBatchId=e,this.mutation=n}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{ 90 largestBatchId: ${this.largestBatchId}, 91 mutation: ${this.mutation.toString()} 92 }`}}class Rhe{constructor(e,n){this.count=e,this.unchangedNames=n}}var $r,nn;function Tj(t){switch(t){case we.OK:return Xe(64938);case we.CANCELLED:case we.UNKNOWN:case we.DEADLINE_EXCEEDED:case we.RESOURCE_EXHAUSTED:case we.INTERNAL:case we.UNAVAILABLE:case we.UNAUTHENTICATED:return!1;case we.INVALID_ARGUMENT:case we.NOT_FOUND:case we.ALREADY_EXISTS:case we.PERMISSION_DENIED:case we.FAILED_PRECONDITION:case we.ABORTED:case we.OUT_OF_RANGE:case we.UNIMPLEMENTED:case we.DATA_LOSS:return!0;default:return Xe(15467,{code:t})}}function Ej(t){if(t===void 0)return Dr("GRPC error has no .code"),we.UNKNOWN;switch(t){case $r.OK:return we.OK;case $r.CANCELLED:return we.CANCELLED;case $r.UNKNOWN:return we.UNKNOWN;case $r.DEADLINE_EXCEEDED:return we.DEADLINE_EXCEEDED;case $r.RESOURCE_EXHAUSTED:return we.RESOURCE_EXHAUSTED;case $r.INTERNAL:return we.INTERNAL;case $r.UNAVAILABLE:return we.UNAVAILABLE;case $r.UNAUTHENTICATED:return we.UNAUTHENTICATED;case $r.INVALID_ARGUMENT:return we.INVALID_ARGUMENT;case $r.NOT_FOUND:return we.NOT_FOUND;case $r.ALREADY_EXISTS:return we.ALREADY_EXISTS;case $r.PERMISSION_DENIED:return we.PERMISSION_DENIED;case $r.FAILED_PRECONDITION:return we.FAILED_PRECONDITION;case $r.ABORTED:return we.ABORTED;case $r.OUT_OF_RANGE:return we.OUT_OF_RANGE;case $r.UNIMPLEMENTED:return we.UNIMPLEMENTED;case $r.DATA_LOSS:return we.DATA_LOSS;default:return Xe(39323,{code:t})}}(nn=$r||($r={}))[nn.OK=0]="OK",nn[nn.CANCELLED=1]="CANCELLED",nn[nn.UNKNOWN=2]="UNKNOWN",nn[nn.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",nn[nn.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",nn[nn.NOT_FOUND=5]="NOT_FOUND",nn[nn.ALREADY_EXISTS=6]="ALREADY_EXISTS",nn[nn.PERMISSION_DENIED=7]="PERMISSION_DENIED",nn[nn.UNAUTHENTICATED=16]="UNAUTHENTICATED",nn[nn.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",nn[nn.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",nn[nn.ABORTED=10]="ABORTED",nn[nn.OUT_OF_RANGE=11]="OUT_OF_RANGE",nn[nn.UNIMPLEMENTED=12]="UNIMPLEMENTED",nn[nn.INTERNAL=13]="INTERNAL",nn[nn.UNAVAILABLE=14]="UNAVAILABLE",nn[nn.DATA_LOSS=15]="DATA_LOSS";function Phe(){return new TextEncoder}const khe=new Yl([4294967295,4294967295],0);function RM(t){const e=Phe().encode(t),n=new _q;return n.update(e),new Uint8Array(n.digest())}function PM(t){const e=new DataView(t.buffer),n=e.getUint32(0,!0),r=e.getUint32(4,!0),s=e.getUint32(8,!0),i=e.getUint32(12,!0);
92return[new Yl([n,r],0),new Yl([s,i],0)]}class Bk{constructor(e,n,r){if(this.bitmap=e,this.padding=n,this.hashCount=r,n<0||n>=8)throw new ug(`Invalid padding: ${n}`);if(r<0)throw new ug(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new ug(`Invalid hash count: ${r}`);if(e.length===0&&n!==0)throw new ug(`Invalid padding when bitmap length is 0: ${n}`);this.ge=8*e.length-n,this.pe=Yl.fromNumber(this.ge)}ye(e,n,r){let s=e.add(n.multiply(Yl.fromNumber(r)));return s.compare(khe)===1&&(s=new Yl([s.getBits(0),s.getBits(1)],0)),s.modulo(this.pe).toNumber()}we(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(this.ge===0)return!1;const n=RM(e),[r,s]=PM(n);for(let i=0;i<this.hashCount;i++){const o=this.ye(r,s,i);if(!this.we(o))return!1}return!0}static create(e,n,r){const s=e%8==0?0:8-e%8,i=new Uint8Array(Math.ceil(e/8)),o=new Bk(i,s,n);return r.forEach((a=>o.insert(a))),o}insert(e){if(this.ge===0)return;const n=RM(e),[r,s]=PM(n);for(let i=0;i<this.hashCount;i++){const o=this.ye(r,s,i);this.Se(o)}}Se(e){const n=Math.floor(e/8),r=e%8;this.bitmap[n]|=1<<r}}class ug extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}class py{constructor(e,n,r,s,i){this.snapshotVersion=e,this.targetChanges=n,this.targetMismatches=r,this.documentUpdates=s,this.resolvedLimboDocuments=i}static createSynthesizedRemoteEventForCurrentChange(e,n,r){const s=new Map;return s.set(e,my.createSynthesizedTargetChangeForCurrentChange(e,n,r)),new py(ct.min(),s,new ur(Et),Li(),Vt())}}class my{constructor(e,n,r,s,i){this.resumeToken=e,this.current=n,this.addedDocuments=r,this.modifiedDocuments=s,this.removedDocuments=i}static createSynthesizedTargetChangeForCurrentChange(e,n,r){return new my(r,n,Vt(),Vt(),Vt())}}class ew{constructor(e,n,r,s){this.be=e,this.removedTargetIds=n,this.key=r,this.De=s}}class Ij{constructor(e,n){this.targetId=e,this.Ce=n}}class Cj{constructor(e,n,r=Lr.EMPTY_BYTE_STRING,s=null){this.state=e,this.targetIds=n,this.resumeToken=r,this.cause=s}}class kM{constructor(){this.ve=0,this.Fe=NM(),this.Me=Lr.EMPTY_BYTE_STRING,this.xe=!1,this.Oe=!0}get current(){return this.xe}get resumeToken(){return this.Me}get Ne(){return this.ve!==0}get Be(){return this.Oe}Le(e){e.approximateByteSize()>0&&(this.Oe=!0,this.Me=e)}ke(){let e=Vt(),n=Vt(),r=Vt();return this.Fe.forEach(((s,i)=>{switch(i){case 0:e=e.add(s);break;case 2:n=n.add(s);break;case 1:r=r.add(s);break;default:Xe(38017,{changeType:i})}})),new my(this.Me,this.xe,e,n,r)}qe(){this.Oe=!1,this.Fe=NM()}Qe(e,n){this.Oe=!0,this.Fe=this.Fe.insert(e,n)}$e(e){this.Oe=!0,this.Fe=this.Fe.remove(e)}Ue(){this.ve+=1}Ke(){this.ve-=1,st(this.ve>=0,3241,{ve:this.ve})}We(){this.Oe=!0,this.xe=!0}}class Nhe{constructor(e){this.Ge=e,this.ze=new Map,this.je=Li(),this.Je=gb(),this.He=gb(),this.Ye=new ur(Et)}Ze(e){for(const n of e.be)e.De&&e.De.isFoundDocument()?this.Xe(n,e.De):this.et(n,e.key,e.De);for(const n of e.removedTargetIds)this.et(n,e.key,e.De)}tt(e){this.forEachTarget(e,(n=>{const r=this.nt(n);switch(e.state){case 0:this.rt(n)&&r.Le(e.resumeToken);break;case 1:r.Ke(),r.Ne||r.qe(),r.Le(e.resumeToken);break;case 2:r.Ke(),r.Ne||this.removeTarget(n);break;case 3:this.rt(n)&&(r.We(),r.Le(e.resumeToken));break;case 4:this.rt(n)&&(this.it(n),r.Le(e.resumeToken));break;default:Xe(56790,{state:e.state})}}))}forEachTarget(e,n){e.targetIds.length>0?e.targetIds.forEach(n):this.ze.forEach(((r,s)=>{this.rt(s)&&n(s)}))}st(e){const n=e.targetId,r=e.Ce.count,s=this.ot(n);if(s){const i=s.target;if(iS(i))if(r===0){const o=new Ge(i.path);this.et(n,o,sr.newNoDocument(o,ct.min()))}else st(r===1,20013,{expectedCount:r});else{const o=this._t(n);if(o!==r){const a=this.ut(e),c=a?this.ct(a,e,o):1;if(c!==0){this.it(n);const l=c===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ye=this.Ye.insert(n,l)}}}}}ut(e){const n=e.Ce.unchangedNames;if(!n||!n.bits)return null;const{bits:{bitmap:r="",padding:s=0},hashCount:i=0}=n;let o,a;try{o=Yc(r).toUint8Array()}catch(c){if(c instanceof Wq)return Hf("Decoding the base64 bloom filter in existence filter failed ("+c.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw c}try{a=new Bk(o,s,i)}catch(c){return Hf(c instanceof ug?"BloomFilter error: ":"Applying bloom filter failed: ",c),null}return a.ge===0?null:a}ct(e,n,r){return n.Ce.count===r-this.Pt(e,n.targetId)?0:2}Pt(e,n){const r=this.Ge.getRemoteKeysForTarget(n);let s=0;return r.forEach((i=>{const o=this.Ge.ht(),a=`projects/${o.projectId}/databases/${o.database}/documents/${i.path.canonicalString()}`;e.mightContain(a)||(this.et(n,i,null),s++)})),s}Tt(e){const n=new Map;this.ze.forEach(((i,o)=>{const a=this.ot(o);if(a){if(i.current&&iS(a.target)){const c=new Ge(a.target.path);this.It(c).has(o)||this.Et(o,c)||this.et(o,c,sr.newNoDocument(c,e))}i.Be&&(n.set(o,i.ke()),i.qe())}}));let r=Vt();this.He.forEach(((i,o)=>{let a=!0;o.forEachWhile((c=>{const l=this.ot(c);return!l||l.purpose==="TargetPurposeLimboResolution"||(a=!1,!1)})),a&&(r=r.add(i))})),this.je.forEach(((i,o)=>o.setReadTime(e)));const s=new py(e,n,this.Ye,this.je,r);return this.je=Li(),this.Je=gb(),this.He=gb(),this.Ye=new ur(Et),s}Xe(e,n){if(!this.rt(e))return;const r=this.Et(e,n.key)?2:0;this.nt(e).Qe(n.key,r),this.je=this.je.insert(n.key,n),this.Je=this.Je.insert(n.key,this.It(n.key).add(e)),this.He=this.He.insert(n.key,this.dt(n.key).add(e))}et(e,n,r){if(!this.rt(e))return;const s=this.nt(e);this.Et(e,n)?s.Qe(n,1):s.$e(n),this.He=this.He.insert(n,this.dt(n).delete(e)),this.He=this.He.insert(n,this.dt(n).add(e)),r&&(this.je=this.je.insert(n,r))}removeTarget(e){this.ze.delete(e)}_t(e){const n=this.nt(e).ke();return this.Ge.getRemoteKeysForTarget(e).size+n.addedDocuments.size-n.removedDocuments.size}Ue(e){this.nt(e).Ue()}nt(e){let n=this.ze.get(e);return n||(n=new kM,this.ze.set(e,n)),n}dt(e){let n=this.He.get(e);return n||(n=new Ln(Et),this.He=this.He.insert(e,n)),n}It(e){let n=this.Je.get(e);return n||(n=new Ln(Et),this.Je=this.Je.insert(e,n)),n}rt(e){const n=this.ot(e)!==null;return n||Le("WatchChangeAggregator","Detected inactive target",e),n}ot(e){const n=this.ze.get(e);return n&&n.Ne?null:this.Ge.At(e)}it(e){this.ze.set(e,new kM),this.Ge.getRemoteKeysForTarget(e).forEach((n=>{this.et(e,n,null)}))}Et(e,n){return this.Ge.getRemoteKeysForTarget(e).has(n)}}function gb(){return new ur(Ge.comparator)}function NM(){return new ur(Ge.comparator)}const Dhe={asc:"ASCENDING",desc:"DESCENDING"},Ohe={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},xhe={and:"AND",or:"OR"};class Lhe{constructor(e,n){this.databaseId=e,this.useProto3Json=n}}function YA(t,e){return t.useProto3Json||ay(e)?e:{value:e}}function np(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function Aj(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function Mhe(t,e){return np(t,e.toTimestamp())}function hs(t){return st(!!t,49232),ct.fromTimestamp((function(n){const r=zc(n);return new an(r.seconds,r.nanos)})(t))}function $k(t,e){return JA(t,e).canonicalString()}function JA(t,e){const n=(function(s){return new rn(["projects",s.projectId,"databases",s.database])})(t).child("documents");return e===void 0?n:n.child(e)}function Rj(t){const e=rn.fromString(t);return st(Vj(e),10190,{key:e.toString()}),e}function v_(t,e){return $k(t.databaseId,e.path)}function Nc(t,e){const n=Rj(e);if(n.get(1)!==t.databaseId.projectId)throw new Be(we.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new Be(we.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new Ge(Nj(n))}function Pj(t,e){return $k(t.databaseId,e)}function kj(t){const e=Rj(t);
92return e.length===4?rn.emptyPath():Nj(e)}function QA(t){return new rn(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function Nj(t){return st(t.length>4&&t.get(4)==="documents",29091,{key:t.toString()}),t.popFirst(5)}function DM(t,e,n){return{name:v_(t,e),fields:n.value.mapValue.fields}}function Vhe(t,e,n){const r=Nc(t,e.name),s=hs(e.updateTime),i=e.createTime?hs(e.createTime):ct.min(),o=new _s({mapValue:{fields:e.fields}}),a=sr.newFoundDocument(r,s,i,o);return n&&a.setHasCommittedMutations(),n?a.setHasCommittedMutations():a}function Fhe(t,e){return"found"in e?(function(r,s){st(!!s.found,43571),s.found.name,s.found.updateTime;const i=Nc(r,s.found.name),o=hs(s.found.updateTime),a=s.found.createTime?hs(s.found.createTime):ct.min(),c=new _s({mapValue:{fields:s.found.fields}});return sr.newFoundDocument(i,o,a,c)})(t,e):"missing"in e?(function(r,s){st(!!s.missing,3894),st(!!s.readTime,22933);const i=Nc(r,s.missing),o=hs(s.readTime);return sr.newNoDocument(i,o)})(t,e):Xe(7234,{result:e})}function Bhe(t,e){let n;if("targetChange"in e){e.targetChange;const r=(function(l){return l==="NO_CHANGE"?0:l==="ADD"?1:l==="REMOVE"?2:l==="CURRENT"?3:l==="RESET"?4:Xe(39313,{state:l})})(e.targetChange.targetChangeType||"NO_CHANGE"),s=e.targetChange.targetIds||[],i=(function(l,d){return l.useProto3Json?(st(d===void 0||typeof d=="string",58123),Lr.fromBase64String(d||"")):(st(d===void 0||d instanceof Buffer||d instanceof Uint8Array,16193),Lr.fromUint8Array(d||new Uint8Array))})(t,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&(function(l){const d=l.code===void 0?we.UNKNOWN:Ej(l.code);return new Be(d,l.message||"")})(o);n=new Cj(r,s,i,a||null)}else if("documentChange"in e){e.documentChange;const r=e.documentChange;r.document,r.document.name,r.document.updateTime;const s=Nc(t,r.document.name),i=hs(r.document.updateTime),o=r.document.createTime?hs(r.document.createTime):ct.min(),a=new _s({mapValue:{fields:r.document.fields}}),c=sr.newFoundDocument(s,i,o,a),l=r.targetIds||[],d=r.removedTargetIds||[];n=new ew(l,d,c.key,c)}else if("documentDelete"in e){e.documentDelete;const r=e.documentDelete;r.document;const s=Nc(t,r.document),i=r.readTime?hs(r.readTime):ct.min(),o=sr.newNoDocument(s,i),a=r.removedTargetIds||[];n=new ew([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const r=e.documentRemove;r.document;const s=Nc(t,r.document),i=r.removedTargetIds||[];n=new ew([],i,s,null)}else{if(!("filter"in e))return Xe(11601,{Rt:e});{e.filter;const r=e.filter;r.targetId;const{count:s=0,unchangedNames:i}=r,o=new Rhe(s,i),a=r.targetId;n=new Ij(a,o)}}return n}function b_(t,e){let n;if(e instanceof Op)n={update:DM(t,e.key,e.value)};else if(e instanceof fy)n={delete:v_(t,e.key)};else if(e instanceof sl)n={update:DM(t,e.key,e.data),updateMask:Whe(e.fieldMask)};else{if(!(e instanceof Lk))return Xe(16599,{Vt:e.type});n={verify:v_(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map((r=>(function(i,o){const a=o.transform;if(a instanceof Zf)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof ep)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof tp)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof y_)return{fieldPath:o.field.canonicalString(),increment:a.Ae};throw Xe(20930,{transform:o.transform})})(0,r)))),e.precondition.isNone||(n.currentDocument=(function(s,i){return i.updateTime!==void 0?{updateTime:Mhe(s,i.updateTime)}:i.exists!==void 0?{exists:i.exists}:Xe(27497)})(t,e.precondition)),n}function XA(t,e){const n=e.currentDocument?(function(i){return i.updateTime!==void 0?Hr.updateTime(hs(i.updateTime)):i.exists!==void 0?Hr.exists(i.exists):Hr.none()})(e.currentDocument):Hr.none(),r=e.updateTransforms?e.updateTransforms.map((s=>(function(o,a){let c=null;if("setToServerValue"in a)st(a.setToServerValue==="REQUEST_TIME",16630,{proto:a}),c=new Zf;else if("appendMissingElements"in a){const d=a.appendMissingElements.values||[];c=new ep(d)}else if("removeAllFromArray"in a){const d=a.removeAllFromArray.values||[];c=new tp(d)}else"increment"in a?c=new y_(o,a.increment):Xe(16584,{proto:a});const l=cr.fromServerFormat(a.fieldPath);return new bj(l,c)})(t,s))):[];if(e.update){e.update.name;const s=Nc(t,e.update.name),i=new _s({mapValue:{fields:e.update.fields}});if(e.updateMask){const o=(function(c){const l=c.fieldPaths||[];return new fi(l.map((d=>cr.fromServerFormat(d))))})(e.updateMask);return new sl(s,i,o,n,r)}return new Op(s,i,n,r)}if(e.delete){const s=Nc(t,e.delete);return new fy(s,n)}if(e.verify){const s=Nc(t,e.verify);return new Lk(s,n)}return Xe(1463,{proto:e})}function $he(t,e){return t&&t.length>0?(st(e!==void 0,14353),t.map((n=>(function(s,i){let o=s.updateTime?hs(s.updateTime):hs(i);return o.isEqual(ct.min())&&(o=hs(i)),new Ihe(o,s.transformResults||[])})(n,e)))):[]}function Dj(t,e){return{documents:[Pj(t,e.path)]}}function Oj(t,e){const n={structuredQuery:{}},r=e.path;let s;e.collectionGroup!==null?(s=r,n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(s=r.popLast(),n.structuredQuery.from=[{collectionId:r.lastSegment()}]),n.parent=Pj(t,s);const i=(function(l){if(l.length!==0)return Mj(xn.create(l,"and"))})(e.filters);i&&(n.structuredQuery.where=i);const o=(function(l){if(l.length!==0)return l.map((d=>(function(p){return{field:of(p.field),direction:Hhe(p.dir)}})(d)))})(e.orderBy);o&&(n.structuredQuery.orderBy=o);const a=YA(t,e.limit);return a!==null&&(n.structuredQuery.limit=a),e.startAt&&(n.structuredQuery.startAt=(function(l){return{before:l.inclusive,values:l.position}})(e.startAt)),e.endAt&&(n.structuredQuery.endAt=(function(l){return{before:!l.inclusive,values:l.position}})(e.endAt)),{ft:n,parent:s}}function xj(t){let e=kj(t.parent);
92const n=t.structuredQuery,r=n.from?n.from.length:0;let s=null;if(r>0){st(r===1,65062);const d=n.from[0];d.allDescendants?s=d.collectionId:e=e.child(d.collectionId)}let i=[];n.where&&(i=(function(h){const p=Lj(h);return p instanceof xn&&Dk(p)?p.getFilters():[p]})(n.where));let o=[];n.orderBy&&(o=(function(h){return h.map((p=>(function(_){return new sS(af(_.field),(function(b){switch(b){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}})(_.direction))})(p)))})(n.orderBy));let a=null;n.limit&&(a=(function(h){let p;return p=typeof h=="object"?h.value:h,ay(p)?null:p})(n.limit));let c=null;n.startAt&&(c=(function(h){const p=!!h.before,g=h.values||[];return new Qf(g,p)})(n.startAt));let l=null;return n.endAt&&(l=(function(h){const p=!h.before,g=h.values||[];return new Qf(g,p)})(n.endAt)),aj(e,s,o,i,a,"F",c,l)}function Uhe(t,e){const n=(function(s){switch(s){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return Xe(28987,{purpose:s})}})(e.purpose);return n==null?null:{"goog-listen-tags":n}}function Lj(t){return t.unaryFilter!==void 0?(function(n){switch(n.unaryFilter.op){case"IS_NAN":const r=af(n.unaryFilter.field);return Qt.create(r,"==",{doubleValue:NaN});case"IS_NULL":const s=af(n.unaryFilter.field);return Qt.create(s,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const i=af(n.unaryFilter.field);return Qt.create(i,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=af(n.unaryFilter.field);return Qt.create(o,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return Xe(61313);default:return Xe(60726)}})(t):t.fieldFilter!==void 0?(function(n){return Qt.create(af(n.fieldFilter.field),(function(s){switch(s){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return Xe(58110);default:return Xe(50506)}})(n.fieldFilter.op),n.fieldFilter.value)})(t):t.compositeFilter!==void 0?(function(n){return xn.create(n.compositeFilter.filters.map((r=>Lj(r))),(function(s){switch(s){case"AND":return"and";case"OR":return"or";default:return Xe(1026)}})(n.compositeFilter.op))})(t):Xe(30097,{filter:t})}function Hhe(t){return Dhe[t]}function qhe(t){return Ohe[t]}function jhe(t){return xhe[t]}function of(t){return{fieldPath:t.canonicalString()}}function af(t){return cr.fromServerFormat(t.fieldPath)}function Mj(t){return t instanceof Qt?(function(n){if(n.op==="=="){if(gM(n.value))return{unaryFilter:{field:of(n.field),op:"IS_NAN"}};if(mM(n.value))return{unaryFilter:{field:of(n.field),op:"IS_NULL"}}}else if(n.op==="!="){if(gM(n.value))return{unaryFilter:{field:of(n.field),op:"IS_NOT_NAN"}};if(mM(n.value))return{unaryFilter:{field:of(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:of(n.field),op:qhe(n.op),value:n.value}}})(t):t instanceof xn?(function(n){const r=n.getFilters().map((s=>Mj(s)));return r.length===1?r[0]:{compositeFilter:{op:jhe(n.op),filters:r}}})(t):Xe(54877,{filter:t})}function Whe(t){const e=[];return t.fields.forEach((n=>e.push(n.canonicalString()))),{fieldPaths:e}}function Vj(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}class wc{constructor(e,n,r,s,i=ct.min(),o=ct.min(),a=Lr.EMPTY_BYTE_STRING,c=null){this.target=e,this.targetId=n,this.purpose=r,this.sequenceNumber=s,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=a,this.expectedCount=c}withSequenceNumber(e){return new wc(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,n){return new wc(this.target,this.targetId,this.purpose,this.sequenceNumber,n,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new wc(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new wc(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}class Fj{constructor(e){this.yt=e}}function Ghe(t,e){let n;if(e.document)n=Vhe(t.yt,e.document,!!e.hasCommittedMutations);else if(e.noDocument){const r=Ge.fromSegments(e.noDocument.path),s=Jd(e.noDocument.readTime);n=sr.newNoDocument(r,s),e.hasCommittedMutations&&n.setHasCommittedMutations()}else{if(!e.unknownDocument)return Xe(56709);{const r=Ge.fromSegments(e.unknownDocument.path),s=Jd(e.unknownDocument.version);n=sr.newUnknownDocument(r,s)}}return e.readTime&&n.setReadTime((function(s){const i=new an(s[0],s[1]);return ct.fromTimestamp(i)})(e.readTime)),n}function OM(t,e){const n=e.key,r={prefixPath:n.getCollectionPath().popLast().toArray(),collectionGroup:n.collectionGroup,documentId:n.path.lastSegment(),readTime:aS(e.readTime),hasCommittedMutations:e.hasCommittedMutations};if(e.isFoundDocument())r.document=(function(i,o){return{name:v_(i,o.key),fields:o.data.value.mapValue.fields,updateTime:np(i,o.version.toTimestamp()),createTime:np(i,o.createTime.toTimestamp())}})(t.yt,e);else if(e.isNoDocument())r.noDocument={path:n.path.toArray(),readTime:Yd(e.version)};else{if(!e.isUnknownDocument())return Xe(57904,{document:e});r.unknownDocument={path:n.path.toArray(),version:Yd(e.version)}}return r}function aS(t){const e=t.toTimestamp();return[e.seconds,e.nanoseconds]}function Yd(t){const e=t.toTimestamp();return{seconds:e.seconds,nanoseconds:e.nanoseconds}}function Jd(t){const e=new an(t.seconds,t.nanoseconds);return ct.fromTimestamp(e)}function dd(t,e){const n=(e.baseMutations||[]).map((i=>XA(t.yt,i)));for(let i=0;i<e.mutations.length-1;++i){const o=e.mutations[i];if(i+1<e.mutations.length&&e.mutations[i+1].transform!==void 0){const a=e.mutations[i+1];o.updateTransforms=a.transform.fieldTransforms,e.mutations.splice(i+1,1),++i}}const r=e.mutations.map((i=>XA(t.yt,i))),s=an.fromMillis(e.localWriteTimeMs);return new Mk(e.batchId,s,n,r)}function dg(t){const e=Jd(t.readTime),n=t.lastLimboFreeSnapshotVersion!==void 0?Jd(t.lastLimboFreeSnapshotVersion):ct.min();let r;return r=(function(i){return i.documents!==void 0})(t.query)?(function(i){const o=i.documents.length;
92return st(o===1,1966,{count:o}),Fi(dy(kj(i.documents[0])))})(t.query):(function(i){return Fi(xj(i))})(t.query),new wc(r,t.targetId,"TargetPurposeListen",t.lastListenSequenceNumber,e,n,Lr.fromBase64String(t.resumeToken))}function Bj(t,e){const n=Yd(e.snapshotVersion),r=Yd(e.lastLimboFreeSnapshotVersion);let s;s=iS(e.target)?Dj(t.yt,e.target):Oj(t.yt,e.target).ft;const i=e.resumeToken.toBase64();return{targetId:e.targetId,canonicalId:zd(e.target),readTime:n,resumeToken:i,lastListenSequenceNumber:e.sequenceNumber,lastLimboFreeSnapshotVersion:r,query:s}}function $j(t){const e=xj({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?zA(e,e.limit,"L"):e}function U0(t,e){return new Fk(e.largestBatchId,XA(t.yt,e.overlayMutation))}function xM(t,e){const n=e.path.lastSegment();return[t,Ds(e.path.popLast()),n]}function LM(t,e,n,r){return{indexId:t,uid:e,sequenceNumber:n,readTime:Yd(r.readTime),documentKey:Ds(r.documentKey.path),largestBatchId:r.largestBatchId}}class Khe{getBundleMetadata(e,n){return MM(e).get(n).next((r=>{if(r)return(function(i){return{id:i.bundleId,createTime:Jd(i.createTime),version:i.version}})(r)}))}saveBundleMetadata(e,n){return MM(e).put((function(s){return{bundleId:s.id,createTime:Yd(hs(s.createTime)),version:s.version}})(n))}getNamedQuery(e,n){return VM(e).get(n).next((r=>{if(r)return(function(i){return{name:i.name,query:$j(i.bundledQuery),readTime:Jd(i.readTime)}})(r)}))}saveNamedQuery(e,n){return VM(e).put((function(s){return{name:s.name,readTime:Yd(hs(s.readTime)),bundledQuery:s.bundledQuery}})(n))}}function MM(t){return Zr(t,KT)}function VM(t){return Zr(t,zT)}class tE{constructor(e,n){this.serializer=e,this.userId=n}static wt(e,n){const r=n.uid||"";return new tE(e,r)}getOverlay(e,n){return jm(e).get(xM(this.userId,n)).next((r=>r?U0(this.serializer,r):null))}getOverlays(e,n){const r=wa();return ae.forEach(n,(s=>this.getOverlay(e,s).next((i=>{i!==null&&r.set(s,i)})))).next((()=>r))}saveOverlays(e,n,r){const s=[];return r.forEach(((i,o)=>{const a=new Fk(n,o);s.push(this.St(e,a))})),ae.waitFor(s)}removeOverlaysForBatchId(e,n,r){const s=new Set;n.forEach((o=>s.add(Ds(o.getCollectionPath()))));const i=[];return s.forEach((o=>{const a=IDBKeyRange.bound([this.userId,o,r],[this.userId,o,r+1],!1,!0);i.push(jm(e).Z(BA,a))})),ae.waitFor(i)}getOverlaysForCollection(e,n,r){const s=wa(),i=Ds(n),o=IDBKeyRange.bound([this.userId,i,r],[this.userId,i,Number.POSITIVE_INFINITY],!0);return jm(e).J(BA,o).next((a=>{for(const c of a){const l=U0(this.serializer,c);s.set(l.getKey(),l)}return s}))}getOverlaysForCollectionGroup(e,n,r,s){const i=wa();let o;const a=IDBKeyRange.bound([this.userId,n,r],[this.userId,n,Number.POSITIVE_INFINITY],!0);return jm(e).ee({index:Bq,range:a},((c,l,d)=>{const h=U0(this.serializer,l);i.size()<s||h.largestBatchId===o?(i.set(h.getKey(),h),o=h.largestBatchId):d.done()})).next((()=>i))}St(e,n){return jm(e).put((function(s,i,o){const[a,c,l]=xM(i,o.mutation.key);return{userId:i,collectionPath:c,documentId:l,collectionGroup:o.mutation.key.getCollectionGroup(),largestBatchId:o.largestBatchId,overlayMutation:b_(s.yt,o.mutation)}})(this.serializer,this.userId,n))}}function jm(t){return Zr(t,YT)}class zhe{bt(e){return Zr(e,Ak)}getSessionToken(e){return this.bt(e).get("sessionToken").next((n=>{const r=n?.value;return r?Lr.fromUint8Array(r):Lr.EMPTY_BYTE_STRING}))}setSessionToken(e,n){return this.bt(e).put({name:"sessionToken",value:n.toUint8Array()})}}class hd{constructor(){}Dt(e,n){this.Ct(e,n),n.vt()}Ct(e,n){if("nullValue"in e)this.Ft(n,5);else if("booleanValue"in e)this.Ft(n,10),n.Mt(e.booleanValue?1:0);else if("integerValue"in e)this.Ft(n,15),n.Mt(nr(e.integerValue));else if("doubleValue"in e){const r=nr(e.doubleValue);isNaN(r)?this.Ft(n,13):(this.Ft(n,15),l_(r)?n.Mt(0):n.Mt(r))}else if("timestampValue"in e){let r=e.timestampValue;this.Ft(n,20),typeof r=="string"&&(r=zc(r)),n.xt(`${r.seconds||""}`),n.Mt(r.nanos||0)}else if("stringValue"in e)this.Ot(e.stringValue,n),this.Nt(n);else if("bytesValue"in e)this.Ft(n,30),n.Bt(Yc(e.bytesValue)),this.Nt(n);else if("referenceValue"in e)this.Lt(e.referenceValue,n);else if("geoPointValue"in e){const r=e.geoPointValue;this.Ft(n,45),n.Mt(r.latitude||0),n.Mt(r.longitude||0)}else"mapValue"in e?Qq(e)?this.Ft(n,Number.MAX_SAFE_INTEGER):QT(e)?this.kt(e.mapValue,n):(this.qt(e.mapValue,n),this.Nt(n)):"arrayValue"in e?(this.Qt(e.arrayValue,n),this.Nt(n)):Xe(19022,{$t:e})}Ot(e,n){this.Ft(n,25),this.Ut(e,n)}Ut(e,n){n.xt(e)}qt(e,n){const r=e.fields||{};this.Ft(n,55);for(const s of Object.keys(r))this.Ot(s,n),this.Ct(r[s],n)}kt(e,n){const r=e.fields||{};this.Ft(n,53);const s=Yf,i=r[s].arrayValue?.values?.length||0;this.Ft(n,15),n.Mt(nr(i)),this.Ot(s,n),this.Ct(r[s],n)}Qt(e,n){const r=e.values||[];this.Ft(n,50);for(const s of r)this.Ct(s,n)}Lt(e,n){this.Ft(n,37),Ge.fromName(e).path.forEach((r=>{this.Ft(n,60),this.Ut(r,n)}))}Ft(e,n){e.Mt(n)}Nt(e){e.Mt(2)}}
92hd.Kt=new hd;const jh=255;function Yhe(t){if(t===0)return 8;let e=0;return t>>4||(e+=4,t<<=4),t>>6||(e+=2,t<<=2),t>>7||(e+=1),e}function FM(t){const e=64-(function(r){let s=0;for(let i=0;i<8;++i){const o=Yhe(255&r[i]);if(s+=o,o!==8)break}return s})(t);return Math.ceil(e/8)}class Jhe{constructor(){this.buffer=new Uint8Array(1024),this.position=0}Wt(e){const n=e[Symbol.iterator]();let r=n.next();for(;!r.done;)this.Gt(r.value),r=n.next();this.zt()}jt(e){const n=e[Symbol.iterator]();let r=n.next();for(;!r.done;)this.Jt(r.value),r=n.next();this.Ht()}Yt(e){for(const n of e){const r=n.charCodeAt(0);if(r<128)this.Gt(r);else if(r<2048)this.Gt(960|r>>>6),this.Gt(128|63&r);else if(n<"\uD800"||"\uDBFF"<n)this.Gt(480|r>>>12),this.Gt(128|63&r>>>6),this.Gt(128|63&r);else{const s=n.codePointAt(0);this.Gt(240|s>>>18),this.Gt(128|63&s>>>12),this.Gt(128|63&s>>>6),this.Gt(128|63&s)}}this.zt()}Zt(e){for(const n of e){const r=n.charCodeAt(0);if(r<128)this.Jt(r);else if(r<2048)this.Jt(960|r>>>6),this.Jt(128|63&r);else if(n<"\uD800"||"\uDBFF"<n)this.Jt(480|r>>>12),this.Jt(128|63&r>>>6),this.Jt(128|63&r);else{const s=n.codePointAt(0);this.Jt(240|s>>>18),this.Jt(128|63&s>>>12),this.Jt(128|63&s>>>6),this.Jt(128|63&s)}}this.Ht()}Xt(e){const n=this.en(e),r=FM(n);this.tn(1+r),this.buffer[this.position++]=255&r;for(let s=n.length-r;s<n.length;++s)this.buffer[this.position++]=255&n[s]}nn(e){const n=this.en(e),r=FM(n);this.tn(1+r),this.buffer[this.position++]=~(255&r);for(let s=n.length-r;s<n.length;++s)this.buffer[this.position++]=~(255&n[s])}rn(){this.sn(jh),this.sn(255)}_n(){this.an(jh),this.an(255)}reset(){this.position=0}seed(e){this.tn(e.length),this.buffer.set(e,this.position),this.position+=e.length}un(){return this.buffer.slice(0,this.position)}en(e){const n=(function(i){const o=new DataView(new ArrayBuffer(8));return o.setFloat64(0,i,!1),new Uint8Array(o.buffer)})(e),r=!!(128&n[0]);n[0]^=r?255:128;for(let s=1;s<n.length;++s)n[s]^=r?255:0;return n}Gt(e){const n=255&e;n===0?(this.sn(0),this.sn(255)):n===jh?(this.sn(jh),this.sn(0)):this.sn(n)}Jt(e){const n=255&e;n===0?(this.an(0),this.an(255)):n===jh?(this.an(jh),this.an(0)):this.an(e)}zt(){this.sn(0),this.sn(1)}Ht(){this.an(0),this.an(1)}sn(e){this.tn(1),this.buffer[this.position++]=e}an(e){this.tn(1),this.buffer[this.position++]=~e}tn(e){const n=e+this.position;if(n<=this.buffer.length)return;let r=2*this.buffer.length;r<n&&(r=n);const s=new Uint8Array(r);s.set(this.buffer),this.buffer=s}}
92class Qhe{constructor(e){this.cn=e}Bt(e){this.cn.Wt(e)}xt(e){this.cn.Yt(e)}Mt(e){this.cn.Xt(e)}vt(){this.cn.rn()}}class Xhe{constructor(e){this.cn=e}Bt(e){this.cn.jt(e)}xt(e){this.cn.Zt(e)}Mt(e){this.cn.nn(e)}vt(){this.cn._n()}}class Wm{constructor(){this.cn=new Jhe,this.ln=new Qhe(this.cn),this.hn=new Xhe(this.cn)}seed(e){this.cn.seed(e)}Pn(e){return e===0?this.ln:this.hn}un(){return this.cn.un()}reset(){this.cn.reset()}}class fd{constructor(e,n,r,s){this.Tn=e,this.In=n,this.En=r,this.dn=s}An(){const e=this.dn.length,n=e===0||this.dn[e-1]===255?e+1:e,r=new Uint8Array(n);return r.set(this.dn,0),n!==e?r.set([0],this.dn.length):++r[r.length-1],new fd(this.Tn,this.In,this.En,r)}Rn(e,n,r){return{indexId:this.Tn,uid:e,arrayValue:tw(this.En),directionalValue:tw(this.dn),orderedDocumentKey:tw(n),documentKey:r.path.toArray()}}Vn(e,n,r){const s=this.Rn(e,n,r);return[s.indexId,s.uid,s.arrayValue,s.directionalValue,s.orderedDocumentKey,s.documentKey]}}function El(t,e){let n=t.Tn-e.Tn;return n!==0?n:(n=BM(t.En,e.En),n!==0?n:(n=BM(t.dn,e.dn),n!==0?n:Ge.comparator(t.In,e.In)))}function BM(t,e){for(let n=0;n<t.length&&n<e.length;++n){const r=t[n]-e[n];if(r!==0)return r}return t.length-e.length}function tw(t){return lq()?(function(n){let r="";for(let s=0;s<n.length;s++)r+=String.fromCharCode(n[s]);return r})(t):t}function $M(t){return typeof t!="string"?t:(function(n){const r=new Uint8Array(n.length);for(let s=0;s<n.length;s++)r[s]=n.charCodeAt(s);return r})(t)}class UM{constructor(e){this.mn=new Ln(((n,r)=>cr.comparator(n.field,r.field))),this.collectionId=e.collectionGroup!=null?e.collectionGroup:e.path.lastSegment(),this.fn=e.orderBy,this.gn=[];for(const n of e.filters){const r=n;r.isInequality()?this.mn=this.mn.add(r):this.gn.push(r)}}get pn(){return this.mn.size>1}yn(e){if(st(e.collectionGroup===this.collectionId,49279),this.pn)return!1;const n=MA(e);if(n!==void 0&&!this.wn(n))return!1;const r=id(e);let s=new Set,i=0,o=0;for(;i<r.length&&this.wn(r[i]);++i)s=s.add(r[i].fieldPath.canonicalString());if(i===r.length)return!0;if(this.mn.size>0){const a=this.mn.getIterator().getNext();if(!s.has(a.field.canonicalString())){const c=r[i];if(!this.Sn(a,c)||!this.bn(this.fn[o++],c))return!1}++i}for(;i<r.length;++i){const a=r[i];if(o>=this.fn.length||!this.bn(this.fn[o++],a))return!1}return!0}Dn(){if(this.pn)return null;let e=new Ln(cr.comparator);const n=[];for(const r of this.gn)if(!r.field.isKeyField())if(r.op==="array-contains"||r.op==="array-contains-any")n.push(new Kb(r.field,2));else{if(e.has(r.field))continue;e=e.add(r.field),n.push(new Kb(r.field,0))}for(const r of this.fn)r.field.isKeyField()||e.has(r.field)||(e=e.add(r.field),n.push(new Kb(r.field,r.dir==="asc"?0:1)));return new eS(eS.UNKNOWN_ID,this.collectionId,n,c_.empty())}wn(e){for(const n of this.gn)if(this.Sn(n,e))return!0;return!1}Sn(e,n){if(e===void 0||!e.field.isEqual(n.fieldPath))return!1;const r=e.op==="array-contains"||e.op==="array-contains-any";return n.kind===2===r}bn(e,n){return!!e.field.isEqual(n.fieldPath)&&(n.kind===0&&e.dir==="asc"||n.kind===1&&e.dir==="desc")}}function Uj(t){if(st(t instanceof Qt||t instanceof xn,20012),t instanceof Qt){if(t instanceof oj){const n=t.value.arrayValue?.values?.map((r=>Qt.create(t.field,"==",r)))||[];return xn.create(n,"or")}return t}const e=t.filters.map((n=>Uj(n)));return xn.create(e,t.op)}function Zhe(t){if(t.getFilters().length===0)return[];const e=tR(Uj(t));return st(Hj(e),7391),ZA(e)||eR(e)?[e]:e.getFilters()}function ZA(t){return t instanceof Qt}function eR(t){return t instanceof xn&&Dk(t)}function Hj(t){return ZA(t)||eR(t)||(function(n){if(n instanceof xn&&jA(n)){for(const r of n.getFilters())if(!ZA(r)&&!eR(r))return!1;return!0}return!1})(t)}function tR(t){if(st(t instanceof Qt||t instanceof xn,34018),t instanceof Qt)return t;if(t.filters.length===1)return tR(t.filters[0]);const e=t.filters.map((r=>tR(r)));let n=xn.create(e,t.op);return n=cS(n),Hj(n)?n:(st(n instanceof xn,64498),st(Xf(n),40251),st(n.filters.length>1,57927),n.filters.reduce(((r,s)=>Uk(r,s))))}function Uk(t,e){let n;return st(t instanceof Qt||t instanceof xn,38388),st(e instanceof Qt||e instanceof xn,25473),n=t instanceof Qt?e instanceof Qt?(function(s,i){return xn.create([s,i],"and")}
92)(t,e):HM(t,e):e instanceof Qt?HM(e,t):(function(s,i){if(st(s.filters.length>0&&i.filters.length>0,48005),Xf(s)&&Xf(i))return rj(s,i.getFilters());const o=jA(s)?s:i,a=jA(s)?i:s,c=o.filters.map((l=>Uk(l,a)));return xn.create(c,"or")})(t,e),cS(n)}function HM(t,e){if(Xf(e))return rj(e,t.getFilters());{const n=e.filters.map((r=>Uk(t,r)));return xn.create(n,"or")}}function cS(t){if(st(t instanceof Qt||t instanceof xn,11850),t instanceof Qt)return t;const e=t.getFilters();if(e.length===1)return cS(e[0]);if(tj(t))return t;const n=e.map((s=>cS(s))),r=[];return n.forEach((s=>{s instanceof Qt?r.push(s):s instanceof xn&&(s.op===t.op?r.push(...s.filters):r.push(s))})),r.length===1?r[0]:xn.create(r,t.op)}class efe{constructor(){this.Cn=new Hk}addToCollectionParentIndex(e,n){return this.Cn.add(n),ae.resolve()}getCollectionParents(e,n){return ae.resolve(this.Cn.getEntries(n))}addFieldIndex(e,n){return ae.resolve()}deleteFieldIndex(e,n){return ae.resolve()}deleteAllFieldIndexes(e){return ae.resolve()}createTargetIndexes(e,n){return ae.resolve()}getDocumentsMatchingTarget(e,n){return ae.resolve(null)}getIndexType(e,n){return ae.resolve(0)}getFieldIndexes(e,n){return ae.resolve([])}getNextCollectionGroupToUpdate(e){return ae.resolve(null)}getMinOffset(e,n){return ae.resolve(Hi.min())}getMinOffsetFromCollectionGroup(e,n){return ae.resolve(Hi.min())}updateCollectionGroup(e,n,r){return ae.resolve()}updateIndexEntries(e,n){return ae.resolve()}}class Hk{constructor(){this.index={}}add(e){const n=e.lastSegment(),r=e.popLast(),s=this.index[n]||new Ln(rn.comparator),i=!s.has(r);return this.index[n]=s.add(r),i}has(e){const n=e.lastSegment(),r=e.popLast(),s=this.index[n];return s&&s.has(r)}getEntries(e){return(this.index[e]||new Ln(rn.comparator)).toArray()}}const qM="IndexedDbIndexManager",_b=new Uint8Array(0);class tfe{constructor(e,n){this.databaseId=n,this.vn=new Hk,this.Fn=new rl((r=>zd(r)),((r,s)=>ly(r,s))),this.uid=e.uid||""}addToCollectionParentIndex(e,n){if(!this.vn.has(n)){const r=n.lastSegment(),s=n.popLast();e.addOnCommittedListener((()=>{this.vn.add(n)}));const i={collectionId:r,parent:Ds(s)};return jM(e).put(i)}return ae.resolve()}getCollectionParents(e,n){const r=[],s=IDBKeyRange.bound([n,""],[Iq(n),""],!1,!0);return jM(e).J(s).next((i=>{for(const o of i){if(o.collectionId!==n)break;r.push(ba(o.parent))}return r}))}addFieldIndex(e,n){const r=Gm(e),s=(function(a){return{indexId:a.indexId,collectionGroup:a.collectionGroup,fields:a.fields.map((c=>[c.fieldPath.canonicalString(),c.kind]))}})(n);delete s.indexId;const i=r.add(s);if(n.indexState){const o=Gh(e);return i.next((a=>{o.put(LM(a,this.uid,n.indexState.sequenceNumber,n.indexState.offset))}))}return i.next()}deleteFieldIndex(e,n){const r=Gm(e),s=Gh(e),i=Wh(e);return r.delete(n.indexId).next((()=>s.delete(IDBKeyRange.bound([n.indexId],[n.indexId+1],!1,!0)))).next((()=>i.delete(IDBKeyRange.bound([n.indexId],[n.indexId+1],!1,!0))))}deleteAllFieldIndexes(e){const n=Gm(e),r=Wh(e),s=Gh(e);return n.Z().next((()=>r.Z())).next((()=>s.Z()))}createTargetIndexes(e,n){return ae.forEach(this.Mn(n),(r=>this.getIndexType(e,r).next((s=>{if(s===0||s===1){const i=new UM(r).Dn();if(i!=null)return this.addFieldIndex(e,i)}}))))}getDocumentsMatchingTarget(e,n){const r=Wh(e);let s=!0;const i=new Map;return ae.forEach(this.Mn(n),(o=>this.xn(e,o).next((a=>{s&&(s=!!a),i.set(o,a)})))).next((()=>{if(s){let o=Vt();const a=[];return ae.forEach(i,((c,l)=>{Le(qM,`Using index ${(function(T){return`id=${T.indexId}|cg=${T.collectionGroup}|f=${T.fields.map((R=>`${R.fieldPath}:${R.kind}`)).join(",")}`})(c)} to execute ${zd(n)}`);const d=(function(T,R){const N=MA(R);if(N===void 0)return null;for(const O of oS(T,N.fieldPath))switch(O.op){case"array-contains-any":return O.value.arrayValue.values||[];case"array-contains":return[O.value]}return null})(l,c),h=(function(T,R){const N=new Map;for(const O of id(R))for(const S of oS(T,O.fieldPath))switch(S.op){case"==":case"in":N.set(O.fieldPath.canonicalString(),S.value);break;case"not-in":case"!=":return N.set(O.fieldPath.canonicalString(),S.value),Array.from(N.values())}return null})(l,c),p=(function(T,R){const N=[];let O=!0;for(const S of id(R)){const I=S.kind===0?wM(T,S.fieldPath,T.startAt):SM(T,S.fieldPath,T.startAt);N.push(I.value),O&&(O=I.inclusive)}return new Qf(N,O)})(l,c),g=(function(T,R){const N=[];let O=!0;for(const S of id(R)){const I=S.kind===0?SM(T,S.fieldPath,T.endAt):wM(T,S.fieldPath,T.endAt);N.push(I.value),O&&(O=I.inclusive)}return new Qf(N,O)})(l,c),_=this.On(c,l,p),v=this.On(c,l,g),b=this.Nn(c,l,h),w=this.Bn(c.indexId,d,_,p.inclusive,v,g.inclusive,b);return ae.forEach(w,(E=>r.Y(E,n.limit).next((T=>{T.forEach((R=>{const N=Ge.fromSegments(R.documentKey);o.has(N)||(o=o.add(N),a.push(N))}))}))))}
92)).next((()=>a))}return ae.resolve(null)}))}Mn(e){let n=this.Fn.get(e);return n||(e.filters.length===0?n=[e]:n=Zhe(xn.create(e.filters,"and")).map((r=>GA(e.path,e.collectionGroup,e.orderBy,r.getFilters(),e.limit,e.startAt,e.endAt))),this.Fn.set(e,n),n)}Bn(e,n,r,s,i,o,a){const c=(n!=null?n.length:1)*Math.max(r.length,i.length),l=c/(n!=null?n.length:1),d=[];for(let h=0;h<c;++h){const p=n?this.Ln(n[h/l]):_b,g=this.kn(e,p,r[h%l],s),_=this.qn(e,p,i[h%l],o),v=a.map((b=>this.kn(e,p,b,!0)));d.push(...this.createRange(g,_,v))}return d}kn(e,n,r,s){const i=new fd(e,Ge.empty(),n,r);return s?i:i.An()}qn(e,n,r,s){const i=new fd(e,Ge.empty(),n,r);return s?i.An():i}xn(e,n){const r=new UM(n),s=n.collectionGroup!=null?n.collectionGroup:n.path.lastSegment();return this.getFieldIndexes(e,s).next((i=>{let o=null;for(const a of i)r.yn(a)&&(!o||a.fields.length>o.fields.length)&&(o=a);return o}))}getIndexType(e,n){let r=2;const s=this.Mn(n);return ae.forEach(s,(i=>this.xn(e,i).next((o=>{o?r!==0&&o.fields.length<(function(c){let l=new Ln(cr.comparator),d=!1;for(const h of c.filters)for(const p of h.getFlattenedFilters())p.field.isKeyField()||(p.op==="array-contains"||p.op==="array-contains-any"?d=!0:l=l.add(p.field));for(const h of c.orderBy)h.field.isKeyField()||(l=l.add(h.field));return l.size+(d?1:0)})(i)&&(r=1):r=0})))).next((()=>(function(o){return o.limit!==null})(n)&&s.length>1&&r===2?1:r))}Qn(e,n){const r=new Wm;for(const s of id(e)){const i=n.data.field(s.fieldPath);if(i==null)return null;const o=r.Pn(s.kind);hd.Kt.Dt(i,o)}return r.un()}Ln(e){const n=new Wm;return hd.Kt.Dt(e,n.Pn(0)),n.un()}$n(e,n){const r=new Wm;return hd.Kt.Dt(g_(this.databaseId,n),r.Pn((function(i){const o=id(i);return o.length===0?0:o[o.length-1].kind})(e))),r.un()}Nn(e,n,r){if(r===null)return[];let s=[];s.push(new Wm);let i=0;for(const o of id(e)){const a=r[i++];for(const c of s)if(this.Un(n,o.fieldPath)&&__(a))s=this.Kn(s,o,a);else{const l=c.Pn(o.kind);hd.Kt.Dt(a,l)}}return this.Wn(s)}On(e,n,r){return this.Nn(e,n,r.position)}Wn(e){const n=[];for(let r=0;r<e.length;++r)n[r]=e[r].un();return n}Kn(e,n,r){const s=[...e],i=[];for(const o of r.arrayValue.values||[])for(const a of s){const c=new Wm;c.seed(a.un()),hd.Kt.Dt(o,c.Pn(n.kind)),i.push(c)}return i}Un(e,n){return!!e.filters.find((r=>r instanceof Qt&&r.field.isEqual(n)&&(r.op==="in"||r.op==="not-in")))}getFieldIndexes(e,n){const r=Gm(e),s=Gh(e);return(n?r.J(FA,IDBKeyRange.bound(n,n)):r.J()).next((i=>{const o=[];return ae.forEach(i,(a=>s.get([a.indexId,this.uid]).next((c=>{o.push((function(d,h){const p=h?new c_(h.sequenceNumber,new Hi(Jd(h.readTime),new Ge(ba(h.documentKey)),h.largestBatchId)):c_.empty(),g=d.fields.map((([_,v])=>new Kb(cr.fromServerFormat(_),v)));return new eS(d.indexId,d.collectionGroup,g,p)})(a,c))})))).next((()=>o))}))}getNextCollectionGroupToUpdate(e){return this.getFieldIndexes(e).next((n=>n.length===0?null:(n.sort(((r,s)=>{const i=r.indexState.sequenceNumber-s.indexState.sequenceNumber;return i!==0?i:Et(r.collectionGroup,s.collectionGroup)})),n[0].collectionGroup)))}updateCollectionGroup(e,n,r){const s=Gm(e),i=Gh(e);return this.Gn(e).next((o=>s.J(FA,IDBKeyRange.bound(n,n)).next((a=>ae.forEach(a,(c=>i.put(LM(c.indexId,this.uid,o,r))))))))}updateIndexEntries(e,n){const r=new Map;return ae.forEach(n,((s,i)=>{const o=r.get(s.collectionGroup);return(o?ae.resolve(o):this.getFieldIndexes(e,s.collectionGroup)).next((a=>(r.set(s.collectionGroup,a),ae.forEach(a,(c=>this.zn(e,s,c).next((l=>{const d=this.jn(i,c);return l.isEqual(d)?ae.resolve():this.Jn(e,i,c,l,d)})))))))}))}
92Hn(e,n,r,s){return Wh(e).put(s.Rn(this.uid,this.$n(r,n.key),n.key))}Yn(e,n,r,s){return Wh(e).delete(s.Vn(this.uid,this.$n(r,n.key),n.key))}zn(e,n,r){const s=Wh(e);let i=new Ln(El);return s.ee({index:Fq,range:IDBKeyRange.only([r.indexId,this.uid,tw(this.$n(r,n))])},((o,a)=>{i=i.add(new fd(r.indexId,n,$M(a.arrayValue),$M(a.directionalValue)))})).next((()=>i))}jn(e,n){let r=new Ln(El);const s=this.Qn(n,e);if(s==null)return r;const i=MA(n);if(i!=null){const o=e.data.field(i.fieldPath);if(__(o))for(const a of o.arrayValue.values||[])r=r.add(new fd(n.indexId,e.key,this.Ln(a),s))}else r=r.add(new fd(n.indexId,e.key,_b,s));return r}Jn(e,n,r,s,i){Le(qM,"Updating index entries for document '%s'",n.key);const o=[];return(function(c,l,d,h,p){const g=c.getIterator(),_=l.getIterator();let v=qh(g),b=qh(_);for(;v||b;){let w=!1,E=!1;if(v&&b){const T=d(v,b);T<0?E=!0:T>0&&(w=!0)}else v!=null?E=!0:w=!0;w?(h(b),b=qh(_)):E?(p(v),v=qh(g)):(v=qh(g),b=qh(_))}})(s,i,El,(a=>{o.push(this.Hn(e,n,r,a))}),(a=>{o.push(this.Yn(e,n,r,a))})),ae.waitFor(o)}Gn(e){let n=1;return Gh(e).ee({index:Vq,reverse:!0,range:IDBKeyRange.upperBound([this.uid,Number.MAX_SAFE_INTEGER])},((r,s,i)=>{i.done(),n=s.sequenceNumber+1})).next((()=>n))}createRange(e,n,r){r=r.sort(((o,a)=>El(o,a))).filter(((o,a,c)=>!a||El(o,c[a-1])!==0));const s=[];
vendor: 11,619 bytes, line 92
92s.push(e);for(const o of r){const a=El(o,e),c=El(o,n);if(a===0)s[0]=e.An();else if(a>0&&c<0)s.push(o),s.push(o.An());else if(c>0)break}s.push(n);const i=[];for(let o=0;o<s.length;o+=2){if(this.Zn(s[o],s[o+1]))return[];const a=s[o].Vn(this.uid,_b,Ge.empty()),c=s[o+1].Vn(this.uid,_b,Ge.empty());i.push(IDBKeyRange.bound(a,c))}return i}Zn(e,n){return El(e,n)>0}getMinOffsetFromCollectionGroup(e,n){return this.getFieldIndexes(e,n).next(WM)}getMinOffset(e,n){return ae.mapArray(this.Mn(n),(r=>this.xn(e,r).next((s=>s||Xe(44426))))).next(WM)}}function jM(t){return Zr(t,h_)}function Wh(t){return Zr(t,Rg)}function Gm(t){return Zr(t,Ck)}function Gh(t){return Zr(t,Ag)}function WM(t){st(t.length!==0,28825);let e=t[0].indexState.offset,n=e.largestBatchId;for(let r=1;r<t.length;r++){const s=t[r].indexState.offset;Tk(s,e)<0&&(e=s),n<s.largestBatchId&&(n=s.largestBatchId)}return new Hi(e.readTime,e.documentKey,n)}const GM={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},qj=41943040;class Is{static withCacheSize(e){return new Is(e,Is.DEFAULT_COLLECTION_PERCENTILE,Is.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,n,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=n,this.maximumSequenceNumbersToCollect=r}}function jj(t,e,n){const r=t.store(No),s=t.store(Wf),i=[],o=IDBKeyRange.only(n.batchId);let a=0;const c=r.ee({range:o},((d,h,p)=>(a++,p.delete())));i.push(c.next((()=>{st(a===1,47070,{batchId:n.batchId})})));const l=[];for(const d of n.mutations){const h=xq(e,d.key.path,n.batchId);i.push(s.delete(h)),l.push(d.key)}return ae.waitFor(i).next((()=>l))}function lS(t){if(!t)return 0;let e;if(t.document)e=t.document;else if(t.unknownDocument)e=t.unknownDocument;else{if(!t.noDocument)throw Xe(14731);e=t.noDocument}return JSON.stringify(e).length}Is.DEFAULT_COLLECTION_PERCENTILE=10,Is.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Is.DEFAULT=new Is(qj,Is.DEFAULT_COLLECTION_PERCENTILE,Is.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Is.DISABLED=new Is(-1,0,0);class nE{constructor(e,n,r,s){this.userId=e,this.serializer=n,this.indexManager=r,this.referenceDelegate=s,this.Xn={}}static wt(e,n,r,s){st(e.uid!=="",64387);const i=e.isAuthenticated()?e.uid:"";return new nE(i,n,r,s)}checkEmpty(e){let n=!0;const r=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return Il(e).ee({index:_d,range:r},((s,i,o)=>{n=!1,o.done()})).next((()=>n))}addMutationBatch(e,n,r,s){const i=cf(e),o=Il(e);return o.add({}).next((a=>{st(typeof a=="number",49019);const c=new Mk(a,n,r,s),l=(function(g,_,v){const b=v.baseMutations.map((E=>b_(g.yt,E))),w=v.mutations.map((E=>b_(g.yt,E)));return{userId:_,batchId:v.batchId,localWriteTimeMs:v.localWriteTime.toMillis(),baseMutations:b,mutations:w}})(this.serializer,this.userId,c),d=[];let h=new Ln(((p,g)=>Et(p.canonicalString(),g.canonicalString())));for(const p of s){const g=xq(this.userId,p.key.path,a);h=h.add(p.key.path.popLast()),d.push(o.put(l)),d.push(i.put(g,Ode))}return h.forEach((p=>{d.push(this.indexManager.addToCollectionParentIndex(e,p))})),e.addOnCommittedListener((()=>{this.Xn[a]=c.keys()})),ae.waitFor(d).next((()=>c))}))}lookupMutationBatch(e,n){return Il(e).get(n).next((r=>r?(st(r.userId===this.userId,48,"Unexpected user for mutation batch",{userId:r.userId,batchId:n}),dd(this.serializer,r)):null))}er(e,n){return this.Xn[n]?ae.resolve(this.Xn[n]):this.lookupMutationBatch(e,n).next((r=>{if(r){const s=r.keys();return this.Xn[n]=s,s}return null}))}getNextMutationBatchAfterBatchId(e,n){const r=n+1,s=IDBKeyRange.lowerBound([this.userId,r]);let i=null;return Il(e).ee({index:_d,range:s},((o,a,c)=>{a.userId===this.userId&&(st(a.batchId>=r,47524,{tr:r}),i=dd(this.serializer,a)),c.done()})).next((()=>i))}getHighestUnacknowledgedBatchId(e){const n=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]);let r=Od;return Il(e).ee({index:_d,range:n,reverse:!0},((s,i,o)=>{r=i.batchId,o.done()})).next((()=>r))}getAllMutationBatches(e){const n=IDBKeyRange.bound([this.userId,Od],[this.userId,Number.POSITIVE_INFINITY]);return Il(e).J(_d,n).next((r=>r.map((s=>dd(this.serializer,s)))))}getAllMutationBatchesAffectingDocumentKey(e,n){const r=zb(this.userId,n.path),s=IDBKeyRange.lowerBound(r),i=[];return cf(e).ee({range:s},((o,a,c)=>{const[l,d,h]=o,p=ba(d);if(l===this.userId&&n.path.isEqual(p))return Il(e).get(h).next((g=>{if(!g)throw Xe(61480,{nr:o,batchId:h});st(g.userId===this.userId,10503,"Unexpected user for mutation batch",{userId:g.userId,batchId:h}),i.push(dd(this.serializer,g))}));c.done()})).next((()=>i))}getAllMutationBatchesAffectingDocumentKeys(e,n){let r=new Ln(Et);const s=[];return n.forEach((i=>{const o=zb(this.userId,i.path),a=IDBKeyRange.lowerBound(o),c=cf(e).ee({range:a},((l,d,h)=>{const[p,g,_]=l,v=ba(g);p===this.userId&&i.path.isEqual(v)?r=r.add(_):h.done()}));s.push(c)})),ae.waitFor(s).next((()=>this.rr(e,r)))}getAllMutationBatchesAffectingQuery(e,n){const r=n.path,s=r.length+1,i=zb(this.userId,r),o=IDBKeyRange.lowerBound(i);let a=new Ln(Et);return cf(e).ee({range:o},((c,l,d)=>{const[h,p,g]=c,_=ba(p);h===this.userId&&r.isPrefixOf(_)?_.length===s&&(a=a.add(g)):d.done()})).next((()=>this.rr(e,a)))}rr(e,n){const r=[],s=[];return n.forEach((i=>{s.push(Il(e).get(i).next((o=>{if(o===null)throw Xe(35274,{batchId:i});st(o.userId===this.userId,9748,"Unexpected user for mutation batch",{userId:o.userId,batchId:i}),r.push(dd(this.serializer,o))})))})),ae.waitFor(s).next((()=>r))}removeMutationBatch(e,n){return jj(e.le,this.userId,n).next((r=>(e.addOnCommittedListener((()=>{this.ir(n.batchId)})),ae.forEach(r,(s=>this.referenceDelegate.markPotentiallyOrphaned(e,s))))))}ir(e){delete this.Xn[e]}performConsistencyCheck(e){return this.checkEmpty(e).next((n=>{if(!n)return ae.resolve();const r=IDBKeyRange.lowerBound((function(o){return[o]})(this.userId)),s=[];return cf(e).ee({range:r},((i,o,a)=>{if(i[0]===this.userId){const c=ba(i[1]);s.push(c)}else a.done()})).next((()=>{st(s.length===0,56720,{sr:s.map((i=>i.canonicalString()))})}))}))}containsKey(e,n){return Wj(e,this.userId,n)}_r(e){return Gj(e).get(this.userId).next((n=>n||{userId:this.userId,lastAcknowledgedBatchId:Od,lastStreamToken:""}))}}function Wj(t,e,n){const r=zb(e,n.path),s=r[1],i=IDBKeyRange.lowerBound(r);let o=!1;return cf(t).ee({range:i,X:!0},((a,c,l)=>{const[d,h,p]=a;d===e&&h===s&&(o=!0),l.done()})).next((()=>o))}function Il(t){return Zr(t,No)}function cf(t){return Zr(t,Wf)}function Gj(t){return Zr(t,u_)}class Qd{constructor(e){this.ar=e}next(){return this.ar+=2,this.ar}static ur(){return new Qd(0)}static cr(){return new Qd(-1)}}class nfe{constructor(e,n){this.referenceDelegate=e,this.serializer=n}allocateTargetId(e){return this.lr(e).next((n=>{const r=new Qd(n.highestTargetId);return n.highestTargetId=r.next(),this.hr(e,n).next((()=>n.highestTargetId))}))}getLastRemoteSnapshotVersion(e){return this.lr(e).next((n=>ct.fromTimestamp(new an(n.lastRemoteSnapshotVersion.seconds,n.lastRemoteSnapshotVersion.nanoseconds))))}getHighestSequenceNumber(e){return this.lr(e).next((n=>n.highestListenSequenceNumber))}setTargetsMetadata(e,n,r){return this.lr(e).next((s=>(s.highestListenSequenceNumber=n,r&&(s.lastRemoteSnapshotVersion=r.toTimestamp()),n>s.highestListenSequenceNumber&&(s.highestListenSequenceNumber=n),this.hr(e,s))))}addTargetData(e,n){return this.Pr(e,n).next((()=>this.lr(e).next((r=>(r.targetCount+=1,this.Tr(n,r),this.hr(e,r))))))}updateTargetData(e,n){return this.Pr(e,n)}removeTargetData(e,n){return this.removeMatchingKeysForTargetId(e,n.targetId).next((()=>Kh(e).delete(n.targetId))).next((()=>this.lr(e))).next((r=>(st(r.targetCount>0,8065),r.targetCount-=1,this.hr(e,r))))}removeTargets(e,n,r){let s=0;const i=[];return Kh(e).ee(((o,a)=>{const c=dg(a);c.sequenceNumber<=n&&r.get(c.targetId)===null&&(s++,i.push(this.removeTargetData(e,c)))})).next((()=>ae.waitFor(i))).next((()=>s))}forEachTarget(e,n){return Kh(e).ee(((r,s)=>{const i=dg(s);n(i)}))}lr(e){return KM(e).get(rS).next((n=>(st(n!==null,2888),n)))}hr(e,n){return KM(e).put(rS,n)}Pr(e,n){return Kh(e).put(Bj(this.serializer,n))}Tr(e,n){let r=!1;return e.targetId>n.highestTargetId&&(n.highestTargetId=e.targetId,r=!0),e.sequenceNumber>n.highestListenSequenceNumber&&(n.highestListenSequenceNumber=e.sequenceNumber,r=!0),r}getTargetCount(e){return this.lr(e).next((n=>n.targetCount))}getTargetData(e,n){const r=zd(n),s=IDBKeyRange.bound([r,Number.NEGATIVE_INFINITY],[r,Number.POSITIVE_INFINITY]);let i=null;return Kh(e).ee({range:s,index:Mq},((o,a,c)=>{const l=dg(a);ly(n,l.target)&&(i=l,c.done())})).next((()=>i))}addMatchingKeys(e,n,r){const s=[],i=Ml(e);return n.forEach((o=>{const a=Ds(o.path);s.push(i.put({targetId:r,path:a})),s.push(this.referenceDelegate.addReference(e,r,o))})),ae.waitFor(s)}removeMatchingKeys(e,n,r){const s=Ml(e);return ae.forEach(n,(i=>{const o=Ds(i.path);return ae.waitFor([s.delete([r,o]),this.referenceDelegate.removeReference(e,r,i)])}))}removeMatchingKeysForTargetId(e,n){const r=Ml(e),s=IDBKeyRange.bound([n],[n+1],!1,!0);return r.delete(s)}getMatchingKeysForTargetId(e,n){const r=IDBKeyRange.bound([n],[n+1],!1,!0),s=Ml(e);let i=Vt();return s.ee({range:r,X:!0},((o,a,c)=>{const l=ba(o[1]),d=new Ge(l);i=i.add(d)})).next((()=>i))}containsKey(e,n){const r=Ds(n.path),s=IDBKeyRange.bound([r],[Iq(r)],!1,!0);let i=0;return Ml(e).ee({index:Ik,X:!0,range:s},(([o,a],c,l)=>{o!==0&&(i++,l.done())})).next((()=>i>0))}At(e,n){return Kh(e).get(n).next((r=>r?dg(r):null))}}function Kh(t){return Zr(t,Gf)}function KM(t){return Zr(t,xd)}function Ml(t){return Zr(t,Kf)}const zM="LruGarbageCollector",Kj=1048576;function YM([t,e],[n,r]){const s=Et(t,n);return s===0?Et(e,r):s}class rfe{constructor(e){this.Ir=e,this.buffer=new Ln(YM),this.Er=0}dr(){return++this.Er}Ar(e){const n=[e,this.dr()];if(this.buffer.size<this.Ir)this.buffer=this.buffer.add(n);else{const r=this.buffer.last();YM(n,r)<0&&(this.buffer=this.buffer.delete(r).add(n))}}get maxValue(){return this.buffer.last()[0]}}class zj{constructor(e,n,r){this.garbageCollector=e,this.asyncQueue=n,this.localStore=r,this.Rr=null}start(){this.garbageCollector.params.cacheSizeCollectionThreshold!==-1&&this.Vr(6e4)}stop(){this.Rr&&(this.Rr.cancel(),this.Rr=null)}get started(){return this.Rr!==null}Vr(e){Le(zM,`Garbage collection scheduled in ${e}ms`),this.Rr=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,(async()=>{this.Rr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(n){Iu(n)?Le(zM,"Ignoring IndexedDB error during garbage collection: ",n):await Eu(n)}await this.Vr(3e5)}))}}class sfe{constructor(e,n){this.mr=e,this.params=n}calculateTargetCount(e,n){return this.mr.gr(e).next((r=>Math.floor(n/100*r)))}nthSequenceNumber(e,n){if(n===0)return ae.resolve(hi.ce);const r=new rfe(n);return this.mr.forEachTarget(e,(s=>r.Ar(s.sequenceNumber))).next((()=>this.mr.pr(e,(s=>r.Ar(s))))).next((()=>r.maxValue))}removeTargets(e,n,r){return this.mr.removeTargets(e,n,r)}removeOrphanedDocuments(e,n){return this.mr.removeOrphanedDocuments(e,n)}collect(e,n){return this.params.cacheSizeCollectionThreshold===-1?(Le("LruGarbageCollector","Garbage collection skipped; disabled"),ae.resolve(GM)):this.getCacheSize(e).next((r=>r<this.params.cacheSizeCollectionThreshold?(Le("LruGarbageCollector",`Garbage collection skipped; Cache size ${r} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),GM):this.yr(e,n)))}getCacheSize(e){return this.mr.getCacheSize(e)}yr(e,n){let r,s,i,o,a,c,l;const d=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next((h=>(h>this.params.maximumSequenceNumbersToCollect?(Le("LruGarbageCollector",`C
92apping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${h}`),s=this.params.maximumSequenceNumbersToCollect):s=h,o=Date.now(),this.nthSequenceNumber(e,s)))).next((h=>(r=h,a=Date.now(),this.removeTargets(e,r,n)))).next((h=>(i=h,c=Date.now(),this.removeOrphanedDocuments(e,r)))).next((h=>(l=Date.now(),rf()<=Gt.DEBUG&&Le("LruGarbageCollector",`LRU Garbage Collection 93 Counted targets in ${o-d}ms 94 Determined least recently used ${s} in `+(a-o)+`ms 95 Removed ${i} targets in `+(c-a)+`ms 96 Removed ${h} documents in `+(l-c)+`ms 97Total Duration: ${l-d}ms`),ae.resolve({didRun:!0,sequenceNumbersCollected:s,targetsRemoved:i,documentsRemoved:h}))))}}function Yj(t,e){return new sfe(t,e)}class ife{constructor(e,n){this.db=e,this.garbageCollector=Yj(this,n)}gr(e){const n=this.wr(e);return this.db.getTargetCache().getTargetCount(e).next((r=>n.next((s=>r+s))))}wr(e){let n=0;return this.pr(e,(r=>{n++})).next((()=>n))}forEachTarget(e,n){return this.db.getTargetCache().forEachTarget(e,n)}pr(e,n){return this.Sr(e,((r,s)=>n(s)))}addReference(e,n,r){return yb(e,r)}removeReference(e,n,r){return yb(e,r)}removeTargets(e,n,r){return this.db.getTargetCache().removeTargets(e,n,r)}markPotentiallyOrphaned(e,n){return yb(e,n)}br(e,n){return(function(s,i){let o=!1;return Gj(s).te((a=>Wj(s,a,i).next((c=>(c&&(o=!0),ae.resolve(!c)))))).next((()=>o))})(e,n)}removeOrphanedDocuments(e,n){const r=this.db.getRemoteDocumentCache().newChangeBuffer(),s=[];let i=0;return this.Sr(e,((o,a)=>{if(a<=n){const c=this.br(e,o).next((l=>{if(!l)return i++,r.getEntry(e,o).next((()=>(r.removeEntry(o,ct.min()),Ml(e).delete((function(h){return[0,Ds(h.path)]})(o)))))}));s.push(c)}})).next((()=>ae.waitFor(s))).next((()=>r.apply(e))).next((()=>i))}removeTarget(e,n){const r=n.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,r)}updateLimboDocument(e,n){return yb(e,n)}Sr(e,n){const r=Ml(e);let s,i=hi.ce;return r.ee({index:Ik},(([o,a],{path:c,sequenceNumber:l})=>{o===0?(i!==hi.ce&&n(new Ge(ba(s)),i),i=l,s=c):i=hi.ce})).next((()=>{i!==hi.ce&&n(new Ge(ba(s)),i)}))}getCacheSize(e){return this.db.getRemoteDocumentCache().getSize(e)}}function yb(t,e){return Ml(t).put((function(r,s){return{targetId:0,path:Ds(r.path),sequenceNumber:s}})(e,t.currentSequenceNumber))}class Jj{constructor(){this.changes=new rl((e=>e.toString()),((e,n)=>e.isEqual(n))),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,n){this.assertNotApplied(),this.changes.set(e,sr.newInvalidDocument(e).setReadTime(n))}getEntry(e,n){this.assertNotApplied();const r=this.changes.get(n);return r!==void 0?ae.resolve(r):this.getFromCache(e,n)}getEntries(e,n){return this.getAllFromCache(e,n)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}class ofe{constructor(e){this.serializer=e}setIndexManager(e){this.indexManager=e}addEntry(e,n,r){return Xu(e).put(r)}removeEntry(e,n,r){return Xu(e).delete((function(i,o){const a=i.path.toArray();return[a.slice(0,a.length-2),a[a.length-2],aS(o),a[a.length-1]]})(n,r))}updateMetadata(e,n){return this.getMetadata(e).next((r=>(r.byteSize+=n,this.Dr(e,r))))}getEntry(e,n){let r=sr.newInvalidDocument(n);return Xu(e).ee({index:Yb,range:IDBKeyRange.only(Km(n))},((s,i)=>{r=this.Cr(n,i)})).next((()=>r))}vr(e,n){let r={size:0,document:sr.newInvalidDocument(n)};return Xu(e).ee({index:Yb,range:IDBKeyRange.only(Km(n))},((s,i)=>{r={document:this.Cr(n,i),size:lS(i)}})).next((()=>r))}getEntries(e,n){let r=Li();return this.Fr(e,n,((s,i)=>{const o=this.Cr(s,i);r=r.insert(s,o)})).next((()=>r))}Mr(e,n){let r=Li(),s=new ur(Ge.comparator);return this.Fr(e,n,((i,o)=>{const a=this.Cr(i,o);r=r.insert(i,a),s=s.insert(i,lS(o))})).next((()=>({documents:r,Or:s})))}Fr(e,n,r){if(n.isEmpty())return ae.resolve();let s=new Ln(XM);n.forEach((c=>s=s.add(c)));const i=IDBKeyRange.bound(Km(s.first()),Km(s.last())),o=s.getIterator();let a=o.getNext();return Xu(e).ee({index:Yb,range:i},((c,l,d)=>{const h=Ge.fromSegments([...l.prefixPath,l.collectionGroup,l.documentId]);for(;a&&XM(a,h)<0;)r(a,null),a=o.getNext();a&&a.isEqual(h)&&(r(a,l),a=o.hasNext()?o.getNext():null),a?d.j(Km(a)):d.done()})).next((()=>{for(;a;)r(a,null),a=o.hasNext()?o.getNext():null}))}getDocumentsMatchingQuery(e,n,r,s,i){const o=n.path,a=[o.popLast().toArray(),o.lastSegment(),aS(r.readTime),r.documentKey.path.isEmpty()?"":r.documentKey.path.lastSegment()],c=[o.popLast().toArray(),o.lastSegment(),[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],""];return Xu(e).J(IDBKeyRange.bound(a,c,!0)).next((l=>{i?.incrementDocumentReadCount(l.length);let d=Li();for(const h of l){const p=this.Cr(Ge.fromSegments(h.prefixPath.concat(h.collectionGroup,h.documentId)),h);
vendor: 4,620 bytes, line 97
97p.isFoundDocument()&&(hy(n,p)||s.has(p.key))&&(d=d.insert(p.key,p))}return d}))}getAllFromCollectionGroup(e,n,r,s){let i=Li();const o=QM(n,r),a=QM(n,Hi.max());return Xu(e).ee({index:Lq,range:IDBKeyRange.bound(o,a,!0)},((c,l,d)=>{const h=this.Cr(Ge.fromSegments(l.prefixPath.concat(l.collectionGroup,l.documentId)),l);i=i.insert(h.key,h),i.size===s&&d.done()})).next((()=>i))}newChangeBuffer(e){return new afe(this,!!e&&e.trackRemovals)}getSize(e){return this.getMetadata(e).next((n=>n.byteSize))}getMetadata(e){return JM(e).get(VA).next((n=>(st(!!n,20021),n)))}Dr(e,n){return JM(e).put(VA,n)}Cr(e,n){if(n){const r=Ghe(this.serializer,n);if(!(r.isNoDocument()&&r.version.isEqual(ct.min())))return r}return sr.newInvalidDocument(e)}}function Qj(t){return new ofe(t)}class afe extends Jj{constructor(e,n){super(),this.Nr=e,this.trackRemovals=n,this.Br=new rl((r=>r.toString()),((r,s)=>r.isEqual(s)))}applyChanges(e){const n=[];let r=0,s=new Ln(((i,o)=>Et(i.canonicalString(),o.canonicalString())));return this.changes.forEach(((i,o)=>{const a=this.Br.get(i);if(n.push(this.Nr.removeEntry(e,i,a.readTime)),o.isValidDocument()){const c=OM(this.Nr.serializer,o);s=s.add(i.path.popLast());const l=lS(c);r+=l-a.size,n.push(this.Nr.addEntry(e,i,c))}else if(r-=a.size,this.trackRemovals){const c=OM(this.Nr.serializer,o.convertToNoDocument(ct.min()));n.push(this.Nr.addEntry(e,i,c))}})),s.forEach((i=>{n.push(this.Nr.indexManager.addToCollectionParentIndex(e,i))})),n.push(this.Nr.updateMetadata(e,r)),ae.waitFor(n)}getFromCache(e,n){return this.Nr.vr(e,n).next((r=>(this.Br.set(n,{size:r.size,readTime:r.document.readTime}),r.document)))}getAllFromCache(e,n){return this.Nr.Mr(e,n).next((({documents:r,Or:s})=>(s.forEach(((i,o)=>{this.Br.set(i,{size:o,readTime:r.get(i).readTime})})),r)))}}function JM(t){return Zr(t,d_)}function Xu(t){return Zr(t,nS)}function Km(t){const e=t.path.toArray();return[e.slice(0,e.length-2),e[e.length-2],e[e.length-1]]}function QM(t,e){const n=e.documentKey.path.toArray();return[t,aS(e.readTime),n.slice(0,n.length-2),n.length>0?n[n.length-1]:""]}function XM(t,e){const n=t.path.toArray(),r=e.path.toArray();let s=0;for(let i=0;i<n.length-2&&i<r.length-2;++i)if(s=Et(n[i],r[i]),s)return s;return s=Et(n.length,r.length),s||(s=Et(n[n.length-2],r[r.length-2]),s||Et(n[n.length-1],r[r.length-1]))}class cfe{constructor(e,n){this.overlayedDocument=e,this.mutatedFields=n}}class Xj{constructor(e,n,r,s){this.remoteDocumentCache=e,this.mutationQueue=n,this.documentOverlayCache=r,this.indexManager=s}getDocument(e,n){let r=null;return this.documentOverlayCache.getOverlay(e,n).next((s=>(r=s,this.remoteDocumentCache.getEntry(e,n)))).next((s=>(r!==null&&Dg(r.mutation,s,fi.empty(),an.now()),s)))}getDocuments(e,n){return this.remoteDocumentCache.getEntries(e,n).next((r=>this.getLocalViewOfDocuments(e,r,Vt()).next((()=>r))))}getLocalViewOfDocuments(e,n,r=Vt()){const s=wa();return this.populateOverlays(e,s,n).next((()=>this.computeViews(e,n,s,r).next((i=>{let o=lg();return i.forEach(((a,c)=>{o=o.insert(a,c.overlayedDocument)})),o}))))}getOverlayedDocuments(e,n){const r=wa();return this.populateOverlays(e,r,n).next((()=>this.computeViews(e,n,r,Vt())))}populateOverlays(e,n,r){const s=[];return r.forEach((i=>{n.has(i)||s.push(i)})),this.documentOverlayCache.getOverlays(e,s).next((i=>{i.forEach(((o,a)=>{n.set(o,a)}))}))}computeViews(e,n,r,s){let i=Li();const o=Ng(),a=(function(){return Ng()})();return n.forEach(((c,l)=>{const d=r.get(l.key);s.has(l.key)&&(d===void 0||d.mutation instanceof sl)?i=i.insert(l.key,l):d!==void 0?(o.set(l.key,d.mutation.getFieldMask()),Dg(d.mutation,l,d.mutation.getFieldMask(),an.now())):o.set(l.key,fi.empty())})),this.recalculateAndSaveOverlays(e,i).next((c=>(c.forEach(((l,d)=>o.set(l,d))),n.forEach(((l,d)=>a.set(l,new cfe(d,o.get(l)??null)))),a)))}recalculateAndSaveOverlays(e,n){const r=Ng();let s=new ur(((o,a)=>o-a)),i=Vt();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,n).next((o=>{for(const a of o)a.keys().forEach((c=>{const l=n.get(c);if(l===null)return;let d=r.get(c)||fi.empty();d=a.applyToLocalView(l,d),r.set(c,d);const h=(s.get(a.batchId)||Vt()).add(c);s=s.insert(a.batchId,h)}))})).next((()=>{const o=[],a=s.getReverseIterator();for(;a.hasNext();){const c=a.getNext(),l=c.key,d=c.value,h=pj();d.forEach((p=>{if(!i.has(p)){const g=wj(n.get(p),r.get(p));g!==null&&h.set(p,g),i=i.add(p)}})),o.push(this.documentOverlayCache.saveOverlays(e,l,h))}return ae.waitFor(o)})).next((()=>r))}recalculateAndSaveOverlaysForDocumentKeys(e,n){return this.remoteDocumentCache.getEntries(e,n).next((r=>this.recalculateAndSaveOverlays(e,r)))}
97getDocumentsMatchingQuery(e,n,r,s){return(function(o){return Ge.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0})(n)?this.getDocumentsMatchingDocumentQuery(e,n.path):cj(n)?this.getDocumentsMatchingCollectionGroupQuery(e,n,r,s):this.getDocumentsMatchingCollectionQuery(e,n,r,s)}getNextDocuments(e,n,r,s){return this.remoteDocumentCache.getAllFromCollectionGroup(e,n,r,s).next((i=>{const o=s-i.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,n,r.largestBatchId,s-i.size):ae.resolve(wa());let a=jf,c=i;return o.next((l=>ae.forEach(l,((d,h)=>(a<h.largestBatchId&&(a=h.largestBatchId),i.get(d)?ae.resolve():this.remoteDocumentCache.getEntry(e,d).next((p=>{c=c.insert(d,p)}))))).next((()=>this.populateOverlays(e,l,i))).next((()=>this.computeViews(e,c,l,Vt()))).next((d=>({batchId:a,changes:fj(d)})))))}))}getDocumentsMatchingDocumentQuery(e,n){return this.getDocument(e,new Ge(n)).next((r=>{let s=lg();return r.isFoundDocument()&&(s=s.insert(r.key,r)),s}))}getDocumentsMatchingCollectionGroupQuery(e,n,r,s){const i=n.collectionGroup;let o=lg();return this.indexManager.getCollectionParents(e,i).next((a=>ae.forEach(a,(c=>{const l=(function(h,p){return new uy(p,null,h.explicitOrderBy.slice(),h.filters.slice(),h.limit,h.limitType,h.startAt,h.endAt)})(n,c.child(i));return this.getDocumentsMatchingCollectionQuery(e,l,r,s).next((d=>{d.forEach(((h,p)=>{o=o.insert(h,p)}))}))})).next((()=>o))))}getDocumentsMatchingCollectionQuery(e,n,r,s){let i;return this.documentOverlayCache.getOverlaysForCollection(e,n.path,r.largestBatchId).next((o=>(i=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,n,r,i,s)))).next((o=>{i.forEach(((c,l)=>{const d=l.getKey();o.get(d)===null&&(o=o.insert(d,sr.newInvalidDocument(d)))}));let a=lg();return o.forEach(((c,l)=>{const d=i.get(c);d!==void 0&&Dg(d.mutation,l,fi.empty(),an.now()),hy(n,l)&&(a=a.insert(c,l))})),a}))}}class lfe{constructor(e){this.serializer=e,this.Lr=new Map,this.kr=new Map}getBundleMetadata(e,n){return ae.resolve(this.Lr.get(n))}saveBundleMetadata(e,n){return this.Lr.set(n.id,(function(s){return{id:s.id,version:s.version,createTime:hs(s.createTime)}})(n)),ae.resolve()}getNamedQuery(e,n){return ae.resolve(this.kr.get(n))}saveNamedQuery(e,n){return this.kr.set(n.name,(function(s){return{name:s.name,query:$j(s.bundledQuery),readTime:hs(s.readTime)}})(n)),ae.resolve()}}class ufe{constructor(){this.overlays=new ur(Ge.comparator),this.qr=new Map}getOverlay(e,n){return ae.resolve(this.overlays.get(n))}getOverlays(e,n){const r=wa();return ae.forEach(n,(s=>this.getOverlay(e,s).next((i=>{i!==null&&r.set(s,i)})))).next((()=>r))}saveOverlays(e,n,r){return r.forEach(((s,i)=>{this.St(e,n,i)})),ae.resolve()}removeOverlaysForBatchId(e,n,r){const s=this.qr.get(r);return s!==void 0&&(s.forEach((i=>this.overlays=this.overlays.remove(i))),this.qr.delete(r)),ae.resolve()}getOverlaysForCollection(e,n,r){const s=wa(),i=n.length+1,o=new Ge(n.child("")),a=this.overlays.getIteratorFrom(o);for(;a.hasNext();){const c=a.getNext().value,l=c.getKey();if(!n.isPrefixOf(l.path))break;l.path.length===i&&c.largestBatchId>r&&s.set(c.getKey(),c)}return ae.resolve(s)}getOverlaysForCollectionGroup(e,n,r,s){let i=new ur(((l,d)=>l-d));const o=this.overlays.getIterator();for(;o.hasNext();){const l=o.getNext().value;if(l.getKey().getCollectionGroup()===n&&l.largestBatchId>r){let d=i.get(l.largestBatchId);d===null&&(d=wa(),i=i.insert(l.largestBatchId,d)),d.set(l.getKey(),l)}}const a=wa(),c=i.getIterator();for(;c.hasNext()&&(c.getNext().value.forEach(((l,d)=>a.set(l,d))),!(a.size()>=s)););return ae.resolve(a)}St(e,n,r){const s=this.overlays.get(r.key);if(s!==null){const o=this.qr.get(s.largestBatchId).delete(r.key);this.qr.set(s.largestBatchId,o)}this.overlays=this.overlays.insert(r.key,new Fk(n,r));let i=this.qr.get(n);i===void 0&&(i=Vt(),this.qr.set(n,i)),this.qr.set(n,i.add(r.key))}}class dfe{constructor(){this.sessionToken=Lr.EMPTY_BYTE_STRING}getSessionToken(e){return ae.resolve(this.sessionToken)}setSessionToken(e,n){return this.sessionToken=n,ae.resolve()}}class qk{constructor(){this.Qr=new Ln(is.$r),this.Ur=new Ln(is.Kr)}isEmpty(){return this.Qr.isEmpty()}addReference(e,n){const r=new is(e,n);this.Qr=this.Qr.add(r),this.Ur=this.Ur.add(r)}Wr(e,n){e.forEach((r=>this.addReference(r,n)))}removeReference(e,n){this.Gr(new is(e,n))}zr(e,n){e.forEach((r=>this.removeReference(r,n)))}jr(e){const n=new Ge(new rn([])),r=new is(n,e),s=new is(n,e+1),i=[];return this.Ur.forEachInRange([r,s],(o=>{this.Gr(o),i.push(o.key)})),i}Jr(){this.Qr.forEach((e=>this.Gr(e)))}Gr(e){this.Qr=this.Qr.delete(e),this.Ur=this.Ur.delete(e)}Hr(e){const n=new Ge(new rn([])),r=new is(n,e),s=new is(n,e+1);let i=Vt();return this.Ur.forEachInRange([r,s],(o=>{i=i.add(o.key)})),i}
97containsKey(e){const n=new is(e,0),r=this.Qr.firstAfterOrEqual(n);return r!==null&&e.isEqual(r.key)}}class is{constructor(e,n){this.key=e,this.Yr=n}static $r(e,n){return Ge.comparator(e.key,n.key)||Et(e.Yr,n.Yr)}static Kr(e,n){return Et(e.Yr,n.Yr)||Ge.comparator(e.key,n.key)}}class hfe{constructor(e,n){this.indexManager=e,this.referenceDelegate=n,this.mutationQueue=[],this.tr=1,this.Zr=new Ln(is.$r)}checkEmpty(e){return ae.resolve(this.mutationQueue.length===0)}addMutationBatch(e,n,r,s){const i=this.tr;this.tr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new Mk(i,n,r,s);this.mutationQueue.push(o);for(const a of s)this.Zr=this.Zr.add(new is(a.key,i)),this.indexManager.addToCollectionParentIndex(e,a.key.path.popLast());return ae.resolve(o)}lookupMutationBatch(e,n){return ae.resolve(this.Xr(n))}getNextMutationBatchAfterBatchId(e,n){const r=n+1,s=this.ei(r),i=s<0?0:s;return ae.resolve(this.mutationQueue.length>i?this.mutationQueue[i]:null)}getHighestUnacknowledgedBatchId(){return ae.resolve(this.mutationQueue.length===0?Od:this.tr-1)}getAllMutationBatches(e){return ae.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,n){const r=new is(n,0),s=new is(n,Number.POSITIVE_INFINITY),i=[];return this.Zr.forEachInRange([r,s],(o=>{const a=this.Xr(o.Yr);i.push(a)})),ae.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(e,n){let r=new Ln(Et);return n.forEach((s=>{const i=new is(s,0),o=new is(s,Number.POSITIVE_INFINITY);this.Zr.forEachInRange([i,o],(a=>{r=r.add(a.Yr)}))})),ae.resolve(this.ti(r))}getAllMutationBatchesAffectingQuery(e,n){const r=n.path,s=r.length+1;let i=r;Ge.isDocumentKey(i)||(i=i.child(""));const o=new is(new Ge(i),0);let a=new Ln(Et);return this.Zr.forEachWhile((c=>{const l=c.key.path;return!!r.isPrefixOf(l)&&(l.length===s&&(a=a.add(c.Yr)),!0)}),o),ae.resolve(this.ti(a))}ti(e){const n=[];return e.forEach((r=>{const s=this.Xr(r);s!==null&&n.push(s)})),n}removeMutationBatch(e,n){st(this.ni(n.batchId,"removed")===0,55003),this.mutationQueue.shift();let r=this.Zr;return ae.forEach(n.mutations,(s=>{const i=new is(s.key,n.batchId);return r=r.delete(i),this.referenceDelegate.markPotentiallyOrphaned(e,s.key)})).next((()=>{this.Zr=r}))}ir(e){}containsKey(e,n){const r=new is(n,0),s=this.Zr.firstAfterOrEqual(r);return ae.resolve(n.isEqual(s&&s.key))}performConsistencyCheck(e){return this.mutationQueue.length,ae.resolve()}ni(e,n){return this.ei(e)}ei(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Xr(e){const n=this.ei(e);return n<0||n>=this.mutationQueue.length?null:this.mutationQueue[n]}}class ffe{constructor(e){this.ri=e,this.docs=(function(){return new ur(Ge.comparator)})(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,n){const r=n.key,s=this.docs.get(r),i=s?s.size:0,o=this.ri(n);return this.docs=this.docs.insert(r,{document:n.mutableCopy(),size:o}),this.size+=o-i,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const n=this.docs.get(e);n&&(this.docs=this.docs.remove(e),this.size-=n.size)}getEntry(e,n){const r=this.docs.get(n);return ae.resolve(r?r.document.mutableCopy():sr.newInvalidDocument(n))}getEntries(e,n){let r=Li();return n.forEach((s=>{const i=this.docs.get(s);r=r.insert(s,i?i.document.mutableCopy():sr.newInvalidDocument(s))})),ae.resolve(r)}getDocumentsMatchingQuery(e,n,r,s){let i=Li();const o=n.path,a=new Ge(o.child("__id-9223372036854775808__")),c=this.docs.getIteratorFrom(a);for(;c.hasNext();){const{key:l,value:{document:d}}=c.getNext();if(!o.isPrefixOf(l.path))break;l.path.length>o.length+1||Tk(Pq(d),r)<=0||(s.has(d.key)||hy(n,d))&&(i=i.insert(d.key,d.mutableCopy()))}return ae.resolve(i)}getAllFromCollectionGroup(e,n,r,s){Xe(9500)}ii(e,n){return ae.forEach(this.docs,(r=>n(r)))}newChangeBuffer(e){return new pfe(this)}getSize(e){return ae.resolve(this.size)}}class pfe extends Jj{constructor(e){super(),this.Nr=e}applyChanges(e){const n=[];
vendor: 4,700 bytes, line 97
97return this.changes.forEach(((r,s)=>{s.isValidDocument()?n.push(this.Nr.addEntry(e,s)):this.Nr.removeEntry(r)})),ae.waitFor(n)}getFromCache(e,n){return this.Nr.getEntry(e,n)}getAllFromCache(e,n){return this.Nr.getEntries(e,n)}}class mfe{constructor(e){this.persistence=e,this.si=new rl((n=>zd(n)),ly),this.lastRemoteSnapshotVersion=ct.min(),this.highestTargetId=0,this.oi=0,this._i=new qk,this.targetCount=0,this.ai=Qd.ur()}forEachTarget(e,n){return this.si.forEach(((r,s)=>n(s))),ae.resolve()}getLastRemoteSnapshotVersion(e){return ae.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return ae.resolve(this.oi)}allocateTargetId(e){return this.highestTargetId=this.ai.next(),ae.resolve(this.highestTargetId)}setTargetsMetadata(e,n,r){return r&&(this.lastRemoteSnapshotVersion=r),n>this.oi&&(this.oi=n),ae.resolve()}Pr(e){this.si.set(e.target,e);const n=e.targetId;n>this.highestTargetId&&(this.ai=new Qd(n),this.highestTargetId=n),e.sequenceNumber>this.oi&&(this.oi=e.sequenceNumber)}addTargetData(e,n){return this.Pr(n),this.targetCount+=1,ae.resolve()}updateTargetData(e,n){return this.Pr(n),ae.resolve()}removeTargetData(e,n){return this.si.delete(n.target),this._i.jr(n.targetId),this.targetCount-=1,ae.resolve()}removeTargets(e,n,r){let s=0;const i=[];return this.si.forEach(((o,a)=>{a.sequenceNumber<=n&&r.get(a.targetId)===null&&(this.si.delete(o),i.push(this.removeMatchingKeysForTargetId(e,a.targetId)),s++)})),ae.waitFor(i).next((()=>s))}getTargetCount(e){return ae.resolve(this.targetCount)}getTargetData(e,n){const r=this.si.get(n)||null;return ae.resolve(r)}addMatchingKeys(e,n,r){return this._i.Wr(n,r),ae.resolve()}removeMatchingKeys(e,n,r){this._i.zr(n,r);const s=this.persistence.referenceDelegate,i=[];return s&&n.forEach((o=>{i.push(s.markPotentiallyOrphaned(e,o))})),ae.waitFor(i)}removeMatchingKeysForTargetId(e,n){return this._i.jr(n),ae.resolve()}getMatchingKeysForTargetId(e,n){const r=this._i.Hr(n);return ae.resolve(r)}containsKey(e,n){return ae.resolve(this._i.containsKey(n))}}class jk{constructor(e,n){this.ui={},this.overlays={},this.ci=new hi(0),this.li=!1,this.li=!0,this.hi=new dfe,this.referenceDelegate=e(this),this.Pi=new mfe(this),this.indexManager=new efe,this.remoteDocumentCache=(function(s){return new ffe(s)})((r=>this.referenceDelegate.Ti(r))),this.serializer=new Fj(n),this.Ii=new lfe(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.li=!1,Promise.resolve()}get started(){return this.li}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let n=this.overlays[e.toKey()];return n||(n=new ufe,this.overlays[e.toKey()]=n),n}getMutationQueue(e,n){let r=this.ui[e.toKey()];return r||(r=new hfe(n,this.referenceDelegate),this.ui[e.toKey()]=r),r}getGlobalsCache(){return this.hi}getTargetCache(){return this.Pi}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Ii}runTransaction(e,n,r){Le("MemoryPersistence","Starting transaction:",e);const s=new gfe(this.ci.next());return this.referenceDelegate.Ei(),r(s).next((i=>this.referenceDelegate.di(s).next((()=>i)))).toPromise().then((i=>(s.raiseOnCommittedEvent(),i)))}Ai(e,n){return ae.or(Object.values(this.ui).map((r=>()=>r.containsKey(e,n))))}}class gfe extends Nq{constructor(e){super(),this.currentSequenceNumber=e}}class rE{constructor(e){this.persistence=e,this.Ri=new qk,this.Vi=null}static mi(e){return new rE(e)}get fi(){if(this.Vi)return this.Vi;throw Xe(60996)}addReference(e,n,r){return this.Ri.addReference(r,n),this.fi.delete(r.toString()),ae.resolve()}removeReference(e,n,r){return this.Ri.removeReference(r,n),this.fi.add(r.toString()),ae.resolve()}markPotentiallyOrphaned(e,n){return this.fi.add(n.toString()),ae.resolve()}removeTarget(e,n){this.Ri.jr(n.targetId).forEach((s=>this.fi.add(s.toString())));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,n.targetId).next((s=>{s.forEach((i=>this.fi.add(i.toString())))})).next((()=>r.removeTargetData(e,n)))}Ei(){this.Vi=new Set}di(e){const n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return ae.forEach(this.fi,(r=>{const s=Ge.fromPath(r);return this.gi(e,s).next((i=>{i||n.removeEntry(s,ct.min())}))})).next((()=>(this.Vi=null,n.apply(e))))}updateLimboDocument(e,n){return this.gi(e,n).next((r=>{r?this.fi.delete(n.toString()):this.fi.add(n.toString())}))}Ti(e){return 0}gi(e,n){return ae.or([()=>ae.resolve(this.Ri.containsKey(n)),()=>this.persistence.getTargetCache().containsKey(e,n),()=>this.persistence.Ai(e,n)])}}class uS{constructor(e,n){this.persistence=e,this.pi=new rl((r=>Ds(r.path)),((r,s)=>r.isEqual(s))),this.garbageCollector=Yj(this,n)}
97static mi(e,n){return new uS(e,n)}Ei(){}di(e){return ae.resolve()}forEachTarget(e,n){return this.persistence.getTargetCache().forEachTarget(e,n)}gr(e){const n=this.wr(e);return this.persistence.getTargetCache().getTargetCount(e).next((r=>n.next((s=>r+s))))}wr(e){let n=0;return this.pr(e,(r=>{n++})).next((()=>n))}pr(e,n){return ae.forEach(this.pi,((r,s)=>this.br(e,r,s).next((i=>i?ae.resolve():n(s)))))}removeTargets(e,n,r){return this.persistence.getTargetCache().removeTargets(e,n,r)}removeOrphanedDocuments(e,n){let r=0;const s=this.persistence.getRemoteDocumentCache(),i=s.newChangeBuffer();return s.ii(e,(o=>this.br(e,o,n).next((a=>{a||(r++,i.removeEntry(o,ct.min()))})))).next((()=>i.apply(e))).next((()=>r))}markPotentiallyOrphaned(e,n){return this.pi.set(n,e.currentSequenceNumber),ae.resolve()}removeTarget(e,n){const r=n.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,n,r){return this.pi.set(r,e.currentSequenceNumber),ae.resolve()}removeReference(e,n,r){return this.pi.set(r,e.currentSequenceNumber),ae.resolve()}updateLimboDocument(e,n){return this.pi.set(n,e.currentSequenceNumber),ae.resolve()}Ti(e){let n=e.key.toString().length;return e.isFoundDocument()&&(n+=Qb(e.data.value)),n}br(e,n,r){return ae.or([()=>this.persistence.Ai(e,n),()=>this.persistence.getTargetCache().containsKey(e,n),()=>{const s=this.pi.get(n);return ae.resolve(s!==void 0&&s>r)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}class _fe{constructor(e){this.serializer=e}k(e,n,r,s){const i=new GT("createOrUpgrade",n);r<1&&s>=1&&((function(c){c.createObjectStore(cy)})(e),(function(c){c.createObjectStore(u_,{keyPath:Dde}),c.createObjectStore(No,{keyPath:lM,autoIncrement:!0}).createIndex(_d,uM,{unique:!0}),c.createObjectStore(Wf)})(e),ZM(e),(function(c){c.createObjectStore(od)})(e));let o=ae.resolve();return r<3&&s>=3&&(r!==0&&((function(c){c.deleteObjectStore(Kf),c.deleteObjectStore(Gf),c.deleteObjectStore(xd)})(e),ZM(e)),o=o.next((()=>(function(c){const l=c.store(xd),d={highestTargetId:0,highestListenSequenceNumber:0,lastRemoteSnapshotVersion:ct.min().toTimestamp(),targetCount:0};return l.put(rS,d)})(i)))),r<4&&s>=4&&(r!==0&&(o=o.next((()=>(function(c,l){return l.store(No).J().next((h=>{c.deleteObjectStore(No),c.createObjectStore(No,{keyPath:lM,autoIncrement:!0}).createIndex(_d,uM,{unique:!0});const p=l.store(No),g=h.map((_=>p.put(_)));return ae.waitFor(g)}))})(e,i)))),o=o.next((()=>{(function(c){c.createObjectStore(zf,{keyPath:Ude})})(e)}))),r<5&&s>=5&&(o=o.next((()=>this.yi(i)))),r<6&&s>=6&&(o=o.next((()=>((function(c){c.createObjectStore(d_)})(e),this.wi(i))))),r<7&&s>=7&&(o=o.next((()=>this.Si(i)))),r<8&&s>=8&&(o=o.next((()=>this.bi(e,i)))),r<9&&s>=9&&(o=o.next((()=>{(function(c){c.objectStoreNames.contains("remoteDocumentChanges")&&c.deleteObjectStore("remoteDocumentChanges")})(e)}))),r<10&&s>=10&&(o=o.next((()=>this.Di(i)))),r<11&&s>=11&&(o=o.next((()=>{(function(c){c.createObjectStore(KT,{keyPath:Hde})})(e),(function(c){c.createObjectStore(zT,{keyPath:qde})})(e)}))),r<12&&s>=12&&(o=o.next((()=>{(function(c){const l=c.createObjectStore(YT,{keyPath:Jde});l.createIndex(BA,Qde,{unique:!1}),l.createIndex(Bq,Xde,{unique:!1})})(e)}))),r<13&&s>=13&&(o=o.next((()=>(function(c){const l=c.createObjectStore(nS,{keyPath:xde});l.createIndex(Yb,Lde),l.createIndex(Lq,Mde)})(e))).next((()=>this.Ci(e,i))).next((()=>e.deleteObjectStore(od)))),r<14&&s>=14&&(o=o.next((()=>this.Fi(e,i)))),r<15&&s>=15&&(o=o.next((()=>(function(c){c.createObjectStore(Ck,{keyPath:jde,autoIncrement:!0}).createIndex(FA,Wde,{unique:!1}),c.createObjectStore(Ag,{keyPath:Gde}).createIndex(Vq,Kde,{unique:!1}),c.createObjectStore(Rg,{keyPath:zde}).createIndex(Fq,Yde,{unique:!1})})(e)))),r<16&&s>=16&&(o=o.next((()=>{n.objectStore(Ag).clear()}
vendor: 4,209 bytes, line 97
97)).next((()=>{n.objectStore(Rg).clear()}))),r<17&&s>=17&&(o=o.next((()=>{(function(c){c.createObjectStore(Ak,{keyPath:Zde})})(e)}))),r<18&&s>=18&&lq()&&(o=o.next((()=>{n.objectStore(Ag).clear()})).next((()=>{n.objectStore(Rg).clear()}))),o}wi(e){let n=0;return e.store(od).ee(((r,s)=>{n+=lS(s)})).next((()=>{const r={byteSize:n};return e.store(d_).put(VA,r)}))}yi(e){const n=e.store(u_),r=e.store(No);return n.J().next((s=>ae.forEach(s,(i=>{const o=IDBKeyRange.bound([i.userId,Od],[i.userId,i.lastAcknowledgedBatchId]);return r.J(_d,o).next((a=>ae.forEach(a,(c=>{st(c.userId===i.userId,18650,"Cannot process batch from unexpected user",{batchId:c.batchId});const l=dd(this.serializer,c);return jj(e,i.userId,l).next((()=>{}))}))))}))))}Si(e){const n=e.store(Kf),r=e.store(od);return e.store(xd).get(rS).next((s=>{const i=[];return r.ee(((o,a)=>{const c=new rn(o),l=(function(h){return[0,Ds(h)]})(c);i.push(n.get(l).next((d=>d?ae.resolve():(h=>n.put({targetId:0,path:Ds(h),sequenceNumber:s.highestListenSequenceNumber}))(c))))})).next((()=>ae.waitFor(i)))}))}bi(e,n){e.createObjectStore(h_,{keyPath:$de});const r=n.store(h_),s=new Hk,i=o=>{if(s.add(o)){const a=o.lastSegment(),c=o.popLast();return r.put({collectionId:a,parent:Ds(c)})}};return n.store(od).ee({X:!0},((o,a)=>{const c=new rn(o);return i(c.popLast())})).next((()=>n.store(Wf).ee({X:!0},(([o,a,c],l)=>{const d=ba(a);return i(d.popLast())}))))}Di(e){const n=e.store(Gf);return n.ee(((r,s)=>{const i=dg(s),o=Bj(this.serializer,i);return n.put(o)}))}Ci(e,n){const r=n.store(od),s=[];return r.ee(((i,o)=>{const a=n.store(nS),c=(function(h){return h.document?new Ge(rn.fromString(h.document.name).popFirst(5)):h.noDocument?Ge.fromSegments(h.noDocument.path):h.unknownDocument?Ge.fromSegments(h.unknownDocument.path):Xe(36783)})(o).path.toArray(),l={prefixPath:c.slice(0,c.length-2),collectionGroup:c[c.length-2],documentId:c[c.length-1],readTime:o.readTime||[0,0],unknownDocument:o.unknownDocument,noDocument:o.noDocument,document:o.document,hasCommittedMutations:!!o.hasCommittedMutations};s.push(a.put(l))})).next((()=>ae.waitFor(s)))}Fi(e,n){const r=n.store(No),s=Qj(this.serializer),i=new jk(rE.mi,this.serializer.yt);return r.J().next((o=>{const a=new Map;return o.forEach((c=>{let l=a.get(c.userId)??Vt();dd(this.serializer,c).keys().forEach((d=>l=l.add(d))),a.set(c.userId,l)})),ae.forEach(a,((c,l)=>{const d=new os(l),h=tE.wt(this.serializer,d),p=i.getIndexManager(d),g=nE.wt(d,this.serializer,p,i.referenceDelegate);return new Xj(s,g,h,p).recalculateAndSaveOverlaysForDocumentKeys(new $A(n,hi.ce),c).next()}))}))}}function ZM(t){t.createObjectStore(Kf,{keyPath:Fde}).createIndex(Ik,Bde,{unique:!0}),t.createObjectStore(Gf,{keyPath:"targetId"}).createIndex(Mq,Vde,{unique:!0}),t.createObjectStore(xd)}const Cl="IndexedDbPersistence",H0=18e5,q0=5e3,j0="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.",yfe="main";class Wk{constructor(e,n,r,s,i,o,a,c,l,d,h=18){if(this.allowTabSynchronization=e,this.persistenceKey=n,this.clientId=r,this.Mi=i,this.window=o,this.document=a,this.xi=l,this.Oi=d,this.Ni=h,this.ci=null,this.li=!1,this.isPrimary=!1,this.networkEnabled=!0,this.Bi=null,this.inForeground=!1,this.Li=null,this.ki=null,this.qi=Number.NEGATIVE_INFINITY,this.Qi=p=>Promise.resolve(),!Wk.v())throw new Be(we.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new ife(this,s),this.$i=n+yfe,this.serializer=new Fj(c),this.Ui=new Jl(this.$i,this.Ni,new _fe(this.serializer)),this.hi=new zhe,this.Pi=new nfe(this.referenceDelegate,this.serializer),this.remoteDocumentCache=Qj(this.serializer),this.Ii=new Khe,this.window&&this.window.localStorage?this.Ki=this.window.localStorage:(this.Ki=null,d===!1&&Dr(Cl,"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}start(){return this.Wi().then((()=>
97{if(!this.isPrimary&&!this.allowTabSynchronization)throw new Be(we.FAILED_PRECONDITION,j0);return this.Gi(),this.zi(),this.ji(),this.runTransaction("getHighestListenSequenceNumber","readonly",(e=>this.Pi.getHighestSequenceNumber(e)))})).then((e=>{this.ci=new hi(e,this.xi)})).then((()=>{this.li=!0})).catch((e=>(this.Ui&&this.Ui.close(),Promise.reject(e))))}Ji(e){return this.Qi=async n=>{if(this.started)return e(n)},e(this.isPrimary)}setDatabaseDeletedListener(e){this.Ui.$((async n=>{n.newVersion===null&&await e()}))}setNetworkEnabled(e){this.networkEnabled!==e&&(this.networkEnabled=e,this.Mi.enqueueAndForget((async()=>{this.started&&await this.Wi()})))}Wi(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(e=>vb(e).put({clientId:this.clientId,updateTimeMs:Date.now(),networkEnabled:this.networkEnabled,inForeground:this.inForeground}).next((()=>{if(this.isPrimary)return this.Hi(e).next((n=>{n||(this.isPrimary=!1,this.Mi.enqueueRetryable((()=>this.Qi(!1))))}))})).next((()=>this.Yi(e))).next((n=>this.isPrimary&&!n?this.Zi(e).next((()=>!1)):!!n&&this.Xi(e).next((()=>!0)))))).catch((e=>{if(Iu(e))return Le(Cl,"Failed to extend owner lease: ",e),this.isPrimary;if(!this.allowTabSynchronization)throw e;return Le(Cl,"Releasing owner lease after error during lease refresh",e),!1})).then((e=>{this.isPrimary!==e&&this.Mi.enqueueRetryable((()=>this.Qi(e))),this.isPrimary=e}))}Hi(e){return zm(e).get(Hh).next((n=>ae.resolve(this.es(n))))}ts(e){return vb(e).delete(this.clientId)}async ns(){if(this.isPrimary&&!this.rs(this.qi,H0)){this.qi=Date.now();const e=await this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(n=>{const r=Zr(n,zf);return r.J().next((s=>{const i=this.ss(s,H0),o=s.filter((a=>i.indexOf(a)===-1));return ae.forEach(o,(a=>r.delete(a.clientId))).next((()=>o))}))})).catch((()=>[]));if(this.Ki)for(const n of e)this.Ki.removeItem(this._s(n.clientId))}}ji(){this.ki=this.Mi.enqueueAfterDelay("client_metadata_refresh",4e3,(()=>this.Wi().then((()=>this.ns())).then((()=>this.ji()))))}es(e){return!!e&&e.ownerId===this.clientId}Yi(e){return this.Oi?ae.resolve(!0):zm(e).get(Hh).next((n=>{if(n!==null&&this.rs(n.leaseTimestampMs,q0)&&!this.us(n.ownerId)){if(this.es(n)&&this.networkEnabled)return!0;if(!this.es(n)){if(!n.allowTabSynchronization)throw new Be(we.FAILED_PRECONDITION,j0);return!1}}return!(!this.networkEnabled||!this.inForeground)||vb(e).J().next((r=>this.ss(r,q0).find((s=>{if(this.clientId!==s.clientId){const i=!this.networkEnabled&&s.networkEnabled,o=!this.inForeground&&s.inForeground,a=this.networkEnabled===s.networkEnabled;if(i||o&&a)return!0}return!1}))===void 0))})).next((n=>(this.isPrimary!==n&&Le(Cl,`Client ${n?"is":"is not"} eligible for a primary lease.`),n)))}async shutdown(){this.li=!1,this.cs(),this.ki&&(this.ki.cancel(),this.ki=null),this.ls(),this.hs(),await this.Ui.runTransaction("shutdown","readwrite",[cy,zf],(e=>{const n=new $A(e,hi.ce);return this.Zi(n).next((()=>this.ts(n)))})),this.Ui.close(),this.Ps()}ss(e,n){return e.filter((r=>this.rs(r.updateTimeMs,n)&&!this.us(r.clientId)))}Ts(){return this.runTransaction("getActiveClients","readonly",(e=>vb(e).J().next((n=>this.ss(n,H0).map((r=>r.clientId))))))}get started(){return this.li}getGlobalsCache(){return this.hi}getMutationQueue(e,n){return nE.wt(e,this.serializer,n,this.referenceDelegate)}getTargetCache(){return this.Pi}getRemoteDocumentCache(){return this.remoteDocumentCache}getIndexManager(e){return new tfe(e,this.serializer.yt.databaseId)}getDocumentOverlayCache(e){return tE.wt(this.serializer,e)}getBundleCache(){return this.Ii}runTransaction(e,n,r){Le(Cl,"Starting transaction:",e);const s=n==="readonly"?"readonly":"readwrite",i=(function(c){return c===18?nhe:c===17?qq:c===16?the:c===15?Rk:c===14?Hq:c===13?Uq:c===12?ehe:c===11?$q:void Xe(60245)})(this.Ni);let o;return this.Ui.runTransaction(e,s,i,(a=>(o=new $A(a,this.ci?this.ci.next():hi.ce),n==="readwrite-primary"?this.Hi(o).next((c=>!!c||this.Yi(o))).next((c=>{if(!c)throw Dr(`Failed to obtain primary lease for action '${e}'.`),this.isPrimary=!1,this.Mi.enqueueRetryable((()=>this.Qi(!1))),new Be(we.FAILED_PRECONDITION,kq);return r(o)})).next((c=>this.Xi(o).next((()=>c)))):this.Is(o).next((()=>r(o)))))).then((a=>(o.raiseOnCommittedEvent(),a)))}Is(e){return zm(e).get(Hh).next((n=>{if(n!==null&&this.rs(n.leaseTimestampMs,q0)&&!this.us(n.ownerId)&&!this.es(n)&&!(this.Oi||this.allowTabSynchronization&&n.allowTabSynchronization))throw new Be(we.FAILED_PRECONDITION,j0)}))}Xi(e){const n={ownerId:this.clientId,allowTabSynchronization:this.allowTabSynchronization,leaseTimestampMs:Date.now()};return zm(e).put(Hh,n)}static v(){return Jl.v()}Zi(e){const n=zm(e);return n.get(Hh).next((r=>this.es(r)?(Le(Cl,"Releasing primary lease."),n.delete(Hh)):ae.resolve()))}rs(e,n){const r=Date.now();return!(e<r-n)&&(!(e>r)||(Dr(`Detected an update time that is in the future: ${e} > ${r}`),!1))}Gi(){this.document!==null&&typeof this.document.addEventListener=="function"&&(this.Li=()=>{this.Mi.enqueueAndForget((()=>(this.inForeground=this.document.visibilityState==="visible",this.Wi())))},this.document.addEventListener("visibilitychange",this.Li),this.inForeground=this.document.visibilityState==="visible")}ls(){this.Li&&(this.document.removeEventListener("visibilitychange",this.Li),this.Li=null)}zi(){typeof this.window?.addEventListener=="function"&&(this.Bi=()=>{this.cs();const e=/(?:Version|Mobile)\/1[456]/;cq()&&(navigator.appVersion.match(e)||navigator.userAgent.match(e))&&this.Mi.enterRestrictedMode(!0),this.Mi.enqueueAndForget((()=>this.shutdown()))},this.window.addEventListener("pagehide",this.Bi))}hs(){this.Bi&&(this.window.removeEventListener("pagehide",this.Bi),this.Bi=null)}us(e){try{const n=this.Ki?.getItem(this._s(e))!==null;return Le(Cl,`Client '${e}' ${n?"is":"is not"} zombied in LocalStorage`),n}catch(n){return Dr(Cl,"Failed to get zombied client id.",n),!1}}cs(){if(this.Ki)try{this.Ki.setItem(this._s(this.clientId),String(Date.now()))}catch(e){Dr("Failed to set zombie client id.",e)}}Ps(){if(this.Ki)try{this.Ki.removeItem(this._s(this.clientId))}catch{}}_s(e){return`firestore_zombie_${this.persistenceKey}_${e}`}}function zm(t){return Zr(t,cy)}function vb(t){return Zr(t,zf)}function Zj(t,e){let n=t.projectId;return t.isDefaultDatabase||(n+="."+t.database),"firestore/"+e+"/"+n+"/"}class Gk{constructor(e,n,r,s){this.targetId=e,this.fromCache=n,this.Es=r,this.ds=s}static As(e,n){let r=Vt(),s=Vt();for(const i of n.docChanges)switch(i.type){case 0:r=r.add(i.doc.key);break;case 1:s=s.add(i.doc.key)}return new Gk(e,n.fromCache,r,s)}}class vfe{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}class e3{constructor(){this.Rs=!1,this.Vs=!1,this.fs=100,this.gs=(function(){return cq()?8:Dq(Xr())>0?6:4})()}initialize(e,n){this.ps=e,this.indexManager=n,this.Rs=!0}
97getDocumentsMatchingQuery(e,n,r,s){const i={result:null};return this.ys(e,n).next((o=>{i.result=o})).next((()=>{if(!i.result)return this.ws(e,n,s,r).next((o=>{i.result=o}))})).next((()=>{if(i.result)return;const o=new vfe;return this.Ss(e,n,o).next((a=>{if(i.result=a,this.Vs)return this.bs(e,n,o,a.size)}))})).next((()=>i.result))}bs(e,n,r,s){return r.documentReadCount<this.fs?(rf()<=Gt.DEBUG&&Le("QueryEngine","SDK will not create cache indexes for query:",sf(n),"since it only creates cache indexes for collection contains","more than or equal to",this.fs,"documents"),ae.resolve()):(rf()<=Gt.DEBUG&&Le("QueryEngine","Query:",sf(n),"scans",r.documentReadCount,"local documents and returns",s,"documents as results."),r.documentReadCount>this.gs*s?(rf()<=Gt.DEBUG&&Le("QueryEngine","The SDK decides to create cache indexes for query:",sf(n),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Fi(n))):ae.resolve())}ys(e,n){if(TM(n))return ae.resolve(null);let r=Fi(n);return this.indexManager.getIndexType(e,r).next((s=>s===0?null:(n.limit!==null&&s===1&&(n=zA(n,null,"F"),r=Fi(n)),this.indexManager.getDocumentsMatchingTarget(e,r).next((i=>{const o=Vt(...i);return this.ps.getDocuments(e,o).next((a=>this.indexManager.getMinOffset(e,r).next((c=>{const l=this.Ds(n,a);return this.Cs(n,l,o,c.readTime)?this.ys(e,zA(n,null,"F")):this.vs(e,l,n,c)}))))})))))}ws(e,n,r,s){return TM(n)||s.isEqual(ct.min())?ae.resolve(null):this.ps.getDocuments(e,r).next((i=>{const o=this.Ds(n,i);return this.Cs(n,o,r,s)?ae.resolve(null):(rf()<=Gt.DEBUG&&Le("QueryEngine","Re-using previous result from %s to execute query: %s",s.toString(),sf(n)),this.vs(e,o,n,Rq(s,jf)).next((a=>a)))}))}Ds(e,n){let r=new Ln(dj(e));return n.forEach(((s,i)=>{hy(e,i)&&(r=r.add(i))})),r}Cs(e,n,r,s){if(e.limit===null)return!1;if(r.size!==n.size)return!0;const i=e.limitType==="F"?n.last():n.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(s)>0)}Ss(e,n,r){return rf()<=Gt.DEBUG&&Le("QueryEngine","Using full collection scan to execute query:",sf(n)),this.ps.getDocumentsMatchingQuery(e,n,Hi.min(),r)}vs(e,n,r,s){return this.ps.getDocumentsMatchingQuery(e,r,s).next((i=>(n.forEach((o=>{i=i.insert(o.key,o)})),i)))}}const Kk="LocalStore",bfe=3e8;class wfe{constructor(e,n,r,s){this.persistence=e,this.Fs=n,this.serializer=s,this.Ms=new ur(Et),this.xs=new rl((i=>zd(i)),ly),this.Os=new Map,this.Ns=e.getRemoteDocumentCache(),this.Pi=e.getTargetCache(),this.Ii=e.getBundleCache(),this.Bs(r)}Bs(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new Xj(this.Ns,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Ns.setIndexManager(this.indexManager),this.Fs.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",(n=>e.collect(n,this.Ms)))}}function t3(t,e,n,r){return new wfe(t,e,n,r)}async function n3(t,e){const n=nt(t);return await n.persistence.runTransaction("Handle user change","readonly",(r=>{let s;
97return n.mutationQueue.getAllMutationBatches(r).next((i=>(s=i,n.Bs(e),n.mutationQueue.getAllMutationBatches(r)))).next((i=>{const o=[],a=[];let c=Vt();for(const l of s){o.push(l.batchId);for(const d of l.mutations)c=c.add(d.key)}for(const l of i){a.push(l.batchId);for(const d of l.mutations)c=c.add(d.key)}return n.localDocuments.getDocuments(r,c).next((l=>({Ls:l,removedBatchIds:o,addedBatchIds:a})))}))}))}function Sfe(t,e){const n=nt(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",(r=>{const s=e.batch.keys(),i=n.Ns.newChangeBuffer({trackRemovals:!0});return(function(a,c,l,d){const h=l.batch,p=h.keys();let g=ae.resolve();return p.forEach((_=>{g=g.next((()=>d.getEntry(c,_))).next((v=>{const b=l.docVersions.get(_);st(b!==null,48541),v.version.compareTo(b)<0&&(h.applyToRemoteDocument(v,l),v.isValidDocument()&&(v.setReadTime(l.commitVersion),d.addEntry(v)))}))})),g.next((()=>a.mutationQueue.removeMutationBatch(c,h)))})(n,r,e,i).next((()=>i.apply(r))).next((()=>n.mutationQueue.performConsistencyCheck(r))).next((()=>n.documentOverlayCache.removeOverlaysForBatchId(r,s,e.batch.batchId))).next((()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,(function(a){let c=Vt();for(let l=0;l<a.mutationResults.length;++l)a.mutationResults[l].transformResults.length>0&&(c=c.add(a.batch.mutations[l].key));return c})(e)))).next((()=>n.localDocuments.getDocuments(r,s)))}))}function r3(t){const e=nt(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(n=>e.Pi.getLastRemoteSnapshotVersion(n)))}function Tfe(t,e){const n=nt(t),r=e.snapshotVersion;let s=n.Ms;return n.persistence.runTransaction("Apply remote event","readwrite-primary",(i=>{const o=n.Ns.newChangeBuffer({trackRemovals:!0});s=n.Ms;const a=[];
97e.targetChanges.forEach(((d,h)=>{const p=s.get(h);if(!p)return;a.push(n.Pi.removeMatchingKeys(i,d.removedDocuments,h).next((()=>n.Pi.addMatchingKeys(i,d.addedDocuments,h))));let g=p.withSequenceNumber(i.currentSequenceNumber);e.targetMismatches.get(h)!==null?g=g.withResumeToken(Lr.EMPTY_BYTE_STRING,ct.min()).withLastLimboFreeSnapshotVersion(ct.min()):d.resumeToken.approximateByteSize()>0&&(g=g.withResumeToken(d.resumeToken,r)),s=s.insert(h,g),(function(v,b,w){return v.resumeToken.approximateByteSize()===0||b.snapshotVersion.toMicroseconds()-v.snapshotVersion.toMicroseconds()>=bfe?!0:w.addedDocuments.size+w.modifiedDocuments.size+w.removedDocuments.size>0})(p,g,d)&&a.push(n.Pi.updateTargetData(i,g))}));let c=Li(),l=Vt();if(e.documentUpdates.forEach((d=>{e.resolvedLimboDocuments.has(d)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(i,d))})),a.push(Efe(i,o,e.documentUpdates).next((d=>{c=d.ks,l=d.qs}))),!r.isEqual(ct.min())){const d=n.Pi.getLastRemoteSnapshotVersion(i).next((h=>n.Pi.setTargetsMetadata(i,i.currentSequenceNumber,r)));a.push(d)}return ae.waitFor(a).next((()=>o.apply(i))).next((()=>n.localDocuments.getLocalViewOfDocuments(i,c,l))).next((()=>c))})).then((i=>(n.Ms=s,i)))}function Efe(t,e,n){let r=Vt(),s=Vt();return n.forEach((i=>r=r.add(i))),e.getEntries(t,r).next((i=>{let o=Li();return n.forEach(((a,c)=>{const l=i.get(a);c.isFoundDocument()!==l.isFoundDocument()&&(s=s.add(a)),c.isNoDocument()&&c.version.isEqual(ct.min())?(e.removeEntry(a,c.readTime),o=o.insert(a,c)):!l.isValidDocument()||c.version.compareTo(l.version)>0||c.version.compareTo(l.version)===0&&l.hasPendingWrites?(e.addEntry(c),o=o.insert(a,c)):Le(Kk,"Ignoring outdated watch update for ",a,". Current version:",l.version," Watch version:",c.version)})),{ks:o,qs:s}}))}function Ife(t,e){const n=nt(t);return n.persistence.runTransaction("Get next mutation batch","readonly",(r=>(e===void 0&&(e=Od),n.mutationQueue.getNextMutationBatchAfterBatchId(r,e))))}function dS(t,e){const n=nt(t);return n.persistence.runTransaction("Allocate target","readwrite",(r=>{let s;return n.Pi.getTargetData(r,e).next((i=>i?(s=i,ae.resolve(s)):n.Pi.allocateTargetId(r).next((o=>(s=new wc(e,o,"TargetPurposeListen",r.currentSequenceNumber),n.Pi.addTargetData(r,s).next((()=>s)))))))})).then((r=>{const s=n.Ms.get(r.targetId);return(s===null||r.snapshotVersion.compareTo(s.snapshotVersion)>0)&&(n.Ms=n.Ms.insert(r.targetId,r),n.xs.set(e,r.targetId)),r}))}async function rp(t,e,n){const r=nt(t),s=r.Ms.get(e),i=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",i,(o=>r.persistence.referenceDelegate.removeTarget(o,s)))}catch(o){if(!Iu(o))throw o;Le(Kk,`Failed to update sequence numbers for target ${e}: ${o}`)}r.Ms=r.Ms.remove(e),r.xs.delete(s.target)}function nR(t,e,n){const r=nt(t);let s=ct.min(),i=Vt();return r.persistence.runTransaction("Execute query","readwrite",(o=>(function(c,l,d){const h=nt(c),p=h.xs.get(d);return p!==void 0?ae.resolve(h.Ms.get(p)):h.Pi.getTargetData(l,d)})(r,o,Fi(e)).next((a=>{if(a)return s=a.lastLimboFreeSnapshotVersion,r.Pi.getMatchingKeysForTargetId(o,a.targetId).next((c=>{i=c}))})).next((()=>r.Fs.getDocumentsMatchingQuery(o,e,n?s:ct.min(),n?i:Vt()))).next((a=>(o3(r,uj(e),a),{documents:a,Qs:i})))))}function s3(t,e){const n=nt(t),r=nt(n.Pi),s=n.Ms.get(e);return s?Promise.resolve(s.target):n.persistence.runTransaction("Get target data","readonly",(i=>r.At(i,e).next((o=>o?o.target:null))))}function i3(t,e){const n=nt(t),r=n.Os.get(e)||ct.min();return n.persistence.runTransaction("Get new document changes","readonly",(s=>n.Ns.getAllFromCollectionGroup(s,e,Rq(r,jf),Number.MAX_SAFE_INTEGER))).then((s=>(o3(n,e,s),s)))}function o3(t,e,n){let r=t.Os.get(e)||ct.min();n.forEach(((s,i)=>{i.readTime.compareTo(r)>0&&(r=i.readTime)})),t.Os.set(e,r)}const a3="firestore_clients";function e2(t,e){return`${a3}_${t}_${e}`}const c3="firestore_mutations";function t2(t,e,n){let r=`${c3}_${t}_${n}`;return e.isAuthenticated()&&(r+=`_${e.uid}`),r}const l3="firestore_targets";function W0(t,e){return`${l3}_${t}_${e}`}const va="SharedClientState";class hS{constructor(e,n,r,s){this.user=e,this.batchId=n,this.state=r,this.error=s}static Ws(e,n,r){const s=JSON.parse(r);let i,o=typeof s=="object"&&["pending","acknowledged","rejected"].indexOf(s.state)!==-1&&(s.error===void 0||typeof s.error=="object");return o&&s.error&&(o=typeof s.error.message=="string"&&typeof s.error.code=="string",o&&(i=new Be(s.error.code,s.error.message))),o?new hS(e,n,s.state,i):(Dr(va,`Failed to parse mutation state for ID '${n}': ${r}`),null)}Gs(){const e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class Og{constructor(e,n,r){this.targetId=e,this.state=n,this.error=r}static Ws(e,n){const r=JSON.parse(n);let s,i=typeof r=="object"&&["not-current","current","rejected"].indexOf(r.state)!==-1&&(r.error===void 0||typeof r.error=="object");return i&&r.error&&(i=typeof r.error.message=="string"&&typeof r.error.code=="string",i&&(s=new Be(r.error.code,r.error.message))),i?new Og(e,r.state,s):(Dr(va,`Failed to parse target state for ID '${e}': ${n}`),null)}Gs(){const e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class fS{constructor(e,n){this.clientId=e,this.activeTargetIds=n}static Ws(e,n){const r=JSON.parse(n);let s=typeof r=="object"&&r.activeTargetIds instanceof Array,i=Ok();for(let o=0;s&&o<r.activeTargetIds.length;++o)s=Oq(r.activeTargetIds[o]),i=i.add(r.activeTargetIds[o]);return s?new fS(e,i):(Dr(va,`Failed to parse client data for instance '${e}': ${n}`),null)}}class zk{constructor(e,n){this.clientId=e,this.onlineState=n}static Ws(e){const n=JSON.parse(e);return typeof n=="object"&&["Unknown","Online","Offline"].indexOf(n.onlineState)!==-1&&typeof n.clientId=="string"?new zk(n.clientId,n.onlineState):(Dr(va,`Failed to parse online state: ${e}`),null)}}class rR{constructor(){this.activeTargetIds=Ok()}zs(e){this.activeTargetIds=this.activeTargetIds.add(e)}js(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Gs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class G0{constructor(e,n,r,s,i){this.window=e,this.Mi=n,this.persistenceKey=r,this.Js=s,this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null,this.Hs=this.Ys.bind(this),this.Zs=new ur(Et),this.started=!1,this.Xs=[];const o=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=i,this.eo=e2(this.persistenceKey,this.Js),this.no=(function(c){return`firestore_sequence_number_${c}`})(this.persistenceKey),this.Zs=this.Zs.insert(this.Js,new rR),this.ro=new RegExp(`^${a3}_${o}_([^_]*)$`),this.io=new RegExp(`^${c3}_${o}_(\\d+)(?:_(.*))?$`),this.so=new RegExp(`^${l3}_${o}_(\\d+)$`),this.oo=(function(c){return`firestore_online_state_${c}`})(this.persistenceKey),this._o=(function(c){return`firestore_bundle_loaded_v2_${c}`})(this.persistenceKey),this.window.addEventListener("storage",this.Hs)}static v(e){return!(!e||!e.localStorage)}async start(){const e=await this.syncEngine.Ts();for(const r of e){if(r===this.Js)continue;const s=this.getItem(e2(this.persistenceKey,r));if(s){const i=fS.Ws(r,s);i&&(this.Zs=this.Zs.insert(i.clientId,i))}}this.ao();const n=this.storage.getItem(this.oo);if(n){const r=this.uo(n);r&&this.co(r)}for(const r of this.Xs)this.Ys(r);this.Xs=[],this.window.addEventListener("pagehide",(()=>this.shutdown())),this.started=!0}writeSequenceNumber(e){this.setItem(this.no,JSON.stringify(e))}getAllActiveQueryTargets(){return this.lo(this.Zs)}isActiveQueryTarget(e){let n=!1;return this.Zs.forEach(((r,s)=>{s.activeTargetIds.has(e)&&(n=!0)})),n}addPendingMutation(e){this.ho(e,"pending")}updateMutationState(e,n,r){this.ho(e,n,r),this.Po(e)}addLocalQueryTarget(e,n=!0){let r="not-current";if(this.isActiveQueryTarget(e)){const s=this.storage.getItem(W0(this.persistenceKey,e));
97if(s){const i=Og.Ws(e,s);i&&(r=i.state)}}return n&&this.To.zs(e),this.ao(),r}removeLocalQueryTarget(e){this.To.js(e),this.ao()}isLocalQueryTarget(e){return this.To.activeTargetIds.has(e)}clearQueryState(e){this.removeItem(W0(this.persistenceKey,e))}updateQueryState(e,n,r){this.Io(e,n,r)}handleUserChange(e,n,r){n.forEach((s=>{this.Po(s)})),this.currentUser=e,r.forEach((s=>{this.addPendingMutation(s)}))}setOnlineState(e){this.Eo(e)}notifyBundleLoaded(e){this.Ao(e)}shutdown(){this.started&&(this.window.removeEventListener("storage",this.Hs),this.removeItem(this.eo),this.started=!1)}getItem(e){const n=this.storage.getItem(e);return Le(va,"READ",e,n),n}setItem(e,n){Le(va,"SET",e,n),this.storage.setItem(e,n)}removeItem(e){Le(va,"REMOVE",e),this.storage.removeItem(e)}Ys(e){const n=e;if(n.storageArea===this.storage){if(Le(va,"EVENT",n.key,n.newValue),n.key===this.eo)return void Dr("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Mi.enqueueRetryable((async()=>{if(this.started){if(n.key!==null){if(this.ro.test(n.key)){if(n.newValue==null){const r=this.Ro(n.key);return this.Vo(r,null)}{const r=this.mo(n.key,n.newValue);if(r)return this.Vo(r.clientId,r)}}else if(this.io.test(n.key)){if(n.newValue!==null){const r=this.fo(n.key,n.newValue);if(r)return this.po(r)}}else if(this.so.test(n.key)){if(n.newValue!==null){const r=this.yo(n.key,n.newValue);if(r)return this.wo(r)}}else if(n.key===this.oo){if(n.newValue!==null){const r=this.uo(n.newValue);if(r)return this.co(r)}}else if(n.key===this.no){const r=(function(i){let o=hi.ce;if(i!=null)try{const a=JSON.parse(i);st(typeof a=="number",30636,{So:i}),o=a}catch(a){Dr(va,"Failed to read sequence number from WebStorage",a)}return o})(n.newValue);r!==hi.ce&&this.sequenceNumberHandler(r)}else if(n.key===this._o){const r=this.bo(n.newValue);await Promise.all(r.map((s=>this.syncEngine.Do(s))))}}}else this.Xs.push(n)}))}}get To(){return this.Zs.get(this.Js)}ao(){this.setItem(this.eo,this.To.Gs())}ho(e,n,r){const s=new hS(this.currentUser,e,n,r),i=t2(this.persistenceKey,this.currentUser,e);this.setItem(i,s.Gs())}Po(e){const n=t2(this.persistenceKey,this.currentUser,e);this.removeItem(n)}Eo(e){const n={clientId:this.Js,onlineState:e};this.storage.setItem(this.oo,JSON.stringify(n))}Io(e,n,r){const s=W0(this.persistenceKey,e),i=new Og(e,n,r);this.setItem(s,i.Gs())}Ao(e){const n=JSON.stringify(Array.from(e));this.setItem(this._o,n)}Ro(e){const n=this.ro.exec(e);return n?n[1]:null}mo(e,n){const r=this.Ro(e);return fS.Ws(r,n)}fo(e,n){const r=this.io.exec(e),s=Number(r[1]),i=r[2]!==void 0?r[2]:null;return hS.Ws(new os(i),s,n)}yo(e,n){const r=this.so.exec(e),s=Number(r[1]);return Og.Ws(s,n)}uo(e){return zk.Ws(e)}bo(e){return JSON.parse(e)}async po(e){if(e.user.uid===this.currentUser.uid)return this.syncEngine.Co(e.batchId,e.state,e.error);Le(va,`Ignoring mutation for non-active user ${e.user.uid}`)}wo(e){return this.syncEngine.vo(e.targetId,e.state,e.error)}
97Vo(e,n){const r=n?this.Zs.insert(e,n):this.Zs.remove(e),s=this.lo(this.Zs),i=this.lo(r),o=[],a=[];return i.forEach((c=>{s.has(c)||o.push(c)})),s.forEach((c=>{i.has(c)||a.push(c)})),this.syncEngine.Fo(o,a).then((()=>{this.Zs=r}))}co(e){this.Zs.get(e.clientId)&&this.onlineStateHandler(e.onlineState)}lo(e){let n=Ok();return e.forEach(((r,s)=>{n=n.unionWith(s.activeTargetIds)})),n}}class u3{constructor(){this.Mo=new rR,this.xo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,n,r){}addLocalQueryTarget(e,n=!0){return n&&this.Mo.zs(e),this.xo[e]||"not-current"}updateQueryState(e,n,r){this.xo[e]=n}removeLocalQueryTarget(e){this.Mo.js(e)}isLocalQueryTarget(e){return this.Mo.activeTargetIds.has(e)}clearQueryState(e){delete this.xo[e]}getAllActiveQueryTargets(){return this.Mo.activeTargetIds}isActiveQueryTarget(e){return this.Mo.activeTargetIds.has(e)}start(){return this.Mo=new rR,Promise.resolve()}handleUserChange(e,n,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}class Cfe{Oo(e){}shutdown(){}}const n2="ConnectivityMonitor";class r2{constructor(){this.No=()=>this.Bo(),this.Lo=()=>this.ko(),this.qo=[],this.Qo()}Oo(e){this.qo.push(e)}shutdown(){window.removeEventListener("online",this.No),window.removeEventListener("offline",this.Lo)}Qo(){window.addEventListener("online",this.No),window.addEventListener("offline",this.Lo)}Bo(){Le(n2,"Network connectivity changed: AVAILABLE");for(const e of this.qo)e(0)}ko(){Le(n2,"Network connectivity changed: UNAVAILABLE");for(const e of this.qo)e(1)}static v(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}let bb=null;function sR(){return bb===null?bb=(function(){return 268435456+Math.round(2147483648*Math.random())})():bb++,"0x"+bb.toString(16)}const K0="RestConnection",Afe={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};class Rfe{get $o(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const n=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.Uo=n+"://"+e.host,this.Ko=`projects/${r}/databases/${s}`,this.Wo=this.databaseId.database===p_?`project_id=${r}`:`project_id=${r}&database_id=${s}`}Go(e,n,r,s,i){const o=sR(),a=this.zo(e,n.toUriEncodedString());Le(K0,`Sending RPC '${e}' ${o}:`,a,r);const c={"google-cloud-resource-prefix":this.Ko,"x-goog-request-params":this.Wo};this.jo(c,s,i);const{host:l}=new URL(a),d=$a(l);return this.Jo(e,a,c,r,d).then((h=>(Le(K0,`Received RPC '${e}' ${o}: `,h),h)),(h=>{throw Hf(K0,`RPC '${e}' ${o} failed with error: `,h,"url: ",a,"request:",r),h}))}Ho(e,n,r,s,i,o){return this.Go(e,n,r,s,i)}jo(e,n,r){e["X-Goog-Api-Client"]=(function(){return"gl-js/ fire/"+Dp})(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),n&&n.headers.forEach(((s,i)=>e[i]=s)),r&&r.headers.forEach(((s,i)=>e[i]=s))}zo(e,n){const r=Afe[e];return`${this.Uo}/v1/${n}:${r}`}terminate(){}}class Pfe{constructor(e){this.Yo=e.Yo,this.Zo=e.Zo}Xo(e){this.e_=e}t_(e){this.n_=e}r_(e){this.i_=e}onMessage(e){this.s_=e}close(){this.Zo()}send(e){this.Yo(e)}o_(){this.e_()}__(){this.n_()}a_(e){this.i_(e)}u_(e){this.s_(e)}}const Ts="WebChannelConnection";class kfe extends Rfe{constructor(e){super(e),this.c_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Jo(e,n,r,s,i){const o=sR();return new Promise(((a,c)=>{const l=new yq;l.setWithCredentials(!0),l.listenOnce(vq.COMPLETE,(()=>{try{switch(l.getLastErrorCode()){case Gb.NO_ERROR:const h=l.getResponseJson();Le(Ts,`XHR for RPC '${e}' ${o} received:`,JSON.stringify(h)),a(h);break;case Gb.TIMEOUT:Le(Ts,`RPC '${e}' ${o} timed out`),c(new Be(we.DEADLINE_EXCEEDED,"Request time out"));break;case Gb.HTTP_ERROR:const p=l.getStatus();if(Le(Ts,`RPC '${e}' ${o} failed with status:`,p,"response text:",l.getResponseText()),p>0){let g=l.getResponseJson();Array.isArray(g)&&(g=g[0]);const _=g?.error;if(_&&_.status&&_.message){const v=(function(w){const E=w.toLowerCase().replace(/_/g,"-");return Object.values(we).indexOf(E)>=0?E:we.UNKNOWN})(_.status);c(new Be(v,_.message))}else c(new Be(we.UNKNOWN,"Server responded with status "+l.getStatus()))}else c(new Be(we.UNAVAILABLE,"Connection failed."));break;default:Xe(9055,{l_:e,streamId:o,h_:l.getLastErrorCode(),P_:l.getLastError()})}}finally{Le(Ts,`RPC '${e}' ${o} completed.`)}}));const d=JSON.stringify(s);Le(Ts,`RPC '${e}' ${o} sending request:`,s),l.send(n,"POST",d,r,15)}))}T_(e,n,r){const s=sR(),i=[this.Uo,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=Sq(),a=wq(),c={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`}
97,sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},l=this.longPollingOptions.timeoutSeconds;l!==void 0&&(c.longPollingTimeout=Math.round(1e3*l)),this.useFetchStreams&&(c.useFetchStreams=!0),this.jo(c.initMessageHeaders,n,r),c.encodeInitMessageHeaders=!0;const d=i.join("");Le(Ts,`Creating RPC '${e}' stream ${s}: ${d}`,c);const h=o.createWebChannel(d,c);this.I_(h);let p=!1,g=!1;const _=new Pfe({Yo:b=>{g?Le(Ts,`Not sending because RPC '${e}' stream ${s} is closed:`,b):(p||(Le(Ts,`Opening RPC '${e}' stream ${s} transport.`),h.open(),p=!0),Le(Ts,`RPC '${e}' stream ${s} sending:`,b),h.send(b))},Zo:()=>h.close()}),v=(b,w,E)=>{b.listen(w,(T=>{try{E(T)}catch(R){setTimeout((()=>{throw R}),0)}}))};return v(h,cg.EventType.OPEN,(()=>{g||(Le(Ts,`RPC '${e}' stream ${s} transport opened.`),_.o_())})),v(h,cg.EventType.CLOSE,(()=>{g||(g=!0,Le(Ts,`RPC '${e}' stream ${s} transport closed`),_.a_(),this.E_(h))})),v(h,cg.EventType.ERROR,(b=>{g||(g=!0,Hf(Ts,`RPC '${e}' stream ${s} transport errored. Name:`,b.name,"Message:",b.message),_.a_(new Be(we.UNAVAILABLE,"The operation could not be completed")))})),v(h,cg.EventType.MESSAGE,(b=>{if(!g){const w=b.data[0];st(!!w,16349);const E=w,T=E?.error||E[0]?.error;if(T){Le(Ts,`RPC '${e}' stream ${s} received error:`,T);const R=T.status;let N=(function(I){const P=$r[I];if(P!==void 0)return Ej(P)})(R),O=T.message;N===void 0&&(N=we.INTERNAL,O="Unknown error status: "+R+" with message "+T.message),g=!0,_.a_(new Be(N,O)),h.close()}else Le(Ts,`RPC '${e}' stream ${s} received:`,w),_.u_(w)}})),v(a,bq.STAT_EVENT,(b=>{b.stat===xA.PROXY?Le(Ts,`RPC '${e}' stream ${s} detected buffering proxy`):b.stat===xA.NOPROXY&&Le(Ts,`RPC '${e}' stream ${s} detected no buffering proxy`)})),setTimeout((()=>{_.__()}),0),_}terminate(){this.c_.forEach((e=>e.close())),this.c_=[]}I_(e){this.c_.push(e)}E_(e){this.c_=this.c_.filter((n=>n===e))}}function d3(){return typeof window<"u"?window:null}function nw(){return typeof document<"u"?document:null}function sE(t){return new Lhe(t,!0)}class Yk{constructor(e,n,r=1e3,s=1.5,i=6e4){this.Mi=e,this.timerId=n,this.d_=r,this.A_=s,this.R_=i,this.V_=0,this.m_=null,this.f_=Date.now(),this.reset()}reset(){this.V_=0}g_(){this.V_=this.R_}p_(e){this.cancel();const n=Math.floor(this.V_+this.y_()),r=Math.max(0,Date.now()-this.f_),s=Math.max(0,n-r);s>0&&Le("ExponentialBackoff",`Backing off for ${s} ms (base delay: ${this.V_} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.m_=this.Mi.enqueueAfterDelay(this.timerId,s,(()=>(this.f_=Date.now(),e()))),this.V_*=this.A_,this.V_<this.d_&&(this.V_=this.d_),this.V_>this.R_&&(this.V_=this.R_)}w_(){this.m_!==null&&(this.m_.skipDelay(),this.m_=null)}cancel(){this.m_!==null&&(this.m_.cancel(),this.m_=null)}y_(){return(Math.random()-.5)*this.V_}}const s2="PersistentStream";class h3{constructor(e,n,r,s,i,o,a,c){this.Mi=e,this.S_=r,this.b_=s,this.connection=i,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=a,this.listener=c,this.state=0,this.D_=0,this.C_=null,this.v_=null,this.stream=null,this.F_=0,this.M_=new Yk(e,n)}x_(){return this.state===1||this.state===5||this.O_()}O_(){return this.state===2||this.state===3}start(){this.F_=0,this.state!==4?this.auth():this.N_()}async stop(){this.x_()&&await this.close(0)}B_(){this.state=0,this.M_.reset()}L_(){this.O_()&&this.C_===null&&(this.C_=this.Mi.enqueueAfterDelay(this.S_,6e4,(()=>this.k_())))}q_(e){this.Q_(),this.stream.send(e)}async k_(){if(this.O_())return this.close(0)}Q_(){this.C_&&(this.C_.cancel(),this.C_=null)}U_(){this.v_&&(this.v_.cancel(),this.v_=null)}async close(e,n){this.Q_(),this.U_(),this.M_.cancel(),this.D_++,e!==4?this.M_.reset():n&&n.code===we.RESOURCE_EXHAUSTED?(Dr(n.toString()),Dr("Using maximum backoff delay to prevent overloading the backend."),this.M_.g_()):n&&n.code===we.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.K_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.r_(n)}K_(){}auth(){this.state=1;const e=this.W_(this.D_),n=this.D_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then((([r,s])=>{this.D_===n&&this.G_(r,s)}),(r=>{e((()=>{const s=new Be(we.UNKNOWN,"Fetching auth token failed: "+r.message);return this.z_(s)}))}))}G_(e,n){const r=this.W_(this.D_);this.stream=this.j_(e,n),this.stream.Xo((()=>{r((()=>this.listener.Xo()))}
97)),this.stream.t_((()=>{r((()=>(this.state=2,this.v_=this.Mi.enqueueAfterDelay(this.b_,1e4,(()=>(this.O_()&&(this.state=3),Promise.resolve()))),this.listener.t_())))})),this.stream.r_((s=>{r((()=>this.z_(s)))})),this.stream.onMessage((s=>{r((()=>++this.F_==1?this.J_(s):this.onNext(s)))}))}N_(){this.state=5,this.M_.p_((async()=>{this.state=0,this.start()}))}z_(e){return Le(s2,`close with error: ${e}`),this.stream=null,this.close(4,e)}W_(e){return n=>{this.Mi.enqueueAndForget((()=>this.D_===e?n():(Le(s2,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())))}}}class Nfe extends h3{constructor(e,n,r,s,i,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",n,r,s,o),this.serializer=i}j_(e,n){return this.connection.T_("Listen",e,n)}J_(e){return this.onNext(e)}onNext(e){this.M_.reset();const n=Bhe(this.serializer,e),r=(function(i){if(!("targetChange"in i))return ct.min();const o=i.targetChange;return o.targetIds&&o.targetIds.length?ct.min():o.readTime?hs(o.readTime):ct.min()})(e);return this.listener.H_(n,r)}Y_(e){const n={};n.database=QA(this.serializer),n.addTarget=(function(i,o){let a;const c=o.target;if(a=iS(c)?{documents:Dj(i,c)}:{query:Oj(i,c).ft},a.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){a.resumeToken=Aj(i,o.resumeToken);const l=YA(i,o.expectedCount);l!==null&&(a.expectedCount=l)}else if(o.snapshotVersion.compareTo(ct.min())>0){a.readTime=np(i,o.snapshotVersion.toTimestamp());const l=YA(i,o.expectedCount);l!==null&&(a.expectedCount=l)}return a})(this.serializer,e);const r=Uhe(this.serializer,e);r&&(n.labels=r),this.q_(n)}Z_(e){const n={};n.database=QA(this.serializer),n.removeTarget=e,this.q_(n)}}class Dfe extends h3{constructor(e,n,r,s,i,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",n,r,s,o),this.serializer=i}get X_(){return this.F_>0}start(){this.lastStreamToken=void 0,super.start()}K_(){this.X_&&this.ea([])}j_(e,n){return this.connection.T_("Write",e,n)}J_(e){return st(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,st(!e.writeResults||e.writeResults.length===0,55816),this.listener.ta()}onNext(e){st(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.M_.reset();const n=$he(e.writeResults,e.commitTime),r=hs(e.commitTime);return this.listener.na(r,n)}ra(){const e={};e.database=QA(this.serializer),this.q_(e)}ea(e){const n={streamToken:this.lastStreamToken,writes:e.map((r=>b_(this.serializer,r)))};this.q_(n)}}class Ofe{}class xfe extends Ofe{constructor(e,n,r,s){super(),this.authCredentials=e,this.appCheckCredentials=n,this.connection=r,this.serializer=s,this.ia=!1}sa(){if(this.ia)throw new Be(we.FAILED_PRECONDITION,"The client has already been terminated.")}Go(e,n,r,s){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([i,o])=>this.connection.Go(e,JA(n,r),s,i,o))).catch((i=>{throw i.name==="FirebaseError"?(i.code===we.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),i):new Be(we.UNKNOWN,i.toString())}))}Ho(e,n,r,s,i){return this.sa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([o,a])=>this.connection.Ho(e,JA(n,r),s,o,a,i))).catch((o=>{throw o.name==="FirebaseError"?(o.code===we.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new Be(we.UNKNOWN,o.toString())}))}terminate(){this.ia=!0,this.connection.terminate()}}class Lfe{constructor(e,n){this.asyncQueue=e,this.onlineStateHandler=n,this.state="Unknown",this.oa=0,this._a=null,this.aa=!0}ua(){this.oa===0&&(this.ca("Unknown"),this._a=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(()=>(this._a=null,this.la("Backend didn't respond within 10 seconds."),this.ca("Offline"),Promise.resolve()))))}ha(e){this.state==="Online"?this.ca("Unknown"):(this.oa++,this.oa>=1&&(this.Pa(),this.la(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ca("Offline")))}set(e){this.Pa(),this.oa=0,e==="Online"&&(this.aa=!1),this.ca(e)}ca(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}la(e){const n=`Could not reach Cloud Firestore backend. ${e} 98This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;
98this.aa?(Dr(n),this.aa=!1):Le("OnlineStateTracker",n)}Pa(){this._a!==null&&(this._a.cancel(),this._a=null)}}const Xd="RemoteStore";class Mfe{constructor(e,n,r,s,i){this.localStore=e,this.datastore=n,this.asyncQueue=r,this.remoteSyncer={},this.Ta=[],this.Ia=new Map,this.Ea=new Set,this.da=[],this.Aa=i,this.Aa.Oo((o=>{r.enqueueAndForget((async()=>{uh(this)&&(Le(Xd,"Restarting streams for network reachability change."),await(async function(c){const l=nt(c);l.Ea.add(4),await gy(l),l.Ra.set("Unknown"),l.Ea.delete(4),await iE(l)})(this))}))})),this.Ra=new Lfe(r,s)}}async function iE(t){if(uh(t))for(const e of t.da)await e(!0)}async function gy(t){for(const e of t.da)await e(!1)}function oE(t,e){const n=nt(t);n.Ia.has(e.targetId)||(n.Ia.set(e.targetId,e),Xk(n)?Qk(n):Lp(n).O_()&&Jk(n,e))}function sp(t,e){const n=nt(t),r=Lp(n);n.Ia.delete(e),r.O_()&&f3(n,e),n.Ia.size===0&&(r.O_()?r.L_():uh(n)&&n.Ra.set("Unknown"))}function Jk(t,e){if(t.Va.Ue(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(ct.min())>0){const n=t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(n)}Lp(t).Y_(e)}function f3(t,e){t.Va.Ue(e),Lp(t).Z_(e)}function Qk(t){t.Va=new Nhe({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),At:e=>t.Ia.get(e)||null,ht:()=>t.datastore.serializer.databaseId}),Lp(t).start(),t.Ra.ua()}function Xk(t){return uh(t)&&!Lp(t).x_()&&t.Ia.size>0}function uh(t){return nt(t).Ea.size===0}function p3(t){t.Va=void 0}async function Vfe(t){t.Ra.set("Online")}async function Ffe(t){t.Ia.forEach(((e,n)=>{Jk(t,e)}))}async function Bfe(t,e){p3(t),Xk(t)?(t.Ra.ha(e),Qk(t)):t.Ra.set("Unknown")}async function $fe(t,e,n){if(t.Ra.set("Online"),e instanceof Cj&&e.state===2&&e.cause)try{await(async function(s,i){const o=i.cause;for(const a of i.targetIds)s.Ia.has(a)&&(await s.remoteSyncer.rejectListen(a,o),s.Ia.delete(a),s.Va.removeTarget(a))})(t,e)}catch(r){Le(Xd,"Failed to remove targets %s: %s ",e.targetIds.join(","),r),await pS(t,r)}else if(e instanceof ew?t.Va.Ze(e):e instanceof Ij?t.Va.st(e):t.Va.tt(e),!n.isEqual(ct.min()))try{const r=await r3(t.localStore);n.compareTo(r)>=0&&await(function(i,o){const a=i.Va.Tt(o);
98return a.targetChanges.forEach(((c,l)=>{if(c.resumeToken.approximateByteSize()>0){const d=i.Ia.get(l);d&&i.Ia.set(l,d.withResumeToken(c.resumeToken,o))}})),a.targetMismatches.forEach(((c,l)=>{const d=i.Ia.get(c);if(!d)return;i.Ia.set(c,d.withResumeToken(Lr.EMPTY_BYTE_STRING,d.snapshotVersion)),f3(i,c);const h=new wc(d.target,c,l,d.sequenceNumber);Jk(i,h)})),i.remoteSyncer.applyRemoteEvent(a)})(t,n)}catch(r){Le(Xd,"Failed to raise snapshot:",r),await pS(t,r)}}async function pS(t,e,n){if(!Iu(e))throw e;t.Ea.add(1),await gy(t),t.Ra.set("Offline"),n||(n=()=>r3(t.localStore)),t.asyncQueue.enqueueRetryable((async()=>{Le(Xd,"Retrying IndexedDB access"),await n(),t.Ea.delete(1),await iE(t)}))}function m3(t,e){return e().catch((n=>pS(t,n,e)))}async function xp(t){const e=nt(t),n=fu(e);let r=e.Ta.length>0?e.Ta[e.Ta.length-1].batchId:Od;for(;Ufe(e);)try{const s=await Ife(e.localStore,r);if(s===null){e.Ta.length===0&&n.L_();break}r=s.batchId,Hfe(e,s)}catch(s){await pS(e,s)}g3(e)&&_3(e)}function Ufe(t){return uh(t)&&t.Ta.length<10}function Hfe(t,e){t.Ta.push(e);const n=fu(t);n.O_()&&n.X_&&n.ea(e.mutations)}function g3(t){return uh(t)&&!fu(t).x_()&&t.Ta.length>0}function _3(t){fu(t).start()}async function qfe(t){fu(t).ra()}async function jfe(t){const e=fu(t);for(const n of t.Ta)e.ea(n.mutations)}async function Wfe(t,e,n){const r=t.Ta.shift(),s=Vk.from(r,e,n);await m3(t,(()=>t.remoteSyncer.applySuccessfulWrite(s))),await xp(t)}async function Gfe(t,e){e&&fu(t).X_&&await(async function(r,s){if((function(o){return Tj(o)&&o!==we.ABORTED})(s.code)){const i=r.Ta.shift();fu(r).B_(),await m3(r,(()=>r.remoteSyncer.rejectFailedWrite(i.batchId,s))),await xp(r)}})(t,e),g3(t)&&_3(t)}async function i2(t,e){const n=nt(t);n.asyncQueue.verifyOperationInProgress(),Le(Xd,"RemoteStore received new credentials");const r=uh(n);n.Ea.add(3),await gy(n),r&&n.Ra.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.Ea.delete(3),await iE(n)}async function iR(t,e){const n=nt(t);e?(n.Ea.delete(2),await iE(n)):e||(n.Ea.add(2),await gy(n),n.Ra.set("Unknown"))}function Lp(t){return t.ma||(t.ma=(function(n,r,s){const i=nt(n);return i.sa(),new Nfe(r,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,s)})(t.datastore,t.asyncQueue,{Xo:Vfe.bind(null,t),t_:Ffe.bind(null,t),r_:Bfe.bind(null,t),H_:$fe.bind(null,t)}),t.da.push((async e=>{e?(t.ma.B_(),Xk(t)?Qk(t):t.Ra.set("Unknown")):(await t.ma.stop(),p3(t))}))),t.ma}function fu(t){return t.fa||(t.fa=(function(n,r,s){const i=nt(n);return i.sa(),new Dfe(r,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,s)})(t.datastore,t.asyncQueue,{Xo:()=>Promise.resolve(),t_:qfe.bind(null,t),r_:Gfe.bind(null,t),ta:jfe.bind(null,t),na:Wfe.bind(null,t)}),t.da.push((async e=>{e?(t.fa.B_(),await xp(t)):(await t.fa.stop(),t.Ta.length>0&&(Le(Xd,`Stopping write stream with ${t.Ta.length} pending writes`),t.Ta=[]))}))),t.fa}class Zk{constructor(e,n,r,s,i){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=r,this.op=s,this.removalCallback=i,this.deferred=new mo,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((o=>{}))}get promise(){return this.deferred.promise}static createAndSchedule(e,n,r,s,i){const o=Date.now()+r,a=new Zk(e,n,o,s,i);return a.start(r),a}start(e){this.timerHandle=setTimeout((()=>this.handleDelayElapsed()),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new Be(we.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget((()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then((e=>this.deferred.resolve(e)))):Promise.resolve()))}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function aE(t,e){if(Dr("AsyncQueue",`${e}: ${t}`),Iu(t))return new Be(we.UNAVAILABLE,`${e}: ${t}`);throw t}class Sf{static emptySet(e){return new Sf(e.comparator)}constructor(e){this.comparator=e?(n,r)=>e(n,r)||Ge.comparator(n.key,r.key):(n,r)=>Ge.comparator(n.key,r.key),this.keyedMap=lg(),this.sortedSet=new ur(this.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const n=this.keyedMap.get(e);return n?this.sortedSet.indexOf(n):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal(((n,r)=>(e(n),!1)))}add(e){const n=this.delete(e.key);return n.copy(n.keyedMap.insert(e.key,e),n.sortedSet.insert(e,null))}delete(e){const n=this.get(e);return n?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(n)):this}isEqual(e){if(!(e instanceof Sf)||this.size!==e.size)return!1;const n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;n.hasNext();){const s=n.getNext().key,i=r.getNext().key;if(!s.isEqual(i))return!1}return!0}toString(){const e=[];return this.forEach((n=>{e.push(n.toString())})),e.length===0?"DocumentSet ()":`DocumentSet ( 99 `+e.join(` 100`)+` 101)`}copy(e,n){const r=new Sf;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,r}}class o2{constructor(){this.ga=new ur(Ge.comparator)}track(e){const n=e.doc.key,r=this.ga.get(n);r?e.type!==0&&r.type===3?this.ga=this.ga.insert(n,e):e.type===3&&r.type!==1?this.ga=this.ga.insert(n,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.ga=this.ga.insert(n,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.ga=this.ga.insert(n,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.ga=this.ga.remove(n):e.type===1&&r.type===2?this.ga=this.ga.insert(n,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.ga=this.ga.insert(n,{type:2,doc:e.doc}):Xe(63341,{Rt:e,pa:r}):this.ga=this.ga.insert(n,e)}ya(){const e=[];return this.ga.inorderTraversal(((n,r)=>{e.push(r)})),e}}class ip{constructor(e,n,r,s,i,o,a,c,l){this.query=e,this.docs=n,this.oldDocs=r,this.docChanges=s,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=c,this.hasCachedResults=l}static fromInitialDocuments(e,n,r,s,i){const o=[];
101return n.forEach((a=>{o.push({type:0,doc:a})})),new ip(e,n,Sf.emptySet(n),o,r,s,!0,!1,i)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&XT(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const n=this.docChanges,r=e.docChanges;if(n.length!==r.length)return!1;for(let s=0;s<n.length;s++)if(n[s].type!==r[s].type||!n[s].doc.isEqual(r[s].doc))return!1;return!0}}class Kfe{constructor(){this.wa=void 0,this.Sa=[]}ba(){return this.Sa.some((e=>e.Da()))}}class zfe{constructor(){this.queries=a2(),this.onlineState="Unknown",this.Ca=new Set}terminate(){(function(n,r){const s=nt(n),i=s.queries;s.queries=a2(),i.forEach(((o,a)=>{for(const c of a.Sa)c.onError(r)}))})(this,new Be(we.ABORTED,"Firestore shutting down"))}}function a2(){return new rl((t=>lj(t)),XT)}async function eN(t,e){const n=nt(t);let r=3;const s=e.query;let i=n.queries.get(s);i?!i.ba()&&e.Da()&&(r=2):(i=new Kfe,r=e.Da()?0:1);try{switch(r){case 0:i.wa=await n.onListen(s,!0);break;case 1:i.wa=await n.onListen(s,!1);break;case 2:await n.onFirstRemoteStoreListen(s)}}catch(o){const a=aE(o,`Initialization of query '${sf(e.query)}' failed`);return void e.onError(a)}n.queries.set(s,i),i.Sa.push(e),e.va(n.onlineState),i.wa&&e.Fa(i.wa)&&nN(n)}async function tN(t,e){const n=nt(t),r=e.query;let s=3;const i=n.queries.get(r);if(i){const o=i.Sa.indexOf(e);o>=0&&(i.Sa.splice(o,1),i.Sa.length===0?s=e.Da()?0:1:!i.ba()&&e.Da()&&(s=2))}switch(s){case 0:return n.queries.delete(r),n.onUnlisten(r,!0);case 1:return n.queries.delete(r),n.onUnlisten(r,!1);case 2:return n.onLastRemoteStoreUnlisten(r);default:return}}function Yfe(t,e){const n=nt(t);let r=!1;for(const s of e){const i=s.query,o=n.queries.get(i);if(o){for(const a of o.Sa)a.Fa(s)&&(r=!0);o.wa=s}}r&&nN(n)}function Jfe(t,e,n){const r=nt(t),s=r.queries.get(e);if(s)for(const i of s.Sa)i.onError(n);r.queries.delete(e)}function nN(t){t.Ca.forEach((e=>{e.next()}))}var oR,c2;(c2=oR||(oR={})).Ma="default",c2.Cache="cache";class rN{constructor(e,n,r){this.query=e,this.xa=n,this.Oa=!1,this.Na=null,this.onlineState="Unknown",this.options=r||{}}Fa(e){if(!this.options.includeMetadataChanges){const r=[];for(const s of e.docChanges)s.type!==3&&r.push(s);e=new ip(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let n=!1;return this.Oa?this.Ba(e)&&(this.xa.next(e),n=!0):this.La(e,this.onlineState)&&(this.ka(e),n=!0),this.Na=e,n}onError(e){this.xa.error(e)}va(e){this.onlineState=e;let n=!1;return this.Na&&!this.Oa&&this.La(this.Na,e)&&(this.ka(this.Na),n=!0),n}La(e,n){if(!e.fromCache||!this.Da())return!0;const r=n!=="Offline";return(!this.options.qa||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||n==="Offline")}Ba(e){if(e.docChanges.length>0)return!0;const n=this.Na&&this.Na.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0}ka(e){e=ip.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Oa=!0,this.xa.next(e)}Da(){return this.options.source!==oR.Cache}}class y3{constructor(e){this.key=e}}class v3{constructor(e){this.key=e}}class Qfe{constructor(e,n){this.query=e,this.Ya=n,this.Za=null,this.hasCachedResults=!1,this.current=!1,this.Xa=Vt(),this.mutatedKeys=Vt(),this.eu=dj(e),this.tu=new Sf(this.eu)}get nu(){return this.Ya}ru(e,n){const r=n?n.iu:new o2,s=n?n.tu:this.tu;let i=n?n.mutatedKeys:this.mutatedKeys,o=s,a=!1;const c=this.query.limitType==="F"&&s.size===this.query.limit?s.last():null,l=this.query.limitType==="L"&&s.size===this.query.limit?s.first():null;if(e.inorderTraversal(((d,h)=>{const p=s.get(d),g=hy(this.query,h)?h:null,_=!!p&&this.mutatedKeys.has(p.key),v=!!g&&(g.hasLocalMutations||this.mutatedKeys.has(g.key)&&g.hasCommittedMutations);let b=!1;p&&g?p.data.isEqual(g.data)?_!==v&&(r.track({type:3,doc:g}),b=!0):this.su(p,g)||(r.track({type:2,doc:g}),b=!0,(c&&this.eu(g,c)>0||l&&this.eu(g,l)<0)&&(a=!0)):!p&&g?(r.track({type:0,doc:g}),b=!0):p&&!g&&(r.track({type:1,doc:p}
101),b=!0,(c||l)&&(a=!0)),b&&(g?(o=o.add(g),i=v?i.add(d):i.delete(d)):(o=o.delete(d),i=i.delete(d)))})),this.query.limit!==null)for(;o.size>this.query.limit;){const d=this.query.limitType==="F"?o.last():o.first();o=o.delete(d.key),i=i.delete(d.key),r.track({type:1,doc:d})}return{tu:o,iu:r,Cs:a,mutatedKeys:i}}su(e,n){return e.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations}applyChanges(e,n,r,s){const i=this.tu;this.tu=e.tu,this.mutatedKeys=e.mutatedKeys;const o=e.iu.ya();o.sort(((d,h)=>(function(g,_){const v=b=>{switch(b){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Xe(20277,{Rt:b})}};return v(g)-v(_)})(d.type,h.type)||this.eu(d.doc,h.doc))),this.ou(r),s=s??!1;const a=n&&!s?this._u():[],c=this.Xa.size===0&&this.current&&!s?1:0,l=c!==this.Za;return this.Za=c,o.length!==0||l?{snapshot:new ip(this.query,e.tu,i,o,e.mutatedKeys,c===0,l,!1,!!r&&r.resumeToken.approximateByteSize()>0),au:a}:{au:a}}va(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({tu:this.tu,iu:new o2,mutatedKeys:this.mutatedKeys,Cs:!1},!1)):{au:[]}}uu(e){return!this.Ya.has(e)&&!!this.tu.has(e)&&!this.tu.get(e).hasLocalMutations}ou(e){e&&(e.addedDocuments.forEach((n=>this.Ya=this.Ya.add(n))),e.modifiedDocuments.forEach((n=>{})),e.removedDocuments.forEach((n=>this.Ya=this.Ya.delete(n))),this.current=e.current)}_u(){if(!this.current)return[];const e=this.Xa;this.Xa=Vt(),this.tu.forEach((r=>{this.uu(r.key)&&(this.Xa=this.Xa.add(r.key))}));const n=[];return e.forEach((r=>{this.Xa.has(r)||n.push(new v3(r))})),this.Xa.forEach((r=>{e.has(r)||n.push(new y3(r))})),n}cu(e){this.Ya=e.Qs,this.Xa=Vt();const n=this.ru(e.documents);return this.applyChanges(n,!0)}lu(){return ip.fromInitialDocuments(this.query,this.tu,this.mutatedKeys,this.Za===0,this.hasCachedResults)}}const Mp="SyncEngine";class Xfe{constructor(e,n,r){this.query=e,this.targetId=n,this.view=r}}class Zfe{constructor(e){this.key=e,this.hu=!1}}class epe{constructor(e,n,r,s,i,o){this.localStore=e,this.remoteStore=n,this.eventManager=r,this.sharedClientState=s,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.Pu={},this.Tu=new rl((a=>lj(a)),XT),this.Iu=new Map,this.Eu=new Set,this.du=new ur(Ge.comparator),this.Au=new Map,this.Ru=new qk,this.Vu={},this.mu=new Map,this.fu=Qd.cr(),this.onlineState="Unknown",this.gu=void 0}get isPrimaryClient(){return this.gu===!0}}async function tpe(t,e,n=!0){const r=cE(t);let s;const i=r.Tu.get(e);return i?(r.sharedClientState.addLocalQueryTarget(i.targetId),s=i.view.lu()):s=await b3(r,e,n,!0),s}async function npe(t,e){const n=cE(t);await b3(n,e,!0,!1)}async function b3(t,e,n,r){const s=await dS(t.localStore,Fi(e)),i=s.targetId,o=t.sharedClientState.addLocalQueryTarget(i,n);let a;return r&&(a=await sN(t,e,i,o==="current",s.resumeToken)),t.isPrimaryClient&&n&&oE(t.remoteStore,s),a}async function sN(t,e,n,r,s){t.pu=(h,p,g)=>(async function(v,b,w,E){let T=b.view.ru(w);T.Cs&&(T=await nR(v.localStore,b.query,!1).then((({documents:S})=>b.view.ru(S,T))));const R=E&&E.targetChanges.get(b.targetId),N=E&&E.targetMismatches.get(b.targetId)!=null,O=b.view.applyChanges(T,v.isPrimaryClient,R,N);return aR(v,b.targetId,O.au),O.snapshot})(t,h,p,g);const i=await nR(t.localStore,e,!0),o=new Qfe(e,i.Qs),a=o.ru(i.documents),c=my.createSynthesizedTargetChangeForCurrentChange(n,r&&t.onlineState!=="Offline",s),l=o.applyChanges(a,t.isPrimaryClient,c);aR(t,n,l.au);const d=new Xfe(e,n,o);return t.Tu.set(e,d),t.Iu.has(n)?t.Iu.get(n).push(e):t.Iu.set(n,[e]),l.snapshot}async function rpe(t,e,n){const r=nt(t),s=r.Tu.get(e),i=r.Iu.get(s.targetId);if(i.length>1)return r.Iu.set(s.targetId,i.filter((o=>!XT(o,e)))),void r.Tu.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(s.targetId),r.sharedCl
101ientState.isActiveQueryTarget(s.targetId)||await rp(r.localStore,s.targetId,!1).then((()=>{r.sharedClientState.clearQueryState(s.targetId),n&&sp(r.remoteStore,s.targetId),op(r,s.targetId)})).catch(Eu)):(op(r,s.targetId),await rp(r.localStore,s.targetId,!0))}async function spe(t,e){const n=nt(t),r=n.Tu.get(e),s=n.Iu.get(r.targetId);n.isPrimaryClient&&s.length===1&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),sp(n.remoteStore,r.targetId))}async function ipe(t,e,n){const r=cN(t);try{const s=await(function(o,a){const c=nt(o),l=an.now(),d=a.reduce(((g,_)=>g.add(_.key)),Vt());let h,p;return c.persistence.runTransaction("Locally write mutations","readwrite",(g=>{let _=Li(),v=Vt();return c.Ns.getEntries(g,d).next((b=>{_=b,_.forEach(((w,E)=>{E.isValidDocument()||(v=v.add(w))}))})).next((()=>c.localDocuments.getOverlayedDocuments(g,_))).next((b=>{h=b;const w=[];for(const E of a){const T=Ahe(E,h.get(E.key).overlayedDocument);T!=null&&w.push(new sl(E.key,T,Zq(T.value.mapValue),Hr.exists(!0)))}return c.mutationQueue.addMutationBatch(g,l,w,a)})).next((b=>{p=b;const w=b.applyToLocalDocumentSet(h,v);return c.documentOverlayCache.saveOverlays(g,b.batchId,w)}))})).then((()=>({batchId:p.batchId,changes:fj(h)})))})(r.localStore,e);r.sharedClientState.addPendingMutation(s.batchId),(function(o,a,c){let l=o.Vu[o.currentUser.toKey()];l||(l=new ur(Et)),l=l.insert(a,c),o.Vu[o.currentUser.toKey()]=l})(r,s.batchId,n),await Au(r,s.changes),await xp(r.remoteStore)}catch(s){const i=aE(s,"Failed to persist write");n.reject(i)}}async function w3(t,e){const n=nt(t);try{const r=await Tfe(n.localStore,e);
101e.targetChanges.forEach(((s,i)=>{const o=n.Au.get(i);o&&(st(s.addedDocuments.size+s.modifiedDocuments.size+s.removedDocuments.size<=1,22616),s.addedDocuments.size>0?o.hu=!0:s.modifiedDocuments.size>0?st(o.hu,14607):s.removedDocuments.size>0&&(st(o.hu,42227),o.hu=!1))})),await Au(n,r,e)}catch(r){await Eu(r)}}function l2(t,e,n){const r=nt(t);if(r.isPrimaryClient&&n===0||!r.isPrimaryClient&&n===1){const s=[];r.Tu.forEach(((i,o)=>{const a=o.view.va(e);a.snapshot&&s.push(a.snapshot)})),(function(o,a){const c=nt(o);c.onlineState=a;let l=!1;c.queries.forEach(((d,h)=>{for(const p of h.Sa)p.va(a)&&(l=!0)})),l&&nN(c)})(r.eventManager,e),s.length&&r.Pu.H_(s),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function ope(t,e,n){const r=nt(t);r.sharedClientState.updateQueryState(e,"rejected",n);const s=r.Au.get(e),i=s&&s.key;if(i){let o=new ur(Ge.comparator);o=o.insert(i,sr.newNoDocument(i,ct.min()));const a=Vt().add(i),c=new py(ct.min(),new Map,new ur(Et),o,a);await w3(r,c),r.du=r.du.remove(i),r.Au.delete(e),aN(r)}else await rp(r.localStore,e,!1).then((()=>op(r,e,n))).catch(Eu)}async function ape(t,e){const n=nt(t),r=e.batch.batchId;try{const s=await Sfe(n.localStore,e);oN(n,r,null),iN(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await Au(n,s)}catch(s){await Eu(s)}}async function cpe(t,e,n){const r=nt(t);try{const s=await(function(o,a){const c=nt(o);return c.persistence.runTransaction("Reject batch","readwrite-primary",(l=>{let d;return c.mutationQueue.lookupMutationBatch(l,a).next((h=>
vendor: 1,955 bytes, line 101
101(st(h!==null,37113),d=h.keys(),c.mutationQueue.removeMutationBatch(l,h)))).next((()=>c.mutationQueue.performConsistencyCheck(l))).next((()=>c.documentOverlayCache.removeOverlaysForBatchId(l,d,a))).next((()=>c.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(l,d))).next((()=>c.localDocuments.getDocuments(l,d)))}))})(r.localStore,e);oN(r,e,n),iN(r,e),r.sharedClientState.updateMutationState(e,"rejected",n),await Au(r,s)}catch(s){await Eu(s)}}function iN(t,e){(t.mu.get(e)||[]).forEach((n=>{n.resolve()})),t.mu.delete(e)}function oN(t,e,n){const r=nt(t);let s=r.Vu[r.currentUser.toKey()];if(s){const i=s.get(e);i&&(n?i.reject(n):i.resolve(),s=s.remove(e)),r.Vu[r.currentUser.toKey()]=s}}function op(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const r of t.Iu.get(e))t.Tu.delete(r),n&&t.Pu.yu(r,n);t.Iu.delete(e),t.isPrimaryClient&&t.Ru.jr(e).forEach((r=>{t.Ru.containsKey(r)||S3(t,r)}))}function S3(t,e){t.Eu.delete(e.path.canonicalString());const n=t.du.get(e);n!==null&&(sp(t.remoteStore,n),t.du=t.du.remove(e),t.Au.delete(n),aN(t))}function aR(t,e,n){for(const r of n)r instanceof y3?(t.Ru.addReference(r.key,e),lpe(t,r)):r instanceof v3?(Le(Mp,"Document no longer in limbo: "+r.key),t.Ru.removeReference(r.key,e),t.Ru.containsKey(r.key)||S3(t,r.key)):Xe(19791,{wu:r})}function lpe(t,e){const n=e.key,r=n.path.canonicalString();t.du.get(n)||t.Eu.has(r)||(Le(Mp,"New document in limbo: "+n),t.Eu.add(r),aN(t))}function aN(t){for(;t.Eu.size>0&&t.du.size<t.maxConcurrentLimboResolutions;){const e=t.Eu.values().next().value;t.Eu.delete(e);const n=new Ge(rn.fromString(e)),r=t.fu.next();t.Au.set(r,new Zfe(n)),t.du=t.du.insert(n,r),oE(t.remoteStore,new wc(Fi(dy(n.path)),r,"TargetPurposeLimboResolution",hi.ce))}}async function Au(t,e,n){const r=nt(t),s=[],i=[],o=[];r.Tu.isEmpty()||(r.Tu.forEach(((a,c)=>{o.push(r.pu(c,e,n).then((l=>{if((l||n)&&r.isPrimaryClient){const d=l?!l.fromCache:n?.targetChanges.get(c.targetId)?.current;
101r.sharedClientState.updateQueryState(c.targetId,d?"current":"not-current")}if(l){s.push(l);const d=Gk.As(c.targetId,l);i.push(d)}})))})),await Promise.all(o),r.Pu.H_(s),await(async function(c,l){const d=nt(c);try{await d.persistence.runTransaction("notifyLocalViewChanges","readwrite",(h=>ae.forEach(l,(p=>ae.forEach(p.Es,(g=>d.persistence.referenceDelegate.addReference(h,p.targetId,g))).next((()=>ae.forEach(p.ds,(g=>d.persistence.referenceDelegate.removeReference(h,p.targetId,g)))))))))}catch(h){if(!Iu(h))throw h;Le(Kk,"Failed to update sequence numbers: "+h)}for(const h of l){const p=h.targetId;if(!h.fromCache){const g=d.Ms.get(p),_=g.snapshotVersion,v=g.withLastLimboFreeSnapshotVersion(_);d.Ms=d.Ms.insert(p,v)}}})(r.localStore,i))}async function upe(t,e){const n=nt(t);if(!n.currentUser.isEqual(e)){Le(Mp,"User change. New user:",e.toKey());const r=await n3(n.localStore,e);n.currentUser=e,(function(i,o){i.mu.forEach((a=>{a.forEach((c=>{c.reject(new Be(we.CANCELLED,o))}))})),i.mu.clear()})(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),await Au(n,r.Ls)}}function dpe(t,e){const n=nt(t),r=n.Au.get(e);if(r&&r.hu)return Vt().add(r.key);{let s=Vt();const i=n.Iu.get(e);if(!i)return s;for(const o of i){const a=n.Tu.get(o);s=s.unionWith(a.view.nu)}return s}}async function hpe(t,e){const n=nt(t),r=await nR(n.localStore,e.query,!0),s=e.view.cu(r);return n.isPrimaryClient&&aR(n,e.targetId,s.au),s}async function fpe(t,e){const n=nt(t);return i3(n.localStore,e).then((r=>Au(n,r)))}async function ppe(t,e,n,r){const s=nt(t),i=await(function(a,c){const l=nt(a),d=nt(l.mutationQueue);return l.persistence.runTransaction("Lookup mutation documents","readonly",(h=>d.er(h,c).next((p=>p?l.localDocuments.getDocuments(h,p):ae.resolve(null)))))})(s.localStore,e);i!==null?(n==="pending"?await xp(s.remoteStore):n==="acknowledged"||n==="rejected"?(oN(s,e,r||null),iN(s,e),(function(a,c){nt(nt(a).mutationQueue).ir(c)})(s.localStore,e)):Xe(6720,"Unknown batchState",{Su:n}),await Au(s,i)):Le(Mp,"Cannot apply mutation batch with id: "+e)}async function mpe(t,e){const n=nt(t);if(cE(n),cN(n),e===!0&&n.gu!==!0){const r=n.sharedClientState.getAllActiveQueryTargets(),s=await u2(n,r.toArray());n.gu=!0,await iR(n.remoteStore,!0);for(const i of s)oE(n.remoteStore,i)}else if(e===!1&&n.gu!==!1){const r=[];let s=Promise.resolve();n.Iu.forEach(((i,o)=>{n.sharedClientState.isLocalQueryTarget(o)?r.push(o):s=s.then((()=>(op(n,o),rp(n.localStore,o,!0)))),sp(n.remoteStore,o)})),await s,await u2(n,r),(function(o){const a=nt(o);a.Au.forEach(((c,l)=>{sp(a.remoteStore,l)})),a.Ru.Jr(),a.Au=new Map,a.du=new ur(Ge.comparator)})(n),n.gu=!1,await iR(n.remoteStore,!1)}}async function u2(t,e,n){const r=nt(t),s=[],i=[];for(const o of e){let a;const c=r.Iu.get(o);if(c&&c.length!==0){a=await dS(r.localStore,Fi(c[0]));for(const l of c){const d=r.Tu.get(l),h=await hpe(r,d);h.snapshot&&i.push(h.snapshot)}}else{const l=await s3(r.localStore,o);a=await dS(r.localStore,l),await sN(r,T3(l),o,!1,a.resumeToken)}s.push(a)}return r.Pu.H_(i),s}function T3(t){return aj(t.path,t.collectionGroup,t.orderBy,t.filters,t.limit,"F",t.startAt,t.endAt)}function gpe(t){return(function(n){return nt(nt(n).persistence).Ts()})(nt(t).localStore)}async function _pe(t,e,n,r){const s=nt(t);if(s.gu)return void Le(Mp,"Ignoring unexpected query state notification.");const i=s.Iu.get(e);if(i&&i.length>0)switch(n){case"current":case"not-current":{const o=await i3(s.localStore,uj(i[0])),a=py.createSynthesizedRemoteEventForCurrentChange(e,n==="current",Lr.EMPTY_BYTE_STRING);await Au(s,o,a);break}case"rejected":await rp(s.localStore,e,!0),op(s,e,r);break;default:Xe(64155,n)}}async function ype(t,e,n){const r=cE(t);if(r.gu){for(const s of e){if(r.Iu.has(s)&&r.sharedClientState.isActiveQueryTarget(s)){Le(Mp,"Adding an already active target "+s);continue}const i=await s3(r.localStore,s),o=await dS(r.localStore,i);await sN(r,T3(i),o.targetId,!1,o.resumeToken),oE(r.remoteStore,o)}for(const s of n)r.Iu.has(s)&&await rp(r.localStore,s,!1).then((()=>{sp(r.remoteStore,s),op(r,s)}
101)).catch(Eu)}}function cE(t){const e=nt(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=w3.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=dpe.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=ope.bind(null,e),e.Pu.H_=Yfe.bind(null,e.eventManager),e.Pu.yu=Jfe.bind(null,e.eventManager),e}function cN(t){const e=nt(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=ape.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=cpe.bind(null,e),e}class w_{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=sE(e.databaseInfo.databaseId),this.sharedClientState=this.Du(e),this.persistence=this.Cu(e),await this.persistence.start(),this.localStore=this.vu(e),this.gcScheduler=this.Fu(e,this.localStore),this.indexBackfillerScheduler=this.Mu(e,this.localStore)}Fu(e,n){return null}Mu(e,n){return null}vu(e){return t3(this.persistence,new e3,e.initialUser,this.serializer)}Cu(e){return new jk(rE.mi,this.serializer)}Du(e){return new u3}async terminate(){this.gcScheduler?.stop(),this.indexBackfillerScheduler?.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}w_.provider={build:()=>new w_};class vpe extends w_{constructor(e){super(),this.cacheSizeBytes=e}Fu(e,n){st(this.persistence.referenceDelegate instanceof uS,46915);const r=this.persistence.referenceDelegate.garbageCollector;return new zj(r,e.asyncQueue,n)}Cu(e){const n=this.cacheSizeBytes!==void 0?Is.withCacheSize(this.cacheSizeBytes):Is.DEFAULT;return new jk((r=>uS.mi(r,n)),this.serializer)}}class E3 extends w_{constructor(e,n,r){super(),this.xu=e,this.cacheSizeBytes=n,this.forceOwnership=r,this.kind="persistent",this.synchronizeTabs=!1}async initialize(e){await super.initialize(e),await this.xu.initialize(this,e),await cN(this.xu.syncEngine),await xp(this.xu.remoteStore),await this.persistence.Ji((()=>(this.gcScheduler&&!this.gcScheduler.started&&this.gcScheduler.start(),this.indexBackfillerScheduler&&!this.indexBackfillerScheduler.started&&this.indexBackfillerScheduler.start(),Promise.resolve())))}vu(e){return t3(this.persistence,new e3,e.initialUser,this.serializer)}Fu(e,n){const r=this.persistence.referenceDelegate.garbageCollector;return new zj(r,e.asyncQueue,n)}Mu(e,n){const r=new kde(n,this.persistence);return new Pde(e.asyncQueue,r)}Cu(e){const n=Zj(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey),r=this.cacheSizeBytes!==void 0?Is.withCacheSize(this.cacheSizeBytes):Is.DEFAULT;return new Wk(this.synchronizeTabs,n,e.clientId,r,e.asyncQueue,d3(),nw(),this.serializer,this.sharedClientState,!!this.forceOwnership)}Du(e){return new u3}}class bpe extends E3{constructor(e,n){super(e,n,!1),this.xu=e,this.cacheSizeBytes=n,this.synchronizeTabs=!0}async initialize(e){await super.initialize(e);const n=this.xu.syncEngine;this.sharedClientState instanceof G0&&(this.sharedClientState.syncEngine={Co:ppe.bind(null,n),vo:_pe.bind(null,n),Fo:ype.bind(null,n),Ts:gpe.bind(null,n),Do:fpe.bind(null,n)},await this.sharedClientState.start()),await this.persistence.Ji((async r=>{await mpe(this.xu.syncEngine,r),this.gcScheduler&&(r&&!this.gcScheduler.started?this.gcScheduler.start():r||this.gcScheduler.stop()),this.indexBackfillerScheduler&&(r&&!this.indexBackfillerScheduler.started?this.indexBackfillerScheduler.start():r||this.indexBackfillerScheduler.stop())}))}Du(e){const n=d3();if(!G0.v(n))throw new Be(we.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");const r=Zj(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey);return new G0(n,e.asyncQueue,r,e.clientId,e.initialUser)}}class S_{async initialize(e,n){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>l2(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=upe.bind(null,this.syncEngine),await iR(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return(function(){return new zfe})()}createDatastore(e){const n=sE(e.databaseInfo.databaseId),r=(function(i){return new kfe(i)})(e.databaseInfo);return(function(i,o,a,c){return new xfe(i,o,a,c)})(e.authCredentials,e.appCheckCredentials,r,n)}createRemoteStore(e){return(function(r,s,i,o,a){return new Mfe(r,s,i,o,a)})(this.localStore,this.datastore,e.asyncQueue,(n=>l2(this.syncEngine,n,0)),(function(){return r2.v()?new r2:new Cfe})())}createSyncEngine(e,n){return(function(s,i,o,a,c,l,d){const h=new epe(s,i,o,a,c,l);return d&&(h.gu=!0),h})(this.localStore,this.remoteStore,this.eventManager,this.sharedCl
vendor: 6,423 bytes, line 101
101ientState,e.initialUser,e.maxConcurrentLimboResolutions,n)}async terminate(){await(async function(n){const r=nt(n);Le(Xd,"RemoteStore shutting down."),r.Ea.add(5),await gy(r),r.Aa.shutdown(),r.Ra.set("Unknown")})(this.remoteStore),this.datastore?.terminate(),this.eventManager?.terminate()}}S_.provider={build:()=>new S_};class lN{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.Ou(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.Ou(this.observer.error,e):Dr("Uncaught Error in snapshot listener:",e.toString()))}Nu(){this.muted=!0}Ou(e,n){setTimeout((()=>{this.muted||e(n)}),0)}}class wpe{constructor(e){this.datastore=e,this.readVersions=new Map,this.mutations=[],this.committed=!1,this.lastTransactionError=null,this.writtenDocs=new Set}async lookup(e){if(this.ensureCommitNotCalled(),this.mutations.length>0)throw this.lastTransactionError=new Be(we.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes."),this.lastTransactionError;const n=await(async function(s,i){const o=nt(s),a={documents:i.map((h=>v_(o.serializer,h)))},c=await o.Ho("BatchGetDocuments",o.serializer.databaseId,rn.emptyPath(),a,i.length),l=new Map;c.forEach((h=>{const p=Fhe(o.serializer,h);l.set(p.key.toString(),p)}));const d=[];return i.forEach((h=>{const p=l.get(h.toString());st(!!p,55234,{key:h}),d.push(p)})),d})(this.datastore,e);return n.forEach((r=>this.recordVersion(r))),n}set(e,n){this.write(n.toMutation(e,this.precondition(e))),this.writtenDocs.add(e.toString())}update(e,n){try{this.write(n.toMutation(e,this.preconditionForUpdate(e)))}catch(r){this.lastTransactionError=r}this.writtenDocs.add(e.toString())}delete(e){this.write(new fy(e,this.precondition(e))),this.writtenDocs.add(e.toString())}async commit(){if(this.ensureCommitNotCalled(),this.lastTransactionError)throw this.lastTransactionError;const e=this.readVersions;this.mutations.forEach((n=>{e.delete(n.key.toString())})),e.forEach(((n,r)=>{const s=Ge.fromPath(r);this.mutations.push(new Lk(s,this.precondition(s)))})),await(async function(r,s){const i=nt(r),o={writes:s.map((a=>b_(i.serializer,a)))};await i.Go("Commit",i.serializer.databaseId,rn.emptyPath(),o)})(this.datastore,this.mutations),this.committed=!0}recordVersion(e){let n;if(e.isFoundDocument())n=e.version;else{if(!e.isNoDocument())throw Xe(50498,{Gu:e.constructor.name});n=ct.min()}const r=this.readVersions.get(e.key.toString());if(r){if(!n.isEqual(r))throw new Be(we.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(e.key.toString(),n)}precondition(e){const n=this.readVersions.get(e.toString());return!this.writtenDocs.has(e.toString())&&n?n.isEqual(ct.min())?Hr.exists(!1):Hr.updateTime(n):Hr.none()}preconditionForUpdate(e){const n=this.readVersions.get(e.toString());if(!this.writtenDocs.has(e.toString())&&n){if(n.isEqual(ct.min()))throw new Be(we.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return Hr.updateTime(n)}return Hr.exists(!0)}write(e){this.ensureCommitNotCalled(),this.mutations.push(e)}ensureCommitNotCalled(){}}class Spe{constructor(e,n,r,s,i){this.asyncQueue=e,this.datastore=n,this.options=r,this.updateFunction=s,this.deferred=i,this.zu=r.maxAttempts,this.M_=new Yk(this.asyncQueue,"transaction_retry")}ju(){this.zu-=1,this.Ju()}Ju(){this.M_.p_((async()=>{const e=new wpe(this.datastore),n=this.Hu(e);n&&n.then((r=>{this.asyncQueue.enqueueAndForget((()=>e.commit().then((()=>{this.deferred.resolve(r)})).catch((s=>{this.Yu(s)}))))})).catch((r=>{this.Yu(r)}))}))}Hu(e){try{const n=this.updateFunction(e);return!ay(n)&&n.catch&&n.then?n:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(n){return this.deferred.reject(n),null}}Yu(e){this.zu>0&&this.Zu(e)?(this.zu-=1,this.asyncQueue.enqueueAndForget((()=>(this.Ju(),Promise.resolve())))):this.deferred.reject(e)}Zu(e){if(e?.name==="FirebaseError"){const n=e.code;return n==="aborted"||n==="failed-precondition"||n==="already-exists"||!Tj(n)}return!1}}const pu="FirestoreClient";class Tpe{constructor(e,n,r,s,i){this.authCredentials=e,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=s,this.user=os.UNAUTHENTICATED,this.clientId=Sk.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=i,this.authCredentials.start(r,(async o=>{Le(pu,"Received user=",o.uid),await this.authCredentialListener(o),this.user=o})),this.appCheckCredentials.start(r,(o=>(Le(pu,"Received new app check token=",o),this.appCheckCredentialListener(o,this.user))))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new mo;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(n){const r=aE(n,"Failed to shutdown persistence");e.reject(r)}})),e.promise}}async function z0(t,e){t.asyncQueue.verifyOperationInProgress(),Le(pu,"Initializing OfflineComponentProvider");const n=t.configuration;await e.initialize(n);let r=n.initialUser;t.setCredentialChangeListener((async s=>{r.isEqual(s)||(await n3(e.localStore,s),r=s)})),e.persistence.setDatabaseDeletedListener((()=>t.terminate())),t._offlineComponents=e}async function d2(t,e){t.asyncQueue.verifyOperationInProgress();const n=await I3(t);Le(pu,"Initializing OnlineComponentProvider"),await e.initialize(n,t.configuration),t.setCredentialChangeListener((r=>i2(e.remoteStore,r))),t.setAppCheckTokenChangeListener(((r,s)=>i2(e.remoteStore,s))),t._onlineComponents=e}async function I3(t){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){Le(pu,"Using user provided OfflineComponentProvider");try{await z0(t,t._uninitializedComponentsProvider._offline)}catch(e){const n=e;if(!(function(s){return s.name==="FirebaseError"?s.code===we.FAILED_PRECONDITION||s.code===we.UNIMPLEMENT
101ED:!(typeof DOMException<"u"&&s instanceof DOMException)||s.code===22||s.code===20||s.code===11})(n))throw n;Hf("Error using user provided cache. Falling back to memory cache: "+n),await z0(t,new w_)}}else Le(pu,"Using default OfflineComponentProvider"),await z0(t,new vpe(void 0));return t._offlineComponents}async function uN(t){return t._onlineComponents||(t._uninitializedComponentsProvider?(Le(pu,"Using user provided OnlineComponentProvider"),await d2(t,t._uninitializedComponentsProvider._online)):(Le(pu,"Using default OnlineComponentProvider"),await d2(t,new S_))),t._onlineComponents}function Epe(t){return I3(t).then((e=>e.localStore))}function Ipe(t){return uN(t).then((e=>e.syncEngine))}function Cpe(t){return uN(t).then((e=>e.datastore))}async function mS(t){const e=await uN(t),n=e.eventManager;return n.onListen=tpe.bind(null,e.syncEngine),n.onUnlisten=rpe.bind(null,e.syncEngine),n.onFirstRemoteStoreListen=npe.bind(null,e.syncEngine),n.onLastRemoteStoreUnlisten=spe.bind(null,e.syncEngine),n}function Ape(t,e){const n=new mo;return t.asyncQueue.enqueueAndForget((async()=>(async function(s,i,o){try{const a=await(function(l,d){const h=nt(l);return h.persistence.runTransaction("read document","readonly",(p=>h.localDocuments.getDocument(p,d)))})(s,i);a.isFoundDocument()?o.resolve(a):a.isNoDocument()?o.resolve(null):o.reject(new Be(we.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)"))}catch(a){const c=aE(a,`Failed to get document '${i} from cache`);o.reject(c)}})(await Epe(t),e,n))),n.promise}function C3(t,e,n={}){const r=new mo;return t.asyncQueue.enqueueAndForget((async()=>(function(i,o,a,c,l){const d=new lN({next:p=>{d.Nu(),o.enqueueAndForget((()=>tN(i,h)));const g=p.docs.has(a);!g&&p.fromCache?l.reject(new Be(we.UNAVAILABLE,"Failed to get document because the client is offline.")):g&&p.fromCache&&c&&c.source==="server"?l.reject(new Be(we.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):l.resolve(p)},error:p=>l.reject(p)}),h=new rN(dy(a.path),d,{includeMetadataChanges:!0,qa:!0});return eN(i,h)})(await mS(t),t.asyncQueue,e,n,r))),r.promise}function Rpe(t,e,n={}){const r=new mo;return t.asyncQueue.enqueueAndForget((async()=>(function(i,o,a,c,l){const d=new lN({next:p=>{d.Nu(),o.enqueueAndForget((()=>tN(i,h))),p.fromCache&&c.source==="server"?l.reject(new Be(we.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):l.resolve(p)},error:p=>l.reject(p)}),h=new rN(a,d,{includeMetadataChanges:!0,qa:!0});return eN(i,h)})(await mS(t),t.asyncQueue,e,n,r))),r.promise}function A3(t){const e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}const h2=new Map;const R3="firestore.googleapis.com",f2=!0;class p2{constructor(e){if(e.host===void 0){if(e.ssl!==void 0)throw new Be(we.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=R3,this.ssl=f2}else this.host=e.host,this.ssl=e.ssl??f2;if(this.isUsingEmulator=e.emulatorOptions!==void 0,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=qj;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<Kj)throw new Be(we.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}Cde("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=A3(e.experimentalLongPollingOptions??{}),(function(r){if(r.timeoutSeconds!==void 0){if(isNaN(r.timeoutSeconds))throw new Be(we.INVALID_ARGUMENT,`invalid long polling timeout: ${r.timeoutSeconds} (must not be NaN)`);if(r.timeoutSeconds<5)throw new Be(we.INVALID_ARGUMENT,`invalid long polling timeout: ${r.timeoutSeconds} (minimum allowed value is 5)`);if(r.timeoutSeconds>30)throw new Be(we.INVALID_ARGUMENT,`invalid long polling timeout: ${r.timeoutSeconds} (maximum allowed value is 30)`)}})(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&(function(r,s){return r.timeoutSeconds===s.timeoutSeconds})(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class lE{constructor(e,n,r,s){this._authCredentials=e,this._appCheckCredentials=n,this._databaseId=r,this._app=s,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new p2({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new Be(we.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new Be(we.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new p2(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=(function(r){if(!r)return new gde;switch(r.type){case"firstParty":return new bde(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new Be(we.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invali
101d credential type")}})(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return(function(n){const r=h2.get(n);r&&(Le("ComponentProvider","Removing Datastore"),h2.delete(n),r.terminate())})(this),Promise.resolve()}}function Ppe(t,e,n,r={}){t=ds(t,lE);const s=$a(e),i=t._getSettings(),o={...i,emulatorOptions:t._getEmulatorOptions()},a=`${e}:${n}`;s&&(sy(`https://${a}`),UT("Firestore",!0)),i.host!==R3&&i.host!==a&&Hf("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const c={...i,host:a,ssl:s,emulatorOptions:r};if(!Wc(c,o)&&(t._setSettings(c),r.mockUserToken)){let l,d;if(typeof r.mockUserToken=="string")l=r.mockUserToken,d=os.MOCK_USER;else{l=_k(r.mockUserToken,t._app?.options.projectId);const h=r.mockUserToken.sub||r.mockUserToken.user_id;if(!h)throw new Be(we.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");d=new os(h)}t._authCredentials=new _de(new Eq(l,d))}}class dh{constructor(e,n,r){this.converter=n,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new dh(this.firestore,e,this._query)}}class Qn{constructor(e,n,r){this.converter=n,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Xl(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new Qn(this.firestore,e,this._key)}toJSON(){return{type:Qn._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,n,r){if(oy(n,Qn._jsonSchema))return new Qn(e,r||null,new Ge(rn.fromString(n.referencePath)))}}Qn._jsonSchemaVersion="firestore/documentReference/1.0",Qn._jsonSchema={type:jr("string",Qn._jsonSchemaVersion),referencePath:jr("string")};class Xl extends dh{constructor(e,n,r){super(e,n,dy(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new Qn(this.firestore,null,new Ge(e))}withConverter(e){return new Xl(this.firestore,e,this._path)}}function cR(t,e,...n){if(t=wn(t),Cq("collection","path",e),t instanceof lE){const r=rn.fromString(e,...n);return sM(r),new Xl(t,null,r)}{if(!(t instanceof Qn||t instanceof Xl))throw new Be(we.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(rn.fromString(e,...n));return sM(r),new Xl(t.firestore,null,r)}}function $n(t,e,...n){if(t=wn(t),arguments.length===1&&(e=Sk.newId()),Cq("doc","path",e),t instanceof lE){const r=rn.fromString(e,...n);return rM(r),new Qn(t,null,new Ge(r))}{if(!(t instanceof Qn||t instanceof Xl))throw new Be(we.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(rn.fromString(e,...n));return rM(r),new Qn(t.firestore,t instanceof Xl?t.converter:null,new Ge(r))}}const m2="AsyncQueue";class g2{constructor(e=Promise.resolve()){this.Xu=[],this.ec=!1,this.tc=[],this.nc=null,this.rc=!1,this.sc=!1,this.oc=[],this.M_=new Yk(this,"async_queue_retry"),this._c=()=>{const r=nw();r&&Le(m2,"Visibility state changed to "+r.visibilityState),this.M_.w_()},this.ac=e;const n=nw();n&&typeof n.addEventListener=="function"&&n.addEventListener("visibilitychange",this._c)}get isShuttingDown(){return this.ec}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.uc(),this.cc(e)}enterRestrictedMode(e){if(!this.ec){this.ec=!0,this.sc=e||!1;const n=nw();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this._c)}}enqueue(e){if(this.uc(),this.ec)return new Promise((()=>{}));const n=new mo;return this.cc((()=>this.ec&&this.sc?Promise.resolve():(e().then(n.resolve,n.reject),n.promise))).then((()=>n.promise))}enqueueRetryable(e){this.enqueueAndForget((()=>(this.Xu.push(e),this.lc())))}async lc(){if(this.Xu.length!==0){try{await this.Xu[0](),this.Xu.shift(),this.M_.reset()}catch(e){if(!Iu(e))throw e;Le(m2,"Operation failed with retryable error: "+e)}this.Xu.length>0&&this.M_.p_((()=>this.lc()))}}cc(e){const n=this.ac.then((()=>(this.rc=!0,e().catch((r=>{throw this.nc=r,this.rc=!1,Dr("INTERNAL UNHANDLED ERROR: ",_2(r)),r})).then((r=>(this.rc=!1,r))))));return this.ac=n,n}enqueueAfterDelay(e,n,r){this.uc(),this.oc.indexOf(e)>-1&&(n=0);const s=Zk.createAndSchedule(this,e,n,r,(i=>this.hc(i)));return this.tc.push(s),s}uc(){this.nc&&Xe(47125,{Pc:_2(this.nc)})}verifyOperationInProgress(){}async Tc(){let e;do e=this.ac,await e;while(e!==this.ac)}Ic(e){for(const n of this.tc)if(n.timerId===e)return!0;return!1}Ec(e){return this.Tc().then((()=>{this.tc.sort(((n,r)=>n.targetTimeMs-r.targetTimeMs));for(const n of this.tc)if(n.skipDelay(),e!=="all"&&n.timerId===e)break;return this.Tc()}))}dc(e){this.oc.push(e)}hc(e){const n=this.tc.indexOf(e);this.tc.splice(n,1)}}function _2(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+` 102`+t.stack),e}function y2(t){return(function(n,r){if(typeof n!="object"||n===null)return!1;const s=n;for(const i of r)if(i in s&&typeof s[i]=="function")return!0;return!1})(t,["next","error","complete"])}class Yo extends lE{constructor(e,n,r,s){super(e,n,r,s),this.type="firestore",this._queue=new g2,this._persistenceKey=s?.name||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new g2(e),this._firestoreClient=void 0,await e}}}function kpe(t,e,n){n||(n=p_);const r=Np(t,"firestore");if(r.isInitialized(n)){const s=r.getImmediate({identifier:n}),i=r.getOptions(n);if(Wc(i,e))return s;throw new Be(we.FAILED_PRECONDITION,"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.")}if(e.cacheSizeBytes!==void 0&&e.localCache!==void 0)throw new Be(we.INVALID_ARGUMENT,"cache and cacheSizeBytes cannot be specified at the same time as cacheSizeBytes willbe deprecated. Instead, specify the cache size in the cache object");
102if(e.cacheSizeBytes!==void 0&&e.cacheSizeBytes!==-1&&e.cacheSizeBytes<Kj)throw new Be(we.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return e.host&&$a(e.host)&&sy(e.host),r.initialize({options:e,instanceIdentifier:n})}function Npe(t,e){const n=typeof t=="object"?t:jT(),r=typeof t=="string"?t:p_,s=Np(n,"firestore").getImmediate({identifier:r});if(!s._initialized){const i=gk("firestore");i&&Ppe(s,...i)}return s}function hh(t){if(t._terminated)throw new Be(we.FAILED_PRECONDITION,"The client has already been terminated.");return t._firestoreClient||Dpe(t),t._firestoreClient}function Dpe(t){const e=t._freezeSettings(),n=(function(s,i,o,a){return new she(s,i,o,a.host,a.ssl,a.experimentalForceLongPolling,a.experimentalAutoDetectLongPolling,A3(a.experimentalLongPollingOptions),a.useFetchStreams,a.isUsingEmulator)})(t._databaseId,t._app?.options.appId||"",t._persistenceKey,e);t._componentsProvider||e.localCache?._offlineComponentProvider&&e.localCache?._onlineComponentProvider&&(t._componentsProvider={_offline:e.localCache._offlineComponentProvider,_online:e.localCache._onlineComponentProvider}),t._firestoreClient=new Tpe(t._authCredentials,t._appCheckCredentials,t._queue,n,t._componentsProvider&&(function(s){const i=s?._online.build();return{_offline:s?._offline.build(i),_online:i}})(t._componentsProvider))}class xi{constructor(e){this._byteString=e}static fromBase64String(e){try{return new xi(Lr.fromBase64String(e))}catch(n){throw new Be(we.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}}static fromUint8Array(e){return new xi(Lr.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:xi._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(oy(e,xi._jsonSchema))return xi.fromBase64String(e.bytes)}}xi._jsonSchemaVersion="firestore/bytes/1.0",xi._jsonSchema={type:jr("string",xi._jsonSchemaVersion),bytes:jr("string")};class _y{constructor(...e){for(let n=0;n<e.length;++n)if(e[n].length===0)throw new Be(we.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new cr(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}class uE{constructor(e){this._methodName=e}}class Ta{constructor(e,n){if(!isFinite(e)||e<-90||e>90)throw new Be(we.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new Be(we.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=e,this._long=n}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return Et(this._lat,e._lat)||Et(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:Ta._jsonSchemaVersion}}static fromJSON(e){if(oy(e,Ta._jsonSchema))return new Ta(e.latitude,e.longitude)}}Ta._jsonSchemaVersion="firestore/geoPoint/1.0",Ta._jsonSchema={type:jr("string",Ta._jsonSchemaVersion),latitude:jr("number"),longitude:jr("number")};class Ea{constructor(e){this._values=(e||[]).map((n=>n))}toArray(){return this._values.map((e=>e))}isEqual(e){return(function(r,s){if(r.length!==s.length)return!1;for(let i=0;i<r.length;++i)if(r[i]!==s[i])return!1;return!0})(this._values,e._values)}toJSON(){return{type:Ea._jsonSchemaVersion,vectorValues:this._values}}static fromJSON(e){if(oy(e,Ea._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every((n=>typeof n=="number")))return new Ea(e.vectorValues);throw new Be(we.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}Ea._jsonSchemaVersion="firestore/vectorValue/1.0",Ea._jsonSchema={type:jr("string",Ea._jsonSchemaVersion),vectorValues:jr("object")};const Ope=/^__.*__$/;class xpe{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return this.fieldMask!==null?new sl(e,this.data,this.fieldMask,n,this.fieldTransforms):new Op(e,this.data,n,this.fieldTransforms)}}class P3{constructor(e,n,r){this.data=e,this.fieldMask=n,this.fieldTransforms=r}toMutation(e,n){return new sl(e,this.data,this.fieldMask,n,this.fieldTransforms)}}function k3(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Xe(40011,{Ac:t})}}class dN{constructor(e,n,r,s,i,o){this.settings=e,this.databaseId=n,this.serializer
102=r,this.ignoreUndefinedProperties=s,i===void 0&&this.Rc(),this.fieldTransforms=i||[],this.fieldMask=o||[]}get path(){return this.settings.path}get Ac(){return this.settings.Ac}Vc(e){return new dN({...this.settings,...e},this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}mc(e){const n=this.path?.child(e),r=this.Vc({path:n,fc:!1});return r.gc(e),r}yc(e){const n=this.path?.child(e),r=this.Vc({path:n,fc:!1});return r.Rc(),r}wc(e){return this.Vc({path:void 0,fc:!0})}Sc(e){return gS(e,this.settings.methodName,this.settings.bc||!1,this.path,this.settings.Dc)}contains(e){return this.fieldMask.find((n=>e.isPrefixOf(n)))!==void 0||this.fieldTransforms.find((n=>e.isPrefixOf(n.field)))!==void 0}Rc(){if(this.path)for(let e=0;e<this.path.length;e++)this.gc(this.path.get(e))}gc(e){if(e.length===0)throw this.Sc("Document fields must not be empty");if(k3(this.Ac)&&Ope.test(e))throw this.Sc('Document fields cannot begin and end with "__"')}}class Lpe{constructor(e,n,r){this.databaseId=e,this.ignoreUndefinedProperties=n,this.serializer=r||sE(e)}Cc(e,n,r,s=!1){return new dN({Ac:e,methodName:n,Dc:r,path:cr.emptyPath(),fc:!1,bc:s},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function dE(t){const e=t._freezeSettings(),n=sE(t._databaseId);return new Lpe(t._databaseId,!!e.ignoreUndefinedProperties,n)}function N3(t,e,n,r,s,i={}){const o=t.Cc(i.merge||i.mergeFields?2:0,e,n,s);fN("Data must be an object, but it was:",o,r);const a=x3(r,o);let c,l;if(i.merge)c=new fi(o.fieldMask),l=o.fieldTransforms;else if(i.mergeFields){const d=[];for(const h of i.mergeFields){const p=lR(e,h,n);if(!o.contains(p))throw new Be(we.INVALID_ARGUMENT,`Field '${p}' is specified in your field mask but missing from your input data.`);M3(d,p)||d.push(p)}c=new fi(d),l=o.fieldTransforms.filter((h=>c.covers(h.field)))}else c=null,l=o.fieldTransforms;return new xpe(new _s(a),c,l)}class yy extends uE{_toFieldTransform(e){if(e.Ac!==2)throw e.Ac===1?e.Sc(`${this._methodName}() can only appear at the top level of your update data`):e.Sc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof yy}}class hN extends uE{_toFieldTransform(e){return new bj(e.path,new Zf)}isEqual(e){return e instanceof hN}}function D3(t,e,n,r){const s=t.Cc(1,e,n);fN("Data must be an object, but it was:",s,r);const i=[],o=_s.empty();Cu(r,((c,l)=>{const d=pN(e,c,n);l=wn(l);const h=s.yc(d);if(l instanceof yy)i.push(d);else{const p=vy(l,h);p!=null&&(i.push(d),o.set(d,p))}}));const a=new fi(i);return new P3(o,a,s.fieldTransforms)}function O3(t,e,n,r,s,i){const o=t.Cc(1,e,n),a=[lR(e,r,n)],c=[s];if(i.length%2!=0)throw new Be(we.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let p=0;p<i.length;p+=2)a.push(lR(e,i[p])),c.push(i[p+1]);const l=[],d=_s.empty();for(let p=a.length-1;p>=0;--p)if(!M3(l,a[p])){const g=a[p];let _=c[p];_=wn(_);const v=o.yc(g);if(_ instanceof yy)l.push(g);else{const b=vy(_,v);b!=null&&(l.push(g),d.set(g,b))}}const h=new fi(l);return new P3(d,h,o.fieldTransforms)}function Mpe(t,e,n,r=!1){return vy(n,t.Cc(r?4:3,e))}function vy(t,e){if(L3(t=wn(t)))return fN("Unsupported field value:",e,t),x3(t,e);if(t instanceof uE)return(function(r,s){if(!k3(s.Ac))throw s.Sc(`${r._methodName}() can only be used with update() and set()`);if(!s.path)throw s.Sc(`${r._methodName}() is not currently supported inside arrays`);const i=r._toFieldTransform(s);i&&s.fieldTransforms.push(i)})(t,e),null;if(t===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.fc&&e.Ac!==4)throw e.Sc("Nested arrays are not supported");return(function(r,s){const i=[];let o=0;for(const a of r){let c=vy(a,s.wc(o));c==null&&(c={nullValue:"NULL_VALUE"}),i.push(c),o++}return{arrayValue:{values:i}}})(t,e)}return(function(r,s){if((r=wn(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return whe(s.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){const i=an.fromDate(r);return{timestampValue:np(s.serializer,i)}}if(r instanceof an){const i=new an(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:np(s.serializer,i)}}if(r instanceof Ta)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof xi)return{bytesValue:Aj(s.serializer,r._byteString)};if(r instanceof Qn){const i=s.databaseId,o=r.firestore._databaseId;if(!o.isEqual(i))throw s.Sc(`Document reference is for database ${o.projectId}/${o.database} but should be for database ${i.projectId}/${i.database}`);return{referenceValue:$k(r.firestore._databaseId||s.databaseId,r._key.path)}}if(r instanceof Ea)return(function(o,a){return{mapValue:{fields:{[kk]:{stringValue:Nk},[Yf]:{arrayValue:{values:o.toArray().map((l=>{if(typeof l!="number")throw a.Sc("VectorValues must only contain numeric values.");return xk(a.serializer,l)}))}}}}}})(r,s);throw s.Sc(`Unsupported field value: ${WT(r)}`)})(t,e)}function x3(t,e){const n={};return jq(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Cu(t,((r,s)=>{const i=vy(s,e.mc(r));i!=null&&(n[r]=i)})),{mapValue:{fields:n}}}function L3(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof an||t instanceof Ta||t instanceof xi||t instanceof Qn||t instanceof uE||t instanceof Ea)}function fN(t,e,n){if(!L3(n)||!Aq(n)){const r=WT(n);throw r==="an object"?e.Sc(t+" a custom object"):e.Sc(t+" "+r)}}
102function lR(t,e,n){if((e=wn(e))instanceof _y)return e._internalPath;if(typeof e=="string")return pN(t,e);throw gS("Field path arguments must be of type string or ",t,!1,void 0,n)}const Vpe=new RegExp("[~\\*/\\[\\]]");function pN(t,e,n){if(e.search(Vpe)>=0)throw gS(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new _y(...e.split("."))._internalPath}catch{throw gS(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function gS(t,e,n,r,s){const i=r&&!r.isEmpty(),o=s!==void 0;let a=`Function ${e}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let c="";return(i||o)&&(c+=" (found",i&&(c+=` in field ${r}`),o&&(c+=` in document ${s}`),c+=")"),new Be(we.INVALID_ARGUMENT,a+t+c)}function M3(t,e){return t.some((n=>n.isEqual(e)))}class _S{constructor(e,n,r,s,i){this._firestore=e,this._userDataWriter=n,this._key=r,this._document=s,this._converter=i}get id(){return this._key.path.lastSegment()}get ref(){return new Qn(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new Fpe(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const n=this._document.data.field(mN("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}}}class Fpe extends _S{data(){return super.data()}}function mN(t,e){return typeof e=="string"?pN(t,e):e instanceof _y?e._internalPath:e._delegate._internalPath}function V3(t){if(t.limitType==="L"&&t.explicitOrderBy.length===0)throw new Be(we.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class gN{}let Bpe=class extends gN{};function $pe(t,e,...n){let r=[];e instanceof gN&&r.push(e),r=r.concat(n),(function(i){const o=i.filter((c=>c instanceof _N)).length,a=i.filter((c=>c instanceof hE)).length;if(o>1||o>0&&a>0)throw new Be(we.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")})(r);for(const s of r)t=s._apply(t);return t}class hE extends Bpe{constructor(e,n,r){super(),this._field=e,this._op=n,this._value=r,this.type="where"}static _create(e,n,r){return new hE(e,n,r)}_apply(e){const n=this._parse(e);return F3(e._query,n),new dh(e.firestore,e.converter,KA(e._query,n))}_parse(e){const n=dE(e.firestore);return(function(i,o,a,c,l,d,h){let p;if(l.isKeyField()){if(d==="array-contains"||d==="array-contains-any")throw new Be(we.INVALID_ARGUMENT,`Invalid Query. You can't perform '${d}' queries on documentId().`);if(d==="in"||d==="not-in"){w2(h,d);const _=[];for(const v of h)_.push(b2(c,i,v));p={arrayValue:{values:_}}}else p=b2(c,i,h)}else d!=="in"&&d!=="not-in"&&d!=="array-contains-any"||w2(h,d),p=Mpe(a,o,h,d==="in"||d==="not-in");return Qt.create(l,d,p)})(e._query,"where",n,e.firestore._databaseId,this._field,this._op,this._value)}}function v2(t,e,n){const r=e,s=mN("where",t);return hE._create(s,r,n)}class _N extends gN{constructor(e,n){super(),this.type=e,this._queryConstraints=n}static _create(e,n){return new _N(e,n)}_parse(e){const n=this._queryConstraints.map((r=>r._parse(e))).filter((r=>r.getFilters().length>0));return n.length===1?n[0]:xn.create(n,this._getOperator())}_apply(e){const n=this._parse(e);return n.getFilters().length===0?e:((function(s,i){let o=s;const a=i.getFlattenedFilters();for(const c of a)F3(o,c),o=KA(o,c)})(e._query,n),new dh(e.firestore,e.converter,KA(e._query,n)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}function b2(t,e,n){if(typeof(n=wn(n))=="string"){if(n==="")throw new Be(we.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!cj(e)&&n.indexOf("/")!==-1)throw new Be(we.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);const r=e.path.child(rn.fromString(n));
102if(!Ge.isDocumentKey(r))throw new Be(we.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return g_(t,new Ge(r))}if(n instanceof Qn)return g_(t,n._key);throw new Be(we.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${WT(n)}.`)}function w2(t,e){if(!Array.isArray(t)||t.length===0)throw new Be(we.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function F3(t,e){const n=(function(s,i){for(const o of s)for(const a of o.getFlattenedFilters())if(i.indexOf(a.op)>=0)return a.op;return null})(t.filters,(function(s){switch(s){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}})(e.op));if(n!==null)throw n===e.op?new Be(we.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new Be(we.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}class B3{convertValue(e,n="none"){switch(du(e)){case 0:return null;case 1:return e.booleanValue;case 2:return nr(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,n);case 5:return e.stringValue;case 6:return this.convertBytes(Yc(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,n);case 11:return this.convertObject(e.mapValue,n);case 10:return this.convertVectorValue(e.mapValue);default:throw Xe(62114,{value:e})}}convertObject(e,n){return this.convertObjectMap(e.fields,n)}convertObjectMap(e,n="none"){const r={};return Cu(e,((s,i)=>{r[s]=this.convertValue(i,n)})),r}convertVectorValue(e){const n=e.fields?.[Yf].arrayValue?.values?.map((r=>nr(r.doubleValue)));return new Ea(n)}convertGeoPoint(e){return new Ta(nr(e.latitude),nr(e.longitude))}convertArray(e,n){return(e.values||[]).map((r=>this.convertValue(r,n)))}convertServerTimestamp(e,n){switch(n){case"previous":const r=JT(e);return r==null?null:this.convertValue(r,n);case"estimate":return this.convertTimestamp(f_(e));default:return null}}convertTimestamp(e){const n=zc(e);return new an(n.seconds,n.nanos)}convertDocumentKey(e,n){const r=rn.fromString(e);st(Vj(r),9688,{name:e});const s=new Kd(r.get(1),r.get(3)),i=new Ge(r.popFirst(5));return s.isEqual(n)||Dr(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),i}}function $3(t,e,n){let r;return r=t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e,r}class Upe extends B3{constructor(e){super(),this.firestore=e}convertBytes(e){return new xi(e)}convertReference(e){const n=this.convertDocumentKey(e,this.firestore._databaseId);return new Qn(this.firestore,null,n)}}class yd{constructor(e,n){this.hasPendingWrites=e,this.fromCache=n}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class Dc extends _S{constructor(e,n,r,s,i,o){super(e,n,r,s,o),this._firestore=e,this._firestoreImpl=e,this.metadata=i}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const n=new rw(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,n={}){if(this._document){const r=this._document.data.field(mN("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,n.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new Be(we.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,n={};return n.type=Dc._jsonSchemaVersion,n.bundle="",n.bundleSource="DocumentSnapshot",n.bundleName=this._key.toString(),!e||!e.isValidDocument()||!e.isFoundDocument()?n:(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),n.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),n)}}Dc._jsonSchemaVersion="firestore/documentSnapshot/1.0",Dc._jsonSchema={type:jr("string",Dc._jsonSchemaVersion),bundleSource:jr("string","DocumentSnapshot"),bundleName:jr("string"),bundle:jr("string")};class rw extends Dc{data(e={}){return super.data(e)}}class Ld{constructor(e,n,r,s){this._firestore=e,this._userDataWriter=n,this._snapshot=s,this.metadata=new yd(s.hasPendingWrites,s.fromCache),this.query=r}get docs(){const e=[];return this.forEach((n=>e.push(n))),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,n){this._snapshot.docs.forEach((r=>{e.call(n,new rw(this._firestore,this._userDataWriter,r.key,r,new yd(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))}))}docChanges(e={}){const n=!!e.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new Be(we.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=(function(s,i){if
102(s._snapshot.oldDocs.isEmpty()){let o=0;return s._snapshot.docChanges.map((a=>{const c=new rw(s._firestore,s._userDataWriter,a.doc.key,a.doc,new yd(s._snapshot.mutatedKeys.has(a.doc.key),s._snapshot.fromCache),s.query.converter);return a.doc,{type:"added",doc:c,oldIndex:-1,newIndex:o++}}))}{let o=s._snapshot.oldDocs;return s._snapshot.docChanges.filter((a=>i||a.type!==3)).map((a=>{const c=new rw(s._firestore,s._userDataWriter,a.doc.key,a.doc,new yd(s._snapshot.mutatedKeys.has(a.doc.key),s._snapshot.fromCache),s.query.converter);let l=-1,d=-1;return a.type!==0&&(l=o.indexOf(a.doc.key),o=o.delete(a.doc.key)),a.type!==1&&(o=o.add(a.doc),d=o.indexOf(a.doc.key)),{type:Hpe(a.type),doc:c,oldIndex:l,newIndex:d}}))}})(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new Be(we.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=Ld._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=Sk.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const n=[],r=[],s=[];return this.docs.forEach((i=>{i._document!==null&&(n.push(i._document),r.push(this._userDataWriter.convertObjectMap(i._document.data.value.mapValue.fields,"previous")),s.push(i.ref.path))})),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function Hpe(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Xe(61501,{type:t})}}function mu(t){t=ds(t,Qn);const e=ds(t.firestore,Yo);return C3(hh(e),t._key).then((n=>vN(e,t,n)))}Ld._jsonSchemaVersion="firestore/querySnapshot/1.0",Ld._jsonSchema={type:jr("string",Ld._jsonSchemaVersion),bundleSource:jr("string","QuerySnapshot"),bundleName:jr("string"),bundle:jr("string")};class by extends B3{constructor(e){super(),this.firestore=e}convertBytes(e){return new xi(e)}convertReference(e){const n=this.convertDocumentKey(e,this.firestore._databaseId);return new Qn(this.firestore,null,n)}}function qpe(t){t=ds(t,Qn);const e=ds(t.firestore,Yo),n=hh(e),r=new by(e);return Ape(n,t._key).then((s=>new Dc(e,r,t._key,s,new yd(s!==null&&s.hasLocalMutations,!0),t.converter)))}function U3(t){t=ds(t,Qn);const e=ds(t.firestore,Yo);return C3(hh(e),t._key,{source:"server"}).then((n=>vN(e,t,n)))}function jpe(t){t=ds(t,dh);const e=ds(t.firestore,Yo),n=hh(e),r=new by(e);return V3(t._query),Rpe(n,t._query).then((s=>new Ld(e,r,t,s)))}function Ws(t,e,n){t=ds(t,Qn);const r=ds(t.firestore,Yo),s=$3(t.converter,e,n);return yN(r,[N3(dE(r),"setDoc",t._key,s,t.converter!==null,n).toMutation(t._key,Hr.none())])}function uR(t,e,n,...r){t=ds(t,Qn);const s=ds(t.firestore,Yo),i=dE(s);let o;return o=typeof(e=wn(e))=="string"||e instanceof _y?O3(i,"updateDoc",t._key,e,n,r):D3(i,"updateDoc",t._key,e),yN(s,[o.toMutation(t._key,Hr.exists(!0))])}function yS(t){return yN(ds(t.firestore,Yo),[new fy(t._key,Hr.none())])}function xo(t,...e){t=wn(t);let n={includeMetadataChanges:!1,source:"default"},r=0;typeof e[r]!="object"||y2(e[r])||(n=e[r++]);const s={includeMetadataChanges:n.includeMetadataChanges,source:n.source};if(y2(e[r])){const c=e[r];e[r]=c.next?.bind(c),e[r+1]=c.error?.bind(c),e[r+2]=c.complete?.bind(c)}let i,o,a;if(t instanceof Qn)o=ds(t.firestore,Yo),a=dy(t._key.path),i={next:c=>{e[r]&&e[r](vN(o,t,c))},error:e[r+1],complete:e[r+2]};else{const c=ds(t,dh);o=ds(c.firestore,Yo),a=c._query;const l=new by(o);i={next:d=>{e[r]&&e[r](new Ld(o,l,c,d))},error:e[r+1],complete:e[r+2]},V3(t._query)}return(function(l,d,h,p){const g=new lN(p),_=new rN(d,g,h);return l.asyncQueue.enqueueAndForget((async()=>eN(await mS(l),_))),()=>{g.Nu(),l.asyncQueue.enqueueAndForget((async()=>tN(await mS(l),_)))}})(hh(o),a,s,i)}function yN(t,e){return(function(r,s){const i=new mo;return r.asyncQueue.enqueueAndForget((async()=>ipe(await Ipe(r),s,i))),i.promise})(hh(t),e)}function vN(t,e,n){const r=n.docs.get(e._key),s=new by(t);return new Dc(t,s,e._key,r,new yd(n.hasPendingWrites,n.fromCache),e.converter)}class Wpe{constructor(e){let n;this.kind="persistent",e?.tabManager?(e.tabManager._initialize(e),n=e.tabManager):(n=Ype(void 0),n._initialize(e)),this._onlineComponentProvider=n._onlineComponentProvider,this._offlineComponentProvider=n._offlineComponentProvider}toJSON(){return{kind:this.kind}}}function Gpe(t){return new Wpe(t)}class Kpe{constructor(e){this.forceOwnership=e,this.kind="persistentSingleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=S_.provider,this._offlineComponentProvider={build:n=>new E3(n,e?.cacheSizeBytes,this.forceOwnership)}}}class zpe{constructor(){this.kind="PersistentMultipleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=S_.provider,this._offlineComponentProvider={build:n=>new bpe(n,e?.cacheSizeBytes)}}}function Ype(t){return new Kpe(t?.forceOwnership)}function Jpe(){return new zpe}const Qpe={maxAttempts:5};function hg(t,e){if((t=wn(t)).firestore!==e)throw new Be(we.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}class Xpe{constructor(e,n){this._firestore=e,this._transaction=n,this._dataReader=dE(e)}get(e){const n=hg(e,this._firestore),r=new Upe(this._firestore);return this._transaction.lookup([n._key]).then((s=>{if(!s||s.length!==1)return Xe(24041);const i=s[0];if(i.isFoundDocument())return new _S(this._firestore,r,i.key,i,n.converter);if(i.isNoDocument())return new _S(this._firestore,r,n._key,null,n.converter);throw Xe(18433,{doc:i})}))}set(e,n,r){const s=hg(e,this._firestore),i=$3(s.converter,n,r),o=N3(this._dataReader,"Transaction.set",s._key,i,s.converter!==null,r);return this._transaction.set(s._key,o),this}update(e,n,r,...s){const i=hg(e,this._firestore);let o;return o=typeof(n=wn(n))=="string"||n instanceof _y?O3(this._dataReader,"Transaction.update",i._key,n,r,s):D3(this._dataReader,"Transaction.update",i._key,n),this._transaction.update(i._key,o),this}delete(e){const n=hg(e,this._firestore);return this._transaction.delete(n._key),this}}class Zpe extends Xpe{constructor(e,n){super(e,n),this._firestore=e}get(e){const n=hg(e,this._firestore),r=new by(this._firestore);return super.get(e).then((s=>new Dc(this._firestore,r,n._key,s._document,new yd(!1,!1),n.converter)))}}function eme(t,e,n){t=ds(t,Yo);const r={...Qpe,...n};return(function(i){if(i.maxAttempts<1)throw new Be(we.INVALID_ARGUMENT,"Max attempts must be at least 1")})(r),(function(i,o,a){const c=new mo;return i.asyncQueue.enqueueAndForget((async()=>{const l=await Cpe(i);new Spe(i.asyncQueue,l,a,o,c).ju()})),c.promise})(hh(t),(s=>e(new Zpe(t,s))),r)}function vS(){return new yy("deleteField")}function tme(){return new hN("serverTimestamp")}(function(e,n=!0){(function(s){Dp=s})(Tu),uu(new Gc("firestore",((r,{instanceIdentifier:s,options:i})=>{const o=r.getProvider("app").getImmediate(),a=new Yo(new yde(r.getProvider("auth-internal")),new wde(o,r.getProvider("app-check-internal")),(function(l,d){if(!Object.prototype.hasOwnProperty.apply(l.options,["projectId"]))throw new Be(we.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Kd(l.options.projectId,d)})(o,s),o);return i={useFetchStreams:n,...i},a._setSettings(i),a}),"PUBLIC").setMultipleInstances(!0)),po(ZL,eM,e),po(ZL,eM,"esm2020")})();var S2={};const T2="@firebase/database",E2="1.1.0";let H3="";function nme(t){H3=t}class rme{constructor(e){this.domStorage_=e,this.prefix_="firebase:"}set(e,n){n==null?this.domStorage_.removeItem(this.prefixedName_(e)):this.domStorage_.setItem(this.prefixedName_(e),Jr(n))}get(e){const n=this.domStorage_.getItem(this.prefixedName_(e));return n==null?null:o_(n)}remove(e){this.domStorage_.removeItem(this.prefixedName_(e))}prefixedName_(e){return this.prefix_+e}toString(){return this.domStorage_.toString()}}class sme{constructor(){this.cache_={},this.isInMemoryStorage=!0}set(e,n){n==null?delete this.cache_[e]:this.cache_[e]=n}get(e){return Ha(this.cache_,e)?this.cache_[e]:null}remove(e){delete this.cache_[e]}}const q3=function(t){try{if(typeof window<"u"&&typeof window[t]<"u"){const e=window[t];return e.setItem("firebase:sentinel","cache"),e.removeItem("firebase:sentinel"),new rme(e)}}catch{}return new sme},vd=q3("localStorage"),ime=q3("sessionStorage");const Tf=new qT("@firebase/database"),ome=(function(){let t=1;return function(){return t++}})(),j3=function(t){const e=iue(t),n=new tue;n.update(e);const r=n.digest();return mk.encodeByteArray(r)},wy=function(...t){let e="";for(let n=0;n<t.length;n++){const r=t[n];Array.isArray(r)||r&&typeof r=="object"&&typeof r.length=="number"?e+=wy.apply(null,r):typeof r=="object"?e+=Jr(r):e+=r,e+=" "}return e};let xg=null,I2=!0;const ame=function(t,e){qe(!0,"Can't turn on custom loggers persistently."),Tf.logLevel=Gt.VERBOSE,xg=Tf.log.bind(Tf)},As=function(...t){if(I2===!0&&(I2=!1,xg===null&&ime.get("logging_enabled")===!0&&ame()),xg){const e=wy.apply(null,t);xg(e)}},Sy=function(t){return function(...e){As(t,...e)}},dR=function(...t){const e="FIREBASE INTERNAL ERROR: "+wy(...t);Tf.error(e)},Jc=function(...t){const e=`FIREBASE FATAL ERROR: ${wy(...t)}`;throw Tf.error(e),new Error(e)},yi=function(...t){const e="FIREBASE WARNING: "+wy(...t);Tf.warn(e)},cme=function(){typeof window<"u"&&window.location&&window.location.protocol&&window.location.protocol.indexOf("https:")!==-1&&yi("Insecure Firebase access from a secure page. Please use https in calls to new Firebase().")},bN=function(t){return typeof t=="number"&&(t!==t||t===Number.POSITIVE_INFINITY||t===Number.NEGATIVE_INFINITY)}
102,lme=function(t){if(document.readyState==="complete")t();else{let e=!1;const n=function(){if(!document.body){setTimeout(n,Math.floor(10));return}e||(e=!0,t())};document.addEventListener?(document.addEventListener("DOMContentLoaded",n,!1),window.addEventListener("load",n,!1)):document.attachEvent&&(document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&n()}),window.attachEvent("onload",n))}},Zd="[MIN_NAME]",gu="[MAX_NAME]",Vp=function(t,e){if(t===e)return 0;if(t===Zd||e===gu)return-1;if(e===Zd||t===gu)return 1;{const n=C2(t),r=C2(e);return n!==null?r!==null?n-r===0?t.length-e.length:n-r:-1:r!==null?1:t<e?-1:1}},ume=function(t,e){return t===e?0:t<e?-1:1},Ym=function(t,e){if(e&&t in e)return e[t];throw new Error("Missing required key ("+t+") in object: "+Jr(e))},wN=function(t){if(typeof t!="object"||t===null)return Jr(t);const e=[];for(const r in t)e.push(r);e.sort();let n="{";for(let r=0;r<e.length;r++)r!==0&&(n+=","),n+=Jr(e[r]),n+=":",n+=wN(t[e[r]]);return n+="}",n},W3=function(t,e){const n=t.length;if(n<=e)return[t];const r=[];for(let s=0;s<n;s+=e)s+e>n?r.push(t.substring(s,n)):r.push(t.substring(s,s+e));return r};function Ti(t,e){for(const n in t)t.hasOwnProperty(n)&&e(n,t[n])}const G3=function(t){qe(!bN(t),"Invalid JSON number");const e=11,n=52,r=(1<<e-1)-1;let s,i,o,a,c;t===0?(i=0,o=0,s=1/t===-1/0?1:0):(s=t<0,t=Math.abs(t),t>=Math.pow(2,1-r)?(a=Math.min(Math.floor(Math.log(t)/Math.LN2),r),i=a+r,o=Math.round(t*Math.pow(2,n-a)-Math.pow(2,n))):(i=0,o=Math.round(t/Math.pow(2,1-r-n))));const l=[];for(c=n;c;c-=1)l.push(o%2?1:0),o=Math.floor(o/2);for(c=e;c;c-=1)l.push(i%2?1:0),i=Math.floor(i/2);l.push(s?1:0),l.reverse();const d=l.join("");let h="";for(c=0;c<64;c+=8){let p=parseInt(d.substr(c,8),2).toString(16);p.length===1&&(p="0"+p),h=h+p}return h.toLowerCase()},dme=function(){return!!(typeof window=="object"&&window.chrome&&window.chrome.extension&&!/^chrome/.test(window.location.href))},hme=function(){return typeof Windows=="object"&&typeof Windows.UI=="object"};function fme(t,e){let n="Unknown Error";t==="too_big"?n="The data requested exceeds the maximum size that can be accessed with a single request.":t==="permission_denied"?n="Client doesn't have permission to access the desired data.":t==="unavailable"&&(n="The service is unavailable");const r=new Error(t+" at "+e._path.toString()+": "+n);return r.code=t.toUpperCase(),r}const pme=new RegExp("^-?(0*)\\d{1,10}$"),mme=-2147483648,gme=2147483647,C2=function(t){if(pme.test(t)){const e=Number(t);if(e>=mme&&e<=gme)return e}return null},Fp=function(t){try{t()}catch(e){setTimeout(()=>{const n=e.stack||"";throw yi("Exception was thrown by user callback.",n),e},Math.floor(0))}},_me=function(){return(typeof window=="object"&&window.navigator&&window.navigator.userAgent||"").search(/googlebot|google webmaster tools|bingbot|yahoo! slurp|baiduspider|yandexbot|duckduckbot/i)>=0},Lg=function(t,e){const n=setTimeout(t,e);return typeof n=="number"&&typeof Deno<"u"&&Deno.unrefTimer?Deno.unrefTimer(n):typeof n=="object"&&n.unref&&n.unref(),n};class yme{constructor(e,n){this.appCheckProvider=n,this.appName=e.name,ui(e)&&e.settings.appCheckToken&&(this.serverAppAppCheckToken=e.settings.appCheckToken),this.appCheck=n?.getImmediate({optional:!0}),this.appCheck||n?.get().then(r=>this.appCheck=r)}getToken(e){if(this.serverAppAppCheckToken){if(e)throw new Error("Attempted reuse of `FirebaseServerApp.appCheckToken` after previous usage failed.");return Promise.resolve({token:this.serverAppAppCheckToken})}return this.appCheck?this.appCheck.getToken(e):new Promise((n,r)=>{setTimeout(()=>{this.appCheck?this.getToken(e).then(n,r):n(null)},0)})}addTokenChangeListener(e){this.appCheckProvider?.get().then(n=>n.addTokenListener(e))}notifyForInvalidToken(){yi(`Provided AppCheck credentials for the app named "${this.appName}" are invalid. This usually indicates your app was not initialized correctly.`)}}class vme{constructor(e,n,r){this.appName_=e,this.firebaseOptions_=n,this.authProvider_=r,this.auth_=null,this.auth_=r.getImmediate({optional:!0}),this.auth_||r.onInit(s=>this.auth_=s)}getToken(e){return this.auth_?this.auth_.getToken(e).catch(n=>
102n&&n.code==="auth/token-not-initialized"?(As("Got auth/token-not-initialized error. Treating as null token."),null):Promise.reject(n)):new Promise((n,r)=>{setTimeout(()=>{this.auth_?this.getToken(e).then(n,r):n(null)},0)})}addTokenChangeListener(e){this.auth_?this.auth_.addAuthTokenListener(e):this.authProvider_.get().then(n=>n.addAuthTokenListener(e))}removeTokenChangeListener(e){this.authProvider_.get().then(n=>n.removeAuthTokenListener(e))}notifyForInvalidToken(){let e='Provided authentication credentials for the app named "'+this.appName_+'" are invalid. This usually indicates your app was not initialized correctly. ';"credential"in this.firebaseOptions_?e+='Make sure the "credential" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':"serviceAccount"in this.firebaseOptions_?e+='Make sure the "serviceAccount" property provided to initializeApp() is authorized to access the specified "databaseURL" and is from the correct project.':e+='Make sure the "apiKey" and "databaseURL" properties provided to initializeApp() match the values provided for your app at https://console.firebase.google.com/.',yi(e)}}class sw{constructor(e){this.accessToken=e}getToken(e){return Promise.resolve({accessToken:this.accessToken})}addTokenChangeListener(e){e(this.accessToken)}removeTokenChangeListener(e){}notifyForInvalidToken(){}}sw.OWNER="owner";const SN="5",K3="v",z3="s",Y3="r",J3="f",Q3=/(console\.firebase|firebase-console-\w+\.corp|firebase\.corp)\.google\.com/,X3="ls",Z3="p",hR="ac",e5="websocket",t5="long_polling";class n5{constructor(e,n,r,s,i=!1,o="",a=!1,c=!1,l=null){this.secure=n,this.namespace=r,this.webSocketOnly=s,this.nodeAdmin=i,this.persistenceKey=o,this.includeNamespaceInQueryParams=a,this.isUsingEmulator=c,this.emulatorOptions=l,this._host=e.toLowerCase(),this._domain=this._host.substr(this._host.indexOf(".")+1),this.internalHost=vd.get("host:"+e)||this._host}isCacheableHost(){return this.internalHost.substr(0,2)==="s-"}isCustomHost(){return this._domain!=="firebaseio.com"&&this._domain!=="firebaseio-demo.com"}get host(){return this._host}set host(e){e!==this.internalHost&&(this.internalHost=e,this.isCacheableHost()&&vd.set("host:"+this._host,this.internalHost))}toString(){let e=this.toURLString();return this.persistenceKey&&(e+="<"+this.persistenceKey+">"),e}toURLString(){const e=this.secure?"https://":"http://",n=this.includeNamespaceInQueryParams?`?ns=${this.namespace}`:"";return`${e}${this.host}/${n}`}}function bme(t){return t.host!==t.internalHost||t.isCustomHost()||t.includeNamespaceInQueryParams}function r5(t,e,n){qe(typeof e=="string","typeof type must == string"),qe(typeof n=="object","typeof params must == object");let r;if(e===e5)r=(t.secure?"wss://":"ws://")+t.internalHost+"/.ws?";else if(e===t5)r=(t.secure?"https://":"http://")+t.internalHost+"/.lp?";else throw new Error("Unknown connection type: "+e);bme(t)&&(n.ns=t.namespace);const s=[];return Ti(n,(i,o)=>{s.push(i+"="+o)}),r+s.join("&")}class wme{constructor(){this.counters_={}}incrementCounter(e,n=1){Ha(this.counters_,e)||(this.counters_[e]=0),this.counters_[e]+=n}get(){return Fle(this.counters_)}}const Y0={},J0={};function TN(t){const e=t.toString();return Y0[e]||(Y0[e]=new wme),Y0[e]}function Sme(t,e){const n=t.toString();return J0[n]||(J0[n]=e()),J0[n]}class Tme{constructor(e){this.onMessage_=e,this.pendingResponses=[],this.currentResponseNum=0,this.closeAfterResponse=-1,this.onClose=null}closeAfter(e,n){this.closeAfterResponse=e,this.onClose=n,this.closeAfterResponse<this.currentResponseNum&&(this.onClose(),this.onClose=null)}handleResponse(e,n){for(this.pendingResponses[e]=n;this.pendingResponses[this.currentResponseNum];){const r=this.pendingResponses[this.currentResponseNum];delete this.pendingResponses[this.currentResponseNum];for(let s=0;s<r.length;++s)r[s]&&Fp(()=>{this.onMessage_(r[s])});if(this.currentResponseNum===this.closeAfterResponse){this.onClose&&(this.onClose(),this.onClose=null);break}this.currentResponseNum++}}}const A2="start",Eme="close",Ime="pLPCommand",Cme="pRTLPCB",s5="id",i5="pw",o5="ser",Ame="cb",Rme="seg",Pme="ts",kme="d",Nme="dframe",a5=1870,c5=30,Dme=a5-c5,Ome=25e3,xme=3e4;class hf{constructor(e,n,r,s,i,o,a){this.connId=e,this.repoInfo=n,this.applicationId=r,this.appCheckToken=s,this.authToken=i,this.transportSessionId=o,this.lastSessionId=a,this.bytesSent=0,this.bytesReceived=0,this.everConnected_=!1,this.log_=Sy(e),this.stats_=TN(n),this.urlFn=c=>(this.appCheckToken&&(c[hR]=this.appCheckToken),r5(n,t5,c))}open(e,n){this.curSegmentNum=0,this.onDisconnect_=n,this.myPacketOrderer=new Tme(e),this.isClosed_=!1,this.connectTimeoutTimer_=setTimeout(()=>{this.log_("Timed out trying to connect."),this.onClosed_(),this.connectTimeoutTimer_=null},Math.floor(xme)),lme(()=>{if(this.isClosed_)return;this.scriptTagHolder=new EN((...i)=>{const[o,a,c,l,d]=i;if(this.incrementIncomingBytes_(i),!!this.scriptTagHolder)if(this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null),this.everConnected_=!0,o===A2)this.id=a,this.password=c;else if(o===Eme)a?(this.scriptTagHolder.sendNewPolls=!1,this.myPacketOrderer.closeAfter(a,()=>{this.onClosed_()})):this.onClosed_();else throw new Error("Unrecognized command received: "+o)},(...i)=>{const[o,a]=i;this.incrementIncomingBytes_(i),this.myPacketOrderer.handleResponse(o,a)},()=>{this.onClosed_()},this.urlFn);const r={};r[A2]="t",r[o5]=Math.floor(Math.random()*1e8),this.scriptTagHolder.uniqueCallbackIdentifier&&(r[Ame]=this.scriptTagHolder.uniqueCallbackIdentifier),r[K3]=SN,this.transportSessionId&&(r[z3]=this.transportSessionId),this.lastSessionId&&(r[X3]=this.lastSessionId),this.applicationId&&(r[Z3]=this.applicationId),this.appCheckToken&&(r[hR]=this.appCheckToken),typeof location<"u"&&location.hostname&&Q3.test(location.hostname)&&(r[Y3]=J3);const s=this.urlFn(r);this.log_("Connecting via long-poll to "+s),this.scriptTagHolder.addTag(s,()=>{})})}start(){this.scriptTagHolder.startLongPoll(this.id,this.password),this.addDisconnectPingFrame(this.id,this.password)}static forceAllow(){hf.forceAllow_=!0}static forceDisallow(){hf.forceDisallow_=!0}static isAvailable(){return hf.forceAllow_?!0:!hf.forceDisallow_&&typeof document<"u"&&document.createElement!=null&&!dme()&&!hme()}markConnectionHealthy(){}shutdown_(){this.isClosed_=!0,this.scriptTagHolder&&(this.scriptTagHolder.close(),this.scriptTagHolder=null),this.myDisconnFrame&&(document.body.removeChild(this.myDisconnFrame),this.myDisconnFrame=null),this.connectTimeoutTimer_&&(clearTimeout(this.connectTimeoutTimer_),this.connectTimeoutTimer_=null)}onClosed_(){this.isClosed_||(this.log_("Longpoll is closing itself"),this.shutdown_(),this.onDisconnect_&&(this.onDisconnect_(this.everConnected_),this.onDisconnect_=null))}close(){this.isClosed_||(this.log_("Longpoll is being closed."),this.shutdown_())}send(e){const n=Jr(e);this.bytesSent+=n.length,this.stats_.incrementCounter("bytes_sent",n.length);const r=eq(n),s=W3(r,Dme);for(let i=0;i<s.length;i++)this.scriptTagHolder.enqueueSegment(this.curSegmentNum,s.length,s[i]),this.curSegmentNum++}addDisconnectPingFrame(e,n){this.myDisconnFrame=document.createElement("iframe");const r={};r[Nme]="t",r[s5]=e,r[i5]=n,this.myDisconnFrame.src=this.urlFn(r),this.myDisconnFrame.style.display="none",document.body.appendChild(this.myDisconnFrame)}incrementIncomingBytes_(e){const n=Jr(e).length;this.bytesReceived+=n,this.stats_.incrementCounter("bytes_received",n)}}class EN{constructor(e,n,r,s){this.onDisconnect=r,this.urlFn=s,this.outstandingRequests=new Set,this.pendingSegs=[],this.currentSerial=Math.floor(Math.random()*1e8),this.sendNewPolls=!0;{this.uniqueCallbackIdentifier=ome(),window[Ime+this.uniqueCallbackIdentifier]=e,window[Cme+this.uniqueCallbackIdentifier]=n,this.myIFrame=EN.createIFrame_();let i="";this.myIFrame.src&&this.myIFrame.src.substr(0,11)==="javascript:"&&(i='<script>document.domain="'+document.domain+'";<\/script>');const o="<html><body>"+i+"</body></html>";
102try{this.myIFrame.doc.open(),this.myIFrame.doc.write(o),this.myIFrame.doc.close()}catch(a){As("frame writing exception"),a.stack&&As(a.stack),As(a)}}}static createIFrame_(){const e=document.createElement("iframe");if(e.style.display="none",document.body){document.body.appendChild(e);try{e.contentWindow.document||As("No IE domain setting required")}catch{const r=document.domain;e.src="javascript:void((function(){document.open();document.domain='"+r+"';document.close();})())"}}else throw"Document body has not initialized. Wait to initialize Firebase until after the document is ready.";return e.contentDocument?e.doc=e.contentDocument:e.contentWindow?e.doc=e.contentWindow.document:e.document&&(e.doc=e.document),e}close(){this.alive=!1,this.myIFrame&&(this.myIFrame.doc.body.textContent="",setTimeout(()=>{this.myIFrame!==null&&(document.body.removeChild(this.myIFrame),this.myIFrame=null)},Math.floor(0)));const e=this.onDisconnect;e&&(this.onDisconnect=null,e())}startLongPoll(e,n){for(this.myID=e,this.myPW=n,this.alive=!0;this.newRequest_(););}newRequest_(){if(this.alive&&this.sendNewPolls&&this.outstandingRequests.size<(this.pendingSegs.length>0?2:1)){this.currentSerial++;const e={};e[s5]=this.myID,e[i5]=this.myPW,e[o5]=this.currentSerial;let n=this.urlFn(e),r="",s=0;for(;this.pendingSegs.length>0&&this.pendingSegs[0].d.length+c5+r.length<=a5;){const o=this.pendingSegs.shift();r=r+"&"+Rme+s+"="+o.seg+"&"+Pme+s+"="+o.ts+"&"+kme+s+"="+o.d,s++}return n=n+r,this.addLongPollTag_(n,this.currentSerial),!0}else return!1}enqueueSegment(e,n,r){this.pendingSegs.push({seg:e,ts:n,d:r}),this.alive&&this.newRequest_()}addLongPollTag_(e,n){this.outstandingRequests.add(n);const r=()=>{this.outstandingRequests.delete(n),this.newRequest_()},s=setTimeout(r,Math.floor(Ome)),i=()=>{clearTimeout(s),r()};this.addTag(e,i)}addTag(e,n){setTimeout(()=>{try{if(!this.sendNewPolls)return;const r=this.myIFrame.doc.createElement("script");r.type="text/javascript",r.async=!0,r.src=e,r.onload=r.onreadystatechange=function(){const s=r.readyState;(!s||s==="loaded"||s==="complete")&&(r.onload=r.onreadystatechange=null,r.parentNode&&r.parentNode.removeChild(r),n())},r.onerror=()=>{As("Long-poll script failed to load: "+e),this.sendNewPolls=!1,this.close()},this.myIFrame.doc.body.appendChild(r)}catch{}},Math.floor(1))}}const Lme=16384,Mme=45e3;let bS=null;typeof MozWebSocket<"u"?bS=MozWebSocket:typeof WebSocket<"u"&&(bS=WebSocket);class Lo{constructor(e,n,r,s,i,o,a){this.connId=e,this.applicationId=r,this.appCheckToken=s,this.authToken=i,this.keepaliveTimer=null,this.frames=null,this.totalFrames=0,this.bytesSent=0,this.bytesReceived=0,this.log_=Sy(this.connId),this.stats_=TN(n),this.connURL=Lo.connectionURL_(n,o,a,s,r),this.nodeAdmin=n.nodeAdmin}static connectionURL_(e,n,r,s,i){const o={};return o[K3]=SN,typeof location<"u"&&location.hostname&&Q3.test(location.hostname)&&(o[Y3]=J3),n&&(o[z3]=n),r&&(o[X3]=r),s&&(o[hR]=s),i&&(o[Z3]=i),r5(e,e5,o)}open(e,n){this.onDisconnect=n,this.onMessage=e,this.log_("Websocket connecting to "+this.connURL),this.everConnected_=!1,vd.set("previous_websocket_failure",!0);try{let r;zle(),this.mySock=new bS(this.connURL,[],r)}catch(r){this.log_("Error instantiating WebSocket.");const s=r.message||r.data;s&&this.log_(s),this.onClosed_();return}this.mySock.onopen=()=>{this.log_("Websocket connected."),this.everConnected_=!0},this.mySock.onclose=()=>{this.log_("Websocket connection was disconnected."),this.mySock=null,this.onClosed_()},this.mySock.onmessage=r=>{this.handleIncomingFrame(r)},this.mySock.onerror=r=>{this.log_("WebSocket error. Closing connection.");const s=r.message||r.data;s&&this.log_(s),this.onClosed_()}}start(){}static forceDisallow(){Lo.forceDisallow_=!0}static isAvailable(){let e=!1;if(typeof navigator<"u"&&navigator.userAgent){const n=/Android ([0-9]{0,}\.[0-9]{0,})/,r=navigator.userAgent.match(n);r&&r.length>1&&parseFloat(r[1])<4.4&&(e=!0)}return!e&&bS!==null&&!Lo.forceDisallow_}static previouslyFailed(){return vd.isInMemoryStorage||vd.get("previous_websocket_failure")===!0}markConnectionHealthy(){vd.remove("previous_websocket_failure")}appendFrame_(e){if(this.frames.push(e),this.frames.length===this.totalFrames){const n=this.frames.join("");this.frames=null;const r=o_(n);this.onMessage(r)}}handleNewFrameCount_(e){this.totalFrames=e,this.frames=[]}extractFrameCount_(e){if(qe(this.frames===null,"We already have a frame buffer"),e.length<=6){const n=Number(e);if(!isNaN(n))return this.handleNewFrameCount_(n),null}return this.handleNewFrameCount_(1),e}handleIncomingFrame(e){if(this.mySock===null)return;const n=e.data;if(this.bytesReceived+=n.length,this.stats_.incrementCounter("bytes_received",n.length),this.resetKeepAlive(),this.frames!==null)this.appendFrame_(n);else{const r=this.extractFrameCount_(n);r!==null&&this.appendFrame_(r)}}send(e){this.resetKeepAlive();const n=Jr(e);this.bytesSent+=n.length,this.stats_.incrementCounter("bytes_sent",n.length);const r=W3(n,Lme);r.length>1&&this.sendString_(String(r.length));for(let s=0;s<r.length;s++)this.sendString_(r[s])}shutdown_(){this.isClosed_=!0,this.keepaliveTimer&&(clearInterval(this.keepaliveTimer),this.keepaliveTimer=null),this.mySock&&(this.mySock.close(),this.mySock=null)}onClosed_(){this.isClosed_||(this.log_("WebSocket is closing itself"),this.shutdown_(),this.onDisconnect&&(this.onDisconnect(this.everConnected_),this.onDisconnect=null))}close(){this.isClosed_||(this.log_("WebSocket is being closed"),this.shutdown_())}resetKeepAlive(){clearInterval(this.keepaliveTimer),this.keepaliveTimer=setInterval(()=>{this.mySock&&this.sendString_("0"),this.resetKeepAlive()},Math.floor(Mme))}sendString_(e){try{this.mySock.send(e)}
102catch(n){this.log_("Exception thrown from WebSocket.send():",n.message||n.data,"Closing connection."),setTimeout(this.onClosed_.bind(this),0)}}}Lo.responsesRequiredToBeHealthy=2;Lo.healthyTimeout=3e4;class T_{static get ALL_TRANSPORTS(){return[hf,Lo]}static get IS_TRANSPORT_INITIALIZED(){return this.globalTransportInitialized_}constructor(e){this.initTransports_(e)}initTransports_(e){const n=Lo&&Lo.isAvailable();let r=n&&!Lo.previouslyFailed();if(e.webSocketOnly&&(n||yi("wss:// URL used, but browser isn't known to support websockets. Trying anyway."),r=!0),r)this.transports_=[Lo];else{const s=this.transports_=[];for(const i of T_.ALL_TRANSPORTS)i&&i.isAvailable()&&s.push(i);T_.globalTransportInitialized_=!0}}initialTransport(){if(this.transports_.length>0)return this.transports_[0];throw new Error("No transports available")}upgradeTransport(){return this.transports_.length>1?this.transports_[1]:null}}T_.globalTransportInitialized_=!1;const Vme=6e4,Fme=5e3,Bme=10*1024,$me=100*1024,Q0="t",R2="d",Ume="s",P2="r",Hme="e",k2="o",N2="a",D2="n",O2="p",qme="h";class jme{constructor(e,n,r,s,i,o,a,c,l,d){this.id=e,this.repoInfo_=n,this.applicationId_=r,this.appCheckToken_=s,this.authToken_=i,this.onMessage_=o,this.onReady_=a,this.onDisconnect_=c,this.onKill_=l,this.lastSessionId=d,this.connectionCount=0,this.pendingDataMessages=[],this.state_=0,this.log_=Sy("c:"+this.id+":"),this.transportManager_=new T_(n),this.log_("Connection created"),this.start_()}start_(){const e=this.transportManager_.initialTransport();this.conn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,null,this.lastSessionId),this.primaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const n=this.connReceiver_(this.conn_),r=this.disconnReceiver_(this.conn_);this.tx_=this.conn_,this.rx_=this.conn_,this.secondaryConn_=null,this.isHealthy_=!1,setTimeout(()=>{this.conn_&&this.conn_.open(n,r)},Math.floor(0));const s=e.healthyTimeout||0;s>0&&(this.healthyTimeout_=Lg(()=>{this.healthyTimeout_=null,this.isHealthy_||(this.conn_&&this.conn_.bytesReceived>$me?(this.log_("Connection exceeded healthy timeout but has received "+this.conn_.bytesReceived+" bytes. Marking connection healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()):this.conn_&&this.conn_.bytesSent>Bme?this.log_("Connection exceeded healthy timeout but has sent "+this.conn_.bytesSent+" bytes. Leaving connection alive."):(this.log_("Closing unhealthy connection after timeout."),this.close()))},Math.floor(s)))}nextTransportId_(){return"c:"+this.id+":"+this.connectionCount++}disconnReceiver_(e){return n=>{e===this.conn_?this.onConnectionLost_(n):e===this.secondaryConn_?(this.log_("Secondary connection lost."),this.onSecondaryConnectionLost_()):this.log_("closing an old connection")}}connReceiver_(e){return n=>{this.state_!==2&&(e===this.rx_?this.onPrimaryMessageReceived_(n):e===this.secondaryConn_?this.onSecondaryMessageReceived_(n):this.log_("message on old connection"))}}sendRequest(e){const n={t:"d",d:e};this.sendData_(n)}tryCleanupConnection(){this.tx_===this.secondaryConn_&&this.rx_===this.secondaryConn_&&(this.log_("cleaning up and promoting a connection: "+this.secondaryConn_.connId),this.conn_=this.secondaryConn_,this.secondaryConn_=null)}onSecondaryControl_(e){if(Q0 in e){const n=e[Q0];n===N2?this.upgradeIfSecondaryHealthy_():n===P2?(this.log_("Got a reset on secondary, closing it"),this.secondaryConn_.close(),(this.tx_===this.secondaryConn_||this.rx_===this.secondaryConn_)&&this.close()):n===k2&&(this.log_("got pong on secondary."),this.secondaryResponsesRequired_--,this.upgradeIfSecondaryHealthy_())}}onSecondaryMessageReceived_(e){const n=Ym("t",e),r=Ym("d",e);if(n==="c")this.onSecondaryControl_(r);else if(n==="d")this.pendingDataMessages.push(r);else throw new Error("Unknown protocol layer: "+n)}upgradeIfSecondaryHealthy_(){this.secondaryResponsesRequired_<=0?(this.log_("Secondary connection is healthy."),this.isHealthy_=!0,this.secondaryConn_.markConnectionHealthy(),this.proceedWithUpgrade_()):(this.log_("sending ping on secondary."),this.secondaryConn_.send({t
vendor: 17,519 bytes, lines 102-103
102:"c",d:{t:O2,d:{}}}))}proceedWithUpgrade_(){this.secondaryConn_.start(),this.log_("sending client ack on secondary"),this.secondaryConn_.send({t:"c",d:{t:N2,d:{}}}),this.log_("Ending transmission on primary"),this.conn_.send({t:"c",d:{t:D2,d:{}}}),this.tx_=this.secondaryConn_,this.tryCleanupConnection()}onPrimaryMessageReceived_(e){const n=Ym("t",e),r=Ym("d",e);n==="c"?this.onControl_(r):n==="d"&&this.onDataMessage_(r)}onDataMessage_(e){this.onPrimaryResponse_(),this.onMessage_(e)}onPrimaryResponse_(){this.isHealthy_||(this.primaryResponsesRequired_--,this.primaryResponsesRequired_<=0&&(this.log_("Primary connection is healthy."),this.isHealthy_=!0,this.conn_.markConnectionHealthy()))}onControl_(e){const n=Ym(Q0,e);if(R2 in e){const r=e[R2];if(n===qme){const s={...r};this.repoInfo_.isUsingEmulator&&(s.h=this.repoInfo_.host),this.onHandshake_(s)}else if(n===D2){this.log_("recvd end transmission on primary"),this.rx_=this.secondaryConn_;for(let s=0;s<this.pendingDataMessages.length;++s)this.onDataMessage_(this.pendingDataMessages[s]);this.pendingDataMessages=[],this.tryCleanupConnection()}else n===Ume?this.onConnectionShutdown_(r):n===P2?this.onReset_(r):n===Hme?dR("Server Error: "+r):n===k2?(this.log_("got pong on primary."),this.onPrimaryResponse_(),this.sendPingOnPrimaryIfNecessary_()):dR("Unknown control packet command: "+n)}}onHandshake_(e){const n=e.ts,r=e.v,s=e.h;this.sessionId=e.s,this.repoInfo_.host=s,this.state_===0&&(this.conn_.start(),this.onConnectionEstablished_(this.conn_,n),SN!==r&&yi("Protocol version mismatch detected"),this.tryStartUpgrade_())}tryStartUpgrade_(){const e=this.transportManager_.upgradeTransport();e&&this.startUpgrade_(e)}startUpgrade_(e){this.secondaryConn_=new e(this.nextTransportId_(),this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,this.sessionId),this.secondaryResponsesRequired_=e.responsesRequiredToBeHealthy||0;const n=this.connReceiver_(this.secondaryConn_),r=this.disconnReceiver_(this.secondaryConn_);this.secondaryConn_.open(n,r),Lg(()=>{this.secondaryConn_&&(this.log_("Timed out trying to upgrade."),this.secondaryConn_.close())},Math.floor(Vme))}onReset_(e){this.log_("Reset packet received. New host: "+e),this.repoInfo_.host=e,this.state_===1?this.close():(this.closeConnections_(),this.start_())}onConnectionEstablished_(e,n){this.log_("Realtime connection established."),this.conn_=e,this.state_=1,this.onReady_&&(this.onReady_(n,this.sessionId),this.onReady_=null),this.primaryResponsesRequired_===0?(this.log_("Primary connection is healthy."),this.isHealthy_=!0):Lg(()=>{this.sendPingOnPrimaryIfNecessary_()},Math.floor(Fme))}sendPingOnPrimaryIfNecessary_(){!this.isHealthy_&&this.state_===1&&(this.log_("sending ping on primary."),this.sendData_({t:"c",d:{t:O2,d:{}}}))}onSecondaryConnectionLost_(){const e=this.secondaryConn_;this.secondaryConn_=null,(this.tx_===e||this.rx_===e)&&this.close()}onConnectionLost_(e){this.conn_=null,!e&&this.state_===0?(this.log_("Realtime connection failed."),this.repoInfo_.isCacheableHost()&&(vd.remove("host:"+this.repoInfo_.host),this.repoInfo_.internalHost=this.repoInfo_.host)):this.state_===1&&this.log_("Realtime connection lost."),this.close()}onConnectionShutdown_(e){this.log_("Connection shutdown command received. Shutting down..."),this.onKill_&&(this.onKill_(e),this.onKill_=null),this.onDisconnect_=null,this.close()}sendData_(e){if(this.state_!==1)throw"Connection is not connected";this.tx_.send(e)}close(){this.state_!==2&&(this.log_("Closing realtime connection."),this.state_=2,this.closeConnections_(),this.onDisconnect_&&(this.onDisconnect_(),this.onDisconnect_=null))}closeConnections_(){this.log_("Shutting down all connections"),this.conn_&&(this.conn_.close(),this.conn_=null),this.secondaryConn_&&(this.secondaryConn_.close(),this.secondaryConn_=null),this.healthyTimeout_&&(clearTimeout(this.healthyTimeout_),this.healthyTimeout_=null)}}class l5{put(e,n,r,s){}merge(e,n,r,s){}refreshAuthToken(e){}refreshAppCheckToken(e){}onDisconnectPut(e,n,r){}onDisconnectMerge(e,n,r){}onDisconnectCancel(e,n){}reportStats(e){}}class u5{constructor(e){this.allowedEvents_=e,this.listeners_={},qe(Array.isArray(e)&&e.length>0,"Requires a non-empty array")}trigger(e,...n){if(Array.isArray(this.listeners_[e])){const r=[...this.listeners_[e]];for(let s=0;s<r.length;s++)r[s].callback.apply(r[s].context,n)}}on(e,n,r){this.validateEventType_(e),this.listeners_[e]=this.listeners_[e]||[],this.listeners_[e].push({callback:n,context:r});const s=this.getInitialEvent(e);s&&n.apply(r,s)}off(e,n,r){this.validateEventType_(e);const s=this.listeners_[e]||[];for(let i=0;i<s.length;i++)if(s[i].callback===n&&(!r||r===s[i].context)){s.splice(i,1);return}}validateEventType_(e){qe(this.allowedEvents_.find(n=>n===e),"Unknown event: "+e)}}class wS extends u5{static getInstance(){return new wS}constructor(){super(["online"]),this.online_=!0,typeof window<"u"&&typeof window.addEventListener<"u"&&!yk()&&(window.addEventListener("online",()=>{this.online_||(this.online_=!0,this.trigger("online",!0))},!1),window.addEventListener("offline",()=>{this.online_&&(this.online_=!1,this.trigger("online",!1))},!1))}getInitialEvent(e){return qe(e==="online","Unknown event type: "+e),[this.online_]}currentlyOnline(){return this.online_}}const x2=32,L2=768;class Hn{constructor(e,n){if(n===void 0){this.pieces_=e.split("/");let r=0;for(let s=0;s<this.pieces_.length;s++)this.pieces_[s].length>0&&(this.pieces_[r]=this.pieces_[s],r++);this.pieces_.length=r,this.pieceNum_=0}else this.pieces_=e,this.pieceNum_=n}toString(){let e="";for(let n=this.pieceNum_;n<this.pieces_.length;n++)this.pieces_[n]!==""&&(e+="/"+this.pieces_[n]);return e||"/"}}function cn(){return new Hn("")}function $t(t){return t.pieceNum_>=t.pieces_.length?null:t.pieces_[t.pieceNum_]}function _u(t){return t.pieces_.length-t.pieceNum_}function Gn(t){let e=t.pieceNum_;return e<t.pieces_.length&&e++,new Hn(t.pieces_,e)}function d5(t){return t.pieceNum_<t.pieces_.length?t.pieces_[t.pieces_.length-1]:null}function Wme(t){let e="";for(let n=t.pieceNum_;n<t.pieces_.length;n++)t.pieces_[n]!==""&&(e+="/"+encodeURIComponent(String(t.pieces_[n])));return e||"/"}function h5(t,e=0){return t.pieces_.slice(t.pieceNum_+e)}function f5(t){if(t.pieceNum_>=t.pieces_.length)return null;const e=[];for(let n=t.pieceNum_;n<t.pieces_.length-1;n++)e.push(t.pieces_[n]);return new Hn(e,0)}function Qr(t,e){const n=[];for(let r=t.pieceNum_;r<t.pieces_.length;r++)n.push(t.pieces_[r]);if(e instanceof Hn)for(let r=e.pieceNum_;r<e.pieces_.length;r++)n.push(e.pieces_[r]);else{const r=e.split("/");for(let s=0;s<r.length;s++)r[s].length>0&&n.push(r[s])}return new Hn(n,0)}function Kt(t){return t.pieceNum_>=t.pieces_.length}function Gs(t,e){const n=$t(t),r=$t(e);if(n===null)return e;if(n===r)return Gs(Gn(t),Gn(e));throw new Error("INTERNAL ERROR: innerPath ("+e+") is not within outerPath ("+t+")")}function IN(t,e){if(_u(t)!==_u(e))return!1;for(let n=t.pieceNum_,r=e.pieceNum_;n<=t.pieces_.length;n++,r++)if(t.pieces_[n]!==e.pieces_[r])return!1;return!0}function Vo(t,e){let n=t.pieceNum_,r=e.pieceNum_;if(_u(t)>_u(e))return!1;for(;n<t.pieces_.length;){if(t.pieces_[n]!==e.pieces_[r])return!1;++n,++r}return!0}class Gme{constructor(e,n){this.errorPrefix_=n,this.parts_=h5(e,0),this.byteLength_=Math.max(1,this.parts_.length);for(let r=0;r<this.parts_.length;r++)this.byteLength_+=HT(this.parts_[r]);p5(this)}}function Kme(t,e){t.parts_.length>0&&(t.byteLength_+=1),t.parts_.push(e),t.byteLength_+=HT(e),p5(t)}function zme(t){const e=t.parts_.pop();t.byteLength_-=HT(e),t.parts_.length>0&&(t.byteLength_-=1)}function p5(t){if(t.byteLength_>L2)throw new Error(t.errorPrefix_+"has a key path longer than "+L2+" bytes ("+t.byteLength_+").");if(t.parts_.length>x2)throw new Error(t.errorPrefix_+"path specified exceeds the maximum depth that can be written ("+x2+") or object contains a cycle "+ad(t))}function ad(t){return t.parts_.length===0?"":"in property '"+t.parts_.join(".")+"'"}class CN extends u5{static getInstance(){return new CN}constructor(){super(["visible"]);let e,n;typeof document<"u"&&typeof document.addEventListener<"u"&&(typeof document.hidden<"u"?(n="visibilitychange",e="hidden"):typeof document.mozHidden<"u"?(n="mozvisibilitychange",e="mozHidden"):typeof document.msHidden<"u"?(n="msvisibilitychange",e="msHidden"):typeof document.webkitHidden<"u"&&(n="webkitvisibilitychange",e="webkitHidden")),this.visible_=!0,n&&document.addEventListener(n,()=>{const r=!document[e];r!==this.visible_&&(this.visible_=r,this.trigger("visible",r))},!1)}getInitialEvent(e){return qe(e==="visible","Unknown event type: "+e),[this.visible_]}}const Jm=1e3,Yme=300*1e3,M2=30*1e3,Jme=1.3,Qme=3e4,Xme="server_kill",V2=3;class Oc extends l5{constructor(e,n,r,s,i,o,a,c){if(super(),this.repoInfo_=e,this.applicationId_=n,this.onDataUpdate_=r,this.onConnectStatus_=s,this.onServerInfoUpdate_=i,this.authTokenProvider_=o,this.appCheckTokenProvider_=a,this.authOverride_=c,this.id=Oc.nextPersistentConnectionId_++,this.log_=Sy("p:"+this.id+":"),this.interruptReasons_={},this.listens=new Map,this.outstandingPuts_=[],this.outstandingGets_=[],this.outstandingPutCount_=0,this.outstandingGetCount_=0,this.onDisconnectRequestQueue_=[],this.connected_=!1,this.reconnectDelay_=Jm,this.maxReconnectDelay_=Yme,this.securityDebugCallback_=null,this.lastSessionId=null,this.establishConnectionTimer_=null,this.visible_=!1,this.requestCBHash_={},this.requestNumber_=0,this.realtime_=null,this.authToken_=null,this.appCheckToken_=null,this.forceTokenRefresh_=!1,this.invalidAuthTokenCount_=0,this.invalidAppCheckTokenCount_=0,this.firstConnection_=!0,this.lastConnectionAttemptTime_=null,this.lastConnectionEstablishedTime_=null,c)throw new Error("Auth override specified in options, but not supported on non Node.js platforms");CN.getInstance().on("visible",this.onVisible_,this),e.host.indexOf("fblocal")===-1&&wS.getInstance().on("online",this.onOnline_,this)}sendRequest(e,n,r){const s=++this.requestNumber_,i={r:s,a:e,b:n};this.log_(Jr(i)),qe(this.connected_,"sendRequest call when we're not connected not allowed."),this.realtime_.sendRequest(i),r&&(this.requestCBHash_[s]=r)}get(e){this.initConnection_();const n=new $T,s={action:"g",request:{p:e._path.toString(),q:e._queryObject},onComplete:o=>{const a=o.d;o.s==="ok"?n.resolve(a):n.reject(a)}};this.outstandingGets_.push(s),this.outstandingGetCount_++;const i=this.outstandingGets_.length-1;return this.connected_&&this.sendGet_(i),n.promise}listen(e,n,r,s){this.initConnection_();const i=e._queryIdentifier,o=e._path.toString();this.log_("Listen called for "+o+" "+i),this.listens.has(o)||this.listens.set(o,new Map),qe(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"listen() called for non-default but complete query"),qe(!this.listens.get(o).has(i),"listen() called twice for same path/queryId.");const a={onComplete:s,hashFn:n,query:e,tag:r};this.listens.get(o).set(i,a),this.connected_&&this.sendListen_(a)}sendGet_(e){const n=this.outstandingGets_[e];this.sendRequest("g",n.request,r=>{delete this.outstandingGets_[e],this.outstandingGetCount_--,this.outstandingGetCount_===0&&(this.outstandingGets_=[]),n.onComplete&&n.onComplete(r)})}sendListen_(e){const n=e.query,r=n._path.toString(),s=n._queryIdentifier;this.log_("Listen on "+r+" for "+s);const i={p:r},o="q";e.tag&&(i.q=n._queryObject,i.t=e.tag),i.h=e.hashFn(),this.sendRequest(o,i,a=>{const c=a.d,l=a.s;Oc.warnOnListenWarnings_(c,n),(this.listens.get(r)&&this.listens.get(r).get(s))===e&&(this.log_("listen response",a),l!=="ok"&&this.removeListen_(r,s),e.onComplete&&e.onComplete(l,c))})}static warnOnListenWarnings_(e,n){if(e&&typeof e=="object"&&Ha(e,"w")){const r=Uf(e,"w");if(Array.isArray(r)&&~r.indexOf("no_index")){const s='".indexOn": "'+n._queryParams.getIndex().toString()+'"',i=n._path.toString();yi(`Using an unspecified index. Your data will be downloaded and filtered on the client. Consider adding ${s} at ${i} to your security rules for better performance.`)}}}refreshAuthToken(e){this.authToken_=e,this.log_("Auth token refreshed"),this.authToken_?this.tryAuth():this.connected_&&this.sendRequest("unauth",{},()=>{}),this.reduceReconnectDelayIfAdminCredential_(e)}reduceReconnectDelayIfAdminCredential_(e){(e&&e.length===40||eue(e))&&(this.log_("Admin auth credential detected. Reducing max reconnect time."),this.maxReconnectDelay_=M2)}refreshAppCheckToken(e){this.appCheckToken_=e,this.log_("App check token refreshed"),this.appCheckToken_?this.tryAppCheck():this.connected_&&this.sendRequest("unappeck",{},()=>{})}tryAuth(){if(this.connected_&&this.authToken_){const e=this.authToken_,n=Zle(e)?"auth":"gauth",r={cred:e};this.authOverride_===null?r.noauth=!0:typeof this.authOverride_=="object"&&(r.authvar=this.authOverride_),this.sendRequest(n,r,s=>{const i=s.s,o=s.d||"error";this.authToken_===e&&(i==="ok"?this.invalidAuthTokenCount_=0:this.onAuthRevoked_(i,o))})}}tryAppCheck(){this.connected_&&this.appCheckToken_&&this.sendRequest("appcheck",{token:this.appCheckToken_},e=>{const n=e.s,r=e.d||"error";n==="ok"?this.invalidAppCheckTokenCount_=0:this.onAppCheckRevoked_(n,r)})}unlisten(e,n){const r=e._path.toString(),s=e._queryIdentifier;this.log_("Unlisten called for "+r+" "+s),qe(e._queryParams.isDefault()||!e._queryParams.loadsAllData(),"unlisten() called for non-default but complete query"),this.removeListen_(r,s)&&this.connected_&&this.sendUnlisten_(r,s,e._queryObject,n)}sendUnlisten_(e,n,r,s){this.log_("Unlisten on "+e+" for "+n);const i={p:e},o="n";s&&(i.q=r,i.t=s),this.sendRequest(o,i)}onDisconnectPut(e,n,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("o",e,n,r):this.onDisconnectRequestQueue_.push({pathString:e,action:"o",data:n,onComplete:r})}onDisconnectMerge(e,n,r){this.initConnection_(),this.connected_?this.sendOnDisconnect_("om",e,n,r):this.onDisconnectRequestQueue_.push({pathString:e,action:"om",data:n,onComplete:r})}onDisconnectCancel(e,n){this.initConnection_(),this.connected_?this.sendOnDisconnect_("oc",e,null,n):this.onDisconnectRequestQueue_.push({pathString:e,action:"oc",data:null,onComplete:n})}sendOnDisconnect_(e,n,r,s){const i={p:n,d:r};this.log_("onDisconnect "+e,i),this.sendRequest(e,i,o=>{s&&setTimeout(()=>{s(o.s,o.d)},Math.floor(0))})}put(e,n,r,s){this.putInternal("p",e,n,r,s)}merge(e,n,r,s){this.putInternal("m",e,n,r,s)}putInternal(e,n,r,s,i){this.initConnection_();const o={p:n,d:r};i!==void 0&&(o.h=i),this.outstandingPuts_.push({action:e,request:o,onComplete:s}),this.outstandingPutCount_++;const a=this.outstandingPuts_.length-1;this.connected_?this.sendPut_(a):this.log_("Buffering put: "+n)}sendPut_(e){const n=this.outstandingPuts_[e].action,r=this.outstandingPuts_[e].request,s=this.outstandingPuts_[e].onComplete;this.outstandingPuts_[e].queued=this.connected_,this.sendRequest(n,r,i=>{this.log_(n+" response",i),delete this.outstandingPuts_[e],this.outstandingPutCount_--,this.outstandingPutCount_===0&&(this.outstandingPuts_=[]),s&&s(i.s,i.d)})}reportStats(e){if(this.connected_){const n={c:e};this.log_("reportStats",n),this.sendRequest("s",n,r=>{if(r.s!=="ok"){const i=r.d;this.log_("reportStats","Error sending stats: "+i)}})}}onDataMessage_(e){if("r"in e){this.log_("from server: "+Jr(e));const n=e.r,r=this.requestCBHash_[n];r&&(delete this.requestCBHash_[n],r(e.b))}else{if("error"in e)throw"A server-side error has occurred: "+e.error;"a"in e&&this.onDataPush_(e.a,e.b)}}onDataPush_(e,n){this.log_("handleServerMessage",e,n),e==="d"?this.onDataUpdate_(n.p,n.d,!1,n.t):e==="m"?this.onDataUpdate_(n.p,n.d,!0,n.t):e==="c"?this.onListenRevoked_(n.p,n.q):e==="ac"?this.onAuthRevoked_(n.s,n.d):e==="apc"?this.onAppCheckRevoked_(n.s,n.d):e==="sd"?this.onSecurityDebugPacket_(n):dR("Unrecognized action received from server: "+Jr(e)+` 103Are you using the latest client?`)}onReady_(e,n){this.log_("connection ready"),this.connected_=!0,this.lastConnectionEstablishedTime_=new Date().getTime(),this.handleTimestamp_(e),this.lastSessionId=n,this.firstConnection_&&this.sendConnectStats_(),this.restoreState_(),this.firstConnection_=!1,this.onConnectStatus_(!0)}scheduleConnect_(e){qe(!this.realtime_,"Scheduling a connect when we're already connected/ing?"),this.establishConnectionTimer_&&clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=setTimeout(()=>{this.establishConnectionTimer_=null,this.establishConnection_()},Math.floor(e))}initConnection_(){!this.realtime_&&this.firstConnection_&&this.scheduleConnect_(0)}onVisible_(e){e&&!this.visible_&&this.reconnectDelay_===this.maxReconnectDelay_&&(this.log_("Window became visible. Reducing delay."),this.reconnectDelay_=Jm,this.realtime_||this.scheduleConnect_(0)),this.visible_=e}onOnline_(e){e?(this.log_("Browser went online."),this.reconnectDelay_=Jm,this.realtime_||this.scheduleConnect_(0)):(this.log_("Browser went offline. Killing connection."),this.realtime_&&this.realtime_.close())}onRealtimeDisconnect_(){if(this.log_("data client disconnected"),this.connected_=!1,this.realtime_=null,this.cancelSentTransactions_(),this.requestCBHash_={},this.shouldReconnect_()){this.visible_?this.lastConnectionEstablishedTime_&&(new Date().getTime()-this.lastConnectionEstablishedTime_>Qme&&(this.reconnectDelay_=Jm),this.lastConnectionEstablishedTime_=null):(this.log_("Window isn't visible. Delaying reconnect."),this.reconnectDelay_=this.maxReconnectDelay_,this.lastConnectionAttemptTime_=new Date().getTime());const e=Math.max(0,new Date().getTime()-this.lastConnectionAttemptTime_);let n=Math.max(0,this.reconnectDelay_-e);
103n=Math.random()*n,this.log_("Trying to reconnect in "+n+"ms"),this.scheduleConnect_(n),this.reconnectDelay_=Math.min(this.maxReconnectDelay_,this.reconnectDelay_*Jme)}this.onConnectStatus_(!1)}async establishConnection_(){if(this.shouldReconnect_()){this.log_("Making a connection attempt"),this.lastConnectionAttemptTime_=new Date().getTime(),this.lastConnectionEstablishedTime_=null;const e=this.onDataMessage_.bind(this),n=this.onReady_.bind(this),r=this.onRealtimeDisconnect_.bind(this),s=this.id+":"+Oc.nextConnectionId_++,i=this.lastSessionId;let o=!1,a=null;const c=function(){a?a.close():(o=!0,r())},l=function(h){qe(a,"sendRequest call when we're not connected not allowed."),a.sendRequest(h)};this.realtime_={close:c,sendRequest:l};const d=this.forceTokenRefresh_;this.forceTokenRefresh_=!1;try{const[h,p]=await Promise.all([this.authTokenProvider_.getToken(d),this.appCheckTokenProvider_.getToken(d)]);o?As("getToken() completed but was canceled"):(As("getToken() completed. Creating connection."),this.authToken_=h&&h.accessToken,this.appCheckToken_=p&&p.token,a=new jme(s,this.repoInfo_,this.applicationId_,this.appCheckToken_,this.authToken_,e,n,r,g=>{yi(g+" ("+this.repoInfo_.toString()+")"),this.interrupt(Xme)},i))}catch(h){this.log_("Failed to get token: "+h),o||(this.repoInfo_.nodeAdmin&&yi(h),c())}}}interrupt(e){As("Interrupting connection for reason: "+e),this.interruptReasons_[e]=!0,this.realtime_?this.realtime_.close():(this.establishConnectionTimer_&&(clearTimeout(this.establishConnectionTimer_),this.establishConnectionTimer_=null),this.connected_&&this.onRealtimeDisconnect_())}resume(e){As("Resuming connection for reason: "+e),delete this.interruptReasons_[e],RA(this.interruptReasons_)&&(this.reconnectDelay_=Jm,this.realtime_||this.scheduleConnect_(0))}handleTimestamp_(e){const n=e-new Date().getTime();this.onServerInfoUpdate_({serverTimeOffset:n})}cancelSentTransactions_(){for(let e=0;e<this.outstandingPuts_.length;e++){const n=this.outstandingPuts_[e];n&&"h"in n.request&&n.queued&&(n.onComplete&&n.onComplete("disconnect"),delete this.outstandingPuts_[e],this.outstandingPutCount_--)}this.outstandingPutCount_===0&&(this.outstandingPuts_=[])}onListenRevoked_(e,n){let r;n?r=n.map(i=>wN(i)).join("$"):r="default";const s=this.removeListen_(e,r);s&&s.onComplete&&s.onComplete("permission_denied")}removeListen_(e,n){const r=new Hn(e).toString();let s;if(this.listens.has(r)){const i=this.listens.get(r);s=i.get(n),i.delete(n),i.size===0&&this.listens.delete(r)}else s=void 0;return s}onAuthRevoked_(e,n){As("Auth token revoked: "+e+"/"+n),this.authToken_=null,this.forceTokenRefresh_=!0,this.realtime_.close(),(e==="invalid_token"||e==="permission_denied")&&(this.invalidAuthTokenCount_++,this.invalidAuthTokenCount_>=V2&&(this.reconnectDelay_=M2,this.authTokenProvider_.notifyForInvalidToken()))}onAppCheckRevoked_(e,n){As("App check token revoked: "+e+"/"+n),this.appCheckToken_=null,this.forceTokenRefresh_=!0,(e==="invalid_token"||e==="permission_denied")&&(this.invalidAppCheckTokenCount_++,this.invalidAppCheckTokenCount_>=V2&&this.appCheckTokenProvider_.notifyForInvalidToken())}onSecurityDebugPacket_(e){this.securityDebugCallback_?this.securityDebugCallback_(e):"msg"in e&&console.log("FIREBASE: "+e.msg.replace(` 104`,` 105FIREBASE: `))}restoreState_(){this.tryAuth(),this.tryAppCheck();for(const e of this.listens.values())for(const n of e.values())this.sendListen_(n);for(let e=0;e<this.outstandingPuts_.length;e++)this.outstandingPuts_[e]&&this.sendPut_(e);for(;this.onDisconnectRequestQueue_.length;){const e=this.onDisconnectRequestQueue_.shift();this.sendOnDisconnect_(e.action,e.pathString,e.data,e.onComplete)}for(let e=0;e<this.outstandingGets_.length;e++)this.outstandingGets_[e]&&this.sendGet_(e)}sendConnectStats_(){const e={};let n="js";e["sdk."+n+"."+H3.replace(/\./g,"-")]=1,yk()?e["framework.cordova"]=1:aq()&&(e["framework.reactnative"]=1),this.reportStats(e)}shouldReconnect_(){const e=wS.getInstance().currentlyOnline();return RA(this.interruptReasons_)&&e}}Oc.nextPersistentConnectionId_=0;Oc.nextConnectionId_=0;class Ut{constructor(e,n){this.name=e,this.node=n}static Wrap(e,n){return new Ut(e,n)}}class fE{getCompare(){return this.compare.bind(this)}
vendor: 8,683 bytes, line 105
105indexedValueChanged(e,n){const r=new Ut(Zd,e),s=new Ut(Zd,n);return this.compare(r,s)!==0}minPost(){return Ut.MIN}}let wb;class m5 extends fE{static get __EMPTY_NODE(){return wb}static set __EMPTY_NODE(e){wb=e}compare(e,n){return Vp(e.name,n.name)}isDefinedOn(e){throw Pp("KeyIndex.isDefinedOn not expected to be called.")}indexedValueChanged(e,n){return!1}minPost(){return Ut.MIN}maxPost(){return new Ut(gu,wb)}makePost(e,n){return qe(typeof e=="string","KeyIndex indexValue must always be a string."),new Ut(e,wb)}toString(){return".key"}}const Zl=new m5;class Sb{constructor(e,n,r,s,i=null){this.isReverse_=s,this.resultGenerator_=i,this.nodeStack_=[];let o=1;for(;!e.isEmpty();)if(e=e,o=n?r(e.key,n):1,s&&(o*=-1),o<0)this.isReverse_?e=e.left:e=e.right;else if(o===0){this.nodeStack_.push(e);break}else this.nodeStack_.push(e),this.isReverse_?e=e.right:e=e.left}getNext(){if(this.nodeStack_.length===0)return null;let e=this.nodeStack_.pop(),n;if(this.resultGenerator_?n=this.resultGenerator_(e.key,e.value):n={key:e.key,value:e.value},this.isReverse_)for(e=e.left;!e.isEmpty();)this.nodeStack_.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack_.push(e),e=e.left;return n}hasNext(){return this.nodeStack_.length>0}peek(){if(this.nodeStack_.length===0)return null;const e=this.nodeStack_[this.nodeStack_.length-1];return this.resultGenerator_?this.resultGenerator_(e.key,e.value):{key:e.key,value:e.value}}}class as{constructor(e,n,r,s,i){this.key=e,this.value=n,this.color=r??as.RED,this.left=s??pi.EMPTY_NODE,this.right=i??pi.EMPTY_NODE}copy(e,n,r,s,i){return new as(e??this.key,n??this.value,r??this.color,s??this.left,i??this.right)}count(){return this.left.count()+1+this.right.count()}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||!!e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min_(){return this.left.isEmpty()?this:this.left.min_()}minKey(){return this.min_().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,n,r){let s=this;const i=r(e,s.key);return i<0?s=s.copy(null,null,null,s.left.insert(e,n,r),null):i===0?s=s.copy(null,n,null,null,null):s=s.copy(null,null,null,null,s.right.insert(e,n,r)),s.fixUp_()}removeMin_(){if(this.left.isEmpty())return pi.EMPTY_NODE;let e=this;return!e.left.isRed_()&&!e.left.left.isRed_()&&(e=e.moveRedLeft_()),e=e.copy(null,null,null,e.left.removeMin_(),null),e.fixUp_()}remove(e,n){let r,s;if(r=this,n(e,r.key)<0)!r.left.isEmpty()&&!r.left.isRed_()&&!r.left.left.isRed_()&&(r=r.moveRedLeft_()),r=r.copy(null,null,null,r.left.remove(e,n),null);else{if(r.left.isRed_()&&(r=r.rotateRight_()),!r.right.isEmpty()&&!r.right.isRed_()&&!r.right.left.isRed_()&&(r=r.moveRedRight_()),n(e,r.key)===0){if(r.right.isEmpty())return pi.EMPTY_NODE;s=r.right.min_(),r=r.copy(s.key,s.value,null,null,r.right.removeMin_())}r=r.copy(null,null,null,null,r.right.remove(e,n))}return r.fixUp_()}isRed_(){return this.color}fixUp_(){let e=this;return e.right.isRed_()&&!e.left.isRed_()&&(e=e.rotateLeft_()),e.left.isRed_()&&e.left.left.isRed_()&&(e=e.rotateRight_()),e.left.isRed_()&&e.right.isRed_()&&(e=e.colorFlip_()),e}moveRedLeft_(){let e=this.colorFlip_();return e.right.left.isRed_()&&(e=e.copy(null,null,null,null,e.right.rotateRight_()),e=e.rotateLeft_(),e=e.colorFlip_()),e}moveRedRight_(){let e=this.colorFlip_();return e.left.left.isRed_()&&(e=e.rotateRight_(),e=e.colorFlip_()),e}rotateLeft_(){const e=this.copy(null,null,as.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight_(){const e=this.copy(null,null,as.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip_(){const e=this.left.copy(null,null,!this.left.color,null,null),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth_(){const e=this.check_();return Math.pow(2,e)<=this.count()+1}check_(){if(this.isRed_()&&this.left.isRed_())throw new Error("Red node has red child("+this.key+","+this.value+")");if(this.right.isRed_())throw new Error("Right child of ("+this.key+","+this.value+") is red");const e=this.left.check_();if(e!==this.right.check_())throw new Error("Black depths differ");return e+(this.isRed_()?0:1)}}as.RED=!0;as.BLACK=!1;class Zme{copy(e,n,r,s,i){return this}insert(e,n,r){return new as(e,n,null)}remove(e,n){return this}count(){return 0}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}check_(){return 0}isRed_(){return!1}}class pi{constructor(e,n=pi.EMPTY_NODE){this.comparator_=e,this.root_=n}insert(e,n){return new pi(this.comparator_,this.root_.insert(e,n,this.comparator_).copy(null,null,as.BLACK,null,null))}remove(e){return new pi(this.comparator_,this.root_.remove(e,this.comparator_).copy(null,null,as.BLACK,null,null))}get(e){let n,r=this.root_;for(;!r.isEmpty();){if(n=this.comparator_(e,r.key),n===0)return r.value;n<0?r=r.left:n>0&&(r=r.right)}return null}getPredecessorKey(e){let n,r=this.root_,s=null;for(;!r.isEmpty();)if(n=this.comparator_(e,r.key),n===0){if(r.left.isEmpty())return s?s.key:null;for(r=r.left;!r.right.isEmpty();)r=r.right;return r.key}else n<0?r=r.left:n>0&&(s=r,r=r.right);throw new Error("Attempted to find predecessor key for a nonexistent key. What gives?")}isEmpty(){return this.root_.isEmpty()}count(){return this.root_.count()}minKey(){return this.root_.minKey()}maxKey(){return this.root_.maxKey()}inorderTraversal(e){return this.root_.inorderTraversal(e)}reverseTraversal(e){return this.root_.reverseTraversal(e)}getIterator(e){return new Sb(this.root_,null,this.comparator_,!1,e)}getIteratorFrom(e,n){return new Sb(this.root_,e,this.comparator_,!1,n)}getReverseIteratorFrom(e,n){return new Sb(this.root_,e,this.comparator_,!0,n)}getReverseIterator(e){return new Sb(this.root_,null,this.comparator_,!0,e)}}pi.EMPTY_NODE=new Zme;function ege(t,e){return Vp(t.name,e.name)}function AN(t,e){return Vp(t,e)}let fR;function tge(t){fR=t}const g5=function(t){return typeof t=="number"?"number:"+G3(t):"string:"+t},_5=function(t){if(t.isLeafNode()){const e=t.val();qe(typeof e=="string"||typeof e=="number"||typeof e=="object"&&Ha(e,".sv"),"Priority must be a string or number.")}else qe(t===fR||t.isEmpty(),"priority of unexpected type.");qe(t===fR||t.getPriority().isEmpty(),"Priority nodes can't have a priority of their own.")};let F2;class ss{static set __childrenNodeConstructor(e){F2=e}static get __childrenNodeConstructor(){return F2}constructor(e,n=ss.__childrenNodeConstructor.EMPTY_NODE){this.value_=e,this.priorityNode_=n,this.lazyHash_=null,qe(this.value_!==void 0&&this.value_!==null,"LeafNode shouldn't be created with null/undefined value."),_5(this.priorityNode_)}isLeafNode(){return!0}getPriority(){return this.priorityNode_}updatePriority(e){return new ss(this.value_,e)}getImmediateChild(e){return e===".priority"?this.priorityNode_:ss.__childrenNodeConstructor.EMPTY_NODE}getChild(e){return Kt(e)?this:$t(e)===".priority"?this.priorityNode_:ss.__childrenNodeConstructor.EMPTY_NODE}hasChild(){return!1}getPredecessorChildName(e,n){return null}updateImmediateChild(e,n){return e===".priority"?this.updatePriority(n):n.isEmpty()&&e!==".priority"?this:ss.__childrenNodeConstructor.EMPTY_NODE.updateImmediateChild(e,n).updatePriority(this.priorityNode_)}updateChild(e,n){const r=$t(e);return r===null?n:n.isEmpty()&&r!==".priority"?this:(qe(r!==".priority"||_u(e)===1,".priority must be the last token in a path"),this.updateImmediateChild(r,ss.__childrenNodeConstructor.EMPTY_NODE.updateChild(Gn(e),n)))}isEmpty(){return!1}numChildren(){return 0}forEachChild(e,n){return!1}val(e){return e&&!this.getPriority().isEmpty()?{".value":this.getValue(),".priority":this.getPriority().val()}:this.getValue()}hash(){if(this.lazyHash_===null){let e="";this.priorityNode_.isEmpty()||(e+="priority:"+g5(this.priorityNode_.val())+":");const n=typeof this.value_;e+=n+":",n==="number"?e+=G3(this.value_):e+=this.value_,this.lazyHash_=j3(e)}return this.lazyHash_}getValue(){return this.value_}compareTo(e){return e===ss.__childrenNodeConstructor.EMPTY_NODE?1:e instanceof ss.__childrenNodeConstructor?-1:(qe(e.isLeafNode(),"Unknown node type"),this.compareToLeafNode_(e))}compareToLeafNode_(e){const n=typeof e.value_,r=typeof this.value_,s=ss.VALUE_TYPE_ORDER.indexOf(n),i=ss.VALUE_TYPE_ORDER.indexOf(r);return qe(s>=0,"Unknown leaf type: "+n),qe(i>=0,"Unknown leaf type: "+r),s===i?r==="object"?0:this.value_<e.value_?-1:this.value_===e.value_?0:1:i-s}withIndex(){return this}isIndexed(){return!0}equals(e){if(e===this)return!0;
105if(e.isLeafNode()){const n=e;return this.value_===n.value_&&this.priorityNode_.equals(n.priorityNode_)}else return!1}}ss.VALUE_TYPE_ORDER=["object","boolean","number","string"];let y5,v5;function nge(t){y5=t}function rge(t){v5=t}class sge extends fE{compare(e,n){const r=e.node.getPriority(),s=n.node.getPriority(),i=r.compareTo(s);return i===0?Vp(e.name,n.name):i}isDefinedOn(e){return!e.getPriority().isEmpty()}indexedValueChanged(e,n){return!e.getPriority().equals(n.getPriority())}minPost(){return Ut.MIN}maxPost(){return new Ut(gu,new ss("[PRIORITY-POST]",v5))}makePost(e,n){const r=y5(e);return new Ut(n,new ss("[PRIORITY-POST]",r))}toString(){return".priority"}}const lr=new sge;const ige=Math.log(2);class oge{constructor(e){const n=i=>parseInt(Math.log(i)/ige,10),r=i=>parseInt(Array(i+1).join("1"),2);this.count=n(e+1),this.current_=this.count-1;const s=r(this.count);this.bits_=e+1&s}nextBitIsOne(){const e=!(this.bits_&1<<this.current_);return this.current_--,e}}const SS=function(t,e,n,r){t.sort(e);const s=function(c,l){const d=l-c;let h,p;if(d===0)return null;if(d===1)return h=t[c],p=n?n(h):h,new as(p,h.node,as.BLACK,null,null);{const g=parseInt(d/2,10)+c,_=s(c,g),v=s(g+1,l);return h=t[g],p=n?n(h):h,new as(p,h.node,as.BLACK,_,v)}},i=function(c){let l=null,d=null,h=t.length;const p=function(_,v){const b=h-_,w=h;h-=_;const E=s(b+1,w),T=t[b],R=n?n(T):T;g(new as(R,T.node,v,null,E))},g=function(_){l?(l.left=_,l=_):(d=_,l=_)};for(let _=0;_<c.count;++_){const v=c.nextBitIsOne(),b=Math.pow(2,c.count-(_+1));v?p(b,as.BLACK):(p(b,as.BLACK),p(b,as.RED))}return d},o=new oge(t.length),a=i(o);return new pi(r||e,a)};let X0;const zh={};class Sc{static get Default(){return qe(zh&&lr,"ChildrenNode.ts has not been loaded"),X0=X0||new Sc({".priority":zh},{".priority":lr}),X0}constructor(e,n){this.indexes_=e,this.indexSet_=n}get(e){const n=Uf(this.indexes_,e);if(!n)throw new Error("No index defined for "+e);return n instanceof pi?n:null}hasIndex(e){return Ha(this.indexSet_,e.toString())}addIndex(e,n){qe(e!==Zl,"KeyIndex always exists and isn't meant to be added to the IndexMap.");const r=[];let s=!1;const i=n.getIterator(Ut.Wrap);let o=i.getNext();for(;o;)s=s||e.isDefinedOn(o.node),r.push(o),o=i.getNext();let a;s?a=SS(r,e.getCompare()):a=zh;const c=e.toString(),l={...this.indexSet_};l[c]=e;const d={...this.indexes_};return d[c]=a,new Sc(d,l)}addToIndexes(e,n){const r=Xw(this.indexes_,(s,i)=>{const o=Uf(this.indexSet_,i);if(qe(o,"Missing index implementation for "+i),s===zh)if(o.isDefinedOn(e.node)){const a=[],c=n.getIterator(Ut.Wrap);let l=c.getNext();for(;l;)l.name!==e.name&&a.push(l),l=c.getNext();return a.push(e),SS(a,o.getCompare())}else return zh;else{const a=n.get(e.name);let c=s;
105return a&&(c=c.remove(new Ut(e.name,a))),c.insert(e,e.node)}});return new Sc(r,this.indexSet_)}removeFromIndexes(e,n){const r=Xw(this.indexes_,s=>{if(s===zh)return s;{const i=n.get(e.name);return i?s.remove(new Ut(e.name,i)):s}});return new Sc(r,this.indexSet_)}}let Qm;class St{static get EMPTY_NODE(){return Qm||(Qm=new St(new pi(AN),null,Sc.Default))}constructor(e,n,r){this.children_=e,this.priorityNode_=n,this.indexMap_=r,this.lazyHash_=null,this.priorityNode_&&_5(this.priorityNode_),this.children_.isEmpty()&&qe(!this.priorityNode_||this.priorityNode_.isEmpty(),"An empty node cannot have a priority")}isLeafNode(){return!1}getPriority(){return this.priorityNode_||Qm}updatePriority(e){return this.children_.isEmpty()?this:new St(this.children_,e,this.indexMap_)}getImmediateChild(e){if(e===".priority")return this.getPriority();{const n=this.children_.get(e);return n===null?Qm:n}}getChild(e){const n=$t(e);return n===null?this:this.getImmediateChild(n).getChild(Gn(e))}hasChild(e){return this.children_.get(e)!==null}updateImmediateChild(e,n){if(qe(n,"We should always be passing snapshot nodes"),e===".priority")return this.updatePriority(n);{const r=new Ut(e,n);let s,i;n.isEmpty()?(s=this.children_.remove(e),i=this.indexMap_.removeFromIndexes(r,this.children_)):(s=this.children_.insert(e,n),i=this.indexMap_.addToIndexes(r,this.children_));const o=s.isEmpty()?Qm:this.priorityNode_;return new St(s,o,i)}}updateChild(e,n){const r=$t(e);if(r===null)return n;{qe($t(e)!==".priority"||_u(e)===1,".priority must be the last token in a path");const s=this.getImmediateChild(r).updateChild(Gn(e),n);return this.updateImmediateChild(r,s)}}isEmpty(){return this.children_.isEmpty()}numChildren(){return this.children_.count()}val(e){if(this.isEmpty())return null;const n={};let r=0,s=0,i=!0;if(this.forEachChild(lr,(o,a)=>{n[o]=a.val(e),r++,i&&St.INTEGER_REGEXP_.test(o)?s=Math.max(s,Number(o)):i=!1}),!e&&i&&s<2*r){const o=[];for(const a in n)o[a]=n[a];return o}else return e&&!this.getPriority().isEmpty()&&(n[".priority"]=this.getPriority().val()),n}hash(){if(this.lazyHash_===null){let e="";this.getPriority().isEmpty()||(e+="priority:"+g5(this.getPriority().val())+":"),this.forEachChild(lr,(n,r)=>{const s=r.hash();s!==""&&(e+=":"+n+":"+s)}),this.lazyHash_=e===""?"":j3(e)}return this.lazyHash_}getPredecessorChildName(e,n,r){const s=this.resolveIndex_(r);if(s){const i=s.getPredecessorKey(new Ut(e,n));return i?i.name:null}else return this.children_.getPredecessorKey(e)}getFirstChildName(e){const n=this.resolveIndex_(e);if(n){const r=n.minKey();return r&&r.name}else return this.children_.minKey()}getFirstChild(e){const n=this.getFirstChildName(e);return n?new Ut(n,this.children_.get(n)):null}getLastChildName(e){const n=this.resolveIndex_(e);if(n){const r=n.maxKey();return r&&r.name}else return this.children_.maxKey()}getLastChild(e){const n=this.getLastChildName(e);return n?new Ut(n,this.children_.get(n)):null}forEachChild(e,n){const r=this.resolveIndex_(e);return r?r.inorderTraversal(s=>n(s.name,s.node)):this.children_.inorderTraversal(n)}getIterator(e){return this.getIteratorFrom(e.minPost(),e)}getIteratorFrom(e,n){const r=this.resolveIndex_(n);if(r)return r.getIteratorFrom(e,s=>s);{const s=this.children_.getIteratorFrom(e.name,Ut.Wrap);let i=s.peek();for(;i!=null&&n.compare(i,e)<0;)s.getNext(),i=s.peek();return s}}getReverseIterator(e){return this.getReverseIteratorFrom(e.maxPost(),e)}getReverseIteratorFrom(e,n){const r=this.resolveIndex_(n);if(r)return r.getReverseIteratorFrom(e,s=>s);{const s=this.children_.getReverseIteratorFrom(e.name,Ut.Wrap);let i=s.peek();for(;i!=null&&n.compare(i,e)>0;)s.getNext(),i=s.peek();return s}}compareTo(e){return this.isEmpty()?e.isEmpty()?0:-1:e.isLeafNode()||e.isEmpty()?1:e===Ty?-1:0}withIndex(e){if(e===Zl||this.indexMap_.hasIndex(e))return this;{const n=this.indexMap_.addIndex(e,this.children_);return new St(this.children_,this.priorityNode_,n)}}isIndexed(e){return e===Zl||this.indexMap_.hasIndex(e)}equals(e){if(e===this)return!0;if(e.isLeafNode())return!1;{const n=e;if(this.getPriority().equals(n.getPriority()))if(this.children_.count()===n.children_.count()){const r=this.getIterator(lr),s=n.getIterator(lr);let i=r.getNext(),o=s.getNext();for(;i&&o;){if(i.name!==o.name||!i.node.equals(o.node))return!1;i=r.getNext(),o=s.getNext()}return i===null&&o===null}else return!1;else return!1}}resolveIndex_(e){return e===Zl?null:this.indexMap_.get(e.toString())}}St.INTEGER_REGEXP_=/^(0|[1-9]\d*)$/;class age extends St{constructor(){super(new pi(AN),St.EMPTY_NODE,Sc.Default)}compareTo(e){return e===this?0:1}equals(e){return e===this}getPriority(){return this}getImmediateChild(e){return St.EMPTY_NODE}isEmpty(){return!1}}const Ty=new age;Object.defineProperties(Ut,{MIN:{value:new Ut(Zd,St.EMPTY_NODE)},MAX:{value:new Ut(gu,Ty)}});m5.__EMPTY_NODE=St.EMPTY_NODE;ss.__childrenNodeConstructor=St;tge(Ty);rge(Ty);const cge=!0;function us(t,e=null){if(t===null)return St.EMPTY_NODE;if(typeof t=="object"&&".priority"in t&&(e=t[".priority"]),qe(e===null||typeof e=="string"||typeof e=="number"||typeof e=="object"&&".sv"in e,"Invalid priority type found: "+typeof e),typeof t=="object"&&".value"in t&&t[".value"]!==null&&(t=t[".value"]),typeof t!="object"||".sv"in t){const n=t;return new ss(n,us(e))}if(!(t instanceof Array)&&cge){const n=[];let r=!1;if(Ti(t,(o,a)=>
105{if(o.substring(0,1)!=="."){const c=us(a);c.isEmpty()||(r=r||!c.getPriority().isEmpty(),n.push(new Ut(o,c)))}}),n.length===0)return St.EMPTY_NODE;const i=SS(n,ege,o=>o.name,AN);if(r){const o=SS(n,lr.getCompare());return new St(i,us(e),new Sc({".priority":o},{".priority":lr}))}else return new St(i,us(e),Sc.Default)}else{let n=St.EMPTY_NODE;return Ti(t,(r,s)=>{if(Ha(t,r)&&r.substring(0,1)!=="."){const i=us(s);(i.isLeafNode()||!i.isEmpty())&&(n=n.updateImmediateChild(r,i))}}),n.updatePriority(us(e))}}nge(us);class b5 extends fE{constructor(e){super(),this.indexPath_=e,qe(!Kt(e)&&$t(e)!==".priority","Can't create PathIndex with empty path or .priority key")}extractChild(e){return e.getChild(this.indexPath_)}isDefinedOn(e){return!e.getChild(this.indexPath_).isEmpty()}compare(e,n){const r=this.extractChild(e.node),s=this.extractChild(n.node),i=r.compareTo(s);return i===0?Vp(e.name,n.name):i}makePost(e,n){const r=us(e),s=St.EMPTY_NODE.updateChild(this.indexPath_,r);return new Ut(n,s)}maxPost(){const e=St.EMPTY_NODE.updateChild(this.indexPath_,Ty);return new Ut(gu,e)}toString(){return h5(this.indexPath_,0).join("/")}}class lge extends fE{compare(e,n){const r=e.node.compareTo(n.node);return r===0?Vp(e.name,n.name):r}isDefinedOn(e){return!0}indexedValueChanged(e,n){return!e.equals(n)}
105minPost(){return Ut.MIN}maxPost(){return Ut.MAX}makePost(e,n){const r=us(e);return new Ut(n,r)}toString(){return".value"}}const w5=new lge;function S5(t){return{type:"value",snapshotNode:t}}function ap(t,e){return{type:"child_added",snapshotNode:e,childName:t}}function E_(t,e){return{type:"child_removed",snapshotNode:e,childName:t}}function I_(t,e,n){return{type:"child_changed",snapshotNode:e,childName:t,oldSnap:n}}function uge(t,e){return{type:"child_moved",snapshotNode:e,childName:t}}class RN{constructor(e){this.index_=e}updateChild(e,n,r,s,i,o){qe(e.isIndexed(this.index_),"A node must be indexed if only a child is updated");const a=e.getImmediateChild(n);return a.getChild(s).equals(r.getChild(s))&&a.isEmpty()===r.isEmpty()||(o!=null&&(r.isEmpty()?e.hasChild(n)?o.trackChildChange(E_(n,a)):qe(e.isLeafNode(),"A child remove without an old child only makes sense on a leaf node"):a.isEmpty()?o.trackChildChange(ap(n,r)):o.trackChildChange(I_(n,r,a))),e.isLeafNode()&&r.isEmpty())?e:e.updateImmediateChild(n,r).withIndex(this.index_)}updateFullNode(e,n,r){return r!=null&&(e.isLeafNode()||e.forEachChild(lr,(s,i)=>{n.hasChild(s)||r.trackChildChange(E_(s,i))}),n.isLeafNode()||n.forEachChild(lr,(s,i)=>{if(e.hasChild(s)){const o=e.getImmediateChild(s);o.equals(i)||r.trackChildChange(I_(s,i,o))}else r.trackChildChange(ap(s,i))})),n.withIndex(this.index_)}
vendor: 1,124 bytes, line 105
105updatePriority(e,n){return e.isEmpty()?St.EMPTY_NODE:e.updatePriority(n)}filtersNodes(){return!1}getIndexedFilter(){return this}getIndex(){return this.index_}}class C_{constructor(e){this.indexedFilter_=new RN(e.getIndex()),this.index_=e.getIndex(),this.startPost_=C_.getStartPost_(e),this.endPost_=C_.getEndPost_(e),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}getStartPost(){return this.startPost_}getEndPost(){return this.endPost_}matches(e){const n=this.startIsInclusive_?this.index_.compare(this.getStartPost(),e)<=0:this.index_.compare(this.getStartPost(),e)<0,r=this.endIsInclusive_?this.index_.compare(e,this.getEndPost())<=0:this.index_.compare(e,this.getEndPost())<0;return n&&r}updateChild(e,n,r,s,i,o){return this.matches(new Ut(n,r))||(r=St.EMPTY_NODE),this.indexedFilter_.updateChild(e,n,r,s,i,o)}updateFullNode(e,n,r){n.isLeafNode()&&(n=St.EMPTY_NODE);let s=n.withIndex(this.index_);s=s.updatePriority(St.EMPTY_NODE);const i=this;return n.forEachChild(lr,(o,a)=>{i.matches(new Ut(o,a))||(s=s.updateImmediateChild(o,St.EMPTY_NODE))}),this.indexedFilter_.updateFullNode(e,s,r)}
vendor: 2,302 bytes, line 105
105updatePriority(e,n){return e}filtersNodes(){return!0}getIndexedFilter(){return this.indexedFilter_}getIndex(){return this.index_}static getStartPost_(e){if(e.hasStart()){const n=e.getIndexStartName();return e.getIndex().makePost(e.getIndexStartValue(),n)}else return e.getIndex().minPost()}static getEndPost_(e){if(e.hasEnd()){const n=e.getIndexEndName();return e.getIndex().makePost(e.getIndexEndValue(),n)}else return e.getIndex().maxPost()}}class dge{constructor(e){this.withinDirectionalStart=n=>this.reverse_?this.withinEndPost(n):this.withinStartPost(n),this.withinDirectionalEnd=n=>this.reverse_?this.withinStartPost(n):this.withinEndPost(n),this.withinStartPost=n=>{const r=this.index_.compare(this.rangedFilter_.getStartPost(),n);return this.startIsInclusive_?r<=0:r<0},this.withinEndPost=n=>{const r=this.index_.compare(n,this.rangedFilter_.getEndPost());return this.endIsInclusive_?r<=0:r<0},this.rangedFilter_=new C_(e),this.index_=e.getIndex(),this.limit_=e.getLimit(),this.reverse_=!e.isViewFromLeft(),this.startIsInclusive_=!e.startAfterSet_,this.endIsInclusive_=!e.endBeforeSet_}updateChild(e,n,r,s,i,o){return this.rangedFilter_.matches(new Ut(n,r))||(r=St.EMPTY_NODE),e.getImmediateChild(n).equals(r)?e:e.numChildren()<this.limit_?this.rangedFilter_.getIndexedFilter().updateChild(e,n,r,s,i,o):this.fullLimitUpdateChild_(e,n,r,i,o)}updateFullNode(e,n,r){let s;if(n.isLeafNode()||n.isEmpty())s=St.EMPTY_NODE.withIndex(this.index_);else if(this.limit_*2<n.numChildren()&&n.isIndexed(this.index_)){s=St.EMPTY_NODE.withIndex(this.index_);let i;this.reverse_?i=n.getReverseIteratorFrom(this.rangedFilter_.getEndPost(),this.index_):i=n.getIteratorFrom(this.rangedFilter_.getStartPost(),this.index_);let o=0;for(;i.hasNext()&&o<this.limit_;){const a=i.getNext();if(this.withinDirectionalStart(a))if(this.withinDirectionalEnd(a))s=s.updateImmediateChild(a.name,a.node),o++;else break;else continue}}else{s=n.withIndex(this.index_),s=s.updatePriority(St.EMPTY_NODE);let i;this.reverse_?i=s.getReverseIterator(this.index_):i=s.getIterator(this.index_);let o=0;for(;i.hasNext();){const a=i.getNext();o<this.limit_&&this.withinDirectionalStart(a)&&this.withinDirectionalEnd(a)?o++:s=s.updateImmediateChild(a.name,St.EMPTY_NODE)}}return this.rangedFilter_.getIndexedFilter().updateFullNode(e,s,r)}
105updatePriority(e,n){return e}filtersNodes(){return!0}getIndexedFilter(){return this.rangedFilter_.getIndexedFilter()}getIndex(){return this.index_}fullLimitUpdateChild_(e,n,r,s,i){let o;if(this.reverse_){const h=this.index_.getCompare();o=(p,g)=>h(g,p)}else o=this.index_.getCompare();const a=e;qe(a.numChildren()===this.limit_,"");const c=new Ut(n,r),l=this.reverse_?a.getFirstChild(this.index_):a.getLastChild(this.index_),d=this.rangedFilter_.matches(c);if(a.hasChild(n)){const h=a.getImmediateChild(n);let p=s.getChildAfterChild(this.index_,l,this.reverse_);for(;p!=null&&(p.name===n||a.hasChild(p.name));)p=s.getChildAfterChild(this.index_,p,this.reverse_);const g=p==null?1:o(p,c);if(d&&!r.isEmpty()&&g>=0)return i?.trackChildChange(I_(n,r,h)),a.updateImmediateChild(n,r);{i?.trackChildChange(E_(n,h));const v=a.updateImmediateChild(n,St.EMPTY_NODE);return p!=null&&this.rangedFilter_.matches(p)?(i?.trackChildChange(ap(p.name,p.node)),v.updateImmediateChild(p.name,p.node)):v}}else return r.isEmpty()?e:d&&o(l,c)>=0?(i!=null&&(i.trackChildChange(E_(l.name,l.node)),i.trackChildChange(ap(n,r))),a.updateImmediateChild(n,r).updateImmediateChild(l.name,St.EMPTY_NODE)):e}}class PN{constructor(){this.limitSet_=!1,this.startSet_=!1,this.startNameSet_=!1,this.startAfterSet_=!1,this.endSet_=!1,this.endNameSet_=!1,this.endBeforeSet_=!1,this.limit_=0,this.viewFrom_="",this.indexStartValue_=null,this.indexStartName_="",this.indexEndValue_=null,this.indexEndName_="",this.index_=lr}hasStart(){return this.startSet_}isViewFromLeft(){return this.viewFrom_===""?this.startSet_:this.viewFrom_==="l"}getIndexStartValue(){return qe(this.startSet_,"Only valid if start has been set"),this.indexStartValue_}getIndexStartName(){return qe(this.startSet_,"Only valid if start has been set"),this.startNameSet_?this.indexStartName_:Zd}hasEnd(){return this.endSet_}getIndexEndValue(){return qe(this.endSet_,"Only valid if end has been set"),this.indexEndValue_}getIndexEndName(){return qe(this.endSet_,"Only valid if end has been set"),this.endNameSet_?this.indexEndName_:gu}hasLimit(){return this.limitSet_}hasAnchoredLimit(){return this.limitSet_&&this.viewFrom_!==""}getLimit(){return qe(this.limitSet_,"Only valid if limit has been set"),this.limit_}getIndex(){return this.index_}loadsAllData(){return!(this.startSet_||this.endSet_||this.limitSet_)}isDefault(){return this.loadsAllData()&&this.index_===lr}copy(){const e=new PN;return e.limitSet_=this.limitSet_,e.limit_=this.limit_,e.startSet_=this.startSet_,e.startAfterSet_=this.startAfterSet_,e.indexStartValue_=this.indexStartValue_,e.startNameSet_=this.startNameSet_,e.indexStartName_=this.indexStartName_,e.endSet_=this.endSet_,e.endBeforeSet_=this.endBeforeSet_,e.indexEndValue_=this.indexEndValue_,e.endNameSet_=this.endNameSet_,e.indexEndName_=this.indexEndName_,e.index_=this.index_,e.viewFrom_=this.viewFrom_,e}}function hge(t){return t.loadsAllData()?new RN(t.getIndex()):t.hasLimit()?new dge(t):new C_(t)}function fge(t,e,n){const r=t.copy();return r.startSet_=!0,e===void 0&&(e=null),r.indexStartValue_=e,n!=null?(r.startNameSet_=!0,r.indexStartName_=n):(r.startNameSet_=!1,r.indexStartName_=""),r}function pge(t,e){const n=t.copy();return n.index_=e,n}function B2(t){const e={};if(t.isDefault())return e;let n;if(t.index_===lr?n="$priority":t.index_===w5?n="$value":t.index_===Zl?n="$key":(qe(t.index_ instanceof b5,"Unrecognized index type!"),n=t.index_.toString()),e.orderBy=Jr(n),t.startSet_){const r=t.startAfterSet_?"startAfter":"startAt";e[r]=Jr(t.indexStartValue_),t.startNameSet_&&(e[r]+=","+Jr(t.indexStartName_))}if(t.endSet_){const r=t.endBeforeSet_?"endBefore":"endAt";e[r]=Jr(t.indexEndValue_),t.endNameSet_&&(e[r]+=","+Jr(t.indexEndName_))}return t.limitSet_&&(t.isViewFromLeft()?e.limitToFirst=t.limit_:e.limitToLast=t.limit_),e}function $2(t){const e={};if(t.startSet_&&(e.sp=t.indexStartValue_,t.startNameSet_&&(e.sn=t.indexStartName_),e.sin=!t.startAfterSet_),t.endSet_&&(e.ep=t.indexEndValue_,t.endNameSet_&&(e.en=t.indexEndName_),e.ein=!t.endBeforeSet_),t.limitSet_){e.l=t.limit_;let n=t.viewFrom_;n===""&&(t.isViewFromLeft()?n="l":n="r"),e.vf=n}return t.index_!==lr&&(e.i=t.index_.toString()),e}class TS extends l5{reportStats(e){throw new Error("Method not implemented.")}static getListenId_(e,n){return n!==void 0?"tag$"+n:(qe(e._queryParams.isDefault(),"should have a tag if it's not a default query."),e._path.toString())}constructor(e,n,r,s){super(),this.repoInfo_=e,this.onDataUpdate_=n,this.authTokenProvider_=r,this.appCheckTokenProvider_=s,this.log_=Sy("p:rest:"),this.listens_={}}
105listen(e,n,r,s){const i=e._path.toString();this.log_("Listen called for "+i+" "+e._queryIdentifier);const o=TS.getListenId_(e,r),a={};this.listens_[o]=a;const c=B2(e._queryParams);this.restRequest_(i+".json",c,(l,d)=>{let h=d;if(l===404&&(h=null,l=null),l===null&&this.onDataUpdate_(i,h,!1,r),Uf(this.listens_,o)===a){let p;l?l===401?p="permission_denied":p="rest_error:"+l:p="ok",s(p,null)}})}unlisten(e,n){const r=TS.getListenId_(e,n);delete this.listens_[r]}get(e){const n=B2(e._queryParams),r=e._path.toString(),s=new $T;return this.restRequest_(r+".json",n,(i,o)=>{let a=o;i===404&&(a=null,i=null),i===null?(this.onDataUpdate_(r,a,!1,null),s.resolve(a)):s.reject(new Error(a))}),s.promise}refreshAuthToken(e){}restRequest_(e,n={},r){return n.format="export",Promise.all([this.authTokenProvider_.getToken(!1),this.appCheckTokenProvider_.getToken(!1)]).then(([s,i])=>{s&&s.accessToken&&(n.auth=s.accessToken),i&&i.token&&(n.ac=i.token);const o=(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host+e+"?ns="+this.repoInfo_.namespace+kp(n);this.log_("Sending REST request for "+o);const a=new XMLHttpRequest;a.onreadystatechange=()=>{if(r&&a.readyState===4){this.log_("REST Response for "+o+" received. status:",a.status,"response:",a.responseText);let c=null;if(a.status>=200&&a.status<300){try{c=o_(a.responseText)}catch{yi("Failed to parse JSON response for "+o+": "+a.responseText)}r(null,c)}else a.status!==401&&a.status!==404&&yi("Got unsuccessful REST response for "+o+" Status: "+a.status),r(a.status);r=null}},a.open("GET",o,!0),a.send()})}}class mge{constructor(){this.rootNode_=St.EMPTY_NODE}getNode(e){return this.rootNode_.getChild(e)}updateSnapshot(e,n){this.rootNode_=this.rootNode_.updateChild(e,n)}}function ES(){return{value:null,children:new Map}}function T5(t,e,n){if(Kt(e))t.value=n,t.children.clear();else if(t.value!==null)t.value=t.value.updateChild(e,n);else{const r=$t(e);t.children.has(r)||t.children.set(r,ES());const s=t.children.get(r);e=Gn(e),T5(s,e,n)}}function pR(t,e,n){t.value!==null?n(e,t.value):gge(t,(r,s)=>{const i=new Hn(e.toString()+"/"+r);pR(s,i,n)})}function gge(t,e){t.children.forEach((n,r)=>{e(r,n)})}class _ge{constructor(e){this.collection_=e,this.last_=null}get(){const e=this.collection_.get(),n={...e};return this.last_&&Ti(this.last_,(r,s)=>{n[r]=n[r]-s}),this.last_=e,n}}const U2=10*1e3,yge=30*1e3,vge=300*1e3;class bge{constructor(e,n){this.server_=n,this.statsToReport_={},this.statsListener_=new _ge(e);const r=U2+(yge-U2)*Math.random();Lg(this.reportStats_.bind(this),Math.floor(r))}reportStats_(){const e=this.statsListener_.get(),n={};let r=!1;Ti(e,(s,i)=>{i>0&&Ha(this.statsToReport_,s)&&(n[s]=i,r=!0)}),r&&this.server_.reportStats(n),Lg(this.reportStats_.bind(this),Math.floor(Math.random()*2*vge))}}var Fo;(function(t){t[t.OVERWRITE=0]="OVERWRITE",t[t.MERGE=1]="MERGE",t[t.ACK_USER_WRITE=2]="ACK_USER_WRITE",t[t.LISTEN_COMPLETE=3]="LISTEN_COMPLETE"})(Fo||(Fo={}));function E5(){return{fromUser:!0,fromServer:!1,queryId:null,tagged:!1}}function kN(){return{fromUser:!1,fromServer:!0,queryId:null,tagged:!1}}function NN(t){return{fromUser:!1,fromServer:!0,queryId:t,tagged:!0}}class IS{constructor(e,n,r){this.path=e,this.affectedTree=n,this.revert=r,this.type=Fo.ACK_USER_WRITE,this.source=E5()}operationForChild(e){if(Kt(this.path)){if(this.affectedTree.value!=null)return qe(this.affectedTree.children.isEmpty(),"affectedTree should not have overlapping affected paths."),this;{const n=this.affectedTree.subtree(new Hn(e));return new IS(cn(),n,this.revert)}}else return qe($t(this.path)===e,"operationForChild called for unrelated child."),new IS(Gn(this.path),this.affectedTree,this.revert)}}class A_{constructor(e,n){this.source=e,this.path=n,this.type=Fo.LISTEN_COMPLETE}operationForChild(e){return Kt(this.path)?new A_(this.source,cn()):new A_(this.source,Gn(this.path))}}class eh{constructor(e,n,r){this.source=e,this.path=n,this.snap=r,this.type=Fo.OVERWRITE}operationForChild(e){return Kt(this.path)?new eh(this.source,cn(),this.snap.getImmediateChild(e)):new eh(this.source,Gn(this.path),this.snap)}}class R_{constructor(e,n,r){this.source=e,this.path=n,this.children=r,this.type=Fo.MERGE}operationForChild(e){if(Kt(this.path)){const n=this.children.subtree(new Hn(e));return n.isEmpty()?null:n.value?new eh(this.source,cn(),n.value):new R_(this.source,cn(),n)}else return qe($t(this.path)===e,"Can't get a merge for a child not on the path of the operation"),new R_(this.source,Gn(this.path),this.children)}toString(){return"Operation("+this.path+": "+this.source.toString()+" merge: "+this.children.toString()+")"}}class yu{constructor(e,n,r){this.node_=e,this.fullyInitialized_=n,this.filtered_=r}isFullyInitialized(){return this.fullyInitialized_}isFiltered(){return this.filtered_}isCompleteForPath(e){if(Kt(e))return this.isFullyInitialized()&&!this.filtered_;const n=$t(e);return this.isCompleteForChild(n)}isCompleteForChild(e){return this.isFullyInitialized()&&!this.filtered_||this.node_.hasChild(e)}getNode(){return this.node_}}class wge{constructor(e){this.query_=e,this.index_=this.query_._queryParams.getIndex()}}function Sge(t,e,n,r){const s=[],i=[];return e.forEach(o=>{o.type==="child_changed"&&t.index_.indexedValueChanged(o.oldSnap,o.snapshotNode)&&i.push(uge(o.childName,o.snapshotNode))}),Xm(t,s,"child_removed",e,r,n),Xm(t,s,"child_added",e,r,n),Xm(t,s,"child_moved",i,r,n),Xm(t,s,"child_changed",e,r,n),Xm(t,s,"value",e,r,n),s}function Xm(t,e,n,r,s,i){const o=r.filter(a=>a.type===n);o.sort((a,c)=>Ege(t,a,c)),o.forEach(a=>{const c=Tge(t,a,i);
105s.forEach(l=>{l.respondsTo(a.type)&&e.push(l.createEvent(c,t.query_))})})}function Tge(t,e,n){return e.type==="value"||e.type==="child_removed"||(e.prevName=n.getPredecessorChildName(e.childName,e.snapshotNode,t.index_)),e}function Ege(t,e,n){if(e.childName==null||n.childName==null)throw Pp("Should only compare child_ events.");const r=new Ut(e.childName,e.snapshotNode),s=new Ut(n.childName,n.snapshotNode);return t.index_.compare(r,s)}function pE(t,e){return{eventCache:t,serverCache:e}}function Mg(t,e,n,r){return pE(new yu(e,n,r),t.serverCache)}function I5(t,e,n,r){return pE(t.eventCache,new yu(e,n,r))}function CS(t){return t.eventCache.isFullyInitialized()?t.eventCache.getNode():null}function th(t){return t.serverCache.isFullyInitialized()?t.serverCache.getNode():null}let Z0;const Ige=()=>(Z0||(Z0=new pi(ume)),Z0);class Yn{static fromObject(e){let n=new Yn(null);return Ti(e,(r,s)=>{n=n.set(new Hn(r),s)}),n}constructor(e,n=Ige()){this.value=e,this.children=n}isEmpty(){return this.value===null&&this.children.isEmpty()}findRootMostMatchingPathAndValue(e,n){if(this.value!=null&&n(this.value))return{path:cn(),value:this.value};if(Kt(e))return null;{const r=$t(e),s=this.children.get(r);if(s!==null){const i=s.findRootMostMatchingPathAndValue(Gn(e),n);return i!=null?{path:Qr(new Hn(r),i.path),value:i.value}:null}else return null}}findRootMostValueAndPath(e){return this.findRootMostMatchingPathAndValue(e,()=>!0)}subtree(e){if(Kt(e))return this;{const n=$t(e),r=this.children.get(n);return r!==null?r.subtree(Gn(e)):new Yn(null)}}set(e,n){if(Kt(e))return new Yn(n,this.children);{const r=$t(e),i=(this.children.get(r)||new Yn(null)).set(Gn(e),n),o=this.children.insert(r,i);return new Yn(this.value,o)}}remove(e){if(Kt(e))return this.children.isEmpty()?new Yn(null):new Yn(null,this.children);{const n=$t(e),r=this.children.get(n);if(r){const s=r.remove(Gn(e));let i;return s.isEmpty()?i=this.children.remove(n):i=this.children.insert(n,s),this.value===null&&i.isEmpty()?new Yn(null):new Yn(this.value,i)}else return this}}get(e){if(Kt(e))return this.value;{const n=$t(e),r=this.children.get(n);return r?r.get(Gn(e)):null}}setTree(e,n){if(Kt(e))return n;{const r=$t(e),i=(this.children.get(r)||new Yn(null)).setTree(Gn(e),n);let o;return i.isEmpty()?o=this.children.remove(r):o=this.children.insert(r,i),new Yn(this.value,o)}}fold(e){return this.fold_(cn(),e)}fold_(e,n){const r={};return this.children.inorderTraversal((s,i)=>{r[s]=i.fold_(Qr(e,s),n)}),n(e,this.value,r)}findOnPath(e,n){return this.findOnPath_(e,cn(),n)}findOnPath_(e,n,r){const s=this.value?r(n,this.value):!1;if(s)return s;if(Kt(e))return null;{const i=$t(e),o=this.children.get(i);return o?o.findOnPath_(Gn(e),Qr(n,i),r):null}}foreachOnPath(e,n){return this.foreachOnPath_(e,cn(),n)}foreachOnPath_(e,n,r){if(Kt(e))return this;{this.value&&r(n,this.value);const s=$t(e),i=this.children.get(s);return i?i.foreachOnPath_(Gn(e),Qr(n,s),r):new Yn(null)}}foreach(e){this.foreach_(cn(),e)}foreach_(e,n){this.children.inorderTraversal((r,s)=>{s.foreach_(Qr(e,r),n)}),this.value&&n(e,this.value)}foreachChild(e){this.children.inorderTraversal((n,r)=>{r.value&&e(n,r.value)})}}class qo{constructor(e){this.writeTree_=e}static empty(){return new qo(new Yn(null))}}function Vg(t,e,n){if(Kt(e))return new qo(new Yn(n));{const r=t.writeTree_.findRootMostValueAndPath(e);if(r!=null){const s=r.path;let i=r.value;const o=Gs(s,e);return i=i.updateChild(o,n),new qo(t.writeTree_.set(s,i))}else{const s=new Yn(n),i=t.writeTree_.setTree(e,s);return new qo(i)}}}function H2(t,e,n){let r=t;return Ti(n,(s,i)=>{r=Vg(r,Qr(e,s),i)}),r}function q2(t,e){if(Kt(e))return qo.empty();{const n=t.writeTree_.setTree(e,new Yn(null));return new qo(n)}}function mR(t,e){return fh(t,e)!=null}function fh(t,e){const n=t.writeTree_.findRootMostValueAndPath(e);return n!=null?t.writeTree_.get(n.path).getChild(Gs(n.path,e)):null}function j2(t){const e=[],n=t.writeTree_.value;return n!=null?n.isLeafNode()||n.forEachChild(lr,(r,s)=>{e.push(new Ut(r,s))}):t.writeTree_.children.inorderTraversal((r,s)=>{s.value!=null&&e.push(new Ut(r,s.value))}),e}function eu(t,e){if(Kt(e))return t;{const n=fh(t,e);return n!=null?new qo(new Yn(n)):new qo(t.writeTree_.subtree(e))}}function gR(t){return t.writeTree_.isEmpty()}function cp(t,e){return C5(cn(),t.writeTree_,e)}function C5(t,e,n){if(e.value!=null)return n.updateChild(t,e.value);{let r=null;return e.children.inorderTraversal((s,i)=>
105{s===".priority"?(qe(i.value!==null,"Priority writes must always be leaf nodes"),r=i.value):n=C5(Qr(t,s),i,n)}),!n.getChild(t).isEmpty()&&r!==null&&(n=n.updateChild(Qr(t,".priority"),r)),n}}function mE(t,e){return k5(e,t)}function Cge(t,e,n,r,s){qe(r>t.lastWriteId,"Stacking an older write on top of newer ones"),s===void 0&&(s=!0),t.allWrites.push({path:e,snap:n,writeId:r,visible:s}),s&&(t.visibleWrites=Vg(t.visibleWrites,e,n)),t.lastWriteId=r}function Age(t,e){for(let n=0;n<t.allWrites.length;n++){const r=t.allWrites[n];if(r.writeId===e)return r}return null}function Rge(t,e){const n=t.allWrites.findIndex(a=>a.writeId===e);qe(n>=0,"removeWrite called with nonexistent writeId.");const r=t.allWrites[n];t.allWrites.splice(n,1);let s=r.visible,i=!1,o=t.allWrites.length-1;for(;s&&o>=0;){const a=t.allWrites[o];a.visible&&(o>=n&&Pge(a,r.path)?s=!1:Vo(r.path,a.path)&&(i=!0)),o--}if(s){if(i)return kge(t),!0;if(r.snap)t.visibleWrites=q2(t.visibleWrites,r.path);else{const a=r.children;Ti(a,c=>{t.visibleWrites=q2(t.visibleWrites,Qr(r.path,c))})}return!0}else return!1}function Pge(t,e){if(t.snap)return Vo(t.path,e);for(const n in t.children)if(t.children.hasOwnProperty(n)&&Vo(Qr(t.path,n),e))return!0;return!1}function kge(t){t.visibleWrites=A5(t.allWrites,Nge,cn()),t.allWrites.length>0?t.lastWriteId=t.allWrites[t.allWrites.length-1].writeId:t.lastWriteId=-1}function Nge(t){return t.visible}function A5(t,e,n){let r=qo.empty();for(let s=0;s<t.length;++s){const i=t[s];if(e(i)){const o=i.path;let a;if(i.snap)Vo(n,o)?(a=Gs(n,o),r=Vg(r,a,i.snap)):Vo(o,n)&&(a=Gs(o,n),r=Vg(r,cn(),i.snap.getChild(a)));else if(i.children){if(Vo(n,o))a=Gs(n,o),r=H2(r,a,i.children);else if(Vo(o,n))if(a=Gs(o,n),Kt(a))r=H2(r,cn(),i.children);else{const c=Uf(i.children,$t(a));if(c){const l=c.getChild(Gn(a));r=Vg(r,cn(),l)}}}else throw Pp("WriteRecord should have .snap or .children")}}return r}function R5(t,e,n,r,s){if(!r&&!s){const i=fh(t.visibleWrites,e);if(i!=null)return i;{const o=eu(t.visibleWrites,e);if(gR(o))return n;if(n==null&&!mR(o,cn()))return null;{const a=n||St.EMPTY_NODE;return cp(o,a)}}}else{const i=eu(t.visibleWrites,e);if(!s&&gR(i))return n;if(!s&&n==null&&!mR(i,cn()))return null;{const o=function(l){return(l.visible||s)&&(!r||!~r.indexOf(l.writeId))&&(Vo(l.path,e)||Vo(e,l.path))},a=A5(t.allWrites,o,e),c=n||St.EMPTY_NODE;return cp(a,c)}}}function Dge(t,e,n){let r=St.EMPTY_NODE;const s=fh(t.visibleWrites,e);if(s)return s.isLeafNode()||s.forEachChild(lr,(i,o)=>{r=r.updateImmediateChild(i,o)}),r;if(n){const i=eu(t.visibleWrites,e);return n.forEachChild(lr,(o,a)=>{const c=cp(eu(i,new Hn(o)),a);r=r.updateImmediateChild(o,c)}),j2(i).forEach(o=>{r=r.updateImmediateChild(o.name,o.node)}),r}else{const i=eu(t.visibleWrites,e);return j2(i).forEach(o=>{r=r.updateImmediateChild(o.name,o.node)}),r}}function Oge(t,e,n,r,s){qe(r||s,"Either existingEventSnap or existingServerSnap must exist");const i=Qr(e,n);if(mR(t.visibleWrites,i))return null;{const o=eu(t.visibleWrites,i);return gR(o)?s.getChild(n):cp(o,s.getChild(n))}}function xge(t,e,n,r){const s=Qr(e,n),i=fh(t.visibleWrites,s);if(i!=null)return i;if(r.isCompleteForChild(n)){const o=eu(t.visibleWrites,s);return cp(o,r.getNode().getImmediateChild(n))}else return null}function Lge(t,e){return fh(t.visibleWrites,e)}function Mge(t,e,n,r,s,i,o){let a;const c=eu(t.visibleWrites,e),l=fh(c,cn());if(l!=null)a=l;else if(n!=null)a=cp(c,n);else return[];if(a=a.withIndex(o),!a.isEmpty()&&!a.isLeafNode()){const d=[],h=o.getCompare(),p=i?a.getReverseIteratorFrom(r,o):a.getIteratorFrom(r,o);let g=p.getNext();for(;g&&d.length<s;)h(g,r)!==0&&d.push(g),g=p.getNext();return d}else return[]}function Vge(){return{visibleWrites:qo.empty(),allWrites:[],lastWriteId:-1}}function AS(t,e,n,r){return R5(t.writeTree,t.treePath,e,n,r)}function DN(t,e){return Dge(t.writeTree,t.treePath,e)}function W2(t,e,n,r){return Oge(t.writeTree,t.treePath,e,n,r)}function RS(t,e){return Lge(t.writeTree,Qr(t.treePath,e))}function Fge(t,e,n,r,s,i){return Mge(t.writeTree,t.treePath,e,n,r,s,i)}function ON(t,e,n){return xge(t.writeTree,t.treePath,e,n)}function P5(t,e){return k5(Qr(t.treePath,e),t.writeTree)}function k5(t,e){return{treePath:t,writeTree:e}}class Bge{constructor(){this.changeMap=new Map}trackChildChange(e){const n=e.type,r=e.childName;qe(n==="child_added"||n==="child_changed"||n==="child_removed","Only child changes supported for tracking"),qe(r!==".priority","Only non-priority child changes can be tracked.");const s=this.changeMap.get(r);if(s){const i=s.type;if(n==="child_added"&&i==="child_removed")this.changeMap.set(r,I_(r,e.snapshotNode,s.snapshotNode));else if(n==="child_removed"&&i==="child_added")this.changeMap.delete(r);else if(n==="child_removed"&&i==="child_changed")this.changeMap.set(r,E_(r,s.oldSnap));else if(n==="child_changed"&&i==="child_added")this.changeMap.set(r,ap(r,e.
105snapshotNode));else if(n==="child_changed"&&i==="child_changed")this.changeMap.set(r,I_(r,e.snapshotNode,s.oldSnap));else throw Pp("Illegal combination of changes: "+e+" occurred after "+s)}else this.changeMap.set(r,e)}getChanges(){return Array.from(this.changeMap.values())}}class $ge{getCompleteChild(e){return null}getChildAfterChild(e,n,r){return null}}const N5=new $ge;class xN{constructor(e,n,r=null){this.writes_=e,this.viewCache_=n,this.optCompleteServerCache_=r}getCompleteChild(e){const n=this.viewCache_.eventCache;if(n.isCompleteForChild(e))return n.getNode().getImmediateChild(e);{const r=this.optCompleteServerCache_!=null?new yu(this.optCompleteServerCache_,!0,!1):this.viewCache_.serverCache;return ON(this.writes_,e,r)}}getChildAfterChild(e,n,r){const s=this.optCompleteServerCache_!=null?this.optCompleteServerCache_:th(this.viewCache_),i=Fge(this.writes_,s,n,1,r,e);return i.length===0?null:i[0]}}function Uge(t){return{filter:t}}function Hge(t,e){qe(e.eventCache.getNode().isIndexed(t.filter.getIndex()),"Event snap not indexed"),qe(e.serverCache.getNode().isIndexed(t.filter.getIndex()),"Server snap not indexed")}function qge(t,e,n,r,s){const i=new Bge;let o,a;if(n.type===Fo.OVERWRITE){const l=n;l.source.fromUser?o=_R(t,e,l.path,l.snap,r,s,i):(qe(l.source.fromServer,"Unknown source."),a=l.source.tagged||e.serverCache.isFiltered()&&!Kt(l.path),o=PS(t,e,l.path,l.snap,r,s,a,i))}else if(n.type===Fo.MERGE){const l=n;l.source.fromUser?o=Wge(t,e,l.path,l.children,r,s,i):(qe(l.source.fromServer,"Unknown source."),a=l.source.tagged||e.serverCache.isFiltered(),o=yR(t,e,l.path,l.children,r,s,a,i))}else if(n.type===Fo.ACK_USER_WRITE){const l=n;l.revert?o=zge(t,e,l.path,r,s,i):o=Gge(t,e,l.path,l.affectedTree,r,s,i)}else if(n.type===Fo.LISTEN_COMPLETE)o=Kge(t,e,n.path,r,i);else throw Pp("Unknown operation type: "+n.type);const c=i.getChanges();return jge(e,o,c),{viewCache:o,changes:c}}function jge(t,e,n){const r=e.eventCache;if(r.isFullyInitialized()){const s=r.getNode().isLeafNode()||r.getNode().isEmpty(),i=CS(t);(n.length>0||!t.eventCache.isFullyInitialized()||s&&!r.getNode().equals(i)||!r.getNode().getPriority().equals(i.getPriority()))&&n.push(S5(CS(e)))}}function D5(t,e,n,r,s,i){const o=e.eventCache;if(RS(r,n)!=null)return e;{let a,c;if(Kt(n))if(qe(e.serverCache.isFullyInitialized(),"If change path is empty, we must have complete server data"),e.serverCache.isFiltered()){const l=th(e),d=l instanceof St?l:St.EMPTY_NODE,h=DN(r,d);a=t.filter.updateFullNode(e.eventCache.getNode(),h,i)}else{const l=AS(r,th(e));a=t.filter.updateFullNode(e.eventCache.getNode(),l,i)}else{const l=$t(n);if(l===".priority"){qe(_u(n)===1,"Can't have a priority with additional path components");const d=o.getNode();c=e.serverCache.getNode();const h=W2(r,n,d,c);h!=null?a=t.filter.updatePriority(d,h):a=o.getNode()}else{const d=Gn(n);let h;if(o.isCompleteForChild(l)){c=e.serverCache.getNode();const p=W2(r,n,o.getNode(),c);p!=null?h=o.getNode().getImmediateChild(l).updateChild(d,p):h=o.getNode().getImmediateChild(l)}else h=ON(r,l,e.serverCache);h!=null?a=t.filter.updateChild(o.getNode(),l,h,d,s,i):a=o.getNode()}}return Mg(e,a,o.isFullyInitialized()||Kt(n),t.filter.filtersNodes())}}function PS(t,e,n,r,s,i,o,a){const c=e.serverCache;let l;const d=o?t.filter:t.filter.getIndexedFilter();if(Kt(n))l=d.updateFullNode(c.getNode(),r,null);else if(d.filtersNodes()&&!c.isFiltered()){const g=c.getNode().updateChild(n,r);l=d.updateFullNode(c.getNode(),g,null)}else{const g=$t(n);if(!c.isCompleteForPath(n)&&_u(n)>1)return e;const _=Gn(n),b=c.getNode().getImmediateChild(g).updateChild(_,r);g===".priority"?l=d.updatePriority(c.getNode(),b):l=d.updateChild(c.getNode(),g,b,_,N5,null)}const h=I5(e,l,c.isFullyInitialized()||Kt(n),d.filtersNodes()),p=new xN(s,h,i);return D5(t,h,n,s,p,a)}function _R(t,e,n,r,s,i,o){const a=e.eventCache;let c,l;const d=new xN(s,e,i);if(Kt(n))l=t.filter.updateFullNode(e.eventCache.getNode(),r,o),c=Mg(e,l,!0,t.filter.filtersNodes());else{const h=$t(n);if(h===".priority")l=t.filter.updatePriority(e.eventCache.getNode(),r),c=Mg(e,l,a.isFullyInitialized(),a.isFiltered());else{const p=Gn(n),g=a.getNode().getImmediateChild(h);let _;if(Kt(p))_=r;else{const v=d.getCompleteChild(h);
105v!=null?d5(p)===".priority"&&v.getChild(f5(p)).isEmpty()?_=v:_=v.updateChild(p,r):_=St.EMPTY_NODE}if(g.equals(_))c=e;else{const v=t.filter.updateChild(a.getNode(),h,_,p,d,o);c=Mg(e,v,a.isFullyInitialized(),t.filter.filtersNodes())}}}return c}function G2(t,e){return t.eventCache.isCompleteForChild(e)}function Wge(t,e,n,r,s,i,o){let a=e;return r.foreach((c,l)=>{const d=Qr(n,c);G2(e,$t(d))&&(a=_R(t,a,d,l,s,i,o))}),r.foreach((c,l)=>{const d=Qr(n,c);G2(e,$t(d))||(a=_R(t,a,d,l,s,i,o))}),a}function K2(t,e,n){return n.foreach((r,s)=>{e=e.updateChild(r,s)}),e}function yR(t,e,n,r,s,i,o,a){if(e.serverCache.getNode().isEmpty()&&!e.serverCache.isFullyInitialized())return e;let c=e,l;Kt(n)?l=r:l=new Yn(null).setTree(n,r);const d=e.serverCache.getNode();return l.children.inorderTraversal((h,p)=>{if(d.hasChild(h)){const g=e.serverCache.getNode().getImmediateChild(h),_=K2(t,g,p);c=PS(t,c,new Hn(h),_,s,i,o,a)}}),l.children.inorderTraversal((h,p)=>{const g=!e.serverCache.isCompleteForChild(h)&&p.value===null;if(!d.hasChild(h)&&!g){const _=e.serverCache.getNode().getImmediateChild(h),v=K2(t,_,p);c=PS(t,c,new Hn(h),v,s,i,o,a)}}),c}function Gge(t,e,n,r,s,i,o){if(RS(s,n)!=null)return e;const a=e.serverCache.isFiltered(),c=e.serverCache;if(r.value!=null){if(Kt(n)&&c.isFullyInitialized()||c.isCompleteForPath(n))return PS(t,e,n,c.getNode().getChild(n),s,i,a,o);if(Kt(n)){let l=new Yn(null);return c.getNode().forEachChild(Zl,(d,h)=>{l=l.set(new Hn(d),h)}),yR(t,e,n,l,s,i,a,o)}else return e}else{let l=new Yn(null);return r.foreach((d,h)=>{const p=Qr(n,d);c.isCompleteForPath(p)&&(l=l.set(d,c.getNode().getChild(p)))}),yR(t,e,n,l,s,i,a,o)}}function Kge(t,e,n,r,s){const i=e.serverCache,o=I5(e,i.getNode(),i.isFullyInitialized()||Kt(n),i.isFiltered());return D5(t,o,n,r,N5,s)}function zge(t,e,n,r,s,i){let o;if(RS(r,n)!=null)return e;{const a=new xN(r,e,s),c=e.eventCache.getNode();let l;if(Kt(n)||$t(n)===".priority"){let d;if(e.serverCache.isFullyInitialized())d=AS(r,th(e));else{const h=e.serverCache.getNode();qe(h instanceof St,"serverChildren would be complete if leaf node"),d=DN(r,h)}d=d,l=t.filter.updateFullNode(c,d,i)}else{const d=$t(n);let h=ON(r,d,e.serverCache);h==null&&e.serverCache.isCompleteForChild(d)&&(h=c.getImmediateChild(d)),h!=null?l=t.filter.updateChild(c,d,h,Gn(n),a,i):e.eventCache.getNode().hasChild(d)?l=t.filter.updateChild(c,d,St.EMPTY_NODE,Gn(n),a,i):l=c,l.isEmpty()&&e.serverCache.isFullyInitialized()&&(o=AS(r,th(e)),o.isLeafNode()&&(l=t.filter.updateFullNode(l,o,i)))}return o=e.serverCache.isFullyInitialized()||RS(r,cn())!=null,Mg(e,l,o,t.filter.filtersNodes())}}class Yge{constructor(e,n){this.query_=e,this.eventRegistrations_=[];const r=this.query_._queryParams,s=new RN(r.getIndex()),i=hge(r);this.processor_=Uge(i);const o=n.serverCache,a=n.eventCache,c=s.updateFullNode(St.EMPTY_NODE,o.getNode(),null),l=i.updateFullNode(St.EMPTY_NODE,a.getNode(),null),d=new yu(c,o.isFullyInitialized(),s.filtersNodes()),h=new yu(l,a.isFullyInitialized(),i.filtersNodes());this.viewCache_=pE(h,d),this.eventGenerator_=new wge(this.query_)}get query(){return this.query_}}function Jge(t){return t.viewCache_.serverCache.getNode()}function Qge(t){return CS(t.viewCache_)}function Xge(t,e){const n=th(t.viewCache_);return n&&(t.query._queryParams.loadsAllData()||!Kt(e)&&!n.getImmediateChild($t(e)).isEmpty())?n.getChild(e):null}function z2(t){return t.eventRegistrations_.length===0}function Zge(t,e){t.eventRegistrations_.push(e)}function Y2(t,e,n){const r=[];if(n){qe(e==null,"A cancel should cancel all event registrations.");const s=t.query._path;t.eventRegistrations_.forEach(i=>{const o=i.createCancelEvent(n,s);o&&r.push(o)})}if(e){let s=[];for(let i=0;i<t.eventRegistrations_.length;++i){const o=t.eventRegistrations_[i];if(!o.matches(e))s.push(o);else if(e.hasAnyCallback()){s=s.concat(t.eventRegistrations_.slice(i+1));break}}t.eventRegistrations_=s}else t.eventRegistrations_=[];return r}function J2(t,e,n,r){e.type===Fo.MERGE&&e.source.queryId!==null&&(qe(th(t.viewCache_),"We should always have a full cache before handling merges"),qe(CS(t.viewCache_),"Missing event cache, even though we have a server cache"));const s=t.viewCache_,i=qge(t.processor_,s,e,n,r);return Hge(t.processor_,i.viewCache),qe(i.viewCache.serverCache.isFullyInitialized()||!s.serverCache.isFullyInitialized(),"Once a server snap is complete, it should never go back"),t.viewCache_=i.viewCache,O5(t,i.changes,i.viewCache.eventCache.getNode(),null)}function e_e(t,e){const n=t.viewCache_.eventCache,r=[];
105return n.getNode().isLeafNode()||n.getNode().forEachChild(lr,(i,o)=>{r.push(ap(i,o))}),n.isFullyInitialized()&&r.push(S5(n.getNode())),O5(t,r,n.getNode(),e)}function O5(t,e,n,r){const s=r?[r]:t.eventRegistrations_;return Sge(t.eventGenerator_,e,n,s)}let kS;class x5{constructor(){this.views=new Map}}function t_e(t){qe(!kS,"__referenceConstructor has already been defined"),kS=t}function n_e(){return qe(kS,"Reference.ts has not been loaded"),kS}function r_e(t){return t.views.size===0}function LN(t,e,n,r){const s=e.source.queryId;if(s!==null){const i=t.views.get(s);return qe(i!=null,"SyncTree gave us an op for an invalid query."),J2(i,e,n,r)}else{let i=[];for(const o of t.views.values())i=i.concat(J2(o,e,n,r));return i}}function L5(t,e,n,r,s){const i=e._queryIdentifier,o=t.views.get(i);if(!o){let a=AS(n,s?r:null),c=!1;a?c=!0:r instanceof St?(a=DN(n,r),c=!1):(a=St.EMPTY_NODE,c=!1);const l=pE(new yu(a,c,!1),new yu(r,s,!1));return new Yge(e,l)}return o}function s_e(t,e,n,r,s,i){const o=L5(t,e,r,s,i);return t.views.has(e._queryIdentifier)||t.views.set(e._queryIdentifier,o),Zge(o,n),e_e(o,n)}function i_e(t,e,n,r){const s=e._queryIdentifier,i=[];let o=[];const a=vu(t);if(s==="default")for(const[c,l]of t.views.entries())o=o.concat(Y2(l,n,r)),z2(l)&&(t.views.delete(c),l.query._queryParams.loadsAllData()||i.push(l.query));else{const c=t.views.get(s);c&&(o=o.concat(Y2(c,n,r)),z2(c)&&(t.views.delete(s),c.query._queryParams.loadsAllData()||i.push(c.query)))}return a&&!vu(t)&&i.push(new(n_e())(e._repo,e._path)),{removed:i,events:o}}function M5(t){const e=[];for(const n of t.views.values())n.query._queryParams.loadsAllData()||e.push(n);return e}function tu(t,e){let n=null;for(const r of t.views.values())n=n||Xge(r,e);return n}function V5(t,e){if(e._queryParams.loadsAllData())return gE(t);{const r=e._queryIdentifier;return t.views.get(r)}}function F5(t,e){return V5(t,e)!=null}function vu(t){return gE(t)!=null}function gE(t){for(const e of t.views.values())if(e.query._queryParams.loadsAllData())return e;return null}let NS;function o_e(t){qe(!NS,"__referenceConstructor has already been defined"),NS=t}function a_e(){return qe(NS,"Reference.ts has not been loaded"),NS}let c_e=1;class Q2{constructor(e){this.listenProvider_=e,this.syncPointTree_=new Yn(null),this.pendingWriteTree_=Vge(),this.tagToQueryMap=new Map,this.queryToTagMap=new Map}}function B5(t,e,n,r,s){return Cge(t.pendingWriteTree_,e,n,r,s),s?Iy(t,new eh(E5(),e,n)):[]}function bd(t,e,n=!1){const r=Age(t.pendingWriteTree_,e);if(Rge(t.pendingWriteTree_,e)){let i=new Yn(null);return r.snap!=null?i=i.set(cn(),!0):Ti(r.children,o=>{i=i.set(new Hn(o),!0)}),Iy(t,new IS(r.path,i,n))}else return[]}function Ey(t,e,n){return Iy(t,new eh(kN(),e,n))}function l_e(t,e,n){const r=Yn.fromObject(n);return Iy(t,new R_(kN(),e,r))}function u_e(t,e){return Iy(t,new A_(kN(),e))}function d_e(t,e,n){const r=VN(t,n);if(r){const s=FN(r),i=s.path,o=s.queryId,a=Gs(i,e),c=new A_(NN(o),a);return BN(t,i,c)}else return[]}function DS(t,e,n,r,s=!1){const i=e._path,o=t.syncPointTree_.get(i);let a=[];if(o&&(e._queryIdentifier==="default"||F5(o,e))){const c=i_e(o,e,n,r);r_e(o)&&(t.syncPointTree_=t.syncPointTree_.remove(i));const l=c.removed;if(a=c.events,!s){const d=l.findIndex(p=>p._queryParams.loadsAllData())!==-1,h=t.syncPointTree_.findOnPath(i,(p,g)=>vu(g));if(d&&!h){const p=t.syncPointTree_.subtree(i);if(!p.isEmpty()){const g=p_e(p);for(let _=0;_<g.length;++_){const v=g[_],b=v.query,w=q5(t,v);t.listenProvider_.startListening(Fg(b),P_(t,b),w.hashFn,w.onComplete)}}}!h&&l.length>0&&!r&&(d?t.listenProvider_.stopListening(Fg(e),null):l.forEach(p=>{const g=t.queryToTagMap.get(_E(p));t.listenProvider_.stopListening(Fg(p),g)}))}m_e(t,l)}return a}function $5(t,e,n,r){const s=VN(t,r);if(s!=null){const i=FN(s),o=i.path,a=i.queryId,c=Gs(o,e),l=new eh(NN(a),c,n);return BN(t,o,l)}else return[]}function h_e(t,e,n,r){const s=VN(t,r);if(s){const i=FN(s),o=i.path,a=i.queryId,c=Gs(o,e),l=Yn.fromObject(n),d=new R_(NN(a),c,l);return BN(t,o,d)}else return[]}function vR(t,e,n,r=!1){const s=e._path;let i=null,o=!1;t.syncPointTree_.foreachOnPath(s,(p,g)=>{const _=Gs(p,s);i=i||tu(g,_),o=o||vu(g)});let a=t.syncPointTree_.get(s);a?(o=o||vu(a),i=i||tu(a,cn())):(a=new x5,t.syncPointTree_=t.syncPointTree_.set(s,a));let c;i!=null?c=!0:(c=!1,i=St.EMPTY_NODE,t.syncPointTree_.subtree(s).foreachChild((g,_)=>{const v=tu(_,cn());v&&(i=i.updateImmediateChild(g,v))}));const l=F5(a,e);if(!l&&!e._queryParams.loadsAllData()){const p=_E(e);
105qe(!t.queryToTagMap.has(p),"View does not exist, but we have a tag");const g=g_e();t.queryToTagMap.set(p,g),t.tagToQueryMap.set(g,p)}const d=mE(t.pendingWriteTree_,s);let h=s_e(a,e,n,d,i,c);if(!l&&!o&&!r){const p=V5(a,e);h=h.concat(__e(t,e,p))}return h}function MN(t,e,n){const s=t.pendingWriteTree_,i=t.syncPointTree_.findOnPath(e,(o,a)=>{const c=Gs(o,e),l=tu(a,c);if(l)return l});return R5(s,e,i,n,!0)}function f_e(t,e){const n=e._path;let r=null;t.syncPointTree_.foreachOnPath(n,(l,d)=>{const h=Gs(l,n);r=r||tu(d,h)});let s=t.syncPointTree_.get(n);s?r=r||tu(s,cn()):(s=new x5,t.syncPointTree_=t.syncPointTree_.set(n,s));const i=r!=null,o=i?new yu(r,!0,!1):null,a=mE(t.pendingWriteTree_,e._path),c=L5(s,e,a,i?o.getNode():St.EMPTY_NODE,i);return Qge(c)}function Iy(t,e){return U5(e,t.syncPointTree_,null,mE(t.pendingWriteTree_,cn()))}function U5(t,e,n,r){if(Kt(t.path))return H5(t,e,n,r);{const s=e.get(cn());n==null&&s!=null&&(n=tu(s,cn()));let i=[];const o=$t(t.path),a=t.operationForChild(o),c=e.children.get(o);if(c&&a){const l=n?n.getImmediateChild(o):null,d=P5(r,o);i=i.concat(U5(a,c,l,d))}return s&&(i=i.concat(LN(s,t,r,n))),i}}function H5(t,e,n,r){const s=e.get(cn());n==null&&s!=null&&(n=tu(s,cn()));let i=[];return e.children.inorderTraversal((o,a)=>{const c=n?n.getImmediateChild(o):null,l=P5(r,o),d=t.operationForChild(o);d&&(i=i.concat(H5(d,a,c,l)))}),s&&(i=i.concat(LN(s,t,r,n))),i}function q5(t,e){const n=e.query,r=P_(t,n);return{hashFn:()=>(Jge(e)||St.EMPTY_NODE).hash(),onComplete:s=>{if(s==="ok")return r?d_e(t,n._path,r):u_e(t,n._path);{const i=fme(s,n);return DS(t,n,null,i)}}}}function P_(t,e){const n=_E(e);return t.queryToTagMap.get(n)}function _E(t){return t._path.toString()+"$"+t._queryIdentifier}function VN(t,e){return t.tagToQueryMap.get(e)}function FN(t){const e=t.indexOf("$");return qe(e!==-1&&e<t.length-1,"Bad queryKey."),{queryId:t.substr(e+1),path:new Hn(t.substr(0,e))}}function BN(t,e,n){const r=t.syncPointTree_.get(e);qe(r,"Missing sync point for query tag that we're tracking");const s=mE(t.pendingWriteTree_,e);return LN(r,n,s,null)}function p_e(t){return t.fold((e,n,r)=>{if(n&&vu(n))return[gE(n)];{let s=[];return n&&(s=M5(n)),Ti(r,(i,o)=>{s=s.concat(o)}),s}})}
105function Fg(t){return t._queryParams.loadsAllData()&&!t._queryParams.isDefault()?new(a_e())(t._repo,t._path):t}function m_e(t,e){for(let n=0;n<e.length;++n){const r=e[n];if(!r._queryParams.loadsAllData()){const s=_E(r),i=t.queryToTagMap.get(s);t.queryToTagMap.delete(s),t.tagToQueryMap.delete(i)}}}function g_e(){return c_e++}function __e(t,e,n){const r=e._path,s=P_(t,e),i=q5(t,n),o=t.listenProvider_.startListening(Fg(e),s,i.hashFn,i.onComplete),a=t.syncPointTree_.subtree(r);if(s)qe(!vu(a.value),"If we're adding a query, it shouldn't be shadowed");else{const c=a.fold((l,d,h)=>{if(!Kt(l)&&d&&vu(d))return[gE(d).query];{let p=[];return d&&(p=p.concat(M5(d).map(g=>g.query))),Ti(h,(g,_)=>{p=p.concat(_)}),p}});for(let l=0;l<c.length;++l){const d=c[l];t.listenProvider_.stopListening(Fg(d),P_(t,d))}}return o}class $N{constructor(e){this.node_=e}getImmediateChild(e){const n=this.node_.getImmediateChild(e);return new $N(n)}node(){return this.node_}}class UN{constructor(e,n){this.syncTree_=e,this.path_=n}getImmediateChild(e){const n=Qr(this.path_,e);return new UN(this.syncTree_,n)}node(){return MN(this.syncTree_,this.path_)}}const y_e=function(t){return t=t||{},t.timestamp=t.timestamp||new Date().getTime(),t},X2=function(t,e,n){if(!t||typeof t!="object")return t;if(qe(".sv"in t,"Unexpected leaf node or priority contents"),typeof t[".sv"]=="string")return v_e(t[".sv"],e,n);if(typeof t[".sv"]=="object")return b_e(t[".sv"],e);qe(!1,"Unexpected server value: "+JSON.stringify(t,null,2))},v_e=function(t,e,n){if(t==="timestamp")return n.timestamp;qe(!1,"Unexpected server value: "+t)},b_e=function(t,e,n){t.hasOwnProperty("increment")||qe(!1,"Unexpected server value: "+JSON.stringify(t,null,2));const r=t.increment;typeof r!="number"&&qe(!1,"Unexpected increment value: "+r);const s=e.node();if(qe(s!==null&&typeof s<"u","Expected ChildrenNode.EMPTY_NODE for nulls"),!s.isLeafNode())return r;const o=s.getValue();return typeof o!="number"?r:o+r},w_e=function(t,e,n,r){return HN(e,new UN(n,t),r)},j5=function(t,e,n){return HN(t,new $N(e),n)};function HN(t,e,n){const r=t.getPriority().val(),s=X2(r,e.getImmediateChild(".priority"),n);let i;if(t.isLeafNode()){const o=t,a=X2(o.getValue(),e,n);return a!==o.getValue()||s!==o.getPriority().val()?new ss(a,us(s)):t}else{const o=t;return i=o,s!==o.getPriority().val()&&(i=i.updatePriority(new ss(s))),o.forEachChild(lr,(a,c)=>{const l=HN(c,e.getImmediateChild(a),n);l!==c&&(i=i.updateImmediateChild(a,l))}),i}}class qN{constructor(e="",n=null,r={children:{},childCount:0}){this.name=e,this.parent=n,this.node=r}}function jN(t,e){let n=e instanceof Hn?e:new Hn(e),r=t,s=$t(n);for(;s!==null;){const i=Uf(r.node.children,s)||{children:{},childCount:0};r=new qN(s,r,i),n=Gn(n),s=$t(n)}return r}function Bp(t){return t.node.value}function W5(t,e){t.node.value=e,bR(t)}function G5(t){return t.node.childCount>0}function S_e(t){return Bp(t)===void 0&&!G5(t)}function yE(t,e){Ti(t.node.children,(n,r)=>{e(new qN(n,t,r))})}function K5(t,e,n,r){n&&e(t),yE(t,s=>{K5(s,e,!0)})}function T_e(t,e,n){let r=t.parent;for(;r!==null;){if(e(r))return!0;r=r.parent}return!1}function Cy(t){return new Hn(t.parent===null?t.name:Cy(t.parent)+"/"+t.name)}function bR(t){t.parent!==null&&E_e(t.parent,t.name,t)}
105function E_e(t,e,n){const r=S_e(n),s=Ha(t.node.children,e);r&&s?(delete t.node.children[e],t.node.childCount--,bR(t)):!r&&!s&&(t.node.children[e]=n.node,t.node.childCount++,bR(t))}const I_e=/[\[\].#$\/\u0000-\u001F\u007F]/,C_e=/[\[\].#$\u0000-\u001F\u007F]/,eC=10*1024*1024,z5=function(t){return typeof t=="string"&&t.length!==0&&!I_e.test(t)},Y5=function(t){return typeof t=="string"&&t.length!==0&&!C_e.test(t)},A_e=function(t){return t&&(t=t.replace(/^\/*\.info(\/|$)/,"/")),Y5(t)},Z2=function(t){return t===null||typeof t=="string"||typeof t=="number"&&!bN(t)||t&&typeof t=="object"&&Ha(t,".sv")},WN=function(t,e,n,r){r&&e===void 0||GN(vk(t,"value"),e,n)},GN=function(t,e,n){const r=n instanceof Hn?new Gme(n,t):n;if(e===void 0)throw new Error(t+"contains undefined "+ad(r));if(typeof e=="function")throw new Error(t+"contains a function "+ad(r)+" with contents = "+e.toString());if(bN(e))throw new Error(t+"contains "+e.toString()+" "+ad(r));if(typeof e=="string"&&e.length>eC/3&&HT(e)>eC)throw new Error(t+"contains a string greater than "+eC+" utf8 bytes "+ad(r)+" ('"+e.substring(0,50)+"...')");if(e&&typeof e=="object"){let s=!1,i=!1;if(Ti(e,(o,a)=>{if(o===".value")s=!0;else if(o!==".priority"&&o!==".sv"&&(i=!0,!z5(o)))throw new Error(t+" contains an invalid key ("+o+") "+ad(r)+`. Keys must be non-empty strings and can't contain ".", "#", "$", "/", "[", or "]"`);Kme(r,o),GN(t,a,r),zme(r)}),s&&i)throw new Error(t+' contains ".value" child '+ad(r)+" in addition to actual children.")}},J5=function(t,e,n,r){if(!Y5(n))throw new Error(vk(t,e)+'was an invalid path = "'+n+`". Paths must be non-empty strings and can't contain ".", "#", "$", "[", or "]"`)},R_e=function(t,e,n,r){n&&(n=n.replace(/^\/*\.info(\/|$)/,"/")),J5(t,e,n)},KN=function(t,e){if($t(e)===".info")throw new Error(t+" failed = Can't modify data under /.info/")},P_e=function(t,e){const n=e.path.toString();if(typeof e.repoInfo.host!="string"||e.repoInfo.host.length===0||!z5(e.repoInfo.namespace)&&e.repoInfo.host.split(":")[0]!=="localhost"||n.length!==0&&!A_e(n))throw new Error(vk(t,"url")+`must be a valid firebase URL and the path can't contain ".", "#", "$", "[", or "]".`)};class k_e{constructor(){this.eventLists_=[],this.recursionDepth_=0}}function zN(t,e){let n=null;for(let r=0;r<e.length;r++){const s=e[r],i=s.getPath();n!==null&&!IN(i,n.path)&&(t.eventLists_.push(n),n=null),n===null&&(n={events:[],path:i}),n.events.push(s)}n&&t.eventLists_.push(n)}function Q5(t,e,n){zN(t,n),X5(t,r=>IN(r,e))}function Oa(t,e,n){zN(t,n),X5(t,r=>Vo(r,e)||Vo(e,r))}function X5(t,e){t.recursionDepth_++;let n=!0;for(let r=0;r<t.eventLists_.length;r++){const s=t.eventLists_[r];if(s){const i=s.path;e(i)?(N_e(t.eventLists_[r]),t.eventLists_[r]=null):n=!1}}n&&(t.eventLists_=[]),t.recursionDepth_--}function N_e(t){for(let e=0;e<t.events.length;e++){const n=t.events[e];if(n!==null){t.events[e]=null;const r=n.getEventRunner();xg&&As("event: "+n.toString()),Fp(r)}}}const Z5="repo_interrupt",D_e=25;class O_e{constructor(e,n,r,s){this.repoInfo_=e,this.forceRestClient_=n,this.authTokenProvider_=r,this.appCheckProvider_=s,this.dataUpdateCount=0,this.statsListener_=null,this.eventQueue_=new k_e,this.nextWriteId_=1,this.interceptServerDataCallback_=null,this.onDisconnect_=ES(),this.transactionQueueTree_=new qN,this.persistentConnection_=null,this.key=this.repoInfo_.toURLString()}toString(){return(this.repoInfo_.secure?"https://":"http://")+this.repoInfo_.host}}function x_e(t,e,n){if(t.stats_=TN(t.repoInfo_),t.forceRestClient_||_me())t.server_=new TS(t.repoInfo_,(r,s,i,o)=>{eV(t,r,s,i,o)},t.authTokenProvider_,t.appCheckProvider_),setTimeout(()=>tV(t,!0),0);else{if(typeof n<"u"&&n!==null){if(typeof n!="object")throw new Error("Only objects are supported for option databaseAuthVariableOverride");try{Jr(n)}catch(r){throw new Error("Invalid authOverride provided: "+r)}}t.persistentConnection_=new Oc(t.repoInfo_,e,(r,s,i,o)=>{eV(t,r,s,i,o)},r=>{tV(t,r)},r=>{L_e(t,r)},t.authTokenProvider_,t.appCheckProvider_,n),t.server_=t.persistentConnection_}t.authTokenProvider_.addTokenChangeListener(r=>{t.server_.refreshAuthToken(r)}),t.appCheckProvider_.addTokenChangeListener(r=>{t.server_.refreshAppCheckToken(r.token)}),t.statsReporter_=Sme(t.repoInfo_,()=>new bge(t.stats_,t.server_)),t.infoData_=new mge,t.infoSyncTree_=new Q2({startListening:(r,s,i,o)=>{let a=[];const c=t.infoData_.getNode(r._path);return c.isEmpty()||(a=Ey(t.infoSyncTree_,r._path,c),setTimeout(()=>{o("ok")},0)),a},stopListening:()=>{}}),JN(t,"connected",!1),t.serverSyncTree_=new Q2({startListening:(r,s,i,o)=>(t.server_.listen(r,i,s,(a,c)=>{const l=o(a,c);Oa(t.eventQueue_,r._path,l)}),[]),stopListening:(r,s)=>{t.server_.unlisten(r,s)}})}function e6(t){const n=t.infoData_.getNode(new Hn(".info/serverTimeOffset")).val()||0;return new Date().getTime()+n}function YN(t){return y_e({timestamp:e6(t)})}function eV(t,e,n,r,s){t.dataUpdateCount++;const i=new Hn(e);n=t.interceptServerDataCallback_?t.interceptServerDataCallback_(e,n):n;let o=[];if(s)if(r){const c=Xw(n,l=>us(l));o=h_e(t.serverSyncTree_,i,c,s)}else{const c=us(n);o=$5(t.serverSyncTree_,i,c,s)}else if(r){const c=Xw(n,l=>us(l));o=l_e(t.serverSyncTree_,i,c)}else{const c=us(n);o=Ey(t.serverSyncTree_,i,c)}let a=i;o.length>0&&(a=bE(t,i)),Oa(t.eventQueue_,a,o)}function tV(t,e){JN(t,"connected",e),e===!1&&F_e(t)}function L_e(t,e){Ti(e,(n,r)=>{JN(t,n,r)})}function JN(t,e,n){const r=new Hn("/.info/"+e),s=us(n);t.infoData_.updateSnapshot(r,s);const i=Ey(t.infoSyncTree_,r,s);Oa(t.eventQueue_,r,i)}function t6(t){return t.nextWriteId_++}function M_e(t,e,n){const r=f_e(t.serverSyncTree_,e);return r!=null?Promise.resolve(r):t.server_.get(e).then(s=>{const i=us(s).withIndex(e._queryParams.getIndex());vR(t.serverSyncTree_,e,n,!0);let o;if(e._queryParams.loadsAllData())o=Ey(t.serverSyncTree_,e._path,i);else{const a=P_(t.serverSyncTree_,e);o=$5(t.serverSyncTree_,e._path,i,a)}return Oa(t.eventQueue_,e._path,o),DS(t.serverSyncTree_,e,n,null,!0),i},s=>(vE(t,"get for query "+Jr(e)+" failed: "+s),Promise.reject(new Error(s))))}function V_e(t,e,n,r,s){vE(t,"set",{path:e.toString(),value:n,priority:r});const i=YN(t),o=us(n,r),a=MN(t.serverSyncTree_,e),c=j5(o,a,i),l=t6(t),d=B5(t.serverSyncTree_,e,c,l,!0);zN(t.eventQueue_,d),t.server_.put(e.toString(),o.val(!0),(p,g)=>{const _=p==="ok";_||yi("set at "+e+" failed: "+p);const v=bd(t.serverSyncTree_,l,!_);Oa(t.eventQueue_,e,v),U_e(t,s,p,g)});const h=a6(t,e);bE(t,h),Oa(t.eventQueue_,h,[])}function F_e(t){vE(t,"onDisconnectEvents");const e=YN(t),n=ES();pR(t.onDisconnect_,cn(),(s,i)=>{const o=w_e(s,i,t.serverSyncTree_,e);T5(n,s,o)});let r=[];pR(n,cn(),(s,i)=>{r=r.concat(Ey(t.serverSyncTree_,s,i));const o=a6(t,s);bE(t,o)}),t.onDisconnect_=ES(),Oa(t.eventQueue_,cn(),r)}function B_e(t,e,n){let r;$t(e._path)===".info"?r=vR(t.infoSyncTree_,e,n):r=vR(t.serverSyncTree_,e,n),Q5(t.eventQueue_,e._path,r)}function nV(t,e,n){let r;$t(e._path)===".info"?r=DS(t.infoSyncTree_,e,n):r=DS(t.serverSyncTree_,e,n),Q5(t.eventQueue_,e._path,r)}function n6(t){t.persistentConnection_&&t.persistentConnection_.interrupt(Z5)}function $_e(t){t.persistentConnection_&&t.persistentConnection_.resume(Z5)}function vE(t,...e){let n="";t.persistentConnection_&&(n=t.persistentConnection_.id+":"),As(n,...e)}function U_e(t,e,n,r){e&&Fp(()=>
105{if(n==="ok")e(null);else{const s=(n||"error").toUpperCase();let i=s;r&&(i+=": "+r);const o=new Error(i);o.code=s,e(o)}})}function r6(t,e,n){return MN(t.serverSyncTree_,e,n)||St.EMPTY_NODE}function QN(t,e=t.transactionQueueTree_){if(e||wE(t,e),Bp(e)){const n=i6(t,e);qe(n.length>0,"Sending zero length transaction queue"),n.every(s=>s.status===0)&&H_e(t,Cy(e),n)}else G5(e)&&yE(e,n=>{QN(t,n)})}function H_e(t,e,n){const r=n.map(l=>l.currentWriteId),s=r6(t,e,r);let i=s;const o=s.hash();for(let l=0;l<n.length;l++){const d=n[l];qe(d.status===0,"tryToSendTransactionQueue_: items in queue should all be run."),d.status=1,d.retryCount++;const h=Gs(e,d.path);i=i.updateChild(h,d.currentOutputSnapshotRaw)}const a=i.val(!0),c=e;t.server_.put(c.toString(),a,l=>{vE(t,"transaction put response",{path:c.toString(),status:l});let d=[];if(l==="ok"){const h=[];for(let p=0;p<n.length;p++)n[p].status=2,d=d.concat(bd(t.serverSyncTree_,n[p].currentWriteId)),n[p].onComplete&&h.push(()=>n[p].onComplete(null,!0,n[p].currentOutputSnapshotResolved)),n[p].unwatcher();wE(t,jN(t.transactionQueueTree_,e)),QN(t,t.transactionQueueTree_),Oa(t.eventQueue_,e,d);for(let p=0;p<h.length;p++)Fp(h[p])}else{if(l==="datastale")for(let h=0;h<n.length;h++)n[h].status===3?n[h].status=4:n[h].status=0;else{yi("transaction at "+c.toString()+" failed: "+l);for(let h=0;h<n.length;h++)n[h].status=4,n[h].abortReason=l}bE(t,e)}},o)}function bE(t,e){const n=s6(t,e),r=Cy(n),s=i6(t,n);return q_e(t,s,r),r}function q_e(t,e,n){if(e.length===0)return;const r=[];let s=[];const o=e.filter(a=>a.status===0).map(a=>a.currentWriteId);for(let a=0;a<e.length;a++){const c=e[a],l=Gs(n,c.path);let d=!1,h;if(qe(l!==null,"rerunTransactionsUnderNode_: relativePath should not be null."),c.status===4)d=!0,h=c.abortReason,s=s.concat(bd(t.serverSyncTree_,c.currentWriteId,!0));else if(c.status===0)if(c.retryCount>=D_e)d=!0,h="maxretry",s=s.concat(bd(t.serverSyncTree_,c.currentWriteId,!0));else{const p=r6(t,c.path,o);c.currentInputSnapshot=p;const g=e[a].update(p.val());if(g!==void 0){GN("transaction failed: Data returned ",g,c.path);let _=us(g);typeof g=="object"&&g!=null&&Ha(g,".priority")||(_=_.updatePriority(p.getPriority()));const b=c.currentWriteId,w=YN(t),E=j5(_,p,w);c.currentOutputSnapshotRaw=_,c.currentOutputSnapshotResolved=E,c.currentWriteId=t6(t),o.splice(o.indexOf(b),1),s=s.concat(B5(t.serverSyncTree_,c.path,E,c.currentWriteId,c.applyLocally)),s=s.concat(bd(t.serverSyncTree_,b,!0))}else d=!0,h="nodata",s=s.concat(bd(t.serverSyncTree_,c.currentWriteId,!0))}Oa(t.eventQueue_,n,s),s=[],d&&(e[a].status=2,(function(p){setTimeout(p,Math.floor(0))})(e[a].unwatcher),e[a].onComplete&&(h==="nodata"?r.push(()=>e[a].onComplete(null,!1,e[a].currentInputSnapshot)):r.push(()=>e[a].onComplete(new Error(h),!1,null))))}wE(t,t.transactionQueueTree_);for(let a=0;a<r.length;a++)Fp(r[a]);QN(t,t.transactionQueueTree_)}function s6(t,e){let n,r=t.transactionQueueTree_;for(n=$t(e);n!==null&&Bp(r)===void 0;)r=jN(r,n),e=Gn(e),n=$t(e);return r}function i6(t,e){const n=[];return o6(t,e,n),n.sort((r,s)=>r.order-s.order),n}function o6(t,e,n){const r=Bp(e);if(r)for(let s=0;s<r.length;s++)n.push(r[s]);yE(e,s=>{o6(t,s,n)})}function wE(t,e){const n=Bp(e);if(n){let r=0;for(let s=0;s<n.length;s++)n[s].status!==2&&(n[r]=n[s],r++);n.length=r,W5(e,n.length>0?n:void 0)}yE(e,r=>{wE(t,r)})}function a6(t,e){const n=Cy(s6(t,e)),r=jN(t.transactionQueueTree_,e);return T_e(r,s=>{tC(t,s)}),tC(t,r),K5(r,s=>{tC(t,s)}),n}function tC(t,e){const n=Bp(e);if(n){const r=[];let s=[],i=-1;for(let o=0;o<n.length;o++)n[o].status===3||(n[o].status===1?(qe(i===o-1,"All SENT items should be at beginning of queue."),i=o,n[o].status=3,n[o].abortReason="set"):(qe(n[o].status===0,"Unexpected transaction status in abort"),n[o].unwatcher(),s=s.concat(bd(t.serverSyncTree_,n[o].currentWriteId,!0)),n[o].onComplete&&r.push(n[o].onComplete.bind(null,new Error("set"),!1,null))));i===-1?W5(e,void 0):n.length=i+1,Oa(t.eventQueue_,Cy(e),s);for(let o=0;o<r.length;o++)Fp(r[o])}}function j_e(t){let e="";const n=t.split("/");for(let r=0;r<n.length;r++)if(n[r].length>0){let s=n[r];
105try{s=decodeURIComponent(s.replace(/\+/g," "))}catch{}e+="/"+s}return e}function W_e(t){const e={};t.charAt(0)==="?"&&(t=t.substring(1));for(const n of t.split("&")){if(n.length===0)continue;const r=n.split("=");r.length===2?e[decodeURIComponent(r[0])]=decodeURIComponent(r[1]):yi(`Invalid query segment '${n}' in query '${t}'`)}return e}const rV=function(t,e){const n=G_e(t),r=n.namespace;n.domain==="firebase.com"&&Jc(n.host+" is no longer supported. Please use <YOUR FIREBASE>.firebaseio.com instead"),(!r||r==="undefined")&&n.domain!=="localhost"&&Jc("Cannot parse Firebase url. Please use https://<YOUR FIREBASE>.firebaseio.com"),n.secure||cme();const s=n.scheme==="ws"||n.scheme==="wss";return{repoInfo:new n5(n.host,n.secure,r,s,e,"",r!==n.subdomain),path:new Hn(n.pathString)}},G_e=function(t){let e="",n="",r="",s="",i="",o=!0,a="https",c=443;if(typeof t=="string"){let l=t.indexOf("//");l>=0&&(a=t.substring(0,l-1),t=t.substring(l+2));let d=t.indexOf("/");d===-1&&(d=t.length);let h=t.indexOf("?");h===-1&&(h=t.length),e=t.substring(0,Math.min(d,h)),d<h&&(s=j_e(t.substring(d,h)));const p=W_e(t.substring(Math.min(t.length,h)));l=e.indexOf(":"),l>=0?(o=a==="https"||a==="wss",c=parseInt(e.substring(l+1),10)):l=e.length;const g=e.slice(0,l);if(g.toLowerCase()==="localhost")n="localhost";else if(g.split(".").length<=2)n=g;else{const _=e.indexOf(".");r=e.substring(0,_).toLowerCase(),n=e.substring(_+1),i=r}"ns"in p&&(i=p.ns)}return{host:e,port:c,domain:n,subdomain:r,secure:o,scheme:a,pathString:s,namespace:i}};const sV="-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz",K_e=(function(){let t=0;const e=[];return function(n){const r=n===t;t=n;let s;const i=new Array(8);for(s=7;s>=0;s--)i[s]=sV.charAt(n%64),n=Math.floor(n/64);qe(n===0,"Cannot push at time == 0");let o=i.join("");if(r){for(s=11;s>=0&&e[s]===63;s--)e[s]=0;e[s]++}else for(s=0;s<12;s++)e[s]=Math.floor(Math.random()*64);for(s=0;s<12;s++)o+=sV.charAt(e[s]);return qe(o.length===20,"nextPushId: Length should be 20."),o}})();class c6{constructor(e,n,r,s){this.eventType=e,this.eventRegistration=n,this.snapshot=r,this.prevName=s}getPath(){const e=this.snapshot.ref;return this.eventType==="value"?e._path:e.parent._path}getEventType(){return this.eventType}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.getPath().toString()+":"+this.eventType+":"+Jr(this.snapshot.exportVal())}}class l6{constructor(e,n,r){this.eventRegistration=e,this.error=n,this.path=r}getPath(){return this.path}getEventType(){return"cancel"}getEventRunner(){return this.eventRegistration.getEventRunner(this)}toString(){return this.path.toString()+":cancel"}}class u6{constructor(e,n){this.snapshotCallback=e,this.cancelCallback=n}onValue(e,n){this.snapshotCallback.call(null,e,n)}onCancel(e){return qe(this.hasCancelCallback,"Raising a cancel event on a listener with no cancel callback"),this.cancelCallback.call(null,e)}get hasCancelCallback(){return!!this.cancelCallback}matches(e){return this.snapshotCallback===e.snapshotCallback||this.snapshotCallback.userCallback!==void 0&&this.snapshotCallback.userCallback===e.snapshotCallback.userCallback&&this.snapshotCallback.context===e.snapshotCallback.context}}class Ay{constructor(e,n,r,s){this._repo=e,this._path=n,this._queryParams=r,this._orderByCalled=s}get key(){return Kt(this._path)?null:d5(this._path)}get ref(){return new qa(this._repo,this._path)}get _queryIdentifier(){const e=$2(this._queryParams),n=wN(e);return n==="{}"?"default":n}get _queryObject(){return $2(this._queryParams)}isEqual(e){if(e=wn(e),!(e instanceof Ay))return!1;const n=this._repo===e._repo,r=IN(this._path,e._path),s=this._queryIdentifier===e._queryIdentifier;return n&&r&&s}toJSON(){return this.toString()}toString(){return this._repo.toString()+Wme(this._path)}}function z_e(t,e){if(t._orderByCalled===!0)throw new Error(e+": You can't combine multiple orderBy calls.")}function d6(t){let e=null,n=null;if(t.hasStart()&&(e=t.getIndexStartValue()),t.hasEnd()&&(n=t.getIndexEndValue()),t.getIndex()===Zl){const r="Query: When ordering by key, you may only pass one argument to startAt(), endAt(), or equalTo().",s="Query: When ordering by key, the argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() must be a string.";if(t.hasStart()){if(t.getIndexStartName()!==Zd)throw new Error(r);if(typeof e!="string")throw new Error(s)}if(t.hasEnd()){if(t.getIndexEndName()!==gu)throw new Error(r);
105if(typeof n!="string")throw new Error(s)}}else if(t.getIndex()===lr){if(e!=null&&!Z2(e)||n!=null&&!Z2(n))throw new Error("Query: When ordering by priority, the first argument passed to startAt(), startAfter() endAt(), endBefore(), or equalTo() must be a valid priority value (null, a number, or a string).")}else if(qe(t.getIndex()instanceof b5||t.getIndex()===w5,"unknown index type."),e!=null&&typeof e=="object"||n!=null&&typeof n=="object")throw new Error("Query: First argument passed to startAt(), startAfter(), endAt(), endBefore(), or equalTo() cannot be an object.")}function Y_e(t){if(t.hasStart()&&t.hasEnd()&&t.hasLimit()&&!t.hasAnchoredLimit())throw new Error("Query: Can't combine startAt(), startAfter(), endAt(), endBefore(), and limit(). Use limitToFirst() or limitToLast() instead.")}class qa extends Ay{constructor(e,n){super(e,n,new PN,!1)}get parent(){const e=f5(this._path);return e===null?null:new qa(this._repo,e)}get root(){let e=this;for(;e.parent!==null;)e=e.parent;return e}}class lp{constructor(e,n,r){this._node=e,this.ref=n,this._index=r}get priority(){return this._node.getPriority().val()}get key(){return this.ref.key}get size(){return this._node.numChildren()}child(e){const n=new Hn(e),r=zt(this.ref,e);return new lp(this._node.getChild(n),r,lr)}exists(){return!this._node.isEmpty()}exportVal(){return this._node.val(!0)}forEach(e){return this._node.isLeafNode()?!1:!!this._node.forEachChild(this._index,(r,s)=>e(new lp(s,zt(this.ref,r),lr)))}hasChild(e){const n=new Hn(e);return!this._node.getChild(n).isEmpty()}hasChildren(){return this._node.isLeafNode()?!1:!this._node.isEmpty()}toJSON(){return this.exportVal()}val(){return this._node.val()}}function Zt(t,e){return t=wn(t),t._checkNotDeleted("ref"),e!==void 0?zt(t._root,e):t._root}function zt(t,e){return t=wn(t),$t(t._path)===null?R_e("child","path",e):J5("child","path",e),new qa(t._repo,Qr(t._path,e))}function J_e(t,e){t=wn(t),KN("push",t._path),WN("push",e,t._path,!0);const n=e6(t._repo),r=K_e(n),s=zt(t,r),i=zt(t,r);let o;return e!=null?o=Ue(i,e).then(()=>i):o=Promise.resolve(i),s.then=o.then.bind(o),s.catch=o.then.bind(o,void 0),s}function Q_e(t){return KN("remove",t._path),Ue(t,null)}function Ue(t,e){t=wn(t),KN("set",t._path),WN("set",e,t._path,!1);const n=new $T;return V_e(t._repo,t._path,e,null,n.wrapCallback(()=>{})),n.promise}function X_e(t){t=wn(t);const e=new u6(()=>{}),n=new SE(e);return M_e(t._repo,t,n).then(r=>new lp(r,new qa(t._repo,t._path),t._queryParams.getIndex()))}class SE{constructor(e){this.callbackContext=e}respondsTo(e){return e==="value"}createEvent(e,n){const r=n._queryParams.getIndex();return new c6("value",this,new lp(e.snapshotNode,new qa(n._repo,n._path),r))}getEventRunner(e){return e.getEventType()==="cancel"?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,null)}createCancelEvent(e,n){return this.callbackContext.hasCancelCallback?new l6(this,e,n):null}matches(e){return e instanceof SE?!e.callbackContext||!this.callbackContext?!0:e.callbackContext.matches(this.callbackContext):!1}hasAnyCallback(){return this.callbackContext!==null}}class XN{constructor(e,n){this.eventType=e,this.callbackContext=n}respondsTo(e){let n=e==="children_added"?"child_added":e;return n=n==="children_removed"?"child_removed":n,this.eventType===n}createCancelEvent(e,n){return this.callbackContext.hasCancelCallback?new l6(this,e,n):null}createEvent(e,n){qe(e.childName!=null,"Child events should have a childName.");const r=zt(new qa(n._repo,n._path),e.childName),s=n._queryParams.getIndex();return new c6(e.type,this,new lp(e.snapshotNode,r,s),e.prevName)}getEventRunner(e){return e.getEventType()==="cancel"?()=>this.callbackContext.onCancel(e.error):()=>this.callbackContext.onValue(e.snapshot,e.prevName)}matches(e){return e instanceof XN?this.eventType===e.eventType&&(!this.callbackContext||!e.callbackContext||this.callbackContext.matches(e.callbackContext)):!1}hasAnyCallback(){return!!this.callbackContext}}function TE(t,e,n,r,s){let i;if(typeof r=="object"&&(i=void 0,s=r),typeof r=="function"&&(i=r),s&&s.onlyOnce){const c=n,l=(d,h)=>{nV(t._repo,t,a),c(d,h)};l.userCallback=n.userCallback,l.context=n.context,n=l}const o=new u6(n,i||void 0),a=e==="value"?new SE(o):new XN(e,o);return B_e(t._repo,t,a),()=>nV(t._repo,t,a)}function xa(t,e,n,r){return TE(t,"value",e,n,r)}function Js(t,e,n,r){return TE(t,"child_added",e,n,r)}function h6(t,e,n,r){return TE(t,"child_changed",e,n,r)}function f6(t,e,n,r){return TE(t,"child_removed",e,n,r)}class p6{}class Z_e extends p6{constructor(e,n){super(),this._value=e,this._key=n,this.type="startAt"}_apply(e){WN("startAt",this._value,e._path,!0);const n=fge(e._queryParams,this._value,this._key);if(Y_e(n),d6(n),e._queryParams.hasStart())throw new Error("startAt: Starting point was already set
105(by another call to startAt, startBefore or equalTo).");return new Ay(e._repo,e._path,n,e._orderByCalled)}}function eye(t=null,e){return new Z_e(t,e)}class tye extends p6{constructor(){super(...arguments),this.type="orderByKey"}_apply(e){z_e(e,"orderByKey");const n=pge(e._queryParams,Zl);return d6(n),new Ay(e._repo,e._path,n,!0)}}function nye(){return new tye}function rye(t,...e){let n=wn(t);for(const r of e)n=r._apply(n);return n}t_e(qa);o_e(qa);const sye="FIREBASE_DATABASE_EMULATOR_HOST",wR={};let iye=!1;function oye(t,e,n,r){const s=e.lastIndexOf(":"),i=e.substring(0,s),o=$a(i);t.repoInfo_=new n5(e,o,t.repoInfo_.namespace,t.repoInfo_.webSocketOnly,t.repoInfo_.nodeAdmin,t.repoInfo_.persistenceKey,t.repoInfo_.includeNamespaceInQueryParams,!0,n),r&&(t.authTokenProvider_=r)}function aye(t,e,n,r,s){let i=r||t.options.databaseURL;i===void 0&&(t.options.projectId||Jc("Can't determine Firebase Database URL. Be sure to include a Project ID when calling firebase.initializeApp()."),As("Using default host for project ",t.options.projectId),i=`${t.options.projectId}-default-rtdb.firebaseio.com`);let o=rV(i,s),a=o.repoInfo,c;typeof process<"u"&&S2&&(c=S2[sye]),c?(i=`http://${c}?ns=${a.namespace}`,o=rV(i,s),a=o.repoInfo):o.repoInfo.secure;const l=new vme(t.name,t.options,e);P_e("Invalid Firebase Database URL",o),Kt(o.path)||Jc("Database URL must point to the root of a Firebase Database (not including a child path).");const d=lye(a,t,l,new yme(t,n));return new uye(d,t)}function cye(t,e){const n=wR[e];(!n||n[t.key]!==t)&&Jc(`Database ${e}(${t.repoInfo_}) has already been deleted.`),n6(t),delete n[t.key]}function lye(t,e,n,r){let s=wR[e.name];s||(s={},wR[e.name]=s);let i=s[t.toURLString()];return i&&Jc("Database initialized multiple times. Please make sure the format of the database URL matches with each database() call."),i=new O_e(t,iye,n,r),s[t.toURLString()]=i,i}class uye{constructor(e,n){this._repoInternal=e,this.app=n,this.type="database",this._instanceStarted=!1}get _repo(){return this._instanceStarted||(x_e(this._repoInternal,this.app.options.appId,this.app.options.databaseAuthVariableOverride),this._instanceStarted=!0),this._repoInternal}get _root(){return this._rootInternal||(this._rootInternal=new qa(this._repo,cn())),this._rootInternal}_delete(){return this._rootInternal!==null&&(cye(this._repo,this.app.name),this._repoInternal=null,this._rootInternal=null),Promise.resolve()}_checkNotDeleted(e){this._rootInternal===null&&Jc("Cannot call "+e+" on a deleted database.")}}function dye(t=jT(),e){const n=Np(t,"database").getImmediate({identifier:e});if(!n._instanceStarted){const r=gk("database");r&&hye(n,...r)}return n}function hye(t,e,n,r={}){t=wn(t),t._checkNotDeleted("useEmulator");const s=`${e}:${n}`,i=t._repoInternal;if(t._instanceStarted){if(s===t._repoInternal.repoInfo_.host&&Wc(r,i.repoInfo_.emulatorOptions))return;Jc("connectDatabaseEmulator() cannot initialize or alter the emulator configuration after the database instance has started.")}let o;if(i.repoInfo_.nodeAdmin)r.mockUserToken&&Jc('mockUserToken is not supported by the Admin SDK. For client access with mock users, please use the "firebase" package instead of "firebase-admin".'),o=new sw(sw.OWNER);else if(r.mockUserToken){const a=typeof r.mockUserToken=="string"?r.mockUserToken:_k(r.mockUserToken,t.app.options.projectId);o=new sw(a)}$a(e)&&(sy(e),UT("Database",!0)),oye(i,s,r,o)}function fye(t){t=wn(t),t._checkNotDeleted("goOffline"),n6(t._repo)}function pye(t){t=wn(t),t._checkNotDeleted("goOnline"),$_e(t._repo)}function mye(t){nme(Tu),uu(new Gc("database",(e,{instanceIdentifier:n})=>{const r=e.getProvider("app").getImmediate(),s=e.getProvider("auth-internal"),i=e.getProvider("app-check-internal");return aye(r,s,i,n)},"PUBLIC").setMultipleInstances(!0)),po(T2,E2,t),po(T2,E2,"esm2020")}Oc.prototype.simpleListen=function(t,e){this.sendRequest("q",{p:t},e)};Oc.prototype.echo=function(t,e){this.sendRequest("echo",{d:t},e)};mye();const m6="firebasestorage.googleapis.com",gye="storageBucket",_ye=120*1e3,yye=600*1e3;class ja extends Ua{constructor(e,n,r=0){super(nC(e),`Firebase Storage: ${n} (${nC(e)})`),this.status_=r,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,ja.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return nC(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage} 106${this.customData.serverResponse}`:this.message=this._baseMessage}}var La;(function(t){t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVA
106LID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVALID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(La||(La={}));function nC(t){return"storage/"+t}function vye(){const t="An unknown error occurred, please check the error payload for server response.";return new ja(La.UNKNOWN,t)}function bye(){return new ja(La.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function wye(){return new ja(La.CANCELED,"User canceled the upload/download.")}function Sye(t){return new ja(La.INVALID_URL,"Invalid URL '"+t+"'.")}function Tye(t){return new ja(La.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function iV(t){return new ja(La.INVALID_ARGUMENT,t)}function g6(){return new ja(La.APP_DELETED,"The Firebase app was deleted.")}function Eye(t){return new ja(La.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}class Bo{constructor(e,n){this.bucket=e,this.path_=n}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,n){let r;try{r=Bo.makeFromUrl(e,n)}catch{return new Bo(e,"")}if(r.path==="")return r;throw Tye(e)}static makeFromUrl(e,n){let r=null;const s="([A-Za-z0-9.\\-_]+)";function i(R){R.path.charAt(R.path.length-1)==="/"&&(R.path_=R.path_.slice(0,-1))}const o="(/(.*))?$",a=new RegExp("^gs://"+s+o,"i"),c={bucket:1,path:3};function l(R){R.path_=decodeURIComponent(R.path)}const d="v[A-Za-z0-9_]+",h=n.replace(/[.]/g,"\\."),p="(/([^?#]*).*)?$",g=new RegExp(`^https?://${h}/${d}/b/${s}/o${p}`,"i"),_={bucket:1,path:3},v=n===m6?"(?:storage.googleapis.com|storage.cloud.google.com)":n,b="([^?#]*)",w=new RegExp(`^https?://${v}/${s}/${b}`,"i"),T=[{regex:a,indices:c,postModify:i},{regex:g,indices:_,postModify:l},{regex:w,indices:{bucket:1,path:2},postModify:l}];for(let R=0;R<T.length;R++){const N=T[R],O=N.regex.exec(e);if(O){const S=O[N.indices.bucket];let I=O[N.indices.path];I||(I=""),r=new Bo(S,I),N.postModify(r);break}}if(r==null)throw Sye(e);return r}}class Iye{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}function Cye(t,e,n){let r=1,s=null,i=null,o=!1,a=0;function c(){return a===2}let l=!1;function d(...b){l||(l=!0,e.apply(null,b))}function h(b){s=setTimeout(()=>{s=null,t(g,c())},b)}function p(){i&&clearTimeout(i)}function g(b,...w){if(l){p();return}if(b){p(),d.call(null,b,...w);return}if(c()||o){p(),d.call(null,b,...w);return}r<64&&(r*=2);let T;a===1?(a=2,T=0):T=(r+Math.random())*1e3,h(T)}let _=!1;function v(b){_||(_=!0,p(),!l&&(s!==null?(b||(a=2),clearTimeout(s),h(0)):b||(a=1)))}return h(0),i=setTimeout(()=>{o=!0,v(!0)},n),v}function Aye(t){t(!1)}function Rye(t){return t!==void 0}function oV(t,e,n,r){if(r<e)throw iV(`Invalid value for '${t}'. Expected ${e} or greater.`);if(r>n)throw iV(`Invalid value for '${t}'. Expected ${n} or less.`)}function Pye(t){const e=encodeURIComponent;let n="?";for(const r in t)if(t.hasOwnProperty(r)){const s=e(r)+"="+e(t[r]);n=n+s+"&"}return n=n.slice(0,-1),n}var OS;(function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"})(OS||(OS={}));function kye(t,e){const n=t>=500&&t<600,s=[408,429].indexOf(t)!==-1,i=e.indexOf(t)!==-1;return n||s||i}class Nye{constructor(e,n,r,s,i,o,a,c,l,d,h,p=!0,g=!1){this.url_=e,this.method_=n,this.headers_=r,this.body_=s,this.successCodes_=i,this.additionalRetryCodes_=o,this.callback_=a,this.errorCallback_=c,this.timeout_=l,this.progressCallback_=d,this.connectionFactory_=h,this.retry=p,this.isUsingEmulator=g,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((_,v)=>{this.resolve_=_,this.reject_=v,this.start_()})}start_(){const e=(r,s)=>{if(s){r(!1,new Tb(!1,null,!0));return}const i=this.connectionFactory_();this.pendingConnection_=i;const o=a=>{const c=a.loaded,l=a.lengthComputable?a.total:-1;this.progressCallback_!==null&&this.progressCallback_(c,l)};this.progressCallback_!==null&&i.addUploadProgressListener(o),i.send(this.url_,this.method_,this.isUsingEmulator,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&i.removeUploadProgressListener(o),this.pendingConnection_=null;const a=i.getErrorCode()===OS.NO_ERROR,c=i.getStatus();if(!a||kye(c,this.additionalRetryCodes_)&&this.retry){const d=i.getErrorCode()===OS.ABORT;r(!1,new Tb(!1,null,d));return}const l=this.successCodes_.indexOf(c)!==-1;r(!0,new Tb(l,i))})},n=(r,s)=>{const i=this.resolve_,o=this.reject_,a=s.connection;if(s.wasSuccessCode)try{const c=this.callback_(a,a.getResponse());Rye(c)?i(c):i()}catch(c){o(c)}else if(a!==null){const c=vye();c.serverResponse=a.getErrorText(),this.errorCallback_?o(this.errorCallback_(a,c)):o(c)}else if(s.canceled){const c=this.appDelete_?g6():wye();o(c)}else{const c=bye();o(c)}};this.canceled_?n(!1,new Tb(!1,null,!0)):this.backoffId_=Cye(e,n,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&Aye(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}
106class Tb{constructor(e,n,r){this.wasSuccessCode=e,this.connection=n,this.canceled=!!r}}function Dye(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function Oye(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function xye(t,e){e&&(t["X-Firebase-GMPID"]=e)}function Lye(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}function Mye(t,e,n,r,s,i,o=!0,a=!1){const c=Pye(t.urlParams),l=t.url+c,d=Object.assign({},t.headers);return xye(d,e),Dye(d,n),Oye(d,i),Lye(d,r),new Nye(l,t.method,d,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,s,o,a)}function Vye(t){if(t.length===0)return null;const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function Fye(t){const e=t.lastIndexOf("/",t.length-2);return e===-1?t:t.slice(e+1)}class xS{constructor(e,n){this._service=e,n instanceof Bo?this._location=n:this._location=Bo.makeFromUrl(n,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,n){return new xS(e,n)}get root(){const e=new Bo(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return Fye(this._location.path)}get storage(){return this._service}get parent(){const e=Vye(this._location.path);if(e===null)return null;const n=new Bo(this._location.bucket,e);return new xS(this._service,n)}_throwIfRoot(e){if(this._location.path==="")throw Eye(e)}}function aV(t,e){const n=e?.[gye];return n==null?null:Bo.makeFromBucketSpec(n,t)}function Bye(t,e,n,r={}){t.host=`${e}:${n}`;const s=$a(e);s&&(sy(`https://${t.host}/b`),UT("Storage",!0)),t._isUsingEmulator=!0,t._protocol=s?"https":"http";const{mockUserToken:i}=r;i&&(t._overrideAuthToken=typeof i=="string"?i:_k(i,t.app.options.projectId))}class $ye{constructor(e,n,r,s,i,o=!1){this.app=e,this._authProvider=n,this._appCheckProvider=r,this._url=s,this._firebaseVersion=i,this._isUsingEmulator=o,this._bucket=null,this._host=m6,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=_ye,this._maxUploadRetryTime=yye,this._requests=new Set,s!=null?this._bucket=Bo.makeFromBucketSpec(s,this._host):this._bucket=aV(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=Bo.makeFromBucketSpec(this._url,e):this._bucket=aV(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){oV("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){oV("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const n=await e.getToken();if(n!==null)return n.accessToken}return null}async _getAppCheckToken(){if(ui(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new xS(this,e)}_makeRequest(e,n,r,s,i=!0){if(this._deleted)return new Iye(g6());{const o=Mye(e,this._appId,r,s,n,this._firebaseVersion,i,this._isUsingEmulator);return this._requests.add(o),o.getPromise().then(()=>this._requests.delete(o),()=>this._requests.delete(o)),o}}async makeRequestWithTokens(e,n){const[r,s]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,n,r,s).getPromise()}}const cV="@firebase/storage",lV="0.14.0";const _6="storage";function Uye(t=jT(),e){t=wn(t);const r=Np(t,_6).getImmediate({identifier:e}),s=gk("storage");return s&&Hye(r,...s),r}function Hye(t,e,n,r={}){Bye(t,e,n,r)}function qye(t,{instanceIdentifier:e}){const n=t.getProvider("app").getImmediate(),r=t.getProvider("auth-internal"),s=t.getProvider("app-check-internal");return new $ye(n,r,s,e,Tu)}function jye(){uu(new Gc(_6,qye,"PUBLIC").setMultipleInstances(!0)),po(cV,lV,""),po(cV,lV,"esm2020")}jye();function y6(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const Wye=y6,v6=new iy("auth","Firebase",y6());const LS=new qT("@firebase/auth");function Gye(t,...e){LS.logLevel<=Gt.WARN&&LS.warn(`Auth (${Tu}): ${t}`,...e)}function iw(t,...e){LS.logLevel<=Gt.ERROR&&LS.error(`Auth (${Tu}): ${t}`,...e)}function Ma(t,...e){throw eD(t,...e)}function jo(t,...e){return eD(t,...e)}function ZN(t,e,n){const r={...Wye(),[e]:n};return new iy("auth","Firebase",r).create(e,{appName:t.name})}function nu(t){return ZN(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Kye(t,e,n){const r=n;if(!(e instanceof r))throw r.name!==e.constructor.name&&Ma(t,"argument-error"),ZN(t,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function eD(t,...e){if(typeof t!="string"){const n=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=t.name),t._errorFactory.create(n,...r)}return v6.create(t,...e)}function Tt(t,e,...n){if(!t)throw eD(e,...n)}function Tc(t){const e="INTERNAL ASSERTION FAILED: "+t;throw iw(e),new Error(e)}function Qc(t,e){t||Tc(e)}function SR(){return typeof self<"u"&&self.location?.href||""}function zye(){return uV()==="http:"||uV()==="https:"}function uV(){return typeof self<"u"&&self.location?.protocol||null}function Yye(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(zye()||Gle()||"connection"in navigator)?navigator.onLine:!0}
106function Jye(){if(typeof navigator>"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}class Ry{constructor(e,n){this.shortDelay=e,this.longDelay=n,Qc(n>e,"Short delay should be less than long delay!"),this.isMobile=yk()||aq()}get(){return Yye()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}function tD(t,e){Qc(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`:n}class b6{static initialize(e,n,r){this.fetchImpl=e,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Tc("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Tc("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Tc("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}const Qye={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};const Xye=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],Zye=new Ry(3e4,6e4);function EE(t,e){return t.tenantId&&!e.tenantId?{...e,tenantId:t.tenantId}:e}async function $p(t,e,n,r,s={}){return w6(t,s,async()=>{let i={},o={};r&&(e==="GET"?o=r:i={body:JSON.stringify(r)});const a=kp({key:t.config.apiKey,...o}).slice(1),c=await t._getAdditionalHeaders();c["Content-Type"]="application/json",t.languageCode&&(c["X-Firebase-Locale"]=t.languageCode);const l={method:e,headers:c,...i};return Wle()||(l.referrerPolicy="no-referrer"),t.emulatorConfig&&$a(t.emulatorConfig.host)&&(l.credentials="include"),b6.fetch()(await T6(t,t.config.apiHost,n,a),l)})}async function w6(t,e,n){t._canInitEmulator=!1;const r={...Qye,...e};try{const s=new eve(t),i=await Promise.race([n(),s.promise]);s.clearNetworkTimeout();const o=await i.json();if("needConfirmation"in o)throw Eb(t,"account-exists-with-different-credential",o);if(i.ok&&!("errorMessage"in o))return o;{const a=i.ok?o.errorMessage:o.error.message,[c,l]=a.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw Eb(t,"credential-already-in-use",o);if(c==="EMAIL_EXISTS")throw Eb(t,"email-already-in-use",o);if(c==="USER_DISABLED")throw Eb(t,"user-disabled",o);const d=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(l)throw ZN(t,d,l);Ma(t,d)}}catch(s){if(s instanceof Ua)throw s;Ma(t,"network-request-failed",{message:String(s)})}}async function S6(t,e,n,r,s={}){const i=await $p(t,e,n,r,s);return"mfaPendingCredential"in i&&Ma(t,"multi-factor-auth-required",{_serverResponse:i}),i}async function T6(t,e,n,r){const s=`${e}${n}?${r}`,i=t,o=i.config.emulator?tD(t.config,s):`${t.config.apiScheme}://${s}`;return Xye.includes(n)&&(await i._persistenceManagerAvailable,i._getPersistenceType()==="COOKIE")?
106i._getPersistence()._getFinalTarget(o).toString():o}class eve{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(jo(this.auth,"network-request-failed")),Zye.get())})}}function Eb(t,e,n){const r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=jo(t,e,r);return s.customData._tokenResponse=n,s}async function tve(t,e){return $p(t,"POST","/v1/accounts:delete",e)}async function MS(t,e){return $p(t,"POST","/v1/accounts:lookup",e)}function Bg(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function E6(t,e=!1){const n=wn(t),r=await n.getIdToken(e),s=nD(r);Tt(s&&s.exp&&s.auth_time&&s.iat,n.auth,"internal-error");const i=typeof s.firebase=="object"?s.firebase:void 0,o=i?.sign_in_provider;return{claims:s,token:r,authTime:Bg(rC(s.auth_time)),issuedAtTime:Bg(rC(s.iat)),expirationTime:Bg(rC(s.exp)),signInProvider:o||null,signInSecondFactor:i?.sign_in_second_factor||null}}function rC(t){return Number(t)*1e3}function nD(t){const[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return iw("JWT malformed, contained fewer than 3 sections"),null;try{const s=Qw(n);return s?JSON.parse(s):(iw("Failed to decode base64 JWT payload"),null)}catch(s){return iw("Caught error parsing JWT payload as JSON",s?.toString()),null}}function dV(t){const e=nD(t);return Tt(e,"internal-error"),Tt(typeof e.exp<"u","internal-error"),Tt(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}async function k_(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof Ua&&nve(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function nve({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}class rve{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){if(e){const n=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),n}else{this.errorBackoff=3e4;const r=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,r)}}schedule(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){e?.code==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}class TR{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=Bg(this.lastLoginAt),this.creationTime=Bg(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}async function VS(t){const e=t.auth,n=await t.getIdToken(),r=await k_(t,MS(e,{idToken:n}));Tt(r?.users.length,e,"internal-error");const s=r.users[0];t._notifyReloadListener(s);const i=s.providerUserInfo?.length?I6(s.providerUserInfo):[],o=ive(t.providerData,i),a=t.isAnonymous,c=!(t.email&&s.passwordHash)&&!o?.length,l=a?c:!1,d={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:o,metadata:new TR(s.createdAt,s.lastLoginAt),isAnonymous:l};Object.assign(t,d)}async function sve(t){const e=wn(t);await VS(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function ive(t,e){return[...t.filter(r=>!e.some(s=>s.providerId===r.providerId)),...e]}function I6(t){return t.map(({providerId:e,...n})=>({providerId:e,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}))}async function ove(t,e){const n=await w6(t,{},async()=>{const r=kp({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:s,apiKey:i}=t.config,o=await T6(t,s,"/v1/token",`key=${i}`),a=await t._getAdditionalHeaders();a["Content-Type"]="application/x-www-form-urlencoded";const c={method:"POST",headers:a,body:r};return t.emulatorConfig&&$a(t.emulatorConfig.host)&&(c.credentials="include"),b6.fetch()(o,c)});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function ave(t,e){return $p(t,"POST","/v2/accounts:revokeToken",EE(t,e))}class Ef{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){Tt(e.idToken,"internal-error"),Tt(typeof e.idToken<"u","internal-error"),Tt(typeof e.refreshToken<"u","internal-error");
106const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):dV(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){Tt(e.length!==0,"internal-error");const n=dV(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(Tt(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:r,refreshToken:s,expiresIn:i}=await ove(e,n);this.updateTokensAndExpiration(r,s,Number(i))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){const{refreshToken:r,accessToken:s,expirationTime:i}=n,o=new Ef;return r&&(Tt(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),s&&(Tt(typeof s=="string","internal-error",{appName:e}),o.accessToken=s),i&&(Tt(typeof i=="number","internal-error",{appName:e}),o.expirationTime=i),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Ef,this.toJSON())}_performRefresh(){return Tc("not implemented")}}function Al(t,e){Tt(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class $o{constructor({uid:e,auth:n,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new rve(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=n,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new TR(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const n=await k_(this,this.stsTokenManager.getToken(this.auth,e));return Tt(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return E6(this,e)}reload(){return sve(this)}_assign(e){this!==e&&(Tt(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(n=>({...n})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new $o({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return n.metadata._copy(this.metadata),n}_onReload(e){Tt(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await VS(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(ui(this.auth.app))return Promise.reject(nu(this.auth));const e=await this.getIdToken();return await k_(this,tve(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,n){const r=n.displayName??void 0,s=n.email??void 0,i=n.phoneNumber??void 0,o=n.photoURL??void 0,a=n.tenantId??void 0,c=n._redirectEventId??void 0,l=n.createdAt??void 0,d=n.lastLoginAt??void 0,{uid:h,emailVerified:p,isAnonymous:g,providerData:_,stsTokenManager:v}=n;Tt(h&&v,e,"internal-error");const b=Ef.fromJSON(this.name,v);Tt(typeof h=="string",e,"internal-error"),Al(r,e.name),Al(s,e.name),Tt(typeof p=="boolean",e,"internal-error"),Tt(typeof g=="boolean",e,"internal-error"),Al(i,e.name),Al(o,e.name),Al(a,e.name),Al(c,e.name),Al(l,e.name),Al(d,e.name);const w=new $o({uid:h,auth:e,email:s,emailVerified:p,displayName:r,isAnonymous:g,photoURL:o,phoneNumber:i,tenantId:a,stsTokenManager:b,createdAt:l,lastLoginAt:d});return _&&Array.isArray(_)&&(w.providerData=_.map(E=>
106({...E}))),c&&(w._redirectEventId=c),w}static async _fromIdTokenResponse(e,n,r=!1){const s=new Ef;s.updateFromServerResponse(n);const i=new $o({uid:n.localId,auth:e,stsTokenManager:s,isAnonymous:r});return await VS(i),i}static async _fromGetAccountInfoResponse(e,n,r){const s=n.users[0];Tt(s.localId!==void 0,"internal-error");const i=s.providerUserInfo!==void 0?I6(s.providerUserInfo):[],o=!(s.email&&s.passwordHash)&&!i?.length,a=new Ef;a.updateFromIdToken(r);const c=new $o({uid:s.localId,auth:e,stsTokenManager:a,isAnonymous:o}),l={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:i,metadata:new TR(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!i?.length};return Object.assign(c,l),c}}const hV=new Map;function Ec(t){Qc(t instanceof Function,"Expected a class definition");let e=hV.get(t);return e?(Qc(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,hV.set(t,e),e)}class C6{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}}C6.type="NONE";const fV=C6;function ow(t,e,n){return`firebase:${t}:${e}:${n}`}class If{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;const{config:s,name:i}=this.auth;this.fullUserKey=ow(this.userKey,s.apiKey,i),this.fullPersistenceKey=ow("persistence",s.apiKey,i),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){const n=await MS(this.auth,{idToken:e}).catch(()=>{});return n?$o._fromGetAccountInfoResponse(this.auth,n,e):null}return $o._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new If(Ec(fV),e,r);const s=(await Promise.all(n.map(async l=>{if(await l._isAvailable())return l}))).filter(l=>l);let i=s[0]||Ec(fV);const o=ow(r,e.config.apiKey,e.name);let a=null;for(const l of n)try{const d=await l._get(o);if(d){let h;if(typeof d=="string"){const p=await MS(e,{idToken:d}).catch(()=>{});if(!p)break;h=await $o._fromGetAccountInfoResponse(e,p,d)}else h=$o._fromJSON(e,d);l!==i&&(a=h),i=l;break}}catch{}const c=s.filter(l=>l._shouldAllowMigration);return!i._shouldAllowMigration||!c.length?new If(i,e,r):(i=c[0],a&&await i._set(o,a.toJSON()),await Promise.all(n.map(async l=>{if(l!==i)try{await l._remove(o)}catch{}})),new If(i,e,r))}}function pV(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(k6(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(A6(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(D6(e))return"Blackberry";if(O6(e))return"Webos";if(R6(e))return"Safari";if((e.includes("chrome/")||P6(e))&&!e.includes("edge/"))return"Chrome";if(N6(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if(r?.length===2)return r[1]}return"Other"}function A6(t=Xr()){return/firefox\//i.test(t)}function R6(t=Xr()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function P6(t=Xr()){return/crios\//i.test(t)}function k6(t=Xr()){return/iemobile/i.test(t)}function N6(t=Xr()){return/android/i.test(t)}function D6(t=Xr()){return/blackberry/i.test(t)}function O6(t=Xr()){return/webos/i.test(t)}function rD(t=Xr()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function cve(t=Xr()){return rD(t)&&!!window.navigator?.standalone}function lve(){return Kle()&&document.documentMode===10}function x6(t=Xr()){return rD(t)||N6(t)||O6(t)||D6(t)||/windows phone/i.test(t)||k6(t)}function L6(t,e=[]){let n;switch(t){case"Browser":n=pV(Xr());break;case"Worker":n=`${pV(Xr())}-${t}`;break;default:n=t}const r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${Tu}/${r}`}class uve{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const r=i=>new Promise((o,a)=>{try{const c=e(i);o(c)}catch(c){a(c)}});r.onAbort=n,this.queue.push(r);const s=this.queue.length-1;return()=>{this.queue[s]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const r of this.queue)await r(e),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const s of n)try{s()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r?.message})}}}async function dve(t,e={}){return $p(t,"GET","/v2/passwordPolicy",EE(t,e))}const hve=6;class fve{constructor(e){const n=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=n.minPasswordLength??hve,n.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=n.maxPasswordLength),n.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=n.containsLowercaseCharacter),n.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=n.containsUppercaseCharacter),n.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=n.containsNumericCharacter),n.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=n.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=e.allowedNonAlphanumericCharacters?.join("")??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){const n={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,n),this.validatePasswordCharacterOptions(e,n),n.isValid&&
106(n.isValid=n.meetsMinPasswordLength??!0),n.isValid&&(n.isValid=n.meetsMaxPasswordLength??!0),n.isValid&&(n.isValid=n.containsLowercaseLetter??!0),n.isValid&&(n.isValid=n.containsUppercaseLetter??!0),n.isValid&&(n.isValid=n.containsNumericCharacter??!0),n.isValid&&(n.isValid=n.containsNonAlphanumericCharacter??!0),n}validatePasswordLengthOptions(e,n){const r=this.customStrengthOptions.minPasswordLength,s=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),s&&(n.meetsMaxPasswordLength=e.length<=s)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let s=0;s<e.length;s++)r=e.charAt(s),this.updatePasswordCharacterOptionsStatuses(n,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,n,r,s,i){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=s)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=i))}}class pve{constructor(e,n,r,s){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new mV(this),this.idTokenSubscription=new mV(this),this.beforeStateQueue=new uve(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=v6,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=s.sdkClientVersion,this._persistenceManagerAvailable=new Promise(i=>this._resolvePersistenceManagerAvailable=i)}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=Ec(n)),this._initializationPromise=this.queue(async()=>{if(!this._deleted&&(this.persistenceManager=await If.create(this,e),this._resolvePersistenceManagerAvailable?.(),!this._deleted)){if(this._popupRedirectResolver?._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=this.currentUser?.uid||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const n=await MS(this,{idToken:e}),r=await $o._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){if(ui(this.app)){const i=this.app.settings.authIdToken;return i?new Promise(o=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(i).then(o,o))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let r=n,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const i=this.redirectUser?._redirectEventId,o=r?._redirectEventId,a=await this.tryRedirectSignIn(e);(!i||i===o)&&a?.user&&(r=a.user,s=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(r)}catch(i){r=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(i))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return Tt(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await VS(e)}catch(n){if(n?.code!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=Jye()}async _delete(){this._deleted=!0}
106async updateCurrentUser(e){if(ui(this.app))return Promise.reject(nu(this));const n=e?wn(e):null;return n&&Tt(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&Tt(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return ui(this.app)?Promise.reject(nu(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return ui(this.app)?Promise.reject(nu(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Ec(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await dve(this),n=new fve(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new iy("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await ave(this,r)}}toJSON(){return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:this._currentUser?.toJSON()}}async _setRedirectUser(e,n){const r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&Ec(e)||this._popupRedirectResolver;Tt(n,this,"argument-error"),this.redirectPersistenceManager=await If.create(this,[Ec(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){return this._isInitialized&&await this.queue(async()=>{}),this._currentUser?._redirectEventId===e?this._currentUser:this.redirectUser?._redirectEventId===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=this.currentUser?.uid??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,s){if(this._deleted)return()=>{};const i=typeof n=="function"?n:n.next.bind(n);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(Tt(a,this,"internal-error"),a.then(()=>{o||i(this.currentUser)}),typeof n=="function"){const c=e.addObserver(n,r,s);return()=>{o=!0,c()}}else{const c=e.addObserver(n);return()=>{o=!0,c()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return Tt(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=L6(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const n=await this.heartbeatServiceProvider.getImmediate({optional:!0})?.getHeartbeatsHeader();n&&(e["X-Firebase-Client"]=n);const r=await this._getAppCheckToken();return r&&(e["X-Firebase-AppCheck"]=r),e}async _getAppCheckToken(){if(ui(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await this.appCheckServiceProvider.getImmediate({optional:!0})?.getToken();return e?.error&&Gye(`Error while retrieving App Check token: ${e.error}`),e?.token}}function Py(t){return wn(t)}class mV{constructor(e){this.auth=e,this.observer=null,this.addObserver=nue(n=>this.observer=n)}get next(){return Tt(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}let sD={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function mve(t){sD=t}function gve(t){return sD.loadJS(t)}function _ve(){return sD.gapiScript}function yve(t){return`__${t}${Math.floor(Math.random()*1e6)}`}function vve(t,e){const n=Np(t,"auth");if(n.isInitialized()){const s=n.getImmediate(),i=n.getOptions();if(Wc(i,e??{}))return s;Ma(s,"already-initialized")}return n.initialize({options:e})}function bve(t,e){const n=e?.persistence||[],r=(Array.isArray(n)?n:[n]).map(Ec);e?.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e?.popupRedirectResolver)}function wve(t,e,n){const r=Py(t);
106Tt(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const s=!1,i=M6(e),{host:o,port:a}=Sve(e),c=a===null?"":`:${a}`,l={url:`${i}//${o}${c}/`},d=Object.freeze({host:o,port:a,protocol:i.replace(":",""),options:Object.freeze({disableWarnings:s})});if(!r._canInitEmulator){Tt(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),Tt(Wc(l,r.config.emulator)&&Wc(d,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=l,r.emulatorConfig=d,r.settings.appVerificationDisabledForTesting=!0,$a(o)?(sy(`${i}//${o}${c}`),UT("Auth",!0)):Tve()}function M6(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function Sve(t){const e=M6(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",s=/^(\[[^\]]+\])(:|$)/.exec(r);if(s){const i=s[1];return{host:i,port:gV(r.substr(i.length+1))}}else{const[i,o]=r.split(":");return{host:i,port:gV(o)}}}function gV(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function Tve(){function t(){const e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",t):t())}class V6{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return Tc("not implemented")}_getIdTokenResponse(e){return Tc("not implemented")}_linkToIdToken(e,n){return Tc("not implemented")}_getReauthenticationResolver(e){return Tc("not implemented")}}async function Cf(t,e){return S6(t,"POST","/v1/accounts:signInWithIdp",EE(t,e))}const Eve="http://localhost";class nh extends V6{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new nh(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):Ma("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
106once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:s,...i}=n;if(!r||!s)return null;const o=new nh(r,s);return o.idToken=i.idToken||void 0,o.accessToken=i.accessToken||void 0,o.secret=i.secret,o.nonce=i.nonce,o.pendingToken=i.pendingToken||null,o}_getIdTokenResponse(e){const n=this.buildRequest();return Cf(e,n)}_linkToIdToken(e,n){const r=this.buildRequest();return r.idToken=n,Cf(e,r)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,Cf(e,n)}buildRequest(){const e={requestUri:Eve,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=kp(n)}return e}}class iD{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}class ky extends iD{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}class Vl extends ky{constructor(){super("facebook.com")}static credential(e){return nh._fromParams({providerId:Vl.PROVIDER_ID,signInMethod:Vl.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Vl.credentialFromTaggedObject(e)}static credentialFromError(e){return Vl.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Vl.credential(e.oauthAccessToken)}catch{return null}}}Vl.FACEBOOK_SIGN_IN_METHOD="facebook.com";Vl.PROVIDER_ID="facebook.com";class bc extends ky{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return nh._fromParams({providerId:bc.PROVIDER_ID,signInMethod:bc.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return bc.credentialFromTaggedObject(e)}static credentialFromError(e){return bc.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:n,oauthAccessToken:r}=e;if(!n&&!r)return null;try{return bc.credential(n,r)}catch{return null}}}bc.GOOGLE_SIGN_IN_METHOD="google.com";bc.PROVIDER_ID="google.com";class Fl extends ky{constructor(){super("github.com")}static credential(e){return nh._fromParams({providerId:Fl.PROVIDER_ID,signInMethod:Fl.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return Fl.credentialFromTaggedObject(e)}static credentialFromError(e){return Fl.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return Fl.credential(e.oauthAccessToken)}catch{return null}}}Fl.GITHUB_SIGN_IN_METHOD="github.com";Fl.PROVIDER_ID="github.com";class Bl extends ky{constructor(){super("twitter.com")}static credential(e,n){return nh._fromParams({providerId:Bl.PROVIDER_ID,signInMethod:Bl.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return Bl.credentialFromTaggedObject(e)}static credentialFromError(e){return Bl.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=e;if(!n||!r)return null;try{return Bl.credential(n,r)}catch{return null}}}Bl.TWITTER_SIGN_IN_METHOD="twitter.com";Bl.PROVIDER_ID="twitter.com";class rh{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,s=!1){const i=await $o._fromIdTokenResponse(e,r,s),o=_V(r);return new rh({user:i,providerId:o,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);const s=_V(r);return new rh({user:e,providerId:s,_tokenResponse:r,operationType:n})}}function _V(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}class FS extends Ua{constructor(e,n,r,s){super(n.code,n.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,FS.prototype),this.customData={appName:e.n
106ame,tenantId:e.tenantId??void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,s){return new FS(e,n,r,s)}}function F6(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(i=>{throw i.code==="auth/multi-factor-auth-required"?FS._fromErrorAndOperation(t,i,e,r):i})}async function Ive(t,e,n=!1){const r=await k_(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return rh._forOperation(t,"link",r)}async function Cve(t,e,n=!1){const{auth:r}=t;if(ui(r.app))return Promise.reject(nu(r));const s="reauthenticate";try{const i=await k_(t,F6(r,s,e,t),n);Tt(i.idToken,r,"internal-error");const o=nD(i.idToken);Tt(o,r,"internal-error");const{sub:a}=o;return Tt(t.uid===a,r,"user-mismatch"),rh._forOperation(t,s,i)}catch(i){throw i?.code==="auth/user-not-found"&&Ma(r,"user-mismatch"),i}}async function Ave(t,e,n=!1){if(ui(t.app))return Promise.reject(nu(t));const r="signIn",s=await F6(t,r,e),i=await rh._fromIdTokenResponse(t,r,s);return n||await t._updateCurrentUser(i.user),i}async function Rve(t,e){return S6(t,"POST","/v1/accounts:signInWithCustomToken",EE(t,e))}async function Pve(t,e){if(ui(t.app))return Promise.reject(nu(t));const n=Py(t),r=await Rve(n,{token:e,returnSecureToken:!0}),s=await rh._fromIdTokenResponse(n,"signIn",r);return await n._updateCurrentUser(s.user),s}function kve(t,e,n,r){return wn(t).onIdTokenChanged(e,n,r)}function Nve(t,e,n){return wn(t).beforeAuthStateChanged(e,n)}function Dve(t,e,n,r){return wn(t).onAuthStateChanged(e,n,r)}function B6(t){return wn(t).signOut()}const BS="__sak";class $6{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(BS,"1"),this.storage.removeItem(BS),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}const Ove=1e3,xve=10;class U6 extends $6{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=x6(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),s=this.localCache[n];r!==s&&e(n,s,r)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((o,a,c)=>{this.notifyListeners(o,c)});return}const r=e.key;n?this.detachListener():this.stopPolling();const s=()=>{const o=this.storage.getItem(r);!n&&this.localCache[r]===o||this.notifyListeners(r,o)},i=this.storage.getItem(r);lve()&&i!==e.newValue&&e.newValue!==e.oldValue?setTimeout(s,xve):s()}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const s of Array.from(r))s(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},Ove)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Ob
106ject.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}}U6.type="LOCAL";const Lve=U6;class H6 extends $6{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}}H6.type="SESSION";const q6=H6;function Mve(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}class IE{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(s=>s.isListeningto(e));if(n)return n;const r=new IE(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:r,eventType:s,data:i}=n.data,o=this.handlersMap[s];if(!o?.size)return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:s});const a=Array.from(o).map(async l=>l(n.origin,i)),c=await Mve(a);n.ports[0].postMessage({status:"done",eventId:r,eventType:s,response:c})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}IE.receivers=[];function oD(t="",e=10){let n="";for(let r=0;r<e;r++)n+=Math.floor(Math.random()*10);return t+n}class Vve{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,n,r=50){const s=typeof MessageChannel<"u"?new MessageChannel:null;if(!s)throw new Error("connection_unavailable");let i,o;return new Promise((a,c)=>{const l=oD("",20);s.port1.start();const d=setTimeout(()=>{c(new Error("unsupported_event"))},r);o={messageChannel:s,onMessage(h){const p=h;if(p.data.eventId===l)switch(p.data.status){case"ack":clearTimeout(d),i=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(i),a(p.data.response);break;default:clearTimeout(d),clearTimeout(i),c(new Error("invalid_response"));break}}},this.handlers.add(o),s.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:l,data:n},[s.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}function Ia(){return window}function Fve(t){Ia().location.href=t}function j6(){return typeof Ia().WorkerGlobalScope<"u"&&typeof Ia().importScripts=="function"}async function Bve(){if(!navigator?.serviceWorker)return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function $ve(){return navigator?.serviceWorker?.controller||null}function Uve(){return j6()?self:null}const W6="firebaseLocalStorageDb",Hve=1,$S="firebaseLocalStorage",G6="fbase_key";class Ny{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function CE(t,e){return t.transaction([$S],e?"readwrite":"readonly").objectStore($S)}function qve(){const t=indexedDB.deleteDatabase(W6);return new Ny(t).toPromise()}function ER(){const t=indexedDB.open(W6,Hve);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const r=t.result;try{r.createObjectStore($S,{keyPath:G6})}catch(s){n(s)}}),t.addEventListener("success",async()=>{const r=t.result;r.objectStoreNames.contains($S)?e(r):(r.close(),await qve(),e(await ER()))})})}async function yV(t,e,n){const r=CE(t,!0).put({[G6]:e,value:n});return new Ny(r).toPromise()}async function jve(t,e){const n=CE(t,!1).get(e),r=await new Ny(n).toPromise();return r===void 0?null:r.value}function vV(t,e){const n=CE(t,!0).delete(e);return new Ny(n).toPromise()}const Wve=800,Gve=3;class K6{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await ER(),this.db)}async _withRetries(e){let n=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(n++>Gve)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return j6()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=IE._getInstance(Uve()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)}
106)),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){if(this.activeServiceWorker=await Bve(),!this.activeServiceWorker)return;this.sender=new Vve(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&e[0]?.fulfilled&&e[0]?.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||$ve()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await ER();return await yV(e,BS,"1"),await vV(e,BS),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>yV(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(r=>jve(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>vV(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(s=>{const i=CE(s,!1).getAll();return new Ny(i).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(e.length!==0)for(const{fbase_key:s,value:i}of e)r.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(i)&&(this.notifyListeners(s,i),n.push(s));for(const s of Object.keys(this.localCache))this.localCache[s]&&!r.has(s)&&(this.notifyListeners(s,null),n.push(s));return n}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const s of Array.from(r))s(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Wve)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Ob
106ject.keys(this.listeners).length===0&&this.stopPolling()}}K6.type="LOCAL";const Kve=K6;new Ry(3e4,6e4);function z6(t,e){return e?Ec(e):(Tt(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}class aD extends V6{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return Cf(e,this._buildIdpRequest())}_linkToIdToken(e,n){return Cf(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return Cf(e,this._buildIdpRequest())}_buildIdpRequest(e){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(n.idToken=e),n}}function zve(t){return Ave(t.auth,new aD(t),t.bypassAuthState)}function Yve(t){const{auth:e,user:n}=t;return Tt(n,e,"internal-error"),Cve(n,new aD(t),t.bypassAuthState)}async function Jve(t){const{auth:e,user:n}=t;return Tt(n,e,"internal-error"),Ive(n,new aD(t),t.bypassAuthState)}class Y6{constructor(e,n,r,s,i=!1){this.auth=e,this.resolver=r,this.user=s,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:n,sessionId:r,postBody:s,tenantId:i,error:o,type:a}=e;if(o){this.reject(o);return}const c={auth:this.auth,requestUri:n,sessionId:r,tenantId:i||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(c))}catch(l){this.reject(l)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return zve;case"linkViaPopup":case"linkViaRedirect":return Jve;case"reauthViaPopup":case"reauthViaRedirect":return Yve;default:Ma(this.auth,"internal-error")}}resolve(e){Qc(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Qc(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}const Qve=new Ry(2e3,1e4);async function Xve(t,e,n){if(ui(t.app))return Promise.reject(jo(t,"operation-not-supported-in-this-environment"));const r=Py(t);Kye(t,e,iD);const s=z6(r,n);return new wd(r,"signInViaPopup",e,s).executeNotNull()}class wd extends Y6{constructor(e,n,r,s,i){super(e,n,s,i),this.provider=r,this.authWindow=null,this.pollId=null,wd.currentPopupAction&&wd.currentPopupAction.cancel(),wd.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return Tt(e,this.auth,"internal-error"),e}async onExecution(){Qc(this.filter.length===1,"Popup operations only handle one event");const e=oD();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(jo(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){return this.authWindow?.associatedEvent||null}cancel(){this.reject(jo(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,wd.currentPopupAction=null}pollUserCancellation(){const e=()=>{if(this.authWindow?.window?.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(jo(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Qve.get())};e()}}wd.currentPopupAction=null;const Zve="pendingRedirect",aw=new Map;class ebe extends Y6{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=aw.get(this.auth._key());if(!e){try{const r=await tbe(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(n){e=()=>Promise.reject(n)}aw.set(this.auth._key(),e)}return this.bypassAuthState||aw.set(this.auth._key(),()=>Promise.resolve(null)),e()}
106async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function tbe(t,e){const n=sbe(e),r=rbe(t);if(!await r._isAvailable())return!1;const s=await r._get(n)==="true";return await r._remove(n),s}function nbe(t,e){aw.set(t._key(),e)}function rbe(t){return Ec(t._redirectPersistence)}function sbe(t){return ow(Zve,t.config.apiKey,t.name)}async function ibe(t,e,n=!1){if(ui(t.app))return Promise.reject(nu(t));const r=Py(t),s=z6(r,e),o=await new ebe(r,s,n).execute();return o&&!n&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}const obe=600*1e3;class abe{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!cbe(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){if(e.error&&!J6(e)){const r=e.error.code?.split("auth/")[1]||"internal-error";n.onError(jo(this.auth,r))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=obe&&this.cachedEventUids.clear(),this.cachedEventUids.has(bV(e))}saveEventToCache(e){this.cachedEventUids.add(bV(e)),this.lastProcessedEventTime=Date.now()}}function bV(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function J6({type:t,error:e}){return t==="unknown"&&e?.code==="auth/no-auth-event"}function cbe(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return J6(t);default:return!1}}async function lbe(t,e={}){return $p(t,"GET","/v1/projects",e)}const ube=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,dbe=/^https?/;async function hbe(t){if(t.config.emulator)return;const{authorizedDomains:e}=await lbe(t);for(const n of e)try{if(fbe(n))return}catch{}Ma(t,"unauthorized-domain")}function fbe(t){const e=SR(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const o=new URL(t);return o.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&o.hostname===r}if(!dbe.test(n))return!1;if(ube.test(t))return r===t;const s=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}const pbe=new Ry(3e4,6e4);function wV(){const t=Ia().___jsl;if(t?.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n<t.CP.length;n++)t.CP[n]=null}}function mbe(t){return new Promise((e,n)=>{function r(){wV(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{wV(),n(jo(t,"network-request-failed"))},timeout:pbe.get()})}if(Ia().gapi?.iframes?.Iframe)e(gapi.iframes.getContext());else if(Ia().gapi?.load)r();else{const s=yve("iframefcb");return Ia()[s]=()=>{gapi.load?r():n(jo(t,"network-request-failed"))},gve(`${_ve()}?onload=${s}`).catch(i=>n(i))}}).catch(e=>{throw cw=null,e})}let cw=null;function gbe(t){return cw=cw||mbe(t),cw}const _be=new Ry(5e3,15e3),ybe="__/auth/iframe",vbe="emulator/auth/iframe",bbe={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},wbe=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Sbe(t){const e=t.config;Tt(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?tD(e,vbe):`https://${t.config.authDomain}/${ybe}`,r={apiKey:e.apiKey,appName:t.name,v:Tu},s=wbe.get(t.config.apiHost);s&&(r.eid=s);const i=t._getFrameworks();return i.length&&(r.fw=i.join(",")),`${n}?${kp(r).slice(1)}`}async function Tbe(t){const e=await gbe(t),n=Ia().gapi;return Tt(n,t,"internal-error"),e.open({where:document.body,url:Sbe(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:bbe,dontclear:!0},r=>new Promise(async(s,i)=>{await r.restyle({setHideOnLeave:!1});const o=jo(t,"network-request-failed"),a=Ia().setTimeout(()=>{i(o)},_be.get());function c(){Ia().clearTimeout(a),s(r)}r.ping(c).then(c,()=>{i(o)})}))}const Ebe={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Ibe=500,Cbe=600,Abe="_blank",Rbe="http://localhost";class SV{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Pbe(t,e,n,r=Ibe,s=Cbe){const i=Math.max((window.screen.availHeight-s)/2,0).toString(),o=Math.max((window.screen.availWi
106dth-r)/2,0).toString();let a="";const c={...Ebe,width:r.toString(),height:s.toString(),top:i,left:o},l=Xr().toLowerCase();n&&(a=P6(l)?Abe:n),A6(l)&&(e=e||Rbe,c.scrollbars="yes");const d=Object.entries(c).reduce((p,[g,_])=>`${p}${g}=${_},`,"");if(cve(l)&&a!=="_self")return kbe(e||"",a),new SV(null);const h=window.open(e||"",a,d);Tt(h,t,"popup-blocked");try{h.focus()}catch{}return new SV(h)}function kbe(t,e){const n=document.createElement("a");n.href=t,n.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}const Nbe="__/auth/handler",Dbe="emulator/auth/handler",Obe=encodeURIComponent("fac");async function TV(t,e,n,r,s,i){Tt(t.config.authDomain,t,"auth-domain-config-required"),Tt(t.config.apiKey,t,"invalid-api-key");const o={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:Tu,eventId:s};if(e instanceof iD){e.setDefaultLanguage(t.languageCode),o.providerId=e.providerId||"",RA(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[d,h]of Object.entries({}))o[d]=h}if(e instanceof ky){const d=e.getScopes().filter(h=>h!=="");d.length>0&&(o.scopes=d.join(","))}t.tenantId&&(o.tid=t.tenantId);const a=o;for(const d of Object.keys(a))a[d]===void 0&&delete a[d];const c=await t._getAppCheckToken(),l=c?`#${Obe}=${encodeURIComponent(c)}`:"";return`${xbe(t)}?${kp(a).slice(1)}${l}`}function xbe({config:t}){return t.emulator?tD(t,Dbe):`https://${t.authDomain}/${Nbe}`}const sC="webStorageSupport";class Lbe{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=q6,this._completeRedirectFn=ibe,this._overrideRedirectResult=nbe}
106async _openPopup(e,n,r,s){Qc(this.eventManagers[e._key()]?.manager,"_initialize() not called before _openPopup()");const i=await TV(e,n,r,SR(),s);return Pbe(e,i,oD())}async _openRedirect(e,n,r,s){await this._originValidation(e);const i=await TV(e,n,r,SR(),s);return Fve(i),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:s,promise:i}=this.eventManagers[n];return s?Promise.resolve(s):(Qc(i,"If manager is not set, promise should be"),i)}const r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){const n=await Tbe(e),r=new abe(e);return n.register("authEvent",s=>(Tt(s?.authEvent,e,"invalid-auth-event"),{status:r.onEvent(s.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(sC,{type:sC},s=>{const i=s?.[0]?.[sC];i!==void 0&&n(!!i),Ma(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=hbe(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return x6()||R6()||rD()}}const Mbe=Lbe;var EV="@firebase/auth",IV="1.11.0";class Vbe{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){return this.assertAuthConfigured(),this.auth.currentUser?.uid||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const n=this.auth.onIdTokenChanged(r=>{e(r?.stsTokenManager.accessToken||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){Tt(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}function Fbe(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function Bbe(t){uu(new Gc("auth",(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),s=e.getProvider("heartbeat"),i=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=r.options;Tt(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const c={apiKey:o,authDomain:a,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:L6(t)},l=new pve(r,s,i,c);return bve(l,n),l},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),uu(new Gc("auth-internal",e=>{const n=Py(e.getProvider("auth").getImmediate());return(r=>new Vbe(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),po(EV,IV,Fbe(t)),po(EV,IV,"esm2020")}const $be=300,Ube=iq("authIdTokenMaxAge")||$be;let CV=null;const Hbe=t=>async e=>{const n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>Ube)return;const s=n?.token;CV!==s&&(CV=s,await fetch(t,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function qbe(t=jT()){const e=Np(t,"auth");if(e.isInitialized())return e.getImmediate();const n=vve(t,{popupRedirectResolver:Mbe,persistence:[Kve,Lve,q6]}),r=iq("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const i=new URL(r,location.origin);if(location.origin===i.origin){const o=Hbe(i.toString());Nve(n,o,()=>o(n.currentUser)),kve(n,a=>o(a))}}const s=rq("auth");return s&&wve(n,`http://${s}`),n}function jbe(){return document.getElementsByTagName("head")?.[0]??document}
106mve({loadJS(t){return new Promise((e,n)=>{const r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=s=>{const i=jo("internal-error");i.customData=s,n(i)},r.type="text/javascript",r.charset="UTF-8",jbe().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});Bbe("Browser");const Wbe={apiKey:"AIzaSyCM81ecUSYOvRAXuc-EkqSwxzPxxHsI410",authDomain:"niceloop.firebaseapp.com",databaseURL:"https://niceloop.firebaseio.com",projectId:"firebase-niceloop",storageBucket:"firebase-niceloop.appspot.com",messagingSenderId:"1028355006993",appId:"1:1028355006993:web:949cefaf3e12bb2e5007b0"},Dy=pq(Wbe);try{kpe(Dy,{localCache:Gpe({tabManager:Jpe()})})}catch(t){console.warn("Firestore persistent cache init failed:",t)}const Cn=Npe(Dy),qt=dye(Dy);Uye(Dy);const xc=qbe(Dy),cD=new bc;cD.addScope("email");cD.addScope("profile");var Ib=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function lD(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function H2e(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){var s=!1;try{s=this instanceof r}catch{}return s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,s.get?s:{enumerable:!0,get:function(){return t[r]}})}),n}var fg={exports:{}};var Gbe=fg.exports,AV;function Kbe(){return AV||(AV=1,(function(t,e){(function(){var n,r="4.17.21",s=200,i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",o="Expected a function",a="Invalid `variable` option passed into `_.template`",c="__lodash_hash_undefined__",l=500,d="__lodash_placeholder__",h=1,p=2,g=4,_=1,v=2,b=1,w=2,E=4,T=8,R=16,N=32,O=64,S=128,I=256,P=512,k=30,L="...",M=800,V=16,z=1,ie=2,K=3,ce=1/0,G=9007199254740991,Z=17976931348623157e292,de=NaN,fe=4294967295,ee=fe-1,Te=fe>>>1,pe=[["ary",S],["bind",b],["bindKey",w],["curry",T],["curryRight",R],["flip",P],["partial",N],["partialRight",O],["rearg",I]],Ce="[object Arguments]",Ve="[object Array]",Y="[object AsyncFunction]",ve="[object Boolean]",Ee="[object Date]",Me="[object DOMException]",Ke="[object Error]",ut="[object Function]",H="[object GeneratorFunction]",j="[object Map]",re="[object Number]",Re="[object Null]",ge="[object Object]",B="[object Promise]",q="[object Proxy]",J="[object RegExp]",se="[object Set]",be="[object String]",xe="[object Symbol]",X="[object Undefined]",le="[object WeakMap]",je="[object WeakSet]",Ye="[object ArrayBuffer]",vt="[object DataView]",oe="[object Float32Array]",ye="[object Float64Array]",Fe="[object Int8Array]",ot="[object Int16Array]",dt="[object Int32Array]",Vr="[object Uint8Array]",jn="[object Uint8ClampedArray]",kn="[object Uint16Array]",Tr="[object Uint32Array]",wo=/\b__p \+= '';/g,Ga=/\b(__p \+=) '' \+/g,So=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Qo=/&(?:amp|lt|gt|quot|#39);/g,Er=/[&<>"']/g,gh=RegExp(Qo.source),De=RegExp(Er.source),We=/<%-([\s\S]+?)%>/g,Rt=/<%([\s\S]+?)%>/g,Ir=/<%=([\s\S]+?)%>/g,pn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Ci=/^\w*$/,Xo=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,er=/[\\^$.*+?()[\]{}|]/g,ps=RegExp(er.source),Vs=/^\s+/,Zo=/\s/,Ka=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,tm=/\{\n\/\* \[wrapped with (.+)\] \*/,Wi=/,? & /,cl=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,ea=/[()=,{}\[\]\/\s]/,xu=/\\(\\)?/g,nm=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,rm=/\w*$/,iI=/^[-+]0x[0-9a-f]+$/i,Zy=/^0b[01]+$/i,oI=/^\[object .+?Constructor\]$/,_h=/^0o[0-7]+$/i,ev=/^(?:0|[1-9]\d*)$/,sm=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u01
vendor: 8,884 bytes, line 106
1067f]/g,ta=/($^)/,za=/['\n\r\u2028\u2029\\]/g,ll="\\ud800-\\udfff",aI="\\u0300-\\u036f",tv="\\ufe20-\\ufe2f",nv="\\u20d0-\\u20ff",im=aI+tv+nv,yh="\\u2700-\\u27bf",vh="a-z\\xdf-\\xf6\\xf8-\\xff",rv="\\xac\\xb1\\xd7\\xf7",sv="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",iv="\\u2000-\\u206f",cI=" \\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",To="A-Z\\xc0-\\xd6\\xd8-\\xde",Ai="\\ufe0e\\ufe0f",ul=rv+sv+iv+cI,Ya="['â]",om="["+ll+"]",Mn="["+ul+"]",Ja="["+im+"]",dl="\\d+",Lu="["+yh+"]",ov="["+vh+"]",am="[^"+ll+ul+dl+yh+vh+To+"]",cm="\\ud83c[\\udffb-\\udfff]",lI="(?:"+Ja+"|"+cm+")",av="[^"+ll+"]",lm="(?:\\ud83c[\\udde6-\\uddff]){2}",Qa="[\\ud800-\\udbff][\\udc00-\\udfff]",ti="["+To+"]",um="\\u200d",dm="(?:"+ov+"|"+am+")",cv="(?:"+ti+"|"+am+")",hm="(?:"+Ya+"(?:d|ll|m|re|s|t|ve))?",fm="(?:"+Ya+"(?:D|LL|M|RE|S|T|VE))?",Xa=lI+"?",lv="["+Ai+"]?",uI="(?:"+um+"(?:"+[av,lm,Qa].join("|")+")"+lv+Xa+")*",dI="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",na="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",uv=lv+Xa+uI,pm="(?:"+[Lu,lm,Qa].join("|")+")"+uv,bh="(?:"+[av+Ja+"?",Ja,lm,Qa,om].join("|")+")",dv=RegExp(Ya,"g"),Mu=RegExp(Ja,"g"),Za=RegExp(cm+"(?="+cm+")|"+bh+uv,"g"),hv=RegExp([ti+"?"+ov+"+"+hm+"(?="+[Mn,ti,"$"].join("|")+")",cv+"+"+fm+"(?="+[Mn,ti+dm,"$"].join("|")+")",ti+"?"+dm+"+"+hm,ti+"+"+fm,na,dI,dl,pm].join("|"),"g"),mm=RegExp("["+um+ll+im+Ai+"]"),tr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,hI=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],fI=-1,Vn={};Vn[oe]=Vn[ye]=Vn[Fe]=Vn[ot]=Vn[dt]=Vn[Vr]=Vn[jn]=Vn[kn]=Vn[Tr]=!0,Vn[Ce]=Vn[Ve]=Vn[Ye]=Vn[ve]=Vn[vt]=Vn[Ee]=Vn[Ke]=Vn[ut]=Vn[j]=Vn[re]=Vn[ge]=Vn[J]=Vn[se]=Vn[be]=Vn[le]=!1;var Nn={};Nn[Ce]=Nn[Ve]=Nn[Ye]=Nn[vt]=Nn[ve]=Nn[Ee]=Nn[oe]=Nn[ye]=Nn[Fe]=Nn[ot]=Nn[dt]=Nn[j]=Nn[re]=Nn[ge]=Nn[J]=Nn[se]=Nn[be]=Nn[xe]=Nn[Vr]=Nn[jn]=Nn[kn]=Nn[Tr]=!0,Nn[Ke]=Nn[ut]=Nn[le]=!1;var fv={Ã:"A",Ã:"A",Ã:"A",Ã:"A",Ã:"A",Ã
:"A",à :"a",á:"a",â:"a",ã:"a",ä:"a",Ã¥:"a",Ã:"C",ç:"c",Ã:"D",ð:"d",Ã:"E",Ã:"E",Ã:"E",Ã:"E",è:"e",é:"e",ê:"e",ë:"e",Ã:"I",Ã:"I",Ã:"I",Ã:"I",ì:"i",Ã:"i",î:"i",ï:"i",Ã:"N",ñ:"n",Ã:"O",Ã:"O",Ã:"O",Ã:"O",Ã:"O",Ã:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ã:"U",Ã:"U",Ã:"U",Ã:"U",ù:"u",ú:"u",û:"u",ü:"u",Ã:"Y",ý:"y",ÿ:"y",Ã:"Ae",æ:"ae",Ã:"Th",þ:"th",Ã:"ss",Ä:"A",Ä:"A",Ä:"A",Ä:"a",Ä:"a",Ä
:"a",Ä:"C",Ä:"C",Ä:"C",Ä:"C",Ä:"c",Ä:"c",Ä:"c",Ä:"c",Ä:"D",Ä:"D",Ä:"d",Ä:"d",Ä:"E",Ä:"E",Ä:"E",Ä:"E",Ä:"E",Ä:"e",Ä:"e",Ä:"e",Ä:"e",Ä:"e",Ä:"G",Ä:"G",Ä :"G",Ä¢:"G",Ä:"g",Ä:"g",Ä¡:"g",Ä£:"g",Ĥ:"H",Ħ:"H",Ä¥:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Ä®:"I",İ:"I",Ä©:"i",Ä«:"i",Ä:"i",į:"i",ı:"i",Ä´:"J",ĵ:"j",Ķ:"K",Ä·:"k",ĸ:"k",Ĺ:"L",Ä»:"L",Ľ:"L",Ä¿:"L",Å:"L",ĺ:"l",ļ:"l",ľ:"l",Å:"l",Å:"l",Å:"N",Å
:"N",Å:"N",Å:"N",Å:"n",Å:"n",Å:"n",Å:"n",Å:"O",Å:"O",Å:"O",Å:"o",Å:"o",Å:"o",Å:"R",Å:"R",Å:"R",Å:"r",Å:"r",Å:"r",Å:"S",Å:"S",Å:"S",Å :"S",Å:"s",Å:"s",Å:"s",Å¡:"s",Å¢:"T",Ť:"T",Ŧ:"T",Å£:"t",Å¥:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Å®:"U",Ű:"U",Ų:"U",Å©:"u",Å«:"u",Å:"u",ů:"u",ű:"u",ų:"u",Å´:"W",ŵ:"w",Ŷ:"Y",Å·:"y",Ÿ:"Y",Ź:"Z",Å»:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Å:"Oe",Å:"oe",Å:"'n",Å¿:"s"},wh={"&":"&","<":"<",">":">",'"':""","'":"'"},ra={"&":"&","<":"<",">":">",""":'"',"'":"'"},pv={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},pI=parseFloat,Vu=parseInt,gm=typeof Ib=="object"&&Ib&&Ib.Object===Object&&Ib,_m=typeof self=="object"&&self&&self.Object===Object&&self,hr=gm||_m||Function("return this")(),Sh=e&&!e.nodeType&&e,Gi=Sh&&!0&&t&&!t.nodeType&&t,mv=Gi&&Gi.exports===Sh,Th=mv&&gm.process,es=(function(){try{var te=Gi&&Gi.require&&Gi.require("util").types;return te||Th&&Th.binding&&Th.binding("util")}catch{}})(),ym=es&&es.isArrayBuffer,vm=es&&es.isDate,Eh=es&&es.isMap,Ih=es&&es.isRegExp,bm=es&&es.isSet,Fu=es&&es.isTypedArray;function bs(te,Ie,_e){switch(_e.length){case 0:return te.call(Ie);case 1:return te.call(Ie,_e[0]);case 2:return te.call(Ie,_e[0],_e[1]);case 3:return te.call(Ie,_e[0],_e[1],_e[2])}return te.apply(Ie,_e)}function gv(te,Ie,_e,et){for(var It=-1,mn=te==null?0:te.length;++It<mn;){var Gr=te[It];Ie(et,Gr,_e(Gr),te)}return et}function Fr(te,Ie){for(var _e=-1,et=te==null?0:te.length;++_e<et&&Ie(te[_e],_e,te)!==!1;);return te}function _v(te,Ie){for(var _e=te==null?0:te.length;_e--&&Ie(te[_e],_e,te)!==!1;);return te}function wm(te,Ie){for(var _e=-1,et=te==null?0:te.length;++_e<et;)if(!Ie(te[_e],_e,te))return!1;return!0}function Eo(te,Ie){for(var _e=-1,et=te==null?0:te.length,It=0,mn=[];++_e<et;){var Gr=te[_e];Ie(Gr,_e,te)&&(mn[It++]=Gr)}return mn}function Bu(te,Ie){var _e=te==null?0:te.length;return!!_e&&He(te,Ie,0)>-1}function hl(te,Ie,_e){for(var et=-1,It=te==null?0:te.length;++et<It;)if(_e(Ie,te[et]))return!0;return!1}function Ft(te,Ie){for(var _e=-1,et=te==null?0:te.length,It=Array(et);++_e<et;)It[_e]=Ie(te[_e],_e,te);return It}function Io(te,Ie){for(var _e=-1,et=Ie.length,It=te.length;++_e<et;)te[It+_e]=Ie[_e];return te}function Ch(te,Ie,_e,et){var It=-1,mn=te==null?0:te.length;for(et&&mn&&(_e=te[++It]);++It<mn;)_e=Ie(_e,te[It],It,te);return _e}function fl(te,Ie,_e,et){var It=te==null?0:te.length;for(et&&It&&(_e=te[--It]);It--;)_e=Ie(_e,te[It],It,te);return _e}function m(te,Ie){for(var _e=-1,et=te==null?0:te.length;++_e<et;)if(Ie(te[_e],_e,te))return!0;return!1}var A=pr("length");function D(te){return te.split("")}function U(te){return te.match(cl)||[]}function ue(te,Ie,_e){var et;return _e(te,function(It,mn,Gr){if(Ie(It,mn,Gr))return et=mn,!1}),et}function he(te,Ie,_e,et){for(var It=te.length,mn=_e+(et?1:-1);et?mn--:++mn<It;)if(Ie(te[mn],mn,te))return mn;return-1}function He(te,Ie,_e){return Ie===Ie?YK(te,Ie,_e):he(te,fr,_e)}function kt(te,Ie,_e,et){for(var It=_e-1,mn=te.length;++It<mn;)if(et(te[It],Ie))return It;return-1}function fr(te){return te!==te}function Sn(te,Ie){var _e=te==null?0:te.length;return _e?Ki(te,Ie)/_e:de}function pr(te){return function(Ie){return Ie==null?n:Ie[te]}}function ni(te){return function(Ie){return te==null?n:te[Ie]}}function sa(te,Ie,_e,et,It){return It(te,function(mn,Gr,Bn){_e=et?(et=!1,mn):Ie(_e,mn,Gr,Bn)}),_e}function ia(te,Ie){var _e=te.length;for(te.sort(Ie);_e--;)te[_e]=te[_e].value;return te}function Ki(te,Ie){for(var _e,et=-1,It=te.length;++et<It;){var mn=Ie(te[et]);mn!==n&&(_e=_e===n?mn:_e+mn)}return _e}function pl(te,Ie){for(var _e=-1,et=Array(te);++_e<te;)et[_e]=Ie(_e);return et}function Sm(te,Ie){return Ft(Ie,function(_e){return[_e,te[_e]]})}function dO(te){return te&&te.slice(0,mO(te)+1).replace(Vs,"")}function Ri(te){return function(Ie){return te(Ie)}}function mI(te,Ie){return Ft(Ie,function(_e){return te[_e]})}function Tm(te,Ie){return te.has(Ie)}function hO(te,Ie){for(var _e=-1,et=te.length;++_e<et&&He(Ie,te[_e],0)>-1;);return _e}function fO(te,Ie){for(var _e=te.length;_e--&&He(Ie,te[_e],0)>-1;);return _e}function UK(te,Ie){for(var _e=te.length,et=0;_e--;)te[_e]===Ie&&++et;return et}var HK=ni(fv),qK=ni(wh);function jK(te){return"\\"+pv[te]}function WK(te,Ie){return te==null?n:te[Ie]}function Ah(te){return mm.test(te)}function GK(te){return tr.test(te)}function KK(te){for(var Ie,_e=[];!(Ie=te.next()).done;)_e.push(Ie.value);return _e}function gI(te){var Ie=-1,_e=Array(te.size);return te.forEach(function(et,It){_e[++Ie]=[It,et]}),_e}function pO(te,Ie){return function(_e){return te(Ie(_e))}}function ml(te,Ie){for(var _e=-1,et=te.length,It=0,mn=[];++_e<et;){var Gr=te[_e];(Gr===Ie||Gr===d)&&(te[_e]=d,mn[It++]=_e)}return mn}function yv(te){var Ie=-1,_e=Array(te.size);return te.forEach(function(et){_e[++Ie]=et}),_e}function zK(te){var Ie=-1,_e=Array(te.size);return te.forEach(function(et){_e[++Ie]=[et,et]}),_e}function YK(te,Ie,_e){for(var et=_e-1,It=te.length;++et<It;)if(te[et]===Ie)return et;return-1}function JK(te,Ie,_e){for(var et=_e+1;et--;)if(te[et]===Ie)return et;return et}function Rh(te){return Ah(te)?XK(te):A(te)}function Co(te){return Ah(te)?ZK(te):D(te)}function mO(te){for(var Ie=te.length;Ie--&&Zo.test(te.charAt(Ie)););return Ie}var QK=ni(ra);function XK(te){for(var Ie=Za.lastIndex=0;Za.test(te);)++Ie;return Ie}function ZK(te){return te.match(Za)||[]}function e8(te){return te.match(hv)||[]}var t8=(function te(Ie){Ie=Ie==null?hr:Ph.defaults(hr.Object(),Ie,Ph.pick(hr,hI));var _e=Ie.Array,et=Ie.Date,It=Ie.Error,mn=Ie.Function,Gr=Ie.Math,Bn=Ie.Object,_I=Ie.RegExp,n8=Ie.String,zi=Ie.TypeError,vv=_e.prototype,r8=mn.prototype,kh=Bn.prototype,bv=Ie["__c
106ore-js_shared__"],wv=r8.toString,Dn=kh.hasOwnProperty,s8=0,gO=(function(){var u=/[^.]+$/.exec(bv&&bv.keys&&bv.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""})(),Sv=kh.toString,i8=wv.call(Bn),o8=hr._,a8=_I("^"+wv.call(Dn).replace(er,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Tv=mv?Ie.Buffer:n,gl=Ie.Symbol,Ev=Ie.Uint8Array,_O=Tv?Tv.allocUnsafe:n,Iv=pO(Bn.getPrototypeOf,Bn),yO=Bn.create,vO=kh.propertyIsEnumerable,Cv=vv.splice,bO=gl?gl.isConcatSpreadable:n,Em=gl?gl.iterator:n,$u=gl?gl.toStringTag:n,Av=(function(){try{var u=Wu(Bn,"defineProperty");return u({},"",{}),u}catch{}})(),c8=Ie.clearTimeout!==hr.clearTimeout&&Ie.clearTimeout,l8=et&&et.now!==hr.Date.now&&et.now,u8=Ie.setTimeout!==hr.setTimeout&&Ie.setTimeout,Rv=Gr.ceil,Pv=Gr.floor,yI=Bn.getOwnPropertySymbols,d8=Tv?Tv.isBuffer:n,wO=Ie.isFinite,h8=vv.join,f8=pO(Bn.keys,Bn),Kr=Gr.max,ws=Gr.min,p8=et.now,m8=Ie.parseInt,SO=Gr.random,g8=vv.reverse,vI=Wu(Ie,"DataView"),Im=Wu(Ie,"Map"),bI=Wu(Ie,"Promise"),Nh=Wu(Ie,"Set"),Cm=Wu(Ie,"WeakMap"),Am=Wu(Bn,"create"),kv=Cm&&new Cm,Dh={},_8=Gu(vI),y8=Gu(Im),v8=Gu(bI),b8=Gu(Nh),w8=Gu(Cm),Nv=gl?gl.prototype:n,Rm=Nv?Nv.valueOf:n,TO=Nv?Nv.toString:n;function F(u){if(mr(u)&&!Pt(u)&&!(u instanceof Yt)){if(u instanceof Yi)return u;if(Dn.call(u,"__wrapped__"))return E1(u)}return new Yi(u)}var Oh=(function(){function u(){}return function(f){if(!or(f))return{};if(yO)return yO(f);u.prototype=f;var y=new u;return u.prototype=n,y}})();function Dv(){}function Yi(u,f){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=n}F.templateSettings={escape:We,evaluate:Rt,interpolate:Ir,variable:"",imports:{_:F}},F.prototype=Dv.prototype,F.prototype.constructor=F,Yi.prototype=Oh(Dv.prototype),Yi.prototype.constructor=Yi;function Yt(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=fe,this.__views__=[]}function S8(){var u=new Yt(this.__wrapped__);return u.__actions__=ri(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=ri(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=ri(this.__views__),u}function T8(){if(this.__filtered__){var u=new Yt(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}function E8(){var u=this.__wrapped__.value(),f=this.__dir__,y=Pt(u),C=f<0,x=y?u.length:0,$=Mz(0,x,this.__views__),W=$.start,Q=$.end,ne=Q-W,Pe=C?Q:W-1,ke=this.__iteratees__,Oe=ke.length,ze=0,it=ws(ne,this.__takeCount__);if(!y||!C&&x==ne&&it==ne)return KO(u,this.__actions__);var bt=[];e:for(;ne--&&ze<it;){Pe+=f;for(var Lt=-1,wt=u[Pe];++Lt<Oe;){var Ht=ke[Lt],Xt=Ht.iteratee,Ni=Ht.type,$s=Xt(wt);if(Ni==ie)wt=$s;else if(!$s){if(Ni==z)continue e;break e}}bt[ze++]=wt}return bt}Yt.prototype=Oh(Dv.prototype),Yt.prototype.constructor=Yt;function Uu(u){var f=-1,y=u==null?0:u.length;for(this.clear();++f<y;){var C=u[f];this.set(C[0],C[1])}}function I8(){this.__data__=Am?Am(null):{},this.size=0}function C8(u){var f=this.has(u)&&delete this.__data__[u];return this.size-=f?1:0,f}function A8(u){var f=this.__data__;if(Am){var y=f[u];return y===c?n:y}return Dn.call(f,u)?f[u]:n}function R8(u){var f=this.__data__;return Am?f[u]!==n:Dn.call(f,u)}function P8(u,f){var y=this.__data__;return this.size+=this.has(u)?0:1,y[u]=Am&&f===n?c:f,this}Uu.prototype.clear=I8,Uu.prototype.delete=C8,Uu.prototype.get=A8,Uu.prototype.has=R8,Uu.prototype.set=P8;function ec(u){var f=-1,y=u==null?0:u.length;for(this.clear();++f<y;){var C=u[f];this.set(C[0],C[1])}}function k8(){this.__data__=[],this.size=0}function N8(u){var f=this.__data__,y=Ov(f,u);if(y<0)return!1;var C=f.length-1;return y==C?f.pop():Cv.call(f,y,1),--this.size,!0}function D8(u){var f=this.__data__,y=Ov(f,u);return y<0?n:f[y][1]}function O8(u){return Ov(this.__data__,u)>-1}function x8(u,f){var y=this.__data__,C=Ov(y,u);return C<0?(++this.size,y.push([u,f])):y[C][1]=f,this}ec.prototype.clear=k8,ec.prototype.delete=N8,ec.prototype.get=D8,ec.prototype.has=O8,ec.prototype.set=x8;function tc(u){var f=-1,y=u==null?0:u.length;for(this.clear();++f<y;
vendor: 5,988 bytes, line 106
106){var C=u[f];this.set(C[0],C[1])}}function L8(){this.size=0,this.__data__={hash:new Uu,map:new(Im||ec),string:new Uu}}function M8(u){var f=Wv(this,u).delete(u);return this.size-=f?1:0,f}function V8(u){return Wv(this,u).get(u)}function F8(u){return Wv(this,u).has(u)}function B8(u,f){var y=Wv(this,u),C=y.size;return y.set(u,f),this.size+=y.size==C?0:1,this}tc.prototype.clear=L8,tc.prototype.delete=M8,tc.prototype.get=V8,tc.prototype.has=F8,tc.prototype.set=B8;function Hu(u){var f=-1,y=u==null?0:u.length;for(this.__data__=new tc;++f<y;)this.add(u[f])}function $8(u){return this.__data__.set(u,c),this}function U8(u){return this.__data__.has(u)}Hu.prototype.add=Hu.prototype.push=$8,Hu.prototype.has=U8;function Ao(u){var f=this.__data__=new ec(u);this.size=f.size}function H8(){this.__data__=new ec,this.size=0}function q8(u){var f=this.__data__,y=f.delete(u);return this.size=f.size,y}function j8(u){return this.__data__.get(u)}function W8(u){return this.__data__.has(u)}function G8(u,f){var y=this.__data__;if(y instanceof ec){var C=y.__data__;if(!Im||C.length<s-1)return C.push([u,f]),this.size=++y.size,this;y=this.__data__=new tc(C)}return y.set(u,f),this.size=y.size,this}Ao.prototype.clear=H8,Ao.prototype.delete=q8,Ao.prototype.get=j8,Ao.prototype.has=W8,Ao.prototype.set=G8;function EO(u,f){var y=Pt(u),C=!y&&Ku(u),x=!y&&!C&&wl(u),$=!y&&!C&&!x&&Vh(u),W=y||C||x||$,Q=W?pl(u.length,n8):[],ne=Q.length;for(var Pe in u)(f||Dn.call(u,Pe))&&!(W&&(Pe=="length"||x&&(Pe=="offset"||Pe=="parent")||$&&(Pe=="buffer"||Pe=="byteLength"||Pe=="byteOffset")||ic(Pe,ne)))&&Q.push(Pe);return Q}function IO(u){var f=u.length;return f?u[NI(0,f-1)]:n}function K8(u,f){return Gv(ri(u),qu(f,0,u.length))}function z8(u){return Gv(ri(u))}function wI(u,f,y){(y!==n&&!Ro(u[f],y)||y===n&&!(f in u))&&nc(u,f,y)}function Pm(u,f,y){var C=u[f];(!(Dn.call(u,f)&&Ro(C,y))||y===n&&!(f in u))&&nc(u,f,y)}function Ov(u,f){for(var y=u.length;y--;)if(Ro(u[y][0],f))return y;return-1}function Y8(u,f,y,C){return _l(u,function(x,$,W){f(C,x,y(x),W)}),C}function CO(u,f){return u&&aa(f,ts(f),u)}function J8(u,f){return u&&aa(f,ii(f),u)}function nc(u,f,y){f=="__proto__"&&Av?Av(u,f,{configurable:!0,enumerable:!0,value:y,writable:!0}):u[f]=y}function SI(u,f){for(var y=-1,C=f.length,x=_e(C),$=u==null;++y<C;)x[y]=$?n:n0(u,f[y]);return x}function qu(u,f,y){return u===u&&(y!==n&&(u=u<=y?u:y),f!==n&&(u=u>=f?u:f)),u}function Ji(u,f,y,C,x,$){var W,Q=f&h,ne=f&p,Pe=f&g;if(y&&(W=x?y(u,C,x,$):y(u)),W!==n)return W;if(!or(u))return u;var ke=Pt(u);if(ke){if(W=Fz(u),!Q)return ri(u,W)}else{var Oe=Ss(u),ze=Oe==ut||Oe==H;if(wl(u))return JO(u,Q);if(Oe==ge||Oe==Ce||ze&&!x){if(W=ne||ze?{}:m1(u),!Q)return ne?Az(u,J8(W,u)):Cz(u,CO(W,u))}else{if(!Nn[Oe])return x?u:{};W=Bz(u,Oe,Q)}}$||($=new Ao);var it=$.get(u);if(it)return it;$.set(u,W),j1(u)?u.forEach(function(wt){W.add(Ji(wt,f,y,wt,u,$))}):H1(u)&&u.forEach(function(wt,Ht){W.set(Ht,Ji(wt,f,y,Ht,u,$))});var bt=Pe?ne?HI:UI:ne?ii:ts,Lt=ke?n:bt(u);return Fr(Lt||u,function(wt,Ht){Lt&&(Ht=wt,wt=u[Ht]),Pm(W,Ht,Ji(wt,f,y,Ht,u,$))}),W}function Q8(u){var f=ts(u);return function(y){return AO(y,u,f)}}function AO(u,f,y){var C=y.length;if(u==null)return!C;for(u=Bn(u);C--;){var x=y[C],$=f[x],W=u[x];if(W===n&&!(x in u)||!$(W))return!1}return!0}function RO(u,f,y){if(typeof u!="function")throw new zi(o);return Mm(function(){u.apply(n,y)},f)}function km(u,f,y,C){var x=-1,$=Bu,W=!0,Q=u.length,ne=[],Pe=f.length;if(!Q)return ne;y&&(f=Ft(f,Ri(y))),C?($=hl,W=!1):f.length>=s&&($=Tm,W=!1,f=new Hu(f));e:for(;++x<Q;){var ke=u[x],Oe=y==null?ke:y(ke);if(ke=C||ke!==0?ke:0,W&&Oe===Oe){for(var ze=Pe;ze--;)if(f[ze]===Oe)continue e;ne.push(ke)}else $(f,Oe,C)||ne.push(ke)}return ne}var _l=t1(oa),PO=t1(EI,!0);function X8(u,f){var y=!0;return _l(u,function(C,x,$){return y=!!f(C,x,$),y}),y}function xv(u,f,y){for(var C=-1,x=u.length;++C<x;){var $=u[C],W=f($);if(W!=null&&(Q===n?W===W&&!ki(W):y(W,Q)))var Q=W,ne=$}return ne}function Z8(u,f,y,C){var x=u.length;for(y=Dt(y),y<0&&(y=-y>x?0:x+y),C=C===n||C>x?x:Dt(C),C<0&&(C+=x),C=y>C?0:G1(C);y<C;)u[y++]=f;return u}function kO(u,f){var y=[];return _l(u,function(C,x,$){f(C,x,$)&&y.push(C)}),y}function ms(u,f,y,C,x){var $=-1,W=u.length;for(y||(y=Uz),x||(x=[]);++$<W;){var Q=u[$];f>0&&y(Q)?f>1?ms(Q,f-1,y,C,x):Io(x,Q):C||(x[x.length]=Q)}return x}var TI=n1(),NO=n1(!0);function oa(u,f){return u&&TI(u,f,ts)}function EI(u,f){return u&&NO(u,f,ts)}function Lv(u,f){return Eo(f,function(y){return oc(u[y])})}function ju(u,f){f=vl(f,u);for(var y=0,C=f.length;u!=null&&y<C;)u=u[ca(f[y++])];return y&&y==C?u:n}function DO(u,f,y){var C=f(u);return Pt(u)?C:Io(C,y(u))}function Fs(u){return u==null?u===n?X:Re:$u&&$u in Bn(u)?Lz(u):zz(u)}function II(u,f){return u>f}function ez(u,f){return u!=null&&Dn.call(u,f)}function tz(u,f){return u!=null&&f in Bn(u)}function nz(u,f,y){return u>=ws(f,y)&&u<Kr(f,y)}function CI(u,f,y){for(var C=y?hl:Bu,x=u[0].length,$=u.length,W=$,Q=_e($),ne=1/0,Pe=[];W--;){var ke=u[W];W&&f&&(ke=Ft(ke,Ri(f))),ne=ws(ke.length,ne),Q[W]=!y&&(f||x>=120&&ke.length>=120)?new Hu(W&&ke):n}ke=u[0];var Oe=-1,ze=Q[0];e:for(;++Oe<x&&Pe.length<ne;){var it=ke[Oe],bt=f?f(it):it;if(it=y||it!==0?it:0,!(ze?Tm(ze,bt):C(Pe,bt,y))){for(W=$;--W;){var Lt=Q[W];if(!(Lt?Tm(Lt,bt):C(u[W],bt,y)))continue e}ze&&ze.push(bt),Pe.push(it)}}return Pe}function rz(u,f,y,C){return oa(u,function(x,$,W){f(C,y(x),$,W)}),C}function Nm(u,f,y){f=vl(f,u),u=v1(u,f);var C=u==null?u:u[ca(Xi(f))];return C==null?n:bs(C,u,y)}function OO(u){return mr(u)&&Fs(u)==Ce}function sz(u){return mr(u)&&Fs(u)==Ye}function iz(u){return mr(u)&&Fs(u)==Ee}function Dm(u,f,y,C,x){return u===f?!0:u==null||f==null||!mr(u)&&!mr(f)?u!==u&&f!==f:oz(u,f,y,C,Dm,x)}function oz(u,f,y,C,x,$){var W=Pt(u),Q=Pt(f),ne=W?Ve:Ss(u),Pe=Q?Ve:Ss(f);ne=ne==Ce?ge:ne,Pe=Pe==Ce?ge:Pe;var ke=ne==ge,Oe=Pe==ge,ze=ne==Pe;if(ze&&wl(u)){if(!wl(f))return!1;W=!0,ke=!1}if(ze&&!ke)return $||($=new Ao),W||Vh(u)?h1(u,f,y,C,x,$):Oz(u,f,ne,y,C,x,$);if(!(y&_)){var it=ke&&Dn.call(u,"__wrapped__"),bt=Oe&&Dn.call(f,"__wrapped__");
vendor: 5,200 bytes, line 106
106if(it||bt){var Lt=it?u.value():u,wt=bt?f.value():f;return $||($=new Ao),x(Lt,wt,y,C,$)}}return ze?($||($=new Ao),xz(u,f,y,C,x,$)):!1}function az(u){return mr(u)&&Ss(u)==j}function AI(u,f,y,C){var x=y.length,$=x,W=!C;if(u==null)return!$;for(u=Bn(u);x--;){var Q=y[x];if(W&&Q[2]?Q[1]!==u[Q[0]]:!(Q[0]in u))return!1}for(;++x<$;){Q=y[x];var ne=Q[0],Pe=u[ne],ke=Q[1];if(W&&Q[2]){if(Pe===n&&!(ne in u))return!1}else{var Oe=new Ao;if(C)var ze=C(Pe,ke,ne,u,f,Oe);if(!(ze===n?Dm(ke,Pe,_|v,C,Oe):ze))return!1}}return!0}function xO(u){if(!or(u)||qz(u))return!1;var f=oc(u)?a8:oI;return f.test(Gu(u))}function cz(u){return mr(u)&&Fs(u)==J}function lz(u){return mr(u)&&Ss(u)==se}function uz(u){return mr(u)&&Xv(u.length)&&!!Vn[Fs(u)]}function LO(u){return typeof u=="function"?u:u==null?oi:typeof u=="object"?Pt(u)?FO(u[0],u[1]):VO(u):rx(u)}function RI(u){if(!Lm(u))return f8(u);var f=[];for(var y in Bn(u))Dn.call(u,y)&&y!="constructor"&&f.push(y);return f}function dz(u){if(!or(u))return Kz(u);var f=Lm(u),y=[];for(var C in u)C=="constructor"&&(f||!Dn.call(u,C))||y.push(C);return y}function PI(u,f){return u<f}function MO(u,f){var y=-1,C=si(u)?_e(u.length):[];return _l(u,function(x,$,W){C[++y]=f(x,$,W)}),C}function VO(u){var f=jI(u);return f.length==1&&f[0][2]?_1(f[0][0],f[0][1]):function(y){return y===u||AI(y,u,f)}}function FO(u,f){return GI(u)&&g1(f)?_1(ca(u),f):function(y){var C=n0(y,u);return C===n&&C===f?r0(y,u):Dm(f,C,_|v)}}function Mv(u,f,y,C,x){u!==f&&TI(f,function($,W){if(x||(x=new Ao),or($))hz(u,f,W,y,Mv,C,x);else{var Q=C?C(zI(u,W),$,W+"",u,f,x):n;Q===n&&(Q=$),wI(u,W,Q)}},ii)}function hz(u,f,y,C,x,$,W){var Q=zI(u,y),ne=zI(f,y),Pe=W.get(ne);if(Pe){wI(u,y,Pe);return}var ke=$?$(Q,ne,y+"",u,f,W):n,Oe=ke===n;if(Oe){var ze=Pt(ne),it=!ze&&wl(ne),bt=!ze&&!it&&Vh(ne);ke=ne,ze||it||bt?Pt(Q)?ke=Q:Cr(Q)?ke=ri(Q):it?(Oe=!1,ke=JO(ne,!0)):bt?(Oe=!1,ke=QO(ne,!0)):ke=[]:Vm(ne)||Ku(ne)?(ke=Q,Ku(Q)?ke=K1(Q):(!or(Q)||oc(Q))&&(ke=m1(ne))):Oe=!1}Oe&&(W.set(ne,ke),x(ke,ne,C,$,W),W.delete(ne)),wI(u,y,ke)}function BO(u,f){var y=u.length;if(y)return f+=f<0?y:0,ic(f,y)?u[f]:n}function $O(u,f,y){f.length?f=Ft(f,function($){return Pt($)?function(W){return ju(W,$.length===1?$[0]:$)}:$}):f=[oi];var C=-1;f=Ft(f,Ri(_t()));var x=MO(u,function($,W,Q){var ne=Ft(f,function(Pe){return Pe($)});return{criteria:ne,index:++C,value:$}});return ia(x,function($,W){return Iz($,W,y)})}function fz(u,f){return UO(u,f,function(y,C){return r0(u,C)})}function UO(u,f,y){for(var C=-1,x=f.length,$={};++C<x;){var W=f[C],Q=ju(u,W);y(Q,W)&&Om($,vl(W,u),Q)}return $}function pz(u){return function(f){return ju(f,u)}}function kI(u,f,y,C){var x=C?kt:He,$=-1,W=f.length,Q=u;for(u===f&&(f=ri(f)),y&&(Q=Ft(u,Ri(y)));++$<W;)for(var ne=0,Pe=f[$],ke=y?y(Pe):Pe;(ne=x(Q,ke,ne,C))>-1;)Q!==u&&Cv.call(Q,ne,1),Cv.call(u,ne,1);return u}function HO(u,f){for(var y=u?f.length:0,C=y-1;y--;){var x=f[y];if(y==C||x!==$){var $=x;ic(x)?Cv.call(u,x,1):xI(u,x)}}return u}function NI(u,f){return u+Pv(SO()*(f-u+1))}function mz(u,f,y,C){for(var x=-1,$=Kr(Rv((f-u)/(y||1)),0),W=_e($);$--;)W[C?$:++x]=u,u+=y;return W}function DI(u,f){var y="";if(!u||f<1||f>G)return y;do f%2&&(y+=u),f=Pv(f/2),f&&(u+=u);while(f);return y}function Mt(u,f){return YI(y1(u,f,oi),u+"")}function gz(u){return IO(Fh(u))}function _z(u,f){var y=Fh(u);return Gv(y,qu(f,0,y.length))}function Om(u,f,y,C){if(!or(u))return u;f=vl(f,u);for(var x=-1,$=f.length,W=$-1,Q=u;Q!=null&&++x<$;){var ne=ca(f[x]),Pe=y;if(ne==="__proto__"||ne==="constructor"||ne==="prototype")return u;if(x!=W){var ke=Q[ne];Pe=C?C(ke,ne,Q):n,Pe===n&&(Pe=or(ke)?ke:ic(f[x+1])?[]:{})}Pm(Q,ne,Pe),Q=Q[ne]}return u}var qO=kv?function(u,f){return kv.set(u,f),u}:oi,yz=Av?function(u,f){return Av(u,"toString",{configurable:!0,enumerable:!1,value:i0(f),writable:!0})}:oi;function vz(u){return Gv(Fh(u))}function Qi(u,f,y){var C=-1,x=u.length;f<0&&(f=-f>x?0:x+f),y=y>x?x:y,y<0&&(y+=x),x=f>y?0:y-f>>>0,f>>>=0;for(var $=_e(x);++C<x;)$[C]=u[C+f];return $}function bz(u,f){var y;return _l(u,function(C,x,$){return y=f(C,x,$),!y}),!!y}function Vv(u,f,y){var C=0,x=u==null?C:u.length;if(typeof f=="number"&&f===f&&x<=Te){for(;C<x;){var $=C+x>>>1,W=u[$];W!==null&&!ki(W)&&(y?W<=f:W<f)?C=$+1:x=$}return x}return OI(u,f,oi,y)}function OI(u,f,y,C){var x=0,$=u==null?0:u.length;if($===0)return 0;f=y(f);for(var W=f!==f,Q=f===null,ne=ki(f),Pe=f===n;x<$;){var ke=Pv((x+$)/2),Oe=y(u[ke]),ze=Oe!==n,it=Oe===null,bt=Oe===Oe,Lt=ki(Oe);if(W)var wt=C||bt;else Pe?wt=bt&&(C||ze):Q?wt=bt&&ze&&(C||!it):ne?wt=bt&&ze&&!it&&(C||!Lt):it||Lt?wt=!1:wt=C?Oe<=f:Oe<f;wt?x=ke+1:$=ke}return ws($,ee)}function jO(u,f){for(var y=-1,C=u.length,x=0,$=[];++y<C;){var W=u[y],Q=f?f(W):W;if(!y||!Ro(Q,ne)){var ne=Q;$[x++]=W===0?0:W}}return $}function WO(u){return typeof u=="number"?u:ki(u)?de:+u}function Pi(u){if(typeof u=="string")return u;if(Pt(u))return Ft(u,Pi)+"";if(ki(u))return TO?TO.call(u):"";var f=u+"";return f=="0"&&1/u==-ce?"-0":f}function yl(u,f,y){var C=-1,x=Bu,$=u.length,W=!0,Q=[],ne=Q;if(y)W=!1,x=hl;else if($>=s){var Pe=f?null:Nz(u);if(Pe)return yv(Pe);W=!1,x=Tm,ne=new Hu}else ne=f?[]:Q;e:for(;++C<$;){var ke=u[C],Oe=f?f(ke):ke;if(ke=y||ke!==0?ke:0,W&&Oe===Oe){for(var ze=ne.length;ze--;)if(ne[ze]===Oe)continue e;f&&ne.push(Oe),Q.push(ke)}
vendor: 4,253 bytes, line 106
106else x(ne,Oe,y)||(ne!==Q&&ne.push(Oe),Q.push(ke))}return Q}function xI(u,f){return f=vl(f,u),u=v1(u,f),u==null||delete u[ca(Xi(f))]}function GO(u,f,y,C){return Om(u,f,y(ju(u,f)),C)}function Fv(u,f,y,C){for(var x=u.length,$=C?x:-1;(C?$--:++$<x)&&f(u[$],$,u););return y?Qi(u,C?0:$,C?$+1:x):Qi(u,C?$+1:0,C?x:$)}function KO(u,f){var y=u;return y instanceof Yt&&(y=y.value()),Ch(f,function(C,x){return x.func.apply(x.thisArg,Io([C],x.args))},y)}function LI(u,f,y){var C=u.length;if(C<2)return C?yl(u[0]):[];for(var x=-1,$=_e(C);++x<C;)for(var W=u[x],Q=-1;++Q<C;)Q!=x&&($[x]=km($[x]||W,u[Q],f,y));return yl(ms($,1),f,y)}function zO(u,f,y){for(var C=-1,x=u.length,$=f.length,W={};++C<x;){var Q=C<$?f[C]:n;y(W,u[C],Q)}return W}function MI(u){return Cr(u)?u:[]}function VI(u){return typeof u=="function"?u:oi}function vl(u,f){return Pt(u)?u:GI(u,f)?[u]:T1(Tn(u))}var wz=Mt;function bl(u,f,y){var C=u.length;return y=y===n?C:y,!f&&y>=C?u:Qi(u,f,y)}var YO=c8||function(u){return hr.clearTimeout(u)};function JO(u,f){if(f)return u.slice();var y=u.length,C=_O?_O(y):new u.constructor(y);return u.copy(C),C}function FI(u){var f=new u.constructor(u.byteLength);return new Ev(f).set(new Ev(u)),f}function Sz(u,f){var y=f?FI(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.byteLength)}function Tz(u){var f=new u.constructor(u.source,rm.exec(u));return f.lastIndex=u.lastIndex,f}function Ez(u){return Rm?Bn(Rm.call(u)):{}}function QO(u,f){var y=f?FI(u.buffer):u.buffer;return new u.constructor(y,u.byteOffset,u.length)}function XO(u,f){if(u!==f){var y=u!==n,C=u===null,x=u===u,$=ki(u),W=f!==n,Q=f===null,ne=f===f,Pe=ki(f);if(!Q&&!Pe&&!$&&u>f||$&&W&&ne&&!Q&&!Pe||C&&W&&ne||!y&&ne||!x)return 1;if(!C&&!$&&!Pe&&u<f||Pe&&y&&x&&!C&&!$||Q&&y&&x||!W&&x||!ne)return-1}return 0}function Iz(u,f,y){for(var C=-1,x=u.criteria,$=f.criteria,W=x.length,Q=y.length;++C<W;){var ne=XO(x[C],$[C]);if(ne){if(C>=Q)return ne;var Pe=y[C];return ne*(Pe=="desc"?-1:1)}}return u.index-f.index}function ZO(u,f,y,C){for(var x=-1,$=u.length,W=y.length,Q=-1,ne=f.length,Pe=Kr($-W,0),ke=_e(ne+Pe),Oe=!C;++Q<ne;)ke[Q]=f[Q];for(;++x<W;)(Oe||x<$)&&(ke[y[x]]=u[x]);for(;Pe--;)ke[Q++]=u[x++];return ke}function e1(u,f,y,C){for(var x=-1,$=u.length,W=-1,Q=y.length,ne=-1,Pe=f.length,ke=Kr($-Q,0),Oe=_e(ke+Pe),ze=!C;++x<ke;)Oe[x]=u[x];for(var it=x;++ne<Pe;)Oe[it+ne]=f[ne];for(;++W<Q;)(ze||x<$)&&(Oe[it+y[W]]=u[x++]);return Oe}function ri(u,f){var y=-1,C=u.length;for(f||(f=_e(C));++y<C;)f[y]=u[y];return f}function aa(u,f,y,C){var x=!y;y||(y={});for(var $=-1,W=f.length;++$<W;){var Q=f[$],ne=C?C(y[Q],u[Q],Q,y,u):n;ne===n&&(ne=u[Q]),x?nc(y,Q,ne):Pm(y,Q,ne)}return y}function Cz(u,f){return aa(u,WI(u),f)}function Az(u,f){return aa(u,f1(u),f)}function Bv(u,f){return function(y,C){var x=Pt(y)?gv:Y8,$=f?f():{};return x(y,u,_t(C,2),$)}}function xh(u){return Mt(function(f,y){var C=-1,x=y.length,$=x>1?y[x-1]:n,W=x>2?y[2]:n;for($=u.length>3&&typeof $=="function"?(x--,$):n,W&&Bs(y[0],y[1],W)&&($=x<3?n:$,x=1),f=Bn(f);++C<x;){var Q=y[C];Q&&u(f,Q,C,$)}return f})}function t1(u,f){return function(y,C){if(y==null)return y;if(!si(y))return u(y,C);for(var x=y.length,$=f?x:-1,W=Bn(y);(f?$--:++$<x)&&C(W[$],$,W)!==!1;);return y}}function n1(u){return function(f,y,C){for(var x=-1,$=Bn(f),W=C(f),Q=W.length;Q--;){var ne=W[u?Q:++x];if(y($[ne],ne,$)===!1)break}return f}}function Rz(u,f,y){var C=f&b,x=xm(u);function $(){var W=this&&this!==hr&&this instanceof $?x:u;return W.apply(C?y:this,arguments)}return $}function r1(u){return function(f){f=Tn(f);var y=Ah(f)?Co(f):n,C=y?y[0]:f.charAt(0),x=y?bl(y,1).join(""):f.slice(1);return C[u]()+x}}function Lh(u){return function(f){return Ch(tx(ex(f).replace(dv,"")),u,"")}}function xm(u){return function(){var f=arguments;switch(f.length){case 0:return new u;case 1:return new u(f[0]);case 2:return new u(f[0],f[1]);case 3:return new u(f[0],f[1],f[2]);case 4:return new u(f[0],f[1],f[2],f[3]);case 5:return new u(f[0],f[1],f[2],f[3],f[4]);case 6:return new u(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new u(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var y=Oh(u.prototype),C=u.apply(y,f);return or(C)?C:y}}function Pz(u,f,y){var C=xm(u);function x(){for(var $=arguments.length,W=_e($),Q=$,ne=Mh(x);Q--;)W[Q]=arguments[Q];var Pe=$<3&&W[0]!==ne&&W[$-1]!==ne?[]:ml(W,ne);
vendor: 4,998 bytes, line 106
106if($-=Pe.length,$<y)return c1(u,f,$v,x.placeholder,n,W,Pe,n,n,y-$);var ke=this&&this!==hr&&this instanceof x?C:u;return bs(ke,this,W)}return x}function s1(u){return function(f,y,C){var x=Bn(f);if(!si(f)){var $=_t(y,3);f=ts(f),y=function(Q){return $(x[Q],Q,x)}}var W=u(f,y,C);return W>-1?x[$?f[W]:W]:n}}function i1(u){return sc(function(f){var y=f.length,C=y,x=Yi.prototype.thru;for(u&&f.reverse();C--;){var $=f[C];if(typeof $!="function")throw new zi(o);if(x&&!W&&jv($)=="wrapper")var W=new Yi([],!0)}for(C=W?C:y;++C<y;){$=f[C];var Q=jv($),ne=Q=="wrapper"?qI($):n;ne&&KI(ne[0])&&ne[1]==(S|T|N|I)&&!ne[4].length&&ne[9]==1?W=W[jv(ne[0])].apply(W,ne[3]):W=$.length==1&&KI($)?W[Q]():W.thru($)}return function(){var Pe=arguments,ke=Pe[0];if(W&&Pe.length==1&&Pt(ke))return W.plant(ke).value();for(var Oe=0,ze=y?f[Oe].apply(this,Pe):ke;++Oe<y;)ze=f[Oe].call(this,ze);return ze}})}function $v(u,f,y,C,x,$,W,Q,ne,Pe){var ke=f&S,Oe=f&b,ze=f&w,it=f&(T|R),bt=f&P,Lt=ze?n:xm(u);function wt(){for(var Ht=arguments.length,Xt=_e(Ht),Ni=Ht;Ni--;)Xt[Ni]=arguments[Ni];if(it)var $s=Mh(wt),Di=UK(Xt,$s);if(C&&(Xt=ZO(Xt,C,x,it)),$&&(Xt=e1(Xt,$,W,it)),Ht-=Di,it&&Ht<Pe){var Ar=ml(Xt,$s);return c1(u,f,$v,wt.placeholder,y,Xt,Ar,Q,ne,Pe-Ht)}var Po=Oe?y:this,cc=ze?Po[u]:u;return Ht=Xt.length,Q?Xt=Yz(Xt,Q):bt&&Ht>1&&Xt.reverse(),ke&&ne<Ht&&(Xt.length=ne),this&&this!==hr&&this instanceof wt&&(cc=Lt||xm(cc)),cc.apply(Po,Xt)}return wt}function o1(u,f){return function(y,C){return rz(y,u,f(C),{})}}function Uv(u,f){return function(y,C){var x;if(y===n&&C===n)return f;if(y!==n&&(x=y),C!==n){if(x===n)return C;typeof y=="string"||typeof C=="string"?(y=Pi(y),C=Pi(C)):(y=WO(y),C=WO(C)),x=u(y,C)}return x}}function BI(u){return sc(function(f){return f=Ft(f,Ri(_t())),Mt(function(y){var C=this;return u(f,function(x){return bs(x,C,y)})})})}function Hv(u,f){f=f===n?" ":Pi(f);var y=f.length;if(y<2)return y?DI(f,u):f;var C=DI(f,Rv(u/Rh(f)));return Ah(f)?bl(Co(C),0,u).join(""):C.slice(0,u)}function kz(u,f,y,C){var x=f&b,$=xm(u);function W(){for(var Q=-1,ne=arguments.length,Pe=-1,ke=C.length,Oe=_e(ke+ne),ze=this&&this!==hr&&this instanceof W?$:u;++Pe<ke;)Oe[Pe]=C[Pe];for(;ne--;)Oe[Pe++]=arguments[++Q];return bs(ze,x?y:this,Oe)}return W}function a1(u){return function(f,y,C){return C&&typeof C!="number"&&Bs(f,y,C)&&(y=C=n),f=ac(f),y===n?(y=f,f=0):y=ac(y),C=C===n?f<y?1:-1:ac(C),mz(f,y,C,u)}}function qv(u){return function(f,y){return typeof f=="string"&&typeof y=="string"||(f=Zi(f),y=Zi(y)),u(f,y)}}function c1(u,f,y,C,x,$,W,Q,ne,Pe){var ke=f&T,Oe=ke?W:n,ze=ke?n:W,it=ke?$:n,bt=ke?n:$;f|=ke?N:O,f&=~(ke?O:N),f&E||(f&=-4);var Lt=[u,f,x,it,Oe,bt,ze,Q,ne,Pe],wt=y.apply(n,Lt);return KI(u)&&b1(wt,Lt),wt.placeholder=C,w1(wt,u,f)}function $I(u){var f=Gr[u];return function(y,C){if(y=Zi(y),C=C==null?0:ws(Dt(C),292),C&&wO(y)){var x=(Tn(y)+"e").split("e"),$=f(x[0]+"e"+(+x[1]+C));return x=(Tn($)+"e").split("e"),+(x[0]+"e"+(+x[1]-C))}return f(y)}}var Nz=Nh&&1/yv(new Nh([,-0]))[1]==ce?function(u){return new Nh(u)}:c0;function l1(u){return function(f){var y=Ss(f);return y==j?gI(f):y==se?zK(f):Sm(f,u(f))}}function rc(u,f,y,C,x,$,W,Q){var ne=f&w;if(!ne&&typeof u!="function")throw new zi(o);var Pe=C?C.length:0;if(Pe||(f&=-97,C=x=n),W=W===n?W:Kr(Dt(W),0),Q=Q===n?Q:Dt(Q),Pe-=x?x.length:0,f&O){var ke=C,Oe=x;C=x=n}var ze=ne?n:qI(u),it=[u,f,y,C,x,ke,Oe,$,W,Q];if(ze&&Gz(it,ze),u=it[0],f=it[1],y=it[2],C=it[3],x=it[4],Q=it[9]=it[9]===n?ne?0:u.length:Kr(it[9]-Pe,0),!Q&&f&(T|R)&&(f&=-25),!f||f==b)var bt=Rz(u,f,y);else f==T||f==R?bt=Pz(u,f,Q):(f==N||f==(b|N))&&!x.length?bt=kz(u,f,y,C):bt=$v.apply(n,it);var Lt=ze?qO:b1;return w1(Lt(bt,it),u,f)}function u1(u,f,y,C){return u===n||Ro(u,kh[y])&&!Dn.call(C,y)?f:u}function d1(u,f,y,C,x,$){return or(u)&&or(f)&&($.set(f,u),Mv(u,f,n,d1,$),$.delete(f)),u}function Dz(u){return Vm(u)?n:u}function h1(u,f,y,C,x,$){var W=y&_,Q=u.length,ne=f.length;if(Q!=ne&&!(W&&ne>Q))return!1;var Pe=$.get(u),ke=$.get(f);if(Pe&&ke)return Pe==f&&ke==u;var Oe=-1,ze=!0,it=y&v?new Hu:n;for($.set(u,f),$.set(f,u);++Oe<Q;){var bt=u[Oe],Lt=f[Oe];if(C)var wt=W?C(Lt,bt,Oe,f,u,$):C(bt,Lt,Oe,u,f,$);if(wt!==n){if(wt)continue;ze=!1;break}if(it){if(!m(f,function(Ht,Xt){if(!Tm(it,Xt)&&(bt===Ht||x(bt,Ht,y,C,$)))return it.push(Xt)})){ze=!1;break}}else if(!(bt===Lt||x(bt,Lt,y,C,$))){ze=!1;break}}return $.delete(u),$.delete(f),ze}function Oz(u,f,y,C,x,$,W){switch(y){case vt:if(u.byteLength!=f.byteLength||u.byteOffset!=f.byteOffset)return!1;u=u.buffer,f=f.buffer;case Ye:return!(u.byteLength!=f.byteLength||!$(new Ev(u),new Ev(f)));case ve:case Ee:case re:return Ro(+u,+f);case Ke:return u.name==f.name&&u.message==f.message;case J:case be:return u==f+"";case j:var Q=gI;case se:var ne=C&_;if(Q||(Q=yv),u.size!=f.size&&!ne)return!1;var Pe=W.get(u);if(Pe)return Pe==f;C|=v,W.set(u,f);var ke=h1(Q(u),Q(f),C,x,$,W);return W.delete(u),ke;case xe:if(Rm)return Rm.call(u)==Rm.call(f)}return!1}function xz(u,f,y,C,x,$){var W=y&_,Q=UI(u),ne=Q.length,Pe=UI(f),ke=Pe.length;if(ne!=ke&&!W)return!1;for(var Oe=ne;Oe--;){var ze=Q[Oe];
vendor: 6,080 bytes, lines 106-108
106if(!(W?ze in f:Dn.call(f,ze)))return!1}var it=$.get(u),bt=$.get(f);if(it&&bt)return it==f&&bt==u;var Lt=!0;$.set(u,f),$.set(f,u);for(var wt=W;++Oe<ne;){ze=Q[Oe];var Ht=u[ze],Xt=f[ze];if(C)var Ni=W?C(Xt,Ht,ze,f,u,$):C(Ht,Xt,ze,u,f,$);if(!(Ni===n?Ht===Xt||x(Ht,Xt,y,C,$):Ni)){Lt=!1;break}wt||(wt=ze=="constructor")}if(Lt&&!wt){var $s=u.constructor,Di=f.constructor;$s!=Di&&"constructor"in u&&"constructor"in f&&!(typeof $s=="function"&&$s instanceof $s&&typeof Di=="function"&&Di instanceof Di)&&(Lt=!1)}return $.delete(u),$.delete(f),Lt}function sc(u){return YI(y1(u,n,A1),u+"")}function UI(u){return DO(u,ts,WI)}function HI(u){return DO(u,ii,f1)}var qI=kv?function(u){return kv.get(u)}:c0;function jv(u){for(var f=u.name+"",y=Dh[f],C=Dn.call(Dh,f)?y.length:0;C--;){var x=y[C],$=x.func;if($==null||$==u)return x.name}return f}function Mh(u){var f=Dn.call(F,"placeholder")?F:u;return f.placeholder}function _t(){var u=F.iteratee||o0;return u=u===o0?LO:u,arguments.length?u(arguments[0],arguments[1]):u}function Wv(u,f){var y=u.__data__;return Hz(f)?y[typeof f=="string"?"string":"hash"]:y.map}function jI(u){for(var f=ts(u),y=f.length;y--;){var C=f[y],x=u[C];f[y]=[C,x,g1(x)]}return f}function Wu(u,f){var y=WK(u,f);return xO(y)?y:n}function Lz(u){var f=Dn.call(u,$u),y=u[$u];try{u[$u]=n;var C=!0}catch{}var x=Sv.call(u);return C&&(f?u[$u]=y:delete u[$u]),x}var WI=yI?function(u){return u==null?[]:(u=Bn(u),Eo(yI(u),function(f){return vO.call(u,f)}))}:l0,f1=yI?function(u){for(var f=[];u;)Io(f,WI(u)),u=Iv(u);return f}:l0,Ss=Fs;(vI&&Ss(new vI(new ArrayBuffer(1)))!=vt||Im&&Ss(new Im)!=j||bI&&Ss(bI.resolve())!=B||Nh&&Ss(new Nh)!=se||Cm&&Ss(new Cm)!=le)&&(Ss=function(u){var f=Fs(u),y=f==ge?u.constructor:n,C=y?Gu(y):"";if(C)switch(C){case _8:return vt;case y8:return j;case v8:return B;case b8:return se;case w8:return le}return f});function Mz(u,f,y){for(var C=-1,x=y.length;++C<x;){var $=y[C],W=$.size;switch($.type){case"drop":u+=W;break;case"dropRight":f-=W;break;case"take":f=ws(f,u+W);break;case"takeRight":u=Kr(u,f-W);break}}return{start:u,end:f}}function Vz(u){var f=u.match(tm);return f?f[1].split(Wi):[]}function p1(u,f,y){f=vl(f,u);for(var C=-1,x=f.length,$=!1;++C<x;){var W=ca(f[C]);if(!($=u!=null&&y(u,W)))break;u=u[W]}return $||++C!=x?$:(x=u==null?0:u.length,!!x&&Xv(x)&&ic(W,x)&&(Pt(u)||Ku(u)))}function Fz(u){var f=u.length,y=new u.constructor(f);return f&&typeof u[0]=="string"&&Dn.call(u,"index")&&(y.index=u.index,y.input=u.input),y}function m1(u){return typeof u.constructor=="function"&&!Lm(u)?Oh(Iv(u)):{}}function Bz(u,f,y){var C=u.constructor;switch(f){case Ye:return FI(u);case ve:case Ee:return new C(+u);case vt:return Sz(u,y);case oe:case ye:case Fe:case ot:case dt:case Vr:case jn:case kn:case Tr:return QO(u,y);case j:return new C;case re:case be:return new C(u);case J:return Tz(u);case se:return new C;case xe:return Ez(u)}}function $z(u,f){var y=f.length;if(!y)return u;var C=y-1;return f[C]=(y>1?"& ":"")+f[C],f=f.join(y>2?", ":" "),u.replace(Ka,`{ 107/* [wrapped with `+f+`] */ 108`)}function Uz(u){return Pt(u)||Ku(u)||!!(bO&&u&&u[bO])}function ic(u,f){var y=typeof u;return f=f??G,!!f&&(y=="number"||y!="symbol"&&ev.test(u))&&u>-1&&u%1==0&&u<f}function Bs(u,f,y){if(!or(y))return!1;var C=typeof f;return(C=="number"?si(y)&&ic(f,y.length):C=="string"&&f in y)?Ro(y[f],u):!1}function GI(u,f){if(Pt(u))return!1;var y=typeof u;return y=="number"||y=="symbol"||y=="boolean"||u==null||ki(u)?!0:Ci.test(u)||!pn.test(u)||f!=null&&u in Bn(f)}function Hz(u){var f=typeof u;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?u!=="__proto__":u===null}function KI(u){var f=jv(u),y=F[f];if(typeof y!="function"||!(f in Yt.prototype))return!1;if(u===y)return!0;var C=qI(y);return!!C&&u===C[0]}function qz(u){return!!gO&&gO in u}var jz=bv?oc:u0;function Lm(u){var f=u&&u.constructor,y=typeof f=="function"&&f.prototype||kh;return u===y}function g1(u){return u===u&&!or(u)}function _1(u,f){return function(y){return y==null?!1:y[u]===f&&(f!==n||u in Bn(y))}}function Wz(u){var f=Jv(u,function(C){return y.size===l&&y.clear(),C}),y=f.cache;return f}function Gz(u,f){var y=u[1],C=f[1],x=y|C,$=x<(b|w|S),W=C==S&&y==T||C==S&&y==I&&u[7].length<=f[8]||C==(S|I)&&f[7].length<=f[8]&&y==T;if(!($||W))return u;C&b&&(u[2]=f[2],x|=y&b?0:E);var Q=f[3];if(Q){var ne=u[3];u[3]=ne?ZO(ne,Q,f[4]):Q,u[4]=ne?ml(u[3],d):f[4]}return Q=f[5],Q&&(ne=u[5],u[5]=ne?e1(ne,Q,f[6]):Q,u[6]=ne?ml(u[5],d):f[6]),Q=f[7],Q&&(u[7]=Q),C&S&&(u[8]=u[8]==null?f[8]:ws(u[8],f[8])),u[9]==null&&(u[9]=f[9]),u[0]=f[0],u[1]=x,u}function Kz(u){var f=[];if(u!=null)for(var y in Bn(u))f.push(y);return f}function zz(u){return Sv.call(u)}function y1(u,f,y){return f=Kr(f===n?u.length-1:f,0),function(){for(var C=arguments,x=-1,$=Kr(C.length-f,0),W=_e($);++x<$;)W[x]=C[f+x];x=-1;for(var Q=_e(f+1);++x<f;)Q[x]=C[x];return Q[f]=y(W),bs(u,this,Q)}}function v1(u,f){return f.length<2?u:ju(u,Qi(f,0,-1))}function Yz(u,f){for(var y=u.length,C=ws(f.length,y),x=ri(u);C--;){var $=f[C];u[C]=ic($,y)?x[$]:n}return u}function zI(u,f){if(!(f==="constructor"&&typeof u[f]=="function")&&f!="__proto__")return u[f]}var b1=S1(qO),Mm=u8||function(u,f){return hr.setTimeout(u,f)},YI=S1(yz);function w1(u,f,y){var C=f+"";return YI(u,$z(C,Jz(Vz(C),y)))}function S1(u){var f=0,y=0;return function(){var C=p8(),x=V-(C-y);if(y=C,x>0){if(++f>=M)return arguments[0]}else f=0;return u.apply(n,arguments)}}function Gv(u,f){var y=-1,C=u.length,x=C-1;for(f=f===n?C:f;++y<f;){var $=NI(y,x),W=u[$];u[$]=u[y],u[y]=W}return u.length=f,u}var T1=Wz(function(u){var f=[];return u.charCodeAt(0)===46&&f.push(""),u.replace(Xo,function(y,C,x,$){f.push(x?$.replace(xu,"$1"):C||y)}),f});function ca(u){if(typeof u=="string"||ki(u))return u;var f=u+"";return f=="0"&&1/u==-ce?"-0":f}function Gu(u){if(u!=null){try{return wv.call(u)}catch{}try{return u+""}catch{}}return""}function Jz(u,f){return Fr(pe,function(y){var C="_."+y[0];f&y[1]&&!Bu(u,C)&&u.push(C)}),u.sort()}function E1(u){if(u instanceof Yt)return u.clone();var f=new Yi(u.__wrapped__,u.__chain__);return f.__actions__=ri(u.__actions__),f.__index__=u.__index__,f.__values__=u.__values__,f}
vendor: 9,277 bytes, line 108
108function Qz(u,f,y){(y?Bs(u,f,y):f===n)?f=1:f=Kr(Dt(f),0);var C=u==null?0:u.length;if(!C||f<1)return[];for(var x=0,$=0,W=_e(Rv(C/f));x<C;)W[$++]=Qi(u,x,x+=f);return W}function Xz(u){for(var f=-1,y=u==null?0:u.length,C=0,x=[];++f<y;){var $=u[f];$&&(x[C++]=$)}return x}function Zz(){var u=arguments.length;if(!u)return[];for(var f=_e(u-1),y=arguments[0],C=u;C--;)f[C-1]=arguments[C];return Io(Pt(y)?ri(y):[y],ms(f,1))}var e7=Mt(function(u,f){return Cr(u)?km(u,ms(f,1,Cr,!0)):[]}),t7=Mt(function(u,f){var y=Xi(f);return Cr(y)&&(y=n),Cr(u)?km(u,ms(f,1,Cr,!0),_t(y,2)):[]}),n7=Mt(function(u,f){var y=Xi(f);return Cr(y)&&(y=n),Cr(u)?km(u,ms(f,1,Cr,!0),n,y):[]});function r7(u,f,y){var C=u==null?0:u.length;return C?(f=y||f===n?1:Dt(f),Qi(u,f<0?0:f,C)):[]}function s7(u,f,y){var C=u==null?0:u.length;return C?(f=y||f===n?1:Dt(f),f=C-f,Qi(u,0,f<0?0:f)):[]}function i7(u,f){return u&&u.length?Fv(u,_t(f,3),!0,!0):[]}function o7(u,f){return u&&u.length?Fv(u,_t(f,3),!0):[]}function a7(u,f,y,C){var x=u==null?0:u.length;return x?(y&&typeof y!="number"&&Bs(u,f,y)&&(y=0,C=x),Z8(u,f,y,C)):[]}function I1(u,f,y){var C=u==null?0:u.length;if(!C)return-1;var x=y==null?0:Dt(y);return x<0&&(x=Kr(C+x,0)),he(u,_t(f,3),x)}function C1(u,f,y){var C=u==null?0:u.length;if(!C)return-1;var x=C-1;return y!==n&&(x=Dt(y),x=y<0?Kr(C+x,0):ws(x,C-1)),he(u,_t(f,3),x,!0)}function A1(u){var f=u==null?0:u.length;return f?ms(u,1):[]}function c7(u){var f=u==null?0:u.length;return f?ms(u,ce):[]}function l7(u,f){var y=u==null?0:u.length;return y?(f=f===n?1:Dt(f),ms(u,f)):[]}function u7(u){for(var f=-1,y=u==null?0:u.length,C={};++f<y;){var x=u[f];C[x[0]]=x[1]}return C}function R1(u){return u&&u.length?u[0]:n}function d7(u,f,y){var C=u==null?0:u.length;if(!C)return-1;var x=y==null?0:Dt(y);return x<0&&(x=Kr(C+x,0)),He(u,f,x)}function h7(u){var f=u==null?0:u.length;return f?Qi(u,0,-1):[]}var f7=Mt(function(u){var f=Ft(u,MI);return f.length&&f[0]===u[0]?CI(f):[]}),p7=Mt(function(u){var f=Xi(u),y=Ft(u,MI);return f===Xi(y)?f=n:y.pop(),y.length&&y[0]===u[0]?CI(y,_t(f,2)):[]}),m7=Mt(function(u){var f=Xi(u),y=Ft(u,MI);return f=typeof f=="function"?f:n,f&&y.pop(),y.length&&y[0]===u[0]?CI(y,n,f):[]});function g7(u,f){return u==null?"":h8.call(u,f)}function Xi(u){var f=u==null?0:u.length;return f?u[f-1]:n}function _7(u,f,y){var C=u==null?0:u.length;if(!C)return-1;var x=C;return y!==n&&(x=Dt(y),x=x<0?Kr(C+x,0):ws(x,C-1)),f===f?JK(u,f,x):he(u,fr,x,!0)}function y7(u,f){return u&&u.length?BO(u,Dt(f)):n}var v7=Mt(P1);function P1(u,f){return u&&u.length&&f&&f.length?kI(u,f):u}function b7(u,f,y){return u&&u.length&&f&&f.length?kI(u,f,_t(y,2)):u}function w7(u,f,y){return u&&u.length&&f&&f.length?kI(u,f,n,y):u}var S7=sc(function(u,f){var y=u==null?0:u.length,C=SI(u,f);return HO(u,Ft(f,function(x){return ic(x,y)?+x:x}).sort(XO)),C});function T7(u,f){var y=[];if(!(u&&u.length))return y;var C=-1,x=[],$=u.length;for(f=_t(f,3);++C<$;){var W=u[C];f(W,C,u)&&(y.push(W),x.push(C))}return HO(u,x),y}function JI(u){return u==null?u:g8.call(u)}function E7(u,f,y){var C=u==null?0:u.length;return C?(y&&typeof y!="number"&&Bs(u,f,y)?(f=0,y=C):(f=f==null?0:Dt(f),y=y===n?C:Dt(y)),Qi(u,f,y)):[]}function I7(u,f){return Vv(u,f)}function C7(u,f,y){return OI(u,f,_t(y,2))}function A7(u,f){var y=u==null?0:u.length;if(y){var C=Vv(u,f);if(C<y&&Ro(u[C],f))return C}return-1}function R7(u,f){return Vv(u,f,!0)}function P7(u,f,y){return OI(u,f,_t(y,2),!0)}function k7(u,f){var y=u==null?0:u.length;if(y){var C=Vv(u,f,!0)-1;if(Ro(u[C],f))return C}return-1}function N7(u){return u&&u.length?jO(u):[]}function D7(u,f){return u&&u.length?jO(u,_t(f,2)):[]}function O7(u){var f=u==null?0:u.length;return f?Qi(u,1,f):[]}function x7(u,f,y){return u&&u.length?(f=y||f===n?1:Dt(f),Qi(u,0,f<0?0:f)):[]}function L7(u,f,y){var C=u==null?0:u.length;return C?(f=y||f===n?1:Dt(f),f=C-f,Qi(u,f<0?0:f,C)):[]}function M7(u,f){return u&&u.length?Fv(u,_t(f,3),!1,!0):[]}function V7(u,f){return u&&u.length?Fv(u,_t(f,3)):[]}var F7=Mt(function(u){return yl(ms(u,1,Cr,!0))}),B7=Mt(function(u){var f=Xi(u);return Cr(f)&&(f=n),yl(ms(u,1,Cr,!0),_t(f,2))}),$7=Mt(function(u){var f=Xi(u);return f=typeof f=="function"?f:n,yl(ms(u,1,Cr,!0),n,f)});function U7(u){return u&&u.length?yl(u):[]}function H7(u,f){return u&&u.length?yl(u,_t(f,2)):[]}function q7(u,f){return f=typeof f=="function"?f:n,u&&u.length?yl(u,n,f):[]}function QI(u){if(!(u&&u.length))return[];var f=0;return u=Eo(u,function(y){if(Cr(y))return f=Kr(y.length,f),!0}),pl(f,function(y){return Ft(u,pr(y))})}function k1(u,f){if(!(u&&u.length))return[];var y=QI(u);return f==null?y:Ft(y,function(C){return bs(f,n,C)})}var j7=Mt(function(u,f){return Cr(u)?km(u,f):[]}),W7=Mt(function(u){return LI(Eo(u,Cr))}),G7=Mt(function(u){var f=Xi(u);return Cr(f)&&(f=n),LI(Eo(u,Cr),_t(f,2))}),K7=Mt(function(u){var f=Xi(u);return f=typeof f=="function"?f:n,LI(Eo(u,Cr),n,f)}),z7=Mt(QI);function Y7(u,f){return zO(u||[],f||[],Pm)}function J7(u,f){return zO(u||[],f||[],Om)}var Q7=Mt(function(u){var f=u.length,y=f>1?u[f-1]:n;return y=typeof y=="function"?(u.pop(),y):n,k1(u,y)});function N1(u){var f=F(u);return f.__chain__=!0,f}function X7(u,f){return f(u),u}function Kv(u,f){return f(u)}var Z7=sc(function(u){var f=u.length,y=f?u[0]:0,C=this.__wrapped__,x=function($){return SI($,u)};return f>1||this.__actions__.length||!(C instanceof Yt)||!ic(y)?this.thru(x):(C=C.slice(y,+y+(f?1:0)),C.__actions__.push({func:Kv,args:[x],thisArg:n}),new Yi(C,this.__chain__).thru(function($){return f&&!$.length&&$.push(n),$}))});function eY(){return N1(this)}function tY(){return new Yi(this.value(),this.__chain__)}function nY(){this.__values__===n&&(this.__values__=W1(this.value()));var u=this.__index__>=this.__values__.length,f=u?n:this.__values__[this.__index__++];return{done:u,value:f}}function rY(){return this}function sY(u){for(var f,y=this;y instanceof Dv;){var C=E1(y);C.__index__=0,C.__values__=n,f?x.__wrapped__=C:f=C;var x=C;y=y.__wrapped__}return x.__wrapped__=u,f}function iY(){var u=this.__wrapped__;if(u instanceof Yt){var f=u;return this.__actions__.length&&(f=new Yt(this)),f=f.reverse(),f.__actions__.push({func:Kv,args:[JI],thisArg:n}),new Yi(f,this.__chain__)}return this.thru(JI)}function oY(){return KO(this.__wrapped__,this.__actions__)}var aY=Bv(function(u,f,y){Dn.call(u,y)?++u[y]:nc(u,y,1)});function cY(u,f,y){var C=Pt(u)?wm:X8;return y&&Bs(u,f,y)&&(f=n),C(u,_t(f,3))}function lY(u,f){var y=Pt(u)?Eo:kO;return y(u,_t(f,3))}var uY=s1(I1),dY=s1(C1);function hY(u,f){return ms(zv(u,f),1)}function fY(u,f){return ms(zv(u,f),ce)}function pY(u,f,y){return y=y===n?1:Dt(y),ms(zv(u,f),y)}function D1(u,f){var y=Pt(u)?Fr:_l;return y(u,_t(f,3))}function O1(u,f){var y=Pt(u)?_v:PO;return y(u,_t(f,3))}var mY=Bv(function(u,f,y){Dn.call(u,y)?u[y].push(f):nc(u,y,[f])});function gY(u,f,y,C){u=si(u)?u:Fh(u),y=y&&!C?Dt(y):0;var x=u.length;return y<0&&(y=Kr(x+y,0)),Zv(u)?y<=x&&u.indexOf(f,y)>-1:!!x&&He(u,f,y)>-1}var _Y=Mt(function(u,f,y){var C=-1,x=typeof f=="function",$=si(u)?_e(u.length):[];return _l(u,function(W){$[++C]=x?bs(f,W,y):Nm(W,f,y)}),$}),yY=Bv(function(u,f,y){nc(u,y,f)});function zv(u,f){var y=Pt(u)?Ft:MO;return y(u,_t(f,3))}function vY(u,f,y,C){return u==null?[]:(Pt(f)||(f=f==null?[]:[f]),y=C?n:y,Pt(y)||(y=y==null?[]:[y]),$O(u,f,y))}var bY=Bv(function(u,f,y){u[y?0:1].push(f)},function(){return[[],[]]});function wY(u,f,y){var C=Pt(u)?Ch:sa,x=arguments.length<3;return C(u,_t(f,4),y,x,_l)}function SY(u,f,y){var C=Pt(u)?fl:sa,x=arguments.length<3;return C(u,_t(f,4),y,x,PO)}function TY(u,f){var y=Pt(u)?Eo:kO;return y(u,Qv(_t(f,3)))}function EY(u){var f=Pt(u)?IO:gz;return f(u)}function IY(u,f,y){(y?Bs(u,f,y):f===n)?f=1:f=Dt(f);var C=Pt(u)?K8:_z;return C(u,f)}function CY(u){var f=Pt(u)?z8:vz;return f(u)}function AY(u){if(u==null)return 0;if(si(u))return Zv(u)?Rh(u):u.length;var f=Ss(u);return f==j||f==se?u.size:RI(u).length}function RY(u,f,y){var C=Pt(u)?m:bz;return y&&Bs(u,f,y)&&(f=n),C(u,_t(f,3))}var PY=Mt(function(u,f){if(u==null)return[];var y=f.length;return y>1&&Bs(u,f[0],f[1])?f=[]:y>2&&Bs(f[0],f[1],f[2])&&(f=[f[0]]),$O(u,ms(f,1),[])}),Yv=l8||function(){return hr.Date.now()};function kY(u,f){if(typeof f!="function")throw new zi(o);return u=Dt(u),function(){if(--u<1)return f.apply(this,arguments)}}function x1(u,f,y){return f=y?n:f,f=u&&f==null?u.length:f,rc(u,S,n,n,n,n,f)}function L1(u,f){var y;if(typeof f!="function")throw new zi(o);return u=Dt(u),function(){return--u>0&&(y=f.apply(this,arguments)),u<=1&&(f=n),y}}var XI=Mt(function(u,f,y){var C=b;if(y.length){var x=ml(y,Mh(XI));C|=N}return rc(u,C,f,y,x)}),M1=Mt(function(u,f,y){var C=b|w;if(y.length){var x=ml(y,Mh(M1));C|=N}return rc(f,C,u,y,x)});function V1(u,f,y){f=y?n:f;var C=rc(u,T,n,n,n,n,n,f);return C.placeholder=V1.placeholder,C}function F1(u,f,y){f=y?n:f;var C=rc(u,R,n,n,n,n,n,f);return C.placeholder=F1.placeholder,C}function B1(u,f,y){var C,x,$,W,Q,ne,Pe=0,ke=!1,Oe=!1,ze=!0;if(typeof u!="function")throw new zi(o);f=Zi(f)||0,or(y)&&(ke=!!y.leading,Oe="maxWait"in y,$=Oe?Kr(Zi(y.maxWait)||0,f):$,ze="trailing"in y?!!y.trailing:ze);function it(Ar){var Po=C,cc=x;return C=x=n,Pe=Ar,W=u.apply(cc,Po),W}function bt(Ar){return Pe=Ar,Q=Mm(Ht,f),ke?it(Ar):W}function Lt(Ar){var Po=Ar-ne,cc=Ar-Pe,sx=f-Po;return Oe?ws(sx,$-cc):sx}function wt(Ar){var Po=Ar-ne,cc=Ar-Pe;return ne===n||Po>=f||Po<0||Oe&&cc>
vendor: 4,712 bytes, line 108
108=$}function Ht(){var Ar=Yv();if(wt(Ar))return Xt(Ar);Q=Mm(Ht,Lt(Ar))}function Xt(Ar){return Q=n,ze&&C?it(Ar):(C=x=n,W)}function Ni(){Q!==n&&YO(Q),Pe=0,C=ne=x=Q=n}function $s(){return Q===n?W:Xt(Yv())}function Di(){var Ar=Yv(),Po=wt(Ar);if(C=arguments,x=this,ne=Ar,Po){if(Q===n)return bt(ne);if(Oe)return YO(Q),Q=Mm(Ht,f),it(ne)}return Q===n&&(Q=Mm(Ht,f)),W}return Di.cancel=Ni,Di.flush=$s,Di}var NY=Mt(function(u,f){return RO(u,1,f)}),DY=Mt(function(u,f,y){return RO(u,Zi(f)||0,y)});function OY(u){return rc(u,P)}function Jv(u,f){if(typeof u!="function"||f!=null&&typeof f!="function")throw new zi(o);var y=function(){var C=arguments,x=f?f.apply(this,C):C[0],$=y.cache;if($.has(x))return $.get(x);var W=u.apply(this,C);return y.cache=$.set(x,W)||$,W};return y.cache=new(Jv.Cache||tc),y}Jv.Cache=tc;function Qv(u){if(typeof u!="function")throw new zi(o);return function(){var f=arguments;switch(f.length){case 0:return!u.call(this);case 1:return!u.call(this,f[0]);case 2:return!u.call(this,f[0],f[1]);case 3:return!u.call(this,f[0],f[1],f[2])}return!u.apply(this,f)}}function xY(u){return L1(2,u)}var LY=wz(function(u,f){f=f.length==1&&Pt(f[0])?Ft(f[0],Ri(_t())):Ft(ms(f,1),Ri(_t()));var y=f.length;return Mt(function(C){for(var x=-1,$=ws(C.length,y);++x<$;)C[x]=f[x].call(this,C[x]);return bs(u,this,C)})}),ZI=Mt(function(u,f){var y=ml(f,Mh(ZI));return rc(u,N,n,f,y)}),$1=Mt(function(u,f){var y=ml(f,Mh($1));return rc(u,O,n,f,y)}),MY=sc(function(u,f){return rc(u,I,n,n,n,f)});function VY(u,f){if(typeof u!="function")throw new zi(o);return f=f===n?f:Dt(f),Mt(u,f)}function FY(u,f){if(typeof u!="function")throw new zi(o);return f=f==null?0:Kr(Dt(f),0),Mt(function(y){var C=y[f],x=bl(y,0,f);return C&&Io(x,C),bs(u,this,x)})}function BY(u,f,y){var C=!0,x=!0;if(typeof u!="function")throw new zi(o);return or(y)&&(C="leading"in y?!!y.leading:C,x="trailing"in y?!!y.trailing:x),B1(u,f,{leading:C,maxWait:f,trailing:x})}function $Y(u){return x1(u,1)}function UY(u,f){return ZI(VI(f),u)}function HY(){if(!arguments.length)return[];var u=arguments[0];return Pt(u)?u:[u]}function qY(u){return Ji(u,g)}function jY(u,f){return f=typeof f=="function"?f:n,Ji(u,g,f)}function WY(u){return Ji(u,h|g)}function GY(u,f){return f=typeof f=="function"?f:n,Ji(u,h|g,f)}function KY(u,f){return f==null||AO(u,f,ts(f))}function Ro(u,f){return u===f||u!==u&&f!==f}var zY=qv(II),YY=qv(function(u,f){return u>=f}),Ku=OO((function(){return arguments})())?OO:function(u){return mr(u)&&Dn.call(u,"callee")&&!vO.call(u,"callee")},Pt=_e.isArray,JY=ym?Ri(ym):sz;function si(u){return u!=null&&Xv(u.length)&&!oc(u)}function Cr(u){return mr(u)&&si(u)}function QY(u){return u===!0||u===!1||mr(u)&&Fs(u)==ve}var wl=d8||u0,XY=vm?Ri(vm):iz;function ZY(u){return mr(u)&&u.nodeType===1&&!Vm(u)}function eJ(u){if(u==null)return!0;if(si(u)&&(Pt(u)||typeof u=="string"||typeof u.splice=="function"||wl(u)||Vh(u)||Ku(u)))return!u.length;var f=Ss(u);if(f==j||f==se)return!u.size;if(Lm(u))return!RI(u).length;for(var y in u)if(Dn.call(u,y))return!1;return!0}function tJ(u,f){return Dm(u,f)}function nJ(u,f,y){y=typeof y=="function"?y:n;var C=y?y(u,f):n;return C===n?Dm(u,f,n,y):!!C}function e0(u){if(!mr(u))return!1;var f=Fs(u);return f==Ke||f==Me||typeof u.message=="string"&&typeof u.name=="string"&&!Vm(u)}function rJ(u){return typeof u=="number"&&wO(u)}function oc(u){if(!or(u))return!1;var f=Fs(u);return f==ut||f==H||f==Y||f==q}function U1(u){return typeof u=="number"&&u==Dt(u)}function Xv(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=G}function or(u){var f=typeof u;return u!=null&&(f=="object"||f=="function")}function mr(u){return u!=null&&typeof u=="object"}var H1=Eh?Ri(Eh):az;function sJ(u,f){return u===f||AI(u,f,jI(f))}function iJ(u,f,y){return y=typeof y=="function"?y:n,AI(u,f,jI(f),y)}function oJ(u){return q1(u)&&u!=+u}function aJ(u){if(jz(u))throw new It(i);return xO(u)}function cJ(u){return u===null}function lJ(u){return u==null}function q1(u){return typeof u=="number"||mr(u)&&Fs(u)==re}function Vm(u){if(!mr(u)||Fs(u)!=ge)return!1;var f=Iv(u);if(f===null)return!0;var y=Dn.call(f,"constructor")&&f.constructor;return typeof y=="function"&&y instanceof y&&wv.call(y)==i8}var t0=Ih?Ri(Ih):cz;function uJ(u){return U1(u)&&u>=-G&&u<=G}var j1=bm?Ri(bm):lz;function Zv(u){return typeof u=="string"||!Pt(u)&&mr(u)&&Fs(u)==be}function ki(u){return typeof u=="symbol"||mr(u)&&Fs(u)==xe}var Vh=Fu?Ri(Fu):uz;function dJ(u){return u===n}function hJ(u){return mr(u)&&Ss(u)==le}function fJ(u){return mr(u)&&Fs(u)==je}var pJ=qv(PI),mJ=qv(function(u,f){return u<=f});function W1(u){if(!u)return[];if(si(u))return Zv(u)?Co(u):ri(u);if(Em&&u[Em])return KK(u[Em]());var f=Ss(u),y=f==j?gI:f==se?yv:Fh;return y(u)}function ac(u){if(!u)return u===0?u:0;
vendor: 5,401 bytes, line 108
108if(u=Zi(u),u===ce||u===-ce){var f=u<0?-1:1;return f*Z}return u===u?u:0}function Dt(u){var f=ac(u),y=f%1;return f===f?y?f-y:f:0}function G1(u){return u?qu(Dt(u),0,fe):0}function Zi(u){if(typeof u=="number")return u;if(ki(u))return de;if(or(u)){var f=typeof u.valueOf=="function"?u.valueOf():u;u=or(f)?f+"":f}if(typeof u!="string")return u===0?u:+u;u=dO(u);var y=Zy.test(u);return y||_h.test(u)?Vu(u.slice(2),y?2:8):iI.test(u)?de:+u}function K1(u){return aa(u,ii(u))}function gJ(u){return u?qu(Dt(u),-G,G):u===0?u:0}function Tn(u){return u==null?"":Pi(u)}var _J=xh(function(u,f){if(Lm(f)||si(f)){aa(f,ts(f),u);return}for(var y in f)Dn.call(f,y)&&Pm(u,y,f[y])}),z1=xh(function(u,f){aa(f,ii(f),u)}),eb=xh(function(u,f,y,C){aa(f,ii(f),u,C)}),yJ=xh(function(u,f,y,C){aa(f,ts(f),u,C)}),vJ=sc(SI);function bJ(u,f){var y=Oh(u);return f==null?y:CO(y,f)}var wJ=Mt(function(u,f){u=Bn(u);var y=-1,C=f.length,x=C>2?f[2]:n;for(x&&Bs(f[0],f[1],x)&&(C=1);++y<C;)for(var $=f[y],W=ii($),Q=-1,ne=W.length;++Q<ne;){var Pe=W[Q],ke=u[Pe];(ke===n||Ro(ke,kh[Pe])&&!Dn.call(u,Pe))&&(u[Pe]=$[Pe])}return u}),SJ=Mt(function(u){return u.push(n,d1),bs(Y1,n,u)});function TJ(u,f){return ue(u,_t(f,3),oa)}function EJ(u,f){return ue(u,_t(f,3),EI)}function IJ(u,f){return u==null?u:TI(u,_t(f,3),ii)}function CJ(u,f){return u==null?u:NO(u,_t(f,3),ii)}function AJ(u,f){return u&&oa(u,_t(f,3))}function RJ(u,f){return u&&EI(u,_t(f,3))}function PJ(u){return u==null?[]:Lv(u,ts(u))}function kJ(u){return u==null?[]:Lv(u,ii(u))}function n0(u,f,y){var C=u==null?n:ju(u,f);return C===n?y:C}function NJ(u,f){return u!=null&&p1(u,f,ez)}function r0(u,f){return u!=null&&p1(u,f,tz)}var DJ=o1(function(u,f,y){f!=null&&typeof f.toString!="function"&&(f=Sv.call(f)),u[f]=y},i0(oi)),OJ=o1(function(u,f,y){f!=null&&typeof f.toString!="function"&&(f=Sv.call(f)),Dn.call(u,f)?u[f].push(y):u[f]=[y]},_t),xJ=Mt(Nm);function ts(u){return si(u)?EO(u):RI(u)}function ii(u){return si(u)?EO(u,!0):dz(u)}function LJ(u,f){var y={};return f=_t(f,3),oa(u,function(C,x,$){nc(y,f(C,x,$),C)}),y}function MJ(u,f){var y={};return f=_t(f,3),oa(u,function(C,x,$){nc(y,x,f(C,x,$))}),y}var VJ=xh(function(u,f,y){Mv(u,f,y)}),Y1=xh(function(u,f,y,C){Mv(u,f,y,C)}),FJ=sc(function(u,f){var y={};if(u==null)return y;var C=!1;f=Ft(f,function($){return $=vl($,u),C||(C=$.length>1),$}),aa(u,HI(u),y),C&&(y=Ji(y,h|p|g,Dz));for(var x=f.length;x--;)xI(y,f[x]);return y});function BJ(u,f){return J1(u,Qv(_t(f)))}var $J=sc(function(u,f){return u==null?{}:fz(u,f)});function J1(u,f){if(u==null)return{};var y=Ft(HI(u),function(C){return[C]});return f=_t(f),UO(u,y,function(C,x){return f(C,x[0])})}function UJ(u,f,y){f=vl(f,u);var C=-1,x=f.length;for(x||(x=1,u=n);++C<x;){var $=u==null?n:u[ca(f[C])];$===n&&(C=x,$=y),u=oc($)?$.call(u):$}return u}function HJ(u,f,y){return u==null?u:Om(u,f,y)}function qJ(u,f,y,C){return C=typeof C=="function"?C:n,u==null?u:Om(u,f,y,C)}var Q1=l1(ts),X1=l1(ii);function jJ(u,f,y){var C=Pt(u),x=C||wl(u)||Vh(u);if(f=_t(f,4),y==null){var $=u&&u.constructor;x?y=C?new $:[]:or(u)?y=oc($)?Oh(Iv(u)):{}:y={}}return(x?Fr:oa)(u,function(W,Q,ne){return f(y,W,Q,ne)}),y}function WJ(u,f){return u==null?!0:xI(u,f)}function GJ(u,f,y){return u==null?u:GO(u,f,VI(y))}function KJ(u,f,y,C){return C=typeof C=="function"?C:n,u==null?u:GO(u,f,VI(y),C)}function Fh(u){return u==null?[]:mI(u,ts(u))}function zJ(u){return u==null?[]:mI(u,ii(u))}function YJ(u,f,y){return y===n&&(y=f,f=n),y!==n&&(y=Zi(y),y=y===y?y:0),f!==n&&(f=Zi(f),f=f===f?f:0),qu(Zi(u),f,y)}function JJ(u,f,y){return f=ac(f),y===n?(y=f,f=0):y=ac(y),u=Zi(u),nz(u,f,y)}function QJ(u,f,y){if(y&&typeof y!="boolean"&&Bs(u,f,y)&&(f=y=n),y===n&&(typeof f=="boolean"?(y=f,f=n):typeof u=="boolean"&&(y=u,u=n)),u===n&&f===n?(u=0,f=1):(u=ac(u),f===n?(f=u,u=0):f=ac(f)),u>f){var C=u;u=f,f=C}if(y||u%1||f%1){var x=SO();return ws(u+x*(f-u+pI("1e-"+((x+"").length-1))),f)}return NI(u,f)}var XJ=Lh(function(u,f,y){return f=f.toLowerCase(),u+(y?Z1(f):f)});function Z1(u){return s0(Tn(u).toLowerCase())}function ex(u){return u=Tn(u),u&&u.replace(sm,HK).replace(Mu,"")}function ZJ(u,f,y){u=Tn(u),f=Pi(f);var C=u.length;y=y===n?C:qu(Dt(y),0,C);var x=y;return y-=f.length,y>=0&&u.slice(y,x)==f}function eQ(u){return u=Tn(u),u&&De.test(u)?u.replace(Er,qK):u}function tQ(u){return u=Tn(u),u&&ps.test(u)?u.replace(er,"\\$&"):u}var nQ=Lh(function(u,f,y){return u+(y?"-":"")+f.toLowerCase()}),rQ=Lh(function(u,f,y){return u+(y?" ":"")+f.toLowerCase()}),sQ=r1("toLowerCase");function iQ(u,f,y){u=Tn(u),f=Dt(f);var C=f?Rh(u):0;if(!f||C>=f)return u;var x=(f-C)/2;return Hv(Pv(x),y)+u+Hv(Rv(x),y)}function oQ(u,f,y){u=Tn(u),f=Dt(f);var C=f?Rh(u):0;return f&&C<f?u+Hv(f-C,y):u}function aQ(u,f,y){u=Tn(u),f=Dt(f);var C=f?Rh(u):0;return f&&C<f?Hv(f-C,y)+u:u}function cQ(u,f,y){return y||f==null?f=0:f&&(f=+f),m8(Tn(u).replace(Vs,""),f||0)}function lQ(u,f,y){return(y?Bs(u,f,y):f===n)?f=1:f=Dt(f),DI(Tn(u),f)}function uQ(){var u=arguments,f=Tn(u[0]);return u.length<3?f:f.replace(u[1],u[2])}var dQ=Lh(function(u,f,y){return u+(y?"_":"")+f.toLowerCase()});function hQ(u,f,y){return y&&typeof y!="number"&&Bs(u,f,y)&&(f=y=n),y=y===n?fe:y>>>0,y?(u=Tn(u),u&&(typeof f=="string"||f!=null&&!t0(f))&&(f=Pi(f),!f&&Ah(u))?bl(Co(u),0,y):u.split(f,y)):[]}var fQ=Lh(function(u,f,y){return u+(y?" ":"")+s0(f)});function pQ(u,f,y){return u=Tn(u),y=y==null?0:qu(Dt(y),0,u.length),f=Pi(f),u.slice(y,y+f.length)==f}function mQ(u,f,y){var C=F.templateSettings;
vendor: 6,365 bytes, lines 108-125
108y&&Bs(u,f,y)&&(f=n),u=Tn(u),f=eb({},f,C,u1);var x=eb({},f.imports,C.imports,u1),$=ts(x),W=mI(x,$),Q,ne,Pe=0,ke=f.interpolate||ta,Oe="__p += '",ze=_I((f.escape||ta).source+"|"+ke.source+"|"+(ke===Ir?nm:ta).source+"|"+(f.evaluate||ta).source+"|$","g"),it="//# sourceURL="+(Dn.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++fI+"]")+` 109`;u.replace(ze,function(wt,Ht,Xt,Ni,$s,Di){return Xt||(Xt=Ni),Oe+=u.slice(Pe,Di).replace(za,jK),Ht&&(Q=!0,Oe+=`' + 110__e(`+Ht+`) + 111'`),$s&&(ne=!0,Oe+=`'; 112`+$s+`; 113__p += '`),Xt&&(Oe+=`' + 114((__t = (`+Xt+`)) == null ? '' : __t) + 115'`),Pe=Di+wt.length,wt}),Oe+=`'; 116`;var bt=Dn.call(f,"variable")&&f.variable;if(!bt)Oe=`with (obj) { 117`+Oe+` 118} 119`;else if(ea.test(bt))throw new It(a);Oe=(ne?Oe.replace(wo,""):Oe).replace(Ga,"$1").replace(So,"$1;"),Oe="function("+(bt||"obj")+`) { 120`+(bt?"":`obj || (obj = {}); 121`)+"var __t, __p = ''"+(Q?", __e = _.escape":"")+(ne?`, __j = Array.prototype.join; 122function print() { __p += __j.call(arguments, '') } 123`:`; 124`)+Oe+`return __p 125}`;var Lt=nx(function(){return mn($,it+"return "+Oe).apply(n,W)});if(Lt.source=Oe,e0(Lt))throw Lt;return Lt}function gQ(u){return Tn(u).toLowerCase()}function _Q(u){return Tn(u).toUpperCase()}function yQ(u,f,y){if(u=Tn(u),u&&(y||f===n))return dO(u);if(!u||!(f=Pi(f)))return u;var C=Co(u),x=Co(f),$=hO(C,x),W=fO(C,x)+1;return bl(C,$,W).join("")}function vQ(u,f,y){if(u=Tn(u),u&&(y||f===n))return u.slice(0,mO(u)+1);if(!u||!(f=Pi(f)))return u;var C=Co(u),x=fO(C,Co(f))+1;return bl(C,0,x).join("")}function bQ(u,f,y){if(u=Tn(u),u&&(y||f===n))return u.replace(Vs,"");if(!u||!(f=Pi(f)))return u;var C=Co(u),x=hO(C,Co(f));return bl(C,x).join("")}function wQ(u,f){var y=k,C=L;if(or(f)){var x="separator"in f?f.separator:x;y="length"in f?Dt(f.length):y,C="omission"in f?Pi(f.omission):C}u=Tn(u);var $=u.length;if(Ah(u)){var W=Co(u);$=W.length}if(y>=$)return u;var Q=y-Rh(C);if(Q<1)return C;var ne=W?bl(W,0,Q).join(""):u.slice(0,Q);if(x===n)return ne+C;if(W&&(Q+=ne.length-Q),t0(x)){if(u.slice(Q).search(x)){var Pe,ke=ne;for(x.global||(x=_I(x.source,Tn(rm.exec(x))+"g")),x.lastIndex=0;Pe=x.exec(ke);)var Oe=Pe.index;ne=ne.slice(0,Oe===n?Q:Oe)}}else if(u.indexOf(Pi(x),Q)!=Q){var ze=ne.lastIndexOf(x);ze>-1&&(ne=ne.slice(0,ze))}return ne+C}function SQ(u){return u=Tn(u),u&&gh.test(u)?u.replace(Qo,QK):u}var TQ=Lh(function(u,f,y){return u+(y?" ":"")+f.toUpperCase()}),s0=r1("toUpperCase");function tx(u,f,y){return u=Tn(u),f=y?n:f,f===n?GK(u)?e8(u):U(u):u.match(f)||[]}var nx=Mt(function(u,f){try{return bs(u,n,f)}catch(y){return e0(y)?y:new It(y)}}),EQ=sc(function(u,f){return Fr(f,function(y){y=ca(y),nc(u,y,XI(u[y],u))}),u});function IQ(u){var f=u==null?0:u.length,y=_t();return u=f?Ft(u,function(C){if(typeof C[1]!="function")throw new zi(o);return[y(C[0]),C[1]]}):[],Mt(function(C){for(var x=-1;++x<f;){var $=u[x];if(bs($[0],this,C))return bs($[1],this,C)}})}function CQ(u){return Q8(Ji(u,h))}function i0(u){return function(){return u}}function AQ(u,f){return u==null||u!==u?f:u}var RQ=i1(),PQ=i1(!0);function oi(u){return u}function o0(u){return LO(typeof u=="function"?u:Ji(u,h))}function kQ(u){return VO(Ji(u,h))}function NQ(u,f){return FO(u,Ji(f,h))}var DQ=Mt(function(u,f){return function(y){return Nm(y,u,f)}}),OQ=Mt(function(u,f){return function(y){return Nm(u,y,f)}});function a0(u,f,y){var C=ts(f),x=Lv(f,C);y==null&&!(or(f)&&(x.length||!C.length))&&(y=f,f=u,u=this,x=Lv(f,ts(f)));var $=!(or(y)&&"chain"in y)||!!y.chain,W=oc(u);return Fr(x,function(Q){var ne=f[Q];u[Q]=ne,W&&(u.prototype[Q]=function(){var Pe=this.__chain__;if($||Pe){var ke=u(this.__wrapped__),Oe=ke.__actions__=ri(this.__actions__);return Oe.push({func:ne,args:arguments,thisArg:u}),ke.__chain__=Pe,ke}return ne.apply(u,Io([this.value()],arguments))})}),u}function xQ(){return hr._===this&&(hr._=o8),this}function c0(){}function LQ(u){return u=Dt(u),Mt(function(f){return BO(f,u)})}var MQ=BI(Ft),VQ=BI(wm),FQ=BI(m);function rx(u){return GI(u)?pr(ca(u)):pz(u)}function BQ(u){return function(f){return u==null?n:ju(u,f)}}var $Q=a1(),UQ=a1(!0);function l0(){return[]}function u0(){return!1}function HQ(){return{}}function qQ(){return""}function jQ(){return!0}function WQ(u,f){if(u=Dt(u),u<1||u>G)return[];var y=fe,C=ws(u,fe);f=_t(f),u-=fe;for(var x=pl(C,f);++y<u;)f(y);return x}function GQ(u){return Pt(u)?Ft(u,ca):ki(u)?[u]:ri(T1(Tn(u)))}function KQ(u){var f=++s8;return Tn(u)+f}var zQ=Uv(function(u,f){return u+f},0),YQ=$I("ceil"),JQ=Uv(function(u,f){return u/f},1),QQ=$I("floor");function XQ(u){return u&&u.length?xv(u,oi,II):n}function ZQ(u,f){return u&&u.length?xv(u,_t(f,2),II):n}function eX(u){return Sn(u,oi)}function tX(u,f){return Sn(u,_t(f,2))}function nX(u){return u&&u.length?xv(u,oi,PI):n}function rX(u,f){return u&&u.length?xv(u,_t(f,2),PI):n}var sX=Uv(function(u,f){return u*f},1),iX=$I("round"),oX=Uv(function(u,f){return u-f},0);function aX(u){return u&&u.length?Ki(u,oi):0}function cX(u,f){return u&&u.length?Ki(u,_t(f,2)):0}return F.after=kY,F.ary=x1,F.assign=_J,F.assignIn=z1,F.assignInWith=eb,F.assignWith=yJ,F.at=vJ,F.before=L1,F.bind=XI,F.bindAll=EQ,F.bindKey=M1,F.castArray=HY,F.chain=N1,F.chunk=Qz,F.compact=Xz,F.concat=Zz,F.cond=IQ,F.conforms=CQ,F.constant=i0,F.countBy=aY,F.create=bJ,F.curry=V1,F.curryRight=F1,F.debounce=B1,F.defaults=wJ,F.defaultsDeep=SJ,F.defer=NY,F.delay=DY,F.difference=e7,F.differenceBy=t7,F.differenceWith=n7,F.drop=r7,F.dropRight=s7,F.dropRightWhile=i7,F.dropWhile=o7,F.fill=a7,F.filter=lY,F.flatMap=hY,F.flatMapDeep=fY,F.flatMapDepth=pY,F.flatten=A1,F.flattenDeep=c7,F.flattenDepth=l7,F.flip=OY,F.flow=RQ,F.flowRight=PQ,F.fromPairs=u7,F.functions=PJ,F.functionsIn=kJ,F.groupBy=mY,F.initial=h7,F.intersection=f7,F.intersectionBy=p7,F.intersectionWith=m7,F.invert=DJ,F.invertBy=OJ,F.invokeMap=_Y,F.iteratee=o0,F.keyBy=yY,F.keys=ts,F.keysIn=ii,F.map=zv,F.mapKeys=LJ,F.mapValues=MJ,F.matches=kQ,F.matchesProperty=NQ,F.memoize=Jv,F.merge=VJ,F.mergeWith=Y1,F.method=DQ,F.methodOf=OQ,F.mixin=a0,F.negate=Qv,F.nthArg=LQ,F.omit=FJ,F.omitBy=BJ,F.once=xY,F.orderBy=vY,F.over=MQ,F.overArgs=LY,F.overEvery=VQ,F.overSome=FQ,F.partial=ZI,F.partialRight=$1,F.partition=bY,F.pick=$J,F.pickBy=J1,F.property=rx,F.propertyOf=BQ,F.pull=v7,F.pullAll=P1,F.pullAllBy=b7,F.pullAllWith=w7,F.pullAt=S7,F.range=$Q,F.rangeRight=UQ,F.rearg=MY,F.reject=TY,F.remove=T7,F.rest=VY,F.reverse=JI,F.sampleSize=IY,F.set=HJ,F.setWith=qJ,F.shuffle=CY,F.slice
vendor: 5,125 bytes, line 125
125=E7,F.sortBy=PY,F.sortedUniq=N7,F.sortedUniqBy=D7,F.split=hQ,F.spread=FY,F.tail=O7,F.take=x7,F.takeRight=L7,F.takeRightWhile=M7,F.takeWhile=V7,F.tap=X7,F.throttle=BY,F.thru=Kv,F.toArray=W1,F.toPairs=Q1,F.toPairsIn=X1,F.toPath=GQ,F.toPlainObject=K1,F.transform=jJ,F.unary=$Y,F.union=F7,F.unionBy=B7,F.unionWith=$7,F.uniq=U7,F.uniqBy=H7,F.uniqWith=q7,F.unset=WJ,F.unzip=QI,F.unzipWith=k1,F.update=GJ,F.updateWith=KJ,F.values=Fh,F.valuesIn=zJ,F.without=j7,F.words=tx,F.wrap=UY,F.xor=W7,F.xorBy=G7,F.xorWith=K7,F.zip=z7,F.zipObject=Y7,F.zipObjectDeep=J7,F.zipWith=Q7,F.entries=Q1,F.entriesIn=X1,F.extend=z1,F.extendWith=eb,a0(F,F),F.add=zQ,F.attempt=nx,F.camelCase=XJ,F.capitalize=Z1,F.ceil=YQ,F.clamp=YJ,F.clone=qY,F.cloneDeep=WY,F.cloneDeepWith=GY,F.cloneWith=jY,F.conformsTo=KY,F.deburr=ex,F.defaultTo=AQ,F.divide=JQ,F.endsWith=ZJ,F.eq=Ro,F.escape=eQ,F.escapeRegExp=tQ,F.every=cY,F.find=uY,F.findIndex=I1,F.findKey=TJ,F.findLast=dY,F.findLastIndex=C1,F.findLastKey=EJ,F.floor=QQ,F.forEach=D1,F.forEachRight=O1,F.forIn=IJ,F.forInRight=CJ,F.forOwn=AJ,F.forOwnRight=RJ,F.get=n0,F.gt=zY,F.gte=YY,F.has=NJ,F.hasIn=r0,F.head=R1,F.identity=oi,F.includes=gY,F.indexOf=d7,F.inRange=JJ,F.invoke=xJ,F.isArguments=Ku,F.isArray=Pt,F.isArrayBuffer=JY,F.isArrayLike=si,F.isArrayLikeObject=Cr,F.isBoolean=QY,F.isBuffer=wl,F.isDate=XY,F.isElement=ZY,F.isEmpty=eJ,F.isEqual=tJ,F.isEqualWith=nJ,F.isError=e0,F.isFinite=rJ,F.isFunction=oc,F.isInteger=U1,F.isLength=Xv,F.isMap=H1,F.isMatch=sJ,F.isMatchWith=iJ,F.isNaN=oJ,F.isNative=aJ,F.isNil=lJ,F.isNull=cJ,F.isNumber=q1,F.isObject=or,F.isObjectLike=mr,F.isPlainObject=Vm,F.isRegExp=t0,F.isSafeInteger=uJ,F.isSet=j1,F.isString=Zv,F.isSymbol=ki,F.isTypedArray=Vh,F.isUndefined=dJ,F.isWeakMap=hJ,F.isWeakSet=fJ,F.join=g7,F.kebabCase=nQ,F.last=Xi,F.lastIndexOf=_7,F.lowerCase=rQ,F.lowerFirst=sQ,F.lt=pJ,F.lte=mJ,F.max=XQ,F.maxBy=ZQ,F.mean=eX,F.meanBy=tX,F.min=nX,F.minBy=rX,F.stubArray=l0,F.stubFalse=u0,F.stubObject=HQ,F.stubString=qQ,F.stubTrue=jQ,F.multiply=sX,F.nth=y7,F.noConflict=xQ,F.noop=c0,F.now=Yv,F.pad=iQ,F.padEnd=oQ,F.padStart=aQ,F.parseInt=cQ,F.random=QJ,F.reduce=wY,F.reduceRight=SY,F.repeat=lQ,F.replace=uQ,F.result=UJ,F.round=iX,F.runInContext=te,F.sample=EY,F.size=AY,F.snakeCase=dQ,F.some=RY,F.sortedIndex=I7,F.sortedIndexBy=C7,F.sortedIndexOf=A7,F.sortedLastIndex=R7,F.sortedLastIndexBy=P7,F.sortedLastIndexOf=k7,F.startCase=fQ,F.startsWith=pQ,F.subtract=oX,F.sum=aX,F.sumBy=cX,F.template=mQ,F.times=WQ,F.toFinite=ac,F.toInteger=Dt,F.toLength=G1,F.toLower=gQ,F.toNumber=Zi,F.toSafeInteger=gJ,F.toString=Tn,F.toUpper=_Q,F.trim=yQ,F.trimEnd=vQ,F.trimStart=bQ,F.truncate=wQ,F.unescape=SQ,F.uniqueId=KQ,F.upperCase=TQ,F.upperFirst=s0,F.each=D1,F.eachRight=O1,F.first=R1,a0(F,(function(){var u={};return oa(F,function(f,y){Dn.call(F.prototype,y)||(u[y]=f)}),u})(),{chain:!1}),F.VERSION=r,Fr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){F[u].placeholder=F}),Fr(["drop","take"],function(u,f){Yt.prototype[u]=function(y){y=y===n?1:Kr(Dt(y),0);var C=this.__filtered__&&!f?new Yt(this):this.clone();return C.__filtered__?C.__takeCount__=ws(y,C.__takeCount__):C.__views__.push({size:ws(y,fe),type:u+(C.__dir__<0?"Right":"")}),C},Yt.prototype[u+"Right"]=function(y){return this.reverse()[u](y).reverse()}}),Fr(["filter","map","takeWhile"],function(u,f){var y=f+1,C=y==z||y==K;Yt.prototype[u]=function(x){var $=this.clone();return $.__iteratees__.push({iteratee:_t(x,3),type:y}),$.__filtered__=$.__filtered__||C,$}}),Fr(["head","last"],function(u,f){var y="take"+(f?"Right":"");Yt.prototype[u]=function(){return this[y](1).value()[0]}}),Fr(["initial","tail"],function(u,f){var y="drop"+(f?"":"Right");Yt.prototype[u]=function(){return this.__filtered__?new Yt(this):this[y](1)}}),Yt.prototype.compact=function(){return this.filter(oi)},Yt.prototype.find=function(u){return this.filter(u).head()},Yt.prototype.findLast=function(u){return this.reverse().find(u)},Yt.prototype.invokeMap=Mt(function(u,f){return typeof u=="function"?new Yt(this):this.map(function(y){return Nm(y,u,f)})}),Yt.prototype.reject=function(u){return this.filter(Qv(_t(u)))},Yt.prototype.slice=function(u,f){u=Dt(u);var y=this;return y.__filtered__&&(u>0||f<0)?new Yt(y):(u<0?y=y.takeRight(-u):u&&(y=y.drop(u)),f!==n&&(f=Dt(f),y=f<0?y.dropRight(-f):y.take(f-u)),y)},Yt.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},Yt.prototype.toArray=function(){return this.take(fe)},oa(Yt.prototype,function(u,f){var y=/^(?:filter|find|map|reject)|While$/.test(f),C=/^(?:head|last)$/.test(f),x=F[C?"take"+(f=="last"?"Right":""):f],$=C||/^find/.test(f);x&&(F.prototype[f]=function(){var W=this.__wrapped__,Q=C?[1]:arguments,ne=W instanceof Yt,Pe=Q[0],ke=ne||Pt(W),Oe=function(Ht){var Xt=x.apply(F,Io([Ht],Q));return C&&ze?Xt[0]:Xt};ke&&y&&typeof Pe=="function"&&Pe.length!=1&&(ne=ke=!1);var ze=this.__chain__,it=!!this.__actions__.length,bt=$&&!ze,Lt=ne&&!it;if(!$&&ke){W=Lt?W:new Yt(this);var wt=u.apply(W,Q);return wt.__actions__.push({func:Kv,args:[Oe],thisArg:n}),new Yi(wt,ze)}return bt&&Lt?u.apply(this,Q):(wt=this.thru(Oe),bt?C?wt.value()[0]:wt.value():wt)})}
125),Fr(["pop","push","shift","sort","splice","unshift"],function(u){var f=vv[u],y=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",C=/^(?:pop|shift)$/.test(u);F.prototype[u]=function(){var x=arguments;if(C&&!this.__chain__){var $=this.value();return f.apply(Pt($)?$:[],x)}return this[y](function(W){return f.apply(Pt(W)?W:[],x)})}}),oa(Yt.prototype,function(u,f){var y=F[f];if(y){var C=y.name+"";Dn.call(Dh,C)||(Dh[C]=[]),Dh[C].push({name:f,func:y})}}),Dh[$v(n,w).name]=[{name:"wrapper",func:n}],Yt.prototype.clone=S8,Yt.prototype.reverse=T8,Yt.prototype.value=E8,F.prototype.at=Z7,F.prototype.chain=eY,F.prototype.commit=tY,F.prototype.next=nY,F.prototype.plant=sY,F.prototype.reverse=iY,F.prototype.toJSON=F.prototype.valueOf=F.prototype.value=oY,F.prototype.first=F.prototype.head,Em&&(F.prototype[Em]=rY),F}),Ph=t8();Gi?((Gi.exports=Ph)._=Ph,Sh._=Ph):hr._=Ph}).call(Gbe)})(fg,fg.exports)),fg.exports}var Oy=Kbe();const Qe=lD(Oy);function Xc(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function uD(t,e){let n;const r=()=>{if(n)return n;const s=indexedDB.open(t);return s.onupgradeneeded=()=>s.result.createObjectStore(e),n=Xc(s),n.then(i=>{i.onclose=()=>n=void 0},()=>{}),n};return(s,i)=>r().then(o=>i(o.transaction(e,s).objectStore(e)))}let iC;function Up(){return iC||(iC=uD("keyval-store","keyval")),iC}function Q6(t,e=Up()){return e("readonly",n=>Xc(n.get(t)))}function X6(t,e,n=Up()){return n("readwrite",r=>(r.put(e,t),Xc(r.transaction)))}function zbe(t,e=Up()){return e("readwrite",n=>(n.delete(t),Xc(n.transaction)))}function Z6(t=Up()){return t("readwrite",e=>(e.clear(),Xc(e.transaction)))}function eW(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},Xc(t.transaction)}function Ybe(t=Up()){return t("readonly",e=>{if(e.getAllKeys)return Xc(e.getAllKeys());const n=[];return eW(e,r=>n.push(r.key)).then(()=>n)})}function Jbe(t=Up()){return t("readonly",e=>{if(e.getAll&&e.getAllKeys)return Promise.all([Xc(e.getAllKeys()),Xc(e.getAll())]).then(([r,s])=>r.map((i,o)=>[i,s[o]]));const n=[];return eW(e,r=>
125n.push([r.key,r.value])).then(()=>n)})}function Qbe(t){return Ba()?($c(t),!0):!1}function il(t){let e=!1,n;const r=oh(!0);return(...s)=>(e||(n=r.run(()=>t(...s)),e=!0),n)}const tW=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Xbe=Object.prototype.toString,Zbe=t=>Xbe.call(t)==="[object Object]",cd=()=>{},ewe=twe();function twe(){var t,e;return tW&&((t=window?.navigator)==null?void 0:t.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((e=window?.navigator)==null?void 0:e.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function nwe(...t){if(t.length!==1)return vp(...t);const e=t[0];return typeof e=="function"?Ac(vT(()=>({get:e,set:cd}))):Ae(e)}function rwe(t,e){function n(...r){return new Promise((s,i)=>{Promise.resolve(t(()=>e.apply(this,r),{fn:e,thisArg:this,args:r})).then(s).catch(i)})}return n}const nW=t=>t();function swe(t=nW,e={}){const{initialState:n="active"}=e,r=nwe(n==="active");function s(){r.value=!1}function i(){r.value=!0}return{isActive:Ac(r),pause:s,resume:i,eventFilter:(...a)=>{r.value&&t(...a)}}}function oC(t){return Array.isArray(t)?t:[t]}function iwe(t){return Sr()}function owe(t,e,n={}){const{eventFilter:r=nW,...s}=n;return ft(t,rwe(r,e),s)}function awe(t,e,n={}){const{eventFilter:r,initialState:s="active",...i}=n,{eventFilter:o,pause:a,resume:c,isActive:l}=swe(r,{initialState:s});return{stop:owe(t,e,{...i,eventFilter:o}),pause:a,resume:c,isActive:l}}function cwe(t,e=!0,n){iwe()?ka(t,n):e?t():zs(t)}function lwe(t,e,n){return ft(t,e,{...n,immediate:!0})}const up=tW?window:void 0;function pg(t){var e;const n=Pr(t);return(e=n?.$el)!=null?e:n}function Af(...t){const e=[],n=()=>{e.forEach(a=>a()),e.length=0},r=(a,c,l,d)=>(a.addEventListener(c,l,d),()=>a.removeEventListener(c,l,d)),s=$e(()=>{const a=oC(Pr(t[0])).filter(c=>c!=null);return a.every(c=>typeof c!="string")?a:void 0}),i=lwe(()=>{var a,c;return[(c=(a=s.value)==null?void 0:a.map(l=>pg(l)))!=null?c:[up].filter(l=>l!=null),oC(Pr(s.value?t[1]:t[0])),oC(Wt(s.value?t[2]:t[1])),Pr(s.value?t[3]:t[2])]},([a,c,l,d])=>{if(n(),!a?.length||!c?.length||!l?.length)return;const h=Zbe(d)?{...d}:d;e.push(...a.flatMap(p=>c.flatMap(g=>l.map(_=>r(p,g,_,h)))))},{flush:"post"}),o=()=>{i(),n()};return Qbe(n),o}let RV=!1;function q2e(t,e,n={}){const{window:r=up,ignore:s=[],capture:i=!0,detectIframe:o=!1,controls:a=!1}=n;if(!r)return a?{stop:cd,cancel:cd,trigger:cd}:cd;if(ewe&&!RV){RV=!0;const b={passive:!0};Array.from(r.document.body.children).forEach(w=>w.addEventListener("click",cd,b)),r.document.documentElement.addEventListener("click",cd,b)}let c=!0;const l=b=>Pr(s).some(w=>{if(typeof w=="string")return Array.from(r.document.querySelectorAll(w)).some(E=>E===b.target||b.composedPath().includes(E));{const E=pg(w);return E&&(b.target===E||b.composedPath().includes(E))}});function d(b){const w=Pr(b);return w&&w.$.subTree.shapeFlag===16}function h(b,w){const E=Pr(b),T=E.$.subTree&&E.$.subTree.children;return T==null||!Array.isArray(T)?!1:T.some(R=>R.el===w.target||w.composedPath().includes(R.el))}const p=b=>{const w=pg(t);if(b.target!=null&&!(!(w instanceof Element)&&d(t)&&h(t,b))&&!(!w||w===b.target||b.composedPath().includes(w))){if("detail"in b&&b.detail===0&&(c=!l(b)),!c){c=!0;return}e(b)}};let g=!1;const _=[Af(r,"click",b=>{g||(g=!0,setTimeout(()=>{g=!1},0),p(b))},{passive:!0,capture:i}),Af(r,"pointerdown",b=>{const w=pg(t);c=!l(b)&&!!(w&&!b.composedPath().includes(w))},{passive:!0}),o&&Af(r,"blur",b=>{setTimeout(()=>{var w;const E=pg(t);((w=r.document.activeElement)==null?void 0:w.tagName)==="IFRAME"&&!E?.contains(r.document.activeElement)&&e(b)},0)},{passive:!0})].filter(Boolean),v=()=>_.forEach(b=>b());return a?{stop:v,cancel:()=>{c=!1},trigger:b=>{c=!0,p(b),c=!1}}:v}function uwe(t){return typeof t=="function"?t:typeof t=="string"?e=>e.key===t:Array.isArray(t)?e=>t.includes(e.key):()=>!0}function j2e(...t){let e,n,r={};t.length===3?(e=t[0],n=t[1],r=t[2]):t.length===2?typeof t[1]=="object"?(e=!0,n=t[0],r=t[1]):(e=t[0],n=t[1]):(e=!0,n=t[0]);const{target:s=up,eventName:i="keydown",passive:o=!1,dedupe:a=!1}=r,c=uwe(e);return Af(s,i,d=>{d.repeat&&Pr(a)||c(d)&&n(d)},o)}const Cb=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ab="__vueuse_ssr_handlers__",dwe=hwe();function hwe(){return Ab in Cb||(Cb[Ab]=Cb[Ab]||{}),Cb[Ab]}function fwe(t,e){return dwe[t]||e}function pwe(t){return t==null?"any":t instanceof Set?"set":t instanceof Map?"map":t instanceof Date?"date":typeof t=="boolean"?"boolean":typeof t=="string"?"string":typeof t=="object"?"object":Number.isNaN(t)?"any":"number"}const mwe={boolean:{read:t=>t==="true",write:t=>String(t)},object:{read:t=>JSON.parse(t),write:t=>JSON.stringify(t)},number:{read:t=>Number.parseFloat(t),write:t=>String(t)},any:{read:t=>t,write:t=>String(t)},string:{read:t=>t,write:t=>String(t)},map:{read:t=>new Map(JSON.parse(t)),write:t=>JSON.stringify(Array.from(t.entries()))},set:{read:t=>new Set(JSON.parse(t)),write:t=>JSON.stringify(Array.from(t))},date:{read:t=>new Date(t),write:t=>t.toISOString()}},PV="vueuse-storage";function gwe(t,e,n,r={}){var s;const{flush:i="pre",deep:o=!0,listenToStorageChanges:a=!0,writeDefaults:c=!0,mergeDefaults:l=!1,shallow:d,window:h=up,eventFilter:p,onError:g=z=>{console.error(z)},initOnMounted:_}=r,v=(d?ht:Ae)(typeof e=="function"?e():e),b=$e(()=>Pr(t));if(!n)try{n=fwe("getDefaultStorage",()=>{var z;return(z=up)==null?void 0:z.localStorage})()}catch(z){g(z)}if(!n)return v;const w=Pr(e),E=pwe(w),T=(s=r.serializer)!=null?s:mwe[E],{pause:R,resume:N}=awe(v,z=>k(z),{flush:i,deep:o,eventFilter:p});ft(b,()=>M(),{flush:i});let O=!1;const S=z=>{_&&!O||M(z)},I=z=>{_&&!O||V(z)};h&&a&&(n instanceof Storage?Af(h,"storage",S,{passive:!0}):Af(h,PV,I)),_?cwe(()=>{O=!0,M()}):M();function P(z,ie){if(h){const K={key:b.value,oldValue:z,newValue:ie,storageArea:n};h.dispatchEvent(n instanceof Storage?new StorageEvent("storage",K):new CustomEvent(PV,{detail:K}))}}function k(z){try{const ie=n.getItem(b.value);if(z==null)P(ie,null),n.removeItem(b.value);else{const K=T.write(z);ie!==K&&(n.setItem(b.value,K),P(ie,K))}}catch(ie){g(ie)}}function L(z){const ie=z?z.newValue:n.getItem(b.value);if(ie==null)return c&&w!=null&&n.setItem(b.value,T.write(w)),w;if(!z&&l){const K=T.read(ie);return typeof l=="function"?l(K,w):E==="object"&&!Array.isArray(K)?{...w,...K}:K}else return typeof ie!="string"?ie:T.read(ie)}function M(z){if(!(z&&z.storageArea!==n)){if(z&&z.key==null){v.value=w;return}if(!(z&&z.key!==b.value)){R();try{const ie=T.write(v.value);(z===void 0||z?.newValue!==ie)&&(v.value=L(z))}catch(ie){g(ie)}finally{z?zs(N):N()}}}}function V(z){M(z.detail)}return v}function _we(t,e,n={}){const{window:r=up}=n;return gwe(t,e,r?.localStorage,n)}const aC=()=>{const t=Ks().public,e=t.releaseChannel||"development";return{channel:e,isProduction:e==="production",isBeta:e==="beta",isPreview:e==="preview",forceReloadDoc:t.forceReloadDoc||"forceReload_test",announcementDoc:t.announcementDoc||"announcement_test",homeMessageDoc:t.homeMessageDoc||"home-message_test"}},rr=il(()=>{const t=Ae("");return{setStoreId:w=>{t.value=w},storeId:t,browserRef:w=>$n(Cn,"browserId",w),getRootDataRef:()=>$n(Cn,"customers",t.value),getDoc:mu,getReceiptsCollectionRef:()=>
125cR(Cn,"customers",t.value,"__receipts"),getSummaryCollectionRef:()=>cR(Cn,"customers",t.value,"summary"),getReceiptCounterDocRef:w=>$n(Cn,"customers",t.value,"receipt-counters",w),getReceiptCounterNonceDocRef:(w,E)=>$n(Cn,"customers",t.value,"receipt-counters",w,"nonces",E),getFeatureBlockRef:()=>$n(Cn,"appState","feature_block"),getForceReloadRef:()=>$n(Cn,"appState",aC().forceReloadDoc),getAnnouncementRef:()=>$n(Cn,"appState",aC().announcementDoc),getHomeMessageRef:()=>$n(Cn,"appState",aC().homeMessageDoc),getFeatureFlagsRef:()=>$n(Cn,"appState","feature_flags"),getMigratedDocRef:()=>$n(Cn,"migrated",t.value),getBetaWhiteListRef:w=>$n(Cn,"beta_whitelist",w),getMobileLayoutRef:()=>$n(Cn,"customers",t.value,"data","mobile"),getTablesSummaryRef:()=>$n(Cn,"customers",t.value,"data","tables_summary")}}),rW="pwaDataCacheFlag";let Yh=null;function dD(){if(Yh!==null)return Yh;try{const t=localStorage.getItem(rW);if(!t)return Yh=!1,!1;Yh=JSON.parse(t)?.bypassCache===!0}catch{Yh=!1}return Yh}function ywe(t){try{localStorage.setItem(rW,JSON.stringify(t))}catch(e){console.warn("[pwaCacheFlag] localStorage write failed",e)}}const vwe=il(()=>{const t=Ae(dD()),e=Ae("default"),n=Ae(!1);let r=null,s=null,i,o;const a=h=>h===!0?!0:h===!1?!1:void 0;function c(){let h,p;o!==void 0?(h=o,p="store"):i!==void 0?(h=i,p="global"):(h=!1,p="default");const g=t.value;t.value=h,e.value=p,ywe({bypassCache:h,source:p,updatedAt:Date.now()}),g!==h&&console.log(`[pwaCacheFlag] bypass=${h} (source=${p}) â takes effect on next reload`)}function l(){if(n.value)return;const h=rr();r=xo(h.getFeatureFlagsRef(),p=>{if(p.metadata.fromCache)return;const g=p.data();i=a(g?.bypassDataCache),c()},p=>console.warn("[pwaCacheFlag] global snapshot error",p)),s=xo(h.getRootDataRef(),p=>{if(p.metadata.fromCache)return;const g=p.data();o=a(g?.featureFlags?.bypassDataCache),c()},p=>console.warn("[pwaCacheFlag] store snapshot error",p)),n.value=!0}function d(){r&&(r(),r=null),s&&(s(),s=null),n.value=!1}return{effectiveBypass:t,source:e,isWatching:n,startWatching:l,stopWatching:d}}),kV=new Map;function hD(t){const e=`general_${t}`;let n=kV.get(e);return n||(n=uD(e,"caches"),kV.set(e,n)),n}function bwe(t){return!!t&&typeof t=="object"&&"resource"in t&&"customerId"in t&&"data"in t}async function wwe(t,e){return dD()?null:xy(t,e)}async function xy(t,e){if(!t)return null;try{const n=await Q6(e,hD(t));if(n==null)return null;if(bwe(n))return n.resource!==e||n.customerId!==t?(console.warn(`[idbCache:${e}] envelope mismatch (resource=${n.resource}, customerId=${n.customerId})`),null):n;const r=n;return{resource:e,customerId:t,version:r.version??null,data:r.data,updatedAt:r.updatedAt??0}}catch(n){return console.warn(`[idbCache:${e}] read failed`,n),null}}async function Swe(t,e){return(await wwe(t,e))?.data??null}async function Ly(t,e,n,r=null){if(t)try{const s={resource:e,customerId:t,version:r,data:n,updatedAt:Date.now()};await X6(e,s,hD(t))}catch(s){console.warn(`[idbCache:${e}] write failed`,s)}}async function sW(t){if(t)try{await Z6(hD(t))}catch(e){console.warn("[idbCache] clear failed",e)}}function Twe(){return null}function Ewe(){return null}function W2e(){return""}function iW(t,e){return function(){return t.apply(e,arguments)}}const{toString:Iwe}=Object.prototype,{getPrototypeOf:fD}=Object,{iterator:AE,toStringTag:oW}=Symbol,RE=(t=>e=>{const n=Iwe.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Jo=t=>(t=t.toLowerCase(),e=>RE(e)===t),PE=t=>e=>typeof e===t,{isArray:Hp}=Array,dp=PE("undefined");function My(t){return t!==null&&!dp(t)&&t.constructor!==null&&!dp(t.constructor)&&vi(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const aW=Jo("ArrayBuffer");function Cwe(t){let e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&aW(t.buffer),e}const Awe=PE("string"),vi=PE("function"),cW=PE("number"),Vy=t=>t!==null&&typeof t=="object",Rwe=t=>t===!0||t===!1,lw=t=>{if(RE(t)!=="object")return!1;const e=fD(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(oW in t)&&!(AE in t)},Pwe=t=>{if(!Vy(t)||My(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch{return!1}},kwe=Jo("Date"),Nwe=Jo("File"),Dwe=Jo("Blob"),Owe=Jo("FileList"),xwe=t=>Vy(t)&&vi(t.pipe),Lwe=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||vi(t.a
vendor: 4,284 bytes, line 125
125ppend)&&((e=RE(t))==="formdata"||e==="object"&&vi(t.toString)&&t.toString()==="[object FormData]"))},Mwe=Jo("URLSearchParams"),[Vwe,Fwe,Bwe,$we]=["ReadableStream","Request","Response","Headers"].map(Jo),Uwe=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Fy(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t>"u")return;let r,s;if(typeof t!="object"&&(t=[t]),Hp(t))for(r=0,s=t.length;r<s;r++)e.call(null,t[r],r,t);else{if(My(t))return;const i=n?Object.getOwnPropertyNames(t):Object.keys(t),o=i.length;let a;for(r=0;r<o;r++)a=i[r],e.call(null,t[a],a,t)}}function lW(t,e){if(My(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r=n.length,s;for(;r-- >0;)if(s=n[r],e===s.toLowerCase())return s;return null}const Sd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,uW=t=>!dp(t)&&t!==Sd;function IR(){const{caseless:t,skipUndefined:e}=uW(this)&&this||{},n={},r=(s,i)=>{const o=t&&lW(n,i)||i;lw(n[o])&&lw(s)?n[o]=IR(n[o],s):lw(s)?n[o]=IR({},s):Hp(s)?n[o]=s.slice():(!e||!dp(s))&&(n[o]=s)};for(let s=0,i=arguments.length;s<i;s++)arguments[s]&&Fy(arguments[s],r);return n}const Hwe=(t,e,n,{allOwnKeys:r}={})=>(Fy(e,(s,i)=>{n&&vi(s)?t[i]=iW(s,n):t[i]=s},{allOwnKeys:r}),t),qwe=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),jwe=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Wwe=(t,e,n,r)=>{let s,i,o;const a={};if(e=e||{},t==null)return e;do{for(s=Object.getOwnPropertyNames(t),i=s.length;i-- >0;)o=s[i],(!r||r(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=n!==!1&&fD(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Gwe=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n},Kwe=t=>{if(!t)return null;if(Hp(t))return t;let e=t.length;if(!cW(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},zwe=(t=>e=>t&&e instanceof t)(typeof Uint8Array<"u"&&fD(Uint8Array)),Ywe=(t,e)=>{const r=(t&&t[AE]).call(t);let s;for(;(s=r.next())&&!s.done;){const i=s.value;e.call(t,i[0],i[1])}},Jwe=(t,e)=>{let n;const r=[];for(;(n=t.exec(e))!==null;)r.push(n);return r},Qwe=Jo("HTMLFormElement"),Xwe=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),NV=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),Zwe=Jo("RegExp"),dW=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Fy(n,(s,i)=>{let o;(o=e(s,i,t))!==!1&&(r[i]=o||s)}),Object.defineProperties(t,r)},eSe=t=>{dW(t,(e,n)=>{if(vi(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=t[n];if(vi(r)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},tSe=(t,e)=>{const n={},r=s=>{s.forEach(i=>{n[i]=!0})};return Hp(t)?r(t):r(String(t).split(e)),n},nSe=()=>{},rSe=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function sSe(t){return!!(t&&vi(t.append)&&t[oW]==="FormData"&&t[AE])}const iSe=t=>{const e=new Array(10),n=(r,s)=>{if(Vy(r)){if(e.indexOf(r)>=0)return;if(My(r))return r;if(!("toJSON"in r)){e[s]=r;const i=Hp(r)?[]:{};return Fy(r,(o,a)=>{const c=n(o,s+1);!dp(c)&&(i[a]=c)}),e[s]=void 0,i}}return r};return n(t,0)},oSe=Jo("AsyncFunction"),aSe=t=>t&&(Vy(t)||vi(t))&&vi(t.then)&&vi(t.catch),hW=((t,e)=>t?setImmediate:e?((n,r)=>(Sd.addEventListener("message",({source:s,data:i})=>{s===Sd&&i===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Sd.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",vi(Sd.postMessage)),cSe=typeof queueMicrotask<"u"?queueMicrotask.bind(Sd):typeof process<"u"&&process.nextTick||hW,lSe=t=>t!=null&&vi(t[AE]),me={isArray:Hp,isArrayBuffer:aW,isBuffer:My,isFormData:Lwe,isArrayBufferView:Cwe,isString:Awe,isNumber:cW,isBoolean:Rwe,isObject:Vy,isPlainObject:lw,isEmptyObject:Pwe,isReadableStream:Vwe,isRequest:Fwe,isResponse:Bwe,isHeaders:$we,isUndefined:dp,isDate:kwe,isFile:Nwe,isBlob:Dwe,isRegExp:Zwe,isFunction:vi,isStream:xwe,isURLSearchParams:Mwe,isTypedArray:zwe,isFileList:Owe,forEach:Fy,merge:IR,extend:Hwe,trim:Uwe,stripBOM:qwe,inherits:jwe,toFlatObject:Wwe,kindOf:RE,kindOfTest:Jo,endsWith:Gwe,toArray:Kwe,forEachEntry:Ywe,matchAll:Jwe,isHTMLF
vendor: 3,466 bytes, line 125
125orm:Qwe,hasOwnProperty:NV,hasOwnProp:NV,reduceDescriptors:dW,freezeMethods:eSe,toObjectSet:tSe,toCamelCase:Xwe,noop:nSe,toFiniteNumber:rSe,findKey:lW,global:Sd,isContextDefined:uW,isSpecCompliantForm:sSe,toJSONObject:iSe,isAsyncFn:oSe,isThenable:aSe,setImmediate:hW,asap:cSe,isIterable:lSe};function Nt(t,e,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}me.inherits(Nt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:me.toJSONObject(this.config),code:this.code,status:this.status}}});const fW=Nt.prototype,pW={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{pW[t]={value:t}});Object.defineProperties(Nt,pW);Object.defineProperty(fW,"isAxiosError",{value:!0});Nt.from=(t,e,n,r,s,i)=>{const o=Object.create(fW);me.toFlatObject(t,o,function(d){return d!==Error.prototype},l=>l!=="isAxiosError");const a=t&&t.message?t.message:"Error",c=e==null&&t?t.code:e;return Nt.call(o,a,c,n,r,s),t&&o.cause==null&&Object.defineProperty(o,"cause",{value:t,configurable:!0}),o.name=t&&t.name||"Error",i&&Object.assign(o,i),o};const uSe=null;function CR(t){return me.isPlainObject(t)||me.isArray(t)}function mW(t){return me.endsWith(t,"[]")?t.slice(0,-2):t}function DV(t,e,n){return t?t.concat(e).map(function(s,i){return s=mW(s),!n&&i?"["+s+"]":s}).join(n?".":""):e}function dSe(t){return me.isArray(t)&&!t.some(CR)}const hSe=me.toFlatObject(me,{},null,function(e){return/^is[A-Z]/.test(e)});function kE(t,e,n){if(!me.isObject(t))throw new TypeError("target must be an object");e=e||new FormData,n=me.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(v,b){return!me.isUndefined(b[v])});const r=n.metaTokens,s=n.visitor||d,i=n.dots,o=n.indexes,c=(n.Blob||typeof Blob<"u"&&Blob)&&me.isSpecCompliantForm(e);if(!me.isFunction(s))throw new TypeError("visitor must be a function");function l(_){if(_===null)return"";if(me.isDate(_))return _.toISOString();if(me.isBoolean(_))return _.toString();if(!c&&me.isBlob(_))throw new Nt("Blob is not supported. Use a Buffer instead.");return me.isArrayBuffer(_)||me.isTypedArray(_)?c&&typeof Blob=="function"?new Blob([_]):Buffer.from(_):_}function d(_,v,b){let w=_;if(_&&!b&&typeof _=="object"){if(me.endsWith(v,"{}"))v=r?v:v.slice(0,-2),_=JSON.stringify(_);else if(me.isArray(_)&&dSe(_)||(me.isFileList(_)||me.endsWith(v,"[]"))&&(w=me.toArray(_)))return v=mW(v),w.forEach(function(T,R){!(me.isUndefined(T)||T===null)&&e.append(o===!0?DV([v],R,i):o===null?v:v+"[]",l(T))}),!1}return CR(_)?!0:(e.append(DV(b,v,i),l(_)),!1)}const h=[],p=Object.assign(hSe,{defaultVisitor:d,convertValue:l,isVisitable:CR});function g(_,v){if(!me.isUndefined(_)){if(h.indexOf(_)!==-1)throw Error("Circular reference detected in "+v.join("."));h.push(_),me.forEach(_,function(w,E){(!(me.isUndefined(w)||w===null)&&s.call(e,w,me.isString(E)?E.trim():E,v,p))===!0&&g(w,v?v.concat(E):[E])}),h.pop()}}if(!me.isObject(t))throw new TypeError("data must be an object");return g(t),e}
vendor: 5,437 bytes, lines 125-126
125function OV(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(r){return e[r]})}function pD(t,e){this._pairs=[],t&&kE(t,this,e)}const gW=pD.prototype;gW.append=function(e,n){this._pairs.push([e,n])};gW.toString=function(e){const n=e?function(r){return e.call(this,r,OV)}:OV;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function fSe(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function _W(t,e,n){if(!e)return t;const r=n&&n.encode||fSe;me.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let i;if(s?i=s(e,n):i=me.isURLSearchParams(e)?e.toString():new pD(e,n).toString(r),i){const o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+i}return t}class xV{constructor(){this.handlers=[]}use(e,n,r){return this.handlers.push({fulfilled:e,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){me.forEach(this.handlers,function(r){r!==null&&e(r)})}}const yW={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},pSe=typeof URLSearchParams<"u"?URLSearchParams:pD,mSe=typeof FormData<"u"?FormData:null,gSe=typeof Blob<"u"?Blob:null,_Se={isBrowser:!0,classes:{URLSearchParams:pSe,FormData:mSe,Blob:gSe},protocols:["http","https","file","blob","url","data"]},mD=typeof window<"u"&&typeof document<"u",AR=typeof navigator=="object"&&navigator||void 0,ySe=mD&&(!AR||["ReactNative","NativeScript","NS"].indexOf(AR.product)<0),vSe=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",bSe=mD&&window.location.href||"http://localhost",wSe=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:mD,hasStandardBrowserEnv:ySe,hasStandardBrowserWebWorkerEnv:vSe,navigator:AR,origin:bSe},Symbol.toStringTag,{value:"Module"})),Ps={...wSe,..._Se};function SSe(t,e){return kE(t,new Ps.classes.URLSearchParams,{visitor:function(n,r,s,i){return Ps.isNode&&me.isBuffer(n)?(this.append(r,n.toString("base64")),!1):i.defaultVisitor.apply(this,arguments)},...e})}function TSe(t){return me.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function ESe(t){const e={},n=Object.keys(t);let r;const s=n.length;let i;for(r=0;r<s;r++)i=n[r],e[i]=t[i];return e}function vW(t){function e(n,r,s,i){let o=n[i++];if(o==="__proto__")return!0;const a=Number.isFinite(+o),c=i>=n.length;return o=!o&&me.isArray(s)?s.length:o,c?(me.hasOwnProp(s,o)?s[o]=[s[o],r]:s[o]=r,!a):((!s[o]||!me.isObject(s[o]))&&(s[o]=[]),e(n,r,s[o],i)&&me.isArray(s[o])&&(s[o]=ESe(s[o])),!a)}if(me.isFormData(t)&&me.isFunction(t.entries)){const n={};return me.forEachEntry(t,(r,s)=>{e(TSe(r),s,n,0)}),n}return null}function ISe(t,e,n){if(me.isString(t))try{return(e||JSON.parse)(t),me.trim(t)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(t)}const By={transitional:yW,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,i=me.isObject(e);if(i&&me.isHTMLForm(e)&&(e=new FormData(e)),me.isFormData(e))return s?JSON.stringify(vW(e)):e;if(me.isArrayBuffer(e)||me.isBuffer(e)||me.isStream(e)||me.isFile(e)||me.isBlob(e)||me.isReadableStream(e))return e;if(me.isArrayBufferView(e))return e.buffer;if(me.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return SSe(e,this.formSerializer).toString();if((a=me.isFileList(e))||r.indexOf("multipart/form-data")>-1){const c=this.env&&this.env.FormData;return kE(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return i||s?(n.setContentType("application/json",!1),ISe(e)):e}],transformResponse:[function(e){const n=this.transitional||By.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(me.isResponse(e)||me.isReadableStream(e))return e;if(e&&me.isString(e)&&(r&&!this.responseType||s)){const o=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(e,this.parseReviver)}catch(a){if(o)throw a.name==="SyntaxError"?Nt.from(a,Nt.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ps.classes.FormData,Blob:Ps.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};me.forEach(["delete","get","head","post","put","patch"],t=>{By.headers[t]={}});const CSe=me.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),ASe=t=>{const e={};let n,r,s;return t&&t.split(` 126`).forEach(function(o){s=o.indexOf(":"),n=o.substring(0,s).trim().toLowerCase(),r=o.substring(s+1).trim(),!(!n||e[n]&&CSe[n])&&(n==="set-cookie"?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e},LV=Symbol("internals");function Zm(t){return t&&String(t).trim().toLowerCase()}function uw(t){return t===!1||t==null?t:me.isArray(t)?t.map(uw):String(t)}function RSe(t){const e=Object.create(null),n=/([^\s,;
126=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}const PSe=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function cC(t,e,n,r,s){if(me.isFunction(r))return r.call(this,e,n);if(s&&(e=n),!!me.isString(e)){if(me.isString(r))return e.indexOf(r)!==-1;if(me.isRegExp(r))return r.test(e)}}function kSe(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,r)=>n.toUpperCase()+r)}function NSe(t,e){const n=me.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(s,i,o){return this[r].call(this,e,s,i,o)},configurable:!0})})}let bi=class{constructor(e){e&&this.set(e)}set(e,n,r){const s=this;function i(a,c,l){const d=Zm(c);if(!d)throw new Error("header name must be a non-empty string");const h=me.findKey(s,d);(!h||s[h]===void 0||l===!0||l===void 0&&s[h]!==!1)&&(s[h||c]=uw(a))}const o=(a,c)=>me.forEach(a,(l,d)=>i(l,d,c));if(me.isPlainObject(e)||e instanceof this.constructor)o(e,n);else if(me.isString(e)&&(e=e.trim())&&!PSe(e))o(ASe(e),n);else if(me.isObject(e)&&me.isIterable(e)){let a={},c,l;for(const d of e){if(!me.isArray(d))throw TypeError("Object iterator must return a key-value pair");a[l=d[0]]=(c=a[l])?me.isArray(c)?[...c,d[1]]:[c,d[1]]:d[1]}o(a,n)}else e!=null&&i(n,e,r);return this}get(e,n){if(e=Zm(e),e){const r=me.findKey(this,e);if(r){const s=this[r];if(!n)return s;if(n===!0)return RSe(s);if(me.isFunction(n))return n.call(this,s,r);if(me.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=Zm(e),e){const r=me.findKey(this,e);return!!(r&&this[r]!==void 0&&(!n||cC(this,this[r],r,n)))}return!1}delete(e,n){const r=this;let s=!1;function i(o){if(o=Zm(o),o){const a=me.findKey(r,o);a&&(!n||cC(r,r[a],a,n))&&(delete r[a],s=!0)}}return me.isArray(e)?e.forEach(i):i(e),s}clear(e){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const i=n[r];(!e||cC(this,this[i],i,e,!0))&&(delete this[i],s=!0)}return s}normalize(e){const n=this,r={};return me.forEach(this,(s,i)=>{const o=me.findKey(r,i);if(o){n[o]=uw(s),delete n[i];return}const a=e?kSe(i):String(i).trim();a!==i&&delete n[i],n[a]=uw(s),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const n=Object.create(null);return me.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=e&&me.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join(` 127`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[LV]=this[LV]={accessors:{}}).accessors,s=this.prototype;function i(o){const a=Zm(o);r[a]||(NSe(s,o),r[a]=!0)}return me.isArray(e)?e.forEach(i):i(e),this}};bi.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);me.reduceDescriptors(bi.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});me.freezeMethods(bi);function lC(t,e){const n=this||By,r=e||n,s=bi.from(r.headers);let i=r.data;return me.forEach(t,function(a){i=a.call(n,i,s.normalize(),e?e.status:void 0)}),s.normalize(),i}function bW(t){return!!(t&&t.__CANCEL__)}function qp(t,e,n){Nt.call(this,t??"canceled",Nt.ERR_CANCELED,e,n),this.name="CanceledError"}me.inherits(qp,Nt,{__CANCEL__:!0});function wW(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new Nt("Request failed with status code "+n.status,[Nt.ERR_BAD_REQUEST,Nt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function DSe(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function OSe(t,e){t=t||10;const n=new Array(t),r=new Array(t);let s=0,i=0,o;return e=e!==void 0?e:1e3,function(c){const l=Date.now(),d=r[i];o||(o=l),n[s]=c,r[s]=l;let h=i,p=0;for(;h!==s;)p+=n[h++],h=h%t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),l-o<e)return;const g=d&&l-d;return g?Math.round(p*1e3/g):void 0}}function xSe(t,e){let n=0,r=1e3/e,s,i;const o=(l,d=Date.now())=>{n=d,s=null,i&&(clearTimeout(i),i=null),t(...l)};return[(...l)=>{const d=Date.now(),h=d-n;h>=r?o(l,d):(s=l,i||(i=setTimeout(()=>{i=null,o(s)},r-h)))},()=>s&&o(s)]}const US=(t,e,n=3)=>{let r=0;const s=OSe(50,250);return xSe(i=>{const o=i.loaded,a=i.lengthComputable?i.total:void 0,c=o-r,l=s(c),d=o<=a;r=o;const h={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:l||void 0,estimated:l&&a&&d?(a-o)/l:void 0,event:i,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(h)},n)},MV=(t,e)=>{const n=t!=null;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},VV=t=>(...e)=>me.asap(()=>t(...e)),LSe=Ps.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Ps.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Ps.origin),Ps.navigator&&/(msie|trident)/i.test(Ps.navigator.userAgent)):()=>!0,MSe=Ps.hasStandardBrowserEnv?{write(t,e,n,r,s,i){const o=[t+"="+encodeURIComponent(e)];me.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),me.
vendor: 8,316 bytes, line 127
127isString(r)&&o.push("path="+r),me.isString(s)&&o.push("domain="+s),i===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function VSe(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function FSe(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function SW(t,e,n){let r=!VSe(e);return t&&(r||n==!1)?FSe(t,e):e}const FV=t=>t instanceof bi?{...t}:t;function sh(t,e){e=e||{};const n={};function r(l,d,h,p){return me.isPlainObject(l)&&me.isPlainObject(d)?me.merge.call({caseless:p},l,d):me.isPlainObject(d)?me.merge({},d):me.isArray(d)?d.slice():d}function s(l,d,h,p){if(me.isUndefined(d)){if(!me.isUndefined(l))return r(void 0,l,h,p)}else return r(l,d,h,p)}function i(l,d){if(!me.isUndefined(d))return r(void 0,d)}function o(l,d){if(me.isUndefined(d)){if(!me.isUndefined(l))return r(void 0,l)}else return r(void 0,d)}function a(l,d,h){if(h in e)return r(l,d);if(h in t)return r(void 0,l)}const c={url:i,method:i,data:i,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(l,d,h)=>s(FV(l),FV(d),h,!0)};return me.forEach(Object.keys({...t,...e}),function(d){const h=c[d]||s,p=h(t[d],e[d],d);me.isUndefined(p)&&h!==a||(n[d]=p)}),n}const TW=t=>{const e=sh({},t);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:i,headers:o,auth:a}=e;if(e.headers=o=bi.from(o),e.url=_W(SW(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),me.isFormData(n)){if(Ps.hasStandardBrowserEnv||Ps.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(me.isFunction(n.getHeaders)){const c=n.getHeaders(),l=["content-type","content-length"];Object.entries(c).forEach(([d,h])=>{l.includes(d.toLowerCase())&&o.set(d,h)})}}if(Ps.hasStandardBrowserEnv&&(r&&me.isFunction(r)&&(r=r(e)),r||r!==!1&&LSe(e.url))){const c=s&&i&&MSe.read(i);c&&o.set(s,c)}return e},BSe=typeof XMLHttpRequest<"u",$Se=BSe&&function(t){return new Promise(function(n,r){const s=TW(t);let i=s.data;const o=bi.from(s.headers).normalize();let{responseType:a,onUploadProgress:c,onDownloadProgress:l}=s,d,h,p,g,_;function v(){g&&g(),_&&_(),s.cancelToken&&s.cancelToken.unsubscribe(d),s.signal&&s.signal.removeEventListener("abort",d)}let b=new XMLHttpRequest;b.open(s.method.toUpperCase(),s.url,!0),b.timeout=s.timeout;function w(){if(!b)return;const T=bi.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),N={data:!a||a==="text"||a==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:T,config:t,request:b};wW(function(S){n(S),v()},function(S){r(S),v()},N),b=null}"onloadend"in b?b.onloadend=w:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(w)},b.onabort=function(){b&&(r(new Nt("Request aborted",Nt.ECONNABORTED,t,b)),b=null)},b.onerror=function(R){const N=R&&R.message?R.message:"Network Error",O=new Nt(N,Nt.ERR_NETWORK,t,b);O.event=R||null,r(O),b=null},b.ontimeout=function(){let R=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const N=s.transitional||yW;s.timeoutErrorMessage&&(R=s.timeoutErrorMessage),r(new Nt(R,N.clarifyTimeoutError?Nt.ETIMEDOUT:Nt.ECONNABORTED,t,b)),b=null},i===void 0&&o.setContentType(null),"setRequestHeader"in b&&me.forEach(o.toJSON(),function(R,N){b.setRequestHeader(N,R)}),me.isUndefined(s.withCredentials)||(b.withCredentials=!!s.withCredentials),a&&a!=="json"&&(b.responseType=s.responseType),l&&([p,_]=US(l,!0),b.addEventListener("progress",p)),c&&b.upload&&([h,g]=US(c),b.upload.addEventListener("progress",h),b.upload.addEventListener("loadend",g)),(s.cancelToken||s.signal)&&(d=T=>{b&&(r(!T||T.type?new qp(null,t,b):T),b.abort(),b=null)},s.cancelToken&&s.cancelToken.subscribe(d),s.signal&&(s.signal.aborted?d():s.signal.addEventListener("abort",d)));const E=DSe(s.url);if(E&&Ps.protocols.indexOf(E)===-1){r(new Nt("Unsupported protocol "+E+":",Nt.ERR_BAD_REQUEST,t));return}b.send(i||null)})},USe=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let r=new AbortController,s;const i=function(l){if(!s){s=!0,a();const d=l instanceof Error?l:this.reason;r.abort(d instanceof Nt?d:new qp(d instanceof Error?d.message:d))}};let o=e&&setTimeout(()=>{o=null,i(new Nt(`timeout ${e} of ms exceeded`,Nt.ETIMEDOUT))},e);const a=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),t=null)};t.forEach(l=>l.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>me.asap(a),c}},HSe=function*(t,e){let n=t.byteLength;if(n<e){yield t;return}let r=0,s;for(;r<n;)s=r+e,yield t.slice(r,s),r=s},qSe=async function*(t,e){for await(const n of jSe(t))yield*HSe(n,e)},jSe=async function*(t){if(t[Symbol.asyncIterator]){yield*t;return}const e=t.getReader();try{for(;;){const{done:n,value:r}=await e.read();if(n)break;yield r}}finally{await e.cancel()}},BV=(t,e,n,r)=>{const s=qSe(t,e);let i=0,o,a=c=>{o||(o=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:l,value:d}=await s.next();if(l){a(),c.close();return}let h=d.byteLength;if(n){let p=i+=h;n(p)}c.enqueue(new Uint8Array(d))}catch(l){throw a(l),l}},cancel(c){return a(c),s.return()}},{highWaterMark:2})},$V=64*1024,{isFunction:Rb}=me,WSe=(({Request:t,Response:e})=>({Request:t,Response:e}))(me.global),{ReadableStream:UV,TextEncoder:HV}=me.global,qV=(t,...e)=>{try{return!!t(...e)}catch{return!1}},GSe=t=>{t=me.merge.call({skipUndefined:!0},WSe,t);const{fetch:e,Request:n,Response:r}=t,s=e?Rb(e):typeof fetch=="function",i=Rb(n),o=Rb(r);if(!s)return!1;const a=s&&Rb(UV),c=s&&(typeof HV=="function"?(_=>v=>_.encode(v))(new HV):async _=>new Uint8Array(await new n(_).arrayBuffer())),l=i&&a&&qV(()=>{let _=!1;const v=new n(Ps.origin,{body:new UV,method:"POST",get duplex(){return _=!0,"half"}}).headers.has("Content-Type");return _&&!v}),d=o&&a&&qV(()=>me.isReadableStream(new r("").body)),h={stream:d&&(_=>_.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(_=>{!h[_]&&(h[_]=(v,b)=>{let w=v&&v[_];if(w)return w.call(v);throw new Nt(`Response type '${_}' is not supported`,Nt.ERR_NOT_SUPPORT,b)})});const p=async _=>{if(_==null)return 0;if(me.isBlob(_))return _.size;if(me.isSpecCompliantForm(_))return(await new n(Ps.origin,{method:"POST",body:_}).arrayBuffer()).byteLength;if(me.isArrayBufferView(_)||me.isArrayBuffer(_))return _.byteLength;if(me.isURLSearchParams(_)&&(_=_+""),me.isString(_))return(await c(_)).byteLength},g=async(_,v)=>{const b=me.toFiniteNumber(_.getContentLength());return b??p(v)};return async _=>{let{url:v,method:b,data:w,signal:E,cancelToken:T,timeout:R,onDownloadProgress:N,onUploadProgress:O,responseType:S,headers:I,withCredentials:P="same-origin",fetchOptions:k}=TW(_),L=e||fetch;S=S?(S+"").toLowerCase():"text";let M=USe([E,T&&T.toAbortSignal()],R),V=null;const z=M&&M.unsubscribe&&(()=>{M.unsubscribe()});let ie;try{if(O&&l&&b!=="get"&&b!=="head"&&(ie=await g(I,w))!==0){let fe=new n(v,{method:"POST",body:w,duplex:"half"}),ee;if(me.isFormData(w)&&(ee=fe.headers.get("content-type"))&&I.setContentType(ee),fe.body){const[Te,pe]=MV(ie,US(VV(O)));w=BV(fe.body,$V,Te,pe)}}me.isString(P)||(P=P?"include":"omit");const K=i&&"credentials"in n.prototype,ce={...k,signal:M,method:b.toUpperCase(),headers:I.normalize().toJSON(),body:w,duplex:"half",credentials:K?P:void 0};V=i&&new n(v,ce);let G=await(i?L(V,k):L(v,ce));const Z=d&&(S==="stream"||S==="response");if(d&&(N||Z&&z)){const fe={};["status","statusText","headers"].forEach(Ce=>{fe[Ce]=G[Ce]});const ee=me.toFiniteNumber(G.headers.get("content-length")),[Te,pe]=N&&MV(ee,US(VV(N),!0))||[];G=new r(BV(G.body,$V,Te,()=>{pe&&pe(),z&&z()}),fe)}S=S||"text";let de=await h[me.findKey(h,S)||"text"](G,_);return!Z&&z&&z(),await new Promise((fe,ee)=>
vendor: 4,680 bytes, lines 127-130
127{wW(fe,ee,{data:de,headers:bi.from(G.headers),status:G.status,statusText:G.statusText,config:_,request:V})})}catch(K){throw z&&z(),K&&K.name==="TypeError"&&/Load failed|fetch/i.test(K.message)?Object.assign(new Nt("Network Error",Nt.ERR_NETWORK,_,V),{cause:K.cause||K}):Nt.from(K,K&&K.code,_,V)}}},KSe=new Map,EW=t=>{let e=t?t.env:{};const{fetch:n,Request:r,Response:s}=e,i=[r,s,n];let o=i.length,a=o,c,l,d=KSe;for(;a--;)c=i[a],l=d.get(c),l===void 0&&d.set(c,l=a?new Map:GSe(e)),d=l;return l};EW();const RR={http:uSe,xhr:$Se,fetch:{get:EW}};me.forEach(RR,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const jV=t=>`- ${t}`,zSe=t=>me.isFunction(t)||t===null||t===!1,IW={getAdapter:(t,e)=>{t=me.isArray(t)?t:[t];const{length:n}=t;let r,s;const i={};for(let o=0;o<n;o++){r=t[o];let a;if(s=r,!zSe(r)&&(s=RR[(a=String(r)).toLowerCase()],s===void 0))throw new Nt(`Unknown adapter '${a}'`);if(s&&(me.isFunction(s)||(s=s.get(e))))break;i[a||"#"+o]=s}if(!s){const o=Object.entries(i).map(([c,l])=>`adapter ${c} `+(l===!1?"is not supported by the environment":"is not available in the build"));let a=n?o.length>1?`since : 128`+o.map(jV).join(` 129`):" "+jV(o[0]):"as no adapter specified";throw new Nt("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return s},adapters:RR};function uC(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new qp(null,t)}function WV(t){return uC(t),t.headers=bi.from(t.headers),t.data=lC.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),IW.getAdapter(t.adapter||By.adapter,t)(t).then(function(r){return uC(t),r.data=lC.call(t,t.transformResponse,r),r.headers=bi.from(r.headers),r},function(r){return bW(r)||(uC(t),r&&r.response&&(r.response.data=lC.call(t,t.transformResponse,r.response),r.response.headers=bi.from(r.response.headers))),Promise.reject(r)})}const CW="1.12.2",NE={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{NE[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const GV={};NE.transitional=function(e,n,r){function s(i,o){return"[Axios v"+CW+"] Transitional option '"+i+"'"+o+(r?". "+r:"")}return(i,o,a)=>{if(e===!1)throw new Nt(s(o," has been removed"+(n?" in "+n:"")),Nt.ERR_DEPRECATED);return n&&!GV[o]&&(GV[o]=!0,console.warn(s(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(i,o,a):!0}};NE.spelling=function(e){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function YSe(t,e,n){if(typeof t!="object")throw new Nt("options must be an object",Nt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let s=r.length;for(;s-- >0;){const i=r[s],o=e[i];if(o){const a=t[i],c=a===void 0||o(a,i,t);if(c!==!0)throw new Nt("option "+i+" must be "+c,Nt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Nt("Unknown option "+i,Nt.ERR_BAD_OPTION)}}const dw={assertOptions:YSe,validators:NE},la=dw.validators;let Md=class{constructor(e){this.defaults=e||{},this.interceptors={request:new xV,response:new xV}}async request(e,n){try{return await this._request(e,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const i=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` 130`+i):r.stack=i}catch{}}throw r}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=sh(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:i}=n;r!==void 0&&dw.assertOptions(r,{silentJSONParsing:la.transitional(la.boolean),forcedJSONParsing:la.transitional(la.boolean),clarifyTimeoutError:la.transitional(la.boolean)},!1),s!=null&&(me.isFunction(s)?n.paramsSerializer={serialize:s}:dw.assertOptions(s,{encode:la.function,serialize:la.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),dw.assertOptions(n,{baseUrl:la.spelling("baseURL"),withXsrfToken:la.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=i&&me.merge(i.common,i[n.method]);i&&me.forEach(["delete","get","head","post","put","patch","common"],_=>{delete i[_]}),n.headers=bi.concat(o,i);const a=[];let c=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(c=c&&v.synchronous,a.unshift(v.fulfilled,v.rejected))});const l=[];this.interceptors.response.forEach(function(v){l.push(v.fulfilled,v.rejected)});let d,h=0,p;if(!c){const _=[WV.bind(this),void 0];
vendor: 2,106 bytes, line 130
130for(_.unshift(...a),_.push(...l),p=_.length,d=Promise.resolve(n);h<p;)d=d.then(_[h++],_[h++]);return d}p=a.length;let g=n;for(;h<p;){const _=a[h++],v=a[h++];try{g=_(g)}catch(b){v.call(this,b);break}}try{d=WV.call(this,g)}catch(_){return Promise.reject(_)}for(h=0,p=l.length;h<p;)d=d.then(l[h++],l[h++]);return d}getUri(e){e=sh(this.defaults,e);const n=SW(e.baseURL,e.url,e.allowAbsoluteUrls);return _W(n,e.params,e.paramsSerializer)}};me.forEach(["delete","get","head","options"],function(e){Md.prototype[e]=function(n,r){return this.request(sh(r||{},{method:e,url:n,data:(r||{}).data}))}});me.forEach(["post","put","patch"],function(e){function n(r){return function(i,o,a){return this.request(sh(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:o}))}}Md.prototype[e]=n(),Md.prototype[e+"Form"]=n(!0)});let JSe=class AW{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(s=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](s);r._listeners=null}),this.promise.then=s=>{let i;const o=new Promise(a=>{r.subscribe(a),i=a}).then(s);return o.cancel=function(){r.unsubscribe(i)},o},e(function(i,o,a){r.reason||(r.reason=new qp(i,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const e=new AbortController,n=r=>{e.abort(r)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new AW(function(s){e=s}),cancel:e}}};function QSe(t){return function(n){return t.apply(null,n)}}function XSe(t){return me.isObject(t)&&t.isAxiosError===!0}const PR={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,Parti
vendor: 6,134 bytes, line 130
130alContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(PR).forEach(([t,e])=>{PR[e]=t});function RW(t){const e=new Md(t),n=iW(Md.prototype.request,e);return me.extend(n,Md.prototype,e,{allOwnKeys:!0}),me.extend(n,e,null,{allOwnKeys:!0}),n.create=function(s){return RW(sh(t,s))},n}const Fn=RW(By);Fn.Axios=Md;Fn.CanceledError=qp;Fn.CancelToken=JSe;Fn.isCancel=bW;Fn.VERSION=CW;Fn.toFormData=kE;Fn.AxiosError=Nt;Fn.Cancel=Fn.CanceledError;Fn.all=function(e){return Promise.all(e)};Fn.spread=QSe;Fn.isAxiosError=XSe;Fn.mergeConfig=sh;Fn.AxiosHeaders=bi;Fn.formToJSON=t=>vW(me.isHTMLForm(t)?new FormData(t):t);Fn.getAdapter=IW.getAdapter;Fn.HttpStatusCode=PR;Fn.default=Fn;const{Axios:z2e,AxiosError:Y2e,CanceledError:J2e,isCancel:Q2e,CancelToken:X2e,VERSION:Z2e,all:eVe,Cancel:tVe,isAxiosError:nVe,spread:rVe,toFormData:sVe,AxiosHeaders:iVe,HttpStatusCode:oVe,formToJSON:aVe,getAdapter:cVe,mergeConfig:lVe}=Fn;var hw={exports:{}},ZSe=hw.exports,KV;function eTe(){return KV||(KV=1,(function(t,e){(function(n,r){t.exports=r()})(ZSe,(function(){var n=1e3,r=6e4,s=36e5,i="millisecond",o="second",a="minute",c="hour",l="day",d="week",h="month",p="quarter",g="year",_="date",v="Invalid Date",b=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(z){var ie=["th","st","nd","rd"],K=z%100;return"["+z+(ie[(K-20)%10]||ie[K]||ie[0])+"]"}},T=function(z,ie,K){var ce=String(z);return!ce||ce.length>=ie?z:""+Array(ie+1-ce.length).join(K)+z},R={s:T,z:function(z){var ie=-z.utcOffset(),K=Math.abs(ie),ce=Math.floor(K/60),G=K%60;return(ie<=0?"+":"-")+T(ce,2,"0")+":"+T(G,2,"0")},m:function z(ie,K){if(ie.date()<K.date())return-z(K,ie);var ce=12*(K.year()-ie.year())+(K.month()-ie.month()),G=ie.clone().add(ce,h),Z=K-G<0,de=ie.clone().add(ce+(Z?-1:1),h);return+(-(ce+(K-G)/(Z?G-de:de-G))||0)},a:function(z){return z<0?Math.ceil(z)||0:Math.floor(z)},p:function(z){return{M:h,y:g,w:d,d:l,D:_,h:c,m:a,s:o,ms:i,Q:p}[z]||String(z||"").toLowerCase().replace(/s$/,"")},u:function(z){return z===void 0}},N="en",O={};O[N]=E;var S="$isDayjsObject",I=function(z){return z instanceof M||!(!z||!z[S])},P=function z(ie,K,ce){var G;if(!ie)return N;if(typeof ie=="string"){var Z=ie.toLowerCase();O[Z]&&(G=Z),K&&(O[Z]=K,G=Z);var de=ie.split("-");if(!G&&de.length>1)return z(de[0])}else{var fe=ie.name;O[fe]=ie,G=fe}return!ce&&G&&(N=G),G||!ce&&N},k=function(z,ie){if(I(z))return z.clone();var K=typeof ie=="object"?ie:{};return K.date=z,K.args=arguments,new M(K)},L=R;L.l=P,L.i=I,L.w=function(z,ie){return k(z,{locale:ie.$L,utc:ie.$u,x:ie.$x,$offset:ie.$offset})};var M=(function(){function z(K){this.$L=P(K.locale,null,!0),this.parse(K),this.$x=this.$x||K.x||{},this[S]=!0}var ie=z.prototype;return ie.parse=function(K){this.$d=(function(ce){var G=ce.date,Z=ce.utc;if(G===null)return new Date(NaN);if(L.u(G))return new Date;if(G instanceof Date)return new Date(G);if(typeof G=="string"&&!/Z$/i.test(G)){var de=G.match(b);if(de){var fe=de[2]-1||0,ee=(de[7]||"0").substring(0,3);return Z?new Date(Date.UTC(de[1],fe,de[3]||1,de[4]||0,de[5]||0,de[6]||0,ee)):new Date(de[1],fe,de[3]||1,de[4]||0,de[5]||0,de[6]||0,ee)}}return new Date(G)})(K),this.init()},ie.init=function(){var K=this.$d;this.$y=K.getFullYear(),this.$M=K.getMonth(),this.$D=K.getDate(),this.$W=K.getDay(),this.$H=K.getHours(),this.$m=K.getMinutes(),this.$s=K.getSeconds(),this.$ms=K.getMilliseconds()},ie.$utils=function(){return L},ie.isValid=function(){return this.$d.toString()!==v},ie.isSame=function(K,ce){var G=k(K);return this.startOf(ce)<=G&&G<=this.endOf(ce)},ie.isAfter=function(K,ce){return k(K)<this.startOf(ce)},ie.isBefore=function(K,ce){return this.endOf(ce)<k(K)},ie.$g=function(K,ce,G){return L.u(K)?this[ce]:this.set(G,K)},ie.unix=function(){return Math.floor(this.valueOf()/1e3)},ie.valueOf=function(){return this.$d.getTime()},ie.startOf=function(K,ce){var G=this,Z=!!L.u(ce)||ce,de=L.p(K),fe=function(Ee,Me){var Ke=L.w(G.$u?Date.UTC(G.$y,Me,Ee):new Date(G.$y,Me,Ee),G);return Z?Ke:Ke.endOf(l)},ee=function(Ee,Me){return L.w(G.toDate()[Ee].apply(G.toDate("s"),(Z?[0,0,0,0]:[23,59,59,999]).slice(Me)),G)},Te=this.$W,pe=this.$M,Ce=this.$D,Ve="set"+(this.$u?"UTC":"");switch(de){case g:return Z?fe(1,0):fe(31,11);case h:return Z?fe(1,pe):fe(0,pe+1);case d:var Y=this.$locale().weekStart||0,ve=(Te<Y?Te+7:Te)-Y;return fe(Z?Ce-ve:Ce+(6-ve),pe);case l:case _:return ee(Ve+"Hours",0);case c:return ee(Ve+"Minutes",1);case a:return ee(Ve+"Seconds",2);case o:return ee(Ve+"Milliseconds",3);default:return this.clone()}},ie.endOf=function(K){return this.startOf(K,!1)},ie.$set=function(K,ce){var G,Z=L.p(K),de="set"+(this.$u?"UTC":""),fe=(G={},G[l]=de+"Date",G[_]=de+"Date",G[h]=de+"Month",G[g]=de+"FullYear",G[c]=de+"Hours",G[a]=de+"Minutes",G[o]=de+"Seconds",G[i]=de+"Milliseconds",G)[Z],ee=Z===l?this.$D+(ce-this.$W):ce;if(Z===h||Z===g){var Te=this.clone().set(_,1);
130Te.$d[fe](ee),Te.init(),this.$d=Te.set(_,Math.min(this.$D,Te.daysInMonth())).$d}else fe&&this.$d[fe](ee);return this.init(),this},ie.set=function(K,ce){return this.clone().$set(K,ce)},ie.get=function(K){return this[L.p(K)]()},ie.add=function(K,ce){var G,Z=this;K=Number(K);var de=L.p(ce),fe=function(pe){var Ce=k(Z);return L.w(Ce.date(Ce.date()+Math.round(pe*K)),Z)};if(de===h)return this.set(h,this.$M+K);if(de===g)return this.set(g,this.$y+K);if(de===l)return fe(1);if(de===d)return fe(7);var ee=(G={},G[a]=r,G[c]=s,G[o]=n,G)[de]||1,Te=this.$d.getTime()+K*ee;return L.w(Te,this)},ie.subtract=function(K,ce){return this.add(-1*K,ce)},ie.format=function(K){var ce=this,G=this.$locale();if(!this.isValid())return G.invalidDate||v;var Z=K||"YYYY-MM-DDTHH:mm:ssZ",de=L.z(this),fe=this.$H,ee=this.$m,Te=this.$M,pe=G.weekdays,Ce=G.months,Ve=G.meridiem,Y=function(Me,Ke,ut,H){return Me&&(Me[Ke]||Me(ce,Z))||ut[Ke].slice(0,H)},ve=function(Me){return L.s(fe%12||12,Me,"0")},Ee=Ve||function(Me,Ke,ut){var H=Me<12?"AM":"PM";return ut?H.toLowerCase():H};return Z.replace(w,(function(Me,Ke){return Ke||(function(ut){switch(ut){case"YY":return String(ce.$y).slice(-2);case"YYYY":return L.s(ce.$y,4,"0");case"M":return Te+1;case"MM":return L.s(Te+1,2,"0");case"MMM":return Y(G.monthsShort,Te,Ce,3);case"MMMM":return Y(Ce,Te);case"D":return ce.$D;case"DD":return L.s(ce.$D,2,"0");case"d":return String(ce.$W);case"dd":return Y(G.weekdaysMin,ce.$W,pe,2);case"ddd":return Y(G.weekdaysShort,ce.$W,pe,3);case"dddd":return pe[ce.$W];case"H":return String(fe);case"HH":return L.s(fe,2,"0");case"h":return ve(1);case"hh":return ve(2);case"a":return Ee(fe,ee,!0);case"A":return Ee(fe,ee,!1);case"m":return String(ee);case"mm":return L.s(ee,2,"0");case"s":return String(ce.$s);case"ss":return L.s(ce.$s,2,"0");case"SSS":return L.s(ce.$ms,3,"0");case"Z":return de}return null})(Me)||de.replace(":","")}))},ie.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},ie.diff=function(K,ce,G){var Z,de=this,fe=L.p(ce),ee=k(K),Te=(ee.utcOffset()-this.utcOffset())*r,pe=this-ee,Ce=function(){return L.m(de,ee)};switch(fe){case g:Z=Ce()/12;break;case h:Z=Ce();break;case p:Z=Ce()/3;break;case d:Z=(pe-Te)/6048e5;break;case l:Z=(pe-Te)/864e5;break;case c:Z=pe/s;break;case a:Z=pe/r;break;case o:Z=pe/n;break;default:Z=pe}return G?Z:L.a(Z)},ie.daysInMonth=function(){return this.endOf(h).$D},ie.$locale=function(){return O[this.$L]},ie.locale=function(K,ce){if(!K)return this.$L;var G=this.clone(),Z=P(K,ce,!0);return Z&&(G.$L=Z),G},ie.clone=function(){return L.w(this.$d,this)},ie.toDate=function(){return new Date(this.valueOf())},ie.toJSON=function(){return this.isValid()?this.toISOString():null},ie.toISOString=function(){return this.$d.toISOString()},ie.toString=function(){return this.$d.toUTCString()},z})(),V=M.prototype;return k.prototype=V,[["$ms",i],["$s",o],["$m",a],["$H",c],["$W",l],["$M",h],["$y",g],["$D",_]].forEach((function(z){V[z[1]]=function(ie){return this.$g(ie,z[0],z[1])}})),k.extend=function(z,ie){return z.$i||(z(ie,M,k),z.$i=!0),k},k.locale=P,k.isDayjs=I,k.unix=function(z){return k(1e3*z)},k.en=O[N],k.Ls=O,k.p={},k}))})(hw)),hw.exports}var tTe=eTe();const Ne=lD(tTe),un=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,en=globalThis,$g="10.55.0";function ph(){return DE(en),en}function DE(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||$g,e[$g]=e[$g]||{}}function OE(t,e,n=en){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[$g]=r[$g]||{};return s[t]||(s[t]=e())}const uVe=["debug","info","warn","error","log","assert","trace"],nTe="Sentry Logger ",zV={};function jp(t){if(!("console"in en))return t();const e=en.console,n={},r=Object.keys(zV);r.forEach(s=>{const i=zV[s];n[s]=e[s],e[s]=i});try{return t()}finally{r.forEach(s=>{e[s]=n[s]})}}function rTe(){_D().enabled=!0}function sTe(){_D().enabled=!1}function PW(){return _D().enabled}function iTe(...t){gD("log",...t)}function oTe(...t){gD("warn",...t)}function aTe(...t){gD("error",...t)}function gD(t,...e){un&&PW()&&jp(()=>{en.console[t](`${nTe}[${t}]:`,...e)})}function _D(){return un?OE("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const mt={enable:rTe,disable:sTe,isEnabled:PW,log:iTe,warn:oTe,error:aTe},kW=50,cTe="?",YV=/\(error: (.*)\)/,JV=/captureMessage|captureException/;function lTe(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,s=0)=>{const i=[],o=n.split(` 131`);for(let a=r;a<o.length;a++){let c=o[a];c.length>1024&&(c=c.slice(0,1024));const l=YV.test(c)?c.replace(YV,"$1"):c;if(!l.includes("Error: ")){for(const d of e){const h=d(l);if(h){i.push(h);break}}if(i.length>=kW+s)break}}return uTe(i.slice(s))}}function dVe(t){return Array.isArray(t)?lTe(...t):t}function uTe(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(Pb(e).function||"")&&e.pop(),e.reverse(),JV.test(Pb(e).function||"")&&(e.pop(),JV.test(Pb(e).function||"")&&e.pop()),e.slice(0,kW).map(n=>({...n,filename:n.filename||Pb(e).filename,function:n.function||cTe}))}function Pb(t){return t[t.length-1]||{}}const dC="<anonymous>";function yD(t){try{return!t||typeof t!="function"?dC:t.name||dC}catch{return dC}}function hVe(t){const e=t.exception;if(e){const n=[];
131try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}const mg={},QV={};function Wp(t,e){return mg[t]=mg[t]||[],mg[t].push(e),()=>{const n=mg[t];if(n){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}}}function Gp(t,e){if(!QV[t]){QV[t]=!0;try{e()}catch(n){un&&mt.error(`Error while instrumenting ${t}`,n)}}}function Ca(t,e){const n=t&&mg[t];if(n)for(const r of n)try{r(e)}catch(s){un&&mt.error(`Error while triggering instrumentation handler. 132Type: ${t} 133Name: ${yD(r)} 134Error:`,s)}}let hC=null;function dTe(t){const e="error";Wp(e,t),Gp(e,hTe)}function hTe(){hC=en.onerror,en.onerror=function(t,e,n,r,s){return Ca("error",{column:r,error:s,line:n,msg:t,url:e}),hC?hC.apply(this,arguments):!1},en.onerror.__SENTRY_INSTRUMENTED__=!0}let fC=null;function fTe(t){const e="unhandledrejection";Wp(e,t),Gp(e,pTe)}function pTe(){fC=en.onunhandledrejection,en.onunhandledrejection=function(t){return Ca("unhandledrejection",t),fC?fC.apply(this,arguments):!0},en.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const NW=Object.prototype.toString;function DW(t){switch(NW.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return LE(t,Error)}}function Kp(t,e){return NW.call(t)===`[object ${e}]`}function fVe(t){return Kp(t,"ErrorEvent")}function pVe(t){return Kp(t,"DOMError")}function mVe(t){return Kp(t,"DOMException")}function ru(t){return Kp(t,"String")}function mTe(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function kR(t){return t===null||mTe(t)||typeof t!="object"&&typeof t!="function"}function gTe(t){return Kp(t,"Object")}function _Te(t){return typeof Event<"u"&&LE(t,Event)}function yTe(t){return Kp(t,"RegExp")}function xE(t){return!!(t?.then&&typeof t.then=="function")}function LE(t,e){try{return t instanceof e}catch{return!1}}function vD(t){return typeof Request<"u"&&LE(t,Request)}function NR(t,e,n){if(!(e in t))return;const r=t[e];if(typeof r!="function")return;const s=n(r);typeof s=="function"&&OW(s,r);try{t[e]=s}catch{un&&mt.log(`Failed to replace method "${e}" in object`,t)}}function vo(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{un&&mt.log(`Failed to add non-enumerable property "${String(e)}" to object`,t)}}function OW(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,vo(t,"__sentry_original__",e)}catch{}}function vTe(t){return t.__sentry_original__}function xW(t){if(DW(t))return{message:t.message,name:t.name,stack:t.stack,...XV(t)};if(_Te(t)){const{type:e,target:n,currentTarget:r,detail:s}=t;return{type:e,target:n,currentTarget:r,...s?{detail:s}:{},...XV(t)}}return t}function XV(t){return typeof t=="object"&&t!==null?Object.fromEntries(Object.entries(t)):{}}function gVe(t){const e=Object.keys(xW(t));return e.sort(),e[0]?e.join(", "):"[object has no keys]"}let Jh;function $y(t){if(Jh!==void 0)return Jh?Jh(t):t();const e=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=en;return e in n&&typeof n[e]=="function"?(Jh=n[e],Jh(t)):(Jh=null,t())}function Vd(){return $y(()=>Math.random())}function LW(){return $y(()=>Date.now())}const bTe=Symbol.for("sentry.skipNormalization"),wTe=Symbol.for("sentry.overrideNormalizationDepth");function STe(t){return!!t[bTe]}function TTe(t){const e=t[wTe];return typeof e=="number"?e:void 0}let DR;function _Ve(t){DR=t}function pc(t,e=100,n=1/0){try{return OR("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function ETe(t,e=3,n=100*1024){const r=pc(t,e);return ATe(r)>n?ETe(t,e-1,n):r}function OR(t,e,n=1/0,r=1/0,s=RTe()){const[i,o]=s;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;const a=MW(t,e);if(!a.startsWith("[object "))return a;if(STe(e))return e;const c=TTe(e),l=c!==void 0?c:n;if(l===0)return a.replace("object ","");if(i(e))return"[Circular ~]";const d=e;if(d&&typeof d.toJSON=="function")try{const _=d.toJSON();return OR("",_,l-1,r,s)}catch{}const h=Array.isArray(e)?[]:{};let p=0;const g=xW(e);for(const _ in g){if(!Object.prototype.hasOwnProperty.call(g,_))continue;if(p>=r){h[_]="[MaxProperties ~]";break}const v=g[_];h[_]=OR(_,v,l-1,r,s),p++}return o(e),h}function MW(t,e){try{if(DR){const r=DR(e);if(r)return r}return typeof global<"u"&&e===global?"[Global]":typeof e=="number"&&!Number.isFinite(e)?`[${e}]`:typeof e=="function"?`[Function: ${yD(e)}]`:typeof e=="symbol"?`[${String(e)}]`:typeof e=="bigint"?`[BigInt: ${String(e)}]`:`[object ${ITe(e)}]`}catch(n){return`**non-serializable** (${n})`}}function ITe(t){const e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function CTe(t){return~-encodeURI(t).split(/%..|./).length}function ATe(t){return CTe(JSON.stringify(t))}function RTe(){const t=new WeakSet;function e(r){return t.has(r)?!0:(t.add(r),!1)}function n(r){t.delete(r)}return[e,n]}function xR(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function yVe(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const s=t[r];kR(s)?n.push(String(s)):s instanceof Error?n.push(s.message?`${s.name}: ${s.message}`:s.name):n.push(MW(void 0,s))}return n.join(e)}function Ug(t,e,n=!1){return ru(t)?yTe(e)?e.test(t):ru(e)?n?t===e:t.includes(e):typeof e=="function"?e(t):!1:!1}function fw(t,e=[],n=!1){for(const r of e)if(Ug(t,r,n))return!0;return!1}function PTe(){const t=en;return t.crypto||t.msCrypto}let pC;function kTe(){return Vd()*16}function su(t=PTe()){try{if(t?.randomUUID)return $y(()=>t.randomUUID()).replace(/-/g,"")}catch{}return pC||(pC="10000000100040008000"+1e11),pC.replace(/[018]/g,e=>(e^(kTe()&15)>>e/4).toString(16))}function VW(t){return t.exception?.values?.[0]}function vVe(t){const{message:e,event_id:n}=t;if(e)return e;const r=VW(t);return r?r.type&&r.value?`${r.type}: ${r.value}
134`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function NTe(t,e,n){const r=t.exception=t.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=e||""),i.type||(i.type="Error")}function FW(t,e){const n=VW(t);if(!n)return;const r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...e},e&&"data"in e){const i={...s?.data,...e.data};n.mechanism.data=i}}function bVe(t){if(DTe(t))return!0;try{vo(t,"__sentry_captured__",!0)}catch{}return!1}function DTe(t){try{return t.__sentry_captured__}catch{}}const BW=1e3;function Uy(){return LW()/BW}function OTe(){const{performance:t}=en;if(!t?.now||!t.timeOrigin)return Uy;const e=t.timeOrigin;return()=>(e+$y(()=>t.now()))/BW}let ZV;function br(){return(ZV??(ZV=OTe()))()}let mC=null;function xTe(){const{performance:t}=en;if(!t?.now)return;const e=3e5,n=$y(()=>t.now()),r=LW(),s=t.timeOrigin;if(typeof s=="number"&&Math.abs(s+n-r)<e)return s;const i=t.timing?.navigationStart;return typeof i=="number"&&Math.abs(i+n-r)<e?i:r-n}function Ms(){return mC===null&&(mC=xTe()),mC}function LTe(t){const e=br(),n={sid:su(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>VTe(n)};return t&&ME(n,t),n}function ME(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||br(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:su()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function MTe(t,e){let n={};t.status==="ok"&&(n={status:"exited"}),ME(t,n)}function VTe(t){return{sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}function VE(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&Object.keys(e).length===0)return t;const r={...t};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=VE(r[s],e[s],n-1));return r}function Zc(){return su()}function Lc(){return su().substring(16)}const LR="_sentrySpan";function N_(t,e){e?vo(t,LR,e):delete t[LR]}function HS(t){return t[LR]}const FTe=100;class Va{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Zc(),sampleRand:Vd()}}clone(){const e=new Va;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,e._conversationId=this._conversationId,N_(e,HS(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&ME(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this.setTags({[e]:n})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,n){return this.setAttributes({[e]:n})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n=typeof e=="function"?e(this):e,r=n instanceof Va?n.getScopeData():gTe(n)?e:void 0,{tags:s,attributes:i,extra:o,user:a,contexts:c,level:l,fingerprint:d=[],propagationContext:h,conversationId:p}=r||{};return this._tags={...this._tags,...s},this._attributes={...this._attributes,...i},this._extra={...this._extra,...o},this._contexts={...this._contexts,...c},a&&Object.keys(a).length&&(this._user=a),l&&(this._level=l),d.length&&(this._fingerprint=d),h&&(this._propagationContext=h),p&&(this._conversationId=p),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,N_(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Zc(),sampleRand:Vd()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:FTe;if(r<=0)return this;const s={timestamp:Uy(),...e,message:e.message?xR(e.message,2048):e.message};return this._breadcrumbs.push(s),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:HS(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=VE(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=n?.event_id||su();if(!this._client)return un&&mt.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:s,...n,event_id:r},this),r}captureMessage(e,n,r){const s=r?.event_id||su();if(!this._client)return un&&mt.warn("No client configured on scope - will not capture message!"),s;const i=r?.syntheticException??new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:i,...r,event_id:s},this),s}captureEvent(e,n){const r=e.event_id||n?.event_id||su();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(un&&mt.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEac
134h(e=>{e(this)}),this._notifyingListeners=!1)}}function BTe(){return OE("defaultCurrentScope",()=>new Va)}function $Te(){return OE("defaultIsolationScope",()=>new Va)}const eF=t=>t instanceof Promise&&!t[$W],$W=Symbol("chained PromiseLike"),UTe=(t,e,n)=>{const r=t.then(s=>(e(s),s),s=>{throw n(s),s});return eF(r)&&eF(t)?r:HTe(t,r)},HTe=(t,e)=>{if(!e)return t;let n=!1;for(const r in t){if(r in e)continue;n=!0;const s=t[r];typeof s=="function"?Object.defineProperty(e,r,{value:(...i)=>s.apply(t,i),enumerable:!0,configurable:!0,writable:!0}):e[r]=s}return n&&Object.assign(e,{[$W]:!0}),e};class qTe{constructor(e,n){let r;e?r=e:r=new Va;let s;n?s=n:s=new Va,this._stack=[{scope:r}],this._isolationScope=s}withScope(e){const n=this._pushScope();let r;try{r=e(n)}catch(s){throw this._popScope(),s}return xE(r)?UTe(r,()=>this._popScope(),()=>this._popScope()):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function hp(){const t=ph(),e=DE(t);return e.stack=e.stack||new qTe(BTe(),$Te())}function jTe(t){return hp().withScope(t)}function WTe(t,e){const n=hp();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function tF(t){return hp().withScope(()=>t(hp().getIsolationScope()))}function GTe(){return{withIsolationScope:tF,withScope:jTe,withSetScope:WTe,withSetIsolationScope:(t,e)=>tF(e),getCurrentScope:()=>hp().getScope(),getIsolationScope:()=>hp().getIsolationScope()}}function zp(t){const e=DE(t);return e.acs?e.acs:GTe()}function KTe(t){return typeof t=="object"&&t!=null&&!Array.isArray(t)&&Object.keys(t).includes("value")}function zTe(t,e){const{value:n,unit:r}=KTe(t)?t:{value:t,unit:void 0},s=YTe(n),i=r&&typeof r=="string"?{unit:r}:{};if(s)return{...s,...i};if(!e||e==="skip-undefined"&&n===void 0)return;let o="";try{o=JSON.stringify(n)??""}catch{}return{value:o,type:"string",...i}}function nF(t,e=!1){const n={};for(const[r,s]of Object.entries(t??{})){const i=zTe(s,e);i&&(n[r]=i)}return n}function YTe(t){if(Array.isArray(t))return{value:t,type:"array"};const e=typeof t=="string"?"string":typeof t=="boolean"?"boolean":typeof t=="number"&&!Number.isNaN(t)?Number.isInteger(t)?"integer":"double":null;if(e)return{value:t,type:e}}function Kn(){const t=ph();return zp(t).getCurrentScope()}function Yp(){const t=ph();return zp(t).getIsolationScope()}function JTe(){return OE("globalScope",()=>new Va)}function bD(...t){const e=ph(),n=zp(e);if(t.length===2){const[r,s]=t;return r?n.withSetScope(r,s):n.withScope(s)}return n.withScope(t[0])}function dr(){return Kn().getClient()}function wVe(t){const e=t.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:s}=e,i={trace_id:n,span_id:s||Lc()};return r&&(i.parent_span_id=r),i}const lo="sentry.source",wD="sentry.sample_rate",UW="sentry.previous_trace_sample_rate",bo="sentry.op",ir="sentry.origin",D_="sentry.idle_span_finish_reason",Hy="sentry.measurement_unit",qy="sentry.measurement_value",rF="sentry.custom_span_name",QTe="sentry.profile_id",Jp="sentry.exclusive_time",XTe="sentry.link.type",SVe="gen_ai.conversation.id",HW=0,FE=1,rs=2;function ZTe(t){if(t<400&&t>=100)return{code:FE};if(t>=400&&t<500)switch(t){case 401:return{code:rs,message:"unauthenticated"};case 403:return{code:rs,message:"permission_denied"};case 404:return{code:rs,message:"not_found"};case 409:return{code:rs,message:"already_exists"};case 413:return{code:rs,message:"failed_precondition"};case 429:return{code:rs,message:"resource_exhausted"};case 499:return{code:rs,message:"cancelled"};default:return{code:rs,message:"invalid_argument"}}if(t>=500&&t<600)switch(t){case 501:return{code:rs,message:"unimplemented"};case 503:return{code:rs,message:"unavailable"};case 504:return{code:rs,message:"deadline_exceeded"};default:return{code:rs,message:"internal_error"}}return{code:rs,message:"internal_error"}}function qW(t,e){t.setAttribute("http.response.status_code",e);const n=ZTe(e);n.message!=="unknown_error"&&t.setStatus(n)}function eEe(t){try{const e=en.WeakRef;if(typeof e=="function")return new e(t)}catch{}return t}function tEe(t){if(t){if(typeof t=="object"&&"deref"in t&&typeof t.deref=="function")try{return t.deref()}catch{return}return t}}const jW="_sentryScope",WW="_sentryIsolationScope";function nEe(t,e,n){t&&(vo(t,WW,eEe(n)),vo(t,jW,e))}function qS(t){const e=t;return{scope:e[jW],isolationScope:tEe(e[WW])}}const jS="sentry-",rEe=8192;function GW(t){const e=iEe(t);if(!e)return;const n=Object.entries(e).reduce((r,[s,i])=>{if(s.startsWith(jS)){const o=s.slice(jS.length);r[o]=i}return r},{});if(Object.keys(n).length>0)return n}function sEe(t){if(!t)return;const e=Object.entries(t).reduce((n,[r,s])=>(s&&(n[`${jS}${r}`]=s),n),{});return oEe(e)}function iEe(t){if(!(!t||!ru(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{const r=sF(n);return Object.entries(r).forEach(([s,i])=>{e[s]=i}),e},{}):sF(t)}function sF(t){return t.split(",").map(e=>{const n=e.indexOf("=");if(n===-1)return[];const r=e.slice(0,n),s=e.slice(n+1);return[r,s].map(i=>{try{return decodeURIComponent(i.trim())}catch{return}})}).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}function oEe(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],s)=>{const i=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,o=s===0?i:`${e},${i}`;return o.length>rEe?(un&&mt.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):o},"")}const aEe=/^o(\d+)\./,cEe=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function lEe(t){return t==="http"||t==="https"}function SD(t,e=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${o}`}function uEe(t){const e=cEe.exec(t);if(!e){jp(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,s="",i="",o="",a=""]=e.slice(1);let c="",l=a;const d=l.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),l=d.pop()),l){const h=l.match(/^\d+/);h&&(l=h[0])}return KW({host:i,pass:s,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function KW(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function dEe(t){if(!un)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(o=>t[o]?!1:(mt.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?lEe(r)?e&&isNaN(parseInt(e,10))?(mt.error(`Invalid Sentry Dsn: Invalid port ${e}
134`),!1):!0:(mt.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(mt.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function hEe(t){return t.match(aEe)?.[1]}function fEe(t){const e=t.getOptions(),{host:n}=t.getDsn()||{};let r;return e.orgId?r=String(e.orgId):n&&(r=hEe(n)),r}function TVe(t){const e=typeof t=="string"?uEe(t):KW(t);if(!(!e||!dEe(e)))return e}function WS(t){if(typeof t=="boolean")return Number(t);const e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}const zW=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function pEe(t){if(!t)return;const e=t.match(zW);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function mEe(t,e){const n=pEe(t),r=GW(e);if(!n?.traceId)return{traceId:Zc(),sampleRand:Vd()};const s=gEe(n,r);r&&(r.sample_rand=s.toString());const{traceId:i,parentSpanId:o,parentSampled:a}=n;return{traceId:i,parentSpanId:o,sampled:a,dsc:r||{},sampleRand:s}}function YW(t=Zc(),e=Lc(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function JW(t=Zc(),e=Lc(),n){return`00-${t}-${e}-${n?"01":"00"}`}function gEe(t,e){const n=WS(e?.sample_rand);if(n!==void 0)return n;const r=WS(e?.sample_rate);return r&&t?.parentSampled!==void 0?t.parentSampled?Vd()*r:r+Vd()*(1-r):Vd()}const QW=0,BE=1;let iF=!1;function _Ee(t){const{spanId:e,traceId:n}=t.spanContext(),{data:r,op:s,parent_span_id:i,status:o,origin:a,links:c}=yn(t);return{parent_span_id:i,span_id:e,trace_id:n,data:r,op:s,status:o,origin:a,links:c}}function yEe(t){const{spanId:e,traceId:n,isRemote:r}=t.spanContext(),s=r?e:yn(t).parent_span_id,i=qS(t).scope,o=r?i?.getPropagationContext().propagationSpanId||Lc():e;return{parent_span_id:s,span_id:o,trace_id:n}}function vEe(t){const{traceId:e,spanId:n}=t.spanContext(),r=Ru(t);return YW(e,n,r)}function bEe(t){const{traceId:e,spanId:n}=t.spanContext(),r=Ru(t);return JW(e,n,r)}function XW(t){if(t&&t.length>0)return t.map(({context:{spanId:e,traceId:n,traceFlags:r,...s},attributes:i})=>({span_id:e,trace_id:n,sampled:r===BE,attributes:i,...s}))}function ZW(t){if(t?.length)return t.map(({context:{spanId:e,traceId:n,traceFlags:r},attributes:s})=>({span_id:e,trace_id:n,sampled:r===BE,attributes:s}))}function Mc(t){return typeof t=="number"?oF(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?oF(t.getTime()):br()}function oF(t){return t>9999999999?t/1e3:t}function yn(t){if(rG(t))return t.getSpanJSON();const{spanId:e,traceId:n}=t.spanContext();if(nG(t)){const{attributes:r,startTime:s,name:i,endTime:o,status:a,links:c}=t;return{span_id:e,trace_id:n,data:r,description:i,parent_span_id:tG(t),start_timestamp:Mc(s),timestamp:Mc(o)||void 0,status:sG(a),op:r[bo],origin:r[ir],links:XW(c)}}return{span_id:e,trace_id:n,start_timestamp:0,data:{}}}function eG(t){if(rG(t))return t.getStreamedSpanJSON();const{spanId:e,traceId:n}=t.spanContext();if(nG(t)){const{attributes:r,startTime:s,name:i,endTime:o,status:a,links:c}=t;return{name:i,span_id:e,trace_id:n,parent_span_id:tG(t),start_timestamp:Mc(s),end_timestamp:Mc(o),is_segment:t===VR(t),status:iG(a),attributes:r,links:ZW(c)}}return{span_id:e,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:t===VR(t)}}function tG(t){return"parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?t.parentSpanContext?.spanId:void 0}function EVe(t){return{...t,attributes:nF(t.attributes),links:t.links?.map(e=>({...e,attributes:nF(e.attributes)}))}}function nG(t){const e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function rG(t){return typeof t.getSpanJSON=="function"}function Ru(t){const{traceFlags:e}=t.spanContext();return e===BE}function sG(t){if(!(!t||t.code===HW))return t.code===FE?"ok":t.message||"internal_error"}function iG(t){return!t||t.code===FE||t.code===HW||t.message==="cancelled"?"ok":"error"}const Fd="_sentryChildSpans",MR="_sentryRootSpan";function oG(t,e){const n=t[MR]||t;vo(e,MR,n),t[Fd]?t[Fd].add(e):vo(t,Fd,new Set([e]))}function wEe(t,e){t[Fd]&&t[Fd].delete(e)}function pw(t){const e=new Set;function n(r){if(!e.has(r)&&Ru(r)){e.add(r);const s=r[Fd]?Array.from(r[Fd]):[];for(const i of s)n(i)}}return n(t),Array.from(e)}const vs=VR;function VR(t){return t[MR]||t}function ei(){const t=ph(),e=zp(t);return e.getActiveSpan?e.getActiveSpan():HS(Kn())}function SEe(){iF||(jp(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),iF=!0)}let aF=!1;
134function TEe(){if(aF)return;function t(){const e=ei(),n=e&&vs(e);if(n){const r="internal_error";un&&mt.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:rs,message:r})}}aF=!0,dTe(t),fTe(t)}function go(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=t||dr()?.getOptions();return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}function cF(t){mt.log(`Ignoring span ${t.op} - ${t.description} because it matches \`ignoreSpans\`.`)}function TD(t,e){if(!e?.length)return!1;for(const n of e){if(IEe(n)){if(t.description&&Ug(t.description,n))return un&&cF(t),!0;continue}const r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;const s=n.name?t.description&&Ug(t.description,n.name):!0,i=n.op?t.op&&Ug(t.op,n.op):!0,o=n.attributes?Object.entries(n.attributes).every(([a,c])=>EEe(t.attributes?.[a],c)):!0;if(s&&i&&o)return un&&cF(t),!0}return!1}function EEe(t,e){return typeof t=="string"&&(typeof e=="string"||e instanceof RegExp)?Ug(t,e):Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((n,r)=>n===e[r]):t===e}function IVe(t,e){const n=e.parent_span_id,r=e.span_id;if(n)for(const s of t)s.parent_span_id===r&&(s.parent_span_id=n)}function IEe(t){return typeof t=="string"||t instanceof RegExp}const aG="production",cG="_frozenDsc";function mw(t,e){vo(t,cG,e)}function lG(t,e){const n=e.getOptions(),{publicKey:r}=e.getDsn()||{},s={environment:n.environment||aG,release:n.release,public_key:r,trace_id:t,org_id:fEe(e)};return e.emit("createDsc",s),s}function CEe(t,e){const n=e.getPropagationContext();return n.dsc||lG(n.traceId,t)}function bu(t){const e=dr();if(!e)return{};const n=vs(t),r=yn(n),s=r.data,i=n.spanContext().traceState,o=i?.get("sentry.sample_rate")??s[wD]??s[UW];function a(_){return(typeof o=="number"||typeof o=="string")&&(_.sample_rate=`${o}`),_}const c=n[cG];if(c)return a(c);const l=i?.get("sentry.dsc"),d=l&&GW(l);if(d)return a(d);const h=lG(t.spanContext().traceId,e),p=s[lo]??s["sentry.span.source"],g=r.description;return p!=="url"&&g&&(h.transaction=g),go()&&(h.sampled=String(Ru(n)),h.sample_rand=i?.get("sentry.sample_rand")??qS(n).scope?.getPropagationContext().sampleRand.toString()),a(h),e.emit("createDsc",h,n),h}class Aa{constructor(e={}){this._traceId=e.traceId||Zc(),this._spanId=e.spanId||Lc(),this.dropReason=e.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:QW}}end(e){}setAttribute(e,n){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,n,r){return this}addLink(e){return this}addLinks(e){return this}recordException(e,n){}}function AEe(t){return!!t&&typeof t=="function"&&"_streamed"in t&&!!t._streamed}function ED(t,e=[]){return[t,e]}function CVe(t,e){const[n,r]=t;return[n,[...r,e]]}function REe(t,e){const n=t[1];for(const r of n){const s=r[0].type;if(e(r,s))return!0}return!1}function AVe(t,e){return REe(t,(n,r)=>e.includes(r))}function FR(t){const e=DE(en);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function RVe(t){const[e,n]=t;let r=JSON.stringify(e);function s(i){typeof r=="string"?r=typeof i=="string"?r+i:[FR(r),i]:r.push(typeof i=="string"?FR(i):i)}for(const i of n){const[o,a]=i;if(s(` 135${JSON.stringify(o)} 136`),typeof a=="string"||a instanceof Uint8Array)s(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(pc(a))}s(c)}}return typeof r=="string"?r:PEe(r)}function PEe(t){const e=t.reduce((s,i)=>s+i.length,0),n=new Uint8Array(e);let r=0;for(const s of t)n.set(s,r),r+=s.length;return n}function kEe(t){return[{type:"span"},t]}function PVe(t){const e=typeof t.data=="string"?FR(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}const uG={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function NEe(t){return t in uG}function kVe(t){return NEe(t)?uG[t]:t}function dG(t){if(!t?.sdk)return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function DEe(t,e,n,r){const s=t.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:SD(r)},...s&&{trace:s}}}function OEe(t,e){if(!e)return t;const n=t.sdk||{};return t.sdk={...n,name:n.name||e.name,version:n.version||e.version,integrations:[...t.sdk?.integrations||[],...e.integrations||[]],packages:[...t.sdk?.packages||[],...e.packages||[]],settings:t.sdk?.settings||e.settings?{...t.sdk?.settings,...e.settings}:void 0},t}function NVe(t,e,n,r){const s=dG(n),i={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&e&&{dsn:SD(e)}},o="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return ED(i,[o])}function DVe(t,e,n,r){const s=dG(n),i=t.type&&t.type!=="replay_event"?t.type:"event";OEe(t,n?.sdk);const o=DEe(t,s,r,e);return delete t.sdkProcessingMetadata,ED(o,[[{type:i},t]])}function xEe(t,e){function n(g){return!!g.trace_id&&!!g.public_key}const r=bu(t[0]),s=e?.getDsn(),i=e?.getOptions().tunnel,o={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!i&&s&&{dsn:SD(s)}},{beforeSendSpan:a,ignoreSpans:c}=e?.getOptions()||{},l=c?.length?t.filter(g=>{const _=yn(g);return!TD({description:_.description,op:_.op,attributes:_.data},c)}):t,d=t.length-l.length;d&&e?.recordDroppedEvent("before_send","span",d);const h=a?g=>{const _=yn(g),v=AEe(a)?_:a(_);return v||(SEe(),_)}:yn,p=[];for(const g of l){const _=h(g);_&&p.push(kEe(_))}return ED(o,p)}function LEe(t){if(!un)return;const{description:e="< unknown name >",op:n="< unknown op >",parent_span_id:r}=yn(t),{spanId:s}=t.spanContext(),i=Ru(t),o=vs(t),a=o===t,c=`[Tracing] Starting ${i?"sampled":"unsampled"} ${a?"root ":""}span`,l=[`op: ${n}`,`name: ${e}`,`ID: ${s}`];if(r&&l.push(`parent ID: ${r}`),!a){const{op:d,description:h}=yn(o);l.push(`root ID: ${o.spanContext().spanId}`),d&&l.push(`root op: ${d}`),h&&l.push(`root description: ${h}`)}mt.log(`${c} 137 ${l.join(` 138 `)}`)}function MEe(t){if(!un)return;const{description:e="< unknown name >",op:n="< unknown op >"}=yn(t),{spanId:r}=t.spanContext(),i=vs(t)===t,o=`[Tracing] Finishing "${n}" ${i?"root ":""}span "${e}" with ID ${r}`;mt.log(o)}function VEe(t,e,n,r=ei()){const s=r&&vs(r);s&&(un&&mt.log(`[Measurement] Setting measurement on root span: ${t} = ${e} ${n}`),s.addEvent(t,{[qy]:e,[Hy]:n}))}function lF(t){if(!t||t.length===0)return;const e={};return t.forEach(n=>{const r=n.attributes||{},s=r[Hy],i=r[qy];typeof s=="string"&&typeof i=="number"&&(e[n.name]={value:i,unit:s})}),e}function el(t){return t.getOptions().traceLifecycle==="stream"}const uF=1e3;class $E{constructor(e={}){this._traceId=e.traceId||Zc(),this._spanId=e.spanId||Lc(),this._startTime=e.startTimestamp||br(),this._links=e.links,this._attributes={},this.setAttributes({[ir]:"manual",[bo]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}
138addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,n){}spanContext(){const{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?BE:QW}}setAttribute(e,n){return n===void 0?delete this._attributes[e]:this._attributes[e]=n,this}setAttributes(e){return Object.keys(e).forEach(n=>this.setAttribute(n,e[n])),this}updateStartTime(e){this._startTime=Mc(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(lo,"custom"),this}end(e){this._endTime||(this._endTime=Mc(e),MEe(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[bo],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:sG(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[ir],profile_id:this._attributes[QTe],exclusive_time:this._attributes[Jp],measurements:lF(this._events),is_segment:this._isStandaloneSpan&&vs(this)===this||void 0,segment_id:this._isStandaloneSpan?vs(this).spanContext().spanId:void 0,links:XW(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===vs(this),status:iG(this._status),attributes:this._attributes,links:ZW(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,n,r){un&&mt.log("[Tracing] Adding an event to span:",e);const s=dF(n)?n:r||br(),i=dF(n)?{}:n||{},o={name:e,time:Mc(s),attributes:i};return this._events.push(o),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const e=dr();if(e&&(e.emit("spanEnd",this),this._isStandaloneSpan||e.emit("afterSpanEnd",this)),!(this._isStandaloneSpan||this===vs(this)))return;if(this._isStandaloneSpan){this._sampled?BEe(xEe([this],e)):(un&&mt.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span"));return}else if(e&&el(e)){e.emit("afterSegmentSpanEnd",this);return}const r=this._convertSpanToTransaction();r&&(qS(this).scope||Kn()).captureEvent(r)}_convertSpanToTransaction(){if(!hF(yn(this)))return;this._name||(un&&mt.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:e,isolationScope:n}=qS(this),r=e?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;const i=pw(this).filter(h=>h!==this&&!FEe(h)).map(h=>yn(h)).filter(hF),o=this._attributes[lo];delete this._attributes[rF];let a=!1;i.forEach(h=>{delete h.data[rF],h.op?.startsWith("gen_ai.")&&(a=!0)});const c={contexts:{trace:_Ee(this)},spans:i.length>uF?i.sort((h,p)=>h.start_timestamp-p.start_timestamp).slice(0,uF):i,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:n,dynamicSamplingContext:bu(this),hasGenAiSpans:a},request:r,...o&&{transaction_info:{source:o}}},l=lF(this._events);return l&&Object.keys(l).length&&(un&&mt.log("[Measurements] Adding measurements to transaction event",JSON.stringify(l,void 0,2)),c.measurements=l),c}}function dF(t){return t&&typeof t=="number"||t instanceof Date||Array.isArray(t)}function hF(t){return!!t.start_timestamp&&!!t.timestamp&&!!t.span_id&&!!t.trace_id}function FEe(t){return t instanceof $E&&t.isStandaloneSpan()}function BEe(t){const e=dr();if(!e)return;const n=t[1];if(!n||n.length===0){e.recordDroppedEvent("before_send","span");return}e.sendEnvelope(t)}function $Ee(t,e,n){if(!go(t))return[!1];let r,s;typeof t.tracesSampler=="function"?(s=t.tracesSampler({...e,inheritOrSampleWith:a=>typeof e.parentSampleRate=="number"?e.parentSampleRate:typeof e.parentSampled=="boolean"?Number(e.parentSampled):a}),r=!0):e.parentSampled!==void 0?s=e.parentSampled:typeof t.tracesSampleRate<"u"&&(s=t.tracesSampleRate,r=!0);const i=WS(s);if(i===void 0)return un&&mt.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(s)} of type ${JSON.stringify(typeof s)}.`),[!1];if(!i)return un&&mt.log(`[Tracing] Discarding transaction because ${typeof t.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,i,r];const o=n<i;return o||un&&mt.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(s)})`),[o,i,r]}const UEe="__SENTRY_SUPPRESS_TRACING__";function Fa(t){const e=fG();if(e.startInactiveSpan)return e.startInactiveSpan(t);const n=qEe(t),{forceTransaction:r,parentSpan:s}=t;return(t.scope?o=>bD(t.scope,o):s!==void 0?o=>hG(s,o):o=>o())(()=>{const o=Kn(),a=WEe(o,s),c=dr();return t.onlyIfParent&&!a?(c?.recordDroppedEvent("no_parent_span","span"),new Aa):HEe({parentSpan:a,spanArguments:n,forceTransaction:r,scope:o})})}function hG(t,e){const n=fG();return n.withActiveSpan?n.withActiveSpan(t,e):bD(r=>(N_(r,t||void 0),e(r)))}function HEe({parentSpan:t,spanArguments:e,forceTransaction:n,scope:r}){if(!go()){const a=new Aa;if(n||!t){const c={sampled:"false",sample_rate:"0",transaction:e.name,...bu(a)};mw(a,c)}return a}const s=dr();if(GEe(s,e))return ID(r)||s?.recordDroppedEvent("ignored","span"),new Aa({dropReason:"ignored",traceId:t?.spanContext().traceId??r.getPropagationContext().traceId});const i=Yp();let o;if(t&&!n)o=jEe(t,r,e),oG(t,o);else if(t){const a=bu(t),{traceId:c,spanId:l}=t.spanContext(),d=Ru(t);o=fF({traceId:c,parentSpanId:l,...e},r,d),mw(o,a)}else{const{traceId:a,dsc:c,parentSpanId:l,sampled:d}={...i.getPropagationContext(),...r.getPropagationContext()};o=fF({traceId:a,parentSpanId:l,...e},r,d),c&&mw(o,c)}return LEe(o),nEe(o,r,i),o}function qEe(t){const n={isStandalone:(t.experimental||{}).standalone,...t};if(t.startTime){const r={...n};return r.startTimestamp=Mc(t.startTime),delete r.startTime,r}return n}function fG(){const t=ph();return zp(t)}function fF(t,e,n){const r=dr(),s=r?.getOptions()||{},{name:i=""}=t,o={spanAttributes:{...t.attributes},spanName:i,parentSampled:n};r?.emit("beforeSampling",o,{decision:!1});const a=o.parentSampled??n,c=o.spanAttributes,l=e.getPropagationContext(),d=ID(e),[h,p,g]=d?[!1]:$Ee(s,{name:i,parentSampled:a,attributes:c,parentSampleRate:WS(l.dsc?.sample_rate)},l.sampleRand),_=new $E({...t,attributes:{[lo]:"custom",[wD]:p!==void 0&&g?p:void 0,...c},sampled:h});return!h&&r&&!d&&(un&&mt.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate",el(r)?"span":"transaction")),r&&r.emit("spanStart",_),_}function jEe(t,e,n){const{spanId:r,traceId:s}=t.spanContext(),i=ID(e),o=i?!1:Ru(t),a=o?new $E({...n,parentSpanId:r,traceId:s,sampled:o}):new Aa({traceId:s});oG(t,a);const c=dr();return c&&(el(c)&&a instanceof Aa&&(t instanceof Aa&&t.dropReason?(a.dropReason=t.dropReason,c.recordDroppedEvent(t.dropReason,"span")):i||(a.dropReason="sample_rate",c.recordDroppedEvent("sample_rate","span"))),c.emit("spanStart",a),n.endTimestamp&&(c.emit
138("spanEnd",a),c.emit("afterSpanEnd",a))),a}function WEe(t,e){if(e)return e;if(e===null)return;const n=HS(t);if(!n)return;const r=dr();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?vs(n):n}function GEe(t,e){const n=t?.getOptions().ignoreSpans;return!t||!el(t)||!n?.length?!1:TD({description:e.name||"",op:e.attributes?.[bo]||e.op,attributes:e.attributes},n)}function ID(t){return t.getScopeData().sdkProcessingMetadata[UEe]===!0}const gw={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3},KEe="heartbeatFailed",zEe="idleTimeout",YEe="finalTimeout",JEe="externalFinish";function pG(t,e={}){const n=new Map;let r=!1,s,i=JEe,o=!e.disableAutoFinish;const a=[],{idleTimeout:c=gw.idleTimeout,finalTimeout:l=gw.finalTimeout,childSpanTimeout:d=gw.childSpanTimeout,beforeSpanEnd:h,trimIdleSpanEndTimestamp:p=!0}=e,g=dr();if(!g||!go()){const S=new Aa,I={sample_rate:"0",sampled:"false",...bu(S)};return mw(S,I),S}const _=Kn(),v=ei(),b=QEe(t);b.end=new Proxy(b.end,{apply(S,I,P){if(h&&h(b),I instanceof Aa)return;const[k,...L]=P,M=k||br(),V=Mc(M),z=pw(b).filter(de=>de!==b),ie=yn(b);if(!z.length||!p)return O(V),Reflect.apply(S,I,[V,...L]);const K=g.getOptions().ignoreSpans,ce=z?.reduce((de,fe)=>{const ee=yn(fe);return!ee.timestamp||K&&TD({description:ee.description,op:ee.op,attributes:ee.data},K)?de:de?Math.max(de,ee.timestamp):ee.timestamp},void 0),G=ie.start_timestamp,Z=Math.min(G?G+l/1e3:1/0,Math.max(G||-1/0,Math.min(V,ce||1/0)));return O(Z),Reflect.apply(S,I,[Z,...L])}});function w(){s&&(clearTimeout(s),s=void 0)}function E(S){w(),s=setTimeout(()=>{!r&&n.size===0&&o&&(i=zEe,b.end(S))},c)}function T(S){s=setTimeout(()=>{!r&&o&&(i=KEe,b.end(S))},d)}function R(S){w(),n.set(S,!0);const I=br();T(I+d/1e3)}function N(S){if(n.has(S)&&n.delete(S),n.size===0){const I=br();E(I+c/1e3)}}function O(S){r=!0,n.clear(),a.forEach(z=>z()),N_(_,v);const I=yn(b),{start_timestamp:P}=I;if(!P)return;I.data[D_]||b.setAttribute(D_,i);const L=I.status;(!L||L==="unknown")&&b.setStatus({code:FE}),mt.log(`[Tracing] Idle span "${I.op}" finished`);const M=pw(b).filter(z=>z!==b);let V=0;M.forEach(z=>{z.isRecording()&&(z.setStatus({code:rs,message:"cancelled"}),z.end(S),un&&mt.log("[Tracing] Cancelling span since span ended early",JSON.stringify(z,void 0,2)));const ie=yn(z),{timestamp:K=0,start_timestamp:ce=0}=ie,G=ce<=S,Z=(l+c)/1e3,de=K-ce<=Z;if(un){const fe=JSON.stringify(z,void 0,2);G?de||mt.log("[Tracing] Discarding span since it finished after idle span final timeout",fe):mt.log("[Tracing] Discarding span since it happened after idle span was finished",fe)}(!de||!G)&&(wEe(b,z),V++)}),V>0&&b.setAttribute("sentry.idle_span_discarded_spans",V)}return a.push(g.on("spanStart",S=>{if(r||S===b||yn(S).timestamp||S instanceof $E&&S.isStandaloneSpan())return;pw(b).includes(S)&&R(S.spanContext().spanId)})),a.push(g.on("spanEnd",S=>{r||N(S.spanContext().spanId)})),a.push(g.on("idleSpanEnableAutoFinish",S=>{S===b&&(o=!0,E(),n.size&&T())})),e.disableAutoFinish||E(),setTimeout(()=>{r||(b.setStatus({code:rs,message:"deadline_exceeded"}),i=YEe,b.end())},l),b}function QEe(t){const e=Fa(t);return N_(Kn(),e),un&&mt.log("[Tracing] Started span is an idle span"),e}function XEe(t,e){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=e;ZEe(t,e),r&&nIe(t,r),rIe(t,n),eIe(t,s),tIe(t,i)}function pF(t,e){const{extra:n,tags:r,attributes:s,user:i,contexts:o,level:a,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:d,eventProcessors:h,attachments:p,propagationContext:g,transactionName:_,span:v}=e;eg(t,"extra",n),eg(t,"tags",r),eg(t,"attributes",s),eg(t,"user",i),eg(t,"contexts",o),t.sdkProcessingMetadata=VE(t.sdkProcessingMetadata,c,2),a&&(t.level=a),_&&(t.transactionName=_),v&&(t.span=v),l.length&&(t.breadcrumbs=[...t.breadcrumbs,...l]),d.length&&(t.fingerprint=[...t.fingerprint,...d]),h.length&&(t.eventProcessors=[...t.eventProcessors,...h]),p.length&&(t.attachments=[...t.attachments,...p]),t.propagationContext={...t.propagationContext,...g}}function eg(t,e,n){t[e]=VE(t[e],n,1)}function mG(t,e){const n=JTe().getScopeData();return t&&pF(n,t.getScopeData()),e&&pF(n,e.getScopeData()),n}function ZEe(t,e){const{extra:n,tags:r,user:s,contexts:i,level:o,transactionName:a}=e;Object.keys(n).length&&(t.extra={...n,...t.extra}),Object.keys(r).length&&(t.tags={...r,...t.tags}),Object.keys(s).length&&(t.user={...s,...t.user}),Object.keys(i).length&&(t.contexts={...i,...t.contexts}),o&&(t.level=o),a&&t.type!=="transaction"&&(t.transaction=a)}function eIe(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function tIe(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function nIe(t,e){t.contexts={trace:yEe(e),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:bu(e),...t.sdkProcessingMetadata};const n=vs(e),r=yn(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function rIe(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}const sIe="thismessage:/";function gG(t){return"isRelative"in t}function CD(t,e){const n=t.indexOf("://")<=0&&t.indexOf("//")!==0,r=n?sIe:void 0;try{if("canParse"in URL&&!URL.canParse(t,r))return;const s=new URL(t,r);return n?{isRelative:n,pathname:s.pathname,search:s.search,hash:s.hash}:s}catch{}}function _G(t){if(gG(t))return t.pathname;const e=new URL(t);return e.search="",e.hash="",["80","443"].includes(e.port)&&(e.port=""),e.password&&(e.password="%filtered%"),e.username&&(e.username="%filtered%"),e.toString()}function GS(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function iIe(t){return t.split(/[?#]/,1)[0]}function Vc(t,e=!0){if(t.startsWith("data:")){const n=t.match(/^data:([^;
138,]+)/),r=n?n[1]:"text/plain",s=t.includes(";base64,"),i=t.indexOf(",");let o="";if(e&&i!==-1){const a=t.slice(i+1);o=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${s?",base64":""}${o?`,${o}`:""}`}return t}const gC=0,mF=1,gF=2;function yG(t){return new O_(e=>{e(t)})}function oIe(t){return new O_((e,n)=>{n(t)})}class O_{constructor(e){this._state=gC,this._handlers=[],this._runExecutor(e)}then(e,n){return new O_((r,s)=>{this._handlers.push([!1,i=>{if(!e)r(i);else try{r(e(i))}catch(o){s(o)}},i=>{if(!n)s(i);else try{r(n(i))}catch(o){s(o)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new O_((n,r)=>{let s,i;return this.then(o=>{i=!1,s=o,e&&e()},o=>{i=!0,s=o,e&&e()}).then(()=>{if(i){r(s);return}n(s)})})}_executeHandlers(){if(this._state===gC)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===mF&&n[1](this._value),this._state===gF&&n[2](this._value),n[0]=!0)})}_runExecutor(e){const n=(i,o)=>{if(this._state===gC){if(xE(o)){o.then(r,s);return}this._state=i,this._value=o,this._executeHandlers()}},r=i=>{n(mF,i)},s=i=>{n(gF,i)};try{e(r,s)}catch(i){s(i)}}}function aIe(t,e,n,r=0){try{const s=BR(e,n,t,r);return xE(s)?s:yG(s)}catch(s){return oIe(s)}}function BR(t,e,n,r){const s=n[r];if(!t||!s)return t;const i=s({...t},e);return un&&i===null&&mt.log(`Event processor "${s.id||"?"}" dropped event`),xE(i)?i.then(o=>BR(o,e,n,r+1)):BR(i,e,n,r+1)}let Zu,_F,yF,Rl;function cIe(t){const e=en._sentryDebugIds,n=en._debugIds;if(!e&&!n)return{};const r=e?Object.keys(e):[],s=n?Object.keys(n):[];if(Rl&&r.length===_F&&s.length===yF)return Rl;_F=r.length,yF=s.length,Rl={},Zu||(Zu={});const i=(o,a)=>{for(const c of o){const l=a[c],d=Zu?.[c];if(d&&Rl&&l)Rl[d[0]]=l,Zu&&(Zu[c]=[d[0],l]);else if(l){const h=t(c);for(let p=h.length-1;p>=0;p--){const _=h[p]?.filename;if(_&&Rl&&Zu){Rl[_]=l,Zu[c]=[_,l];break}}}}};return e&&i(r,e),n&&i(s,n),Rl}function OVe(t,e,n,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=t,c={...e,event_id:e.event_id||n.event_id||su(),timestamp:e.timestamp||Uy()},l=n.integrations||t.integrations.map(w=>w.name);lIe(c,t),hIe(c,l),s&&s.emit("applyFrameMetadata",e),e.type===void 0&&uIe(c,t.stackParser);const d=pIe(r,n.captureContext);n.mechanism&&FW(c,n.mechanism);const h=s?s.getEventProcessors():[],p=mG(i,d),g=[...n.attachments||[],...p.attachments];g.length&&(n.attachments=g),XEe(c,p);const _=[...h,...p.eventProcessors];return(n.data&&n.data.__sentry__===!0?yG(c):aIe(_,c,n)).then(w=>(w&&dIe(w),typeof o=="number"&&o>0?fIe(w,o,a):w))}function lIe(t,e){const{environment:n,release:r,dist:s,maxValueLength:i}=e;t.environment=t.environment||n||aG,!t.release&&r&&(t.release=r),!t.dist&&s&&(t.dist=s);const o=t.request;o?.url&&i&&(o.url=xR(o.url,i)),i&&t.exception?.values?.forEach(a=>{a.value&&(a.value=xR(a.value,i))})}function uIe(t,e){const n=cIe(e);t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(s=>{s.filename&&(s.debug_id=n[s.filename])})})}function dIe(t){const e={};if(t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(s=>{s.debug_id&&(s.abs_path?e[s.abs_path]=s.debug_id:s.filename&&(e[s.filename]=s.debug_id),delete s.debug_id)})}),Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.entries(e).forEach(([r,s])=>{n.push({type:"sourcemap",code_file:r,debug_id:s})})}function hIe(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function fIe(t,e,n){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(s=>({...s,...s.data&&{data:pc(s.data,e,n)}}))},...t.user&&{user:pc(t.user,e,n)},...t.contexts&&{contexts:pc(t.contexts,e,n)},...t.extra&&{extra:pc(t.extra,e,n)}};return t.contexts?.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=pc(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(s=>({...s,...s.data&&{data:pc(s.data,e,n)}}))),t.contexts?.flags&&r.contexts&&(r.contexts.flags=pc(t.contexts.flags,3,n)),r}function pIe(t,e){if(!e)return t;const n=t?t.clone():new Va;return n.update(e),n}function mIe(t){if(t)return gIe(t)?{captureContext:t}:yIe(t)?{captureContext:t}:t}function gIe(t){return t instanceof Va||typeof t=="function"}const _Ie=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function yIe(t){return Object.keys(t).some(e=>_Ie.includes(e))}function UE(t,e){return Kn().captureException(t,mIe(e))}function vIe(t,e){const n=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return Kn().captureMessage(t,n,r)}function xVe(t,e){return Kn().captureEvent(t,e)}function bIe(t){Yp().setUser(t)}function vG(){return!!dr()}function wIe(){const t=dr();return t?.getOptions().enabled!==!1&&!!t?.getTransport()}function LVe(t){const e=Yp(),{user:n}=mG(e,Kn()),{userAgent:r}
138=en.navigator||{},s=LTe({user:n,...r&&{userAgent:r},...t}),i=e.getSession();return i?.status==="ok"&&ME(i,{status:"exited"}),bG(),e.setSession(s),s}function bG(){const t=Yp(),n=Kn().getSession()||t.getSession();n&&MTe(n),wG(),t.setSession()}function wG(){const t=Yp(),e=dr(),n=t.getSession();n&&e&&e.captureSession(n)}function MVe(t=!1){if(t){bG();return}wG()}const vF=[];function SIe(t){const e={};return t.forEach(n=>{const{name:r}=n,s=e[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.values(e)}function VVe(t){const e=t.defaultIntegrations||[],n=t.integrations;e.forEach(s=>{s.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...e,...n];else if(typeof n=="function"){const s=n(e);r=Array.isArray(s)?s:[s]}else r=e;return SIe(r)}function FVe(t,e){const n={};return e.forEach(r=>{r?.beforeSetup&&r.beforeSetup(t)}),e.forEach(r=>{r&&TIe(t,r,n)}),n}function BVe(t,e){for(const n of e)n?.afterAllSetup&&n.afterAllSetup(t)}function TIe(t,e,n){if(n[e.name]){un&&mt.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,!vF.includes(e.name)&&typeof e.setupOnce=="function"&&(e.setupOnce(),vF.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){const r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(s,i)=>r(s,i,t))}if(typeof e.processEvent=="function"){const r=e.processEvent.bind(e),s=Object.assign((i,o)=>r(i,o,t),{id:e.name});t.addEventProcessor(s)}["processSpan","processSegmentSpan"].forEach(r=>{const s=e[r];typeof s=="function"&&t.on(r,i=>s.call(e,i,t))}),un&&mt.log(`Integration installed: ${e.name}`)}function $Ve(t){return t}function EIe(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function UVe(){return"npm"}function IIe(){return!EIe()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function CIe(){return typeof window<"u"&&(!IIe()||AIe())}function AIe(){return en.process?.type==="renderer"}function SG(t={}){const e=t.client||dr();if(!wIe()||!e)return{};const n=ph(),r=zp(n);if(r.getTraceData)return r.getTraceData(t);const s=t.scope||Kn(),i=t.span||ei(),o=i?vEe(i):RIe(s),a=i?bu(i):CEe(e,s),c=sEe(a);if(!zW.test(o))return mt.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const d={"sentry-trace":o,baggage:c};return t.propagateTraceparent&&(d.traceparent=i?bEe(i):PIe(s)),d}function RIe(t){const{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return YW(e,r,n)}function PIe(t){const{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return JW(e,r,n)}function kIe(t,e,n,r,s){if(!t.fetchData)return;const{method:i,url:o}=t.fetchData,a=go()&&e(o);if(t.endTimestamp){const _=t.fetchData.__span;if(!_)return;const v=r[_];v&&(a&&(OIe(v,t),NIe(v,t,s)),delete r[_]);return}const{spanOrigin:c="auto.http.browser",propagateTraceparent:l=!1}=typeof s=="object"?s:{spanOrigin:s},d=dr(),p=!!ei()||!!d&&el(d),g=a&&p?Fa(MIe(o,i,c)):new Aa;if(a&&!p&&d?.recordDroppedEvent("no_parent_span","span"),t.fetchData.__span=g.spanContext().spanId,r[g.spanContext().spanId]=g,n(t.fetchData.url)){const _=t.args[0],v={...t.args[1]||{}},b=DIe(_,v,go()&&p?g:void 0,l);b&&(t.args[1]=v,v.headers=b)}if(d){const _={input:t.args,response:t.response,startTimestamp:t.startTimestamp,endTimestamp:t.endTimestamp};d.emit("beforeOutgoingRequestSpan",g,_)}return g}function NIe(t,e,n){(typeof n=="object"&&n!==null?n.onRequestSpanEnd:void 0)?.(t,{headers:e.response?.headers,error:e.error})}function DIe(t,e,n,r){const s=SG({span:n,propagateTraceparent:r}),i=s["sentry-trace"],o=s.baggage,a=s.traceparent;if(!i)return;const c=e.headers||(vD(t)?t.headers:void 0);if(c)if(xIe(c)){const l=new Headers(c);if(l.get("sentry-trace")||l.set("sentry-trace",i),r&&a&&!l.get("traceparent")&&l.set("traceparent",a),o){const d=l.get("baggage");d?kb(d)||l.set("baggage",`${d},${o}`):l.set("baggage",o)}return l}else if(LIe(c)){const l=[...c];l.find(h=>h[0]==="sentry-trace")||l.push(["sentry-trace",i]),r&&a&&!l.find(h=>h[0]==="traceparent")&&l.push(["traceparent",a]);const d=c.find(h=>h[0]==="baggage"&&typeof h[1]=="string"&&kb(h[1]));return o&&!d&&l.push(["baggage",o]),l}else{const l="sentry-trace"in c?c["sentry-trace"]:void 0,d="traceparent"in c?c.traceparent:void 0,h="baggage"in c?c.baggage:void 0,p=h?Array.isArray(h)?[...h]:[h]:[],g=h&&(Array.isArray(h)?h.find(v=>kb(v)):kb(h));o&&!g&&p.push(o);const _=Object.assign({},c,{"sentry-trace":l??i,baggage:p.length>0?p.join(","):void 0});return r&&a&&!d&&(_.traceparent=a),_}else return{...s}}function OIe(t,e){if(e.response){qW(t,e.response.status);const n=e.response?.headers?.get("content-length");if(n){const r=parseInt(n);r>0&&t.setAttribute("http.response_content_length",r)}}else e.error&&t.setStatus({code:rs,message:"internal_error"});t.end()}function kb(t){return typeof t!="string"?!1:t.split(",").some(e=>e.trim().startsWith(jS))}function xIe(t){return typeof Headers<"u"&&LE(t,Headers)}function LIe(t){return Array.isArray(t)?t.every(e=>Array.isArray(e)&&e.length===2&&typeof e[0]=="string"):!1}function MIe(t,e,n){if(t.startsWith("data:")){const i=Vc(t);return{name:`${e} ${i}`,attributes:bF(t,void 0,e,n)}}const r=CD(t),s=r?_G(r):t;return{name:`${e} ${s}`,attributes:bF(t,r,e,n)}}function bF(t,e,n,r){const s={url:Vc(t),type:"fetch","http.method":n,[ir]:r,[bo]:"http.client"};return e&&(gG(e)||(s["http.url"]=Vc(e.href),s["server.address"]=e.host),e.search&&(s["http.query"]=e.search),e.hash&&(s["http.fragment"]=e.hash)),s}const x_=en;function VIe(){return"history"in x_&&!!x_.history}
138function FIe(){if(!("fetch"in x_))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function wF(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function BIe(){if(typeof EdgeRuntime=="string")return!0;if(!FIe())return!1;if(wF(x_.fetch))return!0;let t=!1;const e=x_.document;if(e&&typeof e.createElement=="function")try{const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow?.fetch&&(t=wF(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){un&&mt.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function TG(t,e){const n="fetch",r=Wp(n,t);return Gp(n,()=>EG(void 0,e)),r}function $Ie(t){const e="fetch-body-resolved",n=Wp(e,t);return Gp(e,()=>EG(HIe)),n}function EG(t,e=!1){e&&!BIe()||NR(en,"fetch",function(n){return function(...r){const s=new Error,{method:i,url:o}=qIe(r),a={args:r,fetchData:{method:i,url:o},startTimestamp:br()*1e3,virtualError:s,headers:jIe(r)};return t||Ca("fetch",{...a}),n.apply(en,r).then(async c=>(t?t(c):Ca("fetch",{...a,endTimestamp:br()*1e3,response:c}),c),c=>{Ca("fetch",{...a,endTimestamp:br()*1e3,error:c}),DW(c)&&c.stack===void 0&&(c.stack=s.stack,vo(c,"framesToPop",1));const d=dr()?.getOptions().enhanceFetchErrorMessages??"always";if(d!==!1&&c instanceof TypeError&&(c.message==="Failed to fetch"||c.message==="Load failed"||c.message==="NetworkError when attempting to fetch resource."))try{const g=new URL(a.fetchData.url).host;d==="always"?c.message=`${c.message} (${g})`:vo(c,"__sentry_fetch_url_host__",g)}catch{}throw c})}})}async function UIe(t,e){if(t?.body){const n=t.body,r=n.getReader(),s=setTimeout(()=>{n.cancel().then(null,()=>{})},90*1e3);let i=!0;for(;i;){let o;try{o=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:a}=await r.read();clearTimeout(o),a&&(e(),i=!1)}catch{i=!1}finally{clearTimeout(o)}}clearTimeout(s),r.releaseLock(),n.cancel().then(null,()=>{})}}function HIe(t){let e;try{e=t.clone()}catch{return}UIe(e,()=>{Ca("fetch-body-resolved",{endTimestamp:br()*1e3,response:t})})}function _w(t,e){return!!t&&typeof t=="object"&&!!t[e]}function SF(t){return typeof t=="string"?t:t?_w(t,"url")?t.url:t.toString?t.toString():"":""}function qIe(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){const[n,r]=t;return{url:SF(n),method:_w(r,"method")?String(r.method).toUpperCase():vD(n)&&_w(n,"method")?String(n.method).toUpperCase():"GET"}}const e=t[0];return{url:SF(e),method:_w(e,"method")?String(e.method).toUpperCase():"GET"}}function jIe(t){const[e,n]=t;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(vD(e))return new Headers(e.headers)}catch{}}const IG=en;function AD(){try{return IG.document.location.href}catch{return""}}function WIe(t,e=5){if(!IG.HTMLElement)return null;let n=t;for(let r=0;r<e;r++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}const Ns=en;let $R=0;function HVe(){return $R>0}function GIe(){$R++,setTimeout(()=>{$R--})}function KIe(t,e={}){function n(s){return typeof s=="function"}if(!n(t))return t;try{const s=t.__sentry_wrapped__;if(s)return typeof s=="function"?s:t;if(vTe(t))return t}catch{return t}const r=function(...s){en._sentryWrappedDepth=(en._sentryWrappedDepth||0)+1;try{const i=s.map(o=>KIe(o,e));return t.apply(this,i)}catch(i){throw GIe(),bD(o=>{o.addEventProcessor(a=>(e.mechanism&&(NTe(a,void 0),FW(a,e.mechanism)),a.extra={...a.extra,arguments:s},a)),UE(i)}),i}finally{en._sentryWrappedDepth=(en._sentryWrappedDepth||0)-1}};try{for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=t[s])}catch{}OW(r,t),vo(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}function CG(){const t=AD(),{referrer:e}=Ns.document||{},{userAgent:n}=Ns.navigator||{},r={...e&&{Referer:e},...n&&{"User-Agent":n}};return{url:t,headers:r}}const Pu=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,tn=en,zIe=(t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good",jy=(t,e,n,r)=>{let s,i;return o=>{e.value>=0&&(o||r)&&(i=e.value-(s??0),(i||s===void 0)&&(s=e.value,e.delta=i,e.rating=zIe(e.value,n),t(e)))}},Wy=(t=!0)=>{const e=tn.performance?.getEntriesByType?.("navigation")[0];if(!t||e&&e.responseStart>0&&e.responseStart<performance.now())return e},Qp=()=>Wy()?.activationStart??0;function iu(t,e,n){tn.document&&tn.addEventListener(t,e,n)}function KS(t,e,n){tn.document&&tn.removeEventListener(t,e,n)}let Rf=-1;const AG=new Set,YIe=()=>tn.document?.visibilityState==="hidden"&&!tn.document?.prerendering?0:1/0,yw=t=>{if(JIe(t)&&Rf>-1){if(t.type==="visibilitychange"||t.type==="pagehide")for(const e of AG)e();isFinite(Rf)||(Rf=t.type==="visibilitychange"?t.timeStamp:0,KS("prerenderingchange",yw,!0))}},Gy=()=>
138{if(tn.document&&Rf<0){const t=Qp();Rf=(tn.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(n=>n.name==="hidden"&&n.startTime>t)[0]?.startTime)??YIe(),iu("visibilitychange",yw,!0),iu("pagehide",yw,!0),iu("prerenderingchange",yw,!0)}return{get firstHiddenTime(){return Rf},onHidden(t){AG.add(t)}}};function JIe(t){return t.type==="pagehide"||tn.document?.visibilityState==="hidden"}const QIe=()=>`v5-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,Ky=(t,e=-1)=>{const n=Wy();let r="navigate";return n&&(tn.document?.prerendering||Qp()>0?r="prerender":tn.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:e,rating:"good",delta:0,entries:[],id:QIe(),navigationType:r}},_C=new WeakMap;function RD(t,e){try{return _C.get(t)||_C.set(t,new e),_C.get(t)}catch{return new e}}class XIe{constructor(){this._sessionValue=0,this._sessionEntries=[]}_processEntry(e){if(e.hadRecentInput)return;const n=this._sessionEntries[0],r=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&n&&r&&e.startTime-r.startTime<1e3&&e.startTime-n.startTime<5e3?(this._sessionValue+=e.value,this._sessionEntries.push(e)):(this._sessionValue=e.value,this._sessionEntries=[e]),this._onAfterProcessingUnexpectedShift?.(e)}}const Xp=(t,e,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(s=>{Promise.resolve().then(()=>{e(s.getEntries())})});return r.observe({type:t,buffered:!0,...n}),r}}catch{}},PD=t=>{let e=!1;return()=>{e||(t(),e=!0)}},HE=t=>{tn.document?.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()},ZIe=[1800,3e3],e0e=(t,e={})=>{HE(()=>{const n=Gy(),r=Ky("FCP");let s;const o=Xp("paint",a=>{for(const c of a)c.name==="first-contentful-paint"&&(o.disconnect(),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-Qp(),0),r.entries.push(c),s(!0)))});o&&(s=jy(t,r,ZIe,e.reportAllChanges))})},t0e=[.1,.25],n0e=(t,e={})=>{e0e(PD(()=>{const n=Ky("CLS",0);let r;const s=Gy(),i=RD(e,XIe),o=c=>{for(const l of c)i._processEntry(l);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},a=Xp("layout-shift",o);a&&(r=jy(t,n,t0e,e.reportAllChanges),s.onHidden(()=>{o(a.takeRecords()),r(!0)}),tn?.setTimeout?.(r))}))};let RG=0,yC=1/0,Nb=0;const r0e=t=>{t.forEach(e=>{e.interactionId&&(yC=Math.min(yC,e.interactionId),Nb=Math.max(Nb,e.interactionId),RG=Nb?(Nb-yC)/7+1:0)})};let UR;const PG=()=>UR?RG:performance.interactionCount||0,s0e=()=>{"interactionCount"in performance||UR||(UR=Xp("event",r0e,{type:"event",buffered:!0,durationThreshold:0}))},vC=10;let kG=0;const i0e=()=>PG()-kG;class o0e{constructor(){this._longestInteractionList=[],this._longestInteractionMap=new Map}_resetInteractions(){kG=PG(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const e=Math.min(this._longestInteractionList.length-1,Math.floor(i0e()/50));return this._longestInteractionList[e]}_processEntry(e){if(this._onBeforeProcessingEntry?.(e),!(e.interactionId||e.entryType==="first-input"))return;const n=this._longestInteractionList.at(-1);let r=this._longestInteractionMap.get(e.interactionId);if(r||this._longestInteractionList.length<vC||e.duration>n._latency){if(r?e.duration>r._latency?(r.entries=[e],r._latency=e.duration):e.duration===r._latency&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],_latency:e.duration},this._longestInteractionMap.set(r.id,r),this._longestInteractionList.push(r)),this._longestInteractionList.sort((s,i)=>i._latency-s._latency),this._longestInteractionList.length>vC){const s=this._longestInteractionList.splice(vC);for(const i of s)this._longestInteractionMap.delete(i.id)}this._onAfterProcessingINPCandidate?.(r)}}}const NG=t=>{const e=tn.requestIdleCallback||tn.setTimeout;tn.document?.visibilityState==="hidden"?t():(t=PD(t),iu("visibilitychange",t,{once:!0,capture:!0}),iu("pagehide",t,{once:!0,capture:!0}),e(()=>{t(),KS("visibilitychange",t,{capture:!0}),KS("pagehide",t,{capture:!0})}))},a0e=[200,500],c0e=40,l0e=(t,e={})=>
138{if(!(globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype))return;const n=Gy();HE(()=>{s0e();const r=Ky("INP");let s;const i=RD(e,o0e),o=c=>{NG(()=>{for(const d of c)i._processEntry(d);const l=i._estimateP98LongestInteraction();l&&l._latency!==r.value&&(r.value=l._latency,r.entries=l.entries,s())})},a=Xp("event",o,{durationThreshold:e.durationThreshold??c0e});s=jy(t,r,a0e,e.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{o(a.takeRecords()),s(!0)}))})};class u0e{_processEntry(e){this._onBeforeProcessingEntry?.(e)}}const d0e=[2500,4e3],h0e=(t,e={})=>{HE(()=>{const n=Gy(),r=Ky("LCP");let s;const i=RD(e,u0e),o=c=>{e.reportAllChanges||(c=c.slice(-1));for(const l of c)i._processEntry(l),l.startTime<n.firstHiddenTime&&(r.value=Math.max(l.startTime-Qp(),0),r.entries=[l],s())},a=Xp("largest-contentful-paint",o);if(a){s=jy(t,r,d0e,e.reportAllChanges);const c=PD(()=>{o(a.takeRecords()),a.disconnect(),s(!0)}),l=d=>{d.isTrusted&&(NG(c),KS(d.type,l,{capture:!0}))};for(const d of["keydown","click","visibilitychange"])iu(d,l,{capture:!0})}})},f0e=[800,1800],HR=t=>{tn.document?.prerendering?HE(()=>HR(t)):tn.document?.readyState!=="complete"?addEventListener("load",()=>HR(t),!0):setTimeout(t)},p0e=(t,e={})=>{const n=Ky("TTFB"),r=jy(t,n,f0e,e.reportAllChanges);HR(()=>{const s=Wy();s&&(n.value=Math.max(s.responseStart-Qp(),0),n.entries=[s],r(!0))})},Hg={},zS={};let DG,OG,xG,LG;function kD(t,e=!1){return qE("cls",t,g0e,DG,e)}function ND(t,e=!1){return qE("lcp",t,_0e,OG,e)}function m0e(t){return qE("ttfb",t,y0e,xG)}function MG(t){return qE("inp",t,v0e,LG)}function L_(t,e){return VG(t,e),zS[t]||(b0e(t),zS[t]=!0),FG(t,e)}function zy(t,e){const n=Hg[t];if(n?.length)for(const r of n)try{r(e)}catch(s){Pu&&mt.error(`Error while triggering instrumentation handler. 139Type: ${t} 140Name: ${yD(r)} 141Error:`,s)}}function g0e(){return n0e(t=>{zy("cls",{metric:t}),DG=t},{reportAllChanges:!0})}function _0e(){return h0e(t=>{zy("lcp",{metric:t}),OG=t},{reportAllChanges:!0})}function y0e(){return p0e(t=>{zy("ttfb",{metric:t}),xG=t})}function v0e(){return l0e(t=>{zy("inp",{metric:t}),LG=t})}function qE(t,e,n,r,s=!1){VG(t,e);let i;return zS[t]||(i=n(),zS[t]=!0),r&&e({metric:r}),FG(t,e,s?i:void 0)}function b0e(t){const e={};t==="event"&&(e.durationThreshold=0),Xp(t,n=>{zy(t,{entries:n})},e)}function VG(t,e){Hg[t]=Hg[t]||[],Hg[t].push(e)}function FG(t,e,n){return()=>{n&&n();const r=Hg[t];if(!r)return;const s=r.indexOf(e);s!==-1&&r.splice(s,1)}}function w0e(t){return"duration"in t}const S0e=80;function Qs(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,s=[];let i=0,o=0;const a=" > ",c=a.length;let l;const d=Array.isArray(e)?e:e.keyAttrs,h=!Array.isArray(e)&&e.maxStringLength||S0e;for(;n&&i++<r&&(l=T0e(n,d),!(l==="html"||i>1&&o+s.length*c+l.length>=h));)s.push(l),o+=l.length,n=n.parentNode;return s.reverse().join(a)}catch{return"<unknown>"}}function T0e(t,e){const n=t,r=[];if(!n?.tagName)return"";if(typeof HTMLElement<"u"&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=e?.length?e.filter(i=>n.getAttribute(i)).map(i=>[i,n.getAttribute(i)]):null;if(s?.length)s.forEach(i=>{r.push(`[${i[0]}="${i[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const i=n.className;if(i&&ru(i)){const o=i.split(/\s+/);for(const a of o)r.push(`.${a}`)}}for(const i of["aria-label","type","name","title","alt"]){const o=n.getAttribute(i);o&&r.push(`[${i}="${o}"]`)}return r.join("")}const E0e=t=>{const e=n=>{(n.type==="pagehide"||tn.document?.visibilityState==="hidden")&&t(n)};iu("visibilitychange",e,{capture:!0,once:!0}),iu("pagehide",e,{capture:!0,once:!0})};function bC(t){return typeof t=="number"&&isFinite(t)}function wu(t,e,n,{...r}){const s=yn(t).start_timestamp;return s&&s>e&&typeof t.updateStartTime=="function"&&t.updateStartTime(e),hG(t,()=>{const i=Fa({startTime:e,...r});return i&&i.end(n),i})}function DD(t){const e=dr();if(!e)return;const{name:n,transaction:r,attributes:s,startTime:i}=t,{release:o,environment:a}=e.getOptions(),{userInfo:c}=e.getDataCollectionOptions(),d=e.getIntegrationByName("Replay")?.getReplayId(),h=Kn(),p=h.getUser(),g=p!==void 0?p.email||p.id||p.ip_address:void 0;let _;try{_=h.getScopeData().contexts.profile.profile_id}catch{}const v={release:o,environment:a,user:g||void 0,profile_id:_||void 0,replay_id:d||void 0,transaction:r,"user_agent.original":tn.navigator?.userAgent,"client.address":c?"{{auto}}":void 0,...s};return Fa({name:n,attributes:v,startTime:i,experimental:{standalone:!0}})}function Yy(){return tn.addEventListener&&tn.performance}function Zn(t){return t/1e3}function I0e(t){let e="unknown",n="unknown",r="";for(const s of t){if(s==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(s))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=s}return r===t&&(e=r),{name:e,version:n}}function jE(t){try{return PerformanceObserver.supportedEntryTypes.includes(t)}catch{return!1}}function WE(t,e){let n,r=!1;function s(a){!r&&n&&e(a,n.spanContext().spanId,n),r=!0}E0e(()=>{s("pagehide")});const i=t.on("beforeStartNavigationSpan",(a,c)=>{c?.isRedirect||(s("navigation"),i(),o())}),o=t.on("afterStartPageLoadSpan",a=>{n=a,o()})}function C0e(t){let e=0,n;if(!jE("layout-shift"))return;const r=kD(({metric:s})=>{const i=s.entries[s.entries.length-1];
141i&&(e=s.value,n=i)},!0);WE(t,(s,i)=>{A0e(e,n,i,s),r()})}function A0e(t,e,n,r){Pu&&mt.log(`Sending CLS span (${t})`);const s=e?Zn((Ms()||0)+e.startTime):br(),i=Kn().getScopeData().transactionName,o=e?Qs(e.sources[0]?.node):"Layout shift",a={[ir]:"auto.http.browser.cls",[bo]:"ui.webvital.cls",[Jp]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};e?.sources&&e.sources.forEach((l,d)=>{a[`cls.source.${d+1}`]=Qs(l.node)});const c=DD({name:o,transaction:i,attributes:a,startTime:s});c&&(c.addEvent("cls",{[Hy]:"",[qy]:t}),c.end(s))}const R0e=6e4;function Jy(t){return t!=null&&t>0&&t<=R0e}function P0e(t){let e=0,n;if(!jE("largest-contentful-paint"))return;const r=ND(({metric:s})=>{const i=s.entries[s.entries.length-1];!i||!Jy(s.value)||(e=s.value,n=i)},!0);WE(t,(s,i)=>{k0e(e,n,i,s),r()})}function k0e(t,e,n,r){if(!Jy(t))return;Pu&&mt.log(`Sending LCP span (${t})`);const s=Zn((Ms()||0)+(e?.startTime||0)),i=Kn().getScopeData().transactionName,o=e?Qs(e.element):"Largest contentful paint",a={[ir]:"auto.http.browser.lcp",[bo]:"ui.webvital.lcp",[Jp]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};e&&(e.element&&(a["lcp.element"]=Qs(e.element)),e.id&&(a["lcp.id"]=e.id),e.url&&(a["lcp.url"]=e.url),e.loadTime!=null&&(a["lcp.loadTime"]=e.loadTime),e.renderTime!=null&&(a["lcp.renderTime"]=e.renderTime),e.size!=null&&(a["lcp.size"]=e.size));const c=DD({name:o,transaction:i,attributes:a,startTime:s});c&&(c.addEvent("lcp",{[Hy]:"millisecond",[qy]:t}),c.end(s))}function to(t){return t&&((Ms()||performance.timeOrigin)+t)/1e3}function BG(t){const e={};if(t.nextHopProtocol!=null){const{name:n,version:r}=I0e(t.nextHopProtocol);e["network.protocol.version"]=r,e["network.protocol.name"]=n}return Ms()||Yy()?.timeOrigin?N0e({...e,"http.request.redirect_start":to(t.redirectStart),"http.request.redirect_end":to(t.redirectEnd),"http.request.worker_start":to(t.workerStart),"http.request.fetch_start":to(t.fetchStart),"http.request.domain_lookup_start":to(t.domainLookupStart),"http.request.domain_lookup_end":to(t.domainLookupEnd),"http.request.connect_start":to(t.connectStart),"http.request.secure_connection_start":to(t.secureConnectionStart),"http.request.connection_end":to(t.connectEnd),"http.request.request_start":to(t.requestStart),"http.request.response_start":to(t.responseStart),"http.request.response_end":to(t.responseEnd),"http.request.time_to_first_byte":t.responseStart!=null?t.responseStart/1e3:void 0}):e}function N0e(t){return Object.fromEntries(Object.entries(t).filter(([,e])=>e!=null))}const D0e=2147483647;let TF=0,Hs={},ai,YS;function O0e({recordClsStandaloneSpans:t,recordLcpStandaloneSpans:e,client:n}){const r=Yy();if(r&&Ms()){r.mark&&tn.performance.mark("sentry-tracing-init");const s=e?P0e(n):e===!1?F0e():void 0,i=t?C0e(n):t===!1?V0e():void 0,o=B0e();return()=>{o(),s?.(),i?.()}}return()=>{}}function x0e(){L_("longtask",({entries:t})=>{const e=ei();if(!e)return;const{op:n,start_timestamp:r}=yn(e);for(const s of t){const i=Zn(Ms()+s.startTime),o=Zn(s.duration);n==="navigation"&&r&&i<r||wu(e,i,i+o,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[ir]:"auto.ui.browser.metrics"}})}})}function L0e(){new PerformanceObserver(e=>{const n=ei();if(n)for(const r of e.getEntries()){if(!r.scripts[0])continue;const s=Zn(Ms()+r.startTime),{start_timestamp:i,op:o}=yn(n);if(o==="navigation"&&i&&s<i)continue;const a=Zn(r.duration),c={[ir]:"auto.ui.browser.metrics"},l=r.scripts[0],{invoker:d,invokerType:h,sourceURL:p,sourceFunctionName:g,sourceCharPosition:_}=l;c["browser.script.invoker"]=d,c["browser.script.invoker_type"]=h,p&&(c["code.filepath"]=p),g&&(c["code.function"]=g),_!==-1&&(c["browser.script.source_char_position"]=_),wu(n,s,s+a,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:c})}}).observe({type:"long-animation-frame",buffered:!0})}function M0e(){L_("event",({entries:t})=>{const e=ei();if(e){for(const n of t)if(n.name==="click"){const r=Zn(Ms()+n.startTime),s=Zn(n.duration),i={name:Qs(n.target),op:`ui.interaction.${n.name}`,startTime:r,attributes:{[ir]:"auto.ui.browser.metrics"}},o=WIe(n.target);o&&(i.attributes["ui.component_name"]=o),wu(e,r,r+s,i)}}})}function V0e(){return kD(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(Hs.cls={value:t.value,unit:""},YS=e)},!0)}function F0e(){return ND(({metric:t})=>{const e=t.entries[t.entries.length-1];!e||!Jy(t.value)||(Hs.lcp={value:t.value,unit:"millisecond"},ai=e)},!0)}function B0e(){return m0e(({metric:t})=>{t.entries[t.entries.length-1]&&(Hs.ttfb={value:t.value,unit:"millisecond"})})}function $0e(t,e){const n=Yy(),r=Ms();if(!n?.getEntries||!r)return;const{spanStreamingEnabled:s,ignorePerformanceApiSpans:i,ignoreResourceSpans:o,recordClsOnPageloadSpan:a,recordLcpOnPageloadSpan:c}=e,l=Zn(r),d=n.getEntries(),{op:h,start_timestamp:p}=yn(t);
141if(d.slice(TF).forEach(g=>{const _=Zn(g.startTime),v=Zn(Math.max(0,g.duration));if(!(h==="navigation"&&p&&l+_<p))switch(g.entryType){case"navigation":{j0e(t,g,l);break}case"mark":case"paint":case"measure":{H0e(t,g,_,v,l,i);const b=Gy(),w=g.startTime<b.firstHiddenTime;g.name==="first-paint"&&w&&(Hs.fp={value:g.startTime,unit:"millisecond"}),g.name==="first-contentful-paint"&&w&&(Hs.fcp={value:g.startTime,unit:"millisecond"});break}case"resource":{K0e(t,g,g.name,_,v,l,o);break}}}),TF=Math.max(d.length-1,0),z0e(t,s),h==="pageload"){if(Q0e(Hs),s){const g=(_,v,b)=>{const w=b??`browser.web_vital.${_}.value`;t.setAttribute(w,v),Pu&&mt.log("Setting web vital attribute",{[w]:v},"on pageload span")};["ttfb","fp","fcp"].forEach(_=>{Hs[_]&&g(_,Hs[_].value)}),Hs["ttfb.requestTime"]&&g("ttfb.requestTime",Hs["ttfb.requestTime"].value,"browser.web_vital.ttfb.request_time")}else a||delete Hs.cls,c||delete Hs.lcp,Object.entries(Hs).forEach(([g,_])=>{VEe(g,_.value,_.unit)}),Y0e(t,e);t.setAttribute(s?"browser.performance.time_origin":"performance.timeOrigin",l),t.setAttribute(s?"browser.performance.navigation.activation_start":"performance.activationStart",Qp())}ai=void 0,YS=void 0,Hs={}}function U0e(t){if(t?.entryType==="measure")try{return t.detail.devtools.track==="Components â"}catch{return}}function H0e(t,e,n,r,s,i){if(U0e(e)||["mark","measure"].includes(e.entryType)&&fw(e.name,i))return;const o=Wy(!1),a=Zn(o?o.requestStart:0),c=s+Math.max(n,a),l=s+n,d=l+r,h={[ir]:"auto.resource.browser.metrics"};c!==l&&(h["sentry.browser.measure_happened_before_request"]=!0,h["sentry.browser.measure_start_time"]=c),q0e(h,e),c<=d&&wu(t,c,d,{name:e.name,op:e.entryType,attributes:h})}function q0e(t,e){try{const n=e.detail;if(!n)return;if(typeof n=="object"){for(const[r,s]of Object.entries(n))if(s&&kR(s))t[`sentry.browser.measure.detail.${r}`]=s;else if(s!==void 0)try{t[`sentry.browser.measure.detail.${r}`]=JSON.stringify(s)}catch{}return}if(kR(n)){t["sentry.browser.measure.detail"]=n;return}try{t["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}function j0e(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Db(t,e,r,n)}),Db(t,e,"secureConnection",n,"TLS/SSL"),Db(t,e,"fetch",n,"cache"),Db(t,e,"domainLookup",n,"DNS"),G0e(t,e,n)}function Db(t,e,n,r,s=n){const i=W0e(n),o=e[i],a=e[`${n}Start`];!a||!o||wu(t,r+Zn(a),r+Zn(o),{op:`browser.${s}`,name:e.name,attributes:{[ir]:"auto.ui.browser.metrics",...n==="redirect"&&e.redirectCount!=null?{"http.redirect_count":e.redirectCount}:{}}})}function W0e(t){return t==="secureConnection"?"connectEnd":t==="fetch"?"domainLookupStart":`${t}End`}function G0e(t,e,n){const r=n+Zn(e.requestStart),s=n+Zn(e.responseEnd),i=n+Zn(e.responseStart);e.responseEnd&&(wu(t,r,s,{op:"browser.request",name:e.name,attributes:{[ir]:"auto.ui.browser.metrics"}}),wu(t,i,s,{op:"browser.response",name:e.name,attributes:{[ir]:"auto.ui.browser.metrics"}}))}function K0e(t,e,n,r,s,i,o){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const a=e.initiatorType?`resource.${e.initiatorType}`:"resource.other";if(o?.includes(a))return;const c={[ir]:"auto.resource.browser.metrics"},l=GS(n);l.protocol&&(c["url.scheme"]=l.protocol.split(":").pop()),l.host&&(c["server.address"]=l.host),c["url.same_origin"]=n.includes(tn.location.origin),J0e(e,c,[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]]);const d={...c,...BG(e)},h=i+r,p=h+s;wu(t,h,p,{name:n.replace(tn.location.origin,""),op:a,attributes:d})}function z0e(t,e){const n=tn.navigator;if(!n)return;const r=n.connection;r&&(r.effectiveType&&t.setAttribute(e?"network.connection.effective_type":"effectiveConnectionType",r.effectiveType),r.type&&t.setAttribute(e?"network.connection.type":"connectionType",r.type),bC(r.rtt)&&(Hs["connection.rtt"]={value:r.rtt,unit:"millisecond"},e&&t.setAttribute("network.connection.rtt",r.rtt))),bC(n.deviceMemory)&&(e?t.setAttribute("device.memory.estimated_capacity",n.deviceMemory):t.setAttribute("deviceMemory",`${n.deviceMemory} GB`)),bC(n.hardwareConcurrency)&&(e?t.setAttribute("device.processor_count",n.hardwareConcurrency):t.setAttribute("hardwareConcurrency",String(n.hardwareConcurrency)))}function Y0e(t,e){ai&&e.recordLcpOnPageloadSpan&&(ai.element&&t.setAttribute("lcp.element",Qs(ai.element)),ai.id&&t.setAttribute("lcp.id",ai.id),ai.url&&t.setAttribute("lcp.url",ai.url.trim().slice(0,200)),ai.loadTime!=null&&t.setAttribute("lcp.loadTime",ai.loadTime),ai.renderTime!=null&&t.setAttribute("lcp.renderTime",ai.renderTime),t.setAttribute("lcp.size",ai.size)),YS?.sources&&e.recordClsOnPageloadSpan&&YS.sources.forEac
141h((n,r)=>t.setAttribute(`cls.source.${r+1}`,Qs(n.node)))}function J0e(t,e,n){n.forEach(([r,s])=>{const i=t[r];i!=null&&(typeof i=="number"&&i<D0e||typeof i=="string")&&(e[s]=i)})}function Q0e(t){const e=Wy(!1);if(!e)return;const{responseStart:n,requestStart:r}=e;r<=n&&(t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const wC=[],qg=new Map,Qh=new Map,$G=60;function X0e(){if(Yy()&&Ms()){const e=Z0e();return()=>{e()}}return()=>{}}const M_={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function Z0e(){return MG(eCe)}const eCe=({metric:t})=>{if(t.value==null)return;const e=Zn(t.value);if(e>$G)return;const n=t.entries.find(_=>_.duration===t.value&&M_[_.name]);if(!n)return;const{interactionId:r}=n,s=M_[n.name],i=Zn(Ms()+n.startTime),o=ei(),a=o?vs(o):void 0,c=r!=null?qg.get(r):void 0,l=c?.span||a,d=l?yn(l).description:Kn().getScopeData().transactionName,h=c?.elementName||Qs(n.target),p={[ir]:"auto.http.browser.inp",[bo]:`ui.interaction.${s}`,[Jp]:n.duration},g=DD({name:h,transaction:d,attributes:p,startTime:i});g&&(g.addEvent("inp",{[Hy]:"millisecond",[qy]:t.value}),g.end(i+e))};function tCe(t){return t!=null?qg.get(t):void 0}function nCe(){const t=Object.keys(M_);CIe()&&t.forEach(s=>{tn.addEventListener(s,e,{capture:!0,passive:!0})});function e(s){const i=s.target;if(!i)return;const o=Qs(i),a=Math.round(s.timeStamp);if(Qh.set(a,o),Qh.size>50){const c=Qh.keys().next().value;c!==void 0&&Qh.delete(c)}}function n(s){const i=Math.round(s.startTime);let o=Qh.get(i);if(!o)for(let a=-5;a<=5;a++){const c=Qh.get(i+a);if(c){o=c;break}}return o||"<unknown>"}const r=({entries:s})=>{const i=ei(),o=i&&vs(i);s.forEach(a=>{if(!w0e(a))return;const c=a.interactionId;if(c==null||qg.has(c))return;const l=a.target?Qs(a.target):n(a);if(wC.length>10){const d=wC.shift();qg.delete(d)}wC.push(c),qg.set(c,{span:o,elementName:l})})};L_("event",r),L_("first-input",r)}function OD(t){const{name:e,op:n,origin:r,metricName:s,value:i,attributes:o,parentSpan:a,reportEvent:c,startTime:l,endTime:d}=t,h=Kn().getScopeData().transactionName,p={[ir]:r,[bo]:n,[Jp]:0,[`browser.web_vital.${s}.value`]:i,"sentry.transaction":h,"user_agent.original":tn.navigator?.userAgent,...o};a&&eG(a).attributes?.[bo]==="pageload"&&(p["sentry.pageload.span_id"]=a.spanContext().spanId),c&&(p[`browser.web_vital.${s}.report_event`]=c);const g=Fa({name:e,attributes:p,startTime:l,parentSpan:a});g&&g.end(d??l)}function rCe(t){let e=0,n;if(!jE("largest-contentful-paint"))return;const r=ND(({metric:s})=>{const i=s.entries[s.entries.length-1];
141!i||!Jy(s.value)||(e=s.value,n=i)},!0);WE(t,(s,i,o)=>{sCe(e,n,o,s),r()})}function sCe(t,e,n,r){if(!Jy(t))return;Pu&&mt.log(`Sending LCP span (${t})`);const s=Ms()||0,i=Zn(s),o=Zn(s+(e?.startTime||0)),a=e?Qs(e.element):"Largest contentful paint",c={};e?.element&&(c["browser.web_vital.lcp.element"]=Qs(e.element)),e?.id&&(c["browser.web_vital.lcp.id"]=e.id),e?.url&&(c["browser.web_vital.lcp.url"]=e.url),e?.loadTime!=null&&(c["browser.web_vital.lcp.load_time"]=e.loadTime),e?.renderTime!=null&&(c["browser.web_vital.lcp.render_time"]=e.renderTime),e?.size!=null&&(c["browser.web_vital.lcp.size"]=e.size),OD({name:a,op:"ui.webvital.lcp",origin:"auto.http.browser.lcp",metricName:"lcp",value:t,attributes:c,parentSpan:n,reportEvent:r,startTime:i,endTime:o})}function iCe(t){let e=0,n;if(!jE("layout-shift"))return;const r=kD(({metric:s})=>{const i=s.entries[s.entries.length-1];i&&(e=s.value,n=i)},!0);WE(t,(s,i,o)=>{oCe(e,n,o,s),r()})}function oCe(t,e,n,r){Pu&&mt.log(`Sending CLS span (${t})`);const s=e?Zn((Ms()||0)+e.startTime):br(),i=e?Qs(e.sources[0]?.node):"Layout shift",o={};e?.sources&&e.sources.forEach((a,c)=>{o[`browser.web_vital.cls.source.${c+1}`]=Qs(a.node)}),OD({name:i,op:"ui.webvital.cls",origin:"auto.http.browser.cls",metricName:"cls",value:t,attributes:o,parentSpan:n,reportEvent:r,startTime:s})}function aCe(){if(!Yy()||!Ms())return;MG(({metric:n})=>{if(n.value==null||Zn(n.value)>$G)return;const s=n.entries.find(i=>i.duration===n.value&&M_[i.name]);s&&cCe(n.value,s)})}function cCe(t,e){Pu&&mt.log(`Sending INP span (${t})`);const n=Zn(Ms()+e.startTime),r=Zn(t),s=M_[e.name],i=tCe(e.interactionId),o=ei(),a=o?vs(o):void 0,c=i?.span||a,l=c?eG(c).name:Kn().getScopeData().transactionName,d=i?.elementName||Qs(e.target);OD({name:d,op:`ui.interaction.${s}`,origin:"auto.http.browser.inp",metricName:"inp",value:t,attributes:{[Jp]:e.duration,"sentry.transaction":l},startTime:n,endTime:n+r,parentSpan:c})}let Ob;function lCe(t){const e="history";Wp(e,t),Gp(e,uCe)}function uCe(){if(tn.addEventListener("popstate",()=>{const e=tn.location.href,n=Ob;if(Ob=e,n===e)return;Ca("history",{from:n,to:e})}),!VIe())return;function t(e){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const s=Ob,i=dCe(String(r));if(Ob=i,s===i)return e.apply(this,n);Ca("history",{from:s,to:i})}return e.apply(this,n)}}NR(tn.history,"pushState",t),NR(tn.history,"replaceState",t)}function dCe(t){try{return new URL(t,tn.location.origin).toString()}catch{return t}}const gg="__sentry_xhr_v3__";function hCe(t){Wp("xhr",t),Gp("xhr",fCe)}function fCe(){if(!tn.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){const s=new Error,i=br()*1e3,o=ru(r[0])?r[0].toUpperCase():void 0,a=pCe(r[1]);if(!o||!a)return e.apply(n,r);n[gg]={method:o,url:a,request_headers:{}},o==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const c=()=>{const l=n[gg];if(l&&n.readyState===4){try{l.status_code=n.status}catch{}const d={endTimestamp:br()*1e3,startTimestamp:i,xhr:n,virtualError:s};Ca("xhr",d)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(l,d,h){return c(),l.apply(d,h)}}):n.addEventListener("readystatechange",c),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(l,d,h){const[p,g]=h,_=d[gg];return _&&ru(p)&&ru(g)&&(_.request_headers[p.toLowerCase()]=g),l.apply(d,h)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){const s=n[gg];if(!s)return e.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const i={startTimestamp:br()*1e3,xhr:n};return Ca("xhr",i),e.apply(n,r)}})}function pCe(t){if(ru(t))return t;try{return t.toString()}catch{}}function mCe(t){let e;try{e=t.getAllResponseHeaders()}catch(n){return Pu&&mt.error(n,"Failed to get xhr response headers",t),{}}return e?e.split(`\r 142`).reduce((n,r)=>{const[s,i]=r.split(": ");return i&&(n[s.toLowerCase()]=i),n},{}):{}}const Fc=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function gCe(t){return t.split(",").some(e=>e.trim().startsWith("sentry-"))}function UG(t){try{return new URL(t,Ns.location.origin).href}catch{return}}function _Ce(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function HG(t){try{return new Headers(t)}catch{return}}const qG={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function yCe(t,e){const{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:s,enableHTTPTimings:i,tracePropagationTargets:o,onRequestSpanStart:a,onRequestSpanEnd:c}
142={...qG,...e},l=typeof s=="function"?s:g=>!0,d=g=>bCe(g,o),h={},p=t.getOptions().propagateTraceparent;n&&TG(g=>{const _=kIe(g,l,d,h,{propagateTraceparent:p,onRequestSpanEnd:c});if(_){const v=UG(g.fetchData.url),b=v?GS(v).host:void 0;_.setAttributes({"http.url":v?Vc(v):void 0,"server.address":b}),i&&EF(_,t),a?.(_,{headers:g.headers})}}),r&&hCe(g=>{const _=wCe(g,l,d,h,p,c);_&&(i&&EF(_,t),a?.(_,{headers:HG(g.xhr.__sentry_xhr_v3__?.request_headers)}))})}const vCe=300;function EF(t,e){const{url:n}=yn(t).data;if(!n||typeof n!="string")return;let r=()=>{setTimeout(s)};if(el(e)){const i=t.end.bind(t);t.end=o=>{const a=o??br();let c=!1;const l=()=>{c||(c=!0,setTimeout(s),i(a),clearTimeout(d))};r=l;const d=setTimeout(l,vCe)}}const s=L_("resource",({entries:i})=>{i.forEach(o=>{_Ce(o)&&o.name.endsWith(n)&&(t.setAttributes(BG(o)),r())})})}function bCe(t,e){const n=AD();if(n){let r,s;try{r=new URL(t,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return e?fw(r.toString(),e)||i&&fw(r.pathname,e):i}else{const r=!!t.match(/^\/(?!\/)/);return e?fw(t,e):r}}function wCe(t,e,n,r,s,i){const o=t.xhr,a=o?.[gg];if(!o||o.__sentry_own_request__||!a)return;const{url:c,method:l}=a,d=go()&&e(c);if(t.endTimestamp){const E=o.__sentry_xhr_span_id__;if(!E)return;const T=r[E];T&&(d&&a.status_code!==void 0&&(qW(T,a.status_code),T.end(),i?.(T,{headers:HG(mCe(o)),error:t.error})),delete r[E]);return}const h=UG(c),p=GS(h||c),g=Vc(iIe(c)),_=dr(),b=!!ei()||!!_&&el(_),w=d&&b?Fa({name:`${l} ${g}`,attributes:{url:Vc(c),type:"xhr","http.method":l,"http.url":h?Vc(h):void 0,"server.address":p?.host,[ir]:"auto.http.browser",[bo]:"http.client",...p?.search&&{"http.query":p?.search},...p?.hash&&{"http.fragment":p?.hash}}}):new Aa;return d&&!b&&_?.recordDroppedEvent("no_parent_span","span"),o.__sentry_xhr_span_id__=w.spanContext().spanId,r[o.__sentry_xhr_span_id__]=w,n(c)&&SCe(o,go()&&b?w:void 0,s),_&&_.emit("beforeOutgoingRequestSpan",w,t),w}function SCe(t,e,n){const{"sentry-trace":r,baggage:s,traceparent:i}=SG({span:e,propagateTraceparent:n});r&&TCe(t,r,s,i)}function TCe(t,e,n,r){const s=t.__sentry_xhr_v3__?.request_headers;if(!(s?.["sentry-trace"]||!t.setRequestHeader))try{if(t.setRequestHeader("sentry-trace",e),r&&!s?.traceparent&&t.setRequestHeader("traceparent",r),n){const i=s?.baggage;(!i||!gCe(i))&&t.setRequestHeader("baggage",n)}}catch{}}const IF=new WeakMap,CF=new WeakMap,ECe=9e4,ICe=["text/event-stream","application/x-ndjson","application/stream+json"],CCe=()=>({name:"FetchStreamPerformance",setup(){$Ie(t=>{if(t.response){const e=IF.get(t.response);if(e&&t.endTimestamp){e.end(t.endTimestamp);const n=CF.get(t.response);n&&clearTimeout(n)}}}),TG(t=>{if(t.endTimestamp&&t.response){const e=t.response.headers?.get("content-type")||"";if(t.response.headers?.get("content-length")||!ICe.some(c=>e.startsWith(c)))return;const n=t.fetchData?.url||"",r=t.fetchData?.method||"GET",s=CD(n),i=n.startsWith("data:")?Vc(n):s?_G(s):n,o=Fa({name:`${r} ${i}`,startTime:t.endTimestamp,attributes:{url:Vc(n),"http.method":r,type:"fetch",[bo]:"http.client.stream",[ir]:"auto.http.browser.stream"}});IF.set(t.response,o);const a=setTimeout(()=>{o.isRecording()&&o.end()},ECe);CF.set(t.response,a)}})}});function ACe(){Ns.document?Ns.document.addEventListener("visibilitychange",()=>{const t=ei();if(!t)return;const e=vs(t);if(Ns.document.hidden&&e){const n="cancelled",{op:r,status:s}=yn(e);Fc&&mt.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),s||e.setStatus({code:rs,message:n}),e.setAttribute("sentry.cancellation_reason","document.hidden"),e.end()}}):Fc&&mt.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const RCe=3600,jG="sentry_previous_trace",PCe="sentry.previous_trace";function kCe(t,{linkPreviousTrace:e,consistentTraceSampling:n}){const r=e==="session-storage";let s=r?OCe():void 0;t.on("spanStart",o=>{if(vs(o)!==o)return;const a=Kn().getPropagationContext();s=NCe(s,o,a),r&&DCe(s)});let i=!0;n&&t.on("beforeSampling",o=>{if(!s)return;const a=Kn(),c=a.getPropagationContext();if(i&&c.parentSpanId){i=!1;return}a.setPropagationContext({...c,dsc:{...c.dsc,sample_rate:String(s.sampleRate),sampled:String(qR(s.spanContext))},sampleRand:s.sampleRand}),o.parentSampled=qR(s.spanContext),o.parentSampleRate=s.sampleRate,o.spanAttributes={...o.spanAttributes,[UW]:s.sampleRate}})}function NCe(t,e,n){const r=yn(e);function s(){try{return Number(n.dsc?.sample_rate)??Number(r.data?.[wD])}catch{return 0}}const i={spanContext:e.spanContext(),startTimestamp:r.start_timestamp,sampleRate:s(),sampleRand:n.sampleRand};if(!t)return i;const o=t.spanContext;return o.traceId===r.trace_id?t:(Date.now()/1e3-t.startTimestamp<=RCe&&(Fc&&mt.log(`Adding previous_trace \`${JSON.stringify(o)}\` link to span \`${JSON.stringify({op:r.op,...e.spanContext()})}\``),e.addLink({context:o,attributes:{[XTe]:"previous_trace"}}),e.setAttribute(PCe,`${o.traceId}-${o.spanId}-${qR(o)?1:0}
142`)),i)}function DCe(t){try{Ns.sessionStorage.setItem(jG,JSON.stringify(t))}catch(e){Fc&&mt.warn("Could not store previous trace in sessionStorage",e)}}function OCe(){try{const t=Ns.sessionStorage?.getItem(jG);return JSON.parse(t)}catch{return}}function qR(t){return t.traceFlags===1}const xCe="BrowserTracing",LCe=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i;function MCe(){const t=Ns.navigator;return t?.userAgent?LCe.test(t.userAgent):!1}const VCe={...gw,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...qG},AF=((t={})=>{"enableElementTiming"in t&&jp(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const e={name:void 0,source:void 0},n=Ns.document,{enableInp:r,enableLongTask:s,enableLongAnimationFrame:i,_experiments:{enableInteractions:o,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:c},beforeStartSpan:l,idleTimeout:d,finalTimeout:h,childSpanTimeout:p,markBackgroundSpan:g,traceFetch:_,traceXHR:v,trackFetchStreamPerformance:b,shouldCreateSpanForRequest:w,enableHTTPTimings:E,ignoreResourceSpans:T,ignorePerformanceApiSpans:R,instrumentPageLoad:N,instrumentNavigation:O,detectRedirects:S,linkPreviousTrace:I,consistentTraceSampling:P,enableReportPageLoaded:k,onRequestSpanStart:L,onRequestSpanEnd:M}={...VCe,...t},V=MCe();let z,ie,K;function ce(G,Z,de=!0){const fe=Z.op==="pageload",ee=Z.name,Te=l?l(Z):Z,pe=Te.attributes||{};if(ee!==Te.name&&(pe[lo]="custom",Te.attributes=pe),!de){const Y=Uy();Fa({...Te,startTime:Y}).end(Y);return}e.name=Te.name,e.source=pe[lo];const Ce=pG(Te,{idleTimeout:d,finalTimeout:h,childSpanTimeout:p,disableAutoFinish:fe,beforeSpanEnd:Y=>{z?.();const ve=el(G);$0e(Y,{recordClsOnPageloadSpan:!ve&&!a,recordLcpOnPageloadSpan:!ve&&!c,ignoreResourceSpans:T,ignorePerformanceApiSpans:R,spanStreamingEnabled:ve}),kF(G,void 0);const Ee=Kn(),Me=Ee.getPropagationContext();Ee.setPropagationContext({...Me,traceId:Ce.spanContext().traceId,sampled:Ru(Ce),dsc:bu(Y)}),fe&&(K=void 0)},trimIdleSpanEndTimestamp:!k});fe&&k&&(K=Ce),kF(G,Ce);function Ve(){n&&["interactive","complete"].includes(n.readyState)&&G.emit("idleSpanEnableAutoFinish",Ce)}fe&&!k&&n&&(n.addEventListener("readystatechange",()=>{Ve()}),Ve())}return{name:xCe,setup(G){if(V){Fc&&mt.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");return}TEe();const Z=el(G);if(z=O0e({recordClsStandaloneSpans:Z?void 0:a||!1,recordLcpStandaloneSpans:Z?void 0:c||!1,client:G}),Z?(rCe(G),iCe(G),r&&aCe()):r&&X0e(),i&&en.PerformanceObserver&&PerformanceObserver.supportedEntryTypes?.includes("long-animation-frame")?L0e():s&&x0e(),o&&M0e(),S&&n){const fe=()=>{ie=br()};addEventListener("click",fe,{capture:!0}),addEventListener("keydown",fe,{capture:!0,passive:!0})}function de(){const fe=V_(G);fe&&!yn(fe).timestamp&&(Fc&&mt.log(`[Tracing] Finishing current active span with op: ${yn(fe).op}`),fe.setAttribute(D_,"cancelled"),fe.end())}G.on("startNavigationSpan",(fe,ee)=>{if(dr()!==G)return;if(ee?.isRedirect){Fc&&mt.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),ce(G,{op:"navigation.redirect",...fe},!1);return}ie=void 0,de(),Yp().setPropagationContext({traceId:Zc(),sampleRand:Math.random(),propagationSpanId:go()?void 0:Lc()});const Te=Kn();Te.setPropagationContext({traceId:Zc(),sampleRand:Math.random(),propagationSpanId:go()?void 0:Lc()}),Te.setSDKProcessingMetadata({normalizedRequest:void 0}),ce(G,{op:"navigation",...fe,parentSpan:null,forceTransaction:!0})}),G.on("startPageLoadSpan",(fe,ee={})=>{if(dr()!==G)return;de();const Te=ee.sentryTrace||RF("sentry-trace")||PF("sentry-trace"),pe=ee.baggage||RF("baggage")||PF("baggage"),Ce=mEe(Te,pe),Ve=Kn();Ve.setPropagationContext(Ce),go()||(Ve.getPropagationContext().propagationSpanId=Lc()),Ve.setSDKProcessingMetadata({normalizedRequest:CG()}),ce(G,{op:"pageload",...fe})}),G.on("endPageloadSpan",()=>{k&&K&&(K.setAttribute(D_,"reportPageLoaded"),K.end())})},afterAllSetup(G){if(V)return;let Z=AD();if(I!=="off"&&kCe(G,{linkPreviousTrace:I,consistentTraceSampling:P}),Ns.location){if(N){const de=Ms();FCe(G,{name:Ns.location.pathname,startTime:de?de/1e3:void 0,attributes:{[lo]:"url",[ir]:"auto.pageload.browser"}})}O&&lCe(({to:de,from:fe})=>{if(fe===void 0&&Z?.indexOf(de)!==-1){Z=void 0;return}Z=void 0;const ee=CD(de),Te=V_(G),pe=Te&&S&&$Ce(Te,ie);WG(G,{name:ee?.pathname||Ns.location.pathname,attributes:{[lo]:"url",[ir]:"auto.navigation.browser"}},{url:de,isRedirect:pe})})}g&&ACe(),o&&BCe(G,d,h,p,e),r&&nCe(),yCe(G,{traceFetch:_,traceXHR:v,tracePropagationTargets:G.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:w,enableHTTPTimings:E,onRequestSpanStart:L,onRequestSpanEnd:M}),b&&G.addIntegration(CCe())}}});function FCe(t,e,n){t.emit("startPageLoadSpan",e,n),Kn().setTransactionName(e.name);const r=V_(t);return r&&t.emit("afterStartPageLoadSpan",r),r}function WG(t,e,n){const{url:r,isRedirect:s}=n||{};t.emit("beforeStartNavigationSpan",e,{isRedirect:s}),t.emit("startNavigationSpan",e,{isRedirect:s});const i=Kn();return i.setTransactionName(e.name),r&&!s&&i.setSDKProcessingMetadata({normalizedRequest:{...CG(),url:r}}),V_(t)}function RF(t){return Ns.document?.querySelector(`meta[name=${t}]`)?.getAttribute("content")||void 0}function PF(t){return Ns.performance?.getEntriesByType?.("navigation")[0]?.serverTiming?.find(r=>r.name===t)?.description}function BCe(t,e,n,r,s){const i=Ns.document;let o;const a=()=>{const c="ui.action.click",l=V_(t);if(l){const d=yn(l).op;
142if(["navigation","pageload"].includes(d)){Fc&&mt.warn(`[Tracing] Did not create ${c} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(D_,"interactionInterrupted"),o.end(),o=void 0),!s.name){Fc&&mt.warn(`[Tracing] Did not create ${c} transaction because _latestRouteName is missing.`);return}o=pG({name:s.name,op:c,attributes:{[lo]:s.source||"url"}},{idleTimeout:e,finalTimeout:n,childSpanTimeout:r})};i&&addEventListener("click",a,{capture:!0})}const GG="_sentry_idleSpan";function V_(t){return t[GG]}function kF(t,e){vo(t,GG,e)}const NF=1.5;function $Ce(t,e){const n=yn(t),r=Uy(),s=n.start_timestamp;return!(r-s>NF||e&&r-e<=NF)}const KG=["activate","mount"],zG=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,UCe=/(?:^|[-_])(\w)/g,HCe=t=>t.replace(UCe,e=>e.toUpperCase()).replace(/[-_]/g,""),qCe="<Root>",SC="<Anonymous>",jCe=(t,e)=>t.repeat(e),jg=(t,e)=>{if(!t)return SC;if(t.$root===t)return qCe;if(!t.$options)return SC;const n=t.$options;let r=n.name||n._componentTag||n.__name;const s=n.__file;if(!r&&s){const i=s.match(/([^/\\]+)\.vue$/);i&&(r=i[1])}return(r?`<${HCe(r)}>`:SC)+(s&&e!==!1?` at ${s}`:"")},WCe=t=>{if(t&&(t._isVue||t.__isVue)&&t.$parent){const e=[];let n=0;for(;t;){if(e.length>0){const s=e[e.length-1];if(s.constructor===t.constructor){n++,t=t.$parent;continue}else n>0&&(e[e.length-1]=[s,n],n=0)}e.push(t),t=t.$parent}return` 143 144found in 145 146${e.map((s,i)=>`${(i===0?"---> ":jCe(" ",5+i*2))+(Array.isArray(s)?`${jg(s[0])}... (${s[1]} recursive calls)`:jg(s))}`).join(` 147`)}`}return` 148 149(found in ${jg(t)})`},GCe=(t,e)=>{const{errorHandler:n}=t.config;t.config.errorHandler=(r,s,i)=>{const o=jg(s,!1),a=s?WCe(s):"",c={componentName:o,lifecycleHook:i,trace:a};if(e?.attachProps!==!1&&s&&(s.$options?.propsData?c.propsData=s.$options.propsData:s.$props&&(c.propsData=s.$props)),setTimeout(()=>{UE(r,{captureContext:{contexts:{vue:c}},mechanism:{handled:!!n,type:"auto.function.vue.error_handler"}})}),typeof n=="function"&&t.config.errorHandler)n.call(t,r,s,i);else throw r}},DF="ui.vue",KCe={activate:["activated","deactivated"],create:["beforeCreate","created"],unmount:["beforeUnmount","unmounted"],destroy:["beforeDestroy","destroyed"],mount:["beforeMount","mounted"],update:["beforeUpdate","updated"]};function TC(t,e,n){t.$_sentryRootComponentSpanTimer&&clearTimeout(t.$_sentryRootComponentSpanTimer),t.$_sentryRootComponentSpanTimer=setTimeout(()=>{t.$root?.$_sentryRootComponentSpan&&(t.$root.$_sentryRootComponentSpan.end(e),t.$root.$_sentryRootComponentSpan=void 0)},n)}function zCe(t,e){function n(s){return s.replace(/^<([^\s]*)>(?: at [^\s]*)?$/,"$1")}return t.some(s=>n(e)===n(s))}const YCe=(t={})=>{const e=(t.hooks||[]).concat(KG).filter((s,i,o)=>o.indexOf(s)===i),n={},r=t.timeout||2e3;for(const s of e){const i=KCe[s];if(!i){zG&&mt.warn(`Unknown hook: ${s}`);continue}for(const o of i)n[o]=function(){const a=this.$root===this;a&&(this.$_sentryRootComponentSpan=this.$_sentryRootComponentSpan||Fa({name:"Application Render",op:`${DF}.render`,attributes:{[ir]:"auto.ui.vue"},onlyIfParent:!0}),TC(this,br(),r));const c=jg(this,!1);if(!(a||(Array.isArray(t.trackComponents)?zCe(t.trackComponents,c):t.trackComponents))){TC(this,br(),r);return}this.$_sentryComponentSpans=this.$_sentryComponentSpans||{};const d=o===i[0],h=this.$root?.$_sentryRootComponentSpan||ei();if(d){if(h){const p=this.$_sentryComponentSpans[s];p&&p.end(),this.$_sentryComponentSpans[s]=Fa({name:`Vue ${c}`,op:`${DF}.${s}`,attributes:{[ir]:"auto.ui.vue"},onlyIfParent:!0})}}else{const p=this.$_sentryComponentSpans[s];if(!p)return;p.end(),TC(this,br(),r)}}}return n},JCe=en,QCe={Vue:JCe.Vue,attachProps:!0,attachErrorHandler:!0,tracingOptions:{hooks:KG,timeout:2e3,trackComponents:!1}},XCe="Vue",ZCe=(t={})=>({name:XCe,setup(e){const n={...QCe,...e.getOptions(),...t};if(!n.Vue&&!n.app){jp(()=>{console.warn("[@sentry/vue]: Misconfigured SDK. Vue specific errors will not be captured. Update your `Sentry.init` call with an appropriate config option: `app` (Application Instance - Vue 3) or `Vue` (Vue Constructor - Vue 2).")});return}
149n.app?(Array.isArray(n.app)?n.app:[n.app]).forEach(s=>OF(s,n)):n.Vue&&OF(n.Vue,n)}}),OF=(t,e)=>{zG&&t._instance?.isMounted===!0&&jp(()=>{console.warn("[@sentry/vue]: Misconfigured SDK. Vue app is already mounted. Make sure to call `app.mount()` after `Sentry.init()`.")}),e.attachErrorHandler&&GCe(t,e),go(e)&&t.mixin(YCe(e.tracingOptions))};function eAe(t,e,n){let r=!1;const s="mode"in t;t.onError(i=>UE(i,{mechanism:{handled:!1}})),t.beforeEach((i,o,...a)=>{const c=r?void 0:tAe(),l={};for(const p of Object.keys(i.params))l[`url.path.parameter.${p}`]=i.params[p],l[`params.${p}`]=i.params[p];for(const p of Object.keys(i.query)){const g=i.query[p];g&&(l[`query.${p}`]=g)}let d=i.path,h="url";if(i.name&&e.routeLabel!=="path")d=i.name.toString(),h="custom";else if(i.matched.length>0){const p=i.matched.length-1;d=i.matched[p].path,h="route"}if(Kn().setTransactionName(d),e.instrumentPageLoad&&c&&(yn(c).data[lo]!=="custom"&&(c.updateName(d),c.setAttribute(lo,h)),c.setAttributes({...l,[ir]:"auto.pageload.vue"}),r=!0),e.instrumentNavigation&&!c&&n({name:d,op:"navigation",attributes:{...l,[ir]:"auto.navigation.vue",[lo]:h}}),s){const p=a[0];typeof p=="function"&&p()}})}function tAe(){const t=ei(),e=t&&vs(t);return e&&yn(e).op==="pageload"?e:void 0}function nAe(t={}){if(!t.router)return AF(t);const e=AF({...t,instrumentNavigation:!1}),{router:n,instrumentNavigation:r=!0,instrumentPageLoad:s=!0,routeLabel:i="name"}=t;return{...e,afterAllSetup(o){e.afterAllSetup(o),eAe(n,{routeLabel:i,instrumentNavigation:r,instrumentPageLoad:s},c=>{WG(o,c)})}}}const rAe="$s";function Bd(...t){const e=typeof t[t.length-1]=="string"?t.pop():void 0;typeof t[0]!="string"&&t.unshift(e);const[n,r]=t;if(!n||typeof n!="string")throw new TypeError("[nuxt] [useState] key must be a string: "+n);if(r!==void 0&&typeof r!="function")throw new Error("[nuxt] [useState] init must be a function: "+r);const s=rAe+n,i=xt(),o=vp(i.payload.state,s);if(r&&(i._state[s]??={_default:r}),o.value===void 0&&r){const a=r();if(Pn(a))return i.payload.state[s]=a,a;o.value=a}return o}let xb=null;const ua=()=>{const t=Bd("fb-uid",()=>null),e=Bd("fb-loading",()=>!0),n=Bd("fb-profile",()=>null);return{uid:Ac(t),loading:Ac(e),profile:Ac(n),initAuth:()=>xb||(xb=new Promise(o=>{Dve(xc,a=>{if(e.value=!1,!a){t.value=null,n.value=null,o();return}t.value=a.uid,n.value={displayName:a.displayName||"",email:a.providerData[0]?.email||a.email||"",photoURL:a.photoURL||""},o()})}),xb),signInWithGoogle:async()=>{try{return(await Xve(xc,cD)).user}catch(o){throw console.error("Google sign-in error:",o),o}},signOut:async()=>{try{await B6(xc)}catch(o){throw console.error("Sign-out error:",o),o}}}},Ct=((t,e,n={})=>{const{public:{apiBase:r}}=Ks(),s=au().createInstance();let i=r+e;const o=Ae([]),a=async O=>{const S=await s(i,{query:O});return o.value=S,S},c=async(O,S)=>{const I={},P=n.businessMode?.();P&&(I.businessMode=P);const k=await s(`${i}/${O}/${S}`,{query:I});return o.value=k,k},l=async(O,S,I)=>{const P=await s(`${i}/${encodeURIComponent(O)}/${S}/${I}`);return o.value=P,P},d=async O=>{const S=await s(`${i}/${encodeURIComponent(O)}`);return o.value=S,S},h=async O=>await s(i,{query:{ids:O.join(",")}}),p=O=>{const S=n.businessMode?.();return S&&O&&typeof O=="object"&&!Array.isArray(O)&&!("businessMode"in O)?{...O,businessMode:S}:O};return{fetch:a,fetchBetween:c,fetchByIdBetween:l,fetchByKey:d,fetchByIds:h,data:o,post:async O=>{const S=p(O);return await s(i,{method:"POST",body:JSON.stringify(S)})},postWithKey:async(O,S)=>await s(i+"/"+encodeURIComponent(O),{method:"POST",body:JSON.stringify(S)}),changePassword:async(O,S)=>await s(`${i}/${encodeURIComponent(O)}/change-password`,{method:"POST",body:JSON.stringify(S)}),postWithQuery:async(O,S)=>await s(i,{method:"POST",query:O,body:S?JSON.stringify(S):void 0}),put:async(O,S,I)=>await s(i+"/"+encodeURIComponent(O),{method:"PUT",body:JSON.stringify(S)}),remove:async(O,S)=>await s(i+"/"+encodeURIComponent(O),{method:"DELETE",...S&&{body:JSON.stringify(S)}}),postByDynamoFormat:async(O,S)=>await s(i,{method:"POST",body:JSON.stringify(S)}),putByDynamoFormat:async(O,S,I)=>await s(i+"/"+encodeURIComponent(S),{method:"PUT",body:JSON.stringify(I)}),removeByDynamoFormat:async(O,S,I)=>await s(i+"/"+encodeURIComponent(S),{method:"DELETE",...I&&{body:JSON.stringify(I)}})}});var Bt=(t=>(t[t.TABLE=1]="TABLE",t[t.TOGO=2]="TOGO",t[t.JOB=3]="JOB",t[t.DELIVERY=4]="DELIVERY",t))(Bt||{}),pt=(t=>(t[t.OPEN_SHOP=100]="OPEN_SHOP",t[t.CHANGE_SHIFT=110]="CHANGE_SHIFT",t[t.ADD=200]="ADD",t[t.MOVE_TO=310
149]="MOVE_TO",t[t.MOVE_RECEIVED=320]="MOVE_RECEIVED",t[t.SPLIT=330]="SPLIT",t[t.SET_DISCOUNT_ITEMS=340]="SET_DISCOUNT_ITEMS",t[t.SET_COMMENTS=350]="SET_COMMENTS",t[t.SET_PRICE=360]="SET_PRICE",t[t.SET_DELIVERY_INFO=370]="SET_DELIVERY_INFO",t[t.VOID=500]="VOID",t[t.VOID_TOPPING=505]="VOID_TOPPING",t[t.CLEAR_TABLE=510]="CLEAR_TABLE",t[t.CLEAR_ALL=520]="CLEAR_ALL",t[t.PAY=700]="PAY",t[t.DRAWER=999]="DRAWER",t[t.CLOSE_SHOP=900]="CLOSE_SHOP",t))(pt||{});const YG={100:"Open Shop",110:"Change Shift",200:"Add",310:"Move To",320:"Move Received",330:"Split",340:"Set Discount Items",350:"Set Comments",360:"Set Price",370:"Set Delivery Info",500:"Void",505:"Void Topping",510:"Clear Table",520:"Clear All",700:"Pay",999:"Drawer",900:"Close Shop"},sAe=["uuid","name","quantity","price","discountedPrice","subItemId","comments","toppings","isOpenMenu","openMenuName"];function iAe(t){const e={};for(const n of sAe)t?.[n]!==void 0&&(e[n]=t[n]);return e}function oAe(t){return Array.isArray(t)?t.map(iAe):[]}function aAe(t,e){if(!Array.isArray(e))return[];const n=t===pt.PAY?e.filter(r=>r?.isOpenMenu===!0):e;return oAe(n)}class ou{job;constructor(){return this.job={v:"app2"},this}withJson2(e){return this.job.json2=e,this}withMode(e){return this.job.mode=e,this}withSource(e){return this.job.source=e,this}withTableAlias(e){return this.job.alias=e.replace("à¹à¸à¹à¸° ","T").replace("Table ","T"),this}withTableUuid(e){return this.job.uuid=e,this}withNickName(e){return this.job.nickName=e,this}withNewTable(e){return this.job.newAlias=e?.replace("à¹à¸à¹à¸° ","T").replace("Table ","T"),this}withActionType(e){return this.job.type=e,this.job.title=YG[e],this}withOrderJson(e){return this.job.json=JSON.stringify(e),this}withNote(e){return this.job.note=e,this}withValue(e){return this.job.value=e,this}withGuests(e=2){return this.job.guests=e,this}withEmployee(e){return this.job.employee={name:e.name||"unknown",employeeId:e.id||"unknown"},this}withPrint(e){return this.job.toKitchen=e,this}withIsMoveAndOpeningNewTable(e){return this.job.isMoveAndOpeningNewTable=e,this}withIsOpeningTable(e){return this.job.isOpeningTable=e,this}withIsClosingTable(e){return this.job.isClosingTable=e,this.job.isPayAll=e,this}withJobId(e){return this.job.jobId=e,this}withCustom(e){return this.job={...this.job,...e},this}withDeliveryInfo(e){return this.job.deliveryInfo=e,this}withJobIdAndTimestamp(e){return this.job.jobId=e,this.job.timestamp=e,this}withCashInitalAmount(e){return this.job.cashInitalAmount=e,this}build(){let e=Qe.cloneDeep(this.job);return e.jobId=e.jobId+("__"+(e.alias||e.title)),Array.isArray(e.__items)&&(e.__items=aAe(e.type,e.__items)),{...Qe.omitBy(e,r=>Qe.isString(r)?r.trim()==="":Qe.isObject(r)?Qe.isEmpty(r):Qe.isUndefined(r))}}}const cAe=90,xF=t=>t.reduce((e,n)=>e+(n.quantity||1),0),LF=t=>t.reduce((e,n)=>e+(n.price||0)*(n.quantity||1),0),Xh=t=>t.map(e=>{const n=`${e.name} X ${e.quantity||1}`,r=(e.toppings||[]).map(i=>i?.quantity>1?`${i.name} x${i.quantity}`:i?.name).filter(Boolean),s=[n];return r.length&&s.push(`+${r.join(", ")}`),e.comments&&s.push(`ð¬ ${e.comments}`),s.join(" ")}).join(", "),Lb=(t,e)=>t?e===Bt.TABLE?`Table ${t?.replace("à¹à¸à¹à¸° ","T").replace("Table ","T")}`:t?.replace("à¹à¸à¹à¸° ","T").replace("Table ","T"):"",lAe=(t,e)=>{if(t)return e===Bt.TABLE?`${t}`:t},uAe=t=>{if(!t)return null;try{return JSON.parse(t)}catch{return null}};class dAe{customerId="";timestamp="";title="";type=0;alias;uuid;mode;qty;toKitchen;json;json2;isPayAll;by;fullAlias;machine;message;shortAlias;ttl;value;discountRequest;isMoveAll;newAlias;newUuid;newUniqueId;nonce;Nonce;fromJobCard(e,n,r){const s=new Date(e.timestamp);this.timestamp=s.toISOString(),this.type=e.type,n&&(this.customerId=`${n}#${r||s.toISOString().slice(0,10)}`),this.machine="cashier",this.alias=e.nickName||e.alias?.replace("à¹à¸à¹à¸° ","T").replace("Table ","T"),this.uuid=e.nickName||e.uuid,this.mode=e.mode,this.toKitchen=e.toKitchen,this.json=e.json,this.json2=e.json2,this.isPayAll=e.isPayAll,this.newAlias=e.newAlias?.replace("à¹à¸à¹à¸° ","T").replace("Table ","T"),this.newUuid=e.newUuid,this.discountRequest=e.discountRequest;const i=uAe(e.json),o=i?.orderitems||[],a=e.__items||[];return this.by=i?.by||i?.employeeName||i?.username||e.employee?.name,this.fullAlias=Lb(e.nickName||e.alias,e.mode),this.shortAlias=lAe(e.nickName||e.alias,e.mode),o.length&&(this.quantity=xF(o),this.value=LF(o)),this._buildTitleAndMessage(e,o,a),this.ttl=Math.floor(Date.now()/1e3)+cAe*24*60*60,this.Nonce=this.timestamp.replace(/[:.]/g,"_"),this}_buildTitleAndMessage(e,n,r){const s=Lb(e.nickName||e.alias,e.mode),i=YG[e.type]||String(e.type);let a=e.mode===Bt.TABLE?`${i}`:i;e.source&&(a=`${i} (${e.source})`);const c=r[0];switch(e.type){case pt.OPEN_SHOP:this.title="Open Shop",this.message="Open shop",this.value=0;break;case pt.ADD:this.title=a,this.message=`${s} : ${Xh(n)}`;break;case pt.MOVE_TO:{this.title="Move to";const p=Lb(e.newAlias,e.mode);this.message=`${s} moved to ${p} : ${Xh(r)||Xh(n)}`,this.isMoveAll=!0,this.value=0;break}case pt.MOVE_RECEIVED:{this.title="Move (receive)";const p=Lb(e.oldAlias,e.mode);this.message=`${s} received from ${p} : ${Xh(r)||Xh(n)}`,this.isMoveAll=!1,this.value=0;break}case pt.SPLIT:this.title="Split item";const l=Qe.values(e.json2);this.fullAlias=s,this.message=`${s} : splited item ,${c?.name} X ${c?.quantity||1} ==> [${c?.quantity-Number(l[0])} ,${l[0]}]`,this.value=0;break;case pt.SET_DISCOUNT_ITEMS:{this.title="Discount Items";const p=this.discountRequest,g=p?p.mode===1?`${p.value} THB`:`${p.value}%`:"0%",_=r.map(v=>`${v.name} X${v.quantity||1}`).join(", ");this.message=`discount ${g} : ${_}`,this.quantity=0,this.value=0;break}case pt.SET_COMMENTS:this.title="Set Comment";
149const d=Qe.values(e.json2);this.fullAlias=s,this.message=`set comment : ${c?.name} to ${d[0]||""}`,this.toKitchen=!1,this.quantity=0,this.value=0;break;case pt.SET_PRICE:this.title="Set Price";const h=Qe.values(e.json2);this.message=`set price : ${c?.name} to ${h[0]}`,this.toKitchen=!1,this.quantity=0,this.value=0;break;case pt.VOID_TOPPING:case pt.VOID:{if(this.title=e.type===pt.VOID_TOPPING?"Void Topping":"Void",this.toKitchen=!0,r.length){const p=e.json2||{},g=r.map(_=>({..._,quantity:Math.abs(Number(p[_.uuid]??0))||_.quantity||1}));this.quantity=-xF(g),this.value=-LF(g),this.message=`${s} voided : ${Xh(g)} __ [ approved by ${this.by||""} ]`}else this.message=`${s} voided`;break}case pt.PAY:this.title="Pay",this.value=e.grandTotal,this.message=`${s} Paid : ${e.grandTotal}, ${e.paymentType}`;break;case pt.CLOSE_SHOP:this.title="Close Shop",this.message="Close shop",this.value=0;break;default:this.title=a,this.message=`${s} : ${i}`;break}}}const Ze=il(()=>{const t=Ae("_");return{handshakeMobileV1Ref:()=>Zt(qt,`customer/${t.value}/mobile_handshake`),mobileV2HandshakeRef:()=>Zt(qt,`customer/${t.value}/mobile_v2_handshake`),mobileV2JobRef:()=>Zt(qt,`customer/${t.value}/mobile_v2_job`),mobileV2ResultRef:()=>Zt(qt,`customer/${t.value}/mobile_v2_result`),mobileV2HistoryRef:()=>Zt(qt,`customer/${t.value}/mobile_v2_history`),handshakeVoidFromMobileRef:()=>Zt(qt,`customer/${t.value}/tables_v2_handshake_void_from_mobile`),voidFromMobileRef:()=>Zt(qt,`customer/${t.value}/tables_v2_void_from_mobile`),handshakeTerminalRef:()=>Zt(qt,`customer/${t.value}/terminal_handshake`),terminalJobRef:()=>Zt(qt,`customer/${t.value}/terminal_job`),terminalJobResultRef:()=>Zt(qt,`customer/${t.value}/terminal_job_result`),setStoreId:G=>{t.value=G},customerRootRef:()=>Zt(qt,`customer/${t.value}`),jobchainRef:()=>Zt(qt,`customer/${t.value}/jobchain`),tablesStateRef:()=>Zt(qt,`customer/${t.value}/tables_state`),lastReceiptIdRef:()=>Zt(qt,`customer/${t.value}/last_id_receipt_running`),tablesV2Ref:()=>Zt(qt,`customer/${t.value}/tables_v2`),tablesV2HistoryRef_OLD:()=>Zt(qt,`customer/${t.value}/tables_v2_history`),tablesV3Ref:()=>Zt(qt,`customer/${t.value}/tables_v3`),tablesRef:()=>Zt(qt,`customer/${t.value}/tables`),pairedRef:()=>Zt(qt,`customer/${t.value}/paired`),quotaRef:()=>Zt(qt,`customer/${t.value}/quota`),soldoutRef:()=>Zt(qt,`customer/${t.value}/soldout`),billNumberRef:()=>Zt(qt,`customer/${t.value}/items_bills`),billNumberRef_OLD:()=>Zt(qt,`customer/${t.value}/bills_number`),printPreviewFromTerminalRef:()=>Zt(qt,`customer/${t.value}/print_preview_from_terminal`),mainCashierRef:()=>Zt(qt,`customer/${t.value}/main_cashier`),cashiersRef:()=>Zt(qt,`customer/${t.value}/cashiers`),cashierEntryRef:G=>Zt(qt,`customer/${t.value}/cashiers/${G}`),secondCashierPrintRef:()=>Zt(qt,`customer/${t.value}/second_cashier_print`),jobHandshakeRef:()=>Zt(qt,`customer/${t.value}/jobs/handshake`),jobMobileRef:()=>Zt(qt,`customer/${t.value}/jobs/mobile`),jobTerminalRef:()=>Zt(qt,`customer/${t.value}/jobs/terminal`),jobTerminalHandshakeRef:()=>Zt(qt,`customer/${t.value}/jobs/terminal_handshake`)}}),hAe=1,fAe="===========";function jR(t){return t?Number(t.subItemId??t.subitemid)===hAe||t.isDivider===!0:!1}function JG(t,e){let n=(t??"").toString().replace("à¹à¸à¹à¸° ","T").replace("Table ","T");const r=Number(e?.mode),s=!r||r===1,i=String(e?.v??"").toLowerCase()==="app2";return s&&!i&&/^\d+$/.test(n)&&(n="T"+n),n}const ns={OPEN_SHOP:100,ADD:200,MOVE_TO:310,MOVE_RECEIVED:320,SPLIT:330,SET_DISCOUNT_ITEMS:340,SET_COMMENTS:350,SET_PRICE:360,SET_DELIVERY_INFO:370,VOID:500,VOID_TOPPING:505,CLEAR_TABLE:510,CLEAR_ALL:520,PAY:700,CLOSE_SHOP:900},MF=1e-6;class pd{tableHolder={};jobId={};constructor(e={}){this.tableHolder=e||{},this.jobId={}}computeAllBlocks(e,{uuidItemToBillNumber:n={}}={}){let r=this.tableHolder,s=this.jobId;for(let a=0;a<e.length;a++){let c=null;try{c=e[a];const l=(c.alias?this.normalizeAlias(c.alias,c):null)||c.uuid;if(!l)continue;const{newAlias:d,isMoveAll:h,json2:p={},isPayAll:g,title:_,mode:v,deliveryInfo:b}=c;let w=null,E=null;l&&(E=r[l]=r[l]||this._generateTableObj(l,c),w=E.items||[],E.jobs.push(c));let T={addFrom:_||"_",job:c,data:{}};switch(c.type){case ns.ADD:const R=JSON.parse(c.json);T.data=R,w.length==0&&(E.startTime=c.timestamp),s[R.uniqueid]==null&&this.add(w,R.orderitems||[],T),s[R.uniqueid]=!0,R.isOpeningTable&&R.guests&&(E.guests=R.guests);break;case ns.PAY:if(r[l]){let V=this.voidItem(p,w);r[l].items=V,V.length===0&&delete r[l]}break;case ns.VOID:let N=this.voidItem(p,w);r[l].items=N,N.length===0&&delete r[l];break;case ns.VOID_TOPPING:r[l].items=this.voidTopping(p,w);break;case ns.SPLIT:let O=this.split_items(p,w,T);r[l].items=O;break;case ns.SET_COMMENTS:let S=this.set_comments(p,w);r[l].items=S;break;case ns.SET_DISCOUNT_ITEMS:let I=this.set_discount_items(p,w);r[l].items=I;break;case ns.SET_PRICE:let P=this.set_price(p,w);r[l].items=P;break;case ns.SET_DELIVERY_INFO:r[l].deliveryInfo=b;break;case ns.MOVE_TO:const k=this.normalizeAlias(d,c);let L=r[k]=r[k]||this._generateTableObj(k,c);if(h){const V=(L.items?.length||0)>0;this.add(L.items,w,T),this._carryOverTableMetadata(r[l],L,V),delete r[l]}else{let V=this.getItemsFromKey(p,w);this.add(L.items,V,T),r[l].items=this.removeItemsFromCurrentTable(p,w)}break;case ns.CLEAR_TABLE:r[l].items=[];break;case ns.CLEAR_ALL:break;case ns.OPEN_SHOP:a==0&&(this.tableHolder={},r=this.tableHolder);break;case ns.CLOSE_SHOP:let M=0;for(var i in r){var o=r[i].items.length;M+=o}M!==0&&console.log(`**** CLOSE SHOP NOT COMPLATE : line has ${M} lines `);break;default:break}E.lastUpdate=c.timestamp}catch(l){const d=Qe.findKey(ns,p=>p===c?.type)||"UNKNOWN",h=c?.json2??c?.json??null;throw console.error(`[jobchain] job ID : ${c?.jobId} (RTDB key: ${String(c?.jobId||"").replaceAll(".","_")})`),console.error(`[jobchain] action : ${d} (${c?.type}) "${c?.title||""}" table=${c?.alias||c?.uuid||""} value=${typeof h=="string"?h:JSON.stringify(h)}`),console.error(c),l}}return this.setBill(n),this.cleanEmptyTables(),this.tableHolder}setBill(e){const n=e||{};Qe.forEach(this.tableHolder,r=>{Qe.forEach(r.items,s=>{s.bill=n[s.uniqueid]||1})})}cleanEmptyTables(){Qe.forEach(this.tableHolder,e=>{e.items.length==0&&delete this.tableHolder[e.uuid],e.__items=e.items,delete e.jobs})}logCart(e){const n=this.tableHolder;console.log(" ");let r=n[e]||[];console.log(`Table : ${e} has ${r.items.length} lines`);let s=0;
149r.items.forEach(i=>{console.log(`${i.quantity} X ${i.name} ${i.uniqueid} ${i.key}`),s+=i.quantity}),console.log("qty "+s),console.log(" "),console.log(r.jobs),console.log("legth",r.jobs.length)}logCartAll(){const e=this.tableHolder;console.log(" ");for(const n in e){let r=e[n]||[];if(r.items.length==0)continue;console.log(`Table : ${n} has ${r.items.length} lines`);let s=0;r.items.forEach(i=>{console.log(`${i.quantity} X ${i.name}`),s+=i.quantity}),console.log("qty "+s),console.log(" ")}}static analytic(e){function n(i){let o=0;for(const a in i)if(Object.hasOwnProperty.call(i,a)){const c=i[a];o+=c}return o}function r(i){let o=0;return i.forEach(a=>{o+=a.quantity}),o}let s={add:0,void:0,paid:0};for(let i=0;i<e.length;i++){const o=e[i];switch(o.type){case ns.ADD:let a=JSON.parse(o.json);s.add+=r(a.orderitems);break;case ns.VOID:s.void+=n(o.json2);break;case ns.PAY:s.paid+=n(o.json2);break}}return s.sum=s.add+s.void,s}static genItemLineKey(e){let n=e.discountrequest||{mode:0,value:0};return e.oneLine||e.toppings&&e.toppings.length>=1||e.comments||e.Comments||e.isTogo||e.isopenmenu||e.isOpenMenu?e.uniqueid:`${e.subitemid}:${e.price}:${n.mode}:${n.value}`}normalizeAlias(e,n){return JG(e,n)}_generateTableObj(e,n){return{items:[],uuid:e,name:this.normalizeAlias(n.newAlias||n.alias,n)||n.uuid||"",nickName:n.nickName||"",mode:n.mode||1,jobs:[],employeeName:n.employee?.name||"",startDateTime:n.pcTimestamp||n.timestamp,lastUpdate:n.pcTimestamp||n.timestamp,deliveryInfo:n.deliveryInfo||null,guests:n.guests||2}}_carryOverTableMetadata(e,n,r){if(!e||!n)return;["guests","startTime","startDateTime","deliveryInfo"].forEach(i=>{const o=e[i];if(o==null)return;const a=n[i]!==void 0&&n[i]!==null;(!r||!a)&&(n[i]=o)})}add(e,n,{addFrom:r,data:s}){n.forEach((i,o)=>{if(jR(i))return;i.uniqueid||(i.uniqueid=s.uniqueid+":"+o,i.oneLine=!0),(i.isopenmenu||i.isOpenMenu)&&(i.oneLine=!0,i.isOpenMenu=!0);let a=pd.genItemLineKey(i);i.key=a,i.discountRequest=i.discountRequest||{mode:i.discountrequest&&i.discountrequest.mode||0,value:i.discountrequest&&i.discountrequest.value||0},r&&(i.addFrom=r);let c=this.findItemInCart(e,i);c?(c.quantity+=i.quantity,c.refs[i.uniqueid]=!0):(c=i,c.refs={[i.uniqueid]:!0},e.push(i)),i.bill=1})}findItemInCart(e,n){return Qe.find(e,r=>r.key===n.key)}split_items(e,n,{job:r,setBillHolder:s={}}){let i=[];return n.forEach(o=>{if(e[o.uniqueid]){let a=Math.abs(e[o.uniqueid]);o.quantity=o.quantity-a;let c=JSON.parse(JSON.stringify(o));c.quantity=a,c.uniqueid=o.uniqueid+":"+r.timestamp.replace(".","_"),c.oneLine=!0,c.refs={[c.uniqueid]:!0},c.key=pd.genItemLineKey(c),c.bill=1,i.push(o),i.push(c)}else i.push(o)}),i}set_comments(e,n){return n.forEach(r=>{e?.[r.uniqueid]!==void 0&&(r.comments=e[r.uniqueid],r.oneLine=!0,r.key=pd.genItemLineKey(r))}),n}set_price(e,n){return n.forEach(r=>{e[r.uniqueid]!==void 0&&(r.price=e[r.uniqueid]||0,r.oneLine=!0,r.key=pd.genItemLineKey(r))}),n}set_discount_items(e,n){return n.forEach(r=>{e[r.uniqueid]!==void 0&&(r.discountRequest.mode=e[r.uniqueid][0],r.discountRequest.value=e[r.uniqueid][1],r.oneLine=!0,r.key=pd.genItemLineKey(r))}),n}removeItemsFromCurrentTable(e,n){let r=[];return n.forEach(s=>{e[s.uniqueid]==null&&r.push(s)}),r}getItemsFromKey(e,n){let r=[];return n.forEach((s,i)=>{e[s.uniqueid]&&r.push(s)}),r}voidItem(e={},n=[]){let r=[];return n===null||n.forEach(s=>{let i=e[s.uniqueid];typeof i=="number"?(s.quantity-=Math.abs(i),s.quantity>MF&&r.push(s)):r.push(s)}),r}voidTopping(e={},n=[]){return Array.isArray(n)?(!e||typeof e!="object"||n.forEac
149h(r=>{if(!r)return;const s=e[r.uniqueid];!s||typeof s!="object"||Array.isArray(r.toppings)&&(r.toppings=r.toppings.reduce((i,o)=>{if(!o||typeof o!="object")return o!=null&&i.push(o),i;const a=s[String(o.toppingId)];return typeof a=="number"?(o.quantity=(o.quantity||0)-Math.abs(a),o.quantity>MF&&i.push(o)):i.push(o),i},[]))}),n):Array.isArray(n)?n:[]}}const pAe=t=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"){const e=Number(t.trim());if(Number.isFinite(e))return e}return NaN},lt=t=>{const e=pAe(t);if(!Number.isFinite(e))return 0;const n=Math.round((Math.abs(e)+Number.EPSILON)*100)/100;return e<0&&n!==0?-n:n},mAe=t=>Number.isFinite(t)&&Math.abs(t*100-Math.round(t*100))<1e-6,gAe=t=>{for(const[r,s]of Object.entries(t))if(r!=="VatMode"&&typeof s=="number"&&!mAe(s))return`${r}=${s} is not 2 decimals`;const e=Number(t.VatMode)===2?t.Vat:0,n=lt(t.SubTotal-Math.abs(t.ItemDiscount)+t.ServiceCharge-Math.abs(t.Discount)+t.CardCharge+e+t.Rounding);return lt(n-t.GrandTotal)!==0?`Invariant broken: ${n} !== GrandTotal ${t.GrandTotal}`:null};function $d(t,e,n){var r=0;switch(e){case 0:r=t*n/100;break;case 1:r=n;break;default:r=0}return r||0}function xD(t,e,n,r){return n===1?(r||0)*(e||0):$d(t,n,r)}const LD={key:"default",calculateBilling(t,e,n,r){let s=0;const i=lt(t.reduce((S,I)=>S+I.discountedPrice,0));s+=i;const o=lt(t.reduce((S,I)=>S+I.dc1[2],0)),a=r?.noServiceCharge?0:n?.sc?.[0]??e?.sc?.[0]??0,c=r?.noServiceCharge?0:n?.sc?.[1]??e?.sc?.[1]??0,l=lt($d(s,a,c));s=lt(s+l);const d=n?.dc2?.[0]??e?.dc2?.[0]??0,h=n?.dc2?.[1]??e?.dc2?.[1]??0;let p=0;if(d===2){if(h>0){const S=lt(t.reduce((P,k)=>k.noDiscount===!0||(k.dc1?.[2]||0)!==0?P+k.discountedPrice:P,0)),I=lt(s-S);p=lt(I*h/100)}}else p=lt($d(s,d,h));s=lt(s-p);const g=n?.cc?.[0]??e?.cc?.[0]??0,_=n?.cc?.[1]??e?.cc?.[1]??0,v=lt($d(s,g,_));s=lt(s+v);const b=n?.vat?.[0]??e?.vat?.[0]??0,w=n?.vat?.[1]??e?.vat?.[1]??0;let E=0;b===1?E=lt(s*w/(100+w)):b===2&&(E=lt(s*w/100),s=lt(s+E));const T=n?.roundingMode??e?.roundingMode??"none";let R=s,N=0;switch(T){case"5/4":R=Math.round(s);break;case"up":R=Math.ceil(s);break;case"down":R=Math.floor(s);break;default:R=s;break}return N=lt(R-s),s=lt(R),{grandTotal:s,rounding:N,roundingMode:T,sc:[a,c,l],dc2:[d,h,p],cc:[g,_,v],vat:[b,w,E],subTotal:i,dc1:o}}},_Ae={key:"Divana",usesSkipService:!0,extraCatalogTypes:["Divana Product","DII Product"],calculateBilling(t,e,n,r){let s=0;const i=lt(t.reduce((P,k)=>P+k.discountedPrice,0));s+=i;const o=lt(t.reduce((P,k)=>P+k.dc1[2],0)),a=lt(t.reduce((P,k)=>k.skipService?P+k.discountedPrice:P,0)),c=r?.noServiceCharge?0:n?.sc?.[0]??e?.sc?.[0]??0,l=r?.noServiceCharge?0:n?.sc?.[1]??e?.sc?.[1]??0,d=lt(s-a),h=lt($d(d,c,l));s=lt(s+h);const p=n?.dc2?.[0]??e?.dc2?.[0]??0,g=n?.dc2?.[1]??e?.dc2?.[1]??0;let _=0;if(p===2){if(g>0){const P=lt(t.reduce((L,M)=>M.noDiscount===!0||(M.dc1?.[2]||0)!==0?L+M.discountedPrice:L,0)),k=lt(s-P);_=lt(k*g/100)}}else _=lt($d(s,p,g));s=lt(s-_);const v=n?.cc?.[0]??e?.cc?.[0]??0,b=n?.cc?.[1]??e?.cc?.[1]??0,w=lt($d(s,v,b));s=lt(s+w);const E=n?.vat?.[0]??e?.vat?.[0]??0,T=n?.vat?.[1]??e?.vat?.[1]??0;let R=0;if(E===1)R=lt(s*T/(100+T));else if(E===2){const P=lt(s-a);R=lt(P*T/100),s=lt(s+R)}const N=n?.roundingMode??e?.roundingMode??"none";let O=s,S=0;switch(N){case"5/4":O=Math.round(s);break;case"up":O=Math.ceil(s);break;case"down":O=Math.floor(s);break;default:O=s;break}return S=lt(O-s),s=lt(O),{grandTotal:s,rounding:S,roundingMode:N,sc:[c,l,h],dc2:[p,g,_],cc:[v,b,w],vat:[E,T,R],subTotal:i,dc1:o}}},QG=t=>(t||"").trim().toLowerCase(),yAe=Object.fromEntries([LD,_Ae].map(t=>[QG(t.key),t]));function vAe(t){return yAe[QG(t)]||LD}let WR=LD;function bAe(t){return WR=vAe(t),WR}function XG(){return WR}const ZG=(t,e,n)=>!t||!Array.isArray(t)?[]:t.map(r=>{const s=r.price||0,i=r.quantity||0,o=(r.toppings||[]).map(h=>{const p=h.price||0,g=h.quantity||h.qty||0,_=h.discount||0,v=lt(p*g),b=lt(v-_);return{toppingId:h.toppingId?.toString()||"",name:h.name||"",price:p,discount:_,discountedPrice:b,quantity:g,extendedPrice:v}}),a=lt(o.reduce((h,p)=>h+p.price*p.quantity,0)),c=lt((s+a)*i),l=lt(-1*xD(c,i,r.discountRequest?.mode||0,r.discountRequest?.value||0)),d=lt(c+l);return{uuid:r.uniqueid||"",subItemId:r.subitemid?.toString()||"",name:r.name||"",comments:r.comments||"",price:s,discountedPrice:d,dc1:[r.discountRequest?.mode||0,r.discountRequest?.value||0,l],quantity:i,extendedPrice:c,toppings:o,toppingsAmount:a,bill:r.bill||1,isOpenMenu:r.isOpenMenu||!1,noDiscount:e?!!e(r.subitemid):!1,skipService:n?!!n(r.subitemid):!1,...r.openMenuName?{openMenuName:r.openMenuName}:{}}}),MD=(t,e,n,r)=>XG().calculateBilling(t,e,n,r),wAe=(t,e,n,r)=>{const s=ZG(t.__items,r?.noDiscountResolver,r?.skipServiceResolver),i=MD(s,e,n,r);return{uuid:t.uuid,name:t.name,nickName:t.nickName||"",guests:(n?.guests??t.guests)||2,startDateTime:t.
149startDateTime||(t.startTime?Ne(t.startTime).format("YYYY-MM-DD HH:mm:ss"):""),employeeName:t.employeeName||"",items:s,jobs:t.jobs||[],mode:t.mode||1,billing:i,setting:n||{},deliveryInfo:t.deliveryInfo||null,lastUpdate:t.lastUpdate||""}},VF=t=>t?.pcTimestamp||t?.timestamp,SAe=t=>(Array.isArray(t)?[...t]:Object.values(t||{})).sort((e,n)=>Ne(VF(e)).diff(Ne(VF(n))));function TAe(t){const e=new pd;return e.computeAllBlocks(SAe(t)),e}function EAe(t,e){t.setBill(e.uuidItemToBillNumber||{});const n={},r=t.tableHolder||{};for(const s in r){const i=r[s];n[s]=wAe(i,e.tableBillingGlobal,e.tablesState?.[s],{noServiceCharge:i.mode===Bt.TOGO&&!!e.togoNoService,noDiscountResolver:e.noDiscountResolver,skipServiceResolver:e.skipServiceResolver})}return n}class Td{static mapCatalog(e){return e.map(n=>({Id:n.data[0],Name:n.data[1],Type:n.data[2],Row:n.data[3]}))}static mapItem(e){return e.map(n=>({Id:n.data[0],CatalogId:n.data[1],Name:n.data[2],BasePrice:n.data[3],Row:n.data[4],ProductCode:n.data[5],DiscountMode:n.data[6],DiscountValue:n.data[7]}))}static mapSubItem(e){return e.map(n=>({Id:n.data[0],ItemId:n.data[1],Name:n.data[2],Price:n.data[3],Row:n.data[4],DiscountValue:n.data[5]}))}static mapData(e,n){if(!e)return[];switch(n){case"catalogs":return this.mapCatalog(e);case"items":return this.mapItem(e);case"subitems":return this.mapSubItem(e);default:throw new Error(`Unsupported data type: ${n}`)}}static catalogsJoined(e,n,r){return e.map(s=>({...s,Items:n.filter(i=>i.CatalogId===s.Id).map(i=>({...i,SubItems:r.filter(o=>o.ItemId===i.Id).slice().sort((o,a)=>(o.Row??0)-(a.Row??0))}))}))}}class FF{generateProducts(e,n,r,s){let i=EC(e),o=EC(n),a=EC(r);const c=Qe.reduce(s,(h,p,g)=>((h[p.ItemId]||(h[p.ItemId]=[])).push(p.Tag),h),{});let l=Qe.groupBy(o,"CatalogId"),d=Qe.groupBy(a,"ItemId");for(let h=0;h<i.length;h++){let p=i[h],g=Qe.orderBy(l[p.Id],"Row");p.Items=g,IC(p);for(let _=0;_<p.Items.length;_++){let v=p.Items[_];IC(v),c[v.Id]&&(v.Tags=c[v.Id]||[]);let b=Qe.orderBy(d[v.Id],"Row");v.SubItems=b;for(let w=0;w<v.SubItems.length;w++){let E=v.SubItems[w];IC(E)}}}return i}generateToppingGroups(e,n){let r={};for(let i=0;i<n.length;i++){let o=n[i];r[o.GroupId]||(r[o.GroupId]=[]),r[o.GroupId].push(o)}for(let i=0;i<e.length;i++){let o=e[i],a=Qe.orderBy(r[o.Id],"Row");o.Toppings=a}return Qe.orderBy(e,"Row")}}function EC(t){return Qe.orderBy(t,"Row")}const BF=["CustomerId","IsHide","Amount","Quantity","Percent","IsDeleted","Tags","DiscountedPrice"];function IC(t){for(let e=0;e<BF.length;e++){let n=BF[e];delete t[n]}return t}const IAe=["catalogs","items","subitems","tags","comments","toppingGroups","toppings"],CAe={catalogs:{dsKey:"catalogs",resource:"catalogs"},items:{dsKey:"items",resource:"items"},subitems:{dsKey:"subItems",resource:"subitems"}},ol=qn("products",{state:()=>({loaded:!1,catalogs:[],items:[],subitems:[],comments:[],toppingGroups:[],toppings:[],tags:[],allData:null,uuidPrintersMap:{}}),getters:{products:t=>new FF().generateProducts(t.catalogs,t.items,t.subitems,t.tags),toppingList:t=>new FF().generateToppingGroups(t.toppingGroups,t.toppings),getProductTypes:t=>{const e=[...new Set(t.products.map(i=>i.Type))],n=["food","drink","dessert","other"],r=i=>{const o=n.indexOf(String(i||"").toLowerCase());return o===-1?n.length:o};return["All",...e.sort((i,o)=>r(i)-r(o))]},getProductHolderWithType:t=>t.products.reduce((e,n)=>(e[n.Type]||(e[n.Type]=[]),e[n.Type].push(n),e),{}),getProductCategoryWithParentId:t=>{const e={};for(let n=0;n<t.products.length;n++){const r=t.products[n];for(let s=0;s<r.Items.length;s++){const i=r.Items[s],o=i.SubItems;if(o.length>1)for(let a=0;a<o.length;a++){const c=o[a];e[c.Id]={catelogId:r.Id,catelogName:r.Name,item:c,parent:i}}else e[i.Id]={catelogId:r.Id,catelogName:r.Name,item:i.SubItems[0],parent:i}}}return e},getProductTypeHolderWithCatalogId:t=>t.products.reduce((e,n)=>(e[n.Id]||(e[n.Id]={}),e[n.Id]=n,e),{}),getAllProductHolder:t=>t.products.reduce((e,n)=>(e.All.push(n),e),{All:[]}),getAllProductSubItem:t=>{const e=t.products.flatMap(i=>i.Items),n=e.filter(i=>i.SubItems.length===1),r=e.filter(i=>i.SubItems.length>1),s=[];for(let i=0;i<r.length;i++)for(let o=0;o<r[i].SubItems.length;o++){const a={...r[i].SubItems[o],Name:`${r[i].Name} (${r[i].SubItems[o].Name})`,CatalogId:r[i].CatalogId};s.push(a)}return[...n,...s]},getAllProductSearch:t=>{let e=t.products;const n=[];for(let r=0;r<e.length;r++){const s=e[r];for(let i=0;i<s.Items.length;i++){const o=s.Items[i],a=o.SubItems;if(a.length>1)for(let c=0;c<a.length;c++){const l=a[c];n.push({label:`${o.Name} (${l.Name})`,SubItem:l,Parent:o})}else n.push({label:o.Name,SubItem:o.SubItems[0],Parent:o})}}return n},getPrintersByUuid(t){return e=>t.uuidPrintersMap[e]||[]},isBillingSkipServiceSubItem:t=>{const e={};for(let n=0;n<t.products.length;n++){const r=t.products[n],s=r.Type,i=typeof s=="string"&&s.toLowerCase().includes("product"),o=r.Items||[];for(let a=0;a<o.length;a++){const c=o[a].SubItems||[];for(let l=0;l<c.length;l++)e[c[l].Id]=i}}return n=>e[n]??e[String(n)]??!1}},actions:{init(){this.registerResources()},applyDefaultDiscount(t){if(!Array.isArray(t)||t.length===0)return t;const e=new Map(this.items.map(r=>[Number(r.Id),r])),n=new Map(this.subitems.map(r=>[Number(r.Id),r]));return t.map(r=>{if(r?.discountrequest||r?.noDefaultDiscount||r?.isComboChild)return r;const s=Number(r?.subItemId??r?.subitemid);if(!s)return r;const i=n.get(s),o=i?e.get(Number(i.ItemId)):void 0;if(!o)return r;const a=Number(o.DiscountValue)||0;if(!a)return r;const c=Number(o.DiscountMode)||0;return{...r,discountrequest:{mode:c,value:a}}})},registerResources(){oo({resource:"catalogs",refetch:()=>Ot().catalogs.fetch(),applyToStore:t=>{this.catalogs=Td.mapData(t,"catalogs")}}),oo({resource:"items",refetch:()=>Ot().items.fetch(),applyToStore:t=>{this.items=Td.mapData(t,"items")}}),oo({resource:"subitems",refetch:()=>Ot().subItems.fetch(),applyToStore:t=>{this.subitems=Td.mapData(t,"subitems")}}),oo({resource:"tags",refetch:()=>Ot().itemTags.fetch(),applyToStore:t=>{this.tags=t}}),oo({resource:"comments",refetch:()=>Ot().comments.fetch(),applyToStore:t=>{this.comments=t}}),oo({resource:"toppingGroups",refetch:()=>Ot().toppingGroups.fetch(),applyToStore:t=>{this.toppingGroups=t}}),oo({resource:"toppings",refetch:()=>Ot().toppingItems.fetch(),applyToStore:t=>{this.toppings=t}})},async refreshResources(t){const e=t?.length?t:IAe;await Promise.all(e.map(n=>JD(n)))},async syncRecords(t){const e=Object.keys(t).map(n=>[n,t[n]]).filter(n=>!!n[1]);await Promise.all(e.map(async([n,r])=>{const{dsKey:s,resource:i}=CAe[n];let o=[];if(r.upsert?.length){const c=await Ot()[s].fetchByIds(r.upsert);o=Array.isArray(c)?c:c?.data??[]}await oke(i,{upsertRaw:o,removeIds:r.remove})})),this.computeUuidPrintersMap()},finishLoad(){this.computeUuidPrintersMap(),this.loaded=!0},computeUuidPrintersMap(){const t={};for(let e=0;e<this.products.length;e++){const n=this.products[e];for(let r=0;r<n.Items.length;r++){const s=n.Items[r],i=s.Tags||[],o=s.SubItems;for(let a=0;a<o.length;a++){const c=o[a];t[c.Id]=i}}}return this.uuidPrintersMap=t,t},getProductGroupsByItemHolder(){let t={};Qe.forEach(this.products,r=>{t[r.Id]===void 0&&(t[r.Id]={});let s={...r};delete s.Items,t[r.Id]=s});let e={};const n=this.getAllProductSubItem;return Qe.forEach(n,r=>{e[r.Id]=t[r.CatalogId]}),e}}});function GR(){if(XG().usesSkipService)return ol().isBillingSkipServiceSubItem}function Qy(t){try{return JSON.parse(JSON.stringify(t))}catch{return t}}const $F=new Map;function AAe(t){let e=$F.get(t);return e||(e=uD(t,"kv"),$F.set(t,e)),e}function mh(t){const e=AAe(t);return{get:n=>
149Q6(n,e).catch(r=>{console.warn(`[bucket:${t}] get(${String(n)}) failed`,r)}),set:(n,r)=>X6(n,Qy(r),e).catch(s=>{console.warn(`[bucket:${t}] set(${String(n)}) failed`,s)}),del:n=>zbe(n,e).catch(r=>{console.warn(`[bucket:${t}] del(${String(n)}) failed`,r)}),clear:()=>Z6(e).catch(n=>{console.warn(`[bucket:${t}] clear failed`,n)}),keys:()=>Ybe(e).catch(n=>(console.warn(`[bucket:${t}] keys failed`,n),[])),entries:()=>Jbe(e).catch(n=>(console.warn(`[bucket:${t}] entries failed`,n),[]))}}let Wg=null;async function RAe(t=3e3){if(Wg!==null)return Wg;const e=typeof navigator<"u"&&navigator.onLine===!1;return Wg=e,console.log(`[detectOfflineBoot] offline=${e} (navigator.onLine=${typeof navigator<"u"?navigator.onLine:"n/a"})`),e}function Zp(){return Wg!==null?Wg:typeof navigator<"u"&&navigator.onLine===!1}const Uo={jobs:t=>`pos_jobs_${t}`,receipts:t=>`pos_receipts_${t}`,tableStates:t=>`pos_tablestates_${t}`,runtime:t=>`pos_runtime_${t}`};async function PAe(t){if(!t)return;const e=[Uo.jobs(t),Uo.receipts(t),Uo.tableStates(t),Uo.runtime(t)];await Promise.all(e.map(n=>mh(n).clear()))}function GE(){try{return bn().runMode==="cashier"}catch{return!1}}function KE(t,e=3e3){return new Promise(n=>{let r=!1,s=null;const i=()=>{r||(r=!0,clearTimeout(o),s?.(),n())},o=setTimeout(i,e);try{s=xa(t,()=>i(),()=>i()),r&&(s(),s=null)}catch{i()}})}async function KR(t,e){const n=new Set;if(!t)return{entries:[],knownKeys:n};try{if(e){const r=await t.entries();for(const[s]of r)n.add(String(s));return{entries:r.map(([s,i])=>[String(s),i]),knownKeys:n}}else{const r=await t.keys();for(const s of r)n.add(String(s));return{entries:[],knownKeys:n}}}catch(r){return console.warn("[layerB] loadPerRowBucket failed",r),{entries:[],knownKeys:n}}}async function VD(t,e){if(!t)return null;try{const n=await t.get(e);return n&&typeof n=="object"?n:null}catch(n){return console.warn(`[layerB] loadSingleRow(${e}) failed`,n),null}}function e9(t,e,n,r){GE()&&(!n||!t||e.has(n)||(e.add(n),t.set(n,r)))}const UF="splitBill";function HF(){const t=Xn().storeId;return t?mh(Uo.runtime(String(t))):null}const t9=qn("bill-number",()=>{const t=Ae(!1),e=Ae({}),n=Ae(Ne().valueOf()),r=()=>{const d=Ze().billNumberRef();Js(d,h=>{e.value[h.key]=h.val()||{}}),h6(d,h=>{e.value[h.key]=h.val()||{}}),f6(d,h=>{e.value[h.key]=null}),t.value=!0},s=Qe.debounce(()=>{if(!GE())return;const d=HF();d&&d.set(UF,e.value)},300);async function i(){r(),ft(e,()=>s(),{deep:!0}),await KE(Ze().billNumberRef()),t.value=!0}async function o(){const d=await VD(HF(),UF);d&&(e.value=d),t.value=!0,r(),ft(e,()=>s(),{deep:!0})}async function a(){return Zp()?o():i()}function c(d,h){const p=Ze().billNumberRef();Ue(zt(p,d),h)}function l(d){const h=Ze().billNumberRef();Ue(zt(h,d),null)}return{name:"billsNumber",init:a,bootOnline:i,bootOffline:o,loaded:t,nonce:n,uuidItemToBillNumber:e,setItem:c,removeItem:l}});var vw={exports:{}},kAe=vw.exports,qF;function NAe(){return qF||(qF=1,(function(t,e){(function(n,r){t.exports=r()})(kAe,(function(){var n,r,s=1e3,i=6e4,o=36e5,a=864e5,c=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,l=31536e6,d=2628e6,h=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,p={years:l,months:d,days:a,hours:o,minutes:i,seconds:s,milliseconds:1,weeks:6048e5},g=function(O){return O instanceof R},_=function(O,S,I){return new R(O,I,S.$l)},v=function(O){return r.p(O)+"s"},b=function(O){return O<0},w=function(O){return b(O)?Math.ceil(O):Math.floor(O)},E=function(O){return Math.abs(O)},T=function(O,S){return O?b(O)?{negative:!0,format:""+E(O)+S}:{negative:!1,format:""+O+S}:{negative:!1,format:""}},R=(function(){function O(I,P,k){var L=this;if(this.$d={},this.$l=k,I===void 0&&(this.$ms=0,this.parseFromMilliseconds()),P)return _(I*p[v(P)],this);if(typeof I=="number")return this.$ms=I,this.parseFromMilliseconds(),this;if(typeof I=="object")return Object.keys(I).forEach((function(z){L.$d[v(z)]=I[z]})),this.calMilliseconds(),this;if(typeof I=="string"){var M=I.match(h);if(M){var V=M.slice(2).map((function(z){return z!=null?Number(z):0}));return this.$d.years=V[0],this.$d.months=V[1],this.$d.weeks=V[2],this.$d.days=V[3],this.$d.hours=V[4],this.$d.minutes=V[5],this.$d.seconds=V[6],this.calMilliseconds(),this}}return this}var S=O.prototype;return S.calMilliseconds=function(){var I=this;this.$ms=Object.keys(this.$d).reduce((function(P,k){return P+(I.$d[k]||0)*p[k]}),0)},S.parseFromMilliseconds=function(){var I=this.$ms;this.$d.years=w(I/l),I%=l,this.$d.months=w(I/d),I%=d,this.$d.days=w(I/a),I%=a,this.$d.hours=w(I/o),I%=o,this.$d.minutes=w(I/i),I%=i,this.$d.seconds=w(I/s),I%=s,this.$d.milliseconds=I},S.toISOString=function(){var I=T(this.$d.years,"Y"),P=T(this.$d.months,"M"),k=+this.$d.days||0;this.$d.weeks&&(k+=7*this.$d.weeks);var L=T(k,"D"),M=T(this.$d.hours,"H"),V=T(this.$d.minutes,"M"),z=this.$d.seconds||0;this.$d.milliseconds&&(z+=this.$d.milliseconds/1e3,z=Math.round(1e3*z)/1e3);var ie=T(z,"S"),K=I.negative||P.negative||L.negative||M.negative||V.negative||ie.negative,ce=M.format||V.format||ie.format?"T":"",G=(K?"-":"")+"P"+I.format
149+P.format+L.format+ce+M.format+V.format+ie.format;return G==="P"||G==="-P"?"P0D":G},S.toJSON=function(){return this.toISOString()},S.format=function(I){var P=I||"YYYY-MM-DDTHH:mm:ss",k={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return P.replace(c,(function(L,M){return M||String(k[L])}))},S.as=function(I){return this.$ms/p[v(I)]},S.get=function(I){var P=this.$ms,k=v(I);return k==="milliseconds"?P%=1e3:P=k==="weeks"?w(P/p[k]):this.$d[k],P||0},S.add=function(I,P,k){var L;return L=P?I*p[v(P)]:g(I)?I.$ms:_(I,this).$ms,_(this.$ms+L*(k?-1:1),this)},S.subtract=function(I,P){return this.add(I,P,!0)},S.locale=function(I){var P=this.clone();return P.$l=I,P},S.clone=function(){return _(this.$ms,this)},S.humanize=function(I){return n().add(this.$ms,"ms").locale(this.$l).fromNow(!I)},S.valueOf=function(){return this.asMilliseconds()},S.milliseconds=function(){return this.get("milliseconds")},S.asMilliseconds=function(){return this.as("milliseconds")},S.seconds=function(){return this.get("seconds")},S.asSeconds=function(){return this.as("seconds")},S.minutes=function(){return this.get("minutes")},S.asMinutes=function(){return this.as("minutes")},S.hours=function(){return this.get("hours")},S.asHours=function(){return this.as("hours")},S.days=function(){return this.get("days")},S.asDays=function(){return this.as("days")},S.weeks=function(){return this.get("weeks")},S.asWeeks=function(){return this.as("weeks")},S.months=function(){return this.get("months")},S.asMonths=function(){return this.as("months")},S.years=function(){return this.get("years")},S.asYears=function(){return this.as("years")},O})(),N=function(O,S,I){return O.add(S.years()*I,"y").add(S.months()*I,"M").add(S.days()*I,"d").add(S.hours()*I,"h").add(S.minutes()*I,"m").add(S.seconds()*I,"s").add(S.milliseconds()*I,"ms")};return function(O,S,I){n=I,r=I().$utils(),I.duration=function(L,M){var V=I.locale();return _(L,{$l:V},M)},I.isDuration=g;var P=S.prototype.add,k=S.prototype.subtract;S.prototype.add=function(L,M){return g(L)?N(this,L,1):P.bind(this)(L,M)},S.prototype.subtract=function(L,M){return g(L)?N(this,L,-1):k.bind(this)(L,M)}}}))})(vw)),vw.exports}NAe();var bw={exports:{}},DAe=bw.exports,jF;function OAe(){return jF||(jF=1,(function(t,e){(function(n,r){t.exports=r()})(DAe,(function(){return function(n,r,s){n=n||{};var i=r.prototype,o={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function a(l,d,h,p){return i.fromToBase(l,d,h,p)}s.en.relativeTime=o,i.fromToBase=function(l,d,h,p,g){for(var _,v,b,w=h.$locale().relativeTime||o,E=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],T=E.length,R=0;R<T;R+=1){var N=E[R];N.d&&(_=p?s(l).diff(h,N.d,!0):h.diff(l,N.d,!0));var O=(n.rounding||Math.round)(Math.abs(_));if(b=_>0,O<=N.r||!N.r){O<=1&&R>0&&(N=E[R-1]);var S=w[N.l];g&&(O=g(""+O)),v=typeof S=="string"?S.replace("%d",O):S(O,d,N.l,b);break}}if(d)return v;var I=b?w.future:w.past;return typeof I=="function"?I(v):I.replace("%s",v)},i.to=function(l,d){return a(l,d,this,!0)},i.from=function(l,d){return a(l,d,this)};var c=function(l){return l.$u?s.utc():s()};i.toNow=function(l){return this.to(c(this),l)},i.fromNow=function(l){return this.from(c(this),l)}}}))})(bw)),bw.exports}var xAe=OAe();const LAe=lD(xAe),Mo=(t,e,n,r)=>isNaN(t)&&r?.hideNaN?r?.hideNaN:isNaN(t)?"NaN":t.toLocaleString("en-EN",{minimumFractionDigits:n?e:0,maximumFractionDigits:e}),MAe=t=>{const e=Number(t)||0,n=Math.round(e*100)/100,r=n!==Math.trunc(n);return n.toLocaleString("en-US",{minimumFractionDigits:r?2:0,maximumFractionDigits:2})};function n9(){function t(n,r={}){return{Rows:n,Underline:r.Underline??!1,DoubleUnderline:r.DoubleUnderline??!1,Bold:r.Bold??!1,Italic:r.Italic??!1,Indent:r.Indent??0}}function e(n,r,s={}){const i=Mo(-Math.abs(n||0),2,!0);return t([{name:r||"สà¹à¸§à¸à¸¥à¸",value:i}],{Indent:10,...s})}return{buildCustomSection:t,buildDiscountSection:e}}const VAe=8;function r9(t){const e=String(t?.name??"").trim(),n=Number(t?.quantity??0);return e?n>1?`${e} x${n}`:e:""}
149function s9(t){return Array.isArray(t)?t.map(r9).filter(Boolean).join(", "):""}function FAe(t){return typeof t!="string"?[]:t.split(",").map(e=>e.trim()).filter(Boolean)}function BAe(t){const e=(Array.isArray(t?.toppings)?t.toppings:[]).map(r9).filter(Boolean).map(r=>({name:"- "+r,value:""})),n=FAe(t?.comments).map(r=>({name:"- "+r,value:""}));return[...e,...n]}function $Ae(t,e={}){const n=BAe(t);if(n.length===0)return;const{buildCustomSection:r}=n9();return r(n,{Indent:VAe,...e})}const UAe=[5224,6920];function HAe(){try{return ln().showItemDiscount===!0}catch{return!1}}function qAe(t){if(!Array.isArray(t))return;const e=t.filter(n=>String(n).trim().toLowerCase()==="skip");return e.length?e:void 0}function jAe(t,e){if(!HAe()||!(t>0))return;const{buildDiscountSection:n}=n9();return n(t,e,{Italic:!0})}class fp{OrderItems=[];OrderId=0;Date="";CustomerId=0;Received=0;Change=0;SubTotal=0;Rounding=0;ItemDiscount=0;ServiceCharge=0;ServiceChargeText="";Discount=0;DiscountText="";DiscountRequest={mode:0,value:0};CardCharge=0;CardChargeText="";Vat=0;VatText="";VatValue=0;VatMode="";PaymentType="";PaymentMethod=0;GrandTotal=0;CustomerCount=0;Table="";IsDeleted=!1;IsOnTheHouse=!1;ShiftWork="";User="";Note=null;Synced=!1;Nonce=Math.random().toString(36).substring(2,15);version="B";VarMode="";BeforeRoundingV2=0;RoundingV2=0;RoundingV2To=null;BeforeVatV2=0;Ref1="";Key="";DateString="";CustomHeaders=[];CustomFooters=[];TempId=0;UniqueId="";Uuid="";Reference="";FullAlias="";ReceiptId="";Cashier="";Room=null;timestamp="";multiplePayment;BusinessDate="";payment={};constructor(e){e&&Object.assign(this,e)}static fromTable(e,n={}){const r=new fp;if(r.Table=e.nickName||e.name||"",r.CustomerCount=e.guests||0,r.Date=Ne(e.endDateTime).format("YYYY-MM-DDTHH:mm:ssZ"),r.OrderId=n.orderId||0,r.CustomerId=n.customerId||0,e.items&&Array.isArray(e.items)){const i=ol();r.OrderItems=e.items.map((o,a)=>{const c=fp.convertTableItemToReceiptOrderItem(o,a+1,n.orderId,n.customerId),l=i.getPrintersByUuid(o.subItemId)||[];return l.length&&(c.tags=l),c})}e.billing&&r.applyBilling(e.billing);const s=e.billing?.dc2;return Array.isArray(s)&&s[0]===2&&(s[1]||0)>0&&r.OrderItems.forEach(i=>{(i.tags||[]).some(a=>String(a).trim().toLowerCase()==="no-discount")||(i.discountRequest?.value||0)>0||(i.name=`${i.name||""} *`)}),r.applyPayment(n.payment),r.applyShiftWork(n.shiftWork),r.applyUser(n.user),r}static convertTableItemToReceiptOrderItem(e,n,r,s){const i=e.extendedPrice||(e.quantity||0)*(e.price||0),o=i-e.discountedPrice;let a="";e.dc1[0]==0&&e.dc1[1]>0&&(a=`ลภ${e.dc1[1]}%`),e.dc1[0]==1&&e.dc1[1]>0&&(a=`ลภ-${Number(e.dc1[1]).toFixed(2)} X ${e.quantity||0}`);const c=e.toppings||[],l=s9(c),d=e.comments||"",h=e.dc1?e.dc1[0]:0,p=e.dc1?e.dc1[1]:0;return{quantity:e.quantity||0,price:e.price||0,extendedPrice:i,discount:o,discountedPrice:e.discountedPrice,subItemId:typeof e.subItemId=="string"&&parseInt(e.subItemId)||0,name:e.name||"",...c.length?{toppings:c,toppingList:l}:{},...d?{comments:d}:{},...a?{discountText:a}:{},...p>0?{discountRequest:{mode:h,value:p}}:{},...(()=>{const g=jAe(o,a);return g?{Custom:g}:{}})(),...e.skipService?{skipService:!0}:{}}}applyBilling(e){this.SubTotal=lt(this.OrderItems.reduce((i,o)=>i+(o.extendedPrice||0),0)),this.GrandTotal=lt(e.grandTotal||0),this.ItemDiscount=lt(e.dc1||0),e.dc2&&Array.isArray(e.dc2)&&e.dc2.length>=2&&(this.Discount=lt(e.dc2[2]||0),this.DiscountRequest={mode:e.dc2[0],value:e.dc2[1]},e.dc2[1]>0&&(this.DiscountText=e.dc2[0]===2?`*-${e.dc2[1]}%*`:`Discount ${e.dc2[1]}%`)),e.sc&&Array.isArray(e.sc)&&e.sc.length>=2&&(this.ServiceCharge=lt(e.sc[2]||0),e.sc[1]>0&&(this.ServiceChargeText=`${e.sc[1]}%`)),e.cc&&Array.isArray(e.cc)&&e.cc.length>=2&&(this.CardCharge=lt(e.cc[2]||0),e.cc[1]>0?this.CardChargeText=`${e.cc[1]}%`:this.CardChargeText=" 0%"),e.vat&&Array.isArray(e.vat)&&e.vat.length>=2&&(this.Vat=lt(e.vat[2]||0),e.vat[0]==1?(this.VatMode="1",this.VatValue=e.vat[1],this.VatText=`${e.vat[1]}% (Included)`,this.VarMode="1"):e.vat[0]==2?(this.VatMode="2",this.VatValue=e.vat[1],this.VatText=`${e.vat[1]}% (Excluded)`,this.VarMode="2"):(this.VatText="",this.VatMode="",this.VatValue=0)),this.ItemDiscount=lt(this.OrderItems.reduce((i,o)=>i+(o.discount||0),0)),this.BeforeVatV2=lt(this.SubTotal-this.ItemDiscount-this.Discount+this.ServiceCharge+this.CardCharge);const n=this.VatMode=="2"?this.Vat:0;this.BeforeRoundingV2=lt(this.BeforeVatV2+n),this.Rounding=lt(this.GrandTotal-this.BeforeRoundingV2),this.RoundingV2=this.Rounding;const r={SubTotal:this.SubTotal,ItemDiscount:this.ItemDiscount,Discount:this.Discount,ServiceCharge:this.ServiceCharge,CardCharge:this.CardCharge,Vat:this.Vat,VatMode:this.VatMode,Rounding:this.Rounding,GrandTotal:this.GrandTotal},s=gAe(r);s&&console.error(`[ReceiptOrder] bill invariant violated: ${s}`,r)}
149applyPayment(e){this.payment=e,this.Received=lt(e.list.reduce((r,s)=>r+(s.amountInput||0),0)),this.Change=lt(this.Received-e.list.reduce((r,s)=>r+(s.amount||0),0)),this.PaymentType=e.list.length==1?e.list[0]?.name||"":this.__convertMultiplePaymentTypeToString(e,!0),this.IsOnTheHouse=e.list.length==1?e.list[0]?.isEntertain??!1:!1,this.Note=e.note?.trim()||null;const n=e.room?.trim();return this.Room=n?n.toUpperCase():null,this.multiplePayment=e.list.length==1?e.list[0]?.name||"":this.__convertMultiplePaymentTypeToString(e,!1),this}__convertMultiplePaymentTypeToString(e,n=!0){const r=e.list.map(s=>({name:s.name||"",amount:s.amount||0,change:(s.amountInput||0)-(s.amount||0),receive:s.amountInput||0}));return n?JSON.stringify(r):r}applyShiftWork(e){return this.ShiftWork=e,this}applyUser(e){return this.User=e,this}toJSON(){if(this.CustomerId==0)throw new Error("CustomerId is required");return{OrderItems:this.OrderItems,OrderId:this.OrderId,Date:this.Date,CustomerId:parseInt(this.CustomerId),Received:this.Received,Change:this.Change,SubTotal:this.SubTotal,Rounding:this.Rounding,ItemDiscount:this.ItemDiscount,ServiceCharge:this.ServiceCharge,ServiceChargeText:this.ServiceChargeText,Discount:this.Discount,DiscountRequest:this.DiscountRequest,CardCharge:this.CardCharge,CardChargeText:this.CardChargeText,Vat:this.Vat,VatValue:this.VatValue,VatMode:this.VatMode,PaymentType:this.PaymentType,GrandTotal:this.GrandTotal,CustomerCount:this.CustomerCount,Table:this.Table,IsDeleted:!1,IsOnTheHouse:this.IsOnTheHouse,ShiftWork:this.ShiftWork,User:this.User,Note:this.Note,Synced:this.Synced,Nonce:this.Nonce,version:this.version}}legacyPmsFields(){const e=Number(this.CustomerId);return UAe.includes(e)?{ShopId:e,ReceiptId:this.OrderId,Room:this.Room??null}:{}}toDynamodb(){return{...this.toJSON(),OrderItems:this.OrderItems.map(e=>{const n=qAe(e.tags);if(n)return{...e,tags:n};const{tags:r,...s}=e;return s}),DiscountRequest:this.DiscountRequest,ServiceChargeText:this.ServiceChargeText,CardChargeText:this.CardChargeText,VatValue:this.VatValue,VatMode:this.VatMode,Note:this.Note,BusinessDate:this.BusinessDate||tt().getBusinessDateFromTimestamp(this.Date),Reference:this.Reference,ReceiptId:this.ReceiptId,...this.Room?{Room:this.Room}:{},...this.legacyPmsFields(),multiplePayment:this.multiplePayment||null}}}class WAe{order;constructor(){return this.order={uniqueid:"",uuid:"",alias:"",noprint:!1,orderitems:[]},this}withUniqueId(e){return this.order.uniqueid=e,this}withUuid(e){return this.order.uuid=e,this}withAlias(e){return this.order.alias=e,this}withNoPrint(e){return this.order.noprint=e,this}withOrderItems(e){const n=e.map(r=>{const s=Number(r.quantity)>0?Number(r.quantity):Number(r.qty)>0?Number(r.qty):1;return{uniqueid:r.uuid||r.uniqueid||"",subitemid:r.subItemId||r.subitemid||0,name:r.name||"",price:r.price||0,discountrequest:r.discountrequest||r.discountRequest||{mode:0,value:0},quantity:s,toppings:r.toppings||[],taglist:r.taglist||[],comments:r.comments||"",...r.isOpenMenu?{isOpenMenu:!0}:{},...r.openMenuName?{openMenuName:r.openMenuName}:{},...r.oneLine?{oneLine:!0}:{}}});return this.order.orderitems=n,this}withCustom(e){return this.order={...this.order,...e},this}build(){let e=Qe.cloneDeep(this.order);return{...Qe.omitBy(e,r=>Qe.isString(r)?r.trim()==="":Qe.isObject(r)?Qe.isEmpty(r):Qe.isUndefined(r))}}}const JS={INVENTORY_MIN:890,EMPLOYEE_PIN_MIN:890,KITCHEN_PRINT_MIN:1390,MULTI_DEVICE_MIN:1390};function FD(){const t=bn().data;return Number(t?.PackagePlan||t?.packagePlan||0)}function zR(t){return FD()>=t}function GAe(){return zR(JS.EMPLOYEE_PIN_MIN)}const QS=globalThis.setInterval,KAe=6e4,zAe=3e4,WF=6e4,YAe=5e3,JAe=5,wi=il(()=>{const t=Ae(null),e=Ae(!1),n=Ae(!1);let r=!1,s=0,i=0,o=0,a=0,c=null;const l=()=>{if(typeof navigator<"u"&&!navigator.onLine||a>=JAe)return;const b=performance.now()-o;if(o!==0&&b<WF){c||(c=setTimeout(()=>{c=null,n.value&&l()},WF-b));return}o=performance.now(),a++;try{fye(qt),pye(qt)}catch(w){console.warn("[serverTime] forced re-handshake failed",w)}},d=()=>{const b=Date.now(),w=performance.now();if(s!==0){const E=Math.abs(b-s-(w-i));E>zAe&&(console.warn(`[serverTime] clock step ~${Math.round(E/1e3)}s detected â offset stale, forcing re-handshake`),n.value=!0,l())}s=b,i=w},h=()=>
149{if(r||typeof window>"u")return;r=!0,xa(Zt(qt,".info/serverTimeOffset"),w=>{t.value=w.val()??0,e.value=!0,n.value=!1}),xa(Zt(qt,".info/connected"),w=>{w.val()===!0&&n.value&&(console.warn("[serverTime] reconnected â offset re-anchored, stale cleared"),n.value=!1)});const b=window;b.__nlServerTimeHeartbeat&&clearInterval(b.__nlServerTimeHeartbeat),s=Date.now(),i=performance.now(),b.__nlServerTimeHeartbeat=QS(d,KAe),document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&d()}),window.addEventListener("online",()=>{d(),n.value&&l()})};return{init:h,refresh:()=>(h(),d(),e.value&&!n.value?Promise.resolve(t.value):new Promise(b=>{let w=!1;const E=()=>{w||(w=!0,T(),clearTimeout(R),b(t.value))},T=ft([e,n],([N,O])=>{N&&!O&&E()}),R=setTimeout(E,YAe)})),nowISO:()=>Ne().add(t.value??0,"millisecond").toISOString(),nowMs:()=>Date.now()+(t.value??0),nowDayjs:()=>Ne().add(t.value??0,"millisecond"),offsetMs:t,ready:e,stale:n}});function i9(){const t=Xn();return t.storeId?String(t.storeId):null}async function BD(t){const e=i9();return e?Swe(e,t):null}async function XS(t,e,n=null){const r=i9();r&&await Ly(r,t,e,n)}function YR(t){return typeof t=="string"?`'${t}'`:new QAe().serialize(t)}const QAe=(function(){class t{#e=new Map;compare(n,r){const s=typeof n,i=typeof r;return s==="string"&&i==="string"?n.localeCompare(r):s==="number"&&i==="number"?n-r:String.prototype.localeCompare.call(this.serialize(n,!0),this.serialize(r,!0))}serialize(n,r){if(n===null)return"null";switch(typeof n){case"string":return r?n:`'${n}'`;case"bigint":return`${n}n`;case"object":return this.$object(n);case"function":return this.$function(n)}return String(n)}serializeObject(n){const r=Object.prototype.toString.call(n);if(r!=="[object Object]")return this.serializeBuiltInType(r.length<10?`unknown:${r}`:r.slice(8,-1),n);const s=n.constructor,i=s===Object||s===void 0?"":s.name;if(i!==""&&globalThis[i]===s)return this.serializeBuiltInType(i,n);if(typeof n.toJSON=="function"){const o=n.toJSON();return i+(o!==null&&typeof o=="object"?this.$object(o):`(${this.serialize(o)})`)}return this.serializeObjectEntries(i,Object.entries(n))}serializeBuiltInType(n,r){const s=this["$"+n];if(s)return s.call(this,r);if(typeof r?.entries=="function")return this.serializeObjectEntries(n,r.entries());throw new Error(`Cannot serialize ${n}`)}serializeObjectEntries(n,r){const s=Array.from(r).sort((o,a)=>this.compare(o[0],a[0]));let i=`${n}{`;for(let o=0;o<s.length;o++){const[a,c]=s[o];i+=`${this.serialize(a,!0)}:${this.serialize(c)}`,o<s.length-1&&(i+=",")}return i+"}"}$object(n){let r=this.#e.get(n);return r===void 0&&(this.#e.set(n,`#${this.#e.size}`),r=this.serializeObject(n),this.#e.set(n,r)),r}$function(n){const r=Function.prototype.toString.call(n);return r.slice(-15)==="[native code] }"?`${n.name||""}()[native]`:`${n.name}(${n.length})${r.replace(/\s*\n\s*/g,"")}`}$Array(n){let r="[";for(let s=0;s<n.length;s++)r+=this.serialize(n[s]),s<n.length-1&&(r+=",");return r+"]"}$Date(n){try{return`Date(${n.toISOString()})`}catch{return"Date(null)"}}$ArrayBuffer(n){return`ArrayBuffer[${new Uint8Array(n).join(",")}]`}$Set(n){return`Set${this.$Array(Array.from(n).sort((r,s)=>this.compare(r,s)))}`}
149$Map(n){return this.serializeObjectEntries("Map",n.entries())}}for(const e of["Error","RegExp","URL"])t.prototype["$"+e]=function(n){return`${e}(${n})`};for(const e of["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"])t.prototype["$"+e]=function(n){return`${e}[${n.join(",")}]`};for(const e of["BigInt64Array","BigUint64Array"])t.prototype["$"+e]=function(n){return`${e}[${n.join("n,")}${n.length>0?"n":""}]`};return t})();function XAe(t,e){return t===e||YR(t)===YR(e)}const ZAe=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],eRe=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],tRe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",ed=[];class nRe{_data=new ff;_hash=new ff([...ZAe]);_nDataBytes=0;_minBufferSize=0;finalize(e){e&&this._append(e);const n=this._nDataBytes*8,r=this._data.sigBytes*8;return this._data.words[r>>>5]|=128<<24-r%32,this._data.words[(r+64>>>9<<4)+14]=Math.floor(n/4294967296),this._data.words[(r+64>>>9<<4)+15]=n,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}_doProcessBlock(e,n){const r=this._hash.words;let s=r[0],i=r[1],o=r[2],a=r[3],c=r[4],l=r[5],d=r[6],h=r[7];for(let p=0;p<64;p++){if(p<16)ed[p]=e[n+p]|0;else{const T=ed[p-15],R=(T<<25|T>>>7)^(T<<14|T>>>18)^T>>>3,N=ed[p-2],O=(N<<15|N>>>17)^(N<<13|N>>>19)^N>>>10;ed[p]=R+ed[p-7]+O+ed[p-16]}const g=c&l^~c&d,_=s&i^s&o^i&o,v=(s<<30|s>>>2)^(s<<19|s>>>13)^(s<<10|s>>>22),b=(c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25),w=h+b+g+eRe[p]+ed[p],E=v+_;h=d,d=l,l=c,c=a+w|0,a=o,o=i,i=s,s=w+E|0}r[0]=r[0]+s|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+c|0,r[5]=r[5]+l|0,r[6]=r[6]+d|0,r[7]=r[7]+h|0}_append(e){typeof e=="string"&&(e=ff.fromUtf8(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(e){let n,r=this._data.sigBytes/64;e?r=Math.ceil(r):r=Math.max((r|0)-this._minBufferSize,0);const s=r*16,i=Math.min(s*4,this._data.sigBytes);if(s){for(let o=0;o<s;o+=16)this._doProcessBlock(this._data.words,o);n=this._data.words.splice(0,s),this._data.sigBytes-=i}return new ff(n,i)}}class ff{words;sigBytes;constructor(e,n){e=this.words=e||[],this.sigBytes=n===void 0?e.length*4:n}static fromUtf8(e){const n=unescape(encodeURIComponent(e)),r=n.length,s=[];for(let i=0;i<r;i++)s[i>>>2]|=(n.charCodeAt(i)&255)<<24-i%4*8;return new ff(s,r)}toBase64(){const e=[];for(let n=0;n<this.sigBytes;n+=3){const r=this.words[n>>>2]>>>24-n%4*8&255,s=this.words[n+1>>>2]>>>24-(n+1)%4*8&255,i=this.words[n+2>>>2]>>>24-(n+2)%4*8&255,o=r<<16|s<<8|i;for(let a=0;a<4&&n*8+a*6<this.sigBytes*8;a++)e.push(tRe.charAt(o>>>6*(3-a)&63))}return e.join("")}concat(e){if(this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4),this.sigBytes%4)for(let n=0;n<e.sigBytes;n++){const r=e.words[n>>>2]>>>24-n%4*8&255;this.words[this.sigBytes+n>>>2]|=r<<24-(this.sigBytes+n)%4*8}else for(let n=0;n<e.sigBytes;n+=4)this.words[this.sigBytes+n>>>2]=e.words[n>>>2];this.sigBytes+=e.sigBytes}}function rRe(t){return new nRe().finalize(t).toBase64()}function lf(t){return rRe(YR(t))}const sRe={trailing:!0};function iRe(t,e=25,n={}){if(n={...sRe,...n},!Number.isFinite(e))throw new TypeError("Expected `wait` to be a finite number");let r,s,i=[],o,a;const c=(h,p)=>(o=oRe(t,h,p),o.finally(()=>{if(o=null,n.trailing&&a&&!s){const g=c(h,a);return a=null,g}}),o),l=function(...h){return n.trailing&&(a=h),o||new Promise(p=>{const g=!s&&n.leading;clearTimeout(s),s=setTimeout(()=>{s=null;const _=n.leading?r:c(this,h);a=null;for(const v of i)v(_);i=[]},e),g?(r=c(this,h),p(r)):i.push(p)})},d=h=>{h&&(clearTimeout(h),s=null)};return l.isPending=()=>!!s,l.cancel=()=>{d(s),i=[],a=null},l.flush=()=>
149{if(d(s),!a||o)return;const h=a;return a=null,c(this,h)},l}async function oRe(t,e,n){return await t.apply(e,n)}const o9=Symbol.for("nuxt:client-only"),aRe="<div></div>";function cRe(t){return t.nodeName==="#comment"&&t.nodeValue==="placeholder"}function CC(t){return t&&!cRe(t)?Foe(t,aRe):On("div")}const qVe=Ls({name:"ClientOnly",inheritAttrs:!1,props:["fallback","placeholder","placeholderTag","fallbackTag"],setup(t,{slots:e,attrs:n}){const r=ht(!1);ka(()=>{r.value=!0});const s=Sr();return s&&(s._nuxtClientOnly=!0),Sa(o9,!0),()=>{if(r.value){const c=e.default?.();return c&&c.length===1?[gi(c[0],n)]:c}const i=e.fallback||e.placeholder;if(i)return On(i);const o=t.fallback||t.placeholder||"",a=t.fallbackTag||t.placeholderTag||"span";return Ll(a,n,o)}}}),AC=new WeakMap;function lRe(t){if(AC.has(t))return AC.get(t);const e={...t};if(e.render)e.render=(n,r,s,i,o,a)=>{if(i.mounted$??n.mounted$){const c=t.render?.bind(n)(n,r,s,i,o,a);return c.children===null||typeof c.children=="string"?gi(c):On(c)}return CC(n._.vnode.el)};else{const n="<div></div>";e.template&&=` 150 <template v-if="mounted$">${t.template}</template> 151 <template v-else>${n}</template> 152 `}return e.setup=(n,r)=>{const s=xt(),i=ht(s.isHydrating===!1),o=Sr();if(s.isHydrating){const c={...o.attrs},l=uRe(o);for(const d in c)delete o.attrs[d];ka(()=>{Object.assign(o.attrs,c),o.vnode.dirs=l})}ka(()=>{i.value=!0});const a=t.setup?.(n,r)||{};return H_(a)?Promise.resolve(a).then(c=>typeof c!="function"?(c||={},c.mounted$=i,c):(...l)=>{if(i.value||!s.isHydrating){const d=c(...l);return d.children===null||typeof d.children=="string"?gi(d):On(d)}return CC(o?.vnode.el)}):typeof a=="function"?(...c)=>{if(i.value){const l=a(...c),d=e.inheritAttrs!==!1?r.attrs:void 0;return l.children===null||typeof l.children=="string"?gi(l,d):On(l,d)}return CC(o?.vnode.el)}:Object.assign(a,{mounted$:i})},AC.set(t,e),e}function uRe(t){if(!t||!t.vnode.dirs)return null;const e=t.vnode.dirs;return t.vnode.dirs=null,e}const GF=globalThis.requestIdleCallback||(t=>{const e=Date.now(),n={didTimeout:!1,timeRemaining:()=>Math.max(0,50-(Date.now()-e))};return setTimeout(()=>{t(n)},1)}),jVe=globalThis.cancelIdleCallback||(t=>{clearTimeout(t)}),a9=t=>{const e=xt();e.isHydrating?e.hooks.hookOnce("app:suspense:resolve",()=>{GF(()=>t())}):GF(()=>t())};function c9(t){return Object.defineProperty(function(){throw new Error(`[nuxt] \`${t.name}\` is a compiler macro and cannot be called at runtime.`)},"__nuxt_factory",{enumerable:!1,get:()=>t.factory})}const l9=c9({name:"createUseAsyncData",factory(t={}){function e(...n){const r=typeof n[n.length-1]=="string"?n.pop():void 0;hRe(n[0],n[1])&&n.unshift(r);let[s,i,o={}]=n,a=!1;const c=Pn(s)||typeof s=="function",l=c?$e(()=>Pr(s)):{value:s};if(!l.value||typeof l.value!="string")throw new TypeError("[nuxt] [useAsyncData] key must be a non-empty string.");if(typeof i!="function")throw new TypeError("[nuxt] [useAsyncData] handler must be a function.");const d=typeof t=="function",h=xt(),p=d?t(o):t;if(!d)for(const T in p)p[T]!==void 0&&o[T]===void 0&&(o[T]=p[T]);if(o.server??=!0,o.default??=pRe,o.getCachedData??=d9,o.lazy??=!1,o.immediate??=!0,o.deep??=hre.deep,o.dedupe??="cancel",d)for(const T in p)p[T]!==void 0&&(o[T]=p[T]);h._asyncData[l.value];function g(){const T={cause:"initial",dedupe:o.dedupe},R=h._asyncData[l.value];return R?._init?T.cachedData=R._initialCachedData:(T.cachedData=o.getCachedData(l.value,h,{cause:"initial"}),h._asyncData[l.value]=KF(h,l.value,i,o,T.cachedData),h._asyncData[l.value]._initialCachedData=T.cachedData),()=>h._asyncData[l.value].execute(T)}const _=g(),v=h._asyncData[l.value];v._deps++;const b=o.server!==!1&&h.payload.serverRendered;{let T=function(k){const L=h._asyncData[k];L?._deps&&(L._deps--,L._deps===0&&L?._off())};const R=Sr();if(R&&b&&o.immediate&&!R.sp&&(R.sp=[]),R&&!R._nuxtOnBeforeMountCbs){R._nuxtOnBeforeMountCbs=[];const k=R._nuxtOnBeforeMountCbs;RP(()=>{k.forEach(L=>{L()}),k.splice(0,k.length)}),Tp(()=>k.splice(0,k.length))}const N=R&&(R._nuxtClientOnly||vr(o9,!1));b&&h.isHydrating&&(v.error.value||v.data.value!==void 0)?v.status.value=v.error.value?"error":"success":R&&(!N&&h.payload.serverRendered&&h.isHydrating||o.lazy)&&o.immediate?R._nuxtOnBeforeMountCbs.push(_):o.immediate&&v.status.value!=="success"&&_();const O=Ba(),S=()=>{},I=c?ft(l,(k,L)=>{if((k||L)&&k!==L){a=!0;const M=h._asyncData[L]?.data.value!==void 0,V=h._asyncDataPromises[L]!==void 0,z={cause:"initial",dedupe:o.dedupe};
152if(!h._asyncData[k]?._init){let K;L&&M?K=h._asyncData[L].data.value:(K=o.getCachedData(k,h,{cause:"initial"}),z.cachedData=K),h._asyncData[k]=KF(h,k,i,o,K)}h._asyncData[k]._deps++,L&&T(L),o._keyTriggersExecute!==!1&&(o.immediate||M||V)&&h._asyncData[k].execute(z),Ud(()=>{a=!1})}},{flush:"sync"}):S,P=o.watch?ft(o.watch,()=>{a||(h._asyncData[l.value]?._execute.isPending()&&Ud(()=>{h._asyncData[l.value]?._execute.flush()}),h._asyncData[l.value]?._execute({cause:"watch",dedupe:o.dedupe}))}):S;O&&$c(()=>{I(),P(),T(l.value)})}const w={data:Mb(()=>h._asyncData[l.value]?.data),pending:Mb(()=>h._asyncData[l.value]?.pending),status:Mb(()=>h._asyncData[l.value]?.status),error:Mb(()=>h._asyncData[l.value]?.error),refresh:(...T)=>h._asyncData[l.value]?._init?h._asyncData[l.value].execute(...T):g()(),execute:(...T)=>w.refresh(...T),clear:()=>{const T=h._asyncData[l.value];if(T?._abortController)try{T._abortController.abort(new DOMException("AsyncData aborted by user.","AbortError"))}finally{T._abortController=void 0}u9(h,l.value)}},E=Promise.resolve(h._asyncDataPromises[l.value]).then(()=>w);return Object.assign(E,w),Object.defineProperties(E,{then:{enumerable:!0,value:E.then.bind(E)},catch:{enumerable:!0,value:E.catch.bind(E)},finally:{enumerable:!0,value:E.finally.bind(E)}}),E}return e}}),dRe=l9.__nuxt_factory();l9.__nuxt_factory({lazy:!0,_functionName:"useLazyAsyncData"});function Mb(t){return $e({get(){return t()?.value},set(e){const n=t();n&&(n.value=e)}})}function hRe(t,e){return!(typeof t=="string"||typeof t=="object"&&t!==null||typeof t=="function"&&typeof e=="function")}function u9(t,e){e in t.payload.data&&(t.payload.data[e]=void 0),e in t.payload._errors&&(t.payload._errors[e]=void 0),t._asyncData[e]&&(t._asyncData[e].data.value=Wt(t._asyncData[e]._default()),t._asyncData[e].error.value=void 0,t._asyncData[e].status.value="idle",t._asyncData[e]._initialCachedData=void 0),e in t._asyncDataPromises&&(t._asyncDataPromises[e]=void 0)}function fRe(t,e){const n={};for(const r of e)n[r]=t[r];return n}function KF(t,e,n,r,s){t.payload._errors[e]??=void 0;const i=r.getCachedData!==d9,o=n,a=r.deep?Ae:ht,c=s!==void 0,l=t.hook("app:data:refresh",async h=>{(!h||h.includes(e))&&await d.execute({cause:"refresh:hook"})}),d={data:a(c?s:r.default()),pending:$e(()=>d.status.value==="pending"),error:vp(t.payload._errors,e),status:ht("idle"),execute:(...h)=>{const[p,g=void 0]=h,_=p&&g===void 0&&typeof p=="object"?p:{};if(t._asyncDataPromises[e]&&(_.dedupe??r.dedupe)==="defer")return t._asyncDataPromises[e];{const w="cachedData"in _?_.cachedData:r.getCachedData(e,t,{cause:_.cause??"refresh:manual"});if(w!==void 0)return t.payload.data[e]=d.data.value=w,d.error.value=void 0,d.status.value="success",Promise.resolve(w)}d._abortController&&d._abortController.abort(new DOMException("AsyncData request cancelled by deduplication","AbortError")),d._abortController=new AbortController,d.status.value="pending";const v=new AbortController,b=new Promise((w,E)=>{try{const T=_.timeout??r.timeout,R=mRe([d._abortController?.signal,_?.signal],v.signal,T);if(R.aborted){const N=R.reason;E(N instanceof Error?N:new DOMException(String(N??"Aborted"),"AbortError"));return}return R.addEventListener("abort",()=>{const N=R.reason;E(N instanceof Error?N:new DOMException(String(N??"Aborted"),"AbortError"))},{once:!0,signal:v.signal}),Promise.resolve(o(t,{signal:R})).then(w,E)}catch(T){E(T)}}).then(async w=>{if(t._asyncDataPromises[e]!==b)return;let E=w;r.transform&&(E=await r.transform(w)),r.pick&&(E=fRe(E,r.pick)),t.payload.data[e]=E,d.data.value=E,d.error.value=void 0,d.status.value="success"}).catch(w=>{if(t._asyncDataPromises[e]!==b||d._abortController?.signal.aborted)return t._asyncDataPromises[e];if(typeof DOMException<"u"&&w instanceof DOMException&&w.name==="AbortError")return d.status.value="idle",t._asyncDataPromises[e];d.error.value=Gl(w),d.data.value=Wt(r.default()),d.status.value="error"}).finally(()=>{v.abort(),t._asyncDataPromises[e]===b&&delete t._asyncDataPromises[e]});return t._asyncDataPromises[e]=b,t._asyncDataPromises[e]},_execute:iRe((...h)=>d.execute(...h),0,{leading:!0}),_default:r.default,_deps:0,_init:!0,_hash:void 0,_off:()=>{l(),t._asyncData[e]?._init&&(t._asyncData[e]._init=!1),i||zs(()=>{t._asyncData[e]?._init||(u9(t,e),d.execute=()=>Promise.resolve())})}};return d}const pRe=()=>{},d9=(t,e,n)=>{if(e.isHydrating)return e.payload.data[t];if(n.cause!=="refresh:manual"&&n.cause!=="refresh:hook")return e.static.data[t]};function mRe(t,e,n){const r=t.filter(o=>!!o);if(typeof n=="number"&&n>=0){const o=AbortSignal.timeout?.(n);o&&r.push(o)}if(AbortSignal.any)return AbortSignal.any(r);const s=new AbortController;for(const o of r)if(o.aborted){const a=o.reason??new DOMException("Aborted","AbortError");try{s.abort(a)}catch{s.abort()}return s.signal}const i=()=>{const a=r.find(c=>c.aborted)?.reason??new DOMException("Aborted","AbortError");try{s.abort(a)}catch{s.abort()}};for(const o of r)o.addEventListener?.("abort",i,{once:!0,signal:e});return s.signal}function gRe(t){const e=[Pr(t.method)?.toUpperCase()||"GET",Pr(t.baseURL)];for(const n of[t.query||t.params]){const r=Pr(n);if(!r)continue;const s={};for(const[i,o]of Object.entries(r))s[Pr(i)]=Pr(o);e.push(s)}if(t.body){const n=Pr(t.body);if(!n)e.push(lf(n));else if(n instanceof ArrayBuffer)e.push(lf(Object.fromEntries([...new Uint8Array(n).entries()].map(([r,s])=>[r,s.toString()]))));else if(n instanceof FormData){const r=[];for(const s of n.entries()){const[i,o]=s;r.push([i,o instanceof File?`${o.name}:${o.size}:${o.lastModified}`:o])}e.push(lf(r))}else if(gp(n))e.push(lf(Xs(n)));else try{e.push(lf(n))}catch{console.warn("[useFetch] Failed to hash body",n)}}return e}const h9=c9({name:"createUseFetch",factory(t={}){function e(n,r,s){const[i={},o]=typeof r=="string"?[{},r]:[r,s],a=typeof t=="function"?t(i):t,{server:c,lazy:l,default:d,transform:h,pick:p,watch:g,immediate:_,getCachedData:v,deep:b,dedupe:w,timeout:E,...T}={...typeof t=="function"?{}:a,...i,...typeof t=="function"?a:{}},R=$e(()=>Pr(n)),N=$e(()=>Pr(T.key)||"$f"+lf([o,typeof R.value=="string"?R.value:"",...gRe(T)]));if(!T.baseURL&&typeof R.value=="string"&&R.value[0]==="/"&&R.value[1]==="/")throw new Error('[nuxt] [useFetch] the request URL must not start with "//".');const O=Xs({...fre,...T,cache:typeof T.cache=="boolean"?void 0:T.cache}),S={server:c,lazy:l,default:d,transform:h,pick:p,immediate:_,getCachedData:v,deep:b,dedupe:w,timeout:E,watch:g===!1?[]:[...g||[],O]};return g===!1&&(S._keyTriggersExecute=!1),dRe(N,(P,{signal:k})=>(T.$fetch||globalThis.$fetch)(R.value,{signal:k,...O}),S)}return e}});h9.__nuxt_factory();h9.__nuxt_factory({lazy:!0,_functionName:"useLazyFetch"});const _Re=3456e4;function yRe(t,e,n){const r=t.indexOf(";",e);return r===-1?n:r}function vRe(t,e,n){const r=t.indexOf("=",e);return r<n?r:-1}function zF(t,e,n){if(e===n)return"";let r=e,s=n;do{const i=t.charCodeAt(r);if(i!==32&&i!==9)break}while(++r<s);for(;s>r;){const i=t.charCodeAt(s-1);if(i!==32&&i!==9)break;s--}return t.slice(r,s)}const bRe=(()=>{const t=function(){};return t.prototype=Object.create(null),t})();function wRe(t,e){const n=new bRe,r=t.length;if(r<2)return n;const s=e?.decode||SRe,i=e?.allowMultiple||!1;let o=0;do{const a=vRe(t,o,r);if(a===-1)break;const c=yRe(t,o,r);if(a>c){o=t.lastIndexOf(";",a-1)+1;continue}const l=zF(t,o,a);if(e?.filter&&!e.filter(l)){o=c+1;continue}const d=s(zF(t,a+1,c));if(i){const h=n[l];h===void 0?n[l]=d:Array.isArray(h)?h.push(d):n[l]=[h,d]}else n[l]===void 0&&(n[l]=d);o=c+1}while(o<r);return n}function SRe(t){if(!t.includes("%"))return t;try{return decodeURIComponent(t)}catch{return t}}const TRe=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,ERe=/^[\u0021-\u003A\u003C-\u007E]*$/,IRe=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,CRe=/^[\u0020-\u003A\u003C-\u007E]*$/,ARe=Object.prototype.toString;function YF(t,e,n){const r=typeof t=="object"&&t!==null,s=r?e:n,i=s?.stringify||JSON.stringify,o=r?t:{...n,name:t,value:e==null?"":typeof e=="string"?e:i(e)},a=s?.encode||encodeURIComponent;if(!TRe.test(o.name))throw new TypeError(`argument name is invali
152d: ${o.name}`);const c=o.value?a(o.value):"";if(!ERe.test(c))throw new TypeError(`argument val is invalid: ${o.value}`);if(!o.secure){if(o.partitioned)throw new TypeError("Partitioned cookies must have the Secure attribute");if(o.sameSite&&String(o.sameSite).toLowerCase()==="none")throw new TypeError("SameSite=None cookies must have the Secure attribute");if(o.name.length>9&&o.name.charCodeAt(0)===95&&o.name.charCodeAt(1)===95){const d=o.name.toLowerCase();if(d.startsWith("__secure-")||d.startsWith("__host-"))throw new TypeError(`${o.name} cookies must have the Secure attribute`)}}if(o.name.length>7&&o.name.charCodeAt(0)===95&&o.name.charCodeAt(1)===95&&o.name.toLowerCase().startsWith("__host-")){if(o.path!=="/")throw new TypeError("__Host- cookies must have Path=/");if(o.domain)throw new TypeError("__Host- cookies must not have a Domain attribute")}let l=o.name+"="+c;if(o.maxAge!==void 0){if(!Number.isInteger(o.maxAge))throw new TypeError(`option maxAge is invalid: ${o.maxAge}`);l+="; Max-Age="+Math.max(0,Math.min(o.maxAge,_Re))}if(o.domain){if(!IRe.test(o.domain))throw new TypeError(`option domain is invalid: ${o.domain}`);l+="; Domain="+o.domain}if(o.path){if(!CRe.test(o.path))throw new TypeError(`option path is invalid: ${o.path}`);l+="; Path="+o.path}if(o.expires){if(!RRe(o.expires)||!Number.isFinite(o.expires.valueOf()))throw new TypeError(`option expires is invali
152d: ${o.expires}`);l+="; Expires="+o.expires.toUTCString()}if(o.httpOnly&&(l+="; HttpOnly"),o.secure&&(l+="; Secure"),o.partitioned&&(l+="; Partitioned"),o.priority)switch(typeof o.priority=="string"?o.priority.toLowerCase():void 0){case"low":l+="; Priority=Low";break;case"medium":l+="; Priority=Medium";break;case"high":l+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${o.priority}`)}if(o.sameSite)switch(typeof o.sameSite=="string"?o.sameSite.toLowerCase():o.sameSite){case!0:case"strict":l+="; SameSite=Strict";break;case"lax":l+="; SameSite=Lax";break;case"none":l+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${o.sameSite}`)}return l}function RRe(t){return ARe.call(t)==="[object Date]"}function ko(t){if(typeof t!="object")return t;var e,n,r=Object.prototype.toString.call(t);if(r==="[object Object]"){if(t.constructor!==Object&&typeof t.constructor=="function"){n=new t.constructor;for(e in t)t.hasOwnProperty(e)&&n[e]!==t[e]&&(n[e]=ko(t[e]))}else{n={};for(e in t)e==="__proto__"?Object.defineProperty(n,e,{value:ko(t[e]),configurable:!0,enumerable:!0,writable:!0}):n[e]=ko(t[e])}return n}if(r==="[object Array]"){for(e=t.length,n=Array(e);e--;)n[e]=ko(t[e]);return n}return r==="[object Set]"?(n=new Set,t.forEach(function(s){n.add(ko(s))}),n):r==="[object Map]"?(n=new Map,t.forEach(function(s,i){n.set(ko(i),ko(s))}),n):r==="[object Date]"?new Date(+t):r==="[object RegExp]"?(n=new RegExp(t.source,t.flags),n.lastIndex=t.lastIndex,n):r==="[object DataView]"?new t.constructor(ko(t.buffer)):r==="[object ArrayBuffer]"?t.slice(0):r.slice(-6)==="Array]"?new t.constructor(t):t}function PRe(t){if(t!=="undefined")try{const e=JSON.parse(t);return typeof e=="number"&&String(e)!==t?t:e}catch{return t}}const kRe={path:"/",watch:!0,decode:t=>t&&PRe(decodeURIComponent(t)),encode:t=>{if(typeof t!="string"||t==="undefined")return encodeURIComponent(JSON.stringify(t));try{if(typeof JSON.parse(t)!="string")return encodeURIComponent(JSON.stringify(t))}catch{}return encodeURIComponent(t)},refresh:!1},Vb=globalThis.cookieStore;function f9(t,e){const n={...kRe,...e};n.filter??=l=>l===t;const r=JF(n)||{};let s;n.maxAge!==void 0?s=n.maxAge*1e3:n.expires&&(s=n.expires.getTime()-Date.now());const i=s!==void 0&&s<=0,o=i||r[t]===void 0||r[t]===null,a=ko(i?void 0:r[t]??n.default?.()),c=s&&!i?LRe(a,s,n.watch&&n.watch!=="shallow"):Ae(a);{let l=null;try{!Vb&&typeof BroadcastChannel<"u"&&(l=new BroadcastChannel(`nuxt:cookies:${t}`))}catch{}const d=(_=!1)=>{if(!_&&(n.readonly||XAe(c.value,r[t])))return;const v=c.value===null||c.value===void 0?void 0:n.encode(c.value);xRe(t,v,n),r[t]=ko(c.value),l?.postMessage({value:n.encode(c.value)})},h=_=>{const v=_.refresh?JF(n)?.[t]:n.decode(_.value);p=!0,c.value=v,r[t]=ko(v),zs(()=>{p=!1})};let p=!1;const g=!!Ba();if(g&&$c(()=>{p=!0,d(),l?.close()}),Vb){const _=v=>{const b=v.changed.find(E=>E.name===t),w=v.deleted.find(E=>E.name===t);b&&h({value:b.value}),w&&h({value:null})};Vb.addEventListener("change",_),g&&$c(()=>Vb.removeEventListener("change",_))}else l&&(l.onmessage=({data:_})=>h(_));n.watch&&ft(c,()=>{p||d(n.refresh)},{deep:n.watch!=="shallow"}),o&&d(o)}return c}function JF(t={}){return wRe(document.cookie,t)}const NRe=t=>t;function DRe(t){const{encode:e,decode:n,...r}=t;return{...r,encode:NRe}}function ORe(t,e,n={}){const r=DRe(n);return e===void 0?YF(t,"",{...r,maxAge:-1}):YF(t,e,r)}function xRe(t,e,n={}){document.cookie=ORe(t,e,n)}const QF=2147483647;function LRe(t,e,n){let r,s,i=0;const o=n?Ae(t):{value:t};return Ba()&&$c(()=>{s?.(),clearTimeout(r)}),vT((a,c)=>{n&&(s=ft(o,c));function l(){const h=e-i,p=h<QF?h:QF;r=setTimeout(()=>{if(i+=p,i<e)return l();o.value=void 0,c()},p)}
152function d(){i=0,clearTimeout(r),l()}return{get(){return a(),o.value},set(h){d(),o.value=h,c()}}})}function MRe(t){if(t?.__asyncLoader&&!t.__asyncResolved)return t.__asyncLoader()}async function VRe(t,e=Os()){const{path:n,matched:r}=e.resolve(t);if(!r.length||(e._routePreloaded||=new Set,e._routePreloaded.has(n)))return;const s=e._preloadPromises||=[];if(s.length>4)return Promise.all(s).then(()=>VRe(t,e));e._routePreloaded.add(n);for(const i of r){const o=i.components?.default;if(typeof o!="function")continue;const a=Promise.resolve(o()).catch(()=>{}).finally(()=>s.splice(s.indexOf(a),1));s.push(a)}await Promise.all(s)}function FRe(t={}){const e=t.path||window.location.pathname;let n={};try{n=JSON.parse(sessionStorage.getItem("nuxt:reload")||"{}")}catch{}if(t.force||n?.path!==e||n?.expires<Date.now()){try{sessionStorage.setItem("nuxt:reload",JSON.stringify({path:e,expires:Date.now()+(t.ttl??1e4)}))}catch{}if(t.persistState)try{sessionStorage.setItem("nuxt:reload:state",JSON.stringify({state:xt().payload.state}))}catch{}window.location.pathname!==e?window.location.href=e:window.location.reload()}}function p9(t){return new URL(globalThis.location.href)}function BRe(t={}){const e=ht(""),n=ht(t.politeness||"polite"),r=LH();function s(l="",d="polite"){e.value=l,n.value=d}function i(l){s(l,"polite")}function o(l){s(l,"assertive")}function a(){s(document?.title?.trim(),n.value)}function c(){r?.hooks?.removeHook("dom:rendered",a)}return a(),r?.hooks?.hook("dom:rendered",a),{_cleanup:c,message:e,politeness:n,set:s,polite:i,assertive:o}}function $Re(t={}){const e=xt(),n=e._routeAnnouncer||=BRe(t);return t.politeness&&t.politeness!==n.politeness.value&&(n.politeness.value=t.politeness),Ba()&&(e._routeAnnouncerDeps||=0,e._routeAnnouncerDeps++,$c(()=>{e._routeAnnouncerDeps--,e._routeAnnouncerDeps===0&&(n._cleanup(),delete e._routeAnnouncer)})),n}const XF="productComboSet",$D=qn("productComboSet",()=>{const t=Ae(!1),e=Ae({}),n=p=>{const g={};Qe.forEach(p,_=>{const v=_?.comboList;Array.isArray(v)&&v.length>=1&&(g[Number(_.uuid)]=v)}),e.value=g},r=p=>{if(p!=null)return e.value[Number(p)]},s=p=>!!r(p),i=p=>{if(p?.isComboChild)return!0;const g=String(p?.name??"");return g.startsWith("(W) ")||g.startsWith(" (W) ")},o=p=>{if(!Array.isArray(p)||p.length===0||Object.keys(e.value).length===0)return p;const g=[];let _=0;return Qe.forEach(p,v=>{if(g.push(v),i(v))return;const b=v?.subItemId??v?.subitemid,w=r(b);if(!w)return;_++;const E=Number(v?.quantity??v?.qty??1)||1;Qe.forEach(w,T=>{const R=(Number(T.qty)||1)*E;g.push({name:" (W) "+T.name,price:0,extPrice:0,quantity:R,qty:R,subItemId:T.subItemId,subitemid:T.subItemId,toppings:[],comments:"",uuid:Qe.random(1,1e5)+":"+Date.now(),isComboChild:!0,majorSet:_,minorSet:_})})}),g},a=async()=>{const p=await Ot().productComboSet.fetch()||[];return await XS(XF,p),n(p),p},c=async()=>{const p=await BD(XF);if(p!=null){n(p),t.value=!0;return}try{await a()}catch(g){console.warn("[productComboSet] fetch failed",g),n([])}t.value=!0},l=async()=>{try{await a()}catch(p){console.warn("[productComboSet] refresh failed",p)}},d=async(p,g)=>{const _=bn().storeId,v=String(p);if(!g||g.length===0)return h(p);const b={customerId:_,uuid:v,comboList:g.map(w=>({name:w.name,qty:Number(w.qty)||1,subItemId:Number(w.subItemId)}))};await Ot().productComboSet.postByDynamoFormat(_,b),await l()},h=async p=>{const g=bn().storeId;await Ot().productComboSet.removeByDynamoFormat(g,String(p)),await l()};return{loaded:t,comboHolder:e,getComboChildren:r,hasCombo:s,expandItems:o,finishLoad:c,refresh:l,saveCombo:d,removeCombo:h}}),ZF=qn("cartItem",{state:()=>({items:[],deliveryInfo:null}),getters:{itemCount:t=>t.items.reduce((e,n)=>e+Number(n.quantity),0),cartTotal:t=>t.items.reduce((e,n)=>{let r=n.price*n.quantity,s=0,i=0;return n?.toppings?.length>0&&(s=n.toppings.reduce((o,a)=>o+a.price*a.quantity*n.quantity,0)),n?.discountrequest&&Number(n.discountrequest.value)?i=xD(r+s,Number(n.quantity)||0,Number(n.discountrequest.mode)||0,Number(n.discountrequest.value)||0):n?.discount&&(i=n.discount[2]),e+r+s-i},0),cartBilling:t=>{const e=zE(),{tableBillingGlobal:n,tablesState:r}=_r(),s=ln(),i=t.items.map(a=>({...a,discountRequest:a.discountRequest||a.discountrequest,subitemid:a.subitemid??a.subItemId})),o=e.mode===Bt.TOGO&&s.togoNoService;return MD(ZG(i,void 0,GR()),n,r[e.tableName],{noServiceCharge:o})},isSkipServiceLine:()=>{const t=GR();return t?e=>!!t(e?.subitemid??e?.subItemId):()=>!1},subItemIdMapQty:t=>t.items.reduce((e,n)=>(e[n.parentId]=(e[n.parentId]||0)+n.quantity,e),{}
152),qtyBySubItemId:t=>t.items.reduce((e,n)=>(e[n.subItemId]=(e[n.subItemId]||0)+n.quantity,e),{})},actions:{setDeliveryInfo(t){this.deliveryInfo=t},handleAddItemToCart(t,e){let n=e?.parentItem?.Name;t?.Name!=="Regular"&&(n+=` (${t.Name})`);let r={parentId:e?.parentItem?.Id,name:n,price:t.Price||0,extPrice:t.Price||0,quantity:1,subItemId:t.Id,toppings:e.toppings||[],comments:e.comments||"",isOpenMenu:e.isOpenMenu||!1};e.openMenuName&&(r.openMenuName=e.openMenuName);const s=Number(e?.parentItem?.DiscountValue)||0;s&&(r.discountrequest={mode:Number(e?.parentItem?.DiscountMode)||0,value:s});const i=tB(r),o=this.items.find(a=>!a.oneLine&&tB(a)==i);if(o){o.quantity++;return}this.addItemToCart(r)},addItemToCart(t){this.items.push({...t,uuid:eB()})},removeItemFromCart(t){this.items.splice(t,1)},onIncreaseQty(t){this.items[t].quantity++},onDecreaseQty(t){this.items[t].quantity>1?this.items[t].quantity--:this.removeItemFromCart(t)},setQuantity(t,e){const n=Number(e);!Number.isFinite(n)||n<=0||(this.items[t].quantity=Math.round(n*100)/100)},setPrice(t,e){t.price=e,t.extPrice=e},setDiscountItem(t,e,n){const r=Number(n)||0;r?(t.discountrequest={mode:Number(e)||0,value:r},delete t.noDefaultDiscount):(delete t.discountrequest,t.noDefaultDiscount=!0)},splitCartLine(t,e){const n=this.items.findIndex(a=>a.uuid==t.uuid);if(n<0)return;const r=this.items[n],s=Number(r.quantity)||0,i=a=>Math.round(a*100)/100,o=i(Number(e)||0);!Number.isFinite(o)||o<=0||o>=s||(r.quantity=i(s-o),r.oneLine=!0,this.items.splice(n+1,0,{...Qe.cloneDeep(r),quantity:o,uuid:eB(),oneLine:!0}))},updateCartLineFromEditor(t,e={}){const n=this.items.find(r=>r.uuid==t.uuid);if(!n){this.addItemToCart(t);return}n.toppings=t.toppings,n.comments=t.comments,e.price!=null&&this.setPrice(n,Number(e.price)),e.discount&&this.setDiscountItem(n,e.discount.mode,e.discount.value),e.splitQty&&this.splitCartLine(n,Number(e.splitQty))},clearCart(){this.items=[]}}});function eB(){return Qe.random(1,1e4)+":"+Ne().valueOf()}function tB(t,e=null){const n=t.discountrequest?`${t.discountrequest.mode||0}:${t.discountrequest.value||0}`:"";return`${t.subItemId}:${t.name}:${t.comments}:${t.price}:${t.toppings?.map(r=>r.toppingId).join(":")}:${n}`}const UD=il(()=>{const t=Ae("dashboard"),e=Ae("table");return{tabSelected:t,tableType:e,setTab:(r,s)=>{t.value=r,e.value=s||"table"}}}),zE=qn("cart",{state:()=>({tableName:"",tableNickname:"",isOpeningTable:!1,mode:1,timestamp:wi().nowISO(),isSending:!1,deliveryInfo:null,guests:0,toKitchen:zR(JS.KITCHEN_PRINT_MIN),terminalTimeout:null,terminalUnsubscribe:null}),getters:{itemCount:t=>1,getTogoCurrentQueueNumber:t=>()=>{const r=Qe.values(tt().jobs).filter(i=>i.mode===Bt.TOGO).map(i=>i.alias);return Qe.uniq(r).length},getJobCurrentQueueNumber:t=>()=>{const r=Qe.values(tt().jobs).filter(i=>i.mode===Bt.JOB).map(i=>i.alias);return Qe.uniq(r).length}},actions:{addTableRequest(t){this.tableName=t.name,this.tableNickname=t.nickName||null,this.mode=nB(t),this.timestamp=wi().nowISO(),this.isSending=!1,this.deliveryInfo=null,this.toKitchen=zR(JS.KITCHEN_PRINT_MIN),this.guests=0,t?.items?.length>0?this.isOpeningTable=!1:this.isOpeningTable=!0,this.onClearCart()},setGuestAmount(t){this.guests=t},setDeliveryInfo(t){this.deliveryInfo=t},async saveFromCashier(t,e){if(!t||t.length===0){await Or.fire({icon:"warning",title:"No items",text:"Please add at least one item before saving."});return}if(!this.isSending){this.isSending=!0;try{const n=this._buildOrder(t,e),r=this._buildJob(n,e);return console.log(r),await tt().add(r,!0),r}finally{this.isSending=!1}}},async saveFromTerminal(t,e,n,r){if(!t||t.length===0)return await Or.fire({icon:"warning",title:"No items",text:"Please add at least one item before saving."}),!1;if(this.isSending)return!1;this.isSending=!0,this.terminalTimeout&&(clearTimeout(this.terminalTimeout),this.terminalTimeout=null),this.terminalUnsubscribe?.(),this.terminalUnsubscribe=null;const s=this._buildOrder(t,e),i=this._buildJob(s,e);console.log(i);const o=i.hash?.toString()||"",a=Ze().handshakeTerminalRef(),c=zt(a,o);Ue(c,1);const l=()=>{this.terminalTimeout&&(clearTimeout(this.terminalTimeout),this.terminalTimeout=null),this.terminalUnsubscribe?.(),this.terminalUnsubscribe=null,this.isSending=!1};this.terminalTimeout=setTimeout(()=>{console.log("Timeout: no response after 7 seconds, unsubscribing"),l(),r?.()},7e3),this.terminalUnsubscribe=xa(c,d=>{if(console.log(d.val()),d.val()===2){const h=Ze().terminalJobRef(),p=zt(h,o);if(Ue(p,i),l(),!(i.mode===Bt.JOB&&!i.nickName)){n?.(i);return}this._awaitTerminalJobNumber(o,_=>{_&&(i.nickName=_),n?.(i)})}})},_awaitTerminalJobNumber(t,e){if(!t){e(null);return}const n=zt(Ze().terminalJobResultRef(),t);let r=null,s=null,i=!1;const o=a=>{i||(i=!0,r?.(),r=null,s&&(clearTimeout(s),s=null),e(a))};s=setTimeout(()=>
152o(null),8e3),r=xa(n,a=>{const c=a.val();c&&o(c.nickName||null)})},_buildJob(t,e={note:""}){tt();const n=qr();bn();const r=Math.random().toString(36).substring(2,15);let s=this.tableName||r;const i=e.note||"",o=this.isOpeningTable,a=new ou().withActionType(pt.ADD).withEmployee(n.getCurrentEmployee).withPrint(this.toKitchen).withOrderJson(t).withJobIdAndTimestamp(this.timestamp).withNote(i).withCustom({hash:r,comments:i||null});switch(e?.source&&a.withSource(e.source),this.mode){case Bt.TABLE:a.withGuests(this.guests).withMode(Bt.TABLE).withIsOpeningTable(o).withTableAlias(s).withTableUuid(s);break;case Bt.TOGO:let c=this.tableNickname||"";this.isOpeningTable&&!c&&(c="Queue #"+(this.getTogoCurrentQueueNumber()+1).toString()),a.withGuests(1).withMode(Bt.TOGO).withTableAlias(s).withTableUuid(s).withNickName(c);break;case Bt.JOB:let l=this.tableNickname||"";this.isOpeningTable&&!l&&e?.source!=="t"&&(l="Job #"+(this.getJobCurrentQueueNumber()+1).toString()),a.withGuests(1).withMode(Bt.JOB).withTableAlias(s).withTableUuid(s).withNickName(l);break;case Bt.DELIVERY:let d=this.tableNickname||"K."+(this.deliveryInfo?.name||"");a.withGuests(1).withMode(Bt.DELIVERY).withTableAlias(s).withTableUuid(s).withNickName(d).withDeliveryInfo(this.deliveryInfo);break}return a.build()},_buildOrder(t,e={note:""}){const n=$D().expandItems(t),r=new WAe;return r.withOrderItems(n).withNoPrint(!this.toKitchen).withUuid(this.tableName).withUniqueId(crypto.randomUUID()).withAlias(this.tableName),r.build()},onClearCart(){ZF().clearCart()},quickAddItems(t,e){if(!e?.length||nB(t)===Bt.JOB)return;this.addTableRequest(t);const n=ZF(),r=ol(),s=r.subitems||[],i=l=>{if(l==null)return null;const h=s.find(p=>String(p?.Id)===String(l))?.Price;return typeof h=="number"?h:h!=null?Number(h):null},o=e.map(l=>({...l,quantity:1,price:i(l.subItemId)??l.price,toppings:(l.toppings||[]).map(d=>({...d})),comments:l.comments||"",dc1:void 0})),a=r.applyDefaultDiscount(o);for(const l of a)n.addItemToCart(l);const c={[Bt.TOGO]:"togo",[Bt.JOB]:"job",[Bt.DELIVERY]:"delivery",[Bt.TABLE]:"table"};UD().setTab("cart",c[this.mode]||"table")}}});function nB(t){if(t?.mode)return t.mode;switch(t?.type){case"delivery":return Bt.DELIVERY;case"togo":return Bt.TOGO;case"job":return Bt.JOB;default:return Bt.TABLE}}const YE=qn("table-instance",()=>{const t=Ae("A1"),e=Ae({}),n=Ae({}),r=Ae("all"),s=Ae(!1);ft(t,()=>{e.value={},n.value={},r.value="all",s.value=!1});const i=Z=>{e.value[Z.uuid]?delete e.value[Z.uuid]:e.value[Z.uuid]=Z},o=Z=>{e.value={[Z.uuid]:Z}},a=()=>{if(h.value.items?.every(de=>e.value[de.uuid]))e.value={};else for(const de of h.value.items||[])e.value[de.uuid]=de},c=()=>{e.value={}},l=()=>{t.value=""},d=$e(()=>Object.keys(e.value).length),h=$e(()=>tt().tables[t.value]||{items:[],__items:[],mode:1,name:t.value}),p=$e(()=>{const Z=h.value.items?.map(de=>de.bill);return Qe.uniq(Z).sort((de,fe)=>de-fe)}),g=$e(()=>p.value.length>1&&r.value!=="all"?Number(r.value):null),_=$e(()=>r.value=="all"?h.value.items:h.value.items?.filter(de=>de.bill==r.value));ft(_,Z=>{const de=new Set((Z||[]).map(ee=>ee.uuid)),fe=Object.keys(e.value).filter(ee=>!de.has(ee));fe.length!==0&&fe.forEach(ee=>delete e.value[ee])});const v=$e(()=>{const{tableBillingGlobal:Z,tablesState:de}=_r(),fe=ln(),ee=h.value?.mode===Bt.TOGO&&fe.togoNoService;return MD(_.value,Z,de[t.value],{noServiceCharge:ee})}),b=$e(()=>{const{tablesState:Z}=_r(),de=Z[t.value]||{};return{...h.value,guests:de.guests??h.value?.guests??0,setting:de}}),w=$e(()=>v.value),E=$e(()=>_r().isLockedWithTable(t.value)),T=$e(()=>_.value?.length||0),R=()=>{const Z=YE(),de=qr(),ee=bn().getStoreId,Te=tt().getShift(),pe=de.getCurrentEmployee?.name||"admin",Ce=Qe.cloneDeep(Z.data);Ce.items=Z.itemsDisplay,Ce.billing=Z.summaryBillingMoney,Ce.endDateTime=Ne().format("YYYY-MM-DDTHH:mm:ss"),Ce.guests=b.value?.guests??Ce.guests??0;const Ve=fp.fromTable(Ce,{orderId:"",shiftWork:Te,user:pe,payment:{list:[]},customerId:ee,printMode:"preview"}).toDynamodb();return Ve.SplitBillNo=g.value,Ve},N=()=>{if(h.value?.mode===Bt.JOB)return;if(!t.value){Or.fire({icon:"warning",title:"à¸à¸£à¸¸à¸à¸²à¹à¸¥à¸·à¸à¸à¹
152à¸à¹à¸°",text:"à¹à¸¡à¹à¹à¸à¹à¹à¸¥à¸·à¸à¸à¹à¸à¹à¸° à¸à¸£à¸¸à¸à¸²à¹à¸¥à¸·à¸à¸à¹à¸à¹à¸°à¸à¹à¸à¸à¹à¸à¸´à¹à¸¡à¹à¸¡à¸à¸¹",confirmButtonText:"OK"});return}const Z=tt();if(Z.isRunningOverClosedDay()){Z.showRunningOverClosedDayAlert();return}zE().addTableRequest(h.value);const fe={[Bt.TOGO]:"togo",[Bt.JOB]:"job",[Bt.DELIVERY]:"delivery",[Bt.TABLE]:"table"};UD().setTab("cart",fe[h.value?.mode]||"table")},O=Z=>{t.value=Z?.name||Z?.uuid||""},S=Z=>{if(!t.value)return;_r().setTableBillingSetting(t.value,{guests:Z})},I=async Z=>{const de=t.value,fe={};let ee=!1;Object.keys(e.value).length===0||Object.keys(e.value).length===h.value.items?.length?(h.value.items?.forEach(Ce=>{fe[Ce.uuid]=!0}),ee=!0):Object.keys(e.value).forEach(Ce=>{fe[Ce]=!0});const Te=ee,pe=G(pt.MOVE_TO,fe,{newAlias:Z,newUuid:Z,mode:1,isMoveAll:ee,isTableClosed:Te});if(await new Promise(Ce=>setTimeout(Ce,10)),G(pt.MOVE_RECEIVED,fe,{alias:Z,uuid:Z,mode:1,isMoveAll:ee,isTableClosed:Te,oldAlias:de,__items:pe.__items}),Te){const Ce=_r(),Ve=Ce.tablesState[de]||{},Y=Ce.tablesState[Z]||{},ve={};for(const Ee of Object.keys(Ve)){if(Ee==="lock")continue;Y[Ee]!==void 0&&Y[Ee]!==null||(ve[Ee]=Ve[Ee])}Object.keys(ve).length>0&&Ce.setTableBillingSetting(Z,ve),Ce.clearTableState(de)}},P=Ae(!1),k=(Z,de={})=>{if(!P.value){P.value=!0;try{const fe=t.value,ee=Object.values(e.value).reduce((Ce,Ve)=>(Ce[Ve.uuid]=(n.value[Ve.uuid]||0)*-1,Ce),{}),Te=h.value.items||[],pe=Te.length>0&&Te.every(Ce=>e.value[Ce.uuid]&&(n.value[Ce.uuid]||0)>=Ce.quantity);G(pt.VOID,ee,{__reason:Z||"",isTableClosed:pe,...de.printToKitchen===!1?{__noPrint:!0}:{}}),pe&&_r().clearTableState(fe)}finally{P.value=!1}}},L=(Z,de,fe={})=>{if(!P.value&&!(!de||de.length===0)){P.value=!0;try{const ee=de.reduce((pe,Ce)=>{const Ve=Number(Ce.qty)||0;return Ve<=0||(pe[Ce.uuid]=pe[Ce.uuid]||{},pe[Ce.uuid][String(Ce.toppingId)]=Ve*-1),pe},{});if(Object.keys(ee).length===0)return;const Te=de.filter(pe=>(Number(pe.qty)||0)>0).map(pe=>({name:pe.parentName?`${pe.parentName} (${pe.name||""})`:pe.name||"",quantity:Number(pe.qty)||0,price:Number(pe.price)||0,subItemId:pe.toppingId}));G(pt.VOID_TOPPING,ee,{__reason:Z||"",__items:Te,...fe.printToKitchen===!1?{__noPrint:!0}:{}})}finally{P.value=!1}}},M=(Z,de)=>{const fe=Object.keys(e.value).reduce((ee,Te)=>(ee[Te]=[Z,de],ee),{});G(pt.SET_DISCOUNT_ITEMS,fe,{discountRequest:{mode:Z,value:de}})},V=(Z,de,fe)=>{const ee={[Z.uuid]:[de,fe]};G(pt.SET_DISCOUNT_ITEMS,ee,{discountRequest:{mode:de,value:fe}})},z=(Z,de)=>{const fe={[Z.uuid]:parseFloat(de)};G(pt.SET_PRICE,fe,{__items:[Z]})},ie=(Z,de)=>{const fe={[Z.uuid]:de};G(pt.SPLIT,fe,{__items:[Z]})},K=(Z,de)=>{const fe={[Z.uuid]:de};G(pt.SET_COMMENTS,fe,{__items:[Z]})},ce=Z=>{G(pt.SET_DELIVERY_INFO,{},{deliveryInfo:Z,__items:[]})},G=(Z,de,fe)=>{const ee=qr(),Te=h.value?.mode||Bt.TABLE,pe=new ou().withEmployee(ee.getCurrentEmployee).withTableAlias(t.value).withTableUuid(t.value).withActionType(Z).withMode(Te).withJson2(de).withJobIdAndTimestamp(wi().nowISO());Te!==Bt.TABLE&&h.value?.nickName&&pe.withNickName(h.value.nickName),fe&&pe.withCustom(fe);const Ce=_.value.filter(ve=>e.value[ve.uuid]);Ce.length>0&&pe.withCustom({__items:Ce});const Ve=pe.build();return console.log(Ve),tt().add(Ve,!0),Ve};return{selectedTableId:t,clearTableSelected:l,itemsSelected:e,uuidQtyToVoid:n,forceShowSplitBillColumn:s,data:h,table:b,filteredBilling:w,isLock:E,selectItem:i,selectOnlyItem:o,selectAllItems:a,clearItemsSelected:c,setTable:O,setGuests:S,getCountItemSelected:d,itemCount:T,itemsDisplay:_,summaryBillingMoney:v,billList:p,billFilter:r,selectedSplitBillNo:g,addRequest:N,printPreview:R,move:I,voidItems:k,voidToppings:L,discountLines:M,setDiscountOneItem:V,setPrice:z,splitItem:ie,saveToJobchain:G,setItemComment:K,setDeliveryInfo:ce}});function rB(){const t=Xn().storeId;return t?mh(Uo.tableStates(String(t))):null}const _r=qn("table-state",()=>{const t=Ae(!1),e=Ae({}),n=Ae({sc:[0,0],vat:[0,0],roundingMode:"5/4"}),r=Ae(Ne().valueOf()),s=()=>{const b=Ze().tablesStateRef();Js(b,w=>{e.value[w.key]=w.val()||{}}),h6(b,w=>{e.value[w.key]=w.val()||{}}),f6(b,w=>
152{e.value[w.key]=null}),t.value=!0};window.TABLE_STATE=e;const i=Qe.debounce(()=>{if(!GE())return;const b=rB();b&&b.set("state",e.value)},300);async function o(){s(),ft(e,()=>i(),{deep:!0}),await KE(Ze().tablesStateRef()),t.value=!0}async function a(){const b=await VD(rB(),"state");b&&(e.value=b),t.value=!0,s(),ft(e,()=>i(),{deep:!0})}async function c(){return Zp()?a():o()}return{name:"tableStates",init:c,bootOnline:o,bootOffline:a,loaded:t,getTableState:b=>e.value[b],isLockedWithTable:b=>e.value[b]?.lock||!1,nonce:r,setLockTable:(b,w)=>{const E=Ze().tablesStateRef(),T=zt(E,`${b}/lock`);if(typeof w=="boolean")Ue(T,w);else{const R=e.value[b]?.lock||!1;Ue(T,!R)}},setPrintTime:(b,w)=>{const E=Ze().tablesStateRef(),T=zt(E,`${b}/printTime`);console.log("_dbRef=>",T),console.log("printTime=>",w),Ue(T,w)},setTableBillingSetting:(b,w)=>{const E=Ze().tablesStateRef();Object.entries(w).forEach(([T,R])=>{const N=zt(E,`${b}/${T}`);Ue(N,R)})},tablesState:e,tableBillingGlobal:n,clearTableState:(b,w=null)=>{const E=Ze().tablesStateRef(),T=zt(E,b);Ue(T,null)},clearAllTablesState:()=>{const b=Ze().tablesStateRef();Ue(b,null)}}}),m9="__jobchain:",g9=`${m9}cid-`,RC=t=>`${g9}${t}:`,URe=t=>t.startsWith(m9)&&!t.startsWith(g9);function sB(){const t=Xn().storeId;return t?mh(Uo.jobs(String(t))):null}const tt=qn("jobsV1",()=>{const t=Ae(!1),e=t9(),n=Ae({}),r=Ae({}),s=Ae(null),i=new Set,o=(ee,Te)=>{e9(sB(),i,ee,Te)};window.TABLES=r,window.JOBS=n;function a(){const ee=_r();ft([()=>ee.tablesState,()=>ee.tableBillingGlobal],()=>{w()},{deep:!0}),ft(()=>e.uuidItemToBillNumber,()=>{w()},{deep:!0}),E(),S()}async function c(){const{knownKeys:ee}=await KR(sB(),!1);ee.forEach(pe=>i.add(pe)),a();const Te=Ze().jobchainRef();await KE(Te),K(),t.value=!0}async function l(){}async function d(){return Zp()?l():c()}function h(ee,Te){let pe=Ze().jobchainRef(),Ce=ee.jobId.replaceAll(".","_");const Ve=zt(pe,Ce),Y=`${RC(String(Xn().storeId||""))}${Ce}`;T(Y,ee),n.value[Ce]=ee,Ue(Ve,ee).then(()=>{R(Y)})}let p=null,g=!0;function _(){g=!0,w()}function v(){const{tableBillingGlobal:ee,tablesState:Te}=_r(),pe=ol(),Ce=Y=>(pe.getPrintersByUuid(String(Y))||[]).some(ve=>String(ve).trim().toLowerCase()==="no-discount"),Ve=GR();return{tableBillingGlobal:ee,tablesState:Te,togoNoService:ln().togoNoService,noDiscountResolver:Ce,skipServiceResolver:Ve,uuidItemToBillNumber:e.uuidItemToBillNumber||{}}}function b(){t.value=!0;const ee=g||!p;ee&&(p=TAe(n.value),g=!1),console.log(`computeJobchain [${ee?"full replay":"billing only"}] : `+Ne().toISOString()),r.value=EAe(p,v())}const w=Qe.debounce(b,200);function E(){let ee=Ze().jobchainRef();Js(ee,Te=>{n.value[Te.key]=Te.val(),Te.key&&o(Te.key,Te.val()),_()})}function T(ee,Te){window.localStorage.setItem(ee,JSON.stringify(Te))}function R(ee,Te){window.localStorage.removeItem(ee)}function N(){const ee=[],Te=Xn().storeId;if(!Te)return ee;const pe=RC(String(Te));for(let Ce=0;Ce<window.localStorage.length;Ce++){const Ve=window.localStorage.key(Ce);if(!Ve||!Ve.startsWith(pe))continue;const Y=window.localStorage.getItem(Ve);if(Y)try{ee.push({key:Ve,nodeKey:Ve.slice(pe.length),job:JSON.parse(Y)})}catch(ve){console.error("Failed to parse pending job from local storage:",ve)}}return ee}function O(){if(bn().runMode!=="terminal")return;const ee=Xn().storeId;if(!ee)return;const Te=`nl:terminal:pendingJobsPurged:v1:${ee}`;try{if(window.localStorage.getItem(Te))return;const pe=RC(String(ee)),Ce=[];for(let Ve=0;Ve<window.localStorage.length;Ve++){const Y=window.localStorage.key(Ve);Y&&(Y.startsWith(pe)||URe(Y))&&Ce.push(Y)}for(const Ve of Ce)window.localStorage.removeItem(Ve);window.localStorage.setItem(Te,new Date().toISOString()),Ce.length&&console.warn(`[jobs] terminal: discarded ${Ce.length} stale pending jobchain write(s)`)}catch(pe){console.warn("[jobs] terminal pending-job purge failed",pe)}}async function S(){console.log("dispatch - restoreOffline started"),O();const ee=N();if(!ee.length)return[];const Te=Ze().jobchainRef();for(const pe of ee)n.value[pe.nodeKey]=pe.job;return _(),K(),await Promise.all(ee.map(async({key:pe,nodeKey:Ce,job:Ve})=>{try{const Y=zt(Te,Ce);await Ue(Y,Ve),R(pe,null)}catch(Y){console.error("Failed to restore offline job:",Ce,Y)}})),ee}async function I(){return await S(),N()}const P=()=>Object.values(n.value),k=(ee,Te="YYYY-MM-DD")=>{const pe=ee?Ne(ee):Ne();return(ln().getSystemEnvByName("BusinessMode")?.Value||"0")==1?pe.add(-7,"hour").format(Te):pe.format(Te)}
152,L=()=>P().filter(ee=>ee?.type===pt.OPEN_SHOP).sort((ee,Te)=>Ne(Te.timestamp).diff(Ne(ee.timestamp)))[0]||null,M=ee=>ee?ee.businessDate||k(ee.timestamp):null,V=()=>{const ee=L();if(!ee?.timestamp)return!1;const Te=M(ee),pe=k();return Ne(pe).isAfter(Ne(Te),"day")},z=ee=>{const Te=Math.max(0,Ne().diff(Ne(ee),"minute")),pe=Math.floor(Te/1440),Ce=Math.floor(Te%1440/60),Ve=Te%60,Y=[];return pe&&Y.push(`${pe}d`),Ce&&Y.push(`${Ce}h`),(Ve||Y.length===0)&&Y.push(`${Ve}m`),`${Y.join(" ")} ago`},ie=()=>{const ee=L(),Te=ee?.timestamp?Ne(ee.timestamp).format("D MMM YYYY HH:mm"):null,pe=ee?.timestamp?z(ee.timestamp):null,Ce=ee?.timestamp?M(ee):null,Ve=ce(),Y=pe?` <span style="color:#888;">(${pe})</span>`:"",ve=Te?`<div style="margin-top:12px;line-height:1.7;font-size:14px;"> 153 <div>ð¢ à¹à¸à¸´à¸à¸£à¹à¸²à¸à¹à¸¡à¸·à¹à¸: <b>${Te} à¸.</b>${Y}</div> 154 <div>ð รà¸à¸ business date à¸à¸µà¹à¹à¸à¸´à¸: <b>${Ce}</b></div> 155 <div>ð business date วัà¸à¸à¸µà¹: <b>${Ve}</b></div> 156 </div>`:"";return Or.fire({icon:"warning",title:"รà¸à¸à¹à¸à¸´à¸à¸£à¹à¸²à¸à¸à¸à¸¥à¸°à¸§à¸±à¸ / Shop running over closed day",html:`à¸à¸£à¸§à¸à¸à¸à¸§à¹à¸²à¸£à¸à¸à¹à¸à¸´à¸à¸£à¹à¸²à¸à¸à¸±à¸à¸à¸¸à¸à¸±à¸à¹à¸¡à¹à¸à¸£à¸à¸à¸±à¸ business date à¸à¸à¸à¸§à¸±à¸à¸à¸µà¹ à¸à¸£à¸¸à¸à¸²à¸à¸´à¸à¸£à¹à¸²à¸à¸à¹à¸à¸à¹à¸¥à¹à¸§à¹à¸à¸´à¸à¸£à¹à¸²à¸à¹à¸«à¸¡à¹${ve}`,confirmButtonText:"OK",allowOutsideClick:!1,allowEscapeKey:!1})};function K(){if(s.value)return;const ee=P();if(ee.length===0){s.value=Ne().toISOString();return}ee.sort((pe,Ce)=>Ne(pe.timestamp).diff(Ne(Ce.timestamp)));const Te=L();s.value=Te?Te.timestamp:ee[0].timestamp}const ce=(ee="YYYY-MM-DD")=>k(void 0,ee),G=()=>{const ee=P();return ee.length===0?null:(ee.sort((Te,pe)=>Ne(Te.timestamp).diff(Ne(pe.timestamp))),ee[0])},Z=()=>{const ee=P();return ee.length===0?null:ee.reduce((pe,Ce)=>pe?Ce.timestamp>pe.timestamp?Ce:pe:Ce,null)?.timestamp||null},de=()=>1+P().filter(ee=>ee?.type===pt.CHANGE_SHIFT).length;return{name:"jobs",init:d,bootOnline:c,bootOffline:l,tables:r,jobs:n,add:h,loaded:t,getBusinessDate:ce,getBusinessDateFromTimestamp:k,getLastUpdate:Z,getShift:()=>`Shift ${de()}`,getShiftNumber:de,resolveBusinessDate:K,getFirstJob:G,getJobsArray:P,getLatestOpenShopJob:L,isRunningOverClosedDay:V,showRunningOverClosedDayAlert:ie,restoreOffline:S,getPendingJobs:N,syncPendingJobs:I}}),JE=(t,e)=>{if(t.isInited.value){e();return}const n=ft(()=>t.isInited.value,r=>{r&&(n(),e())})},HD="activity-dynamodb",HRe=t=>{try{const e=`${HD}:${t.Nonce||Date.now()}`;localStorage.setItem(e,JSON.stringify(t))}catch(e){console.error("Failed to save activity to local storage:",e)}},_9=t=>{try{const e=`${HD}:${t.Nonce}`;localStorage.removeItem(e)}catch(e){console.error("Failed to remove activity from local storage:",e)}},y9=()=>{try{const t=[];for(let e=0;e<localStorage.length;e++){const n=localStorage.key(e);if(n&&n.startsWith(HD)){const r=localStorage.getItem(n);r&&t.push(JSON.parse(r))}}return t}catch(t){return console.error("Failed to get pending activities from local storage:",t),[]}},qRe=async(t,e,n,r)=>{const s=new dAe().fromJobCard(t,n,r);Object.keys(s).forEach(i=>{s[i]===void 0&&delete s[i]}),HRe(s);try{await e.activities.postWithKey(s.customerId,s),_9(s)}catch(i){console.error("Failed to post activity to API, kept in local storage:",i)}},ZS=async t=>{const e=y9();if(!e.length)return;const n=25,r=[];for(let s=0;s<e.length;s+=n)r.push(e.slice(s,s+n));for(const s of r)try{await Promise.all(s.map(async i=>{await t.activities.postWithKey(i.customerId,i),_9(i)}))}catch(i){console.error("Failed to sync pending activities batch:",i)}},jRe=At(({$pinia:t})=>{const e=tt(),n=Ot(),r=n.customerId;JE(n,()=>{ZS(n)}),window.addEventListener("online",()=>{n.isInited.value&&ZS(n)}),e.$onAction(s=>{if(s.name=="add"){const i=s.args[0];s.args[1]&&s.after(()=>{const a=e.getBusinessDate();qRe(i,n,r.value,a)})}})}),WRe=(()=>{if(typeof window>"u")return!1;try{return window.localStorage.getItem("niceloop_chrome_extension_installed")==="true"}catch{return!1}})();class Ii{apiUrl="http://localhost:9000/api/command";path="/";print_data=null;constructor(e){this.path=e||"/"}getPrintersThatUsed(e){const n=[];return e.forEach(r=>{n.push(r.printer)}),Qe.compact(n)}onSendRequest(){let e=this.apiUrl+this.path,n={method:"post",maxBodyLength:1/0,url:e,headers:{"Content-Type":"application/json"}};const r=this.print_data?JSON.stringify(this.print_data):"";if(this.print_data&&(n.data=r),WRe&&typeof window<"u"){window.postMessage({type:"NICELOOP_APP_PRINTER",text:"Hello from the webpage!",payload:{data:r,url:e}},"*");return}Fn.request(n).then(s=>{console.log(JSON.stringify(s.data))}).catch(s=>{console.log(s)})}openDrawer(){this.onSendRequest()}print(){this.onSendRequest()}}const GRe=" ";function KRe(t){return Array.isArray(t?.toppings)?t.toppings.reduce((e,n)=>e+(Number(n?.price)||0)*(Number(n?.quantity)||0),0):0}function zRe(t){const e=(Number(t?.price)||0)+KRe(t),n=t?.discountrequest||t?.discountRequest||{},r=xD(e,1,Number(n.mode)||0,Number(n.value)||0);return lt(e-r)}function YRe(t,e){const n=Mo(zRe(e),2,!0);return`${t}${GRe}@${n}`}const JRe="http://localhost:9000/api",v9=320,QRe=335,ro={value:0,loaded:!1,inflight:null};function XRe(t){const e=String(t??"").replace(/"/g,"").trim();if(!e)return 0;if(!e.includes("."))return parseInt(e,10)||0;const[n=0,r=0,s=0]=e.split(".").map(i=>parseInt(i,10)||0);return n*100+Math.min(r,9)*10+Math.min(s,9)}function ZRe(){return ro.loaded?Promise.resolve():(ro.inflight||(ro.inflight=(async()=>{try{const t=await Fn.get(`${JRe}/setting/AppVersion`,{timeout:3e3}
156),e=typeof t.data=="string"?t.data:String(t.data);ro.value=XRe(e)}catch{ro.value=0}finally{ro.loaded=!0,ro.inflight=null}})()),ro.inflight)}function Gg(){return ro.value>=v9}function ePe(){return ro.value}function tPe(){return ro.value>=QRe}class b9{productsStore=null;constructor(e){this.productsStore=e}getPrinterByUuid(e){const n=this.productsStore.getPrintersByUuid(e)||{};let r=[];for(const s of n)r.push(s);return r.length===0?[]:r}sumTopping(e){return e?.toppings?e.toppings.reduce((n,r)=>n+r.price*r.quantity,0):0}sumToppingForReceipt(e){return e?.Toppings?e.Toppings.reduce((n,r)=>n+r.rice*r.Quantity,0):0}joinToppingText=e=>s9(e);joinToppingTextForReceipt=e=>e.map(n=>n.Name).join(", ");joinToppingTextNewLine(e){return e?e.map((n,r)=>` ${n.name} `).join(` 157`):""}getBillArrValue(e,n){return e?.[n]||0}transformToppings(e){return e?e.map((n,r)=>(n.price-n.discount,n.discountedPrice*n.quantity,{toppingId:n.toppingId,name:n.name,price:n.price,discount:n.discount,discountedPrice:n.discountedPrice,quantity:n.quantity,extendedPrice:n.extendedPrice})):[]}getValueWithMode(e,{showSymbol:n,showBahtValue:r=!0,showPercentValue:s=!0}={showSymbol:!1}){if(!e||e.length<2)return"";const[i,o]=e,a=Math.abs(o);return i===0&&s?n?`${a}%`:a.toString():r?n?`${a}฿`:a.toString():""}getValueWithModeDiscount(e,{showSymbol:n,showBahtValue:r=!0,showPercentValue:s=!0}={showSymbol:!1}){const{mode:i,value:o}=e,a=Math.abs(o);return i===0&&s?n?`${a}%`:a.toString():r?n?`${a}฿`:a.toString():""}adapterToppings=e=>e.map(n=>({toppingId:n.toppingId,name:n.name,price:n.price,discount:n.discount,discountedPrice:n.discountedPrice,quantity:n.quantity,extendedPrice:n.extendedPrice}));adapterToppingsForReceipt=e=>e.map(n=>({toppingId:n.toppingId,name:n.name,price:n.price,discount:0,discountedPrice:0,quantity:n.quantity,extendedPrice:n.extendedPrice}));transfromMoveOrderItems(e,n,r){return e.map((s,i)=>{const o=this.getPrinterByUuid(s.subItemId);return{...s,comments:`(ยà¹à¸²à¸¢ ${n} ==> ${r})`,tags:o}})}getPrintersListFromItems(e){return e.map(n=>this.getPrinterByUuid(n.subItemId))}buildOrderItems(e,n={}){const r=tPe(),s=n.showPrice===!0,i=[...new Set(e.filter(o=>!jR(o)).flatMap(o=>this.getPrinterByUuid(o.subitemid||o.subItemId)||[]))];return e.map(o=>{if(jR(o))return{...o,name:fAe,quantity:1,price:0,extendedPrice:0,discount:0,discountText:"",discountRequest:{mode:0,value:0},sumToppings:0,toppings:[],toppingList:"",toPrinter:99,bill:o.bill||1,tagList:i,tags:i,check:!1,by:"",isOpenMenu:!1,listOrderTaker:[],qtyToVoid:0,noDiscount:!0,forceNewLine:!0,majorSet:0,minorSet:0};const a=o.subitemid||o.subItemId,c=this.getPrinterByUuid(a),l=o.discountrequest||{mode:0,value:0},d=Math.abs(l[2])||0,h=o.discountrequest?.mode||0,p=o.discountrequest?.value||0,g=this.getValueWithModeDiscount(l,{showSymbol:!0,showBahtValue:!1,showPercentValue:!0}),_=h===1?`ลภ-${Number(p).toFixed(2)} X ${o.quantity||0}`:`ลภ${g}`,v=r?$Ae(o):void 0,b=s?YRe(o.name||"",o):void 0;return{...o,...b!==void 0?{name:b}:{},...v?{Custom:v}:{},comments:r?"":o.comments||"",discount:d,discountText:_,discountRequest:{mode:h,value:p},extendedPrice:o.price||0,sumToppings:this.sumTopping(o),toppings:this.adapterToppings(o?.toppings||[]),toppingList:r?"":this.joinToppingText(o?.toppings||[]),toPrinter:99,bill:1,tagList:c||[],check:!1,by:"",isOpenMenu:!1,listOrderTaker:[],qtyToVoid:o.quantity,noDiscount:!1,forceNewLine:!1,majorSet:0,minorSet:0,tags:c}})}displayItemDiscountText(e=0,n=0,r=0){return e==0?`ลภ${n}%`:`ลà¸-${n} x ${r}`}}const w9=t=>{if(!t)return!1;if(typeof t=="string")try{return JSON.parse(t),!0}catch{return!1}return!0},nPe=(t,e)=>{const n=[],r=[],s={CustomHeaders:n,CustomFooters:r};if(e?.isCopy){const o={name:"PrintComment",value:e?.isPrintAll?"**** COPY RECEIPT (PRINT ALL) ****":"**** COPY RECEIPT ****"};n.push(o),r.push(o)}if(w9(t?.PaymentType)){const i=JSON.parse(t.PaymentType);r.push({name:"PrintTextLine",value:"Payment Detail "},...i.map(o=>({name:"PrintTextLine",value:` ${o.name} : ${o.amount}`})),{name:"LineFeed",value:!0}),s.PaymentType="Multiple Payment"}return s},rPe=(t,e=new Date().valueOf())=>{const n=e.toString();return{TempId:`${n}_${t?.OrderId}`,UniqueId:`${n}_${t?.UniqueId}`,Uuid:`${n}_${t?.UniqueId}`}},sPe=t=>({TempId:`${t.TempId}_C`,UniqueId:`${t.UniqueId}_C`,Uuid:`${t.Uuid}_C`}),iB=t=>`Table ${t?.SplitBillNo?`${t.Table}-${t.SplitBillNo}`:t?.Table}`,iPe=t=>{if(typeof t?.OrderId!="number")return;const e=t.OrderId.toString();return`${e.slice(0,6)}-${e.slice(6)}`},oPe=t=>{if(t?.DateString)return t.DateString;if(!t?.Date)return"";const e=Ne(t.Date);return e.isValid()?e.format("DD/MM/YYYY HH:mm:ss"):""},S9=t=>{if(t?.VatText)return t.VatText;const e=String(t?.VatMode??""),n=t?.VatValue;return n?e==="1"?`${n}% (Included)`:e==="2"?`${n}% (Excluded)`:"":""},aPe=t=>{if(t?.DiscountText)return t.DiscountText;const e=Number(t?.DiscountRequest?.mode??0),n=Number(t?.DiscountRequest?.value??0);return n>0?e===2?`*-${n}%*`:`Discount ${n}%`:""},qD=(t=0,e=0)=>e==0?"":t==0?`ลภ${e}%`:t==2?`*ลภ${e}%*`:"",T9=(t,e,n)=>{const r=e.isPreview||!1;let s=rPe(t,n);e?.isCopy&&(s=sPe(s));const i={...t,...s,Reference:iB(t),FullAlias:iB(t),DateString:oPe(t),Cashier:t?.User,EnableHeaderItems:!0,isPreview:!1};if(r)i.isPreview=!0,i.IsPreview=!0,delete i.PaymentType;else{const a=iPe(t);a!==void 0&&(i.ReceiptId=a)}
157e.enableCustomerCount===!1?delete i.CustomerCount:i.CustomerCount!=null&&(i.CustomerCount=String(i.CustomerCount));const o=nPe(i,e);return i.CustomHeaders=o.CustomHeaders,i.CustomFooters=o.CustomFooters,o.PaymentType!==void 0&&(i.PaymentType=o.PaymentType),i},cPe=(t,e)=>{const n=O=>Mo(O||0,2,!0),r=O=>Number(O)||0,s=Array.isArray(t?.OrderItems)?t.OrderItems:[],i=[],o=s.reduce((O,S)=>O+(S?.quantity||0),0);i.push({name:`${o} Items`,value:""});const a=Math.abs(r(t?.ItemDiscount)),c=r(t?.SubTotal),l=r(t?.Discount),d=r(t?.ServiceCharge),h=r(t?.CardCharge),p=r(t?.Vat),g=r(t?.Rounding),_=r(t?.GrandTotal),v=aPe(t),b=S9(t),w=[];if(a>0&&w.push({name:"Item Discount",value:`-${n(a)}`}),l>0){const O=v?`Discount ${v}`:"Discount";w.push({name:O,value:`-${n(l)}`})}if(d!==0){const O=t?.ServiceChargeText?`Service Charge ${t.ServiceChargeText}`:"Service Charge";w.push({name:O,value:n(d)})}if(h!==0){const O=t?.CardChargeText?`Card Charge ${t.CardChargeText}`:"Card Charge";w.push({name:O,value:n(h)})}if(p!==0||b){const O=b?`VAT ${b}`:"VAT";
157w.push({name:O,value:n(p)})}g!==0&&w.push({name:"Rounding",value:n(g)}),Math.round(c*100)===Math.round(_*100)&&w.length===0||i.push({name:"Total",value:n(c)}),i.push(...w);const T={Rows:i,Underline:!0,DoubleUnderline:!1,Bold:!1},R={Rows:[{name:"Grand Total",value:n(_)}],Underline:!1,DoubleUnderline:!0,Bold:!0};let N=null;return e==="payment"&&(N={Rows:[{name:"Received",value:n(r(t?.Received))},{name:"Change",value:n(r(t?.Change))}],Underline:!1,DoubleUnderline:!1,Bold:!1}),t?.Note&&(N?.Rows.push({name:" ",value:" "}),t?.Room&&N?.Rows.push({name:`Room : ${t.Room}`,value:" "}),N?.Rows.push({name:`Note : ${t.Note}`,value:" "})),{Summary1:T,Summary2:R,Summary3:N,Summary4:null}},lPe={key:"v3",usesSummarySections:!0,build(t,e){const n=T9(t,e),r=cPe(t,e.printMode||"payment");return Object.assign(n,r),n.DiscountText=qD(t?.DiscountRequest?.mode,t?.DiscountRequest?.value),n}},uPe={key:"legacy",usesSummarySections:!1,build(t,e){const n=T9(t,e);return n.VatText=S9(t),n.DiscountText=qD(t?.DiscountRequest?.mode,t?.DiscountRequest?.value),n.Rounding=0,delete n.Summary1,delete n.Summary2,delete n.Summary3,delete n.Summary4,n}},eT={v3:lPe,legacy:uPe},dPe=t=>(Number(t)||0)>=v9?eT.v3:eT.legacy,hPe=t=>eT[t]||eT.legacy;class fPe extends b9{receipt=null;constructor(e){super();const n=bn();this.receipt={...e,ShopId:n.getStoreId}}build(e={}){return(e.isPrinterInterfaceV3===void 0?dPe(ePe()):hPe(e.isPrinterInterfaceV3?"v3":"legacy")).build(this.receipt,{isPreview:e.isPreview,isCopy:e.isCopy,isPrintAll:e.isPrintAll,enableCustomerCount:e.enableCustomerCount,printMode:e.printMode})}checkMultiplePayment(e){return w9(e)}displayPaymentTypes(e){if(!e)return"";if(typeof e=="string")try{e=JSON.parse(e)}catch{return e}return Array.isArray(e)?e.map(n=>`${n.name||n.type}: ${n.amount}`).join(", "):""}displayDiscountBillText(e=0,n=0){return qD(e,n)}}class JR extends Ii{printReceipt(e,n={}){const r=this.withPayload(e,n);return console.log("print receipt=>",r),this.print_data=r,this}withPayload(e,n={}){return new fPe(e).build({isCopy:e.isCopy||!1,...n})}setPayload(e){return this.print_data=e,this}}const E9=qn("receiptIdCounter",()=>{const t=Ae(0),e=Ae(Ne().format("YYYYMM")),n=Ae(!1),r=()=>Xn().storeId??"",s=()=>typeof navigator>"u"||navigator.onLine!==!1,i=()=>`receiptsCounter:${r()}:${e.value}`,o=()=>`counter-increment:${r()}:`,a=()=>`counter-increment-parked:${r()}:`,c=20,l=()=>{try{const S=parseInt(localStorage.getItem(i())??"",10);return Number.isFinite(S)?S:0}catch{return 0}},d=S=>{t.value=Math.max(t.value,l(),S);try{localStorage.setItem(i(),String(t.value))}catch{}},h=S=>{const I=Math.max(t.value,l())+1;t.value=I;try{localStorage.setItem(i(),String(I));const P={nonce:S,month:e.value,claimed:I,createdAt:Date.now()};localStorage.setItem(`${o()}${S}`,JSON.stringify(P))}catch(P){console.error("Failed to persist receipt counter claim:",P)}return b(),I},p=()=>{const S=[];try{for(const I of Object.keys(localStorage)){const P=I.startsWith(o()),k=I.startsWith("counter-increment:")&&I.split(":").length===2;if(!P&&!k)continue;const L=localStorage.getItem(I);L&&S.push({cmd:JSON.parse(L),key:I})}}catch(I){console.error("Failed to read counter queue:",I)}return S.sort((I,P)=>I.cmd.createdAt-P.cmd.createdAt)},g=2160*60*60*1e3,_=async S=>{const I=rr(),P=I.getReceiptCounterDocRef(S.month),k=I.getReceiptCounterNonceDocRef(S.month,S.nonce),L=an.fromMillis(Date.now()+g);await eme(Cn,async M=>{if((await M.get(k)).exists())return;const V=Number((await M.get(P)).data()?.value)||0;M.set(P,{value:Math.max(V+1,Number(S.claimed)||0)},{merge:!0}),M.set(k,{createdAt:S.createdAt,expireAt:L})})};let v=!1;const b=async()=>{if(!(v||!s()||!r())){v=!0;try{for(const{cmd:S,key:I}of p())try{await _(S),localStorage.removeItem(I)}catch(P){console.error("Failed to flush counter increment:",S.nonce,P);try{const k=(S.failCount||0)+1;k>=c?(localStorage.setItem(`${a()}${S.nonce}`,JSON.stringify({...S,failCount:k})),localStorage.removeItem(I),console.error(`Counter increment ${S.nonce} parked after ${k} failed flushes`)):localStorage.setItem(I,JSON.stringify({...S,failCount:k}))}catch{}}}finally{v=!1}}},w=S=>{d(S)},E=()=>{const S=e.value;
157xo(rr().getReceiptCounterDocRef(S),I=>w(Number(I.data()?.value)||0)),xa(zt(Ze().lastReceiptIdRef(),S),I=>{w(Number(I.val())||0)})},T=()=>{window.addEventListener("storage",S=>{if(S.key!==i())return;const I=parseInt(S.newValue??"",10);Number.isFinite(I)&&I>t.value&&(t.value=I)})},R=async()=>{if(l()>0||!s())return;const S=e.value,I=mu(rr().getReceiptCounterDocRef(S)).then(k=>Number(k.data()?.value)||0).catch(()=>0),P=X_e(zt(Ze().lastReceiptIdRef(),S)).then(k=>Number(k.val())||0).catch(()=>0);await Promise.race([Promise.all([I,P]).then(([k,L])=>d(Math.max(k,L))),new Promise(k=>setTimeout(k,5e3))])};let N=!1;return{name:"receiptIdCounter",loaded:n,receiptsCounter:t,counterYYYYMM:e,boot:async()=>{N||(N=!0,r(),e.value=tt().getBusinessDate().substring(0,7).replace("-",""),d(0),await R(),n.value=!0,E(),T())},getNextReceiptIdAndIncrement:h,flushCounterIncrements:b}});function pPe(t={}){const e=t||{},n=Number(e.subTotal)||0,r=Array.isArray(e.sc)&&Number(e.sc[2])||0;return lt(n+r)}const Fb=.1,no="Cash",oB="nl-payment-copy-receipt",jD=qn("posPayment",()=>{const t=YE(),e=qr(),n=bn(),r=Mi(),s=E9(),i=Ae(!1),o=Ae("A1"),a=Ae(""),c=Ae(!1),l=Ae(!1),d=$e(()=>{const De=Ot().paymentType.data.value||[];let We=Qe.orderBy(De.map(Rt=>Ce(Rt)),["row"],["asc"]);return We.unshift({isCreditCard:!1,uuid:"Cash",row:0,onTheHouse:!1,name:"Cash",type:"Cash"}),FD()<800&&We.push({isCreditCard:!0,uuid:"Credit Card",row:9999,onTheHouse:!1,name:"Credit Card",type:"Credit Card"}),We}),h=$e(()=>d.value.filter(De=>!De.onTheHouse)),p=Ae(""),g=Ae(""),_=Ae(0),v=Ae(0),b=Ae(null),w=Ae(0),E=Ae(!1),T=Ae("idle"),R=Ae(0),N=Ae(!1),O=Ae([]),S=Ae({show:!1,amountChange:0,table:""});let I=null,P=null,k=null;const L=$e(()=>b.value?b.value.onTheHouse?pe(w.value)===0:!(w.value<0||w.value<v.value):!1),M=$e(()=>pe(O.value.reduce((De,We)=>De+(We.amountInput||0),0))),V=$e(()=>pe(Math.max(0,v.value-M.value))),z=$e(()=>pe(Math.max(0,M.value-v.value))),ie=$e(()=>pe(O.value.filter(De=>De.type===no).reduce((De,We)=>De+(We.amountInput||0),0))),K=$e(()=>pe(O.value.filter(De=>De.type!==no).reduce((De,We)=>De+(We.amountInput||0),0))),ce=$e(()=>K.value-v.value>Fb),G=$e(()=>M.value-v.value>=-Fb),Z=$e(()=>M.value-v.value>Fb),de=$e(()=>Math.abs(M.value-v.value)<=Fb),fe=$e(()=>O.value.filter(De=>De.type===no).length>1),ee=$e(()=>vt()!==null),Te=$e(()=>O.value.length===0||v.value<=0||O.value.some(We=>!We.type||We.amountInput<=0)||fe.value||ce.value?!1:G.value);function pe(De){return Math.round((De+Number.EPSILON)*100)/100}function Ce(De){const We=`${De.uuid||De.type||De.name||"payment"}`;return{isCreditCard:!!De.isCreditCard,uuid:We,row:Number(De.row||0),onTheHouse:!!De.onTheHouse,name:De.name||We,cardCharge:Number(De.cardCharge||0),customerId:`${De.customerId||""}`,type:We}}function Ve(De,We=0){return{id:`${Date.now()}-${Math.random().toString(36).slice(2,8)}`,type:De||d.value[0]?.uuid||"Cash",amountInput:pe(Math.max(0,We))}}function Y(){return pe(Math.max(0,_.value))}function ve(){v.value=b.value?.onTheHouse?0:Y(),R.value=Math.max(0,w.value-v.value)}function Ee(De){const We=b.value?.name||De.list[0]?.name||"Cash",Rt=b.value?.uuid||De.list[0]?.paymentId||We,Ir=Y();return{...De,isOnTheHouse:!0,list:[{...De.list[0],amount:0,amountInput:0,entertainAmount:Ir,entertainMode:We,isEntertain:!0,name:We,paymentId:Rt}]}}function Me(De){const We=Qe.cloneDeep(De.billing||{}),Rt=Array.isArray(We.vat)?[...We.vat]:[0,0,0];Rt[2]=0;const Ir=pPe(We);De.billing={...We,dc2:[0,100,Ir],cc:[0,0,0],vat:Rt,rounding:0,roundingMode:"none",grandTotal:0}}function Ke(De){_.value=pe(Math.max(0,De)),ve(),N.value&&O.value.length===0&&Ye()}function ut(De){b.value=De,T.value="idle",N.value||ve()}function H(De){w.value=De,R.value=Math.max(0,De-v.value)}function j(){return l.value||T.value==="complete"||!L.value?!1:(T.value="confirm",!0)}function re(){if(T.value!=="confirm"||l.value)return!1;l.value=!0,T.value="complete";const De=B("single");setTimeout(()=>{t.billFilter="all",Tr(),So(),l.value=!1},150),c.value&&_r().clearTableState(a.value);const We=t.data?.nickName||t.data?.alias||t.data?.name||o.value||"";return Er(R.value,We),De}function Re(){if(T.value!=="confirm"||!Te.value||l.value)return!1;l.value=!0,T.value="complete";const De=B("multiple");setTimeout(()=>{t.billFilter="all",Tr(),So(),l.value=!1},150),c.value&&_r().clearTableState(o.value);const We=t.data?.nickName||t.data?.alias||t.data?.name||o.value||"";return Er(z.value,We),De}function ge(){return l.value||T.value==="complete"||!Te.value?!1:(T.value="confirm",!0)}function B(De="single"){const We=q(De),Rt=De==="single"&&!!b.value?.onTheHouse,Ir=n.getStoreId,pn=tt().getShift(),Ci=e.getCurrentEmployee?.name||"admin",Xo=Rt?Ee(We):We,er=Qe.cloneDeep(t.data);er.items=t.itemsDisplay,er.billing=Qe.cloneDeep(t.summaryBillingMoney),er.endDateTime=Ne().format("YYYY-MM-DDTHH:mm:ss"),er.guests=t.table?.guests??er.guests??0,Rt&&Me(er);const ps=tt(),Vs=ps.getBusinessDateFromTimestamp(er.endDateTime),Zo=Math.random().toString(36).substring(2,15),Ka=s.getNextReceiptIdAndIncrement(Zo),tm=`${Vs.substring(0,7).replace("-","")}-${Oy.padStart(Ka.toString(),4,"0")}`,Wi=parseInt(tm.replace("-","")),cl=fp.fromTable(er,{orderId:Wi,shiftWork:pn,user:Ci,payment:Xo,customerId:Ir,printMode:"payment"});cl.BusinessDate=Vs,cl.Nonce=Zo;const ea=cl.toDynamodb();ea.SplitBillNo=t.selectedSplitBillNo,console.log("receiptOrder=>",ea);const xu=be(ea,Xo);return ps.add(xu,!0),r.add(ea),ea}function q(De="single"){return De==="multiple"?se():J()}function J(){const De=b.value,We=De?.name||d.value[0]?.name||"Cash",Rt=!!De?.onTheHouse,Ir=Y();return{list:[{amount:Rt?0:v.value,amountInput:Rt?0:w.value,entertainAmount:Rt?Ir:0,entertainMode:Rt?We:null,isEntertain:Rt,name:We,paymentId:De?.uuid||We}],note:p.value||"",room:g.value||"",isOnTheHouse:Rt}}function se(){const De=v.value,We=pe(O.value.filter(pn=>pn.amountInput>0&&pn.type!==no).reduce((pn,Ci)=>pn+Ci.amountInput,0)),Rt=pe(Math.max(0,De-We)),Ir=O.value.filter(pn=>pn.amountInput>0).map(pn=>{const Ci=d.value.find(Zo=>Zo.uuid===pn.type),er=pn.type===no?Rt:pe(pn.amountInput),ps=!!Ci?.onTheHouse,Vs=Ci?.name||pn.type;return{amount:er,amountInput:pe(pn.amountInput),entertainAmount:ps?er:0,entertainMode:ps?Vs:null,isEntertain:ps,name:Vs,paymentId:Ci?.uuid||pn.type}});return{list:Ir,note:p.value||"",room:g.value||"",isOnTheHouse:Ir.some(pn=>pn.isEntertain)}}function be(De,We){let Rt=t.itemsDisplay;const pn=qr()?.getCurrentEmployee,Ci=Rt.reduce((ps,Vs)=>(ps[Vs.uuid]=Vs.quantity*-1,ps),{});let Xo=We.list[0].name;We.list.length>1&&(console.log("Multiple payment detected",We),Xo=We.list.map(ps=>`${ps.name} ${ps.amount}`).join(", "));const er=Rt.length===t.data?.items?.length;return c.value=er,new ou().withActionType(pt.PAY).withTableAlias(t.selectedTableId).withTableUuid(t.selectedTableId).withEmployee(pn).withMode(1).withIsClosingTable(er).withJson2(Ci).withJobIdAndTimestamp(wi().nowISO()).withCustom({grandTotal:De.GrandTotal,paymentType:Xo,nickName:t.data?.nickName||null,isTableClosed:er,receiptNonce:De.Nonce||De.Ref1||"",__items:Rt}).build()}
157function xe(){try{return localStorage.getItem(oB)==="true"}catch{return!1}}function X(){E.value=xe()}function le(De){E.value=!!De;try{localStorage.setItem(oB,String(!!De))}catch{}}function je(){T.value="idle",w.value=0,E.value=!1,R.value=0,b.value=d.value[0]||null,_.value=0,v.value=0,p.value="",g.value="",i.value=!1,N.value=!1,l.value=!1,Ye()}function Ye(){const De=h.value[0]?.uuid||"Cash",We=h.value[1]?.uuid||De;O.value=[Ve(De),Ve(We)]}function vt(){const De=h.value.find(Rt=>Rt.uuid!==no);return De?De.uuid:O.value.some(Rt=>Rt.type===no)?null:no}function oe(){const De=vt();return De?(O.value.push(Ve(De)),!0):!1}function ye(De){O.value.length<=1||(O.value=O.value.filter(We=>We.id!==De))}function Fe(De,We){if(We===no&&O.value.some(pn=>pn.id!==De&&pn.type===no))return!1;const Rt=O.value.find(Ir=>Ir.id===De);return Rt?(Rt.type=We,!0):!1}function ot(De,We){const Rt=O.value.find(Ir=>Ir.id===De);Rt&&(Rt.amountInput=pe(Math.max(0,We)))}function dt(){const De=Ot().paymentType;oo({resource:"paymentType",refetch:async()=>(await De.fetch(),De.data.value),applyToStore:We=>{We!=null&&(De.data.value=We)}})}function Vr(){QD("paymentType")}function jn(){je()}function kn(){je(),Ke(t.summaryBillingMoney?.grandTotal||0),o.value=t.data?.nickName||t.data?.alias||t.data?.name||"",a.value=t.data?.alias||t.data?.name||"",i.value=!0}function Tr(){i.value=!1}function wo(){const De=pe(t.summaryBillingMoney?.grandTotal||0);_.value=De,v.value=De,o.value=t.data?.alias||t.data?.name||o.value,a.value=t.data?.alias||t.data?.name||"",T.value="idle",Ye();const We=O.value[0];We&&(We.type=b.value?.uuid||We.type,w.value>0&&M.value===0&&(We.amountInput=pe(w.value))),i.value=!1,N.value=!0}function Ga(){const De=O.value[0];if(De){let We=d.value.find(Rt=>Rt.uuid===De.type);We&&ut(We),H(We?.onTheHouse?0:De.amountInput)}T.value="idle",N.value=!1,ve(),i.value=!0}function So(){N.value=!1}function Qo(){S.value={show:!1,amountChange:0,table:""},I&&(clearTimeout(I),I=null),P&&(clearTimeout(P),P=null),k&&typeof document<"u"&&document.removeEventListener("click",k),k=null}function Er(De,We=""){Qo(),S.value={amountChange:pe(Number(De)||0),show:!0,table:We},I=setTimeout(()=>{Qo()},30*1e3),typeof document<"u"&&(k=()=>Qo(),P=setTimeout(()=>{P=null,k&&document.addEventListener("click",k,{once:!0})},150))}function gh(De){const We=O.value.some(Rt=>Rt.id!==De&&Rt.type===no);return h.value.filter(Rt=>Rt.uuid!==no||!We)}return{paymentOptions:d,multiplePaymentOptions:h,dueAmountPayment:v,selectedPaymentOption:b,inputAmount:w,isCopyReceipt:E,hydrateCopyReceiptPref:X,setCopyReceipt:le,paymentStatus:T,changeAmount:R,alertChange:S,hideAlertChange:Qo,isValidPayment:L,setDueAmount:Ke,selectPaymentOption:ut,setInputAmount:H,validateAndConfirm:j,validateAndConfirmMultiplePayment:ge,completePayment:re,completeMultiplePayment:Re,resetPayment:je,init:dt,restart:jn,tableName:o,isOpenModal:i,isOpenMultiModal:N,openRequest:kn,openMultipleRequest:wo,closeMultipleRequest:So,switchToSinglePayment:Ga,closeRequest:Tr,note:p,room:g,multiplePayments:O,totalMultipleInput:M,remainingMultipleAmount:V,multipleChangeAmount:z,cashMultipleInput:ie,nonCashMultipleInput:K,isNonCashMultipleOverpaid:ce,isMultipleFullyCovered:G,isMultipleOverpaid:Z,isMultipleAmountBalanced:de,hasDuplicateMultiplePaymentTypes:fe,canAddMultiplePaymentLine:ee,isValidMultiplePayment:Te,addMultiplePaymentLine:oe,removeMultiplePaymentLine:ye,updateMultiplePaymentLineType:Fe,updateMultiplePaymentLineAmount:ot,getAvailablePaymentTypesForLine:gh,processPayment:B,isProcessingPayment:l,refresh:Vr}}),aB="soldout";function cB(){const t=Xn().storeId;return t?mh(Uo.runtime(String(t))):null}const mPe=qn("soldout",()=>{const t=Ae({}),e=Ae(!1),n=()=>{const c=Ze().soldoutRef();xa(c,l=>{t.value=l.val()||{},e.value=!0})},r=(c,l)=>{const d=Ze().soldoutRef(),h=zt(d,c.toString());l?Ue(h,l):Q_e(h)},s=Qe.debounce(()=>{if(!GE())return;const c=cB();c&&c.set(aB,t.value)},300);async function i(){n(),ft(t,()=>s(),{deep:!0}),await KE(Ze().soldoutRef()),e.value=!0}async function o(){const c=await VD(cB(),aB);c&&(t.value=c),e.value=!0,n(),ft(t,()=>s(),{deep:!0})}return{name:"soldout",soldout:t,loaded:e,fetchSnapshot:n,updateProductSoldout:r,init:async()=>Zp()?o():i(),bootOnline:i,bootOffline:o}}),gPe=300*1e3,tg=t=>JSON.parse(JSON.stringify(t)),td=()=>({data:null,lastFetchedAt:0,loading:!1,error:null,inFlightPromise:null,storeId:""}),_Pe=qn("stockDataCache",()=>{const t=Xs({stockList:td(),productMenu:td(),toppingMenu:td(),stockFormula:td(),toppingFormula:td(),stockTransactions:td(),stockUserPins:td()}),e=()=>Xn().storeId||"",n=(w,E)=>w.data!==null&&w.storeId===E&&Date.now()-w.lastFetchedAt<gPe,r=async(w,E,T={})=>{const R=e(),N=t[w];return!T.force&&n(N,R)?tg(N.data):!T.force&&N.inFlightPromise&&N.storeId===R?tg(await N.inFlightPromise):(N.loading=!0,N.error=null,N.storeId=R,N.inFlightPromise=E().then(O=>(N.data=tg(O),N.lastFetchedAt=Date.now(),O)).catch(O=>{throw N.error=O,O}).finally(()=>{N.loading=!1,N.inFlightPromise=null}),tg(await N.inFlightPromise))},s=w=>
157{(w||Object.keys(t)).forEach(T=>{const R=t[T];R.data=null,R.lastFetchedAt=0,R.loading=!1,R.error=null,R.inFlightPromise=null,R.storeId=""})},i=()=>s(),o=w=>{const E=Ot();return r("stockList",async()=>(await E.stock.list.fetch({customerId:e()})||[]).filter(R=>typeof R?.name=="string"&&R.name.trim()!==""),w)},a=async w=>(await o(w)||[]).filter(T=>T?.deleted!==!0),c=w=>{const E=Ot();return r("productMenu",async()=>{await Promise.all([E.catalogs.fetch(e()),E.items.fetch(e()),E.subItems.fetch(e())]);const T=Td.mapData(E.catalogs.data.value,"catalogs"),R=Td.mapData(E.items.data.value,"items"),N=Td.mapData(E.subItems.data.value,"subitems");return{catalogs:T,items:R,subItems:N,productCatalogs:Td.catalogsJoined(T,R,N)}},w)},l=w=>{const E=Ot();return r("toppingMenu",async()=>{const[T,R]=await Promise.all([E.toppingGroups.fetch(),E.toppingItems.fetch()]),N=new Map;return(R||[]).forEach(O=>{const S=O.GroupId||"ungrouped";if(!N.has(S)){const I=(T||[]).find(P=>P.Id===S);N.set(S,{Id:S,Name:I?.Name||"Ungrouped",Toppings:[]})}N.get(S).Toppings.push({Id:O.Id,Name:O.Name,Row:O.Row,Price:O.Price,GroupId:O.GroupId})}),{groups:T||[],items:R||[],joinedGroups:Array.from(N.values())}},w)},d=w=>{const E=Ot();return r("stockFormula",async()=>await E.stockFormula.fetch({partitionKey:e()})||[],w)},h=w=>{const E=Ot();return r("toppingFormula",async()=>await E.toppingFormula.fetch({partitionKey:e()})||[],w)},p=w=>{const E=Ot();return r("stockTransactions",async()=>await E.stock.transactions.fetch({customerId:e()})||[],w)},g=async()=>{const E=await Ot().stockEmployeesPin.fetch({customerId:e()});return Array.isArray(E)?E:Array.isArray(E?.data)?E.data:Array.isArray(E?.items)?E.items:[]},_=w=>{const E=t.stockUserPins;E.data=tg(Array.isArray(w)?w:[]),E.lastFetchedAt=Date.now(),E.storeId=e(),E.error=null};return{entries:t,init:()=>{oo({resource:"stockUserPin",refetch:g,applyToStore:_})},invalidate:s,clearAll:i,getStockList:o,getActiveStockList:a,getProductMenu:c,getToppingMenu:l,getStockFormula:d,getToppingFormula:h,getStockTransactions:p,getStockUserPins:w=>r("stockUserPins",async()=>{if(!w?.force){const E=await BD("stockUserPin");if(E!=null)return E}try{const E=await g();return await XS("stockUserPin",E),E}catch(E){return console.warn("[stockUserPin] fetch failed",E),[]}},w),fetchStockUserPinList:g,applyStockUserPins:_}});function I9(){ln().init(),qr().init(),ol().init(),bn().init(),jD().init(),_Pe().init()}function yPe(t){bn().storeId=t.storeId}async function C9(){ol().finishLoad(),qr().finishLoad(),await ln().finishLoad(),await $D().finishLoad()}function A9(){return[tt(),Mi(),_r(),t9(),mPe()]}function R9(){if(!(typeof localStorage>"u"))try{const t=[];for(let e=0;e<localStorage.length;e++){const n=localStorage.key(e);n&&n.startsWith("receipt-order")&&t.push(n)}t.forEach(e=>localStorage.removeItem(e))}catch(t){console.error("Failed to purge legacy receipt-order cache:",t)}}class vPe{mode="online";async loadAuth(){await Xn().hydrateFromFirestore(),Xn().refreshCurrentUserProfile()}async loadLayerA(e){I9(),await ske(),await C9(),ike("customerInfo")}async bootLayerB(e){R9(),await Promise.all(A9().map(n=>n.bootOnline(e)))}}class bPe{mode="offline";async loadAuth(){await Xn().hydrateFromLocalStorage()}async loadLayerA(e){I9(),await U9(),await C9()}async bootLayerB(e){R9(),await Promise.all(A9().map(n=>n.bootOffline(e)))}}class WD{fromCloudToJobchain(e){const n=tt(),r=JSON.parse(e),s=r.alias.replace("à¹à¸à¹à¸° ","T").replace("Table ","T"),i=r.orderitems.map(d=>{const h=d.toppings?.map(_=>({toppingId:_.toppingid,name:_.name,price:_.price,qty:_.quantity,quantity:_.quantity}));let p="";d.isTogo&&(p="<<< TAKE AWAY >>> "),d.comments&&(p+=d.comments);const g=Number(d.quantity)>0?Number(d.quantity):1;return{...d,quantity:g,qty:g,subItemId:d.subitemid,name:d.name,uuid:d.uniqueid,price:d.price,comments:p,toppings:h||[]}}),o=r.customercount,a=!(n.tables[s]?.items?.length>0),c=ol().applyDefaultDiscount(i);r.orderitems=$D().expandItems(c);const l=new ou().withTableAlias(r.alias).withTableUuid(r.table).withOrderJson(r).withActionType(pt.ADD).withSource("m").withEmployee({employeeId:r.employeeId||r.by||r.username||"mobile",name:r.employeeName||r.by||r.username||"mobile"}).withPrint(!0).withNote(r.comments||"").withMode(Bt.TABLE).withIsOpeningTable(a).withGuests(o).withJobIdAndTimestamp(Ne(r.datetime).toISOString()).withCustom({comments:r.comments||null}).build();return r.uniqueid&&(l.jobId=`${r.uniqueid}__${l.alias}
157`),l}}let wPe=1;function di(){const t=Bd("mobile-v1-toasts",()=>[]);function e(r){const s={id:wPe++,text:r.text,variant:r.variant||"success",duration:r.duration??2500};return t.value=[...t.value,s],setTimeout(()=>n(s.id),s.duration),s.id}function n(r){t.value=t.value.filter(s=>s.id!==r)}return{toasts:t,push:e,remove:n}}const PC=qn("table-list",()=>{const t=ln(),e=Ae([]);e.value=t.tables;const n=Ae(e.value[0]),r=Ae("table"),s=Ae(0),i=tt(),o=$e(()=>{const a=i.tables;let c=[];for(const[l,d]of Object.entries(a))l!==void 0&&d.mode==1&&c.push({...d,name:l});return c});return{zoneList:e,zoneSelected:n,activeTableList:o,mode:r,lastScrollTop:s}}),Wo=qn("mobile-v1",()=>{const t=Ae({}),e=Ae({}),n=Ae({}),r=new Set,s=new Set;let i=0;const o=5e3,a=()=>Date.now()-i<o,c=P=>String(P||"").replace("à¹à¸à¹à¸° ","T").replace("Table ","T"),l=(P,k)=>`${P}__${c(k)}`.replaceAll(".","_"),d=(P,k)=>r.has(P)||!!tt().jobs[l(P,k)],h=()=>{const P=tt();return P.loaded?Promise.resolve():(console.warn("[mobile-v1] jobchain not loaded yet â holding mobile ingest until it is"),new Promise(k=>{const L=ft(()=>P.loaded,M=>{M&&(L(),k())})}))},p=P=>{try{const k=tt().tables?.[c(P)]?.items||[];return new Set(k.map(L=>String(L?.uuid)).filter(Boolean))}catch{return new Set}},g=(P,k)=>{if(a()){Ue(P,null);return}k.read=2,Ue(P,JSON.stringify(k))},_=P=>e.value[P]||null,v=P=>n.value[P]||null,b=()=>{const P=PC().zoneList,k=tt(),L=_r(),M=k.tables,V=L.tablesState;let z=[];return Qe.forEach(P,ie=>{Qe.times(ie.tableCount,K=>{let ce=`${ie.name}${K+1}`,G=M[ce]?.items||[],de=V[ce]?.lock||!1?99:G.length>0?2:0;z.push(de)})}),z},w=P=>{if(String(P.key||"").startsWith("-"))return;const k=P.ref;var L=P.val(),M=JSON.parse(L);if(M.void||M.read==2)return;if(M.uniqueid&&d(M.uniqueid,M.alias)){g(k,M);return}if(tt().isRunningOverClosedDay()){setTimeout(()=>{Ue(k,null)},2500),di().push({variant:"warn",text:"รà¹à¸²à¸à¹à¸à¸´à¸à¸à¹à¸²à¸¡à¸§à¸±à¸ â à¸à¸£à¸¸à¸à¸²à¸à¸´à¸à¸£à¹à¸²à¸à¹à¸¥à¹à¸§à¹à¸à¸´à¸à¹à¸«à¸¡à¹à¸à¹à¸à¸à¸£à¸±à¸à¸à¸à¹à¸à¸à¸£à¹à¸à¸²à¸à¸¡à¸·à¸à¸à¸·à¸",duration:4e3});return}if(!t.value[M.deviceId]){setTimeout(()=>{Ue(k,null)},2500),di().push({variant:"warn",text:`à¸à¸à¹à¸à¸à¸£à¹à¸à¸²à¸à¸à¸¸à¸à¸à¸£à¸à¹à¸à¸µà¹à¸¢à¸±à¸à¹à¸¡à¹à¹à¸à¹à¸à¸±à¸à¸à¸¹à¹ â ${M.deviceId}`,duration:3e3});return}const V=String(M.alias||"").replace("à¹à¸à¹à¸° ","T").replace("Table ","T");if(_r().isLockedWithTable(V)){setTimeout(()=>{Ue(k,null)},2500),di().push({variant:"warn",text:`à¹à¸à¹à¸° ${V} à¸à¸³à¸¥à¸±à¸à¸à¸¹à¸à¹à¸à¹à¹à¸ â à¸à¸à¹à¸à¸à¸£à¹à¸à¸¹à¸à¸¢à¸à¹à¸¥à¸´à¸ à¸à¸£à¸¸à¸à¸²à¸ªà¹à¸à¹à¸«à¸¡à¹à¸à¸µà¸à¸à¸£à¸±à¹à¸à¸«à¸¥à¸±à¸à¸à¸¥à¸à¸¥à¹à¸à¸`,duration:3e3});return}M.uniqueid&&r.add(M.uniqueid);const z=String(M.alias||"").trim(),ie=fe=>`${z}_${fe}`,K=p(M.alias),G=(Array.isArray(M.orderitems)?M.orderitems:[]).filter(fe=>{const ee=fe?.uniqueid;return ee?!s.has(ie(ee))&&!K.has(String(ee)):!0});if(G.length===0){g(k,M),di().push({variant:"warn",text:`à¸à¸à¹à¸à¸à¸£à¹à¸à¹à¸³ â ${M.alias||""}`,duration:2500});return}G.forEach(fe=>{fe?.uniqueid&&s.add(ie(fe.uniqueid))}),M.orderitems=G,M.read=2;const Z=JSON.stringify(M);Ue(k,Z);const de=new WD().fromCloudToJobchain(Z);try{const ee=(tt().tables?.[de.alias]?.items?.length||0)===0;de.isOpeningTable=ee,ee||(de.guests=0)}catch(fe){console.warn("mobile guest/opening reconcile failed, leaving job as-is",fe)}de.pcTimestamp=wi().nowISO(),tt().add(de,!0),di().push({variant:"success",text:`New order from â ${de.alias}`,duration:2e3})},E=(P,k)=>{if(P.val()==1){const L=P.ref;Ue(L,2),setTimeout(()=>{Ue(L,null)},8e3)}},T=3600*1e3,R=()=>{const P=Ze().handshakeMobileV1Ref();Js(P,E);const L=PC().zoneList.map(z=>z.tableCount),M=Qe.sum(L),V=(wi().nowMs()-T).toString();i=Date.now();for(let z=1;z<=M;z++){const ie=`tables/${z}/history`,K=Ze().customerRootRef(),ce=zt(K,ie),G=rye(ce,nye(),eye(V));Js(G,w)}},N=()=>new Promise(P=>{const k=Ze().customerRootRef(),L=zt(k,"paired"),M=setTimeout(P,3e3);xa(L,V=>{const z=V.val()||{},ie={};for(const K in z){const{deviceId:ce,deviceName:G}=z[K];ie[ce]=!0}
157t.value=ie,clearTimeout(M),P()})}),O=()=>{const P=PC().zoneList;let k=1;Qe.forEach(P,L=>{Qe.times(L.tableCount,M=>{let V=`${L.name}${M+1}`;e.value[V]=k,n.value[k]=V,k++})})};return{convertTableToUuid:_,convertUuidToTable:v,generateCustomerArray:b,init:async()=>{O(),await h();const P=Ze().handshakeMobileV1Ref();Ue(P,null),await N(),R()},initPublishOnly:()=>{O()},tableToUuid:e,uuidToTable:n,pariedDevices:t}}),SPe=qn("job-gateway",()=>{const t=new Set,e=new Map,n=i=>{const o=i.val();(o===0||o===1)&&(Ue(i.ref,2),setTimeout(()=>{Ue(i.ref,null)},8e3))},r=async i=>{const o=i.ref,a=i.val();if(a==null)return;let c;try{c=JSON.parse(a)}catch{return}if(c.void||c.read==2)return;if(c.uniqueid&&e.has(c.uniqueid)){Ue(o,e.get(c.uniqueid)),setTimeout(()=>{Ue(o,null)},2500);return}if(c.uniqueid&&t.has(c.uniqueid))return;if(tt().isRunningOverClosedDay()){setTimeout(()=>{Ue(o,null)},2500),di().push({variant:"warn",text:"รà¹à¸²à¸à¹à¸à¸´à¸à¸à¹à¸²à¸¡à¸§à¸±à¸ â à¸à¸£à¸¸à¸à¸²à¸à¸´à¸à¸£à¹à¸²à¸à¹à¸¥à¹à¸§à¹à¸à¸´à¸à¹à¸«à¸¡à¹à¸à¹à¸à¸à¸£à¸±à¸à¸à¸à¹à¸à¸à¸£à¹à¸à¸²à¸à¸¡à¸·à¸à¸à¸·à¸",duration:4e3});return}if(!Wo().pariedDevices[c.deviceId]){setTimeout(()=>{Ue(o,null)},2500),di().push({variant:"warn",text:`à¸à¸à¹à¸à¸à¸£à¹à¸à¸²à¸à¸à¸¸à¸à¸à¸£à¸à¹à¸à¸µà¹à¸¢à¸±à¸à¹à¸¡à¹à¹à¸à¹à¸à¸±à¸à¸à¸¹à¹ â ${c.deviceId}`,duration:3e3});return}c.uniqueid&&t.add(c.uniqueid);const d=zE().getJobCurrentQueueNumber()+1,h=new WD().fromCloudToJobchain(a),p=String(c.uniqueid||d);h.mode=Bt.JOB,h.alias=p,h.uuid=p,h.nickName="Job #"+d,h.jobId=`${h.timestamp}__${p}`,tt().add(h,!0),c.read=2,c.jobId=d;const g=JSON.stringify(c);c.uniqueid&&e.set(c.uniqueid,g),Ue(o,g),di().push({variant:"success",text:`New job â ${h.nickName||h.alias}`,duration:2e3}),setTimeout(()=>{Ue(o,null)},8e3)};return{init:()=>{const i=Ze().jobHandshakeRef();Ue(i,null),Js(i,n);const o=Ze().jobMobileRef();Ue(o,null),Js(o,r)}}}),TPe=qn("mobile-v2",()=>{const t=new Map,e=new Set,n=1e4,r=2e3,s=v=>String(v||"").replace("à¹à¸à¹à¸° ","T").replace("Table ","T"),i=(v,b)=>`${v}__${s(b)}`.replaceAll(".","_"),o=(v,b)=>t.has(v)||!!tt().jobs[i(v,b)],a=(v,b)=>{const w=tt().jobs[i(v,b)];return{read:2,jobId:w?.jobId||null,nickName:w?.nickName||null,alias:w?.alias||s(b)}},c=()=>{const v=tt();return v.loaded?Promise.resolve():(console.warn("[mobile-v2] jobchain not loaded yet â holding mobile ingest until it is"),new Promise(b=>{const w=ft(()=>v.loaded,E=>{E&&(w(),b())})}))},l=(v,b)=>{const w=zt(Ze().mobileV2ResultRef(),v);Ue(w,b),setTimeout(()=>{Ue(w,null)},n)},d=(v,b,w,E)=>{l(b,{read:3,reason:w}),di().push({variant:"warn",text:E,duration:3500}),setTimeout(()=>{Ue(v.ref,null)},r)};function h(){const v=Ze().mobileV2HandshakeRef();Js(v,b=>{const w=b.val();(w==0||w==1)&&(Ue(b.ref,2),setTimeout(()=>{Ue(b.ref,null)},r))})}function p(){const v=Ze().mobileV2JobRef();Js(v,b=>{const w=b.val();if(w==null)return;let E,T;try{typeof w=="string"?(T=w,E=JSON.parse(w)):(E=w,T=JSON.stringify(w))}catch{setTimeout(()=>{Ue(b.ref,null)},r);return}if(!E||E.void||E.read==2)return;const R=String(E.uniqueid||b.key||"");if(!R){setTimeout(()=>{Ue(b.ref,null)},r);return}if(o(R,E.alias)){const P=t.get(R)||a(R,E.alias);t.set(R,P),l(R,P),setTimeout(()=>{Ue(b.ref,null)},r);return}if(e.has(R))return;if(tt().isRunningOverClosedDay()){d(b,R,"closed_day","รà¹à¸²à¸à¹à¸à¸´à¸à¸à¹à¸²à¸¡à¸§à¸±à¸ â à¸à¸£à¸¸à¸à¸²à¸à¸´à¸à¸£à¹à¸²à¸à¹à¸¥à¹à¸§à¹à¸à¸´à¸à¹à¸«à¸¡à¹à¸à¹à¸à¸à¸£à¸±à¸à¸à¸à¹à¸à¸à¸£à¹à¸à¸²à¸à¸¡à¸·à¸à¸à¸·à¸");return}if(!Wo().pariedDevices[E.deviceId]){d(b,R,"unpaired",`à¸à¸à¹à¸à¸à¸£à¹à¸à¸²à¸à¸à¸¸à¸à¸à¸£à¸à¹à¸à¸µà¹à¸¢à¸±à¸à¹à¸¡à¹à¹à¸à¹à¸à¸±à¸à¸à¸¹à¹ â ${E.deviceId}`);return}const O=String(E.alias||"").replace("à¹à¸à¹à¸° ","T").replace("Table ","T");if(_r().isLockedWithTable(O)){d(b,R,"table_locked",`à¹à¸à¹à¸° ${O} à¸à¸¹à¸à¸¥à¹à¸à¸à¸à¸¢à¸¹à¹`);return}e.add(R);const S=new WD().fromCloudToJobchain(T);try{const k=(tt().tables?.[S.alias]?.items?.length||0)===0;S.isOpeningTable=k,k||(S.guests=0)}catch(P){console.warn("[mobile-v2] guest/opening reconcile failed, leaving as-is",P)}S.pcTimestamp=wi().nowISO(),tt().add(S,!0);const I={read:2,jobId:S.jobId||null,nickName:S.nickName||null,alias:S.alias||null};t.set(R,I),e.delete(R),l(R,I),di().push({variant:"success",text:`New order from â ${S.alias}`,duration:2e3}),setTimeout(()=>{Ue(b.ref,null)},r)})}function g(){Ue(Ze().mobileV2HandshakeRef(),null),Ue(Ze().mobileV2JobRef(),null),Ue(Ze().mobileV2ResultRef(),null)}async function _(){await c(),g(),h(),p()}return{init:_}});class EPe{fromCloudToJobchain(e,n){const r=JSON.parse(e),s=Wo().convertUuidToTable(r.uuid),i=r.mapVoidUniqueId||{},o=Object.keys(i).length;if(!s)return{job:null,matchedCount:0,requestedCount:o};const a=tt().tables[s]?.items||[],c={},l=[];for(const[g,_]of Object.entries(i)){const v=Math.abs(Number(_)||0);if(v<=0)continue;const b=a.find(E=>E.uuid===g);if(!b)continue;const w=Math.min(v,Number(b.quantity)||v);c[g]=w*-1,l.push(b)}const d=l.length;if(d===0)return{job:null,matchedCount:0,requestedCount:o};const h=wi().nowISO();return{job:new ou().withTableAlias(s).withTableUuid(s).withActionType(pt.VOID).withMode(Bt.TABLE).withJson2(c).withSource("m").withEmployee({
157name:r.by||"mobile",id:"mobile"}).withPrint(!0).withJobIdAndTimestamp(h).withJobId(n||h).withCustom({__items:l,__reason:r.reason||""}).build(),matchedCount:d,requestedCount:o}}}const IPe=qn("mobile-void-v1",()=>{const t=new Set,e=h=>{const p=h.val();(p===0||p===1)&&(Ue(h.ref,2),setTimeout(()=>{Ue(h.ref,null)},8e3))},n=1e4,r="__void_done:",s=h=>`${r}${h}`,i=()=>{if(!(typeof window>"u"))try{const h=Date.now(),p=[];for(let g=0;g<window.localStorage.length;g++){const _=window.localStorage.key(g);if(!_||!_.startsWith(r))continue;const v=Number(window.localStorage.getItem(_));(!v||h-v>=n)&&p.push(_)}p.forEach(g=>window.localStorage.removeItem(g))}catch{}},o=h=>{if(!h||typeof window>"u")return!1;const p=window.localStorage.getItem(s(h));return!!p&&Date.now()-Number(p)<n},a=h=>{h&&typeof window<"u"&&window.localStorage.setItem(s(h),String(Date.now()))},c=h=>{h&&typeof window<"u"&&window.localStorage.removeItem(s(h))},l=async h=>{const p=h.ref,g=h.val();if(g==null)return;let _;try{_=typeof g=="string"?JSON.parse(g):g}catch{return}if(_.read==2)return;const v=String(h.key||"");if(v&&t.has(v)||o(v))return;const b=async()=>{if(o(v))return;if(a(v),v&&t.add(v),tt().isRunningOverClosedDay()){c(v),setTimeout(()=>{Ue(p,null)},2500),di().push({variant:"warn",text:"รà¹à¸²à¸à¹à¸à¸´à¸à¸à¹à¸²à¸¡à¸§à¸±à¸ â à¸à¸£à¸¸à¸à¸²à¸à¸´à¸à¸£à¹à¸²à¸à¹à¸¥à¹à¸§à¹à¸à¸´à¸à¹à¸«à¸¡à¹à¸à¹à¸à¸à¸£à¸±à¸à¸à¸³à¸ªà¸±à¹à¸à¸à¸²à¸à¸¡à¸·à¸à¸à¸·à¸",duration:4e3});return}const{job:w,matchedCount:E}=new EPe().fromCloudToJobchain(typeof g=="string"?g:JSON.stringify(_),v);if(!w||E===0){c(v),di().push({variant:"warn",text:`à¹à¸¡à¹à¸à¸à¸£à¸²à¸¢à¸à¸²à¸£à¸à¸µà¹à¸à¸° void â ${_.uuid??""}`,duration:3e3}),setTimeout(()=>{Ue(p,null)},2500);return}w.pcTimestamp=wi().nowISO(),tt().add(w,!0),_.read=2,Ue(p,JSON.stringify(_)),setTimeout(()=>{Ue(p,null)},8e3),di().push({variant:"success",text:`Void from mobile â ${w.alias}`,duration:2e3}),v&&setTimeout(()=>{c(v)},n)};v&&typeof navigator<"u"&&navigator.locks?.request?await navigator.locks.request(`void_from_mobile:${v}`,{ifAvailable:!0},async w=>{w&&await b()}):await b()};return{init:()=>{i();const h=Ze().handshakeVoidFromMobileRef();Ue(h,null),Js(h,e);const p=Ze().voidFromMobileRef();Ue(p,null),Js(p,l)}}}),P9=qn("posTerminal",()=>{function t(){const i=Ze().handshakeTerminalRef();Js(i,o=>{o.val()==1&&(Ue(o.ref,2),setTimeout(()=>{Ue(o.ref,null)},2e3))})}function e(){const i=Ze().terminalJobRef();Js(i,o=>{const a=o.val();if(console.log(a),a&&a.mode===Bt.JOB&&!a.nickName){const d=zE().getJobCurrentQueueNumber()+1;a.nickName="Job #"+d}a&&(a.pcTimestamp=wi().nowISO()),tt().add(a,!0);const c=o.key||(a?.hash!=null?String(a.hash):"");if(c){const d=zt(Ze().terminalJobResultRef(),c);Ue(d,{nickName:a?.nickName||null,jobId:a?.jobId||null}),setTimeout(()=>{Ue(d,null)},1e4)}const l=a?.nickName||a?.alias||a?.tableName||a?.table||"Terminal";di().push({variant:"success",text:`New order from terminal â ${l}`,duration:2e3}),setTimeout(()=>{Ue(o.ref,null)},2e3)})}function n(i,o){const a=Ze().printPreviewFromTerminalRef(),c=zt(a,i);Ue(c,{alias:i,user:o?.User||null})}function r(){const i=Ze().printPreviewFromTerminalRef();Ue(i,null);const o=Ze().handshakeTerminalRef();Ue(o,null);const a=Ze().terminalJobRef();Ue(a,null);const c=Ze().terminalJobResultRef();Ue(c,null)}function s(){r(),t(),e()}return{init:s,sendPrintPreviewRequest:n}}),tT=qn("pos-print-preview",()=>{const t=tt(),e=qr(),n=bn(),r=p=>p&&t.tables[p]||null,s=(p,g)=>{const _=r(p);if(!_)return null;const v=Qe.cloneDeep(_);return v.items=_.items||[],v.billing=_.billing,v.endDateTime=Ne().format("YYYY-MM-DDTHH:mm:ss"),fp.fromTable(v,{orderId:"",shiftWork:t.getShift?.()||"Shift 1",user:g||e.getCurrentEmployee?.name||"admin",payment:{list:[]},customerId:n.getStoreId}).toDynamodb()},i=(p,g)=>s(p,g),o=()=>{const p=Ze().printPreviewFromTerminalRef();Js(p,g=>{const _=g.val();if(_==null)return;const v=typeof _=="string"?_:_.alias,b=typeof _=="string"?void 0:_.user;if(!v){Ue(g.ref,null);return}tT().printPreviewByTable(v,b),Ue(g.ref,null)})},a=1e4,c={},l=()=>{const p=Wo(),g=Ze().tablesRef(),_=p.tableToUuid;for(const[v,b]of Object.entries(_)){const w=zt(g,`${b}/requestPayment`);xa(w,E=>
157{if(!E.val())return;const R=tT(),N=E.ref.parent?.key||"",O=Date.now();if(O-(c[N]||0)<a){Ue(E.ref,null);return}c[N]=O;const S=p.convertUuidToTable(N);if(!S){Ue(E.ref,null);return}R.printPreviewByTable(S),_r().isLockedWithTable(S)||_r().setLockTable(S,!0),Ue(E.ref,null)})}};return{init:()=>{o(),l()},getTableForPreview:r,buildPreviewPayloadFromTable:s,printPreviewByTable:i,handleTerminalRequest:o,handleMobileNewAppRequest:l,handleMobileOldAppRequest:()=>{}}}),CPe="/users/firebase-token",lB=2,APe=2e3,RPe=t=>new Promise(e=>setTimeout(e,t));async function uB(t){const e=xc.currentUser;if(!e)return"unknown";try{const{claims:n}=await E6(e);return n.cashier===!0&&n.customerId===t?"match":"mismatch"}catch(n){return console.warn("[cashier-auth] cannot read claims (offline?) â passing through",n),"unknown"}}async function PPe(){const{$api:t}=au(),e=Xn();let n=null;for(let r=0;r<=lB;r++)try{const s=await t(CPe,{method:"POST",body:{browserId:e.browserId}}),i=await Pve(xc,s.firebaseCustomToken);return console.log(`[cashier-auth] signed in as ${i.user.uid}`),{status:"ok",uid:i.user.uid}}catch(s){n=s;const i=s?.response?.status??s?.statusCode??s?.status;if(i===401||i===403)return{status:"unauthorized"};r<lB&&await RPe(APe*(r+1))}return console.warn("[cashier-auth] could not reach firebase-token endpoint",n),{status:"unreachable"}}async function kPe(t){if(await xc.authStateReady(),xc.currentUser){if(await uB(t)!=="mismatch")return{status:"ok",uid:xc.currentUser.uid};console.warn("[cashier-auth] session claims do not match current shop â re-minting"),await QR()}const e=await PPe();return e.status!=="ok"?e:await uB(t)==="mismatch"?{status:"mismatch",uid:e.uid}:e}async function QR(){try{await B6(xc)}catch(t){console.warn("[cashier-auth] signOut failed",t)}}const GD=il(()=>{const t={pos:!1,setting:!1,report:!1,expense:!1,download:!1,manager:!1},e=l=>({pos:l?.pos===!0,setting:l?.setting===!0,report:l?.report===!0,expense:l?.expense===!0,download:l?.download===!0,manager:l?.manager===!0}),n=Ae({...t}),r=Ae(!1);let s=null;const i=l=>{const d=l.replace(/\/+$/,"")||"/";return d==="/pos"||d==="/v2/pos"?"pos":d.startsWith("/v2/settings")||d.startsWith("/settings")||d.startsWith("/setting")?"setting":d.startsWith("/v2/reports")||d.startsWith("/reports")||d.startsWith("/report")?"report":d.startsWith("/v2/expense")||d.startsWith("/expenses")||d.startsWith("/expense")?"expense":d.startsWith("/download")?"download":d.startsWith("/v2/menu")||d.startsWith("/v2/edit-bill")||d.startsWith("/manager")?"manager":null};return{featureBlockData:n,isWatching:r,startWatching:()=>{if(r.value)return;const l=rr().getFeatureBlockRef();s=xo(l,d=>{if(!d.exists()){console.log("[useWatchFeatureBlock] feature_block not found"),n.value={...t};return}n.value=e(d.data()),console.log("[useWatchFeatureBlock] feature_block:",n.value)},d=>{console.log("[useWatchFeatureBlock] snapshot error:",d),n.value={...t}}),r.value=!0},stopWatching:()=>{s&&(s(),s=null),r.value=!1},isPathBlocked:l=>{const d=i(l);return d?n.value[d]===!0:!1}}}),NPe="cashier_takeover_signal",Wa=qn("bootstrap",()=>{const t=Ae(!1),e=Ae(!1),n=Ae(!1),r=Ae("");function s(){const g=window.location.protocol==="file:";if(!(g?window.location.hash==="#/login":window.location.pathname==="/login")){if(g){window.location.hash="#/login";return}window.location.href="/login"}}function i(g){const _=g?.status||g?.statusCode||g?.response?.status,v=String(g?.message||g||"").toLowerCase();if(_===401||_===403||v.includes("need login")){t.value=!1,r.value="Session expired. Redirecting to login...",console.log("Session expired. Redirecting to login..."),Or.fire({icon:"warning",title:"Session expired. Redirecting to login..."}),s();return}r.value="Initialization failed",console.log("Failed to initialize bootstrap store:",g),Or.fire({icon:"error",title:"Failed to initialize bootstrap store: "+g})}async function o(){if(Xn().storeId==null)throw new Error("need login")}async function a(){jD().restart()}async function c(){await Wo().init(),SPe().init(),await TPe().init(),IPe().init(),P9().init(),tT().init()}async function l(){const g=bn().runMode;if(g!=="cashier"&&g!=="2nd_cashier"&&g!=="terminal")return;const _=await kPe(String(Xn().storeId));if(_.status!=="ok"&&(_.status,window.location.pathname!=="/login"))throw _.status==="unauthorized"||_.status==="mismatch"?localStorage.removeItem("token"):Or.fire({icon:"error",title:"Cashier sign-in failed",text:"à¹à¸à¸£à¸·à¹à¸à¸à¹à¸à¸à¹à¸à¸µà¸¢à¸£à¹à¸à¹à¸à¸à¸à¹à¸à¸à¸´à¸à¹à¸à¸à¸£à¹à¹à¸à¹à¸à¹à¸à¸·à¹à¸à¸¥à¸à¸à¸°à¹à¸à¸µà¸¢à¸à¸à¸£à¸±à¹à¸à¹à¸£à¸ à¸à¸£à¸¸à¸à¸²à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¹à¸¥à¹à¸§ login à¹à¸«à¸¡à¹"}
157),window.location.href="/login",new Error("need login")}async function d(){const _=bn().runMode;_!=null&&((_==="cashier"||_==="2nd_cashier")&&await a(),_==="cashier"&&await c(),_==="2nd_cashier"&&Wo().initPublishOnly())}async function h(){const g=Xn(),_=Os();let v=!1;return g.watchFirestoreOffline(({isFirestoreOffline:b})=>{if(v){e.value=b;return}v=!b}),n.value=!0,r.value="Loading Completed",setTimeout(()=>{localStorage.setItem("firestore_loaded","true")},5e3),window.sessionStorage.getItem(NPe)?_.push("/"):new URLSearchParams(window.location.search).get("enterPos")==="1"?_.push({path:"/v2",query:{enterPos:"1"}}):_.push("/v2")}async function p(){if(!t.value){t.value=!0;try{const g=await RAe();e.value=g,console.log(`[bootstrap] offline boot = ${g}`);const _=g?new bPe:new vPe;r.value="Authenticating...",await _.loadAuth();const v=Xn();if(v.storeId==null)throw new Error("need login");const b={storeId:String(v.storeId),get businessMode(){return Number(ln().getSystemEnvByName?.("BusinessMode")?.Value??0)||0}};au().setStoreId(b.storeId),Ot().setCustomerId(b.storeId),Ot().init(),rr().setStoreId(b.storeId),Ze().setStoreId(b.storeId),yPe(b),r.value="Loading Main Data...",await _.loadLayerA(b),await bn().loadRunMode(),await l(),GD().startWatching(),vwe().startWatching(),r.value="Loading POS Data...",await _.bootLayerB(b),await d(),await h(),setTimeout(()=>o(),1e3)}catch(g){i(g)}}}return{isInited:t,isOffline:e,loaded:n,loadingLabel:r,init:p,redirectToLogin:s,handleBootError:i,initClientDatabaseService:o,initByRunMode:d,initPaymentRuntime:a,initCashierControllerRuntime:c,processRoute:h}}),kC="receipt-dynamodb",NC="void-command";function DC(){const t=Xn().storeId;return t?mh(Uo.receipts(String(t))):null}function DPe(t){return t?.Nonce||t?.["datetime-table-grandtotal"]||t?.receiptId||""}const Mi=qn("receipts",()=>{const t=Ot(),e=E9(),n=Ae([]),r=Ae({startDate:Ne().format("YYYY-MM-DD"),endDate:Ne().format("YYYY-MM-DD")}),s=Ae({receipts:!1}),i=$e(()=>s.value.receipts&&e.loaded),o=$e(()=>n.value),a=Ae(!1),c=Ae([]),l=new Set,d=async oe=>{const ye=DPe(oe);e9(DC(),l,ye,oe)},h=async oe=>{for(const ye of oe)await d(ye)},p=()=>{c.value=V()},g=$e(()=>new Set(c.value.map(oe=>oe.Nonce).filter(Boolean))),_=Ae([]),v=()=>{try{const oe=[];for(let ye=0;ye<localStorage.length;ye++){const Fe=localStorage.key(ye);if(Fe&&Fe.startsWith(`${NC}:`)){const ot=localStorage.getItem(Fe);ot&&oe.push(JSON.parse(ot))}}return oe}catch(oe){return console.error("Failed to read void commands from local storage:",oe),[]}},b=()=>{_.value=v()},w=()=>{const oe=qr().getCurrentEmployee?.name||"";return oe==="unknown"?"":oe},E=(oe,ye,Fe)=>{const ot=oe?.Nonce;if(ot)try{const dt={nonce:ot,sortKey:Ke(oe),voidReason:ye,voidedBy:w(),approvedBy:Fe||void 0,createdAt:Date.now()};localStorage.setItem(`${NC}:${ot}`,JSON.stringify(dt)),b()}catch(dt){console.error("Failed to enqueue void command:",dt)}},T=oe=>{if(oe)try{localStorage.removeItem(`${NC}:${oe}`),b()}catch(ye){console.error("Failed to dequeue void command:",ye)}},R=$e(()=>new Set(_.value.map(oe=>oe.nonce).filter(Boolean))),N=oe=>{const ye=oe?.Nonce;return!!ye&&R.value.has(ye)},O=$e(()=>c.value.length+_.value.length),S=Ae(0);let I=null;ft(O,oe=>{if(I&&clearTimeout(I),oe===0){S.value=0;return}I=setTimeout(()=>{S.value=O.value},5e3)});const P=oe=>!!oe&&g.value.has(oe),k=oe=>{try{const ye=`${kC}:${oe.Nonce||Date.now()}`;localStorage.setItem(ye,JSON.stringify({...oe,Synced:!1})),p()}catch(ye){console.error("Failed to save receipt to local storage:",ye)}},L=oe=>{try{const ye=`${kC}:${oe.Nonce}`;localStorage.removeItem(ye),p()}catch(ye){console.error("Failed to remove receipt from local storage:",ye)}},M=oe=>{if(!oe)return;const ye=n.value.findIndex(Fe=>Fe.Nonce===oe);ye!==-1&&n.value[ye]&&(n.value[ye].Synced=!0)},V=()=>{try{const oe=[];for(let ye=0;ye<localStorage.length;ye++){const Fe=localStorage.key(ye);if(Fe&&Fe.startsWith(kC)){const ot=localStorage.getItem(Fe);ot&&oe.push(JSON.parse(ot))}}return oe}catch(oe){return console.error("Failed to get pending receipts from local storage:",oe),[]}},z=oe=>oe?.Nonce||oe?.hash||oe?.Hash||oe?.["datetime-table-grandtotal"]||oe?.receiptId||"",ie=oe=>{const ye=new Map;for(const Fe of oe){const ot=z(Fe);if(!ot){ye.set(`__noKey:${ye.size}`,Fe);continue}const dt=ye.get(ot);if(!dt)ye.set(ot,Fe);else{const Vr=dt.Synced!==!1,jn=Fe.Synced!==!1;!Vr&&jn&&ye.set(ot,Fe)}}return Array.from(ye.values())},K=(oe=V())=>{const ye=oe.map(jn=>({...jn,Synced:!1})),Fe=[...n.value,...ye],ot=ie(Fe),dt=R.value,Vr=ot.map(jn=>jn?.Nonce&&dt.has(jn.Nonce)?{...jn,_voidPending:!0}:jn);return n.value=Qe.orderBy(Vr,["Date","OrderDate","createdAt"],["desc","desc","desc"]),n.value},ce=oe=>{const{Synced:ye,...Fe}=oe;return Fe}
157,G=async oe=>{try{const ye=await t.receipts.post(ce(oe));return M(oe.Nonce),ye}catch(ye){throw console.error("Failed to post receipt to API:",ye),ye}},Z=async()=>{const oe=V();for(const ye of oe)try{await G(ye),L(ye),M(ye.Nonce)}catch(Fe){console.error("Failed to sync pending receipt:",ye.receiptId,Fe)}K()},de=async(oe=Ne().format("YYYY-MM-DD"),ye=Ne().format("YYYY-MM-DD"))=>{try{await t.receipts.fetchBetween(oe,ye);const Fe=t.receipts.data.value||[];return console.log("[receipts fetch] result count:",Fe.length,"| startDate:",oe,"endDate:",ye),n.value=Fe,K(),h(Fe),s.value.receipts=!0,Fe}catch(Fe){return console.error("[receipts fetch] FAILED:",Fe,"| startDate:",oe,"endDate:",ye),K(),s.value.receipts=!0,[]}},fe=async(oe=Ne().format("YYYY-MM-DD"),ye=Ne().format("YYYY-MM-DD"))=>{await t.receipts.fetchBetween(oe,ye);const Fe=t.receipts.data.value||[];return console.log("[receipts refreshFromServer] count:",Fe.length,"| range:",oe,"â",ye),n.value=Fe,K(),h(Fe),s.value.receipts=!0,Fe},ee=async oe=>{n.value.unshift(oe),k(oe),d(oe),K([oe]);try{await G(oe),L(oe),K()}catch(ye){console.error("Failed to post receipt to API, kept in local storage:",ye)}},Te=async(oe,ye)=>{try{await t.receipts.put(oe["datetime-table-grandtotal"],ye),await de()}catch(Fe){throw console.error("Failed to update receipt in API:",Fe),Fe}},pe=oe=>new Promise(ye=>setTimeout(ye,oe)),Ce=3500,Ve=2e3,Y=()=>typeof navigator>"u"||navigator.onLine!==!1,ve=oe=>oe?.status||oe?.statusCode||oe?.response?.status,Ee=oe=>{const ye=ve(oe);return ye==null||ye>=500},Me=oe=>ve(oe)===404,Ke=oe=>{const ye=oe?.["datetime-table-grandtotal"];if(ye)return ye;const Fe=oe?.Nonce;if(Fe){const ot=n.value.find(dt=>dt?.Nonce===Fe);if(ot?.["datetime-table-grandtotal"])return ot["datetime-table-grandtotal"]}},ut=new Map;let H=Promise.resolve();const j=oe=>{if(Ke(oe))return Promise.resolve();const ye=oe?.Nonce;if(!ye)return Promise.resolve();const Fe=ut.get(ye);if(Fe)return Fe;const ot=H.then(async()=>{if(!Ke(oe))try{const dt=await G(oe);if(dt?.["datetime-table-grandtotal"]){const jn=n.value.findIndex(kn=>kn?.Nonce===ye);jn!==-1&&n.value[jn]&&(n.value[jn]={...n.value[jn],...dt,Synced:!0}),L(oe)}await pe(Ce),await de()}catch(dt){console.error("ensureSynced failed",dt)}}).finally(()=>{ut.delete(ye)});return ut.set(ye,ot),H=ot.catch(()=>{}),ot},re=(oe,ye,Fe)=>{E(oe,ye,Fe),K()},Re=async(oe,ye,Fe)=>{const ot=ye||"voided";if(!Y()){re(oe,ot,Fe);return}try{let dt=Ke(oe);if(dt||(await j(oe),dt=Ke(oe),dt||(await pe(1500),await de(),dt=Ke(oe))),!dt){re(oe,ot,Fe);return}await t.receipts.remove(dt,{voidReason:ot,voidedBy:w(),approvedBy:Fe||""}),await de()}catch(dt){if(Me(dt)){await de().catch(()=>{});return}if(Ee(dt)){console.warn("[receipts.remove] server unreachable â queuing void",dt),re(oe,ot,Fe);return}throw console.error("Failed to delete receipt from API:",dt),dt}},ge=()=>{const oe=H.then(async()=>{if(await Z(),_.value.length===0)return;await pe(Ve);const ye=se();await de(ye,ye);for(const Fe of[..._.value]){const ot=Fe.sortKey||Ke({Nonce:Fe.nonce});if(ot)try{await t.receipts.remove(ot,{voidReason:Fe.voidReason,voidedBy:Fe.voidedBy,approvedBy:Fe.approvedBy}),T(Fe.nonce)}catch(dt){Me(dt)&&T(Fe.nonce)}}await de(ye,ye)});return H=oe.catch(()=>{}),oe.catch(ye=>console.error("[flushOfflineMutations] failed",ye))},B=()=>{n.value=[],s.value.receipts=!1},q=oe=>{n.value=Qe.orderBy(oe||[],["Date"],["desc"]),s.value.receipts=!0};let J=null;function se(){const oe=ln().getSystemEnvByName("BusinessMode")?.Value||"0",ye=Ne();return oe==1?ye.add(-7,"hour").format("YYYY-MM-DD"):ye.format("YYYY-MM-DD")}function be(){J||(J=QS(()=>{e.flushCounterIncrements().catch(oe=>console.error("[counter auto-sync] failed:",oe)),ge().catch(oe=>console.error("[receipts auto-sync] failed:",oe))},600*1e3))}let xe=null;async function X(){await Promise.allSettled([e.flushCounterIncrements(),ge(),tt().syncPendingJobs(),ZS(t)])}function le(){if(xe)return;const oe=Wa();xe=ft(()=>oe.isOffline,(ye,Fe)=>{Fe===!0&&ye===!1&&X().catch(ot=>console.error("[receipts reconnect-sync] failed:",ot))})}async function je(){if(a.value)return;a.value=!0;const{knownKeys:oe}=await KR(DC(),!1);oe.forEach(Fe=>l.add(Fe)),e.boot();const ye=se();bn().isRestrictedMode?s.value.receipts=!0:await de(ye,ye),p(),b(),K(),e.flushCounterIncrements(),ge(),r.value.startDate=ye,r.value.endDate=ye,be(),le()}async function Ye(){if(a.value)return;a.value=!0;const{entries:oe,knownKeys:ye}=await KR(DC(),!0);ye.forEach(ot=>l.add(ot)),oe.length&&(n.value=Qe.orderBy(oe.map(([,ot])=>ot),["Date","OrderDate","createdAt"],["desc","desc","desc"])),s.value.receipts=!0,e.boot(),p(),b(),K();const Fe=se();r.value.startDate=Fe,r.value.endDate=Fe,be(),le()}return{name:"receipts",loaded:i,queryReceipts:r,receipts:n,data:o,init:async()=>Zp()?Ye():je(),bootOnline:je,bootOffline:Ye,refresh:B,fetch:de,refreshFromServer:fe,setReceipts:q,add:ee,post:G,update:Te,remove:Re,ensureSynced:j,getPendingReceipts:V,mergePendingReceiptsIntoState:K,syncPendingReceipts:Z,flushOfflineMutations:ge,markReceiptSynced:M,pendingReceipts:c,pendingNonces:g,refreshPendingReceipts:p,isReceiptUnsynced:P,unsyncedCount:O,delayedUnsyncedCount:S,voidCommands:_,pendingVoidNonces:R,isVoidPending:N,refreshVoidCommands:b}}),OPe=t=>({summary:$e(()=>{const n={};return t.filter(s=>
157!s.IsDeleted).forEach(s=>{typeof s.PaymentType=="string"?n[s.PaymentType]={name:s.PaymentType,qty:1,amount:s.GrandTotal||0}:s.payment.forEach(i=>{n[i.Name]?(n[i.Name].quantity++,n[i.Name].amount+=s.GrandTotal||0):n[i.Name]={name:i.Name,qty:1,amount:s.GrandTotal||0}})}),Object.values(n).sort((s,i)=>i.amount-s.amount)})});function xPe(t,e=2){return Number(t??0).toLocaleString("en-US",{minimumFractionDigits:e,maximumFractionDigits:e})}const ww="x,xxx",nT=ww,rT=()=>qr().getCurrentEmployee?.HideCashier===!0,WVe=()=>{const t=qr(),e=$e(()=>t.getCurrentEmployee?.HideCashier===!0);return{shouldMaskMoney:e,maskedMoney:ww,formatMoney:(s,i=2)=>e.value?ww:xPe(Number(s??0),i),formatFixed:(s,i=2)=>e.value?ww:Number(s??0).toFixed(i)}};function KD(t){const e=t?.multiplePayment;if(Array.isArray(e)&&e.length>0)return e.map(r=>({name:String(r.name??""),amount:Number(r.amount??0)}));const n=t?.PaymentType??t?.paymentType;if(!n)return[];if(typeof n=="string"&&n.trimStart().startsWith("["))try{const r=JSON.parse(n);if(Array.isArray(r))return r.map(s=>({name:String(s.name??""),amount:Number(s.amount??0)}))}catch{}return[{name:String(n),amount:0}]}function k9(t){const e=KD(t);return e.length?e.map(n=>n.amount>0?`${n.name} : ${Number(n.amount).toLocaleString("en-US")}`:n.name).join(", "):"-"}function LPe(t){return KD(t).map(n=>n.name).filter(Boolean)}function N9(t){const e=t?.OrderItems||t?.items||[];return Array.isArray(e)&&e.length>0?e.reduce((r,s)=>{const i=Number(s?.quantity??s?.qty??1),o=Number(s?.price??0);return r+Number(s?.extendedPrice??i*o)},0):Number(t?.SubTotal??t?.subTotal??0)+Math.abs(Number(t?.ItemDiscount??t?.ItemsDiscount??0))}function MPe(t){const e=t?.OrderItems||t?.items||[];return Array.isArray(e)&&e.length>0?e.reduce((n,r)=>{const s=Number(r?.extendedPrice??Number(r?.quantity??r?.qty??1)*(Number(r?.price)||0)),i=Number(r?.discount??0);return n+Number(r?.discountedPrice??s-i)},0):Number(t?.SubTotal??t?.subTotal??0)-Math.abs(Number(t?.ItemDiscount??t?.ItemsDiscount??0))}function zD(t){return Number(t?.Vat)||0}function VPe(t){const e=Number(t?.VatMode||0),n=zD(t);return n?e===1?{exclusive:0,inclusive:-Math.abs(n)}:e===2?{exclusive:Math.abs(n),inclusive:0}:{exclusive:0,inclusive:0}:{exclusive:0,inclusive:0}}function D9(t){return(t||[]).reduce((e,n)=>{const{exclusive:r,inclusive:s}=VPe(n);return e.exclusive+=r,e.inclusive+=s,e},{exclusive:0,inclusive:0})}function GVe(t){const e=t?.Date?Ne(t.Date):null,n=KD(t),r=(t?.OrderItems||t?.items||[]).map(s=>{const o=(Array.isArray(s?.toppings)?s.toppings:[]).map(l=>({name:String(l?.name??l?.Name??""),price:Number(l?.price??l?.Price??l?.extendedPrice??0)})).filter(l=>l.name),a=Number(s?.quantity??s?.qty??1),c=Number(s?.price??0);return{name:String(s?.name??s?.Name??""),qty:a,price:c,total:Number(s?.extendedPrice??a*c),discount:Number(s?.discount??0),discountText:String(s?.discountText??""),toppings:o,comments:String(s?.comments??"")}});return{receiptId:String(t?.ReceiptId||t?.OrderId||""),reference:String(t?.Reference||t?.Table||t?.table||"-"),room:String(t?.Room??"").trim(),note:String(t?.Note??"").trim(),dateDisplay:e?.isValid()?`${e.format("DD")}/${e.format("MMMM")}/${e.year()}`:"-",time:e?.isValid()?e.format("HH:mm:ss"):"-",guests:Number(t?.CustomerCount||0),paymentTypePrimary:n.length>1?"Multiple Payment":n[0]?.name||k9(t)||"-",paymentTypeSecondary:n.length>1?n.map(s=>s.amount>0?`${s.name} : ${Number(s.amount).toLocaleString("en-US")}`:s.name).join(", "):"",paymentLines:n.length>1?n.map(s=>({name:s.name,amount:Number(s.amount||0)})):[],subTotal:N9(t),itemDiscount:Number(t?.ItemDiscount||t?.ItemsDiscount||0),serviceCharge:Number(t?.ServiceCharge||0),additionalDiscount:Number(t?.Discount||0),cardCharge:Number(t?.CardCharge||0),vat:zD(t),rounding:Number(t?.Rounding||t?.RoundingV2||0),grandTotal:Number(t?.GrandTotal||0),shift:String(t?.ShiftWork||"-"),cashier:String(t?.User||t?.Cashier||"-"),items:r,voided:t?.IsDeleted===!0,voidAt:(()=>{const s=t?.voidAt;if(!s)return"";const i=Ne(s);return i.isValid()?i.format("HH:mm:ss DD-MM-YYYY"):String(s)})(),voidReason:String(t?.voidReason||"")}}class FPe extends Ii{printOrderSummary(e){return this.print_data=this.withPayload(e),this}withPayload(e){const n=Array.isArray(e?.receipts)?e.receipts:[],r=n.filter(b=>!b?.IsDeleted),s=n.filter(b=>b?.IsDeleted),i=r.reduce((b,w)=>b+Number(w?.CustomerCount||0),0),o=r.reduce((b,w)=>b+N9(w),0),a=r.reduce((b,w)=>b+Number(w?.ItemDiscount||0),0),c=r.reduce((b,w)=>b+Number(w?.ServiceCharge||0),0),l=r.reduce((b,w)=>b+Number(w?.Discount||0),0),d=D9(r),h=r.reduce((b,w)=>b+Number(w?.GrandTotal||0),0),p=s.reduce((b,w)=>b+Number(w?.GrandTotal||0),0),g=this.aggregatePaymentType(r),_=this.aggregateShift(r),v=this.aggregateCashier(r);return[{name:"PrintTitle",value:e?.store?.name||"-"},{name:"LineFeed",value:!0},{name:"PrintTitle",value:"(BACK DATE REPORT)"},{name:"LineFeed",value:!0},{name:"Report",value:"Summary Income"},{name:"Date",value:e?.reportDateText||Ne().format("D MMMM YYYY")},{name:"Time",value:e?.reportTimeText||"all day"},{name:"LineFeed",value:!0},{name:"PrintLine",value:!0},{name:"LineFeed",value:!0},{name:"PrintTitle",value:`Summary (${r.length} bills)`},{name:"LineFeed",value:!0},...ln().enableCustomerMode?[{name:"Customer ",value:i},{name:"LineFeed",value:!0}]:[],{name:"Total",value:this.amount(o)},{name:"Discount Items",value:this.amount(a)},{name:"Service",value:this.amount(c)},{name:"Discount Bill",value:this.amount(l)}
157,...d.exclusive?[{name:"VAT (Exclusive)",value:this.amount(d.exclusive)}]:[],...d.inclusive?[{name:"VAT (Inclusive)",value:this.amount(d.inclusive)}]:[],{name:"PrintLine",value:!0},{name:"Grand Total",value:`*** ${this.amount(h)}`},{name:"PrintDoubleLine",value:!0},{name:"LineFeed",value:!0},{name:"PrintComment",value:`Voided ${s.length} bills,${this.amount(p)}`},{name:"LineFeed",value:!0},{name:"PrintTitle",value:"By Payment type"},...g,{name:"LineFeed",value:!0},{name:"PrintTitle",value:"By shift"},..._,{name:"LineFeed",value:!0},{name:"PrintTitle",value:"By cashier"},...v,{name:"LineFeed",value:!0},{name:"PrintLine",value:!0},{name:"LineFeed",value:!0},{name:"PrintComment",value:"Back Date Report"},{name:"PrintComment",value:`Print at ${Ne().format("HH:mm:ss D MMMM YYYY")}`},{name:"LineFeed",value:!0},{name:"PrintComment",value:"****** BACK DATE REPORT *****"},{name:"LineFeed",value:!0},{name:"LineFeed",value:!0},{name:"PrintLine",value:!0},{name:"LineFeed",value:!0}]}amount(e){return rT()?` ${nT}`:` ${Mo(Number(e||0),2,!0)}`}aggregatePaymentType(e){const n=new Map;for(const r of e){const s=Array.isArray(r?.multiplePayment)&&r.multiplePayment.length?r.multiplePayment.map(i=>({name:String(i?.name||i?.type||"Unknown"),amount:Number(i?.amount||i?.inputAmount||0)})):[{name:String(r?.PaymentType||"Unknown"),amount:Number(r?.GrandTotal||0)}];for(const i of s){const o=n.get(i.name)||{total:0,count:0};o.total+=i.amount,o.count+=1,n.set(i.name,o)}}return Array.from(n.entries()).map(([r,s])=>({name:`${r} (${s.count})`,value:this.amount(s.total)}))}aggregateShift(e){const n=new Map;for(const r of e){const s=String(r?.ShiftWork||"-");n.set(s,(n.get(s)||0)+Number(r?.GrandTotal||0))}return Array.from(n.entries()).map(([r,s])=>({name:`Shift ${r}`,value:this.amount(s)}))}aggregateCashier(e){const n=new Map;for(const r of e){const s=String(r?.User||r?.Cashier||"-");n.set(s,(n.get(s)||0)+Number(r?.GrandTotal||0))}return Array.from(n.entries()).map(([r,s])=>({name:r,value:this.amount(s)}))}}const ng=t=>{const e=Number(t);return Number.isFinite(e)?e:0},OC=(t,e="Id",n="Name")=>t?.[e]!=null&&t?.[e]!==""?String(t[e]):String(t?.[n]??"");function BPe(){return{summarizeAmountByTypeFromSubItems:(e,n={})=>{const{dropZeroSubItems:r=!0,dropZeroCatalogs:s=!0}=n,o=Object.entries(e??{}).flatMap(([c,l])=>Object.values(l??{}).filter(Array.isArray).flatMap(d=>d).map(d=>({typeKey:c,catalog:d}))).reduce((c,{typeKey:l,catalog:d})=>{const h=c[l]??={totalamount:0,catalogMap:{}},p=OC(d,"Id","Name"),g=h.catalogMap[p]??={id:d?.Id,name:d?.Name,type:d?.Type??l,row:d?.Row,subMap:{}};return(Array.isArray(d?.Items)?d.Items:[]).forEach(v=>{const b=Array.isArray(v?.SubItems)?v.SubItems:[];if(b.length===0)return;const w=String(v?.Name??""),E=OC(v,"Id","Name");b.forEach(T=>{const R=OC(T,"Id","Name"),N=String(T?.Name??"").trim(),O=g.subMap[R]??={id:T?.Id,name:N||w,itemName:w,subName:N,itemKey:E,quantity:0,amount:0};O.quantity+=ng(T?.quantity),O.amount+=ng(T?.amount)})}),c},{});return Object.entries(o).reduce((c,[l,d])=>{const p=Object.values(d.catalogMap).map(_=>{const v=Object.values(_.subMap).filter(w=>r?ng(w.quantity)>0:!0),b=v.reduce((w,E)=>w+ng(E.amount),0);return{id:_.id,name:_.name,type:_.type,row:_.row,totalamount:b,subItems:v}}).filter(_=>s?(_.subItems?.length??0)>0:!0).sort((_,v)=>{const b=Number(_?.row),w=Number(v?.row),E=Number.isFinite(b),T=Number.isFinite(w);return E&&T?b-w:E?-1:T?1:0}),g=p.reduce((_,v)=>_+ng(v.totalamount),0);return c[l]={totalAmount:g,items:p},c},{})}}}function O9(t=[],e={}){const r=(Array.isArray(t)?t:[]).filter(i=>i?.groupByType&&i?.name).reduce((i,{name:o,groupByType:a})=>{const c=i[o]??(i[o]={});for(const[l,d]of Object.entries(a||{}))(c[l]??=[]).push(d);return i},{}),{summarizeAmountByTypeFromSubItems:s}=BPe();return s(r,e)}function $Pe(t={}){return Object.entries(t).map(([e,n])=>({label:x9(e),value:Number(n?.totalAmount||0)}))}function UPe(t={}){return Object.entries(t).flatMap(([e,n])=>(n?.items||[]).map(r=>{const s=new Map;for(const a of r?.subItems||[]){const c=String(a?.itemName||r?.name||"-"),l=String(a?.itemKey||c),d=s.get(l)??{itemName:c,subItems:[]};d.subItems.push({subName:String(a?.subName||a?.name||""),qty:Number(a?.quantity||0),amount:Number(a?.amount||0)}),s.set(l,d)}const i=Array.from(s.values()),o=i.flatMap(({itemName:a,subItems:c})=>{const l=c.filter(p=>Number(p.qty)>0),d=l.length===1?l[0]:null,h=!!d&&(d.subName||"").trim().toLowerCase()==="regular";return l.map(p=>({name:h?a:`${a} (${p.subName}
157)`,itemName:a,subName:p.subName,qty:p.qty,amount:p.amount}))});return{typeName:x9(e),productName:String(r?.name||"-"),total:Number(r?.totalamount||0),items:i,subs:o}}))}function x9(t){const e=String(t||"").toLowerCase();return e.charAt(0).toUpperCase()+e.slice(1)}const HPe=t=>t.trim().toLowerCase()==="regular";function L9(t,e){const n=(t.subItems||[]).filter(i=>Number(i.qty)>0);if(!n.length)return[];const r=n.length===1?n[0]:null,s=!!r&&HPe(r.subName||"");return n.map(i=>({name:s?`${i.qty} ${t.itemName}`:`${i.qty} ${t.itemName} (${i.subName})`,value:e(i.amount)}))}class qPe extends Ii{printProductSummary(e){return this.print_data=this.withPayload(e),this}withPayload(e){const n=Ne(),r=e.topCommentText||`****** à¸à¸´à¸¡à¸à¹à¸¢à¹à¸à¸à¸«à¸¥à¸±à¸ ${n.format("HH:mm DD/MMM/YY")}*****`,s=e.reportName||"Product Sold",i=e.printedAtText||n.format("DD MMMM YYYY HH:mm"),o=O9(e.sumProductType||[],{dropZeroCatalogs:!1,dropZeroSubItems:!1}),a=$Pe(o),c=UPe(o),l=a.length?a:e.byType||[],d=c.length?c:e.details||[],h=[{name:"PrintComment",value:r},{name:"LineFeed",value:!0},{name:"LineFeed",value:!0},{name:"PrintTitle",value:e.storeName||"-"},{name:"LineFeed",value:!0},{name:"From",value:e.fromText||"-"},{name:"To",value:e.toText||"-"},{name:"Printed at",value:i},{name:"Report",value:s},{name:"LineFeed",value:!0},{name:"PrintLine",value:!0},{name:"LineFeed",value:!0},{name:"PrintTitle",value:"Products by type"},{name:"LineFeed",value:!0},...l.map(p=>({name:p.label,value:this.amount(p.value)})),{name:"LineFeed",value:!0},{name:"Total",value:`*** ${this.amount(e.totalAmount)}`},{name:"LineFeed",value:!0},{name:"PrintComment",value:"à¹à¸¡à¹à¸£à¸§à¸¡à¸ªà¹à¸§à¸à¸¥à¸à¸à¹à¸²à¸¢à¸à¸´à¸¥/Service/VAT"},{name:"LineFeed",value:!0},{name:"PrintLine",value:!0},{name:"LineFeed",value:!0},{name:"PrintTitle",value:"Detail"},{name:"LineFeed",value:!0}];return d.forEach(p=>{h.push({name:"PrintComment",value:`*** ${p.typeName} : ${p.productName} :${this.amount(p.total)}`});const g=Array.isArray(p.items)&&p.items.length?p.items:(p.subs||[]).map(_=>({itemName:_.itemName||_.name,subItems:[{subName:_.subName||"",qty:_.qty,amount:_.amount}]}));for(const _ of g){const v=L9(_,b=>this.amount(b));for(const b of v)h.push(b)}h.push({name:"LineFeed",value:!0}),h.push({name:"LineFeed",value:!0})}),h.push({name:"PrintComment",value:r}),h.push({name:"LineFeed",value:!0}),h.push({name:"LineFeed",value:!0}),h}amount(e){return rT()?` ${nT}`:` ${Mo(Number(e||0),2,!0)}`}}class jPe extends Ii{printStockMovement(e){return this.print_data=this.withPayload(e),this}withPayload(e){const n=Ne(),r=e.printAtShort||`${n.format("HH:mm:ss")} @ ${n.format("DD/MM/YY")}`,s=e.printAtLong||`${n.format("HH:mm:ss")} ${n.format("DD MMMM YYYY")}`,i=Array.isArray(e.groups)?e.groups:[],o=[{name:"PrintTitle",value:e.storeName||"-"},{name:"LineFeed",value:!0},{name:"Date from",value:e.dateFrom||"-"},{name:"Date to",value:e.dateTo||"-"},{name:" ",value:`length ${e.lengthDays||0} days`},{name:"Print At",value:r},{name:"Report",value:e.reportName||"Inventory"},{name:"LineFeed",value:!0},{name:"PrintLine",value:!0},{name:"LineFeed",value:!0}];for(const a of i){o.push({name:"PrintComment",value:` ---- [${a.name||"Unknown"}] ----`}),o.push({name:"LineFeed",value:!0});for(const c of a.rows||[])o.push({name:"PrintTextLine",value:`${c.name||"-"}${c.unit?` (${c.unit})`:""}`}),o.push({name:"PrintTextLine",value:` begin : ${this.amount(c.begin)}${this.unitText(c.unit)}`}),o.push({name:"PrintTextLine",value:` add : ${this.amount(c.add)}${this.unitText(c.unit)}`}),o.push({name:"PrintTextLine",value:` sold : ${this.amount(this.soldAsNegative(c.sold))}${this.unitText(c.unit)}`}),o.push({name:"PrintTextLine",value:` balance : ${this.amount(c.balance)}${this.unitText(c.unit)}`}),o.push({name:"LineFeed",value:!0});o.push({name:"LineFeed",value:!0})}return o.push({name:"PrintComment",value:`stock movement : ${i.reduce((a,c)=>a+(c.rows?.length||0),0)} items.`}),o.push({name:"PrintComment",value:" "}),o.push({name:"PrintComment",value:`Print at ${s}`}),o}amount(e){return Mo(Number(e||0),2,!0)}soldAsNegative(e){const n=Number(e||0);return n===0?0:n>0?-n:n}unitText(e){return e?` ${e}`:""}}const WPe=function(){const t=(s,i,o=0)=>{let a={start:{amount:0,timeText:"11:45 06/Oct",count:0},deposit:{amount:0,note:"",count:0},withdraw:{amount:0,count:0},returned:{amount:0,note:"",count:0},actualCash:{amount:o,count:0}};const c=Object.values(s).filter(E=>E.type==pt.DRAWER),l=Object.values(s).filter(E=>E.type==pt.OPEN_SHOP);Object.values(s).filter(E=>E.type==pt.CLOSE_SHOP);const d=l.reduce((E,T)=>(E.start.amount=T.cashInitalAmount||0,E.start.timeText=Ne(T.timestamp).format("HH:mm DD/MM"),E.start.count+=1,E),a),h=c.reduce((E,T)=>(T.mode=="deposit"&&(E.deposit.amount+=T.amount||0,E.deposit.count+=1),T.mode=="withdraw"&&(E.withdraw.amount+=T.amount||0,E.withdraw.count+=1),T.mode=="start"&&(E.start.amount=T.cashInitalAmount||0,E.start.count+=1),E),a),g=i.filter(E=>n(E)).reduce((E,T)=>{const R=r(T);return R>0&&(E.returned.amount+=R,E.returned.count+=1),E},a),_=i.filter(E=>!n(E));let v=e(_)||{amount:0,count:0};const b=a.start.amount+a.deposit.amount+v.amount-a.withdraw.amount,w=a.actualCash.amount-b;return a={...d,...h,...g,drawerTotal:b,diff:w,cashPayment:v},a},e=s=>{let i={amount:0,count:0};
157return s.forEach(o=>{const a=r(o);a>0&&(i.amount+=a,i.count+=1)}),i},n=s=>s?.IsDeleted===!0||s?.voided===!0||s?.status==="voided"||s?.billing?.voided===!0,r=s=>{const i=s?._custom?.value||s,o=d=>String(d||"").trim().toLowerCase()==="cash",a=d=>Number(d||0)||0,c=d=>d?.type||d?.name||d?.paymentId,l=d=>d.reduce((h,p)=>o(c(p))?h+a(p?.amount):h,0);if(typeof i?.PaymentType=="string"){const d=i.PaymentType.trim();if(d.startsWith("[")&&d.endsWith("]"))try{const h=JSON.parse(d);if(Array.isArray(h)&&h.length>0)return l(h)}catch{}if(o(d))return a(i?.GrandTotal)}return Array.isArray(i?.multiplePayment)&&i.multiplePayment.length>0?l(i.multiplePayment):Array.isArray(i?.payment)&&i.payment.length>0?l(i.payment):0};return{excute:t}},GPe=()=>({execute:(s,i)=>{const o=Qe.reduce(i,(c,l)=>(Qe.forEach(l.OrderItems,d=>{c[d.subItemId]?(c[d.subItemId].amount+=d.discountedPrice,c[d.subItemId].quantity+=d.quantity):c[d.subItemId]={name:d.name,amount:d.discountedPrice,quantity:d.quantity}}),c),{});return console.log("receiptsHolder=>",o),s.map(c=>({...c,Items:c.Items.map(l=>({...l,SubItems:l.SubItems.filter(d=>o[d.Id]).map(d=>({...d,Name:d.Name,amount:o[d.Id]?.amount||0,quantity:o[d.Id]?.quantity||0}))}))}))},catalogMapping:(s,i)=>{const o={...i};return s.map(a=>({...a,Items:a.Items.map(c=>({...c,SubItems:c.SubItems.filter(l=>o[l.Id]).map(l=>({...l,Name:l.Name,amount:o[l.Id]?.amount||0,quantity:o[l.Id]?.quantity||0}))}))}))},sumProductByType:s=>{const i={};for(let a of s){const c=a.Type||"Unknown";i[c]==null&&(i[c]={name:a.Type,total:0,groupByType:[]});for(let l of a?.Items)for(let d of l?.SubItems)i[c].total+=d.amount,i[c].groupByType.push(a)}const o=Object.values(i).map(a=>({...a,groupByType:Qe.uniqBy(a.groupByType,c=>c?.Id??c?.id)}));return console.log("sumProductWithCategory=>",o),o},calcPercentProductTypeAndSort:s=>{const i=s.reduce((l,d)=>l+(Number(d.total)||0),0),o=i===0?1:i,a=["food","drink","dessert","other"],c=l=>{const d=a.indexOf(String(l||"").toLowerCase());return d===-1?a.length:d};return s.map(l=>{const d=Number(l.total)||0,h=+(d/o*100).toFixed(2);return{name:l.name,total:d,percent:h,groupByType:l.groupByType}}).sort((l,d)=>{const h=c(l.name)-c(d.name);return h!==0?h:String(l.name).localeCompare(String(d.name))})}}),M9=qn("report",{state:()=>({}),getters:{},actions:{printSummary({isFullReport:t=!1,receiptsPayload:e=[],startDatePayload:n=null,actualCash:r=0,isCloseShop:s=!1,isLocalOnly:i=!1,isChangeShift:o=!1,outstanding:a=null}){const c=Mi();bn();const l=ln(),d=qr(),h=tt();let p=c.receipts;e.length>0&&(p=e);const _=Object.values(h.jobs).find(T=>T.type==pt.OPEN_SHOP),v=WPe().excute(h.jobs,p,r),b=OPe(p).summary.value,w={...v},E={store:{name:l.getStoreName()},employee:d.getCurrentEmployee,receipts:p,drawerData:w,isFullReport:t,isCloseShop:s,isChangeShift:o,outstanding:a,isLocalOnly:i,startDate:_?.timestamp,paymentSummaryList:b};return console.log("printSummary...",E),E},printOrderSummary({receiptsPayload:t=[],reportDateText:e="",reportTimeText:n="all day"}){const r=Mi(),s=ln(),i=qr();let o=r.receipts;t.length>0&&(o=t);const a={store:{name:s.getStoreName()},employee:i.getCurrentEmployee,receipts:o,reportDateText:e,reportTimeText:n};new FPe("/printcustom").printOrderSummary(a).print(),console.log("printOrderSummary...",a)},printProductSummary(t){new qPe("/printcustom").printProductSummary(t).print(),console.log("printProductSummary...",t)},printStockMovement(t){new jPe("/printcustom").printStockMovement(t).print(),console.log("printStockMovement...",t)},printProductSold({isFullReport:t=!1,reportProductSummary:e={},isCloseShop:n=!1,isChangeShift:r=!1}){const s=tt(),i=qr(),o=Mi(),a=ol(),c=ln(),l=GPe(),h=Object.values(s.jobs).find(N=>N.action==pt.OPEN_SHOP),p=(N,O)=>{if(Array.isArray(N)){const S=String(N?.[0]??O??"").trim();return S?{id:S,value:{name:String(N?.[1]??""),quantity:Number(N?.[2]??0),amount:Number(N?.[3]??0)}}:null}if(N&&typeof N=="object"){const S=String(N?.subItemId??N?.id??O??"").trim();return S?{id:S,value:{name:String(N?.name??""),quantity:Number(N?.quantity??0),amount:Number(N?.amount??0)}}:null}return null},_=(N=>{const O={};if(!N)return O;
157if(!Array.isArray(N)&&typeof N=="object"){for(const[S,I]of Object.entries(N)){const P=p(I,S);P&&(O[P.id]=P.value)}return O}if(Array.isArray(N)){for(const S of N){const I=p(S);I&&(O[I.id]=I.value)}return O}return O})(e),v=_&&Object.keys(_).length>0,b=(o.receipts||[]).filter(N=>!N?.IsDeleted),w=v?l.catalogMapping(a.catalogs,_):l.execute(a.catalogs,b),E=l.sumProductByType(w),T=l.calcPercentProductTypeAndSort(E),R={store:{name:c.getStoreName()},employee:i.getCurrentEmployee,productsTypeHolder:a.getProductTypeHolderWithCatalogId,isFullReport:t,isCloseShop:n,isChangeShift:r,startDate:h?.timestamp,productReportData:w,sumProductType:T};return console.log("payload=>",R),R},printVoidItems({isCloseShop:t=!1,isChangeShift:e=!1}={}){const n=bn(),r=qr(),s=tt(),o=Object.values(s.jobs).filter(d=>d.type==pt.VOID||d.type==pt.VOID_TOPPING);let a=[];for(let d of o){const h=d?.json2||{};for(let p of d?.__items||[]){const g=Number(h[p.uuid]||0),_=Math.abs(g||p.quantity||0);a.push({subItemId:p.subItemId,name:p.name,quantity:_,table:d.alias,timestamp:d.timestamp,price:p?.price||0})}}a=Qe.orderBy(a,["timestamp"],["asc"]);const c=Qe.reduce(a,(d,h)=>d+h.quantity*h.price||0,0),l={store:n.data,employee:r.getCurrentEmployee,voidItemsList:a,voidAmount:c,isCloseShop:t,isChangeShift:e};return console.log("printVoid...",l),l},printOpenMenu({isCloseShop:t=!1,isChangeShift:e=!1}={}){const n=ln(),r=Mi(),s=qr(),i=r.receipts,o={store:{name:n.getStoreName()},employee:s.getCurrentEmployee,receipts:i,isCloseShop:t,isChangeShift:e};return console.log("printOpenMenu...",o),o}}}),bn=qn("shop",{state:()=>({storeId:"",data:{Id:0,Logo:null,Name:"",CreateDate:"",ExpireDate:"",Reference:null,PromotionCode:"",IsTrial:!1,Remarks:null,PackagePlan:""},is2ndCashier:!1,runMode:null,closeStateCompleted:{refreshReceipts:!1,syncData:!1,sendEmailDaily:!1,sendSmsDaily:!1,closingBatch:!1}}),getters:{getStoreId:t=>t.storeId,getRunMode:t=>t.runMode,isRestrictedMode:t=>t.runMode==="terminal"||t.runMode==="readonly"},actions:{init(){oo({resource:"customerInfo",refetch:()=>Ot().customers.fetch(),applyToStore:t=>{t&&(this.data=t)}})},async loadRunMode(){const t=localStorage.getItem(`runMode_${this.storeId}`);if(t==="cashier"||t==="terminal"||t==="readonly"||t==="2nd_cashier"){this.runMode=t;return}this.runMode=null},setRunMode(t){if(this.runMode=t,t==null){localStorage.removeItem(`runMode_${this.storeId}`);return}localStorage.setItem(`runMode_${this.storeId}`,t)},clearCashierModeBecauseOwnershipLost(){this.runMode!=="cashier"&&this.runMode!=="2nd_cashier"||(this.runMode=null,localStorage.removeItem(`runMode_${this.storeId}`))},async checkIs2ndCashier(){try{const n=await(await fetch("http://localhost:9090/api/2ndcashier")).json();this.is2ndCashier=n.is2ndCashier||!1}catch(t){console.log(t),this.is2ndCashier=!1}},async openShop(t,{cashInitalAmount:e=0,businessDate:n=null}={}){if(t=="cashier"){const r=ln().getSystemEnvByName("BusinessMode")?.Value||"0",s=Number(r)||0,i=Ne(),o=n||(s==1?i.add(-7,"hour").format("YYYY-MM-DD"):i.format("YYYY-MM-DD")),a=new ou().withCashInitalAmount(e).withJobIdAndTimestamp(wi().nowISO()).withActionType(pt.OPEN_SHOP).withCustom({businessDate:o}).build();tt().add(a,!0);try{const c=rr().getRootDataRef();await Ws(c,{status:"opened",opened:i.toISOString(),closed:vS(),businessMode:s,live:{businessMode:s,businessDate:o}},{merge:!0})}catch(c){console.error("openShop: failed to update customer doc",c)}}},async closeShop(t){if(this.runMode!=="cashier"){const{$i18n:s}=xt();await Or.fire({icon:"warning",title:s?.t("closeShop.secondCashierBlock.title")??"à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸´à¸à¸£à¹à¸²à¸à¹à¸à¹",text:s?.t("closeShop.secondCashierBlock.text")??"à¸à¸´à¸à¸£à¹à¸²à¸à¹à¸à¹à¹à¸à¸à¸²à¸°à¹à¸à¸£à¸·à¹à¸à¸à¹à¸à¸à¹à¸à¸µà¸¢à¸£à¹à¸«à¸¥à¸±à¸à¹à¸à¹à¸²à¸à¸±à¹à¸"});return}const e=tt().tables||{},n=Object.keys(e).length;if(n>0){await Or.fire({icon:"warning",title:"มีà¹à¸à¹à¸°à¸à¸µà¹à¸¢à¸±à¸à¹à¸¡à¹à¹à¸à¹à¸à¸´à¸",text:`à¸à¸£à¸¸à¸à¸²à¹à¸à¸¥à¸µà¸¢à¸£à¹à¹à¸à¹à¸°à¹à¸«à¹à¸«à¸¡à¸à¸à¹à¸à¸à¸à¸´à¸à¸£à¹à¸²à¸ (à¹à¸«à¸¥à¸·à¸à¸à¸¢à¸¹à¹ ${n} à¹à¸à¹à¸°)`});return}this.resetCloseStateCompleted();let r=!1;try{const s=tt().getBusinessDate();await Mi().flushOfflineMutations(),await Mi().refreshFromServer(s,s)}catch(s){r=!0,console.error("close-shop receipts sync/refresh from server failed â printing LOCAL ONLY:",s)}await new Promise(s=>Qe.delay(s,1e3)),this.closeStateCompleted.refreshReceipts=!r;try{await this.printReport(t,{localOnly:r})}catch(s){console.error("printReport failed, continuing:",s)}await this.addCloseJobCard();try{await this.syncOfflineDataOrThrow()}catch(s){console.error("Failed to sync close-shop data before cleanup:",s),Or.fire({icon:"error",title:"à¸à¸±à¸à¸à¸¶à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸´à¸à¸£à¹à¸²à¸à¸à¸¶à¹à¸ cloud ยัà¸à¹à¸¡à¹à¸à¸£à¸ ระà¸à¸à¸¢à¸±à¸à¹à¸¡à¹à¸¥à¹à¸²à¸à¸à¹à¸à¸¡à¸¹à¸¥ à¸à¸£à¸¸à¸à¸²à¸¥à¸à¸à¸à¸´à¸à¸£à¹à¸²à¸à¸à¸µà¸à¸à¸£à¸±à¹à¸"});return}this.closeStateCompleted.syncData=!0,await new Promise(s=>Qe.delay(s,1e3)),await this.sendEmailDaily(),await this.sendSmsDaily(),await this.updateCloseSummary(),await this.clearCloudData(),this.closeStateCompleted.closingBatch=!0,await Or.fire({icon:"success",title:"à¸à¸´à¸à¸£à¹à¸²à¸à¹à¸£à¸µà¸¢à¸à¸£à¹à¸à¸¢ / Closing Complete",confirmButtonText:"OK"}),window.location.reload()},printReport(t,{localOnly:e=!1,isChangeShift:n=!1,outstanding:r=null}={}){const s=M9(),{cash:i,income:o,incomeDetail:a,product:c,productDetail:l,voidBill:d,openMenu:h,reportProductSummary:p}=t;console.log("print report income");for(let g=0;g<o;
157g++)s.printSummary({isFullReport:!1,actualCash:parseFloat(i),isCloseShop:!0,isLocalOnly:e,isChangeShift:n,outstanding:r});console.log("print report income detail");for(let g=0;g<a;g++)s.printSummary({isFullReport:!0,isCloseShop:!0,isLocalOnly:e,isChangeShift:n,outstanding:r});for(let g=0;g<c;g++)s.printProductSold({isFullReport:!1,reportProductSummary:p,isCloseShop:!0,isChangeShift:n});console.log("print report product detail");for(let g=0;g<l;g++)s.printProductSold({isFullReport:!0,reportProductSummary:p,isCloseShop:!0,isChangeShift:n});console.log("print report void");for(let g=0;g<d;g++)s.printVoidItems({isCloseShop:!0,isChangeShift:n});console.log("print report open menu");for(let g=0;g<h;g++)s.printOpenMenu({isCloseShop:!0,isChangeShift:n})},resetCloseStateCompleted(){this.closeStateCompleted={refreshReceipts:!1,syncData:!1,sendEmailDaily:!1,sendSmsDaily:!1,closingBatch:!1}},async syncOfflineDataOrThrow(){const t=Ot(),e=tt(),n=Mi();await e.syncPendingJobs();const r=e.getPendingJobs();if(r.length)throw new Error(`Pending jobs remain: ${r.length}`);await n.syncPendingReceipts();const s=n.getPendingReceipts();if(s.length)throw new Error(`Pending receipts remain: ${s.length}`);await ZS(t);const i=y9();if(i.length)throw new Error(`Pending activities remain: ${i.length}`)},async saveReceiptsToDbAsync(t){},async addCloseJobCard(){const t=tt().getBusinessDate(),e=qr().getCurrentEmployee,n=tt().getShift();let r=new ou().withActionType(pt.CLOSE_SHOP).withEmployee(e).withJobIdAndTimestamp(wi().nowISO()).withCustom({businessDate:t,shift:n}).build();tt().add(r,!0)},async addChangeShiftJobCard(){const t=tt(),e=t.getBusinessDate(),n=qr().getCurrentEmployee,r=t.getShiftNumber(),s=r+1,i=new ou().withActionType(pt.CHANGE_SHIFT).withEmployee(n).withJobIdAndTimestamp(wi().nowISO()).withCustom({businessDate:e,fromShift:r,toShift:s}).build();tt().add(i,!0)},async changeShift(t={}){const e=tt(),n=Mi();let r=!1;try{const c=e.getBusinessDate();await n.flushOfflineMutations(),await n.refreshFromServer(c,c)}catch(c){r=!0,console.warn("[changeShift] offline / refresh failed â printing local data:",c)}const s=Object.values(e.tables||{}).filter(c=>(c?.items?.length||0)>0),i={count:s.length,total:s.reduce((c,l)=>c+(Number(l?.billing?.grandTotal)||0),0)};["income","incomeDetail","product","productDetail","voidBill","openMenu"].some(c=>Number(t?.[c])>0)&&this.printReport({cash:"0",...t},{localOnly:r,isChangeShift:!0,outstanding:i}),await this.addChangeShiftJobCard()},async sendEmailDaily(){const t=tt().getBusinessDate(),e=ln().getStoreName(),n="YYYY-MM-DD HH:mm:ss",r=tt().getFirstJob()?.timestamp||Ne().format(n),s=Ne(r).format(n);if(!this.data?.Id){console.log("Not found customer id."),this.closeStateCompleted.sendEmailDaily=!0;return}try{const i=Ot(),o=await i.customerEmails.fetch(),a=Array.isArray(o)?o.map(l=>l.Email).filter(Boolean).join(","):"";if(!a){console.log("Not found customer emails."),this.closeStateCompleted.sendEmailDaily=!0;return}console.log("toEmails=>",a);const c={startDate:t,endDate:t,customerId:this.data?.Id,shopName:e,openShop:s,timestamp:Ne().format("YYYY-MM-DD HH:mm:ss"),to:a};await i.emailDaily.post(c)}catch(i){console.error("sendEmailDaily failed, continuing close-shop flow:",i)}this.closeStateCompleted.sendEmailDaily=!0},async sendSmsDaily(){const t=tt().getBusinessDate(),e=ln().getStoreName();if(!this.data?.Id){console.log("Not found customer id."),this.closeStateCompleted.sendSmsDaily=!0;return}const n=ln().getSystemEnvByName("SmsReport");if(!n||!n.Value){console.log("Not found SmsReport setting, skip SMS."),this.closeStateCompleted.sendSmsDaily=!0;return}try{const r={startDate:t,endDate:t,shopName:e};await Ot().sms.post(r)}catch(r){console.error("sendSmsDaily failed, continuing close-shop flow:",r)}this.closeStateCompleted.sendSmsDaily=!0},async updateCloseSummary(){const t=ln().getSystemEnvByName("BusinessMode")?.Value||"0",e=Number(t)||0,n=Ne(),r=tt().getBusinessDate()||n.format("YYYY-MM-DD"),s=rr().getSummaryCollectionRef(),i=$n(s,r);await Ws(i,{closed:n.format("YYYY-MM-DDTHH:mm:ss")},{merge:!0});try{const o=rr().getRootDataRef();await Ws(o,{status:"closed",closed:n.toISOString(),opened:vS(),businessMode:e,live:{businessMode:e,businessDate:r}},{merge:!0})}catch(o){console.error("closeShop: failed to update customer doc",o)}},async clearCloudData(){const t=Ze().jobchainRef();await Ue(t,null);const e=Ze().tablesRef();await Ue(e,null);const n=Ze().tablesStateRef();await Ue(n,null);const r=Ze().tablesV2Ref();await Ue(r,null);const s=Ze().tablesV3Ref();await Ue(s,null);const i=Ze().tablesV2HistoryRef_OLD();await Ue(i,null);const o=Ze().mobileV2HistoryRef();await Ue(o,null);const a=Ze().billNumberRef();await Ue(a,null);const c=Ze().billNumberRef_OLD();await Ue(c,null);const l=Ze().jobMobileRef();await Ue(l,null);const d=Ze().jobHandshakeRef();await Ue(d,null);const h=this.storeId;if(h)try{await PAe(String(h))}catch(p){console.warn("[closeShop] clearOfflineRuntime failed",p)}}}});var sn=(t=>(t.CUSTOMER_MODE="CustomerMode",t.IS_LOCK_ENABLE="IsLockEnable",t.PRINT_MOVE_TABLE="PrintMoveTable",t.SMS_REPORT="SmsReport",t.USE_JOB="UseJob",t.USE_COMBO_SET="UseComboSet",t.VOID_ON_MOBILE="VoidOnMobile",t.PRINT_PREVIEW_REMOTE="PrintPreviewRemote",t.SHOP_NAME="ShopName",t.ROOM_ENABLE="RoomEnable",t.SHOW_ITEM_DISCOUNT="ShowItemDiscount",t.PRINT_SHOW_PRICE="PrintShowPrice",t.NO_ROUND_UP="NoRoundUp",t.BILLING_PATTERN="BillingPattern",t))(sn||{});const ln=qn("settings",()=>
157{const t=Ae([]),e=Ae(!1),n=Ae({}),r=Ae({}),s=Ae(!1),i=Ae([]),o=Ae(null),a=Y=>{t.value=Y,ce()},c=()=>{oo({resource:"settings",refetch:()=>Ot().settings.fetch(),applyToStore:Y=>a(Y)})},l=Y=>{let ve=t.value.filter(Ee=>Ee.Name==Y);return ve=Qe.sortBy(ve,[function(Ee){return Ee.Id}]),ve.length>0?ve[0]:null},d=$e(()=>ie()),h=$e(()=>{const Y={};for(const ve of t.value||[])ve?.Name!=null&&(Y[ve.Name]=ve.Value);return Y}),p=$e(()=>h.value[sn.SHOP_NAME]||""),g=$e(()=>h.value[sn.PRINT_MOVE_TABLE]==="1"||h.value[sn.PRINT_MOVE_TABLE]==="true"),_=$e(()=>e.value),v=$e(()=>h.value[sn.CUSTOMER_MODE]==="true"||h.value[sn.CUSTOMER_MODE]==="1"),b=$e(()=>h.value[sn.IS_LOCK_ENABLE]==="true"||h.value[sn.IS_LOCK_ENABLE]==="1"),w=$e(()=>h.value[sn.SMS_REPORT]==="true"||h.value[sn.SMS_REPORT]==="1"),E=$e(()=>h.value[sn.USE_JOB]==="true"||h.value[sn.USE_JOB]==="1"),T=$e(()=>h.value[sn.USE_COMBO_SET]==="true"||h.value[sn.USE_COMBO_SET]==="1"),R=$e(()=>h.value[sn.VOID_ON_MOBILE]==="true"||h.value[sn.VOID_ON_MOBILE]==="1"),N=$e(()=>h.value[sn.PRINT_PREVIEW_REMOTE]==="true"||h.value[sn.PRINT_PREVIEW_REMOTE]==="1"),O=$e(()=>h.value[sn.ROOM_ENABLE]==="true"||h.value[sn.ROOM_ENABLE]==="1"),S=$e(()=>h.value[sn.SHOW_ITEM_DISCOUNT]==="true"||h.value[sn.SHOW_ITEM_DISCOUNT]==="1"),I=$e(()=>h.value[sn.PRINT_SHOW_PRICE]==="true"||h.value[sn.PRINT_SHOW_PRICE]==="1"),P=$e(()=>h.value[sn.NO_ROUND_UP]==="none"||h.value[sn.NO_ROUND_UP]==="1"||h.value[sn.NO_ROUND_UP]==="true"?"none":h.value[sn.NO_ROUND_UP]==="0"||h.value[sn.NO_ROUND_UP]==="5/4"?"5/4":h.value[sn.NO_ROUND_UP]==="up"?"up":h.value[sn.NO_ROUND_UP]==="down"?"down":"5/4"),k=$e(()=>parseInt(h.value.TaxMode||"0")),L=$e(()=>parseInt(h.value.TaxRate1||"0")),M=$e(()=>parseInt(h.value.ServiceCharge||"0")),V=$e(()=>(h.value[sn.BILLING_PATTERN]||"").trim().toLowerCase()),z=()=>{t.value.find(Y=>Y.Name=="ShopName")?.Value},ie=()=>t.value.find(Y=>Y.Name=="ShopName")?.Value||"",K=()=>{const Y=t.value.find(ve=>ve.Name=="TableArray")?.Value||"";if(Y){const Ee=Y.split(",").map((Me,Ke)=>({name:String.fromCharCode(65+Ke),tableCount:parseInt(Me)}));i.value=Qe.filter(Ee,Me=>Me.tableCount>0)}else{let ve=t.value.find(Me=>Me.Name=="Table")?.Value||100;const Ee=parseInt(ve)||0;i.value=[{name:"T",tableCount:Math.max(30,Ee)}]}};function ce(){K(),z(),ee(),Te()}const G=()=>{c()},Z=()=>{QD("settings")},de=async()=>{const Y=await pe("timer");Ve(Y);const ve=await pe("togoNoService");e.value=fe(ve),ce(),s.value=!0},fe=Y=>{if(!Array.isArray(Y))return!1;const Ee=Y.find(Me=>Me.name==="togoNoService")?.value;return Ee===!0||Ee==="true"||Ee==="1"||Ee===1},ee=()=>{const Y=_r();return Y.tableBillingGlobal={sc:[0,M.value],vat:[k.value,L.value],roundingMode:P.value},Y},Te=()=>{bAe(V.value)},pe=async Y=>{const ve=`dynamoSettings_${Y}`,Ee=await BD(ve);if(Ee!=null)return Ee;const Ke={partitionKey:bn().storeId,sortKey:Y};try{const ut=await Ot().settingsDynamo.fetch(Ke)||[];return await XS(ve,ut),ut}catch(ut){return console.warn(`[settings:${ve}] fetch failed`,ut),[]}},Ce=async(Y,ve)=>{const Me=bn().storeId,Ke=await pe(Y),ut=Array.isArray(Ke)?Ke.find(re=>re.name===Y):null,H={...ut||{},customerId:Me,name:Y,value:ve};ut?await Ot().settingsDynamo.putByDynamoFormat(Me,Y,H):await Ot().settingsDynamo.postByDynamoFormat(Me,H);const j={partitionKey:Me,sortKey:Y};try{const re=await Ot().settingsDynamo.fetch(j)||[];await XS(`dynamoSettings_${Y}`,re)}catch(re){console.warn(`[settings:dynamoSettings_${Y}] post-save refetch failed`,re)}},Ve=async Y=>{if(Array.isArray(Y)&&Y.length>0){let ve=Y.find(Ee=>Ee.name==="timer");return r.value=ve?.value||{},ve?.value||{}}};return{settings:t,printTimesSetting:r,tables:i,loaded:s,init:G,finishLoad:de,refresh:Z,getStoreName:ie,storeName:d,printerSettings:n,getSystemEnvByName:l,saveDynamoSetting:Ce,fetchDynamodbSettingWithKey:pe,computeTable:K,shopName:p,printMoveTable:g,togoNoService:_,enableCustomerMode:v,isLockEnable:b,smsReport:w,isJobEnabled:E,isComboSetEnabled:T,voidOnMobile:R,printPreviewRemote:N,isRoomEnabled:O,showItemDiscount:S,printShowPrice:I,roundingMode:P,taxMode:k,taxRate:L,serviceCharge:M,billingStrategy:V,lastFetchResult:o}}),Ot=il(()=>{const t=Ae(""),e=Ae(!1),n=ve=>{t.value=ve},r=ht(null),s=ht(null),i=ht(null),o=ht(null),a=ht(null),c=ht(null),l=ht(null),d=ht(null),h=ht(null),p=ht(null),g=ht(null),_=ht
157(null),v=ht(null),b=ht(null),w=ht(null),E=ht(null),T=ht(null),R=ht(null),N=ht(null),O=ht(null),S=ht(null),I=ht(null),P=ht(null),k=ht(null),L=ht(null),M=ht(null),V=ht(null),z=ht(null),ie=ht(null),K=ht(null),ce=ht(null),G=ht(null),Z=ht(null),de=ht(null),fe=ht(null),ee=ht(null),Te=ht(null),pe=ht(null),Ce=ht(null),Ve=()=>ln().getSystemEnvByName("BusinessMode")?.Value||"0";return{customerId:t,isInited:e,setCustomerId:n,init:()=>{e.value||(e.value=!0,r.value=Ct("users","/users"),s.value=Ct("users","/users/current-user"),i.value=Ct("userChangePassword","/users"),o.value=Ct("catalogs","/catalogs"),a.value=Ct("customers","/customers"),c.value=Ct("items","/items"),l.value=Ct("subItems","/subitems"),d.value=Ct("employees","/employees"),h.value=Ct("settings","/system-environments"),p.value=Ct("toppings","/toppings"),g.value=Ct("toppingGroups","/topping-groups"),_.value=Ct("comments","/comments"),v.value=Ct("itemTags","/item-tags"),b.value=Ct("orders","/orders"),w.value=Ct("expenseGroups","/expense-groups"),E.value=Ct("expenseItems","/expense-items"),T.value=Ct("expenseTransaction","/expense-transactions"),R.value=Ct("systemEnv","/system-environments"),N.value=Ct("settingsDynamo",`/dynamodb/settings/${t.value}`),O.value=Ct("stockEmployeesPin",`/dynamodb/v1-employee-pin/${t.value}`),S.value=Ct("paymentType",`/dynamodb/payment-types/${t.value}`),I.value=Ct("productComboSet",`/dynamodb/product-set/${t.value}`),P.value={list:Ct("stockList","/stock/list"),balance:Ct("stockBalance","/stock/balance"),summary:Ct("stockSummary","/stock/summary"),individual:Ct("stockIndividual","/stock/individual"),transactions:Ct("stockTransactions","/stock/transactions")},k.value=Ct("receipts",`/receipts/${t.value}`,{businessMode:Ve}),L.value=Ct("trackSetPriceAndDiscount",`/dynamodb/track-set-price-and-discount/${t.value}`,{businessMode:Ve}),M.value=Ct("openMenu",`/dynamodb/open-menu/${t.value}`,{businessMode:Ve}),V.value=Ct("voidItems",`/dynamodb/void-items/${t.value}`,{businessMode:Ve}),z.value=Ct("activities","/dynamodb/activities"),ie.value=Ct("stockItems",`/dynamodb/stock-items/${t.value}`),K.value=Ct("stockFormula",`/dynamodb/stock-formula/${t.value}`),ce.value=Ct("toppingFormula",`/dynamodb/topping-formula/${t.value}`),G.value=Ct("receiptsSummary","/reports/receipts-summary",{businessMode:Ve}),Z.value=Ct("receiptsDaily","/reports/receipts-daily",{businessMode:Ve}),de.value=Ct("productsSummary","/reports/products-summary",{businessMode:Ve}),fe.value=Ct("productsDaily","/reports/products-daily",{businessMode:Ve}),ee.value=Ct("emailDaily","/emails/email-daily",{businessMode:Ve}),Te.value=Ct("sms","/sms",{businessMode:Ve}),pe.value=Ct("customerEmails","/customer-emails"),Ce.value=Ct("migrateStockTransactions","/migrate/stock-transactions"))},get stock(){return P.value},get stockEmployeesPin(){return O.value},get paymentType(){return S.value},get productComboSet(){return I.value},get customers(){return a.value},get userCurrent(){return s.value},get catalogs(){return o.value},get items(){return c.value},get subItems(){return l.value},get employees(){return d.value},get settings(){return h.value},get toppingItems(){return p.value},get toppingGroups(){return g.value},get comments(){return _.value},get itemTags(){return v.value},get orders(){return b.value},get users(){return r.value},get userChangePassword(){return i.value},get systemEnv(){return R.value},get expenseGroups(){return w.value},get expenseItems(){return E.value},get expenseTransaction(){return T.value},get receipts(){return k.value},get trackSetPriceAndDiscount(){return L.value},get openMenu(){return M.value},get voidItems(){return V.value},get activities(){return z.value},get settingsDynamo(){return N.value},get stockFormula(){return K.value},get toppingFormula(){return ce.value},get stockItems(){return ie.value},get receiptsSummary(){return G.value},get receiptsDaily(){return Z.value},get productsSummary(){return de.value},get productsDaily(){return fe.value},get emailDaily(){return ee.value},get sms(){return Te.value},get customerEmails(){return pe.value},get migrateStockTransactions(){return Ce.value}}}),V9="owner_mobile_locale";function KVe(){if(typeof localStorage>"u")return"en";try{const t=localStorage.getItem(V9);
157if(t==="th"||t==="en")return t}catch{}return"en"}function KPe(t){if(!(typeof localStorage>"u"))try{localStorage.setItem(V9,t)}catch{}}const zPe=10080*60*1e3,Sw=t=>{if(!t)return null;const e=t.split(".");if(e.length!==3)return null;try{const n=e[1].replace(/-/g,"+").replace(/_/g,"/"),r=n+"=".repeat((4-n.length%4)%4),s=JSON.parse(atob(r));return typeof s.exp=="number"?s.exp:null}catch{return null}},YPe=t=>{const e=Sw(t);return e===null?null:e*1e3-Date.now()},JPe=5e3,QPe=(t,e)=>{console.info("[owner-v2] init timings (ms)",t),!((t.total??0)<JPe||!vG())&&vIe("owner-v2 slow init",{level:"warning",tags:{area:"owner-v2-init"},extra:{...t,shopCount:e,online:navigator.onLine,connection:navigator.connection?.effectiveType}})},dB=(t,e=Ne())=>((Number(t)||0)===1?e.add(-7,"hour"):e).format("YYYY-MM-DD"),XPe=()=>({grandTotal:0,bills:0,voidedAmount:0,voidedBills:0}),ZPe=qn("owner-v2",{state:()=>({userData:null,selectedStoreId:"",loaded:!1,loading:!1,liveTables:{},liveTablesLoaded:!1,liveTablesLoading:!1,subscribedTablesStoreId:"",_liveTablesUnsubscribers:{},customerSummary:{},customerSummaryLoading:!1,liveSummaries:{},_liveSummaryUnsubs:{},dashboardView:"live",dashboardStartDate:"",dashboardEndDate:"",grandTotals:{},grandTotalsLoading:!1,_grandTotalRefetchTimers:{},_liveSummaryFirstSeen:{}}),actions:{async init(){const t=performance.now(),e={},n=s=>{e[s]=Math.round(performance.now()-t)},r=ua();if(await r.initAuth(),n("auth"),!r.uid.value)return co("/v2-owner-report-mobile/login");if(await this.loadUserData(),n("userDoc"),!this.selectedStoreId&&this.stores.length>0&&(this.selectedStoreId=this.stores[0].storeId,this.saveSelectedStore().catch(s=>console.warn("[owner-v2] saveSelectedStore failed",s))),this.selectedStoreId){const{setCustomerId:s,init:i}=Ot();this._applyShopAuth(this.selectedStoreId),s(this.selectedStoreId),i()}return this.subscribeAllStoresLiveSummary(),this.renewExpiringShopTokens(),this.loaded=!0,n("total"),QPe(e,this.stores.length),this.stores.length===0?co("/v2-owner-report-mobile/link-shop"):co("/v2-owner-report-mobile/dashboard")},async loadUserData(){const t=ua();if(!t.uid.value)return;const e=$n(Cn,"owner-users",t.uid.value);let n=!1,r;try{r=await qpe(e),n=r.exists()&&typeof r.data()?.shops=="object"}catch{}n||(r=await mu(e)),r?.exists()&&(this._applyUserDoc(r.data()),n&&U3(e).then(s=>{s.exists()&&t.uid.value===s.id&&this._applyServerUserDoc(s.data())}).catch(s=>console.warn("[owner-v2] user doc server refresh failed",s)))},_applyServerUserDoc(t){const e=()=>this.stores.map(i=>i.storeId).sort().join(","),n=e(),r=this.selectedStoreId,s={};for(const i of Object.values(this.userData?.shops??{}))s[i.customerId]=i.token;this._applyUserDoc(t,{keepSelection:!0});for(const i of Object.values(this.userData?.shops??{})){const o=s[i.customerId];o&&(Sw(o)??0)>(Sw(i.token)??0)&&(i.token=o)}this.loaded&&(this.selectedStoreId&&this.selectedStoreId!==r&&(this._applyShopAuth(this.selectedStoreId),Ot().setCustomerId(this.selectedStoreId)),e()!==n&&this.subscribeAllStoresLiveSummary())},_applyUserDoc(t,e={}){const n=t.shops||{},r={};for(const[s,i]of Object.entries(n))r[s]={customerId:s,shopName:i.shopName,username:i.username,role:i.role??0,accessList:typeof i.accessList=="string"&&i.accessList?i.accessList:"all",token:i.token||"",linkedAt:i.linkedAt?.toDate?.()||new Date,lastUsedAt:i.lastUsedAt?.toDate?.()||void 0};if(this.userData={uid:t.uid,createdAt:t.createdAt?.toDate?.()||new Date,selectedCustomerId:t.selectedCustomerId||null,shops:r,locale:t.locale==="th"||t.locale==="en"?t.locale:void 0,shopOrder:Array.isArray(t.shopOrder)?t.shopOrder.filter(s=>typeof s=="string"):void 0},(!e.keepSelection||!this.selectedStoreId||!r[this.selectedStoreId])&&(this.selectedStoreId=this.userData.selectedCustomerId||""),this.userData.locale){KPe(this.userData.locale);try{const s=xt().$i18n;typeof s?.setLocale=="function"?s.setLocale(this.userData.locale):s?.locale&&"value"in s.locale&&(s.locale.value=this.userData.locale)}catch{}}},async saveOwnerLocale(t){const e=ua();if(e.uid.value){this.userData&&(this.userData.locale=t);try{const n=$n(Cn,"owner-users",e.uid.value);await Ws(n,{locale:t},{merge:!0})}catch(n){console.error("[owner-v2] failed to persist locale to user doc",n)}}},async saveShopOrder(t){const e=ua();if(!e.uid.value)return;const n=this.userData?t.filter(r=>!!this.userData.shops[r]):t;this.userData&&(this.userData.shopOrder=n);try{const r=$n(Cn,"owner-users",e.uid.value);await Ws(r,{shopOrder:n},{merge:!0})}catch(r){console.error("[owner-v2] failed to persist shop order to user doc",r)}}
157,async addShop(t){const e=ua();if(!e.uid.value)throw new Error("Not authenticated");const{public:{apiBase:n}}=Ks(),r=await Fn.post(`${n}/users/login`,{UserName:t.username,Username:t.username,Password:t.password},{headers:{"Content-Type":"application/json"}}),{user:s,CustomerId:i,token:o}=r.data||{};if(!i||!o)throw new Error("POS login did not return a valid shop credential");const a=String(i);try{if((await $fetch("https://api-app2.niceloop.com/public/check-app2-version",{method:"GET",query:{customerId:a}}))?.migrated!==!0){const _=new Error("SHOP_NOT_MIGRATED");throw _.code="SHOP_NOT_MIGRATED",_.name="SHOP_NOT_MIGRATED",_}}catch(g){if(g?.code==="SHOP_NOT_MIGRATED")throw g;console.warn("[owner-v2] check-app2-version failed",g);const _=new Error("SHOP_NOT_MIGRATED");throw _.code="SHOP_NOT_MIGRATED",_}const c=s?.Role??0,l=typeof s?.AccessList=="string"&&s.AccessList?s.AccessList:"all";let d=s?.ShopName||s?.shopName||s?.CustomerName||void 0;if(!d)try{const g=await mu($n(Cn,"customers",a));d=(g.exists()?g.data().name:void 0)||void 0}catch(g){console.warn("[owner-v2] failed to read customer name",a,g)}const h={customerId:a,username:t.username,token:o,role:c,accessList:l,...d?{shopName:d}:{},linkedAt:new Date,lastUsedAt:new Date},p=$n(Cn,"owner-users",e.uid.value);await Ws(p,{uid:e.uid.value,shops:{[a]:h},selectedCustomerId:a,createdAt:tme()},{merge:!0}),this.userData||(this.userData={uid:e.uid.value,createdAt:new Date,selectedCustomerId:a,shops:{}}),this.userData.shops[a]=h,this.userData.selectedCustomerId=a,this.selectedStoreId=a,this._applyShopAuth(a),this.subscribeAllStoresLiveSummary()},async reAuthShop(t,e){const n=ua();if(!n.uid.value)throw new Error("Not authenticated");const{public:{apiBase:r}}=Ks(),s=await Fn.post(`${r}/users/login`,{UserName:e.username,Username:e.username,Password:e.password},{headers:{"Content-Type":"application/json"}}),{user:i,CustomerId:o,token:a}=s.data||{};if(!o||!a)throw new Error("POS login did not return a valid shop credential");if(String(o)!==t)throw new Error("Credentials belong to a different shop");const c=this.userData?.shops[t],l=typeof i?.AccessList=="string"&&i.AccessList?i.AccessList:c?.accessList||"all",d=i?.ShopName||c?.shopName,h={customerId:t,username:e.username,token:a,role:i?.Role??c?.role??0,accessList:l,...d?{shopName:d}:{},linkedAt:c?.linkedAt||new Date,lastUsedAt:new Date},p=$n(Cn,"owner-users",n.uid.value);await Ws(p,{shops:{[t]:h}},{merge:!0}),this.userData&&(this.userData.shops[t]=h),this.selectedStoreId===t&&this._applyShopAuth(t)},_applyShopAuth(t){const e=this.userData?.shops[t];e?.token?localStorage.setItem("mobile_token",e.token):localStorage.removeItem("mobile_token");const{setStoreId:n}=au();n(t)},async renewExpiringShopTokens(){const t=ua();if(!t.uid.value||!this.userData)return;const{public:{apiBase:e}}=Ks(),n=Object.values(this.userData.shops);try{const r=await Promise.allSettled(n.map(async i=>{if(!i.token||typeof i.token!="string")return!1;const o=YPe(i.token);if(o===null||o<=0||o>=zPe)return!1;const c=(await Fn.post(`${e}/users/renew`,{},{headers:{"Content-Type":"application/json",Authorization:`Bearer ${i.token}`}}))?.data?.token;if(typeof c!="string"||Sw(c)===null)return!1;i.token=c;const l=this.userData?.shops[i.customerId];return l&&l!==i&&(l.token=c),!0})),s={};if(r.forEach((i,o)=>{const a=n[o];i.status==="fulfilled"&&i.value?s[`shops.${a.customerId}.token`]=a.token:i.status==="rejected"&&console.warn("[owner-v2] token renew failed",a.customerId,i.reason)}),Object.keys(s).length){const i=$n(Cn,"owner-users",t.uid.value);await uR(i,s),s[`shops.${this.selectedStoreId}.token`]&&this._applyShopAuth(this.selectedStoreId)}}catch(r){console.warn("[owner-v2] renewExpiringShopTokens failed",r)}},async removeShop(t){const e=ua();if(!e.uid.value)return;const n=$n(Cn,"owner-users",e.uid.value);if(await uR(n,{[`shops.${t}`]:vS()}),this.userData&&delete this.userData.shops[t],this.selectedStoreId===t){const r=this.userData?Object.keys(this.userData.shops):[];this.selectedStoreId=r[0]||"",this.userData&&(this.userData.selectedCustomerId=this.selectedStoreId||null),await this.saveSelectedStore(),this.selectedStoreId?this._applyShopAuth(this.selectedStoreId):localStorage.removeItem("mobile_token")}this.subscribeAllStoresLiveSummary()},async saveSelectedStore(){const t=ua();if(!t.uid.value)return;const e=$n(Cn,"owner-users",t.uid.value);await Ws(e,{selectedCustomerId:this.selectedStoreId||null},{merge:!0})},selectStore(t){this.selectedStoreId=t,this.userData&&(this.userData.selectedCustomerId=t),this.saveSelectedStore(),this._applyShopAuth(t),Ot().setCustomerId(t)},async signOut(){this.unsubscribeAllLiveTables(),this.unsubscribeAllStoresLiveSummary(),await ua().signOut(),this.userData=null,this.selectedStoreId="",this.loaded=!1,this.liveTables={},this.liveTablesLoaded=!1;const{setStoreId:e}=au();return e(""),localStorage.removeItem("mobile_token"),co("/v2-owner-report-mobile/login")},getSelectedStoreCredentials(){const t=this.userData?.shops[this.selectedStoreId];return t?{username:t.username,token:t.token,storeId:t.customerId}:null},_extractGrandTotal(t){if(t.status==="openning"){let e=0;for(const n of Object.keys(t))n.startsWith("__")&&(e+=Number(t[n])||0);return e}else return Number(t.grandTotal)||0},async fetchCustomerSummaryByRange(t,e,n){const r=n||e;try{const s=an.fromDate(new Date(e+"T00:00:00")),i=an.fromDate(new Date(r+"T23:59:59")),o=cR(Cn,"customers",t,"summary"),a=$pe(o,v2("lastUpdate",">=",s),v2("lastUpdate","<=",i)),c=await jpe(a),l={};
157c.forEach(v=>{const b=v.data();l[v.id]={...b,_computedGrandTotal:this._extractGrandTotal(b)}});const d=new Date(e),h=new Date(r),p=Math.ceil((h.getTime()-d.getTime())/(1e3*60*60*24))+1,g=Object.values(l).reduce((v,b)=>v+(b?._computedGrandTotal||0),0),_={shopId:t,dateRange:{start:e,end:r,totalDays:p},totalGrandTotal:g,datesWithData:Object.keys(l).length};return this.customerSummary[t]={summaryData:l,summaryResult:_},{summaryData:l,summaryResult:_}}catch(s){throw console.error("Error fetching customer summary:",s),s}},async fetchAllStoresCustomerSummaryByRange(t,e){this.customerSummaryLoading=!0;try{await Promise.all(this.stores.map(n=>this.fetchCustomerSummaryByRange(n.storeId,t,e)))}catch(n){throw console.error("Error fetching all stores customer summary:",n),n}finally{this.customerSummaryLoading=!1}},async setDashboardPeriod(t){this.dashboardView=t.view;const e=Ne();let n,r;switch(t.view){case"by_date":n=Ne(t.date).startOf("day"),r=Ne(t.date).endOf("day");break;case"by_month":n=Ne(new Date(t.month.year,t.month.month)).startOf("month"),r=Ne(new Date(t.month.year,t.month.month)).endOf("month");break;case"by_year":n=Ne(new Date(t.year,0,1)).startOf("year"),r=Ne(new Date(t.year,11,31)).endOf("year");break;default:n=e.startOf("day"),r=e.endOf("day");break}if(this.dashboardStartDate=n.format("YYYY-MM-DD"),this.dashboardEndDate=r.format("YYYY-MM-DD"),this.stores.length>0)if(t.view==="live")await this.fetchLiveGrandTotals();else{let s;switch(t.view){case"by_date":s=Ne(t.date).format("YYYY-MM-DD");break;case"by_month":s=Ne(new Date(t.month.year,t.month.month)).format("YYYY-MM");break;case"by_year":s=String(t.year);break;default:s=e.format("YYYY-MM-DD");break}await this.fetchGrandTotals(s)}},async _fetchGrandTotalsForGroup(t,e){if(!t.length||!e)return{};const n=t.includes(this.selectedStoreId)?this.selectedStoreId:t[0],{$api:r}=au(),i=(await r("/dashboard/grandTotal",{method:"POST",body:{customerId:n,list:t,date:e}}))?.data||{},o={};for(const a of t){const c=i[a];o[a]=c?{grandTotal:Number(c.grandTotal)||0,bills:Number(c.bills)||0,voidedAmount:Number(c.voidedAmount)||0,voidedBills:Number(c.voidedBills)||0}:XPe()}return o},async fetchGrandTotals(t){const e=this.stores.map(n=>n.storeId).filter(Boolean);if(!(!e.length||!t)){this.grandTotalsLoading=!0;try{this.grandTotals=await this._fetchGrandTotalsForGroup(e,t)}catch(n){throw console.error("Error fetching grand totals:",n),n}finally{this.grandTotalsLoading=!1}}},async fetchGrandTotalForStore(t){if(!t)return;const e=this.liveSummaries[t]?.businessMode,n=dB(e);try{const r=await this._fetchGrandTotalsForGroup([t],n);this.grandTotals={...this.grandTotals,...r}}catch(r){console.error("Error fetching grand total for store",t,r)}},async fetchLiveGrandTotals(){const t=this.stores.map(r=>r.storeId).filter(Boolean);if(!t.length)return;const e=Ne(),n=new Map;for(const r of t){const s=this.liveSummaries[r]?.businessMode,i=dB(s,e),o=n.get(i);o?o.push(r):n.set(i,[r])}this.grandTotalsLoading=!0;try{const r=await Promise.all(Array.from(n.entries()).map(([s,i])=>this._fetchGrandTotalsForGroup(i,s)));this.grandTotals=Object.assign({},...r)}catch(r){throw console.error("Error fetching live grand totals:",r),r}finally{this.grandTotalsLoading=!1}},subscribeLiveTables(t){if(this.subscribedTablesStoreId===t&&this.liveTablesLoaded)return;this.unsubscribeAllLiveTables(),this.subscribedTablesStoreId=t,this.liveTablesLoading=!0,this.liveTablesLoaded=!1;const e=Zt(qt,`customer/${t}/tables_v3`),n=xa(e,r=>{this.liveTables=r.val()||{},this.liveTablesLoading=!1,this.liveTablesLoaded=!0},r=>{console.error("[owner-v2] tables_v3 subscription error",t,r),this.liveTablesLoading=!1});this._liveTablesUnsubscribers[t]=[n]},unsubscribeLiveTables(t){const e=this._liveTablesUnsubscribers[t];e&&(e.forEach(n=>n()),delete this._liveTablesUnsubscribers[t])},unsubscribeAllLiveTables(){Object.keys(this._liveTablesUnsubscribers).forEach(t=>{this.unsubscribeLiveTables(t)}),this.liveTables={},this.liveTablesLoaded=!1,this.liveTablesLoading=!1,this.subscribedTablesStoreId=""},subscribeStoreLiveSummary(t){this.unsubscribeStoreLiveSummary(t);const e=$n(Cn,"customers",t),n=xo(e,r=>{const s=r.exists()?r.data():{};if(this.liveSummaries[t]={name:s?.name,live:s?.live,businessMode:s?.businessMode,status:s?.status,opened:s?.opened,closed:s?.closed},!this._liveSummaryFirstSeen[t]){this._liveSummaryFirstSeen[t]=!0;return}const i=this._grandTotalRefetchTimers[t];i&&clearTimeout(i),this._grandTotalRefetchTimers[t]=setTimeout(()=>{delete this._grandTotalRefetchTimers[t],this.fetchGrandTotalForStore(t)},1200)},r=>{console.error("[liveSummary] snapshot error",t,r)});this._liveSummaryUnsubs[t]=n},unsubscribeStoreLiveSummary(t){const e=this._liveSummaryUnsubs[t];e&&(e(),delete this._liveSummaryUnsubs[t]);const n=this._grandTotalRefetchTimers[t];
157n&&(clearTimeout(n),delete this._grandTotalRefetchTimers[t]),delete this._liveSummaryFirstSeen[t]},subscribeAllStoresLiveSummary(){const t=new Set(this.stores.map(e=>e.storeId));for(const e of Object.keys(this._liveSummaryUnsubs))t.has(e)||this.unsubscribeStoreLiveSummary(e);for(const e of this.stores)this.subscribeStoreLiveSummary(e.storeId)},unsubscribeAllStoresLiveSummary(){for(const t of Object.keys(this._liveSummaryUnsubs))this.unsubscribeStoreLiveSummary(t);this.liveSummaries={}}},getters:{stores(t){if(!t.userData)return[];const e=Object.values(t.userData.shops),n=t.userData.shopOrder;return(n&&n.length?[...n.map(s=>e.find(i=>i.customerId===s)).filter(s=>!!s),...e.filter(s=>!n.includes(s.customerId))]:e).map(s=>({storeId:s.customerId,name:t.liveSummaries[s.customerId]?.name||s.shopName||`Shop: ${s.customerId}`,username:s.username,token:s.token||"",role:s.role??0,accessList:s.accessList||"all",needsReLink:!s.token}))},selectedStore(){return this.stores.find(t=>t.storeId===this.selectedStoreId)},selectedBusinessMode(){return Number(this.liveSummaries[this.selectedStoreId]?.businessMode)||0},isAuthenticated:t=>!!t.userData,currentShop(){return this.stores.find(t=>t.storeId===this.selectedStoreId)},currentRole(){return this.currentShop?.role??0},currentAccessList(){return(this.currentShop?.accessList||"all").split(",").map(e=>e.trim()).filter(Boolean)},currentHasAllAccess(){return this.currentAccessList.includes("all")},canAccessReport(){const t=this.userData?.shops||{};return e=>{const n=t[e];if(!n)return!1;if(n.role!==1)return!0;const s=(n.accessList||"all").split(",").map(i=>i.trim()).filter(Boolean);return s.includes("all")||s.includes("report")}},currentCanAccessReport(){return this.selectedStoreId?this.canAccessReport(this.selectedStoreId):!1},canAccessAll(){const t=this.currentRole;return t===2||t===1},currentShopNeedsReLink(){return!!this.currentShop?.needsReLink},activeTables:t=>Object.values(t.liveTables).filter(e=>e.items&&e.items.length>0),totalGuests:t=>Object.values(t.liveTables).reduce((e,n)=>e+(n.guests||0),0),totalPendingAmount:t=>Object.values(t.liveTables).reduce((e,n)=>e+(n.billing?.subTotal||0),0)}}),eke=il(()=>{const t=Ae(!1),e=Ae(null);return{isOpen:t,customerId:e,open:s=>{const i=ZPe();e.value=s??i.selectedStoreId??null,t.value=!0},close:()=>{t.value=!1,e.value=null}}}),au=il(()=>{const t=Ks(),e=Ae(""),n=i=>{e.value=i},r=()=>$fetch.create({baseURL:t.public.apiBase,headers:{"Content-Type":"application/json"},onRequest({request:i,options:o}){{const a=window.location.pathname.startsWith("/v2-owner-report-mobile"),c=localStorage.getItem(a?"mobile_token":"token");c&&(o.headers={...o.headers,Authorization:`Bearer ${c}`})}o.query||(o.query={}),o.query.customerId||(o.query.customerId=e.value)},onResponse({request:i,response:o,options:a}){},onResponseError({request:i,response:o}){const a=window.location.pathname.startsWith("/v2-owner-report-mobile");if(a&&o?.status===401){eke().open();return}(typeof i=="string"?i:i?.url??"").includes("/change-password")||!a&&o?.status===401&&window.location.pathname!=="/login"&&(window.location.href="/login")}});return{$api:r(),setStoreId:n,createInstance:r}}),tke="customer_databases",ku=new Map;function oo(t){ku.set(t.resource,t)}function al(){const t=Xn();return t.storeId?String(t.storeId):null}function QE(){const t=al();return t?$n(Cn,tke,t):null}async function nke(){const t=QE();if(!t)return null;try{const e=await U3(t);if(!e.exists())return{};const n=e.data(),r={};for(const[s,i]of Object.entries(n))typeof i=="string"?r[s]=i:typeof i=="number"&&(r[s]=String(i));return r}catch(e){return console.warn("[versionSync] fetchRemoteVersions failed",e),null}}const F9=new Set(["catalogs","items","subitems","tags","comments","toppingGroups","toppings"]);async function B9(t=!1){if(al())try{await au().$api("/legacy-cache/clear",{method:"POST",body:{immediate:t}})}catch(n){console.warn("[versionSync] legacy cache clear failed",n)}}const $9=Oy.debounce(()=>B9(!1),1500,{leading:!1,trailing:!0});function YD(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now()}-${Math.random().toString(36).slice(2)}`}async function rke(t,e,n){const r=await xy(t,e.resource);if(!dD()&&n&&r?.version===n){e.applyToStore(r.data);return}let i;try{i=await e.refetch()}catch(c){if(r){console.warn(`[versionSync:${e.resource}] refetch failed â serving cached data`,c),e.applyToStore(r.data);return}throw c}const o=Qy(i),a=n??YD();await Ly(t,e.resource,o,a),e.applyToStore(o),n||await XD(e.resource,a)}async function ske(){const t=al();if(!t)return;const e=await nke();if(e==null){await U9();return}await Promise.all(Array.from(ku.values()).map(n=>rke(t,n,e[n.resource]??null)))}async function U9(){const t=al();t&&await Promise.all(Array.from(ku.values()).map(async e=>{const n=await xy(t,e.resource);n&&e.applyToStore(n.data)}))}async function JD(t){const e=al();if(!e)throw new Error("[versionSync] no storeId");const n=ku.get(t);if(!n)throw new Error(`[versionSync] resource "${t}" not registered`);const r=await n.refetch(),s=Qy(r),i=YD();await Ly(e,t,s,i),n.applyToStore(s),await XD(t,i),F9.has(t)&&$9()}async function ike(t){const e=al();if(!e)return;const n=ku.get(t);if(!n)return;let r;try{r=await n.refetch()}catch(s){console.warn(`[versionSync:${t}] revalidate refetch skipped`,s);return}try{const s=Qy(r),i=await xy(e,t);if(Oy.isEqual(i?.data,s))return;await Ly(e,t,s,i?.version??null),n.applyToStore(s)}catch(s){console.warn(`[versionSync:${t}] revalidate apply failed`,s)}}async function oke(t,e){const n=al();if(!n)throw new Error("[versionSync] no storeId");const r=ku.get(t);if(!r)throw new Error(`[versionSync] resource "${t}" not registered`);const s=await xy(n,t);if(!s||!Array.isArray(s.data)){await JD(t);return}const i=e.upsertRaw??[],o=e.removeIds??[],a=g=>Number(g?.data?.[0]),c=new Set(o.map(g=>Number(g))),l=new Map(i.map(g=>[a(g),g]));let d=s.data.filter(g=>!c.has(a(g))).map(g=>l.get(a(g))??g);for(const g of i)d.some(_=>a(_)===a(g))||d.push(g);const h=Qy(d),p=YD();await Ly(n,t,h,p),r.applyToStore(h),await XD(t,p),F9.has(t)&&$9()}const hB=new Map;function QD(t,e=1500){let n=hB.get(t);n||(n=Oy.debounce(()=>{JD(t).catch(r=>console.warn(`[versionSync:${t}] debounced refresh failed`,r))},e,{leading:!1,trailing:!0}),hB.set(t,n)),n()}async function XD(t,e){const n=QE();if(!n)throw new Error("[versionSync] no storeId");try{await uR(n,{[t]:e})}catch{try{await Ws(n,{[t]:e},{merge:!0})}catch(s){throw console.warn(`[versionSync:${t}] bumpResourceVersion failed`,s),s}}}async function zVe(){const t=al();if(!t)throw new Error("[versionSync] no storeId");const e=QE();if(e)try{await yS(e)}catch(n){console.warn("[versionSync] hardClear: deleteDoc failed",n)}await sW(t),ku.clear()}const ake=new Set(["jobs","receipts"]);async function YVe(){const t=al();if(!t)throw new Error("[versionSync] no storeId");const e=QE(),n=Object.keys(Uo).filter(r=>!ake.has(r)).map(r=>mh(Uo[r](t)).clear());await Promise.all([e?yS(e).catch(r=>console.warn("[versionSync] clearCache: deleteDoc failed",r)):Promise.resolve(),sW(t),B9(!0).catch(()=>{}),...n]),ku.clear()}const cke={pos_set_discount:["pos_set_discount","pos_discount"]},lke=t=>(t||"").split(",").map(e=>
157e.trim()).filter(Boolean),fB=(t,e)=>{if(!t)return!1;if(t.Editable)return!0;const n=cke[e]||[e],r=lke(t.Role);return n.some(s=>r.includes(s))},qr=qn("employees",{state:()=>({employees:[],employeesSetting:[],employee:null,lastEmployeeName:null,lastApprovedBy:null,loaded:!1,reloadNewData:!1}),getters:{getCurrentEmployee:t=>({name:t.employee?.Name||"unknown",id:t.employee?.Id||"unknown",...t.employee}),lockEnabled:t=>GAe()&&t.employees.length>0},actions:{getAdminEmployee(){return{Name:"admin",Id:"admin",Editable:!0}},init(){oo({resource:"employees",refetch:()=>Ot().employees.fetch(),applyToStore:e=>{const n=Array.isArray(e)?e:[];this.employeesSetting=n,this.employees=n,n.length===0&&(this.employee=this.getAdminEmployee())}})},finishLoad(){this.loaded=!0,!this.lockEnabled&&!this.employee&&(this.employee=this.getAdminEmployee())},refresh(){QD("employees")},enterPin(t){if(t=="pos")return this.employee=this.getAdminEmployee(),this.lastEmployeeName=this.employee?.Name||null,this.employee;if(this.employees.length==0)return this.employee=this.getAdminEmployee(),this.lastEmployeeName=this.employee?.Name||null,this.employee;const e=this.employees.find(n=>n.Pin===parseInt(t));return e?(this.employee=e,this.lastEmployeeName=e?.Name||null,this.employee):null},async checkPermission(t,e,n){return this.lastApprovedBy=null,new Promise(async r=>{const s=this.getCurrentEmployee;if(fB(s,t))return r(!0);const{$i18n:i}=xt(),o=i?.te?.(`lockScreen.permission.actions.${t}`)?i.t(`lockScreen.permission.actions.${t}`):e||t,a=await Or.fire({icon:"warning",title:i?.t("lockScreen.permission.title",{action:o})??`à¹à¸ªà¹ PIN à¹à¸à¸·à¹à¸${o}`,input:"password",inputLabel:i?.t("lockScreen.permission.inputLabel")??"à¹à¸ªà¹ PIN à¸à¸µà¹à¹à¸à¹à¸£à¸±à¸à¸ªà¸´à¸à¸à¸´à¹",inputPlaceholder:i?.t("lockScreen.permission.inputPlaceholder")??"à¹à¸ªà¹ PIN",inputAttributes:{autocapitalize:"off",autocorrect:"off",autocomplete:"off"},showCancelButton:!0,confirmButtonText:i?.t("lockScreen.permission.submit")??"à¸à¸à¸¥à¸",showLoaderOnConfirm:!0,...n?.containerClass?{customClass:{container:n.containerClass}}:{}});if(!a.isConfirmed)return r(!1);const c=this.employees.find(d=>d.Pin===parseInt(a.value));if(!(c&&fB(c,t)))return await Or.fire({icon:"error",title:i?.t("lockScreen.permission.deniedTitle")??"รหัสà¸à¸µà¹à¹à¸¡à¹à¸¡à¸µà¸ªà¸´à¸à¸à¸´à¹",text:c?i?.t("lockScreen.permission.deniedText",{name:c.Name,action:o})??`PIN à¸à¸à¸ ${c.Name} à¹à¸¡à¹à¹à¸à¹à¸£à¸±à¸à¸ªà¸´à¸à¸à¸´à¹à¸ªà¸³à¸«à¸£à¸±à¸${o}`:i?.t("lockScreen.permission.notFound")??"à¹à¸¡à¹à¸à¸ PIN à¸à¸µà¹à¹à¸à¸£à¸°à¸à¸",...n?.containerClass?{customClass:{container:n.containerClass}}:{}}),r(!1);this.lastApprovedBy=c.Name||null,r(!0)})},lockScreen(){this.employee=null}}}),xC=4320*60*1e3,uke=6e4,dke=t=>{if(!t)return null;const e=t.split(".");if(e.length!==3)return null;try{const n=e[1].replace(/-/g,"+").replace(/_/g,"/"),r=n+"=".repeat((4-n.length%4)%4),s=atob(r),i=JSON.parse(s);return typeof i.exp=="number"?i.exp:null}catch{return null}},pB=t=>{const e=dke(t);return e===null?null:e*1e3-Date.now()},hke="https://app.niceloop.com/api/account/checkislogin",ZD="authSnapshot";function Zh(t){if(!(typeof localStorage>"u"))try{localStorage.setItem(ZD,JSON.stringify(t))}catch(e){console.warn("[auth] persistAuthSnapshot failed",e)}}function mB(){if(typeof localStorage>"u")return null;try{const t=localStorage.getItem(ZD);if(!t)return null;const e=JSON.parse(t);return!e||typeof e!="object"||!e.user||!e.storeId?null:e}catch(t){return console.warn("[auth] loadCachedAuthSnapshot failed",t),null}}function LC(){if(!(typeof localStorage>"u"))try{localStorage.removeItem(ZD)}catch{}}const Xn=qn("auth",{state:()=>({browserId:_we("browserId",crypto.randomUUID()).value,user:null,token:null,storeId:null,isAuthenticated:null,_credHash:null,_renewInFlight:null,_renewTimer:null,_lastRenewAt:0,_visibilityHandler:null,_credHashUnsub:null}),getters:{},actions:{async init(){return await this.snapshotAuth()},async hydrateFromFirestore(){return await this.snapshotAuth()},async hydrateFromLocalStorage(){if(this.applyDevStoreOverrideSession())return!0;const t=mB();if(!t||!t.user||!t.storeId)throw new Error("need login");this.storeId=t.storeId,this.user=t.user,this.token=t.token,this._credHash=t.credHash??null,this.isAuthenticated=!0,this.startSessionWatchers(),Zh({user:this.user,storeId:this.storeId,token:this.token,credHash:this._credHash,savedAt:Date.now()});try{const e=rr().browserRef(this.browserId),n=xo(e,{includeMetadataChanges:!0},r=>{if(r.metadata.fromCache)return;if(!r.exists()){this.forceLogout("session_expired"),n();return}const s=r.data();this.storeId=s?.storeId?.toString?.()||null,this.user=s?.user,this.token=s?.token,this._credHash=s?.credHash??null,this.isAuthenticated=!0,this.startSessionWatchers(),Zh({user:this.user,storeId:this.storeId,token:this.token,credHash:this._credHash,savedAt:Date.now()}),this.verifyCredentialHashOnce()},r=>{console.warn("[auth] background listener error",r)})}catch(e){console.warn("[auth] failed to start background listener",e)}return!0},async checkIsLogin(){try{const e=await(await fetch(hke,{method:"GET",headers:{"Content-Type":"application/json"}})).json();this.isAuthenticated=e.isAuthenticated}catch{}},applyDevStoreOverrideSession(){return!1},async snapshotAuth(){if(this.applyDevStoreOverrideSession())return!0;const t=rr().browserRef(this.browserId),e=5e3,n=()=>typeof navigator<"u"&&navigator.onLine===!1,r=i=>{this.storeId=i?.storeId?.toString?.()||null,this.user=i?.user,this.token=i?.token,this._credHash=i?.credHash??null,this.isAuthenticated=!0,this.startSessionWatchers(),Zh({user:this.user,storeId:this.storeId,token:this.token,credHash:this._credHash,savedAt:Date.now()})},s=mB();if(s&&(n()||s.user)){r(s);try{const i=xo(t,{includeMetadataChanges:!0},o=>{if(!o.metadata.fromCache){if(!o.exists()){this.forceLogout("session_expired"),i();return}r(o.data()),this.verifyCredentialHashOnce()}},o=>{console.warn("[auth] background snapshot listener error",o)})}catch(i){console.warn("[auth] failed to start background listener",i)}return!0}return new Promise((i,o)=>{let a=!1,c=null,l=null,d=null;const h=(p,g)=>{if(!a){if(a=!0,l&&clearTimeout(l),d?.(),!p.exists()){this.storeId=null,this.user=null,this.token=null,this.isAuthenticated=!1,LC(),o(new Error("need login"));return}r(p.data()),g||this.verifyCredentialHashOnce(),i(!0)}};d=xo(t,{includeMetadataChanges:!0},p=>{if(!a){if(p.metadata.fromCache){c=p,n()&&h(p,!0);return}h(p,!1)}},p=>{if(!a){if(c&&c.exists()){console.warn("[auth] firestore listener error, using cached snapshot",p),h(c,!0);return}a=!0,l&&clearTimeout(l),d?.(),this.storeId=null,this.user=null,this.token=null,this.isAuthenticated=!1,o(p instanceof Error?p:new Error(String(p||"auth snapshot failed")))}}),l=setTimeout(()=>{a||c&&c.exists()&&(console.warn("[auth] server snapshot timed out, using cached snapshot"),h(c,!0))},e)})},async watchFirestoreOffline(t){const e=rr().browserRef(this.browserId);let n=null;return xo(e,{includeMetadataChanges:!0},r=>{if(!r.exists())return;const s=r.metadata.fromCache===!0;n!==s&&(t({isFirestoreOffline:s,source:s?"cache":"server"}),n=s)},r=>{console.warn("Firestore listener error:",r)})},async saveSnapshot(){const t=rr().browserRef(this.browserId);return Ws(t,{user:this.user,storeId:this.storeId,timestamp:Ne().toISOString(),token:this.token,credHash:this._credHash??null})},async login(t,e=!1){const{public:{apiBase:n}}=Ks();let r=JSON.stringify(t),s={method:"post",maxBodyLength:1/0,url:n+"/u
157sers/login",headers:{"Content-Type":"application/json"},data:r};const i=await Fn.request(s);return await this.applySession(i.data),await Or.fire({icon:"success",title:"Login Success",confirmButtonText:"OK",showCancelButton:!1}),i},async applySession(t){this.user=t.user,this.storeId=t.CustomerId.toString(),this.token=t.token,this._credHash=t.credHash??null,localStorage.setItem("token",t.token),await this.saveSnapshot(),Zh({user:this.user,storeId:this.storeId,token:this.token,credHash:this._credHash,savedAt:Date.now()}),rr().setStoreId(this.storeId),bn().storeId=this.storeId,this.isAuthenticated=!0,this.startSessionWatchers()},async register(t){const{public:{apiBase:e}}=Ks(),n=await Fn.request({method:"post",maxBodyLength:1/0,url:e+"/account/register",headers:{"Content-Type":"application/json"},data:JSON.stringify(t)});return await this.applySession(n.data),n},async logout(){try{this.stopSessionWatchers(),await QR();const t=rr().browserRef(this.browserId),e=await yS(t);this.user=null,this._credHash=null,localStorage.removeItem("token"),localStorage.removeItem("firestore_loaded"),LC();try{const{resetAllStockTransactions:n}=await at(async()=>{const{resetAllStockTransactions:r}=await import("./Cwj4MixS.js").then(s=>s.e);return{resetAllStockTransactions:r}},[],import.meta.url);await n()}catch(n){console.error("[auth] stock cache reset failed",n)}this.isAuthenticated=null,alert("logout success"),window.location.href="/"}catch{}},async renew(){if(this._renewInFlight)return this._renewInFlight;if(!this.token)return null;const{public:{apiBase:t}}=Ks(),e=this.token;this._renewInFlight=(async()=>{try{const r=(await Fn.request({method:"post",url:t+"/users/renew",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},data:{}}))?.data?.token;if(!r)throw new Error("renew: missing token in response");return this._lastRenewAt=Date.now(),this.token=r,localStorage.setItem("token",r),await this.saveSnapshot(),Zh({user:this.user,storeId:this.storeId,token:this.token,credHash:this._credHash,savedAt:Date.now()}),this.scheduleRenew(),r}finally{this._renewInFlight=null}})();try{return await this._renewInFlight}catch(n){return console.warn("[auth] renew failed",n),null}},maybeRenewIfBelowThreshold(){const t=pB(this.token);t!==null&&(t<=0||Date.now()-this._lastRenewAt<uke||t<xC&&this.renew())},scheduleRenew(){this._renewTimer&&(clearTimeout(this._renewTimer),this._renewTimer=null);const t=pB(this.token);if(!(t===null||t<=0)){if(t<xC){this.maybeRenewIfBelowThreshold();return}this._renewTimer=setTimeout(()=>{this._renewTimer=null,this.maybeRenewIfBelowThreshold()},t-xC)}},installVisibilityWatcher(){this._visibilityHandler||(this._visibilityHandler=()=>{document.visibilityState==="visible"&&this.maybeRenewIfBelowThreshold()},document.addEventListener("visibilitychange",this._visibilityHandler))},removeVisibilityWatcher(){this._visibilityHandler&&(document.removeEventListener("visibilitychange",this._visibilityHandler),this._visibilityHandler=null)},watchCredentialHash(t){if(this._credHashUnsub||!t||!Number.isFinite(t))return;const e=$n(Cn,"users-auth",String(t));this._credHash||mu(e).then(n=>{if(n.exists()){const r=n.data().credHash;typeof r=="string"&&(this._credHash=r,this.saveSnapshot())}}).catch(()=>{}),this._credHashUnsub=xo(e,{includeMetadataChanges:!0},n=>{if(n.metadata.fromCache||!n.exists())return;const r=n.data().credHash;if(typeof r=="string"){if(!this._credHash){this._credHash=r,this.saveSnapshot();return}r!==this._credHash&&this.forceLogout("password_changed")}},n=>{console.warn("[auth] credHash watcher error",n)})},async verifyCredentialHashOnce(){const t=Number(this.user?.Id);if(!(!Number.isFinite(t)||!this._credHash))try{const e=await mu($n(Cn,"users-auth",String(t)));if(!e.exists())return;const n=e.data().credHash;typeof n=="string"&&n!==this._credHash&&this.forceLogout("password_changed")}catch(e){console.warn("[auth] verifyCredentialHashOnce failed",e)}},async refreshCurrentUserProfile(){if(this.user&&!(typeof navigator<"u"&&navigator.onLine===!1))try{const t=await Ct("users","/users/current-user").fetch({customerId:this.storeId}),e=Array.isArray(t)?t[0]:t;if(!e||typeof e!="object")return;const n=this.user;if(e.Id!=null&&n?.Id!=null&&String(e.Id)!==String(n.Id))return;const r=n.Role!==e.Role||n.Locale!==e.Locale||n.AccessList!==e.AccessList;this.user={...n,...e},r&&(await this.saveSnapshot(),Zh({user:this.user,storeId:this.storeId,token:this.token,credHash:this._credHash,savedAt:Date.now()}))}catch(t){console.warn("[auth] refreshCurrentUserProfile failed",t)}},startSessionWatchers(){this.scheduleRenew(),this.installVisibilityWatcher()},stopSessionWatchers(){this._renewTimer&&(clearTimeout(this._renewTimer),this._renewTimer=null),this._renewInFlight=null,this.removeVisibilityWatcher(),this._credHashUnsub&&(this._credHashUnsub(),this._credHashUnsub=null)},async forceLogout(t){this.stopSessionWatchers(),await QR();try{const e=rr().browserRef(this.browserId);await yS(e)}catch{}this.user=null,this.token=null,this._credHash=null,this.isAuthenticated=!1,localStorage.removeItem("token"),localStorage.removeItem("firestore_loaded"),LC(),typeof window<"u"&&window.location.pathname!=="/login"&&(window.location.href=`/login?reason=${encodeURIComponent(t)}`)}}}),fke=(t,e)=>{const n=Xn();if(Wa().loaded&&!(t.path==="/login"||t.path==="/register")&&!n.isAuthenticated)return co("/login")},pke={expenses:"expense",settings:"setting"};function mke(t){const e=String(t??"").trim().toLowerCase();return pke[e]||e}function H9(t){const e=Array.isArray(t)?t:typeof t=="string"?t.split(","):[],n=[];for(const r of e){const s=mke(r);s&&!n.includes(s)&&n.push(s)}return n}function JVe(t){return H9(t).join(",")}const gke=new Set(["/","/home","/login","/register","/no-permission","/v2","/v2/"]),_ke={"/v2/pos":"pos","/v2/expense":"expense","/v2/stock":"stock","/v2/reports":"report","/v2/menu":"menu","/v2/settings":"setting","/v2/edit-bill":"report"};function yke(t){return H9(t)}const vke=t=>{const e=Wa(),n=Xn();if(gke.has(t.path)||t.path.startsWith("/v2-owner-report-mobile")||!e.loaded)return;if(!n.user)return co("/login");const r=_ke[t.path];if(!r)return;
157const{AccessList:s,Role:i}=n.user;if(!(i===2||yke(s).includes(r)))return co("/no-permission")},bke=t=>{if(t.path==="/maintainance"||t.path.startsWith("/v2-owner-report-mobile"))return;const e=GD();if(e.startWatching(),e.isPathBlocked(t.path))return co("/maintainance")},wke=new Set(["/","/home","/index","/v2","/v2/","/v2/pos","/runMode","/login","/offline-blocked","/pos","/pos-cashier-changed","/openShop","/add-day"]),Ske=["/v2/payment"];function Tke(t){return wke.has(t)?!0:Ske.some(e=>t===e||t.startsWith(e+"/"))}function Eke(t){return Zp()?!0:typeof navigator<"u"&&navigator.onLine===!1||t.isOffline===!0}const Ike=t=>{const e=Wa();if(Eke(e)&&!Tke(t.path)&&!t.path.startsWith("/v2-owner-report-mobile"))return co({path:"/offline-blocked",query:{from:t.fullPath}})},Cke=t=>{const e=VH({path:t.path});if(e.redirect){const n=e.redirect.includes("#")?e.redirect:e.redirect+t.hash;return nl(n,{acceptRelative:!0})?(window.location.href=n,!1):n}},Ake=[qoe,Woe,fke,vke,bke,Ike,Cke],XR={"check-package":()=>at(()=>import("./DBoVD1-z.js"),[],import.meta.url),"owner-v2":()=>at(()=>import("./BjQT81fx.js"),[],import.meta.url),"pos-expiry":()=>at(()=>import("./B3D1xSVk.js"),[],import.meta.url)};function Rke(t,e,n){const{pathname:r,search:s,hash:i}=e,o=t.indexOf("#");if(o>-1){const l=i.includes(t.slice(o))?t.slice(o).length:1;let d=i.slice(l);return d[0]!=="/"&&(d="/"+d),Kx(d,"")}const a=Kx(r,t),c=!n||fH(a,n)?a:n;return c+(c.includes("?")?"":s)+i}const Pke=At({name:"nuxt:router",enforce:"pre",async setup(t){let e,n,r=Ks().app.baseURL;const s=Tl.history?.(r)??bie(r),i=Tl.routes?([e,n]=Wl(()=>Tl.routes(N0)),e=await e,n(),e??N0):N0;let o;const a=Uie({...Tl,scrollBehavior:(w,E,T)=>{if(E===so){o=T;return}if(Tl.scrollBehavior){if(a.options.scrollBehavior=Tl.scrollBehavior,"scrollRestoration"in window.history){const R=a.beforeEach(()=>{R(),window.history.scrollRestoration="manual"})}return Tl.scrollBehavior(w,so,o||T)}},history:s,routes:i});"scrollRestoration"in window.history&&(window.history.scrollRestoration="auto"),t.vueApp.use(a);const c=ht(a.currentRoute.value);a.afterEach((w,E)=>{c.value=E}),Object.defineProperty(t.vueApp.config.globalProperties,"previousRoute",{get:()=>c.value});const l=Rke(r,window.location,t.payload.path),d=ht(a.currentRoute.value),h=()=>{d.value=a.currentRoute.value};a.afterEach((w,E)=>{const T=w.matched.at(-1)?.components?.default,R=E.matched.at(-1)?.components?.default;if(T===R){h();return}w.matched.length<E.matched.length&&w.matched.every((N,O)=>N.components?.default===E.matched[O]?.components?.default)&&h()});const p={sync:h};for(const w in d.value)Object.defineProperty(p,w,{get:()=>d.value[w],enumerable:!0});t._route=ao(p),t._middleware||={global:[],named:{}};const g=NT();a.afterEach(async(w,E,T)=>{delete t._processingMiddleware,!t.isHydrating&&g.value&&await t.runWithContext(kre),T&&await t.callHook("page:loading:end")});try{[e,n]=Wl(()=>a.isReady()),await e,n()}catch(w){[e,n]=Wl(()=>t.runWithContext(()=>rd(w))),await e,n()}const _=l!==a.currentRoute.value.fullPath?a.resolve(l):a.currentRoute.value,v=t.isHydrating&&t.payload.prerenderedAt&&t.payload.path&&l!==t.payload.path&&fH(a.currentRoute.value.path,t.payload.path);h();const b=t.payload.state._layout;return a.beforeEach(async(w,E)=>{await t.callHook("page:loading:start"),w.meta=Xs(w.meta),t.isHydrating&&b&&!Go(w.meta.layout)&&(w.meta.layout=b),t._processingMiddleware=!0;{const T=new Set([...Ake,...t._middleware.global]);for(const N of w.matched){const O=N.meta.middleware;if(O)for(const S of ZH(O))T.add(S)}const R=VH({path:w.path});if(R.appMiddleware)for(const N in R.appMiddleware)R.appMiddleware[N]?T.add(N):T.delete(N);for(const N of T){const O=typeof N=="string"?t._middleware.named[N]||await XR[N]?.().then(S=>S.default||S):N;if(!O)throw new Error(`Unknown route middleware: '${N}'.`);try{const S=await t.runWithContext(()=>O(w,E));if(!t.payload.serverRendered&&t.isHydrating&&(S===!1||S instanceof Error)){const I=S||Gl({status:404,statusText:`Page Not Found: ${l}`});return await t.runWithContext(()=>rd(I)),!1}if(S===!0)continue;if(S===!1)return S;if(S)return YP(S)&&S.fatal&&await t.runWithContext(()=>rd(S)),S}catch(S){const I=Gl(S);return I.fatal&&await t.runWithContext(()=>rd(I)),I}}}}),a.onError(async()=>{delete t._processingMiddleware,await t.callHook("page:loading:end")}),a.afterEach(w=>{if(w.matched.length===0&&!g.value)return t.runWithContext(()=>rd(Gl({status:404,fatal:!1,statusText:`Page not found: ${w.fullPath}`,data:{path:w.fullPath}})))}),t.hooks.hookOnce("app:created",async()=>{try{if("name"in _&&(_.name=void 0),v){const w=a.resolve(t.payload.path);"name"in w&&(w.name=void 0),await a.replace({...w,force:!0}),t.hooks.hookOnce("app:suspense:resolve",async()=>{await a.replace({..._,force:!0})})}else await a.replace({..._,force:!0});a.options.scrollBehavior=Tl.scrollBehavior}catch(w){await t.runWithContext(()=>rd(w))}}),{provide:{router:a}}}}),kke="https://app2.niceloop.com",gB="openExternalBrowser",Nke=t=>/\bline\//i.test(t),Dke=At({name:"line-external-browser",enforce:"pre",setup(){const t=window.navigator.userAgent||"";if(!Nke(t))return;const e=new URL(window.location.href);if(e.searchParams.has(gB))return;const n=new URL(kke);n.pathname=e.pathname,n.search=e.search,n.hash=e.hash,n.searchParams.set(gB,"1"),console.log("[line-external-browser] LINE in-app detected, opening in external browser",{to:n.href}),window.location.replace(n.href)}}),Oke=new Set(["/","/login","/register","/no-permission","/account-expired","/maintenance","/maintainance","/download","/sentry-test"]),xke=["/v2-owner-report-mobile"],Lke=At({name:"bootstrap-guard",enforce:"pre",setup(){const t=window.location.pathname,e=t.length>1&&t.endsWith("/")?t.slice(0,-1):t;if(!Oke.has(e)&&!xke.some(n=>
157e.startsWith(n)))return console.log("[bootstrap-guard] redirect deep-link to /",{from:t}),window.location.replace("/"),new Promise(()=>{})}}),Mke=At(()=>{const t=Os();a9(()=>{t.beforeResolve(async()=>{await new Promise(e=>{setTimeout(e,100),requestAnimationFrame(()=>{setTimeout(e,0)})})})})}),Vke=At(t=>{let e;async function n(){let r;try{r=await Ise()}catch(s){const i=s;if(!("status"in i&&(i.status===404||i.status===403)))throw i}e&&clearTimeout(e),e=setTimeout(n,eL);try{const s=await $fetch(zP("builds/latest.json")+`?${Date.now()}`);s.id!==r?.id&&(t.hooks.callHook("app:manifest:update",s),e&&clearTimeout(e))}catch{}}a9(()=>{e=setTimeout(n,eL)})}),Fke=At({name:"nuxt:chunk-reload",setup(t){const e=Os(),n=Ks(),r=new Set;e.beforeEach(()=>{r.clear()}),t.hook("app:chunkError",({error:i})=>{r.add(i)});function s(i){const o=Nd(n.app.baseURL,i.fullPath);FRe({path:o,persistState:!0})}t.hook("app:manifest:update",()=>{e.beforeResolve(s)}),e.onError((i,o)=>{r.has(i)&&s(o)})}}),Bke=At({name:"pinia",setup(t){const e=Nre();return t.vueApp.use(e),Mf(e),t.payload&&t.payload.pinia&&(e.state.value=t.payload.pinia),{provide:{pinia:e}}},hooks:{"app:rendered"(){const t=xt();t.payload.pinia=jt(t.$pinia).state.value,Mf(void 0)}}}),$ke=At({name:"nuxt:global-components"}),ql={clean:mc(()=>at(()=>import("./pcgf0SE-.js"),[],import.meta.url).then(t=>t.default||t)),clear:mc(()=>at(()=>import("./-4AxHbWx.js"),[],import.meta.url).then(t=>t.default||t)),default:mc(()=>at(()=>import("./BDTKtHtc.js"),__vite__mapDeps([89,44]),import.meta.url).then(t=>t.default||t)),"owner-v2":mc(()=>at(()=>import("./DlmO52m5.js"),__vite__mapDeps([90,91,21,92,2,3]),import.meta.url).then(t=>t.default||t)),"v2-scroll":mc(()=>at(()=>import("./CZ8fyd2o.js"),__vite__mapDeps([93,94,21,1,95,91,92,96]),import.meta.url).then(t=>t.default||t)),v2:mc(()=>at(()=>import("./Drv5Jw0u.js"),__vite__mapDeps([97,94,21,1,95,91,92,53,41,98]),import.meta.url).then(t=>t.default||t))},Uke=At({name:"nuxt:prefetch",setup(t){const e=Os();t.hooks.hook("app:mounted",()=>{e.beforeEach(async n=>{const r=n?.meta?.layout;r&&typeof ql[r]=="function"&&await ql[r]()})}),t.hooks.hook("link:prefetch",n=>{if(nl(n))return;const r=e.resolve(n);if(!r)return;const s=r.meta.layout;let i=ZH(r.meta.middleware);i=i.filter(o=>typeof o=="string");for(const o of i)typeof XR[o]=="function"&&XR[o]();typeof s=="string"&&s in ql&&MRe(ql[s])})}}),Hke=At(()=>({provide:{pwaIcons:{transparent:{},maskable:{},favicon:{},apple:{},appleSplashScreen:{}}}})),qke=new RegExp(/Googlebot\/|Googlebot-Mobile|Googlebot-Image|Googlebot-News|Googlebot-Video|AdsBot-Google([^-]|$)|AdsBot-Google-Mobile|Feedfetcher-Google|Mediapartners-Google|Mediapartners \(Googlebot\)|APIs-Google|Google-InspectionTool|Storebot-Google|GoogleOther|bingbot|Slurp|[wW]get|LinkedInBot|Python-urllib|python-requests|aiohttp|httpx|libwww-perl|httpunit|Nutch|Go-http-client|phpcrawl|msnbot|jyxobot|FAST-WebCrawler|FAST Enterprise Crawler|BIGLOTRON|Teoma|convera|seekbot|Gigabot|Gigablast|exabot|ia_archiver|GingerCrawler|webmon |HTTrack|grub\.org|UsineNouvelleCrawler|antibot|netresearchserver|speedy|fluffy|findlink|msrbot|panscient|yacybot|AISearchBot|ips-agent|tagoobot|MJ12bot|woriobot|yanga|buzzbot|mlbot|yandex\.com\/bots|purebot|Linguee Bot|CyberPatrol|voilabot|Baiduspider|citeseerxbot|spbot|twengabot|postrank|Turnitin|scribdbot|page2rss|sitebot|linkdex|Adidxbot|ezooms|dotbot|Mail\.RU_Bot|discobot|heritrix|findthatfile|europarchive\.org|NerdByNature\.Bot|(sistrix|SISTRIX) [cC]rawler|Ahrefs(Bot|SiteAudit)|fuelbot|CrunchBot|IndeedBot|mappydata|woobot|ZoominfoBot|PrivacyAwareBot|Multiviewbot|SWIMGBot|Grobbot|eright|Apercite|semanticbot|Aboundex|domaincrawler|wbsearchbot|summify|CCBot|edisterbot|SeznamBot|ec2linkfinder|gslfbot|aiHitBot|intelium_bot|facebookexternalhit|Yeti|RetrevoPageAnalyzer|lb-spider|Sogou|lssbot|careerbot|wotbox|wocbot|ichiro|DuckDuckBot|lssrocketcrawler|drupact|webcompanycrawler|acoonbot|openindexspider|gnam gnam spider|web-archive-net\.com\.bot|backlinkcrawler|coccoc|integromedb|content crawler spider|toplistbot|it2media-domain-crawler|ip-web-crawler\.com|siteexplorer\.info|elisabot|proximic|changedetection|arabot|WeSEE:Search|niki-bot|CrystalSemanticsBot|rogerbot|360Spider|psbot|InterfaxScanBot|CC Metadata Scaper|g00g1e\.net|GrapeshotCrawler|urlappendbot|brainobot|fr-crawler|binlar|SimpleCrawler|Twitterbot|cXensebot|smtbot|bnf\.fr_bot|A6-Indexer|ADmantX|Facebot|OrangeBot\/|memorybot|AdvBot|MegaIndex|SemanticScholarBot|ltx71|nerdybot|xovibot|BUbiNG|Qwantify|archive\.org_bot|Applebot|TweetmemeBot|crawler4j|findxbot|S[eE][mM]rushBot|yoozBot|lipperhey|Y!J|Domain Re-Animator Bot|AddThis|Screaming Frog SEO Spider|MetaURI|Scrapy|Livelap[bB]ot|OpenHoseBot|CapsuleChecker|collection@infegy\.com|IstellaBot|DeuSu\/|betaBot|Cliqzbot\/|MojeekBot\/|netEstate NE Crawler|SafeSearch microdata crawler|Gluten Free Crawler\/|Sonic|Sysomos|Trove|deadlinkchecker|Slack-ImgProxy|Embedly|RankActiveLinkBot|iskanie|SafeDNSBot|SkypeUriPreview|Veoozbot|Slackbot|redditbot|datagnionbot|Google-Adwords-Instant|adbeat_bot|WhatsApp|contxbot|pinterest\.com\/bot|electricmonk|GarlikCrawler|BingPreview\/|vebidoobot|FemtosearchBot|Yahoo Link Preview|MetaJobBot|DomainStatsBot|mindUpBot|Daum\/|Jugendschutzprogramm-Crawler|Xenu Link Sleuth|Pcore-HTTP|moatbot|KosmioBot|[pP]ingdom|AppInsights|PhantomJS|Gowikibot|PiplBot|Discordbot|TelegramBot|Jetslide|newsharecounts|James BOT|Bark[rR]owler|TinEye|SocialRankIOBot|trendictionbot|Ocarinabot|epicbot|Primalbot|DuckDuckGo-Favicons-Bot|GnowitNewsbot|Leikibot|LinkArchiver|YaK\/|PaperLiBot|Digg Deeper|dcrawl|Snacktory|AndersPinkBot|Fyrebot|EveryoneSocialBot|Mediatoolkitbot|Luminator-robots|ExtLinksBot|SurveyBot|NING\/|okhttp|Nuzzel|omgili|PocketParser|YisouSpider|um-LN|ToutiaoSpider|MuckRack|Jamie's Spider|AHC\/|NetcraftSurveyAgent|Laserlikebot|^Apache-HttpClient|AppEngine-Google|Jetty|Upflow|Thinklab|Traackr\.com|Twurly|Mastodon|http_get|DnyzBot|botify|007ac9 Crawler|BehloolBot|BrandVerity|check_http|BDCbot|ZumBot|EZID|ICC-Crawler|ArchiveBot|^LCC |filterdb\.iss\.net\/crawler|BLP_bbot|BomboraBot|Buck\/|Companybook-Crawler|Genieo|magpie-crawler|Meltw
157aterNews|Moreover|newspaper\/|ScoutJet|(^| )sentry\/|StorygizeBot|UptimeRobot|OutclicksBot|seoscanners|Hatena|Google Web Preview|MauiBot|AlphaBot|SBL-BOT|IAS crawler|adscanner|Netvibes|acapbot|Baidu-YunGuanCe|bitlybot|blogmuraBot|Bot\.AraTurka\.com|bot-pge\.chlooe\.com|BoxcarBot|BTWebClient|ContextAd Bot|Digincore bot|Disqus|Feedly|Fetch\/|Fever|Flamingo_SearchEngine|FlipboardProxy|g2reader-bot|G2 Web Services|imrbot|K7MLWCBot|Kemvibot|Landau-Media-Spider|linkapediabot|vkShare|Siteimprove\.com|BLEXBot\/|DareBoost|ZuperlistBot\/|Miniflux\/|Feedspot|Diffbot\/|SEOkicks|tracemyfile|Nimbostratus-Bot|zgrab|PR-CY\.RU|AdsTxtCrawler|Datafeedwatch|Zabbix|TangibleeBot|google-xrawler|axios|Amazon CloudFront|Pulsepoint|CloudFlare-AlwaysOnline|Cloudflare-Healthchecks|Cloudflare-Traffic-Manager|CloudFlare-Prefetch|Cloudflare-SSLDetector|https:\/\/developers\.cloudflare\.com\/security-center\/|Google-Structured-Data-Testing-Tool|WordupInfoSearch|WebDataStats|HttpUrlConnection|ZoomBot|VelenPublicWebCrawler|MoodleBot|jpg-newsbot|outbrain|W3C_Validator|Validator\.nu|W3C-checklink|W3C-mobileOK|W3C_I18n-Checker|FeedValidator|W3C_CSS_Validator|W3C_Unicorn|Google-PhysicalWeb|Blackboard|ICBot\/|BazQux|Twingly|Rivva|Experibot|awesomecrawler|Dataprovider\.com|GroupHigh\/|theoldreader\.com|AnyEvent|Uptimebot\.org|Nmap Scripting Engine|2ip\.ru|Clickagy|Caliperbot|MBCrawler|online-webceo-bot|B2B Bot|AddSearchBot|Google Favicon|HubSpot|Chrome-Lighthouse|HeadlessChrome|CheckMarkNetwork\/|www\.uptime\.com|Streamline3Bot\/|serpstatbot\/|MixnodeCache\/|^curl|SimpleScraper|RSSingBot|Jooblebot|fedoraplanet|Friendica|NextCloud|Tiny Tiny RSS|RegionStuttgartBot|Bytespider|Datanyze|Google-Site-Verification|TrendsmapResolver|tweetedtimes|NTENTbot|Gwene|SimplePie|SearchAtlas|Superfeedr|feedbot|UT-Dorkbot|Amazonbot|SerendeputyBot|Eyeotabot|officestorebot|Neticle Crawler|SurdotlyBot|LinkisBot|AwarioSmartBot|AwarioRssBot|RyteBot|FreeWebMonitoring SiteChecker|AspiegelBot|NAVER Blog Rssbot|zenback bot|SentiBot|Domains Project\/|Pandalytics|VKRobot|bidswitchbot|tigerbot|NIXStatsbot|Atom Feed Robot|[Cc]urebot|PagePeeker\/|Vigil\/|rssbot\/|startmebot\/|JobboerseBot|seewithkids|NINJA bot|Cutbot|BublupBot|BrandONbot|RidderBot|Taboolabot|Dubbotbot|FindITAnswersbot|infoobot|Refindbot|BlogTraffic\/\d\.\d+ Feed-Fetcher|SeobilityBot|Cincraw|Dragonbot|VoluumDSP-content-bot|FreshRSS|BitBot|^PHP-Curl-Class|Google-Certificates-Bridge|centurybot|Viber|e\.ventures Investment Crawler|evc-batch|PetalBot|virustotal|(^| )PTST\/|minicrawler|Cookiebot|trovitBot|seostar\.co|IonCrawl|Uptime-Kuma|Seekport|FreshpingBot|Feedbin|CriteoBot|Snap URL Preview Service|Better Uptime Bot|RuxitSynthetic|Google-Read-Aloud|Valve\/Steam|OdklBot\/|GPTBot|ChatGPT-User|OAI-SearchBot|YandexRenderResourcesBot\/|LightspeedSystemsCrawler|ev-crawler\/|BitSightBot\/|woorankreview\/|Google-Safety|AwarioBot|DataForSeoBot|Linespider|WellKnownBot|A Patent Crawler|StractBot|search\.marginalia\.nu|YouBot|Nicecrawler|Neevabot|BrightEdge Crawler|SiteCheckerBotCrawler|TombaPublicWebCrawler|CrawlyProjectCrawler|KomodiaBot|KStandBot|CISPA Webcrawler|MTRobot|hyscore\.io|AlexandriaOrgBot|2ip bot|Yellowbrandprotectionbot|SEOlizer|vuhuvBot|INETDEX-BOT|Synapse|t3versionsBot|deepnoc|Cocolyzebot|hypestat|ReverseEngineeringBot|sempi\.tech|Iframely|MetaInspector|node-fetch|l9explore|python-opengraph|OpenGraphCheck|developers\.google\.com\/\+\/web\/snippet|SenutoBot|MaCoCu|NewsBlur|inoreader|NetSystemsResearch|PageThing|WordPress\/|PhxBot|ImagesiftBot|Expanse|InternetMeasurement|^BW\/|GeedoBot|Audisto Crawler|PerplexityBot\/|[cC]laude[bB]ot|Monsidobot|GroupMeBot|Vercelbot|vercel-screenshot|facebookcatalog\/|meta-externalads\/|meta-externalagent\/|meta-externalfetcher\/|AcademicBotRTU|KeybaseBot|Lemmy|CookieHubScan|Hydrozen\.io|HTTP Banner Detection|SummalyBot|MicrosoftPreview\/|GeedoProductSearch|TikTokSpider|OnCrawl\/|sindresorhus\/got|CensysInspect\/|SBIntuitionsBot\/|sitebulb|YextBot\/|DatadogSynthetics|Google-Ads-Conversions/),jke=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|FBAN|FBAV|fennec|hiptop|iemobile|ip(hone|od)|Instagram|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i,Wke=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
157sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,Gke=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|FBAN|FBAV|fennec|hiptop|iemobile|ip(hone|od)|Instagram|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i,Kke=/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i;function zke(t){return jke.test(t)||Wke.test(t.slice(0,4))}function Yke(t){return Gke.test(t)||Kke.test(t.slice(0,4))}function Jke(t){return/iPad|iPhone|iPod/.test(t)}function q9(t){return/android/i.test(t)}function Qke(t){return/Windows/.test(t)}function Xke(t){return/Mac OS X/.test(t)}function Zke(t){return/Linux/i.test(t)&&!q9(t)}const eNe=[{name:"Samsung",regex:/SamsungBrowser/i},{name:"Edge",regex:/edg(?:[ea]|ios)?\//i},{name:"Firefox",regex:/firefox|iceweasel|fxios/i},{name:"Chrome",regex:/chrome|crios|crmo/i},{name:"Safari",regex:/safari|applewebkit/i}];function tNe(t){for(const e of eNe)if(e.regex.test(t))return e.name;return""}function nNe(t,e={}){let n=!1,r=!1,s=!1,i=!1;if(t==="Amazon CloudFront")e["cloudfront-is-mobile-viewer"]==="true"&&(n=!0,r=!0),e["cloudfront-is-tablet-viewer"]==="true"&&(n=!1,r=!0),e["cloudfront-is-desktop-viewer"]==="true"&&(n=!1,r=!1),e["cloudfront-is-ios-viewer"]==="true"&&(s=!0),e["cloudfront-is-android-viewer"]==="true"&&(i=!0);else if(e&&e["cf-device-type"])switch(e["cf-device-type"]){case"mobile":n=!0,r=!0;break;case"tablet":n=!1,r=!0;break;case"desktop":n=!1,r=!1;break}else n=zke(t),r=Yke(t),s=Jke(t),i=q9(t);const o=Qke(t),a=Xke(t),c=Zke(t),l=tNe(t),d=l==="Safari",h=l==="Firefox",p=l==="Edge",g=l==="Chrome",_=l==="Samsung",v=qke.test(t);return{userAgent:t,isMobile:n,isMobileOrTablet:r,isTablet:!n&&r,isDesktop:!r,isIos:s,isAndroid:i,isWindows:o,isLinux:c,isMacOS:a,isApple:a||s,isDesktopOrTablet:!n,isSafari:d,isFirefox:h,isEdge:p,isChrome:g,isSamsung:_,isCrawler:v}}const rNe=At(()=>{const e=Ks().public.device.defaultUserAgent;let n;{const r=navigator.userAgent||e;n=Xs(nNe(r))}return{provide:{device:n}}});function sNe(t,e){typeof console<"u"&&(console.warn("[intlify] "+t),e&&console.warn(e.stack))}const sT=typeof window<"u",Nu=(t,e=!1)=>e?Symbol.for(t):Symbol(t),iNe=(t,e,n)=>oNe({l:t,k:e,s:n}),oNe=t=>JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),Wr=t=>typeof t=="number"&&isFinite(t),j9=t=>ZE(t)==="[object Date]",iT=t=>ZE(t)==="[object RegExp]",XE=t=>gn(t)&&Object.keys(t).length===0,wr=Object.assign,aNe=Object.create,An=(t=null)=>aNe(t);function _B(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function cNe(t){return t.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(/</g,"<").replace(/>/g,">")}const lNe=/^\s*javascript\s*(?::|�*58;?|�*3a;
157?|:?)/i,uNe=/^(?:href|src|action|formaction)$/i;function eO(t){return lNe.test(t)}function dNe(t){const e=/url\s*\(/gi;let n="",r=0,s;for(;(s=e.exec(t))!==null;){const i=s.index,o=e.lastIndex-1;let a=o+1,c=1,l=null;for(;a<t.length;a++){const p=t[a];if(l){p===l&&(l=null);continue}if(p==='"'||p==="'")l=p;else if(p==="(")c++;else if(p===")"&&(c--,c===0))break}if(c!==0)break;const d=t.slice(o+1,a).trim(),h=d.startsWith('"')&&d.endsWith('"')||d.startsWith("'")&&d.endsWith("'")?d.slice(1,-1).trim():d;n+=t.slice(r,i),n+=eO(h)?"url(about:blank)":t.slice(i,a+1),r=a+1}return n+t.slice(r)}function yB(t,e){if(uNe.test(t)&&eO(e))return"about:blank";const n=t.toLowerCase()==="style"?dNe(e):e;return cNe(n)}function hNe(t){return t=t.replace(/([\w:-]+)\s*=\s*"([^"]*)"/g,(n,r,s)=>`${r}="${yB(r,s)}"`),t=t.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,r,s)=>`${r}='${yB(r,s)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(t)&&(t=t.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),t=t.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,r,s)=>eO(s)?`${r}about:blank`:n),t}const fNe=Object.prototype.hasOwnProperty;function uo(t,e){return fNe.call(t,e)}const yr=Array.isArray,Jn=t=>typeof t=="function",Je=t=>typeof t=="string",ar=t=>typeof t=="boolean",dn=t=>t!==null&&typeof t=="object",pNe=t=>dn(t)&&Jn(t.then)&&Jn(t.catch),W9=Object.prototype.toString,ZE=t=>W9.call(t),gn=t=>ZE(t)==="[object Object]",mNe=t=>t==null?"":yr(t)||gn(t)&&t.toString===W9?JSON.stringify(t,null,2):String(t);function tO(t,e=""){return t.reduce((n,r,s)=>s===0?n+r:n+e+r,"")}const Bb=t=>!dn(t)||yr(t);function Pf(t,e){if(Bb(t)||Bb(e))throw new Error("Invalid value");const n=[{src:t,des:e}];for(;n.length;){const{src:r,des:s}=n.pop();Object.keys(r).forEach(i=>{i!=="__proto__"&&(dn(r[i])&&!dn(s[i])&&(s[i]=Array.isArray(r[i])?[]:An()),Bb(s[i])||Bb(r[i])?s[i]=r[i]:n.push({src:r[i],des:s[i]}))})}}function gNe(t,e=t.getCurrentLanguage(),n=t.getCurrentDirection()){const r={htmlAttrs:{},link:[],meta:[]};if(t.dir&&(r.htmlAttrs.dir=n),t.lang&&e&&(r.htmlAttrs.lang=e),t.seo){const s=yNe(t);r.link=r.link.concat(s,bNe(t)),r.meta=r.meta.concat(wNe(t),SNe(t),TNe(t,t.locales.map(i=>i.language||i.code)))}return r}function _Ne(t){const e=new Map;for(const n of t){if(!n.language){console.warn("Locale `language` ISO code is required to generate alternate link");continue}const[r,s]=n.language.split("-");r&&s&&(n.isCatchallLocale||!e.has(r))&&e.set(r,n),e.set(n.language,n)}return e}function yNe(t){if(!t.hreflangLinks)return[];const e=[],n=_Ne(t.locales);for(const[r,s]of n.entries()){const i=vNe(r,s,t);i&&(e.push(i),t.defaultLocale&&t.defaultLocale===s.code&&e[0].hreflang!=="x-default"&&e.unshift({[t.key]:"i18n-xd",rel:"alternate",href:i.href,hreflang:"x-default"}))}return e}function vNe(t,e,n,r=n.strictCanonicals?n.getRouteWithoutQuery():void 0){const s=n.getLocalizedRoute(e.code,r);if(!s)return;const i=PT(nl(s)?s:Nd(n.baseUrl,s),n.strictCanonicals?K9(n):{});return{[n.key]:`i18n-alt-${t}`,rel:"alternate",href:i,hreflang:t}}function G9(t,e=t.getCurrentRoute()){const n=t.getLocaleRoute(Object.assign({},e,{path:void 0,name:t.getRouteBaseName(e)}));return n?PT(Nd(t.baseUrl,n.path),K9(t)):""}function bNe(t,e=G9(t)){return e?[{[t.key]:"i18n-can",rel:"canonical",href:e}]:[]}function K9(t,e=t.getCurrentRoute()){const r=t.getLocaleRoute(Object.assign({},e,{path:void 0,name:t.getRouteBaseName(e)}))?.query??{},s={};for(const i of t.canonicalQueries.filter(o=>o in r)){s[i]??=[];for(const o of ENe(r[i]))s[i].push(o||"")}return s}function wNe(t,e=G9(t)){return e?[{[t.key]:"i18n-og-url",property:"og:url",content:e}]:[]}function SNe(t,e=t.getCurrentLanguage()){return e?[{[t.key]:"i18n-og",property:"og:locale",content:z9(e)}]:[]}function TNe(t,e,n=t.getCurrentLanguage()){return e.filter(s=>s&&s!==n).map(s=>({[t.key]:`i18n-og-alt-${s}`,property:"og:locale:alternate",content:z9(s)}))}function z9(t=""){return t.replace(/-/g,"_")}function ENe(t){return Array.isArray(t)?t:[t]}function Y9(t,e,n=t.getLocale()){if(Je(e)&&nl(e,{acceptRelative:!0}))return e;try{return Q9(t,e,n).fullPath}catch{return""}}function J9(t,e,n=t.getLocale()){try{return Q9(t,e,n)}catch{return}}function INe(t){if(!Je(t))return wr({},t);if(t[0]==="/"){const{pathname:e,search:n,hash:r}=uA(t);return{path:e,query:WP(n),hash:r}}return{name:t}}function Q9(t,e,n){const r=INe(e),s=t.router.resolve(t.resolveLocalizedRouteObject(r,n));return s.name?s:t.router.resolve(e)}function X9(t,e,n=t.router.currentRoute.value){const r=t.getRouteBaseName(n);if(!r)return"";const s={name:r,params:wr({},n.params,t.getLocalizedDynamicParams(e)),fullPath:n.fullPath,query:n.query,hash:n.hash,path:n.path,meta:n.meta},i=Y9(t,s,e);return t.afterSwitchLocalePath(i,e)}function CNe(t,e,n=t.getLocale(),r=t.getLocales(),s=t.getBaseUrl()){const i=r.find(a=>a.code===n)||{},o=typeof e.seo=="object"&&e.seo?.canonicalQueries||[];
157return s||console.warn("I18n `baseUrl` is required to generate valid SEO tag links."),{...e,key:"id",locales:r,baseUrl:s,canonicalQueries:o,hreflangLinks:t.routingOptions.hreflangLinks,defaultLocale:t.routingOptions.defaultLocale,strictCanonicals:t.routingOptions.strictCanonicals,getRouteBaseName:t.getRouteBaseName,getCurrentRoute:()=>t.router.currentRoute.value,getCurrentLanguage:()=>i.language,getCurrentDirection:()=>i.dir||"ltr",getLocaleRoute:a=>J9(t,a),getLocalizedRoute:(a,c)=>X9(t,a,c),getRouteWithoutQuery:()=>{try{return wr({},t.router.resolve({query:{}}),{meta:t.router.currentRoute.value.meta})}catch{return}}}}function ANe(t,{dir:e=!0,lang:n=!0,seo:r=!0}){return gNe(CNe(t,{dir:e,lang:n,seo:r}))}function RNe(t=0){return e=>{const s=(typeof e=="string"?e:e.pathname).split("?")[0].split("/");return s[0]===""&&s.shift(),s.length>t&&s[t]||""}}const Z9="___";function eK(t){return typeof t=="string"?t:t!=null?t.toString():""}function MC(t){return eK(typeof t=="object"?t?.name:t).split(Z9)[0]}const PNe=RNe(0),ZR=t=>PNe(t),kNe=t=>t.split(Z9).at(1)??"";function NNe(t){return String(typeof t!="object"?t:t?.name||t?.path||"")}function DNe(t){const e=NNe(t);if(e[0]==="/")return ZR(e);const n=kNe(e);return n||(typeof t=="object"&&t?.path?ZR(String(t.path)):"")}function ONe(t){return e=>eK(e)}function xNe(t){return e=>e}const F_=["th","en"],oT={th:[],en:[]},LNe=[],Xy=[{code:"th",name:"à¹à¸à¸¢",language:void 0},{code:"en",name:"English",language:void 0}],tK=new Map,MNe=SH((t,e,n)=>{if(e==="messages"||e==="datetimeFormats"||e==="numberFormats")return t[e]??=An(null),Pf(n,t[e]),!0});async function VNe(t){const e=xt();let n={messages:An(null)};for(const r of t){const s=await r().then(o=>nK(o)?o.default:o),i=Jn(s)?await e.runWithContext(()=>s()):s;n=MNe(An(null),i,n)}return n.fallbackLocale??=!1,n}const nK=t=>ZE(t)==="[object Module]";async function FNe(t,e){const n=xt();try{const r=await n.runWithContext(e.load).then(s=>nK(s)?s.default:s);return Jn(r)?await n.runWithContext(()=>r(t)):r}catch(r){throw new Error(`Failed loading locale (${t}): `+r.message)}}async function BNe(t,e=[]){const n=xt(),r=await Promise.all(e.map(async i=>{const o=$Ne(i),a=o||await n.runWithContext(()=>FNe(t,i));return!o&&i.cache!==!1&&tK.set(i.key,{ttl:Date.now()+86400*1e3,value:a}),a})),s={};for(const i of r)Pf(i,s);return s}function $Ne(t){if(t.cache===!1)return;const e=tK.get(t.key);if(e!=null)return e.ttl>Date.now()?e.value:void 0}function nO(t){return t!=null&&"global"in t&&"mode"in t?t.global:t}function $b(t){const e=nO(t);return"__composer"in e?e.__composer:e}function eI(t,e){return t?t.$config.public.i18n:Ks().public.i18n}function tI(t){const e=eI(t).detectBrowserLanguage,n=e||{};return{...n,enabled:!!e,cookieKey:n.cookieKey||"i18n_redirected"}}function UNe(t){if(t)return{path:"/"+(Je(t)?t:t.path).replace(/^\//,""),code:!Je(t)&&t.statusCode||302}}function HNe(t){return Array.isArray(t)?t:[t]}function qNe(t,e,n){const r=(i="")=>i.replace(/https?:\/\//,""),s=t.filter(i=>r(i.domain)===e||HNe(i.domains).includes(e));return s.length<=1?s[0]?.code:s.find(i=>i.code===n)?.code||s.find(i=>i.defaultForDomains?.includes(e)??i.domainDefault)?.code}function jNe(t,e,n){const r=Xy.find(i=>i.code===n),s=t?.[n]?.domain||r?.domain||r?.domains?.find(i=>i===e.host);if(s)return nl(s,{strict:!0})?s:e.protocol+"//"+s}function WNe(t){const e={};for(const n of F_){const r=GNe(t,[n]),s=KNe(n,r);e[n]={fallbacks:r,cacheable:s}}return e}function GNe(t,e){if(t===!1)return[];if(yr(t))return t;let n=[];if(Je(t))return e.every(s=>s!==t)&&n.push(t),n;const r=[...e,"default"];for(const s of r)s in t&&(n=[...n,...t[s].filter(Boolean)]);return n}function vB(t){return oT[t]!=null&&oT[t].every(e=>e.cache!==!1)}function KNe(t,e){return vB(t)&&e.every(n=>vB(n))}function zNe(t){return Xy.find(e=>!!e.defaultForDomains?.includes(t))?.code}const kf=t=>F_.includes(t||""),bB=t=>kf(t)?t:void 0;var YNe={th:"e3b0c442",en:"e3b0c442"};const rK=()=>Bd("i18n:cached-locale-configs",()=>{}),sK=()=>Bd("i18n:resolved-locale",()=>"");function JNe({cookieCrossOrigin:t,cookieDomain:e,cookieSecure:n,cookieKey:r}){const s=new Date;return f9(r||"i18n_redirected",{path:"/",readonly:!1,expires:new Date(s.setDate(s.getDate()+365)),sameSite:t?"none":"lax",domain:e||void 0,secure:t||n})}function QNe(t,e,n){const r=nO(e),s=eI(t),i=tI(t),o=rK(),a=JNe(i),c=new Set,l=b=>o.value[b],d=b=>jNe(s.domainLocales,p9(),b),h=dDe(t,s.baseUrl),p=sK(),g=async b=>{const w=l(b)?.fallbacks??[];w.includes(b)||w.push(b);for(const E of w){const T=await t.runWithContext(()=>BNe(E,oT[E]));r.mergeLocaleMessage(E,T)}},_=async b=>{if(!(b in oT))return;const w=l(b)?.cacheable?{}:{"Cache-Control":"no-cache"},T=Nd("","/_i18n",YNe[b],b,"messages.json"),R=await $fetch(T,{headers:w});for(const N of Object.keys(R))r.mergeLocaleMessage(N,R[N])},v={vueI18n:e,initial:!0,preloaded:!1,config:s,rootRedirect:UNe(s.rootRedirect),redirectStatusCode:s.redirectStatusCode??302,dynamicResourcesSSG:!0,getDefaultLocale:()=>n,getLocale:()=>Wt(r.locale),setLocale:async b=>{const w=v.getLocale();b===w||!kf(b)||(Pn(r.locale)?r.locale.value=b:r.locale=b,await t.callHook("i18n:localeSwitched",{newLocale:b,oldLocale:w}),p.value=b)},setLocaleSuspend:async b=>{kf(b)&&(v.vueI18n.__pendingLocale=b,v.vueI18n.__pendingLocalePromise=new Promise(w=>{v.vueI18n.__resolvePendingLocalePromise=async()=>{v.setCookieLocale(b),await v.setLocale(b),v.vueI18n.__pendingLocale=void 0,w()}}),(t.isHydrating||!v.config.skipSettingLocaleOnNavigate)&&await v.vueI18n.__resolvePendingLocalePromise?.())},getLocales:()=>Wt(r.locales).map(b=>Je(b)?{code:b}:b),setCookieLocale:b=>{i.useCookie&&kf(b)&&(a.value=b)},getBaseUrl:b=>Nd(b&&d(b)||h(),t.$config.app.baseURL),loadMessages:async b=>{if(!(t.isHydrating&&c.has(b)))try{return v.dynamicResourcesSSG?await g(b):await _(b)}catch(w){console.warn(`Failed to load messages for locale "${b}"`,w)}finally{c.add(b)}},composableCtx:void 0};return v.composableCtx=aDe(v,t),v}
157function rO(t){if(t._nuxtI18n==null)throw new Error("Nuxt I18n context has not been set up yet.");return t._nuxtI18n}function XNe(t,e){const n=[];for(const[r,s]of e.entries()){const i=t.find(o=>o.language?.toLowerCase()===s.toLowerCase());if(i){n.push({code:i.code,score:1-r/e.length});break}}for(const[r,s]of e.entries()){const i=s.split("-")[0].toLowerCase(),o=t.find(a=>a.language?.split("-")[0].toLowerCase()===i);if(o){n.push({code:o.code,score:.999-r/e.length});break}}return n}function ZNe(t,e){return t.score===e.score?e.code.length-t.code.length:e.score-t.score}function eDe(t,e){return XNe(t.map(r=>({code:r.code,language:r.language||r.code})),e).sort(ZNe).at(0)?.code??""}const tDe=(t,e)=>f9(e).value||void 0,nDe=(t,e)=>DNe(e),rDe=t=>eDe(Xy,navigator.languages),sDe=(t,e,n)=>{const r=new URL(window.location.href).host,s=Xy.map(i=>({...i,domain:n[i.code]?.domain??i.domain}));return qNe(s,r,ZR(e))},sO=(t,e,n)=>{const r=eI(n);return{cookie:()=>tDe(t,e.cookieKey),header:()=>{},navigator:()=>rDe(),host:s=>sDe(t,s,r.domainLocales),route:s=>nDe(t,s)}},iDe=t=>!!t.path&&!t.name;function nI(t){const e=t?._nuxtI18n?.composableCtx;if(!e)throw new Error("i18n context is not initialized. Ensure the i18n plugin is installed and the composable is used within a Vue component or setup function.");return e}const oDe=s_;function aDe(t,e=xt()){const n=Os();sO(void 0,tI(e),e);const r=t.getDefaultLocale(),s=ONe();function i(l,d){l.name=MC(l.name||n.currentRoute.value);const h=s(l.name,d);return n.hasRoute(h)&&(l.name=h),l.name=h,l}const o=xNe();function a(l,d){const h=o(l,d),p=MC(h);if(p){const g=s(p,d);return n.hasRoute(g),h.name=g,h}return h.path=oDe(h.path,!0),h}const c={router:n,_head:void 0,get head(){return this._head??=wse({}),this._head},metaState:{htmlAttrs:{},meta:[],link:[]},seoSettings:{dir:!1,lang:!1,seo:!1},localePathPayload:cDe(),routingOptions:{defaultLocale:r,strictCanonicals:t.config.experimental.alternateLinkCanonicalQueries??!0,hreflangLinks:!1},getLocale:t.getLocale,getLocales:t.getLocales,getBaseUrl:t.getBaseUrl,getRouteBaseName:MC,getRouteLocalizedParams:()=>n.currentRoute.value.meta.nuxtI18nInternal??{},getLocalizedDynamicParams:l=>c.getRouteLocalizedParams()?.[l],afterSwitchLocalePath:(l,d)=>(c.getRouteLocalizedParams(),l),resolveLocalizedRouteObject:(l,d)=>iDe(l)?a(l,d):i(l,d)};return c}function cDe(t=xt()){const e=document.querySelector(`[data-nuxt-i18n-slp="${t._id}"]`)?.textContent;return JSON.parse(e||"{}")}async function iK(t,e){const n=rO(t),r=n.getLocale();if(e===r&&!n.initial&&(!n.vueI18n.__pendingLocale||n.vueI18n.__pendingLocale===e))return e;const s={oldLocale:r,newLocale:e,initialSetup:n.initial,context:t};let i=await t.callHook("i18n:beforeLocaleSwitch",s);return i!=null,i??=s.newLocale,kf(i)&&(e=i),await n.loadMessages(e),await n.setLocaleSuspend(e),e}function lDe(t,e,n){return!1}function uDe(t,e){const n=tI(t),r=sO(void 0,n,t),s=rO(t),i=Je(e)?e:e.path;function*o(){s.initial&&n.enabled&&!lDe(n,i,r.route(i))&&(yield r.cookie(),yield r.header(),yield r.navigator(),yield n.fallbackLocale)}for(const a of o())if(a&&kf(a))return a;return s.getLocale()||s.getDefaultLocale()||""}function dDe(t,e,n,r){return Jn(e)?()=>e(t):()=>e??""}function hDe(t,e,n){return{line:t,column:e,offset:n}}function eP(t,e,n){return{start:t,end:e}}const In={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},fDe=17;function rI(t,e,n={}){const{domain:r,messages:s,args:i}=n,o=t,a=new SyntaxError(String(o));return a.code=t,e&&(a.location=e),a.domain=r,a}function pDe(t){throw t}const da=" ",mDe="\r",Es=` 158`,gDe="\u2028",_De="\u2029";function yDe(t){const e=t;let n=0,r=1,s=1,i=0;const o=S=>e[S]===mDe&&e[S+1]===Es,a=S=>e[S]===Es,c=S=>e[S]===_De,l=S=>e[S]===gDe,d=S=>o(S)||a(S)||c(S)||l(S),h=()=>n,p=()=>r,g=()=>s,_=()=>i,v=S=>o(S)||c(S)||l(S)?Es:e[S],b=()=>v(n),w=()=>v(n+i);function E(){return i=0,d(n)&&(r++,s=0),o(n)&&n++,n++,s++,e[n]}function T(){return o(n+i)&&i++,i++,e[n+i]}function R(){n=0,r=1,s=1,i=0}function N(S=0){i=S}function O(){const S=n+i;for(;S!==n;)E();i=0}return{index:h,line:p,column:g,peekOffset:_,charAt:v,currentChar:b,currentPeek:w,next:E,peek:T,reset:R,resetPeek:N,skipToPeek:O}}const dc=void 0,vDe=".",wB="'",bDe="tokenizer";function wDe(t,e={}){const n=e.location!==!1,r=yDe(t),s=()=>r.index(),i=()=>hDe(r.line(),r.column(),r.index()),o=i(),a=s(),c={currentType:13,offset:a,startLoc:o,endLoc:o,lastType:13,lastOffset:a,lastStartLoc:o,lastEndLoc:o,braceNest:0,inLinked:!1,text:""},l=()=>c,{onError:d}=e;function h(B,q,J,...se){const be=l();if(q.column+=J,q.offset+=J,d){const xe=n?eP(be.startLoc,q):null,X=rI(B,xe,{domain:bDe,args:se});d(X)}}function p(B,q,J){B.endLoc=i(),B.currentType=q;const se={type:q};return n&&(se.loc=eP(B.startLoc,B.endLoc)),J!=null&&(se.value=J),se}const g=B=>p(B,13);function _(B,q){return B.currentChar()===q?(B.next(),q):(h(In.EXPECTED_TOKEN,i(),0,q),"")}function v(B){let q="";for(;B.currentPeek()===da||B.currentPeek()===Es;)q+=B.currentPeek(),B.peek();return q}function b(B){const q=v(B);return B.skipToPeek(),q}function w(B){if(B===dc)return!1;
158const q=B.charCodeAt(0);return q>=97&&q<=122||q>=65&&q<=90||q===95}function E(B){if(B===dc)return!1;const q=B.charCodeAt(0);return q>=48&&q<=57}function T(B,q){const{currentType:J}=q;if(J!==2)return!1;v(B);const se=w(B.currentPeek());return B.resetPeek(),se}function R(B,q){const{currentType:J}=q;if(J!==2)return!1;v(B);const se=B.currentPeek()==="-"?B.peek():B.currentPeek(),be=E(se);return B.resetPeek(),be}function N(B,q){const{currentType:J}=q;if(J!==2)return!1;v(B);const se=B.currentPeek()===wB;return B.resetPeek(),se}function O(B,q){const{currentType:J}=q;if(J!==7)return!1;v(B);const se=B.currentPeek()===".";return B.resetPeek(),se}function S(B,q){const{currentType:J}=q;if(J!==8)return!1;v(B);const se=w(B.currentPeek());return B.resetPeek(),se}function I(B,q){const{currentType:J}=q;if(!(J===7||J===11))return!1;v(B);const se=B.currentPeek()===":";return B.resetPeek(),se}function P(B,q){const{currentType:J}=q;if(J!==9)return!1;const se=()=>{const xe=B.currentPeek();return xe==="{"?w(B.peek()):xe==="@"||xe==="|"||xe===":"||xe==="."||xe===da||!xe?!1:xe===Es?(B.peek(),se()):L(B,!1)},be=se();return B.resetPeek(),be}function k(B){v(B);const q=B.currentPeek()==="|";return B.resetPeek(),q}function L(B,q=!0){const J=(be=!1,xe="")=>{const X=B.currentPeek();return X==="{"||X==="@"||!X?be:X==="|"?!(xe===da||xe===Es):X===da?(B.peek(),J(!0,da)):X===Es?(B.peek(),J(!0,Es)):!0},se=J();return q&&B.resetPeek(),se}function M(B,q){const J=B.currentChar();return J===dc?dc:q(J)?(B.next(),J):null}
158function V(B){const q=B.charCodeAt(0);return q>=97&&q<=122||q>=65&&q<=90||q>=48&&q<=57||q===95||q===36}function z(B){return M(B,V)}function ie(B){const q=B.charCodeAt(0);return q>=97&&q<=122||q>=65&&q<=90||q>=48&&q<=57||q===95||q===36||q===45}function K(B){return M(B,ie)}function ce(B){const q=B.charCodeAt(0);return q>=48&&q<=57}function G(B){return M(B,ce)}function Z(B){const q=B.charCodeAt(0);return q>=48&&q<=57||q>=65&&q<=70||q>=97&&q<=102}function de(B){return M(B,Z)}function fe(B){let q="",J="";for(;q=G(B);)J+=q;return J}function ee(B){let q="";for(;;){const J=B.currentChar();if(J==="\\"){const se=B.peek();se==="{"||se==="}"||se==="@"||se==="|"||se==="\\"?(q+=J+se,B.next(),B.next()):(B.resetPeek(),q+=J,B.next())}else{if(J==="{"||J==="}"||J==="@"||J==="|"||!J)break;if(J===da||J===Es)if(L(B))q+=J,B.next();else{if(k(B))break;q+=J,B.next()}else q+=J,B.next()}}return q}function Te(B){b(B);let q="",J="";for(;q=K(B);)J+=q;const se=B.currentChar();if(se&&se!=="}"&&se!==dc&&se!==da&&se!==Es&&se!=="ã"){const be=Me(B);return h(In.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,J+be),J+be}return B.currentChar()===dc&&h(In.UNTERMINATED_CLOSING_BRACE,i(),0),J}function pe(B){b(B);let q="";return B.currentChar()==="-"?(B.next(),q+=`-${fe(B)}`):q+=fe(B),B.currentChar()===dc&&h(In.UNTERMINATED_CLOSING_BRACE,i(),0),q}function Ce(B){return B!==wB&&B!==Es}function Ve(B){b(B),_(B,"'");let q="",J="";for(;q=M(B,Ce);)q==="\\"?J+=Y(B):J+=q;const se=B.currentChar();return se===Es||se===dc?(h(In.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,i(),0),se===Es&&(B.next(),_(B,"'")),J):(_(B,"'"),J)}function Y(B){const q=B.currentChar();switch(q){case"\\":case"'":return B.next(),`\\${q}`;case"u":return ve(B,q,4);case"U":return ve(B,q,6);default:return h(In.UNKNOWN_ESCAPE_SEQUENCE,i(),0,q),""}}function ve(B,q,J){_(B,q);let se="";for(let be=0;be<J;be++){const xe=de(B);if(!xe){h(In.INVALID_UNICODE_ESCAPE_SEQUENCE,i(),0,`\\${q}${se}${B.currentChar()}`);break}se+=xe}return`\\${q}${se}`}function Ee(B){return B!=="{"&&B!=="}"&&B!==da&&B!==Es}function Me(B){b(B);let q="",J="";for(;q=M(B,Ee);)J+=q;return J}function Ke(B){let q="",J="";for(;q=z(B);)J+=q;return J}function ut(B){const q=J=>{const se=B.currentChar();return se==="{"||se==="@"||se==="|"||se==="("||se===")"||!se||se===da?J:(J+=se,B.next(),q(J))};return q("")}function H(B){b(B);const q=_(B,"|");return b(B),q}function j(B,q){let J=null;switch(B.currentChar()){case"{":return q.braceNest>=1&&h(In.NOT_ALLOW_NEST_PLACEHOLDER,i(),0),B.next(),J=p(q,2,"{"),b(B),q.braceNest++,J;case"}":return q.braceNest>0&&q.currentType===2&&h(In.EMPTY_PLACEHOLDER,i(),0),B.next(),J=p(q,3,"}"),q.braceNest--,q.braceNest>0&&b(B),q.inLinked&&q.braceNest===0&&(q.inLinked=!1),J;case"@":return q.braceNest>0&&h(In.UNTERMINATED_CLOSING_BRACE,i(),0),J=re(B,q)||g(q),q.braceNest=0,J;default:{let be=!0,xe=!0,X=!0;if(k(B))return q.braceNest>
vendor: 1,286 bytes, line 158
1580&&h(In.UNTERMINATED_CLOSING_BRACE,i(),0),J=p(q,1,H(B)),q.braceNest=0,q.inLinked=!1,J;if(q.braceNest>0&&(q.currentType===4||q.currentType===5||q.currentType===6))return h(In.UNTERMINATED_CLOSING_BRACE,i(),0),q.braceNest=0,Re(B,q);if(be=T(B,q))return J=p(q,4,Te(B)),b(B),J;if(xe=R(B,q))return J=p(q,5,pe(B)),b(B),J;if(X=N(B,q))return J=p(q,6,Ve(B)),b(B),J;if(!be&&!xe&&!X)return J=p(q,12,Me(B)),h(In.INVALID_TOKEN_IN_PLACEHOLDER,i(),0,J.value),b(B),J;break}}return J}function re(B,q){const{currentType:J}=q;let se=null;const be=B.currentChar();switch((J===7||J===8||J===11||J===9)&&(be===Es||be===da)&&h(In.INVALID_LINKED_FORMAT,i(),0),be){case"@":return B.next(),se=p(q,7,"@"),q.inLinked=!0,se;case".":return b(B),B.next(),p(q,8,".");case":":return b(B),B.next(),p(q,9,":");default:return k(B)?(se=p(q,1,H(B)),q.braceNest=0,q.inLinked=!1,se):O(B,q)||I(B,q)?(b(B),re(B,q)):S(B,q)?(b(B),p(q,11,Ke(B))):P(B,q)?(b(B),be==="{"?j(B,q)||se:p(q,10,ut(B))):(J===7&&h(In.INVALID_LINKED_FORMAT,i(),0),q.braceNest=0,q.inLinked=!1,Re(B,q))}}function Re(B,q){let J={type:13};if(q.braceNest>0)return j(B,q)||g(q);if(q.inLinked)return re(B,q)||g(q);switch(B.currentChar()){case"{":return j(B,q)||g(q);case"}":return h(In.UNBALANCED_CLOSING_BRACE,i(),0),B.next(),p(q,3,"}");case"@":return re(B,q)||g(q);
158default:{if(k(B))return J=p(q,1,H(B)),q.braceNest=0,q.inLinked=!1,J;if(L(B))return p(q,0,ee(B));break}}return J}function ge(){const{currentType:B,offset:q,startLoc:J,endLoc:se}=c;return c.lastType=B,c.lastOffset=q,c.lastStartLoc=J,c.lastEndLoc=se,c.offset=s(),c.startLoc=i(),r.currentChar()===dc?p(c,13):Re(r,c)}return{nextToken:ge,currentOffset:s,currentPosition:i,context:l}}const SDe="parser",TDe=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,EDe=/\\([\\@{}|])/g;function IDe(t,e){return e}function CDe(t,e,n){switch(t){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(e||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function ADe(t={}){const e=t.location!==!1,{onError:n}=t;function r(w,E,T,R,...N){const O=w.currentPosition();if(O.offset+=R,O.column+=R,n){const S=e?eP(T,O):null,I=rI(E,S,{domain:SDe,args:N});n(I)}}function s(w,E,T){const R={type:w};return e&&(R.start=E,R.end=E,R.loc={start:T,end:T}),R}function i(w,E,T,R){e&&(w.end=E,w.loc&&(w.loc.end=T))}function o(w,E){const T=w.context(),R=s(3,T.offset,T.startLoc);return R.value=E.replace(EDe,IDe),i(R,w.currentOffset(),w.currentPosition()),R}function a(w,E){const T=w.context(),{lastOffset:R,lastStartLoc:N}=T,O=s(5,R,N);return O.index=parseInt(E,10),w.nextToken(),i(O,w.currentOffset(),w.currentPosition()),O}function c(w,E){const T=w.context(),{lastOffset:R,lastStartLoc:N}=T,O=s(4,R,N);return O.key=E,w.nextToken(),i(O,w.currentOffset(),w.currentPosition()),O}function l(w,E){const T=w.context(),{lastOffset:R,lastStartLoc:N}=T,O=s(9,R,N);return O.value=E.replace(TDe,CDe),w.nextToken(),i(O,w.currentOffset(),w.currentPosition()),O}function d(w){const E=w.nextToken(),T=w.context(),{lastOffset:R,lastStartLoc:N}=T,O=s(8,R,N);return E.type!==11?(r(w,In.UNEXPECTED_EMPTY_LINKED_MODIFIER,T.lastStartLoc,0),O.value="",i(O,R,N),{nextConsumeToken:E,node:O}):(E.value==null&&r(w,In.UNEXPECTED_LEXICAL_ANALYSIS,T.lastStartLoc,0,ha(E)),O.value=E.value||"",i(O,w.currentOffset(),w.currentPosition()),{node:O})}function h(w,E){const T=w.context(),R=s(7,T.offset,T.startLoc);return R.value=E,i(R,w.currentOffset(),w.currentPosition()),R}function p(w){const E=w.context(),T=s(6,E.offset,E.startLoc);let R=w.nextToken();if(R.type===8){const N=d(w);T.modifier=N.node,R=N.nextConsumeToken||w.nextToken()}switch(R.type!==9&&r(w,In.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,ha(R)),R=w.nextToken(),R.type===2&&(R=w.nextToken()),R.type){case 10:R.value==null&&r(w,In.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,ha(R)),T.key=h(w,R.value||"");break;case 4:R.value==null&&r(w,In.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,ha(R)),T.key=c(w,R.value||"");break;case 5:R.value==null&&r(w,In.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,ha(R)),T.key=a(w,R.value||"");break;case 6:R.value==null&&r(w,In.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,ha(R)),T.key=l(w,R.value||"");break;default:{r(w,In.UNEXPECTED_EMPTY_LINKED_KEY,E.lastStartLoc,0);const N=w.context(),O=s(7,N.offset,N.startLoc);return O.value="",i(O,N.offset,N.startLoc),T.key=O,i(T,N.offset,N.startLoc),{nextConsumeToken:R,node:T}}}return i(T,w.currentOffset(),w.currentPosition()),{node:T}}function g(w){const E=w.context(),T=E.currentType===1?w.currentOffset():E.offset,R=E.currentType===1?E.endLoc:E.startLoc,N=s(2,T,R);N.items=[];let O=null;do{const P=O||w.nextToken();switch(O=null,P.type){case 0:P.value==null&&r(w,In.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,ha(P)),N.items.push(o(w,P.value||""));break;case 5:P.value==null&&r(w,In.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,ha(P)),N.items.push(a(w,P.value||""));break;case 4:P.value==null&&r(w,In.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,ha(P)),N.items.push(c(w,P.value||""));break;case 6:P.value==null&&r(w,In.UNEXPECTED_LEXICAL_ANALYSIS,E.lastStartLoc,0,ha(P)),N.items.push(l(w,P.value||""));break;case 7:{const k=p(w);N.items.push(k.node),O=k.nextConsumeToken||null;break}}}while(E.currentType!==13&&E.currentType!==1);const S=E.currentType===1?E.lastOffset:w.currentOffset(),I=E.currentType===1?E.lastEndLoc:w.currentPosition();return i(N,S,I),N}function _(w,E,T,R){const N=w.context();let O=R.items.length===0;const S=s(1,E,T);S.cases=[],S.cases.push(R);do{const I=g(w);O||(O=I.items.length===0),S.cases.push(I)}while(N.currentType!==13);return O&&r(w,In.MUST_HAVE_MESSAGES_IN_PLURAL,T,0),i(S,w.currentOffset(),w.currentPosition()),S}
158function v(w){const E=w.context(),{offset:T,startLoc:R}=E,N=g(w);return E.currentType===13?N:_(w,T,R,N)}function b(w){const E=wDe(w,wr({},t)),T=E.context(),R=s(0,T.offset,T.startLoc);return e&&R.loc&&(R.loc.source=w),R.body=v(E),t.onCacheKey&&(R.cacheKey=t.onCacheKey(w)),T.currentType!==13&&r(E,In.UNEXPECTED_LEXICAL_ANALYSIS,T.lastStartLoc,0,w[T.offset]||""),i(R,E.currentOffset(),E.currentPosition()),R}return{parse:b}}function ha(t){if(t.type===13)return"EOF";const e=(t.value||"").replace(/\r?\n/gu,"\\n");return e.length>10?e.slice(0,9)+"â¦":e}function RDe(t,e={}){const n={ast:t,helpers:new Set};return{context:()=>n,helper:i=>(n.helpers.add(i),i)}}function SB(t,e){for(let n=0;n<t.length;n++)iO(t[n],e)}function iO(t,e){switch(t.type){case 1:SB(t.cases,e),e.helper("plural");break;case 2:SB(t.items,e);break;case 6:{iO(t.key,e),e.helper("linked"),e.helper("type");break}case 5:e.helper("interpolate"),e.helper("list");break;case 4:e.helper("interpolate"),e.helper("named");break}}function PDe(t,e={}){const n=RDe(t);n.helper("normalize"),t.body&&iO(t.body,n);const r=n.context();t.helpers=Array.from(r.helpers)}function kDe(t){const e=t.body;return e.type===2?TB(e):e.cases.forEach(n=>TB(n)),t}function TB(t){if(t.items.length===1){const e=t.items[0];(e.type===3||e.type===9)&&(t.static=e.value,delete e.value)}else{const e=[];for(let n=0;n<t.items.length;n++){const r=t.items[n];if(!(r.type===3||r.type===9)||r.value==null)break;e.push(r.value)}if(e.length===t.items.length){t.static=tO(e);for(let n=0;n<t.items.length;n++){const r=t.items[n];(r.type===3||r.type===9)&&delete r.value}}}}function uf(t){switch(t.t=t.type,t.type){case 0:{const e=t;uf(e.body),e.b=e.body,delete e.body;break}case 1:{const e=t,n=e.cases;for(let r=0;r<n.length;r++)uf(n[r]);e.c=n,delete e.cases;break}case 2:{const e=t,n=e.items;for(let r=0;r<n.length;r++)uf(n[r]);e.i=n,delete e.items,e.static&&(e.s=e.static,delete e.static);break}case 3:case 9:case 8:case 7:{const e=t;e.value&&(e.v=e.value,delete e.value);break}case 6:{const e=t;uf(e.key),e.k=e.key,delete e.key,e.modifier&&(uf(e.modifier),e.m=e.modifier,delete e.modifier);break}case 5:{const e=t;e.i=e.index,delete e.index;break}case 4:{const e=t;e.k=e.key,delete e.key;break}}delete t.type}function NDe(t,e){const{filename:n,breakLineCode:r,needIndent:s}=e,i=e.location!==!1,o={filename:n,code:"",column:1,line:1,offset:0,map:void 0,breakLineCode:r,needIndent:s,indentLevel:0};i&&t.loc&&(o.source=t.loc.source);const a=()=>o;function c(v,b){o.code+=v}function l(v,b=!0){const w=b?r:"";c(s?w+" ".repeat(v):w)}function d(v=!0){const b=++o.indentLevel;v&&l(b)}function h(v=!0){const b=--o.indentLevel;v&&l(b)}function p(){l(o.indentLevel)}return{context:a,push:c,indent:d,deindent:h,newline:p,helper:v=>`_${v}`,needIndent:()=>o.needIndent}}function DDe(t,e){const{helper:n}=t;t.push(`${n("linked")}(`),pp(t,e.key),e.modifier?(t.push(", "),pp(t,e.modifier),t.push(", _type")):t.push(", undefined, _type"),t.push(")")}function ODe(t,e){const{helper:n,needIndent:r}=t;t.push(`${n("normalize")}([`),t.indent(r());const s=e.items.length;for(let i=0;i<s&&(pp(t,e.items[i]),i!==s-1);i++)t.push(", ");t.deindent(r()),t.push("])")}function xDe(t,e){const{helper:n,needIndent:r}=t;if(e.cases.length>1){t.push(`${n("plural")}([`),t.indent(r());const s=e.cases.length;for(let i=0;i<s&&(pp(t,e.cases[i]),i!==s-1);i++)t.push(", ");t.deindent(r()),t.push("])")}}function LDe(t,e){e.body?pp(t,e.body):t.push("null")}function pp(t,e){const{helper:n}=t;switch(e.type){case 0:LDe(t,e);break;case 1:xDe(t,e);break;case 2:ODe(t,e);break;case 6:DDe(t,e);break;case 8:t.push(JSON.stringify(e.value),e);break;case 7:t.push(JSON.stringify(e.value),e);break;case 5:t.push(`${n("interpolate")}(${n("list")}(${e.index}))`,e);break;case 4:t.push(`${n("interpolate")}(${n("named")}(${JSON.stringify(e.key)}))`,e);break;case 9:t.push(JSON.stringify(e.value),e);break;case 3:t.push(JSON.stringify(e.value),e);break}}const MDe=(t,e={})=>{const n=Je(e.mode)?e.mode:"normal",r=Je(e.filename)?e.filename:"message.intl";e.sourceMap;const s=e.breakLineCode!=null?e.breakLineCode:n==="arrow"?";":` 159`,i=e.needIndent?e.needIndent:n!=="arrow",o=t.helpers||[],a=NDe(t,{filename:r,breakLineCode:s,needIndent:i});a.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),a.indent(i),o.length>0&&(a.push(`const { ${tO(o.map(d=>`${d}: _${d}`),", ")} } = ctx`),a.newline()),a.push("return "),pp(a,t),a.deindent(i),a.push("}"),delete t.helpers;const{code:c,map:l}=a.context();return{ast:t,code:c,map:l?l.toJSON():void 0}};function VDe(t,e={}
159){const n=wr({},e),r=!!n.jit,s=!!n.minify,i=n.optimize==null?!0:n.optimize,a=ADe(n).parse(t);return r?(i&&kDe(a),s&&uf(a),{ast:a,code:""}):(PDe(a,n),MDe(a,n))}function Ra(t){return dn(t)&&oO(t)===0&&(uo(t,"b")||uo(t,"body"))}const oK=["b","body"];function FDe(t){return Du(t,oK)}const aK=["c","cases"];function BDe(t){return Du(t,aK,[])}const cK=["s","static"];function $De(t){return Du(t,cK)}const lK=["i","items"];function UDe(t){return Du(t,lK,[])}const uK=["t","type"];function oO(t){return Du(t,uK)}const dK=["v","value"];function Ub(t,e){const n=Du(t,dK);if(n!=null)return n;throw B_(e)}const hK=["m","modifier"];function HDe(t){return Du(t,hK)}const fK=["k","key"];function qDe(t){const e=Du(t,fK);if(e)return e;throw B_(6)}function Du(t,e,n){for(let r=0;r<e.length;r++){const s=e[r];if(uo(t,s)&&t[s]!=null)return t[s]}return n}const pK=[...oK,...aK,...cK,...lK,...fK,...hK,...dK,...uK];function B_(t){return new Error(`unhandled node type: ${t}`)}function VC(t){return n=>jDe(n,t)}function jDe(t,e){const n=FDe(e);if(n==null)throw B_(0);if(oO(n)===1){const i=BDe(n);return t.plural(i.reduce((o,a)=>[...o,EB(t,a)],[]))}else return EB(t,n)}function EB(t,e){const n=$De(e);if(n!=null)return t.type==="text"?n:t.normalize([n]);{const r=UDe(e).reduce((s,i)=>[...s,tP(t,i)],[]);return t.normalize(r)}}function tP(t,e){const n=oO(e);switch(n){case 3:return Ub(e,n);case 9:return Ub(e,n);case 4:{const r=e;if(uo(r,"k")&&r.k)return t.interpolate(t.named(r.k));if(uo(r,"key")&&r.key)return t.interpolate(t.named(r.key));throw B_(n)}case 5:{const r=e;if(uo(r,"i")&&Wr(r.i))return t.interpolate(t.list(r.i));if(uo(r,"index")&&Wr(r.index))return t.interpolate(t.list(r.index));throw B_(n)}case 6:{const r=e,s=HDe(r),i=qDe(r);return t.linked(tP(t,i),s?tP(t,s):void 0,t.type)}case 7:return Ub(e,n);case 8:return Ub(e,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const WDe=t=>t;let Hb=An();function GDe(t,e={}){let n=!1;const r=e.onError||pDe;return e.onError=s=>{n=!0,r(s)},{...VDe(t,e),detectError:n}}function KDe(t,e){if(Je(t)){ar(e.warnHtmlMessage)&&e.warnHtmlMessage;const r=(e.onCacheKey||WDe)(t),s=Hb[r];if(s)return s;const{ast:i,detectError:o}=GDe(t,{...e,location:!1,jit:!0}),a=VC(i);return o?a:Hb[r]=a}else{const n=t.cacheKey;if(n){const r=Hb[n];return r||(Hb[n]=VC(t))}else return VC(t)}}const Ic={INVALID_ARGUMENT:fDe,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},zDe=24;function Cc(t){return rI(t,null,void 0)}function aO(t,e){return e.locale!=null?IB(e.locale):IB(t.locale)}let FC;function IB(t){if(Je(t))return t;if(Jn(t)){if(t.resolvedOnce&&FC!=null)return FC;if(t.constructor.name==="Function"){const e=t();if(pNe(e))throw Cc(Ic.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return FC=e}else throw Cc(Ic.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw Cc(Ic.NOT_SUPPORT_LOCALE_TYPE)}function YDe(t,e,n){return[...new Set([n,...yr(e)?e:dn(e)?Object.keys(e):Je(e)?[e]:[n]])]}function nP(t,e,n){const r=Je(n)?n:aT,s=t;s.__localeChainCache||(s.__localeChainCache=new Map);let i=s.__localeChainCache.get(r);if(!i){i=[];let o=[n];for(;yr(o);)o=CB(i,o,e);const a=yr(e)||!gn(e)?e:e.default?e.default:null;o=Je(a)?[a]:a,yr(o)&&CB(i,o,!1),s.__localeChainCache.set(r,i)}return i}function CB(t,e,n){let r=!0;for(let s=0;s<e.length&&ar(r);s++){const i=e[s];Je(i)&&(r=JDe(t,e[s],n))}return r}function JDe(t,e,n){let r;const s=e.split("-");do{const i=s.join("-");r=QDe(t,i,n),s.splice(-1,1)}while(s.length&&r===!0);return r}function QDe(t,e,n){let r=!1;if(!t.includes(e)&&(r=!0,e)){r=e[e.length-1]!=="!";const s=e.replace(/!/g,"");t.push(s),(yr(n)||gn(n))&&n[s]&&(r=n[s])}return r}const Ou=[];Ou[0]={w:[0],i:[3,0],"[":[4],o:[7]};Ou[1]={w:[1],".":[2],"[":[4],o:[7]};Ou[2]={w:[2],i:[3,0],0:[3,0]};Ou[3]={i:[3,0],0:[3,0],w:[1,1],".":[2,1],"[":[4,1],o:[7,1]};Ou[4]={"'":[5,0],'"':[6,0],"[":[4,2],"]":[1,3],o:8,l:[4,0]};Ou[5]={"'":[4,0],o:8,l:[5,0]};Ou[6]={'"':[4,0],o:8,l:[6,0]};const XDe=/^\s?(?:true|false|-?[\d.]+|'[^']*'|"[^"]*")\s?$/;function ZDe(t){return XDe.test(t)}function eOe(t){const e=t.charCodeAt(0),n=t.charCodeAt(t.length-1);return e===n&&(e===34||e===39)?t.slice(1,-1):t}function tOe(t){if(t==null)return"o";switch(t.charCodeAt(0)){case 91:case 93:case 46:case 34:case 39:return t;case 95:case 36:case 45:return"i";case 9:case 10:case 13:case 160:case 65279:case 8232:case 8233:return"w"}return"i"}function nOe(t){const e=t.trim();return t.charAt(0)==="0"&&isNaN(parseInt(t))?!1:ZDe(e)?eOe(e):"*"+e}function rOe(t){const e=[];let n=-1,r=0,s=0,i,o,a,c,l,d,h;const p=[];p[0]=()=>{o===void 0?o=a:o+=a},p[1]=()=>{o!==void 0&&(e.push(o),o=void 0)},p[2]=()=>{p[0](),s++},p[3]=()=>
159{if(s>0)s--,r=4,p[0]();else{if(s=0,o===void 0||(o=nOe(o),o===!1))return!1;p[1]()}};function g(){const _=t[n+1];if(r===5&&_==="'"||r===6&&_==='"')return n++,a="\\"+_,p[0](),!0}for(;r!==null;)if(n++,i=t[n],!(i==="\\"&&g())){if(c=tOe(i),h=Ou[r],l=h[c]||h.l||8,l===8||(r=l[0],l[1]!==void 0&&(d=p[l[1]],d&&(a=i,d()===!1))))return;if(r===7)return e}}const AB=new Map;function sOe(t,e){return dn(t)?t[e]:null}function iOe(t,e){if(!dn(t))return null;let n=AB.get(e);if(n||(n=rOe(e),n&&AB.set(e,n)),!n)return null;const r=n.length;let s=t,i=0;for(;i<r;){const o=n[i];if(pK.includes(o)&&Ra(s)||!dn(s)||!uo(s,o))return null;const a=s[o];if(a===void 0||Jn(s))return null;s=a,i++}return s}const oOe="11.4.4",sI=-1,aT="en-US",cT="",RB=t=>`${t.charAt(0).toLocaleUpperCase()}${t.substr(1)}`;function aOe(){return{upper:(t,e)=>e==="text"&&Je(t)?t.toUpperCase():e==="vnode"&&dn(t)&&"__v_isVNode"in t?t.children.toUpperCase():t,lower:(t,e)=>e==="text"&&Je(t)?t.toLowerCase():e==="vnode"&&dn(t)&&"__v_isVNode"in t?t.children.toLowerCase():t,capitalize:(t,e)=>e==="text"&&Je(t)?RB(t):e==="vnode"&&dn(t)&&"__v_isVNode"in t?RB(t.children):t}}let mK;function cOe(t){mK=t}let gK;function lOe(t){gK=t}let _K;function uOe(t){_K=t}let yK=null;const PB=t=>{yK=t},dOe=()=>yK;let kB=0;function hOe(t={}){const e=Jn(t.onWarn)?t.onWarn:sNe,n=Je(t.version)?t.version:oOe,r=Je(t.locale)||Jn(t.locale)?t.locale:aT,s=Jn(r)?aT:r,i=yr(t.fallbackLocale)||gn(t.fallbackLocale)||Je(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:s,o=gn(t.messages)?t.messages:BC(s),a=gn(t.datetimeFormats)?t.datetimeFormats:BC(s),c=gn(t.numberFormats)?t.numberFormats:BC(s),l=wr(An(),t.modifiers,aOe()),d=t.pluralRules||An(),h=Jn(t.missing)?t.missing:null,p=ar(t.missingWarn)||iT(t.missingWarn)?t.missingWarn:!0,g=ar(t.fallbackWarn)||iT(t.fallbackWarn)?t.fallbackWarn:!0,_=!!t.fallbackFormat,v=!!t.unresolving,b=Jn(t.postTranslation)?t.postTranslation:null,w=gn(t.processor)?t.processor:null,E=ar(t.warnHtmlMessage)?t.warnHtmlMessage:!0,T=!!t.escapeParameter,R=Jn(t.messageCompiler)?t.messageCompiler:mK,N=Jn(t.messageResolver)?t.messageResolver:gK||sOe,O=Jn(t.localeFallbacker)?t.localeFallbacker:_K||YDe,S=dn(t.fallbackContext)?t.fallbackContext:void 0,I=t,P=dn(I.__datetimeFormatters)?I.__datetimeFormatters:new Map,k=dn(I.__numberFormatters)?I.__numberFormatters:new Map,L=dn(I.__meta)?I.__meta:{};kB++;const M={version:n,cid:kB,locale:r,fallbackLocale:i,messages:o,modifiers:l,pluralRules:d,missing:h,missingWarn:p,fallbackWarn:g,fallbackFormat:_,unresolving:v,postTranslation:b,processor:w,warnHtmlMessage:E,escapeParameter:T,messageCompiler:R,messageResolver:N,localeFallbacker:O,fallbackContext:S,onWarn:e,__meta:L};return M.datetimeFormats=a,M.numberFormats=c,M.__datetimeFormatters=P,M.__numberFormatters=k,M}const BC=t=>({[t]:An()});function cO(t,e,n,r,s){const{missing:i,onWarn:o}=t;if(i!==null){const a=i(t,n,e,s);return Je(a)?a:e}else return e}function rg(t,e,n){const r=t;r.__localeChainCache=new Map,t.localeFallbacker(t,n,e)}function fOe(t,e){return t===e?!1:t.split("-")[0]===e.split("-")[0]}function pOe(t,e){const n=e.indexOf(t);if(n===-1)return!1;for(let r=n+1;r<e.length;r++)if(fOe(t,e[r]))return!0;return!1}function NB(t,...e){const{datetimeFormats:n,unresolving:r,fallbackLocale:s,onWarn:i,localeFallbacker:o}=t,{__datetimeFormatters:a}=t;if(!Je(e[0])&&!j9(e[0])&&!Wr(e[0]))return cT;const[c,l,d,h]=rP(...e),p=ar(d.missingWarn)?d.missingWarn:t.missingWarn;ar(d.fallbackWarn)?d.fallbackWarn:t.fallbackWarn;const g=!!d.part,_=aO(t,d),v=o(t,s,_);if(!Je(c)||c==="")return new Intl.DateTimeFormat(_.replace(/!/g,""),h).format(l);let b={},w,E=null;const T="datetime format";for(let O=0;O<v.length&&(w=v[O],b=n[w]||{},E=b[c],!gn(E));O++)cO(t,c,w,p,T);if(!gn(E)||!Je(w))return r?sI:c;let R=`${w}__${c}`;XE(h)||(R=`${R}__${JSON.stringify(h)}`);let N=a.get(R);return N||(N=new Intl.DateTimeFormat(w,wr({},E,h)),a.set(R,N)),g?N.formatToParts(l):N.format(l)}const vK=["localeMatcher","weekday","era","year","month","day","hour","minute","second","timeZoneName","formatMatcher","hour12","timeZone","dateStyle","timeStyle","calendar","dayPeriod","numberingSystem","hourCycle","fractionalSecondDigits"];function rP(...t){const[e,n,r,s]=t,i=An();let o=An(),a;if(Je(e)){const c=e.match(/(\d{4}-\d{2}-\d{2})(T|\s)?(.*)/);if(!c)throw Cc(Ic.INVALID_ISO_DATE_ARGUMENT);const l=c[3]?c[3].trim().startsWith("T")?`${c[1].trim()}${c[3].trim()}`:`${c[1].trim()}T${c[3].trim()}`:c[1].trim();a=new Date(l);try{a.toISOString()}catch{throw Cc(Ic.INVALID_ISO_DATE_ARGUMENT)}}else if(j9(e)){if(isNaN(e.getTime()))throw Cc(Ic.INVALID_DATE_ARGUMENT);a=e}else if(Wr(e))a=e;else throw Cc(Ic.INVALID_ARGUMENT);
159return Je(n)?i.key=n:gn(n)&&Object.keys(n).forEach(c=>{vK.includes(c)?o[c]=n[c]:i[c]=n[c]}),Je(r)?i.locale=r:gn(r)&&(o=r),gn(s)&&(o=s),[i.key||"",a,i,o]}function DB(t,e,n){const r=t;for(const s in n){const i=`${e}__${s}`;r.__datetimeFormatters.has(i)&&r.__datetimeFormatters.delete(i)}}function OB(t,...e){const{numberFormats:n,unresolving:r,fallbackLocale:s,onWarn:i,localeFallbacker:o}=t,{__numberFormatters:a}=t;if(!Wr(e[0]))return cT;const[c,l,d,h]=sP(...e),p=ar(d.missingWarn)?d.missingWarn:t.missingWarn;ar(d.fallbackWarn)?d.fallbackWarn:t.fallbackWarn;const g=!!d.part,_=aO(t,d),v=o(t,s,_);if(!Je(c)||c==="")return new Intl.NumberFormat(_.replace(/!/g,""),h).format(l);let b={},w,E=null;const T="number format";for(let O=0;O<v.length&&(w=v[O],b=n[w]||{},E=b[c],!gn(E));O++)cO(t,c,w,p,T);if(!gn(E)||!Je(w))return r?sI:c;let R=`${w}__${c}`;XE(h)||(R=`${R}__${JSON.stringify(h)}`);let N=a.get(R);return N||(N=new Intl.NumberFormat(w,wr({},E,h)),a.set(R,N)),g?N.formatToParts(l):N.format(l)}const bK=["localeMatcher","style","currency","currencyDisplay","currencySign","useGrouping","minimumIntegerDigits","minimumFractionDigits","maximumFractionDigits","minimumSignificantDigits","maximumSignificantDigits","compactDisplay","notation","signDisplay","unit","unitDisplay","roundingMode","roundingPriority","roundingIncrement","trailingZeroDisplay"];function sP(...t){const[e,n,r,s]=t,i=An();let o=An();if(!Wr(e))throw Cc(Ic.INVALID_ARGUMENT);const a=e;return Je(n)?i.key=n:gn(n)&&Object.keys(n).forEach(c=>{bK.includes(c)?o[c]=n[c]:i[c]=n[c]}),Je(r)?i.locale=r:gn(r)&&(o=r),gn(s)&&(o=s),[i.key||"",a,i,o]}function xB(t,e,n){const r=t;for(const s in n){const i=`${e}__${s}`;r.__numberFormatters.has(i)&&r.__numberFormatters.delete(i)}}const mOe=t=>t,gOe=t=>"",_Oe="text",yOe=t=>t.length===0?"":tO(t),vOe=mNe;function $C(t,e){return t=Math.abs(t),e===2?t===1?0:1:Math.min(t,2)}function bOe(t){const e=Wr(t.pluralIndex)?t.pluralIndex:-1;return Wr(t.named?.count)?t.named.count:Wr(t.named?.n)?t.named.n:e}function wOe(t={}){const e=t.locale,n=bOe(t),r=Je(e)&&Jn(t.pluralRules?.[e])?t.pluralRules[e]:$C,s=r===$C?void 0:$C,i=w=>w[r(n,w.length,s)],o=t.list||[],a=w=>o[w],c=t.named||An();Wr(t.pluralIndex)&&(c.count||=t.pluralIndex,c.n||=t.pluralIndex);const l=w=>c[w];function d(w,E){const T=Jn(t.messages)?t.messages(w,!!E):dn(t.messages)?t.messages[w]:!1;return T||(t.parent?t.parent.message(w):gOe)}const h=w=>t.modifiers?t.modifiers[w]:mOe,p=Jn(t.processor?.normalize)?t.processor.normalize:yOe,g=Jn(t.processor?.interpolate)?t.processor.interpolate:vOe,_=Je(t.processor?.type)?t.processor.type:_Oe,b={list:a,named:l,plural:i,linked:(w,...E)=>{const[T,R]=E;let N="text",O="";E.length===1?dn(T)?(O=T.modifier||O,N=T.type||N):Je(T)&&(O=T||O):E.length===2&&(Je(T)&&(O=T||O),Je(R)&&(N=R||N));const S=d(w,!0)(b),I=S===""||S===void 0?w:S,P=N==="vnode"&&yr(I)&&O?I[0]:I;return O?h(O)(P,N):P},message:d,type:_,interpolate:g,normalize:p,values:wr(An(),o,c)};return b}const LB=()=>"",Bc=t=>Jn(t);function MB(t,...e){const{fallbackFormat:n,postTranslation:r,unresolving:s,messageCompiler:i,fallbackLocale:o,messages:a}=t,[c,l]=iP(...e),d=ar(l.missingWarn)?l.missingWarn:t.missingWarn,h=ar(l.fallbackWarn)?l.fallbackWarn:t.fallbackWarn,p=ar(l.escapeParameter)?l.escapeParameter:t.escapeParameter,g=!!l.resolvedMessage,_=Je(l.default)||ar(l.default)?ar(l.default)?i?c:()=>c:l.default:n?i?c:()=>c:null,v=n||_!=null&&(Je(_)||Jn(_)),b=aO(t,l);p&&SOe(l);let[w,E,T]=g?[c,b,a[b]||An()]:wK(t,c,b,o,h,d),R=w,N=c;if(!g&&!(Je(R)||Ra(R)||Bc(R))&&v&&(R=_,N=R),!g&&(!(Je(R)||Ra(R)||Bc(R))||!Je(E)))return s?sI:c;let O=!1;const S=()=>{O=!0},I=Bc(R)?R:SK(t,c,E,R,N,S);if(O)return R;const P=IOe(t,E,T,l),k=wOe(P),L=TOe(t,I,k);let M=r?r(L,c):L;return p&&Je(M)&&(M=hNe(M)),M}function SOe(t){yr(t.list)?t.list=t.list.map(e=>Je(e)?_B(e):e):dn(t.named)&&Object.keys(t.named).forEach(e=>{Je(t.named[e])&&(t.named[e]=_B(t.named[e]))})}function wK(t,e,n,r,s,i){const{messages:o,onWarn:a,messageResolver:c,localeFallbacker:l}=t,d=l(t,r,n);let h=An(),p,g=null;const _="translate";for(let v=0;v<d.length&&(p=d[v],h=o[p]||An(),(g=c(h,e))===null&&(g=h[e]),!(Je(g)||Ra(g)||Bc(g)));v++)if(!pOe(p,d)){const b=cO(t,e,p,i,_);b!==e&&(g=b)}return[g,p,h]}function SK(t,e,n,r,s,i){const{messageCompiler:o,warnHtmlMessage:a}=t;if(Bc(r)){const l=r;return l.locale=l.locale||n,l.key=l.key||e,l}if(o==null){const l=(()=>r);return l.locale=n,l.key=e,l}const c=o(r,EOe(t,n,s,r,a,i));return c.locale=n,c.key=e,c.source=r,c}function TOe(t,e,n){return e(n)}function iP(...t){const[e,n,r]=t,s=An();if(!Je(e)&&!Wr(e)&&!Bc(e)&&!Ra(e))throw Cc(Ic.INVALID_ARGUMENT);const i=Wr(e)?String(e):(Bc(e),e);return Wr(n)?s.plural=n:Je(n)?s.default=n:gn(n)&&!XE(n)?s.named=n:yr(n)&&(s.list=n),Wr(r)?s.plural=r:Je(r)?s.default=r:gn(r)&&wr(s,r),[i,s]}function EOe(t,e,n,r,s,i){return{locale:e,key:n,warnHtmlMessage:s,onError:o=>{throw i&&i(o),o},onCacheKey:o=>iNe(e,n,o)}}function IOe(t,e,n,r){const{modifiers:s,pluralRules:i,messageResolver:o,fallbackLocale:a,fallbackWarn:c,missingWarn:l,fallbackContext:d}=t,p={locale:e,modifiers:s,pluralRules:i,messages:(g,_)=>{let v=o(n,g);
159if(v==null&&(d||_)){const[b,,w]=wK(d||t,g,e,a,c,l);v=b??o(w,g)}if(Je(v)||Ra(v)){let b=!1;const E=SK(t,g,e,v,g,()=>{b=!0});return b?LB:E}else return Bc(v)?v:LB}};return t.processor&&(p.processor=t.processor),r.list&&(p.list=r.list),r.named&&(p.named=r.named),Wr(r.plural)&&(p.pluralIndex=r.plural),p}const COe="11.4.4",Bi={UNEXPECTED_RETURN_TYPE:zDe,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function _o(t,...e){return rI(t,null,void 0)}const oP=Nu("__translateVNode"),aP=Nu("__datetimeParts"),cP=Nu("__numberParts"),AOe=Nu("__setPluralRules"),ROe=Nu("__injectWithOption"),pf=Nu("__dispose");function $_(t){if(!dn(t)||Ra(t))return t;for(const e in t)if(uo(t,e))if(!e.includes("."))dn(t[e])&&$_(t[e]);else{const n=e.split("."),r=n.length-1;let s=t,i=!1;for(let o=0;o<r;o++){if(n[o]==="__proto__")throw new Error(`unsafe key: ${n[o]}`);if(n[o]in s||(s[n[o]]=An()),!dn(s[n[o]])){i=!0;break}s=s[n[o]]}if(i||(Ra(s)?pK.includes(n[r])||delete t[e]:(s[n[r]]=t[e],delete t[e])),!Ra(s)){const o=s[n[r]];dn(o)&&$_(o)}}return t}function TK(t,e){const{messages:n,__i18n:r,messageResolver:s,flatJson:i}=e,o=gn(n)?n:yr(r)?An():{[t]:An()};if(yr(r)&&r.forEach(a=>{if("locale"in a&&"resource"in a){const{locale:c,resource:l}=a;c?(o[c]=o[c]||An(),Pf(l,o[c])):Pf(l,o)}else Je(a)&&Pf(JSON.parse(a),o)}),s==null&&i)for(const a in o)uo(o,a)&&$_(o[a]);return o}function POe(t){return t.type}function kOe(t,e,n){let r=dn(e.messages)?e.messages:An();"__i18nGlobal"in n&&(r=TK(t.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const s=Object.keys(r);s.length&&s.forEach(i=>{t.mergeLocaleMessage(i,r[i])});{if(dn(e.datetimeFormats)){const i=Object.keys(e.datetimeFormats);i.length&&i.forEach(o=>{t.mergeDateTimeFormat(o,e.datetimeFormats[o])})}if(dn(e.numberFormats)){const i=Object.keys(e.numberFormats);i.length&&i.forEach(o=>{t.mergeNumberFormat(o,e.numberFormats[o])})}}}function VB(t){return Un(Pc,null,t,0)}function EK(){return Sr()}const FB=()=>[],NOe=()=>!1;let BB=0;function $B(t){return((e,n,r,s)=>t(n,r,EK()||void 0,s))}function lP(t={}){const{__root:e,__injectWithOption:n}=t,r=e===void 0,s=t.flatJson,i=sT?Ae:ht;let o=ar(t.inheritLocale)?t.inheritLocale:!0;const a=i(e&&o?e.locale.value:Je(t.locale)?t.locale:aT),c=i(e&&o?e.fallbackLocale.value:Je(t.fallbackLocale)||yr(t.fallbackLocale)||gn(t.fallbackLocale)||t.fallbackLocale===!1?t.fallbackLocale:a.value),l=i(TK(a.value,t)),d=i(gn(t.datetimeFormats)?t.datetimeFormats:{[a.value]:{}}),h=i(gn(t.numberFormats)?t.numberFormats:{[a.value]:{}});let p=e?e.missingWarn:ar(t.missingWarn)||iT(t.missingWarn)?t.missingWarn:!0,g=e?e.fallbackWarn:ar(t.fallbackWarn)||iT(t.fallbackWarn)?t.fallbackWarn:!0,_=e?e.fallbackRoot:ar(t.fallbackRoot)?t.fallbackRoot:!0,v=!!t.fallbackFormat,b=Jn(t.missing)?t.missing:null,w=Jn(t.missing)?$B(t.missing):null,E=Jn(t.postTranslation)?t.postTranslation:null,T=e?e.warnHtmlMessage:ar(t.warnHtmlMessage)?t.warnHtmlMessage:!0,R=!!t.escapeParameter;const N=e?e.modifiers:gn(t.modifiers)?t.modifiers:{};let O=t.pluralRules||e&&e.pluralRules,S;S=(()=>{r&&PB(null);const X={version:COe,locale:a.value,fallbackLocale:c.value,messages:l.value,modifiers:N,pluralRules:O,missing:w===null?void 0:w,missingWarn:p,fallbackWarn:g,fallbackFormat:v,unresolving:!0,postTranslation:E===null?void 0:E,warnHtmlMessage:T,escapeParameter:R,messageResolver:t.messageResolver,messageCompiler:t.messageCompiler,__meta:{framework:"vue"}};X.datetimeFormats=d.value,X.numberFormats=h.value,X.__datetimeFormatters=gn(S)?S.__datetimeFormatters:void 0,X.__numberFormatters=gn(S)?S.__numberFormatters:void 0;const le=hOe(X);return r&&PB(le),le})(),rg(S,a.value,c.value);function P(){return[a.value,c.value,l.value,d.value,h.value]}const k=$e({get:()=>a.value,set:X=>{S.locale=X,a.value=X}}),L=$e({get:()=>c.value,set:X=>{S.fallbackLocale=X,c.value=X,rg(S,a.value,X)}}),M=$e(()=>l.value),V=$e(()=>d.value),z=$e(()=>h.value);function ie(){return Jn(E)?E:null}function K(X){E=X,S.postTranslation=X}function ce(){return b}function G(X){X!==null&&(w=$B(X)),b=X,S.missing=w}const Z=(X,le,je,Ye,vt,oe)=>{P();let ye;try{r||(S.fallbackContext=e?dOe():void 0),ye=X(S)}finally{r||(S.fallbackContext=void 0)}if(je!=="translate exists"&&Wr(ye)&&ye===sI||je==="translate exists"&&!ye){const[Fe,ot]=le();return e&&_?Ye(e):vt(Fe)}else{if(oe(ye))return ye;throw _o(Bi.UNEXPECTED_RETURN_TYPE)}};function de(...X){return Z(le=>Reflect.apply(MB,null,[le,...X]),()=>iP(...X),"translate",le=>Reflect.apply(le.t,le,[...X]),le=>le,le=>Je(le))}function fe(...X){const[le,je,Ye]=X;if(Ye&&!dn(Ye))throw _o(Bi.INVALID_ARGUMENT);return de(le,je,wr({resolvedMessage:!0},Ye||{}))}function ee(...X){return Z(le=>Reflect.apply(NB,null,[le,...X]),()=>rP(...X),"datetime format",le=>Reflect.apply(le.d,le,[...X]),()=>cT,le=>Je(le)||yr(le))}function Te(...X){return Z(le=>Reflect.apply(OB,null,[le,...X]),()=>sP(...X),"number format",le=>Reflect.apply(le.n,le,[...X]),()=>cT,le=>Je(le)||yr(le))}function pe(X){return X.map(le=>Je(le)||Wr(le)||ar(le)?VB(String(le)):le)}const Ve={normalize:pe,interpolate:X=>X,type:"vnode"};function Y(...X){return Z(le=>{let je;const Ye=le;try{Ye.processor=Ve,je=Reflect.apply(MB,null,[Ye,...X])}finally{Ye.processor=null}return je},()=>iP(...X),"translate",le=>le[oP](...X),le=>[VB(le)],le=>yr(le))}function ve(...X){return Z(le=>Reflect.apply(OB,null,[le,...X]),()=>sP(...X),"number format",le=>le[cP](...X),FB,le=>Je(le)||yr(le))}function Ee(...X){return Z(le=>Reflect.apply(NB,null,[le,...X]),()=>rP(...X),"datetime format",le=>le[aP](...X),FB,le=>Je(le)||yr(le))}function Me(X){O=X,S.pluralRules=O}function Ke(X,le){return Z(()=>
159{if(!X)return!1;const je=Je(le)?le:a.value,Ye=Je(le)?[je]:nP(S,c.value,je);for(let vt=0;vt<Ye.length;vt++){const oe=j(Ye[vt]);let ye=S.messageResolver(oe,X);if(ye===null&&(ye=oe[X]),Ra(ye)||Bc(ye)||Je(ye))return!0}return!1},()=>[X],"translate exists",je=>Reflect.apply(je.te,je,[X,le]),NOe,je=>ar(je))}function ut(X){let le=null;const je=nP(S,c.value,a.value);for(let Ye=0;Ye<je.length;Ye++){const vt=l.value[je[Ye]]||{},oe=S.messageResolver(vt,X);if(oe!=null){le=oe;break}}return le}function H(X){const le=ut(X);return le??(e?e.tm(X)||{}:{})}function j(X){return l.value[X]||{}}function re(X,le){if(s){const je={[X]:le};for(const Ye in je)uo(je,Ye)&&$_(je[Ye]);le=je[X]}l.value[X]=le,S.messages=l.value}function Re(X,le){l.value[X]=l.value[X]||{};const je={[X]:le};if(s)for(const Ye in je)uo(je,Ye)&&$_(je[Ye]);le=je[X],Pf(le,l.value[X]),S.messages=l.value}function ge(X){return d.value[X]||{}}function B(X,le){d.value[X]=le,S.datetimeFormats=d.value,DB(S,X,le)}function q(X,le){d.value[X]=wr(d.value[X]||{},le),S.datetimeFormats=d.value,DB(S,X,le)}function J(X){return h.value[X]||{}}function se(X,le){h.value[X]=le,S.numberFormats=h.value,xB(S,X,le)}function be(X,le){h.value[X]=wr(h.value[X]||{},le),S.numberFormats=h.value,xB(S,X,le)}BB++,e&&sT&&(ft(e.locale,X=>{o&&(a.value=X,S.locale=X,rg(S,a.value,c.value))}),ft(e.fallbackLocale,X=>{o&&(c.value=X,S.fallbackLocale=X,rg(S,a.value,c.value))}));const xe={id:BB,locale:k,fallbackLocale:L,get inheritLocale(){return o},set inheritLocale(X){o=X,X&&e&&(a.value=e.locale.value,c.value=e.fallbackLocale.value,rg(S,a.value,c.value))},get availableLocales(){return Object.keys(l.value).sort()},messages:M,get modifiers(){return N},get pluralRules(){return O||{}},get isGlobal(){return r},get missingWarn(){return p},set missingWarn(X){p=X,S.missingWarn=p},get fallbackWarn(){return g},set fallbackWarn(X){g=X,S.fallbackWarn=g},get fallbackRoot(){return _},set fallbackRoot(X){_=X},get fallbackFormat(){return v},set fallbackFormat(X){v=X,S.fallbackFormat=v},get warnHtmlMessage(){return T},set warnHtmlMessage(X){T=X,S.warnHtmlMessage=X},get escapeParameter(){return R},set escapeParameter(X){R=X,S.escapeParameter=X},t:de,getLocaleMessage:j,setLocaleMessage:re,mergeLocaleMessage:Re,getPostTranslationHandler:ie,setPostTranslationHandler:K,getMissingHandler:ce,setMissingHandler:G,[AOe]:Me};return xe.datetimeFormats=V,xe.numberFormats=z,xe.rt=fe,xe.te=Ke,xe.tm=H,xe.d=ee,xe.n=Te,xe.getDateTimeFormat=ge,xe.setDateTimeFormat=B,xe.mergeDateTimeFormat=q,xe.getNumberFormat=J,xe.setNumberFormat=se,xe.mergeNumberFormat=be,xe[ROe]=n,xe[oP]=Y,xe[aP]=Ee,xe[cP]=ve,xe}const lO={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:t=>t==="parent"||t==="global",default:"parent"},i18n:{type:Object}};function DOe({slots:t},e){return e.length===1&&e[0]==="default"?(t.default?t.default():[]).reduce((r,s)=>[...r,...s.type===kr?s.children:[s]],[]):e.reduce((n,r)=>{const s=t[r];return s&&(n[r]=s()),n},An())}function IK(){return kr}const OOe=Ls({name:"i18n-t",props:wr({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:t=>Wr(t)||!isNaN(t)}},lO),setup(t,e){const{slots:n,attrs:r}=e,s=t.i18n||uO({useScope:t.scope,__useComponent:!0});return()=>{const i=()=>{const c=Object.keys(n).filter(h=>h[0]!=="_"),l=An();t.locale&&(l.locale=t.locale),t.plural!==void 0&&(l.plural=Je(t.plural)?+t.plural:t.plural);const d=DOe(e,c);return s[oP](t.keypath,d,l)},o=wr(An(),r),a=Je(t.tag)||dn(t.tag)?t.tag:IK();return dn(a)?On(a,o,{default:i}):On(a,o,i())}}}),UB=OOe;function xOe(t){return yr(t)&&!Je(t[0])}function CK(t,e,n,r){const{slots:s,attrs:i}=e;return()=>{const o=()=>{const l={part:!0};let d=An();t.locale&&(l.locale=t.locale),Je(t.format)?l.key=t.format:dn(t.format)&&(Je(t.format.key)&&(l.key=t.format.key),d=Object.keys(t.format).reduce((g,_)=>n.includes(_)?wr(An(),g,{[_]:t.format[_]}):g,An()));const h=r(t.value,l,d);let p=[l.key];return yr(h)?p=h.map((g,_)=>{const v=s[g.type],b=v?v({[g.type]:g.value,index:_,parts:h}):[g.value];return xOe(b)&&(b[0].key=`${g.type}-${_}`),b}):Je(h)&&(p=[h]),p},a=wr(An(),i),c=Je(t.tag)||dn(t.tag)?t.tag:IK();return dn(c)?On(c,a,{default:o}):On(c,a,o())}}const LOe=Ls({name:"i18n-n",props:wr({value:{type:Number,required:!0},format:{type:[String,Object]}},lO),setup(t,e){const n=t.i18n||uO({useScope:t.scope,__useComponent:!0});return CK(t,e,bK,(...r)=>n[cP](...r))}}),HB=LOe;function MOe(t,e){const n=t;if(t.mode==="composition")return n.__getInstance(e)||t.global;{const r=n.__getInstance(e);return r!=null?r.__composer:t.global.__composer}}function VOe(t){const e=o=>{const{instance:a,value:c}=o;if(!a||!a.$)throw _o(Bi.UNEXPECTED_ERROR);const l=MOe(t,a.$),d=qB(c);return[Reflect.apply(l.t,l,[...jB(d)]),l]};return{created:(o,a)=>{const[c,l]=e(a);sT&&(o.__i18nWatcher=ft(l.locale,()=>{a.instance&&a.instance.$forceUpdate()})),o.__composer=l,o.textContent=c},unmounted:o=>{sT&&o.__i18nWatcher&&(o.__i18nWatcher(),o.__i18nWatcher=void 0,delete o.__i18nWatcher),o.__composer&&(o.__composer=void 0,delete o.__composer)},beforeUpdate:(o,{value:a})=>{if(o.__composer){const c=o.__composer,l=qB(a);o.textContent=Reflect.apply(c.t,c,[...jB(l)])}},getSSRProps:o=>{const[a]=e(o);return{textContent:a}}}}function qB(t){if(Je(t))return{path:t};if(gn(t)){if(!("path"in t))throw _o(Bi.REQUIRED_VALUE,"path");return t}else throw _o(Bi.INVALID_VALUE)}function jB(t){const{path:e,locale:n,args:r,choice:s,plural:i}=t,o={},a=r||{};return Je(n)&&(o.locale=n),Wr(s)&&(o.plural=s),Wr(i)&&(o.plural=i),[e,a,o]}function FOe(t,e,...n){const r=gn(n[0])?n[0]:{};(!ar(r.globalInstall)||r.globalInstall)&&([UB.name,"I18nT"].forEach(i=>
159t.component(i,UB)),[HB.name,"I18nN"].forEach(i=>t.component(i,HB)),[KB.name,"I18nD"].forEach(i=>t.component(i,KB))),t.directive("t",VOe(e))}const BOe=Nu("global-vue-i18n");function $Oe(t={}){const e=ar(t.globalInjection)?t.globalInjection:!0,n=new Map,[r,s]=UOe(t),i=Nu("");function o(d){return n.get(d)||null}function a(d,h){n.set(d,h)}function c(d){n.delete(d)}const l={get mode(){return"composition"},async install(d,...h){if(d.__VUE_I18N_SYMBOL__=i,d.provide(d.__VUE_I18N_SYMBOL__,l),gn(h[0])){const _=h[0];l.__composerExtend=_.__composerExtend,l.__vueI18nExtend=_.__vueI18nExtend}let p=null;e&&(p=zOe(d,l.global)),FOe(d,l,...h);const g=d.unmount;d.unmount=()=>{p&&p(),l.dispose(),g()}},get global(){return s},dispose(){r.stop()},__instances:n,__getInstance:o,__setInstance:a,__deleteInstance:c};return l}function uO(t={}){const e=EK();if(e==null)throw _o(Bi.MUST_BE_CALL_SETUP_TOP);if(!e.isCE&&e.appContext.app!=null&&!e.appContext.app.__VUE_I18N_SYMBOL__)throw _o(Bi.NOT_INSTALLED);const n=HOe(e),r=jOe(n),s=POe(e),i=qOe(t,s);if(i==="global")return kOe(r,t,s),r;if(i==="parent"){let c=WB(n,e,t.__useComponent);return c==null&&(c=r),c}if(i==="isolated"){if(n.mode!=="composition")throw _o(Bi.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const c=n,l=wr({},t),d=WB(n,e);l.__root=d||r;const h=lP(l);return c.__composerExtend&&(h[pf]=c.__composerExtend(h)),Ba()&&$c(()=>{const g=h[pf];g&&(g(),delete h[pf])}),h}const o=n;let a=o.__getInstance(e);if(a==null){const c=wr({},t);"__i18n"in s&&(c.__i18n=s.__i18n),r&&(c.__root=r),a=lP(c),o.__composerExtend&&(a[pf]=o.__composerExtend(a)),GOe(o,e,a),o.__setInstance(e,a)}return a}function UOe(t,e){const n=oh(),r=n.run(()=>lP(t));if(r==null)throw _o(Bi.UNEXPECTED_ERROR);return[n,r]}function HOe(t){const e=vr(t.isCE?BOe:t.appContext.app.__VUE_I18N_SYMBOL__);if(!e)throw _o(t.isCE?Bi.NOT_INSTALLED_WITH_PROVIDE:Bi.UNEXPECTED_ERROR);return e}function qOe(t,e){return XE(t)?"__i18n"in e?"local":"global":t.useScope?t.useScope:"local"}function jOe(t){return t.mode==="composition"?t.global:t.global.__composer}function WB(t,e,n=!1){let r=null;const s=e.root;let i=WOe(e,n);for(;i!=null;){const o=t;if(t.mode==="composition"&&(r=o.__getInstance(i)),r!=null||s===i)break;i=i.parent}return r}function WOe(t,e=!1){return t==null?null:e&&t.vnode.ctx||t.parent}function GOe(t,e,n){ka(()=>{},e),Tp(()=>{const r=n;t.__deleteInstance(e);const s=r[pf];s&&(s(),delete r[pf])},e)}const KOe=["locale","fallbackLocale","availableLocales"],GB=["t","rt","d","n","tm","te"];function zOe(t,e){const n=Object.create(null);return KOe.forEach(s=>{const i=Object.getOwnPropertyDescriptor(e,s);if(!i)throw _o(Bi.UNEXPECTED_ERROR);const o=Pn(i.value)?{get(){return i.value.value},set(a){i.value.value=a}}:{get(){return i.get&&i.get()}};Object.defineProperty(n,s,o)}),t.config.globalProperties.$i18n=n,GB.forEach(s=>{const i=Object.getOwnPropertyDescriptor(e,s);if(!i||!i.value)throw _o(Bi.UNEXPECTED_ERROR);Object.defineProperty(t.config.globalProperties,`$${s}`,i)}),()=>{delete t.config.globalProperties.$i18n,GB.forEach(s=>{delete t.config.globalProperties[`$${s}`]})}}const YOe=Ls({name:"i18n-d",props:wr({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},lO),setup(t,e){const n=t.i18n||uO({useScope:t.scope,__useComponent:!0});return CK(t,e,vK,(...r)=>n[aP](...r))}}),KB=YOe;cOe(KDe);lOe(iOe);uOe(nP);function zB(t=xt()){const e=nI(t);return n=>{if(n!=null)return e.getRouteBaseName(n)||void 0}}function JOe(t=xt()){const e=nI(t);return(n,r)=>Y9(e,n,r)}function QOe(t=xt()){const e=nI(t);return(n,r)=>J9(e,n,r)}function AK(t=xt()){const e=nI(t);return n=>X9(e,n)}const YB="nuxt-i18n-slp",XOe=new RegExp([`<!--${YB}-\\[(\\w+)\\]-->`,".+?",`<!--/${YB}-->`].join(""),"g"),ZOe=At({name:"i18n:plugin:switch-locale-path-ssr",dependsOn:["i18n:plugin"],setup(t){const e=xt(t._id),n=AK(e);e.hook("app:rendered",r=>{r.renderResult?.html!=null&&(r.renderResult.html=r.renderResult.html.replaceAll(XOe,(s,i)=>{const o=encodeURI(n(i??""));return s.replace(/href="([^"]+)"/,`href="${o||"#"}" `)}))})}}),e1e=At({name:"i18n:plugin:route-locale-detect",dependsOn:["i18n:plugin"],async setup(t){let e,n;const r=xt(t._id),s=rO(r),i=sK();[e,n]=Wl(()=>r.runWithContext(()=>iK(r,s.initial&&i.value||uDe(r,r.$router.currentRoute.value)))),await e,n()}}),t1e=At({name:"i18n:plugin:preload",dependsOn:["i18n:plugin"],async setup(t){}});function n1e(t,{extendComposer:e,extendComposerInstance:n}){const r=oh(),s=t.install.bind(t);t.install=(i,...o)=>{const a=wr({},o[0]);a.__composerExtend=l=>(n(l,$b(t)),()=>{}),t.mode==="legacy"&&(a.__vueI18nExtend=l=>(n(l,$b(l)),()=>{})),Reflect.apply(s,t,[i,a]);const c=$b(t);if(r.run(()=>{e(c),t.mode==="legacy"&&"__composer"in t.global&&n(t.global,$b(t.global))}),t.mode==="composition"&&i.config.globalProperties.$i18n!=null&&n(i.config.globalProperties.$i18n,c),i.unmount){const l=i.unmount.bind(i);i.unmount=()=>{r.stop(),l()}}}}const r1e=async t=>{const e=await VNe(LNe);e.locale=t||e.locale||"en-US",e.defaultLocale=t,e.fallbackLocale??=!1,e.messages??={};for(const n of F_)e.messages[n]??={};return e};var s1e={th:"e3b0c442",en:"e3b0c442"};const i1e=At({name:"i18n:plugin",parallel:!1,async setup(t){let e,n;Object.defineProperty(t.versions,"nuxtI18n",{get:()=>"10.4.0"});const r=xt(t._id),s=eI(r),i=r.ssrContext?.event?.context?.nuxtI18n?.vueI18nOptions,o=zNe(p9().host)||s.defaultLocale||"",a=i||([e,n]=Wl(()=>r1e(o)),e=await e,n(),e),c=rK();c.value??=WNe(a.fallbackLocale),F_.map(p=>`/_i18n/${s1e[p]}/${p}/messages.json`);const l=$Oe(a),d=sO(void 0,tI(r),r),h=QNe(r,l,a.defaultLocale);r._nuxtI18n=h,n1e(l,{extendComposer(p){p.locales=$e(()=>s.locales),p.localeCodes=$e(()=>F_);const g=Ae(h.getBaseUrl());p.baseUrl=$e(()=>g.value),ft(p.locale,()=>g.value=h.getBaseUrl()),p.strategy="no_prefix",p.localeProperties=$e(()=>Xy.find(_=>_.code===p.locale.value)||{code:p.locale.value}),p.setLocale=async _=>{await iK(r,_),await r.runWithContext(()=>(r.$router.currentRoute.value,void 0))},p.loadLocaleMessages=h.loadMessages,p.differentDomains=!1,p.defaultLocale=a.defaultLocale,p.getBrowserLocale=()=>bB(d.navigator()),p.getLocaleCookie=()=>bB(d.cookie()),p.setLocaleCookie=h.setCookieLocale,p.finalizePendingLocaleChange=async()=>{l.__pendingLocale&&await l.__resolvePendingLocalePromise?.()},p.waitForPendingLocaleChange=async()=>{await l?.__pendingLocalePromise}},extendComposerInstance(p,g){const _=[["locales",()=>g.locales],["localeCodes",()=>g.localeCodes],["baseUrl",()=>g.baseUrl],["strategy",()=>"no_prefix"],["localeProperties",()=>g.localeProperties],["setLocale",()=>v=>Reflect.apply(g.setLocale,g,[v])],["loadLocaleMessages",()=>v=>Reflect.apply(g.loadLocaleMessages,g,[v])],["differentDomains",()=>!1],["defaultLocale",()=>g.defaultLocale],["getBrowserLocale",()=>()=>Reflect.apply(g.getBrowserLocale,g,[])],["getLocaleCookie",()=>()=>Reflect.apply(g.getLocaleCookie,g,[])],["setLocaleCookie",()=>v=>Reflect.apply(g.setLocaleCookie,g,[v])],["finalizePendingLocaleChange",()=>()=>Reflect.apply(g.finalizePendingLocaleChange,g,[])],["waitForPendingLocaleChange",()=>()=>Reflect.apply(g.waitForPendingLocaleChange,g,[])]];for(const[v,b]of _)Object.defineProperty(p,v,{get:b})}}),r.vueApp.use(l),Object.defineProperty(r,"$i18n",{get:()=>nO(l)}),r.provide("localeHead",p=>ANe(r._nuxtI18n.composableCtx,p)),r.provide("localePath",JOe(r)),r.provide("localeRoute",QOe(r)),r.provide("routeBaseName",zB(r)),r.provide("getRouteBaseName",zB(r)),r.provide("switchLocalePath",AK(r))}}),o1e=At({name:"sentry-client-config",async setup(){let t,e;[t,e]=Wl(()=>at(()=>import("./C6Y_q6yl.js"),[],import.meta.url)),await t,e()}}),a1e=10*6e4;function c1e(t){const e=Math.round(Math.abs(t)/6e4);if(e<60)return`${e} à¸à¸²à¸à¸µ / min`;const n=Math.floor(e/60),r=e%60;return r?`${n} à¸à¸¡. ${r} à¸à¸²à¸à¸µ / ${n}h ${r}m`:`${n} à¸à¸¡. / ${n}h`}const l1e=At(()=>{const t=wi();let e=!1;const n=r=>{if(e||r==null||Math.abs(r)<=a1e)return;e=!0;const s=r<0?"à¹à¸£à¹à¸§à¸à¸§à¹à¸² / ahead of":"à¸à¹à¸²à¸à¸§à¹à¸² / behind";Or.fire({icon:"error",title:"à¹à¸§à¸¥à¸²à¸à¸à¸à¹à¸à¸£à¸·à¹à¸à¸à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸<br>Device clock is wrong",html:`à¸à¸²à¸¬à¸´à¸à¸²à¸à¸à¸à¸à¸¸à¸à¸à¸£à¸à¹à¸à¸µà¹à¸à¸¥à¸²à¸à¹à¸à¸¥à¸·à¹à¸à¸à¸à¸²à¸à¹à¸§à¸¥à¸²à¸à¸£à¸´à¸à¸à¸£à¸°à¸¡à¸²à¸ <b>${c1e(r)}</b> (${s}).<br><br>à¸à¸£à¸¸à¸à¸²à¹à¸à¹à¹à¸ <b>วัà¸à¸à¸µà¹à¹à¸¥à¸°à¹à¸§à¸¥à¸²</b> à¸à¸à¸à¸à¸¸à¸à¸à¸£à¸à¹à¹à¸«à¹à¸à¸¹à¸à¸à¹à¸à¸ (ระวัภAM / PM â 11 à¹à¸¡à¸à¹à¸à¹à¸² à¹à¸¡à¹à¹à¸à¹ 5 à¸à¸¸à¹à¸¡) à¹à¸¥à¹à¸§à¸à¸à¹à¸«à¸¥à¸à¹à¸«à¸¡à¹<br><br><span style="opacity:.7">Please fix this device's date & time (watch AM vs PM), then reload.</span>`,confirmButtonText:"à¹à¸«à¸¥à¸à¹à¸«à¸¡à¹ / Reload",allowOutsideClick:!1,allowEscapeKey:!1,allowEnterKey:!1}).then(()=>{window.location.reload()})};t.refresh().then(r=>{if(r!=null){n(r);return}const s=ft(t.offsetMs,i=>{i!=null&&(s(),n(i))})})}),u1e=(t,e,n,r)=>{try{if(typeof document>"u")return;const s=new Date(Date.now()+n*24*60*60*1e3).toUTCString(),i=[`${t}=${encodeURIComponent(e)}`,`expires=${s}`,"path=/"];r&&i.push(`domain=${r}`),document.cookie=i.join("; ")}catch{}},UC="app2b.niceloop.com",d1e=".niceloop.com",h1e="/v2-owner-report-mobile",f1e=At({name:"beta-redirect",setup(){const{hostname:t,pathname:e}=window.location;if(t===UC||e.startsWith(h1e))return;const n=Xn();let r=!1,s=null;s=ft(()=>n.storeId,async i=>{if(!(!i||r)){r=!0,s?.();try{if(!(await mu(rr().getBetaWhiteListRef(String(i)))).exists())return;if(t==="localhost"){console.log("[beta-redirect] whitelisted, would redirect to",UC,{storeId:i});return}u1e("niceloop",JSON.stringify({isBeta:!0,storeId:i}),30,d1e),window.location.href=`https://${UC}`}catch(o){console.warn("[beta-redirect] whitelist lookup failed",o)}}},{immediate:!0}),r&&s()}});function RK(t){const e=t.json2||{};return(Array.isArray(t.__items)?t.__items:[]).map(r=>{const s=Math.abs(Number(e[r.uuid]||0))||Number(r.quantity)||0;return{uniqueid:String(r.uuid||""),name:r.name||"",quantity:s,subitemid:Number(r.subItemId||r.subitemid)||0,price:Number(r.price)||0,comments:r.comments||"",toppings:r.toppings||[]}})}function PK(t){let e={};
159try{e=typeof t.json=="string"?JSON.parse(t.json):t.json||{}}catch{e={}}return(Array.isArray(e.orderitems)?e.orderitems:[]).map(r=>({uniqueid:String(r.uniqueid||r.uuid||""),name:r.name||"",quantity:Number(r.quantity)||0,subitemid:Number(r.subitemid||r.subItemId)||0,price:Number(r.price)||0,comments:r.comments||"",toppings:r.toppings||[]}))}class p1e{fromJobToHistory(e){const n={tableNumber:null,record:null};if(!e)return n;const r=e.type===pt.VOID,s=e.type===pt.ADD;if(s&&e.source==="m"||!r&&!s)return n;const i=Wo().convertTableToUuid(e.alias);if(!i)return n;const o=r?this.buildVoidItems(e):this.buildAddItems(e);if(o.length===0)return n;const a=e.employee?.name||"cashier",c=Ne(e.timestamp).format("YYYY-MM-DD[T]HH:mm:ss.SSSZZ"),l={uniqueid:String(e.jobId||crypto.randomUUID()),username:a,employeeName:a,employeeId:e.employee?.employeeId||0,table:i,uuid:i,alias:e.alias||"",jobId:0,customercount:Number(e.guests)||0,datetime:c,orderitems:o,comments:e.note||e.__reason||"",read:2,isVoid:r,handshake:!0};return{tableNumber:i,record:l}}buildVoidItems(e){return RK(e)}buildAddItems(e){return PK(e)}}const m1e=/[.#$\[\]\/]/g;function g1e(t){return String(t??"").replace(m1e,"_")}class _1e{fromJobToHistory(e){const n={alias:null,key:null,record:null};if(!e)return n;const r=e.type===pt.VOID,s=e.type===pt.ADD;if(!r&&!s)return n;const i=JG(e.alias,e);if(!i)return n;const o=g1e(e.jobId);if(!o)return n;const a=Wo().convertTableToUuid(i);if(!a)return n;const c=r?RK(e):PK(e);if(c.length===0)return n;const l=e.employee?.name||"cashier",d=Ne(e.pcTimestamp||e.timestamp),h=d.isValid()?d.valueOf():Date.now(),p=Ne(h).format("YYYY-MM-DD[T]HH:mm:ss.SSSZZ"),g={uniqueid:String(e.jobId),username:l,employeeName:l,employeeId:e.employee?.employeeId||0,table:a,uuid:a,alias:i,jobId:0,customercount:Number(e.guests)||0,datetime:p,ts:h,orderitems:c,comments:e.note||e.__reason||"",read:2,isVoid:r,handshake:!0};return{alias:i,key:o,record:g}}}const y1e=At(()=>{const t=Wa(),e=bn(),n=tt(),r=Ze(),s=()=>t.loaded&&(e.runMode==="cashier"||e.runMode==="2nd_cashier");let i=new Set;n.$onAction(({name:l,args:d,after:h})=>{if(l!=="add")return;const p=d[0];h(()=>{try{a(p)}catch(g){console.warn("[mobile-v2-history] write failed",g)}})}),ft(()=>n.tables,()=>{try{c()}catch(l){console.warn("[mobile-v2-history] reconcile failed",l)}});function o(){return!s()||!e.storeId||String(e.storeId)==="_"?null:r.mobileV2HistoryRef()}function a(l){const d=o();if(!d)return;const{alias:h,key:p,record:g}=new _1e().fromJobToHistory(l);!h||!p||!g||Ue(zt(zt(d,h),p),g)}function c(){const l=new Set(Object.keys(n.tables||{})),d=o();if(d)for(const h of i)l.has(h)||Ue(zt(d,h),null);i=l}}),v1e=At(()=>{const t=Wa(),e=bn(),n=ln(),r=tt(),s=_r();let i="",o="",a,c;const l=()=>t.loaded&&e.runMode==="cashier",d=()=>{const v=n.tables||[],b={};for(const E of v){if(!E||!E.name)continue;const T=Number(E.tableCount)||0;T>0&&(b[E.name]=T)}const w=n.getSystemEnvByName("TableArray")?.Value||"";return{name:n.getStoreName()||"",type:w?"zone":"number",zones:b}},h=async()=>{if(!l())return;const v=d();if(Object.keys(v.zones).length===0)return;const b=JSON.stringify(v);if(b!==i)try{await Ws(rr().getMobileLayoutRef(),v),i=b,console.log("[cloud.mobile-v2] layout published",v)}catch(w){console.warn("[cloud.mobile-v2] layout publish failed",w)}},p=()=>{const v={},b=r.tables||{};for(const E of Object.keys(b)){const T=b[E];if(!T||T.mode!==1)continue;const R=Array.isArray(T.items)?T.items.length:0;v[E]={guests:Number(T.guests)||0,isLock:s.isLockedWithTable(E)||!1,items:R}}const w=s.tablesState||{};for(const E of Object.keys(w))w[E]?.lock&&(v[E]||(v[E]={guests:0,isLock:!0,items:0}));return v},g=async()=>{if(!l())return;const v=p(),b=JSON.stringify(v);if(b!==o)try{await Ws(rr().getTablesSummaryRef(),v),o=b}catch(w){console.warn("[cloud.mobile-v2] tables_summary publish failed",w)}},_=$e(()=>l());ft(_,(v,b)=>{if(v!==b){if(v){a||(a=ft(()=>n.tables,()=>{h()},{deep:!0,immediate:!0})),c||(c=ft([()=>r.tables,()=>s.tablesState],()=>{g()},{deep:!0,immediate:!0}));return}a&&(a(),a=void 0),c&&(c(),c=void 0)}},{immediate:!0})}),b1e=At(t=>{const e=tt(),n=_r(),r=bn(),s=()=>r.runMode==="cashier"&&!!r.storeId&&String(r.storeId)!=="_",i=Ae({});let o=!0;function a(d){return d?JSON.stringify(d):""}ft([()=>e.tables,()=>n.tablesState],([d,h])=>{if(!s())return;const p={},g=d;for(const _ in g)p[_]=a(g[_]);if(o){o=!1,i.value={...p},l(d);return}for(const _ in p){const v=i.value[_],b=p[_];v!==b&&(console.log(`[cloud.tables-state] table "${_}" changed`),c(_,g[_]))}for(const _ in i.value)_ in p||(console.log(`[cloud.tables-state] table "${_}" removed`),c(_,null));i.value={...p}},{deep:!0});function c(d,h){const p=Ze().tablesV3Ref(),g=zt(p,d);Ue(g,h||null)}function l(d){if(!d)return;const h=Ze().tablesV3Ref();Ue(h,d)}}),w1e=At(t=>{Ne.extend(LAe)}),S1e={class:"dsp-pill-label"},T1e={key:1,class:"dsp-panel"},E1e={class:"dsp-head"},I1e={class:"dsp-meta"},C1e={key:0},A1e={class:"dsp-v dsp-v-muted"}
159,R1e=Ls({__name:"DevStorePanel",setup(t){const e=Ae(!1),n=Ae(""),r=Ae(Twe()),s=Ae(Ewe()??""),i=(()=>{try{const d=localStorage.getItem("authSnapshot");return d?String(JSON.parse(d)?.storeId??""):""}catch{return""}})(),o=$e(()=>r.value||i),a=$e(()=>!!r.value);function c(){n.value.trim()&&(s.value.trim(),location.reload())}function l(){location.reload()}return(d,h)=>(ls(),Ll("div",{class:cu(["dsp-root",{"dsp-on":a.value}])},[e.value?(ls(),Ll("div",T1e,[Br("div",E1e,[h[5]||(h[5]=Br("span",{class:"dsp-title"},"DEV · Store override",-1)),Br("button",{class:"dsp-x",onClick:h[1]||(h[1]=p=>e.value=!1)},"â")]),Br("div",I1e,[Br("div",null,[h[6]||(h[6]=Br("span",{class:"dsp-k"},"Viewing",-1)),Br("span",{class:cu(["dsp-v",{"dsp-v-on":a.value}])},md(o.value||"â"),3)]),a.value?(ls(),Ll("div",C1e,[h[7]||(h[7]=Br("span",{class:"dsp-k"},"Account",-1)),Br("span",A1e,md(Wt(i)||"â"),1)])):Nw("",!0)]),Br("form",{class:"dsp-form",onSubmit:tH(c,["prevent"])},[KC(Br("input",{"onUpdate:modelValue":h[2]||(h[2]=p=>n.value=p),class:"dsp-input",type:"text",inputmode:"numeric",placeholder:"Customer ID (e.g. 5422)",autofocus:""},null,512),[[xf,n.value]]),h[8]||(h[8]=Br("button",{class:"dsp-apply",type:"submit"},"Switch",-1))],32),KC(Br("input",{"onUpdate:modelValue":h[3]||(h[3]=p=>s.value=p),class:"dsp-input dsp-bypass",type:"text",placeholder:"bypass pair â key=value",spellcheck:"false",autocomplete:"off"},null,512),[[xf,s.value]]),h[9]||(h[9]=Br("p",{class:"dsp-hint"}," Stored on this machine only. Needed when the backend enforces scope. ",-1)),a.value?(ls(),Ll("button",{key:0,class:"dsp-reset",onClick:l}," â Back to my shop ("+md(Wt(i)||"real")+") ",1)):Nw("",!0),h[10]||(h[10]=Br("p",{class:"dsp-note"},"Reloads to apply · dev build only",-1))])):(ls(),Ll("button",{key:0,class:"dsp-pill",onClick:h[0]||(h[0]=p=>e.value=!0)},[h[4]||(h[4]=Br("span",{class:"dsp-dot"},null,-1)),Br("span",S1e,md(a.value?`shop ${o.value}`:"DEV store"),1)]))],2))}}),kK=(t,e)=>{const n=t.__vccOpts||t;for(const[r,s]of e)n[r]=s;return n};kK(R1e,[["__scopeId","data-v-fbe778f0"]]);const P1e=At(()=>{}),k1e=At(()=>{const t=GD(),e=kT(),n=Os();t.startWatching();const r=()=>{const s=e.path;s!=="/maintainance"&&(s.startsWith("/v2-owner-report-mobile")||t.isPathBlocked(s)&&n.replace("/maintainance"))};ft(()=>e.path,r,{immediate:!0}),ft(t.featureBlockData,r,{deep:!0})});function N1e(){const{$pwa:t}=xt(),e=$e(()=>!!t?.needRefresh);async function n(){if("serviceWorker"in navigator&&navigator.onLine)try{await(await navigator.serviceWorker.getRegistration())?.update()}catch{}}async function r(){window.location.reload()}return{newVersionReady:e,pokeUpdate:n,applyUpdate:r}}const D1e=At(()=>{const t=Wa(),e=UD(),n=rr(),r=Os(),{newVersionReady:s,pokeUpdate:i,applyUpdate:o}=N1e(),a=R=>!!R&&(R==="/v2/pos"||R.startsWith("/v2/pos")),c=R=>R==="table"||R==="dashboard";let l,d,h,p;const g=Ae(!1),_=Ae(!1),v=Ae(!1),b=720*60*1e3;ft(()=>t.loaded,R=>{R?w():E()},{immediate:!0}),SP(()=>{g.value&&s.value&&!v.value&&a(r.currentRoute.value.path)&&c(e.tabSelected.value)&&T(_.value)});function w(){l||(h=setTimeout(()=>i(),3e4),d=QS(()=>i(),b),l=xo(n.getForceReloadRef(),R=>{const N=R.data(),O=N?.hash??null,S=N?.force===!0;if(p===void 0){p=O;return}R.metadata.fromCache||O!==p&&(g.value=!0,_.value=S,i())},R=>{console.error("[force-reload] snapshot error",R)}))}function E(){l&&(l(),l=void 0),d&&(clearInterval(d),d=void 0),h&&(clearTimeout(h),h=void 0)}function T(R){if(v.value=!0,R){let N=10;Or.fire({icon:"info",title:"New version available",text:"Updating now to apply the latest changes.",confirmButtonText:`Reload now (${N})`,allowOutsideClick:!1,allowEscapeKey:!1,showCancelButton:!1,timer:1e4,timerProgressBar:!0,didOpen:()=>{const O=Or.getConfirmButton(),S=QS(()=>{N-=1,O&&(O.textContent=`Reload now (${N})`),N<=0&&clearInterval(S)},1e3)}}).then(()=>o());return}Or.fire({icon:"info",title:"New version available",text:"Reload now to get the latest version, or continue and update later.",showCancelButton:!0,confirmButtonText:"Reload now",cancelButtonText:"Later",allowOutsideClick:!1,allowEscapeKey:!1}).then(N=>{N.isConfirmed&&o()})}}),O1e={save:["à¸à¸±à¸à¸à¸¶à¸","Save"],cancel:["ยà¸à¹à¸¥à¸´à¸","Cancel"],confirm:["ยืà¸à¸¢à¸±à¸","Confirm"],close:["à¸à¸´à¸","Close"],delete:["ลà¸","Delete"],edit:["à¹à¸à¹à¹à¸","Edit"],add:["à¹à¸à¸´à¹à¸¡","Add"],remove:["à¸à¸³à¸à¸à¸","Remove"],search:["à¸à¹à¸à¸«à¸²","Search"],back:["ยà¹à¸à¸à¸à¸¥à¸±à¸","Back"],next:["à¸à¸±à¸à¹à¸","Next"],submit:["สà¹à¸à¸à¹à¸à¸¡à¸¹à¸¥","Submit"],reset:["รีà¹à¸à¹à¸","Reset"],view:["à¸à¸¹","View"],download:["à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸","Download"],upload:["à¸à¸±à¸à¹à¸«à¸¥à¸","Upload"],ok:["à¸à¸à¸¥à¸","OK"],lockSwitchUser:["ลà¹à¸à¸ / สลัà¸à¸à¸¹à¹à¹à¸à¹","Lock / Switch User"],switchUser:["สลัà¸à¸à¸¹à¹à¹à¸à¹","Switch User"]}
159,x1e={save:["à¸à¸±à¸à¸à¸¶à¸","Save"],cancel:["ยà¸à¹à¸¥à¸´à¸","Cancel"],confirm:["ยืà¸à¸¢à¸±à¸","Confirm"],close:["à¸à¸´à¸","Close"],delete:["ลà¸","Delete"],edit:["à¹à¸à¹à¹à¸","Edit"],add:["à¹à¸à¸´à¹à¸¡","Add"],remove:["à¸à¸³à¸à¸à¸","Remove"],back:["ยà¹à¸à¸à¸à¸¥à¸±à¸","Back"],next:["à¸à¸±à¸à¹à¸","Next"],reset:["รีà¹à¸à¹à¸","Reset"],clear:["ลà¹à¸²à¸","Clear"],ok:["à¸à¸à¸¥à¸","OK"],update:["à¸à¸±à¸à¹à¸à¸","Update"],print:["à¸à¸´à¸¡à¸à¹","Print"]},L1e={loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸...","Loading..."],saving:["à¸à¸³à¸¥à¸±à¸à¸à¸±à¸à¸à¸¶à¸...","Saving..."],submitting:["à¸à¸³à¸¥à¸±à¸à¸ªà¹à¸à¸à¹à¸à¸¡à¸¹à¸¥...","Submitting..."],success:["สำà¹à¸£à¹à¸","Success"],error:["à¹à¸à¸´à¸à¸à¹à¸à¸à¸´à¸à¸à¸¥à¸²à¸","Error"],empty:["à¹à¸¡à¹à¸¡à¸µà¸à¹à¸à¸¡à¸¹à¸¥","No data"]},M1e={dash:["â","â"],selectOption:["à¸à¸£à¸¸à¸à¸²à¹à¸¥à¸·à¸à¸","Please select"]},V1e={actions:O1e,buttons:x1e,status:L1e,placeholders:M1e},F1e={title:["à¸à¸£à¸°à¸à¸²à¸¨ / à¹à¸à¹à¸à¹à¸à¸·à¸à¸","Announcement"]},B1e={title:["à¸à¸£à¸°à¸à¸²à¸¨à¸à¸±à¸à¹à¸à¸à¸£à¸°à¸à¸","System Update Notice"],body1Line1:["ระà¸à¸à¹à¸à¹à¸à¸±à¸à¹à¸à¸à¹à¸à¹à¸à¹à¸§à¸à¸£à¹à¸à¸±à¸à¹à¸«à¸¡à¹à¹à¸£à¸µà¸¢à¸à¸£à¹à¸à¸¢à¹à¸¥à¹à¸§","The system has been successfully updated to the latest version."],body1Line2:["à¸à¸²à¸à¸£à¹à¸²à¸à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¹à¸à¸²à¸à¹à¸à¹à¸à¸²à¸¡à¸à¸à¸à¸´ à¹à¸à¸¢à¹à¸¡à¹à¸à¹à¸à¸à¸à¸´à¸à¸à¸±à¹à¸à¹à¸à¸£à¹à¸à¸£à¸¡à¹à¸à¸´à¹à¸¡à¹à¸à¸´à¸¡ à¹à¸¥à¸°à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸±à¹à¸à¸«à¸¡à¸à¸à¸°à¸¢à¸±à¸à¸à¸à¸à¸¢à¸¹à¹à¸à¸£à¸à¸à¹à¸§à¸","You can continue using it as normal â no additional installation is required, and all your data remains intact."],firstTimeSetup:["สำหรัà¸à¸£à¹à¸²à¸à¸à¸µà¹à¹à¸à¸´à¹à¸à¹à¸à¹à¸²à¹à¸à¹à¸à¸²à¸à¸à¸£à¸±à¹à¸à¹à¸£à¸ à¹à¸«à¹à¸à¸³à¸à¸²à¸£à¸à¸à¹à¸à¸´à¸à¸£à¹à¸²à¸à¹à¸¥à¸°à¸à¸à¸¥à¸à¸à¸ªà¸±à¹à¸à¸à¸²à¸«à¸²à¸£à¹à¸à¸·à¹à¸à¸à¸à¸ªà¸à¸ Printer à¸à¸¸à¸à¸à¸±à¸§à¸§à¹à¸²à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸³à¸à¸²à¸à¹à¸à¹à¸à¸±à¹à¸à¸«à¸¡à¸","For shops using the system for the first time, please open the shop and place a test order to make sure every printer is working correctly."],body2Default:["หาà¸à¸à¸à¸à¸±à¸à¸«à¸²à¹à¸à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸ à¸à¸£à¸¸à¸à¸²à¸à¸´à¸à¸à¹à¸à¸à¸µà¸¡ Support à¹à¸à¹à¸à¸µà¹ {phone}","If you run into any issues, please contact our Support team at {phone}"],body2Night:["หาà¸à¸à¸à¸à¸±à¸à¸«à¸²à¹à¸à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸ à¸à¸£à¸¸à¸à¸²à¸à¸´à¸à¸à¹à¸à¸à¸µà¸¡ Support à¹à¸à¹à¸à¸µà¹ {phone} (à¹à¸à¸à¹à¸§à¸à¹à¸§à¸¥à¸² 09:00à¸. à¸à¸¶à¸ 23:00à¸.)","If you run into any issues, please contact our Support team at {phone} (available 09:00â23:00)"]},$1e={title:["รà¹à¸²à¸à¸à¹à¸²","Store"],shopName:["à¸à¸·à¹à¸à¸£à¹à¸²à¸","Shop Name"],customerId:["Customer ID","Customer ID"],packagePlan:["à¹à¸à¹à¸à¹à¸à¸","Package Plan"],expireDate:["วัà¸à¸«à¸¡à¸à¸à¸²à¸¢à¸¸","Expire Date"],daysRemaining:["à¹à¸«à¸¥à¸·à¸à¸à¸µà¸ {days} วัà¸","in {days} days"]},U1e={title:["à¸à¸¹à¹à¹à¸à¹à¸à¸²à¸","User"],username:["Username / Email","UserName / Email"],userId:["User ID","User ID"],name:["à¸à¸·à¹à¸","Name"],locale:["ภาษา","Language"],role:["สิà¸à¸à¸´à¹à¸à¸¹à¹à¹à¸à¹","Role"],permission:["สิà¸à¸à¸´à¹à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸","Permission"],roleAdmin:["Admin","Admin"],roleCustom:["Custom","Custom"]},H1e={settings:{title:["à¸à¸±à¹à¸à¸à¹à¸²","Settings"],subtitle:["รà¹à¸²à¸ / à¸à¸¹à¹à¹à¸à¹ / à¸à¸²à¸£à¸à¸³à¸£à¸°à¹à¸à¸´à¸","Store / Users / Payment"]},addDays:{title:["à¸à¹à¸à¸à¸²à¸¢à¸¸à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸","Add Days"],subtitle:["à¸à¹à¸à¸à¸²à¸¢à¸¸à¹à¸à¹à¸à¹à¸à¸","Renew package"]},printer:{title:["Printer Interface V3.3.1","Printer Interface V3.3.1"],subtitle:["à¹à¸à¸£à¹à¸à¸£à¸¡à¸à¸´à¸¡à¸à¹à¹à¸à¹à¸ªà¸£à¹à¸","Receipt Printer Software"],cta:["à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸","Download"]},printerExt:{title:["Printer Chrome Extension","Printer Chrome Extension"],subtitle:["Extension สำหรัภChrome Browser","Extension for Chrome Browser"],cta:["à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸","Download"]},viewMore:["à¸à¸¹à¹à¸à¸´à¹à¸¡à¹à¸à¸´à¸¡","Download"]}
159,q1e={title:["Download Printer Interface","Download Printer Interface"]},j1e={title:["Remote Control","Remote Control"],subtitle:["à¹à¸à¸£à¹à¸à¸£à¸¡à¸à¸§à¸à¸à¸¸à¸¡à¸£à¸°à¸¢à¸°à¹à¸à¸¥","Remote control software"],fullVersion:["TeamViewer Full","TeamViewer Full"],quickSupport:["TeamViewer QuickSupport","TeamViewer QuickSupport"],howTo:["วิà¸à¸µà¸à¸²à¸£à¹à¸à¸´à¸ TeamViewer","How to open the program"],howToTitle:["วิà¸à¸µà¸à¸²à¸£à¹à¸à¸´à¸ TeamViewer","How to open TeamViewer"],tabOpen:["วิà¸à¸µà¸à¸²à¸£à¹à¸à¸´à¸ TeamViewer","How to open"],tabId:["à¸à¸²à¸£à¸à¸¹à¹à¸¥à¸ ID","Finding your ID"]},W1e={announcement:F1e,systemNotice:B1e,store:$1e,user:U1e,tiles:H1e,downloadPrinter:q1e,teamviewer:j1e},G1e={dashboard:["à¹à¸à¸à¸à¸à¸£à¹à¸","DASHBOARD"],tables:["à¹à¸à¹à¸°","TABLES"],togo:["TOGO (à¸à¸·à¹à¸à¸à¸¥à¸±à¸à¸à¹à¸²à¸)","TOGO"],job:["Job","JOB"],delivery:["à¹à¸à¸¥à¸´à¹à¸§à¸à¸£à¸µ","DELIVERY"],activity:["à¸à¸£à¸°à¸§à¸±à¸à¸´à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸","ACTIVITY"]},K1e={notAvailable:["{tab} â ยัà¸à¹à¸¡à¹à¸£à¸à¸à¸£à¸±à¸à¹à¸à¸«à¸à¹à¸²à¸à¸µà¹","{tab} â view not in this UI kit"]},z1e={products:{no:["ลำà¸à¸±à¸","No"],product:["สิà¸à¸à¹à¸²","Product"],qty:["à¸à¸³à¸à¸§à¸","Qty"],total:["ราà¸à¸²à¹à¸à¹à¸¡","Total"],discount:["สà¹à¸§à¸à¸¥à¸","Discount"],sold:["à¸à¸²à¸¢à¹à¸à¹","Sold"],percent:["à¹à¸à¸à¸£à¹à¹à¸à¹à¸à¸à¹","Percent"]}},Y1e={header:{table:["à¹à¸à¹à¸° {table}","Table {table}"]},table:{quantity:["à¸à¸³à¸à¸§à¸","Qty"],product:["รายà¸à¸²à¸£à¸à¸²à¸«à¸²à¸£","Product"],grandTotal:["ยà¸à¸à¸£à¸§à¸¡","Total"]},item:{edit:["à¹à¸à¹à¹à¸","Edit"],editLabel:["à¹à¸à¹à¹à¸à¸£à¸²à¸¢à¸à¸²à¸£","Edit item"],options:["à¸à¸±à¸§à¹à¸¥à¸·à¸à¸","Options"],closeTooltip:["à¸à¸´à¸à¹à¸¡à¸à¸¹","Close menu"],discount:["สà¹à¸§à¸à¸¥à¸: {value}","Discount: {value}"],editQtyTooltip:["à¹à¸à¹à¹à¸à¸à¸±à¸§à¹à¸¥à¸","Edit quantity"],editQtyTitle:["à¹à¸à¹à¹à¸à¸à¸³à¸à¸§à¸","Edit quantity"],qtyRequired:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸à¸à¸à¸³à¸à¸§à¸","Please enter a quantity"],qtyInteger:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸à¸à¹à¸à¹à¸à¸à¸³à¸à¸§à¸à¹à¸à¹à¸¡","Please enter a whole number"],qtyMin:["à¸à¸³à¸à¸§à¸à¸à¹à¸à¸à¸¡à¸²à¸à¸à¸§à¹à¸² 0","Quantity must be at least 1"],noServiceNoVat:["à¹à¸¡à¹à¸à¸´à¸ SC/VAT","No SC/VAT"]},actions:{clear:["ลà¹à¸²à¸à¸à¸°à¸à¸£à¹à¸²","Clear"],saveTo:["à¸à¸±à¸à¸à¸¶à¸à¹à¸à¸à¸µà¹ {target}","Save to {target}"],sending:["à¸à¸³à¸¥à¸±à¸à¸ªà¹à¸à¸£à¸²à¸¢à¸à¸²à¸£...","Sending..."],confirm:["ยืà¸à¸¢à¸±à¸","Confirm"]},toKitchen:["สà¹à¸à¹à¸à¹à¸²à¸à¸£à¸±à¸§","Send to Kitchen"],grandTotalLabel:["ยà¸à¸à¸£à¸§à¸¡à¸à¸±à¹à¸à¸«à¸¡à¸","Grand Total"],billComment:{button:["หมายà¹à¸«à¸à¸¸","Comment"],title:["หมายà¹à¸«à¸à¸¸à¸à¸¶à¸à¸à¸£à¸±à¸§","Comment to kitchen"],placeholder:["à¹à¸ªà¹à¸«à¸¡à¸²à¸¢à¹à¸«à¸à¸¸à¸ªà¸³à¸«à¸£à¸±à¸à¸à¸´à¸¥à¸à¸µà¹ (à¸à¸°à¸à¸´à¸¡à¸à¹à¹à¸à¹à¸²à¸à¸£à¸±à¸§)","Add a note for this bill (prints to kitchen)"],edit:["à¹à¸à¹à¹à¸","Edit"],save:["à¸à¸±à¸à¸à¸¶à¸","Save"]},contextMenu:{setSoldOut:["à¸à¸±à¹à¸à¸à¹à¸²à¹à¸à¹à¸à¸à¸à¸à¸«à¸¡à¸","Mark as Sold Out"],unsetSoldOut:["ยà¸à¹à¸¥à¸´à¸à¸à¸à¸à¸«à¸¡à¸","Unmark Sold Out"]},openMenu:{namePrompt:["ระà¸à¸¸à¸à¸·à¹à¸à¹à¸¡à¸à¸¹","Enter menu name"],pricePrompt:["ระà¸à¸¸à¸£à¸²à¸à¸²","Enter price"],validation:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸«à¹à¸à¸£à¸","Please fill in the required field"]},filters:{all:["à¸à¸±à¹à¸à¸«à¸¡à¸","All"]},search:{placeholder:["à¸à¹à¸à¸«à¸²...","Search..."],clear:["ลà¹à¸²à¸à¸à¸³à¸à¹à¸à¸«à¸²","Clear search"],minChars:["à¸à¸´à¸¡à¸à¹à¸à¸¢à¹à¸²à¸à¸à¹à¸à¸¢ 2 à¸à¸±à¸§à¸à¸±à¸à¸©à¸£","Type at least 2 characters"],noResults:["à¹à¸¡à¹à¸à¸à¸à¸¥à¸¥à¸±à¸à¸à¹","No results found"],soldOut:{title:["สิà¸à¸à¹à¸²à¸«à¸¡à¸","Sold out"],text:["สิà¸à¸à¹à¸²à¸à¸µà¹à¸à¸¢à¸¹à¹à¹à¸à¹à¸«à¸¡à¸à¸à¸à¸à¸«à¸¡à¸ à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸²à¸¢à¹à¸à¹","This item is marked as sold out and cannot be sold."]}},retrySend:{title:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸ªà¹à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸¶à¸à¹à¸à¸£à¸·à¹à¸à¸ Cashier à¹à¸à¹ à¸à¸£à¸¸à¸à¸²à¸¥à¸à¸à¹à¸«à¸¡à¹à¸à¸µà¸à¸à¸£à¸±à¹à¸","Cannot send data to the Cashier device. Please try again."]}},J1e={topping:{customizeItem:["à¸à¸£à¸±à¸à¹à¸à¹à¸à¸£à¸²à¸¢à¸à¸²à¸£","Customize Item"],base:["ราà¸à¸²à¹à¸£à¸´à¹à¸¡à¸à¹à¸","Base"],yourSelection:["รายà¸à¸²à¸£ Topping","Topping items"],addOns:["à¸à¸±à¸§à¹à¸¥à¸·à¸à¸à¹à¸à¸´à¹à¸¡","Add-ons"],total:["ยà¸à¸à¸£à¸§à¸¡","Total"],free:["à¸à¸£à¸µ","Free"],note:["Comment","Comment"],notePlaceholder:["à¹à¸à¸´à¹à¸¡à¸«à¸¡à¸²à¸¢à¹à¸«à¸à¸¸ à¹à¸à¹à¸ à¹à¸¡à¹à¹à¸à¹à¸, à¹à¸¡à¹à¸à¸±à¸","Add note e.g. no spicy, no veggies"],noItemsInGroup:["à¹à¸¡à¹à¸¡à¸µà¸£à¸²à¸¢à¸à¸²à¸£à¹à¸à¸à¸¥à¸¸à¹à¸¡à¸à¸µà¹","No items in this group"],emptyState:{title:["ยัà¸à¹à¸¡à¹à¹à¸à¹à¹à¸¥à¸·à¸à¸ Topping","No topping selected yet"],hint:["à¹à¸¥à¸·à¸à¸ Topping à¸à¸²à¸à¸à¹à¸²à¸à¸à¸§à¸²à¹à¸à¸·à¹à¸à¸à¸£à¸±à¸à¹à¸à¹à¸à¸£à¸²à¸¢à¸à¸²à¸£","Pick a topping from the right to customize"]},tabs:{topping:["Topping","Topping"],comment:["Comment","Comment"]},lockedWarning:{lineOne:["รายà¸à¸²à¸£à¸à¸µà¹à¸à¸¹à¸à¸ªà¹à¸à¹à¸à¹à¸²à¸à¸£à¸±à¸§à¹à¸¥à¹à¸§","This item has been sent to the kitchen"],lineTwo:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¹à¹à¸ Topping à¹à¸à¹","Topping cannot be edited"]},summary:{baseOnly:["ยัà¸à¹à¸¡à¹à¸¡à¸µà¸à¸±à¸§à¹à¸¥à¸·à¸à¸à¹à¸à¸´à¹à¸¡","No add-ons selected"],comments:["Comments","comments"]},clearAllTopping:["ลà¸à¸à¸±à¹à¸à¸«à¸¡à¸","Clear all "],lineActions:{splitMaxHint:["สูà¸à¸ªà¸¸à¸ {max} à¸à¸´à¹à¸ à¸à¸²à¸à¸à¸±à¹à¸à¸«à¸¡à¸ {total} à¸à¸´à¹à¸","Max {max} qty, from total of {total}"],setPrice:["à¸à¸±à¹à¸à¸£à¸²à¸à¸²","Set price"],discount:["สà¹à¸§à¸à¸¥à¸","Discount"],splitLine:["à¹à¸¢à¸à¸à¸£à¸£à¸à¸±à¸","Split line"],priceLabel:["ราà¸à¸²à¸à¹à¸à¸«à¸à¹à¸§à¸¢","Unit price"],priceWas:["ราà¸à¸²à¹à¸à¸´à¸¡ {price}","Was {price}"],priceInvalid:["à¸à¸£à¸à¸à¸£à¸²à¸à¸²à¸à¸µà¹à¸à¸¹à¸à¸à¹à¸à¸ (à¸à¸¨à¸à¸´à¸¢à¸¡à¹à¸¡à¹à¹à¸à¸´à¸ 2 à¸à¸³à¹à¸«à¸à¹à¸)","Enter a valid price (max 2 decimals)"],discountLabel:["สà¹à¸§à¸à¸¥à¸à¸à¹à¸à¸«à¸à¹à¸§à¸¢","Discount per unit"],discountInvalid:["สà¹à¸§à¸à¸¥à¸à¹à¸à¸à¸£à¹à¹à¸à¹à¸à¸à¹à¸à¹à¸à¸à¸à¸¢à¸¹à¹à¸£à¸°à¸«à¸§à¹à¸²à¸ 0 â 100","Percent discount must be 0 â 100"],discountRow:["สà¹à¸§à¸à¸¥à¸","Discount"],splitLabel:["à¹à¸¢à¸à¸à¸à¸à¸à¸³à¸à¸§à¸","Split quantity"],splitNeedQty:["à¹à¸¢à¸à¹à¸à¹à¹à¸¡à¸·à¹à¸à¸à¸³à¸à¸§à¸à¸à¸±à¹à¸à¹à¸à¹ 2 à¸à¸¶à¹à¸à¹à¸","Split needs a quantity of 2 or more"],notPermitted:["à¹à¸¡à¹à¹à¸à¹à¸£à¸±à¸à¸à¸à¸¸à¸à¸²à¸ â à¸à¹à¸à¸à¹à¸à¹ PIN à¸à¸µà¹à¸¡à¸µà¸ªà¸´à¸à¸à¸´à¹{action}","Not permitted â a PIN with the {action} right is required"]}},shared:{scope:["à¸à¸à¸à¹à¸à¸","Scope"],mode:["à¹à¸«à¸¡à¸","Mode"],percentage:["à¹à¸à¸à¸£à¹à¹à¸à¹à¸à¸à¹","Percentage"],percentExclude:["ลà¸% (มีà¸à¹à¸à¸¢à¸à¹à¸§à¹à¸)","Percent (with conditions)"],amountThb:["à¸à¸³à¸à¸§à¸à¹à¸à¸´à¸ (à¸à¸²à¸)","Amount (THB)"],valuePercent:["à¸à¹à¸² (%)","Value (%)"],valueThb:["à¸à¹à¸² (à¸à¸²à¸)","Value (THB)"],itemsCount:["{count} รายà¸à¸²à¸£","{count} items"],fromTable:["à¸à¸²à¸à¹à¸à¹à¸° {table}","from Table {table}"]},move:{title:["ยà¹à¸²à¸¢à¸ªà¸´à¸à¸à¹à¸²","Move Items"],scope:{all:["à¹à¸¥à¸·à¸à¸à¸à¸±à¹à¸à¸«à¸¡à¸ (Select All)","Select All"],selected:["à¹à¸à¸à¸²à¸°à¸£à¸²à¸¢à¸à¸²à¸£à¸à¸µà¹à¹à¸¥à¸·à¸à¸","Selected items"]},zone:["à¹à¸à¸","Zone"],zoneOption:["à¹à¸à¸ {name} ({count} à¹à¸à¹à¸°)","Zone {name} ({count} tables)"],targetTable:["à¹à¸à¹à¸°à¸à¸¥à¸²à¸¢à¸à¸²à¸","Target Table"],source:["à¸à¹à¸à¸à¸²à¸","Source"],locked:["ลà¹à¸à¸","Locked"],empty:["วà¹à¸²à¸","Empty"],footerSummary:["{count} รายà¸à¸²à¸£ â","{count} items â"],moveButton:["ยà¹à¸²à¸¢","Move"],modeSimple:["à¹à¸«à¸¡à¸à¸à¹à¸²à¸¢","Simple"],modeAdvanced:["à¹à¸«à¸¡à¸à¸¥à¸°à¹à¸à¸µà¸¢à¸","Advanced"],simpleLabel:["à¹à¸à¹à¸°à¸à¸¥à¸²à¸¢à¸à¸²à¸","Target table"],simplePlaceholder:["à¹à¸à¹à¸ t5 หรืภ5","e.g. t5 or 5"],notFound:["à¹à¸¡à¹à¸à¸à¹à¸à¹à¸°à¸à¸¥à¸²à¸¢à¸à¸²à¸","Target table not found"],moveAll:["ยà¹à¸²à¸¢à¸à¸±à¹à¸à¸«à¸¡à¸","Move all"],moveCount:["ยà¹à¸²à¸¢ {count} รายà¸à¸²à¸£","Move {count} items"],gotoAdvanced:["à¹à¸«à¸¡à¸à¸¥à¸°à¹à¸à¸µà¸¢à¸","Advanced Mode"],gotoSimple:["à¹à¸«à¸¡à¸à¸à¹à¸²à¸¢","Simple Mode"],targetL
159ocked:{title:["à¹à¸à¹à¸°à¸à¸¥à¸²à¸¢à¸à¸²à¸à¸à¸¹à¸à¸¥à¹à¸à¸","Target table is locked"],text:["à¹à¸à¹à¸°à¸à¸¥à¸²à¸¢à¸à¸²à¸à¸à¸¹à¸à¸¥à¹à¸à¸à¸à¸¢à¸¹à¹ à¸à¸£à¸¸à¸à¸²à¸à¸¥à¸à¸¥à¹à¸à¸à¹à¸à¹à¸°à¸à¸¥à¸²à¸¢à¸à¸²à¸à¸à¹à¸à¸à¸¢à¹à¸²à¸¢à¸ªà¸´à¸à¸à¹à¸²","The target table is locked. Please unlock it before moving items here."]}},discount:{title:["à¹à¸«à¹à¸ªà¹à¸§à¸à¸¥à¸","Apply Discount"],scope:{all:["à¸à¸¸à¸à¸£à¸²à¸¢à¸à¸²à¸£à¹à¸à¹à¸à¹à¸° (Select All)","Select All"],selected:["à¹à¸à¸à¸²à¸°à¸ªà¸´à¸à¸à¹à¸²à¸à¸µà¹à¹à¸¥à¸·à¸à¸","Selected items"]},scopeSummary:["{count} รายà¸à¸²à¸£ · รวม {total}","{count} items · total {total}"],footerSummary:["{count} รายà¸à¸²à¸£","{count} items"],discountButton:["ลà¸","Discount"],perUnitHint:["สà¹à¸§à¸à¸¥à¸à¸à¹à¸à¸«à¸à¹à¸§à¸¢ â (ระà¸à¸à¸à¸°à¸à¸¹à¸à¸à¸³à¸à¸§à¸ Qty à¹à¸«à¹à¸à¸±à¸à¹à¸à¸¡à¸±à¸à¸´)","Discount per UNIT "]},void:{title:["ยà¸à¹à¸¥à¸´à¸à¸ªà¸´à¸à¸à¹à¸²","Void Items"],tabItems:["ยà¸à¹à¸¥à¸´à¸à¸ªà¸´à¸à¸à¹à¸²","Items"],tabToppings:["ยà¸à¹à¸¥à¸´à¸ Topping","Toppings"],noToppings:["à¹à¸¡à¹à¸¡à¸µ Topping à¹à¸«à¹à¸¢à¸à¹à¸¥à¸´à¸","No toppings to void"],maxAll:["à¹à¸¥à¸·à¸à¸à¸à¸±à¹à¸à¸«à¸¡à¸","Max all"],item:["รายà¸à¸²à¸£","Item"],qtyToVoid:["à¸à¸³à¸à¸§à¸à¸à¸µà¹à¸¢à¸à¹à¸¥à¸´à¸","Qty to Void"],max:["à¸à¸±à¹à¸à¸«à¸¡à¸","All"],noItemsSelected:["ยัà¸à¹à¸¡à¹à¹à¸à¹à¹à¸¥à¸·à¸à¸à¸£à¸²à¸¢à¸à¸²à¸£","No items selected"],reason:["à¹à¸«à¸à¸¸à¸à¸¥","Reason"],reasonPlaceholder:["à¹à¸«à¸à¸¸à¸à¸¥à¹à¸à¸à¸²à¸£à¸¢à¸à¹à¸¥à¸´à¸ (Void)","Reason for void"],printKitchen:["à¸à¸´à¸¡à¸à¹à¹à¸à¸¢à¸à¹à¸¥à¸´à¸ (Void) à¸à¸µà¹à¸à¸£à¸±à¸§","Print void slip at kitchen"],voidButton:["ยà¸à¹à¸¥à¸´à¸à¸ªà¸´à¸à¸à¹à¸²","Void Items"],quickReasons:{customerCancel:["ลูà¸à¸à¹à¸²à¸¢à¸à¹à¸¥à¸´à¸","Customer cancelled"],remake:["à¸à¸³à¹à¸«à¸¡à¹","Remake"],wrongOrder:["สัà¹à¸à¸à¸´à¸","Wrong order"],soldOut:["สิà¸à¸à¹à¸²à¸«à¸¡à¸","Sold out"],returnItem:["à¸à¸·à¸à¸ªà¸´à¸à¸à¹à¸²","Return"],other:["à¸à¸·à¹à¸à¹","Other"]}},autoSelect:{title:["à¹à¸¥à¸·à¸à¸à¸à¸±à¸à¹à¸à¸¡à¸±à¸à¸´","Auto Select"],hint:["à¹à¸¥à¸·à¸à¸à¹à¸à¸·à¹à¸à¸à¹à¸ à¹à¸¥à¹à¸§à¸£à¸°à¸à¸à¸à¸°à¸à¸´à¹à¸à¸£à¸²à¸¢à¸à¸²à¸£à¸à¸µà¹à¸à¸£à¸à¹à¸«à¹à¸à¸±à¸à¹à¸à¸¡à¸±à¸à¸´ (à¹à¸¥à¸·à¸à¸à¹à¸à¹à¸«à¸¥à¸²à¸¢à¸à¹à¸²à¹à¸¥à¸°à¸à¹à¸²à¸¡à¹à¸à¹à¸)","Pick criteria and matching items get ticked automatically (multi-select, across tabs)"],tabs:{type:["à¸à¸²à¸¡à¸à¸£à¸°à¹à¸ à¸","By Type"],catalog:["à¸à¸²à¸¡à¸«à¸¡à¸§à¸","By Catalog"],tag:["à¸à¸²à¸¡à¹à¸à¹à¸","By Tag"]},empty:{type:["à¹à¸¡à¹à¸¡à¸µà¸à¸£à¸°à¹à¸ à¸à¹à¸à¸£à¸²à¸¢à¸à¸²à¸£à¸à¸µà¹","No types in this order"],catalog:["à¹à¸¡à¹à¸¡à¸µà¸«à¸¡à¸§à¸à¹à¸à¸£à¸²à¸¢à¸à¸²à¸£à¸à¸µà¹","No catalogs in this order"],tag:["à¹à¸¡à¹à¸¡à¸µà¹à¸à¹à¸à¹à¸à¸£à¸²à¸¢à¸à¸²à¸£à¸à¸µà¹","No tags in this order"]},matchCount:["à¸à¸°à¸à¸´à¹à¸ {count} รายà¸à¸²à¸£","Will tick {count} items"],selectButton:["à¸à¸´à¹à¸à¸£à¸²à¸¢à¸à¸²à¸£à¸à¸µà¹à¸à¸£à¸","Select matching"]},comment:{title:["หมายà¹à¸«à¸à¸¸ / comments","Comment"],label:["หมายà¹à¸«à¸à¸¸","Comment"],placeholder:["à¹à¸ªà¹à¸«à¸¡à¸²à¸¢à¹à¸«à¸à¸¸à¸ªà¸³à¸«à¸£à¸±à¸à¸£à¸²à¸¢à¸à¸²à¸£à¸à¸µà¹","Add a comment for this item"]},splitItem:{title:["à¹à¸¢à¸à¸ªà¸´à¸à¸à¹à¸²","Split Item"],splitQty:["à¹à¸¢à¸à¸à¸à¸à¸à¸³à¸à¸§à¸","Split quantity"],fromHint:["à¸à¸²à¸ {qty} à¸à¸´à¹à¸ (à¹à¸¥à¸·à¸à¸à¹à¸à¹ 1 â {max})","from {qty} pcs (choose 1 â {max})"],splitButton:["à¹à¸¢à¸","Split"]},splitBill:{title:["à¹à¸¢à¸à¸à¸´à¸¥","Split Bill"],product:["รายà¸à¸²à¸£","Items"],qty:["à¸à¸³à¸à¸§à¸","Qty"],extPrice:["ราà¸à¸²à¸£à¸§à¸¡","Ext. Price"],billNo:["หมายà¹à¸¥à¸à¸à¸´à¸¥","Bill Numbers"],billNoShort:["à¸à¸´à¸¥à¸à¸µà¹","Bill no."],noItems:["à¹à¸¡à¹à¸¡à¸µà¸£à¸²à¸¢à¸à¸²à¸£","No items"],billOption:["à¸à¸´à¸¥ {n}","Bill {n}"],more:["à¹à¸à¸´à¹à¸¡","More"],footerSummary:["{items} รายà¸à¸²à¸£ · {bills} à¸à¸´à¸¥","{items} items · {bills} bills"]},billingAdjust:{types:{serviceCharge:["à¸à¹à¸²à¸à¸£à¸´à¸à¸²à¸£","Service Charge"],additionalDiscount:["สà¹à¸§à¸à¸¥à¸à¸à¹à¸²à¸¢à¸à¸´à¸¥","Additional Discount"],cardCharge:["à¸à¹à¸²à¸à¸£à¸£à¸¡à¹à¸à¸µà¸¢à¸¡à¸à¸±à¸à¸£","Card Charge"],vat:["ภาษีมูลà¸à¹à¸²à¹à¸à¸´à¹à¸¡ (VAT)","VAT"]},useDefault:["à¹à¸à¹à¸à¹à¸²à¹à¸£à¸´à¹à¸¡à¸à¹à¸ (Default)","Use Default"],saveButton:["à¸à¸±à¸à¸à¸¶à¸","Save"],excludeInfoTitle:["ลà¸% (มีà¸à¹à¸à¸¢à¸à¹à¸§à¹à¸) à¸à¸·à¸à¸à¸°à¹à¸£","What is Percent (with conditions)?"],excludeInfoBody:[`ระà¸à¸à¸à¸°à¸à¹à¸²à¸¡à¹à¸¡à¹à¸¥à¸à¹à¸«à¹ 2 à¸à¸¥à¸¸à¹à¸¡à¸à¸µà¹: 160⢠รายà¸à¸²à¸£à¸à¸µà¹à¸à¸´à¸à¹à¸à¹à¸ no-discount (à¸à¸²à¸¢à¸à¸±à¸§à¸à¸µà¹à¸à¸±à¹à¸à¸à¹à¸²à¸«à¹à¸²à¸¡à¸¥à¸à¹à¸§à¹) 161⢠รายà¸à¸²à¸£à¸à¸µà¹à¸à¸¹à¸à¸¥à¸à¸£à¸²à¸à¸²à¸£à¸²à¸¢à¸à¸±à¸§à¹à¸à¹à¸¥à¹à¸§ (à¸à¸±à¸à¸à¸²à¸£à¸¥à¸à¸à¹à¸³à¸à¹à¸à¸)`,`The discount skips these 2 groups: 162⢠Items tagged no-discount (fixed-price items set as non-discountable) 163⢠Items already discounted individually (to prevent double-discounting)`]},guests:{title:["à¸à¸³à¸à¸§à¸à¸¥à¸¹à¸à¸à¹à¸²","Number of Guests"],custom:["à¸à¸³à¸«à¸à¸à¹à¸à¸","Custom"],customPlaceholder:["ระà¸à¸¸à¸à¸³à¸à¸§à¸","Enter number"]},drawer:{title:["ลิà¹à¸à¸à¸±à¸à¹à¸à¹à¸à¹à¸à¸´à¸","Cash Drawer"],cols:{start:["à¹à¸à¸´à¸à¹à¸£à¸´à¹à¸¡à¸à¹à¸","Start"],deposit:["à¸à¸²à¸à¹à¸à¹à¸²","Deposit"],withdraw:["à¸à¸à¸à¸à¸à¸","Withdraw"],return:["à¸à¸·à¸à¹à¸à¸´à¸","Return"]},voidBills:["{count} à¸à¸´à¸¥à¸à¸µà¹à¸¢à¸à¹à¸¥à¸´à¸","{count} void bills"],mode:["à¹à¸«à¸¡à¸","Mode"],amount:["à¸à¸³à¸à¸§à¸à¹à¸à¸´à¸","Amount"],modes:{deposit:["à¸à¸²à¸à¹à¸à¹à¸²","Deposit"],withdraw:["à¸à¸à¸à¸à¸à¸","Withdraw"],start:["à¹à¸à¸´à¸à¹à¸£à¸´à¹à¸¡à¸à¹à¸","Start"]},replaceStartTitle:["à¸à¹à¸à¸à¸à¸²à¸£à¹à¸à¸à¸à¸µà¹à¹à¸à¸´à¸à¹à¸à¸´à¸à¸£à¹à¸²à¸à¹à¸à¹à¹à¸«à¸¡","Replace opening cash?"],replaceStartText:["à¹à¸à¸à¸à¸µà¹à¹à¸à¸´à¸à¹à¸à¸´à¸à¸£à¹à¸²à¸","This replaces the opening cash"],yes:["à¹à¸à¹","Yes"],no:["à¹à¸¡à¹à¹à¸à¹","No"]},reportSummary:{title:["สรุà¸à¸£à¸²à¸¢à¸à¸²à¸","Report Summary"],reloading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸â¦","Reloadingâ¦"],printFull:["à¸à¸´à¸¡à¸à¹à¸£à¸²à¸¢à¸à¸²à¸à¹à¸à¹à¸¡","Print Full Report"],rows:{income:["สรุà¸à¸£à¸²à¸¢à¹à¸à¹","Income summary"],products:["สรุà¸à¸ªà¸´à¸à¸à¹à¸²à¸à¸µà¹à¸à¸²à¸¢à¹à¸à¹","Products sold"],voids:["สรุà¸à¸£à¸²à¸¢à¸à¸²à¸£ Void","Voided items"],openMenu:["สรุà¸à¸ªà¸´à¸à¸à¹à¸² Open Menu","Open menu items"]}},closeShop:{title:["à¸à¸´à¸à¸£à¹à¸²à¸ | Close Shop","Close Shop"],actualCash:["à¹à¸à¸´à¸à¸ªà¸à¸à¸£à¸´à¸ (Actual Cash)","Actual Cash"],rows:{income:["รายà¹à¸à¹ (Income)","Income"],incomeDetail:["รายà¹à¸à¹ + รายละà¹à¸à¸µà¸¢à¸à¸à¸´à¸¥ (Full Report)","Receipt Full Report"],productDetail:["สิà¸à¸à¹à¸²à¸£à¸²à¸¢à¸¥à¸°à¹à¸à¸µà¸¢à¸ (Product Detail)","Product Detail"],void
163Bill:["ยà¸à¹à¸¥à¸´à¸à¸à¸´à¸¥ (Void)","Void Bill"],openMenu:["สิà¸à¸à¹à¸² Open Menu","Open Menu"]},closing:["à¸à¸³à¸¥à¸±à¸à¸à¸´à¸...","Closing..."],confirm:["ยืà¸à¸¢à¸±à¸à¸à¸´à¸à¸£à¹à¸²à¸","Confirm Close Shop"]},changeShift:{title:["à¹à¸à¸¥à¸µà¹à¸¢à¸à¸à¸° | Change Shift","Change Shift"],current:["à¸à¸°à¸à¸±à¸à¸à¸¸à¸à¸±à¸","Current"],next:["à¸à¸°à¸à¸±à¸à¹à¸","Next"],shift:["à¸à¸° {n}","Shift {n}"],reportsSection:["à¸à¸³à¸à¸§à¸à¸ªà¸³à¹à¸à¸²à¸£à¸²à¸¢à¸à¸²à¸à¸à¸µà¹à¸à¸°à¸à¸´à¸¡à¸à¹","Report copies to print"],outstanding:["ยà¸à¸à¹à¸à¹à¸°à¸à¸µà¹à¸¢à¸±à¸à¹à¸à¸´à¸à¸à¹à¸²à¸ (ยà¸à¹à¸à¸à¸°à¸à¸±à¸à¹à¸)","Open tables outstanding (carried to next shift)"],outstandingTables:["{n} à¹à¸à¹à¸°","{n} tables"],outstandingNone:["à¹à¸¡à¹à¸¡à¸µà¹à¸à¹à¸°à¹à¸à¸´à¸à¸à¹à¸²à¸","No open tables"],rows:{income:["Print รายà¹à¸à¹ (Income)","Print Income"],productDetail:["Print สิà¸à¸à¹à¸²à¸£à¸²à¸¢à¸¥à¸°à¹à¸à¸µà¸¢à¸ (Product Detail)","Print Product Detail"],voidBill:["Print ยà¸à¹à¸¥à¸´à¸à¸à¸´à¸¥ (Void)","Print Void Bill"],openMenu:["Print สิà¸à¸à¹à¸² Open Menu","Print Open Menu"]},changing:["à¸à¸³à¸¥à¸±à¸à¹à¸à¸¥à¸µà¹à¸¢à¸à¸à¸°...","Changing..."],confirm:["ยืà¸à¸¢à¸±à¸à¹à¸à¸¥à¸µà¹à¸¢à¸à¸à¸°","Confirm Change Shift"]},closeShopProgress:{title:["à¸à¸³à¸¥à¸±à¸à¸à¸´à¸à¸£à¹à¸²à¸...","Closing shop..."],done:["à¹à¸ªà¸£à¹à¸","Done"],inProgress:["à¸à¸³à¸¥à¸±à¸à¸à¸³...","In progress..."],doNotClose:["à¸à¸£à¸¸à¸à¸²à¸à¸¢à¹à¸²à¸à¸´à¸à¸«à¸à¹à¸²à¸à¸à¸à¸à¸à¸§à¹à¸²à¸£à¸°à¸à¸à¸à¸°à¸à¸³à¸à¸²à¸à¹à¸ªà¸£à¹à¸","Please do not close the screen until the process finishes"],steps:{refreshReceipts:["รีà¹à¸à¸£à¸à¸à¹à¸à¸¡à¸¹à¸¥ Receipts","Refresh receipts"],syncData:["Sync à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸¶à¹à¸ Cloud (Jobs / Receipts / Activities)","Sync data to cloud (Jobs / Receipts / Activities)"],sendEmailDaily:["สà¹à¸à¸à¸µà¹à¸¡à¸¥à¸£à¸²à¸¢à¸à¸²à¸à¸à¸£à¸°à¸à¸³à¸§à¸±à¸","Send daily email report"],sendSmsDaily:["สà¹à¸ SMS รายà¸à¸²à¸à¸à¸£à¸°à¸à¸³à¸§à¸±à¸","Send daily SMS report"],closingBatch:["à¸à¸´à¸à¸¢à¸à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸ Cloud","Close batch on cloud"]}}},Q1e={labels:{date:["วัà¸à¸à¸µà¹","Date"],go:["à¸à¹à¸à¸«à¸²!","Go!"],orders:["à¸à¸´à¸¥à¸à¸µà¹à¸à¸à¸","Orders"],deletedOrders:["à¸à¸´à¸¥à¸à¸µà¹à¸¢à¸à¹à¸¥à¸´à¸","Deleted Orders"],voided:["ยà¸à¹à¸¥à¸´à¸à¹à¸¥à¹à¸§","Voided"],view:["à¸à¸¹","View"],voidBill:["ยà¸à¹à¸¥à¸´à¸à¸à¸´à¸¥","Void Bill"],voidPending:["รภsync","Void pending"]},table:{no:["ลำà¸à¸±à¸","No."],id:["#ID","#ID"],date:["วัà¸à¸à¸µà¹","Date"],type:["à¸à¸£à¸°à¹à¸ à¸","Type"],shift:["à¸à¸°","Shift"],cashier:["à¹à¸à¸à¹à¸à¸µà¸¢à¸£à¹","Cashier"],guests:["ลูà¸à¸à¹à¸²","Guests"],grandTotal:["ยà¸à¸à¸£à¸§à¸¡","GrandTotal"],remark:["หมายà¹à¸«à¸à¸¸","Remark"],actions:["à¸à¸²à¸£à¸à¸³à¸£à¸²à¸¢à¸à¸²à¸£","Actions"]},empty:{searching:["à¸à¸³à¸¥à¸±à¸à¸à¹à¸à¸«à¸²à¹à¸à¹à¸ªà¸£à¹à¸...","Searching receipts..."],selectDate:["à¹à¸¥à¸·à¸à¸à¸§à¸±à¸à¸à¸µà¹à¹à¸¥à¸°à¸à¸à¸à¹à¸à¸«à¸²à¹à¸à¸·à¹à¸à¹à¸ªà¸à¸à¸£à¸²à¸¢à¸à¸²à¸£","Select a date and press Go! to show the list"],noRecords:["à¹à¸¡à¹à¸à¸à¸£à¸²à¸¢à¸à¸²à¸£à¹à¸à¹à¸à¹à¸à¸à¸µà¹","No records in this tab"]},messages:{fetchError:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸¶à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸à¹ à¸à¸£à¸¸à¸à¸²à¸¥à¸à¸à¹à¸«à¸¡à¹à¸à¸µà¸à¸à¸£à¸±à¹à¸","Unable to fetch data. Please try again."],editGuestTitle:["à¸à¸£à¸¸à¸à¸²à¸£à¸°à¸à¸¸à¸à¸³à¸à¸§à¸à¸¥à¸¹à¸à¸à¹à¸²","Please enter number of customers"],editGuestPlaceholder:["à¸à¸³à¸à¸§à¸à¸¥à¸¹à¸à¸à¹à¸²","Number of customers"],reprintTitle:["à¸à¸´à¸¡à¸à¹à¸à¹à¸³","Reprint"],reprintText:["สัà¹à¸à¸à¸´à¸¡à¸à¹à¸à¹à¸³à¹à¸¥à¹à¸§","Reprint invoked."],voidPromptTitle:["ยà¸à¹à¸¥à¸´à¸à¸à¸´à¸¥ #{id} ?","Void bill #{id}?"],voidPromptConfirm:["ยืà¸à¸¢à¸±à¸à¸¢à¸à¹à¸¥à¸´à¸","Confirm void"],voidDefaultReason:["à¹à¸¡à¹à¹à¸à¹à¸£à¸°à¸à¸¸à¹à¸«à¸à¸¸à¸à¸¥","No reason provided"],voidQueued:["ยà¸à¹à¸¥à¸´à¸à¹à¸¥à¹à¸§ â à¸à¸° sync à¹à¸¡à¸·à¹à¸à¸à¸¥à¸±à¸à¸¡à¸²à¸à¸à¸à¹à¸¥à¸à¹","Voided â will sync
163when back online"]}},X1e={title:{add:["à¹à¸à¸´à¹à¸¡à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸²à¸£à¸à¸±à¸à¸ªà¹à¸","Add Delivery"],edit:["à¹à¸à¹à¹à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸²à¸£à¸à¸±à¸à¸ªà¹à¸","Edit Delivery"]},fields:{name:["à¸à¸·à¹à¸à¸¥à¸¹à¸à¸à¹à¸²","Customer Name"],phone:["à¹à¸à¸à¸£à¹à¹à¸à¸£à¸¨à¸±à¸à¸à¹","Phone"],pickTime:["à¹à¸§à¸¥à¸²à¸à¸±à¸à¸ªà¹à¸","Pick-up Time"],zone:["à¸à¸·à¹à¸à¸à¸µà¹","Zone"],address:["à¸à¸µà¹à¸à¸¢à¸¹à¹","Address"],comment:["หมายà¹à¸«à¸à¸¸","Comment"]},prefix:["K.","K."],placeholders:{name:["ระà¸à¸¸à¸à¸·à¹à¸","Enter name"],phone:["à¹à¸à¸à¸£à¹à¹à¸à¸£ 9-10 หลัà¸","9-10 digit phone number"],zone:["à¹à¸à¹à¸ สุà¸à¸¸à¸¡à¸§à¸´à¸, ลาà¸à¸à¸£à¹à¸²à¸§","e.g. Sukhumvit, Lat Phrao"],address:["à¸à¸µà¹à¸à¸¢à¸¹à¹à¸ªà¸³à¸«à¸£à¸±à¸à¸à¸±à¸à¸ªà¹à¸","Delivery address"],comment:["หมายà¹à¸«à¸à¸¸à¹à¸à¸´à¹à¸¡à¹à¸à¸´à¸¡","Additional notes"]},actions:{add:["à¹à¸à¸´à¹à¸¡à¸à¸²à¸£à¸à¸±à¸à¸ªà¹à¸","Add Delivery"],edit:["à¸à¸±à¸à¸à¸¶à¸à¸à¸²à¸£à¹à¸à¹à¹à¸","Save Changes"]}},Z1e={header:["ToGo","ToGo"],newTogo:["สรà¹à¸²à¸ ToGo à¹à¸«à¸¡à¹","New ToGo"],empty:["à¹à¸¡à¹à¸¡à¸µà¸£à¸²à¸¢à¸à¸²à¸£ ToGo","No ToGo orders"],table:{id:["รหัส","ID"],createdAt:["à¹à¸§à¸¥à¸²à¹à¸£à¸´à¹à¸¡","Created At"],orderedBy:["สัà¹à¸à¹à¸à¸¢","Ordered by"],items:["รายà¸à¸²à¸£","Items"],grandTotal:["ยà¸à¸à¸£à¸§à¸¡","Grand Total"]}},exe={header:["JOB","JOB"],newJob:["สรà¹à¸²à¸ JOB à¹à¸«à¸¡à¹","New JOB"],empty:["à¹à¸¡à¹à¸¡à¸µà¸£à¸²à¸¢à¸à¸²à¸£ JOB","No JOB orders"],table:{id:["รหัส","ID"],createdAt:["à¹à¸§à¸¥à¸²à¹à¸£à¸´à¹à¸¡","Created At"],orderedBy:["สัà¹à¸à¹à¸à¸¢","Ordered by"],items:["รายà¸à¸²à¸£","Items"],grandTotal:["ยà¸à¸à¸£à¸§à¸¡","Grand Total"]}},txe={title:["à¸à¸²à¸£à¸à¸±à¸à¸ªà¹à¸","Delivery"],newDelivery:["สรà¹à¸²à¸à¸à¸²à¸£à¸à¸±à¸à¸ªà¹à¸à¹à¸«à¸¡à¹","New Delivery"],empty:["à¹à¸¡à¹à¸¡à¸µà¸£à¸²à¸¢à¸à¸²à¸£à¸à¸±à¸à¸ªà¹à¸","No delivery orders"]},nxe={terminalBlocked:{title:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸¹à¹à¸à¹à¹à¸à¹à¸«à¸¡à¸ Terminal","Not available in Terminal mode"],detail:["à¸à¹à¸à¸¡à¸¹à¸¥à¸¢à¸à¸à¸à¸²à¸¢à¸à¸à¸à¸£à¹à¸²à¸à¸à¸¹à¹à¸à¹à¹à¸à¸à¸²à¸°à¹à¸à¸£à¸·à¹à¸à¸à¹à¸à¸à¹à¸à¸µà¸¢à¸£à¹à¹à¸à¹à¸²à¸à¸±à¹à¸","Shop sales data is only available on the cashier terminal"]},nav:{title:["à¹à¸à¸à¸à¸à¸£à¹à¸","Dashboard"],actions:["Actions","Actions"],receipts:["à¹à¸à¹à¸ªà¸£à¹à¸ (à¸à¸³à¸£à¸°à¹à¸¥à¹à¸§)","Receipts"],liveBilling:["สิà¸à¸à¹à¸²à¸£à¸à¸à¸³à¸£à¸°","Live Billing"],summary:["สรุà¸à¸¢à¸à¸à¸à¸²à¸¢ (à¸à¸³à¸£à¸°à¹à¸¥à¹à¸§)","Summary"],productType:["ยà¸à¸à¸à¸²à¸¡à¸à¸¥à¸¸à¹à¸¡à¸ªà¸´à¸à¸à¹à¸²","Sales by Group"],products:["สิà¸à¸à¹à¸²à¸à¸²à¸¢ (à¸à¸³à¸£à¸°à¹à¸¥à¹à¸§)","Products"],voidedItems:["สิà¸à¸à¹à¸²à¸¢à¸à¹à¸¥à¸´à¸","Voided Items"]},actions:{header:["Actions","Actions"],drawer:{label:["ลิà¹à¸à¸à¸±à¸à¹à¸à¹à¸à¹à¸à¸´à¸","Drawer"],desc:["à¹à¸à¸´à¸à¸¥à¸´à¹à¸à¸à¸±à¸à¹à¸à¹à¸à¹à¸à¸´à¸à¹à¸à¸¢à¹à¸¡à¹à¸à¸à¸à¹à¸à¹à¸ªà¸£à¹à¸","Open the cash drawer without a receipt."]},changeShift:{label:["à¹à¸à¸¥à¸µà¹à¸¢à¸à¸à¸°","Change Shift"],desc:["à¸à¸´à¸à¸à¸°à¸à¸±à¸à¸à¸¸à¸à¸±à¸ à¸à¸´à¸¡à¸à¹à¸ªà¸£à¸¸à¸à¸¢à¸à¸ à¹à¸¥à¹à¸§à¹à¸£à¸´à¹à¸¡à¸à¸°à¸à¸±à¸à¹à¸","Close the current shift, print its summary, start the next."],done:["à¹à¸à¸¥à¸µà¹à¸¢à¸à¸à¸°à¹à¸¥à¹à¸§","Shift changed"]},reload:{label:["à¹à¸«à¸¥à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸«à¸¡à¹","Reload Data"],desc:["à¸à¸¶à¸à¹à¸à¹à¸ªà¸£à¹à¸à¹à¸¥à¸°à¹à¸¡à¸à¸¹à¸¥à¹à¸²à¸ªà¸¸à¸à¸à¸²à¸à¹à¸à¸´à¸£à¹à¸à¹à¸§à¸à¸£à¹","Pull latest receipts & menu from the server."]},changeMode:{label:["à¹à¸à¸¥à¸µà¹à¸¢à¸à¹à¸«à¸¡à¸","Change Mode"],desc:["สลัà¸à¹à¸«à¸¡à¸à¸à¸²à¸£à¸à¸³à¸à¸²à¸ POS (Cashier / Terminal / ฯลฯ)","Switch POS run mode (Cashier / Terminal / etc)."]},printSummary:{label:["à¸à¸´à¸¡à¸à¹à¸ªà¸£à¸¸à¸à¸¢à¸à¸","Print Summary"],desc:["à¸à¸´à¸¡à¸à¹à¸£à¸²à¸¢à¸à¸²à¸à¸ªà¸£à¸¸à¸à¸¢à¸à¸à¸à¸´à¸à¸à¸°","Print end-of-shift summary report."]},reloadOk:["à¹à¸«à¸¥à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸«à¸¡à¹à¹à¸¥à¹à¸§","Reloaded"],reloadFailTitle:["à¹à¸«à¸¥à¸à¹à¸¡à¹à¸ªà¸³à¹à¸£à¹à¸","Reload failed"],reloadFailText:["à¹à¸ªà¸à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸à¹à¸à¸£à¸·à¹à¸à¸ (local)","Showing local data"]},activity:{title:["à¸à¸±à¸à¸à¸¶à¸à¸à¸£à¸°à¸§à¸±à¸à¸´à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸","Activity L
163og"],table:["à¹à¸à¹à¸°","Table"],allTables:["à¸à¸¸à¸à¹à¸à¹à¸° ({count})","All tables ({count})"],action:["Action","Action"],allActions:["All actions","All actions"],clear:["ลà¹à¸²à¸","Clear"],previous:["à¸à¹à¸à¸à¸«à¸à¹à¸²","Previous"],next:["à¸à¸±à¸à¹à¸","Next"],pageRange:["{from}â{to} à¸à¸²à¸","{from}â{to} of"],reload:["Reload","Reload"],cols:{time:["à¹à¸§à¸¥à¸²","Time"],table:["à¹à¸à¹à¸°","Table"],action:["Action","Action"],message:["รายละà¹à¸à¸µà¸¢à¸","Message"],value:["มูลà¸à¹à¸²","Value"],by:["à¹à¸à¸¢","By"]},loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸...","Loading..."],empty:["à¹à¸¡à¹à¸¡à¸µà¸à¸´à¸à¸à¸£à¸£à¸¡à¸à¸µà¹à¸à¸£à¸à¸à¸±à¸à¸à¸±à¸§à¸à¸£à¸à¸à¸à¸±à¸à¸à¸¸à¸à¸±à¸","No activity matches the current filters."],emptyForTable:["{table} : à¹à¸¡à¹à¸à¸à¸£à¸²à¸¢à¸à¸²à¸£","{table} : No records found"],clearFilter:["ลà¹à¸²à¸à¸à¸±à¸§à¸à¸£à¸à¸","Clear filter"]},common:{noData:["à¹à¸¡à¹à¸¡à¸µà¸à¹à¸à¸¡à¸¹à¸¥","NO DATA"],reload:["à¹à¸«à¸¥à¸à¹à¸«à¸¡à¹","Reload"],reloading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸â¦","Reloadingâ¦"],reloadTitle:["à¹à¸«à¸¥à¸à¹à¸à¹à¸ªà¸£à¹à¸à¹à¸«à¸¡à¹","Reload receipts"]},receipts:{title:["à¹à¸à¹à¸ªà¸£à¹à¸","Receipts"],showReceiptId:["à¹à¸ªà¸à¸à¸£à¸«à¸±à¸ªà¹à¸à¹à¸ªà¸£à¹à¸","Show Receipt ID"],countInfo:["({total} à¸à¸´à¸¥, ยà¸à¹à¸¥à¸´à¸ {voided} à¸à¸´à¸¥)","({total} bills, Void {voided} bills)"],shift:["à¸à¸°","Shift"],cashier:["à¹à¸à¸à¹à¸à¸µà¸¢à¸£à¹","Cashier"],cols:{no:["ลำà¸à¸±à¸","No."],receiptId:["รหัสà¹à¸à¹à¸ªà¸£à¹à¸","Receipt ID"],dateTime:["วัà¸à¹à¸§à¸¥à¸²","DateTime"],table:["à¹à¸à¹à¸°","Table"],grandTotal:["ยà¸à¸à¸£à¸§à¸¡","Grand Total"],payments:["à¸à¸²à¸£à¸à¸³à¸£à¸°à¹à¸à¸´à¸","Payments"],shift:["à¸à¸°","Shift"],by:["à¹à¸à¸¢","By"]},view:["à¸à¸¹","View"],void:["ยà¸à¹à¸¥à¸´à¸","Void"],offline:["à¸à¸à¸à¹à¸¥à¸à¹","Offline"],voided:["ยà¸à¹à¸¥à¸´à¸à¹à¸¥à¹à¸§","Voided"],reasonPrefix:["à¹à¸«à¸à¸¸à¸à¸¥: {reason}","Reason: {reason}"],noReason:["à¹à¸¡à¹à¹à¸à¹à¸£à¸°à¸à¸¸à¹à¸«à¸à¸¸à¸à¸¥","no reason provided"],swal:{voidTitle:["ยà¸à¹à¸¥à¸´à¸à¹à¸à¹à¸ªà¸£à¹à¸à¸à¸µà¹?","Void this receipt?"],reasonPlaceholder:["à¹à¸«à¸à¸¸à¸à¸¥","Reason"],voidConfirm:["ยà¸à¹à¸¥à¸´à¸","Void"],voided:["ยà¸à¹à¸¥à¸´à¸à¹à¸à¹à¸ªà¸£à¹à¸à¹à¸¥à¹à¸§","Receipt voided"],error:["à¹à¸à¸´à¸à¸à¹à¸à¸à¸´à¸à¸à¸¥à¸²à¸","Error"]}},liveBilling:{title:["à¸à¹à¸à¸¡à¸¹à¸¥à¸£à¸à¸à¸³à¸£à¸°à¸à¸±à¸à¸à¸¸à¸à¸±à¸","Live Data"],lastUpdate:["à¸à¸±à¸à¹à¸à¸à¸¥à¹à¸²à¸ªà¸¸à¸ · {time}","last update · {time}"],paid:["à¸à¸³à¸£à¸°à¹à¸¥à¹à¸§ {amount} · {bills} à¸à¸´à¸¥","Paid {amount} · {bills} bills"],liveTables:["à¹à¸à¹à¸°à¸à¸µà¹à¹à¸à¸´à¸à¸à¸¢à¸¹à¹","Live Tables"],liveTogo:["TOGO à¸à¸·à¹à¸à¸à¸¥à¸±à¸à¸à¸µà¹à¹à¸à¸´à¸à¸à¸¢à¸¹à¹","Live Togo"],liveDelivery:["à¹à¸à¸¥à¸´à¹à¸§à¸à¸£à¸µà¸à¸µà¹à¹à¸à¸´à¸à¸à¸¢à¸¹à¹","Live Delivery"],subTables:["{count} à¹à¸à¹à¸° · {guests} ลูà¸à¸à¹à¸² · {items} รายà¸à¸²à¸£","{count} open · {guests} guests · {items} items"],subTablesNoGuests:["{count} à¹à¸à¹à¸° · {items} รายà¸à¸²à¸£","{count} open · {items} items"],subOrders:["{count} à¸à¸à¹à¸à¸à¸£à¹ · {items} รายà¸à¸²à¸£","{count} orders · {items} items"],sum:["รวม","SUM"],sumSub:["{items} รายà¸à¸²à¸£ à¸à¸²à¸ {tickets} à¸à¸´à¸¥","{items} items across {tickets} tickets"]},summary:{title:["สรุà¸à¸¢à¸à¸","Summary"],summaryAll:["สรุà¸à¸à¸±à¹à¸à¸«à¸¡à¸","Summary All"],productTypeArray:["ยà¸à¸à¸à¸²à¸¡à¸à¸£à¸°à¹à¸ à¸à¸ªà¸´à¸à¸à¹à¸²","Product Type Array"],billingSummary:["สรุà¸à¸à¸²à¸£à¹à¸£à¸µà¸¢à¸à¹à¸à¹à¸à¹à¸à¸´à¸","Billing Summary"],noProductData:["à¹à¸¡à¹à¸¡à¸µà¸à¹à¸à¸¡à¸¹à¸¥à¸ªà¸´à¸à¸à¹à¸²","No product data"],bills:["({count} à¸à¸´à¸¥)","({count} bills)"],guestCount:["(ลูà¸à¸à¹à¸² {count})","(Guest : {count})"],grandTotal:["ยà¸à¸à¸£à¸§à¸¡à¸à¸±à¹à¸à¸ªà¸´à¹à¸","Grand Total"],voidBills:["à¸à¸´à¸¥à¸à¸µà¹à¸¢à¸à¹à¸¥à¸´à¸","Void Bills"],detail:["รายละà¹à¸à¸µà¸¢à¸","Detail"],byShift:["à¸à¸²à¸¡à¸à¸°","By Shift"],byCashier:["à¸à¸²à¸¡à¹à¸à¸à¹à¸à¸µà¸¢à¸£à¹","By Cashier"],byPaymentType:["à¸à¸²à¸¡à¸à¸£à¸°à¹à¸ à¸à¸à¸²à¸£à¸à¸³à¸£à¸°","By Payment Type"],byLabel:["à¸à¸²à¸¡{mode}","By {mode}"],seg:{type:["à¸à¸£à¸°à¹à¸ à¸","Type"],group:["à¸à¸¥à¸¸à¹à¸¡","Group"]},rows:{customer:["ลูà¸à¸à¹à¸²","Customer"],total:["ยà¸à¸à¸£à¸§à¸¡","Total"],discountItems:["สà¹à¸§à¸à¸¥à¸à¸ªà¸´à¸à¸à¹à¸²","Discount Items"],service:["à¸à¹à¸²à¸à¸£à¸´à¸à¸²à¸£","Service"],discountBill:["สà¹à¸§à¸à¸¥à¸à¸à¹à¸²à¸¢à¸à¸´à¸¥","Addtional Discount"],cardCharge:["à¸à¹à¸²à¸à¸£à¸£à¸¡à¹à¸à¸µà¸¢à¸¡à¸à¸±à¸à¸£","CreditCard Charge"],vat:["VAT","VAT"],vatExclusive:["VAT (à¹à¸¢à¸à¸à¸à¸)","VAT (Exclusive)"],vatInclusive:["VAT (รวมà¹à¸)","VAT (Inclusive)"],rounding:["à¸à¸±à¸à¹à¸¨à¸©","Rounding"]}},productType:{title:["ยà¸à¸à¸à¸²à¸¡à¸à¸¥à¸¸à¹à¸¡à¸ªà¸´à¸à¸à¹à¸²","Sales by Group"],productTypeArray:["ยà¸à¸à¸à¸²à¸¡à¸à¸£à¸°à¹à¸ à¸à¸ªà¸´à¸à¸à¹à¸²","Product Type Array"]},products:{title:["สิà¸à¸à¹à¸²à¸à¸²à¸¡à¸à¸¥à¸¸à¹à¸¡","Products by Group"],group:["à¸à¸¥à¸¸à¹à¸¡","Group"],all:["à¸à¸±à¹à¸à¸«à¸¡à¸","All"],cols:{no:["ลำà¸à¸±à¸","No."],name:["à¸à¸·à¹à¸à¸ªà¸´à¸à¸à¹à¸²","Name"],qty:["à¸à¸³à¸à¸§à¸","Qty"],total:["ยà¸à¸à¹à¸à¹à¸¡","Extended<br/> rice"],discount:["สà¹à¸§à¸à¸¥à¸","Discount<br/>Items"],net:["ยà¸à¸à¸ªà¸¸à¸à¸à¸´","Sold<br/>Amount"],percent:["% รวม","% of Total"]},tips:{total:["ยà¸à¸à¹à¸à¹à¸¡à¸à¹à¸à¸à¸«à¸±à¸à¸ªà¹à¸§à¸à¸¥à¸ = à¸à¸³à¸à¸§à¸ à ราà¸à¸²à¸à¹à¸à¸«à¸à¹à¸§à¸¢","Full amount before discount = Quantity à Price"],discount:["ยà¸à¸à¸ªà¹à¸§à¸à¸¥à¸à¸à¸µà¹à¸«à¸±à¸à¸à¸²à¸à¸£à¸²à¸¢à¸à¸²à¸£à¸ªà¸´à¸à¸à¹à¸² (à¹à¸ªà¸à¸à¹à¸à¹à¸à¸à¹à¸²à¸à¸´à¸à¸¥à¸)","Item-level discount deducted (shown as a negative value)"],net:["ยà¸à¸à¸ªà¸¸à¸à¸à¸´à¸«à¸¥à¸±à¸à¸«à¸±à¸à¸ªà¹à¸§à¸à¸¥à¸à¹à¸¥à¹à¸§ = ยà¸à¸à¹à¸à¹à¸¡ â สà¹à¸§à¸à¸¥à¸","Net amount after discount = Total â Discount"]}},voids:{title:["รายà¸à¸²à¸£à¸à¸µà¹à¸¢à¸à¹à¸¥à¸´à¸","Voided Items"],cols:{time:["à¹à¸§à¸¥à¸²","Time"],qty:["à¸à¸³à¸à¸§à¸","Qty"],product:["สิà¸à¸à¹à¸²","Product"],table:["à¹à¸à¹à¸°","Table"],by:["à¹à¸à¸¢","By"],reason:["à¹à¸«à¸à¸¸à¸à¸¥","Reason"],amount:["มูลà¸à¹à¸²","Amount"]}},endOfDay:{section:["สิà¹à¸à¸§à¸±à¸","End of day"],closeShop:["à¸à¸´à¸à¸£à¹à¸²à¸ | Close Shop","Close Shop | à¸à¸´à¸à¸£à¹à¸²à¸"],closeShopDesc:["à¸à¸£à¸°à¸à¸à¸¢à¸à¸à¹à¸à¸´à¸à¸ªà¸ à¸à¸´à¸à¸à¸¸à¸à¸à¸° à¸à¸´à¸¡à¸à¹à¸ªà¸£à¸¸à¸à¸¢à¸à¸à¸ªà¸¸à¸à¸à¹à¸²à¸¢","Reconcile cash, close all shifts, print final summary."],closeShopHint:["à¸à¸à¸à¸£à¸±à¹à¸à¹à¸à¸µà¸¢à¸§à¹à¸¡à¸·à¹à¸à¸ªà¸´à¹à¸à¸§à¸±à¸","Click once at end of day."]}},rxe={tableTag:["· à¹à¸à¹à¸° {name}","· Table {name}"],noteOptional:["หมายà¹à¸«à¸à¸¸ (à¹à¸¡à¹à¸à¸±à¸à¸à¸±à¸)","Note (optional)"],notePlaceholder:["à¹à¸ªà¹à¸«à¸¡à¸²à¸¢à¹à¸«à¸à¸¸à¸ªà¸³à¸«à¸£à¸±à¸à¸à¸´à¸¥à¸à¸µà¹...","Add a comment for this bill..."],roomOptional:["ROOM (à¹à¸¡à¹à¸à¸±à¸à¸à¸±à¸)","ROOM (optional)"],roomPlaceholder:["à¹à¸ªà¹à¸«à¸¡à¸²à¸¢à¹à¸¥à¸à¸«à¹à¸à¸","Enter Room Number"],modal:{title:["à¸à¸³à¸£à¸°à¹à¸à¸´à¸","Payment"],items:["รายà¸à¸²à¸£","Items"],totalDue:["ยà¸à¸à¸à¸µà¹à¸à¹à¸à¸à¸à¸³à¸£à¸°","Total Due"],received:["รัà¸à¹à¸à¸´à¸","Received"],short:["à¸à¸²à¸","Short"],exact:["รัà¸à¸à¸à¸à¸µ","Exact"],change:["à¹à¸à¸´à¸à¸à¸à¸","Change"],paymentMethod:["à¸à¹à¸à¸à¸à¸²à¸à¸à¸²à¸£à¸à¸³à¸£à¸°à¹à¸à¸´à¸","Payment Method"],splitMultiple:["Multiple Payment","Multiple Payment"],cashReceived:["à¹à¸à¸´à¸à¸ªà¸à¸à¸µà¹à¸£à¸±à¸","Cash Received"],amount:["à¸à¸³à¸à¸§à¸à¹à¸à¸´à¸","Amount"],nonCashHint:["รายà¸à¸²à¸£à¹à¸¡à¹à¹à¸à¹à¹à¸à¸´à¸à¸ªà¸à¸à¸°à¹à¸à¹à¸¢à¸à¸à¸à¸à¸à¸µà¹à¸à¹à¸à¸à¹à¸²à¹à¸£à¸´à¹à¸¡à¸à¹à¸ à¸à¸´à¸¡à¸à¹à¸«à¸£à¸·à¸à¹à¸à¹à¹à¸à¹à¸à¸à¸±à¸§à¹à¸¥à¸à¹à¸à¸·à¹à¸à¹à¸à¹à¹à¸","Non-cash defaults to exact amount. Type or use the keypad to override."],pay:["à¸à¸³à¸£à¸°","Pay"],copyReceipt:["à¸à¸´à¸¡à¸à¹à¹à¸à¹à¸ªà¸£à¹à¸ Copy","Copy receipt"],pressPrefix:["à¸à¸","Press"],paySuffix:["à¹à¸à¸·à¹à¸à¸à¸³à¸£à¸°","to pay"]},multi:{title:["à¸à¸³à¸£à¸°à¹à¸à¸´à¸à¸«à¸¥à¸²à¸¢à¸£à¸²à¸¢à¸à¸²à¸£ | Multiple Payment","Multiple Payment"],total:["ยà¸à¸à¸£à¸§à¸¡","Total"],allocated:["มียà¸à¸à¹à¸¥à¹à¸§","Allocated"],of:["à¸à¸²à¸ {total}","of {total}"],balanced:["à¸à¸£à¸à¸à¸à¸à¸µ","Balanced"],overBy:["à¹à¸à¸´à¸à¸¡à¸²","Over by"],change:["à¹à¸à¸´à¸à¸à¸à¸","Change"],nonCashOverBy:["ยà¸à¸à¸à¸µà¹à¹à¸¡à¹à¹à¸à¹à¹à¸à¸´à¸à¸ªà¸à¹à¸à¸´à¸à¸¡à¸²","Non-cash over by"],remaining:["à¸à¸à¹à¸«à¸¥à¸·à¸","Remaining"],paymentType:["à¸à¸£à¸°à¹à¸ à¸à¸à¸²à¸£à¸à¸³à¸£à¸°","Payment Type"],entertainNotAvailable:["* à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸³à¸£à¸°à¸à¹à¸§à¸¢à¸à¸£à¸°à¹à¸ ภEntertain à¹à¸à¹à¸«à¸¡à¸à¸à¸³à¸£à¸°à¸«à¸¥à¸²à¸¢à¸£à¸²à¸¢à¸à¸²à¸£à¹à¸à¹","* Entertain payment types are not available in Multiple Payment mode"],receive:["รัà¸à¹à¸à¸´à¸","Receive"],addPayment:["à¹à¸à¸´à¹à¸¡à¸à¸²à¸£à¸à¸³à¸£à¸°","Add payment"],fillRemaining:["à¹à¸à¸´à¸¡à¸¢à¸à¸à¸à¸à¹à¸«à¸¥à¸·à¸ {amount} ลà¸à¹à¸à¹à¸à¸§à¸à¸µà¹à¹à¸¥à¸·à¸à¸","Fill remaining {amount} into focused row"],footerCount:["{count} รายà¸à¸²à¸£à¸à¸³à¸£à¸°","{count} payments"],submit:["ยืà¸à¸¢à¸±à¸","Submit"],errors:{typeUsed:["à¹à¸à¸´à¸à¸ªà¸à¹à¸ªà¹à¹à¸à¹à¹à¸à¸µà¸¢à¸à¸£à¸²à¸¢à¸à¸²à¸£à¹à¸à¸µà¸¢à¸§ à¸à¸£à¸¸à¸à¸²à¹à¸¥à¸·à¸à¸à¸à¸£à¸°à¹à¸ à¸à¸à¸·à¹à¸","Cash can only be used once. Please choose another type."],allUsed:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¸´à¹à¸¡à¸£à¸²à¸¢à¸à¸²à¸£à¸à¸³à¸£à¸°à¹à¸à¹à¸à¸µà¸","No more payment lines can be added."]}},resultEmail:{title:["à¸à¸¥à¸à¸²à¸£à¸à¸³à¸£à¸°à¹à¸à¸´à¸","Payment Result"],subtitle:["ระà¸à¸à¹à¸à¹à¸£à¸±à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸²à¸£à¸à¸³à¸£à¸°à¸à¸à¸à¸à¸¸à¸à¹à¸¥à¹à¸§","We have received your payment information"],cardHeader:["à¹à¸à¹à¸à¸à¸²à¸£à¹à¸à¸à¸à¹à¸²à¸à¸à¸à¸²à¸à¸²à¸£","Bank Transfer Notification"],statusBadge:["สà¹à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸ªà¸³à¹à¸£à¹à¸","Submitted successfully"],message:["à¹à¸£à¸²à¹à¸à¹à¸£à¸±à¸à¸à¹à¸à¸à¸§à¸²à¸¡à¸à¸à¸à¸à¸¸à¸à¹à¸¥à¹à¸§","We have received your message"],detail:["à¹à¸£à¸²à¸à¸°à¸à¸³à¸à¸²à¸£à¸à¸£à¸§à¸à¸ªà¸à¸à¹à¸¥à¸°à¸à¸±à¸à¹à¸à¸à¸à¸±à¸à¸à¸µà¸à¸µà¹à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸¹à¸à¸à¹à¸à¸","We will review and update as soon as the data is verified"],note:["(à¸à¸²à¸à¹à¸à¹à¹à¸§à¸¥à¸² 48 à¸à¸¡.)","(may take up to 48 hours)"],callout:["หาà¸à¹à¸¡à¹à¹à¸à¹à¸£à¸±à¸à¸à¸²à¸£à¸à¸±à¸à¹à¸à¸à¸ ายà¹à¸ 48 à¸à¸±à¹à¸§à¹à¸¡à¸ à¸à¸£à¸¸à¸à¸²à¸à¸´à¸à¸à¹à¸à¸à¸µà¸¡à¸à¸²à¸ Niceloop","If you do not receive an update within 48 hours, please contact the Niceloop team"]}}
163,sxe={selectTable:["à¹à¸¥à¸·à¸à¸à¹à¸à¹à¸°","Select a table"],primary:{add:["à¹à¸à¸´à¹à¸¡","Add"],quickAdd:["à¹à¸à¸´à¹à¸¡à¸à¹à¸§à¸ ({count})","Quick Add ({count})"],clickToUnlock:["à¸à¸à¹à¸à¸·à¹à¸à¸à¸¥à¸à¸¥à¹à¸à¸","Click to Unlock"],jobCannotAdd:["JOB à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¸´à¹à¸¡à¸£à¸²à¸¢à¸à¸²à¸£à¹à¸à¹","JOB cannot add items"],lockedTooltip:["à¹à¸à¹à¸°à¸à¸¹à¸à¸¥à¹à¸à¸ â à¸à¸à¹à¸à¸·à¹à¸à¸à¸¥à¸à¸¥à¹à¸à¸","Table is locked â click to unlock"]},toggle:{items:["รายà¸à¸²à¸£","Items"],billing:["สรุà¸à¸¢à¸à¸à¸à¸´à¸¥","Billing"]},headerDisplay:{title:["à¹à¸ªà¸à¸à¸à¸¥","Display"],grandTotal:["ยà¸à¸à¸£à¸§à¸¡","Grand Total"],time:["à¹à¸§à¸¥à¸²","Time"],guests:["à¸à¸³à¸à¸§à¸à¸¥à¸¹à¸à¸à¹à¸²","Guests"],billingSummary:["สรุà¸à¸à¸´à¸¥","Billing Summary"]},billingSummary:{items:["รายà¸à¸²à¸£","Items"],serviceCharge:["SC","SC"],discount:["สà¹à¸§à¸à¸¥à¸","Disc"],cardCharge:["CC","CC"],tax:["Tax","Tax"]},itemsTable:{product:["รายà¸à¸²à¸£","Product"],price:["ราà¸à¸²","Price"],total:["รวม","Total"],split:["à¹à¸¢à¸","Split"],bills:["หมายà¹à¸¥à¸à¸à¸´à¸¥","Bill Number"],noItems:["à¹à¸¡à¹à¸¡à¸µà¸£à¸²à¸¢à¸à¸²à¸£","No items"],splitItem:["à¹à¸¢à¸à¸ªà¸´à¸à¸à¹à¸²","Split item"],autoSelect:["à¹à¸¥à¸·à¸à¸","Select"]},splitBillLabel:["à¹à¸¢à¸à¸à¸´à¸¥:","Split Bill:"],exitSplitMode:["à¸à¸à¸à¸à¸²à¸à¹à¸«à¸¡à¸à¹à¸¢à¸à¸ªà¸´à¸à¸à¹à¸²","Exit split mode"],noCustomerData:["â à¹à¸¡à¹à¸¡à¸µà¸à¹à¸à¸¡à¸¹à¸¥à¸¥à¸¹à¸à¸à¹à¸² â","â No customer data â"],information:{title:["à¸à¹à¸à¸¡à¸¹à¸¥","Information"],startDateTime:["à¹à¸§à¸¥à¸²à¹à¸£à¸´à¹à¸¡","Start Date Time"],runningTime:["ระยะà¹à¸§à¸¥à¸²","Running Time"],timer:["Timer","Timer"],usedTime:["à¹à¸à¹à¹à¸§à¸¥à¸²à¹à¸¥à¹à¸§","Time Used"],guests:["à¸à¸³à¸à¸§à¸à¸¥à¸¹à¸à¸à¹à¸²","Guests"]},footer:{printPreview:["Print Preview","Print Preview"],payment:["Payment","Payment"]},sideActions:{discountItems:["ลà¸à¸£à¸²à¸à¸²à¸ªà¸´à¸à¸à¹à¸²","Discount Items"],lock:["ลà¹à¸à¸","Lock"],unlock:["à¸à¸¥à¸à¸¥à¹à¸à¸","Unlock"],move:["ยà¹à¸²à¸¢","Move"],setPrice:["à¸à¸³à¸«à¸à¸à¸£à¸²à¸à¸²","Set Price"],comment:["Comment","Comment"],splitItem:["à¹à¸¢à¸à¸ªà¸´à¸à¸à¹à¸²","Split Item"],exitSplit:["à¸à¸à¸à¸à¸²à¸à¹à¸«à¸¡à¸à¹à¸¢à¸","Exit Split"],splitBill:["à¹à¸¢à¸à¸à¸´à¸¥","SplitBill"],printTime:["à¸à¸´à¸¡à¸à¹à¹à¸§à¸¥à¸²","Print Time"],history:["à¸à¸£à¸°à¸§à¸±à¸à¸´","History"],voidItems:["ยà¸à¹à¸¥à¸´à¸à¸ªà¸´à¸à¸à¹à¸²","Void Items"]},terminalBlock:["à¸à¹à¸à¸à¸à¸³à¸à¹à¸²à¸à¹à¸à¸à¹à¸à¸µà¸¢à¸£à¹à¹à¸à¹à¸²à¸à¸±à¹à¸","Must be done at the cashier"],moveNotAllowed:["{mode} à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸¢à¹à¸²à¸¢à¹à¸à¹à¸°à¹à¸à¹","{mode} cannot be moved to a table"],terminalBillingBlock:["à¹à¸à¸£à¸·à¹à¸à¸ Terminal à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¹à¹à¸à¸à¹à¸²à¹à¸à¹","Terminal devices cannot edit billing values"],lockedAlert:{title:["à¹à¸à¹à¸°à¸à¸¹à¸à¸¥à¹à¸à¸à¸à¸¢à¸¹à¹","Table is locked"],text:["à¸à¸£à¸¸à¸à¸²à¸à¸à¸à¸¥à¸à¸¥à¹à¸à¸à¸à¹à¸à¸ à¸à¸¶à¸à¸à¸°à¹à¸à¹à¸à¸²à¸à¹à¸¡à¸à¸¹à¸à¸µà¹à¹à¸à¹","Please unlock the table first to use this action"]},billing:{title:["à¸à¸´à¸¥","Billing"],override:["à¸à¸³à¸«à¸à¸à¹à¸à¸","Override"],fixed:["à¸à¸à¸à¸µà¹","Fixed"],excludeNoDiscount:["With Condition","With Condition"],subTotal:["SubTotal","SubTotal"],itemsDiscount:["Items Discount","Items Discount"],serviceCharge:["Service Charge","Service Charge"],additionalDiscount:["Additional Discount","Additional Discount"],cardCharge:["Card Charge","Card Charge"],vat:["VAT","VAT"],rounding:["Rounding","Rounding"],grandTotal:["Grand Total","Grand Total"]},productList:{discount:["(-{value})","(-{value})"]},modals:{printShift:{title:["à¹à¸à¹à¸° {table}","Table {table}"],labels:{date:["วัà¸à¸à¸µà¹","Date"],start:["à¹à¸£à¸´à¹à¸¡","Start"],length:["ระยะà¹à¸§à¸¥à¸²","Length"],end:["สิà¹à¸à¸ªà¸¸à¸","End"],note:["หมายà¹à¸«à¸à¸¸","Note"]},editTime:["à¹à¸à¹à¹à¸à¹à¸§à¸¥à¸²","Edit time"],changePlaceholder:["à¸à¸£à¸±à¸","Change"],minutes:["{value} à¸à¸²à¸à¸µ","{value} minutes"],timeValue:["{time} à¸.","{time}"],saved:["สำà¹à¸£à¹à¸à¹à¸¥à¹à¸§","Saved"]}}},ixe={tabs:G1e,placeholder:K1e,reports:z1e,cart:Y1e,modals:J1e,editBill:Q1e,deliveryForm:X1e,togo:Z1e,job:exe,delivery:txe,dash:nxe,payment:rxe,tableInstance:sxe},oxe={menu:["à¹à¸¡à¸à¸¹","Menu"],topping:["Topping","Topping"],tag:["à¹à¸à¹à¸","Tag"],comment:["หมายà¹à¸«à¸à¸¸","Comment"],combo:["à¸à¸¸à¸à¸à¸à¸¡à¹à¸","Combo"]},axe={tabs:oxe},cxe={title:["Stock â à¹à¸à¹à¸²à¸ªà¸¹à¹à¸£à¸°à¸à¸","Stock â Sign In"],subtitle:["à¸à¸£à¸à¸ PIN à¹à¸à¹à¸²à¸«à¸à¹à¸²à¸à¸µà¹à¸ªà¸à¹à¸à¸à¹à¸à¸·à¹à¸à¹à¸à¹à¸²à¹à¸à¹à¸à¸²à¸","Enter the stock staff PIN to continue"],submit:["à¹à¸à¹à¸²à¸ªà¸¹à¹à¸£à¸°à¸à¸","Sign In"],wrongPin:["PIN à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸","Incorrect PIN"]},lxe={noPermission:["à¹à¸¡à¹à¸¡à¸µà¸ªà¸´à¸à¸à¸´à¹à¹à¸à¹à¸²à¸à¸¶à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸µà¹","You don't have permission to access this data"],noPermissionTab:["à¸à¸±à¸à¸à¸µà¸à¸µà¹à¹à¸¡à¹à¹à¸à¹à¸£à¸±à¸à¸ªà¸´à¸à¸à¸´à¹à¹à¸«à¹à¸à¸¹à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸à¹à¸à¹à¸ â{label}â","This account is not permitted to view the â{label}â tab"],contactAdmin:["à¸à¸£à¸¸à¸à¸²à¸ªà¸¥à¸±à¸à¸à¸¹à¹à¹à¸à¹ หรืà¸à¸à¸´à¸à¸à¹à¸à¸à¸¹à¹à¸à¸¹à¹à¸¥à¹à¸à¸·à¹à¸à¸à¸à¸ªà¸´à¸à¸à¸´à¹à¸à¸²à¸£à¹à¸à¹à¸²à¸à¸¶à¸","Please switch user or contact your administrator for access"]},uxe={stock:["สà¸à¹à¸à¸","Stock"],history:["à¸à¸£à¸°à¸§à¸±à¸à¸´","History"],summary:["สรุà¸","Summary"],formula:["สูà¸à¸£à¸à¸±à¸à¸ªà¸à¹à¸à¸","Formula"],toppingFormula:["สูà¸à¸£à¸à¸±à¸à¸ªà¸à¹à¸à¸ Topping","Topping Stock Formula"],stockUsage:["สà¸à¹à¸à¸ â à¹à¸¡à¸à¸¹à¸à¸µà¹à¹à¸à¹","Stock Usage"],addAdjust:["à¹à¸à¸´à¹à¸¡ / à¸à¸£à¸±à¸à¸à¸£à¸¸à¸","Add / Adjust"]},dxe={title:["à¹à¸à¸´à¹à¸¡à¸ªà¸à¹à¸à¸ à¹à¸«à¸¡à¹","Add New Stock"],exampleData:["à¸à¸±à¸§à¸à¸¢à¹à¸²à¸à¸à¹à¸à¸¡à¸¹à¸¥","Example data"],exampleName1:["Coke ลิà¸à¸£ (à¸à¸±à¸§à¸à¸¢à¹à¸²à¸)","Coke Liter (example)"],exampleUnit1:["à¸à¸§à¸","Bottle"],exampleName2:["à¸à¸¥à¸²à¹à¸à¸¥à¸¡à¸à¸à¸à¸´à¸ (à¸à¸±à¸§à¸à¸¢à¹à¸²à¸)","Raw Salmon (example)"],exampleUnit2:["à¸à¸£à¸±à¸¡","Gram"],validatePrompt:["à¹à¸ªà¹à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸à¸à¸²à¸£à¸²à¸ à¹à¸¥à¹à¸§à¸à¸£à¸§à¸à¸ªà¸à¸à¸à¸µà¹à¸à¸µà¹","Enter data in the table, then verify here"],found:["à¸à¸à¸à¹à¸à¸¡à¸¹à¸¥ {n} รายà¸à¸²à¸£","Found {n} items"],colName:["à¸à¸·à¹à¸à¸ªà¸à¹à¸à¸à¸ªà¸´à¸à¸à¹à¸²","Stock name"],colUnit:["หà¸à¹à¸§à¸¢","Unit"],colSellingUnit:["หà¸à¹à¸§à¸¢à¸à¸µà¹à¸à¸²à¸¢","Selling unit"],noData:["à¹à¸¡à¹à¸à¸à¸à¹à¸à¸¡à¸¹à¸¥ â à¸à¸£à¸¸à¸à¸²à¹à¸ªà¹à¸à¸·à¹à¸à¸ªà¸à¹à¸à¸à¹à¸à¸à¸²à¸£à¸²à¸","No data â please enter stock names in the table"],save:["à¸à¸±à¸à¸à¸¶à¸à¸£à¸²à¸¢à¸à¸²à¸£à¸ªà¸à¹à¸à¸à¹à¸«à¸¡à¹","Save new stock items"],savedCount:["à¸à¸±à¸à¸à¸¶à¸à¸ªà¸³à¹à¸£à¹à¸ {n} รายà¸à¸²à¸£ â","Saved {n} items â"]},hxe={add:["à¹à¸à¸´à¹à¸¡à¸ªà¸à¹à¸à¸à¹à¸«à¸¡à¹","Add New Stock"],edit:["à¹à¸à¹à¹à¸","Edit"],sort:["à¹à¸£à¸µà¸¢à¸","Sort"],changeGroup:["à¹à¸à¸¥à¸µà¹à¸¢à¸à¸à¸¥à¸¸à¹à¸¡","Change Group"],allGroups:["à¸à¸¥à¸¸à¹à¸¡à¸à¸±à¹à¸à¸«à¸¡à¸","All Groups"],delete:["ลà¸","Delete"],newGroupPlaceholder:["à¸à¸·à¹à¸à¸à¸¥à¸¸à¹à¸¡à¹à¸«à¸¡à¹","New group name"],viewTransactions:["à¸à¸¹à¸£à¸²à¸¢à¸à¸²à¸£à¹à¸à¸¥à¸·à¹à¸à¸à¹à¸«à¸§","View Transactions"]},fxe={grid:{group:["à¸à¸¥à¸¸à¹à¸¡","Group"],stockItem:["à¸à¸·à¹à¸à¸ªà¸à¹à¸à¸","Stock Item"],unit:["หà¸à¹à¸§à¸¢","Unit"],current:["à¸à¸à¹à¸«à¸¥à¸·à¸","Current"],amount:["à¸à¸³à¸à¸§à¸","Amount"],next:["ยà¸à¸à¹à¸«à¸¡à¹","New"],comment:["หมายà¹à¸«à¸à¸¸","Comment"],allGroups:["à¸à¸¸à¸à¸à¸¥à¸¸à¹à¸¡","All groups"],autosave:["à¹à¸
163à¹à¸à¸£à¹à¸²à¸à¹à¸¥à¹à¸§","Autosaved"],filledCount:["à¸à¸£à¸à¸à¹à¸§à¹ {count}","{count} filled"],edited:["รายà¸à¸²à¸£à¸à¸µà¹à¹à¸à¹à¹à¸","items edited"],showEstimate:["à¹à¸ªà¸à¸à¸¢à¸à¸à¹à¸«à¸¡à¹à¹à¸à¸¢à¸à¸£à¸°à¸¡à¸²à¸","Show estimate new value"]},mustBePositive:["à¸à¹à¸à¸à¹à¸à¹à¸à¸à¹à¸²à¸à¸§à¸ (มาà¸à¸à¸§à¹à¸² 0)","must be positive (greater than 0)"],invalidRows:["มี {count} à¹à¸à¸§à¸à¸µà¹à¸à¹à¸²à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸ â {label} à¸à¹à¸à¸à¹à¸à¹à¸à¸à¹à¸²à¸à¸§à¸ (มาà¸à¸à¸§à¹à¸² 0)","{count} rows have invalid values â {label} must be positive (greater than 0)"],successTitle:["{label} สำà¹à¸£à¹à¸","{label} successful"],successText:["à¸à¸±à¸à¸à¸¶à¸ {count} รายà¸à¸²à¸£à¹à¸£à¸µà¸¢à¸à¸£à¹à¸à¸¢à¹à¸¥à¹à¸§","Saved {count} items successfully"],help:{addTitle:["ADD / à¹à¸à¸´à¹à¸¡à¸ªà¸à¹à¸à¸","ADD / Add Stock"],addBody:["à¹à¸ªà¹à¸à¸³à¸à¸§à¸à¸à¸µà¹à¸à¹à¸à¸à¸à¸²à¸£à¹à¸à¸´à¹à¸¡ ระà¸à¸à¸à¸°à¸à¸§à¸à¹à¸à¹à¸²à¸à¸±à¸à¸¢à¸à¸à¸à¸à¹à¸«à¸¥à¸·à¸à¸à¸±à¸à¸à¸¸à¸à¸±à¸","Enter the amount to add; it will be added to the current balance"],adjustTitle:["ADJUST / à¸à¸£à¸±à¸à¸à¹à¸²","ADJUST / Adjust Value"],adjustBody:[`à¸à¸²à¸£à¸à¸£à¸±à¸à¹à¸«à¹à¹à¸ªà¹à¸à¸³à¸à¸§à¸ + หรืภâ à¸à¸²à¸à¸à¸³à¸à¸§à¸à¸à¸±à¸à¸à¸¸à¸à¸±à¸ 164à¹à¸à¹à¸ ยà¸à¸à¸à¸à¹à¸«à¸¥à¸·à¸ 10 à¸à¸§à¸ หาà¸à¸à¹à¸à¸à¸à¸²à¸£à¸à¸£à¸±à¸à¹à¸à¹à¸ 12 à¹à¸«à¹à¹à¸ªà¹ 2 165หาà¸à¸à¹à¸à¸à¸à¸²à¸£ à¸à¸£à¸±à¸à¹à¸à¹à¸ 8 à¹à¸«à¹à¹à¸ªà¹ â2`,`To adjust, enter a + or â amount relative to the current quantity 166E.g. balance is 10 bottles; to make it 12 enter 2 167To make it 8 enter â2`],withdrawTitle:["WITHDRAW / à¹à¸à¸´à¸à¸à¸à¸","WITHDRAW / Withdraw"],withdrawBody:["à¹à¸ªà¹à¸à¸³à¸à¸§à¸à¸à¸µà¹à¸à¹à¸à¸à¸à¸²à¸£à¹à¸à¸´à¸à¸à¸à¸ ระà¸à¸à¸à¸°à¸«à¸±à¸à¸à¸²à¸à¸¢à¸à¸à¸à¸à¹à¸«à¸¥à¸·à¸à¸à¸±à¸à¸à¸¸à¸à¸±à¸","Enter the amount to withdraw; it will be deducted from the current balance"]}},pxe={title:["สูà¸à¸£à¸à¸²à¸£à¸à¸±à¸ Stock â Topping","Stock Deduction Formula â Topping"],subtitle:["à¸à¸³à¸«à¸à¸à¸ªà¸¹à¸à¸£à¸à¸±à¸à¸ªà¸à¹à¸à¸à¸ªà¸³à¸«à¸£à¸±à¸à¹à¸à¹à¸¥à¸° topping à¹à¸¢à¸à¸à¸²à¸¡ Group","Define the stock deduction formula for each topping, grouped by Group"],loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸à¸à¹à¸à¸¡à¸¹à¸¥...","Loading data..."],noGroup:["ยัà¸à¹à¸¡à¹à¸¡à¸µ Topping Group","No Topping Group yet"],cutFormula:["สูà¸à¸£à¸à¸±à¸ Stock","Stock Deduction"],noToppingInGroup:["ยัà¸à¹à¸¡à¹à¸¡à¸µ topping à¹à¸ group à¸à¸µà¹","No topping in this group yet"],noFormula:["ยัà¸à¹à¸¡à¹à¸¡à¸µà¸ªà¸¹à¸à¸£","No formula yet"],addFormula:["à¹à¸à¸´à¹à¸¡à¸ªà¸¹à¸à¸£","Add Formula"],removeAllFormula:["ลà¸à¸ªà¸¹à¸à¸£à¸à¸±à¹à¸à¸«à¸¡à¸","Remove All Formulas"],modalTitle:["à¸à¸³à¸«à¸à¸à¸ªà¸¹à¸à¸£à¸ªà¸³à¸«à¸£à¸±à¸: {name}","Set formula for: {name}"],filterByGroup:["à¸à¸£à¸à¸à¸à¸²à¸¡à¸à¸¥à¸¸à¹à¸¡","Filter by group"],allGroups:["à¸à¸±à¹à¸à¸«à¸¡à¸","All"],noStockItem:["à¹à¸¡à¹à¸¡à¸µ stock item","No stock item"],selectedItems:["รายà¸à¸²à¸£à¸à¸µà¹à¹à¸¥à¸·à¸à¸","Selected items"],nameAmount:["à¸à¸·à¹à¸ / à¸à¸³à¸à¸§à¸","Name / Amount"],noSelected:["ยัà¸à¹à¸¡à¹à¸¡à¸µà¸£à¸²à¸¢à¸à¸²à¸£","No items yet"],selectAtLeastOne:["à¸à¸£à¸¸à¸à¸²à¹à¸¥à¸·à¸à¸ stock item à¸à¸¢à¹à¸²à¸à¸à¹à¸à¸¢ 1 รายà¸à¸²à¸£","Please select at least 1 stock item"],confirmRemoveFormula:["ลà¸à¸ªà¸¹à¸à¸£à¸à¸µà¹?","Remove this formula?"],confirmRemoveAllFormula:["ลà¸à¸ªà¸¹à¸à¸£à¸à¸±à¹à¸à¸«à¸¡à¸à¸à¸à¸ topping à¸à¸µà¹?","Remove all formulas of this topping?"],unnamed:["(ยัà¸à¹à¸¡à¹à¹à¸à¹à¸à¸±à¹à¸à¸à¸·à¹à¸)","(Unnamed topping)"]},mxe={searchStock:["à¸à¹à¸à¸«à¸²à¸ªà¸à¹à¸à¸","Search Stock"],searchPlaceholder:["à¸à¸´à¸¡à¸à¹à¸à¸·à¹à¸à¸ªà¸à¹à¸à¸à¸«à¸£à¸·à¸à¸à¸¥à¸¸à¹à¸¡","Stock or group name"],filterAll:["à¸à¸±à¹à¸à¸«à¸¡à¸","All"],filterUsed:["à¸à¸¹à¸à¹à¸à¹","In use"],filterUnused:["à¹à¸¡à¹à¸à¸¹à¸à¹à¸à¹","Unused"],loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸â¦","Loadingâ¦"],noStock:["à¹à¸¡à¹à¸à¸à¸ªà¸à¹à¸à¸","No stock found"],counter:["à¸à¸¹à¸à¹à¸à¹ {used} à¸à¸²à¸ {total} รายà¸à¸²à¸£","{used} of {total} stocks in use"],stock:["สà¸à¹à¸à¸","Stock"],usedBy:["à¹à¸¡à¸à¸¹à¸à¸µà¹à¹à¸à¹","Items using it"],noUsage:["ยัà¸à¹à¸¡à¹à¸¡à¸µà¹à¸¡à¸à¸¹à¹à¸«à¸à¹à¸à¹à¸ªà¸à¹à¸à¸à¸à¸µà¹","No item uses this
167stock yet"],selectStock:["à¹à¸¥à¸·à¸à¸à¸ªà¸à¹à¸à¸à¸à¸²à¸à¸à¹à¸²à¸¢","Select a stock"],topping:["Topping","Topping"],linkedPosCount:["à¸à¸¹à¸à¸à¸±à¸à¸ªà¸´à¸à¸à¹à¸² POS {count} รายà¸à¸²à¸£","Linked to {count} POS items"],linkedPosShort:["POS {count}","POS {count}"]},gxe={onlyMoves:["à¹à¸ªà¸à¸à¹à¸à¸à¸²à¸°à¸£à¸²à¸¢à¸à¸²à¸£à¸à¸µà¹à¹à¸à¸¥à¸·à¹à¸à¸à¹à¸«à¸§","Show only items with movement"]},_xe={allGroups:["à¸à¸¸à¸à¸à¸¥à¸¸à¹à¸¡","All groups"],baht:["à¸à¸²à¸","THB"],deleted:["à¸à¸¹à¸à¸¥à¸","Deleted"],stockDeleted:["สà¸à¹à¸à¸à¸à¸µà¹à¸à¸¹à¸à¸¥à¸à¹à¸à¹à¸¥à¹à¸§","This stock item has been deleted"],searchFormulaPlaceholder:["à¸à¹à¸à¸«à¸²à¸§à¸±à¸à¸à¸¸à¸à¸´à¸à¹à¸à¸ªà¸¹à¸à¸£â¦","Search ingredientâ¦"],noFormulaMatch:["à¹à¸¡à¹à¸¡à¸µà¹à¸¡à¸à¸¹à¹à¸«à¸à¹à¸à¹à¸§à¸±à¸à¸à¸¸à¸à¸´à¸à¸à¸µà¹à¸à¹à¸à¸«à¸²","No item uses an ingredient matching your search"]},yxe={date:["วัà¸à¸à¸µà¹","Date"],begin:["ยà¸à¸à¸à¹à¸","Begin"],end:["ยà¸à¸à¸à¸¥à¸²à¸¢","End"],movement:["à¹à¸à¸¥à¸·à¹à¸à¸à¹à¸«à¸§","Movement"],close:["à¸à¸´à¸","Close"]},vxe={lock:cxe,access:lxe,tabs:uxe,addNew:dxe,list:hxe,adjust:fxe,topping:pxe,stockUsage:mxe,summary:gxe,formula:_xe,logs:yxe},bxe={overview:["ภาà¸à¸£à¸§à¸¡","Overview"],manage:["à¸à¸±à¸à¸à¸²à¸£à¸«à¸¡à¸§à¸à¸à¹à¸²à¹à¸à¹à¸à¹à¸²à¸¢","Manage Expense Group"]},wxe={loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸...","Loading..."]},Sxe={title:["à¸à¸±à¸à¸à¸²à¸£à¸à¸£à¸°à¹à¸ à¸à¸£à¸²à¸¢à¸à¹à¸²à¸¢","Manage Expense Group"],help:{groupText:[" รายà¸à¹à¸²à¸¢à¸«à¸¥à¸±à¸ à¸à¸·à¸à¸à¸£à¸°à¹à¸ à¸à¸à¹à¸²à¹à¸à¹à¸à¹à¸²à¸¢à¸«à¸¥à¸±à¸à¹ à¹à¸à¹à¸ à¸à¹à¸²à¸ªà¸²à¸à¸²à¸£à¸à¸¹à¸à¹à¸ à¸"," â the main expense category, e.g. Utilities."],expenseLine:["รายà¸à¹à¸²à¸¢ à¸à¸·à¸ à¸à¸à¸´à¸à¸à¸à¸à¸£à¸²à¸¢à¸à¹à¸²à¸¢à¸¢à¹à¸à¸¢à¸à¸µà¹à¹à¸à¸´à¸à¸à¸¶à¹à¸à¸à¸£à¸´à¸ à¹à¸à¹à¸ à¸à¹à¸²à¸à¹à¸³ à¸à¹à¸²à¹à¸ à¸à¹à¸²à¸à¸´à¸à¹à¸à¸à¸£à¹à¹à¸à¹à¸","Expense â the actual sub-expense that occurs, e.g. water, electricity, internet."],commentText:[" à¸à¸·à¸ รายละà¹à¸à¸µà¸¢à¸à¹à¸à¸·à¹à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸à¸´à¹à¸¡à¹à¸à¸´à¸¡à¸à¸à¸à¸£à¸²à¸¢à¸à¹à¸²à¸¢à¸à¸±à¹à¸à¹ à¹à¸à¹à¸ à¸à¹à¸²à¸à¸´à¸à¹à¸à¸à¸£à¹à¹à¸à¹à¸ (True)"," â extra detail for that expense, e.g. Internet (True)."],clickHint:["Click à¸à¸µà¹à¸à¸·à¹à¸à¹à¸à¸·à¹à¸à¸à¸¹à¸£à¸²à¸¢à¸à¸²à¸£à¸¢à¹à¸à¸¢","Click a name to view its sub-items."]}},Txe={removeTxn:["ลà¸à¸£à¸²à¸¢à¸à¸²à¸£à¸à¹à¸²à¹à¸à¹à¸à¹à¸²à¸¢à¸à¸µà¹?","Remove this expense?"]},Exe={tabs:bxe,status:wxe,manage:Sxe,confirm:Txe},Ixe=["รายà¸à¸²à¸","Reports"],Cxe={subtitle:["à¹à¸¥à¸·à¸à¸à¸£à¸²à¸¢à¸à¸²à¸","Select a report to view details and export."],totalReports:["{count} รายà¸à¸²à¸","{count} reports"],reportOne:["{count} รายà¸à¸²à¸","{count} report"],reportMany:["{count} รายà¸à¸²à¸","{count} reports"],view:["à¸à¸¹","VIEW"],groups:{summarySales:["สรุà¸à¸¢à¸à¸à¸à¸²à¸¢","Summary Sales"],orders:["à¹à¸à¹à¸ªà¸£à¹à¸","Receipts"],product:["สิà¸à¸à¹à¸²","Product"],stock:["สà¸à¹à¸à¸","Stock"],expense:["à¸à¹à¸²à¹à¸à¹à¸à¹à¸²à¸¢","Expense"],other:["à¸à¸·à¹à¸à¹","Other"]},items:{income:["สรุà¸à¸ าà¸à¸£à¸§à¸¡à¸à¸²à¸£à¸à¸²à¸¢ (Summary Report)","Income"],incomeSub:["สรุà¸à¸£à¸²à¸¢à¹à¸à¹à¸£à¸²à¸¢à¸§à¸±à¸à¸à¸²à¸¡à¸à¸£à¸°à¹à¸ à¸à¸à¸²à¸£à¸à¸³à¸£à¸°","Income summary by payment type"],salesByTime:["à¸à¸²à¸£à¸ªà¸±à¹à¸à¸à¸²à¸¡à¸à¹à¸§à¸à¹à¸§à¸¥à¸²","Orders by Time Period"],salesByTimeSub:["Heatmap à¸à¸²à¸¡à¸à¸±à¹à¸§à¹à¸¡à¸ à วัภ(à¹à¸à¸´à¹à¸¡/ยà¸à¹à¸¥à¸´à¸/à¸à¸³à¸£à¸°à¹à¸à¸´à¸)","Heatmap by hour à day (Add/Void/Payment)"],orders:["à¹à¸à¹à¸ªà¸£à¹à¸à¸£à¸²à¸¢à¸§à¸±à¸ (Daily Report)","Daily Receipts"],ordersSub:["à¸à¸´à¸¥ à¸à¸³à¸à¸§à¸à¸¥à¸¹à¸à¸à¹à¸² à¹à¸¥à¸°à¸¢à¸à¸à¸£à¸§à¸¡","Bills, guests & grand totals"],products:["สิà¸à¸à¹à¸²à¸à¸²à¸¢ (Products Sold)","Products"],productsSub:["ยà¸à¸à¸à¸²à¸¢à¸à¸²à¸¡à¸£à¸²à¸¢à¸à¸²à¸£à¹à¸¥à¸°à¸«à¸¡à¸§à¸à¸«à¸¡à¸¹à¹","Sales by item & category"],productsDaily:["ยà¸à¸à¸à¸²à¸¢à¸ªà¸´à¸à¸à¹à¸²à¹à¸¢à¸à¸à¸²à¸¡à¸§à¸±à¸ (Products Daily)","Products Daily"],productsDailySub:["ยà¸à¸à¸à¸²à¸¢à¸£à¸²à¸¢à¸ªà¸´à¸à¸à¹à¸²à¹à¸¢à¸à¸à¸²à¸¡à¸§à¸±à¸à¹à¸à¹à¸à¸·à¸à¸à¸à¸µà¹à¹à¸¥à¸·à¸à¸","S
167ales per product, day by day"],voidItems:["รายà¸à¸²à¸£à¸ªà¸´à¸à¸à¹à¸²à¸à¸µà¹à¸¢à¸à¹à¸¥à¸´à¸ (Void Items)","Void Items"],voidItemsSub:["รายà¸à¸²à¸£à¸à¸µà¹à¸à¸¹à¸à¸¢à¸à¹à¸¥à¸´à¸à¹à¸¥à¸°à¹à¸«à¸à¸¸à¸à¸¥","Voided items and reasons"],changePrice:["รายà¸à¸²à¸à¸à¸²à¸£à¹à¸à¸¥à¸µà¹à¸¢à¸à¸£à¸²à¸à¸²","Change Price Report"],changePriceSub:["à¸à¸²à¸£à¸à¸£à¸±à¸à¸£à¸²à¸à¸²à¸à¸µà¹à¸«à¸à¹à¸² POS","Price adjustments made at POS"],openMenu:["สรุà¸à¸¢à¸à¸à¸à¸²à¸¢à¹à¸¡à¸à¸¹à¹à¸à¸´à¸ (OpenMenu Report)","OpenMenu"],openMenuSub:["รายà¸à¸²à¸£à¹à¸¡à¸à¸¹à¹à¸à¸à¸à¸£à¸à¸à¸à¸´à¸ªà¸£à¸°","Free-form menu entries"],stock:["สà¸à¹à¸à¸","Stock"],stockSub:["à¸à¸²à¸£à¹à¸à¸¥à¸·à¹à¸à¸à¹à¸«à¸§à¹à¸¥à¸°à¸¢à¸à¸à¸à¸à¹à¸«à¸¥à¸·à¸à¸à¸à¸à¸ªà¸à¹à¸à¸","Inventory movement & balance"],expense:["à¸à¹à¸²à¹à¸à¹à¸à¹à¸²à¸¢","Expense"],expenseSub:["à¸à¹à¸²à¹à¸à¹à¸à¹à¸²à¸¢à¹à¸à¸à¸²à¸£à¸à¸³à¹à¸à¸´à¸à¸à¸²à¸à¸à¸²à¸¡à¸«à¸¡à¸§à¸à¸«à¸¡à¸¹à¹","Operating expenses by category"],activity:["à¸à¸£à¸°à¸§à¸±à¸à¸´à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸","Activity (History Log)"],activitySub:["à¹à¸à¸£à¸à¸³à¸à¸°à¹à¸£ â à¸à¸£à¸°à¸§à¸±à¸à¸´à¸à¸²à¸£à¸à¸£à¸§à¸à¸ªà¸à¸à¸à¸±à¹à¸à¸«à¸¡à¸","Who did what â full audit trail"]}},Axe={index:["รายà¸à¸²à¸ / หà¸à¹à¸²à¸«à¸¥à¸±à¸","Reports / Index"],detail:["รายà¸à¸²à¸ / {id}","Reports / {id}"]},Rxe={confirmTitle:["ยืà¸à¸¢à¸±à¸à¸à¸²à¸£à¸à¸´à¸¡à¸à¹à¹à¸à¸à¸ªà¸²à¸£à¸à¸±à¹à¸à¸«à¸¡à¸à¸à¸³à¸à¸§à¸ {count} à¹à¸","Confirm printing all {count} receipts"],confirmText:["ยืà¸à¸¢à¸±à¸à¸à¸³à¸à¸§à¸à¸à¸£à¸´à¹à¸ {count} à¹à¸ à¹à¸à¹à¸«à¸£à¸·à¸à¹à¸¡à¹?","Print all {count} receipts?"],confirmButton:["à¸à¸´à¸¡à¸à¹à¸à¸±à¹à¸à¸«à¸¡à¸","Print All"],cancelButton:["ยà¸à¹à¸¥à¸´à¸","Cancel"]},Pxe={title:["à¸à¸£à¸à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸£à¸²à¸¢à¸à¸²à¸","Filter report"],type:["à¸à¸£à¸°à¹à¸ à¸à¸à¸²à¸£à¸à¸£à¸à¸","Filter by"],all:["à¸à¸±à¹à¸à¸«à¸¡à¸","All"],paymentType:["à¸à¸£à¸°à¹à¸ à¸à¸à¸²à¸£à¸à¸³à¸£à¸°à¹à¸à¸´à¸","Payment Type"],cashier:["à¸à¸à¸±à¸à¸à¸²à¸","Cashier"],shift:["à¸à¸°","Shift"],selectLabel:["à¹à¸¥à¸·à¸à¸{name}","Select {name}"],selectPlaceholder:["à¹à¸¥à¸·à¸à¸...","Select..."],noData:["à¹à¸¡à¹à¸à¸à¸à¹à¸à¸¡à¸¹à¸¥ à¹à¸à¸£à¸à¸à¸±à¹à¸à¸à¹à¸²à¹à¸à¸«à¸à¹à¸² Settings","No data â please configure in Settings"],confirm:["à¸à¸à¸¥à¸","OK"],cancel:["ยà¸à¹à¸¥à¸´à¸","Cancel"]},kxe={title:["ยà¸à¸à¸à¸²à¸¢à¸à¸²à¸¡à¸à¹à¸§à¸à¹à¸§à¸¥à¸²","Sales by Time Period"],metrics:{orders:["à¹à¸à¸´à¹à¸¡à¸à¸à¹à¸à¸à¸£à¹","Orders"],voids:["ยà¸à¹à¸¥à¸´à¸à¸£à¸²à¸¢à¸à¸²à¸£","Void Items"],payments:["à¸à¸²à¸£à¸à¸³à¸£à¸°à¹à¸à¸´à¸","Payments"]},metricNotes:{orders:["à¸à¹à¸§à¸à¹à¸§à¸¥à¸²à¸à¸µà¹à¸¡à¸µà¸à¸²à¸£à¹à¸à¸´à¹à¸¡à¸à¸à¹à¸à¸à¸£à¹","When orders are being added"],voids:["à¸à¹à¸§à¸à¹à¸§à¸¥à¸²à¸à¸µà¹à¸¡à¸µà¸à¸²à¸£à¸¢à¸à¹à¸¥à¸´à¸à¸£à¸²à¸¢à¸à¸²à¸£à¸ªà¸´à¸à¸à¹à¸²","When items are voided"],payments:["à¸à¹à¸§à¸à¹à¸§à¸¥à¸²à¸à¸µà¹à¹à¸à¹à¸°à¸à¸³à¸£à¸°à¹à¸à¸´à¸à¹à¸¥à¸°à¸à¸´à¸à¸à¸´à¸¥","When tables pay and close"]},tiles:{total:["รวม{label}","Total {label}"],peakHour:["à¸à¸±à¹à¸§à¹à¸¡à¸à¸à¸µà¹à¸à¸²à¸¢à¸à¸µà¸ªà¸¸à¸","Peak Hour"],busiestDay:["วัà¸à¸à¸µà¹à¸à¸²à¸¢à¸à¸µà¸ªà¸¸à¸","Busiest Day"],transactions:["à¸à¸¸à¸£à¸à¸£à¸£à¸¡","transactions"],txn:["à¸à¸£à¸±à¹à¸","txn"]},heatmap:{byHourDay:["{label} à¸à¸²à¸¡à¸à¸±à¹à¸§à¹à¸¡à¸ à วัà¸","{label} by hour à day"]},controls:{onlyActiveHours:["à¹à¸ªà¸à¸à¹à¸à¸à¸²à¸°à¹à¸§à¸¥à¸²à¸à¸µà¹à¸¡à¸µà¸à¸¸à¸£à¸à¸£à¸£à¸¡","Active hours only"],showQty:["à¹à¸ªà¸à¸à¸à¸³à¸à¸§à¸à¸à¸´à¸¥ (Qty)","Show bill count (Qty)"],unitLabel:["หà¸à¹à¸§à¸¢","Unit"],low:["à¸à¹à¸³","Low"],high:["สูà¸","High"]},units:{baht:["à¸à¸²à¸ (à¹à¸à¹à¸¡)","Baht (full)"],thousand:["à¸à¸±à¸ (K)","Thousand (K)"]},table:{hour:["à¸à¸±à¹à¸§à¹à¸¡à¸","Hour"],overall:["รวม","Overall"],total:["รวม","Total"]},footer:{legend:["ยà¸à¸à¸à¸²à¸¢ à¹à¸¥à¸°à¸à¸±à¸§à¹à¸¥à¸à¹à¸à¸§à¸à¹à¸¥à¹à¸à¸à¸·à¸ à¸à¸³à¸à¸§à¸à¸à¸´à¸¥ ( Qty )","Amount · number in parentheses = bill count"],approxNote:["à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸à¹à¸à¸à¸±à¸§à¹à¸¥à¸à¹à¸à¸¢à¸à¸£à¸°à¸¡à¸²à¸ ยัà¸à¹à¸¡à¹à¸£à¸§à¸¡à¸à¸´à¸¥à¸¢à¸à¹à¸¥à¸´à¸","Figures are approximate and exclude voided bills"]},states:{loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸â¦","Loadingâ¦"]},errors:{fetch:["à¹à¸«à¸¥à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸¡à¹à¸ªà¸³à¹à¸£à¹à¸ à¸à¸£à¸¸à¸à¸²à¸¥à¸à¸à¹à¸«à¸¡à¹","Failed to load data. Please try again."],rangeLimit:["à¹à¸¥à¸·à¸à¸à¸à¹à¸§à¸à¹à¸à¹à¹à¸¡à¹à¹à¸à¸´à¸ {max} วัภ(à¹à¸¥à¸·à¸à¸à¹à¸§à¹ {selected} วัà¸)","Select a range up to {max} days ({selected} selected)"]}},Nxe={title:["ยà¸à¸à¸à¸²à¸¢à¸ªà¸´à¸à¸à¹à¸²à¹à¸¢à¸à¸à¸²à¸¡à¸§à¸±à¸","Products Daily"],group:["à¸à¸¥à¸¸à¹à¸¡","Group"],allGroups:["à¸à¸¸à¸à¸à¸¥à¸¸à¹à¸¡","All groups"],modeAmount:["ยà¸à¸à¸£à¸§à¸¡","Amount"],modeQty:["à¸à¸³à¸à¸§à¸","Quantity"],onlyWithSales:["à¹à¸ªà¸à¸à¹à¸à¸à¸²à¸°à¸£à¸²à¸¢à¸à¸²à¸£à¸à¸µà¹à¸¡à¸µà¸¢à¸à¸","Only rows with sales"],downloadExcel:["à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸ Excel","Download Excel"],product:["สิà¸à¸à¹à¸²","Product"],total:["รวม","Total"],loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸...","Loading..."],empty:["à¹à¸¡à¹à¸à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸¡à¸à¸¹à¸ªà¸´à¸à¸à¹à¸²","No menu data found."],note:["*ราà¸à¸²à¸¢à¸±à¸à¹à¸¡à¹à¸£à¸§à¸¡à¸à¹à¸²à¸à¸£à¸´à¸à¸²à¸£ สà¹à¸§à¸à¸¥à¸ à¹à¸¥à¸° VAT","*The price does not include service, discount or VAT"],excelBuilding:["à¸à¸³à¸¥à¸±à¸à¸ªà¸£à¹à¸²à¸à¹à¸à¸¥à¹...","Preparing..."],excelFailed:["à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸à¹à¸¡à¹à¸ªà¸³à¹à¸£à¹à¸","Download failed"],loadFailed:["à¹à¸«à¸¥à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸¡à¹à¸ªà¸³à¹à¸£à¹à¸ à¸à¸²à¸£à¸²à¸à¸à¹à¸²à¸à¸¥à¹à¸²à¸à¸à¸¶à¸à¸¢à¸±à¸à¹à¸¡à¹à¸¡à¸µà¸à¸±à¸§à¹à¸¥à¸","Could not load the data â the grid below is not showing real numbers"],retry:["ลà¸à¸à¹à¸«à¸¡à¹","Retry"]},Dxe={title:Ixe,index:Cxe,screenLabel:Axe,printAll:Rxe,filter:Pxe,salesByTime:kxe,productsDaily:Nxe},Oxe=["à¸à¸±à¹à¸à¸à¹à¸²","Settings"],xxe={information:["à¸à¹à¸à¸¡à¸¹à¸¥à¸£à¹à¸²à¸","Information"],users:["à¸à¸±à¸à¸à¸²à¸£à¸à¸¹à¹à¹à¸à¹à¸à¸²à¸","Manage User Accounts"],posPin:["PIN à¸à¸à¸±à¸à¸à¸²à¸ POS","POS Employees PIN"],stockPin:["PIN à¸à¸à¸±à¸à¸à¸²à¸ Stock","Stock Employees PIN"],mobile:["Mobile","Mobile"],payment:["à¸à¸£à¸°à¹à¸ à¸à¸à¸²à¸£à¸à¸³à¸£à¸°à¹à¸à¸´à¸","Payment Type"]},Lxe={loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸à¸à¸²à¸£à¸à¸±à¹à¸à¸à¹à¸²â¦","Loading settingsâ¦"],intOnly:["à¸à¸£à¸à¸à¹à¸à¹à¹à¸à¸à¸²à¸°à¸à¸±à¸§à¹à¸¥à¸à¹à¸à¹à¸²à¸à¸±à¹à¸","Numbers only"],saving:["à¸à¸³à¸¥à¸±à¸à¸à¸±à¸à¸à¸¶à¸â¦","Savingâ¦"],user:{title:["à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸¹à¹à¹à¸à¹","User info"],username:["à¸à¸·à¹à¸à¸à¸¹à¹à¹à¸à¹","Username"],usernameHint:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¸¥à¸µà¹à¸¢à¸à¹à¸à¹","Cannot be changed."],password:["รหัสà¸à¹à¸²à¸","Password"],passwordHint:["",""],change:["à¹à¸à¸¥à¸µà¹à¸¢à¸","Change"]},passwordModal:{title:["à¹à¸à¸¥à¸µà¹à¸¢à¸à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸","Change password"],subtitle:["à¸à¸±à¸à¹à¸à¸à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸à¸ªà¸³à¸«à¸£à¸±à¸à¸à¸±à¸à¸à¸µà¸à¸µà¹","Update your password for this account."],current:["รหัสà¸à¹à¸²à¸à¸à¸±à¸à¸à¸¸à¸à¸±à¸","Current password"],new:["รหัสà¸à¹à¸²à¸à¹à¸«à¸¡à¹","New password"],confirm:["ยืà¸à¸¢à¸±à¸à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸à¹à¸«à¸¡à¹","Confirm new password"],errCurrentRequired:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸à¸à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸à¸à¸±à¸à¸à¸¸à¸à¸±à¸","Current password is required."],errNewRequired:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸à¸à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸à¹à¸«à¸¡à¹","New password is required."],errNewLength:["รหัสà¸à¹à¸²à¸à¸à¹à¸à¸à¸¡à¸µà¸à¸¢à¹à¸²à¸à¸à¹à¸à¸¢ 6 à¸à¸±à¸§à¸à¸±à¸à¸©à¸£","Password must be at least 6 characters."],errSameAsCurrent:["รหัสà¸à¹à¸²à¸à¹à¸«à¸¡à¹à¸à¹à¸à¸à¹à¸¡à¹à¸à¹à¸³à¸à¸±à¸à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸à¹à¸à¸´à¸¡","New password must differ from the current one."],errConfirmRequired:["à¸à¸£à¸¸à¸à¸²à¸¢à¸·à¸à¸¢à¸±à¸à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸à¹à¸«à¸¡à¹","Please confirm the new password."],errMismatch:["รหัสà¸à¹à¸²à¸à¹à¸¡à¹à¸à¸£à¸à¸à¸±à¸","Passwords do not match."],errIncorrect:["รหัสà¸à¹à¸²à¸à¸à¸±à¸à¸à¸¸à¸à¸±à¸à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸","Current password is incorrect."],errInvalidNew:["รหัสà¸à¹à¸²à¸à¹à¸«à¸¡à¹à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸ (à¸à¸¢à¹à¸²à¸à¸à¹à¸à¸¢ 6 à¸à¸±à¸§à¸à¸±à¸à¸©à¸£ à¹à¸¥à¸°à¸à¹à¸à¸à¸à¹à¸²à¸à¸à¸²à¸à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸à¹à¸à¸´à¸¡)","Invalid new password (at least 6 characters and must differ from the current one)."]},shop:{title:["à¸à¹à¸à¸¡à¸¹à¸¥à¸£à¹à¸²à¸","Shop info"],name:["à¸à¸·à¹à¸à¸£à¹à¸²à¸","Restaurant name"],nameHint:["à¹à¸ªà¸à¸à¸à¸à¹à¸à¹à¸ªà¸£à¹à¸à¸à¸µà¹à¸à¸´à¸¡à¸à¹","Appears on printed bills."],notSet:["ยัà¸à¹à¸¡à¹à¹à¸à¹à¸à¸±à¹à¸à¸à¹à¸²","Not set"],errNameRequired:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸à¸à¸à¸·à¹à¸à¸£à¹à¸²à¸","Restaurant name is required."],errNotFound:["à¹à¸¡à¹à¸à¸à¸à¸²à¸£à¸à¸±à¹à¸à¸à¹à¸²à¸£à¹à¸²à¸","Shop setting not found."],errSaveFailed:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸±à¸à¸à¸¶à¸à¸à¸·à¹à¸à¸£à¹à¸²à¸à¹à¸à¹","Unable to save restaurant name."]},params:{title:["à¸à¸±à¹à¸à¸à¹à¸²à¸à¸²à¸£à¸²à¸¡à¸´à¹à¸à¸à¸£à¹","Set parameters"],tables:["à¸à¸³à¸à¸§à¸à¹à¸à¹à¸°","Tables"],tablesSuffix:["à¹à¸à¹à¸°","tables"],serviceCharge:["à¸à¹à¸²à¸à¸£à¸´à¸à¸²à¸£","Service charge"],closeTime:["à¹à¸§à¸¥à¸²à¸à¸´à¸à¸£à¹à¸²à¸","Close time"],roundNumber:["à¸à¸²à¸£à¸à¸±à¸à¹à¸¨à¸©","Round number"],showItemDiscount:["à¹à¸ªà¸à¸à¸ªà¹à¸§à¸à¸¥à¸à¸£à¸²à¸¢à¸£à¸²à¸¢à¸à¸²à¸£à¸à¸à¹à¸à¹à¸ªà¸£à¹à¸","Show item discount on receipt"],emailReport:["à¸à¸µà¹à¸¡à¸¥à¸£à¸±à¸à¸£à¸²à¸¢à¸à¸²à¸","Email report"],emailHint:["à¹à¸à¹à¸ªà¸¹à¸à¸ªà¸¸à¸ 10 à¸à¸µà¹à¸¡à¸¥","Up to 10 emails"],emailPlaceholder:["à¸à¸£à¸à¸à¸à¸µà¹à¸¡à¸¥","Enter email address"],smsReport:["SMS รัà¸à¸£à¸²à¸¢à¸à¸²à¸","SMS report"],noNumber:["ยัà¸à¹à¸¡à¹à¹à¸à¹à¹à¸à¸´à¹à¸¡à¹à¸à¸à¸£à¹","No number added"],remove:["à¸à¸³à¸à¸à¸","Remove"],add:["à¹à¸à¸´à¹à¸¡","Add"],saved:["à¸à¸±à¸à¸à¸¶à¸à¹à¸¥à¹à¸§","Saved"]},tax:{title:["ภาษี","Tax"],vatMode:["à¹à¸«à¸¡à¸ VAT","VAT mode"],vatModeHint:["None = à¹à¸¡à¹à¹à¸à¹ · Inclusive = ราà¸à¸²à¸£à¸§à¸¡ VAT à¹à¸¥à¹à¸§ · Exclusive = à¸à¸§à¸ VAT à¹à¸à¸´à¹à¸¡","None = off · Inclusive = VAT included in price · Exclusive = VAT added on top"],rate:["à¸à¸±à¸à¸£à¸²","Rate"],rateHint:["à¸à¸±à¸à¸£à¸²à¸ าษีมูลà¸à¹à¸²à¹à¸à¸´à¹à¸¡","VAT rate"]},timer:{title:["à¸à¸±à¸§à¸à¸±à¸à¹à¸§à¸¥à¸²","Timer"],titleSub:["(à¸à¸´à¸¡à¸à¹à¹à¸à¹à¸à¹à¸à¹à¸§à¸¥à¸²)","(prints time slip)"],add:["à¹à¸à¸´à¹à¸¡à¸à¸±à¸§à¸à¸±à¸à¹à¸§à¸¥à¸²","Add timer"],time:["à¹à¸§à¸¥à¸²","Time"],note:["หมายà¹à¸«à¸à¸¸","Note"],loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸â¦","Loadingâ¦"],empty:["à¹à¸¡à¹à¸¡à¸µà¸à¹à¸à¸¡à¸¹à¸¥","No data"],edit:["à¹à¸à¹à¹à¸","Edit"],remove:["à¸à¸³à¸à¸à¸","Remove"],addModalTitle:["à¹à¸à¸´à¹à¸¡à¸à¸±à¸§à¸à¸±à¸à¹à¸§à¸¥à¸²","Add Timer"],editModalTitle:["à¹à¸à¹à¹à¸à¸à¸±à¸§à¸à¸±à¸à¹à¸§à¸¥à¸²","Edit Timer"],notePlaceholder:["à¹à¸à¹à¸ สามารà¸à¹à¸¥à¹à¸à¹à¸à¹ 1 à¸à¸±à¹à¸§à¹à¸¡à¸ à¸à¸£à¸µ à¸à¹à¸³à¹à¸à¹à¸","e.g. 1 hour free play, free Coke"],invalidTime:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸à¸à¹à¸§à¸¥à¸²à¹à¸à¹à¸à¸à¸±à¸§à¹à¸¥à¸ (à¸à¸²à¸à¸µ) มาà¸à¸à¸§à¹à¸² 0","Please enter the time as a number (minutes) greater than 0"],units:{second:["วิà¸à¸²à¸à¸µ","seconds"],minute:["à¸à¸²à¸à¸µ","minutes"],hour:["à¸à¸±à¹à¸§à¹à¸¡à¸","hours"]}},onOff:{on:["à¹à¸à¸´à¸","On"],off:["à¸à¸´à¸","Off"]},display:{title:["à¸à¸²à¸£à¹à¸ªà¸à¸à¸à¸¥","Display"],theme:["à¸à¸µà¸¡","Theme"],light:["สวà¹à¸²à¸","Light"],dark:["มืà¸","Dark"],thaiFont:["à¸à¸à¸à¸à¹à¹à¸à¸¢","Thai Font"],fontLooped:["à¹à¸¡à¹à¸¡à¸µà¸«à¸±à¸§","Loopless"],fontSans:["มีหัว","Looped"]},openTime:{sameDay:["à¹à¸à¸´à¸-à¸à¸´à¸ วัà¸à¹à¸à¸µà¸¢à¸§à¸à¸±à¸","Open-Close same day"],differentDay:["à¹à¸à¸´à¸-à¸à¸´à¸ à¸à¸à¸¥à¸°à¸§à¸±à¸","Open-Close different day"]}
167,rounding:{none:["à¹à¸¡à¹à¸¡à¸µà¸à¸²à¸£à¸à¸£à¸±à¸à¹à¸¨à¸©","No rounding"],up:["à¸à¸±à¸à¸à¸¶à¹à¸à¸à¸¥à¸à¸","Always round up"],down:["à¸à¸±à¸à¸¥à¸à¸à¸¥à¸à¸","Always round down"]},vatMode:{none:["None (à¹à¸¡à¹à¹à¸à¹)","None"],inclusive:["Inclusive (รวม VAT)","Inclusive"],exclusive:["Exclusive (à¸à¸§à¸ VAT)","Exclusive"]}},Mxe={title:["PIN à¸à¸à¸±à¸à¸à¸²à¸à¸ªà¸à¹à¸à¸","Stock employees PIN"],subtitle:["PIN à¹à¸à¸à¸²à¸°à¹à¸à¹à¸²à¸«à¸à¹à¸²à¸à¸µà¹à¸ªà¸à¹à¸à¸ · à¹à¸à¹à¸à¸£à¸§à¸à¸£à¸±à¸à¸à¸à¸ à¹à¸à¹à¸ªà¸¹à¸à¸£ à¹à¸¥à¸°à¸à¹à¸²à¸à¸¢à¸à¸à¸à¸à¹à¸«à¸¥à¸·à¸à¹à¸à¸«à¸à¹à¸² Stock","PIN for stock staff only · used to receive goods, edit formulas, and read balances on the Stock page"],addEmployee:["à¹à¸à¸´à¹à¸¡à¸à¸à¸±à¸à¸à¸²à¸","Add employee"],searchPlaceholder:["à¸à¹à¸à¸«à¸²à¸à¹à¸§à¸¢à¸à¸·à¹à¸","Search by name"],employeesCount:["{n} à¸à¸","{n} employees"],withFullAccess:["{n} รายมีสิà¸à¸à¸´à¹à¹à¸à¹à¸¡","{n} with full access"],colName:["à¸à¸·à¹à¸","Name"],colPin:["PIN","PIN"],colPermissions:["สิà¸à¸à¸´à¹à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸","Permissions"],colActions:["à¸à¸²à¸£à¸à¸±à¸à¸à¸²à¸£","Actions"],all:["à¸à¸±à¹à¸à¸«à¸¡à¸","All"],noAccess:["à¹à¸¡à¹à¸¡à¸µà¸ªà¸´à¸à¸à¸´à¹","No access"],edit:["à¹à¸à¹à¹à¸","Edit"],delete:["ลà¸","Delete"],noEmployees:["à¹à¸¡à¹à¸¡à¸µà¸à¸à¸±à¸à¸à¸²à¸","No employees"],addTitle:["à¹à¸à¸´à¹à¸¡à¸à¸à¸±à¸à¸à¸²à¸","Add employee"],editTitle:["à¹à¸à¹à¹à¸à¸à¸à¸±à¸à¸à¸²à¸","Edit employee"],name:["à¸à¸·à¹à¸","Name"],pin:["PIN","PIN"],confirmPin:["ยืà¸à¸¢à¸±à¸ PIN","Confirm PIN"],permissions:["สิà¸à¸à¸´à¹à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸","Permissions"],cancel:["ยà¸à¹à¸¥à¸´à¸","Cancel"],save:["à¸à¸±à¸à¸à¸¶à¸","Save"],ok:["à¸à¸à¸¥à¸","OK"],errNameRequired:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸à¸à¸à¸·à¹à¸","Name is required"],errPinRequired:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸à¸ PIN","PIN is required"],errPinMismatch:["PIN à¹à¸¡à¹à¸à¸£à¸à¸à¸±à¸","PIN does not match"],errPinExists:["PIN à¸à¸µà¹à¸¡à¸µà¸à¸¢à¸¹à¹à¹à¸¥à¹à¸§","PIN already exists"],saved:["à¸à¸±à¸à¸à¸¶à¸à¹à¸¥à¹à¸§","Saved"],saveFailed:["à¸à¸±à¸à¸à¸¶à¸à¹à¸¡à¹à¸ªà¸³à¹à¸£à¹à¸ à¸à¸£à¸¸à¸à¸²à¸¥à¸à¸à¹à¸«à¸¡à¹","Save failed. Please try again."],deleteFailed:["ลà¸à¹à¸¡à¹à¸ªà¸³à¹à¸£à¹à¸ à¸à¸£à¸¸à¸à¸²à¸¥à¸à¸à¹à¸«à¸¡à¹","Delete failed. Please try again."],deleteConfirm:['ลà¸à¸à¸à¸±à¸à¸à¸²à¸ "{name}"?','Delete employee "{name}"?'],perms:{edit_stock:["à¹à¸à¹à¹à¸à¸ªà¸à¹à¸à¸","Edit Stock"],edit_formula:["à¹à¸à¹à¹à¸à¸ªà¸¹à¸à¸£","Edit Formula"],transaction_add:["รัà¸à¸ªà¸´à¸à¸à¹à¸²","Receive Goods"],transaction_withdraw:["à¹à¸à¸´à¸à¸ªà¸´à¸à¸à¹à¸²","Withdraw Goods"],transaction_adjust:["à¸à¸£à¸±à¸à¸ªà¸à¹à¸à¸","Adjust Stock"],read_balance:["à¸à¹à¸²à¸à¸¢à¸à¸à¸à¸à¹à¸«à¸¥à¸·à¸","Read Balance"]}},Vxe={title:["à¸à¸¸à¸à¸à¸£à¸à¹à¸¡à¸·à¸à¸à¸·à¸à¸à¸µà¹à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸","Paired mobiles"],subtitle:["à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¸à¸²à¸£à¸ªà¸±à¹à¸à¸à¸²à¸«à¸²à¸£à¸à¹à¸²à¸à¸¡à¸·à¸à¸à¸·à¸ · à¸à¹à¸à¸à¹à¸à¹ Package 1390 à¸à¸¶à¹à¸à¹à¸","Connect mobile food ordering · requires Package 1390 or higher"],pairedDevices:["à¸à¸¸à¸à¸à¸£à¸à¹à¸à¸µà¹à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸","paired devices"],empty:["ยัà¸à¹à¸¡à¹à¸¡à¸µà¸à¸¸à¸à¸à¸£à¸à¹à¸à¸µà¹à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸","No paired devices yet"],active:["à¹à¸à¹à¸à¸²à¸à¸à¸¢à¸¹à¹","Active"],paired:["à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¹à¸¡à¸·à¹à¸:","Paired:"],lastActive:["à¹à¸à¹à¸à¸²à¸à¸¥à¹à¸²à¸ªà¸¸à¸:","Last active:"],remove:["à¸à¸³à¸à¸à¸","Remove"],addNewDevice:["à¹à¸à¸´à¹à¸¡à¸à¸¸à¸à¸à¸£à¸à¹à¹à¸«à¸¡à¹","Add new device"],deviceIdPlaceholder:["à¸à¸£à¸à¸à¸£à¸«à¸±à¸ªà¸à¸¸à¸à¸à¸£à¸à¹ (à¹à¸à¹à¸ a3c9d1)","Enter device ID (e.g. a3c9d1)"],link:["à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸","Link"],reachedMax:["à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¸à¸£à¸ {n} à¹à¸à¸£à¸·à¹à¸à¸à¹à¸¥à¹à¸§ à¸à¸³à¸à¸à¸à¸«à¸à¸¶à¹à¸à¹à¸à¸£à¸·à¹à¸à¸à¹à¸à¸·à¹à¸à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¸à¸¸à¸à¸à¸£à¸à¹à¹à¸«à¸¡à¹","Reached max {n} devices. Remove one to link a new device."],errMaxReached:["à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¹à¸à¹à¸ªà¸¹à¸à¸ªà¸¸à¸ {n} à¹à¸à¸£à¸·à¹à¸à¸","Maximum {n} devices reached."],errInvalidId:["รหัสà¸à¸¸à¸à¸à¸£à¸à¹à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸ à¹à¸à¹à¹à¸à¹à¹à¸à¸à¸²à¸°à¸à¸±à¸§à¸à¸±à¸à¸©à¸£ à¸à¸±à¸§à¹à¸¥à¸ à¸à¸µà¸à¸à¸¥à¸²à¸ หรืà¸à¸à¸µà¸à¸¥à¹à¸²à¸à¹à¸à¹à¸²à¸à¸±à¹à¸","Invalid device ID. Use letters, numbers, hyphen, or underscore only."],errAlreadyPaired:["รหัสà¸à¸¸à¸à¸à¸£à¸à¹à¸à¸µà¹à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¸à¸¢à¸¹à¹à¹à¸¥à¹à¸§","This device ID is already paired."],errPairFailed:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¸à¸¸à¸à¸à¸£à¸à¹à¹à¸à¹","Failed to pair device."],errRemoveFailed:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸³à¸à¸¸à¸à¸à¸£à¸à¹à¸à¸à¸à¹à¸à¹","Failed to remove device."]},Fxe={title:Oxe,tabs:xxe,tab1:Lxe,tab4:Mxe,tab5:Vxe},Bxe={title:["à¹à¸à¸´à¸¡à¹à¸à¸´à¸ / à¸à¹à¸à¸à¸²à¸¢à¸¸","Top Up"],subtitle:["à¸à¸³à¸£à¸°à¸à¹à¸²à¸à¸£à¸´à¸à¸²à¸£à¹à¸¥à¸°à¸à¹à¸à¸à¸²à¸¢à¸¸à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸","Pay for service and extend your subscription"],testBtn:["à¸à¸à¸ªà¸à¸à¸«à¸à¹à¸²à¸à¸¥à¸à¸³à¸£à¸°","Test result page"]},$xe={title:["à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸±à¸à¸à¸µà¸à¸à¸²à¸à¸²à¸£","Bank Account Information"],subtitle:["à¹à¸à¸à¹à¸à¸´à¸à¸¡à¸²à¸¢à¸±à¸à¸à¸±à¸à¸à¸µà¸à¹à¸²à¸à¸¥à¹à¸²à¸","Transfer to the account below"],table:{bank:["à¸à¸à¸²à¸à¸²à¸£","Bank"],accountName:["à¸à¸·à¹à¸à¸à¸±à¸à¸à¸µ","A
167ccount Name"],branch:["สาà¸à¸²","Branch"],accountNumber:["à¹à¸¥à¸à¸à¸µà¹à¸à¸±à¸à¸à¸µ","Account Number"]},callout:["à¹à¸à¸à¸£à¸à¸µà¸à¹à¸à¸à¸à¸²à¸£à¹à¸à¸¥à¸µà¹à¸¢à¸ Package à¸à¸£à¸¸à¸à¸²à¸à¸´à¸à¸à¹à¸à¸à¸à¸±à¸à¸à¸²à¸à¸à¸²à¸¢","To change Package, please contact a sales representative"]},Uxe={title:["à¸à¸³à¸£à¸°à¸à¹à¸²à¸à¸£à¸´à¸à¸²à¸£","Pay for Service"],subtitle:["à¸à¸£à¸à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸²à¸£à¹à¸à¸à¹à¸à¸´à¸","Fill in transfer information"],fields:{paymentMethod:["วิà¸à¸µà¸à¸²à¸£à¸à¸³à¸£à¸°à¹à¸à¸´à¸","Payment Method"],package:["à¹à¸à¹à¸à¹à¸à¸","Package"],pricePerMonth:["ราà¸à¸²à¸à¹à¸à¹à¸à¸·à¸à¸","Price per month"],packageLabel:["Package","Package"],months:["{n} à¹à¸à¸·à¸à¸","{n} months"],total:["ยà¸à¸à¸£à¸§à¸¡","Total"],totalUnit:["à¸à¸²à¸","Baht"],transferDateTime:["วัà¸à¸à¸µà¹ / à¹à¸§à¸¥à¸²à¹à¸à¸","Transfer Date / Time"],destinationBank:["à¸à¸à¸²à¸à¸²à¸£à¸à¸¥à¸²à¸¢à¸à¸²à¸","Destination Bank"],searchPlaceholder:["à¸à¸´à¸¡à¸à¹à¹à¸à¸·à¹à¸à¸à¹à¸à¸«à¸²...","Type to search..."],transferAmount:["à¸à¸³à¸à¸§à¸à¹à¸à¸´à¸à¸à¸µà¹à¹à¸à¸","Transfer Amount"],transferAmountHint:["หà¸à¹à¸§à¸¢: à¸à¸²à¸","Unit: Baht"],shopName:["à¸à¸·à¹à¸à¸£à¹à¸²à¸","Shop Name"],shopNamePlaceholder:["à¹à¸ªà¹à¸à¸·à¹à¸à¸£à¹à¸²à¸","Enter shop name"],remark:["หมายà¹à¸«à¸à¸¸","Remark"]},paymentMethods:{bankTransfer:["à¹à¸à¸à¹à¸à¸´à¸à¸à¹à¸²à¸à¸à¸à¸²à¸à¸²à¸£","Bank Transfer"],creditCard:["à¸à¸±à¸à¸£à¹à¸à¸£à¸à¸´à¸","Credit Card"]},submitError:{title:["สà¹à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸à¹à¸à¸à¸³à¸£à¸°à¹à¸à¸´à¸à¹à¸¡à¹à¸ªà¸³à¹à¸£à¹à¸","Failed to submit payment notification"],retry:["à¸à¸£à¸¸à¸à¸²à¸¥à¸à¸à¹à¸«à¸¡à¹à¸à¸µà¸à¸à¸£à¸±à¹à¸ หรืà¸à¸à¸´à¸à¸à¹à¸à¹à¸à¹à¸²à¸«à¸à¹à¸²à¸à¸µà¹","Please try again or contact support"]},submit:{default:["สà¹à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸³à¸£à¸°","Submit Payment"],submitting:["à¸à¸³à¸¥à¸±à¸à¸ªà¹à¸à¸à¹à¸à¸¡à¸¹à¸¥...","Submitting..."]},validation:{title:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸§à¸à¸ªà¸à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸µà¹à¸à¸£à¸à¸","Please check the information you entered"],selectTransferDate:["à¸à¸£à¸¸à¸à¸²à¹à¸¥à¸·à¸à¸à¸§à¸±à¸à¸à¸µà¹à¹à¸à¸","Please select transfer date"],selectTransferTime:["à¸à¸£à¸¸à¸à¸²à¹à¸¥à¸·à¸à¸à¹à¸§à¸¥à¸²à¸à¸µà¹à¹à¸à¸","Please select transfer time"],selectDestinationBank:["à¸à¸£à¸¸à¸à¸²à¹à¸¥à¸·à¸à¸à¸à¸à¸²à¸à¸²à¸£à¸à¸¥à¸²à¸¢à¸à¸²à¸","Please select destination bank"],amountGreaterThanZero:["à¸à¸³à¸à¸§à¸à¹à¸à¸´à¸à¸à¸µà¹à¹à¸à¸à¸à¹à¸à¸à¸¡à¸²à¸à¸à¸§à¹à¸² 0 à¸à¸²à¸","Transfer amount must be greater than 0 Baht"],enterShopName:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸à¸à¸à¸·à¹à¸à¸£à¹à¸²à¸","Please enter shop name"]}},Hxe={header:Bxe,bankInfo:$xe,form:Uxe},qxe={gmail:{title:["à¸à¸±à¸à¸à¸µ Google","Google Account"],subtitle:["à¹à¸à¹à¸²à¸ªà¸¹à¹à¸£à¸°à¸à¸à¸à¹à¸§à¸¢ Gmail","Signed in with Gmail"],name:["à¸à¸·à¹à¸","Name"],email:["à¸à¸µà¹à¸¡à¸¥","Email"],signedInAs:["ลà¸à¸à¸·à¹à¸à¹à¸à¹à¸²à¹à¸à¹à¸à¹à¸§à¸¢ Gmail","Signed in with Gmail"]},link:{button:["à¹à¸à¸´à¹à¸¡à¸£à¹à¸²à¸à¸à¹à¸²","Add Shop"]},stores:{title:["รà¹à¸²à¸à¸à¹à¸²à¸à¸à¸à¸à¸±à¸","My Stores"],empty:["ยัà¸à¹à¸¡à¹à¸¡à¸µà¸£à¹à¸²à¸à¸à¹à¸²à¸à¸µà¹à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸","No stores linked yet"],addAnother:["à¹à¸à¸´à¹à¸¡à¸£à¹à¸²à¸","Add another shop"],reorder:["à¹à¸£à¸µà¸¢à¸à¸¥à¸³à¸à¸±à¸","Reorder"],reorderTitle:["à¹à¸£à¸µà¸¢à¸à¸¥à¸³à¸à¸±à¸à¸£à¹à¸²à¸à¸à¹à¸²","Reorder Stores"],reorderHint:["ลาà¸à¹à¸à¸·à¹à¸à¸à¸±à¸à¸¥à¸³à¸à¸±à¸à¸£à¹à¸²à¸à¸à¸µà¹à¸à¹à¸à¸à¸à¸²à¸£à¹à¸«à¹à¹à¸ªà¸à¸à¸à¹à¸à¸","Drag to arrange which store shows first"],reorderSave:["à¸à¸±à¸à¸à¸¶à¸","Save"],shopI
167d:["ID","ID"],username:["à¸à¸·à¹à¸à¸à¸¹à¹à¹à¸à¹","Username"],role:["à¸à¸à¸à¸²à¸","Role"],switch:["à¹à¸¥à¸·à¸à¸à¸£à¹à¸²à¸à¸à¸µà¹","Use this shop"],active:["à¹à¸à¹à¸à¸²à¸à¸à¸¢à¸¹à¹","Active"],needsReLink:["à¹à¸à¸ªà¸à¸±à¸à¸«à¸¡à¸à¸à¸²à¸¢à¸¸ à¸à¸£à¸¸à¸à¸²à¹à¸à¹à¸²à¸ªà¸¹à¹à¸£à¸°à¸à¸à¹à¸«à¸¡à¹","Session expired. Please sign in again."],roles:{admin:["Admin","ADMIN"],custom:["Custom","CUSTOM"],staff:["Staff","STAFF"]},access:{title:["สิà¸à¸à¸´à¹à¸à¸²à¸£à¹à¸à¹à¸²à¸à¸¶à¸","Access"],all:["à¹à¸à¹à¸²à¹à¸à¹à¸à¸¸à¸à¸«à¸à¹à¸²","Full access"],limited:["à¹à¸à¹à¸²à¹à¸à¹à¹à¸à¸à¸²à¸°","Can access"],keys:{pos:["à¸à¸²à¸¢à¸«à¸à¹à¸²à¸£à¹à¸²à¸ (POS)","POS"],report:["รายà¸à¸²à¸","Reports"],menu:["à¹à¸¡à¸à¸¹","Menu"],expense:["à¸à¹à¸²à¹à¸à¹à¸à¹à¸²à¸¢","Expenses"],expenses:["à¸à¹à¸²à¹à¸à¹à¸à¹à¸²à¸¢","Expenses"],stock:["สà¸à¹à¸à¸","Stock"],setting:["à¸à¸±à¹à¸à¸à¹à¸²","Settings"],settings:["à¸à¸±à¹à¸à¸à¹à¸²","Settings"]}}},signOut:["à¸à¸à¸à¸à¸²à¸à¸£à¸°à¸à¸","Sign Out"],messages:{confirmRemove:["ยืà¸à¸¢à¸±à¸à¸à¸²à¸£à¸¥à¸à¸£à¹à¸²à¸à¸à¹à¸²?","Confirm remove store?"],removeSuccess:["ลà¸à¸£à¹à¸²à¸à¸à¹à¸²à¸ªà¸³à¹à¸£à¹à¸","Store removed successfully"],removeError:["à¹à¸à¸´à¸à¸à¹à¸à¸à¸´à¸à¸à¸¥à¸²à¸à¹à¸à¸à¸²à¸£à¸¥à¸à¸£à¹à¸²à¸à¸à¹à¸²","Error removing store"],confirmSignOut:["ยืà¸à¸¢à¸±à¸à¸à¸²à¸£à¸à¸à¸à¸à¸²à¸à¸£à¸°à¸à¸?","Confirm sign out?"]}},jxe={title:["à¹à¸à¹à¸²à¸ªà¸¹à¹à¸£à¸°à¸à¸","Sign In"],subtitle:["à¹à¸à¹à¸²à¸ªà¸¹à¹à¸£à¸°à¸à¸à¹à¸à¸·à¹à¸à¹à¸à¹à¸²à¸à¸¶à¸à¸£à¸²à¸¢à¸à¸²à¸à¸à¸à¸à¸£à¹à¸²à¸à¸à¹à¸²","Sign in to access your shop reports"],googleButton:["à¹à¸à¹à¸²à¸ªà¸¹à¹à¸£à¸°à¸à¸à¸à¹à¸§à¸¢ Google","Sign in with Google"],signingIn:["à¸à¸³à¸¥à¸±à¸à¹à¸à¹à¸²à¸ªà¸¹à¹à¸£à¸°à¸à¸...","Signing in..."],copy:["© NICELOOP POS","© NICELOOP POS"],linkShop:["à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¸£à¹à¸²à¸à¸à¹à¸²","Link Your Shop"],welcome:["ยิà¸à¸à¸µà¸à¹à¸à¸à¸£à¸±à¸","Welcome"],linkShopDescription:["à¸à¸£à¸à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸¥à¹à¸à¸à¸à¸´à¸à¸à¸à¸à¸£à¹à¸²à¸à¸à¹à¸²à¹à¸à¸·à¹à¸à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¸à¸±à¸à¸à¸±à¸à¸à¸µà¸à¸à¸à¸à¸¸à¸","Enter your shop login credentials to link with your account"],fields:{username:["à¸à¸·à¹à¸à¸à¸¹à¹à¹à¸à¹","Username"],password:["รหัสà¸à¹à¸²à¸","Password"]},actions:{linkShop:["à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¸£à¹à¸²à¸à¸à¹à¸²","Link Shop"],linking:["à¸à¸³à¸¥à¸±à¸à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸...","Linking..."],cancel:["ยà¸à¹à¸¥à¸´à¸","Cancel"]},alerts:{authError:["à¹à¸à¸´à¸à¸à¹à¸à¸à¸´à¸à¸à¸¥à¸²à¸à¹à¸à¸à¸²à¸£à¹à¸à¹à¸²à¸ªà¸¹à¹à¸£à¸°à¸à¸ à¸à¸£à¸¸à¸à¸²à¸¥à¸à¸à¹à¸«à¸¡à¹à¸à¸µà¸à¸à¸£à¸±à¹à¸","Sign in failed. Please try again."],linkError:["à¹à¸à¸´à¸à¸à¹à¸à¸à¸´à¸à¸à¸¥à¸²à¸à¹à¸à¸à¸²à¸£à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¸£à¹à¸²à¸à¸à¹à¸² à¸à¸£à¸¸à¸à¸²à¸à¸£à¸§à¸à¸ªà¸à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸¥à¸°à¸¥à¸à¸à¹à¸«à¸¡à¹","Failed to link shop. Please check your credentials and try again."],linkSuccess:["à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¸£à¹à¸²à¸à¸à¹à¸²à¸ªà¸³à¹à¸£à¹à¸","Shop linked successfully"],storeNotFound:["à¹à¸¡à¹à¸à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸£à¹à¸²à¸à¸à¹à¸² à¸à¸£à¸¸à¸à¸²à¸à¸£à¸§à¸à¸ªà¸à¸à¸à¸±à¸à¸à¸µà¸à¸¹à¹à¹à¸à¹","Store not found. Please check your account."],notMigratedTitle:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¸£à¹à¸²à¸à¸à¹à¸²à¹à¸à¹","Cannot link this shop"],notMigratedBody:['รà¹à¸²à¸à¸à¸µà¹à¸¢à¸±à¸à¹à¸à¹à¸à¸²à¸à¹à¸§à¸à¸£à¹à¸à¸±à¸à¹à¸à¹à¸²à¸à¸¢à¸¹à¹ à¸à¸£à¸¸à¸à¸²à¸à¸´à¸à¸à¹à¸à¹à¸à¹à¸²à¸«à¸à¹à¸²à¸à¸µà¹ Niceloop à¸à¸µà¹ <a href="tel:0818460621">081-846-0621/a>','This shop is still on the legacy version. Please contact Niceloop support at <a href="tel:0818460621">081-846-0621</a>']}},Wxe={title:["à¹à¸à¸ªà¸à¸±à¸à¸£à¹à¸²à¸ {shop} หมà¸à¸à¸²à¸¢à¸¸","Session for {shop} has expired"],body:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸à¸ Username à¹à¸¥à¸° Password à¸à¸à¸à¸£à¹à¸²à¸ {shop} à¸à¸µà¸à¸à¸£à¸±à¹à¸à¹à¸à¸·à¹à¸à¹à¸à¹à¸à¸²à¸à¸à¹à¸","Please enter the Username and Password of {shop} again to continue."],submit:["ยืà¸à¸¢à¸±à¸","Continue"],signingIn:["à¸à¸³à¸¥à¸±à¸à¹à¸à¹à¸²à¸ªà¸¹à¹à¸£à¸°à¸à¸...","Signing in..."],cancel:["ยà¸à¹à¸¥à¸´à¸","Cancel"]},Gxe={empty:{noStores:["ยัà¸à¹à¸¡à¹à¸¡à¸µà¸£à¹à¸²à¸à¸à¹à¸²","No Stores Yet"],noStoresDescription:["à¹à¸à¸´à¹à¸¡à¸£à¹à¸²à¸à¸à¹à¸²à¹à¸à¸·à¹à¸à¹à¸£à¸´à¹à¸¡à¸à¸¹à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸à¸à¹à¸£à¸µà¸¢à¸¥à¹à¸à¸¡à¹","Add a store to start viewing real-time data"],activeTables:["à¹à¸¡à¹à¸¡à¸µà¹à¸à¹à¸°à¸à¸µà¹à¸à¸³à¸¥à¸±à¸à¹à¸à¹à¸à¸²à¸","No active tables"],noItems:["à¹à¸¡à¹à¸¡à¸µà¸£à¸²à¸¢à¸à¸²à¸£à¸à¸²à¸«à¸²à¸£","No order items"]},summary:{todayOverview:["ภาà¸à¸£à¸§à¸¡à¸§à¸±à¸à¸à¸µà¹","Today's Overview"],grandTotal:["ยà¸à¸à¸£à¸§à¸¡","Grand Total"],tables:["à¹à¸à¹à¸°à¸à¸µà¹à¹à¸à¹à¸à¸²à¸","Active Tables"],guestsNow:["ลูà¸à¸à¹à¸²à¸à¸±à¸à¸à¸¸à¸à¸±à¸","Guests Now"],pending:["ยà¸à¸à¸à¸à¹à¸à¹à¸°","Pending"],activeTables:["{count} à¹à¸à¹à¸°à¸à¸µà¹à¹à¸à¸´à¸","{count}
167 Active Tables"]},live:{allPayment:["à¸à¸¸à¸à¸à¸²à¸£à¸à¸³à¸£à¸°","All Payment"],allPending:["ยà¸à¸à¸à¸à¹à¸à¹à¸°","Pending"],paid:["à¸à¹à¸²à¸¢à¹à¸¥à¹à¸§","Paid"],pending:["ยà¸à¸à¸à¸à¹à¸à¹à¸°","Pending"],grandTotal:["Grand Total","Grand Total"],total:["รวม","Total"],allShops:["à¸à¸¸à¸à¸£à¹à¸²à¸","All shops"],totalAllShops:["รวม · à¸à¸¸à¸à¸£à¹à¸²à¸","Total · all shops"],lastUpdate:["à¸à¸±à¸à¹à¸à¸à¸¥à¹à¸²à¸ªà¸¸à¸","last update"],addAnotherShop:["à¹à¸à¸´à¹à¸¡à¸£à¹à¸²à¸","Add another shop"],noData:["ยัà¸à¹à¸¡à¹à¸¡à¸µà¸à¹à¸à¸¡à¸¹à¸¥","No data yet"],offline:["à¸à¸à¸à¹à¸¥à¸à¹","offline"],loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸...","Loading..."],live:["Live","Live"],closed:["Closed","Closed"],tablesCount:["{count} à¹à¸à¹à¸°","{count} Tables"],billsCount:["{count} à¸à¸´à¸¥","{count} Bills"],reloadAll:["à¹à¸«à¸¥à¸à¹à¸«à¸¡à¹à¸à¸±à¹à¸à¸«à¸¡à¸","Reload All"]},actions:{viewTables:["à¸à¸¹à¹à¸à¹à¸°à¸à¸±à¹à¸à¸«à¸¡à¸","View All Tables"],receipts:["à¹à¸à¹à¸ªà¸£à¹à¸","Receipts"],viewReceipts:["à¸à¸¹à¹à¸à¹à¸ªà¸£à¹à¸","View Receipts"]},tableDetail:{summaryTitle:["สรุà¸à¸à¸´à¸¥","Bill Summary"],itemsTitle:["รายà¸à¸²à¸£à¸à¸²à¸«à¸²à¸£","Order Items"]},tableSummary:{time_start:["à¹à¸§à¸¥à¸²à¹à¸£à¸´à¹à¸¡","Time Start"],subtotal:["ราà¸à¸²à¸£à¸§à¸¡","Subtotal"],discountItems:["สà¹à¸§à¸à¸¥à¸à¸£à¸²à¸¢à¸à¸²à¸£","Item Discounts"],serviceCharge:["à¸à¹à¸²à¸à¸£à¸´à¸à¸²à¸£","Service Charge"],additionalDiscount:["สà¹à¸§à¸à¸¥à¸à¹à¸à¸´à¹à¸¡à¹à¸à¸´à¸¡","Additional Discount"],creditCardCharge:["à¸à¹à¸²à¸à¸£à¸£à¸¡à¹à¸à¸µà¸¢à¸¡à¸à¸±à¸à¸£","Card Charge"],vat:["ภาษีมูลà¸à¹à¸²à¹à¸à¸´à¹à¸¡","VAT"],grandTotal:["ยà¸à¸à¸£à¸§à¸¡à¸ªà¸¸à¸à¸à¸´","Grand Total"],toppings:["à¸à¹à¸à¸à¸à¸´à¹à¸","Toppings"]},dateRange:{overallTitle:["ยà¸à¸à¸£à¸§à¸¡à¸à¸¸à¸à¸£à¹à¸²à¸","Overall Total"]},noPermission:{title:["à¹à¸¡à¹à¸¡à¸µà¸ªà¸´à¸à¸à¸´à¹à¸à¸¹à¸£à¸²à¸¢à¸à¸²à¸","No report permission"],body:["à¸à¸±à¸à¸à¸µà¸à¸à¸à¸£à¹à¸²à¸à¸à¸µà¹à¹à¸¡à¹à¸¡à¸µà¸ªà¸´à¸à¸à¸´à¹à¹à¸à¹à¸²à¸à¸¶à¸à¸£à¸²à¸¢à¸à¸²à¸","This shop's account cannot access reports."]}},Kxe={noPermission:{title:["à¹à¸¡à¹à¸¡à¸µà¸ªà¸´à¸à¸à¸´à¹à¹à¸à¹à¸²à¸à¸¶à¸à¸£à¸²à¸¢à¸à¸²à¸","No Report Permission"],body:["à¸à¸±à¸à¸à¸µà¸à¸à¸à¸£à¹à¸²à¸ {shop} à¹à¸¡à¹à¸¡à¸µà¸ªà¸´à¸à¸à¸´à¹à¹à¸à¹à¸²à¸à¸¶à¸à¸£à¸²à¸¢à¸à¸²à¸","The account for {shop} does not have permission to access reports."],confirm:["à¸à¸à¸¥à¸","OK"]},permissionInfo:{title:["à¸à¸¹à¹à¹à¸à¹à¸à¸µà¹à¹à¸à¹à¸²à¸ªà¸¹à¹à¸£à¸°à¸à¸ / สิà¸à¸à¸´à¹à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸","Signed-in user / permissions"]},common:{submit:["Submit","Submit"],submitting:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸...","Loading..."]},index:{title:["รายà¸à¸²à¸","Reports"],description:["à¹à¸¥à¸·à¸à¸à¸£à¸²à¸¢à¸à¸²à¸à¸à¸µà¹à¸à¹à¸à¸à¸à¸²à¸£à¸à¸¹","Select a report to view"],reports:{summaryDaily:["รายà¸à¸²à¸à¸ªà¸£à¸¸à¸","Summary Report"],receipts:["à¹à¸à¹à¸ªà¸£à¹à¸à¸£à¸²à¸¢à¸§à¸±à¸","Daily Receipt"],products:["สิà¸à¸à¹à¸²","Products"],voidItems:["รายà¸à¸²à¸£à¸à¸µà¹à¸¢à¸à¹à¸¥à¸´à¸","Void Items"],openMenu:["à¹à¸¡à¸à¸¹à¸£à¸²à¸à¸²à¹à¸à¸´à¸","Open Menu"],prices:["à¸à¸²à¸£à¹à¸à¸¥à¸µà¹à¸¢à¸à¸£à¸²à¸à¸²","Price Changes"],expense:["à¸à¹à¸²à¹à¸à¹à¸à¹à¸²à¸¢","Expense"],stock:["สà¸à¹à¸à¸à¸à¸à¹à¸«à¸¥à¸·à¸","Stock"],activitiesByTime:["à¸à¸²à¸£à¸ªà¸±à¹à¸à¸à¸²à¸¡à¸à¹à¸§à¸à¹à¸§à¸¥à¸²","Orders by Time Period"]}},summaryDaily:{title:["รายà¸à¸²à¸à¸ªà¸£à¸¸à¸","Summary Report"],filters:{datePlaceholder:["à¹à¸¥à¸·à¸à¸à¸à¹à¸§à¸à¸§à¸±à¸à¸à¸µà¹","Select date range"],showAvailableOnly:["à¹à¸ªà¸à¸à¹à¸à¸à¸²à¸°à¸§à¸±à¸à¸à¸µà¹à¸¡à¸µà¸à¹à¸à¸¡à¸¹à¸¥","Show only days with data"]},states:{loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸à¸à¹à¸à¸¡à¸¹à¸¥...","Loading..."],empty:["à¹à¸¡à¹à¸¡à¸µà¸à¹à¸à¸¡à¸¹à¸¥à¹à¸à¸à¹à¸§à¸à¸§à¸±à¸à¸à¸µà¹à¹à¸¥à¸·à¸à¸","No data for the selected period"]},errors:{fetch:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸¶à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸ªà¸£à¸¸à¸à¸£à¸²à¸¢à¸§à¸±à¸à¹à¸à¹","Failed to load daily summary"]},summary:{total:["ยà¸à¸à¸£à¸§à¸¡","Total"],bills:["à¸à¸³à¸à¸§à¸à¸à¸´à¸¥","Bills"]},table:{date:["วัà¸à¸à¸µà¹","Date"],amount:["ยà¸à¸","Amount"],bills:["à¸à¸´à¸¥","Bills"]}},activitiesByTime:{title:["à¸à¸²à¸£à¸ªà¸±à¹à¸à¸à¸²à¸¡à¸à¹à¸§à¸à¹à¸§à¸¥à¸²","Orders by Time Period"],filters:{datePlaceholder:["à¹à¸¥à¸·à¸à¸à¸à¹à¸§à¸à¸§à¸±à¸à¸à¸µà¹","Select date range"],showActiveOnly:["à¹à¸ªà¸à¸à¹à¸à¸à¸²à¸°à¹à¸§à¸¥à¸²à¸à¸µà¹à¸¡à¸µà¸à¸¸à¸£à¸à¸£à¸£à¸¡","Only hours with activity"],showQty:["à¹à¸ªà¸à¸à¸à¸³à¸à¸§à¸à¸à¸´à¸¥ (Qty)","Show bill count (Qty)"]},metrics:{orders:["à¸à¸²à¸£à¸ªà¸±à¹à¸","Orders"],voids:["ยà¸à¹à¸¥à¸´à¸","Voids"],payments:["à¸à¸³à¸£à¸°à¹à¸à¸´à¸","Payments"]},states:{loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸à¸à¹à¸à¸¡à¸¹à¸¥...","Loading..."],empty:["à¹à¸¡à¹à¸¡à¸µà¸à¹à¸à¸¡à¸¹à¸¥à¹à¸à¸à¹à¸§à¸à¸§à¸±à¸à¸à¸µà¹à¹à¸¥à¸·à¸à¸","No data for the selected period"],rangeLimit:["à¹à¸¥à¸·à¸à¸à¸à¹à¸§à¸à¹à¸à¹à¹à¸¡à¹à¹à¸à¸´à¸ {days} วัà¸","Select a range of at most {days} days"]},errors:{fetch:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸¶à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸à¹","Failed to load data"]},table:{hour:["à¹à¸§à¸¥à¸²","Hour"],overall:["รวม","Overall"],total:["รวมà¸à¸±à¹à¸à¸«à¸¡à¸","Total"]},units:{label:["หà¸à¹à¸§à¸¢","Unit"],baht:["à¸à¸²à¸ (à¹à¸à¹à¸¡)","Baht (full)"],thousand:["à¸à¸±à¸ (K)","Thousand (K)"]},unitSuffix:{baht:["",""],thousand:["K","K"]},hint:["ยà¸à¸à¸à¸²à¸¢ à¹à¸¥à¸°à¸à¸±à¸§à¹à¸¥à¸à¹à¸à¸§à¸à¹à¸¥à¹à¸à¸à¸·à¸à¸à¸³à¸à¸§à¸à¸à¸´à¸¥ (Qty)","Amount · number in parentheses = bill count (Qty)"]},receipts:{title:["à¹à¸à¹à¸ªà¸£à¹à¸à¸£à¸²à¸¢à¸§à¸±à¸","Daily Receipt"],filters:{datePlaceholder:["à¹à¸¥à¸·à¸à¸à¸à¹à¸§à¸à¸§à¸±à¸à¸à¸µà¹","Select date range"]},states:{loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸à¸à¹à¸à¸¡à¸¹à¸¥...","Loading..."],empty:["à¹à¸¡à¹à¸¡à¸µà¹à¸à¹à¸ªà¸£à¹à¸à¹à¸à¸à¹à¸§à¸à¸§à¸±à¸à¸à¸µà¹à¹à¸¥à¸·à¸à¸","No receipts for the selected period"]},errors:{fetch:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸¶à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸à¹à¸ªà¸£à¹à¸à¹à¸à¹","Failed to load receipts"]},summary:{grandTotal:["ยà¸à¸à¸£à¸§à¸¡","Total"],bills:["à¸à¸³à¸à¸§à¸à¸à¸´à¸¥","Bills"],guests:["ลูà¸à¸à¹à¸²","Guests"]},table:{time:["à¹à¸§à¸¥à¸²","Time"],table:["à¹à¸à¹à¸°","Table"],amount:["ยà¸à¸","Amount"]},modal:{title:["รายละà¹à¸à¸µà¸¢à¸à¹à¸à¹à¸ªà¸£à¹à¸","Receipt Detail"],subtitle:["รายà¸à¸²à¸£à¸ªà¸´à¸à¸à¹à¸²","Order Items"],fields:{receiptNo:["à¹à¸¥à¸à¸à¸µà¹à¹à¸à¹à¸ªà¸£à¹à¸","Receipt No."],time:["à¹à¸§à¸¥à¸²","Time"],paymentType:["วิà¸à¸µà¸à¸³à¸£à¸°à¹à¸à¸´à¸","Payment Type"],table:["à¹à¸à¹à¸°","Table"],tableGuests:["à¹à¸à¹à¸° {table} ({guests} à¸à¸)","Table {table} ({guests} guests)"]}},totals:{subTotal:["ราà¸à¸²à¸£à¸§à¸¡","Subtotal"],itemDiscounts:["สà¹à¸§à¸à¸¥à¸à¸£à¸²à¸¢à¸à¸²à¸£","Item Discounts"],discount:["สà¹à¸§à¸à¸¥à¸","Discount"],serviceCharge:["à¸à¹à¸²à¸à¸£à¸´à¸à¸²à¸£","Service Charge"],cardCharge:["à¸à¹à¸²à¸à¸£à¸£à¸¡à¹à¸à¸µà¸¢à¸¡à¸à¸±à¸à¸£","Card Charge"],tax:["ภาษี","Tax"],grandTotal:["ยà¸à¸à¸£à¸§à¸¡à¸ªà¸¸à¸à¸à¸´","Grand Total"]},actions:{close:["à¸à¸´à¸","Close"]}},products:{title:["รายà¸à¸²à¸à¸ªà¸´à¸à¸à¹à¸²","Products Report"],filters:{datePlaceholder:["à¹à¸¥à¸·à¸à¸à¸à¹à¸§à¸à¸§à¸±à¸à¸à¸µà¹","Select date range"],onlySales:["à¹à¸ªà¸à¸à¹à¸à¸à¸²à¸°à¸ªà¸´à¸à¸à¹à¸²à¸à¸µà¹à¸¡à¸µà¸¢à¸à¸à¸à¸²à¸¢","Show only items with sales"]},states:{loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸à¸à¹à¸à¸¡à¸¹à¸¥...","Loading..."],empty:["à¹à¸¡à¹à¸¡à¸µà¸à¹à¸à¸¡à¸¹à¸¥à¸ªà¸´à¸à¸à¹à¸²à¹à¸à¸à¹à¸§à¸à¸§à¸±à¸à¸à¸µà¹à¹à¸¥à¸·à¸à¸","No product data for the selected period"]},errors:{fetch:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸¶à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸ªà¸´à¸à¸à¹à¸²à¹à¸à¹","Failed to load products data"]}},voidItems:{title:["รายà¸à¸²à¸£à¸à¸µà¹à¸¢à¸à¹à¸¥à¸´à¸","Void Items"],filters:{datePlaceholder:["à¹à¸¥à¸·à¸à¸à¸à¹à¸§à¸à¸§à¸±à¸à¸à¸µà¹","Select date range"]},states:{loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸à¸à¹à¸à¸¡à¸¹à¸¥...","Loading..."],empty:["à¹à¸¡à¹à¸¡à¸µà¸£à¸²à¸¢à¸à¸²à¸£à¸à¸µà¹à¸¢à¸à¹à¸¥à¸´à¸à¹à¸à¸à¹à¸§à¸à¸§à¸±à¸à¸à¸µà¹à¹à¸¥à¸·à¸à¸","No void items for the selected period"]},errors:{fetch:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸¶à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸£à¸²à¸¢à¸à¸²à¸£à¸à¸µà¹à¸¢à¸à¹à¸¥à¸´à¸à¹à¸à¹","Failed to load void items"]}},openMenu:{title:["รายà¸à¸²à¸à¹à¸¡à¸à¸¹à¸£à¸²à¸à¸²à¹à¸à¸´à¸","Open Me
167nu Report"],filters:{datePlaceholder:["à¹à¸¥à¸·à¸à¸à¸à¹à¸§à¸à¸§à¸±à¸à¸à¸µà¹","Select date range"]},states:{loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸à¸à¹à¸à¸¡à¸¹à¸¥...","Loading..."],empty:["à¹à¸¡à¹à¸¡à¸µà¸à¹à¸à¸¡à¸¹à¸¥à¹à¸¡à¸à¸¹à¸£à¸²à¸à¸²à¹à¸à¸´à¸à¹à¸à¸à¹à¸§à¸à¸§à¸±à¸à¸à¸µà¹à¹à¸¥à¸·à¸à¸","No open menu items for the selected period"]},errors:{fetch:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸¶à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸¡à¸à¸¹à¸£à¸²à¸à¸²à¹à¸à¸´à¸à¹à¸à¹","Failed to load open menu data"]},summary:{totalItems:["รายà¸à¸²à¸£à¸à¸±à¹à¸à¸«à¸¡à¸","Total Items"],daysCount:["à¸à¸³à¸à¸§à¸à¸§à¸±à¸","Days"]},voided:["ยà¸à¹à¸¥à¸´à¸","Voided"]},prices:{title:["รายà¸à¸²à¸à¸à¸²à¸£à¹à¸à¸¥à¸µà¹à¸¢à¸à¸£à¸²à¸à¸²","Price Changes Report"],filters:{datePlaceholder:["à¹à¸¥à¸·à¸à¸à¸à¹à¸§à¸à¸§à¸±à¸à¸à¸µà¹","Select date range"]},states:{loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸à¸à¹à¸à¸¡à¸¹à¸¥...","Loading..."],empty:["à¹à¸¡à¹à¸¡à¸µà¸à¹à¸à¸¡à¸¹à¸¥à¸à¸²à¸£à¹à¸à¸¥à¸µà¹à¸¢à¸à¸£à¸²à¸à¸²à¹à¸à¸à¹à¸§à¸à¸§à¸±à¸à¸à¸µà¹à¹à¸¥à¸·à¸à¸","No price changes for the selected period"]},errors:{fetch:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸¶à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸²à¸£à¹à¸à¸¥à¸µà¹à¸¢à¸à¸£à¸²à¸à¸²à¹à¸à¹","Failed to load price changes"]},summary:{totalEdits:["à¸à¸²à¸£à¹à¸à¹à¹à¸à¸à¸±à¹à¸à¸«à¸¡à¸","Total Edits"],daysCount:["à¸à¸³à¸à¸§à¸à¸§à¸±à¸","Days"]}},expense:{title:["รายà¸à¸²à¸à¸à¹à¸²à¹à¸à¹à¸à¹à¸²à¸¢","Expense Report"],filters:{monthPlaceholder:["à¹à¸¥à¸·à¸à¸à¹à¸à¸·à¸à¸","Select month"],datePlaceholder:["à¹à¸¥à¸·à¸à¸à¸§à¸±à¸à¸à¸µà¹","Select date"]},states:{loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸à¸à¹à¸à¸¡à¸¹à¸¥...","Loading..."],empty:["à¹à¸¡à¹à¸¡à¸µà¸à¹à¸²à¹à¸à¹à¸à¹à¸²à¸¢à¹à¸à¸§à¸±à¸à¸à¸µà¹à¹à¸¥à¸·à¸à¸","No expenses for the selected day"]},errors:{fetch:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸¶à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸à¹à¸²à¹à¸à¹à¸à¹à¸²à¸¢à¹à¸à¹","Failed to load expense data"]},summary:{monthlyTotal:["ยà¸à¸à¸£à¸§à¸¡à¸§à¸±à¸à¸à¸µà¹","Daily Total"],transactionCount:["à¸à¸³à¸à¸§à¸à¸£à¸²à¸¢à¸à¸²à¸£","Transactions"],byCategory:["à¹à¸¢à¸à¸à¸²à¸¡à¸«à¸¡à¸§à¸à¸«à¸¡à¸¹à¹","By Category"]}},stock:{title:["สà¸à¹à¸à¸à¸à¸à¹à¸«à¸¥à¸·à¸","Stock Balance"],reload:["à¹à¸«à¸¥à¸à¹à¸«à¸¡à¹","Reload"],columns:{balance:["à¸à¸à¹à¸«à¸¥à¸·à¸","Balance"]},states:{loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸à¸à¹à¸à¸¡à¸¹à¸¥...","Loading..."],empty:["ยัà¸à¹à¸¡à¹à¸¡à¸µà¸£à¸²à¸¢à¸à¸²à¸£à¸ªà¸à¹à¸à¸","No stock items"]},errors:{fetch:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸¶à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸ªà¸à¹à¸à¸à¹à¸à¹","Failed to load stock data"]}}},zxe={account:qxe,login:jxe,sessionExpired:Wxe,dashboard:Gxe,reports:Kxe},Yxe=["à¸à¸à¸à¸à¸µà¹","Live"],Jxe=["รายวัà¸","Date"],Qxe=["รายà¹à¸à¸·à¸à¸","Month"],Xxe=["รายà¸à¸µ","Year"],Zxe=["หà¸à¹à¸²à¸«à¸¥à¸±à¸","Dashboard"],eLe=["รายà¸à¸²à¸","Reports"],tLe=["à¸à¸±à¸à¸à¸µ","Account"],nLe=["à¹à¸¥à¸·à¸à¸à¸ªà¸²à¸à¸²","Select Branch"],rLe=["à¹à¸à¸·à¹à¸à¸¡à¸à¹à¸à¸£à¹à¸²à¸à¸à¹à¸²","Link Store"],sLe=["à¹à¸à¸¥à¸µà¹à¸¢à¸","Change"],iLe={live:Yxe,by_date:Jxe,by_month:Qxe,by_year:Xxe,dashboard:Zxe,reports:eLe,account:tLe,select_branch:nLe,link_store:rLe,switch_shop:sLe},oLe=["à¹à¸à¹à¸²à¸ªà¸¹à¹à¸£à¸°à¸à¸","Sign in"],aLe={username:["Username หรืà¸à¸à¸µà¹à¸¡à¸¥","Username or email"],password:["รหัสà¸à¹à¸²à¸","Password"]},cLe={remember:["à¸à¸à¸à¸³à¸à¸±à¸à¹à¸§à¹","Remember me"],forgot:["ลืมรหัสà¸à¹à¸²à¸?","Forgot password?"]},lLe={login:["à¹à¸à¹à¸²à¸ªà¸¹à¹à¸£à¸°à¸à¸","Login"],loading:["à¸à¸³à¸¥à¸±à¸à¹à¸à¹à¸²à¸ªà¸¹à¹à¸£à¸°à¸à¸...","Signing in..."]},uLe={home:["à¸à¸¥à¸±à¸à¸«à¸à¹à¸²à¸«à¸¥à¸±à¸","Back to home"],register:["สมัà¸à¸£à¸ªà¸¡à¸²à¸à¸´à¸","Register"]},dLe=["© Niceloop. All rights reserved.","© Niceloop. All rights reserved."],hLe={invalid:["Username หรืภรหัสà¸à¹à¸²à¸à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸","Invalid username or password"]},fLe={title:oLe,placeholders:aLe,options:cLe,buttons:lLe,links:uLe,copy:dLe,alerts:hLe},pLe=["สมัà¸à¸£à¹à¸à¹à¸à¸²à¸","Create your account"],mLe=["à¸à¸à¸¥à¸à¸à¹à¸à¹à¸à¸£à¸µ 15 วัภà¹à¸¡à¹à¸à¹à¸à¸à¹à¸à¹à¸à¸±à¸à¸£à¹à¸à¸£à¸à¸´à¸","Free 15-day trial, no credit card required"],gLe={account:["à¸à¸±à¸à¸à¸µà¸à¸¹à¹à¹à¸à¹","Your login"],shop:["à¸à¹à¸à¸¡à¸¹à¸¥à¸£à¹à¸²à¸","Shop details"],terms:["à¹à¸à¸·à¹à¸à¸à¹à¸à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸","Terms of service"]},_Le={email:["à¸à¸µà¹à¸¡à¸¥","Email"],password:["รหัสà¸à¹à¸²à¸","Password"],confirmPassword:["ยืà¸à¸¢à¸±à¸à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸","Confirm password"],package:["à¹à¸à¹à¸à¹à¸à¸","Package"],shopName:["à¸à¸·à¹à¸à¸£à¹à¸²à¸","Shop name"],province:["à¸à¸±à¸à¸«à¸§à¸±à¸","Province"],table:["à¸à¸³à¸à¸§à¸à¹à¸à¹à¸°","Number of tables"],emailReport:["à¸à¸µà¹à¸¡à¸¥à¸£à¸±à¸à¸£à¸²à¸¢à¸à¸²à¸","Report email"],smsReport:["à¹à¸à¸à¸£à¹à¸£à¸±à¸ SMS รายà¸à¸²à¸","Report SMS number"],promotionCode:["รหัสà¸à¸à¸±à¸à¸à¸²à¸à¸à¸²à¸¢","Sales code"],optional:["à¹à¸¡à¹à¸à¸±à¸à¸à¸±à¸","optional"],captcha:["ยืà¸à¸¢à¸±à¸à¸§à¹à¸²à¹à¸¡à¹à¹à¸à¹à¸à¸à¸","Confirm you are not a robot"]},yLe={email:["à¸à¸µà¹à¸¡à¸¥à¸à¸µà¹à¹à¸à¹à¹à¸à¹à¸²à¸ªà¸¹à¹à¸£à¸°à¸à¸","The email you will sign in with"],password:["à¸à¸¢à¹à¸²à¸à¸à¹à¸à¸¢ 6 à¸à¸±à¸§à¸à¸±à¸à¸©à¸£","At least 6 characters"],confirmPassword:["à¸à¸´à¸¡à¸à¹à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸à¸à¸µà¸à¸à¸£à¸±à¹à¸","Re-enter your password"],shopName:["à¸à¸·à¹à¸à¸£à¹à¸²à¸à¸à¸à¸à¸à¸¸à¸","Your shop name"],province:["--------- à¹à¸¥à¸·à¸à¸à¸à¸±à¸à¸«à¸§à¸±à¸ ---------","--------- Select a province ---------"],table:["à¸à¸³à¸à¸§à¸à¹à¸à¹à¸°à¸à¸µà¹à¹à¸«à¹à¸à¸£à¸´à¸à¸²à¸£","Tables you serve"],emailReport:["à¸à¸µà¹à¸¡à¸¥à¸à¸µà¹à¸à¹à¸à¸à¸à¸²à¸£à¹à¸«à¹à¸ªà¹à¸à¸£à¸²à¸¢à¸à¸²à¸à¸¢à¸à¸à¸à¸²à¸¢","Where to send your sales reports"],smsReport:["à¹à¸à¸à¸£à¹à¸¡à¸·à¸à¸à¸·à¸à¸à¸µà¹à¸à¹à¸à¸à¸à¸²à¸£à¹à¸«à¹à¸ªà¹à¸à¸£à¸²à¸¢à¸à¸²à¸à¸¢à¸à¸à¸à¸²à¸¢","Mobile number for sales report SMS"],promotionCode:["à¸à¹à¸²à¸¡à¸µ","If you have one"],captcha:["à¸à¸à¸ 4 หรืภ๠à¸à¹à¹à¸à¹","Answer 4 or à¹"]},vLe={accept:["à¸à¸±à¸à¹à¸à¹à¸à¹à¸²à¸à¸à¹à¸à¸à¸à¸¥à¸à¹à¸¥à¸°à¸¢à¸à¸¡à¸£à¸±à¸à¹à¸à¸·à¹à¸à¸à¹à¸à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸","I have read and accept the terms of service"],body:[`1. à¸à¸¹à¹à¹à¸à¹à¸à¸£à¸´à¸à¸²à¸£à¸à¸à¸¥à¸à¹à¸à¹à¸£à¸°à¸à¸ Niceloop POS à¸à¸²à¸¡à¹à¸à¸·à¹à¸à¸à¹à¸à¸à¸µà¹à¸à¸³à¸«à¸à¸à¹à¸§à¹à¸à¸µà¹ à¹à¸¥à¸°à¸£à¸±à¸à¸à¸£à¸²à¸à¸§à¹à¸²à¸à¸±à¸à¸à¸µà¸à¸µà¹à¸ªà¸¡à¸±à¸à¸£à¹à¸à¹à¸à¸à¸±à¸à¸à¸µà¸à¸à¸¥à¸à¸à¹à¸à¹à¸à¸²à¸à¸à¸£à¸µ 15 วัภà¸à¸±à¸à¸à¸²à¸à¸§à¸±à¸à¸à¸µà¹à¸ªà¸¡à¸±à¸à¸£ 168 1692. à¸à¸¹à¹à¹à¸à¹à¸à¸£à¸´à¸à¸²à¸£à¸¡à¸µà¸«à¸à¹à¸²à¸à¸µà¹à¸£à¸±à¸à¸©à¸²à¸à¸·à¹à¸à¸à¸¹à¹à¹à¸à¹à¹à¸¥à¸°à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸à¹à¸§à¹à¹à¸à¹à¸à¸à¸§à¸²à¸¡à¸¥à¸±à¸ à¸
169ารà¸à¸£à¸°à¸à¸³à¹à¸ ๠à¸à¸µà¹à¹à¸à¸´à¸à¸à¸¶à¹à¸à¸ ายà¹à¸à¹à¸à¸±à¸à¸à¸µà¸à¸à¸à¸à¸¹à¹à¹à¸à¹à¸à¸£à¸´à¸à¸²à¸£ à¸à¸·à¸à¹à¸à¹à¸à¸à¸²à¸£à¸à¸£à¸°à¸à¸³à¸à¸à¸à¸à¸¹à¹à¹à¸à¹à¸à¸£à¸´à¸à¸²à¸£à¹à¸à¸ 170 1713. à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸²à¸£à¸à¸²à¸¢ à¸à¹à¸à¸¡à¸¹à¸¥à¸ªà¸´à¸à¸à¹à¸² à¹à¸¥à¸°à¸à¹à¸à¸¡à¸¹à¸¥à¸£à¹à¸²à¸à¸à¹à¸²à¸à¸µà¹à¸à¸±à¸à¸à¸¶à¸à¹à¸à¸£à¸°à¸à¸ à¹à¸à¹à¸à¸à¸£à¸£à¸¡à¸ªà¸´à¸à¸à¸´à¹à¸à¸à¸à¸à¸¹à¹à¹à¸à¹à¸à¸£à¸´à¸à¸²à¸£ Niceloop à¸à¸°à¹à¸à¹à¸à¸£à¸±à¸à¸©à¸²à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸±à¸à¸à¸¥à¹à¸²à¸§à¹à¸§à¹à¹à¸à¸·à¹à¸à¸à¸²à¸£à¹à¸«à¹à¸à¸£à¸´à¸à¸²à¸£à¹à¸à¹à¸²à¸à¸±à¹à¸ à¹à¸¥à¸°à¸à¸°à¹à¸¡à¹à¹à¸à¸´à¸à¹à¸à¸¢à¸à¹à¸à¸à¸¸à¸à¸à¸¥à¸ ายà¸à¸à¸à¹à¸à¸¢à¹à¸¡à¹à¹à¸à¹à¸£à¸±à¸à¸à¸§à¸²à¸¡à¸¢à¸´à¸à¸¢à¸à¸¡ à¹à¸§à¹à¸à¹à¸à¹à¹à¸à¹à¸à¸à¸²à¸£à¸à¸à¸´à¸à¸±à¸à¸´à¸à¸²à¸¡à¸à¸à¸«à¸¡à¸²à¸¢ 172 1734. Niceloop à¸à¸²à¸à¸à¸£à¸±à¸à¸à¸£à¸¸à¸à¸«à¸£à¸·à¸à¸«à¸¢à¸¸à¸à¹à¸«à¹à¸à¸£à¸´à¸à¸²à¸£à¸à¸²à¸à¸ªà¹à¸§à¸à¹à¸à¸·à¹à¸à¸à¸²à¸£à¸à¸³à¸£à¸¸à¸à¸£à¸±à¸à¸©à¸²à¸£à¸°à¸à¸ à¹à¸à¸¢à¸à¸°à¹à¸à¹à¸à¹à¸«à¹à¸à¸£à¸²à¸à¸¥à¹à¸§à¸à¸«à¸à¹à¸²à¸à¸²à¸¡à¸ªà¸¡à¸à¸§à¸£ 174 1755. à¹à¸¡à¸·à¹à¸à¸ªà¸´à¹à¸à¸ªà¸¸à¸à¸£à¸°à¸¢à¸°à¹à¸§à¸¥à¸²à¸à¸à¸¥à¸à¸à¹à¸à¹à¸à¸²à¸ หาà¸à¸à¸¹à¹à¹à¸à¹à¸à¸£à¸´à¸à¸²à¸£à¹à¸¡à¹à¸à¸³à¸£à¸°à¸à¹à¸²à¸à¸£à¸´à¸à¸²à¸£à¸à¸²à¸¡à¹à¸à¹à¸à¹à¸à¸à¸à¸µà¹à¹à¸¥à¸·à¸à¸à¹à¸§à¹ ระà¸à¸à¸à¸°à¸£à¸°à¸à¸±à¸à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸à¸à¸±à¹à¸§à¸à¸£à¸²à¸§ à¹à¸à¹à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸°à¸¢à¸±à¸à¸à¸à¸à¸¹à¸à¹à¸à¹à¸à¸£à¸±à¸à¸©à¸²à¹à¸§à¹à¸à¸²à¸¡à¸£à¸°à¸¢à¸°à¹à¸§à¸¥à¸²à¸à¸µà¹ Niceloop à¸à¸³à¸«à¸à¸ 176 1776. à¸à¸¹à¹à¹à¸à¹à¸à¸£à¸´à¸à¸²à¸£à¸à¸à¸¥à¸à¹à¸¡à¹à¹à¸à¹à¸£à¸°à¸à¸à¹à¸à¸·à¹à¸à¸à¸²à¸£à¹à¸ ๠à¸à¸µà¹à¸à¸±à¸à¸à¹à¸à¸à¸à¸«à¸¡à¸²à¸¢ à¹à¸¥à¸°à¹à¸¡à¹à¸à¸³à¸§à¸´à¸¨à¸§à¸à¸£à¸£à¸¡à¸¢à¹à¸à¸à¸à¸¥à¸±à¸ à¸à¸³à¸à¹à¸³ หรืà¸à¸à¸±à¸à¹à¸à¸¥à¸à¸£à¸°à¸à¸`,`1. You agree to use Niceloop POS under these terms, and acknowledge that this account is a free trial valid for 15 days from the date of registration. 178 1792. You are responsible for keeping your username and password confidential. Any activity under your account is treated as your own. 180 1813. Sales data, product data and shop data recorded in the system belong to you. Niceloop stores it solely to provide the service and will not disclose it to third parties without your consent, except as required by law. 182 1834. Niceloop may update or temporarily suspend parts of the service for maintenance, with reasonable prior notice. 184 1855. When the trial period ends, if you do not pay for the package you selected, access is suspended, though your data is retained for the period Niceloop specifies. 186 1876. You agree not to use the system for any unlawful purpose, and not to reverse-engineer, copy or modify it.`]},bLe={submit:["สมัà¸à¸£à¹à¸à¹à¸à¸²à¸","Create account"],loading:["à¸à¸³à¸¥à¸±à¸à¸ªà¸¡à¸±à¸à¸£...","Creating account..."],next:["à¸à¸±à¸à¹à¸","Next"],back:["ยà¹à¸à¸à¸à¸¥à¸±à¸","Back"],checking:["à¸à¸³à¸¥à¸±à¸à¸à¸£à¸§à¸à¸ªà¸à¸...","Checking..."]},wLe={emailRequired:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸à¸à¸à¸µà¹à¸¡à¸¥","Email is required"],emailInvalid:["รูà¸à¹à¸à¸à¸à¸µà¹à¸¡à¸¥à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸","Enter a valid email address"],emailTaken:["à¸à¸µà¹à¸¡à¸¥à¸à¸µà¹à¸à¸¹à¸à¹à¸à¹à¸ªà¸¡à¸±à¸à¸£à¹à¸à¹à¸¥à¹à¸§ à¸à¸£à¸¸à¸à¸²à¹à¸à¹à¸à¸µà¹à¸¡à¸¥à¸à¸·à¹à¸","This email is already registered. Please use another one."],passwordRequired:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸à¸à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸","Password is required"],passwordTooShort:["รหัสà¸à¹à¸²à¸à¸à¹à¸à¸à¸¢à¸²à¸§à¸à¸¢à¹à¸²à¸à¸à¹à¸à¸¢ 6 à¸à¸±à¸§à¸à¸±à¸à¸©à¸£","Password must be at least 6 characters"],confirmRequired:["à¸à¸£à¸¸à¸à¸²à¸¢à¸·à¸à¸¢à¸±à¸à¸£à¸«à¸±à¸ªà¸à¹à¸²à¸","Please confirm your password"],confirmMismatch:["รหัสà¸à¹à¸²à¸à¹à¸¡à¹à¸à¸£à¸à¸à¸±à¸","Passwords do not match"],shopNameRequired:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸à¸à¸à¸·à¹à¸à¸£à¹à¸²à¸","Shop name is required"],provinceRequired:["à¸à¸£à¸¸à¸à¸²à¹à¸¥à¸·à¸à¸à¸à¸±à¸à¸«à¸§à¸±à¸","Please select a province"],tableRequired:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸à¸à¸à¸³à¸à¸§à¸à¹à¸à¹à¸°","Number of tables is required"],tableRange:["à¸à¸³à¸à¸§à¸à¹à¸à¹à¸°à¸à¹à¸à¸à¸à¸¢à¸¹à¹à¸£à¸°à¸«à¸§à¹à¸²à¸ 1-100","Number of tables must be between 1 and 100"],emailReportRequired:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸à¸à¸à¸µà¹à¸¡à¸¥à¸£à¸±à¸à¸£à¸²à¸¢à¸à¸²à¸","Report email is required"],emailReportInvalid:["รูà¸à¹à¸à¸à¸à¸µà¹à¸¡à¸¥à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸","Enter a valid email address"],smsInvalid:["à¹à¸à¸à¸£à¹à¸¡à¸·à¸à¸à¸·à¸à¸à¹à¸à¸à¹à¸à¹à¸à¸à¸±à¸§à¹à¸¥à¸ 7-12 หลัà¸","Mobile number must be 7-12 digits"],captchaRequired:["à¸à¸£à¸¸à¸à¸²à¸à¸à¸à¹à¸à¸à¸¢à¹","Please answer the question"],captchaWrong:["à¸à¸à¸à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸ à¸à¸£à¸¸à¸à¸²à¸¥à¸à¸à¹à¸«à¸¡à¹","Incorrect answer, please try again"],captchaUnavailable:["à¹à¸«à¸¥à¸à¹à¸à¸à¸¢à¹à¹à¸¡à¹à¸ªà¸³à¹à¸£à¹à¸ à¸à¸£à¸¸à¸à¸²à¸à¸à¹à¸à¸¥à¸µà¹à¸¢à¸à¹à¸à¸à¸¢à¹",'Could not load the question â please tap "New question"']},SLe={failedTitle:["สมัà¸à¸£à¹à¸¡à¹à¸ªà¸³à¹à¸£à¹à¸","Sign-up failed"],failedText:["à¸à¸£à¸¸à¸à¸²à¸à¸£à¸§à¸à¸ªà¸à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸¥à¹à¸§à¸¥à¸à¸à¹à¸«à¸¡à¹à¸à¸µà¸à¸à¸£à¸±à¹à¸","Please check your details and try again."]},TLe={of:["à¸à¸±à¹à¸à¸à¸à¸à¸à¸µà¹ {current} à¸à¸²à¸ {total}","Step {current} of {total}"]},ELe={question:["{a} + {b} = ?","{a} + {b} = ?"],refresh:["à¹à¸à¸¥à¸µà¹à¸¢à¸à¹à¸à¸à¸¢à¹","New question"],loading:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸à¹à¸à¸à¸¢à¹...","Loading question..."]},ILe={title:pLe,subtitle:mLe,sections:gLe,labels:_Le,placeholders:yLe,package:{perMonth:["/ à¹à¸à¸·à¸à¸","/ month"]},terms:vLe,buttons:bLe,errors:wLe,alerts:SLe,steps:TLe,captcha:ELe},CLe={offline:["à¸à¸à¸à¹à¸¥à¸à¹","Offline"],changeNotice:["à¹à¸à¹à¸° {table} à¹à¸à¸´à¸à¸à¸à¸ {amount}","Table {table} change {amount}"],lock:{withUser:["ลà¹à¸à¸à¸«à¸à¹à¸²à¸à¸","Lock screen"],default:["ลà¹à¸à¸à¸«à¸à¹à¸²à¸à¸","Lock screen"]},refId:["รหัสรà¹à¸²à¸ {id}","Ref {id}"],logout:["à¸à¸à¸à¸à¸²à¸à¸£à¸°à¸à¸","Logout"]},ALe={title:["à¹à¸¡à¸à¸¹à¸«à¸¥à¸±à¸","Main Menu"],version:["à¹à¸§à¸à¸£à¹à¸à¸±à¸ {version}","Version {version}"],devLabel:["(DEV)","(DEV)"],items:{home:["หà¸à¹à¸²à¸«à¸¥à¸±à¸","Home"],pos:["POS","POS"],reports:["รายà¸à¸²à¸","Reports"],manager:["à¸à¸±à¸à¸à¸²à¸£à¹à¸¡à¸à¸¹","Manager"],expenses:["à¸à¹à¸²à¹à¸à¹à¸à¹à¸²à¸¢","Expenses"],settings:["à¸à¸±à¹à¸à¸à¹à¸²","Settings"],download:["à¸à¸²à¸§à¸à¹à¹à¸«à¸¥à¸","Download"],mobileOrder:["Mobile Order","Mobile Order"],addDay:["à¸à¹à¸à¸à¸²à¸¢à¸¸à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸","Add Days"],editBill:["à¸à¸±à¸à¸à¸²à¸£à¹à¸à¹à¸ªà¸£à¹à¸","Edit Bill"],ownerReports:["รายà¸à¸²à¸à¸ªà¸³à¸«à¸£à¸±à¸à¹à¸à¹à¸²à¸à¸à¸","Owner Reports"],stock:["สà¸à¹à¸à¸","Stock"],v2:["V2 (Preview)","V2 (Preview)"]}},RLe={items:{home:["Home","Home"],pos:["à¸à¸²à¸£à¸à¸²à¸¢ / à¹à¸à¹à¸°","POS"],expenses:["à¸à¹à¸²à¹à¸à¹à¸à¹à¸²à¸¢","Expenses"],stock:["สà¸à¹à¸à¸","Stock"],report:["รายà¸à¸²à¸","Report"],menu:["à¹à¸¡à¸à¸¹","Menu"],settings:["à¸à¸±à¹à¸à¸à¹à¸²","Settings"],editBill:["à¸à¸±à¸à¸à¸²à¸£à¹à¸à¹à¸ªà¸£à¹à¸","Edit Bill"]},expand:["à¸à¸¢à¸²à¸¢à¹à¸à¸à¹à¸¡à¸à¸¹","Expand sidebar"],collapse:["ยà¹à¸à¹à¸à¸à¹à¸¡à¸à¸¹","Collapse sidebar"],darkMode:["Dark mode","Dark mode"],toLight:["à¹à¸à¸¥à¸µà¹à¸¢à¸à¹à¸à¹à¸à¹à¸«à¸¡à¸à¸ªà¸§à¹à¸²à¸","Switch to light mode"],toDark:["à¹à¸à¸¥à¸µà¹à¸¢à¸à¹à¸à¹à¸à¹à¸«à¸¡à¸à¸¡à¸·à¸","Switch to dark mode"],disableDark:["à¸à¸´à¸à¹à¸«à¸¡à¸à¸¡à¸·à¸","Disable dark mode"],enableDark:["à¹à¸à¸´à¸à¹à¸«à¸¡à¸à¸¡à¸·à¸","Enable dark mode"],version:["Version","Version"]},PLe={sr:["à¸à¸³à¸¥à¸±à¸à¹à¸«à¸¥à¸...","Loading..."],message:["à¸à¸³à¸¥à¸±à¸à¹à¸à¸£à¸µà¸¢à¸¡à¸£à¸°à¸à¸...","Loading..."]},kLe={title:["à¸à¸à¸à¸à¸²à¸à¸£à¸°à¸à¸","Logout"],text:["à¸à¸¸à¸à¸à¹à¸à¸à¸à¸²à¸£à¸à¸à¸à¸à¸²à¸à¸£à¸°à¸à¸à¹à¸à¹à¸«à¸£à¸·à¸à¹à¸¡à¹?","Are you sure you want to log out?"],confirm:["à¹à¸à¹, à¸à¸à¸à¸à¸²à¸à¸£à¸°à¸à¸","Yes, log out"],cancel:["ยà¸à¹à¸¥à¸´à¸","Cancel"]},NLe={header:CLe,menu:ALe,leftRail:RLe,loading:PLe,logoutDialog:kLe}
187,DLe=["à¹à¸¥à¸·à¸à¸à¹à¸«à¸¡à¸à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸","Select Run Mode"],OLe={cashier:{button:["à¹à¸à¸£à¸·à¹à¸à¸à¹à¸à¸à¹à¸à¸µà¸¢à¸£à¹ (Main Cashier)","Main Cashier"],description:["à¹à¸«à¸¡à¸à¸«à¸¥à¸±à¸à¸ªà¸³à¸«à¸£à¸±à¸à¹à¸à¸£à¸·à¹à¸à¸à¹à¸à¹à¸à¹à¸à¸´à¸ รà¸à¸à¸£à¸±à¸à¸à¸²à¸£à¸à¸³à¸£à¸°à¹à¸à¸´à¸à¹à¸¥à¸°à¸à¸±à¸à¸à¸²à¸£à¸à¸´à¸¥à¹à¸à¹à¸¡à¸£à¸¹à¸à¹à¸à¸","Main cashier mode with full payment and bill management."]},terminal:{button:["สัà¹à¸à¸à¸²à¸«à¸²à¸£à¹à¸à¹à¸²à¸à¸±à¹à¸ (Terminal)","Terminal"],description:["à¹à¸«à¸¡à¸à¸ªà¸³à¸«à¸£à¸±à¸à¹à¸à¹à¸£à¸±à¸à¸à¸à¹à¸à¸à¸£à¹ à¹à¸¡à¹à¸£à¸à¸à¸£à¸±à¸à¸à¸²à¸£à¸à¸³à¸£à¸°à¹à¸à¸´à¸","Order terminal mode without payment support."]},readonly:{button:["à¸à¹à¸²à¸à¸à¸¢à¹à¸²à¸à¹à¸à¸µà¸¢à¸§ (Read Only)","Read Only"],description:["à¸à¸¹à¸à¹à¸à¸¡à¸¹à¸¥à¸£à¹à¸²à¸à¹à¸à¹à¸à¸¢à¹à¸²à¸à¹à¸à¸µà¸¢à¸§ à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¹à¹à¸à¸«à¸£à¸·à¸à¸ªà¸±à¹à¸à¸à¸²à¸à¹à¸à¹","View-only mode. No editing or actions allowed."]},"2nd_cashier":{button:["à¹à¸à¸£à¸·à¹à¸à¸à¹à¸à¸à¹à¸à¸µà¸¢à¸£à¹à¹à¸ªà¸£à¸´à¸¡ (Second Cashier)","Second Cashier"],description:["à¹à¸à¹à¸à¸²à¸à¸£à¹à¸§à¸¡à¸à¸±à¸à¹à¸à¸£à¸·à¹à¸à¸à¹à¸à¸à¹à¸à¸µà¸¢à¸£à¹à¸«à¸¥à¸±à¸ รà¸à¸à¸£à¸±à¸à¸à¸²à¸£à¸à¸³à¸£à¸°à¹à¸à¸´à¸à¹à¸à¸¢à¹à¸¡à¹à¸à¹à¸à¸à¸¥à¹à¸à¸à¹à¸à¸£à¸·à¹à¸à¸à¸«à¸¥à¸±à¸","Shared POS runtime with payment support, without main cashier controller lock."]}},xLe={title:["à¹à¸à¸£à¸·à¹à¸à¸à¹à¸à¸à¹à¸à¸µà¸¢à¸£à¹à¸à¸¹à¸à¹à¸à¹à¸à¸²à¸à¸à¸¢à¸¹à¹","Cashier In Use"],body:["มีà¸à¸¸à¸à¸à¸£à¸à¹à¸à¸·à¹à¸à¸à¸³à¸¥à¸±à¸à¹à¸à¹à¸à¸²à¸à¹à¸à¸à¹à¸à¸µà¸¢à¸£à¹à¸à¸µà¹à¸à¸¢à¸¹à¹ à¸à¹à¸à¸à¸à¸²à¸£à¸à¸¶à¸à¸ªà¸´à¸à¸à¸´à¹à¸¡à¸²à¹à¸à¹à¸à¸²à¸à¸«à¸£à¸·à¸à¹à¸¡à¹?","Another device is already using this cashier. Do you want to take over this cashier session?"],currentOwner:["à¸à¸¹à¹à¹à¸à¹à¸à¸²à¸à¸à¸±à¸à¸à¸¸à¸à¸±à¸: {name}","Current owner: {name}"],note:["(à¹à¸à¸£à¸·à¹à¸à¸à¸à¸µà¹à¹à¸à¹à¸£à¸±à¸à¸ªà¸´à¸à¸à¸´à¹à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸à¹à¸à¸à¹à¸à¸µà¸¢à¸£à¹à¸à¸à¸°à¸à¸µà¹à¸à¸°à¸à¸¹à¸à¹à¸à¸°à¸à¸à¸à¸à¸²à¸à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸)","(The device currently using cashier mode will be signed out.)"],confirm:["ยึà¸à¸ªà¸´à¸à¸à¸´à¹à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸","Take Over"],cancel:["ยà¸à¹à¸¥à¸´à¸","Cancel"]},LLe={title:DLe,options:OLe,takeover:xLe},MLe=["à¸à¸£à¸à¸ PIN à¸à¸à¸±à¸à¸à¸²à¸","Enter Employee PIN"],VLe=["à¸à¸¥à¸à¸¥à¹à¸à¸","Unlock"],FLe={invalidPin:["PIN à¹à¸¡à¹à¸à¸¹à¸à¸à¹à¸à¸","Invalid PIN"]},BLe={title:["à¹à¸ªà¹ PIN à¹à¸à¸·à¹à¸{action}","Enter PIN for {action}"],inputLabel:["à¹à¸ªà¹ PIN à¸à¸µà¹à¹à¸à¹à¸£à¸±à¸à¸ªà¸´à¸à¸à¸´à¹","Enter an authorized PIN"],inputPlaceholder:["à¹à¸ªà¹ PIN","Enter PIN"],submit:["à¸à¸à¸¥à¸","Submit"],deniedTitle:["รหัสà¸à¸µà¹à¹à¸¡à¹à¸¡à¸µà¸ªà¸´à¸à¸à¸´à¹","This PIN is not authorized"],deniedText:["PIN à¸à¸à¸ {name} à¹à¸¡à¹à¹à¸à¹à¸£à¸±à¸à¸ªà¸´à¸à¸à¸´à¹à¸ªà¸³à¸«à¸£à¸±à¸{action}","{name}'s PIN is not authorized for {action}"],notFound:["à¹à¸¡à¹à¸à¸ PIN à¸à¸µà¹à¹à¸à¸£à¸°à¸à¸","PIN not found"],actions:{pos_move:["ยà¹à¸²à¸¢à¸£à¸²à¸¢à¸à¸²à¸£","Move"],pos_set_discount:["สà¹à¸§à¸à¸¥à¸","Discount"],pos_set_unit_price:["à¹à¸à¹à¹à¸à¸£à¸²à¸à¸²","Set Price"],pos_void:["ยà¸à¹à¸¥à¸´à¸à¸£à¸²à¸¢à¸à¸²à¸£","Void"]}},$Le={title:MLe,button:VLe,errors:FLe,permission:BLe},ULe=["à¹à¸à¸´à¸à¸£à¹à¸²à¸","Open Shop"],HLe={label:["à¹à¸à¸´à¸à¸ªà¸à¸à¸±à¹à¸à¸à¹à¸","Initial Cash"],placeholder:["0.00","0.00"],help:["à¸à¸³à¸à¸§à¸à¹à¸à¸´à¸à¸ªà¸à¹à¸£à¸´à¹à¸¡à¸à¹à¸à¹à¸à¸¥à¸´à¹à¸à¸à¸±à¸à¹à¸à¹à¸à¹à¸à¸´à¸ à¹à¸à¹à¹à¸à¸à¸²à¸£à¸à¸³à¸à¸§à¸à¸¢à¸à¸à¸ªà¸£à¸¸à¸à¸ªà¸´à¹à¸à¸§à¸±à¸","Starting cash amount in the drawer. Used to calculate end-of-day totals."]},qLe={label:["à¸à¸´à¸¡à¸à¹à¹à¸à¹à¸à¸ªà¸à¹à¹à¸à¸£à¸·à¹à¸à¸à¸à¸´à¸¡à¸à¹","Print test receipt"],help:["à¸à¸´à¸¡à¸à¹à¹à¸à¸à¸à¸ªà¸à¸à¹à¸à¸¢à¸±à¸à¹à¸à¸£à¸·à¹à¸à¸à¸à¸´à¸¡à¸à¹à¸à¸¸à¸à¸à¸±à¸§à¹à¸¡à¸·à¹à¸à¹à¸à¸´à¸à¸£à¹à¸²à¸ à¹à¸à¸·à¹à¸à¸à¸£à¸§à¸à¸ªà¸à¸à¸§à¹à¸²à¸à¸¸à¸à¹à¸à¸£à¸·à¹à¸à¸à¸à¸³à¸à¸²à¸à¹à¸à¹à¸à¸à¸à¸´","Print a test slip to all printers when opening, to confirm they work correctly."]},jLe={default:["à¹à¸à¸´à¸à¸£à¹à¸²à¸","Open Shop"],loading:["à¸à¸³à¸¥à¸±à¸à¹à¸à¸´à¸à¸£à¹à¸²à¸...","Opening shop..."]},WLe={label:["à¹à¸¥à¸·à¸à¸à¸§à¸±à¸à¹à¸à¸´à¸à¸£à¹à¸²à¸","Business day"],prompt:["à¹à¸à¸¥à¹à¹à¸§à¸¥à¸²à¸à¸¶à¹à¸à¸§à¸±à¸à¹à¸«à¸¡à¹ (07:00 à¸.) à¸à¸£à¸¸à¸à¸²à¹à¸¥à¸·à¸à¸à¸§à¹à¸²à¸à¸°à¹à¸à¸´à¸à¸£à¹à¸²à¸à¹à¸à¹à¸à¸à¸à¸à¸§à¸±à¸à¹à¸«à¸","Near the new business day (07:00). Please choose which day to open for."],sameDay:["à¹à¸à¸´à¸à¸à¸à¸à¸§à¸±à¸à¹à¸à¸´à¸¡ ({date})","Same day ({date}
187)"],newDay:["à¹à¸à¸´à¸à¸à¸à¸à¸§à¸±à¸à¹à¸«à¸¡à¹ ({date})","New day ({date})"],sameDayHelp:["à¹à¸¥à¸·à¸à¸à¸à¹à¸²à¸¢à¸±à¸à¸à¸²à¸¢à¸à¹à¸à¹à¸«à¹à¸¥à¸¹à¸à¸à¹à¸²à¸£à¸à¸à¹à¸à¸´à¸¡ (ยà¸à¸à¹à¸à¹à¸²à¸§à¸±à¸à¹à¸à¸´à¸¡)","Continue the current night for late customers (counts toward the same day)."],newDayHelp:["à¹à¸¥à¸·à¸à¸à¸à¹à¸²à¹à¸£à¸´à¹à¸¡à¸£à¸à¸à¸à¸²à¸¢à¹à¸«à¸¡à¹ ระà¸à¸à¸à¸°à¹à¸¡à¹à¸à¸¥à¹à¸à¸à¸à¸²à¸£à¹à¸à¸´à¹à¸¡à¸ªà¸´à¸à¸à¹à¸²à¹à¸¡à¸·à¹à¸à¸à¹à¸²à¸¡ 07:00 à¸.","Start a fresh business day; adding items won't be blocked after 07:00."]},GLe=["à¹à¸£à¸´à¹à¸¡à¸à¹à¸à¹à¸à¸´à¸à¸£à¹à¸²à¸à¹à¸à¸·à¹à¸à¹à¸à¹à¸à¸²à¸ POS รà¸à¸à¸£à¸±à¸à¸à¸²à¸£à¸ªà¸±à¹à¸à¸à¸²à¸«à¸²à¸£, à¸à¸³à¸£à¸°à¹à¸à¸´à¸ à¹à¸¥à¸°à¸à¸±à¸à¸à¸²à¸£à¸à¸´à¸¥","Start a new business day to use POS â orders, payments and bill management."],KLe={terminalTitle:["à¹à¸«à¸¡à¸à¸à¸µà¹à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¸´à¸à¸£à¹à¸²à¸à¹à¸à¹","This mode cannot open the shop"],instruction:["à¸à¸£à¸¸à¸à¸²à¹à¸à¸¥à¸µà¹à¸¢à¸à¹à¸à¹à¸à¹à¸«à¸¡à¸à¹à¸à¸à¹à¸à¸µà¸¢à¸£à¹à¹à¸à¸·à¹à¸à¹à¸à¸´à¸à¸£à¹à¸²à¸","Please switch to Cashier mode to open the shop."]},zLe=["à¹à¸à¸¥à¸µà¹à¸¢à¸à¹à¸«à¸¡à¸","Change Mode"],YLe={title:ULe,initialCash:HLe,printTest:qLe,buttons:jLe,chooseDay:WLe,openHelp:GLe,modeNotice:KLe,changeMode:zLe},JLe={title:["à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¸à¸´à¸à¸£à¹à¸²à¸à¹à¸à¹","Cannot Close Shop"],text:["à¸à¸´à¸à¸£à¹à¸²à¸à¹à¸à¹à¹à¸à¸à¸²à¸°à¹à¸à¸£à¸·à¹à¸à¸à¹à¸à¸à¹à¸à¸µà¸¢à¸£à¹à¸«à¸¥à¸±à¸à¹à¸à¹à¸²à¸à¸±à¹à¸","Only the main cashier terminal can close the shop."]},QLe={secondCashierBlock:JLe},XLe=["Account หมà¸à¸à¸²à¸¢à¸¸","Account Expired"],ZLe={customerId:["Customer ID","Customer ID"],shopName:["à¸à¸·à¹à¸à¸£à¹à¸²à¸","Shop Name"],packagePlan:["Package","Package"],expireDate:["วัà¸à¸«à¸¡à¸à¸à¸²à¸¢à¸¸","Expire Date"]},eMe=["Account à¸à¸µà¹à¹à¸¡à¹à¸ªà¸²à¸¡à¸²à¸£à¸à¹à¸à¹à¸à¸²à¸à¹à¸à¹ à¹à¸à¸·à¹à¸à¸à¸à¸²à¸à¹à¸¡à¹à¹à¸à¹à¸à¹à¸à¸à¸²à¸¢à¸¸à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸","This account is unavailable because the subscription has not been renewed."],tMe=["à¸à¸£à¸¸à¸à¸²à¸à¸´à¸à¸à¹à¸à¸à¹à¸²à¸¢à¸à¸±à¸à¸à¸µ/à¹à¸à¸´à¸¡à¸§à¸±à¸à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸ à¸à¸µà¹à¹à¸à¸à¸£à¹ {phone}","Please contact our accounting team to renew at {phone}"],nMe={name:["à¸à¸à¸²à¸à¸²à¸£ : à¸à¸ªà¸´à¸à¸£à¹à¸à¸¢","Bank : Kasikorn Bank"],accountName:["à¸à¸·à¹à¸à¸à¸±à¸à¸à¸µ : à¸à¸£à¸´à¸©à¸±à¸ à¹à¸à¸à¹à¸¥à¸¹à¸ à¸à¸³à¸à¸±à¸","Account Name : Niceloop Co., Ltd."],accountNumber:["à¹à¸¥à¸à¸à¸±à¸à¸à¸µ : 952-2-07522-9","Account No. : 952-2-07522-9"]},rMe=["à¸à¹à¸à¸à¸²à¸¢à¸¸à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸","Top Up Account"],sMe=["à¸à¸¥à¸±à¸à¸ªà¸¹à¹à¸«à¸à¹à¸²à¸«à¸¥à¸±à¸","Back To Home"],iMe={title:XLe,fields:ZLe,unavailableNotice:eMe,contactNotice:tMe,bank:nMe,topUp:rMe,backHome:sMe},oMe=["Account à¸à¸°à¸«à¸¡à¸à¸à¸²à¸¢à¸¸à¸ ายà¹à¸ {days} วัภ({date}) à¸à¸£à¸¸à¸à¸²à¸à¸´à¸à¸à¹à¸à¸à¹à¸²à¸¢à¸à¸±à¸à¸à¸µà¹à¸à¸·à¹à¸à¸à¹à¸à¸à¸²à¸¢à¸¸à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸ à¹à¸à¸£ {phone}","Your account will expire in {days} day(s) ({date}). Please contact our accounting team to renew. Call {phone}"],aMe=["Account à¸à¸°à¸«à¸¡à¸à¸à¸²à¸¢à¸¸ {date} สามารà¸à¹à¸à¹à¸à¸²à¸à¹à¸à¹à¸à¸¶à¸ 07:00 à¸à¸à¸à¸§à¸±à¸à¸à¸±à¸à¹à¸ à¸à¸£à¸¸à¸à¸²à¸à¸´à¸à¸à¹à¸à¸à¹à¸²à¸¢à¸à¸±à¸à¸à¸µà¹à¸à¸·à¹à¸à¸à¹à¸à¸à¸²à¸¢à¸¸à¸à¸²à¸£à¹à¸à¹à¸à¸²à¸ à¹à¸à¸£ {phone}","Your account will expire on {date}. You can keep using it until 07:00 the next day. Please contact our accounting team to renew. Call {phone}"],cMe=["à¸à¹à¸à¸à¸²à¸¢à¸¸","Renew"],lMe=["à¸à¸´à¸à¸à¹à¸à¸à¸§à¸²à¸¡à¸à¸µà¹","Dismiss"],uMe={withinDays:oMe,lastDay:aMe,renew:cMe,dismiss:lMe},dMe={common:V1e,home:W1e,pos:ixe,menu:axe,stock:vxe,expense:Exe,reports:Dxe,settings:Fxe,topup:Hxe,owner:zxe,owner_layout:iLe,login:fLe,register:ILe,layout:NLe,runMode:LLe,lockScreen:$Le,openShop:YLe,closeShop:QLe,accountExpired:iMe,expiryWarning:uMe},hMe=["th","en"];function NK(t,e){if(Array.isArray(t))return t[e]??t[0]??"";if(t&&typeof t=="object"){const n={};for(const[r,s]of Object.entries(t))n[r]=NK(s,e);return n}return t}const fMe=At(t=>{const e=t.$i18n;e&&hMe.forEach((n,r)=>{e.setLocaleMessage(n,NK(dMe,r))})}),pMe=At(()=>{const t=Wa(),e=bn(),n=ln(),r=Ot(),s=rr(),{$api:i}=au();let o=!1;const a=async()=>
187{if(o)return;o=!0;const l=s.getMigratedDocRef(),d=await mu(l);if(d.exists()&&d.data()?.inventory){console.log("[migrate] inventory already migrated:",d.data().inventory);return}try{await r.migrateStockTransactions.postWithQuery({beginDate:"2026-05"});try{const{apiBase:h}=Ks().public,p=r.customerId.value,g=await i("https://api-app2.niceloop.com/public/check-app2-version",{method:"POST",query:{customerId:p}});console.log("[migrate] check-app2-version flagged",g)}catch(h){console.error("[migrate] check-app2-version failed",h)}await Ws(l,{inventory:Ne().toISOString(),name:n.getStoreName()},{merge:!0}),console.log("[migrate] inventory migration complete")}catch(h){o=!1,console.error("[migrate] inventory migration failed",h)}},c=$e(()=>t.loaded&&e.runMode==="cashier");ft(c,(l,d)=>{l!==d&&l&&a()},{immediate:!0})}),lT="changeprice-dynamodb",mMe=t=>(t||"").replace(/^T/i,""),gMe=t=>(t?Ne(t):Ne()).format("YYYY-MM-DDTHH:mm:ssZ"),_Me=(t,e)=>{const n=Array.isArray(t.__items)?t.__items:[],r=t.json2||{};if(n.length===0||Object.keys(r).length===0)return[];const s=t.employee?.name||"unknown",i=mMe(t.alias);return n.map((o,a)=>{const c=Number(r[o.uuid]??0),l=Number(o.price??0),d=t.timestamp?new Date(t.timestamp).getTime():Date.now(),h=gMe(d+a),p=Ne(d+a).format("YYYY-MM-DD");return{customerId:e,datetime:`${p}#${h}`,timestamp:h,employeeName:s,table:i,item:o.name||"",qty:Number(o.quantity||1),oldUnitPrice:l,newUnitPrice:c,type:"set_unit_price"}})},yMe=(t,e)=>{try{localStorage.setItem(`${lT}:${t}`,JSON.stringify(e))}catch(n){console.error("changePrice: failed to save local",n)}},vMe=t=>{try{localStorage.removeItem(`${lT}:${t}`)}catch(e){console.error("changePrice: failed to remove local",e)}},bMe=()=>{const t=[];try{for(let e=0;e<localStorage.length;e++){const n=localStorage.key(e);if(n&&n.startsWith(`${lT}:`)){const r=localStorage.getItem(n);r&&t.push({key:n.slice(lT.length+1),payload:JSON.parse(r)})}}}catch(e){console.error("changePrice: failed to read pending",e)}return t},DK=async(t,e,n)=>{try{await t.trackSetPriceAndDiscount.post(n),vMe(e)}catch(r){console.error("changePrice: post failed, kept in local storage",r)}},JB=async t=>{const e=bMe();if(!e.length)return;const n=25;for(let r=0;r<e.length;r+=n){const s=e.slice(r,r+n);await Promise.all(s.map(({key:i,payload:o})=>DK(t,i,o)))}},wMe=At(({$pinia:t})=>{const e=tt(),n=Ot(),r=n.customerId;JE(n,()=>{JB(n)}),window.addEventListener("online",()=>{n.isInited.value&&JB(n)}),e.$onAction(s=>{if(s.name!=="add")return;const i=s.args[0];s.args[1]&&i?.type===pt.SET_PRICE&&s.after(()=>{_Me(i,r.value).forEach(c=>{const l=c.datetime;yMe(l,c),DK(n,l,c)})})})}),uT="openmenu-dynamodb",SMe=(t,e,n)=>{const s=(Array.isArray(t.__items)?t.__items:[]).filter(a=>a?.isOpenMenu===!0);if(s.length===0)return[];const i=t.alias||t.jobId||"",o=t.receiptNonce||"";return s.map((a,c)=>{const l=Number(a.price??0),d=Number(a.quantity??1),h=t.timestamp?new Date(t.timestamp).getTime():Date.now(),p=new Date(h+c).toISOString();return{customerId:e,timestamp:p,name:a.name||"",openMenuName:a.openMenuName||"",orderId:i,receiptNonce:o,businessDate:n,price:l,quantity:d,extendedPrice:l*d,discountedPrice:l*d}})},TMe=(t,e)=>{try{localStorage.setItem(`${uT}:${t}`,JSON.stringify(e))}catch(n){console.error("openMenu: failed to save local",n)}},EMe=t=>{try{localStorage.removeItem(`${uT}:${t}`)}catch(e){console.error("openMenu: failed to remove local",e)}},IMe=()=>{const t=[];try{for(let e=0;e<localStorage.length;e++){const n=localStorage.key(e);if(n&&n.startsWith(`${uT}:`)){const r=localStorage.getItem(n);r&&t.push({key:n.slice(uT.length+1),payload:JSON.parse(r)})}}}catch(e){console.error("openMenu: failed to read pending",e)}return t},OK=async(t,e,n)=>{try{await t.openMenu.post(n),EMe(e)}catch(r){console.error("openMenu: post failed, kept in local storage",r)}},QB=async t=>{const e=IMe();if(!e.length)return;const n=25;for(let r=0;r<e.length;r+=n){const s=e.slice(r,r+n);await Promise.all(s.map(({key:i,payload:o})=>OK(t,i,o)))}},CMe=At(({$pinia:t})=>{const e=tt(),n=Ot(),r=n.customerId;JE(n,()=>{QB(n)}),window.addEventListener("online",()=>{n.isInited.value&&QB(n)}),e.$onAction(s=>{if(s.name!=="add")return;const i=s.args[0];s.args[1]&&i?.type===pt.PAY&&s.after(()=>{const a=e.getBusinessDateFromTimestamp(i.timestamp);
187SMe(i,r.value,a).forEach(l=>{const d=`${l.timestamp}__${l.name}`;TMe(d,l),OK(n,d,l)})})})}),dT="voiditem-dynamodb",AMe=t=>(t||"").replace(/^T/i,""),RMe=(t,e)=>{const n=Array.isArray(t.__items)?t.__items:[];if(n.length===0)return[];const r=t.json2||{},s=t.__reason||null,i=t.employee?.name||"unknown",o=AMe(t.alias),a=!t.__noPrint;return n.map((c,l)=>{const d=Number(r[c.uuid]||0),h=Math.abs(d||c.quantity||1),p=Number(c.price??0),g=t.timestamp?new Date(t.timestamp).getTime():Date.now(),_=new Date(g+l).toISOString();return{customerId:e,timestamp:_,approvedBy:i,cashier:i,by:i,shortAlias:`T${o}`,fullAlias:`Table ${o}`,alias:o,isPrint:a,name:c.name||"",reason:s,qty:h,amount:p*h,subItemId:c.subItemId||c.subitemid||0,price:p}})},PMe=(t,e)=>{try{localStorage.setItem(`${dT}:${t}`,JSON.stringify(e))}catch(n){console.error("voidItem: failed to save local",n)}},kMe=t=>{try{localStorage.removeItem(`${dT}:${t}`)}catch(e){console.error("voidItem: failed to remove local",e)}},NMe=()=>{const t=[];try{for(let e=0;e<localStorage.length;e++){const n=localStorage.key(e);if(n&&n.startsWith(`${dT}:`)){const r=localStorage.getItem(n);r&&t.push({key:n.slice(dT.length+1),payload:JSON.parse(r)})}}}catch(e){console.error("voidItem: failed to read pending",e)}return t},xK=async(t,e,n)=>{try{await t.voidItems.post(n),kMe(e)}catch(r){console.error("voidItem: post failed, kept in local storage",r)}},XB=async t=>{const e=NMe();if(!e.length)return;const n=25;for(let r=0;r<e.length;r+=n){const s=e.slice(r,r+n);await Promise.all(s.map(({key:i,payload:o})=>xK(t,i,o)))}},DMe=At(({$pinia:t})=>{const e=tt(),n=Ot(),r=n.customerId;JE(n,()=>{XB(n)}),window.addEventListener("online",()=>{n.isInited.value&&XB(n)}),e.$onAction(s=>{if(s.name!=="add")return;const i=s.args[0];s.args[1]&&(i?.type!==pt.VOID&&i?.type!==pt.VOID_TOPPING||s.after(()=>{RMe(i,r.value).forEach(c=>{const l=`${c.timestamp}__${c.subItemId}`;PMe(l,c),xK(n,l,c)})}))})}),OMe=At(()=>{const t=Wa(),e=bn(),n=tt(),r=Mi();let s;const i=E=>{const T=Number(E);return Number.isFinite(T)?T:0},o=()=>{const E=n.tables||{},T=r.receipts||[];let R=0,N=0,O=0,S=0;for(const I of Object.values(E)){const P=Array.isArray(I?.items)?I.items:[];R+=P.reduce((k,L)=>{const M=L?.discountedPrice??L?.extendedPrice??i(L?.price)*i(L?.quantity);return k+i(M)},0),N+=i(I?.billing?.grandTotal),S+=1}for(const I of T){const P=I?.GrandTotal??I?.billing?.grandTotal??I?.grandTotal;O+=i(P)}return{tableItemsTotal:R,tableGrandTotal:N,receiptsGrandTotal:O,tablesCount:S,computedAt:new Date().toISOString()}},a=new Map,c=5e3,l="unknown",d=E=>{const T=String(E).replace(/[.#$/\[\]]/g,"_").trim();return T?/^__.*__$/.test(T)?`id_${T}`:T:l},h=E=>{const T=String(E?.jobId??"");if(T&&a.has(T))return a.get(T);let R="";try{R=String(JSON.parse(E?.json||"{}")?.deviceId??"").trim()}catch{R=""}if(T){if(a.size>=c){const N=a.keys().next().value;N!==void 0&&a.delete(N)}a.set(T,R)}return R},p=()=>{const E=n.getJobsArray()||[],T={cashier:0,terminal:0,mobile:0},R=new Map;for(const N of E){if(N?.type!==pt.ADD)continue;const O=String(N?.source||"");if(O==="m"){T.mobile+=1;const S=d(h(N));R.set(S,(R.get(S)||0)+1)}else O==="t"?T.terminal+=1:T.cashier+=1}return{jobsCount:E.length,addCounts:T,deviceIds:Object.fromEntries(R)}};let g=[],_="";const v=E=>{const T={...E};for(const R of g)Object.prototype.hasOwnProperty.call(E,R)||(T[R]=vS());return T},b=async()=>{if(!(!t.loaded||e.runMode!=="cashier"))try{const E=o(),T=p(),R=rr();if(!R.storeId.value)return;const N=R.getRootDataRef(),O=Mi().data?.length||0,S=ln().getStoreName(),I=v(T.deviceIds),P={name:S||"",...T.jobsCount>0?{status:"opened"}:{},live:{paid:E.receiptsGrandTotal,pending:Object.values(n.tables||{}).reduce((L,M)=>L+i(M?.billing?.grandTotal),0),tables:E.tablesCount,bills:O,businessDate:n.getBusinessDate()||Ne().format("YYYY-MM-DD"),lastUpdated:n.getLastUpdate()||Ne().format("YYYY-MM-DD HH:mm:ss"),jobschain:T.jobsCount,analytic_add_counts:T.addCounts,deviceIds:I}},k=JSON.stringify(P);if(k===_)return;await Ws(N,P,{merge:!0}),_=k,g=Object.keys(T.deviceIds),console.log("[jobs.live] totals computed:",E,T)}catch(E){console.warn("[jobs.live] live update skipped:",E)}},w=$e(()=>t.loaded&&e.runMode==="cashier");ft(w,(E,T)=>{if(E!==T){if(E){if(s)return;s=ft(()=>n.tables,()=>{b()},{deep:!1,immediate:!0});return}s&&(s(),s=void 0)}},{immediate:!0})});class xMe{constructor(){}transform(e){const n=e?.startDateTime||e?.items?.[0]?.timestamp||"",r=this.toOffset(n,420),s=String(e?.name??""),{zoneMajor:i,zoneMinor:o,tableNumber:a}=this.parseZone(s),c=Array.isArray(e?.items)?e.items:[],l=this.buildLines(c),d=this.round2(l.reduce((T,R)=>T+this.toNumber(R.discount,0),0)),h=d>0,p=e?.billing??{},g=this.round2(this.toNumber(p.subTotal,0)),_=this.round2(this.toNumber(p.grandTotal,g)),v=this.parseVat(p.vat),b=this.parseCharge(p.sc||p.serviceCharge),w=this.parseDiscount(p.dc2||p.discount),E=this.parseCharge(p.cc||p.cardCharge);
187return{comment:"",timeStart:r,dateTime:"",key:"",sync:!0,numberOfItmes:l.length,lines:l,grandTotal:_,subTotal:g,noOfJobs:Array.isArray(e?.jobs)?e.jobs.length:0,fullAlias:`${e?.type==="table"?"Table ":""}${s||""}`,vat:v,customer:this.toNumber(e?.guests,1),customerMode:1,service:b,discount:w,sumDiscountLines:d,uuid:String(e?.itemsCombined?.[0]?.billNumber??e?.items?.[0]?.billNumber??a??""),hasLineDiscount:h,total:g,cardCharge:E,isLock:!1,mode:1,printPreviewCount:0,tableNumber:a??"",zoneMajor:i??"",zoneMinor:o??null,useZoneV2:!0,alias:s||"",shortAlias:s||"",dataChanged:r||""}}tranformEmptyData(e){const n=e?.startDateTime||e?.items?.[0]?.timestamp||"",r=this.toOffset(n,420),s=String(e?.name??""),{zoneMajor:i,zoneMinor:o,tableNumber:a}=e,c=Array.isArray(e?.items)?e.items:[],l=this.buildLines(c),d=this.round2(l.reduce((T,R)=>T+this.toNumber(R.discount,0),0)),h=d>0,p=e?.billing??{},g=this.round2(this.toNumber(p.subTotal,0)),_=this.round2(this.toNumber(p.grandTotal,g)),v=this.parseVat(p.vat),b=this.parseCharge(p.sc||p.serviceCharge),w=this.parseDiscount(p.dc2||p.discount),E=this.parseCharge(p.cc||p.cardCharge);return{comment:"",timeStart:r,dateTime:"",key:"",sync:!0,numberOfItmes:l.length,lines:l,grandTotal:_,subTotal:g,noOfJobs:Array.isArray(e?.jobs)?e.jobs.length:0,fullAlias:`${e?.type==="table"?"Table ":""}${s||""}`,vat:v,customer:this.toNumber(e?.guests,1),customerMode:1,service:b,discount:w,sumDiscountLines:d,uuid:String(e?.itemsCombined?.[0]?.billNumber??e?.items?.[0]?.billNumber??a??""),hasLineDiscount:h,total:g,cardCharge:E,isLock:!1,mode:1,printPreviewCount:0,tableNumber:a??"",zoneMajor:i??"",zoneMinor:o??null,useZoneV2:!0,alias:s||"",shortAlias:s||"",dataChanged:r||""}}toNumber(e,n=0){return Number.isFinite(Number(e))?Number(e):n}round2(e){return Math.round((this.toNumber(e)+Number.EPSILON)*100)/100}ensureArray(e){return Array.isArray(e)?e:[0,0,0]}modeNameFromMode(e){return e===1?"Included":e===2?"Excluded":""}fmtPercentText(e,n){const r=this.round2(e);return`${Number.isFinite(r)?`${r}%`:"0%"}${n?` (${n})`:""}`}parseVat(e){const[n,r,s]=this.ensureArray(e),i=`${this.round2(r)}%${n?` (${this.modeNameFromMode(n)})`:""}`;return{amount:this.round2(s),text:i}}parseCharge(e){const[n,r,s]=this.ensureArray(e);return{amount:this.round2(s),text:this.fmtPercentText(r)}}parseDiscount(e){const[n,r,s]=this.ensureArray(e);return{amount:this.round2(s),text:this.fmtPercentText(r)}}toOffset(e,n=420){if(!e)return"";const r=new Date(e);if(isNaN(r.getTime()))return"";const s=r.getTime()+n*60*1e3,o=new Date(s).toISOString().replace("Z","").slice(0,19),a=n>=0?"+":"-",c=Math.abs(n),l=String(Math.floor(c/60)).padStart(2,"0"),d=String(c%60).padStart(2,"0");return`${o}${a}${l}:${d}`}parseZone(e){if(!e||typeof e!="string")return{zoneMajor:"",zoneMinor:null,tableNumber:""};const n=e.match(/^([A-Za-z]+)(\d+)$/);if(!n)return{zoneMajor:e,zoneMinor:null,tableNumber:""};const r=n[1].toUpperCase(),s=Number(n[2]);return{zoneMajor:r,zoneMinor:s,tableNumber:String(s)}}buildLines(e=[]){return e.map(n=>{const r=n.dc1?.[0]??0,s=n.dc1?.[1]??0,i=n.dc1?.[2]??0,o=i>0?r===1?`ลภ-${this.toNumber(s,0).toFixed(2)} X ${n.quantity??0}`:`ลภ${s}%`:"";return{uniqueId:String(n.uuid??`${Date.now()}`),subItemId:this.toNumber(n.subItemId,0),name:String(n.name??""),comments:n.comments||"",price:n.price,discount:n.dc1[2],discountText:o,discountedPrice:n.discountedPrice,discountRequest:{mode:r,value:s,amount:i},quantity:n.quantity,extendedPrice:n.extendedPrice,toppings:n.toppings||[]}})}}const LMe=At(()=>{const t=tt(),e=_r(),n=bn(),r=()=>n.runMode==="cashier";let s={},i=!0,o="";t.$onAction(({name:g,store:_,args:v,after:b,onError:w})=>{if(g=="add"){const E=v[0];v[1],b(T=>{l(E)})}}),ft(()=>e.tablesState,d,{deep:!0}),ft(()=>t.tables,()=>{d(),a()});function a(){if(!r())return;const g=t.tables||{},_={};for(const v in g){const b=g[v];if(!b)continue;const w=Wo().convertTableToUuid(v);if(!w)continue;const E=c(b);_[v]=E,!i&&s[v]!==E&&h(w,b)}if(!i)for(const v in s)v in _||p(v);s=_,i=!1}function c(g){let _=`${g.name}|${g.guests}|${g.startDateTime}|${JSON.stringify(g.billing)}`;const v=g.items||[];for(const b of v)_+=`|${b.uuid},${b.subItemId},${b.name},${b.comments},${b.price},${b.quantity},${b.extendedPrice},${b.discountedPrice},${b.dc1},${b.toppingsAmount},${(b.toppings||[]).length}`;return _}function l(g){if(!r())return;const{tableNumber:_,record:v}=new p1e().fromJobToHistory(g);if(!_||!v)return;const b=Ze().customerRootRef(),w=zt(b,`tables/${_}/history`);J_e(w,JSON.stringify(v))}function d(){if(!r())return;const g=JSON.stringify(Wo().generateCustomerArray());if(g===o)return;o=g;const _=Ze().customerRootRef();Ue(zt(_,"tables/customercounts"),g)}function h(g,_){const v=Ze().customerRootRef(),b=new xMe;let w=zt(v,`tables/${g}/list`);Ue(w,JSON.stringify(b.transform(_)));let E=zt(v,`tables_v2/${g}/lines`);Ue(E,b.buildLines(_.items||[]))}function p(g){if(!r())return;let _=Wo().convertTableToUuid(g);if(!_)return;const v=Ze().customerRootRef();let b=zt(v,`tables/${_}`);Ue(b,null);let w=zt(v,`tables_v2/${_}`);Ue(w,null)}}),MMe=At(()=>{if(!(window.matchMedia("(pointer: fine)").matches||window.matchMedia("(min-width: 900px)").matches))return;const e="niceloop-pos-hello",n="niceloop-pos-occupied",r="/pos-multi-tabs-opened.html",s=`niceloop-pos-tab:${window.location.hostname}`;let i=!1,o=!1;const a=new BroadcastChannel(s);a.addEventListener("message",l=>{if(l.data===e)i&&a.postMessage(n);
187else if(l.data===n){if(o)return;o=!0,a.close(),window.location.replace(r)}}),a.postMessage(e);const c=setTimeout(()=>{i=!0},500);window.addEventListener("beforeunload",()=>{clearTimeout(c),a.close()})});function nd(t){if(typeof t!="string")return t;const e=ln().tables||[];if(!(e.length===1&&e[0]?.name==="T"))return t;const r=t.match(/^T(\d+)$/);return r?`Table ${r[1]}`:t}class Ed extends b9{job=null;constructor(e){super(e)}build(){return this.job}getCurrentDateTime(){return Ne().format("YYYY-MM-DDTHH:mm:ssZ")}makePrintJobKitchen(e){const n=e?.employee?.name||e?.employee?.Name||"unknown",r=e.nickName||nd(e.alias);return this.job={...Number(e?.guests)>0?{CustomerCount:String(e.guests)}:{},OrderItems:this.buildOrderItems(e?.json?.orderitems,{showPrice:e?.showPrice===!0}),Table:r,DateTime:Ne(e.pcTimestamp||e.timestamp).format("YYYY-MM-DDTHH:mm:ssZ"),Date:Ne(e.pcTimestamp||e.timestamp).format("YYYY-MM-DDTHH:mm:ssZ"),OrderTaker:n,Comments:e?.note||e?.comments||"",WaterMark:"",IsVoid:!1,IsHideQtyComboSet:!1,Reference:r,UniqueId:e.jobId,ShopId:e.storeId,ServiceValue:e.serviceValue,VatValue:e.vatValue,VatMode:e.vatMode,AccumulateGrandTotal:0,PreviousGrandTotal:0,noOfJobs:"#1"},this}makePrintJobVoid(e){const n=e?.employee?.name||e?.employee?.Name||"unknown",r=e?.nickName||nd(e?.alias),s=e?.json2||{},i=(Array.isArray(e.__items)?e.__items:[]).map(o=>({...o,quantity:Math.abs(Number(s[o.uuid]??0))||Number(o.quantity||0)}));return this.job={customercount:e.guests||2,uniqueid:e.jobId,username:n,by:n,table:`${r} (ยà¸à¹à¸¥à¸´à¸)`,datetime:this.getCurrentDateTime(),uuid:e.uuid,customermode:1,fullAlias:e.alias,alias:e.alias,comments:e?.comments,useZoneV2:!0,orderitems:this.buildOrderItems(i),reference:`${r} (ยà¸à¹à¸¥à¸´à¸)`,orderTaker:n,watermark:`Void 188ยà¸à¹à¸¥à¸´à¸`,isPrint:!0,approvedBy:n,isVoid:!0,read:2,customfooters:[{name:"PrintTextLine",value:` 189Reason : ${e?.__reason}`},{name:"LineFeed",value:""},{name:"PrintTextLine",value:"Sign : "}],date:this.getCurrentDateTime()},this}makePrintJobMove(e){const n=e?.employee?.name||e?.employee?.Name||"unknown",s=this.getPrintersListFromItems(e.__items).flat();return console.log("printers move",s),`${e.alias}${e.newAlias}`,this.job={OrderItems:[...this.transfromMoveOrderItems(e.__items,e.alias,e.newAlias)],IsMoveTable:!0,IsReprint:!0,Date:this.getCurrentDateTime(),OrderTaker:n,UniqueId:`${e.jobId}:move`,ShopId:e.storeId,Table:`${nd(e.alias)} ยà¹à¸²à¸¢à¹à¸ ${nd(e.newAlias)}`,Reference:`${nd(e.alias)} ยà¹à¸²à¸¢à¹à¸ ${nd(e.newAlias)}`},this}makeReprintJobToKitchen(e){const n=e.pcTimestamp||e.timestamp,r=Ne(n).format("HH:mm"),s=e.nickName||nd(e.alias);return this.job={OrderItems:this.buildOrderItems(e?.json?.orderitems,{showPrice:e?.showPrice===!0}),Table:`${s} (à¸à¸²à¸¡à¸à¸²à¸«à¸²à¸£)`,DateTime:`${Ne(n).format("YYYY-MM-DDTHH:mm:ssZ")}`,Date:`${Ne(n).format("YYYY-MM-DDTHH:mm:ssZ")}`,OrderTaker:e.by||"unknown",Comments:`************************ 190*** RE-PRINT : 191*** สัà¹à¸à¹à¸à¹à¸¥à¹à¸§à¹à¸¡à¸·à¹à¸ `+r+` 192************************ 193 194`,WaterMark:"",IsVoid:!1,Reference:`Table ${s}`,UniqueId:`reprint_${new Date().valueOf().toString()}`,ShopId:e.storeId},this}}let VMe=class extends Ii{printToKitchen(e,n){const r=this.withPayload(e,n);return console.log("jobKitchen=>",r),this.print_data=r,this}withPayload(e,n){const r=new Ed(n?.productsStore),s=r.getBillArrValue(n?.billing?.serviceCharge,2)||0,i=r.getBillArrValue(n?.billing?.vat,1)||0,o=r.getBillArrValue(n?.billing?.vat,0)||0,a={...e,...n,serviceValue:s,vatValue:i,vatMode:o},c=r.makePrintJobKitchen(a).build();return console.log("jobKitchen=>",c),c}setPayload(e){return this.print_data=e,this}};class em{job=null;money(e,n=2){return rT()?nT:Mo(e,n,!0)||0}moneySmart(e){return rT()?nT:MAe(e)}build(){return this.job}buildHeaderReport(e){const n=[{name:"PrintTitle",value:e.title},{name:"LineFeed",value:!0},{name:"Date",value:e.date},{name:"Time",value:e.time},{name:"Report",value:e.reportName}];return e.shift&&n.push({name:"Shift",value:e.shift}),e.cashier&&n.push({name:"Cashier",value:e.cashier}),n}buildFooterReport(e){return[{name:"PrintComment",value:`Print by : ${e.printBy}`},{name:"PrintComment",value:`Print at : ${e.printAt}`},{name:"LineFeed",value:!0},{name:"PrintLine",value:!0},{name:"LineFeed",value:!0}]}buildCloseShopHeader(e,n=!1){return e?[{name:"PrintComment",value:`***** ${n?"Change Shift":"Close Shop"} ${Ne().format("HH:mm:ss DD/MMMM/YYYY")} *****`},...this.buildLineFeed()]:[]}buildOutstandingData(e){if(!e)return[];const n=Number(e?.count)||0,r=Number(e?.total)||0;return[{name:"PrintComment",value:`ยà¸à¸à¹à¸à¹à¸°à¹à¸à¸´à¸à¸à¹à¸²à¸ ${n} à¹à¸à¹à¸° = ${this.money(r)}`},...this.buildLineFeed()]}buildLocalOnlyWarning(e){return e?[{name:"PrintComment",value:"!!! à¸à¸¶à¸à¸à¹à¸à¸¡à¸¹à¸¥à¸à¸²à¸ Server à¹à¸¡à¹à¹à¸à¹ - ยà¸à¸à¸à¸µà¹à¹à¸à¹à¸à¸à¹à¸à¸¡à¸¹à¸¥à¹à¸à¸£à¸·à¹à¸à¸à¸à¸µà¹à¹à¸à¹à¸²à¸à¸±à¹à¸ (LOCAL ONLY) à¸à¸²à¸à¹à¸¡à¹à¸£à¸§à¸¡à¸¢à¸à¸à¹à¸à¸£à¸·à¹à¸à¸à¹à¸à¸à¹à¸à¸µà¸¢à¸£à¹à¸à¸·à¹à¸ !!!"},...this.buildLineFeed()]:[]}buildCloseShopFooter(e,n=!1){if(!e)return[];const r=n?"Change Shift":"Close Shop";return[...this.buildLineFeed(),{name:"PrintComment",value:`***** ${r} ${Ne().format("HH:mm:ss DD/MMMM/YYYY")} *****`}]}makeSummaryIncomeReport(e){const n=e?.startTime&&Ne(e.startTime).isValid()?Ne(e.startTime):null,r=n?n.format("HH:mm"):"7:00",s=n||Ne(),i={title:e.shopName,date:s.format("DD/MMMM/YYYY"),time:`${r} - ${Ne().format("HH:mm")}`,reportName:"Summary Income",shift:"All",cashier:"All"},o={printAt:Ne().format("HH:mm:ss DD/MMMM/YYYY"),printBy:e?.User||e?.employee?.Name||"My Employee"},a=this.buildCloseShopHeader(e?.isCloseShop,e?.isChangeShift),c=this.buildCloseShopFooter(e?.isCloseShop,e?.isChangeShift),l=this.buildLocalOnlyWarning(e?.isLocalOnly),d=this.buildOutstandingData(e?.outstanding),h=this.buildHeaderReport(i),p=this.buildFooterReport(o),g=this.buildShiftData(e.shiftsSummary),_=this.buildDrawerData(e.drawerData),v=this.buildPaymentTypeData(e.paymentTypesSummary),b=this.buildOnTheHouseData(e.onTheHouseSummary||[]),w=this.buildCashierData(e.cashiersSummary);let E=[];return e?.isFullReport&&(E=[...this.buildBillSummary(e.goodBills,"Bills"),...e.voidBills?.length?this.buildBillSummary(e.voidBills,"Void Bills"):[]]),this.job=[...a,...l,...h,{name:"PrintLine",value:!0},...this.buildLineFeed(),{name:"PrintTitle",value:`Summary (${e.goodBills.length} bills)`},...this.buildLineFeed(),...ln().enableCustomerMode?[{name:"Customer : "+(e.guests||0),value:""}]:[],{name:"Total",value:this.money(e.billing?.subTotal+Math.abs(e.billing?.itemsDiscountTotal||0))},{name:"Discount Items",value:this.money(e.billing?.itemsDiscountTotal)},{name:"Service",value:this.money(e.billing?.serviceChangeTotal)},{name:"Discount Bill",value:this.money(e.billing?.discountBillTotal)},{name:"CreditCard Charge",value:this.money(e.billing?.cardChargeTotal)},...e.billing?.vatExclusiveTotal?[{name:"VAT (Exclusive)",value:this.money(e.billing?.vatExclusiveTotal)}]:[],...e.billing?.vatInclusiveTotal?[{name:"VAT (Inclusive)",value:this.money(e.billing?.vatInclusiveTotal)}]:[],{name:"PrintLine",value:!0},{name:"Grand Total",value:`*** ${this.money(e.billing?.grandTotal)}`},{name:"PrintDoubleLine",value:!0},...this.buildLineFeed(),{name:"PrintComment",value:`Voided ${e.voidBills.length} bills, ${this.money(e.billing?.voidedBillsAmount)}`},...this.buildLineFeed(),...d,..._,...this.buildLineFeed(),...g,...this.buildLineFeed(),...v,...this.buildLineFeed(),...b,...b.length>0?this.buildLineFeed():[],...w,...this.buildLineFeed(1),{name:"PrintLine",value:!0},...this.buildLineFeed(),...E,...p,...c],this}makeProductSoldReport(e){const n={title:e.shopName,date:Ne().format("DD/MMMM/YYYY"),time:`7:00 - ${Ne().format("HH:mm")}`,reportName:"Product Sold",shift:"All",cashier:"All"},r={printAt:Ne().format("HH:mm:ss DD/MMMM/YYYY"),printBy:e?.employee?.name||"Niceloop"},s=this.buildCloseShopHeader(e?.isCloseShop,e?.isChangeShift),i=this.buildCloseShopFooter(e?.isCloseShop,e?.isChangeShift),o=this.buildHeaderReport(n),a=this.buildFooterReport(r);let c=[];return e?.isFullReport&&(c=this.buildProductSoldSummary(e.productSoldSummary)),this.job=[...s,...o,...this.buildLineFeed(),{name:"PrintLine",value:!0},...this.buildLineFeed(),{name:"PrintTitle",value:"Products by type"},...this.buildLineFeed(),...this.buildProductTypeSummary(e.groups),...this.buildLineFeed(),{name:"PrintComment",value:"à¹à¸¡à¹à¸£à¸§à¸¡/หัà¸à¸ªà¹à¸§à¸à¸¥à¸à¸à¹à¸²à¸¢à¸à¸´à¸¥"},...this.buildLineFeed(),{name:"PrintLine",value:!0},...this.buildLineFeed(),...c,...a,...i],this}makeVoidReport(e){const n={title:e.shopName,date:Ne().format("DD/MMMM/YYYY"),time:`7:00 - ${Ne().format("HH:mm")}`,reportName:"Void Items",shift:"All",cashier:"All"},r={printAt:Ne().format("HH:mm:ss DD/MMMM/YYYY"),printBy:e?.employee?.name||"Niceloop"},s=this.buildCloseShopHeader(e?.isCloseShop,e?.isChangeShift),i=this.buildCloseShopFooter(e?.isCloseShop,e?.isChangeShift),o=this.buildHeaderReport(n),a=this.buildFooterReport(r),c=this.buildVoidItemsReport(e.voidItemsList);return this.job=[...s,...o,{name:"PrintLine",value:!0},{name:"LineFeed",value:!0},{name:"PrintTitle",value:"list void items"},{name:"LineFeed",value:!0},...c,{name:"LineFeed",value:!0},{name:"PrintLine",value:!0},{name:"LineFeed",value:!0},{name:"PrintTextLine",value:`Void Amount : ${Mo(e.voidAmount,2,!0)}`},...a,...i],this}makeVoidReceipt(e){const n=Ne(e.voidedAt||void 0).format("HH:mm:ss DD/MMM/YYYY");return this.job=[{name:"PrintTitle",value:"Deleted Bill (Voided)"},...this.buildLineFeed(),{name:"Invoice Id",value:String(e.invoiceId??"-")},{name:"Date Time",value:String(e.dateTime??"-")},{name:"Table",value:String(e.table??"-")},{name:"GrandTotal",value:Mo(e.grandTotal,2,!0)},{name:"Payment",value:String(e.paymentType??"-")},...this.buildLineFeed(),{name:"Voided At",value:n},{name:"Employee",value:String(e.employee??"-")},{name:"Reason",value:String(e.reason??"")},...this.buildLineFeed(2),{name:"PrintTextLine",value:"Sign : ______________________________________"},...this.buildLineFeed(2)],this}makeVoidItemsCashier(e){const n=Ne(e.voidedAt||void 0).format("HH:mm:ss DD/MMM/YYYY"),r=Array.isArray(e.items)?e.items:[],s=r.map(a=>({name:`${a.qty} ${a.name}`,value:Mo(a.amount,2,!0)})),i=r.reduce((a,c)=>a+Number(c.qty||0),0),o=r.reduce((a,c)=>a+Number(c.amount||0),0);return this.job=[{name:"PrintTitle",value:"ยà¸à¹à¸¥à¸´à¸à¸£à¸²à¸¢à¸à¸²à¸£ (VOID)"},...this.buildLineFeed(),{name:"Table",value:String(e.alias??"-")},{name:"Void By",value:String(e.employee??"-")},{name:"Voided At",value:n},...this.buildLineFeed(),{name:"PrintLine",value:!0},...this.buildLineFeed(),...s,...this.buildLineFeed(),{name:"PrintLine",value:!0},{name:`${i} Items`,value:Mo(o,2,!0)},...this.buildLineFeed(),{name:"PrintTextLine",value:`Reason : ${e.reason||"-"}`},...this.buildLineFeed(2),{name:"PrintTextLine",value:"Sign : ______________________________________"},...this.buildLineFeed(2)],this}makeOpenMenuReport(e){const n={title:e.shopName,date:Ne().format("DD/MMMM/YYYY"),time:`7:00 - ${Ne().format("HH:mm")}`,reportName:"Open Menu"},r={printAt:"Printed At : "+Ne().format("HH:mm:ss DD/MMMM/YYYY"),printBy:e?.employee?.name||"Niceloop"},s=this.buildCloseShopHeader(e?.isCloseShop,e?.isChangeShift),i=this.buildCloseShopFooter(e?.isCloseShop,e?.isChangeShift),o=this.buildHeaderReport(n);this.buildFooterReport(r);let a=e.openMenuData.map(c=>({name:c.name,value:this.money(c.extendedPrice)}));return e.openMenuData.length==0&&(a=[{name:"PrintTextLine",value:"à¹à¸¡à¹à¸¡à¸µà¸£à¸²à¸¢à¸à¸²à¸£à¸à¸²à¸¢ Open Menu"}]),this.job=[...s,...o,...this.buildLineFeed(),{name:"PrintLine",value:!0},...this.buildLineFeed(),{name:"PrintTitle",value:"OPEN MENU"},...this.buildLineFeed(),{name:"PrintComment",value:"** ราà¸à¸²à¸à¸µà¹à¹à¸ªà¸à¸à¹à¸à¹à¸à¸£à¸²à¸à¸²à¸à¸µà¹à¸«à¸±à¸à¸ªà¹à¸§à¸à¸¥à¸à¸ªà¸´à¸à¸à¹à¸²à¹à¸¥à¹à¸§"},...this.buildLineFeed(2),...a,...this.buildLineFeed(2),{name:"PrintComment",value:r.printAt},...this.buildLineFeed(),{name:"PrintLine",value:!0},...this.buildLineFeed(),...i],this}makePrinterTest(e={}
194){const n=e.title||"PRINTER TEST",r=(e.lines||[]).filter(Boolean);return this.job=[{name:"PrintTitle",value:n},...this.buildLineFeed(),...r.map(s=>({name:"PrintTextLine",value:s})),...this.buildLineFeed(2),{name:"PrintLine",value:!0},...this.buildLineFeed()],this}makeFullProductSoldReport(){const e={title:"Niceloop_1",date:"24 September 2025",time:"7:00 - 15:32",reportName:"Void Items",shift:"All",cashier:"All"},n={printAt:"15:32:16 24 September 2025",printBy:"Niceloop"},r=this.buildHeaderReport(e),s=this.buildFooterReport(n);return this.job=[...r,{name:"PrintLine",value:!0},{name:"LineFeed",value:!0},{name:"PrintTitle",value:"Products by type"},{name:"LineFeed",value:!0},{name:"Food (100%)",value:" 1,000.00"},{name:"Dessert (0%)",value:" 0.00"},{name:"Other (0%)",value:" 0.00"},{name:"Drink (0%)",value:" 0.00"},{name:"LineFeed",value:!0},{name:"PrintComment",value:"à¹à¸¡à¹à¸£à¸§à¸¡/หัà¸à¸ªà¹à¸§à¸à¸¥à¸à¸à¹à¸²à¸¢à¸à¸´à¸¥"},{name:"LineFeed",value:!0},{name:"PrintLine",value:!0},{name:"PrintTitle",value:"Detail"},{name:"LineFeed",value:!0},{name:"PrintComment",value:"*** Food : à¸à¸²à¸«à¸²à¸£à¹à¸à¸¢ 1 : 350.00"},{name:"1 à¸à¸¸à¹à¸à¸à¸±à¸à¸à¸£à¸´à¸à¹à¸à¸¢à¸à¸³",value:" 350.00"},{name:"LineFeed",value:!0},{name:"LineFeed",value:!0},{name:"PrintComment",value:"*** Food : ยำ 1 : 0.00"},{name:"1 ยำมะà¹à¸à¸·à¸à¸¢à¸²à¸§",value:" 0.00"},{name:"LineFeed",value:!0},{name:"LineFeed",value:!0},{name:"PrintComment",value:"*** Food : à¸à¸²à¸«à¸²à¸£à¸à¸°à¹à¸¥ : 650.00"},{name:"1 à¸à¸¹à¸à¸°à¹à¸¥à¸à¸±à¸à¸à¸à¸à¸°à¸«à¸£à¸µà¹ (1à¸à¸±à¸§)",value:" 650.00"},{name:"LineFeed",value:!0},{name:"LineFeed",value:!0},...s],this}buildLineFeed(e=1){return Array(e).fill({name:"LineFeed",value:!0})}buildDrawerData(e){return[{name:"PrintTitle",value:"Summary Cash Drawer"},{name:"LineFeed",value:!0},{name:"Opening Time",value:e.start?.timeText||""},{name:"Opening Cash",value:this.money(e.start.amount)},{name:`Cash In (${e.deposit.count})`,value:this.money(e.deposit.amount)},{name:`Cash Out (${e.withdraw.count})`,value:this.money(e.withdraw.amount)},{name:`Cash Refunded (${e.returned.count})`,value:this.money(e.returned.amount)},{name:"Total Cash (compute from POS)",value:this.money(e.drawerTotal)},{name:"Actual Cash (count from drawer) ",value:this.money(e.actualCash.amount)},{name:"Total Diff ",value:this.money(e.diff)}]}buildShiftData(e){return[{name:"PrintTitle",value:"By ShiftWork"},...e.map(n=>({name:`Shift ${n.shift} (${n.quantity})`,value:` ${this.money(n.total)}`}))]}buildPaymentTypeData(e){return[{name:"PrintTitle",value:"By payment types"},...[...e].sort((n,r)=>Number(r?.total||0)-Number(n?.total||0)).map(n=>({name:`${n.type} (${n.quantity})`,value:`${this.moneySmart(n.total)}`}))]}buildOnTheHouseData(e){return!Array.isArray(e)||e.length===0?[]:[{name:"PrintTitle",value:"Entertain / OnTheHouse"},...[...e].sort((n,r)=>Number(r?.total||0)-Number(n?.total||0)).map(n=>({name:`${n.name} (${n.quantity})`,value:`${this.moneySmart(n.total)}`}))]}buildCashierData(e){return[{name:"PrintTitle",value:"By Cashier"},...[...e].sort((n,r)=>Number(r?.total||0)-Number(n?.total||0)).map(n=>({name:`${n.name} (${n.quantity})`,value:`${this.moneySmart(n.total)}`}))]}buildProductTypeSummary(e){return[...e.map(n=>({name:`${n.name} (${n.percent}%)`,value:`${this.moneySmart(n.total)}`}))]}buildBillSummary(e,n="Bills"){const r=a=>Array.isArray(a.multiplePayment)?a.multiplePayment.map(c=>c.name).join(", "):a?.PaymentType||"-",s=e.map((a,c)=>[...this.buildLineFeed(),{name:`${c+1}. ${Ne(a.Date).format("HH:mm:ss DD MMM")}`,value:` ${this.money(a.GrandTotal)}`},{name:"PrintComment",value:` #${a?.ReceiptId||a?.OrderId||"no-id"}, ${r(a)}
194, By : ${a.User}`}]),i=e.reduce((a,c)=>a+(c.GrandTotal||0),0);return[...this.buildLineFeed(),{name:"PrintTitle",value:`${n} : ${this.money(i)}`},...Qe.flatMap(s),...this.buildLineFeed(2),{name:"PrintLine",value:!0},...this.buildLineFeed()]}buildProductSoldSummary(e){let n=[];for(const[r,s]of Object.entries(e??{})){const i=s?.items??[];if(!(!Array.isArray(i)||i.length===0))for(const o of i){const a=o?.name??"-",c=Number(o?.totalamount??0),l=[...this.buildLineFeed(),{name:"PrintComment",value:`*** ${r} : ${a} : ${this.moneySmart(c)}`}],d=Array.isArray(o?.subItems)?o.subItems:[],h=new Map;for(const p of d){const g=String(p?.itemName||o?.name||"-"),_=String(p?.itemKey||g),v=h.get(_)??{itemName:g,subItems:[]};v.subItems.push({subName:String(p?.subName||p?.name||""),qty:Number(p?.quantity??0),amount:Number(p?.amount??0)}),h.set(_,v)}for(const p of h.values()){const g=L9(p,_=>this.moneySmart(_));for(const _ of g)l.push(_)}n=[...n,...l]}}return[...this.buildLineFeed(),{name:"PrintTitle",value:"Detail"},...n]}buildVoidItemsReport(e){let n=[];for(let r of e)n.push({name:"PrintTextLine",value:`${Ne(r.timestamp).format("HH:mm")} ${r.name} x${r.quantity} `});return n}}class FMe extends Ii{printVoidItems(e,n){const r=this.withPayload(e,n);return console.log("jobVoid=>",r),this.print_data=r,this}printVoidItemsCashier(e){return this.print_data=new em().makeVoidItemsCashier(e).build(),this}withPayload(e,n){const r={...e,...n};return new Ed(n?.productsStore).makePrintJobVoid(r).build()}setPayload(e){return this.print_data=e,this}}class BMe extends Ii{printMoveItems(e,n){const r=this.withPayload(e,n);return console.log("jobMove=>",r),this.print_data=r,this}withPayload(e,n){const r={...e,...n};return new Ed(n?.productsStore).makePrintJobMove(r).build()}setPayload(e){return this.print_data=e,this}}function LK(t){console.log("thermal printer JOB run in plugin",t);const e=bn(),n=ol(),r=YE();qr();const s=ln();let i=0;try{const d=Number(t?.guests)||0;if(d>0)i=d;else{const h=tt(),p=_r(),g=String(t?.alias??""),_=/^\d+$/.test(g)?`T${g}`:g;i=Number(p.tablesState?.[_]?.guests??h.tables?.[_]?.guests??0)||0}}catch(d){console.warn("kitchen guest count resolve failed, defaulting to 0",d),i=0}const o={storeId:e.getStoreId||2,guests:s.enableCustomerMode?i:0,billing:r.summaryBillingMoney,productsStore:n,showPrice:s.printShowPrice};console.log("options=>",o);const a={...t},c=(()=>{if(t?.toKitchen===!1)return!1;if(typeof t?.json=="string")try{if(JSON.parse(t.json)?.noPrint===!0)return!1}catch{}return!0})(),l=FD()>=JS.KITCHEN_PRINT_MIN;switch(t.type){case pt.ADD:if(!c||!l)break;a.json=typeof t.json=="string"?JSON.parse(t.json):t.json,new VMe("/printKitchen").printToKitchen(a,o).print();break;case pt.MOVE_TO:if(!ln().printMoveTable||!l)break;new BMe("/printKitchen").printMoveItems(t,o).print();break;case pt.VOID:case pt.VOID_TOPPING:if(t?.__noPrint||!l)break;new FMe("/printVoid").printVoidItems(t,o).print();break;default:console.log("thermal printer JOB run in plugin not match action..");break}}const MK="__job_printed:",VK=1440*60*1e3;function FK(t,e=Date.now()){const n=String(t??"");if(!n||typeof window>"u")return!0;try{const r=`${MK}${n}`,s=window.localStorage.getItem(r);return s&&e-Number(s)<VK?!1:(window.localStorage.setItem(r,String(e)),!0)}catch{return!0}}function $Me(t=Date.now()){if(typeof window>"u")return 0;try{const e=[];for(let n=0;n<window.localStorage.length;n++){const r=window.localStorage.key(n);if(!r||!r.startsWith(MK))continue;const s=Number(window.localStorage.getItem(r));(!s||t-s>=VK)&&e.push(r)}return e.forEach(n=>window.localStorage.removeItem(n)),e.length}catch{return 0}}const UMe=10,HMe=At(()=>{const t=bn();let e=null;ft(()=>t.runMode,n=>{if(!(!n||n===e)){if(n==="2nd_cashier"){e=n,qMe();return}n==="cashier"&&(e=n,jMe())}},{immediate:!0})});function qMe(){tt().$onAction(({name:e,args:n,after:r})=>{if(e!=="add")return;const s=n[0];s?.jobId&&s?.type===200&&r(()=>{try{const i=Ze().secondCashierPrintRef(),o=String(s.jobId).replaceAll(".","_");Ue(zt(i,o),{job:s,sentAt:Ne().toISOString()})}catch(i){console.error("second-cashier: failed to push print request",i)}})})}function jMe(){const t=Ze().secondCashierPrintRef();Js(t,e=>{const n=e.val(),r=()=>Ue(e.ref,null);if(!n||!n.job||!n.sentAt){setTimeout(r,2e3);return}const s=Ne().diff(Ne(n.sentAt),"minute",!0);if(!Number.isFinite(s)||s>UMe){console.log("second-cashier: drop stale print job",{ageMin:s,jobId:n.job?.jobId}),setTimeout(r,2e3);return}if(!FK(n.job?.jobId)){console.log("second-cashier: skip reprint, jobId already printed",
194n.job?.jobId),setTimeout(r,2e3);return}try{LK(n.job)}catch(i){console.error("second-cashier: printJob failed",i)}finally{setTimeout(r,2e3)}})}const WMe=At(t=>{if(!vG())return;const e=Xn();ft(()=>e.isAuthenticated,n=>{if(n){const r=e.user;bIe({id:e.storeId,username:r.UserName,storeId:e.storeId})}},{immediate:!0})}),GMe="2.7.8",ZB="nl-theme",KMe=()=>{const t=Bd("nl-theme",()=>"light"),e=i=>{document.documentElement.setAttribute("data-theme",i);try{localStorage.setItem(ZB,i)}catch{}};return{theme:t,init:()=>{let i="light";try{const o=localStorage.getItem(ZB);(o==="dark"||o==="light")&&(i=o)}catch{}t.value=i,e(i)},toggle:()=>{const i=t.value==="dark"?"light":"dark";t.value=i,e(i)},set:i=>{t.value=i,e(i)}}},zMe=At(()=>{const t=Wa(),e=ln(),n=Xn(),r=bn();rr();const{theme:s}=KMe();let i,o="";const a=async c=>{const l=(c||"").trim();if(!l||!n.storeId||l===o)return;const d=rr().getRootDataRef();try{await Ws(d,{name:l,version:GMe,colorTheme:s.value==="dark"?"Dark":"Light"},{merge:!0}),o=l}catch(h){console.error("[storeName plugin] Failed to sync storeName:",h)}};ft(()=>t.loaded,c=>{if(c){if(r.runMode!=="cashier"||i)return;i=ft(()=>e.storeName,(l,d)=>{l!==d&&a(l)},{immediate:!0});return}i&&(i(),i=void 0)},{immediate:!0})});class YMe extends Ii{printToKitchen(e,n){const r=new Ed(n?.productsStore),s=r.getBillArrValue(n?.billing?.serviceCharge,2)||0,i=r.getBillArrValue(n?.billing?.vat,1)||0,o=r.getBillArrValue(n?.billing?.vat,0)||0,a={...e,...n,serviceValue:s,vatValue:i,vatMode:o},c=r.makePrintJobKitchen(a).build();return console.log("jobKitchen=>",c),this.print_data=c,this}printVoidItems(e){let n=e?.table;e?.channel=="table"&&(n=`Table ${e?.table}`);const r={...e,alias:n},i=new Ed().makePrintJobVoid(r).build();return console.log("jobVoid=>",i),this.print_data=i,this}printMoveItems(e){const n={...e,tableOrigin:e.table,tableDestination:e.newTable},s=new Ed().makePrintJobMove(n).build();return console.log("jobMove=>",s),this.print_data=s,this}printShift(e){const n=[{name:"LineFeed",value:!0},{name:"PrintTitle",value:e.storeInfo?.name||""},{name:"LineFeed",value:!0},{name:"PrintTitle",value:e.table||""},{name:"LineFeed",value:!0},{name:"LineFeed",value:!0},{name:"PrintTextLine",value:`วัà¸à¸à¸µà¹ : ${Ne(e.startTime).format("DD-MM-YYYY")}`},{name:"PrintTextLine",value:`à¹à¸£à¸´à¹à¸¡ : ${Ne(e.startTime).format("HH:mm")}`},{name:"PrintTextLine",value:`ระยะà¹à¸§à¸¥à¸² : ${e.timeLength} à¸à¸²à¸à¸µ`},{name:"PrintTextLine",value:`สิà¹à¸à¸ªà¸¸à¸à¹à¸§à¸¥à¸² : ${Ne(e.startTime).add(e.timeLength,"minute").format("HH:mm")}`},{name:"LineFeed",value:!0},{name:"PrintComment",value:e.note||""},{name:"LineFeed",value:!0},{name:"PrintLine",value:!0},{name:"LineFeed",value:!0}];return this.print_data=n,this}rePrintJob(e){const n=new Ed().makeReprintJobToKitchen(e).build();return console.log("reprint job to kitchen=>",n),this.print_data=n,this}}function e$(t){return t?.IsOnTheHouse===!0?!0:(Number(t?.GrandTotal)||0)===0&&(Number(t?.Discount)||0)>0&&(Number(t?.SubTotal)||0)>0}class JMe extends Ii{printSummaryIncome(e){const n=this.withPayload(e);return console.log("summaryIncome=>",n),this.print_data=n,this}withPayload(e){const n=e.receipts.filter(I=>!I?.IsDeleted),r=e.receipts.filter(I=>I?.IsDeleted),i=(()=>{try{const I=k=>!!k&&Ne(k).isValid();if(I(e?.startDate))return e.startDate;const P=k=>k?.Date||k?.OrderDate||k?.createdAt||null;return(n||[]).reduce((k,L)=>{const M=P(L);return I(M)&&(!k||Ne(M).isBefore(Ne(k)))?M:k},null)}catch(I){return console.warn("resolveStartTime failed, using default:",I),null}})(),o=n.reduce((I,P)=>I+P.CustomerCount,0),a=n.reduce((I,P)=>I+MPe(P),0),c=n.reduce((I,P)=>I+P.GrandTotal,0),l=n.reduce((I,P)=>I+zD(P),0),d=D9(n),h=n.reduce((I,P)=>I+P.ItemDiscount,0),p=n.reduce((I,P)=>I+P.ServiceCharge,0),g=n.reduce((I,P)=>I+P.CardCharge,0),_=n.reduce((I,P)=>I+P.Discount,0),v=r.reduce((I,P)=>I+P.GrandTotal,0),b=this.computeGrandTotalByShift(n),w=n.filter(I=>!e$(I)),E=n.filter(I=>e$(I)),T=this.computeGrandTotalByPaymentType(w),R=this.computeOnTheHouseSummary(E),N=this.computeGrandTotalByCashier(n),O={shopName:e.store.name,employee:e.employee,startTime:i,goodBills:n,voidBills:r,guests:o,shiftsSummary:b,paymentTypesSummary:T,onTheHouseSummary:R,cashiersSummary:N,drawerData:e.drawerData,billing:{subTotal:a,itemsDiscountTotal:h,serviceChangeTotal:p,discountBillTotal:_,cardChargeTotal:g,vatTotal:l,vatExclusiveTotal:d.exclusive,vatInclusiveTotal:d.inclusive,grandTotal:c,voidedBillsAmount:v},isFullReport:e.isFullReport,isCloseShop:e.isCloseShop,isChangeShift:e.isChangeShift,outstanding:e.outstanding,isLocalOnly:e.isLocalOnly};console.log("newPayload=>",O);const S=new em().makeSummaryIncomeReport(O).build();return console.log("summaryIncome=>",S),S}setPayload(e){return this.print_data=e,this}getBillArrValue(e,n){return e?.[n]||0}computeGrandTotalByShift(e){let n={};return e.forEach(r=>{const s=r.ShiftWork;n[s]==null&&(n[s]={shift:r.ShiftWork,total:0,quantity:0}),n[s].total+=r.GrandTotal,n[s].quantity+=1}),Object.values(n)}computeGrandTotalByCashier(e){let n={};return e.forEach(r=>{const s=r.User;n[s]==null&&(n[s]={name:r.User,total:0,quantity:0}),n[s].total+=r.GrandTotal,n[s].quantity+=1}),Object.values(n)}computeOnTheHouseSummary(e){const n={};return e.forEach(r=>{const s=LPe(r)[0]||k9(r)||"OnTheHouse",i=Number(r?.Discount)||0;n[s]||(n[s]={name:s,total:0,quantity:0}),n[s].total+=i,n[s].quantity+=1}),Object.values(n)}computeGrandTotalByPaymentType(e){const n={},r=(s,i,o,a)=>{const c=String(s||i||"Unknown").trim()||"Unknown",l=String(i||c).trim()||c,d=Number(o||0);
194n[c]==null&&(n[c]={name:l,type:c,total:0,quantity:0}),n[c].total+=d,a.has(c)||(n[c].quantity+=1,a.add(c))};return e.forEach(s=>{const i=new Set;if(Array.isArray(s?.multiplePayment)&&s.multiplePayment.length>0){s.multiplePayment.forEach(o=>{r(o?.type||o?.name,o?.name||o?.type,o?.amount,i)});return}if(Array.isArray(s?.payment)&&s.payment.length>0){s.payment.forEach(o=>{r(o?.type||o?.name,o?.name||o?.type,o?.amount,i)});return}if(typeof s?.PaymentType=="string"){const o=s.PaymentType.trim();if(o.startsWith("[")&&o.endsWith("]"))try{const a=JSON.parse(o);if(Array.isArray(a)&&a.length>0){a.forEach(c=>{r(c?.type||c?.name,c?.name||c?.type,c?.amount,i)});return}}catch{}if(o){r(o,o,s?.GrandTotal,i);return}}r("Unknown","Unknown",s?.GrandTotal,i)}),Object.values(n)}}class QMe extends Ii{printProductSold(e){return this.print_data=this.withPayload(e),console.log("print_data",this.print_data),this}withPayload(e){const n=e.sumProductType,r=O9(n),s={shopName:e.store.name,employee:e.employee,groups:n,productSoldSummary:r,isFullReport:e.isFullReport,isCloseShop:e.isCloseShop,isChangeShift:e.isChangeShift};return new em().makeProductSoldReport(s).build()}setPayload(e){return this.print_data=e,this}}class XMe extends Ii{printVoid(e){const n=this.withPayload(e);return this.print_data=n,this}withPayload(e){return new em().makeVoidReport(e).build()}setPayload(e){return this.print_data=e,this}}class ZMe extends Ii{printOpenMenu(e){const n=this.withPayload(e);return console.log("openMenu=>",n),this.print_data=n,this}withPayload(e){const n=this.computePayload(e);return new em().makeOpenMenuReport(n).build()}setPayload(e){return this.print_data=e,this}computePayload(e){const n=e.receipts.filter(o=>!o?.IsDeleted),r=n.flatMap(o=>o.OrderItems);console.log("flatGoodbill=>",r);const s=n.flatMap(o=>o.OrderItems).reduce((o,a)=>{const c=o.find(l=>l.subItemId===a.subItemId);return c?(c.extendedPrice+=a.extendedPrice,c.quantity+=a.quantity):(a.isOpenMenu||a.name.includes("Open Menu"))&&o.push({subItemId:a.subItemId,name:a.name,extendedPrice:a.extendedPrice,price:a.price,quantity:a.quantity}),o},[]);return{shopName:e.store.name||"My Shop",employee:e.employee,openMenuData:s,isCloseShop:e.isCloseShop,isChangeShift:e.isChangeShift}}}class e2e extends Ii{printVoidReceipt(e){return this.print_data=this.withPayload(e),this}withPayload(e){return new em().makeVoidReceipt(e).build()}setPayload(e){return this.print_data=e,this}}const t2e=At(({$pinia:t})=>{ZRe(),$Me(),tt().$onAction(({name:a,store:c,args:l,after:d,onError:h})=>{if(a=="add"){const p=l[0];l[1],console.log("job added",p),d(g=>{if(!FK(p?.jobId)){console.log("kitchen print skipped â jobId already printed",p?.jobId);return}LK(p)})}}),tT().$onAction(({name:a,store:c,after:l})=>{a=="printPreviewByTable"&&l(d=>{if(!d)return;const h=ln();t$(c,d,h)})}),jD().$onAction(({name:a,store:c,args:l,after:d,onError:h})=>{console.log("receipt plugin=>",a),(a=="completePayment"||a=="completeMultiplePayment")&&d(p=>{const g=ln();p&&n2e(c,p,g)})}),Mi().$onAction(({name:a,args:c,after:l})=>{if(a!=="remove")return;const d=c[0],h=c[1];l(()=>{o2e(d,h)})});const i=YE();i.$onAction(({name:a,store:c,args:l,after:d,onError:h})=>{a=="printPreview"&&d(p=>{const g=ln();if(bn().getRunMode=="terminal"&&g.printPreviewRemote){P9().sendPrintPreviewRequest(i.selectedTableId,p);return}t$(c,p,g)}),a=="printShiftTime"&&d(p=>{s2e(p)})}),M9().$onAction(a=>{["printSummary","printProductSold","printVoidItems","printOpenMenu"].includes(a.name)&&a.after(l=>{a2e(a.name,l)})})});function n2e(t,e,n){const r=t.isCopyReceipt,s=Gg()?"/ReceiptV2":"/printPayment",i=r2e(t,e);setTimeout(async()=>{i&&new Ii("/openDrawer").openDrawer(),new JR(s).printReceipt(e,{enableCustomerCount:n.enableCustomerMode,isPrinterInterfaceV3:Gg()}).print()},10),r&&setTimeout(()=>{new JR(s).printReceipt(e,{isCopy:!0,isPrinterInterfaceV3:Gg(),enableCustomerCount:n.enableCustomerMode}).print()},100)}function r2e(t,e){const n=t?.paymentOptions||[],r=o=>{const a=String(o||"").trim();return a?!!n.find(l=>l.name===a||l.uuid===a)?.isCreditCard:!1},s=e?.multiplePayment;if(Array.isArray(s)&&s.length>0)return s.some(o=>!r(o?.name||o?.type||o?.paymentId));const i=typeof s=="string"&&s||e?.PaymentType;return!r(i)}function t$(t,e,n){const r=Gg()?"/PreviewV2":"/printPreview";setTimeout(()=>{new JR(r).printReceipt(e,{isPreview:!0,enableCustomerCount:n.enableCustomerMode,isPrinterInterfaceV3:Gg()}).print()},10)}function s2e(t){setTimeout(async()=>{(await new YMe("/printcustom").printShift(t)).print()},10)}function i2e(t){const e=t?.multiplePayment;return Array.isArray(e)&&e.length>0?e.map(n=>
194n?.name||n?.type||n?.paymentId).filter(Boolean).join(", ")||"-":t?.PaymentType||t?.paymentType||"-"}function o2e(t,e){if(!t)return;const n=qr().getCurrentEmployee?.name||"unknown",r={invoiceId:t?.ReceiptId||t?.receiptId||t?.OrderId||"-",dateTime:t?.Date||t?.OrderDate||t?.createdAt||"-",table:t?.Table||t?.table||"-",grandTotal:Number(t?.GrandTotal??t?.grandTotal??0),paymentType:i2e(t),voidedAt:Ne().toISOString(),employee:n,reason:e||"voided"};setTimeout(()=>{new e2e("/printcustom").printVoidReceipt(r).print()},10)}function a2e(t,e){switch(t){case"printSummary":new JMe("/printcustom").printSummaryIncome(e).print();break;case"printProductSold":new QMe("/printcustom").printProductSold(e).print();break;case"printVoidItems":new XMe("/printcustom").printVoid(e).print();break;case"printOpenMenu":new ZMe("/printcustom").printOpenMenu(e).print();break}}function n$(t){const{error:e,instance:n,info:r}=t,s={info:r};if(n?.$props){const i=dr();(i?i.getOptions():null)?.attachProps&&n.$props!==!1&&(s.propsData=n.$props)}setTimeout(()=>{UE(e,{captureContext:{contexts:{nuxt:s}},mechanism:{handled:!1,type:`auto.function.nuxt.${n?"vue":"app"}-error`}})})}const c2e=At({dependsOn:["sentry-client-config"],async setup(t){if(typeof __SENTRY_TRACING__>"u"||__SENTRY_TRACING__){const e=dr();e&&"$router"in t&&e.addIntegration(nAe({router:t.$router,routeLabel:"path"}))}t.hook("app:created",e=>{const n=dr();n&&n.addIntegration(ZCe({...en._sentryNuxtVueIntegrationOptions,app:e,attachErrorHandler:!1}))}),t.hook("app:error",e=>{YP(e)&&e?.statusCode&&e.statusCode>=300&&e.statusCode<500||n$({error:e})}),t.hook("vue:error",(e,n,r)=>{n$({error:e,instance:n,info:r})})}}),l2e="standalone",u2e=void 0;function d2e(t={}){const{immediate:e=!1,onNeedReload:n,onNeedRefresh:r,onOfflineReady:s,onRegistered:i,onRegisteredSW:o,onRegisterError:a}=t;let c,l,d;const h=async(g=!0)=>{await l,d?.()};async function p(){if("serviceWorker"in navigator){if(c=await at(async()=>{const{Workbox:g}=await import("./tbC_6FF9.js");return{Workbox:g}},[],import.meta.url).then(({Workbox:g})=>new g("./sw.js",{scope:"./",type:"classic"})).catch(g=>{a?.(g)}),!c)return;d=()=>{c?.messageSkipWaiting()};{let g=!1;const _=()=>{g=!0,c?.addEventListener("controlling",v=>{v.isUpdate&&(n?n():window.location.reload())}),r?.()};c.addEventListener("installed",v=>{typeof v.isUpdate>"u"?typeof v.isExternal<"u"&&v.isExternal?_():!g&&s?.():v.isUpdate||s?.()}),c.addEventListener("waiting",_)}c.register({immediate:e}).then(g=>{o?o("./sw.js",g):i?.(g)}).catch(g=>{a?.(g)})}}return l=p(),h}function h2e(t={}){const{immediate:e=!0,onNeedReload:n,onNeedRefresh:r,onOfflineReady:s,onRegistered:i,onRegisteredSW:o,onRegisterError:a}=t,c=Ae(!1),l=Ae(!1);return{updateServiceWorker:d2e({immediate:e,onNeedReload:n,onNeedRefresh(){c.value=!0,r?.()},onOfflineReady(){l.value=!0,s?.()},onRegistered:i,onRegisteredSW:o,onRegisterError:a}),offlineReady:l,needRefresh:c}}const f2e=At({name:"vite-pwa:nuxt:client:plugin",enforce:"post",parallel:!0,setup(t){const e=Ae(!1),n=Ae(!1),r=Ae(!1),s=Ae(!0),i=navigator.userAgent,o=i.match(/iPhone|iPad|iPod/),a=`${l2e}`,c=window.matchMedia(`(display-mode: ${a})`).matches,l=Ae(!!(c||o&&!i.match(/Safari/))),d=Ae(l.value);window.matchMedia(`(display-mode: ${a})`).addEventListener("change",T=>{!d.value&&T.matches&&(d.value=!0)});let h;const p=()=>h,{offlineReady:g,needRefresh:_,updateServiceWorker:v}=h2e({immediate:!0,onRegisterError(T){t.hooks.callHook("service-worker:registration-failed",{error:T}),e.value=!0},onRegisteredSW(T,R){h=R,t.hooks.callHook("service-worker:registered",{url:T,registration:R}),R?.active?.state==="activated"?(n.value=!0,t.hooks.callHook("service-worker:activated",{url:T,registration:R})):R?.installing&&R.installing.addEventListener("statechange",N=>{const O=N.target;n.value=O.state==="activated",n.value&&t.hooks.callHook("service-worker:activated",{url:T,registration:R})})}}),b=async()=>{g.value=!1,_.value=!1};let w=()=>Promise.resolve(void 0),E=()=>{};if(!s.value){let T;const R=N=>{N.preventDefault(),T=N,r.value=!0};window.addEventListener("beforeinstallprompt",R),window.addEventListener("appinstalled",()=>{T=void 0,r.value=!1}),E=()=>{T=void 0,r.value=!1,window.removeEventListener("beforeinstallprompt",R),s.value=!0,localStorage.setItem(u2e,"true")},w=async()=>
194{if(!r.value||!T){r.value=!1;return}return r.value=!1,await zs(),T.prompt(),await T.userChoice}}return{provide:{pwa:Xs({isInstalled:l,isPWAInstalled:d,showInstallPrompt:r,cancelInstall:E,install:w,swActivated:n,registrationError:e,offlineReady:g,needRefresh:_,updateServiceWorker:v,cancelPrompt:b,getSWRegistration:p})}}}}),p2e=At({name:"i18n:plugin:ssg-detect",dependsOn:["i18n:plugin","i18n:plugin:route-locale-detect"],enforce:"post",setup(t){}}),m2e=[Pse,Nse,Mse,Pke,Dke,Lke,Mke,Vke,Fke,Bke,$ke,Uke,Hke,rNe,ZOe,e1e,t1e,i1e,o1e,l1e,f1e,y1e,v1e,b1e,w1e,P1e,k1e,D1e,fMe,pMe,jRe,wMe,CMe,DMe,OMe,LMe,MMe,HMe,WMe,zMe,t2e,c2e,f2e,p2e],g2e=Ls({name:"NuxtRouteAnnouncer",props:{atomic:{type:Boolean,default:!1},politeness:{type:String,default:"polite"}},setup(t,{slots:e,expose:n}){const{set:r,polite:s,assertive:i,message:o,politeness:a}=$Re({politeness:t.politeness}),c=$e(()=>{if(a.value==="assertive")return"alert";if(a.value!=="off")return"status"});return n({set:r,polite:s,assertive:i,message:o,politeness:a}),()=>On("span",{class:"nuxt-route-announcer",style:{position:"absolute"}},On("span",{role:c.value,"aria-live":a.value,"aria-atomic":t.atomic,style:{border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",width:"1px",overflow:"hidden",position:"absolute","white-space":"nowrap","word-wrap":"normal",margin:"-1px",padding:"0"}},e.default?e.default({message:o.value}):o.value))}}),BK=(t="RouteProvider")=>Ls({name:t,props:{route:{type:Object,required:!0},vnode:Object,vnodeRef:Object,renderKey:String,trackRootNodes:Boolean},setup(e){const n=e.renderKey,r=e.route,s={};for(const i in e.route)Object.defineProperty(s,i,{get:()=>n===e.renderKey?e.route[i]:r[i],enumerable:!0});return Sa(jd,ao(s)),()=>e.vnode?On(e.vnode,{ref:e.vnodeRef}):e.vnode}}),_2e=BK(),r$=new WeakMap,y2e=Ls({name:"NuxtPage",inheritAttrs:!1,props:{name:{type:String},transition:{type:[Boolean,Object],default:void 0},keepalive:{type:[Boolean,Object],default:void 0},route:{type:Object},pageKey:{type:[Function,String],default:null}},setup(t,{attrs:e,slots:n,expose:r}){const s=xt(),i=Ae(),o=vr(jd,null);let a;r({pageRef:i});const c=vr(IH,null);let l;const d=s.deferHydration();let h=!1,p=!1,g=0;if(s.isHydrating){const v=s.hooks.hookOnce("app:error",d),b=Os().beforeEach(()=>{v(),b()})}t.pageKey&&ft(()=>t.pageKey,(v,b)=>{v!==b&&s.callHook("page:loading:start")});let _=!1;{const v=Os().beforeResolve(()=>{_=!1});Sp(()=>{v(),d()})}return()=>On(QH,{name:t.name,route:t.route,...e},{default:v=>{const b=v2e(o,v.route,v.Component),w=o&&o.matched.length===v.route.matched.length;if(!v.Component){if(l&&!w&&!HC(l))return l;d();return}if(l&&c&&!HC(l)&&!c.isCurrent(v.route))return l;if(b&&o&&(!c||c?.isCurrent(o)))return(w||l)&&!HC(l)?l:null;const E=EA(v,t.pageKey),T=b2e(o,v.route,v.Component);!s.isHydrating&&a===E&&!T&&zs(()=>{_||(_=!0,s.callHook("page:loading:end"))}),h&&a!==E&&p&&g++,a=E;const R=!!(t.transition??v.route.meta.pageTransition??Xx),N=R&&n4([t.transition,v.route.meta.pageTransition,Xx,{onAfterLeave(){s["~transitionFinish"]?.(),delete s["~transitionFinish"],delete s["~transitionPromise"],s.callHook("page:transition:finish",v.Component)}}]),O=t.keepalive??v.route.meta.keepalive??dre;return l=e4(R&&N,Gie(O,On(CT,{key:g,suspensible:!0,onPending:()=>{h=!0,R&&!s["~transitionPromise"]&&(s["~transitionPromise"]=new Promise(S=>{s["~transitionFinish"]=S})),s.callHook("page:start",v.Component)}
194,onResolve:async()=>{h=!1,p=!0;try{await zs(),s._route.sync?.(),await s.callHook("page:finish",v.Component),!_&&!T&&(_=!0,await s.callHook("page:loading:end"))}finally{d()}}},{default:()=>{const S={key:E||void 0,vnode:n.default?w2e(n.default,v):v.Component,route:v.route,renderKey:E||void 0,trackRootNodes:R,vnodeRef:i};if(!O)return On(_2e,S);const I=v.Component.type,P=I;let k=r$.get(P);return k||(k=BK(I.name||I.__name),r$.set(P,k)),On(k,S)}}))).default(),l}})}});function v2e(t,e,n){if(!t)return!1;const r=e.matched.findIndex(o=>o.components?.default===n?.type);if(r===-1)return!1;const s=e.matched.slice(0,r).filter(o=>o.components?.default);if(!s.length)return!1;const i=t.matched.filter(o=>o.components?.default);return s.some((o,a)=>o.components?.default!==i[a]?.components?.default)||n&&EA({route:e,Component:n})!==EA({route:t,Component:n})}function b2e(t,e,n){return t?e.matched.findIndex(s=>s.components?.default===n?.type)<e.matched.length-1:!1}function w2e(t,e){const n=t(e);return n.length===1?On(n[0]):On(kr,void 0,n)}function HC(t){return!!t&&(!!t.suspense?.isUnmounted||!!t.component?.isUnmounted)}const $K=MH,S2e=Ls({name:"LayoutLoader",inheritAttrs:!1,props:{name:String,layoutProps:Object},setup(t,e){return()=>On(ql[t.name],t.layoutProps,e.slots)}}),T2e={name:{type:[String,Boolean,Object],default:null},fallback:{type:[String,Object],default:null}},E2e=Ls({name:"NuxtLayout",inheritAttrs:!1,props:T2e,setup(t,e){const n=xt(),r=vr(jd),i=!r||r===kT()?XH():r,o=$e(()=>{let d=Wt(t.name)??i?.meta.layout??$K(i?.path).appLayout??"default";return d&&!(d in ql)&&t.fallback&&(d=Wt(t.fallback)),d}),a=ht();e.expose({layoutRef:a});const c=n.deferHydration();if(n.isHydrating){const d=n.hooks.hookOnce("app:error",c),h=Os().beforeEach(()=>{d(),h()})}let l;return()=>{const h=!!o.value&&o.value in ql&&!!(i?.meta.layoutTransition??Qx),p=h&&n4([i?.meta.layoutTransition,Qx,{onBeforeLeave(){n["~transitionPromise"]=new Promise(_=>{n["~transitionFinish"]=_})},onAfterLeave(){n["~transitionFinish"]?.(),delete n["~transitionFinish"],delete n["~transitionPromise"]}}]),g=l;return l=o.value,e4(p,{default:()=>On(CT,{suspensible:!0,onResolve:async()=>{await zs(c)}},{default:()=>On(I2e,{layoutProps:UP(e.attrs,i.meta.layoutProps??{},{ref:a}),key:o.value||void 0,name:o.value,shouldProvide:!t.name,isRenderingNewLayout:_=>_!==g&&_===o.value,hasTransition:h},e.slots)})}).default()}}}),I2e=Ls({name:"NuxtLayoutProvider",inheritAttrs:!1,props:{name:{type:[String,Boolean]},layoutProps:{type:Object},hasTransition:{type:Boolean},shouldProvide:{type:Boolean},isRenderingNewLayout:{type:Function,required:!0}},setup(t,e){const n=t.name;t.shouldProvide&&Sa(IH,{isCurrent:i=>n===!1||n===(i.meta.layout??$K(i.path).appLayout??"default")});const r=vr(jd);if(r&&r===kT()){const i=XH(),o={};for(const a in i){const c=a;Object.defineProperty(o,c,{enumerable:!0,get:()=>t.isRenderingNewLayout(t.name)?i[c]:r[c]})}Sa(jd,ao(o))}return()=>!n||typeof n=="string"&&!(n in ql)?e.slots.default?.():On(S2e,{key:n,layoutProps:t.layoutProps,name:n},e.slots)}}),C2e=lRe(g2e),A2e={};function R2e(t,e){const n=C2e,r=y2e,s=E2e;return ls(),Do(s,null,{default:z_(()=>[Un(n),Un(r)]),_:1})}const P2e=kK(A2e,[["render",R2e]]),k2e={__name:"nuxt-error-page",props:{error:Object},setup(t){const n=t.error,r=Number(n.statusCode||500),s=r===404,i=n.statusMessage??(s?"Page Not Found":"Internal Server Error"),o=n.message||n.toString(),a=void 0,d=s?mc(()=>at(()=>import("./D36nqd-u.js"),__vite__mapDeps([99,1,100]),import.meta.url)):mc(()=>at(()=>import("./CU1xs4rU.js"),__vite__mapDeps([101,102]),import.meta.url));return(h,p)=>(ls(),Do(Wt(d),pP(FP({status:Wt(r),statusText:Wt(i),statusCode:Wt(r),statusMessage:Wt(i),description:Wt(o),stack:Wt(a)})),null,16))}},N2e={key:0},s$={__name:"nuxt-root",setup(t){const e=()=>null,n=xt(),r=n.deferHydration();if(n.isHydrating){const d=n.hooks.hookOnce("app:error",r),h=Os().beforeEach(()=>{d(),h()})}const s=!1;Sa(jd,kT()),n.hooks.callHookWith(d=>d.map(h=>h()),"vue:setup",[]);const i=NT(),o=!1,a=/bot\b|chrome-lighthouse|facebookexternalhit|google\b/i;function c(d,h,p){const g=n.vueApp.config.errorHandler;if(g&&!g.__nuxt_default)try{g(d,h,p)}
194catch(_){console.error("[nuxt] Error in `app.config.errorHandler`",_)}}kP((d,h,p)=>{if(n.hooks.callHook("vue:error",d,h,p)?.catch(g=>console.error("[nuxt] Error in `vue:error` hook",g)),a.test(navigator.userAgent))return n.hooks.callHook("app:error",d),console.error(`[nuxt] Not rendering error page for bot with user agent \`${navigator.userAgent}\`:`,d),!1;if(YP(d)&&(d.fatal||d.unhandled))return n.runWithContext(()=>rd(d)),c(d,h,p),!1});const l=!1;return(d,h)=>(ls(),Do(CT,{onResolve:Wt(r)},{default:z_(()=>[Wt(o)?(ls(),Ll("div",N2e)):Wt(i)?(ls(),Do(Wt(k2e),{key:1,error:Wt(i)},null,8,["error"])):Wt(l)?(ls(),Do(Wt(e),{key:2,context:Wt(l)},null,8,["context"])):Wt(s)?(ls(),Do(tU(Wt(s)),{key:3})):(ls(),Do(Wt(P2e),{key:4}))]),_:1},8,["onResolve"]))}};let i$;{let t;i$=async function(){if(t)return t;const n=!!(window.__NUXT__?.serverRendered??document.getElementById("__NUXT_DATA__")?.dataset.ssr==="true"),r=n?jP(s$):Vw(s$),s=_re({vueApp:r});async function i(o){await s.callHook("app:error",o),s.payload.error||=Gl(o)}i.__nuxt_default=!0,r.config.errorHandler=i,s.hook("app:suspense:resolve",()=>{r.config.errorHandler===i&&(r.config.errorHandler=void 0)}),!n&&Zx.id&&s.hook("app:suspense:resolve",()=>{document.getElementById(Zx.id)?.remove()});try{await bre(s,m2e)}catch(o){i(o)}try{await s.hooks.callHook("app:created",r),await s.hooks.callHook("app:beforeMount",r),r.mount(pre),await s.hooks.callHook("app:mounted",r),await zs()}catch(o){i(o)}return r},t=i$().catch(e=>{throw console.error("Error while mounting app:",e),e})}export{xVe as $,Td as A,fTe as B,uVe as C,un as D,Jt as E,kr as F,SVe as G,Wp as H,lCe as I,pt as J,Y$ as K,CVe as L,vo as M,uP as N,hCe as O,JS as P,BVe as Q,D9 as R,$g as S,jZ as T,cTe as U,Fn as V,Ns as W,xr as X,jVe as Y,_p as Z,Qe as _,Pu as a,yD as a$,UE as a0,vIe as a1,MVe as a2,bVe as a3,zt as a4,YVe as a5,Ib as a6,dB as a7,VPe as a8,$e as a9,$n as aA,SD as aB,oh as aC,fB as aD,Pre as aE,AVe as aF,kVe as aG,Rn as aH,gVe as aI,NR as aJ,REe as aK,MAe as aL,xPe as aM,k9 as aN,TX as aO,X_e as aP,H2e as aQ,vAe as aR,dr as aS,WIe as aT,Sr as aU,Kn as aV,Ba as aW,lD as aX,CEe as aY,vVe as aZ,hVe as a_,jp as aa,PVe as ab,Br as ac,Do as ad,Nw as ae,Ll as af,ED as ag,DVe as ah,il as ai,NVe as aj,hee as ak,lTe as al,AU as am,BP as an,Un as ao,FD as ap,Uy as aq,Ne as ar,Cn as as,mt as at,Ls as au,$Ve as av,L2e as aw,qn as ax,W2e as ay,xD as az,Fc as b,RP as b$,OE as b0,CG as b1,VVe as b2,Yp as b3,AD as b4,vTe as b5,KVe as b6,UVe as b7,wVe as b8,N9 as b9,Gg as bA,Pn as bB,jl as bC,OX as bD,AEe as bE,ru as bF,vn as bG,Si as bH,xE as bI,LX as bJ,Nd as bK,TVe as bL,Ei as bM,GVe as bN,yT as bO,Gp as bP,VE as bQ,UP as bR,co as bS,zs as bT,JVe as bU,cu as bV,pP as bW,yp as bX,ETe as bY,x2e as bZ,CP as b_,FP as ba,On as bb,zVe as bc,zR as bd,nl as be,el as bf,Qs as bg,vr as bh,rt as bi,CIe as bj,uX as bk,pVe as bl,mVe as bm,DW as bn,fVe as bo,_Te as bp,DX as bq,vG as br,LE as bs,xX as bt,wF as bu,fn as bv,mp as bw,mTe as bx,gTe as by,kR as bz,aG as c,fw as c$,Sp as c0,PP as c1,q2e as c2,j2e as c3,ka as c4,a9 as c5,$c as c6,xo as c7,Tp as c8,xa as c9,tU as cA,KD as cB,Rre as cC,yG as cD,lke as cE,qt as cF,O2e as cG,LW as cH,yVe as cI,Vd as cJ,RVe as cK,Ue as cL,QS as cM,_Ve as cN,KPe as cO,TIe as cP,FVe as cQ,ht as cR,D2e as cS,HVe as cT,TD as cU,SEe as cV,yn as cW,dVe as cX,LVe as cY,M2e as cZ,EVe as c_,ls as ca,zV as cb,H9 as cc,LPe as cd,WP as ce,WS as cf,c$ as cg,GS as ch,VRe as ci,OVe as cj,Sa as ck,gH as cl,$pe as cm,Xs as cn,zD as co,Ae as cp,Zt as cq,QD as cr,oIe as cs,Q_e as ct,iH as cu,dee as cv,fee as cw,IVe as cx,GF as cy,lee as cz,en as d,z_ as d$,Vc as d0,md as d1,mf as d2,vp as d3,Pr as d4,Ca as d5,Wt as d6,ME as d7,au as d8,Eee as d9,YE as dA,PC as dB,_r as dC,GPe as dD,Ze as dE,M9 as dF,kT as dG,Os as dH,V2e as dI,Ks as dJ,wi as dK,ln as dL,Tee as dM,Bd as dN,_Pe as dO,UD as dP,KMe as dQ,su as dR,HP as dS,qP as dT,QU as dU,xf as dV,qU as dW,GMe as dX,ft as dY,SP as dZ,v2 as d_,Xn as da,Wa as db,WPe as dc,WVe as dd,Ot as de,ua as df,rr as dg,Mo as dh,wse as di,uO as dj,di as dk,xt as dl,ZPe as dm,eke as dn,t9 as dp,ZF as dq,zE as dr,qr as ds,tt as dt,jD as du,$D as dv,ol as dw,Mi as dx,bn as dy,mPe as dz,ou as e,KC as e0,sne as e1,tH as e2,Lne as e3,
194s_ as e4,KIe as e5,Bt as f,Vi as g,em as h,Ed as i,Jp as j,QTe as k,gg as l,Or as m,VMe as n,JR as o,Ii as p,BU as q,zte as r,tn as s,qVe as t,at as u,kK as v,FW as w,NTe as x,TG as y,dTe as z}; 195//# sourceMappingURL=IkjnEir3.js.map
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.