var ZN = Object.defineProperty;
var l_ = (e) => {
  throw TypeError(e);
};
var eC = (e, t, n) => t in e ? ZN(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var Qe = (e, t, n) => eC(e, typeof t != "symbol" ? t + "" : t, n), Pp = (e, t, n) => t.has(e) || l_("Cannot " + n);
var ha = (e, t, n) => (Pp(e, t, "read from private field"), n ? n.call(e) : t.get(e)), Sl = (e, t, n) => t.has(e) ? l_("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), Lp = (e, t, n, s) => (Pp(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n), c_ = (e, t, n) => (Pp(e, t, "access private method"), n);
var d1 = {};
/**
* @vue/shared v3.5.13
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function On(e) {
  const t = /* @__PURE__ */ Object.create(null);
  for (const n of e.split(",")) t[n] = 1;
  return (n) => n in t;
}
const pt = d1.NODE_ENV !== "production" ? Object.freeze({}) : {}, Di = d1.NODE_ENV !== "production" ? Object.freeze([]) : [], Jt = () => {
}, Ta = () => !1, Do = (e) => e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && // uppercase letter
(e.charCodeAt(2) > 122 || e.charCodeAt(2) < 97), vc = (e) => e.startsWith("onUpdate:"), it = Object.assign, _f = (e, t) => {
  const n = e.indexOf(t);
  n > -1 && e.splice(n, 1);
}, tC = Object.prototype.hasOwnProperty, St = (e, t) => tC.call(e, t), Ce = Array.isArray, Kr = (e) => oa(e) === "[object Map]", oi = (e) => oa(e) === "[object Set]", Ph = (e) => oa(e) === "[object Date]", f1 = (e) => oa(e) === "[object RegExp]", Ue = (e) => typeof e == "function", Ge = (e) => typeof e == "string", us = (e) => typeof e == "symbol", mt = (e) => e !== null && typeof e == "object", Hc = (e) => (mt(e) || Ue(e)) && Ue(e.then) && Ue(e.catch), nv = Object.prototype.toString, oa = (e) => nv.call(e), yf = (e) => oa(e).slice(8, -1), Yc = (e) => oa(e) === "[object Object]", bf = (e) => Ge(e) && e !== "NaN" && e[0] !== "-" && "" + parseInt(e, 10) === e, fr = /* @__PURE__ */ On(
  // the leading comma is intentional so empty string "" is also included
  ",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"
), sv = /* @__PURE__ */ On(
  "bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"
), Ef = (e) => {
  const t = /* @__PURE__ */ Object.create(null);
  return (n) => t[n] || (t[n] = e(n));
}, nC = /-(\w)/g, Gt = Ef(
  (e) => e.replace(nC, (t, n) => n ? n.toUpperCase() : "")
), sC = /\B([A-Z])/g, Un = Ef(
  (e) => e.replace(sC, "-$1").toLowerCase()
), fo = Ef((e) => e.charAt(0).toUpperCase() + e.slice(1)), to = Ef(
  (e) => e ? `on${fo(e)}` : ""
), Wn = (e, t) => !Object.is(e, t), or = (e, ...t) => {
  for (let n = 0; n < e.length; n++)
    e[n](...t);
}, ji = (e, t, n, s = !1) => {
  Object.defineProperty(e, t, {
    configurable: !0,
    enumerable: !1,
    writable: s,
    value: n
  });
}, gc = (e) => {
  const t = parseFloat(e);
  return isNaN(t) ? e : t;
}, _c = (e) => {
  const t = Ge(e) ? Number(e) : NaN;
  return isNaN(t) ? e : t;
};
let u_;
const al = () => u_ || (u_ = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {}), oC = /^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;
function rC(e) {
  return oC.test(e) ? `__props.${e}` : `__props[${JSON.stringify(e)}]`;
}
function iC(e, t) {
  return e + JSON.stringify(
    t,
    (n, s) => typeof s == "function" ? s.toString() : s
  );
}
const aC = {
  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"
}, ql = {
  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]: "HOISTED",
  [-2]: "BAIL"
}, lC = {
  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"
}, cC = {
  STABLE: 1,
  1: "STABLE",
  DYNAMIC: 2,
  2: "DYNAMIC",
  FORWARDED: 3,
  3: "FORWARDED"
}, p1 = {
  1: "STABLE",
  2: "DYNAMIC",
  3: "FORWARDED"
}, uC = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol", ov = /* @__PURE__ */ On(uC), dC = ov, d_ = 2;
function h1(e, t = 0, n = e.length) {
  if (t = Math.max(0, Math.min(t, e.length)), n = Math.max(0, Math.min(n, e.length)), t > n) return "";
  let s = e.split(/(\r?\n)/);
  const o = s.filter((a, l) => l % 2 === 1);
  s = s.filter((a, l) => l % 2 === 0);
  let i = 0;
  const r = [];
  for (let a = 0; a < s.length; a++)
    if (i += s[a].length + (o[a] && o[a].length || 0), i >= t) {
      for (let l = a - d_; l <= a + d_ || n > i; l++) {
        if (l < 0 || l >= s.length) continue;
        const u = l + 1;
        r.push(
          `${u}${" ".repeat(Math.max(3 - String(u).length, 0))}|  ${s[l]}`
        );
        const d = s[l].length, f = o[l] && o[l].length || 0;
        if (l === a) {
          const p = t - (i - (d + f)), h = Math.max(
            1,
            n > i ? d - p : n - t
          );
          r.push("   |  " + " ".repeat(p) + "^".repeat(h));
        } else if (l > a) {
          if (n > i) {
            const p = Math.max(Math.min(n - i, d), 1);
            r.push("   |  " + "^".repeat(p));
          }
          i += d + f;
        }
      }
      break;
    }
  return r.join(`
`);
}
function Jn(e) {
  if (Ce(e)) {
    const t = {};
    for (let n = 0; n < e.length; n++) {
      const s = e[n], o = Ge(s) ? rv(s) : Jn(s);
      if (o)
        for (const i in o)
          t[i] = o[i];
    }
    return t;
  } else if (Ge(e) || mt(e))
    return e;
}
const fC = /;(?![^(]*\))/g, pC = /:([^]+)/, hC = /\/\*[^]*?\*\//g;
function rv(e) {
  const t = {};
  return e.replace(hC, "").split(fC).forEach((n) => {
    if (n) {
      const s = n.split(pC);
      s.length > 1 && (t[s[0].trim()] = s[1].trim());
    }
  }), t;
}
function m1(e) {
  if (!e) return "";
  if (Ge(e)) return e;
  let t = "";
  for (const n in e) {
    const s = e[n];
    if (Ge(s) || typeof s == "number") {
      const o = n.startsWith("--") ? n : Un(n);
      t += `${o}:${s};`;
    }
  }
  return t;
}
function Se(e) {
  let t = "";
  if (Ge(e))
    t = e;
  else if (Ce(e))
    for (let n = 0; n < e.length; n++) {
      const s = Se(e[n]);
      s && (t += s + " ");
    }
  else if (mt(e))
    for (const n in e)
      e[n] && (t += n + " ");
  return t.trim();
}
function kt(e) {
  if (!e) return null;
  let { class: t, style: n } = e;
  return t && !Ge(t) && (e.class = Se(t)), n && (e.style = Jn(n)), e;
}
const mC = "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", vC = "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", gC = "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", _C = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr", iv = /* @__PURE__ */ On(mC), av = /* @__PURE__ */ On(vC), lv = /* @__PURE__ */ On(gC), v1 = /* @__PURE__ */ On(_C), g1 = "itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly", _1 = /* @__PURE__ */ On(g1), Lh = /* @__PURE__ */ On(
  g1 + ",async,autofocus,autoplay,controls,default,defer,disabled,hidden,inert,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected"
);
function wf(e) {
  return !!e || e === "";
}
const yC = /[>/="'\u0009\u000a\u000c\u0020]/, Vp = {};
function bC(e) {
  if (Vp.hasOwnProperty(e))
    return Vp[e];
  const t = yC.test(e);
  return t && console.error(`unsafe attribute name: ${e}`), Vp[e] = !t;
}
const EC = {
  acceptCharset: "accept-charset",
  className: "class",
  htmlFor: "for",
  httpEquiv: "http-equiv"
}, y1 = /* @__PURE__ */ On(
  "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,colspan,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"
), b1 = /* @__PURE__ */ On(
  "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-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"
), wC = /* @__PURE__ */ On(
  "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 E1(e) {
  if (e == null)
    return !1;
  const t = typeof e;
  return t === "string" || t === "number" || t === "boolean";
}
const SC = /["'&<>]/;
function xC(e) {
  const t = "" + e, n = SC.exec(t);
  if (!n)
    return t;
  let s = "", o, i, r = 0;
  for (i = n.index; i < t.length; i++) {
    switch (t.charCodeAt(i)) {
      case 34:
        o = "&quot;";
        break;
      case 38:
        o = "&amp;";
        break;
      case 39:
        o = "&#39;";
        break;
      case 60:
        o = "&lt;";
        break;
      case 62:
        o = "&gt;";
        break;
      default:
        continue;
    }
    r !== i && (s += t.slice(r, i)), r = i + 1, s += o;
  }
  return r !== i ? s + t.slice(r, i) : s;
}
const NC = /^-?>|<!--|-->|--!>|<!-$/g;
function CC(e) {
  return e.replace(NC, "");
}
const w1 = /[ !"#$%&'()*+,./:;<=>?@[\\\]^`{|}~]/g;
function S1(e, t) {
  return e.replace(
    w1,
    (n) => t ? n === '"' ? '\\\\\\"' : `\\\\${n}` : `\\${n}`
  );
}
function OC(e, t) {
  if (e.length !== t.length) return !1;
  let n = !0;
  for (let s = 0; n && s < e.length; s++)
    n = gr(e[s], t[s]);
  return n;
}
function gr(e, t) {
  if (e === t) return !0;
  let n = Ph(e), s = Ph(t);
  if (n || s)
    return n && s ? e.getTime() === t.getTime() : !1;
  if (n = us(e), s = us(t), n || s)
    return e === t;
  if (n = Ce(e), s = Ce(t), n || s)
    return n && s ? OC(e, t) : !1;
  if (n = mt(e), s = mt(t), n || s) {
    if (!n || !s)
      return !1;
    const o = Object.keys(e).length, i = Object.keys(t).length;
    if (o !== i)
      return !1;
    for (const r in e) {
      const a = e.hasOwnProperty(r), l = t.hasOwnProperty(r);
      if (a && !l || !a && l || !gr(e[r], t[r]))
        return !1;
    }
  }
  return String(e) === String(t);
}
function Wc(e, t) {
  return e.findIndex((n) => gr(n, t));
}
const x1 = (e) => !!(e && e.__v_isRef === !0), F = (e) => Ge(e) ? e : e == null ? "" : Ce(e) || mt(e) && (e.toString === nv || !Ue(e.toString)) ? x1(e) ? F(e.value) : JSON.stringify(e, N1, 2) : String(e), N1 = (e, t) => x1(t) ? N1(e, t.value) : Kr(t) ? {
  [`Map(${t.size})`]: [...t.entries()].reduce(
    (n, [s, o], i) => (n[Fp(s, i) + " =>"] = o, n),
    {}
  )
} : oi(t) ? {
  [`Set(${t.size})`]: [...t.values()].map((n) => Fp(n))
} : us(t) ? Fp(t) : mt(t) && !Ce(t) && !Yc(t) ? String(t) : t, Fp = (e, t = "") => {
  var n;
  return (
    // Symbol.description in es2019+ so we need to cast here to pass
    // the lib: es2016 check
    us(e) ? `Symbol(${(n = e.description) != null ? n : t})` : e
  );
}, TC = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  EMPTY_ARR: Di,
  EMPTY_OBJ: pt,
  NO: Ta,
  NOOP: Jt,
  PatchFlagNames: ql,
  PatchFlags: aC,
  ShapeFlags: lC,
  SlotFlags: cC,
  camelize: Gt,
  capitalize: fo,
  cssVarNameEscapeSymbolsRE: w1,
  def: ji,
  escapeHtml: xC,
  escapeHtmlComment: CC,
  extend: it,
  genCacheKey: iC,
  genPropsAccessExp: rC,
  generateCodeFrame: h1,
  getEscapedCssVarName: S1,
  getGlobalThis: al,
  hasChanged: Wn,
  hasOwn: St,
  hyphenate: Un,
  includeBooleanAttr: wf,
  invokeArrayFns: or,
  isArray: Ce,
  isBooleanAttr: Lh,
  isBuiltInDirective: sv,
  isDate: Ph,
  isFunction: Ue,
  isGloballyAllowed: ov,
  isGloballyWhitelisted: dC,
  isHTMLTag: iv,
  isIntegerKey: bf,
  isKnownHtmlAttr: y1,
  isKnownMathMLAttr: wC,
  isKnownSvgAttr: b1,
  isMap: Kr,
  isMathMLTag: lv,
  isModelListener: vc,
  isObject: mt,
  isOn: Do,
  isPlainObject: Yc,
  isPromise: Hc,
  isRegExp: f1,
  isRenderableAttrValue: E1,
  isReservedProp: fr,
  isSSRSafeAttrName: bC,
  isSVGTag: av,
  isSet: oi,
  isSpecialBooleanAttr: _1,
  isString: Ge,
  isSymbol: us,
  isVoidTag: v1,
  looseEqual: gr,
  looseIndexOf: Wc,
  looseToNumber: gc,
  makeMap: On,
  normalizeClass: Se,
  normalizeProps: kt,
  normalizeStyle: Jn,
  objectToString: nv,
  parseStringStyle: rv,
  propsToAttrMap: EC,
  remove: _f,
  slotFlagsText: p1,
  stringifyStyle: m1,
  toDisplayString: F,
  toHandlerKey: to,
  toNumber: _c,
  toRawType: yf,
  toTypeString: oa
}, Symbol.toStringTag, { value: "Module" }));
var Vt = {};
function Hs(e, ...t) {
  console.warn(`[Vue warn] ${e}`, ...t);
}
let rs;
class cv {
  constructor(t = !1) {
    this.detached = t, this._active = !0, this.effects = [], this.cleanups = [], this._isPaused = !1, this.parent = rs, !t && rs && (this.index = (rs.scopes || (rs.scopes = [])).push(
      this
    ) - 1);
  }
  get active() {
    return this._active;
  }
  pause() {
    if (this._active) {
      this._isPaused = !0;
      let t, n;
      if (this.scopes)
        for (t = 0, n = this.scopes.length; t < n; t++)
          this.scopes[t].pause();
      for (t = 0, n = this.effects.length; t < n; t++)
        this.effects[t].pause();
    }
  }
  /**
   * Resumes the effect scope, including all child scopes and effects.
   */
  resume() {
    if (this._active && this._isPaused) {
      this._isPaused = !1;
      let t, n;
      if (this.scopes)
        for (t = 0, n = this.scopes.length; t < n; t++)
          this.scopes[t].resume();
      for (t = 0, n = this.effects.length; t < n; t++)
        this.effects[t].resume();
    }
  }
  run(t) {
    if (this._active) {
      const n = rs;
      try {
        return rs = this, t();
      } finally {
        rs = n;
      }
    } else Vt.NODE_ENV !== "production" && Hs("cannot run an inactive effect scope.");
  }
  /**
   * This should only be called on non-detached scopes
   * @internal
   */
  on() {
    rs = this;
  }
  /**
   * This should only be called on non-detached scopes
   * @internal
   */
  off() {
    rs = this.parent;
  }
  stop(t) {
    if (this._active) {
      this._active = !1;
      let n, s;
      for (n = 0, s = this.effects.length; n < s; n++)
        this.effects[n].stop();
      for (this.effects.length = 0, n = 0, s = this.cleanups.length; n < s; n++)
        this.cleanups[n]();
      if (this.cleanups.length = 0, this.scopes) {
        for (n = 0, s = this.scopes.length; n < s; n++)
          this.scopes[n].stop(!0);
        this.scopes.length = 0;
      }
      if (!this.detached && this.parent && !t) {
        const o = this.parent.scopes.pop();
        o && o !== this && (this.parent.scopes[this.index] = o, o.index = this.index);
      }
      this.parent = void 0;
    }
  }
}
function uv(e) {
  return new cv(e);
}
function dv() {
  return rs;
}
function C1(e, t = !1) {
  rs ? rs.cleanups.push(e) : Vt.NODE_ENV !== "production" && !t && Hs(
    "onScopeDispose() is called when there is no active effect scope to be associated with."
  );
}
let jt;
const Up = /* @__PURE__ */ new WeakSet();
class yc {
  constructor(t) {
    this.fn = t, this.deps = void 0, this.depsTail = void 0, this.flags = 5, this.next = void 0, this.cleanup = void 0, this.scheduler = void 0, rs && rs.active && rs.effects.push(this);
  }
  pause() {
    this.flags |= 64;
  }
  resume() {
    this.flags & 64 && (this.flags &= -65, Up.has(this) && (Up.delete(this), this.trigger()));
  }
  /**
   * @internal
   */
  notify() {
    this.flags & 2 && !(this.flags & 32) || this.flags & 8 || T1(this);
  }
  run() {
    if (!(this.flags & 1))
      return this.fn();
    this.flags |= 2, f_(this), $1(this);
    const t = jt, n = uo;
    jt = this, uo = !0;
    try {
      return this.fn();
    } finally {
      Vt.NODE_ENV !== "production" && jt !== this && Hs(
        "Active effect was not restored correctly - this is likely a Vue internal bug."
      ), k1(this), jt = t, uo = n, this.flags &= -3;
    }
  }
  stop() {
    if (this.flags & 1) {
      for (let t = this.deps; t; t = t.nextDep)
        hv(t);
      this.deps = this.depsTail = void 0, f_(this), this.onStop && this.onStop(), this.flags &= -2;
    }
  }
  trigger() {
    this.flags & 64 ? Up.add(this) : this.scheduler ? this.scheduler() : this.runIfDirty();
  }
  /**
   * @internal
   */
  runIfDirty() {
    Vh(this) && this.run();
  }
  get dirty() {
    return Vh(this);
  }
}
let O1 = 0, Jl, Ql;
function T1(e, t = !1) {
  if (e.flags |= 8, t) {
    e.next = Ql, Ql = e;
    return;
  }
  e.next = Jl, Jl = e;
}
function fv() {
  O1++;
}
function pv() {
  if (--O1 > 0)
    return;
  if (Ql) {
    let t = Ql;
    for (Ql = void 0; t; ) {
      const n = t.next;
      t.next = void 0, t.flags &= -9, t = n;
    }
  }
  let e;
  for (; Jl; ) {
    let t = Jl;
    for (Jl = void 0; t; ) {
      const n = t.next;
      if (t.next = void 0, t.flags &= -9, t.flags & 1)
        try {
          t.trigger();
        } catch (s) {
          e || (e = s);
        }
      t = n;
    }
  }
  if (e) throw e;
}
function $1(e) {
  for (let t = e.deps; t; t = t.nextDep)
    t.version = -1, t.prevActiveLink = t.dep.activeLink, t.dep.activeLink = t;
}
function k1(e) {
  let t, n = e.depsTail, s = n;
  for (; s; ) {
    const o = s.prevDep;
    s.version === -1 ? (s === n && (n = o), hv(s), $C(s)) : t = s, s.dep.activeLink = s.prevActiveLink, s.prevActiveLink = void 0, s = o;
  }
  e.deps = t, e.depsTail = n;
}
function Vh(e) {
  for (let t = e.deps; t; t = t.nextDep)
    if (t.dep.version !== t.version || t.dep.computed && (D1(t.dep.computed) || t.dep.version !== t.version))
      return !0;
  return !!e._dirty;
}
function D1(e) {
  if (e.flags & 4 && !(e.flags & 16) || (e.flags &= -17, e.globalVersion === bc))
    return;
  e.globalVersion = bc;
  const t = e.dep;
  if (e.flags |= 2, t.version > 0 && !e.isSSR && e.deps && !Vh(e)) {
    e.flags &= -3;
    return;
  }
  const n = jt, s = uo;
  jt = e, uo = !0;
  try {
    $1(e);
    const o = e.fn(e._value);
    (t.version === 0 || Wn(o, e._value)) && (e._value = o, t.version++);
  } catch (o) {
    throw t.version++, o;
  } finally {
    jt = n, uo = s, k1(e), e.flags &= -3;
  }
}
function hv(e, t = !1) {
  const { dep: n, prevSub: s, nextSub: o } = e;
  if (s && (s.nextSub = o, e.prevSub = void 0), o && (o.prevSub = s, e.nextSub = void 0), Vt.NODE_ENV !== "production" && n.subsHead === e && (n.subsHead = o), n.subs === e && (n.subs = s, !s && n.computed)) {
    n.computed.flags &= -5;
    for (let i = n.computed.deps; i; i = i.nextDep)
      hv(i, !0);
  }
  !t && !--n.sc && n.map && n.map.delete(n.key);
}
function $C(e) {
  const { prevDep: t, nextDep: n } = e;
  t && (t.nextDep = n, e.prevDep = void 0), n && (n.prevDep = t, e.nextDep = void 0);
}
function kC(e, t) {
  e.effect instanceof yc && (e = e.effect.fn);
  const n = new yc(e);
  t && it(n, t);
  try {
    n.run();
  } catch (o) {
    throw n.stop(), o;
  }
  const s = n.run.bind(n);
  return s.effect = n, s;
}
function DC(e) {
  e.effect.stop();
}
let uo = !0;
const R1 = [];
function br() {
  R1.push(uo), uo = !1;
}
function Er() {
  const e = R1.pop();
  uo = e === void 0 ? !0 : e;
}
function f_(e) {
  const { cleanup: t } = e;
  if (e.cleanup = void 0, t) {
    const n = jt;
    jt = void 0;
    try {
      t();
    } finally {
      jt = n;
    }
  }
}
let bc = 0;
class RC {
  constructor(t, n) {
    this.sub = t, this.dep = n, this.version = n.version, this.nextDep = this.prevDep = this.nextSub = this.prevSub = this.prevActiveLink = void 0;
  }
}
class Sf {
  constructor(t) {
    this.computed = t, this.version = 0, this.activeLink = void 0, this.subs = void 0, this.map = void 0, this.key = void 0, this.sc = 0, Vt.NODE_ENV !== "production" && (this.subsHead = void 0);
  }
  track(t) {
    if (!jt || !uo || jt === this.computed)
      return;
    let n = this.activeLink;
    if (n === void 0 || n.sub !== jt)
      n = this.activeLink = new RC(jt, this), jt.deps ? (n.prevDep = jt.depsTail, jt.depsTail.nextDep = n, jt.depsTail = n) : jt.deps = jt.depsTail = n, I1(n);
    else if (n.version === -1 && (n.version = this.version, n.nextDep)) {
      const s = n.nextDep;
      s.prevDep = n.prevDep, n.prevDep && (n.prevDep.nextDep = s), n.prevDep = jt.depsTail, n.nextDep = void 0, jt.depsTail.nextDep = n, jt.depsTail = n, jt.deps === n && (jt.deps = s);
    }
    return Vt.NODE_ENV !== "production" && jt.onTrack && jt.onTrack(
      it(
        {
          effect: jt
        },
        t
      )
    ), n;
  }
  trigger(t) {
    this.version++, bc++, this.notify(t);
  }
  notify(t) {
    fv();
    try {
      if (Vt.NODE_ENV !== "production")
        for (let n = this.subsHead; n; n = n.nextSub)
          n.sub.onTrigger && !(n.sub.flags & 8) && n.sub.onTrigger(
            it(
              {
                effect: n.sub
              },
              t
            )
          );
      for (let n = this.subs; n; n = n.prevSub)
        n.sub.notify() && n.sub.dep.notify();
    } finally {
      pv();
    }
  }
}
function I1(e) {
  if (e.dep.sc++, e.sub.flags & 4) {
    const t = e.dep.computed;
    if (t && !e.dep.subs) {
      t.flags |= 20;
      for (let s = t.deps; s; s = s.nextDep)
        I1(s);
    }
    const n = e.dep.subs;
    n !== e && (e.prevSub = n, n && (n.nextSub = e)), Vt.NODE_ENV !== "production" && e.dep.subsHead === void 0 && (e.dep.subsHead = e), e.dep.subs = e;
  }
}
const Od = /* @__PURE__ */ new WeakMap(), Ri = Symbol(
  Vt.NODE_ENV !== "production" ? "Object iterate" : ""
), Fh = Symbol(
  Vt.NODE_ENV !== "production" ? "Map keys iterate" : ""
), Ec = Symbol(
  Vt.NODE_ENV !== "production" ? "Array iterate" : ""
);
function kn(e, t, n) {
  if (uo && jt) {
    let s = Od.get(e);
    s || Od.set(e, s = /* @__PURE__ */ new Map());
    let o = s.get(n);
    o || (s.set(n, o = new Sf()), o.map = s, o.key = n), Vt.NODE_ENV !== "production" ? o.track({
      target: e,
      type: t,
      key: n
    }) : o.track();
  }
}
function xo(e, t, n, s, o, i) {
  const r = Od.get(e);
  if (!r) {
    bc++;
    return;
  }
  const a = (l) => {
    l && (Vt.NODE_ENV !== "production" ? l.trigger({
      target: e,
      type: t,
      key: n,
      newValue: s,
      oldValue: o,
      oldTarget: i
    }) : l.trigger());
  };
  if (fv(), t === "clear")
    r.forEach(a);
  else {
    const l = Ce(e), u = l && bf(n);
    if (l && n === "length") {
      const d = Number(s);
      r.forEach((f, p) => {
        (p === "length" || p === Ec || !us(p) && p >= d) && a(f);
      });
    } else
      switch ((n !== void 0 || r.has(void 0)) && a(r.get(n)), u && a(r.get(Ec)), t) {
        case "add":
          l ? u && a(r.get("length")) : (a(r.get(Ri)), Kr(e) && a(r.get(Fh)));
          break;
        case "delete":
          l || (a(r.get(Ri)), Kr(e) && a(r.get(Fh)));
          break;
        case "set":
          Kr(e) && a(r.get(Ri));
          break;
      }
  }
  pv();
}
function IC(e, t) {
  const n = Od.get(e);
  return n && n.get(t);
}
function ma(e) {
  const t = Ye(e);
  return t === e ? t : (kn(t, "iterate", Ec), Qn(e) ? t : t.map(Gn));
}
function xf(e) {
  return kn(e = Ye(e), "iterate", Ec), e;
}
const AC = {
  __proto__: null,
  [Symbol.iterator]() {
    return jp(this, Symbol.iterator, Gn);
  },
  concat(...e) {
    return ma(this).concat(
      ...e.map((t) => Ce(t) ? ma(t) : t)
    );
  },
  entries() {
    return jp(this, "entries", (e) => (e[1] = Gn(e[1]), e));
  },
  every(e, t) {
    return Ko(this, "every", e, t, void 0, arguments);
  },
  filter(e, t) {
    return Ko(this, "filter", e, t, (n) => n.map(Gn), arguments);
  },
  find(e, t) {
    return Ko(this, "find", e, t, Gn, arguments);
  },
  findIndex(e, t) {
    return Ko(this, "findIndex", e, t, void 0, arguments);
  },
  findLast(e, t) {
    return Ko(this, "findLast", e, t, Gn, arguments);
  },
  findLastIndex(e, t) {
    return Ko(this, "findLastIndex", e, t, void 0, arguments);
  },
  // flat, flatMap could benefit from ARRAY_ITERATE but are not straight-forward to implement
  forEach(e, t) {
    return Ko(this, "forEach", e, t, void 0, arguments);
  },
  includes(...e) {
    return Bp(this, "includes", e);
  },
  indexOf(...e) {
    return Bp(this, "indexOf", e);
  },
  join(e) {
    return ma(this).join(e);
  },
  // keys() iterator only reads `length`, no optimisation required
  lastIndexOf(...e) {
    return Bp(this, "lastIndexOf", e);
  },
  map(e, t) {
    return Ko(this, "map", e, t, void 0, arguments);
  },
  pop() {
    return xl(this, "pop");
  },
  push(...e) {
    return xl(this, "push", e);
  },
  reduce(e, ...t) {
    return p_(this, "reduce", e, t);
  },
  reduceRight(e, ...t) {
    return p_(this, "reduceRight", e, t);
  },
  shift() {
    return xl(this, "shift");
  },
  // slice could use ARRAY_ITERATE but also seems to beg for range tracking
  some(e, t) {
    return Ko(this, "some", e, t, void 0, arguments);
  },
  splice(...e) {
    return xl(this, "splice", e);
  },
  toReversed() {
    return ma(this).toReversed();
  },
  toSorted(e) {
    return ma(this).toSorted(e);
  },
  toSpliced(...e) {
    return ma(this).toSpliced(...e);
  },
  unshift(...e) {
    return xl(this, "unshift", e);
  },
  values() {
    return jp(this, "values", Gn);
  }
};
function jp(e, t, n) {
  const s = xf(e), o = s[t]();
  return s !== e && !Qn(e) && (o._next = o.next, o.next = () => {
    const i = o._next();
    return i.value && (i.value = n(i.value)), i;
  }), o;
}
const MC = Array.prototype;
function Ko(e, t, n, s, o, i) {
  const r = xf(e), a = r !== e && !Qn(e), l = r[t];
  if (l !== MC[t]) {
    const f = l.apply(e, i);
    return a ? Gn(f) : f;
  }
  let u = n;
  r !== e && (a ? u = function(f, p) {
    return n.call(this, Gn(f), p, e);
  } : n.length > 2 && (u = function(f, p) {
    return n.call(this, f, p, e);
  }));
  const d = l.call(r, u, s);
  return a && o ? o(d) : d;
}
function p_(e, t, n, s) {
  const o = xf(e);
  let i = n;
  return o !== e && (Qn(e) ? n.length > 3 && (i = function(r, a, l) {
    return n.call(this, r, a, l, e);
  }) : i = function(r, a, l) {
    return n.call(this, r, Gn(a), l, e);
  }), o[t](i, ...s);
}
function Bp(e, t, n) {
  const s = Ye(e);
  kn(s, "iterate", Ec);
  const o = s[t](...n);
  return (o === -1 || o === !1) && Ha(n[0]) ? (n[0] = Ye(n[0]), s[t](...n)) : o;
}
function xl(e, t, n = []) {
  br(), fv();
  const s = Ye(e)[t].apply(e, n);
  return pv(), Er(), s;
}
const PC = /* @__PURE__ */ On("__proto__,__v_isRef,__isVue"), A1 = new Set(
  /* @__PURE__ */ Object.getOwnPropertyNames(Symbol).filter((e) => e !== "arguments" && e !== "caller").map((e) => Symbol[e]).filter(us)
);
function LC(e) {
  us(e) || (e = String(e));
  const t = Ye(this);
  return kn(t, "has", e), t.hasOwnProperty(e);
}
class M1 {
  constructor(t = !1, n = !1) {
    this._isReadonly = t, this._isShallow = n;
  }
  get(t, n, s) {
    if (n === "__v_skip") return t.__v_skip;
    const o = this._isReadonly, i = this._isShallow;
    if (n === "__v_isReactive")
      return !o;
    if (n === "__v_isReadonly")
      return o;
    if (n === "__v_isShallow")
      return i;
    if (n === "__v_raw")
      return s === (o ? i ? j1 : U1 : i ? F1 : V1).get(t) || // receiver is not the reactive proxy, but has the same prototype
      // this means the receiver is a user proxy of the reactive proxy
      Object.getPrototypeOf(t) === Object.getPrototypeOf(s) ? t : void 0;
    const r = Ce(t);
    if (!o) {
      let l;
      if (r && (l = AC[n]))
        return l;
      if (n === "hasOwnProperty")
        return LC;
    }
    const a = Reflect.get(
      t,
      n,
      // if this is a proxy wrapping a ref, return methods using the raw ref
      // as receiver so that we don't have to call `toRaw` on the ref in all
      // its class methods
      ut(t) ? t : s
    );
    return (us(n) ? A1.has(n) : PC(n)) || (o || kn(t, "get", n), i) ? a : ut(a) ? r && bf(n) ? a : a.value : mt(a) ? o ? Cf(a) : qe(a) : a;
  }
}
class P1 extends M1 {
  constructor(t = !1) {
    super(!1, t);
  }
  set(t, n, s, o) {
    let i = t[n];
    if (!this._isShallow) {
      const l = Ro(i);
      if (!Qn(s) && !Ro(s) && (i = Ye(i), s = Ye(s)), !Ce(t) && ut(i) && !ut(s))
        return l ? !1 : (i.value = s, !0);
    }
    const r = Ce(t) && bf(n) ? Number(n) < t.length : St(t, n), a = Reflect.set(
      t,
      n,
      s,
      ut(t) ? t : o
    );
    return t === Ye(o) && (r ? Wn(s, i) && xo(t, "set", n, s, i) : xo(t, "add", n, s)), a;
  }
  deleteProperty(t, n) {
    const s = St(t, n), o = t[n], i = Reflect.deleteProperty(t, n);
    return i && s && xo(t, "delete", n, void 0, o), i;
  }
  has(t, n) {
    const s = Reflect.has(t, n);
    return (!us(n) || !A1.has(n)) && kn(t, "has", n), s;
  }
  ownKeys(t) {
    return kn(
      t,
      "iterate",
      Ce(t) ? "length" : Ri
    ), Reflect.ownKeys(t);
  }
}
class L1 extends M1 {
  constructor(t = !1) {
    super(!0, t);
  }
  set(t, n) {
    return Vt.NODE_ENV !== "production" && Hs(
      `Set operation on key "${String(n)}" failed: target is readonly.`,
      t
    ), !0;
  }
  deleteProperty(t, n) {
    return Vt.NODE_ENV !== "production" && Hs(
      `Delete operation on key "${String(n)}" failed: target is readonly.`,
      t
    ), !0;
  }
}
const VC = /* @__PURE__ */ new P1(), FC = /* @__PURE__ */ new L1(), UC = /* @__PURE__ */ new P1(!0), jC = /* @__PURE__ */ new L1(!0), Uh = (e) => e, gu = (e) => Reflect.getPrototypeOf(e);
function BC(e, t, n) {
  return function(...s) {
    const o = this.__v_raw, i = Ye(o), r = Kr(i), a = e === "entries" || e === Symbol.iterator && r, l = e === "keys" && r, u = o[e](...s), d = n ? Uh : t ? jh : Gn;
    return !t && kn(
      i,
      "iterate",
      l ? Fh : Ri
    ), {
      // iterator protocol
      next() {
        const { value: f, done: p } = u.next();
        return p ? { value: f, done: p } : {
          value: a ? [d(f[0]), d(f[1])] : d(f),
          done: p
        };
      },
      // iterable protocol
      [Symbol.iterator]() {
        return this;
      }
    };
  };
}
function _u(e) {
  return function(...t) {
    if (Vt.NODE_ENV !== "production") {
      const n = t[0] ? `on key "${t[0]}" ` : "";
      Hs(
        `${fo(e)} operation ${n}failed: target is readonly.`,
        Ye(this)
      );
    }
    return e === "delete" ? !1 : e === "clear" ? void 0 : this;
  };
}
function HC(e, t) {
  const n = {
    get(o) {
      const i = this.__v_raw, r = Ye(i), a = Ye(o);
      e || (Wn(o, a) && kn(r, "get", o), kn(r, "get", a));
      const { has: l } = gu(r), u = t ? Uh : e ? jh : Gn;
      if (l.call(r, o))
        return u(i.get(o));
      if (l.call(r, a))
        return u(i.get(a));
      i !== r && i.get(o);
    },
    get size() {
      const o = this.__v_raw;
      return !e && kn(Ye(o), "iterate", Ri), Reflect.get(o, "size", o);
    },
    has(o) {
      const i = this.__v_raw, r = Ye(i), a = Ye(o);
      return e || (Wn(o, a) && kn(r, "has", o), kn(r, "has", a)), o === a ? i.has(o) : i.has(o) || i.has(a);
    },
    forEach(o, i) {
      const r = this, a = r.__v_raw, l = Ye(a), u = t ? Uh : e ? jh : Gn;
      return !e && kn(l, "iterate", Ri), a.forEach((d, f) => o.call(i, u(d), u(f), r));
    }
  };
  return it(
    n,
    e ? {
      add: _u("add"),
      set: _u("set"),
      delete: _u("delete"),
      clear: _u("clear")
    } : {
      add(o) {
        !t && !Qn(o) && !Ro(o) && (o = Ye(o));
        const i = Ye(this);
        return gu(i).has.call(i, o) || (i.add(o), xo(i, "add", o, o)), this;
      },
      set(o, i) {
        !t && !Qn(i) && !Ro(i) && (i = Ye(i));
        const r = Ye(this), { has: a, get: l } = gu(r);
        let u = a.call(r, o);
        u ? Vt.NODE_ENV !== "production" && h_(r, a, o) : (o = Ye(o), u = a.call(r, o));
        const d = l.call(r, o);
        return r.set(o, i), u ? Wn(i, d) && xo(r, "set", o, i, d) : xo(r, "add", o, i), this;
      },
      delete(o) {
        const i = Ye(this), { has: r, get: a } = gu(i);
        let l = r.call(i, o);
        l ? Vt.NODE_ENV !== "production" && h_(i, r, o) : (o = Ye(o), l = r.call(i, o));
        const u = a ? a.call(i, o) : void 0, d = i.delete(o);
        return l && xo(i, "delete", o, void 0, u), d;
      },
      clear() {
        const o = Ye(this), i = o.size !== 0, r = Vt.NODE_ENV !== "production" ? Kr(o) ? new Map(o) : new Set(o) : void 0, a = o.clear();
        return i && xo(
          o,
          "clear",
          void 0,
          void 0,
          r
        ), a;
      }
    }
  ), [
    "keys",
    "values",
    "entries",
    Symbol.iterator
  ].forEach((o) => {
    n[o] = BC(o, e, t);
  }), n;
}
function Nf(e, t) {
  const n = HC(e, t);
  return (s, o, i) => o === "__v_isReactive" ? !e : o === "__v_isReadonly" ? e : o === "__v_raw" ? s : Reflect.get(
    St(n, o) && o in s ? n : s,
    o,
    i
  );
}
const YC = {
  get: /* @__PURE__ */ Nf(!1, !1)
}, WC = {
  get: /* @__PURE__ */ Nf(!1, !0)
}, GC = {
  get: /* @__PURE__ */ Nf(!0, !1)
}, zC = {
  get: /* @__PURE__ */ Nf(!0, !0)
};
function h_(e, t, n) {
  const s = Ye(n);
  if (s !== n && t.call(e, s)) {
    const o = yf(e);
    Hs(
      `Reactive ${o} contains both the raw and reactive versions of the same object${o === "Map" ? " as keys" : ""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`
    );
  }
}
const V1 = /* @__PURE__ */ new WeakMap(), F1 = /* @__PURE__ */ new WeakMap(), U1 = /* @__PURE__ */ new WeakMap(), j1 = /* @__PURE__ */ new WeakMap();
function KC(e) {
  switch (e) {
    case "Object":
    case "Array":
      return 1;
    case "Map":
    case "Set":
    case "WeakMap":
    case "WeakSet":
      return 2;
    default:
      return 0;
  }
}
function XC(e) {
  return e.__v_skip || !Object.isExtensible(e) ? 0 : KC(yf(e));
}
function qe(e) {
  return Ro(e) ? e : Of(
    e,
    !1,
    VC,
    YC,
    V1
  );
}
function mv(e) {
  return Of(
    e,
    !1,
    UC,
    WC,
    F1
  );
}
function Cf(e) {
  return Of(
    e,
    !0,
    FC,
    GC,
    U1
  );
}
function ro(e) {
  return Of(
    e,
    !0,
    jC,
    zC,
    j1
  );
}
function Of(e, t, n, s, o) {
  if (!mt(e))
    return Vt.NODE_ENV !== "production" && Hs(
      `value cannot be made ${t ? "readonly" : "reactive"}: ${String(
        e
      )}`
    ), e;
  if (e.__v_raw && !(t && e.__v_isReactive))
    return e;
  const i = o.get(e);
  if (i)
    return i;
  const r = XC(e);
  if (r === 0)
    return e;
  const a = new Proxy(
    e,
    r === 2 ? s : n
  );
  return o.set(e, a), a;
}
function Us(e) {
  return Ro(e) ? Us(e.__v_raw) : !!(e && e.__v_isReactive);
}
function Ro(e) {
  return !!(e && e.__v_isReadonly);
}
function Qn(e) {
  return !!(e && e.__v_isShallow);
}
function Ha(e) {
  return e ? !!e.__v_raw : !1;
}
function Ye(e) {
  const t = e && e.__v_raw;
  return t ? Ye(t) : e;
}
function lr(e) {
  return !St(e, "__v_skip") && Object.isExtensible(e) && ji(e, "__v_skip", !0), e;
}
const Gn = (e) => mt(e) ? qe(e) : e, jh = (e) => mt(e) ? Cf(e) : e;
function ut(e) {
  return e ? e.__v_isRef === !0 : !1;
}
function I(e) {
  return B1(e, !1);
}
function vv(e) {
  return B1(e, !0);
}
function B1(e, t) {
  return ut(e) ? e : new qC(e, t);
}
class qC {
  constructor(t, n) {
    this.dep = new Sf(), this.__v_isRef = !0, this.__v_isShallow = !1, this._rawValue = n ? t : Ye(t), this._value = n ? t : Gn(t), this.__v_isShallow = n;
  }
  get value() {
    return Vt.NODE_ENV !== "production" ? this.dep.track({
      target: this,
      type: "get",
      key: "value"
    }) : this.dep.track(), this._value;
  }
  set value(t) {
    const n = this._rawValue, s = this.__v_isShallow || Qn(t) || Ro(t);
    t = s ? t : Ye(t), Wn(t, n) && (this._rawValue = t, this._value = s ? t : Gn(t), Vt.NODE_ENV !== "production" ? this.dep.trigger({
      target: this,
      type: "set",
      key: "value",
      newValue: t,
      oldValue: n
    }) : this.dep.trigger());
  }
}
function JC(e) {
  e.dep && (Vt.NODE_ENV !== "production" ? e.dep.trigger({
    target: e,
    type: "set",
    key: "value",
    newValue: e._value
  }) : e.dep.trigger());
}
function C(e) {
  return ut(e) ? e.value : e;
}
function QC(e) {
  return Ue(e) ? e() : C(e);
}
const ZC = {
  get: (e, t, n) => t === "__v_raw" ? e : C(Reflect.get(e, t, n)),
  set: (e, t, n, s) => {
    const o = e[t];
    return ut(o) && !ut(n) ? (o.value = n, !0) : Reflect.set(e, t, n, s);
  }
};
function gv(e) {
  return Us(e) ? e : new Proxy(e, ZC);
}
class eO {
  constructor(t) {
    this.__v_isRef = !0, this._value = void 0;
    const n = this.dep = new Sf(), { get: s, set: o } = t(n.track.bind(n), n.trigger.bind(n));
    this._get = s, this._set = o;
  }
  get value() {
    return this._value = this._get();
  }
  set value(t) {
    this._set(t);
  }
}
function H1(e) {
  return new eO(e);
}
function he(e) {
  Vt.NODE_ENV !== "production" && !Ha(e) && Hs("toRefs() expects a reactive object but received a plain one.");
  const t = Ce(e) ? new Array(e.length) : {};
  for (const n in e)
    t[n] = Y1(e, n);
  return t;
}
class tO {
  constructor(t, n, s) {
    this._object = t, this._key = n, this._defaultValue = s, this.__v_isRef = !0, this._value = void 0;
  }
  get value() {
    const t = this._object[this._key];
    return this._value = t === void 0 ? this._defaultValue : t;
  }
  set value(t) {
    this._object[this._key] = t;
  }
  get dep() {
    return IC(Ye(this._object), this._key);
  }
}
class nO {
  constructor(t) {
    this._getter = t, this.__v_isRef = !0, this.__v_isReadonly = !0, this._value = void 0;
  }
  get value() {
    return this._value = this._getter();
  }
}
function Ra(e, t, n) {
  return ut(e) ? e : Ue(e) ? new nO(e) : mt(e) && arguments.length > 1 ? Y1(e, t, n) : I(e);
}
function Y1(e, t, n) {
  const s = e[t];
  return ut(s) ? s : new tO(e, t, n);
}
class sO {
  constructor(t, n, s) {
    this.fn = t, this.setter = n, this._value = void 0, this.dep = new Sf(this), this.__v_isRef = !0, this.deps = void 0, this.depsTail = void 0, this.flags = 16, this.globalVersion = bc - 1, this.next = void 0, this.effect = this, this.__v_isReadonly = !n, this.isSSR = s;
  }
  /**
   * @internal
   */
  notify() {
    if (this.flags |= 16, !(this.flags & 8) && // avoid infinite self recursion
    jt !== this)
      return T1(this, !0), !0;
  }
  get value() {
    const t = Vt.NODE_ENV !== "production" ? this.dep.track({
      target: this,
      type: "get",
      key: "value"
    }) : this.dep.track();
    return D1(this), t && (t.version = this.dep.version), this._value;
  }
  set value(t) {
    this.setter ? this.setter(t) : Vt.NODE_ENV !== "production" && Hs("Write operation failed: computed value is readonly");
  }
}
function oO(e, t, n = !1) {
  let s, o;
  Ue(e) ? s = e : (s = e.get, o = e.set);
  const i = new sO(s, o, n);
  return Vt.NODE_ENV !== "production" && t && !n && (i.onTrack = t.onTrack, i.onTrigger = t.onTrigger), i;
}
const rO = {
  GET: "get",
  HAS: "has",
  ITERATE: "iterate"
}, iO = {
  SET: "set",
  ADD: "add",
  DELETE: "delete",
  CLEAR: "clear"
}, yu = {}, Td = /* @__PURE__ */ new WeakMap();
let Rr;
function aO() {
  return Rr;
}
function W1(e, t = !1, n = Rr) {
  if (n) {
    let s = Td.get(n);
    s || Td.set(n, s = []), s.push(e);
  } else Vt.NODE_ENV !== "production" && !t && Hs(
    "onWatcherCleanup() was called when there was no active watcher to associate with."
  );
}
function lO(e, t, n = pt) {
  const { immediate: s, deep: o, once: i, scheduler: r, augmentJob: a, call: l } = n, u = (N) => {
    (n.onWarn || Hs)(
      "Invalid watch source: ",
      N,
      "A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types."
    );
  }, d = (N) => o ? N : Qn(N) || o === !1 || o === 0 ? rr(N, 1) : rr(N);
  let f, p, h, m, v = !1, _ = !1;
  if (ut(e) ? (p = () => e.value, v = Qn(e)) : Us(e) ? (p = () => d(e), v = !0) : Ce(e) ? (_ = !0, v = e.some((N) => Us(N) || Qn(N)), p = () => e.map((N) => {
    if (ut(N))
      return N.value;
    if (Us(N))
      return d(N);
    if (Ue(N))
      return l ? l(N, 2) : N();
    Vt.NODE_ENV !== "production" && u(N);
  })) : Ue(e) ? t ? p = l ? () => l(e, 2) : e : p = () => {
    if (h) {
      br();
      try {
        h();
      } finally {
        Er();
      }
    }
    const N = Rr;
    Rr = f;
    try {
      return l ? l(e, 3, [m]) : e(m);
    } finally {
      Rr = N;
    }
  } : (p = Jt, Vt.NODE_ENV !== "production" && u(e)), t && o) {
    const N = p, S = o === !0 ? 1 / 0 : o;
    p = () => rr(N(), S);
  }
  const b = dv(), w = () => {
    f.stop(), b && b.active && _f(b.effects, f);
  };
  if (i && t) {
    const N = t;
    t = (...S) => {
      N(...S), w();
    };
  }
  let y = _ ? new Array(e.length).fill(yu) : yu;
  const x = (N) => {
    if (!(!(f.flags & 1) || !f.dirty && !N))
      if (t) {
        const S = f.run();
        if (o || v || (_ ? S.some((O, $) => Wn(O, y[$])) : Wn(S, y))) {
          h && h();
          const O = Rr;
          Rr = f;
          try {
            const $ = [
              S,
              // pass undefined as the old value when it's changed for the first time
              y === yu ? void 0 : _ && y[0] === yu ? [] : y,
              m
            ];
            l ? l(t, 3, $) : (
              // @ts-expect-error
              t(...$)
            ), y = S;
          } finally {
            Rr = O;
          }
        }
      } else
        f.run();
  };
  return a && a(x), f = new yc(p), f.scheduler = r ? () => r(x, !1) : x, m = (N) => W1(N, !1, f), h = f.onStop = () => {
    const N = Td.get(f);
    if (N) {
      if (l)
        l(N, 4);
      else
        for (const S of N) S();
      Td.delete(f);
    }
  }, Vt.NODE_ENV !== "production" && (f.onTrack = n.onTrack, f.onTrigger = n.onTrigger), t ? s ? x(!0) : y = f.run() : r ? r(x.bind(null, !0), !0) : f.run(), w.pause = f.pause.bind(f), w.resume = f.resume.bind(f), w.stop = w, w;
}
function rr(e, t = 1 / 0, n) {
  if (t <= 0 || !mt(e) || e.__v_skip || (n = n || /* @__PURE__ */ new Set(), n.has(e)))
    return e;
  if (n.add(e), t--, ut(e))
    rr(e.value, t, n);
  else if (Ce(e))
    for (let s = 0; s < e.length; s++)
      rr(e[s], t, n);
  else if (oi(e) || Kr(e))
    e.forEach((s) => {
      rr(s, t, n);
    });
  else if (Yc(e)) {
    for (const s in e)
      rr(e[s], t, n);
    for (const s of Object.getOwnPropertySymbols(e))
      Object.prototype.propertyIsEnumerable.call(e, s) && rr(e[s], t, n);
  }
  return e;
}
var W = {};
const Ii = [];
function Ia(e) {
  Ii.push(e);
}
function Aa() {
  Ii.pop();
}
let Hp = !1;
function ae(e, ...t) {
  if (Hp) return;
  Hp = !0, br();
  const n = Ii.length ? Ii[Ii.length - 1].component : null, s = n && n.appContext.config.warnHandler, o = cO();
  if (s)
    ra(
      s,
      n,
      11,
      [
        // eslint-disable-next-line no-restricted-syntax
        e + t.map((i) => {
          var r, a;
          return (a = (r = i.toString) == null ? void 0 : r.call(i)) != null ? a : JSON.stringify(i);
        }).join(""),
        n && n.proxy,
        o.map(
          ({ vnode: i }) => `at <${Lf(n, i.type)}>`
        ).join(`
`),
        o
      ]
    );
  else {
    const i = [`[Vue warn]: ${e}`, ...t];
    o.length && i.push(`
`, ...uO(o)), console.warn(...i);
  }
  Er(), Hp = !1;
}
function cO() {
  let e = Ii[Ii.length - 1];
  if (!e)
    return [];
  const t = [];
  for (; e; ) {
    const n = t[0];
    n && n.vnode === e ? n.recurseCount++ : t.push({
      vnode: e,
      recurseCount: 0
    });
    const s = e.component && e.component.parent;
    e = s && s.vnode;
  }
  return t;
}
function uO(e) {
  const t = [];
  return e.forEach((n, s) => {
    t.push(...s === 0 ? [] : [`
`], ...dO(n));
  }), t;
}
function dO({ vnode: e, recurseCount: t }) {
  const n = t > 0 ? `... (${t} recursive calls)` : "", s = e.component ? e.component.parent == null : !1, o = ` at <${Lf(
    e.component,
    e.type,
    s
  )}`, i = ">" + n;
  return e.props ? [o, ...fO(e.props), i] : [o + i];
}
function fO(e) {
  const t = [], n = Object.keys(e);
  return n.slice(0, 3).forEach((s) => {
    t.push(...G1(s, e[s]));
  }), n.length > 3 && t.push(" ..."), t;
}
function G1(e, t, n) {
  return Ge(t) ? (t = JSON.stringify(t), n ? t : [`${e}=${t}`]) : typeof t == "number" || typeof t == "boolean" || t == null ? n ? t : [`${e}=${t}`] : ut(t) ? (t = G1(e, Ye(t.value), !0), n ? t : [`${e}=Ref<`, t, ">"]) : Ue(t) ? [`${e}=fn${t.name ? `<${t.name}>` : ""}`] : (t = Ye(t), n ? t : [`${e}=`, t]);
}
function _v(e, t) {
  W.NODE_ENV !== "production" && e !== void 0 && (typeof e != "number" ? ae(`${t} is not a valid number - got ${JSON.stringify(e)}.`) : isNaN(e) && ae(`${t} is NaN - the duration expression might be incorrect.`));
}
const pO = {
  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"
}, Tf = {
  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 ra(e, t, n, s) {
  try {
    return s ? e(...s) : e();
  } catch (o) {
    ri(o, t, n);
  }
}
function Ys(e, t, n, s) {
  if (Ue(e)) {
    const o = ra(e, t, n, s);
    return o && Hc(o) && o.catch((i) => {
      ri(i, t, n);
    }), o;
  }
  if (Ce(e)) {
    const o = [];
    for (let i = 0; i < e.length; i++)
      o.push(Ys(e[i], t, n, s));
    return o;
  } else W.NODE_ENV !== "production" && ae(
    `Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`
  );
}
function ri(e, t, n, s = !0) {
  const o = t ? t.vnode : null, { errorHandler: i, throwUnhandledErrorInProduction: r } = t && t.appContext.config || pt;
  if (t) {
    let a = t.parent;
    const l = t.proxy, u = W.NODE_ENV !== "production" ? Tf[n] : `https://vuejs.org/error-reference/#runtime-${n}`;
    for (; a; ) {
      const d = a.ec;
      if (d) {
        for (let f = 0; f < d.length; f++)
          if (d[f](e, l, u) === !1)
            return;
      }
      a = a.parent;
    }
    if (i) {
      br(), ra(i, null, 10, [
        e,
        l,
        u
      ]), Er();
      return;
    }
  }
  hO(e, n, o, s, r);
}
function hO(e, t, n, s = !0, o = !1) {
  if (W.NODE_ENV !== "production") {
    const i = Tf[t];
    if (n && Ia(n), ae(`Unhandled error${i ? ` during execution of ${i}` : ""}`), n && Aa(), s)
      throw e;
    console.error(e);
  } else {
    if (o)
      throw e;
    console.error(e);
  }
}
const is = [];
let bo = -1;
const Ma = [];
let Ir = null, Na = 0;
const z1 = /* @__PURE__ */ Promise.resolve();
let $d = null;
const mO = 100;
function po(e) {
  const t = $d || z1;
  return e ? t.then(this ? e.bind(this) : e) : t;
}
function vO(e) {
  let t = bo + 1, n = is.length;
  for (; t < n; ) {
    const s = t + n >>> 1, o = is[s], i = wc(o);
    i < e || i === e && o.flags & 2 ? t = s + 1 : n = s;
  }
  return t;
}
function $f(e) {
  if (!(e.flags & 1)) {
    const t = wc(e), n = is[is.length - 1];
    !n || // fast path when the job id is larger than the tail
    !(e.flags & 2) && t >= wc(n) ? is.push(e) : is.splice(vO(t), 0, e), e.flags |= 1, K1();
  }
}
function K1() {
  $d || ($d = z1.then(X1));
}
function Ya(e) {
  Ce(e) ? Ma.push(...e) : Ir && e.id === -1 ? Ir.splice(Na + 1, 0, e) : e.flags & 1 || (Ma.push(e), e.flags |= 1), K1();
}
function m_(e, t, n = bo + 1) {
  for (W.NODE_ENV !== "production" && (t = t || /* @__PURE__ */ new Map()); n < is.length; n++) {
    const s = is[n];
    if (s && s.flags & 2) {
      if (e && s.id !== e.uid || W.NODE_ENV !== "production" && yv(t, s))
        continue;
      is.splice(n, 1), n--, s.flags & 4 && (s.flags &= -2), s(), s.flags & 4 || (s.flags &= -2);
    }
  }
}
function kd(e) {
  if (Ma.length) {
    const t = [...new Set(Ma)].sort(
      (n, s) => wc(n) - wc(s)
    );
    if (Ma.length = 0, Ir) {
      Ir.push(...t);
      return;
    }
    for (Ir = t, W.NODE_ENV !== "production" && (e = e || /* @__PURE__ */ new Map()), Na = 0; Na < Ir.length; Na++) {
      const n = Ir[Na];
      W.NODE_ENV !== "production" && yv(e, n) || (n.flags & 4 && (n.flags &= -2), n.flags & 8 || n(), n.flags &= -2);
    }
    Ir = null, Na = 0;
  }
}
const wc = (e) => e.id == null ? e.flags & 2 ? -1 : 1 / 0 : e.id;
function X1(e) {
  W.NODE_ENV !== "production" && (e = e || /* @__PURE__ */ new Map());
  const t = W.NODE_ENV !== "production" ? (n) => yv(e, n) : Jt;
  try {
    for (bo = 0; bo < is.length; bo++) {
      const n = is[bo];
      if (n && !(n.flags & 8)) {
        if (W.NODE_ENV !== "production" && t(n))
          continue;
        n.flags & 4 && (n.flags &= -2), ra(
          n,
          n.i,
          n.i ? 15 : 14
        ), n.flags & 4 || (n.flags &= -2);
      }
    }
  } finally {
    for (; bo < is.length; bo++) {
      const n = is[bo];
      n && (n.flags &= -2);
    }
    bo = -1, is.length = 0, kd(e), $d = null, (is.length || Ma.length) && X1(e);
  }
}
function yv(e, t) {
  const n = e.get(t) || 0;
  if (n > mO) {
    const s = t.i, o = s && Oc(s.type);
    return ri(
      `Maximum recursive updates exceeded${o ? ` in component <${o}>` : ""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,
      null,
      10
    ), !0;
  }
  return e.set(t, n + 1), !1;
}
let io = !1;
const Qu = /* @__PURE__ */ new Map();
W.NODE_ENV !== "production" && (al().__VUE_HMR_RUNTIME__ = {
  createRecord: Yp(q1),
  rerender: Yp(yO),
  reload: Yp(bO)
});
const Bi = /* @__PURE__ */ new Map();
function gO(e) {
  const t = e.type.__hmrId;
  let n = Bi.get(t);
  n || (q1(t, e.type), n = Bi.get(t)), n.instances.add(e);
}
function _O(e) {
  Bi.get(e.type.__hmrId).instances.delete(e);
}
function q1(e, t) {
  return Bi.has(e) ? !1 : (Bi.set(e, {
    initialDef: Dd(t),
    instances: /* @__PURE__ */ new Set()
  }), !0);
}
function Dd(e) {
  return n0(e) ? e.__vccOpts : e;
}
function yO(e, t) {
  const n = Bi.get(e);
  n && (n.initialDef.render = t, [...n.instances].forEach((s) => {
    t && (s.render = t, Dd(s.type).render = t), s.renderCache = [], io = !0, s.update(), io = !1;
  }));
}
function bO(e, t) {
  const n = Bi.get(e);
  if (!n) return;
  t = Dd(t), v_(n.initialDef, t);
  const s = [...n.instances];
  for (let o = 0; o < s.length; o++) {
    const i = s[o], r = Dd(i.type);
    let a = Qu.get(r);
    a || (r !== n.initialDef && v_(r, t), Qu.set(r, a = /* @__PURE__ */ new Set())), a.add(i), i.appContext.propsCache.delete(i.type), i.appContext.emitsCache.delete(i.type), i.appContext.optionsCache.delete(i.type), i.ceReload ? (a.add(i), i.ceReload(t.styles), a.delete(i)) : i.parent ? $f(() => {
      io = !0, i.parent.update(), io = !1, a.delete(i);
    }) : i.appContext.reload ? i.appContext.reload() : typeof window < "u" ? window.location.reload() : console.warn(
      "[HMR] Root or manually mounted instance modified. Full reload required."
    ), i.root.ce && i !== i.root && i.root.ce._removeChildStyle(r);
  }
  Ya(() => {
    Qu.clear();
  });
}
function v_(e, t) {
  it(e, t);
  for (const n in e)
    n !== "__file" && !(n in t) && delete e[n];
}
function Yp(e) {
  return (t, n) => {
    try {
      return e(t, n);
    } catch (s) {
      console.error(s), console.warn(
        "[HMR] Something went wrong during Vue component hot-reload. Full reload required."
      );
    }
  };
}
let so, jl = [], Bh = !1;
function Gc(e, ...t) {
  so ? so.emit(e, ...t) : Bh || jl.push({ event: e, args: t });
}
function bv(e, t) {
  var n, s;
  so = e, so ? (so.enabled = !0, jl.forEach(({ event: o, args: i }) => so.emit(o, ...i)), jl = []) : /* handle late devtools injection - only do this if we are in an actual */ /* browser environment to avoid the timer handle stalling test runner exit */ /* (#4815) */ typeof window < "u" && // some envs mock window but not fully
  window.HTMLElement && // also exclude jsdom
  // eslint-disable-next-line no-restricted-syntax
  !((s = (n = window.navigator) == null ? void 0 : n.userAgent) != null && s.includes("jsdom")) ? ((t.__VUE_DEVTOOLS_HOOK_REPLAY__ = t.__VUE_DEVTOOLS_HOOK_REPLAY__ || []).push((i) => {
    bv(i, t);
  }), setTimeout(() => {
    so || (t.__VUE_DEVTOOLS_HOOK_REPLAY__ = null, Bh = !0, jl = []);
  }, 3e3)) : (Bh = !0, jl = []);
}
function EO(e, t) {
  Gc("app:init", e, t, {
    Fragment: G,
    Text: To,
    Comment: Zt,
    Static: qr
  });
}
function wO(e) {
  Gc("app:unmount", e);
}
const Hh = /* @__PURE__ */ Ev(
  "component:added"
  /* COMPONENT_ADDED */
), J1 = /* @__PURE__ */ Ev(
  "component:updated"
  /* COMPONENT_UPDATED */
), SO = /* @__PURE__ */ Ev(
  "component:removed"
  /* COMPONENT_REMOVED */
), xO = (e) => {
  so && typeof so.cleanupBuffer == "function" && // remove the component if it wasn't buffered
  !so.cleanupBuffer(e) && SO(e);
};
/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function Ev(e) {
  return (t) => {
    Gc(
      e,
      t.appContext.app,
      t.uid,
      t.parent ? t.parent.uid : void 0,
      t
    );
  };
}
const NO = /* @__PURE__ */ Q1(
  "perf:start"
  /* PERFORMANCE_START */
), CO = /* @__PURE__ */ Q1(
  "perf:end"
  /* PERFORMANCE_END */
);
function Q1(e) {
  return (t, n, s) => {
    Gc(e, t.appContext.app, t.uid, t, n, s);
  };
}
function OO(e, t, n) {
  Gc(
    "component:emit",
    e.appContext.app,
    e,
    t,
    n
  );
}
let pn = null, kf = null;
function Sc(e) {
  const t = pn;
  return pn = e, kf = e && e.type.__scopeId || null, t;
}
function TO(e) {
  kf = e;
}
function $O() {
  kf = null;
}
const kO = (e) => B;
function B(e, t = pn, n) {
  if (!t || e._n)
    return e;
  const s = (...o) => {
    s._d && Qh(-1);
    const i = Sc(t);
    let r;
    try {
      r = e(...o);
    } finally {
      Sc(i), s._d && Qh(1);
    }
    return W.NODE_ENV !== "production" && J1(t), r;
  };
  return s._n = !0, s._c = !0, s._d = !0, s;
}
function Z1(e) {
  sv(e) && ae("Do not use built-in directive ids as custom directive id: " + e);
}
function L(e, t) {
  if (pn === null)
    return W.NODE_ENV !== "production" && ae("withDirectives can only be used inside render functions."), e;
  const n = Kc(pn), s = e.dirs || (e.dirs = []);
  for (let o = 0; o < t.length; o++) {
    let [i, r, a, l = pt] = t[o];
    i && (Ue(i) && (i = {
      mounted: i,
      updated: i
    }), i.deep && rr(r), s.push({
      dir: i,
      instance: n,
      value: r,
      oldValue: void 0,
      arg: a,
      modifiers: l
    }));
  }
  return e;
}
function wo(e, t, n, s) {
  const o = e.dirs, i = t && t.dirs;
  for (let r = 0; r < o.length; r++) {
    const a = o[r];
    i && (a.oldValue = i[r].value);
    let l = a.dir[s];
    l && (br(), Ys(l, n, 8, [
      e.el,
      a,
      e,
      t
    ]), Er());
  }
}
const eE = Symbol("_vte"), tE = (e) => e.__isTeleport, Ai = (e) => e && (e.disabled || e.disabled === ""), g_ = (e) => e && (e.defer || e.defer === ""), __ = (e) => typeof SVGElement < "u" && e instanceof SVGElement, y_ = (e) => typeof MathMLElement == "function" && e instanceof MathMLElement, Yh = (e, t) => {
  const n = e && e.to;
  if (Ge(n))
    if (t) {
      const s = t(n);
      return W.NODE_ENV !== "production" && !s && !Ai(e) && ae(
        `Failed to locate Teleport target with selector "${n}". Note the target element must exist before the component is mounted - i.e. the target cannot be rendered by the component itself, and ideally should be outside of the entire Vue component tree.`
      ), s;
    } else
      return W.NODE_ENV !== "production" && ae(
        "Current renderer does not support string target for Teleports. (missing querySelector renderer option)"
      ), null;
  else
    return W.NODE_ENV !== "production" && !n && !Ai(e) && ae(`Invalid Teleport target: ${n}`), n;
}, nE = {
  name: "Teleport",
  __isTeleport: !0,
  process(e, t, n, s, o, i, r, a, l, u) {
    const {
      mc: d,
      pc: f,
      pbc: p,
      o: { insert: h, querySelector: m, createText: v, createComment: _ }
    } = u, b = Ai(t.props);
    let { shapeFlag: w, children: y, dynamicChildren: x } = t;
    if (W.NODE_ENV !== "production" && io && (l = !1, x = null), e == null) {
      const N = t.el = W.NODE_ENV !== "production" ? _("teleport start") : v(""), S = t.anchor = W.NODE_ENV !== "production" ? _("teleport end") : v("");
      h(N, n, s), h(S, n, s);
      const O = (T, R) => {
        w & 16 && (o && o.isCE && (o.ce._teleportTarget = T), d(
          y,
          T,
          R,
          o,
          i,
          r,
          a,
          l
        ));
      }, $ = () => {
        const T = t.target = Yh(t.props, m), R = sE(T, t, v, h);
        T ? (r !== "svg" && __(T) ? r = "svg" : r !== "mathml" && y_(T) && (r = "mathml"), b || (O(T, R), Zu(t, !1))) : W.NODE_ENV !== "production" && !b && ae(
          "Invalid Teleport target on mount:",
          T,
          `(${typeof T})`
        );
      };
      b && (O(n, S), Zu(t, !0)), g_(t.props) ? $n(() => {
        $(), t.el.__isMounted = !0;
      }, i) : $();
    } else {
      if (g_(t.props) && !e.el.__isMounted) {
        $n(() => {
          nE.process(
            e,
            t,
            n,
            s,
            o,
            i,
            r,
            a,
            l,
            u
          ), delete e.el.__isMounted;
        }, i);
        return;
      }
      t.el = e.el, t.targetStart = e.targetStart;
      const N = t.anchor = e.anchor, S = t.target = e.target, O = t.targetAnchor = e.targetAnchor, $ = Ai(e.props), T = $ ? n : S, R = $ ? N : O;
      if (r === "svg" || __(S) ? r = "svg" : (r === "mathml" || y_(S)) && (r = "mathml"), x ? (p(
        e.dynamicChildren,
        x,
        T,
        o,
        i,
        r,
        a
      ), ec(e, t, !0)) : l || f(
        e,
        t,
        T,
        R,
        o,
        i,
        r,
        a,
        !1
      ), b)
        $ ? t.props && e.props && t.props.to !== e.props.to && (t.props.to = e.props.to) : bu(
          t,
          n,
          N,
          u,
          1
        );
      else if ((t.props && t.props.to) !== (e.props && e.props.to)) {
        const P = t.target = Yh(
          t.props,
          m
        );
        P ? bu(
          t,
          P,
          null,
          u,
          0
        ) : W.NODE_ENV !== "production" && ae(
          "Invalid Teleport target on update:",
          S,
          `(${typeof S})`
        );
      } else $ && bu(
        t,
        S,
        O,
        u,
        1
      );
      Zu(t, b);
    }
  },
  remove(e, t, n, { um: s, o: { remove: o } }, i) {
    const {
      shapeFlag: r,
      children: a,
      anchor: l,
      targetStart: u,
      targetAnchor: d,
      target: f,
      props: p
    } = e;
    if (f && (o(u), o(d)), i && o(l), r & 16) {
      const h = i || !Ai(p);
      for (let m = 0; m < a.length; m++) {
        const v = a[m];
        s(
          v,
          t,
          n,
          h,
          !!v.dynamicChildren
        );
      }
    }
  },
  move: bu,
  hydrate: DO
};
function bu(e, t, n, { o: { insert: s }, m: o }, i = 2) {
  i === 0 && s(e.targetAnchor, t, n);
  const { el: r, anchor: a, shapeFlag: l, children: u, props: d } = e, f = i === 2;
  if (f && s(r, t, n), (!f || Ai(d)) && l & 16)
    for (let p = 0; p < u.length; p++)
      o(
        u[p],
        t,
        n,
        2
      );
  f && s(a, t, n);
}
function DO(e, t, n, s, o, i, {
  o: { nextSibling: r, parentNode: a, querySelector: l, insert: u, createText: d }
}, f) {
  const p = t.target = Yh(
    t.props,
    l
  );
  if (p) {
    const h = Ai(t.props), m = p._lpa || p.firstChild;
    if (t.shapeFlag & 16)
      if (h)
        t.anchor = f(
          r(e),
          t,
          a(e),
          n,
          s,
          o,
          i
        ), t.targetStart = m, t.targetAnchor = m && r(m);
      else {
        t.anchor = r(e);
        let v = m;
        for (; v; ) {
          if (v && v.nodeType === 8) {
            if (v.data === "teleport start anchor")
              t.targetStart = v;
            else if (v.data === "teleport anchor") {
              t.targetAnchor = v, p._lpa = t.targetAnchor && r(t.targetAnchor);
              break;
            }
          }
          v = r(v);
        }
        t.targetAnchor || sE(p, t, d, u), f(
          m && r(m),
          t,
          p,
          n,
          s,
          o,
          i
        );
      }
    Zu(t, h);
  }
  return t.anchor && r(t.anchor);
}
const ns = nE;
function Zu(e, t) {
  const n = e.ctx;
  if (n && n.ut) {
    let s, o;
    for (t ? (s = e.el, o = e.anchor) : (s = e.targetStart, o = e.targetAnchor); s && s !== o; )
      s.nodeType === 1 && s.setAttribute("data-v-owner", n.uid), s = s.nextSibling;
    n.ut();
  }
}
function sE(e, t, n, s) {
  const o = t.targetStart = n(""), i = t.targetAnchor = n("");
  return o[eE] = i, e && (s(o, e), s(i, e)), i;
}
const Ar = Symbol("_leaveCb"), Eu = Symbol("_enterCb");
function wv() {
  const e = {
    isMounted: !1,
    isLeaving: !1,
    isUnmounting: !1,
    leavingVNodes: /* @__PURE__ */ new Map()
  };
  return vt(() => {
    e.isMounted = !0;
  }), ii(() => {
    e.isUnmounting = !0;
  }), e;
}
const Is = [Function, Array], Sv = {
  mode: String,
  appear: Boolean,
  persisted: Boolean,
  // enter
  onBeforeEnter: Is,
  onEnter: Is,
  onAfterEnter: Is,
  onEnterCancelled: Is,
  // leave
  onBeforeLeave: Is,
  onLeave: Is,
  onAfterLeave: Is,
  onLeaveCancelled: Is,
  // appear
  onBeforeAppear: Is,
  onAppear: Is,
  onAfterAppear: Is,
  onAppearCancelled: Is
}, oE = (e) => {
  const t = e.subTree;
  return t.component ? oE(t.component) : t;
}, RO = {
  name: "BaseTransition",
  props: Sv,
  setup(e, { slots: t }) {
    const n = cn(), s = wv();
    return () => {
      const o = t.default && Df(t.default(), !0);
      if (!o || !o.length)
        return;
      const i = rE(o), r = Ye(e), { mode: a } = r;
      if (W.NODE_ENV !== "production" && a && a !== "in-out" && a !== "out-in" && a !== "default" && ae(`invalid <transition> mode: ${a}`), s.isLeaving)
        return Wp(i);
      const l = b_(i);
      if (!l)
        return Wp(i);
      let u = Wa(
        l,
        r,
        s,
        n,
        // #11061, ensure enterHooks is fresh after clone
        (f) => u = f
      );
      l.type !== Zt && _r(l, u);
      let d = n.subTree && b_(n.subTree);
      if (d && d.type !== Zt && !oo(l, d) && oE(n).type !== Zt) {
        let f = Wa(
          d,
          r,
          s,
          n
        );
        if (_r(d, f), a === "out-in" && l.type !== Zt)
          return s.isLeaving = !0, f.afterLeave = () => {
            s.isLeaving = !1, n.job.flags & 8 || n.update(), delete f.afterLeave, d = void 0;
          }, Wp(i);
        a === "in-out" && l.type !== Zt ? f.delayLeave = (p, h, m) => {
          const v = aE(
            s,
            d
          );
          v[String(d.key)] = d, p[Ar] = () => {
            h(), p[Ar] = void 0, delete u.delayedLeave, d = void 0;
          }, u.delayedLeave = () => {
            m(), delete u.delayedLeave, d = void 0;
          };
        } : d = void 0;
      } else d && (d = void 0);
      return i;
    };
  }
};
function rE(e) {
  let t = e[0];
  if (e.length > 1) {
    let n = !1;
    for (const s of e)
      if (s.type !== Zt) {
        if (W.NODE_ENV !== "production" && n) {
          ae(
            "<transition> can only be used on a single element or component. Use <transition-group> for lists."
          );
          break;
        }
        if (t = s, n = !0, W.NODE_ENV === "production") break;
      }
  }
  return t;
}
const iE = RO;
function aE(e, t) {
  const { leavingVNodes: n } = e;
  let s = n.get(t.type);
  return s || (s = /* @__PURE__ */ Object.create(null), n.set(t.type, s)), s;
}
function Wa(e, t, n, s, o) {
  const {
    appear: i,
    mode: r,
    persisted: a = !1,
    onBeforeEnter: l,
    onEnter: u,
    onAfterEnter: d,
    onEnterCancelled: f,
    onBeforeLeave: p,
    onLeave: h,
    onAfterLeave: m,
    onLeaveCancelled: v,
    onBeforeAppear: _,
    onAppear: b,
    onAfterAppear: w,
    onAppearCancelled: y
  } = t, x = String(e.key), N = aE(n, e), S = (T, R) => {
    T && Ys(
      T,
      s,
      9,
      R
    );
  }, O = (T, R) => {
    const P = R[1];
    S(T, R), Ce(T) ? T.every((M) => M.length <= 1) && P() : T.length <= 1 && P();
  }, $ = {
    mode: r,
    persisted: a,
    beforeEnter(T) {
      let R = l;
      if (!n.isMounted)
        if (i)
          R = _ || l;
        else
          return;
      T[Ar] && T[Ar](
        !0
        /* cancelled */
      );
      const P = N[x];
      P && oo(e, P) && P.el[Ar] && P.el[Ar](), S(R, [T]);
    },
    enter(T) {
      let R = u, P = d, M = f;
      if (!n.isMounted)
        if (i)
          R = b || u, P = w || d, M = y || f;
        else
          return;
      let U = !1;
      const H = T[Eu] = (j) => {
        U || (U = !0, j ? S(M, [T]) : S(P, [T]), $.delayedLeave && $.delayedLeave(), T[Eu] = void 0);
      };
      R ? O(R, [T, H]) : H();
    },
    leave(T, R) {
      const P = String(e.key);
      if (T[Eu] && T[Eu](
        !0
        /* cancelled */
      ), n.isUnmounting)
        return R();
      S(p, [T]);
      let M = !1;
      const U = T[Ar] = (H) => {
        M || (M = !0, R(), H ? S(v, [T]) : S(m, [T]), T[Ar] = void 0, N[P] === e && delete N[P]);
      };
      N[P] = e, h ? O(h, [T, U]) : U();
    },
    clone(T) {
      const R = Wa(
        T,
        t,
        n,
        s,
        o
      );
      return o && o(R), R;
    }
  };
  return $;
}
function Wp(e) {
  if (ll(e))
    return e = Ws(e), e.children = null, e;
}
function b_(e) {
  if (!ll(e))
    return tE(e.type) && e.children ? rE(e.children) : e;
  if (W.NODE_ENV !== "production" && e.component)
    return e.component.subTree;
  const { shapeFlag: t, children: n } = e;
  if (n) {
    if (t & 16)
      return n[0];
    if (t & 32 && Ue(n.default))
      return n.default();
  }
}
function _r(e, t) {
  e.shapeFlag & 6 && e.component ? (e.transition = t, _r(e.component.subTree, t)) : e.shapeFlag & 128 ? (e.ssContent.transition = t.clone(e.ssContent), e.ssFallback.transition = t.clone(e.ssFallback)) : e.transition = t;
}
function Df(e, t = !1, n) {
  let s = [], o = 0;
  for (let i = 0; i < e.length; i++) {
    let r = e[i];
    const a = n == null ? r.key : String(n) + String(r.key != null ? r.key : i);
    r.type === G ? (r.patchFlag & 128 && o++, s = s.concat(
      Df(r.children, t, a)
    )) : (t || r.type !== Zt) && s.push(a != null ? Ws(r, { key: a }) : r);
  }
  if (o > 1)
    for (let i = 0; i < s.length; i++)
      s[i].patchFlag = -2;
  return s;
}
/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function Rn(e, t) {
  return Ue(e) ? (
    // #8236: extend call and options.name access are considered side-effects
    // by Rollup, so we have to wrap it in a pure-annotated IIFE.
    it({ name: e.name }, t, { setup: e })
  ) : e;
}
function IO() {
  const e = cn();
  return e ? (e.appContext.config.idPrefix || "v") + "-" + e.ids[0] + e.ids[1]++ : (W.NODE_ENV !== "production" && ae(
    "useId() is called when there is no active component instance to be associated with."
  ), "");
}
function xv(e) {
  e.ids = [e.ids[0] + e.ids[2]++ + "-", 0, 0];
}
const lE = /* @__PURE__ */ new WeakSet();
function Io(e) {
  const t = cn(), n = vv(null);
  if (t) {
    const o = t.refs === pt ? t.refs = {} : t.refs;
    let i;
    W.NODE_ENV !== "production" && (i = Object.getOwnPropertyDescriptor(o, e)) && !i.configurable ? ae(`useTemplateRef('${e}') already exists.`) : Object.defineProperty(o, e, {
      enumerable: !0,
      get: () => n.value,
      set: (r) => n.value = r
    });
  } else W.NODE_ENV !== "production" && ae(
    "useTemplateRef() is called when there is no active component instance to be associated with."
  );
  const s = W.NODE_ENV !== "production" ? Cf(n) : n;
  return W.NODE_ENV !== "production" && lE.add(s), s;
}
function xc(e, t, n, s, o = !1) {
  if (Ce(e)) {
    e.forEach(
      (m, v) => xc(
        m,
        t && (Ce(t) ? t[v] : t),
        n,
        s,
        o
      )
    );
    return;
  }
  if (Xr(s) && !o) {
    s.shapeFlag & 512 && s.type.__asyncResolved && s.component.subTree.component && xc(e, t, n, s.component.subTree);
    return;
  }
  const i = s.shapeFlag & 4 ? Kc(s.component) : s.el, r = o ? null : i, { i: a, r: l } = e;
  if (W.NODE_ENV !== "production" && !a) {
    ae(
      "Missing ref owner context. ref cannot be used on hoisted vnodes. A vnode with ref must be created inside the render function."
    );
    return;
  }
  const u = t && t.r, d = a.refs === pt ? a.refs = {} : a.refs, f = a.setupState, p = Ye(f), h = f === pt ? () => !1 : (m) => W.NODE_ENV !== "production" && (St(p, m) && !ut(p[m]) && ae(
    `Template ref "${m}" used on a non-ref value. It will not work in the production build.`
  ), lE.has(p[m])) ? !1 : St(p, m);
  if (u != null && u !== l && (Ge(u) ? (d[u] = null, h(u) && (f[u] = null)) : ut(u) && (u.value = null)), Ue(l))
    ra(l, a, 12, [r, d]);
  else {
    const m = Ge(l), v = ut(l);
    if (m || v) {
      const _ = () => {
        if (e.f) {
          const b = m ? h(l) ? f[l] : d[l] : l.value;
          o ? Ce(b) && _f(b, i) : Ce(b) ? b.includes(i) || b.push(i) : m ? (d[l] = [i], h(l) && (f[l] = d[l])) : (l.value = [i], e.k && (d[e.k] = l.value));
        } else m ? (d[l] = r, h(l) && (f[l] = r)) : v ? (l.value = r, e.k && (d[e.k] = r)) : W.NODE_ENV !== "production" && ae("Invalid template ref type:", l, `(${typeof l})`);
      };
      r ? (_.id = -1, $n(_, n)) : _();
    } else W.NODE_ENV !== "production" && ae("Invalid template ref type:", l, `(${typeof l})`);
  }
}
let E_ = !1;
const fi = () => {
  E_ || (console.error("Hydration completed but contains mismatches."), E_ = !0);
}, AO = (e) => e.namespaceURI.includes("svg") && e.tagName !== "foreignObject", MO = (e) => e.namespaceURI.includes("MathML"), wu = (e) => {
  if (e.nodeType === 1) {
    if (AO(e)) return "svg";
    if (MO(e)) return "mathml";
  }
}, Si = (e) => e.nodeType === 8;
function PO(e) {
  const {
    mt: t,
    p: n,
    o: {
      patchProp: s,
      createText: o,
      nextSibling: i,
      parentNode: r,
      remove: a,
      insert: l,
      createComment: u
    }
  } = e, d = (y, x) => {
    if (!x.hasChildNodes()) {
      W.NODE_ENV !== "production" && ae(
        "Attempting to hydrate existing markup but container is empty. Performing full mount instead."
      ), n(null, y, x), kd(), x._vnode = y;
      return;
    }
    f(x.firstChild, y, null, null, null), kd(), x._vnode = y;
  }, f = (y, x, N, S, O, $ = !1) => {
    $ = $ || !!x.dynamicChildren;
    const T = Si(y) && y.data === "[", R = () => v(
      y,
      x,
      N,
      S,
      O,
      T
    ), { type: P, ref: M, shapeFlag: U, patchFlag: H } = x;
    let j = y.nodeType;
    x.el = y, W.NODE_ENV !== "production" && (ji(y, "__vnode", x, !0), ji(y, "__vueParentComponent", N, !0)), H === -2 && ($ = !1, x.dynamicChildren = null);
    let V = null;
    switch (P) {
      case To:
        j !== 3 ? x.children === "" ? (l(x.el = o(""), r(y), y), V = y) : V = R() : (y.data !== x.children && (W.NODE_ENV !== "production" && ae(
          "Hydration text mismatch in",
          y.parentNode,
          `
  - rendered on server: ${JSON.stringify(
            y.data
          )}
  - expected on client: ${JSON.stringify(x.children)}`
        ), fi(), y.data = x.children), V = i(y));
        break;
      case Zt:
        w(y) ? (V = i(y), b(
          x.el = y.content.firstChild,
          y,
          N
        )) : j !== 8 || T ? V = R() : V = i(y);
        break;
      case qr:
        if (T && (y = i(y), j = y.nodeType), j === 1 || j === 3) {
          V = y;
          const K = !x.children.length;
          for (let q = 0; q < x.staticCount; q++)
            K && (x.children += V.nodeType === 1 ? V.outerHTML : V.data), q === x.staticCount - 1 && (x.anchor = V), V = i(V);
          return T ? i(V) : V;
        } else
          R();
        break;
      case G:
        T ? V = m(
          y,
          x,
          N,
          S,
          O,
          $
        ) : V = R();
        break;
      default:
        if (U & 1)
          (j !== 1 || x.type.toLowerCase() !== y.tagName.toLowerCase()) && !w(y) ? V = R() : V = p(
            y,
            x,
            N,
            S,
            O,
            $
          );
        else if (U & 6) {
          x.slotScopeIds = O;
          const K = r(y);
          if (T ? V = _(y) : Si(y) && y.data === "teleport start" ? V = _(y, y.data, "teleport end") : V = i(y), t(
            x,
            K,
            null,
            N,
            S,
            wu(K),
            $
          ), Xr(x) && !x.type.__asyncResolved) {
            let q;
            T ? (q = D(G), q.anchor = V ? V.previousSibling : K.lastChild) : q = y.nodeType === 3 ? te("") : D("div"), q.el = y, x.component.subTree = q;
          }
        } else U & 64 ? j !== 8 ? V = R() : V = x.type.hydrate(
          y,
          x,
          N,
          S,
          O,
          $,
          e,
          h
        ) : U & 128 ? V = x.type.hydrate(
          y,
          x,
          N,
          S,
          wu(r(y)),
          O,
          $,
          e,
          f
        ) : W.NODE_ENV !== "production" && ae("Invalid HostVNode type:", P, `(${typeof P})`);
    }
    return M != null && xc(M, null, S, x), V;
  }, p = (y, x, N, S, O, $) => {
    $ = $ || !!x.dynamicChildren;
    const { type: T, props: R, patchFlag: P, shapeFlag: M, dirs: U, transition: H } = x, j = T === "input" || T === "option";
    if (W.NODE_ENV !== "production" || j || P !== -1) {
      U && wo(x, null, N, "created");
      let V = !1;
      if (w(y)) {
        V = ME(
          null,
          // no need check parentSuspense in hydration
          H
        ) && N && N.vnode.props && N.vnode.props.appear;
        const q = y.content.firstChild;
        V && H.beforeEnter(q), b(q, y, N), x.el = y = q;
      }
      if (M & 16 && // skip if element has innerHTML / textContent
      !(R && (R.innerHTML || R.textContent))) {
        let q = h(
          y.firstChild,
          x,
          y,
          N,
          S,
          O,
          $
        ), re = !1;
        for (; q; ) {
          Bl(
            y,
            1
            /* CHILDREN */
          ) || (W.NODE_ENV !== "production" && !re && (ae(
            "Hydration children mismatch on",
            y,
            `
Server rendered element contains more child nodes than client vdom.`
          ), re = !0), fi());
          const ke = q;
          q = q.nextSibling, a(ke);
        }
      } else if (M & 8) {
        let q = x.children;
        q[0] === `
` && (y.tagName === "PRE" || y.tagName === "TEXTAREA") && (q = q.slice(1)), y.textContent !== q && (Bl(
          y,
          0
          /* TEXT */
        ) || (W.NODE_ENV !== "production" && ae(
          "Hydration text content mismatch on",
          y,
          `
  - rendered on server: ${y.textContent}
  - expected on client: ${x.children}`
        ), fi()), y.textContent = x.children);
      }
      if (R) {
        if (W.NODE_ENV !== "production" || j || !$ || P & 48) {
          const q = y.tagName.includes("-");
          for (const re in R)
            W.NODE_ENV !== "production" && // #11189 skip if this node has directives that have created hooks
            // as it could have mutated the DOM in any possible way
            !(U && U.some((ke) => ke.dir.created)) && LO(y, re, R[re], x, N) && fi(), (j && (re.endsWith("value") || re === "indeterminate") || Do(re) && !fr(re) || // force hydrate v-bind with .prop modifiers
            re[0] === "." || q) && s(y, re, null, R[re], void 0, N);
        } else if (R.onClick)
          s(
            y,
            "onClick",
            null,
            R.onClick,
            void 0,
            N
          );
        else if (P & 4 && Us(R.style))
          for (const q in R.style) R.style[q];
      }
      let K;
      (K = R && R.onVnodeBeforeMount) && ys(K, N, x), U && wo(x, null, N, "beforeMount"), ((K = R && R.onVnodeMounted) || U || V) && WE(() => {
        K && ys(K, N, x), V && H.enter(y), U && wo(x, null, N, "mounted");
      }, S);
    }
    return y.nextSibling;
  }, h = (y, x, N, S, O, $, T) => {
    T = T || !!x.dynamicChildren;
    const R = x.children, P = R.length;
    let M = !1;
    for (let U = 0; U < P; U++) {
      const H = T ? R[U] : R[U] = as(R[U]), j = H.type === To;
      y ? (j && !T && U + 1 < P && as(R[U + 1]).type === To && (l(
        o(
          y.data.slice(H.children.length)
        ),
        N,
        i(y)
      ), y.data = H.children), y = f(
        y,
        H,
        S,
        O,
        $,
        T
      )) : j && !H.children ? l(H.el = o(""), N) : (Bl(
        N,
        1
        /* CHILDREN */
      ) || (W.NODE_ENV !== "production" && !M && (ae(
        "Hydration children mismatch on",
        N,
        `
Server rendered element contains fewer child nodes than client vdom.`
      ), M = !0), fi()), n(
        null,
        H,
        N,
        null,
        S,
        O,
        wu(N),
        $
      ));
    }
    return y;
  }, m = (y, x, N, S, O, $) => {
    const { slotScopeIds: T } = x;
    T && (O = O ? O.concat(T) : T);
    const R = r(y), P = h(
      i(y),
      x,
      R,
      N,
      S,
      O,
      $
    );
    return P && Si(P) && P.data === "]" ? i(x.anchor = P) : (fi(), l(x.anchor = u("]"), R, P), P);
  }, v = (y, x, N, S, O, $) => {
    if (Bl(
      y.parentElement,
      1
      /* CHILDREN */
    ) || (W.NODE_ENV !== "production" && ae(
      `Hydration node mismatch:
- rendered on server:`,
      y,
      y.nodeType === 3 ? "(text)" : Si(y) && y.data === "[" ? "(start of fragment)" : "",
      `
- expected on client:`,
      x.type
    ), fi()), x.el = null, $) {
      const P = _(y);
      for (; ; ) {
        const M = i(y);
        if (M && M !== P)
          a(M);
        else
          break;
      }
    }
    const T = i(y), R = r(y);
    return a(y), n(
      null,
      x,
      R,
      T,
      N,
      S,
      wu(R),
      O
    ), N && (N.vnode.el = x.el, Pf(N, x.el)), T;
  }, _ = (y, x = "[", N = "]") => {
    let S = 0;
    for (; y; )
      if (y = i(y), y && Si(y) && (y.data === x && S++, y.data === N)) {
        if (S === 0)
          return i(y);
        S--;
      }
    return y;
  }, b = (y, x, N) => {
    const S = x.parentNode;
    S && S.replaceChild(y, x);
    let O = N;
    for (; O; )
      O.vnode.el === x && (O.vnode.el = O.subTree.el = y), O = O.parent;
  }, w = (y) => y.nodeType === 1 && y.tagName === "TEMPLATE";
  return [d, f];
}
function LO(e, t, n, s, o) {
  let i, r, a, l;
  if (t === "class")
    a = e.getAttribute("class"), l = Se(n), VO(w_(a || ""), w_(l)) || (i = 2, r = "class");
  else if (t === "style") {
    a = e.getAttribute("style") || "", l = Ge(n) ? n : m1(Jn(n));
    const u = S_(a), d = S_(l);
    if (s.dirs)
      for (const { dir: f, value: p } of s.dirs)
        f.name === "show" && !p && d.set("display", "none");
    o && cE(o, s, d), FO(u, d) || (i = 3, r = "style");
  } else (e instanceof SVGElement && b1(t) || e instanceof HTMLElement && (Lh(t) || y1(t))) && (Lh(t) ? (a = e.hasAttribute(t), l = wf(n)) : n == null ? (a = e.hasAttribute(t), l = !1) : (e.hasAttribute(t) ? a = e.getAttribute(t) : t === "value" && e.tagName === "TEXTAREA" ? a = e.value : a = !1, l = E1(n) ? String(n) : !1), a !== l && (i = 4, r = t));
  if (i != null && !Bl(e, i)) {
    const u = (p) => p === !1 ? "(not rendered)" : `${r}="${p}"`, d = `Hydration ${uE[i]} mismatch on`, f = `
  - rendered on server: ${u(a)}
  - expected on client: ${u(l)}
  Note: this mismatch is check-only. The DOM will not be rectified in production due to performance overhead.
  You should fix the source of the mismatch.`;
    return ae(d, e, f), !0;
  }
  return !1;
}
function w_(e) {
  return new Set(e.trim().split(/\s+/));
}
function VO(e, t) {
  if (e.size !== t.size)
    return !1;
  for (const n of e)
    if (!t.has(n))
      return !1;
  return !0;
}
function S_(e) {
  const t = /* @__PURE__ */ new Map();
  for (const n of e.split(";")) {
    let [s, o] = n.split(":");
    s = s.trim(), o = o && o.trim(), s && o && t.set(s, o);
  }
  return t;
}
function FO(e, t) {
  if (e.size !== t.size)
    return !1;
  for (const [n, s] of e)
    if (s !== t.get(n))
      return !1;
  return !0;
}
function cE(e, t, n) {
  const s = e.subTree;
  if (e.getCssVars && (t === s || s && s.type === G && s.children.includes(t))) {
    const o = e.getCssVars();
    for (const i in o)
      n.set(
        `--${S1(i, !1)}`,
        String(o[i])
      );
  }
  t === s && e.parent && cE(e.parent, e.vnode, n);
}
const x_ = "data-allow-mismatch", uE = {
  0: "text",
  1: "children",
  2: "class",
  3: "style",
  4: "attribute"
};
function Bl(e, t) {
  if (t === 0 || t === 1)
    for (; e && !e.hasAttribute(x_); )
      e = e.parentElement;
  const n = e && e.getAttribute(x_);
  if (n == null)
    return !1;
  if (n === "")
    return !0;
  {
    const s = n.split(",");
    return t === 0 && s.includes("children") ? !0 : n.split(",").includes(uE[t]);
  }
}
const UO = al().requestIdleCallback || ((e) => setTimeout(e, 1)), jO = al().cancelIdleCallback || ((e) => clearTimeout(e)), BO = (e = 1e4) => (t) => {
  const n = UO(t, { timeout: e });
  return () => jO(n);
};
function HO(e) {
  const { top: t, left: n, bottom: s, right: o } = e.getBoundingClientRect(), { innerHeight: i, innerWidth: r } = window;
  return (t > 0 && t < i || s > 0 && s < i) && (n > 0 && n < r || o > 0 && o < r);
}
const YO = (e) => (t, n) => {
  const s = new IntersectionObserver((o) => {
    for (const i of o)
      if (i.isIntersecting) {
        s.disconnect(), t();
        break;
      }
  }, e);
  return n((o) => {
    if (o instanceof Element) {
      if (HO(o))
        return t(), s.disconnect(), !1;
      s.observe(o);
    }
  }), () => s.disconnect();
}, WO = (e) => (t) => {
  if (e) {
    const n = matchMedia(e);
    if (n.matches)
      t();
    else
      return n.addEventListener("change", t, { once: !0 }), () => n.removeEventListener("change", t);
  }
}, GO = (e = []) => (t, n) => {
  Ge(e) && (e = [e]);
  let s = !1;
  const o = (r) => {
    s || (s = !0, i(), t(), r.target.dispatchEvent(new r.constructor(r.type, r)));
  }, i = () => {
    n((r) => {
      for (const a of e)
        r.removeEventListener(a, o);
    });
  };
  return n((r) => {
    for (const a of e)
      r.addEventListener(a, o, { once: !0 });
  }), i;
};
function zO(e, t) {
  if (Si(e) && e.data === "[") {
    let n = 1, s = e.nextSibling;
    for (; s; ) {
      if (s.nodeType === 1) {
        if (t(s) === !1)
          break;
      } else if (Si(s))
        if (s.data === "]") {
          if (--n === 0) break;
        } else s.data === "[" && n++;
      s = s.nextSibling;
    }
  } else
    t(e);
}
const Xr = (e) => !!e.type.__asyncLoader;
/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function KO(e) {
  Ue(e) && (e = { loader: e });
  const {
    loader: t,
    loadingComponent: n,
    errorComponent: s,
    delay: o = 200,
    hydrate: i,
    timeout: r,
    // undefined = never times out
    suspensible: a = !0,
    onError: l
  } = e;
  let u = null, d, f = 0;
  const p = () => (f++, u = null, h()), h = () => {
    let m;
    return u || (m = u = t().catch((v) => {
      if (v = v instanceof Error ? v : new Error(String(v)), l)
        return new Promise((_, b) => {
          l(v, () => _(p()), () => b(v), f + 1);
        });
      throw v;
    }).then((v) => {
      if (m !== u && u)
        return u;
      if (W.NODE_ENV !== "production" && !v && ae(
        "Async component loader resolved to undefined. If you are using retry(), make sure to return its return value."
      ), v && (v.__esModule || v[Symbol.toStringTag] === "Module") && (v = v.default), W.NODE_ENV !== "production" && v && !mt(v) && !Ue(v))
        throw new Error(`Invalid async component load result: ${v}`);
      return d = v, v;
    }));
  };
  return /* @__PURE__ */ Rn({
    name: "AsyncComponentWrapper",
    __asyncLoader: h,
    __asyncHydrate(m, v, _) {
      const b = i ? () => {
        const w = i(
          _,
          (y) => zO(m, y)
        );
        w && (v.bum || (v.bum = [])).push(w);
      } : _;
      d ? b() : h().then(() => !v.isUnmounted && b());
    },
    get __asyncResolved() {
      return d;
    },
    setup() {
      const m = yn;
      if (xv(m), d)
        return () => Gp(d, m);
      const v = (y) => {
        u = null, ri(
          y,
          m,
          13,
          !s
        );
      };
      if (a && m.suspense || Ga)
        return h().then((y) => () => Gp(y, m)).catch((y) => (v(y), () => s ? D(s, {
          error: y
        }) : null));
      const _ = I(!1), b = I(), w = I(!!o);
      return o && setTimeout(() => {
        w.value = !1;
      }, o), r != null && setTimeout(() => {
        if (!_.value && !b.value) {
          const y = new Error(
            `Async component timed out after ${r}ms.`
          );
          v(y), b.value = y;
        }
      }, r), h().then(() => {
        _.value = !0, m.parent && ll(m.parent.vnode) && m.parent.update();
      }).catch((y) => {
        v(y), b.value = y;
      }), () => {
        if (_.value && d)
          return Gp(d, m);
        if (b.value && s)
          return D(s, {
            error: b.value
          });
        if (n && !w.value)
          return D(n);
      };
    }
  });
}
function Gp(e, t) {
  const { ref: n, props: s, children: o, ce: i } = t.vnode, r = D(e, s, o);
  return r.ref = n, r.ce = i, delete t.vnode.ce, r;
}
const ll = (e) => e.type.__isKeepAlive, XO = {
  name: "KeepAlive",
  // Marker for special handling inside the renderer. We are not using a ===
  // check directly on KeepAlive in the renderer, because importing it directly
  // would prevent it from being tree-shaken.
  __isKeepAlive: !0,
  props: {
    include: [String, RegExp, Array],
    exclude: [String, RegExp, Array],
    max: [String, Number]
  },
  setup(e, { slots: t }) {
    const n = cn(), s = n.ctx;
    if (!s.renderer)
      return () => {
        const w = t.default && t.default();
        return w && w.length === 1 ? w[0] : w;
      };
    const o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
    let r = null;
    W.NODE_ENV !== "production" && (n.__v_cache = o);
    const a = n.suspense, {
      renderer: {
        p: l,
        m: u,
        um: d,
        o: { createElement: f }
      }
    } = s, p = f("div");
    s.activate = (w, y, x, N, S) => {
      const O = w.component;
      u(w, y, x, 0, a), l(
        O.vnode,
        w,
        y,
        x,
        O,
        a,
        N,
        w.slotScopeIds,
        S
      ), $n(() => {
        O.isDeactivated = !1, O.a && or(O.a);
        const $ = w.props && w.props.onVnodeMounted;
        $ && ys($, O.parent, w);
      }, a), W.NODE_ENV !== "production" && Hh(O);
    }, s.deactivate = (w) => {
      const y = w.component;
      Md(y.m), Md(y.a), u(w, p, null, 1, a), $n(() => {
        y.da && or(y.da);
        const x = w.props && w.props.onVnodeUnmounted;
        x && ys(x, y.parent, w), y.isDeactivated = !0;
      }, a), W.NODE_ENV !== "production" && Hh(y);
    };
    function h(w) {
      zp(w), d(w, n, a, !0);
    }
    function m(w) {
      o.forEach((y, x) => {
        const N = Oc(y.type);
        N && !w(N) && v(x);
      });
    }
    function v(w) {
      const y = o.get(w);
      y && (!r || !oo(y, r)) ? h(y) : r && zp(r), o.delete(w), i.delete(w);
    }
    nt(
      () => [e.include, e.exclude],
      ([w, y]) => {
        w && m((x) => Hl(w, x)), y && m((x) => !Hl(y, x));
      },
      // prune post-render after `current` has been updated
      { flush: "post", deep: !0 }
    );
    let _ = null;
    const b = () => {
      _ != null && (Ld(n.subTree.type) ? $n(() => {
        o.set(_, Su(n.subTree));
      }, n.subTree.suspense) : o.set(_, Su(n.subTree)));
    };
    return vt(b), If(b), ii(() => {
      o.forEach((w) => {
        const { subTree: y, suspense: x } = n, N = Su(y);
        if (w.type === N.type && w.key === N.key) {
          zp(N);
          const S = N.component.da;
          S && $n(S, x);
          return;
        }
        h(w);
      });
    }), () => {
      if (_ = null, !t.default)
        return r = null;
      const w = t.default(), y = w[0];
      if (w.length > 1)
        return W.NODE_ENV !== "production" && ae("KeepAlive should contain exactly one component child."), r = null, w;
      if (!Ao(y) || !(y.shapeFlag & 4) && !(y.shapeFlag & 128))
        return r = null, y;
      let x = Su(y);
      if (x.type === Zt)
        return r = null, x;
      const N = x.type, S = Oc(
        Xr(x) ? x.type.__asyncResolved || {} : N
      ), { include: O, exclude: $, max: T } = e;
      if (O && (!S || !Hl(O, S)) || $ && S && Hl($, S))
        return x.shapeFlag &= -257, r = x, y;
      const R = x.key == null ? N : x.key, P = o.get(R);
      return x.el && (x = Ws(x), y.shapeFlag & 128 && (y.ssContent = x)), _ = R, P ? (x.el = P.el, x.component = P.component, x.transition && _r(x, x.transition), x.shapeFlag |= 512, i.delete(R), i.add(R)) : (i.add(R), T && i.size > parseInt(T, 10) && v(i.values().next().value)), x.shapeFlag |= 256, r = x, Ld(y.type) ? y : x;
    };
  }
}, dE = XO;
function Hl(e, t) {
  return Ce(e) ? e.some((n) => Hl(n, t)) : Ge(e) ? e.split(",").includes(t) : f1(e) ? (e.lastIndex = 0, e.test(t)) : !1;
}
function Nv(e, t) {
  fE(e, "a", t);
}
function Cv(e, t) {
  fE(e, "da", t);
}
function fE(e, t, n = yn) {
  const s = e.__wdc || (e.__wdc = () => {
    let o = n;
    for (; o; ) {
      if (o.isDeactivated)
        return;
      o = o.parent;
    }
    return e();
  });
  if (Rf(t, s, n), n) {
    let o = n.parent;
    for (; o && o.parent; )
      ll(o.parent.vnode) && qO(s, t, n, o), o = o.parent;
  }
}
function qO(e, t, n, s) {
  const o = Rf(
    t,
    e,
    s,
    !0
    /* prepend */
  );
  Fo(() => {
    _f(s[t], o);
  }, n);
}
function zp(e) {
  e.shapeFlag &= -257, e.shapeFlag &= -513;
}
function Su(e) {
  return e.shapeFlag & 128 ? e.ssContent : e;
}
function Rf(e, t, n = yn, s = !1) {
  if (n) {
    const o = n[e] || (n[e] = []), i = t.__weh || (t.__weh = (...r) => {
      br();
      const a = Wi(n), l = Ys(t, n, e, r);
      return a(), Er(), l;
    });
    return s ? o.unshift(i) : o.push(i), i;
  } else if (W.NODE_ENV !== "production") {
    const o = to(Tf[e].replace(/ hook$/, ""));
    ae(
      `${o} is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup(). If you are using async setup(), make sure to register lifecycle hooks before the first await statement.`
    );
  }
}
const wr = (e) => (t, n = yn) => {
  (!Ga || e === "sp") && Rf(e, (...s) => t(...s), n);
}, pE = wr("bm"), vt = wr("m"), Ov = wr(
  "bu"
), If = wr("u"), ii = wr(
  "bum"
), Fo = wr("um"), hE = wr(
  "sp"
), mE = wr("rtg"), vE = wr("rtc");
function gE(e, t = yn) {
  Rf("ec", e, t);
}
const Rd = "components", JO = "directives";
function le(e, t) {
  return $v(Rd, e, !0, t) || e;
}
const Tv = Symbol.for("v-ndc");
function Hi(e) {
  return Ge(e) ? $v(Rd, e, !1) || e : e || Tv;
}
function Ht(e) {
  return $v(JO, e);
}
function $v(e, t, n = !0, s = !1) {
  const o = pn || yn;
  if (o) {
    const i = o.type;
    if (e === Rd) {
      const a = Oc(
        i,
        !1
      );
      if (a && (a === t || a === Gt(t) || a === fo(Gt(t))))
        return i;
    }
    const r = (
      // local registration
      // check instance[type] first which is resolved for options API
      N_(o[e] || i[e], t) || // global registration
      N_(o.appContext[e], t)
    );
    if (!r && s)
      return i;
    if (W.NODE_ENV !== "production" && n && !r) {
      const a = e === Rd ? `
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement.` : "";
      ae(`Failed to resolve ${e.slice(0, -1)}: ${t}${a}`);
    }
    return r;
  } else W.NODE_ENV !== "production" && ae(
    `resolve${fo(e.slice(0, -1))} can only be used in render() or setup().`
  );
}
function N_(e, t) {
  return e && (e[t] || e[Gt(t)] || e[fo(Gt(t))]);
}
function ge(e, t, n, s) {
  let o;
  const i = n && n[s], r = Ce(e);
  if (r || Ge(e)) {
    const a = r && Us(e);
    let l = !1;
    a && (l = !Qn(e), e = xf(e)), o = new Array(e.length);
    for (let u = 0, d = e.length; u < d; u++)
      o[u] = t(
        l ? Gn(e[u]) : e[u],
        u,
        void 0,
        i && i[u]
      );
  } else if (typeof e == "number") {
    W.NODE_ENV !== "production" && !Number.isInteger(e) && ae(`The v-for range expect an integer value but got ${e}.`), o = new Array(e);
    for (let a = 0; a < e; a++)
      o[a] = t(a + 1, a, void 0, i && i[a]);
  } else if (mt(e))
    if (e[Symbol.iterator])
      o = Array.from(
        e,
        (a, l) => t(a, l, void 0, i && i[l])
      );
    else {
      const a = Object.keys(e);
      o = new Array(a.length);
      for (let l = 0, u = a.length; l < u; l++) {
        const d = a[l];
        o[l] = t(e[d], d, l, i && i[l]);
      }
    }
  else
    o = [];
  return n && (n[s] = o), o;
}
function QO(e, t) {
  for (let n = 0; n < t.length; n++) {
    const s = t[n];
    if (Ce(s))
      for (let o = 0; o < s.length; o++)
        e[s[o].name] = s[o].fn;
    else s && (e[s.name] = s.key ? (...o) => {
      const i = s.fn(...o);
      return i && (i.key = s.key), i;
    } : s.fn);
  }
  return e;
}
function fe(e, t, n = {}, s, o) {
  if (pn.ce || pn.parent && Xr(pn.parent) && pn.parent.ce)
    return t !== "default" && (n.name = t), g(), se(
      G,
      null,
      [D("slot", n, s && s())],
      64
    );
  let i = e[t];
  W.NODE_ENV !== "production" && i && i.length > 1 && (ae(
    "SSR-optimized slot function detected in a non-SSR-optimized render function. You need to mark this component with $dynamic-slots in the parent template."
  ), i = () => []), i && i._c && (i._d = !1), g();
  const r = i && kv(i(n)), a = n.key || // slot content array of a dynamic conditional slot may have a branch
  // key attached in the `createSlots` helper, respect that
  r && r.key, l = se(
    G,
    {
      key: (a && !us(a) ? a : `_${t}`) + // #7256 force differentiate fallback content from actual content
      (!r && s ? "_fb" : "")
    },
    r || (s ? s() : []),
    r && e._ === 1 ? 64 : -2
  );
  return !o && l.scopeId && (l.slotScopeIds = [l.scopeId + "-s"]), i && i._c && (i._d = !0), l;
}
function kv(e) {
  return e.some((t) => Ao(t) ? !(t.type === Zt || t.type === G && !kv(t.children)) : !0) ? e : null;
}
function ZO(e, t) {
  const n = {};
  if (W.NODE_ENV !== "production" && !mt(e))
    return ae("v-on with no argument expects an object value."), n;
  for (const s in e)
    n[t && /[A-Z]/.test(s) ? `on:${s}` : to(s)] = e[s];
  return n;
}
const Wh = (e) => e ? QE(e) ? Kc(e) : Wh(e.parent) : null, Mi = (
  // Move PURE marker to new line to workaround compiler discarding it
  // due to type annotation
  /* @__PURE__ */ it(/* @__PURE__ */ Object.create(null), {
    $: (e) => e,
    $el: (e) => e.vnode.el,
    $data: (e) => e.data,
    $props: (e) => W.NODE_ENV !== "production" ? ro(e.props) : e.props,
    $attrs: (e) => W.NODE_ENV !== "production" ? ro(e.attrs) : e.attrs,
    $slots: (e) => W.NODE_ENV !== "production" ? ro(e.slots) : e.slots,
    $refs: (e) => W.NODE_ENV !== "production" ? ro(e.refs) : e.refs,
    $parent: (e) => Wh(e.parent),
    $root: (e) => Wh(e.root),
    $host: (e) => e.ce,
    $emit: (e) => e.emit,
    $options: (e) => Rv(e),
    $forceUpdate: (e) => e.f || (e.f = () => {
      $f(e.update);
    }),
    $nextTick: (e) => e.n || (e.n = po.bind(e.proxy)),
    $watch: (e) => FT.bind(e)
  })
), Dv = (e) => e === "_" || e === "$", Kp = (e, t) => e !== pt && !e.__isScriptSetup && St(e, t), Zl = {
  get({ _: e }, t) {
    if (t === "__v_skip")
      return !0;
    const { ctx: n, setupState: s, data: o, props: i, accessCache: r, type: a, appContext: l } = e;
    if (W.NODE_ENV !== "production" && t === "__isVue")
      return !0;
    let u;
    if (t[0] !== "$") {
      const h = r[t];
      if (h !== void 0)
        switch (h) {
          case 1:
            return s[t];
          case 2:
            return o[t];
          case 4:
            return n[t];
          case 3:
            return i[t];
        }
      else {
        if (Kp(s, t))
          return r[t] = 1, s[t];
        if (o !== pt && St(o, t))
          return r[t] = 2, o[t];
        if (
          // only cache other properties when instance has declared (thus stable)
          // props
          (u = e.propsOptions[0]) && St(u, t)
        )
          return r[t] = 3, i[t];
        if (n !== pt && St(n, t))
          return r[t] = 4, n[t];
        Gh && (r[t] = 0);
      }
    }
    const d = Mi[t];
    let f, p;
    if (d)
      return t === "$attrs" ? (kn(e.attrs, "get", ""), W.NODE_ENV !== "production" && Pd()) : W.NODE_ENV !== "production" && t === "$slots" && kn(e, "get", t), d(e);
    if (
      // css module (injected by vue-loader)
      (f = a.__cssModules) && (f = f[t])
    )
      return f;
    if (n !== pt && St(n, t))
      return r[t] = 4, n[t];
    if (
      // global properties
      p = l.config.globalProperties, St(p, t)
    )
      return p[t];
    W.NODE_ENV !== "production" && pn && (!Ge(t) || // #1091 avoid internal isRef/isVNode checks on component instance leading
    // to infinite warning loop
    t.indexOf("__v") !== 0) && (o !== pt && Dv(t[0]) && St(o, t) ? ae(
      `Property ${JSON.stringify(
        t
      )} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`
    ) : e === pn && ae(
      `Property ${JSON.stringify(t)} was accessed during render but is not defined on instance.`
    ));
  },
  set({ _: e }, t, n) {
    const { data: s, setupState: o, ctx: i } = e;
    return Kp(o, t) ? (o[t] = n, !0) : W.NODE_ENV !== "production" && o.__isScriptSetup && St(o, t) ? (ae(`Cannot mutate <script setup> binding "${t}" from Options API.`), !1) : s !== pt && St(s, t) ? (s[t] = n, !0) : St(e.props, t) ? (W.NODE_ENV !== "production" && ae(`Attempting to mutate prop "${t}". Props are readonly.`), !1) : t[0] === "$" && t.slice(1) in e ? (W.NODE_ENV !== "production" && ae(
      `Attempting to mutate public property "${t}". Properties starting with $ are reserved and readonly.`
    ), !1) : (W.NODE_ENV !== "production" && t in e.appContext.config.globalProperties ? Object.defineProperty(i, t, {
      enumerable: !0,
      configurable: !0,
      value: n
    }) : i[t] = n, !0);
  },
  has({
    _: { data: e, setupState: t, accessCache: n, ctx: s, appContext: o, propsOptions: i }
  }, r) {
    let a;
    return !!n[r] || e !== pt && St(e, r) || Kp(t, r) || (a = i[0]) && St(a, r) || St(s, r) || St(Mi, r) || St(o.config.globalProperties, r);
  },
  defineProperty(e, t, n) {
    return n.get != null ? e._.accessCache[t] = 0 : St(n, "value") && this.set(e, t, n.value, null), Reflect.defineProperty(e, t, n);
  }
};
W.NODE_ENV !== "production" && (Zl.ownKeys = (e) => (ae(
  "Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."
), Reflect.ownKeys(e)));
const eT = /* @__PURE__ */ it({}, Zl, {
  get(e, t) {
    if (t !== Symbol.unscopables)
      return Zl.get(e, t, e);
  },
  has(e, t) {
    const n = t[0] !== "_" && !ov(t);
    return W.NODE_ENV !== "production" && !n && Zl.has(e, t) && ae(
      `Property ${JSON.stringify(
        t
      )} should not start with _ which is a reserved prefix for Vue internals.`
    ), n;
  }
});
function tT(e) {
  const t = {};
  return Object.defineProperty(t, "_", {
    configurable: !0,
    enumerable: !1,
    get: () => e
  }), Object.keys(Mi).forEach((n) => {
    Object.defineProperty(t, n, {
      configurable: !0,
      enumerable: !1,
      get: () => Mi[n](e),
      // intercepted by the proxy so no need for implementation,
      // but needed to prevent set errors
      set: Jt
    });
  }), t;
}
function nT(e) {
  const {
    ctx: t,
    propsOptions: [n]
  } = e;
  n && Object.keys(n).forEach((s) => {
    Object.defineProperty(t, s, {
      enumerable: !0,
      configurable: !0,
      get: () => e.props[s],
      set: Jt
    });
  });
}
function sT(e) {
  const { ctx: t, setupState: n } = e;
  Object.keys(Ye(n)).forEach((s) => {
    if (!n.__isScriptSetup) {
      if (Dv(s[0])) {
        ae(
          `setup() return property ${JSON.stringify(
            s
          )} should not start with "$" or "_" which are reserved prefixes for Vue internals.`
        );
        return;
      }
      Object.defineProperty(t, s, {
        enumerable: !0,
        configurable: !0,
        get: () => n[s],
        set: Jt
      });
    }
  });
}
const ia = (e) => ae(
  `${e}() is a compiler-hint helper that is only usable inside <script setup> of a single file component. Its arguments should be compiled away and passing it at runtime has no effect.`
);
function oT() {
  return W.NODE_ENV !== "production" && ia("defineProps"), null;
}
function rT() {
  return W.NODE_ENV !== "production" && ia("defineEmits"), null;
}
function iT(e) {
  W.NODE_ENV !== "production" && ia("defineExpose");
}
function aT(e) {
  W.NODE_ENV !== "production" && ia("defineOptions");
}
function lT() {
  return W.NODE_ENV !== "production" && ia("defineSlots"), null;
}
function cT() {
  W.NODE_ENV !== "production" && ia("defineModel");
}
function uT(e, t) {
  return W.NODE_ENV !== "production" && ia("withDefaults"), null;
}
function _E() {
  return yE().slots;
}
function dT() {
  return yE().attrs;
}
function yE() {
  const e = cn();
  return W.NODE_ENV !== "production" && !e && ae("useContext() called without active instance."), e.setupContext || (e.setupContext = t0(e));
}
function Nc(e) {
  return Ce(e) ? e.reduce(
    (t, n) => (t[n] = null, t),
    {}
  ) : e;
}
function fT(e, t) {
  const n = Nc(e);
  for (const s in t) {
    if (s.startsWith("__skip")) continue;
    let o = n[s];
    o ? Ce(o) || Ue(o) ? o = n[s] = { type: o, default: t[s] } : o.default = t[s] : o === null ? o = n[s] = { default: t[s] } : W.NODE_ENV !== "production" && ae(`props default key "${s}" has no corresponding declaration.`), o && t[`__skip_${s}`] && (o.skipFactory = !0);
  }
  return n;
}
function jn(e, t) {
  return !e || !t ? e || t : Ce(e) && Ce(t) ? e.concat(t) : it({}, Nc(e), Nc(t));
}
function pT(e, t) {
  const n = {};
  for (const s in e)
    t.includes(s) || Object.defineProperty(n, s, {
      enumerable: !0,
      get: () => e[s]
    });
  return n;
}
function hT(e) {
  const t = cn();
  W.NODE_ENV !== "production" && !t && ae(
    "withAsyncContext called without active current instance. This is likely a bug."
  );
  let n = e();
  return tm(), Hc(n) && (n = n.catch((s) => {
    throw Wi(t), s;
  })), [n, () => Wi(t)];
}
function mT() {
  const e = /* @__PURE__ */ Object.create(null);
  return (t, n) => {
    e[n] ? ae(`${t} property "${n}" is already defined in ${e[n]}.`) : e[n] = t;
  };
}
let Gh = !0;
function vT(e) {
  const t = Rv(e), n = e.proxy, s = e.ctx;
  Gh = !1, t.beforeCreate && C_(t.beforeCreate, e, "bc");
  const {
    // state
    data: o,
    computed: i,
    methods: r,
    watch: a,
    provide: l,
    inject: u,
    // lifecycle
    created: d,
    beforeMount: f,
    mounted: p,
    beforeUpdate: h,
    updated: m,
    activated: v,
    deactivated: _,
    beforeDestroy: b,
    beforeUnmount: w,
    destroyed: y,
    unmounted: x,
    render: N,
    renderTracked: S,
    renderTriggered: O,
    errorCaptured: $,
    serverPrefetch: T,
    // public API
    expose: R,
    inheritAttrs: P,
    // assets
    components: M,
    directives: U,
    filters: H
  } = t, j = W.NODE_ENV !== "production" ? mT() : null;
  if (W.NODE_ENV !== "production") {
    const [K] = e.propsOptions;
    if (K)
      for (const q in K)
        j("Props", q);
  }
  if (u && gT(u, s, j), r)
    for (const K in r) {
      const q = r[K];
      Ue(q) ? (W.NODE_ENV !== "production" ? Object.defineProperty(s, K, {
        value: q.bind(n),
        configurable: !0,
        enumerable: !0,
        writable: !0
      }) : s[K] = q.bind(n), W.NODE_ENV !== "production" && j("Methods", K)) : W.NODE_ENV !== "production" && ae(
        `Method "${K}" has type "${typeof q}" in the component definition. Did you reference the function correctly?`
      );
    }
  if (o) {
    W.NODE_ENV !== "production" && !Ue(o) && ae(
      "The data option must be a function. Plain object usage is no longer supported."
    );
    const K = o.call(n, n);
    if (W.NODE_ENV !== "production" && Hc(K) && ae(
      "data() returned a Promise - note data() cannot be async; If you intend to perform data fetching before component renders, use async setup() + <Suspense>."
    ), !mt(K))
      W.NODE_ENV !== "production" && ae("data() should return an object.");
    else if (e.data = qe(K), W.NODE_ENV !== "production")
      for (const q in K)
        j("Data", q), Dv(q[0]) || Object.defineProperty(s, q, {
          configurable: !0,
          enumerable: !0,
          get: () => K[q],
          set: Jt
        });
  }
  if (Gh = !0, i)
    for (const K in i) {
      const q = i[K], re = Ue(q) ? q.bind(n, n) : Ue(q.get) ? q.get.bind(n, n) : Jt;
      W.NODE_ENV !== "production" && re === Jt && ae(`Computed property "${K}" has no getter.`);
      const ke = !Ue(q) && Ue(q.set) ? q.set.bind(n) : W.NODE_ENV !== "production" ? () => {
        ae(
          `Write operation failed: computed property "${K}" is readonly.`
        );
      } : Jt, ze = k({
        get: re,
        set: ke
      });
      Object.defineProperty(s, K, {
        enumerable: !0,
        configurable: !0,
        get: () => ze.value,
        set: (We) => ze.value = We
      }), W.NODE_ENV !== "production" && j("Computed", K);
    }
  if (a)
    for (const K in a)
      bE(a[K], s, n, K);
  if (l) {
    const K = Ue(l) ? l.call(n) : l;
    Reflect.ownKeys(K).forEach((q) => {
      Cn(q, K[q]);
    });
  }
  d && C_(d, e, "c");
  function V(K, q) {
    Ce(q) ? q.forEach((re) => K(re.bind(n))) : q && K(q.bind(n));
  }
  if (V(pE, f), V(vt, p), V(Ov, h), V(If, m), V(Nv, v), V(Cv, _), V(gE, $), V(vE, S), V(mE, O), V(ii, w), V(Fo, x), V(hE, T), Ce(R))
    if (R.length) {
      const K = e.exposed || (e.exposed = {});
      R.forEach((q) => {
        Object.defineProperty(K, q, {
          get: () => n[q],
          set: (re) => n[q] = re
        });
      });
    } else e.exposed || (e.exposed = {});
  N && e.render === Jt && (e.render = N), P != null && (e.inheritAttrs = P), M && (e.components = M), U && (e.directives = U), T && xv(e);
}
function gT(e, t, n = Jt) {
  Ce(e) && (e = zh(e));
  for (const s in e) {
    const o = e[s];
    let i;
    mt(o) ? "default" in o ? i = $e(
      o.from || s,
      o.default,
      !0
    ) : i = $e(o.from || s) : i = $e(o), ut(i) ? Object.defineProperty(t, s, {
      enumerable: !0,
      configurable: !0,
      get: () => i.value,
      set: (r) => i.value = r
    }) : t[s] = i, W.NODE_ENV !== "production" && n("Inject", s);
  }
}
function C_(e, t, n) {
  Ys(
    Ce(e) ? e.map((s) => s.bind(t.proxy)) : e.bind(t.proxy),
    t,
    n
  );
}
function bE(e, t, n, s) {
  let o = s.includes(".") ? UE(n, s) : () => n[s];
  if (Ge(e)) {
    const i = t[e];
    Ue(i) ? nt(o, i) : W.NODE_ENV !== "production" && ae(`Invalid watch handler specified by key "${e}"`, i);
  } else if (Ue(e))
    nt(o, e.bind(n));
  else if (mt(e))
    if (Ce(e))
      e.forEach((i) => bE(i, t, n, s));
    else {
      const i = Ue(e.handler) ? e.handler.bind(n) : t[e.handler];
      Ue(i) ? nt(o, i, e) : W.NODE_ENV !== "production" && ae(`Invalid watch handler specified by key "${e.handler}"`, i);
    }
  else W.NODE_ENV !== "production" && ae(`Invalid watch option: "${s}"`, e);
}
function Rv(e) {
  const t = e.type, { mixins: n, extends: s } = t, {
    mixins: o,
    optionsCache: i,
    config: { optionMergeStrategies: r }
  } = e.appContext, a = i.get(t);
  let l;
  return a ? l = a : !o.length && !n && !s ? l = t : (l = {}, o.length && o.forEach(
    (u) => Id(l, u, r, !0)
  ), Id(l, t, r)), mt(t) && i.set(t, l), l;
}
function Id(e, t, n, s = !1) {
  const { mixins: o, extends: i } = t;
  i && Id(e, i, n, !0), o && o.forEach(
    (r) => Id(e, r, n, !0)
  );
  for (const r in t)
    if (s && r === "expose")
      W.NODE_ENV !== "production" && ae(
        '"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.'
      );
    else {
      const a = _T[r] || n && n[r];
      e[r] = a ? a(e[r], t[r]) : t[r];
    }
  return e;
}
const _T = {
  data: O_,
  props: T_,
  emits: T_,
  // objects
  methods: Yl,
  computed: Yl,
  // lifecycle
  beforeCreate: ss,
  created: ss,
  beforeMount: ss,
  mounted: ss,
  beforeUpdate: ss,
  updated: ss,
  beforeDestroy: ss,
  beforeUnmount: ss,
  destroyed: ss,
  unmounted: ss,
  activated: ss,
  deactivated: ss,
  errorCaptured: ss,
  serverPrefetch: ss,
  // assets
  components: Yl,
  directives: Yl,
  // watch
  watch: bT,
  // provide / inject
  provide: O_,
  inject: yT
};
function O_(e, t) {
  return t ? e ? function() {
    return it(
      Ue(e) ? e.call(this, this) : e,
      Ue(t) ? t.call(this, this) : t
    );
  } : t : e;
}
function yT(e, t) {
  return Yl(zh(e), zh(t));
}
function zh(e) {
  if (Ce(e)) {
    const t = {};
    for (let n = 0; n < e.length; n++)
      t[e[n]] = e[n];
    return t;
  }
  return e;
}
function ss(e, t) {
  return e ? [...new Set([].concat(e, t))] : t;
}
function Yl(e, t) {
  return e ? it(/* @__PURE__ */ Object.create(null), e, t) : t;
}
function T_(e, t) {
  return e ? Ce(e) && Ce(t) ? [.../* @__PURE__ */ new Set([...e, ...t])] : it(
    /* @__PURE__ */ Object.create(null),
    Nc(e),
    Nc(t ?? {})
  ) : t;
}
function bT(e, t) {
  if (!e) return t;
  if (!t) return e;
  const n = it(/* @__PURE__ */ Object.create(null), e);
  for (const s in t)
    n[s] = ss(e[s], t[s]);
  return n;
}
function EE() {
  return {
    app: null,
    config: {
      isNativeTag: Ta,
      performance: !1,
      globalProperties: {},
      optionMergeStrategies: {},
      errorHandler: void 0,
      warnHandler: void 0,
      compilerOptions: {}
    },
    mixins: [],
    components: {},
    directives: {},
    provides: /* @__PURE__ */ Object.create(null),
    optionsCache: /* @__PURE__ */ new WeakMap(),
    propsCache: /* @__PURE__ */ new WeakMap(),
    emitsCache: /* @__PURE__ */ new WeakMap()
  };
}
let ET = 0;
function wT(e, t) {
  return function(s, o = null) {
    Ue(s) || (s = it({}, s)), o != null && !mt(o) && (W.NODE_ENV !== "production" && ae("root props passed to app.mount() must be an object."), o = null);
    const i = EE(), r = /* @__PURE__ */ new WeakSet(), a = [];
    let l = !1;
    const u = i.app = {
      _uid: ET++,
      _component: s,
      _props: o,
      _container: null,
      _context: i,
      _instance: null,
      version: rm,
      get config() {
        return i.config;
      },
      set config(d) {
        W.NODE_ENV !== "production" && ae(
          "app.config cannot be replaced. Modify individual options instead."
        );
      },
      use(d, ...f) {
        return r.has(d) ? W.NODE_ENV !== "production" && ae("Plugin has already been applied to target app.") : d && Ue(d.install) ? (r.add(d), d.install(u, ...f)) : Ue(d) ? (r.add(d), d(u, ...f)) : W.NODE_ENV !== "production" && ae(
          'A plugin must either be a function or an object with an "install" function.'
        ), u;
      },
      mixin(d) {
        return i.mixins.includes(d) ? W.NODE_ENV !== "production" && ae(
          "Mixin has already been applied to target app" + (d.name ? `: ${d.name}` : "")
        ) : i.mixins.push(d), u;
      },
      component(d, f) {
        return W.NODE_ENV !== "production" && nm(d, i.config), f ? (W.NODE_ENV !== "production" && i.components[d] && ae(`Component "${d}" has already been registered in target app.`), i.components[d] = f, u) : i.components[d];
      },
      directive(d, f) {
        return W.NODE_ENV !== "production" && Z1(d), f ? (W.NODE_ENV !== "production" && i.directives[d] && ae(`Directive "${d}" has already been registered in target app.`), i.directives[d] = f, u) : i.directives[d];
      },
      mount(d, f, p) {
        if (l)
          W.NODE_ENV !== "production" && ae(
            "App has already been mounted.\nIf you want to remount the same app, move your app creation logic into a factory function and create fresh app instances for each mount - e.g. `const createMyApp = () => createApp(App)`"
          );
        else {
          W.NODE_ENV !== "production" && d.__vue_app__ && ae(
            "There is already an app instance mounted on the host container.\n If you want to mount another app on the same host container, you need to unmount the previous app by calling `app.unmount()` first."
          );
          const h = u._ceVNode || D(s, o);
          return h.appContext = i, p === !0 ? p = "svg" : p === !1 && (p = void 0), W.NODE_ENV !== "production" && (i.reload = () => {
            e(
              Ws(h),
              d,
              p
            );
          }), f && t ? t(h, d) : e(h, d, p), l = !0, u._container = d, d.__vue_app__ = u, W.NODE_ENV !== "production" && (u._instance = h.component, EO(u, rm)), Kc(h.component);
        }
      },
      onUnmount(d) {
        W.NODE_ENV !== "production" && typeof d != "function" && ae(
          `Expected function as first argument to app.onUnmount(), but got ${typeof d}`
        ), a.push(d);
      },
      unmount() {
        l ? (Ys(
          a,
          u._instance,
          16
        ), e(null, u._container), W.NODE_ENV !== "production" && (u._instance = null, wO(u)), delete u._container.__vue_app__) : W.NODE_ENV !== "production" && ae("Cannot unmount an app that is not mounted.");
      },
      provide(d, f) {
        return W.NODE_ENV !== "production" && d in i.provides && ae(
          `App already provides property with key "${String(d)}". It will be overwritten with the new value.`
        ), i.provides[d] = f, u;
      },
      runWithContext(d) {
        const f = Pi;
        Pi = u;
        try {
          return d();
        } finally {
          Pi = f;
        }
      }
    };
    return u;
  };
}
let Pi = null;
function Cn(e, t) {
  if (!yn)
    W.NODE_ENV !== "production" && ae("provide() can only be used inside setup().");
  else {
    let n = yn.provides;
    const s = yn.parent && yn.parent.provides;
    s === n && (n = yn.provides = Object.create(s)), n[e] = t;
  }
}
function $e(e, t, n = !1) {
  const s = yn || pn;
  if (s || Pi) {
    const o = Pi ? Pi._context.provides : s ? s.parent == null ? s.vnode.appContext && s.vnode.appContext.provides : s.parent.provides : void 0;
    if (o && e in o)
      return o[e];
    if (arguments.length > 1)
      return n && Ue(t) ? t.call(s && s.proxy) : t;
    W.NODE_ENV !== "production" && ae(`injection "${String(e)}" not found.`);
  } else W.NODE_ENV !== "production" && ae("inject() can only be used inside setup() or functional components.");
}
function wE() {
  return !!(yn || pn || Pi);
}
const SE = {}, xE = () => Object.create(SE), NE = (e) => Object.getPrototypeOf(e) === SE;
function ST(e, t, n, s = !1) {
  const o = {}, i = xE();
  e.propsDefaults = /* @__PURE__ */ Object.create(null), CE(e, t, o, i);
  for (const r in e.propsOptions[0])
    r in o || (o[r] = void 0);
  W.NODE_ENV !== "production" && TE(t || {}, o, e), n ? e.props = s ? o : mv(o) : e.type.props ? e.props = o : e.props = i, e.attrs = i;
}
function xT(e) {
  for (; e; ) {
    if (e.type.__hmrId) return !0;
    e = e.parent;
  }
}
function NT(e, t, n, s) {
  const {
    props: o,
    attrs: i,
    vnode: { patchFlag: r }
  } = e, a = Ye(o), [l] = e.propsOptions;
  let u = !1;
  if (
    // always force full diff in dev
    // - #1942 if hmr is enabled with sfc component
    // - vite#872 non-sfc component used by sfc component
    !(W.NODE_ENV !== "production" && xT(e)) && (s || r > 0) && !(r & 16)
  ) {
    if (r & 8) {
      const d = e.vnode.dynamicProps;
      for (let f = 0; f < d.length; f++) {
        let p = d[f];
        if (Af(e.emitsOptions, p))
          continue;
        const h = t[p];
        if (l)
          if (St(i, p))
            h !== i[p] && (i[p] = h, u = !0);
          else {
            const m = Gt(p);
            o[m] = Kh(
              l,
              a,
              m,
              h,
              e,
              !1
            );
          }
        else
          h !== i[p] && (i[p] = h, u = !0);
      }
    }
  } else {
    CE(e, t, o, i) && (u = !0);
    let d;
    for (const f in a)
      (!t || // for camelCase
      !St(t, f) && // it's possible the original props was passed in as kebab-case
      // and converted to camelCase (#955)
      ((d = Un(f)) === f || !St(t, d))) && (l ? n && // for camelCase
      (n[f] !== void 0 || // for kebab-case
      n[d] !== void 0) && (o[f] = Kh(
        l,
        a,
        f,
        void 0,
        e,
        !0
      )) : delete o[f]);
    if (i !== a)
      for (const f in i)
        (!t || !St(t, f)) && (delete i[f], u = !0);
  }
  u && xo(e.attrs, "set", ""), W.NODE_ENV !== "production" && TE(t || {}, o, e);
}
function CE(e, t, n, s) {
  const [o, i] = e.propsOptions;
  let r = !1, a;
  if (t)
    for (let l in t) {
      if (fr(l))
        continue;
      const u = t[l];
      let d;
      o && St(o, d = Gt(l)) ? !i || !i.includes(d) ? n[d] = u : (a || (a = {}))[d] = u : Af(e.emitsOptions, l) || (!(l in s) || u !== s[l]) && (s[l] = u, r = !0);
    }
  if (i) {
    const l = Ye(n), u = a || pt;
    for (let d = 0; d < i.length; d++) {
      const f = i[d];
      n[f] = Kh(
        o,
        l,
        f,
        u[f],
        e,
        !St(u, f)
      );
    }
  }
  return r;
}
function Kh(e, t, n, s, o, i) {
  const r = e[n];
  if (r != null) {
    const a = St(r, "default");
    if (a && s === void 0) {
      const l = r.default;
      if (r.type !== Function && !r.skipFactory && Ue(l)) {
        const { propsDefaults: u } = o;
        if (n in u)
          s = u[n];
        else {
          const d = Wi(o);
          s = u[n] = l.call(
            null,
            t
          ), d();
        }
      } else
        s = l;
      o.ce && o.ce._setProp(n, s);
    }
    r[
      0
      /* shouldCast */
    ] && (i && !a ? s = !1 : r[
      1
      /* shouldCastTrue */
    ] && (s === "" || s === Un(n)) && (s = !0));
  }
  return s;
}
const CT = /* @__PURE__ */ new WeakMap();
function OE(e, t, n = !1) {
  const s = n ? CT : t.propsCache, o = s.get(e);
  if (o)
    return o;
  const i = e.props, r = {}, a = [];
  let l = !1;
  if (!Ue(e)) {
    const d = (f) => {
      l = !0;
      const [p, h] = OE(f, t, !0);
      it(r, p), h && a.push(...h);
    };
    !n && t.mixins.length && t.mixins.forEach(d), e.extends && d(e.extends), e.mixins && e.mixins.forEach(d);
  }
  if (!i && !l)
    return mt(e) && s.set(e, Di), Di;
  if (Ce(i))
    for (let d = 0; d < i.length; d++) {
      W.NODE_ENV !== "production" && !Ge(i[d]) && ae("props must be strings when using array syntax.", i[d]);
      const f = Gt(i[d]);
      $_(f) && (r[f] = pt);
    }
  else if (i) {
    W.NODE_ENV !== "production" && !mt(i) && ae("invalid props options", i);
    for (const d in i) {
      const f = Gt(d);
      if ($_(f)) {
        const p = i[d], h = r[f] = Ce(p) || Ue(p) ? { type: p } : it({}, p), m = h.type;
        let v = !1, _ = !0;
        if (Ce(m))
          for (let b = 0; b < m.length; ++b) {
            const w = m[b], y = Ue(w) && w.name;
            if (y === "Boolean") {
              v = !0;
              break;
            } else y === "String" && (_ = !1);
          }
        else
          v = Ue(m) && m.name === "Boolean";
        h[
          0
          /* shouldCast */
        ] = v, h[
          1
          /* shouldCastTrue */
        ] = _, (v || St(h, "default")) && a.push(f);
      }
    }
  }
  const u = [r, a];
  return mt(e) && s.set(e, u), u;
}
function $_(e) {
  return e[0] !== "$" && !fr(e) ? !0 : (W.NODE_ENV !== "production" && ae(`Invalid prop name: "${e}" is a reserved property.`), !1);
}
function OT(e) {
  return e === null ? "null" : typeof e == "function" ? e.name || "" : typeof e == "object" && e.constructor && e.constructor.name || "";
}
function TE(e, t, n) {
  const s = Ye(t), o = n.propsOptions[0], i = Object.keys(e).map((r) => Gt(r));
  for (const r in o) {
    let a = o[r];
    a != null && TT(
      r,
      s[r],
      a,
      W.NODE_ENV !== "production" ? ro(s) : s,
      !i.includes(r)
    );
  }
}
function TT(e, t, n, s, o) {
  const { type: i, required: r, validator: a, skipCheck: l } = n;
  if (r && o) {
    ae('Missing required prop: "' + e + '"');
    return;
  }
  if (!(t == null && !r)) {
    if (i != null && i !== !0 && !l) {
      let u = !1;
      const d = Ce(i) ? i : [i], f = [];
      for (let p = 0; p < d.length && !u; p++) {
        const { valid: h, expectedType: m } = kT(t, d[p]);
        f.push(m || ""), u = h;
      }
      if (!u) {
        ae(DT(e, t, f));
        return;
      }
    }
    a && !a(t, s) && ae('Invalid prop: custom validator check failed for prop "' + e + '".');
  }
}
const $T = /* @__PURE__ */ On(
  "String,Number,Boolean,Function,Symbol,BigInt"
);
function kT(e, t) {
  let n;
  const s = OT(t);
  if (s === "null")
    n = e === null;
  else if ($T(s)) {
    const o = typeof e;
    n = o === s.toLowerCase(), !n && o === "object" && (n = e instanceof t);
  } else s === "Object" ? n = mt(e) : s === "Array" ? n = Ce(e) : n = e instanceof t;
  return {
    valid: n,
    expectedType: s
  };
}
function DT(e, t, n) {
  if (n.length === 0)
    return `Prop type [] for prop "${e}" won't match anything. Did you mean to use type Array instead?`;
  let s = `Invalid prop: type check failed for prop "${e}". Expected ${n.map(fo).join(" | ")}`;
  const o = n[0], i = yf(t), r = k_(t, o), a = k_(t, i);
  return n.length === 1 && D_(o) && !RT(o, i) && (s += ` with value ${r}`), s += `, got ${i} `, D_(i) && (s += `with value ${a}.`), s;
}
function k_(e, t) {
  return t === "String" ? `"${e}"` : t === "Number" ? `${Number(e)}` : `${e}`;
}
function D_(e) {
  return ["string", "number", "boolean"].some((n) => e.toLowerCase() === n);
}
function RT(...e) {
  return e.some((t) => t.toLowerCase() === "boolean");
}
const $E = (e) => e[0] === "_" || e === "$stable", Iv = (e) => Ce(e) ? e.map(as) : [as(e)], IT = (e, t, n) => {
  if (t._n)
    return t;
  const s = B((...o) => (W.NODE_ENV !== "production" && yn && (!n || n.root === yn.root) && ae(
    `Slot "${e}" invoked outside of the render function: this will not track dependencies used in the slot. Invoke the slot function inside the render function instead.`
  ), Iv(t(...o))), n);
  return s._c = !1, s;
}, kE = (e, t, n) => {
  const s = e._ctx;
  for (const o in e) {
    if ($E(o)) continue;
    const i = e[o];
    if (Ue(i))
      t[o] = IT(o, i, s);
    else if (i != null) {
      W.NODE_ENV !== "production" && ae(
        `Non-function value encountered for slot "${o}". Prefer function slots for better performance.`
      );
      const r = Iv(i);
      t[o] = () => r;
    }
  }
}, DE = (e, t) => {
  W.NODE_ENV !== "production" && !ll(e.vnode) && ae(
    "Non-function value encountered for default slot. Prefer function slots for better performance."
  );
  const n = Iv(t);
  e.slots.default = () => n;
}, Xh = (e, t, n) => {
  for (const s in t)
    (n || s !== "_") && (e[s] = t[s]);
}, AT = (e, t, n) => {
  const s = e.slots = xE();
  if (e.vnode.shapeFlag & 32) {
    const o = t._;
    o ? (Xh(s, t, n), n && ji(s, "_", o, !0)) : kE(t, s);
  } else t && DE(e, t);
}, MT = (e, t, n) => {
  const { vnode: s, slots: o } = e;
  let i = !0, r = pt;
  if (s.shapeFlag & 32) {
    const a = t._;
    a ? W.NODE_ENV !== "production" && io ? (Xh(o, t, n), xo(e, "set", "$slots")) : n && a === 1 ? i = !1 : Xh(o, t, n) : (i = !t.$stable, kE(t, o)), r = t;
  } else t && (DE(e, t), r = { default: 1 });
  if (i)
    for (const a in o)
      !$E(a) && r[a] == null && delete o[a];
};
let Nl, jr;
function Qo(e, t) {
  e.appContext.config.performance && Ad() && jr.mark(`vue-${t}-${e.uid}`), W.NODE_ENV !== "production" && NO(e, t, Ad() ? jr.now() : Date.now());
}
function Zo(e, t) {
  if (e.appContext.config.performance && Ad()) {
    const n = `vue-${t}-${e.uid}`, s = n + ":end";
    jr.mark(s), jr.measure(
      `<${Lf(e, e.type)}> ${t}`,
      n,
      s
    ), jr.clearMarks(n), jr.clearMarks(s);
  }
  W.NODE_ENV !== "production" && CO(e, t, Ad() ? jr.now() : Date.now());
}
function Ad() {
  return Nl !== void 0 || (typeof window < "u" && window.performance ? (Nl = !0, jr = window.performance) : Nl = !1), Nl;
}
function PT() {
  const e = [];
  if (W.NODE_ENV !== "production" && e.length) {
    const t = e.length > 1;
    console.warn(
      `Feature flag${t ? "s" : ""} ${e.join(", ")} ${t ? "are" : "is"} not explicitly defined. You are running the esm-bundler build of Vue, which expects these compile-time feature flags to be globally injected via the bundler config in order to get better tree-shaking in the production bundle.

For more details, see https://link.vuejs.org/feature-flags.`
    );
  }
}
const $n = WE;
function RE(e) {
  return AE(e);
}
function IE(e) {
  return AE(e, PO);
}
function AE(e, t) {
  PT();
  const n = al();
  n.__VUE__ = !0, W.NODE_ENV !== "production" && bv(n.__VUE_DEVTOOLS_GLOBAL_HOOK__, n);
  const {
    insert: s,
    remove: o,
    patchProp: i,
    createElement: r,
    createText: a,
    createComment: l,
    setText: u,
    setElementText: d,
    parentNode: f,
    nextSibling: p,
    setScopeId: h = Jt,
    insertStaticContent: m
  } = e, v = (A, Y, Q, ie = null, ue = null, de = null, be = void 0, ve = null, _e = W.NODE_ENV !== "production" && io ? !1 : !!Y.dynamicChildren) => {
    if (A === Y)
      return;
    A && !oo(A, Y) && (ie = we(A), st(A, ue, de, !0), A = null), Y.patchFlag === -2 && (_e = !1, Y.dynamicChildren = null);
    const { type: pe, ref: Be, shapeFlag: xe } = Y;
    switch (pe) {
      case To:
        _(A, Y, Q, ie);
        break;
      case Zt:
        b(A, Y, Q, ie);
        break;
      case qr:
        A == null ? w(Y, Q, ie, be) : W.NODE_ENV !== "production" && y(A, Y, Q, be);
        break;
      case G:
        U(
          A,
          Y,
          Q,
          ie,
          ue,
          de,
          be,
          ve,
          _e
        );
        break;
      default:
        xe & 1 ? S(
          A,
          Y,
          Q,
          ie,
          ue,
          de,
          be,
          ve,
          _e
        ) : xe & 6 ? H(
          A,
          Y,
          Q,
          ie,
          ue,
          de,
          be,
          ve,
          _e
        ) : xe & 64 || xe & 128 ? pe.process(
          A,
          Y,
          Q,
          ie,
          ue,
          de,
          be,
          ve,
          _e,
          tt
        ) : W.NODE_ENV !== "production" && ae("Invalid VNode type:", pe, `(${typeof pe})`);
    }
    Be != null && ue && xc(Be, A && A.ref, de, Y || A, !Y);
  }, _ = (A, Y, Q, ie) => {
    if (A == null)
      s(
        Y.el = a(Y.children),
        Q,
        ie
      );
    else {
      const ue = Y.el = A.el;
      Y.children !== A.children && u(ue, Y.children);
    }
  }, b = (A, Y, Q, ie) => {
    A == null ? s(
      Y.el = l(Y.children || ""),
      Q,
      ie
    ) : Y.el = A.el;
  }, w = (A, Y, Q, ie) => {
    [A.el, A.anchor] = m(
      A.children,
      Y,
      Q,
      ie,
      A.el,
      A.anchor
    );
  }, y = (A, Y, Q, ie) => {
    if (Y.children !== A.children) {
      const ue = p(A.anchor);
      N(A), [Y.el, Y.anchor] = m(
        Y.children,
        Q,
        ue,
        ie
      );
    } else
      Y.el = A.el, Y.anchor = A.anchor;
  }, x = ({ el: A, anchor: Y }, Q, ie) => {
    let ue;
    for (; A && A !== Y; )
      ue = p(A), s(A, Q, ie), A = ue;
    s(Y, Q, ie);
  }, N = ({ el: A, anchor: Y }) => {
    let Q;
    for (; A && A !== Y; )
      Q = p(A), o(A), A = Q;
    o(Y);
  }, S = (A, Y, Q, ie, ue, de, be, ve, _e) => {
    Y.type === "svg" ? be = "svg" : Y.type === "math" && (be = "mathml"), A == null ? O(
      Y,
      Q,
      ie,
      ue,
      de,
      be,
      ve,
      _e
    ) : R(
      A,
      Y,
      ue,
      de,
      be,
      ve,
      _e
    );
  }, O = (A, Y, Q, ie, ue, de, be, ve) => {
    let _e, pe;
    const { props: Be, shapeFlag: xe, transition: Ae, dirs: Ke } = A;
    if (_e = A.el = r(
      A.type,
      de,
      Be && Be.is,
      Be
    ), xe & 8 ? d(_e, A.children) : xe & 16 && T(
      A.children,
      _e,
      null,
      ie,
      ue,
      Xp(A, de),
      be,
      ve
    ), Ke && wo(A, null, ie, "created"), $(_e, A, A.scopeId, be, ie), Be) {
      for (const X in Be)
        X !== "value" && !fr(X) && i(_e, X, null, Be[X], de, ie);
      "value" in Be && i(_e, "value", null, Be.value, de), (pe = Be.onVnodeBeforeMount) && ys(pe, ie, A);
    }
    W.NODE_ENV !== "production" && (ji(_e, "__vnode", A, !0), ji(_e, "__vueParentComponent", ie, !0)), Ke && wo(A, null, ie, "beforeMount");
    const ft = ME(ue, Ae);
    ft && Ae.beforeEnter(_e), s(_e, Y, Q), ((pe = Be && Be.onVnodeMounted) || ft || Ke) && $n(() => {
      pe && ys(pe, ie, A), ft && Ae.enter(_e), Ke && wo(A, null, ie, "mounted");
    }, ue);
  }, $ = (A, Y, Q, ie, ue) => {
    if (Q && h(A, Q), ie)
      for (let de = 0; de < ie.length; de++)
        h(A, ie[de]);
    if (ue) {
      let de = ue.subTree;
      if (W.NODE_ENV !== "production" && de.patchFlag > 0 && de.patchFlag & 2048 && (de = Mf(de.children) || de), Y === de || Ld(de.type) && (de.ssContent === Y || de.ssFallback === Y)) {
        const be = ue.vnode;
        $(
          A,
          be,
          be.scopeId,
          be.slotScopeIds,
          ue.parent
        );
      }
    }
  }, T = (A, Y, Q, ie, ue, de, be, ve, _e = 0) => {
    for (let pe = _e; pe < A.length; pe++) {
      const Be = A[pe] = ve ? Mr(A[pe]) : as(A[pe]);
      v(
        null,
        Be,
        Y,
        Q,
        ie,
        ue,
        de,
        be,
        ve
      );
    }
  }, R = (A, Y, Q, ie, ue, de, be) => {
    const ve = Y.el = A.el;
    W.NODE_ENV !== "production" && (ve.__vnode = Y);
    let { patchFlag: _e, dynamicChildren: pe, dirs: Be } = Y;
    _e |= A.patchFlag & 16;
    const xe = A.props || pt, Ae = Y.props || pt;
    let Ke;
    if (Q && pi(Q, !1), (Ke = Ae.onVnodeBeforeUpdate) && ys(Ke, Q, Y, A), Be && wo(Y, A, Q, "beforeUpdate"), Q && pi(Q, !0), W.NODE_ENV !== "production" && io && (_e = 0, be = !1, pe = null), (xe.innerHTML && Ae.innerHTML == null || xe.textContent && Ae.textContent == null) && d(ve, ""), pe ? (P(
      A.dynamicChildren,
      pe,
      ve,
      Q,
      ie,
      Xp(Y, ue),
      de
    ), W.NODE_ENV !== "production" && ec(A, Y)) : be || re(
      A,
      Y,
      ve,
      null,
      Q,
      ie,
      Xp(Y, ue),
      de,
      !1
    ), _e > 0) {
      if (_e & 16)
        M(ve, xe, Ae, Q, ue);
      else if (_e & 2 && xe.class !== Ae.class && i(ve, "class", null, Ae.class, ue), _e & 4 && i(ve, "style", xe.style, Ae.style, ue), _e & 8) {
        const ft = Y.dynamicProps;
        for (let X = 0; X < ft.length; X++) {
          const z = ft[X], Z = xe[z], ce = Ae[z];
          (ce !== Z || z === "value") && i(ve, z, Z, ce, ue, Q);
        }
      }
      _e & 1 && A.children !== Y.children && d(ve, Y.children);
    } else !be && pe == null && M(ve, xe, Ae, Q, ue);
    ((Ke = Ae.onVnodeUpdated) || Be) && $n(() => {
      Ke && ys(Ke, Q, Y, A), Be && wo(Y, A, Q, "updated");
    }, ie);
  }, P = (A, Y, Q, ie, ue, de, be) => {
    for (let ve = 0; ve < Y.length; ve++) {
      const _e = A[ve], pe = Y[ve], Be = (
        // oldVNode may be an errored async setup() component inside Suspense
        // which will not have a mounted element
        _e.el && // - In the case of a Fragment, we need to provide the actual parent
        // of the Fragment itself so it can move its children.
        (_e.type === G || // - In the case of different nodes, there is going to be a replacement
        // which also requires the correct parent container
        !oo(_e, pe) || // - In the case of a component, it could contain anything.
        _e.shapeFlag & 70) ? f(_e.el) : (
          // In other cases, the parent container is not actually used so we
          // just pass the block element here to avoid a DOM parentNode call.
          Q
        )
      );
      v(
        _e,
        pe,
        Be,
        null,
        ie,
        ue,
        de,
        be,
        !0
      );
    }
  }, M = (A, Y, Q, ie, ue) => {
    if (Y !== Q) {
      if (Y !== pt)
        for (const de in Y)
          !fr(de) && !(de in Q) && i(
            A,
            de,
            Y[de],
            null,
            ue,
            ie
          );
      for (const de in Q) {
        if (fr(de)) continue;
        const be = Q[de], ve = Y[de];
        be !== ve && de !== "value" && i(A, de, ve, be, ue, ie);
      }
      "value" in Q && i(A, "value", Y.value, Q.value, ue);
    }
  }, U = (A, Y, Q, ie, ue, de, be, ve, _e) => {
    const pe = Y.el = A ? A.el : a(""), Be = Y.anchor = A ? A.anchor : a("");
    let { patchFlag: xe, dynamicChildren: Ae, slotScopeIds: Ke } = Y;
    W.NODE_ENV !== "production" && // #5523 dev root fragment may inherit directives
    (io || xe & 2048) && (xe = 0, _e = !1, Ae = null), Ke && (ve = ve ? ve.concat(Ke) : Ke), A == null ? (s(pe, Q, ie), s(Be, Q, ie), T(
      // #10007
      // such fragment like `<></>` will be compiled into
      // a fragment which doesn't have a children.
      // In this case fallback to an empty array
      Y.children || [],
      Q,
      Be,
      ue,
      de,
      be,
      ve,
      _e
    )) : xe > 0 && xe & 64 && Ae && // #2715 the previous fragment could've been a BAILed one as a result
    // of renderSlot() with no valid children
    A.dynamicChildren ? (P(
      A.dynamicChildren,
      Ae,
      Q,
      ue,
      de,
      be,
      ve
    ), W.NODE_ENV !== "production" ? ec(A, Y) : (
      // #2080 if the stable fragment has a key, it's a <template v-for> that may
      //  get moved around. Make sure all root level vnodes inherit el.
      // #2134 or if it's a component root, it may also get moved around
      // as the component is being moved.
      (Y.key != null || ue && Y === ue.subTree) && ec(
        A,
        Y,
        !0
        /* shallow */
      )
    )) : re(
      A,
      Y,
      Q,
      Be,
      ue,
      de,
      be,
      ve,
      _e
    );
  }, H = (A, Y, Q, ie, ue, de, be, ve, _e) => {
    Y.slotScopeIds = ve, A == null ? Y.shapeFlag & 512 ? ue.ctx.activate(
      Y,
      Q,
      ie,
      be,
      _e
    ) : j(
      Y,
      Q,
      ie,
      ue,
      de,
      be,
      _e
    ) : V(A, Y, _e);
  }, j = (A, Y, Q, ie, ue, de, be) => {
    const ve = A.component = JE(
      A,
      ie,
      ue
    );
    if (W.NODE_ENV !== "production" && ve.type.__hmrId && gO(ve), W.NODE_ENV !== "production" && (Ia(A), Qo(ve, "mount")), ll(A) && (ve.ctx.renderer = tt), W.NODE_ENV !== "production" && Qo(ve, "init"), ZE(ve, !1, be), W.NODE_ENV !== "production" && Zo(ve, "init"), ve.asyncDep) {
      if (W.NODE_ENV !== "production" && io && (A.el = null), ue && ue.registerDep(ve, K, be), !A.el) {
        const _e = ve.subTree = D(Zt);
        b(null, _e, Y, Q);
      }
    } else
      K(
        ve,
        A,
        Y,
        Q,
        ue,
        de,
        be
      );
    W.NODE_ENV !== "production" && (Aa(), Zo(ve, "mount"));
  }, V = (A, Y, Q) => {
    const ie = Y.component = A.component;
    if (HT(A, Y, Q))
      if (ie.asyncDep && !ie.asyncResolved) {
        W.NODE_ENV !== "production" && Ia(Y), q(ie, Y, Q), W.NODE_ENV !== "production" && Aa();
        return;
      } else
        ie.next = Y, ie.update();
    else
      Y.el = A.el, ie.vnode = Y;
  }, K = (A, Y, Q, ie, ue, de, be) => {
    const ve = () => {
      if (A.isMounted) {
        let { next: xe, bu: Ae, u: Ke, parent: ft, vnode: X } = A;
        {
          const Pe = PE(A);
          if (Pe) {
            xe && (xe.el = X.el, q(A, xe, be)), Pe.asyncDep.then(() => {
              A.isUnmounted || ve();
            });
            return;
          }
        }
        let z = xe, Z;
        W.NODE_ENV !== "production" && Ia(xe || A.vnode), pi(A, !1), xe ? (xe.el = X.el, q(A, xe, be)) : xe = X, Ae && or(Ae), (Z = xe.props && xe.props.onVnodeBeforeUpdate) && ys(Z, ft, xe, X), pi(A, !0), W.NODE_ENV !== "production" && Qo(A, "render");
        const ce = ed(A);
        W.NODE_ENV !== "production" && Zo(A, "render");
        const Te = A.subTree;
        A.subTree = ce, W.NODE_ENV !== "production" && Qo(A, "patch"), v(
          Te,
          ce,
          // parent may have changed if it's in a teleport
          f(Te.el),
          // anchor may have changed if it's in a fragment
          we(Te),
          A,
          ue,
          de
        ), W.NODE_ENV !== "production" && Zo(A, "patch"), xe.el = ce.el, z === null && Pf(A, ce.el), Ke && $n(Ke, ue), (Z = xe.props && xe.props.onVnodeUpdated) && $n(
          () => ys(Z, ft, xe, X),
          ue
        ), W.NODE_ENV !== "production" && J1(A), W.NODE_ENV !== "production" && Aa();
      } else {
        let xe;
        const { el: Ae, props: Ke } = Y, { bm: ft, m: X, parent: z, root: Z, type: ce } = A, Te = Xr(Y);
        if (pi(A, !1), ft && or(ft), !Te && (xe = Ke && Ke.onVnodeBeforeMount) && ys(xe, z, Y), pi(A, !0), Ae && Fe) {
          const Pe = () => {
            W.NODE_ENV !== "production" && Qo(A, "render"), A.subTree = ed(A), W.NODE_ENV !== "production" && Zo(A, "render"), W.NODE_ENV !== "production" && Qo(A, "hydrate"), Fe(
              Ae,
              A.subTree,
              A,
              ue,
              null
            ), W.NODE_ENV !== "production" && Zo(A, "hydrate");
          };
          Te && ce.__asyncHydrate ? ce.__asyncHydrate(
            Ae,
            A,
            Pe
          ) : Pe();
        } else {
          Z.ce && Z.ce._injectChildStyle(ce), W.NODE_ENV !== "production" && Qo(A, "render");
          const Pe = A.subTree = ed(A);
          W.NODE_ENV !== "production" && Zo(A, "render"), W.NODE_ENV !== "production" && Qo(A, "patch"), v(
            null,
            Pe,
            Q,
            ie,
            A,
            ue,
            de
          ), W.NODE_ENV !== "production" && Zo(A, "patch"), Y.el = Pe.el;
        }
        if (X && $n(X, ue), !Te && (xe = Ke && Ke.onVnodeMounted)) {
          const Pe = Y;
          $n(
            () => ys(xe, z, Pe),
            ue
          );
        }
        (Y.shapeFlag & 256 || z && Xr(z.vnode) && z.vnode.shapeFlag & 256) && A.a && $n(A.a, ue), A.isMounted = !0, W.NODE_ENV !== "production" && Hh(A), Y = Q = ie = null;
      }
    };
    A.scope.on();
    const _e = A.effect = new yc(ve);
    A.scope.off();
    const pe = A.update = _e.run.bind(_e), Be = A.job = _e.runIfDirty.bind(_e);
    Be.i = A, Be.id = A.uid, _e.scheduler = () => $f(Be), pi(A, !0), W.NODE_ENV !== "production" && (_e.onTrack = A.rtc ? (xe) => or(A.rtc, xe) : void 0, _e.onTrigger = A.rtg ? (xe) => or(A.rtg, xe) : void 0), pe();
  }, q = (A, Y, Q) => {
    Y.component = A;
    const ie = A.vnode.props;
    A.vnode = Y, A.next = null, NT(A, Y.props, ie, Q), MT(A, Y.children, Q), br(), m_(A), Er();
  }, re = (A, Y, Q, ie, ue, de, be, ve, _e = !1) => {
    const pe = A && A.children, Be = A ? A.shapeFlag : 0, xe = Y.children, { patchFlag: Ae, shapeFlag: Ke } = Y;
    if (Ae > 0) {
      if (Ae & 128) {
        ze(
          pe,
          xe,
          Q,
          ie,
          ue,
          de,
          be,
          ve,
          _e
        );
        return;
      } else if (Ae & 256) {
        ke(
          pe,
          xe,
          Q,
          ie,
          ue,
          de,
          be,
          ve,
          _e
        );
        return;
      }
    }
    Ke & 8 ? (Be & 16 && J(pe, ue, de), xe !== pe && d(Q, xe)) : Be & 16 ? Ke & 16 ? ze(
      pe,
      xe,
      Q,
      ie,
      ue,
      de,
      be,
      ve,
      _e
    ) : J(pe, ue, de, !0) : (Be & 8 && d(Q, ""), Ke & 16 && T(
      xe,
      Q,
      ie,
      ue,
      de,
      be,
      ve,
      _e
    ));
  }, ke = (A, Y, Q, ie, ue, de, be, ve, _e) => {
    A = A || Di, Y = Y || Di;
    const pe = A.length, Be = Y.length, xe = Math.min(pe, Be);
    let Ae;
    for (Ae = 0; Ae < xe; Ae++) {
      const Ke = Y[Ae] = _e ? Mr(Y[Ae]) : as(Y[Ae]);
      v(
        A[Ae],
        Ke,
        Q,
        null,
        ue,
        de,
        be,
        ve,
        _e
      );
    }
    pe > Be ? J(
      A,
      ue,
      de,
      !0,
      !1,
      xe
    ) : T(
      Y,
      Q,
      ie,
      ue,
      de,
      be,
      ve,
      _e,
      xe
    );
  }, ze = (A, Y, Q, ie, ue, de, be, ve, _e) => {
    let pe = 0;
    const Be = Y.length;
    let xe = A.length - 1, Ae = Be - 1;
    for (; pe <= xe && pe <= Ae; ) {
      const Ke = A[pe], ft = Y[pe] = _e ? Mr(Y[pe]) : as(Y[pe]);
      if (oo(Ke, ft))
        v(
          Ke,
          ft,
          Q,
          null,
          ue,
          de,
          be,
          ve,
          _e
        );
      else
        break;
      pe++;
    }
    for (; pe <= xe && pe <= Ae; ) {
      const Ke = A[xe], ft = Y[Ae] = _e ? Mr(Y[Ae]) : as(Y[Ae]);
      if (oo(Ke, ft))
        v(
          Ke,
          ft,
          Q,
          null,
          ue,
          de,
          be,
          ve,
          _e
        );
      else
        break;
      xe--, Ae--;
    }
    if (pe > xe) {
      if (pe <= Ae) {
        const Ke = Ae + 1, ft = Ke < Be ? Y[Ke].el : ie;
        for (; pe <= Ae; )
          v(
            null,
            Y[pe] = _e ? Mr(Y[pe]) : as(Y[pe]),
            Q,
            ft,
            ue,
            de,
            be,
            ve,
            _e
          ), pe++;
      }
    } else if (pe > Ae)
      for (; pe <= xe; )
        st(A[pe], ue, de, !0), pe++;
    else {
      const Ke = pe, ft = pe, X = /* @__PURE__ */ new Map();
      for (pe = ft; pe <= Ae; pe++) {
        const gt = Y[pe] = _e ? Mr(Y[pe]) : as(Y[pe]);
        gt.key != null && (W.NODE_ENV !== "production" && X.has(gt.key) && ae(
          "Duplicate keys found during update:",
          JSON.stringify(gt.key),
          "Make sure keys are unique."
        ), X.set(gt.key, pe));
      }
      let z, Z = 0;
      const ce = Ae - ft + 1;
      let Te = !1, Pe = 0;
      const et = new Array(ce);
      for (pe = 0; pe < ce; pe++) et[pe] = 0;
      for (pe = Ke; pe <= xe; pe++) {
        const gt = A[pe];
        if (Z >= ce) {
          st(gt, ue, de, !0);
          continue;
        }
        let je;
        if (gt.key != null)
          je = X.get(gt.key);
        else
          for (z = ft; z <= Ae; z++)
            if (et[z - ft] === 0 && oo(gt, Y[z])) {
              je = z;
              break;
            }
        je === void 0 ? st(gt, ue, de, !0) : (et[je - ft] = pe + 1, je >= Pe ? Pe = je : Te = !0, v(
          gt,
          Y[je],
          Q,
          null,
          ue,
          de,
          be,
          ve,
          _e
        ), Z++);
      }
      const Nt = Te ? LT(et) : Di;
      for (z = Nt.length - 1, pe = ce - 1; pe >= 0; pe--) {
        const gt = ft + pe, je = Y[gt], Me = gt + 1 < Be ? Y[gt + 1].el : ie;
        et[pe] === 0 ? v(
          null,
          je,
          Q,
          Me,
          ue,
          de,
          be,
          ve,
          _e
        ) : Te && (z < 0 || pe !== Nt[z] ? We(je, Q, Me, 2) : z--);
      }
    }
  }, We = (A, Y, Q, ie, ue = null) => {
    const { el: de, type: be, transition: ve, children: _e, shapeFlag: pe } = A;
    if (pe & 6) {
      We(A.component.subTree, Y, Q, ie);
      return;
    }
    if (pe & 128) {
      A.suspense.move(Y, Q, ie);
      return;
    }
    if (pe & 64) {
      be.move(A, Y, Q, tt);
      return;
    }
    if (be === G) {
      s(de, Y, Q);
      for (let xe = 0; xe < _e.length; xe++)
        We(_e[xe], Y, Q, ie);
      s(A.anchor, Y, Q);
      return;
    }
    if (be === qr) {
      x(A, Y, Q);
      return;
    }
    if (ie !== 2 && pe & 1 && ve)
      if (ie === 0)
        ve.beforeEnter(de), s(de, Y, Q), $n(() => ve.enter(de), ue);
      else {
        const { leave: xe, delayLeave: Ae, afterLeave: Ke } = ve, ft = () => s(de, Y, Q), X = () => {
          xe(de, () => {
            ft(), Ke && Ke();
          });
        };
        Ae ? Ae(de, ft, X) : X();
      }
    else
      s(de, Y, Q);
  }, st = (A, Y, Q, ie = !1, ue = !1) => {
    const {
      type: de,
      props: be,
      ref: ve,
      children: _e,
      dynamicChildren: pe,
      shapeFlag: Be,
      patchFlag: xe,
      dirs: Ae,
      cacheIndex: Ke
    } = A;
    if (xe === -2 && (ue = !1), ve != null && xc(ve, null, Q, A, !0), Ke != null && (Y.renderCache[Ke] = void 0), Be & 256) {
      Y.ctx.deactivate(A);
      return;
    }
    const ft = Be & 1 && Ae, X = !Xr(A);
    let z;
    if (X && (z = be && be.onVnodeBeforeUnmount) && ys(z, Y, A), Be & 6)
      Et(A.component, Q, ie);
    else {
      if (Be & 128) {
        A.suspense.unmount(Q, ie);
        return;
      }
      ft && wo(A, null, Y, "beforeUnmount"), Be & 64 ? A.type.remove(
        A,
        Y,
        Q,
        tt,
        ie
      ) : pe && // #5154
      // when v-once is used inside a block, setBlockTracking(-1) marks the
      // parent block with hasOnce: true
      // so that it doesn't take the fast path during unmount - otherwise
      // components nested in v-once are never unmounted.
      !pe.hasOnce && // #1153: fast path should not be taken for non-stable (v-for) fragments
      (de !== G || xe > 0 && xe & 64) ? J(
        pe,
        Y,
        Q,
        !1,
        !0
      ) : (de === G && xe & 384 || !ue && Be & 16) && J(_e, Y, Q), ie && Lt(A);
    }
    (X && (z = be && be.onVnodeUnmounted) || ft) && $n(() => {
      z && ys(z, Y, A), ft && wo(A, null, Y, "unmounted");
    }, Q);
  }, Lt = (A) => {
    const { type: Y, el: Q, anchor: ie, transition: ue } = A;
    if (Y === G) {
      W.NODE_ENV !== "production" && A.patchFlag > 0 && A.patchFlag & 2048 && ue && !ue.persisted ? A.children.forEach((be) => {
        be.type === Zt ? o(be.el) : Lt(be);
      }) : Yt(Q, ie);
      return;
    }
    if (Y === qr) {
      N(A);
      return;
    }
    const de = () => {
      o(Q), ue && !ue.persisted && ue.afterLeave && ue.afterLeave();
    };
    if (A.shapeFlag & 1 && ue && !ue.persisted) {
      const { leave: be, delayLeave: ve } = ue, _e = () => be(Q, de);
      ve ? ve(A.el, de, _e) : _e();
    } else
      de();
  }, Yt = (A, Y) => {
    let Q;
    for (; A !== Y; )
      Q = p(A), o(A), A = Q;
    o(Y);
  }, Et = (A, Y, Q) => {
    W.NODE_ENV !== "production" && A.type.__hmrId && _O(A);
    const { bum: ie, scope: ue, job: de, subTree: be, um: ve, m: _e, a: pe } = A;
    Md(_e), Md(pe), ie && or(ie), ue.stop(), de && (de.flags |= 8, st(be, A, Y, Q)), ve && $n(ve, Y), $n(() => {
      A.isUnmounted = !0;
    }, Y), Y && Y.pendingBranch && !Y.isUnmounted && A.asyncDep && !A.asyncResolved && A.suspenseId === Y.pendingId && (Y.deps--, Y.deps === 0 && Y.resolve()), W.NODE_ENV !== "production" && xO(A);
  }, J = (A, Y, Q, ie = !1, ue = !1, de = 0) => {
    for (let be = de; be < A.length; be++)
      st(A[be], Y, Q, ie, ue);
  }, we = (A) => {
    if (A.shapeFlag & 6)
      return we(A.component.subTree);
    if (A.shapeFlag & 128)
      return A.suspense.next();
    const Y = p(A.anchor || A.el), Q = Y && Y[eE];
    return Q ? p(Q) : Y;
  };
  let Ee = !1;
  const De = (A, Y, Q) => {
    A == null ? Y._vnode && st(Y._vnode, null, null, !0) : v(
      Y._vnode || null,
      A,
      Y,
      null,
      null,
      null,
      Q
    ), Y._vnode = A, Ee || (Ee = !0, m_(), kd(), Ee = !1);
  }, tt = {
    p: v,
    um: st,
    m: We,
    r: Lt,
    mt: j,
    mc: T,
    pc: re,
    pbc: P,
    n: we,
    o: e
  };
  let Tt, Fe;
  return t && ([Tt, Fe] = t(
    tt
  )), {
    render: De,
    hydrate: Tt,
    createApp: wT(De, Tt)
  };
}
function Xp({ type: e, props: t }, n) {
  return n === "svg" && e === "foreignObject" || n === "mathml" && e === "annotation-xml" && t && t.encoding && t.encoding.includes("html") ? void 0 : n;
}
function pi({ effect: e, job: t }, n) {
  n ? (e.flags |= 32, t.flags |= 4) : (e.flags &= -33, t.flags &= -5);
}
function ME(e, t) {
  return (!e || e && !e.pendingBranch) && t && !t.persisted;
}
function ec(e, t, n = !1) {
  const s = e.children, o = t.children;
  if (Ce(s) && Ce(o))
    for (let i = 0; i < s.length; i++) {
      const r = s[i];
      let a = o[i];
      a.shapeFlag & 1 && !a.dynamicChildren && ((a.patchFlag <= 0 || a.patchFlag === 32) && (a = o[i] = Mr(o[i]), a.el = r.el), !n && a.patchFlag !== -2 && ec(r, a)), a.type === To && (a.el = r.el), W.NODE_ENV !== "production" && a.type === Zt && !a.el && (a.el = r.el);
    }
}
function LT(e) {
  const t = e.slice(), n = [0];
  let s, o, i, r, a;
  const l = e.length;
  for (s = 0; s < l; s++) {
    const u = e[s];
    if (u !== 0) {
      if (o = n[n.length - 1], e[o] < u) {
        t[s] = o, n.push(s);
        continue;
      }
      for (i = 0, r = n.length - 1; i < r; )
        a = i + r >> 1, e[n[a]] < u ? i = a + 1 : r = a;
      u < e[n[i]] && (i > 0 && (t[s] = n[i - 1]), n[i] = s);
    }
  }
  for (i = n.length, r = n[i - 1]; i-- > 0; )
    n[i] = r, r = t[r];
  return n;
}
function PE(e) {
  const t = e.subTree.component;
  if (t)
    return t.asyncDep && !t.asyncResolved ? t : PE(t);
}
function Md(e) {
  if (e)
    for (let t = 0; t < e.length; t++)
      e[t].flags |= 8;
}
const LE = Symbol.for("v-scx"), VE = () => {
  {
    const e = $e(LE);
    return e || W.NODE_ENV !== "production" && ae(
      "Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."
    ), e;
  }
};
function Ft(e, t) {
  return zc(e, null, t);
}
function VT(e, t) {
  return zc(
    e,
    null,
    W.NODE_ENV !== "production" ? it({}, t, { flush: "post" }) : { flush: "post" }
  );
}
function FE(e, t) {
  return zc(
    e,
    null,
    W.NODE_ENV !== "production" ? it({}, t, { flush: "sync" }) : { flush: "sync" }
  );
}
function nt(e, t, n) {
  return W.NODE_ENV !== "production" && !Ue(t) && ae(
    "`watch(fn, options?)` signature has been moved to a separate API. Use `watchEffect(fn, options?)` instead. `watch` now only supports `watch(source, cb, options?) signature."
  ), zc(e, t, n);
}
function zc(e, t, n = pt) {
  const { immediate: s, deep: o, flush: i, once: r } = n;
  W.NODE_ENV !== "production" && !t && (s !== void 0 && ae(
    'watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'
  ), o !== void 0 && ae(
    'watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'
  ), r !== void 0 && ae(
    'watch() "once" option is only respected when using the watch(source, callback, options?) signature.'
  ));
  const a = it({}, n);
  W.NODE_ENV !== "production" && (a.onWarn = ae);
  const l = t && s || !t && i !== "post";
  let u;
  if (Ga) {
    if (i === "sync") {
      const h = VE();
      u = h.__watcherHandles || (h.__watcherHandles = []);
    } else if (!l) {
      const h = () => {
      };
      return h.stop = Jt, h.resume = Jt, h.pause = Jt, h;
    }
  }
  const d = yn;
  a.call = (h, m, v) => Ys(h, d, m, v);
  let f = !1;
  i === "post" ? a.scheduler = (h) => {
    $n(h, d && d.suspense);
  } : i !== "sync" && (f = !0, a.scheduler = (h, m) => {
    m ? h() : $f(h);
  }), a.augmentJob = (h) => {
    t && (h.flags |= 4), f && (h.flags |= 2, d && (h.id = d.uid, h.i = d));
  };
  const p = lO(e, t, a);
  return Ga && (u ? u.push(p) : l && p()), p;
}
function FT(e, t, n) {
  const s = this.proxy, o = Ge(e) ? e.includes(".") ? UE(s, e) : () => s[e] : e.bind(s, s);
  let i;
  Ue(t) ? i = t : (i = t.handler, n = t);
  const r = Wi(this), a = zc(o, i.bind(s), n);
  return r(), a;
}
function UE(e, t) {
  const n = t.split(".");
  return () => {
    let s = e;
    for (let o = 0; o < n.length && s; o++)
      s = s[n[o]];
    return s;
  };
}
function At(e, t, n = pt) {
  const s = cn();
  if (W.NODE_ENV !== "production" && !s)
    return ae("useModel() called without active instance."), I();
  const o = Gt(t);
  if (W.NODE_ENV !== "production" && !s.propsOptions[0][o])
    return ae(`useModel() called with prop "${t}" which is not declared.`), I();
  const i = Un(t), r = jE(e, o), a = H1((l, u) => {
    let d, f = pt, p;
    return FE(() => {
      const h = e[o];
      Wn(d, h) && (d = h, u());
    }), {
      get() {
        return l(), n.get ? n.get(d) : d;
      },
      set(h) {
        const m = n.set ? n.set(h) : h;
        if (!Wn(m, d) && !(f !== pt && Wn(h, f)))
          return;
        const v = s.vnode.props;
        v && // check if parent has passed v-model
        (t in v || o in v || i in v) && (`onUpdate:${t}` in v || `onUpdate:${o}` in v || `onUpdate:${i}` in v) || (d = h, u()), s.emit(`update:${t}`, m), Wn(h, m) && Wn(h, f) && !Wn(m, p) && u(), f = h, p = m;
      }
    };
  });
  return a[Symbol.iterator] = () => {
    let l = 0;
    return {
      next() {
        return l < 2 ? { value: l++ ? r || pt : a, done: !1 } : { done: !0 };
      }
    };
  }, a;
}
const jE = (e, t) => t === "modelValue" || t === "model-value" ? e.modelModifiers : e[`${t}Modifiers`] || e[`${Gt(t)}Modifiers`] || e[`${Un(t)}Modifiers`];
function UT(e, t, ...n) {
  if (e.isUnmounted) return;
  const s = e.vnode.props || pt;
  if (W.NODE_ENV !== "production") {
    const {
      emitsOptions: d,
      propsOptions: [f]
    } = e;
    if (d)
      if (!(t in d))
        (!f || !(to(Gt(t)) in f)) && ae(
          `Component emitted event "${t}" but it is neither declared in the emits option nor as an "${to(Gt(t))}" prop.`
        );
      else {
        const p = d[t];
        Ue(p) && (p(...n) || ae(
          `Invalid event arguments: event validation failed for event "${t}".`
        ));
      }
  }
  let o = n;
  const i = t.startsWith("update:"), r = i && jE(s, t.slice(7));
  if (r && (r.trim && (o = n.map((d) => Ge(d) ? d.trim() : d)), r.number && (o = n.map(gc))), W.NODE_ENV !== "production" && OO(e, t, o), W.NODE_ENV !== "production") {
    const d = t.toLowerCase();
    d !== t && s[to(d)] && ae(
      `Event "${d}" is emitted in component ${Lf(
        e,
        e.type
      )} but the handler is registered for "${t}". Note that HTML attributes are case-insensitive and you cannot use v-on to listen to camelCase events when using in-DOM templates. You should probably use "${Un(
        t
      )}" instead of "${t}".`
    );
  }
  let a, l = s[a = to(t)] || // also try camelCase event handler (#2249)
  s[a = to(Gt(t))];
  !l && i && (l = s[a = to(Un(t))]), l && Ys(
    l,
    e,
    6,
    o
  );
  const u = s[a + "Once"];
  if (u) {
    if (!e.emitted)
      e.emitted = {};
    else if (e.emitted[a])
      return;
    e.emitted[a] = !0, Ys(
      u,
      e,
      6,
      o
    );
  }
}
function BE(e, t, n = !1) {
  const s = t.emitsCache, o = s.get(e);
  if (o !== void 0)
    return o;
  const i = e.emits;
  let r = {}, a = !1;
  if (!Ue(e)) {
    const l = (u) => {
      const d = BE(u, t, !0);
      d && (a = !0, it(r, d));
    };
    !n && t.mixins.length && t.mixins.forEach(l), e.extends && l(e.extends), e.mixins && e.mixins.forEach(l);
  }
  return !i && !a ? (mt(e) && s.set(e, null), null) : (Ce(i) ? i.forEach((l) => r[l] = null) : it(r, i), mt(e) && s.set(e, r), r);
}
function Af(e, t) {
  return !e || !Do(t) ? !1 : (t = t.slice(2).replace(/Once$/, ""), St(e, t[0].toLowerCase() + t.slice(1)) || St(e, Un(t)) || St(e, t));
}
let qh = !1;
function Pd() {
  qh = !0;
}
function ed(e) {
  const {
    type: t,
    vnode: n,
    proxy: s,
    withProxy: o,
    propsOptions: [i],
    slots: r,
    attrs: a,
    emit: l,
    render: u,
    renderCache: d,
    props: f,
    data: p,
    setupState: h,
    ctx: m,
    inheritAttrs: v
  } = e, _ = Sc(e);
  let b, w;
  W.NODE_ENV !== "production" && (qh = !1);
  try {
    if (n.shapeFlag & 4) {
      const N = o || s, S = W.NODE_ENV !== "production" && h.__isScriptSetup ? new Proxy(N, {
        get(O, $, T) {
          return ae(
            `Property '${String(
              $
            )}' was accessed via 'this'. Avoid using 'this' in templates.`
          ), Reflect.get(O, $, T);
        }
      }) : N;
      b = as(
        u.call(
          S,
          N,
          d,
          W.NODE_ENV !== "production" ? ro(f) : f,
          h,
          p,
          m
        )
      ), w = a;
    } else {
      const N = t;
      W.NODE_ENV !== "production" && a === f && Pd(), b = as(
        N.length > 1 ? N(
          W.NODE_ENV !== "production" ? ro(f) : f,
          W.NODE_ENV !== "production" ? {
            get attrs() {
              return Pd(), ro(a);
            },
            slots: r,
            emit: l
          } : { attrs: a, slots: r, emit: l }
        ) : N(
          W.NODE_ENV !== "production" ? ro(f) : f,
          null
        )
      ), w = t.props ? a : jT(a);
    }
  } catch (N) {
    tc.length = 0, ri(N, e, 1), b = D(Zt);
  }
  let y = b, x;
  if (W.NODE_ENV !== "production" && b.patchFlag > 0 && b.patchFlag & 2048 && ([y, x] = HE(b)), w && v !== !1) {
    const N = Object.keys(w), { shapeFlag: S } = y;
    if (N.length) {
      if (S & 7)
        i && N.some(vc) && (w = BT(
          w,
          i
        )), y = Ws(y, w, !1, !0);
      else if (W.NODE_ENV !== "production" && !qh && y.type !== Zt) {
        const O = Object.keys(a), $ = [], T = [];
        for (let R = 0, P = O.length; R < P; R++) {
          const M = O[R];
          Do(M) ? vc(M) || $.push(M[2].toLowerCase() + M.slice(3)) : T.push(M);
        }
        T.length && ae(
          `Extraneous non-props attributes (${T.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text or teleport root nodes.`
        ), $.length && ae(
          `Extraneous non-emits event listeners (${$.join(", ")}) were passed to component but could not be automatically inherited because component renders fragment or text root nodes. If the listener is intended to be a component custom event listener only, declare it using the "emits" option.`
        );
      }
    }
  }
  return n.dirs && (W.NODE_ENV !== "production" && !R_(y) && ae(
    "Runtime directive used on component with non-element root node. The directives will not function as intended."
  ), y = Ws(y, null, !1, !0), y.dirs = y.dirs ? y.dirs.concat(n.dirs) : n.dirs), n.transition && (W.NODE_ENV !== "production" && !R_(y) && ae(
    "Component inside <Transition> renders non-element root node that cannot be animated."
  ), _r(y, n.transition)), W.NODE_ENV !== "production" && x ? x(y) : b = y, Sc(_), b;
}
const HE = (e) => {
  const t = e.children, n = e.dynamicChildren, s = Mf(t, !1);
  if (s) {
    if (W.NODE_ENV !== "production" && s.patchFlag > 0 && s.patchFlag & 2048)
      return HE(s);
  } else return [e, void 0];
  const o = t.indexOf(s), i = n ? n.indexOf(s) : -1, r = (a) => {
    t[o] = a, n && (i > -1 ? n[i] = a : a.patchFlag > 0 && (e.dynamicChildren = [...n, a]));
  };
  return [as(s), r];
};
function Mf(e, t = !0) {
  let n;
  for (let s = 0; s < e.length; s++) {
    const o = e[s];
    if (Ao(o)) {
      if (o.type !== Zt || o.children === "v-if") {
        if (n)
          return;
        if (n = o, W.NODE_ENV !== "production" && t && n.patchFlag > 0 && n.patchFlag & 2048)
          return Mf(n.children);
      }
    } else
      return;
  }
  return n;
}
const jT = (e) => {
  let t;
  for (const n in e)
    (n === "class" || n === "style" || Do(n)) && ((t || (t = {}))[n] = e[n]);
  return t;
}, BT = (e, t) => {
  const n = {};
  for (const s in e)
    (!vc(s) || !(s.slice(9) in t)) && (n[s] = e[s]);
  return n;
}, R_ = (e) => e.shapeFlag & 7 || e.type === Zt;
function HT(e, t, n) {
  const { props: s, children: o, component: i } = e, { props: r, children: a, patchFlag: l } = t, u = i.emitsOptions;
  if (W.NODE_ENV !== "production" && (o || a) && io || t.dirs || t.transition)
    return !0;
  if (n && l >= 0) {
    if (l & 1024)
      return !0;
    if (l & 16)
      return s ? I_(s, r, u) : !!r;
    if (l & 8) {
      const d = t.dynamicProps;
      for (let f = 0; f < d.length; f++) {
        const p = d[f];
        if (r[p] !== s[p] && !Af(u, p))
          return !0;
      }
    }
  } else
    return (o || a) && (!a || !a.$stable) ? !0 : s === r ? !1 : s ? r ? I_(s, r, u) : !0 : !!r;
  return !1;
}
function I_(e, t, n) {
  const s = Object.keys(t);
  if (s.length !== Object.keys(e).length)
    return !0;
  for (let o = 0; o < s.length; o++) {
    const i = s[o];
    if (t[i] !== e[i] && !Af(n, i))
      return !0;
  }
  return !1;
}
function Pf({ vnode: e, parent: t }, n) {
  for (; t; ) {
    const s = t.subTree;
    if (s.suspense && s.suspense.activeBranch === e && (s.el = e.el), s === e)
      (e = t.vnode).el = n, t = t.parent;
    else
      break;
  }
}
const Ld = (e) => e.__isSuspense;
let Jh = 0;
const YT = {
  name: "Suspense",
  // In order to make Suspense tree-shakable, we need to avoid importing it
  // directly in the renderer. The renderer checks for the __isSuspense flag
  // on a vnode's type and calls the `process` method, passing in renderer
  // internals.
  __isSuspense: !0,
  process(e, t, n, s, o, i, r, a, l, u) {
    if (e == null)
      GT(
        t,
        n,
        s,
        o,
        i,
        r,
        a,
        l,
        u
      );
    else {
      if (i && i.deps > 0 && !e.suspense.isInFallback) {
        t.suspense = e.suspense, t.suspense.vnode = t, t.el = e.el;
        return;
      }
      zT(
        e,
        t,
        n,
        s,
        o,
        r,
        a,
        l,
        u
      );
    }
  },
  hydrate: KT,
  normalize: XT
}, WT = YT;
function Cc(e, t) {
  const n = e.props && e.props[t];
  Ue(n) && n();
}
function GT(e, t, n, s, o, i, r, a, l) {
  const {
    p: u,
    o: { createElement: d }
  } = l, f = d("div"), p = e.suspense = YE(
    e,
    o,
    s,
    t,
    f,
    n,
    i,
    r,
    a,
    l
  );
  u(
    null,
    p.pendingBranch = e.ssContent,
    f,
    null,
    s,
    p,
    i,
    r
  ), p.deps > 0 ? (Cc(e, "onPending"), Cc(e, "onFallback"), u(
    null,
    e.ssFallback,
    t,
    n,
    s,
    null,
    // fallback tree will not have suspense context
    i,
    r
  ), Pa(p, e.ssFallback)) : p.resolve(!1, !0);
}
function zT(e, t, n, s, o, i, r, a, { p: l, um: u, o: { createElement: d } }) {
  const f = t.suspense = e.suspense;
  f.vnode = t, t.el = e.el;
  const p = t.ssContent, h = t.ssFallback, { activeBranch: m, pendingBranch: v, isInFallback: _, isHydrating: b } = f;
  if (v)
    f.pendingBranch = p, oo(p, v) ? (l(
      v,
      p,
      f.hiddenContainer,
      null,
      o,
      f,
      i,
      r,
      a
    ), f.deps <= 0 ? f.resolve() : _ && (b || (l(
      m,
      h,
      n,
      s,
      o,
      null,
      // fallback tree will not have suspense context
      i,
      r,
      a
    ), Pa(f, h)))) : (f.pendingId = Jh++, b ? (f.isHydrating = !1, f.activeBranch = v) : u(v, o, f), f.deps = 0, f.effects.length = 0, f.hiddenContainer = d("div"), _ ? (l(
      null,
      p,
      f.hiddenContainer,
      null,
      o,
      f,
      i,
      r,
      a
    ), f.deps <= 0 ? f.resolve() : (l(
      m,
      h,
      n,
      s,
      o,
      null,
      // fallback tree will not have suspense context
      i,
      r,
      a
    ), Pa(f, h))) : m && oo(p, m) ? (l(
      m,
      p,
      n,
      s,
      o,
      f,
      i,
      r,
      a
    ), f.resolve(!0)) : (l(
      null,
      p,
      f.hiddenContainer,
      null,
      o,
      f,
      i,
      r,
      a
    ), f.deps <= 0 && f.resolve()));
  else if (m && oo(p, m))
    l(
      m,
      p,
      n,
      s,
      o,
      f,
      i,
      r,
      a
    ), Pa(f, p);
  else if (Cc(t, "onPending"), f.pendingBranch = p, p.shapeFlag & 512 ? f.pendingId = p.component.suspenseId : f.pendingId = Jh++, l(
    null,
    p,
    f.hiddenContainer,
    null,
    o,
    f,
    i,
    r,
    a
  ), f.deps <= 0)
    f.resolve();
  else {
    const { timeout: w, pendingId: y } = f;
    w > 0 ? setTimeout(() => {
      f.pendingId === y && f.fallback(h);
    }, w) : w === 0 && f.fallback(h);
  }
}
let A_ = !1;
function YE(e, t, n, s, o, i, r, a, l, u, d = !1) {
  W.NODE_ENV !== "production" && !A_ && (A_ = !0, console[console.info ? "info" : "log"](
    "<Suspense> is an experimental feature and its API will likely change."
  ));
  const {
    p: f,
    m: p,
    um: h,
    n: m,
    o: { parentNode: v, remove: _ }
  } = u;
  let b;
  const w = qT(e);
  w && t && t.pendingBranch && (b = t.pendingId, t.deps++);
  const y = e.props ? _c(e.props.timeout) : void 0;
  W.NODE_ENV !== "production" && _v(y, "Suspense timeout");
  const x = i, N = {
    vnode: e,
    parent: t,
    parentComponent: n,
    namespace: r,
    container: s,
    hiddenContainer: o,
    deps: 0,
    pendingId: Jh++,
    timeout: typeof y == "number" ? y : -1,
    activeBranch: null,
    pendingBranch: null,
    isInFallback: !d,
    isHydrating: d,
    isUnmounted: !1,
    effects: [],
    resolve(S = !1, O = !1) {
      if (W.NODE_ENV !== "production") {
        if (!S && !N.pendingBranch)
          throw new Error(
            "suspense.resolve() is called without a pending branch."
          );
        if (N.isUnmounted)
          throw new Error(
            "suspense.resolve() is called on an already unmounted suspense boundary."
          );
      }
      const {
        vnode: $,
        activeBranch: T,
        pendingBranch: R,
        pendingId: P,
        effects: M,
        parentComponent: U,
        container: H
      } = N;
      let j = !1;
      N.isHydrating ? N.isHydrating = !1 : S || (j = T && R.transition && R.transition.mode === "out-in", j && (T.transition.afterLeave = () => {
        P === N.pendingId && (p(
          R,
          H,
          i === x ? m(T) : i,
          0
        ), Ya(M));
      }), T && (v(T.el) === H && (i = m(T)), h(T, U, N, !0)), j || p(R, H, i, 0)), Pa(N, R), N.pendingBranch = null, N.isInFallback = !1;
      let V = N.parent, K = !1;
      for (; V; ) {
        if (V.pendingBranch) {
          V.effects.push(...M), K = !0;
          break;
        }
        V = V.parent;
      }
      !K && !j && Ya(M), N.effects = [], w && t && t.pendingBranch && b === t.pendingId && (t.deps--, t.deps === 0 && !O && t.resolve()), Cc($, "onResolve");
    },
    fallback(S) {
      if (!N.pendingBranch)
        return;
      const { vnode: O, activeBranch: $, parentComponent: T, container: R, namespace: P } = N;
      Cc(O, "onFallback");
      const M = m($), U = () => {
        N.isInFallback && (f(
          null,
          S,
          R,
          M,
          T,
          null,
          // fallback tree will not have suspense context
          P,
          a,
          l
        ), Pa(N, S));
      }, H = S.transition && S.transition.mode === "out-in";
      H && ($.transition.afterLeave = U), N.isInFallback = !0, h(
        $,
        T,
        null,
        // no suspense so unmount hooks fire now
        !0
        // shouldRemove
      ), H || U();
    },
    move(S, O, $) {
      N.activeBranch && p(N.activeBranch, S, O, $), N.container = S;
    },
    next() {
      return N.activeBranch && m(N.activeBranch);
    },
    registerDep(S, O, $) {
      const T = !!N.pendingBranch;
      T && N.deps++;
      const R = S.vnode.el;
      S.asyncDep.catch((P) => {
        ri(P, S, 0);
      }).then((P) => {
        if (S.isUnmounted || N.isUnmounted || N.pendingId !== S.suspenseId)
          return;
        S.asyncResolved = !0;
        const { vnode: M } = S;
        W.NODE_ENV !== "production" && Ia(M), sm(S, P, !1), R && (M.el = R);
        const U = !R && S.subTree.el;
        O(
          S,
          M,
          // component may have been moved before resolve.
          // if this is not a hydration, instance.subTree will be the comment
          // placeholder.
          v(R || S.subTree.el),
          // anchor will not be used if this is hydration, so only need to
          // consider the comment placeholder case.
          R ? null : m(S.subTree),
          N,
          r,
          $
        ), U && _(U), Pf(S, M.el), W.NODE_ENV !== "production" && Aa(), T && --N.deps === 0 && N.resolve();
      });
    },
    unmount(S, O) {
      N.isUnmounted = !0, N.activeBranch && h(
        N.activeBranch,
        n,
        S,
        O
      ), N.pendingBranch && h(
        N.pendingBranch,
        n,
        S,
        O
      );
    }
  };
  return N;
}
function KT(e, t, n, s, o, i, r, a, l) {
  const u = t.suspense = YE(
    t,
    s,
    n,
    e.parentNode,
    // eslint-disable-next-line no-restricted-globals
    document.createElement("div"),
    null,
    o,
    i,
    r,
    a,
    !0
  ), d = l(
    e,
    u.pendingBranch = t.ssContent,
    n,
    u,
    i,
    r
  );
  return u.deps === 0 && u.resolve(!1, !0), d;
}
function XT(e) {
  const { shapeFlag: t, children: n } = e, s = t & 32;
  e.ssContent = M_(
    s ? n.default : n
  ), e.ssFallback = s ? M_(n.fallback) : D(Zt);
}
function M_(e) {
  let t;
  if (Ue(e)) {
    const n = Yi && e._c;
    n && (e._d = !1, g()), e = e(), n && (e._d = !0, t = qn, GE());
  }
  if (Ce(e)) {
    const n = Mf(e);
    W.NODE_ENV !== "production" && !n && e.filter((s) => s !== Tv).length > 0 && ae("<Suspense> slots expect a single root node."), e = n;
  }
  return e = as(e), t && !e.dynamicChildren && (e.dynamicChildren = t.filter((n) => n !== e)), e;
}
function WE(e, t) {
  t && t.pendingBranch ? Ce(e) ? t.effects.push(...e) : t.effects.push(e) : Ya(e);
}
function Pa(e, t) {
  e.activeBranch = t;
  const { vnode: n, parentComponent: s } = e;
  let o = t.el;
  for (; !o && t.component; )
    t = t.component.subTree, o = t.el;
  n.el = o, s && s.subTree === n && (s.vnode.el = o, Pf(s, o));
}
function qT(e) {
  const t = e.props && e.props.suspensible;
  return t != null && t !== !1;
}
const G = Symbol.for("v-fgt"), To = Symbol.for("v-txt"), Zt = Symbol.for("v-cmt"), qr = Symbol.for("v-stc"), tc = [];
let qn = null;
function g(e = !1) {
  tc.push(qn = e ? null : []);
}
function GE() {
  tc.pop(), qn = tc[tc.length - 1] || null;
}
let Yi = 1;
function Qh(e, t = !1) {
  Yi += e, e < 0 && qn && t && (qn.hasOnce = !0);
}
function zE(e) {
  return e.dynamicChildren = Yi > 0 ? qn || Di : null, GE(), Yi > 0 && qn && qn.push(e), e;
}
function E(e, t, n, s, o, i) {
  return zE(
    c(
      e,
      t,
      n,
      s,
      o,
      i,
      !0
    )
  );
}
function se(e, t, n, s, o) {
  return zE(
    D(
      e,
      t,
      n,
      s,
      o,
      !0
    )
  );
}
function Ao(e) {
  return e ? e.__v_isVNode === !0 : !1;
}
function oo(e, t) {
  if (W.NODE_ENV !== "production" && t.shapeFlag & 6 && e.component) {
    const n = Qu.get(t.type);
    if (n && n.has(e.component))
      return e.shapeFlag &= -257, t.shapeFlag &= -513, !1;
  }
  return e.type === t.type && e.key === t.key;
}
let Zh;
function JT(e) {
  Zh = e;
}
const QT = (...e) => XE(
  ...Zh ? Zh(e, pn) : e
), KE = ({ key: e }) => e ?? null, td = ({
  ref: e,
  ref_key: t,
  ref_for: n
}) => (typeof e == "number" && (e = "" + e), e != null ? Ge(e) || ut(e) || Ue(e) ? { i: pn, r: e, k: t, f: !!n } : e : null);
function c(e, t = null, n = null, s = 0, o = null, i = e === G ? 0 : 1, r = !1, a = !1) {
  const l = {
    __v_isVNode: !0,
    __v_skip: !0,
    type: e,
    props: t,
    key: t && KE(t),
    ref: t && td(t),
    scopeId: kf,
    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: s,
    dynamicProps: o,
    dynamicChildren: null,
    appContext: null,
    ctx: pn
  };
  return a ? (Mv(l, n), i & 128 && e.normalize(l)) : n && (l.shapeFlag |= Ge(n) ? 8 : 16), W.NODE_ENV !== "production" && l.key !== l.key && ae("VNode created with invalid key (NaN). VNode type:", l.type), Yi > 0 && // avoid a block node from tracking itself
  !r && // has current parent block
  qn && // presence of a patch flag indicates this node needs patching on updates.
  // component nodes also should always be patched, because even if the
  // component doesn't need to update, it needs to persist the instance on to
  // the next vnode so that it can be properly unmounted later.
  (l.patchFlag > 0 || i & 6) && // the EVENTS flag is only for hydration and if it is the only flag, the
  // vnode should not be considered dynamic due to handler caching.
  l.patchFlag !== 32 && qn.push(l), l;
}
const D = W.NODE_ENV !== "production" ? QT : XE;
function XE(e, t = null, n = null, s = 0, o = null, i = !1) {
  if ((!e || e === Tv) && (W.NODE_ENV !== "production" && !e && ae(`Invalid vnode type when creating vnode: ${e}.`), e = Zt), Ao(e)) {
    const a = Ws(
      e,
      t,
      !0
      /* mergeRef: true */
    );
    return n && Mv(a, n), Yi > 0 && !i && qn && (a.shapeFlag & 6 ? qn[qn.indexOf(e)] = a : qn.push(a)), a.patchFlag = -2, a;
  }
  if (n0(e) && (e = e.__vccOpts), t) {
    t = Dt(t);
    let { class: a, style: l } = t;
    a && !Ge(a) && (t.class = Se(a)), mt(l) && (Ha(l) && !Ce(l) && (l = it({}, l)), t.style = Jn(l));
  }
  const r = Ge(e) ? 1 : Ld(e) ? 128 : tE(e) ? 64 : mt(e) ? 4 : Ue(e) ? 2 : 0;
  return W.NODE_ENV !== "production" && r & 4 && Ha(e) && (e = Ye(e), ae(
    "Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",
    `
Component that was made reactive: `,
    e
  )), c(
    e,
    t,
    n,
    s,
    o,
    r,
    i,
    !0
  );
}
function Dt(e) {
  return e ? Ha(e) || NE(e) ? it({}, e) : e : null;
}
function Ws(e, t, n = !1, s = !1) {
  const { props: o, ref: i, patchFlag: r, children: a, transition: l } = e, u = t ? bn(o || {}, t) : o, d = {
    __v_isVNode: !0,
    __v_skip: !0,
    type: e.type,
    props: u,
    key: u && KE(u),
    ref: t && t.ref ? (
      // #2078 in the case of <component :is="vnode" ref="extra"/>
      // if the vnode itself already has a ref, cloneVNode will need to merge
      // the refs so the single vnode can be set on multiple refs
      n && i ? Ce(i) ? i.concat(td(t)) : [i, td(t)] : td(t)
    ) : i,
    scopeId: e.scopeId,
    slotScopeIds: e.slotScopeIds,
    children: W.NODE_ENV !== "production" && r === -1 && Ce(a) ? a.map(qE) : a,
    target: e.target,
    targetStart: e.targetStart,
    targetAnchor: e.targetAnchor,
    staticCount: e.staticCount,
    shapeFlag: e.shapeFlag,
    // if the vnode is cloned with extra props, we can no longer assume its
    // existing patch flag to be reliable and need to add the FULL_PROPS flag.
    // note: preserve flag for fragments since they use the flag for children
    // fast paths only.
    patchFlag: t && e.type !== G ? r === -1 ? 16 : r | 16 : r,
    dynamicProps: e.dynamicProps,
    dynamicChildren: e.dynamicChildren,
    appContext: e.appContext,
    dirs: e.dirs,
    transition: l,
    // These should technically only be non-null on mounted VNodes. However,
    // they *should* be copied for kept-alive vnodes. So we just always copy
    // them since them being non-null during a mount doesn't affect the logic as
    // they will simply be overwritten.
    component: e.component,
    suspense: e.suspense,
    ssContent: e.ssContent && Ws(e.ssContent),
    ssFallback: e.ssFallback && Ws(e.ssFallback),
    el: e.el,
    anchor: e.anchor,
    ctx: e.ctx,
    ce: e.ce
  };
  return l && s && _r(
    d,
    l.clone(d)
  ), d;
}
function qE(e) {
  const t = Ws(e);
  return Ce(e.children) && (t.children = e.children.map(qE)), t;
}
function te(e = " ", t = 0) {
  return D(To, null, e, t);
}
function Av(e, t) {
  const n = D(qr, null, e);
  return n.staticCount = t, n;
}
function ne(e = "", t = !1) {
  return t ? (g(), se(Zt, null, e)) : D(Zt, null, e);
}
function as(e) {
  return e == null || typeof e == "boolean" ? D(Zt) : Ce(e) ? D(
    G,
    null,
    // #3666, avoid reference pollution when reusing vnode
    e.slice()
  ) : Ao(e) ? Mr(e) : D(To, null, String(e));
}
function Mr(e) {
  return e.el === null && e.patchFlag !== -1 || e.memo ? e : Ws(e);
}
function Mv(e, t) {
  let n = 0;
  const { shapeFlag: s } = e;
  if (t == null)
    t = null;
  else if (Ce(t))
    n = 16;
  else if (typeof t == "object")
    if (s & 65) {
      const o = t.default;
      o && (o._c && (o._d = !1), Mv(e, o()), o._c && (o._d = !0));
      return;
    } else {
      n = 32;
      const o = t._;
      !o && !NE(t) ? t._ctx = pn : o === 3 && pn && (pn.slots._ === 1 ? t._ = 1 : (t._ = 2, e.patchFlag |= 1024));
    }
  else Ue(t) ? (t = { default: t, _ctx: pn }, n = 32) : (t = String(t), s & 64 ? (n = 16, t = [te(t)]) : n = 8);
  e.children = t, e.shapeFlag |= n;
}
function bn(...e) {
  const t = {};
  for (let n = 0; n < e.length; n++) {
    const s = e[n];
    for (const o in s)
      if (o === "class")
        t.class !== s.class && (t.class = Se([t.class, s.class]));
      else if (o === "style")
        t.style = Jn([t.style, s.style]);
      else if (Do(o)) {
        const i = t[o], r = s[o];
        r && i !== r && !(Ce(i) && i.includes(r)) && (t[o] = i ? [].concat(i, r) : r);
      } else o !== "" && (t[o] = s[o]);
  }
  return t;
}
function ys(e, t, n, s = null) {
  Ys(e, t, 7, [
    n,
    s
  ]);
}
const ZT = EE();
let e$ = 0;
function JE(e, t, n) {
  const s = e.type, o = (t ? t.appContext : e.appContext) || ZT, i = {
    uid: e$++,
    vnode: e,
    type: s,
    parent: t,
    appContext: o,
    root: null,
    // to be immediately set
    next: null,
    subTree: null,
    // will be set synchronously right after creation
    effect: null,
    update: null,
    // will be set synchronously right after creation
    job: null,
    scope: new cv(
      !0
      /* detached */
    ),
    render: null,
    proxy: null,
    exposed: null,
    exposeProxy: null,
    withProxy: null,
    provides: t ? t.provides : Object.create(o.provides),
    ids: t ? t.ids : ["", 0, 0],
    accessCache: null,
    renderCache: [],
    // local resolved assets
    components: null,
    directives: null,
    // resolved props and emits options
    propsOptions: OE(s, o),
    emitsOptions: BE(s, o),
    // emit
    emit: null,
    // to be set immediately
    emitted: null,
    // props default value
    propsDefaults: pt,
    // inheritAttrs
    inheritAttrs: s.inheritAttrs,
    // state
    ctx: pt,
    data: pt,
    props: pt,
    attrs: pt,
    slots: pt,
    refs: pt,
    setupState: pt,
    setupContext: null,
    // suspense related
    suspense: n,
    suspenseId: n ? n.pendingId : 0,
    asyncDep: null,
    asyncResolved: !1,
    // lifecycle hooks
    // not using enums here because it results in computed properties
    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 W.NODE_ENV !== "production" ? i.ctx = tT(i) : i.ctx = { _: i }, i.root = t ? t.root : i, i.emit = UT.bind(null, i), e.ce && e.ce(i), i;
}
let yn = null;
const cn = () => yn || pn;
let Vd, em;
{
  const e = al(), t = (n, s) => {
    let o;
    return (o = e[n]) || (o = e[n] = []), o.push(s), (i) => {
      o.length > 1 ? o.forEach((r) => r(i)) : o[0](i);
    };
  };
  Vd = t(
    "__VUE_INSTANCE_SETTERS__",
    (n) => yn = n
  ), em = t(
    "__VUE_SSR_SETTERS__",
    (n) => Ga = n
  );
}
const Wi = (e) => {
  const t = yn;
  return Vd(e), e.scope.on(), () => {
    e.scope.off(), Vd(t);
  };
}, tm = () => {
  yn && yn.scope.off(), Vd(null);
}, t$ = /* @__PURE__ */ On("slot,component");
function nm(e, { isNativeTag: t }) {
  (t$(e) || t(e)) && ae(
    "Do not use built-in or reserved HTML elements as component id: " + e
  );
}
function QE(e) {
  return e.vnode.shapeFlag & 4;
}
let Ga = !1;
function ZE(e, t = !1, n = !1) {
  t && em(t);
  const { props: s, children: o } = e.vnode, i = QE(e);
  ST(e, s, i, t), AT(e, o, n);
  const r = i ? n$(e, t) : void 0;
  return t && em(!1), r;
}
function n$(e, t) {
  var n;
  const s = e.type;
  if (W.NODE_ENV !== "production") {
    if (s.name && nm(s.name, e.appContext.config), s.components) {
      const i = Object.keys(s.components);
      for (let r = 0; r < i.length; r++)
        nm(i[r], e.appContext.config);
    }
    if (s.directives) {
      const i = Object.keys(s.directives);
      for (let r = 0; r < i.length; r++)
        Z1(i[r]);
    }
    s.compilerOptions && Pv() && ae(
      '"compilerOptions" is only supported when using a build of Vue that includes the runtime compiler. Since you are using a runtime-only build, the options should be passed via your build tool config instead.'
    );
  }
  e.accessCache = /* @__PURE__ */ Object.create(null), e.proxy = new Proxy(e.ctx, Zl), W.NODE_ENV !== "production" && nT(e);
  const { setup: o } = s;
  if (o) {
    br();
    const i = e.setupContext = o.length > 1 ? t0(e) : null, r = Wi(e), a = ra(
      o,
      e,
      0,
      [
        W.NODE_ENV !== "production" ? ro(e.props) : e.props,
        i
      ]
    ), l = Hc(a);
    if (Er(), r(), (l || e.sp) && !Xr(e) && xv(e), l) {
      if (a.then(tm, tm), t)
        return a.then((u) => {
          sm(e, u, t);
        }).catch((u) => {
          ri(u, e, 0);
        });
      if (e.asyncDep = a, W.NODE_ENV !== "production" && !e.suspense) {
        const u = (n = s.name) != null ? n : "Anonymous";
        ae(
          `Component <${u}>: setup function returned a promise, but no <Suspense> boundary was found in the parent component tree. A component with async setup() must be nested in a <Suspense> in order to be rendered.`
        );
      }
    } else
      sm(e, a, t);
  } else
    e0(e, t);
}
function sm(e, t, n) {
  Ue(t) ? e.type.__ssrInlineRender ? e.ssrRender = t : e.render = t : mt(t) ? (W.NODE_ENV !== "production" && Ao(t) && ae(
    "setup() should not return VNodes directly - return a render function instead."
  ), W.NODE_ENV !== "production" && (e.devtoolsRawSetupState = t), e.setupState = gv(t), W.NODE_ENV !== "production" && sT(e)) : W.NODE_ENV !== "production" && t !== void 0 && ae(
    `setup() should return an object. Received: ${t === null ? "null" : typeof t}`
  ), e0(e, n);
}
let nc, om;
function s$(e) {
  nc = e, om = (t) => {
    t.render._rc && (t.withProxy = new Proxy(t.ctx, eT));
  };
}
const Pv = () => !nc;
function e0(e, t, n) {
  const s = e.type;
  if (!e.render) {
    if (!t && nc && !s.render) {
      const o = s.template || Rv(e).template;
      if (o) {
        W.NODE_ENV !== "production" && Qo(e, "compile");
        const { isCustomElement: i, compilerOptions: r } = e.appContext.config, { delimiters: a, compilerOptions: l } = s, u = it(
          it(
            {
              isCustomElement: i,
              delimiters: a
            },
            r
          ),
          l
        );
        s.render = nc(o, u), W.NODE_ENV !== "production" && Zo(e, "compile");
      }
    }
    e.render = s.render || Jt, om && om(e);
  }
  {
    const o = Wi(e);
    br();
    try {
      vT(e);
    } finally {
      Er(), o();
    }
  }
  W.NODE_ENV !== "production" && !s.render && e.render === Jt && !t && (!nc && s.template ? ae(
    'Component provided template option but runtime compilation is not supported in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js".'
  ) : ae("Component is missing template or render function: ", s));
}
const P_ = W.NODE_ENV !== "production" ? {
  get(e, t) {
    return Pd(), kn(e, "get", ""), e[t];
  },
  set() {
    return ae("setupContext.attrs is readonly."), !1;
  },
  deleteProperty() {
    return ae("setupContext.attrs is readonly."), !1;
  }
} : {
  get(e, t) {
    return kn(e, "get", ""), e[t];
  }
};
function o$(e) {
  return new Proxy(e.slots, {
    get(t, n) {
      return kn(e, "get", "$slots"), t[n];
    }
  });
}
function t0(e) {
  const t = (n) => {
    if (W.NODE_ENV !== "production" && (e.exposed && ae("expose() should be called only once per setup()."), n != null)) {
      let s = typeof n;
      s === "object" && (Ce(n) ? s = "array" : ut(n) && (s = "ref")), s !== "object" && ae(
        `expose() should be passed a plain object, received ${s}.`
      );
    }
    e.exposed = n || {};
  };
  if (W.NODE_ENV !== "production") {
    let n, s;
    return Object.freeze({
      get attrs() {
        return n || (n = new Proxy(e.attrs, P_));
      },
      get slots() {
        return s || (s = o$(e));
      },
      get emit() {
        return (o, ...i) => e.emit(o, ...i);
      },
      expose: t
    });
  } else
    return {
      attrs: new Proxy(e.attrs, P_),
      slots: e.slots,
      emit: e.emit,
      expose: t
    };
}
function Kc(e) {
  return e.exposed ? e.exposeProxy || (e.exposeProxy = new Proxy(gv(lr(e.exposed)), {
    get(t, n) {
      if (n in t)
        return t[n];
      if (n in Mi)
        return Mi[n](e);
    },
    has(t, n) {
      return n in t || n in Mi;
    }
  })) : e.proxy;
}
const r$ = /(?:^|[-_])(\w)/g, i$ = (e) => e.replace(r$, (t) => t.toUpperCase()).replace(/[-_]/g, "");
function Oc(e, t = !0) {
  return Ue(e) ? e.displayName || e.name : e.name || t && e.__name;
}
function Lf(e, t, n = !1) {
  let s = Oc(t);
  if (!s && t.__file) {
    const o = t.__file.match(/([^/\\]+)\.\w+$/);
    o && (s = o[1]);
  }
  if (!s && e && e.parent) {
    const o = (i) => {
      for (const r in i)
        if (i[r] === t)
          return r;
    };
    s = o(
      e.components || e.parent.type.components
    ) || o(e.appContext.components);
  }
  return s ? i$(s) : n ? "App" : "Anonymous";
}
function n0(e) {
  return Ue(e) && "__vccOpts" in e;
}
const k = (e, t) => {
  const n = oO(e, t, Ga);
  if (W.NODE_ENV !== "production") {
    const s = cn();
    s && s.appContext.config.warnRecursiveComputed && (n._warnRecursive = !0);
  }
  return n;
};
function Co(e, t, n) {
  const s = arguments.length;
  return s === 2 ? mt(t) && !Ce(t) ? Ao(t) ? D(e, null, [t]) : D(e, t) : D(e, null, t) : (s > 3 ? n = Array.prototype.slice.call(arguments, 2) : s === 3 && Ao(n) && (n = [n]), D(e, t, n));
}
function s0() {
  if (W.NODE_ENV === "production" || typeof window > "u")
    return;
  const e = { style: "color:#3ba776" }, t = { style: "color:#1677ff" }, n = { style: "color:#f5222d" }, s = { style: "color:#eb2f96" }, o = {
    __vue_custom_formatter: !0,
    header(f) {
      return mt(f) ? f.__isVue ? ["div", e, "VueInstance"] : ut(f) ? [
        "div",
        {},
        ["span", e, d(f)],
        "<",
        // avoid debugger accessing value affecting behavior
        a("_value" in f ? f._value : f),
        ">"
      ] : Us(f) ? [
        "div",
        {},
        ["span", e, Qn(f) ? "ShallowReactive" : "Reactive"],
        "<",
        a(f),
        `>${Ro(f) ? " (readonly)" : ""}`
      ] : Ro(f) ? [
        "div",
        {},
        ["span", e, Qn(f) ? "ShallowReadonly" : "Readonly"],
        "<",
        a(f),
        ">"
      ] : null : null;
    },
    hasBody(f) {
      return f && f.__isVue;
    },
    body(f) {
      if (f && f.__isVue)
        return [
          "div",
          {},
          ...i(f.$)
        ];
    }
  };
  function i(f) {
    const p = [];
    f.type.props && f.props && p.push(r("props", Ye(f.props))), f.setupState !== pt && p.push(r("setup", f.setupState)), f.data !== pt && p.push(r("data", Ye(f.data)));
    const h = l(f, "computed");
    h && p.push(r("computed", h));
    const m = l(f, "inject");
    return m && p.push(r("injected", m)), p.push([
      "div",
      {},
      [
        "span",
        {
          style: s.style + ";opacity:0.66"
        },
        "$ (internal): "
      ],
      ["object", { object: f }]
    ]), p;
  }
  function r(f, p) {
    return p = it({}, p), Object.keys(p).length ? [
      "div",
      { style: "line-height:1.25em;margin-bottom:0.6em" },
      [
        "div",
        {
          style: "color:#476582"
        },
        f
      ],
      [
        "div",
        {
          style: "padding-left:1.25em"
        },
        ...Object.keys(p).map((h) => [
          "div",
          {},
          ["span", s, h + ": "],
          a(p[h], !1)
        ])
      ]
    ] : ["span", {}];
  }
  function a(f, p = !0) {
    return typeof f == "number" ? ["span", t, f] : typeof f == "string" ? ["span", n, JSON.stringify(f)] : typeof f == "boolean" ? ["span", s, f] : mt(f) ? ["object", { object: p ? Ye(f) : f }] : ["span", n, String(f)];
  }
  function l(f, p) {
    const h = f.type;
    if (Ue(h))
      return;
    const m = {};
    for (const v in f.ctx)
      u(h, v, p) && (m[v] = f.ctx[v]);
    return m;
  }
  function u(f, p, h) {
    const m = f[h];
    if (Ce(m) && m.includes(p) || mt(m) && p in m || f.extends && u(f.extends, p, h) || f.mixins && f.mixins.some((v) => u(v, p, h)))
      return !0;
  }
  function d(f) {
    return Qn(f) ? "ShallowRef" : f.effect ? "ComputedRef" : "Ref";
  }
  window.devtoolsFormatters ? window.devtoolsFormatters.push(o) : window.devtoolsFormatters = [o];
}
function a$(e, t, n, s) {
  const o = n[s];
  if (o && o0(o, e))
    return o;
  const i = t();
  return i.memo = e.slice(), i.cacheIndex = s, n[s] = i;
}
function o0(e, t) {
  const n = e.memo;
  if (n.length != t.length)
    return !1;
  for (let s = 0; s < n.length; s++)
    if (Wn(n[s], t[s]))
      return !1;
  return Yi > 0 && qn && qn.push(e), !0;
}
const rm = "3.5.13", En = W.NODE_ENV !== "production" ? ae : Jt, l$ = Tf, c$ = so, u$ = bv, d$ = {
  createComponentInstance: JE,
  setupComponent: ZE,
  renderComponentRoot: ed,
  setCurrentRenderingInstance: Sc,
  isVNode: Ao,
  normalizeVNode: as,
  getComponentPublicInstance: Kc,
  ensureValidVNode: kv,
  pushWarningContext: Ia,
  popWarningContext: Aa
}, f$ = d$, p$ = null, h$ = null, m$ = null;
var zt = {};
let im;
const L_ = typeof window < "u" && window.trustedTypes;
if (L_)
  try {
    im = /* @__PURE__ */ L_.createPolicy("vue", {
      createHTML: (e) => e
    });
  } catch (e) {
    zt.NODE_ENV !== "production" && En(`Error creating trusted types policy: ${e}`);
  }
const r0 = im ? (e) => im.createHTML(e) : (e) => e, v$ = "http://www.w3.org/2000/svg", g$ = "http://www.w3.org/1998/Math/MathML", tr = typeof document < "u" ? document : null, V_ = tr && /* @__PURE__ */ tr.createElement("template"), _$ = {
  insert: (e, t, n) => {
    t.insertBefore(e, n || null);
  },
  remove: (e) => {
    const t = e.parentNode;
    t && t.removeChild(e);
  },
  createElement: (e, t, n, s) => {
    const o = t === "svg" ? tr.createElementNS(v$, e) : t === "mathml" ? tr.createElementNS(g$, e) : n ? tr.createElement(e, { is: n }) : tr.createElement(e);
    return e === "select" && s && s.multiple != null && o.setAttribute("multiple", s.multiple), o;
  },
  createText: (e) => tr.createTextNode(e),
  createComment: (e) => tr.createComment(e),
  setText: (e, t) => {
    e.nodeValue = t;
  },
  setElementText: (e, t) => {
    e.textContent = t;
  },
  parentNode: (e) => e.parentNode,
  nextSibling: (e) => e.nextSibling,
  querySelector: (e) => tr.querySelector(e),
  setScopeId(e, t) {
    e.setAttribute(t, "");
  },
  // __UNSAFE__
  // Reason: innerHTML.
  // Static content here can only come from compiled templates.
  // As long as the user only uses trusted templates, this is safe.
  insertStaticContent(e, t, n, s, o, i) {
    const r = n ? n.previousSibling : t.lastChild;
    if (o && (o === i || o.nextSibling))
      for (; t.insertBefore(o.cloneNode(!0), n), !(o === i || !(o = o.nextSibling)); )
        ;
    else {
      V_.innerHTML = r0(
        s === "svg" ? `<svg>${e}</svg>` : s === "mathml" ? `<math>${e}</math>` : e
      );
      const a = V_.content;
      if (s === "svg" || s === "mathml") {
        const l = a.firstChild;
        for (; l.firstChild; )
          a.appendChild(l.firstChild);
        a.removeChild(l);
      }
      t.insertBefore(a, n);
    }
    return [
      // first
      r ? r.nextSibling : t.firstChild,
      // last
      n ? n.previousSibling : t.lastChild
    ];
  }
}, Tr = "transition", Cl = "animation", za = Symbol("_vtc"), i0 = {
  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
}, a0 = /* @__PURE__ */ it(
  {},
  Sv,
  i0
), y$ = (e) => (e.displayName = "Transition", e.props = a0, e), Lv = /* @__PURE__ */ y$(
  (e, { slots: t }) => Co(iE, l0(e), t)
), hi = (e, t = []) => {
  Ce(e) ? e.forEach((n) => n(...t)) : e && e(...t);
}, F_ = (e) => e ? Ce(e) ? e.some((t) => t.length > 1) : e.length > 1 : !1;
function l0(e) {
  const t = {};
  for (const M in e)
    M in i0 || (t[M] = e[M]);
  if (e.css === !1)
    return t;
  const {
    name: n = "v",
    type: s,
    duration: o,
    enterFromClass: i = `${n}-enter-from`,
    enterActiveClass: r = `${n}-enter-active`,
    enterToClass: a = `${n}-enter-to`,
    appearFromClass: l = i,
    appearActiveClass: u = r,
    appearToClass: d = a,
    leaveFromClass: f = `${n}-leave-from`,
    leaveActiveClass: p = `${n}-leave-active`,
    leaveToClass: h = `${n}-leave-to`
  } = e, m = b$(o), v = m && m[0], _ = m && m[1], {
    onBeforeEnter: b,
    onEnter: w,
    onEnterCancelled: y,
    onLeave: x,
    onLeaveCancelled: N,
    onBeforeAppear: S = b,
    onAppear: O = w,
    onAppearCancelled: $ = y
  } = t, T = (M, U, H, j) => {
    M._enterCancelled = j, Dr(M, U ? d : a), Dr(M, U ? u : r), H && H();
  }, R = (M, U) => {
    M._isLeaving = !1, Dr(M, f), Dr(M, h), Dr(M, p), U && U();
  }, P = (M) => (U, H) => {
    const j = M ? O : w, V = () => T(U, M, H);
    hi(j, [U, V]), U_(() => {
      Dr(U, M ? l : i), yo(U, M ? d : a), F_(j) || j_(U, s, v, V);
    });
  };
  return it(t, {
    onBeforeEnter(M) {
      hi(b, [M]), yo(M, i), yo(M, r);
    },
    onBeforeAppear(M) {
      hi(S, [M]), yo(M, l), yo(M, u);
    },
    onEnter: P(!1),
    onAppear: P(!0),
    onLeave(M, U) {
      M._isLeaving = !0;
      const H = () => R(M, U);
      yo(M, f), M._enterCancelled ? (yo(M, p), am()) : (am(), yo(M, p)), U_(() => {
        M._isLeaving && (Dr(M, f), yo(M, h), F_(x) || j_(M, s, _, H));
      }), hi(x, [M, H]);
    },
    onEnterCancelled(M) {
      T(M, !1, void 0, !0), hi(y, [M]);
    },
    onAppearCancelled(M) {
      T(M, !0, void 0, !0), hi($, [M]);
    },
    onLeaveCancelled(M) {
      R(M), hi(N, [M]);
    }
  });
}
function b$(e) {
  if (e == null)
    return null;
  if (mt(e))
    return [qp(e.enter), qp(e.leave)];
  {
    const t = qp(e);
    return [t, t];
  }
}
function qp(e) {
  const t = _c(e);
  return zt.NODE_ENV !== "production" && _v(t, "<transition> explicit duration"), t;
}
function yo(e, t) {
  t.split(/\s+/).forEach((n) => n && e.classList.add(n)), (e[za] || (e[za] = /* @__PURE__ */ new Set())).add(t);
}
function Dr(e, t) {
  t.split(/\s+/).forEach((s) => s && e.classList.remove(s));
  const n = e[za];
  n && (n.delete(t), n.size || (e[za] = void 0));
}
function U_(e) {
  requestAnimationFrame(() => {
    requestAnimationFrame(e);
  });
}
let E$ = 0;
function j_(e, t, n, s) {
  const o = e._endId = ++E$, i = () => {
    o === e._endId && s();
  };
  if (n != null)
    return setTimeout(i, n);
  const { type: r, timeout: a, propCount: l } = c0(e, t);
  if (!r)
    return s();
  const u = r + "end";
  let d = 0;
  const f = () => {
    e.removeEventListener(u, p), i();
  }, p = (h) => {
    h.target === e && ++d >= l && f();
  };
  setTimeout(() => {
    d < l && f();
  }, a + 1), e.addEventListener(u, p);
}
function c0(e, t) {
  const n = window.getComputedStyle(e), s = (m) => (n[m] || "").split(", "), o = s(`${Tr}Delay`), i = s(`${Tr}Duration`), r = B_(o, i), a = s(`${Cl}Delay`), l = s(`${Cl}Duration`), u = B_(a, l);
  let d = null, f = 0, p = 0;
  t === Tr ? r > 0 && (d = Tr, f = r, p = i.length) : t === Cl ? u > 0 && (d = Cl, f = u, p = l.length) : (f = Math.max(r, u), d = f > 0 ? r > u ? Tr : Cl : null, p = d ? d === Tr ? i.length : l.length : 0);
  const h = d === Tr && /\b(transform|all)(,|$)/.test(
    s(`${Tr}Property`).toString()
  );
  return {
    type: d,
    timeout: f,
    propCount: p,
    hasTransform: h
  };
}
function B_(e, t) {
  for (; e.length < t.length; )
    e = e.concat(e);
  return Math.max(...t.map((n, s) => H_(n) + H_(e[s])));
}
function H_(e) {
  return e === "auto" ? 0 : Number(e.slice(0, -1).replace(",", ".")) * 1e3;
}
function am() {
  return document.body.offsetHeight;
}
function w$(e, t, n) {
  const s = e[za];
  s && (t = (t ? [t, ...s] : [...s]).join(" ")), t == null ? e.removeAttribute("class") : n ? e.setAttribute("class", t) : e.className = t;
}
const Fd = Symbol("_vod"), u0 = Symbol("_vsh"), Gi = {
  beforeMount(e, { value: t }, { transition: n }) {
    e[Fd] = e.style.display === "none" ? "" : e.style.display, n && t ? n.beforeEnter(e) : Ol(e, t);
  },
  mounted(e, { value: t }, { transition: n }) {
    n && t && n.enter(e);
  },
  updated(e, { value: t, oldValue: n }, { transition: s }) {
    !t != !n && (s ? t ? (s.beforeEnter(e), Ol(e, !0), s.enter(e)) : s.leave(e, () => {
      Ol(e, !1);
    }) : Ol(e, t));
  },
  beforeUnmount(e, { value: t }) {
    Ol(e, t);
  }
};
zt.NODE_ENV !== "production" && (Gi.name = "show");
function Ol(e, t) {
  e.style.display = t ? e[Fd] : "none", e[u0] = !t;
}
function S$() {
  Gi.getSSRProps = ({ value: e }) => {
    if (!e)
      return { style: { display: "none" } };
  };
}
const d0 = Symbol(zt.NODE_ENV !== "production" ? "CSS_VAR_TEXT" : "");
function x$(e) {
  const t = cn();
  if (!t) {
    zt.NODE_ENV !== "production" && En("useCssVars is called without current active component instance.");
    return;
  }
  const n = t.ut = (o = e(t.proxy)) => {
    Array.from(
      document.querySelectorAll(`[data-v-owner="${t.uid}"]`)
    ).forEach((i) => Ud(i, o));
  };
  zt.NODE_ENV !== "production" && (t.getCssVars = () => e(t.proxy));
  const s = () => {
    const o = e(t.proxy);
    t.ce ? Ud(t.ce, o) : lm(t.subTree, o), n(o);
  };
  Ov(() => {
    Ya(s);
  }), vt(() => {
    nt(s, Jt, { flush: "post" });
    const o = new MutationObserver(s);
    o.observe(t.subTree.el.parentNode, { childList: !0 }), Fo(() => o.disconnect());
  });
}
function lm(e, t) {
  if (e.shapeFlag & 128) {
    const n = e.suspense;
    e = n.activeBranch, n.pendingBranch && !n.isHydrating && n.effects.push(() => {
      lm(n.activeBranch, t);
    });
  }
  for (; e.component; )
    e = e.component.subTree;
  if (e.shapeFlag & 1 && e.el)
    Ud(e.el, t);
  else if (e.type === G)
    e.children.forEach((n) => lm(n, t));
  else if (e.type === qr) {
    let { el: n, anchor: s } = e;
    for (; n && (Ud(n, t), n !== s); )
      n = n.nextSibling;
  }
}
function Ud(e, t) {
  if (e.nodeType === 1) {
    const n = e.style;
    let s = "";
    for (const o in t)
      n.setProperty(`--${o}`, t[o]), s += `--${o}: ${t[o]};`;
    n[d0] = s;
  }
}
const N$ = /(^|;)\s*display\s*:/;
function C$(e, t, n) {
  const s = e.style, o = Ge(n);
  let i = !1;
  if (n && !o) {
    if (t)
      if (Ge(t))
        for (const r of t.split(";")) {
          const a = r.slice(0, r.indexOf(":")).trim();
          n[a] == null && nd(s, a, "");
        }
      else
        for (const r in t)
          n[r] == null && nd(s, r, "");
    for (const r in n)
      r === "display" && (i = !0), nd(s, r, n[r]);
  } else if (o) {
    if (t !== n) {
      const r = s[d0];
      r && (n += ";" + r), s.cssText = n, i = N$.test(n);
    }
  } else t && e.removeAttribute("style");
  Fd in e && (e[Fd] = i ? s.display : "", e[u0] && (s.display = "none"));
}
const O$ = /[^\\];\s*$/, Y_ = /\s*!important$/;
function nd(e, t, n) {
  if (Ce(n))
    n.forEach((s) => nd(e, t, s));
  else if (n == null && (n = ""), zt.NODE_ENV !== "production" && O$.test(n) && En(
    `Unexpected semicolon at the end of '${t}' style value: '${n}'`
  ), t.startsWith("--"))
    e.setProperty(t, n);
  else {
    const s = T$(e, t);
    Y_.test(n) ? e.setProperty(
      Un(s),
      n.replace(Y_, ""),
      "important"
    ) : e[s] = n;
  }
}
const W_ = ["Webkit", "Moz", "ms"], Jp = {};
function T$(e, t) {
  const n = Jp[t];
  if (n)
    return n;
  let s = Gt(t);
  if (s !== "filter" && s in e)
    return Jp[t] = s;
  s = fo(s);
  for (let o = 0; o < W_.length; o++) {
    const i = W_[o] + s;
    if (i in e)
      return Jp[t] = i;
  }
  return t;
}
const G_ = "http://www.w3.org/1999/xlink";
function z_(e, t, n, s, o, i = _1(t)) {
  s && t.startsWith("xlink:") ? n == null ? e.removeAttributeNS(G_, t.slice(6, t.length)) : e.setAttributeNS(G_, t, n) : n == null || i && !wf(n) ? e.removeAttribute(t) : e.setAttribute(
    t,
    i ? "" : us(n) ? String(n) : n
  );
}
function K_(e, t, n, s, o) {
  if (t === "innerHTML" || t === "textContent") {
    n != null && (e[t] = t === "innerHTML" ? r0(n) : n);
    return;
  }
  const i = e.tagName;
  if (t === "value" && i !== "PROGRESS" && // custom elements may use _value internally
  !i.includes("-")) {
    const a = i === "OPTION" ? e.getAttribute("value") || "" : e.value, l = n == null ? (
      // #11647: value should be set as empty string for null and undefined,
      // but <input type="checkbox"> should be set as 'on'.
      e.type === "checkbox" ? "on" : ""
    ) : String(n);
    (a !== l || !("_value" in e)) && (e.value = l), n == null && e.removeAttribute(t), e._value = n;
    return;
  }
  let r = !1;
  if (n === "" || n == null) {
    const a = typeof e[t];
    a === "boolean" ? n = wf(n) : n == null && a === "string" ? (n = "", r = !0) : a === "number" && (n = 0, r = !0);
  }
  try {
    e[t] = n;
  } catch (a) {
    zt.NODE_ENV !== "production" && !r && En(
      `Failed setting prop "${t}" on <${i.toLowerCase()}>: value ${n} is invalid.`,
      a
    );
  }
  r && e.removeAttribute(o || t);
}
function ir(e, t, n, s) {
  e.addEventListener(t, n, s);
}
function $$(e, t, n, s) {
  e.removeEventListener(t, n, s);
}
const X_ = Symbol("_vei");
function k$(e, t, n, s, o = null) {
  const i = e[X_] || (e[X_] = {}), r = i[t];
  if (s && r)
    r.value = zt.NODE_ENV !== "production" ? J_(s, t) : s;
  else {
    const [a, l] = D$(t);
    if (s) {
      const u = i[t] = A$(
        zt.NODE_ENV !== "production" ? J_(s, t) : s,
        o
      );
      ir(e, a, u, l);
    } else r && ($$(e, a, r, l), i[t] = void 0);
  }
}
const q_ = /(?:Once|Passive|Capture)$/;
function D$(e) {
  let t;
  if (q_.test(e)) {
    t = {};
    let s;
    for (; s = e.match(q_); )
      e = e.slice(0, e.length - s[0].length), t[s[0].toLowerCase()] = !0;
  }
  return [e[2] === ":" ? e.slice(3) : Un(e.slice(2)), t];
}
let Qp = 0;
const R$ = /* @__PURE__ */ Promise.resolve(), I$ = () => Qp || (R$.then(() => Qp = 0), Qp = Date.now());
function A$(e, t) {
  const n = (s) => {
    if (!s._vts)
      s._vts = Date.now();
    else if (s._vts <= n.attached)
      return;
    Ys(
      M$(s, n.value),
      t,
      5,
      [s]
    );
  };
  return n.value = e, n.attached = I$(), n;
}
function J_(e, t) {
  return Ue(e) || Ce(e) ? e : (En(
    `Wrong type passed as event handler to ${t} - did you forget @ or : in front of your prop?
Expected function or array of functions, received type ${typeof e}.`
  ), Jt);
}
function M$(e, t) {
  if (Ce(t)) {
    const n = e.stopImmediatePropagation;
    return e.stopImmediatePropagation = () => {
      n.call(e), e._stopped = !0;
    }, t.map(
      (s) => (o) => !o._stopped && s && s(o)
    );
  } else
    return t;
}
const Q_ = (e) => e.charCodeAt(0) === 111 && e.charCodeAt(1) === 110 && // lowercase letter
e.charCodeAt(2) > 96 && e.charCodeAt(2) < 123, P$ = (e, t, n, s, o, i) => {
  const r = o === "svg";
  t === "class" ? w$(e, s, r) : t === "style" ? C$(e, n, s) : Do(t) ? vc(t) || k$(e, t, n, s, i) : (t[0] === "." ? (t = t.slice(1), !0) : t[0] === "^" ? (t = t.slice(1), !1) : L$(e, t, s, r)) ? (K_(e, t, s), !e.tagName.includes("-") && (t === "value" || t === "checked" || t === "selected") && z_(e, t, s, r, i, t !== "value")) : /* #11081 force set props for possible async custom element */ e._isVueCE && (/[A-Z]/.test(t) || !Ge(s)) ? K_(e, Gt(t), s, i, t) : (t === "true-value" ? e._trueValue = s : t === "false-value" && (e._falseValue = s), z_(e, t, s, r));
};
function L$(e, t, n, s) {
  if (s)
    return !!(t === "innerHTML" || t === "textContent" || t in e && Q_(t) && Ue(n));
  if (t === "spellcheck" || t === "draggable" || t === "translate" || t === "form" || t === "list" && e.tagName === "INPUT" || t === "type" && e.tagName === "TEXTAREA")
    return !1;
  if (t === "width" || t === "height") {
    const o = e.tagName;
    if (o === "IMG" || o === "VIDEO" || o === "CANVAS" || o === "SOURCE")
      return !1;
  }
  return Q_(t) && Ge(n) ? !1 : t in e;
}
const Z_ = {};
/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function f0(e, t, n) {
  const s = /* @__PURE__ */ Rn(e, t);
  Yc(s) && it(s, t);
  class o extends Vf {
    constructor(r) {
      super(s, r, n);
    }
  }
  return o.def = s, o;
}
/*! #__NO_SIDE_EFFECTS__ */
const V$ = /* @__NO_SIDE_EFFECTS__ */ (e, t) => /* @__PURE__ */ f0(e, t, w0), F$ = typeof HTMLElement < "u" ? HTMLElement : class {
};
class Vf extends F$ {
  constructor(t, n = {}, s = wn) {
    super(), this._def = t, this._props = n, this._createApp = s, this._isVueCE = !0, this._instance = null, this._app = null, this._nonce = this._def.nonce, this._connected = !1, this._resolved = !1, this._numberProps = null, this._styleChildren = /* @__PURE__ */ new WeakSet(), this._ob = null, this.shadowRoot && s !== wn ? this._root = this.shadowRoot : (zt.NODE_ENV !== "production" && this.shadowRoot && En(
      "Custom element has pre-rendered declarative shadow root but is not defined as hydratable. Use `defineSSRCustomElement`."
    ), t.shadowRoot !== !1 ? (this.attachShadow({ mode: "open" }), this._root = this.shadowRoot) : this._root = this), this._def.__asyncLoader || this._resolveProps(this._def);
  }
  connectedCallback() {
    if (!this.isConnected) return;
    this.shadowRoot || this._parseSlots(), this._connected = !0;
    let t = this;
    for (; t = t && (t.parentNode || t.host); )
      if (t instanceof Vf) {
        this._parent = t;
        break;
      }
    this._instance || (this._resolved ? (this._setParent(), this._update()) : t && t._pendingResolve ? this._pendingResolve = t._pendingResolve.then(() => {
      this._pendingResolve = void 0, this._resolveDef();
    }) : this._resolveDef());
  }
  _setParent(t = this._parent) {
    t && (this._instance.parent = t._instance, this._instance.provides = t._instance.provides);
  }
  disconnectedCallback() {
    this._connected = !1, po(() => {
      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);
    });
  }
  /**
   * resolve inner component definition (handle possible async component)
   */
  _resolveDef() {
    if (this._pendingResolve)
      return;
    for (let s = 0; s < this.attributes.length; s++)
      this._setAttr(this.attributes[s].name);
    this._ob = new MutationObserver((s) => {
      for (const o of s)
        this._setAttr(o.attributeName);
    }), this._ob.observe(this, { attributes: !0 });
    const t = (s, o = !1) => {
      this._resolved = !0, this._pendingResolve = void 0;
      const { props: i, styles: r } = s;
      let a;
      if (i && !Ce(i))
        for (const l in i) {
          const u = i[l];
          (u === Number || u && u.type === Number) && (l in this._props && (this._props[l] = _c(this._props[l])), (a || (a = /* @__PURE__ */ Object.create(null)))[Gt(l)] = !0);
        }
      this._numberProps = a, o && this._resolveProps(s), this.shadowRoot ? this._applyStyles(r) : zt.NODE_ENV !== "production" && r && En(
        "Custom element style injection is not supported when using shadowRoot: false"
      ), this._mount(s);
    }, n = this._def.__asyncLoader;
    n ? this._pendingResolve = n().then(
      (s) => t(this._def = s, !0)
    ) : t(this._def);
  }
  _mount(t) {
    zt.NODE_ENV !== "production" && !t.name && (t.name = "VueElement"), this._app = this._createApp(t), t.configureApp && t.configureApp(this._app), this._app._ceVNode = this._createVNode(), this._app.mount(this._root);
    const n = this._instance && this._instance.exposed;
    if (n)
      for (const s in n)
        St(this, s) ? zt.NODE_ENV !== "production" && En(`Exposed property "${s}" already exists on custom element.`) : Object.defineProperty(this, s, {
          // unwrap ref to be consistent with public instance behavior
          get: () => C(n[s])
        });
  }
  _resolveProps(t) {
    const { props: n } = t, s = Ce(n) ? n : Object.keys(n || {});
    for (const o of Object.keys(this))
      o[0] !== "_" && s.includes(o) && this._setProp(o, this[o]);
    for (const o of s.map(Gt))
      Object.defineProperty(this, o, {
        get() {
          return this._getProp(o);
        },
        set(i) {
          this._setProp(o, i, !0, !0);
        }
      });
  }
  _setAttr(t) {
    if (t.startsWith("data-v-")) return;
    const n = this.hasAttribute(t);
    let s = n ? this.getAttribute(t) : Z_;
    const o = Gt(t);
    n && this._numberProps && this._numberProps[o] && (s = _c(s)), this._setProp(o, s, !1, !0);
  }
  /**
   * @internal
   */
  _getProp(t) {
    return this._props[t];
  }
  /**
   * @internal
   */
  _setProp(t, n, s = !0, o = !1) {
    if (n !== this._props[t] && (n === Z_ ? delete this._props[t] : (this._props[t] = n, t === "key" && this._app && (this._app._ceVNode.key = n)), o && this._instance && this._update(), s)) {
      const i = this._ob;
      i && i.disconnect(), n === !0 ? this.setAttribute(Un(t), "") : typeof n == "string" || typeof n == "number" ? this.setAttribute(Un(t), n + "") : n || this.removeAttribute(Un(t)), i && i.observe(this, { attributes: !0 });
    }
  }
  _update() {
    E0(this._createVNode(), this._root);
  }
  _createVNode() {
    const t = {};
    this.shadowRoot || (t.onVnodeMounted = t.onVnodeUpdated = this._renderSlots.bind(this));
    const n = D(this._def, it(t, this._props));
    return this._instance || (n.ce = (s) => {
      this._instance = s, s.ce = this, s.isCE = !0, zt.NODE_ENV !== "production" && (s.ceReload = (i) => {
        this._styles && (this._styles.forEach((r) => this._root.removeChild(r)), this._styles.length = 0), this._applyStyles(i), this._instance = null, this._update();
      });
      const o = (i, r) => {
        this.dispatchEvent(
          new CustomEvent(
            i,
            Yc(r[0]) ? it({ detail: r }, r[0]) : { detail: r }
          )
        );
      };
      s.emit = (i, ...r) => {
        o(i, r), Un(i) !== i && o(Un(i), r);
      }, this._setParent();
    }), n;
  }
  _applyStyles(t, n) {
    if (!t) return;
    if (n) {
      if (n === this._def || this._styleChildren.has(n))
        return;
      this._styleChildren.add(n);
    }
    const s = this._nonce;
    for (let o = t.length - 1; o >= 0; o--) {
      const i = document.createElement("style");
      if (s && i.setAttribute("nonce", s), i.textContent = t[o], this.shadowRoot.prepend(i), zt.NODE_ENV !== "production")
        if (n) {
          if (n.__hmrId) {
            this._childStyles || (this._childStyles = /* @__PURE__ */ new Map());
            let r = this._childStyles.get(n.__hmrId);
            r || this._childStyles.set(n.__hmrId, r = []), r.push(i);
          }
        } else
          (this._styles || (this._styles = [])).push(i);
    }
  }
  /**
   * Only called when shadowRoot is false
   */
  _parseSlots() {
    const t = this._slots = {};
    let n;
    for (; n = this.firstChild; ) {
      const s = n.nodeType === 1 && n.getAttribute("slot") || "default";
      (t[s] || (t[s] = [])).push(n), this.removeChild(n);
    }
  }
  /**
   * Only called when shadowRoot is false
   */
  _renderSlots() {
    const t = (this._teleportTarget || this).querySelectorAll("slot"), n = this._instance.type.__scopeId;
    for (let s = 0; s < t.length; s++) {
      const o = t[s], i = o.getAttribute("name") || "default", r = this._slots[i], a = o.parentNode;
      if (r)
        for (const l of r) {
          if (n && l.nodeType === 1) {
            const u = n + "-s", d = document.createTreeWalker(l, 1);
            l.setAttribute(u, "");
            let f;
            for (; f = d.nextNode(); )
              f.setAttribute(u, "");
          }
          a.insertBefore(l, o);
        }
      else
        for (; o.firstChild; ) a.insertBefore(o.firstChild, o);
      a.removeChild(o);
    }
  }
  /**
   * @internal
   */
  _injectChildStyle(t) {
    this._applyStyles(t.styles, t);
  }
  /**
   * @internal
   */
  _removeChildStyle(t) {
    if (zt.NODE_ENV !== "production" && (this._styleChildren.delete(t), this._childStyles && t.__hmrId)) {
      const n = this._childStyles.get(t.__hmrId);
      n && (n.forEach((s) => this._root.removeChild(s)), n.length = 0);
    }
  }
}
function cm(e) {
  const t = cn(), n = t && t.ce;
  return n || (zt.NODE_ENV !== "production" && En(
    t ? `${e || "useHost"} can only be used in components defined via defineCustomElement.` : `${e || "useHost"} called without an active component instance.`
  ), null);
}
function U$() {
  const e = zt.NODE_ENV !== "production" ? cm("useShadowRoot") : cm();
  return e && e.shadowRoot;
}
function j$(e = "$style") {
  {
    const t = cn();
    if (!t)
      return zt.NODE_ENV !== "production" && En("useCssModule must be called inside setup()"), pt;
    const n = t.type.__cssModules;
    if (!n)
      return zt.NODE_ENV !== "production" && En("Current instance does not have CSS modules injected."), pt;
    const s = n[e];
    return s || (zt.NODE_ENV !== "production" && En(`Current instance does not have CSS module named "${e}".`), pt);
  }
}
const p0 = /* @__PURE__ */ new WeakMap(), h0 = /* @__PURE__ */ new WeakMap(), jd = Symbol("_moveCb"), ey = Symbol("_enterCb"), B$ = (e) => (delete e.props.mode, e), H$ = /* @__PURE__ */ B$({
  name: "TransitionGroup",
  props: /* @__PURE__ */ it({}, a0, {
    tag: String,
    moveClass: String
  }),
  setup(e, { slots: t }) {
    const n = cn(), s = wv();
    let o, i;
    return If(() => {
      if (!o.length)
        return;
      const r = e.moveClass || `${e.name || "v"}-move`;
      if (!z$(
        o[0].el,
        n.vnode.el,
        r
      ))
        return;
      o.forEach(Y$), o.forEach(W$);
      const a = o.filter(G$);
      am(), a.forEach((l) => {
        const u = l.el, d = u.style;
        yo(u, r), d.transform = d.webkitTransform = d.transitionDuration = "";
        const f = u[jd] = (p) => {
          p && p.target !== u || (!p || /transform$/.test(p.propertyName)) && (u.removeEventListener("transitionend", f), u[jd] = null, Dr(u, r));
        };
        u.addEventListener("transitionend", f);
      });
    }), () => {
      const r = Ye(e), a = l0(r);
      let l = r.tag || G;
      if (o = [], i)
        for (let u = 0; u < i.length; u++) {
          const d = i[u];
          d.el && d.el instanceof Element && (o.push(d), _r(
            d,
            Wa(
              d,
              a,
              s,
              n
            )
          ), p0.set(
            d,
            d.el.getBoundingClientRect()
          ));
        }
      i = t.default ? Df(t.default()) : [];
      for (let u = 0; u < i.length; u++) {
        const d = i[u];
        d.key != null ? _r(
          d,
          Wa(d, a, s, n)
        ) : zt.NODE_ENV !== "production" && d.type !== To && En("<TransitionGroup> children must be keyed.");
      }
      return D(l, null, i);
    };
  }
}), m0 = H$;
function Y$(e) {
  const t = e.el;
  t[jd] && t[jd](), t[ey] && t[ey]();
}
function W$(e) {
  h0.set(e, e.el.getBoundingClientRect());
}
function G$(e) {
  const t = p0.get(e), n = h0.get(e), s = t.left - n.left, o = t.top - n.top;
  if (s || o) {
    const i = e.el.style;
    return i.transform = i.webkitTransform = `translate(${s}px,${o}px)`, i.transitionDuration = "0s", e;
  }
}
function z$(e, t, n) {
  const s = e.cloneNode(), o = e[za];
  o && o.forEach((a) => {
    a.split(/\s+/).forEach((l) => l && s.classList.remove(l));
  }), n.split(/\s+/).forEach((a) => a && s.classList.add(a)), s.style.display = "none";
  const i = t.nodeType === 1 ? t : t.parentNode;
  i.appendChild(s);
  const { hasTransform: r } = c0(s);
  return i.removeChild(s), r;
}
const ti = (e) => {
  const t = e.props["onUpdate:modelValue"] || !1;
  return Ce(t) ? (n) => or(t, n) : t;
};
function K$(e) {
  e.target.composing = !0;
}
function ty(e) {
  const t = e.target;
  t.composing && (t.composing = !1, t.dispatchEvent(new Event("input")));
}
const js = Symbol("_assign"), Ve = {
  created(e, { modifiers: { lazy: t, trim: n, number: s } }, o) {
    e[js] = ti(o);
    const i = s || o.props && o.props.type === "number";
    ir(e, t ? "change" : "input", (r) => {
      if (r.target.composing) return;
      let a = e.value;
      n && (a = a.trim()), i && (a = gc(a)), e[js](a);
    }), n && ir(e, "change", () => {
      e.value = e.value.trim();
    }), t || (ir(e, "compositionstart", K$), ir(e, "compositionend", ty), ir(e, "change", ty));
  },
  // set value on mounted so it's after min/max for type="range"
  mounted(e, { value: t }) {
    e.value = t ?? "";
  },
  beforeUpdate(e, { value: t, oldValue: n, modifiers: { lazy: s, trim: o, number: i } }, r) {
    if (e[js] = ti(r), e.composing) return;
    const a = (i || e.type === "number") && !/^0\d/.test(e.value) ? gc(e.value) : e.value, l = t ?? "";
    a !== l && (document.activeElement === e && e.type !== "range" && (s && t === n || o && e.value.trim() === l) || (e.value = l));
  }
}, mn = {
  // #4096 array checkboxes need to be deep traversed
  deep: !0,
  created(e, t, n) {
    e[js] = ti(n), ir(e, "change", () => {
      const s = e._modelValue, o = Ka(e), i = e.checked, r = e[js];
      if (Ce(s)) {
        const a = Wc(s, o), l = a !== -1;
        if (i && !l)
          r(s.concat(o));
        else if (!i && l) {
          const u = [...s];
          u.splice(a, 1), r(u);
        }
      } else if (oi(s)) {
        const a = new Set(s);
        i ? a.add(o) : a.delete(o), r(a);
      } else
        r(v0(e, i));
    });
  },
  // set initial checked on mount to wait for true-value/false-value
  mounted: ny,
  beforeUpdate(e, t, n) {
    e[js] = ti(n), ny(e, t, n);
  }
};
function ny(e, { value: t, oldValue: n }, s) {
  e._modelValue = t;
  let o;
  if (Ce(t))
    o = Wc(t, s.props.value) > -1;
  else if (oi(t))
    o = t.has(s.props.value);
  else {
    if (t === n) return;
    o = gr(t, v0(e, !0));
  }
  e.checked !== o && (e.checked = o);
}
const La = {
  created(e, { value: t }, n) {
    e.checked = gr(t, n.props.value), e[js] = ti(n), ir(e, "change", () => {
      e[js](Ka(e));
    });
  },
  beforeUpdate(e, { value: t, oldValue: n }, s) {
    e[js] = ti(s), t !== n && (e.checked = gr(t, s.props.value));
  }
}, Qt = {
  // <select multiple> value need to be deep traversed
  deep: !0,
  created(e, { value: t, modifiers: { number: n } }, s) {
    const o = oi(t);
    ir(e, "change", () => {
      const i = Array.prototype.filter.call(e.options, (r) => r.selected).map(
        (r) => n ? gc(Ka(r)) : Ka(r)
      );
      e[js](
        e.multiple ? o ? new Set(i) : i : i[0]
      ), e._assigning = !0, po(() => {
        e._assigning = !1;
      });
    }), e[js] = ti(s);
  },
  // set value in mounted & updated because <select> relies on its children
  // <option>s.
  mounted(e, { value: t }) {
    sy(e, t);
  },
  beforeUpdate(e, t, n) {
    e[js] = ti(n);
  },
  updated(e, { value: t }) {
    e._assigning || sy(e, t);
  }
};
function sy(e, t) {
  const n = e.multiple, s = Ce(t);
  if (n && !s && !oi(t)) {
    zt.NODE_ENV !== "production" && En(
      `<select multiple v-model> expects an Array or Set value for its binding, but got ${Object.prototype.toString.call(t).slice(8, -1)}.`
    );
    return;
  }
  for (let o = 0, i = e.options.length; o < i; o++) {
    const r = e.options[o], a = Ka(r);
    if (n)
      if (s) {
        const l = typeof a;
        l === "string" || l === "number" ? r.selected = t.some((u) => String(u) === String(a)) : r.selected = Wc(t, a) > -1;
      } else
        r.selected = t.has(a);
    else if (gr(Ka(r), t)) {
      e.selectedIndex !== o && (e.selectedIndex = o);
      return;
    }
  }
  !n && e.selectedIndex !== -1 && (e.selectedIndex = -1);
}
function Ka(e) {
  return "_value" in e ? e._value : e.value;
}
function v0(e, t) {
  const n = t ? "_trueValue" : "_falseValue";
  return n in e ? e[n] : t;
}
const Vv = {
  created(e, t, n) {
    xu(e, t, n, null, "created");
  },
  mounted(e, t, n) {
    xu(e, t, n, null, "mounted");
  },
  beforeUpdate(e, t, n, s) {
    xu(e, t, n, s, "beforeUpdate");
  },
  updated(e, t, n, s) {
    xu(e, t, n, s, "updated");
  }
};
function g0(e, t) {
  switch (e) {
    case "SELECT":
      return Qt;
    case "TEXTAREA":
      return Ve;
    default:
      switch (t) {
        case "checkbox":
          return mn;
        case "radio":
          return La;
        default:
          return Ve;
      }
  }
}
function xu(e, t, n, s, o) {
  const r = g0(
    e.tagName,
    n.props && n.props.type
  )[o];
  r && r(e, t, n, s);
}
function X$() {
  Ve.getSSRProps = ({ value: e }) => ({ value: e }), La.getSSRProps = ({ value: e }, t) => {
    if (t.props && gr(t.props.value, e))
      return { checked: !0 };
  }, mn.getSSRProps = ({ value: e }, t) => {
    if (Ce(e)) {
      if (t.props && Wc(e, t.props.value) > -1)
        return { checked: !0 };
    } else if (oi(e)) {
      if (t.props && e.has(t.props.value))
        return { checked: !0 };
    } else if (e)
      return { checked: !0 };
  }, Vv.getSSRProps = (e, t) => {
    if (typeof t.type != "string")
      return;
    const n = g0(
      // resolveDynamicModel expects an uppercase tag name, but vnode.type is lowercase
      t.type.toUpperCase(),
      t.props && t.props.type
    );
    if (n.getSSRProps)
      return n.getSSRProps(e, t);
  };
}
const q$ = ["ctrl", "shift", "alt", "meta"], J$ = {
  stop: (e) => e.stopPropagation(),
  prevent: (e) => e.preventDefault(),
  self: (e) => e.target !== e.currentTarget,
  ctrl: (e) => !e.ctrlKey,
  shift: (e) => !e.shiftKey,
  alt: (e) => !e.altKey,
  meta: (e) => !e.metaKey,
  left: (e) => "button" in e && e.button !== 0,
  middle: (e) => "button" in e && e.button !== 1,
  right: (e) => "button" in e && e.button !== 2,
  exact: (e, t) => q$.some((n) => e[`${n}Key`] && !t.includes(n))
}, Rt = (e, t) => {
  const n = e._withMods || (e._withMods = {}), s = t.join(".");
  return n[s] || (n[s] = (o, ...i) => {
    for (let r = 0; r < t.length; r++) {
      const a = J$[t[r]];
      if (a && a(o, t)) return;
    }
    return e(o, ...i);
  });
}, Q$ = {
  esc: "escape",
  space: " ",
  up: "arrow-up",
  left: "arrow-left",
  right: "arrow-right",
  down: "arrow-down",
  delete: "backspace"
}, Fv = (e, t) => {
  const n = e._withKeys || (e._withKeys = {}), s = t.join(".");
  return n[s] || (n[s] = (o) => {
    if (!("key" in o))
      return;
    const i = Un(o.key);
    if (t.some(
      (r) => r === i || Q$[r] === i
    ))
      return e(o);
  });
}, _0 = /* @__PURE__ */ it({ patchProp: P$ }, _$);
let sc, oy = !1;
function y0() {
  return sc || (sc = RE(_0));
}
function b0() {
  return sc = oy ? sc : IE(_0), oy = !0, sc;
}
const E0 = (...e) => {
  y0().render(...e);
}, Z$ = (...e) => {
  b0().hydrate(...e);
}, wn = (...e) => {
  const t = y0().createApp(...e);
  zt.NODE_ENV !== "production" && (x0(t), N0(t));
  const { mount: n } = t;
  return t.mount = (s) => {
    const o = C0(s);
    if (!o) return;
    const i = t._component;
    !Ue(i) && !i.render && !i.template && (i.template = o.innerHTML), o.nodeType === 1 && (o.textContent = "");
    const r = n(o, !1, S0(o));
    return o instanceof Element && (o.removeAttribute("v-cloak"), o.setAttribute("data-v-app", "")), r;
  }, t;
}, w0 = (...e) => {
  const t = b0().createApp(...e);
  zt.NODE_ENV !== "production" && (x0(t), N0(t));
  const { mount: n } = t;
  return t.mount = (s) => {
    const o = C0(s);
    if (o)
      return n(o, !0, S0(o));
  }, t;
};
function S0(e) {
  if (e instanceof SVGElement)
    return "svg";
  if (typeof MathMLElement == "function" && e instanceof MathMLElement)
    return "mathml";
}
function x0(e) {
  Object.defineProperty(e.config, "isNativeTag", {
    value: (t) => iv(t) || av(t) || lv(t),
    writable: !1
  });
}
function N0(e) {
  if (Pv()) {
    const t = e.config.isCustomElement;
    Object.defineProperty(e.config, "isCustomElement", {
      get() {
        return t;
      },
      set() {
        En(
          "The `isCustomElement` config option is deprecated. Use `compilerOptions.isCustomElement` instead."
        );
      }
    });
    const n = e.config.compilerOptions, s = 'The `compilerOptions` config option is only respected when using a build of Vue.js that includes the runtime compiler (aka "full build"). Since you are using the runtime-only build, `compilerOptions` must be passed to `@vue/compiler-dom` in the build setup instead.\n- For vue-loader: pass it via vue-loader\'s `compilerOptions` loader option.\n- For vue-cli: see https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader\n- For vite: pass it via @vitejs/plugin-vue options. See https://github.com/vitejs/vite-plugin-vue/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-sfc';
    Object.defineProperty(e.config, "compilerOptions", {
      get() {
        return En(s), n;
      },
      set() {
        En(s);
      }
    });
  }
}
function C0(e) {
  if (Ge(e)) {
    const t = document.querySelector(e);
    return zt.NODE_ENV !== "production" && !t && En(
      `Failed to mount app: mount target selector "${e}" returned null.`
    ), t;
  }
  return zt.NODE_ENV !== "production" && window.ShadowRoot && e instanceof window.ShadowRoot && e.mode === "closed" && En(
    'mounting on a ShadowRoot with `{mode: "closed"}` may lead to unpredictable bugs'
  ), e;
}
let ry = !1;
const ek = () => {
  ry || (ry = !0, X$(), S$());
}, tk = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  BaseTransition: iE,
  BaseTransitionPropsValidators: Sv,
  Comment: Zt,
  DeprecationTypes: m$,
  EffectScope: cv,
  ErrorCodes: pO,
  ErrorTypeStrings: l$,
  Fragment: G,
  KeepAlive: dE,
  ReactiveEffect: yc,
  Static: qr,
  Suspense: WT,
  Teleport: ns,
  Text: To,
  TrackOpTypes: rO,
  Transition: Lv,
  TransitionGroup: m0,
  TriggerOpTypes: iO,
  VueElement: Vf,
  assertNumber: _v,
  callWithAsyncErrorHandling: Ys,
  callWithErrorHandling: ra,
  camelize: Gt,
  capitalize: fo,
  cloneVNode: Ws,
  compatUtils: h$,
  computed: k,
  createApp: wn,
  createBlock: se,
  createCommentVNode: ne,
  createElementBlock: E,
  createElementVNode: c,
  createHydrationRenderer: IE,
  createPropsRestProxy: pT,
  createRenderer: RE,
  createSSRApp: w0,
  createSlots: QO,
  createStaticVNode: Av,
  createTextVNode: te,
  createVNode: D,
  customRef: H1,
  defineAsyncComponent: KO,
  defineComponent: Rn,
  defineCustomElement: f0,
  defineEmits: rT,
  defineExpose: iT,
  defineModel: cT,
  defineOptions: aT,
  defineProps: oT,
  defineSSRCustomElement: V$,
  defineSlots: lT,
  devtools: c$,
  effect: kC,
  effectScope: uv,
  getCurrentInstance: cn,
  getCurrentScope: dv,
  getCurrentWatcher: aO,
  getTransitionRawChildren: Df,
  guardReactiveProps: Dt,
  h: Co,
  handleError: ri,
  hasInjectionContext: wE,
  hydrate: Z$,
  hydrateOnIdle: BO,
  hydrateOnInteraction: GO,
  hydrateOnMediaQuery: WO,
  hydrateOnVisible: YO,
  initCustomFormatter: s0,
  initDirectivesForSSR: ek,
  inject: $e,
  isMemoSame: o0,
  isProxy: Ha,
  isReactive: Us,
  isReadonly: Ro,
  isRef: ut,
  isRuntimeOnly: Pv,
  isShallow: Qn,
  isVNode: Ao,
  markRaw: lr,
  mergeDefaults: fT,
  mergeModels: jn,
  mergeProps: bn,
  nextTick: po,
  normalizeClass: Se,
  normalizeProps: kt,
  normalizeStyle: Jn,
  onActivated: Nv,
  onBeforeMount: pE,
  onBeforeUnmount: ii,
  onBeforeUpdate: Ov,
  onDeactivated: Cv,
  onErrorCaptured: gE,
  onMounted: vt,
  onRenderTracked: vE,
  onRenderTriggered: mE,
  onScopeDispose: C1,
  onServerPrefetch: hE,
  onUnmounted: Fo,
  onUpdated: If,
  onWatcherCleanup: W1,
  openBlock: g,
  popScopeId: $O,
  provide: Cn,
  proxyRefs: gv,
  pushScopeId: TO,
  queuePostFlushCb: Ya,
  reactive: qe,
  readonly: Cf,
  ref: I,
  registerRuntimeCompiler: s$,
  render: E0,
  renderList: ge,
  renderSlot: fe,
  resolveComponent: le,
  resolveDirective: Ht,
  resolveDynamicComponent: Hi,
  resolveFilter: p$,
  resolveTransitionHooks: Wa,
  setBlockTracking: Qh,
  setDevtoolsHook: u$,
  setTransitionHooks: _r,
  shallowReactive: mv,
  shallowReadonly: ro,
  shallowRef: vv,
  ssrContextKey: LE,
  ssrUtils: f$,
  stop: DC,
  toDisplayString: F,
  toHandlerKey: to,
  toHandlers: ZO,
  toRaw: Ye,
  toRef: Ra,
  toRefs: he,
  toValue: QC,
  transformVNodeArgs: JT,
  triggerRef: JC,
  unref: C,
  useAttrs: dT,
  useCssModule: j$,
  useCssVars: x$,
  useHost: cm,
  useId: IO,
  useModel: At,
  useSSRContext: VE,
  useShadowRoot: U$,
  useSlots: _E,
  useTemplateRef: Io,
  useTransitionState: wv,
  vModelCheckbox: mn,
  vModelDynamic: Vv,
  vModelRadio: La,
  vModelSelect: Qt,
  vModelText: Ve,
  vShow: Gi,
  version: rm,
  warn: En,
  watch: nt,
  watchEffect: Ft,
  watchPostEffect: VT,
  watchSyncEffect: FE,
  withAsyncContext: hT,
  withCtx: B,
  withDefaults: uT,
  withDirectives: L,
  withKeys: Fv,
  withMemo: a$,
  withModifiers: Rt,
  withScopeId: kO
}, Symbol.toStringTag, { value: "Module" }));
var nk = {};
function sk() {
  s0();
}
nk.NODE_ENV !== "production" && sk();
function ok() {
  return "10000000-1000-4000-8000-100000000000".replace(
    /[018]/g,
    (e) => (e ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> e / 4).toString(16)
  );
}
const um = {}, Ns = (e, t, n = !1) => {
  const s = ok();
  return n && (um[s] = {}), () => {
    const i = $e("store");
    let r = n ? um[s] : i;
    return typeof r[e] > "u" && (r[e] = t()), r[e];
  };
}, ai = () => {
  const e = {};
  return {
    install: (t) => {
      t.config.globalProperties.$store = e, t.provide("store", e), t.config.globalProperties.$sharedStore = e, t.provide("sharedStore", um);
    }
  };
};
//! moment.js
//! version : 2.30.1
//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
//! license : MIT
//! momentjs.com
var O0;
function me() {
  return O0.apply(null, arguments);
}
function rk(e) {
  O0 = e;
}
function ho(e) {
  return e instanceof Array || Object.prototype.toString.call(e) === "[object Array]";
}
function Li(e) {
  return e != null && Object.prototype.toString.call(e) === "[object Object]";
}
function Mt(e, t) {
  return Object.prototype.hasOwnProperty.call(e, t);
}
function Uv(e) {
  if (Object.getOwnPropertyNames)
    return Object.getOwnPropertyNames(e).length === 0;
  var t;
  for (t in e)
    if (Mt(e, t))
      return !1;
  return !0;
}
function _s(e) {
  return e === void 0;
}
function yr(e) {
  return typeof e == "number" || Object.prototype.toString.call(e) === "[object Number]";
}
function Xc(e) {
  return e instanceof Date || Object.prototype.toString.call(e) === "[object Date]";
}
function T0(e, t) {
  var n = [], s, o = e.length;
  for (s = 0; s < o; ++s)
    n.push(t(e[s], s));
  return n;
}
function Hr(e, t) {
  for (var n in t)
    Mt(t, n) && (e[n] = t[n]);
  return Mt(t, "toString") && (e.toString = t.toString), Mt(t, "valueOf") && (e.valueOf = t.valueOf), e;
}
function Uo(e, t, n, s) {
  return J0(e, t, n, s, !0).utc();
}
function ik() {
  return {
    empty: !1,
    unusedTokens: [],
    unusedInput: [],
    overflow: -2,
    charsLeftOver: 0,
    nullInput: !1,
    invalidEra: null,
    invalidMonth: null,
    invalidFormat: !1,
    userInvalidated: !1,
    iso: !1,
    parsedDateParts: [],
    era: null,
    meridiem: null,
    rfc2822: !1,
    weekdayMismatch: !1
  };
}
function dt(e) {
  return e._pf == null && (e._pf = ik()), e._pf;
}
var dm;
Array.prototype.some ? dm = Array.prototype.some : dm = function(e) {
  var t = Object(this), n = t.length >>> 0, s;
  for (s = 0; s < n; s++)
    if (s in t && e.call(this, t[s], s, t))
      return !0;
  return !1;
};
function jv(e) {
  var t = null, n = !1, s = e._d && !isNaN(e._d.getTime());
  if (s && (t = dt(e), n = dm.call(t.parsedDateParts, function(o) {
    return o != null;
  }), s = t.overflow < 0 && !t.empty && !t.invalidEra && !t.invalidMonth && !t.invalidWeekday && !t.weekdayMismatch && !t.nullInput && !t.invalidFormat && !t.userInvalidated && (!t.meridiem || t.meridiem && n), e._strict && (s = s && t.charsLeftOver === 0 && t.unusedTokens.length === 0 && t.bigHour === void 0)), Object.isFrozen == null || !Object.isFrozen(e))
    e._isValid = s;
  else
    return s;
  return e._isValid;
}
function Ff(e) {
  var t = Uo(NaN);
  return e != null ? Hr(dt(t), e) : dt(t).userInvalidated = !0, t;
}
var iy = me.momentProperties = [], Zp = !1;
function Bv(e, t) {
  var n, s, o, i = iy.length;
  if (_s(t._isAMomentObject) || (e._isAMomentObject = t._isAMomentObject), _s(t._i) || (e._i = t._i), _s(t._f) || (e._f = t._f), _s(t._l) || (e._l = t._l), _s(t._strict) || (e._strict = t._strict), _s(t._tzm) || (e._tzm = t._tzm), _s(t._isUTC) || (e._isUTC = t._isUTC), _s(t._offset) || (e._offset = t._offset), _s(t._pf) || (e._pf = dt(t)), _s(t._locale) || (e._locale = t._locale), i > 0)
    for (n = 0; n < i; n++)
      s = iy[n], o = t[s], _s(o) || (e[s] = o);
  return e;
}
function qc(e) {
  Bv(this, e), this._d = new Date(e._d != null ? e._d.getTime() : NaN), this.isValid() || (this._d = /* @__PURE__ */ new Date(NaN)), Zp === !1 && (Zp = !0, me.updateOffset(this), Zp = !1);
}
function mo(e) {
  return e instanceof qc || e != null && e._isAMomentObject != null;
}
function $0(e) {
  me.suppressDeprecationWarnings === !1 && typeof console < "u" && console.warn && console.warn("Deprecation warning: " + e);
}
function Ks(e, t) {
  var n = !0;
  return Hr(function() {
    if (me.deprecationHandler != null && me.deprecationHandler(null, e), n) {
      var s = [], o, i, r, a = arguments.length;
      for (i = 0; i < a; i++) {
        if (o = "", typeof arguments[i] == "object") {
          o += `
[` + i + "] ";
          for (r in arguments[0])
            Mt(arguments[0], r) && (o += r + ": " + arguments[0][r] + ", ");
          o = o.slice(0, -2);
        } else
          o = arguments[i];
        s.push(o);
      }
      $0(
        e + `
Arguments: ` + Array.prototype.slice.call(s).join("") + `
` + new Error().stack
      ), n = !1;
    }
    return t.apply(this, arguments);
  }, t);
}
var ay = {};
function k0(e, t) {
  me.deprecationHandler != null && me.deprecationHandler(e, t), ay[e] || ($0(t), ay[e] = !0);
}
me.suppressDeprecationWarnings = !1;
me.deprecationHandler = null;
function jo(e) {
  return typeof Function < "u" && e instanceof Function || Object.prototype.toString.call(e) === "[object Function]";
}
function ak(e) {
  var t, n;
  for (n in e)
    Mt(e, n) && (t = e[n], jo(t) ? this[n] = t : this["_" + n] = t);
  this._config = e, this._dayOfMonthOrdinalParseLenient = new RegExp(
    (this._dayOfMonthOrdinalParse.source || this._ordinalParse.source) + "|" + /\d{1,2}/.source
  );
}
function fm(e, t) {
  var n = Hr({}, e), s;
  for (s in t)
    Mt(t, s) && (Li(e[s]) && Li(t[s]) ? (n[s] = {}, Hr(n[s], e[s]), Hr(n[s], t[s])) : t[s] != null ? n[s] = t[s] : delete n[s]);
  for (s in e)
    Mt(e, s) && !Mt(t, s) && Li(e[s]) && (n[s] = Hr({}, n[s]));
  return n;
}
function Hv(e) {
  e != null && this.set(e);
}
var pm;
Object.keys ? pm = Object.keys : pm = function(e) {
  var t, n = [];
  for (t in e)
    Mt(e, t) && n.push(t);
  return n;
};
var lk = {
  sameDay: "[Today at] LT",
  nextDay: "[Tomorrow at] LT",
  nextWeek: "dddd [at] LT",
  lastDay: "[Yesterday at] LT",
  lastWeek: "[Last] dddd [at] LT",
  sameElse: "L"
};
function ck(e, t, n) {
  var s = this._calendar[e] || this._calendar.sameElse;
  return jo(s) ? s.call(t, n) : s;
}
function Mo(e, t, n) {
  var s = "" + Math.abs(e), o = t - s.length, i = e >= 0;
  return (i ? n ? "+" : "" : "-") + Math.pow(10, Math.max(0, o)).toString().substr(1) + s;
}
var Yv = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g, Nu = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g, eh = {}, Va = {};
function He(e, t, n, s) {
  var o = s;
  typeof s == "string" && (o = function() {
    return this[s]();
  }), e && (Va[e] = o), t && (Va[t[0]] = function() {
    return Mo(o.apply(this, arguments), t[1], t[2]);
  }), n && (Va[n] = function() {
    return this.localeData().ordinal(
      o.apply(this, arguments),
      e
    );
  });
}
function uk(e) {
  return e.match(/\[[\s\S]/) ? e.replace(/^\[|\]$/g, "") : e.replace(/\\/g, "");
}
function dk(e) {
  var t = e.match(Yv), n, s;
  for (n = 0, s = t.length; n < s; n++)
    Va[t[n]] ? t[n] = Va[t[n]] : t[n] = uk(t[n]);
  return function(o) {
    var i = "", r;
    for (r = 0; r < s; r++)
      i += jo(t[r]) ? t[r].call(o, e) : t[r];
    return i;
  };
}
function sd(e, t) {
  return e.isValid() ? (t = D0(t, e.localeData()), eh[t] = eh[t] || dk(t), eh[t](e)) : e.localeData().invalidDate();
}
function D0(e, t) {
  var n = 5;
  function s(o) {
    return t.longDateFormat(o) || o;
  }
  for (Nu.lastIndex = 0; n >= 0 && Nu.test(e); )
    e = e.replace(
      Nu,
      s
    ), Nu.lastIndex = 0, n -= 1;
  return e;
}
var fk = {
  LTS: "h:mm:ss A",
  LT: "h:mm A",
  L: "MM/DD/YYYY",
  LL: "MMMM D, YYYY",
  LLL: "MMMM D, YYYY h:mm A",
  LLLL: "dddd, MMMM D, YYYY h:mm A"
};
function pk(e) {
  var t = this._longDateFormat[e], n = this._longDateFormat[e.toUpperCase()];
  return t || !n ? t : (this._longDateFormat[e] = n.match(Yv).map(function(s) {
    return s === "MMMM" || s === "MM" || s === "DD" || s === "dddd" ? s.slice(1) : s;
  }).join(""), this._longDateFormat[e]);
}
var hk = "Invalid date";
function mk() {
  return this._invalidDate;
}
var vk = "%d", gk = /\d{1,2}/;
function _k(e) {
  return this._ordinal.replace("%d", e);
}
var yk = {
  future: "in %s",
  past: "%s ago",
  s: "a few seconds",
  ss: "%d seconds",
  m: "a minute",
  mm: "%d minutes",
  h: "an hour",
  hh: "%d hours",
  d: "a day",
  dd: "%d days",
  w: "a week",
  ww: "%d weeks",
  M: "a month",
  MM: "%d months",
  y: "a year",
  yy: "%d years"
};
function bk(e, t, n, s) {
  var o = this._relativeTime[n];
  return jo(o) ? o(e, t, n, s) : o.replace(/%d/i, e);
}
function Ek(e, t) {
  var n = this._relativeTime[e > 0 ? "future" : "past"];
  return jo(n) ? n(t) : n.replace(/%s/i, t);
}
var ly = {
  D: "date",
  dates: "date",
  date: "date",
  d: "day",
  days: "day",
  day: "day",
  e: "weekday",
  weekdays: "weekday",
  weekday: "weekday",
  E: "isoWeekday",
  isoweekdays: "isoWeekday",
  isoweekday: "isoWeekday",
  DDD: "dayOfYear",
  dayofyears: "dayOfYear",
  dayofyear: "dayOfYear",
  h: "hour",
  hours: "hour",
  hour: "hour",
  ms: "millisecond",
  milliseconds: "millisecond",
  millisecond: "millisecond",
  m: "minute",
  minutes: "minute",
  minute: "minute",
  M: "month",
  months: "month",
  month: "month",
  Q: "quarter",
  quarters: "quarter",
  quarter: "quarter",
  s: "second",
  seconds: "second",
  second: "second",
  gg: "weekYear",
  weekyears: "weekYear",
  weekyear: "weekYear",
  GG: "isoWeekYear",
  isoweekyears: "isoWeekYear",
  isoweekyear: "isoWeekYear",
  w: "week",
  weeks: "week",
  week: "week",
  W: "isoWeek",
  isoweeks: "isoWeek",
  isoweek: "isoWeek",
  y: "year",
  years: "year",
  year: "year"
};
function Xs(e) {
  return typeof e == "string" ? ly[e] || ly[e.toLowerCase()] : void 0;
}
function Wv(e) {
  var t = {}, n, s;
  for (s in e)
    Mt(e, s) && (n = Xs(s), n && (t[n] = e[s]));
  return t;
}
var wk = {
  date: 9,
  day: 11,
  weekday: 11,
  isoWeekday: 11,
  dayOfYear: 4,
  hour: 13,
  millisecond: 16,
  minute: 14,
  month: 8,
  quarter: 7,
  second: 15,
  weekYear: 1,
  isoWeekYear: 1,
  week: 5,
  isoWeek: 5,
  year: 1
};
function Sk(e) {
  var t = [], n;
  for (n in e)
    Mt(e, n) && t.push({ unit: n, priority: wk[n] });
  return t.sort(function(s, o) {
    return s.priority - o.priority;
  }), t;
}
var R0 = /\d/, Rs = /\d\d/, I0 = /\d{3}/, Gv = /\d{4}/, Uf = /[+-]?\d{6}/, tn = /\d\d?/, A0 = /\d\d\d\d?/, M0 = /\d\d\d\d\d\d?/, jf = /\d{1,3}/, zv = /\d{1,4}/, Bf = /[+-]?\d{1,6}/, cl = /\d+/, Hf = /[+-]?\d+/, xk = /Z|[+-]\d\d:?\d\d/gi, Yf = /Z|[+-]\d\d(?::?\d\d)?/gi, Nk = /[+-]?\d+(\.\d{1,3})?/, Jc = /[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i, ul = /^[1-9]\d?/, Kv = /^([1-9]\d|\d)/, Bd;
Bd = {};
function Re(e, t, n) {
  Bd[e] = jo(t) ? t : function(s, o) {
    return s && n ? n : t;
  };
}
function Ck(e, t) {
  return Mt(Bd, e) ? Bd[e](t._strict, t._locale) : new RegExp(Ok(e));
}
function Ok(e) {
  return pr(
    e.replace("\\", "").replace(
      /\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,
      function(t, n, s, o, i) {
        return n || s || o || i;
      }
    )
  );
}
function pr(e) {
  return e.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&");
}
function Vs(e) {
  return e < 0 ? Math.ceil(e) || 0 : Math.floor(e);
}
function bt(e) {
  var t = +e, n = 0;
  return t !== 0 && isFinite(t) && (n = Vs(t)), n;
}
var hm = {};
function Kt(e, t) {
  var n, s = t, o;
  for (typeof e == "string" && (e = [e]), yr(t) && (s = function(i, r) {
    r[t] = bt(i);
  }), o = e.length, n = 0; n < o; n++)
    hm[e[n]] = s;
}
function Qc(e, t) {
  Kt(e, function(n, s, o, i) {
    o._w = o._w || {}, t(n, o._w, o, i);
  });
}
function Tk(e, t, n) {
  t != null && Mt(hm, e) && hm[e](t, n._a, n, e);
}
function Wf(e) {
  return e % 4 === 0 && e % 100 !== 0 || e % 400 === 0;
}
var Zn = 0, cr = 1, No = 2, Dn = 3, ao = 4, ur = 5, xi = 6, $k = 7, kk = 8;
He("Y", 0, 0, function() {
  var e = this.year();
  return e <= 9999 ? Mo(e, 4) : "+" + e;
});
He(0, ["YY", 2], 0, function() {
  return this.year() % 100;
});
He(0, ["YYYY", 4], 0, "year");
He(0, ["YYYYY", 5], 0, "year");
He(0, ["YYYYYY", 6, !0], 0, "year");
Re("Y", Hf);
Re("YY", tn, Rs);
Re("YYYY", zv, Gv);
Re("YYYYY", Bf, Uf);
Re("YYYYYY", Bf, Uf);
Kt(["YYYYY", "YYYYYY"], Zn);
Kt("YYYY", function(e, t) {
  t[Zn] = e.length === 2 ? me.parseTwoDigitYear(e) : bt(e);
});
Kt("YY", function(e, t) {
  t[Zn] = me.parseTwoDigitYear(e);
});
Kt("Y", function(e, t) {
  t[Zn] = parseInt(e, 10);
});
function oc(e) {
  return Wf(e) ? 366 : 365;
}
me.parseTwoDigitYear = function(e) {
  return bt(e) + (bt(e) > 68 ? 1900 : 2e3);
};
var P0 = dl("FullYear", !0);
function Dk() {
  return Wf(this.year());
}
function dl(e, t) {
  return function(n) {
    return n != null ? (L0(this, e, n), me.updateOffset(this, t), this) : Tc(this, e);
  };
}
function Tc(e, t) {
  if (!e.isValid())
    return NaN;
  var n = e._d, s = e._isUTC;
  switch (t) {
    case "Milliseconds":
      return s ? n.getUTCMilliseconds() : n.getMilliseconds();
    case "Seconds":
      return s ? n.getUTCSeconds() : n.getSeconds();
    case "Minutes":
      return s ? n.getUTCMinutes() : n.getMinutes();
    case "Hours":
      return s ? n.getUTCHours() : n.getHours();
    case "Date":
      return s ? n.getUTCDate() : n.getDate();
    case "Day":
      return s ? n.getUTCDay() : n.getDay();
    case "Month":
      return s ? n.getUTCMonth() : n.getMonth();
    case "FullYear":
      return s ? n.getUTCFullYear() : n.getFullYear();
    default:
      return NaN;
  }
}
function L0(e, t, n) {
  var s, o, i, r, a;
  if (!(!e.isValid() || isNaN(n))) {
    switch (s = e._d, o = e._isUTC, t) {
      case "Milliseconds":
        return void (o ? s.setUTCMilliseconds(n) : s.setMilliseconds(n));
      case "Seconds":
        return void (o ? s.setUTCSeconds(n) : s.setSeconds(n));
      case "Minutes":
        return void (o ? s.setUTCMinutes(n) : s.setMinutes(n));
      case "Hours":
        return void (o ? s.setUTCHours(n) : s.setHours(n));
      case "Date":
        return void (o ? s.setUTCDate(n) : s.setDate(n));
      // case 'Day': // Not real
      //    return void (isUTC ? d.setUTCDay(value) : d.setDay(value));
      // case 'Month': // Not used because we need to pass two variables
      //     return void (isUTC ? d.setUTCMonth(value) : d.setMonth(value));
      case "FullYear":
        break;
      // See below ...
      default:
        return;
    }
    i = n, r = e.month(), a = e.date(), a = a === 29 && r === 1 && !Wf(i) ? 28 : a, o ? s.setUTCFullYear(i, r, a) : s.setFullYear(i, r, a);
  }
}
function Rk(e) {
  return e = Xs(e), jo(this[e]) ? this[e]() : this;
}
function Ik(e, t) {
  if (typeof e == "object") {
    e = Wv(e);
    var n = Sk(e), s, o = n.length;
    for (s = 0; s < o; s++)
      this[n[s].unit](e[n[s].unit]);
  } else if (e = Xs(e), jo(this[e]))
    return this[e](t);
  return this;
}
function Ak(e, t) {
  return (e % t + t) % t;
}
var _n;
Array.prototype.indexOf ? _n = Array.prototype.indexOf : _n = function(e) {
  var t;
  for (t = 0; t < this.length; ++t)
    if (this[t] === e)
      return t;
  return -1;
};
function Xv(e, t) {
  if (isNaN(e) || isNaN(t))
    return NaN;
  var n = Ak(t, 12);
  return e += (t - n) / 12, n === 1 ? Wf(e) ? 29 : 28 : 31 - n % 7 % 2;
}
He("M", ["MM", 2], "Mo", function() {
  return this.month() + 1;
});
He("MMM", 0, 0, function(e) {
  return this.localeData().monthsShort(this, e);
});
He("MMMM", 0, 0, function(e) {
  return this.localeData().months(this, e);
});
Re("M", tn, ul);
Re("MM", tn, Rs);
Re("MMM", function(e, t) {
  return t.monthsShortRegex(e);
});
Re("MMMM", function(e, t) {
  return t.monthsRegex(e);
});
Kt(["M", "MM"], function(e, t) {
  t[cr] = bt(e) - 1;
});
Kt(["MMM", "MMMM"], function(e, t, n, s) {
  var o = n._locale.monthsParse(e, s, n._strict);
  o != null ? t[cr] = o : dt(n).invalidMonth = e;
});
var Mk = "January_February_March_April_May_June_July_August_September_October_November_December".split(
  "_"
), V0 = "Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"), F0 = /D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/, Pk = Jc, Lk = Jc;
function Vk(e, t) {
  return e ? ho(this._months) ? this._months[e.month()] : this._months[(this._months.isFormat || F0).test(t) ? "format" : "standalone"][e.month()] : ho(this._months) ? this._months : this._months.standalone;
}
function Fk(e, t) {
  return e ? ho(this._monthsShort) ? this._monthsShort[e.month()] : this._monthsShort[F0.test(t) ? "format" : "standalone"][e.month()] : ho(this._monthsShort) ? this._monthsShort : this._monthsShort.standalone;
}
function Uk(e, t, n) {
  var s, o, i, r = e.toLocaleLowerCase();
  if (!this._monthsParse)
    for (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = [], s = 0; s < 12; ++s)
      i = Uo([2e3, s]), this._shortMonthsParse[s] = this.monthsShort(
        i,
        ""
      ).toLocaleLowerCase(), this._longMonthsParse[s] = this.months(i, "").toLocaleLowerCase();
  return n ? t === "MMM" ? (o = _n.call(this._shortMonthsParse, r), o !== -1 ? o : null) : (o = _n.call(this._longMonthsParse, r), o !== -1 ? o : null) : t === "MMM" ? (o = _n.call(this._shortMonthsParse, r), o !== -1 ? o : (o = _n.call(this._longMonthsParse, r), o !== -1 ? o : null)) : (o = _n.call(this._longMonthsParse, r), o !== -1 ? o : (o = _n.call(this._shortMonthsParse, r), o !== -1 ? o : null));
}
function jk(e, t, n) {
  var s, o, i;
  if (this._monthsParseExact)
    return Uk.call(this, e, t, n);
  for (this._monthsParse || (this._monthsParse = [], this._longMonthsParse = [], this._shortMonthsParse = []), s = 0; s < 12; s++) {
    if (o = Uo([2e3, s]), n && !this._longMonthsParse[s] && (this._longMonthsParse[s] = new RegExp(
      "^" + this.months(o, "").replace(".", "") + "$",
      "i"
    ), this._shortMonthsParse[s] = new RegExp(
      "^" + this.monthsShort(o, "").replace(".", "") + "$",
      "i"
    )), !n && !this._monthsParse[s] && (i = "^" + this.months(o, "") + "|^" + this.monthsShort(o, ""), this._monthsParse[s] = new RegExp(i.replace(".", ""), "i")), n && t === "MMMM" && this._longMonthsParse[s].test(e))
      return s;
    if (n && t === "MMM" && this._shortMonthsParse[s].test(e))
      return s;
    if (!n && this._monthsParse[s].test(e))
      return s;
  }
}
function U0(e, t) {
  if (!e.isValid())
    return e;
  if (typeof t == "string") {
    if (/^\d+$/.test(t))
      t = bt(t);
    else if (t = e.localeData().monthsParse(t), !yr(t))
      return e;
  }
  var n = t, s = e.date();
  return s = s < 29 ? s : Math.min(s, Xv(e.year(), n)), e._isUTC ? e._d.setUTCMonth(n, s) : e._d.setMonth(n, s), e;
}
function j0(e) {
  return e != null ? (U0(this, e), me.updateOffset(this, !0), this) : Tc(this, "Month");
}
function Bk() {
  return Xv(this.year(), this.month());
}
function Hk(e) {
  return this._monthsParseExact ? (Mt(this, "_monthsRegex") || B0.call(this), e ? this._monthsShortStrictRegex : this._monthsShortRegex) : (Mt(this, "_monthsShortRegex") || (this._monthsShortRegex = Pk), this._monthsShortStrictRegex && e ? this._monthsShortStrictRegex : this._monthsShortRegex);
}
function Yk(e) {
  return this._monthsParseExact ? (Mt(this, "_monthsRegex") || B0.call(this), e ? this._monthsStrictRegex : this._monthsRegex) : (Mt(this, "_monthsRegex") || (this._monthsRegex = Lk), this._monthsStrictRegex && e ? this._monthsStrictRegex : this._monthsRegex);
}
function B0() {
  function e(l, u) {
    return u.length - l.length;
  }
  var t = [], n = [], s = [], o, i, r, a;
  for (o = 0; o < 12; o++)
    i = Uo([2e3, o]), r = pr(this.monthsShort(i, "")), a = pr(this.months(i, "")), t.push(r), n.push(a), s.push(a), s.push(r);
  t.sort(e), n.sort(e), s.sort(e), this._monthsRegex = new RegExp("^(" + s.join("|") + ")", "i"), this._monthsShortRegex = this._monthsRegex, this._monthsStrictRegex = new RegExp(
    "^(" + n.join("|") + ")",
    "i"
  ), this._monthsShortStrictRegex = new RegExp(
    "^(" + t.join("|") + ")",
    "i"
  );
}
function Wk(e, t, n, s, o, i, r) {
  var a;
  return e < 100 && e >= 0 ? (a = new Date(e + 400, t, n, s, o, i, r), isFinite(a.getFullYear()) && a.setFullYear(e)) : a = new Date(e, t, n, s, o, i, r), a;
}
function $c(e) {
  var t, n;
  return e < 100 && e >= 0 ? (n = Array.prototype.slice.call(arguments), n[0] = e + 400, t = new Date(Date.UTC.apply(null, n)), isFinite(t.getUTCFullYear()) && t.setUTCFullYear(e)) : t = new Date(Date.UTC.apply(null, arguments)), t;
}
function Hd(e, t, n) {
  var s = 7 + t - n, o = (7 + $c(e, 0, s).getUTCDay() - t) % 7;
  return -o + s - 1;
}
function H0(e, t, n, s, o) {
  var i = (7 + n - s) % 7, r = Hd(e, s, o), a = 1 + 7 * (t - 1) + i + r, l, u;
  return a <= 0 ? (l = e - 1, u = oc(l) + a) : a > oc(e) ? (l = e + 1, u = a - oc(e)) : (l = e, u = a), {
    year: l,
    dayOfYear: u
  };
}
function kc(e, t, n) {
  var s = Hd(e.year(), t, n), o = Math.floor((e.dayOfYear() - s - 1) / 7) + 1, i, r;
  return o < 1 ? (r = e.year() - 1, i = o + hr(r, t, n)) : o > hr(e.year(), t, n) ? (i = o - hr(e.year(), t, n), r = e.year() + 1) : (r = e.year(), i = o), {
    week: i,
    year: r
  };
}
function hr(e, t, n) {
  var s = Hd(e, t, n), o = Hd(e + 1, t, n);
  return (oc(e) - s + o) / 7;
}
He("w", ["ww", 2], "wo", "week");
He("W", ["WW", 2], "Wo", "isoWeek");
Re("w", tn, ul);
Re("ww", tn, Rs);
Re("W", tn, ul);
Re("WW", tn, Rs);
Qc(
  ["w", "ww", "W", "WW"],
  function(e, t, n, s) {
    t[s.substr(0, 1)] = bt(e);
  }
);
function Gk(e) {
  return kc(e, this._week.dow, this._week.doy).week;
}
var zk = {
  dow: 0,
  // Sunday is the first day of the week.
  doy: 6
  // The week that contains Jan 6th is the first week of the year.
};
function Kk() {
  return this._week.dow;
}
function Xk() {
  return this._week.doy;
}
function qk(e) {
  var t = this.localeData().week(this);
  return e == null ? t : this.add((e - t) * 7, "d");
}
function Jk(e) {
  var t = kc(this, 1, 4).week;
  return e == null ? t : this.add((e - t) * 7, "d");
}
He("d", 0, "do", "day");
He("dd", 0, 0, function(e) {
  return this.localeData().weekdaysMin(this, e);
});
He("ddd", 0, 0, function(e) {
  return this.localeData().weekdaysShort(this, e);
});
He("dddd", 0, 0, function(e) {
  return this.localeData().weekdays(this, e);
});
He("e", 0, 0, "weekday");
He("E", 0, 0, "isoWeekday");
Re("d", tn);
Re("e", tn);
Re("E", tn);
Re("dd", function(e, t) {
  return t.weekdaysMinRegex(e);
});
Re("ddd", function(e, t) {
  return t.weekdaysShortRegex(e);
});
Re("dddd", function(e, t) {
  return t.weekdaysRegex(e);
});
Qc(["dd", "ddd", "dddd"], function(e, t, n, s) {
  var o = n._locale.weekdaysParse(e, s, n._strict);
  o != null ? t.d = o : dt(n).invalidWeekday = e;
});
Qc(["d", "e", "E"], function(e, t, n, s) {
  t[s] = bt(e);
});
function Qk(e, t) {
  return typeof e != "string" ? e : isNaN(e) ? (e = t.weekdaysParse(e), typeof e == "number" ? e : null) : parseInt(e, 10);
}
function Zk(e, t) {
  return typeof e == "string" ? t.weekdaysParse(e) % 7 || 7 : isNaN(e) ? null : e;
}
function qv(e, t) {
  return e.slice(t, 7).concat(e.slice(0, t));
}
var eD = "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), Y0 = "Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"), tD = "Su_Mo_Tu_We_Th_Fr_Sa".split("_"), nD = Jc, sD = Jc, oD = Jc;
function rD(e, t) {
  var n = ho(this._weekdays) ? this._weekdays : this._weekdays[e && e !== !0 && this._weekdays.isFormat.test(t) ? "format" : "standalone"];
  return e === !0 ? qv(n, this._week.dow) : e ? n[e.day()] : n;
}
function iD(e) {
  return e === !0 ? qv(this._weekdaysShort, this._week.dow) : e ? this._weekdaysShort[e.day()] : this._weekdaysShort;
}
function aD(e) {
  return e === !0 ? qv(this._weekdaysMin, this._week.dow) : e ? this._weekdaysMin[e.day()] : this._weekdaysMin;
}
function lD(e, t, n) {
  var s, o, i, r = e.toLocaleLowerCase();
  if (!this._weekdaysParse)
    for (this._weekdaysParse = [], this._shortWeekdaysParse = [], this._minWeekdaysParse = [], s = 0; s < 7; ++s)
      i = Uo([2e3, 1]).day(s), this._minWeekdaysParse[s] = this.weekdaysMin(
        i,
        ""
      ).toLocaleLowerCase(), this._shortWeekdaysParse[s] = this.weekdaysShort(
        i,
        ""
      ).toLocaleLowerCase(), this._weekdaysParse[s] = this.weekdays(i, "").toLocaleLowerCase();
  return n ? t === "dddd" ? (o = _n.call(this._weekdaysParse, r), o !== -1 ? o : null) : t === "ddd" ? (o = _n.call(this._shortWeekdaysParse, r), o !== -1 ? o : null) : (o = _n.call(this._minWeekdaysParse, r), o !== -1 ? o : null) : t === "dddd" ? (o = _n.call(this._weekdaysParse, r), o !== -1 || (o = _n.call(this._shortWeekdaysParse, r), o !== -1) ? o : (o = _n.call(this._minWeekdaysParse, r), o !== -1 ? o : null)) : t === "ddd" ? (o = _n.call(this._shortWeekdaysParse, r), o !== -1 || (o = _n.call(this._weekdaysParse, r), o !== -1) ? o : (o = _n.call(this._minWeekdaysParse, r), o !== -1 ? o : null)) : (o = _n.call(this._minWeekdaysParse, r), o !== -1 || (o = _n.call(this._weekdaysParse, r), o !== -1) ? o : (o = _n.call(this._shortWeekdaysParse, r), o !== -1 ? o : null));
}
function cD(e, t, n) {
  var s, o, i;
  if (this._weekdaysParseExact)
    return lD.call(this, e, t, n);
  for (this._weekdaysParse || (this._weekdaysParse = [], this._minWeekdaysParse = [], this._shortWeekdaysParse = [], this._fullWeekdaysParse = []), s = 0; s < 7; s++) {
    if (o = Uo([2e3, 1]).day(s), n && !this._fullWeekdaysParse[s] && (this._fullWeekdaysParse[s] = new RegExp(
      "^" + this.weekdays(o, "").replace(".", "\\.?") + "$",
      "i"
    ), this._shortWeekdaysParse[s] = new RegExp(
      "^" + this.weekdaysShort(o, "").replace(".", "\\.?") + "$",
      "i"
    ), this._minWeekdaysParse[s] = new RegExp(
      "^" + this.weekdaysMin(o, "").replace(".", "\\.?") + "$",
      "i"
    )), this._weekdaysParse[s] || (i = "^" + this.weekdays(o, "") + "|^" + this.weekdaysShort(o, "") + "|^" + this.weekdaysMin(o, ""), this._weekdaysParse[s] = new RegExp(i.replace(".", ""), "i")), n && t === "dddd" && this._fullWeekdaysParse[s].test(e))
      return s;
    if (n && t === "ddd" && this._shortWeekdaysParse[s].test(e))
      return s;
    if (n && t === "dd" && this._minWeekdaysParse[s].test(e))
      return s;
    if (!n && this._weekdaysParse[s].test(e))
      return s;
  }
}
function uD(e) {
  if (!this.isValid())
    return e != null ? this : NaN;
  var t = Tc(this, "Day");
  return e != null ? (e = Qk(e, this.localeData()), this.add(e - t, "d")) : t;
}
function dD(e) {
  if (!this.isValid())
    return e != null ? this : NaN;
  var t = (this.day() + 7 - this.localeData()._week.dow) % 7;
  return e == null ? t : this.add(e - t, "d");
}
function fD(e) {
  if (!this.isValid())
    return e != null ? this : NaN;
  if (e != null) {
    var t = Zk(e, this.localeData());
    return this.day(this.day() % 7 ? t : t - 7);
  } else
    return this.day() || 7;
}
function pD(e) {
  return this._weekdaysParseExact ? (Mt(this, "_weekdaysRegex") || Jv.call(this), e ? this._weekdaysStrictRegex : this._weekdaysRegex) : (Mt(this, "_weekdaysRegex") || (this._weekdaysRegex = nD), this._weekdaysStrictRegex && e ? this._weekdaysStrictRegex : this._weekdaysRegex);
}
function hD(e) {
  return this._weekdaysParseExact ? (Mt(this, "_weekdaysRegex") || Jv.call(this), e ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex) : (Mt(this, "_weekdaysShortRegex") || (this._weekdaysShortRegex = sD), this._weekdaysShortStrictRegex && e ? this._weekdaysShortStrictRegex : this._weekdaysShortRegex);
}
function mD(e) {
  return this._weekdaysParseExact ? (Mt(this, "_weekdaysRegex") || Jv.call(this), e ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex) : (Mt(this, "_weekdaysMinRegex") || (this._weekdaysMinRegex = oD), this._weekdaysMinStrictRegex && e ? this._weekdaysMinStrictRegex : this._weekdaysMinRegex);
}
function Jv() {
  function e(d, f) {
    return f.length - d.length;
  }
  var t = [], n = [], s = [], o = [], i, r, a, l, u;
  for (i = 0; i < 7; i++)
    r = Uo([2e3, 1]).day(i), a = pr(this.weekdaysMin(r, "")), l = pr(this.weekdaysShort(r, "")), u = pr(this.weekdays(r, "")), t.push(a), n.push(l), s.push(u), o.push(a), o.push(l), o.push(u);
  t.sort(e), n.sort(e), s.sort(e), o.sort(e), this._weekdaysRegex = new RegExp("^(" + o.join("|") + ")", "i"), this._weekdaysShortRegex = this._weekdaysRegex, this._weekdaysMinRegex = this._weekdaysRegex, this._weekdaysStrictRegex = new RegExp(
    "^(" + s.join("|") + ")",
    "i"
  ), this._weekdaysShortStrictRegex = new RegExp(
    "^(" + n.join("|") + ")",
    "i"
  ), this._weekdaysMinStrictRegex = new RegExp(
    "^(" + t.join("|") + ")",
    "i"
  );
}
function Qv() {
  return this.hours() % 12 || 12;
}
function vD() {
  return this.hours() || 24;
}
He("H", ["HH", 2], 0, "hour");
He("h", ["hh", 2], 0, Qv);
He("k", ["kk", 2], 0, vD);
He("hmm", 0, 0, function() {
  return "" + Qv.apply(this) + Mo(this.minutes(), 2);
});
He("hmmss", 0, 0, function() {
  return "" + Qv.apply(this) + Mo(this.minutes(), 2) + Mo(this.seconds(), 2);
});
He("Hmm", 0, 0, function() {
  return "" + this.hours() + Mo(this.minutes(), 2);
});
He("Hmmss", 0, 0, function() {
  return "" + this.hours() + Mo(this.minutes(), 2) + Mo(this.seconds(), 2);
});
function W0(e, t) {
  He(e, 0, 0, function() {
    return this.localeData().meridiem(
      this.hours(),
      this.minutes(),
      t
    );
  });
}
W0("a", !0);
W0("A", !1);
function G0(e, t) {
  return t._meridiemParse;
}
Re("a", G0);
Re("A", G0);
Re("H", tn, Kv);
Re("h", tn, ul);
Re("k", tn, ul);
Re("HH", tn, Rs);
Re("hh", tn, Rs);
Re("kk", tn, Rs);
Re("hmm", A0);
Re("hmmss", M0);
Re("Hmm", A0);
Re("Hmmss", M0);
Kt(["H", "HH"], Dn);
Kt(["k", "kk"], function(e, t, n) {
  var s = bt(e);
  t[Dn] = s === 24 ? 0 : s;
});
Kt(["a", "A"], function(e, t, n) {
  n._isPm = n._locale.isPM(e), n._meridiem = e;
});
Kt(["h", "hh"], function(e, t, n) {
  t[Dn] = bt(e), dt(n).bigHour = !0;
});
Kt("hmm", function(e, t, n) {
  var s = e.length - 2;
  t[Dn] = bt(e.substr(0, s)), t[ao] = bt(e.substr(s)), dt(n).bigHour = !0;
});
Kt("hmmss", function(e, t, n) {
  var s = e.length - 4, o = e.length - 2;
  t[Dn] = bt(e.substr(0, s)), t[ao] = bt(e.substr(s, 2)), t[ur] = bt(e.substr(o)), dt(n).bigHour = !0;
});
Kt("Hmm", function(e, t, n) {
  var s = e.length - 2;
  t[Dn] = bt(e.substr(0, s)), t[ao] = bt(e.substr(s));
});
Kt("Hmmss", function(e, t, n) {
  var s = e.length - 4, o = e.length - 2;
  t[Dn] = bt(e.substr(0, s)), t[ao] = bt(e.substr(s, 2)), t[ur] = bt(e.substr(o));
});
function gD(e) {
  return (e + "").toLowerCase().charAt(0) === "p";
}
var _D = /[ap]\.?m?\.?/i, yD = dl("Hours", !0);
function bD(e, t, n) {
  return e > 11 ? n ? "pm" : "PM" : n ? "am" : "AM";
}
var z0 = {
  calendar: lk,
  longDateFormat: fk,
  invalidDate: hk,
  ordinal: vk,
  dayOfMonthOrdinalParse: gk,
  relativeTime: yk,
  months: Mk,
  monthsShort: V0,
  week: zk,
  weekdays: eD,
  weekdaysMin: tD,
  weekdaysShort: Y0,
  meridiemParse: _D
}, on = {}, Tl = {}, Dc;
function ED(e, t) {
  var n, s = Math.min(e.length, t.length);
  for (n = 0; n < s; n += 1)
    if (e[n] !== t[n])
      return n;
  return s;
}
function cy(e) {
  return e && e.toLowerCase().replace("_", "-");
}
function wD(e) {
  for (var t = 0, n, s, o, i; t < e.length; ) {
    for (i = cy(e[t]).split("-"), n = i.length, s = cy(e[t + 1]), s = s ? s.split("-") : null; n > 0; ) {
      if (o = Gf(i.slice(0, n).join("-")), o)
        return o;
      if (s && s.length >= n && ED(i, s) >= n - 1)
        break;
      n--;
    }
    t++;
  }
  return Dc;
}
function SD(e) {
  return !!(e && e.match("^[^/\\\\]*$"));
}
function Gf(e) {
  var t = null, n;
  if (on[e] === void 0 && typeof module < "u" && module && module.exports && SD(e))
    try {
      t = Dc._abbr, n = require, n("./locale/" + e), Jr(t);
    } catch {
      on[e] = null;
    }
  return on[e];
}
function Jr(e, t) {
  var n;
  return e && (_s(t) ? n = Sr(e) : n = Zv(e, t), n ? Dc = n : typeof console < "u" && console.warn && console.warn(
    "Locale " + e + " not found. Did you forget to load it?"
  )), Dc._abbr;
}
function Zv(e, t) {
  if (t !== null) {
    var n, s = z0;
    if (t.abbr = e, on[e] != null)
      k0(
        "defineLocaleOverride",
        "use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."
      ), s = on[e]._config;
    else if (t.parentLocale != null)
      if (on[t.parentLocale] != null)
        s = on[t.parentLocale]._config;
      else if (n = Gf(t.parentLocale), n != null)
        s = n._config;
      else
        return Tl[t.parentLocale] || (Tl[t.parentLocale] = []), Tl[t.parentLocale].push({
          name: e,
          config: t
        }), null;
    return on[e] = new Hv(fm(s, t)), Tl[e] && Tl[e].forEach(function(o) {
      Zv(o.name, o.config);
    }), Jr(e), on[e];
  } else
    return delete on[e], null;
}
function xD(e, t) {
  if (t != null) {
    var n, s, o = z0;
    on[e] != null && on[e].parentLocale != null ? on[e].set(fm(on[e]._config, t)) : (s = Gf(e), s != null && (o = s._config), t = fm(o, t), s == null && (t.abbr = e), n = new Hv(t), n.parentLocale = on[e], on[e] = n), Jr(e);
  } else
    on[e] != null && (on[e].parentLocale != null ? (on[e] = on[e].parentLocale, e === Jr() && Jr(e)) : on[e] != null && delete on[e]);
  return on[e];
}
function Sr(e) {
  var t;
  if (e && e._locale && e._locale._abbr && (e = e._locale._abbr), !e)
    return Dc;
  if (!ho(e)) {
    if (t = Gf(e), t)
      return t;
    e = [e];
  }
  return wD(e);
}
function ND() {
  return pm(on);
}
function eg(e) {
  var t, n = e._a;
  return n && dt(e).overflow === -2 && (t = n[cr] < 0 || n[cr] > 11 ? cr : n[No] < 1 || n[No] > Xv(n[Zn], n[cr]) ? No : n[Dn] < 0 || n[Dn] > 24 || n[Dn] === 24 && (n[ao] !== 0 || n[ur] !== 0 || n[xi] !== 0) ? Dn : n[ao] < 0 || n[ao] > 59 ? ao : n[ur] < 0 || n[ur] > 59 ? ur : n[xi] < 0 || n[xi] > 999 ? xi : -1, dt(e)._overflowDayOfYear && (t < Zn || t > No) && (t = No), dt(e)._overflowWeeks && t === -1 && (t = $k), dt(e)._overflowWeekday && t === -1 && (t = kk), dt(e).overflow = t), e;
}
var CD = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, OD = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/, TD = /Z|[+-]\d\d(?::?\d\d)?/, Cu = [
  ["YYYYYY-MM-DD", /[+-]\d{6}-\d\d-\d\d/],
  ["YYYY-MM-DD", /\d{4}-\d\d-\d\d/],
  ["GGGG-[W]WW-E", /\d{4}-W\d\d-\d/],
  ["GGGG-[W]WW", /\d{4}-W\d\d/, !1],
  ["YYYY-DDD", /\d{4}-\d{3}/],
  ["YYYY-MM", /\d{4}-\d\d/, !1],
  ["YYYYYYMMDD", /[+-]\d{10}/],
  ["YYYYMMDD", /\d{8}/],
  ["GGGG[W]WWE", /\d{4}W\d{3}/],
  ["GGGG[W]WW", /\d{4}W\d{2}/, !1],
  ["YYYYDDD", /\d{7}/],
  ["YYYYMM", /\d{6}/, !1],
  ["YYYY", /\d{4}/, !1]
], th = [
  ["HH:mm:ss.SSSS", /\d\d:\d\d:\d\d\.\d+/],
  ["HH:mm:ss,SSSS", /\d\d:\d\d:\d\d,\d+/],
  ["HH:mm:ss", /\d\d:\d\d:\d\d/],
  ["HH:mm", /\d\d:\d\d/],
  ["HHmmss.SSSS", /\d\d\d\d\d\d\.\d+/],
  ["HHmmss,SSSS", /\d\d\d\d\d\d,\d+/],
  ["HHmmss", /\d\d\d\d\d\d/],
  ["HHmm", /\d\d\d\d/],
  ["HH", /\d\d/]
], $D = /^\/?Date\((-?\d+)/i, kD = /^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/, DD = {
  UT: 0,
  GMT: 0,
  EDT: -4 * 60,
  EST: -5 * 60,
  CDT: -5 * 60,
  CST: -6 * 60,
  MDT: -6 * 60,
  MST: -7 * 60,
  PDT: -7 * 60,
  PST: -8 * 60
};
function K0(e) {
  var t, n, s = e._i, o = CD.exec(s) || OD.exec(s), i, r, a, l, u = Cu.length, d = th.length;
  if (o) {
    for (dt(e).iso = !0, t = 0, n = u; t < n; t++)
      if (Cu[t][1].exec(o[1])) {
        r = Cu[t][0], i = Cu[t][2] !== !1;
        break;
      }
    if (r == null) {
      e._isValid = !1;
      return;
    }
    if (o[3]) {
      for (t = 0, n = d; t < n; t++)
        if (th[t][1].exec(o[3])) {
          a = (o[2] || " ") + th[t][0];
          break;
        }
      if (a == null) {
        e._isValid = !1;
        return;
      }
    }
    if (!i && a != null) {
      e._isValid = !1;
      return;
    }
    if (o[4])
      if (TD.exec(o[4]))
        l = "Z";
      else {
        e._isValid = !1;
        return;
      }
    e._f = r + (a || "") + (l || ""), ng(e);
  } else
    e._isValid = !1;
}
function RD(e, t, n, s, o, i) {
  var r = [
    ID(e),
    V0.indexOf(t),
    parseInt(n, 10),
    parseInt(s, 10),
    parseInt(o, 10)
  ];
  return i && r.push(parseInt(i, 10)), r;
}
function ID(e) {
  var t = parseInt(e, 10);
  return t <= 49 ? 2e3 + t : t <= 999 ? 1900 + t : t;
}
function AD(e) {
  return e.replace(/\([^()]*\)|[\n\t]/g, " ").replace(/(\s\s+)/g, " ").replace(/^\s\s*/, "").replace(/\s\s*$/, "");
}
function MD(e, t, n) {
  if (e) {
    var s = Y0.indexOf(e), o = new Date(
      t[0],
      t[1],
      t[2]
    ).getDay();
    if (s !== o)
      return dt(n).weekdayMismatch = !0, n._isValid = !1, !1;
  }
  return !0;
}
function PD(e, t, n) {
  if (e)
    return DD[e];
  if (t)
    return 0;
  var s = parseInt(n, 10), o = s % 100, i = (s - o) / 100;
  return i * 60 + o;
}
function X0(e) {
  var t = kD.exec(AD(e._i)), n;
  if (t) {
    if (n = RD(
      t[4],
      t[3],
      t[2],
      t[5],
      t[6],
      t[7]
    ), !MD(t[1], n, e))
      return;
    e._a = n, e._tzm = PD(t[8], t[9], t[10]), e._d = $c.apply(null, e._a), e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm), dt(e).rfc2822 = !0;
  } else
    e._isValid = !1;
}
function LD(e) {
  var t = $D.exec(e._i);
  if (t !== null) {
    e._d = /* @__PURE__ */ new Date(+t[1]);
    return;
  }
  if (K0(e), e._isValid === !1)
    delete e._isValid;
  else
    return;
  if (X0(e), e._isValid === !1)
    delete e._isValid;
  else
    return;
  e._strict ? e._isValid = !1 : me.createFromInputFallback(e);
}
me.createFromInputFallback = Ks(
  "value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",
  function(e) {
    e._d = /* @__PURE__ */ new Date(e._i + (e._useUTC ? " UTC" : ""));
  }
);
function Ca(e, t, n) {
  return e ?? t ?? n;
}
function VD(e) {
  var t = new Date(me.now());
  return e._useUTC ? [
    t.getUTCFullYear(),
    t.getUTCMonth(),
    t.getUTCDate()
  ] : [t.getFullYear(), t.getMonth(), t.getDate()];
}
function tg(e) {
  var t, n, s = [], o, i, r;
  if (!e._d) {
    for (o = VD(e), e._w && e._a[No] == null && e._a[cr] == null && FD(e), e._dayOfYear != null && (r = Ca(e._a[Zn], o[Zn]), (e._dayOfYear > oc(r) || e._dayOfYear === 0) && (dt(e)._overflowDayOfYear = !0), n = $c(r, 0, e._dayOfYear), e._a[cr] = n.getUTCMonth(), e._a[No] = n.getUTCDate()), t = 0; t < 3 && e._a[t] == null; ++t)
      e._a[t] = s[t] = o[t];
    for (; t < 7; t++)
      e._a[t] = s[t] = e._a[t] == null ? t === 2 ? 1 : 0 : e._a[t];
    e._a[Dn] === 24 && e._a[ao] === 0 && e._a[ur] === 0 && e._a[xi] === 0 && (e._nextDay = !0, e._a[Dn] = 0), e._d = (e._useUTC ? $c : Wk).apply(
      null,
      s
    ), i = e._useUTC ? e._d.getUTCDay() : e._d.getDay(), e._tzm != null && e._d.setUTCMinutes(e._d.getUTCMinutes() - e._tzm), e._nextDay && (e._a[Dn] = 24), e._w && typeof e._w.d < "u" && e._w.d !== i && (dt(e).weekdayMismatch = !0);
  }
}
function FD(e) {
  var t, n, s, o, i, r, a, l, u;
  t = e._w, t.GG != null || t.W != null || t.E != null ? (i = 1, r = 4, n = Ca(
    t.GG,
    e._a[Zn],
    kc(en(), 1, 4).year
  ), s = Ca(t.W, 1), o = Ca(t.E, 1), (o < 1 || o > 7) && (l = !0)) : (i = e._locale._week.dow, r = e._locale._week.doy, u = kc(en(), i, r), n = Ca(t.gg, e._a[Zn], u.year), s = Ca(t.w, u.week), t.d != null ? (o = t.d, (o < 0 || o > 6) && (l = !0)) : t.e != null ? (o = t.e + i, (t.e < 0 || t.e > 6) && (l = !0)) : o = i), s < 1 || s > hr(n, i, r) ? dt(e)._overflowWeeks = !0 : l != null ? dt(e)._overflowWeekday = !0 : (a = H0(n, s, o, i, r), e._a[Zn] = a.year, e._dayOfYear = a.dayOfYear);
}
me.ISO_8601 = function() {
};
me.RFC_2822 = function() {
};
function ng(e) {
  if (e._f === me.ISO_8601) {
    K0(e);
    return;
  }
  if (e._f === me.RFC_2822) {
    X0(e);
    return;
  }
  e._a = [], dt(e).empty = !0;
  var t = "" + e._i, n, s, o, i, r, a = t.length, l = 0, u, d;
  for (o = D0(e._f, e._locale).match(Yv) || [], d = o.length, n = 0; n < d; n++)
    i = o[n], s = (t.match(Ck(i, e)) || [])[0], s && (r = t.substr(0, t.indexOf(s)), r.length > 0 && dt(e).unusedInput.push(r), t = t.slice(
      t.indexOf(s) + s.length
    ), l += s.length), Va[i] ? (s ? dt(e).empty = !1 : dt(e).unusedTokens.push(i), Tk(i, s, e)) : e._strict && !s && dt(e).unusedTokens.push(i);
  dt(e).charsLeftOver = a - l, t.length > 0 && dt(e).unusedInput.push(t), e._a[Dn] <= 12 && dt(e).bigHour === !0 && e._a[Dn] > 0 && (dt(e).bigHour = void 0), dt(e).parsedDateParts = e._a.slice(0), dt(e).meridiem = e._meridiem, e._a[Dn] = UD(
    e._locale,
    e._a[Dn],
    e._meridiem
  ), u = dt(e).era, u !== null && (e._a[Zn] = e._locale.erasConvertYear(u, e._a[Zn])), tg(e), eg(e);
}
function UD(e, t, n) {
  var s;
  return n == null ? t : e.meridiemHour != null ? e.meridiemHour(t, n) : (e.isPM != null && (s = e.isPM(n), s && t < 12 && (t += 12), !s && t === 12 && (t = 0)), t);
}
function jD(e) {
  var t, n, s, o, i, r, a = !1, l = e._f.length;
  if (l === 0) {
    dt(e).invalidFormat = !0, e._d = /* @__PURE__ */ new Date(NaN);
    return;
  }
  for (o = 0; o < l; o++)
    i = 0, r = !1, t = Bv({}, e), e._useUTC != null && (t._useUTC = e._useUTC), t._f = e._f[o], ng(t), jv(t) && (r = !0), i += dt(t).charsLeftOver, i += dt(t).unusedTokens.length * 10, dt(t).score = i, a ? i < s && (s = i, n = t) : (s == null || i < s || r) && (s = i, n = t, r && (a = !0));
  Hr(e, n || t);
}
function BD(e) {
  if (!e._d) {
    var t = Wv(e._i), n = t.day === void 0 ? t.date : t.day;
    e._a = T0(
      [t.year, t.month, n, t.hour, t.minute, t.second, t.millisecond],
      function(s) {
        return s && parseInt(s, 10);
      }
    ), tg(e);
  }
}
function HD(e) {
  var t = new qc(eg(q0(e)));
  return t._nextDay && (t.add(1, "d"), t._nextDay = void 0), t;
}
function q0(e) {
  var t = e._i, n = e._f;
  return e._locale = e._locale || Sr(e._l), t === null || n === void 0 && t === "" ? Ff({ nullInput: !0 }) : (typeof t == "string" && (e._i = t = e._locale.preparse(t)), mo(t) ? new qc(eg(t)) : (Xc(t) ? e._d = t : ho(n) ? jD(e) : n ? ng(e) : YD(e), jv(e) || (e._d = null), e));
}
function YD(e) {
  var t = e._i;
  _s(t) ? e._d = new Date(me.now()) : Xc(t) ? e._d = new Date(t.valueOf()) : typeof t == "string" ? LD(e) : ho(t) ? (e._a = T0(t.slice(0), function(n) {
    return parseInt(n, 10);
  }), tg(e)) : Li(t) ? BD(e) : yr(t) ? e._d = new Date(t) : me.createFromInputFallback(e);
}
function J0(e, t, n, s, o) {
  var i = {};
  return (t === !0 || t === !1) && (s = t, t = void 0), (n === !0 || n === !1) && (s = n, n = void 0), (Li(e) && Uv(e) || ho(e) && e.length === 0) && (e = void 0), i._isAMomentObject = !0, i._useUTC = i._isUTC = o, i._l = n, i._i = e, i._f = t, i._strict = s, HD(i);
}
function en(e, t, n, s) {
  return J0(e, t, n, s, !1);
}
var WD = Ks(
  "moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",
  function() {
    var e = en.apply(null, arguments);
    return this.isValid() && e.isValid() ? e < this ? this : e : Ff();
  }
), GD = Ks(
  "moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",
  function() {
    var e = en.apply(null, arguments);
    return this.isValid() && e.isValid() ? e > this ? this : e : Ff();
  }
);
function Q0(e, t) {
  var n, s;
  if (t.length === 1 && ho(t[0]) && (t = t[0]), !t.length)
    return en();
  for (n = t[0], s = 1; s < t.length; ++s)
    (!t[s].isValid() || t[s][e](n)) && (n = t[s]);
  return n;
}
function zD() {
  var e = [].slice.call(arguments, 0);
  return Q0("isBefore", e);
}
function KD() {
  var e = [].slice.call(arguments, 0);
  return Q0("isAfter", e);
}
var XD = function() {
  return Date.now ? Date.now() : +/* @__PURE__ */ new Date();
}, $l = [
  "year",
  "quarter",
  "month",
  "week",
  "day",
  "hour",
  "minute",
  "second",
  "millisecond"
];
function qD(e) {
  var t, n = !1, s, o = $l.length;
  for (t in e)
    if (Mt(e, t) && !(_n.call($l, t) !== -1 && (e[t] == null || !isNaN(e[t]))))
      return !1;
  for (s = 0; s < o; ++s)
    if (e[$l[s]]) {
      if (n)
        return !1;
      parseFloat(e[$l[s]]) !== bt(e[$l[s]]) && (n = !0);
    }
  return !0;
}
function JD() {
  return this._isValid;
}
function QD() {
  return vo(NaN);
}
function zf(e) {
  var t = Wv(e), n = t.year || 0, s = t.quarter || 0, o = t.month || 0, i = t.week || t.isoWeek || 0, r = t.day || 0, a = t.hour || 0, l = t.minute || 0, u = t.second || 0, d = t.millisecond || 0;
  this._isValid = qD(t), this._milliseconds = +d + u * 1e3 + // 1000
  l * 6e4 + // 1000 * 60
  a * 1e3 * 60 * 60, this._days = +r + i * 7, this._months = +o + s * 3 + n * 12, this._data = {}, this._locale = Sr(), this._bubble();
}
function od(e) {
  return e instanceof zf;
}
function mm(e) {
  return e < 0 ? Math.round(-1 * e) * -1 : Math.round(e);
}
function ZD(e, t, n) {
  var s = Math.min(e.length, t.length), o = Math.abs(e.length - t.length), i = 0, r;
  for (r = 0; r < s; r++)
    bt(e[r]) !== bt(t[r]) && i++;
  return i + o;
}
function Z0(e, t) {
  He(e, 0, 0, function() {
    var n = this.utcOffset(), s = "+";
    return n < 0 && (n = -n, s = "-"), s + Mo(~~(n / 60), 2) + t + Mo(~~n % 60, 2);
  });
}
Z0("Z", ":");
Z0("ZZ", "");
Re("Z", Yf);
Re("ZZ", Yf);
Kt(["Z", "ZZ"], function(e, t, n) {
  n._useUTC = !0, n._tzm = sg(Yf, e);
});
var eR = /([\+\-]|\d\d)/gi;
function sg(e, t) {
  var n = (t || "").match(e), s, o, i;
  return n === null ? null : (s = n[n.length - 1] || [], o = (s + "").match(eR) || ["-", 0, 0], i = +(o[1] * 60) + bt(o[2]), i === 0 ? 0 : o[0] === "+" ? i : -i);
}
function og(e, t) {
  var n, s;
  return t._isUTC ? (n = t.clone(), s = (mo(e) || Xc(e) ? e.valueOf() : en(e).valueOf()) - n.valueOf(), n._d.setTime(n._d.valueOf() + s), me.updateOffset(n, !1), n) : en(e).local();
}
function vm(e) {
  return -Math.round(e._d.getTimezoneOffset());
}
me.updateOffset = function() {
};
function tR(e, t, n) {
  var s = this._offset || 0, o;
  if (!this.isValid())
    return e != null ? this : NaN;
  if (e != null) {
    if (typeof e == "string") {
      if (e = sg(Yf, e), e === null)
        return this;
    } else Math.abs(e) < 16 && !n && (e = e * 60);
    return !this._isUTC && t && (o = vm(this)), this._offset = e, this._isUTC = !0, o != null && this.add(o, "m"), s !== e && (!t || this._changeInProgress ? nw(
      this,
      vo(e - s, "m"),
      1,
      !1
    ) : this._changeInProgress || (this._changeInProgress = !0, me.updateOffset(this, !0), this._changeInProgress = null)), this;
  } else
    return this._isUTC ? s : vm(this);
}
function nR(e, t) {
  return e != null ? (typeof e != "string" && (e = -e), this.utcOffset(e, t), this) : -this.utcOffset();
}
function sR(e) {
  return this.utcOffset(0, e);
}
function oR(e) {
  return this._isUTC && (this.utcOffset(0, e), this._isUTC = !1, e && this.subtract(vm(this), "m")), this;
}
function rR() {
  if (this._tzm != null)
    this.utcOffset(this._tzm, !1, !0);
  else if (typeof this._i == "string") {
    var e = sg(xk, this._i);
    e != null ? this.utcOffset(e) : this.utcOffset(0, !0);
  }
  return this;
}
function iR(e) {
  return this.isValid() ? (e = e ? en(e).utcOffset() : 0, (this.utcOffset() - e) % 60 === 0) : !1;
}
function aR() {
  return this.utcOffset() > this.clone().month(0).utcOffset() || this.utcOffset() > this.clone().month(5).utcOffset();
}
function lR() {
  if (!_s(this._isDSTShifted))
    return this._isDSTShifted;
  var e = {}, t;
  return Bv(e, this), e = q0(e), e._a ? (t = e._isUTC ? Uo(e._a) : en(e._a), this._isDSTShifted = this.isValid() && ZD(e._a, t.toArray()) > 0) : this._isDSTShifted = !1, this._isDSTShifted;
}
function cR() {
  return this.isValid() ? !this._isUTC : !1;
}
function uR() {
  return this.isValid() ? this._isUTC : !1;
}
function ew() {
  return this.isValid() ? this._isUTC && this._offset === 0 : !1;
}
var dR = /^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/, fR = /^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;
function vo(e, t) {
  var n = e, s = null, o, i, r;
  return od(e) ? n = {
    ms: e._milliseconds,
    d: e._days,
    M: e._months
  } : yr(e) || !isNaN(+e) ? (n = {}, t ? n[t] = +e : n.milliseconds = +e) : (s = dR.exec(e)) ? (o = s[1] === "-" ? -1 : 1, n = {
    y: 0,
    d: bt(s[No]) * o,
    h: bt(s[Dn]) * o,
    m: bt(s[ao]) * o,
    s: bt(s[ur]) * o,
    ms: bt(mm(s[xi] * 1e3)) * o
    // the millisecond decimal point is included in the match
  }) : (s = fR.exec(e)) ? (o = s[1] === "-" ? -1 : 1, n = {
    y: mi(s[2], o),
    M: mi(s[3], o),
    w: mi(s[4], o),
    d: mi(s[5], o),
    h: mi(s[6], o),
    m: mi(s[7], o),
    s: mi(s[8], o)
  }) : n == null ? n = {} : typeof n == "object" && ("from" in n || "to" in n) && (r = pR(
    en(n.from),
    en(n.to)
  ), n = {}, n.ms = r.milliseconds, n.M = r.months), i = new zf(n), od(e) && Mt(e, "_locale") && (i._locale = e._locale), od(e) && Mt(e, "_isValid") && (i._isValid = e._isValid), i;
}
vo.fn = zf.prototype;
vo.invalid = QD;
function mi(e, t) {
  var n = e && parseFloat(e.replace(",", "."));
  return (isNaN(n) ? 0 : n) * t;
}
function uy(e, t) {
  var n = {};
  return n.months = t.month() - e.month() + (t.year() - e.year()) * 12, e.clone().add(n.months, "M").isAfter(t) && --n.months, n.milliseconds = +t - +e.clone().add(n.months, "M"), n;
}
function pR(e, t) {
  var n;
  return e.isValid() && t.isValid() ? (t = og(t, e), e.isBefore(t) ? n = uy(e, t) : (n = uy(t, e), n.milliseconds = -n.milliseconds, n.months = -n.months), n) : { milliseconds: 0, months: 0 };
}
function tw(e, t) {
  return function(n, s) {
    var o, i;
    return s !== null && !isNaN(+s) && (k0(
      t,
      "moment()." + t + "(period, number) is deprecated. Please use moment()." + t + "(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."
    ), i = n, n = s, s = i), o = vo(n, s), nw(this, o, e), this;
  };
}
function nw(e, t, n, s) {
  var o = t._milliseconds, i = mm(t._days), r = mm(t._months);
  e.isValid() && (s = s ?? !0, r && U0(e, Tc(e, "Month") + r * n), i && L0(e, "Date", Tc(e, "Date") + i * n), o && e._d.setTime(e._d.valueOf() + o * n), s && me.updateOffset(e, i || r));
}
var hR = tw(1, "add"), mR = tw(-1, "subtract");
function sw(e) {
  return typeof e == "string" || e instanceof String;
}
function vR(e) {
  return mo(e) || Xc(e) || sw(e) || yr(e) || _R(e) || gR(e) || e === null || e === void 0;
}
function gR(e) {
  var t = Li(e) && !Uv(e), n = !1, s = [
    "years",
    "year",
    "y",
    "months",
    "month",
    "M",
    "days",
    "day",
    "d",
    "dates",
    "date",
    "D",
    "hours",
    "hour",
    "h",
    "minutes",
    "minute",
    "m",
    "seconds",
    "second",
    "s",
    "milliseconds",
    "millisecond",
    "ms"
  ], o, i, r = s.length;
  for (o = 0; o < r; o += 1)
    i = s[o], n = n || Mt(e, i);
  return t && n;
}
function _R(e) {
  var t = ho(e), n = !1;
  return t && (n = e.filter(function(s) {
    return !yr(s) && sw(e);
  }).length === 0), t && n;
}
function yR(e) {
  var t = Li(e) && !Uv(e), n = !1, s = [
    "sameDay",
    "nextDay",
    "lastDay",
    "nextWeek",
    "lastWeek",
    "sameElse"
  ], o, i;
  for (o = 0; o < s.length; o += 1)
    i = s[o], n = n || Mt(e, i);
  return t && n;
}
function bR(e, t) {
  var n = e.diff(t, "days", !0);
  return n < -6 ? "sameElse" : n < -1 ? "lastWeek" : n < 0 ? "lastDay" : n < 1 ? "sameDay" : n < 2 ? "nextDay" : n < 7 ? "nextWeek" : "sameElse";
}
function ER(e, t) {
  arguments.length === 1 && (arguments[0] ? vR(arguments[0]) ? (e = arguments[0], t = void 0) : yR(arguments[0]) && (t = arguments[0], e = void 0) : (e = void 0, t = void 0));
  var n = e || en(), s = og(n, this).startOf("day"), o = me.calendarFormat(this, s) || "sameElse", i = t && (jo(t[o]) ? t[o].call(this, n) : t[o]);
  return this.format(
    i || this.localeData().calendar(o, this, en(n))
  );
}
function wR() {
  return new qc(this);
}
function SR(e, t) {
  var n = mo(e) ? e : en(e);
  return this.isValid() && n.isValid() ? (t = Xs(t) || "millisecond", t === "millisecond" ? this.valueOf() > n.valueOf() : n.valueOf() < this.clone().startOf(t).valueOf()) : !1;
}
function xR(e, t) {
  var n = mo(e) ? e : en(e);
  return this.isValid() && n.isValid() ? (t = Xs(t) || "millisecond", t === "millisecond" ? this.valueOf() < n.valueOf() : this.clone().endOf(t).valueOf() < n.valueOf()) : !1;
}
function NR(e, t, n, s) {
  var o = mo(e) ? e : en(e), i = mo(t) ? t : en(t);
  return this.isValid() && o.isValid() && i.isValid() ? (s = s || "()", (s[0] === "(" ? this.isAfter(o, n) : !this.isBefore(o, n)) && (s[1] === ")" ? this.isBefore(i, n) : !this.isAfter(i, n))) : !1;
}
function CR(e, t) {
  var n = mo(e) ? e : en(e), s;
  return this.isValid() && n.isValid() ? (t = Xs(t) || "millisecond", t === "millisecond" ? this.valueOf() === n.valueOf() : (s = n.valueOf(), this.clone().startOf(t).valueOf() <= s && s <= this.clone().endOf(t).valueOf())) : !1;
}
function OR(e, t) {
  return this.isSame(e, t) || this.isAfter(e, t);
}
function TR(e, t) {
  return this.isSame(e, t) || this.isBefore(e, t);
}
function $R(e, t, n) {
  var s, o, i;
  if (!this.isValid())
    return NaN;
  if (s = og(e, this), !s.isValid())
    return NaN;
  switch (o = (s.utcOffset() - this.utcOffset()) * 6e4, t = Xs(t), t) {
    case "year":
      i = rd(this, s) / 12;
      break;
    case "month":
      i = rd(this, s);
      break;
    case "quarter":
      i = rd(this, s) / 3;
      break;
    case "second":
      i = (this - s) / 1e3;
      break;
    // 1000
    case "minute":
      i = (this - s) / 6e4;
      break;
    // 1000 * 60
    case "hour":
      i = (this - s) / 36e5;
      break;
    // 1000 * 60 * 60
    case "day":
      i = (this - s - o) / 864e5;
      break;
    // 1000 * 60 * 60 * 24, negate dst
    case "week":
      i = (this - s - o) / 6048e5;
      break;
    // 1000 * 60 * 60 * 24 * 7, negate dst
    default:
      i = this - s;
  }
  return n ? i : Vs(i);
}
function rd(e, t) {
  if (e.date() < t.date())
    return -rd(t, e);
  var n = (t.year() - e.year()) * 12 + (t.month() - e.month()), s = e.clone().add(n, "months"), o, i;
  return t - s < 0 ? (o = e.clone().add(n - 1, "months"), i = (t - s) / (s - o)) : (o = e.clone().add(n + 1, "months"), i = (t - s) / (o - s)), -(n + i) || 0;
}
me.defaultFormat = "YYYY-MM-DDTHH:mm:ssZ";
me.defaultFormatUtc = "YYYY-MM-DDTHH:mm:ss[Z]";
function kR() {
  return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ");
}
function DR(e) {
  if (!this.isValid())
    return null;
  var t = e !== !0, n = t ? this.clone().utc() : this;
  return n.year() < 0 || n.year() > 9999 ? sd(
    n,
    t ? "YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"
  ) : jo(Date.prototype.toISOString) ? t ? this.toDate().toISOString() : new Date(this.valueOf() + this.utcOffset() * 60 * 1e3).toISOString().replace("Z", sd(n, "Z")) : sd(
    n,
    t ? "YYYY-MM-DD[T]HH:mm:ss.SSS[Z]" : "YYYY-MM-DD[T]HH:mm:ss.SSSZ"
  );
}
function RR() {
  if (!this.isValid())
    return "moment.invalid(/* " + this._i + " */)";
  var e = "moment", t = "", n, s, o, i;
  return this.isLocal() || (e = this.utcOffset() === 0 ? "moment.utc" : "moment.parseZone", t = "Z"), n = "[" + e + '("]', s = 0 <= this.year() && this.year() <= 9999 ? "YYYY" : "YYYYYY", o = "-MM-DD[T]HH:mm:ss.SSS", i = t + '[")]', this.format(n + s + o + i);
}
function IR(e) {
  e || (e = this.isUtc() ? me.defaultFormatUtc : me.defaultFormat);
  var t = sd(this, e);
  return this.localeData().postformat(t);
}
function AR(e, t) {
  return this.isValid() && (mo(e) && e.isValid() || en(e).isValid()) ? vo({ to: this, from: e }).locale(this.locale()).humanize(!t) : this.localeData().invalidDate();
}
function MR(e) {
  return this.from(en(), e);
}
function PR(e, t) {
  return this.isValid() && (mo(e) && e.isValid() || en(e).isValid()) ? vo({ from: this, to: e }).locale(this.locale()).humanize(!t) : this.localeData().invalidDate();
}
function LR(e) {
  return this.to(en(), e);
}
function ow(e) {
  var t;
  return e === void 0 ? this._locale._abbr : (t = Sr(e), t != null && (this._locale = t), this);
}
var rw = Ks(
  "moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",
  function(e) {
    return e === void 0 ? this.localeData() : this.locale(e);
  }
);
function iw() {
  return this._locale;
}
var Yd = 1e3, Fa = 60 * Yd, Wd = 60 * Fa, aw = (365 * 400 + 97) * 24 * Wd;
function Ua(e, t) {
  return (e % t + t) % t;
}
function lw(e, t, n) {
  return e < 100 && e >= 0 ? new Date(e + 400, t, n) - aw : new Date(e, t, n).valueOf();
}
function cw(e, t, n) {
  return e < 100 && e >= 0 ? Date.UTC(e + 400, t, n) - aw : Date.UTC(e, t, n);
}
function VR(e) {
  var t, n;
  if (e = Xs(e), e === void 0 || e === "millisecond" || !this.isValid())
    return this;
  switch (n = this._isUTC ? cw : lw, e) {
    case "year":
      t = n(this.year(), 0, 1);
      break;
    case "quarter":
      t = n(
        this.year(),
        this.month() - this.month() % 3,
        1
      );
      break;
    case "month":
      t = n(this.year(), this.month(), 1);
      break;
    case "week":
      t = n(
        this.year(),
        this.month(),
        this.date() - this.weekday()
      );
      break;
    case "isoWeek":
      t = n(
        this.year(),
        this.month(),
        this.date() - (this.isoWeekday() - 1)
      );
      break;
    case "day":
    case "date":
      t = n(this.year(), this.month(), this.date());
      break;
    case "hour":
      t = this._d.valueOf(), t -= Ua(
        t + (this._isUTC ? 0 : this.utcOffset() * Fa),
        Wd
      );
      break;
    case "minute":
      t = this._d.valueOf(), t -= Ua(t, Fa);
      break;
    case "second":
      t = this._d.valueOf(), t -= Ua(t, Yd);
      break;
  }
  return this._d.setTime(t), me.updateOffset(this, !0), this;
}
function FR(e) {
  var t, n;
  if (e = Xs(e), e === void 0 || e === "millisecond" || !this.isValid())
    return this;
  switch (n = this._isUTC ? cw : lw, e) {
    case "year":
      t = n(this.year() + 1, 0, 1) - 1;
      break;
    case "quarter":
      t = n(
        this.year(),
        this.month() - this.month() % 3 + 3,
        1
      ) - 1;
      break;
    case "month":
      t = n(this.year(), this.month() + 1, 1) - 1;
      break;
    case "week":
      t = n(
        this.year(),
        this.month(),
        this.date() - this.weekday() + 7
      ) - 1;
      break;
    case "isoWeek":
      t = n(
        this.year(),
        this.month(),
        this.date() - (this.isoWeekday() - 1) + 7
      ) - 1;
      break;
    case "day":
    case "date":
      t = n(this.year(), this.month(), this.date() + 1) - 1;
      break;
    case "hour":
      t = this._d.valueOf(), t += Wd - Ua(
        t + (this._isUTC ? 0 : this.utcOffset() * Fa),
        Wd
      ) - 1;
      break;
    case "minute":
      t = this._d.valueOf(), t += Fa - Ua(t, Fa) - 1;
      break;
    case "second":
      t = this._d.valueOf(), t += Yd - Ua(t, Yd) - 1;
      break;
  }
  return this._d.setTime(t), me.updateOffset(this, !0), this;
}
function UR() {
  return this._d.valueOf() - (this._offset || 0) * 6e4;
}
function jR() {
  return Math.floor(this.valueOf() / 1e3);
}
function BR() {
  return new Date(this.valueOf());
}
function HR() {
  var e = this;
  return [
    e.year(),
    e.month(),
    e.date(),
    e.hour(),
    e.minute(),
    e.second(),
    e.millisecond()
  ];
}
function YR() {
  var e = this;
  return {
    years: e.year(),
    months: e.month(),
    date: e.date(),
    hours: e.hours(),
    minutes: e.minutes(),
    seconds: e.seconds(),
    milliseconds: e.milliseconds()
  };
}
function WR() {
  return this.isValid() ? this.toISOString() : null;
}
function GR() {
  return jv(this);
}
function zR() {
  return Hr({}, dt(this));
}
function KR() {
  return dt(this).overflow;
}
function XR() {
  return {
    input: this._i,
    format: this._f,
    locale: this._locale,
    isUTC: this._isUTC,
    strict: this._strict
  };
}
He("N", 0, 0, "eraAbbr");
He("NN", 0, 0, "eraAbbr");
He("NNN", 0, 0, "eraAbbr");
He("NNNN", 0, 0, "eraName");
He("NNNNN", 0, 0, "eraNarrow");
He("y", ["y", 1], "yo", "eraYear");
He("y", ["yy", 2], 0, "eraYear");
He("y", ["yyy", 3], 0, "eraYear");
He("y", ["yyyy", 4], 0, "eraYear");
Re("N", rg);
Re("NN", rg);
Re("NNN", rg);
Re("NNNN", i2);
Re("NNNNN", a2);
Kt(
  ["N", "NN", "NNN", "NNNN", "NNNNN"],
  function(e, t, n, s) {
    var o = n._locale.erasParse(e, s, n._strict);
    o ? dt(n).era = o : dt(n).invalidEra = e;
  }
);
Re("y", cl);
Re("yy", cl);
Re("yyy", cl);
Re("yyyy", cl);
Re("yo", l2);
Kt(["y", "yy", "yyy", "yyyy"], Zn);
Kt(["yo"], function(e, t, n, s) {
  var o;
  n._locale._eraYearOrdinalRegex && (o = e.match(n._locale._eraYearOrdinalRegex)), n._locale.eraYearOrdinalParse ? t[Zn] = n._locale.eraYearOrdinalParse(e, o) : t[Zn] = parseInt(e, 10);
});
function qR(e, t) {
  var n, s, o, i = this._eras || Sr("en")._eras;
  for (n = 0, s = i.length; n < s; ++n) {
    switch (typeof i[n].since) {
      case "string":
        o = me(i[n].since).startOf("day"), i[n].since = o.valueOf();
        break;
    }
    switch (typeof i[n].until) {
      case "undefined":
        i[n].until = 1 / 0;
        break;
      case "string":
        o = me(i[n].until).startOf("day").valueOf(), i[n].until = o.valueOf();
        break;
    }
  }
  return i;
}
function JR(e, t, n) {
  var s, o, i = this.eras(), r, a, l;
  for (e = e.toUpperCase(), s = 0, o = i.length; s < o; ++s)
    if (r = i[s].name.toUpperCase(), a = i[s].abbr.toUpperCase(), l = i[s].narrow.toUpperCase(), n)
      switch (t) {
        case "N":
        case "NN":
        case "NNN":
          if (a === e)
            return i[s];
          break;
        case "NNNN":
          if (r === e)
            return i[s];
          break;
        case "NNNNN":
          if (l === e)
            return i[s];
          break;
      }
    else if ([r, a, l].indexOf(e) >= 0)
      return i[s];
}
function QR(e, t) {
  var n = e.since <= e.until ? 1 : -1;
  return t === void 0 ? me(e.since).year() : me(e.since).year() + (t - e.offset) * n;
}
function ZR() {
  var e, t, n, s = this.localeData().eras();
  for (e = 0, t = s.length; e < t; ++e)
    if (n = this.clone().startOf("day").valueOf(), s[e].since <= n && n <= s[e].until || s[e].until <= n && n <= s[e].since)
      return s[e].name;
  return "";
}
function e2() {
  var e, t, n, s = this.localeData().eras();
  for (e = 0, t = s.length; e < t; ++e)
    if (n = this.clone().startOf("day").valueOf(), s[e].since <= n && n <= s[e].until || s[e].until <= n && n <= s[e].since)
      return s[e].narrow;
  return "";
}
function t2() {
  var e, t, n, s = this.localeData().eras();
  for (e = 0, t = s.length; e < t; ++e)
    if (n = this.clone().startOf("day").valueOf(), s[e].since <= n && n <= s[e].until || s[e].until <= n && n <= s[e].since)
      return s[e].abbr;
  return "";
}
function n2() {
  var e, t, n, s, o = this.localeData().eras();
  for (e = 0, t = o.length; e < t; ++e)
    if (n = o[e].since <= o[e].until ? 1 : -1, s = this.clone().startOf("day").valueOf(), o[e].since <= s && s <= o[e].until || o[e].until <= s && s <= o[e].since)
      return (this.year() - me(o[e].since).year()) * n + o[e].offset;
  return this.year();
}
function s2(e) {
  return Mt(this, "_erasNameRegex") || ig.call(this), e ? this._erasNameRegex : this._erasRegex;
}
function o2(e) {
  return Mt(this, "_erasAbbrRegex") || ig.call(this), e ? this._erasAbbrRegex : this._erasRegex;
}
function r2(e) {
  return Mt(this, "_erasNarrowRegex") || ig.call(this), e ? this._erasNarrowRegex : this._erasRegex;
}
function rg(e, t) {
  return t.erasAbbrRegex(e);
}
function i2(e, t) {
  return t.erasNameRegex(e);
}
function a2(e, t) {
  return t.erasNarrowRegex(e);
}
function l2(e, t) {
  return t._eraYearOrdinalRegex || cl;
}
function ig() {
  var e = [], t = [], n = [], s = [], o, i, r, a, l, u = this.eras();
  for (o = 0, i = u.length; o < i; ++o)
    r = pr(u[o].name), a = pr(u[o].abbr), l = pr(u[o].narrow), t.push(r), e.push(a), n.push(l), s.push(r), s.push(a), s.push(l);
  this._erasRegex = new RegExp("^(" + s.join("|") + ")", "i"), this._erasNameRegex = new RegExp("^(" + t.join("|") + ")", "i"), this._erasAbbrRegex = new RegExp("^(" + e.join("|") + ")", "i"), this._erasNarrowRegex = new RegExp(
    "^(" + n.join("|") + ")",
    "i"
  );
}
He(0, ["gg", 2], 0, function() {
  return this.weekYear() % 100;
});
He(0, ["GG", 2], 0, function() {
  return this.isoWeekYear() % 100;
});
function Kf(e, t) {
  He(0, [e, e.length], 0, t);
}
Kf("gggg", "weekYear");
Kf("ggggg", "weekYear");
Kf("GGGG", "isoWeekYear");
Kf("GGGGG", "isoWeekYear");
Re("G", Hf);
Re("g", Hf);
Re("GG", tn, Rs);
Re("gg", tn, Rs);
Re("GGGG", zv, Gv);
Re("gggg", zv, Gv);
Re("GGGGG", Bf, Uf);
Re("ggggg", Bf, Uf);
Qc(
  ["gggg", "ggggg", "GGGG", "GGGGG"],
  function(e, t, n, s) {
    t[s.substr(0, 2)] = bt(e);
  }
);
Qc(["gg", "GG"], function(e, t, n, s) {
  t[s] = me.parseTwoDigitYear(e);
});
function c2(e) {
  return uw.call(
    this,
    e,
    this.week(),
    this.weekday() + this.localeData()._week.dow,
    this.localeData()._week.dow,
    this.localeData()._week.doy
  );
}
function u2(e) {
  return uw.call(
    this,
    e,
    this.isoWeek(),
    this.isoWeekday(),
    1,
    4
  );
}
function d2() {
  return hr(this.year(), 1, 4);
}
function f2() {
  return hr(this.isoWeekYear(), 1, 4);
}
function p2() {
  var e = this.localeData()._week;
  return hr(this.year(), e.dow, e.doy);
}
function h2() {
  var e = this.localeData()._week;
  return hr(this.weekYear(), e.dow, e.doy);
}
function uw(e, t, n, s, o) {
  var i;
  return e == null ? kc(this, s, o).year : (i = hr(e, s, o), t > i && (t = i), m2.call(this, e, t, n, s, o));
}
function m2(e, t, n, s, o) {
  var i = H0(e, t, n, s, o), r = $c(i.year, 0, i.dayOfYear);
  return this.year(r.getUTCFullYear()), this.month(r.getUTCMonth()), this.date(r.getUTCDate()), this;
}
He("Q", 0, "Qo", "quarter");
Re("Q", R0);
Kt("Q", function(e, t) {
  t[cr] = (bt(e) - 1) * 3;
});
function v2(e) {
  return e == null ? Math.ceil((this.month() + 1) / 3) : this.month((e - 1) * 3 + this.month() % 3);
}
He("D", ["DD", 2], "Do", "date");
Re("D", tn, ul);
Re("DD", tn, Rs);
Re("Do", function(e, t) {
  return e ? t._dayOfMonthOrdinalParse || t._ordinalParse : t._dayOfMonthOrdinalParseLenient;
});
Kt(["D", "DD"], No);
Kt("Do", function(e, t) {
  t[No] = bt(e.match(tn)[0]);
});
var dw = dl("Date", !0);
He("DDD", ["DDDD", 3], "DDDo", "dayOfYear");
Re("DDD", jf);
Re("DDDD", I0);
Kt(["DDD", "DDDD"], function(e, t, n) {
  n._dayOfYear = bt(e);
});
function g2(e) {
  var t = Math.round(
    (this.clone().startOf("day") - this.clone().startOf("year")) / 864e5
  ) + 1;
  return e == null ? t : this.add(e - t, "d");
}
He("m", ["mm", 2], 0, "minute");
Re("m", tn, Kv);
Re("mm", tn, Rs);
Kt(["m", "mm"], ao);
var _2 = dl("Minutes", !1);
He("s", ["ss", 2], 0, "second");
Re("s", tn, Kv);
Re("ss", tn, Rs);
Kt(["s", "ss"], ur);
var y2 = dl("Seconds", !1);
He("S", 0, 0, function() {
  return ~~(this.millisecond() / 100);
});
He(0, ["SS", 2], 0, function() {
  return ~~(this.millisecond() / 10);
});
He(0, ["SSS", 3], 0, "millisecond");
He(0, ["SSSS", 4], 0, function() {
  return this.millisecond() * 10;
});
He(0, ["SSSSS", 5], 0, function() {
  return this.millisecond() * 100;
});
He(0, ["SSSSSS", 6], 0, function() {
  return this.millisecond() * 1e3;
});
He(0, ["SSSSSSS", 7], 0, function() {
  return this.millisecond() * 1e4;
});
He(0, ["SSSSSSSS", 8], 0, function() {
  return this.millisecond() * 1e5;
});
He(0, ["SSSSSSSSS", 9], 0, function() {
  return this.millisecond() * 1e6;
});
Re("S", jf, R0);
Re("SS", jf, Rs);
Re("SSS", jf, I0);
var Yr, fw;
for (Yr = "SSSS"; Yr.length <= 9; Yr += "S")
  Re(Yr, cl);
function b2(e, t) {
  t[xi] = bt(("0." + e) * 1e3);
}
for (Yr = "S"; Yr.length <= 9; Yr += "S")
  Kt(Yr, b2);
fw = dl("Milliseconds", !1);
He("z", 0, 0, "zoneAbbr");
He("zz", 0, 0, "zoneName");
function E2() {
  return this._isUTC ? "UTC" : "";
}
function w2() {
  return this._isUTC ? "Coordinated Universal Time" : "";
}
var ye = qc.prototype;
ye.add = hR;
ye.calendar = ER;
ye.clone = wR;
ye.diff = $R;
ye.endOf = FR;
ye.format = IR;
ye.from = AR;
ye.fromNow = MR;
ye.to = PR;
ye.toNow = LR;
ye.get = Rk;
ye.invalidAt = KR;
ye.isAfter = SR;
ye.isBefore = xR;
ye.isBetween = NR;
ye.isSame = CR;
ye.isSameOrAfter = OR;
ye.isSameOrBefore = TR;
ye.isValid = GR;
ye.lang = rw;
ye.locale = ow;
ye.localeData = iw;
ye.max = GD;
ye.min = WD;
ye.parsingFlags = zR;
ye.set = Ik;
ye.startOf = VR;
ye.subtract = mR;
ye.toArray = HR;
ye.toObject = YR;
ye.toDate = BR;
ye.toISOString = DR;
ye.inspect = RR;
typeof Symbol < "u" && Symbol.for != null && (ye[Symbol.for("nodejs.util.inspect.custom")] = function() {
  return "Moment<" + this.format() + ">";
});
ye.toJSON = WR;
ye.toString = kR;
ye.unix = jR;
ye.valueOf = UR;
ye.creationData = XR;
ye.eraName = ZR;
ye.eraNarrow = e2;
ye.eraAbbr = t2;
ye.eraYear = n2;
ye.year = P0;
ye.isLeapYear = Dk;
ye.weekYear = c2;
ye.isoWeekYear = u2;
ye.quarter = ye.quarters = v2;
ye.month = j0;
ye.daysInMonth = Bk;
ye.week = ye.weeks = qk;
ye.isoWeek = ye.isoWeeks = Jk;
ye.weeksInYear = p2;
ye.weeksInWeekYear = h2;
ye.isoWeeksInYear = d2;
ye.isoWeeksInISOWeekYear = f2;
ye.date = dw;
ye.day = ye.days = uD;
ye.weekday = dD;
ye.isoWeekday = fD;
ye.dayOfYear = g2;
ye.hour = ye.hours = yD;
ye.minute = ye.minutes = _2;
ye.second = ye.seconds = y2;
ye.millisecond = ye.milliseconds = fw;
ye.utcOffset = tR;
ye.utc = sR;
ye.local = oR;
ye.parseZone = rR;
ye.hasAlignedHourOffset = iR;
ye.isDST = aR;
ye.isLocal = cR;
ye.isUtcOffset = uR;
ye.isUtc = ew;
ye.isUTC = ew;
ye.zoneAbbr = E2;
ye.zoneName = w2;
ye.dates = Ks(
  "dates accessor is deprecated. Use date instead.",
  dw
);
ye.months = Ks(
  "months accessor is deprecated. Use month instead",
  j0
);
ye.years = Ks(
  "years accessor is deprecated. Use year instead",
  P0
);
ye.zone = Ks(
  "moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",
  nR
);
ye.isDSTShifted = Ks(
  "isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",
  lR
);
function S2(e) {
  return en(e * 1e3);
}
function x2() {
  return en.apply(null, arguments).parseZone();
}
function pw(e) {
  return e;
}
var Pt = Hv.prototype;
Pt.calendar = ck;
Pt.longDateFormat = pk;
Pt.invalidDate = mk;
Pt.ordinal = _k;
Pt.preparse = pw;
Pt.postformat = pw;
Pt.relativeTime = bk;
Pt.pastFuture = Ek;
Pt.set = ak;
Pt.eras = qR;
Pt.erasParse = JR;
Pt.erasConvertYear = QR;
Pt.erasAbbrRegex = o2;
Pt.erasNameRegex = s2;
Pt.erasNarrowRegex = r2;
Pt.months = Vk;
Pt.monthsShort = Fk;
Pt.monthsParse = jk;
Pt.monthsRegex = Yk;
Pt.monthsShortRegex = Hk;
Pt.week = Gk;
Pt.firstDayOfYear = Xk;
Pt.firstDayOfWeek = Kk;
Pt.weekdays = rD;
Pt.weekdaysMin = aD;
Pt.weekdaysShort = iD;
Pt.weekdaysParse = cD;
Pt.weekdaysRegex = pD;
Pt.weekdaysShortRegex = hD;
Pt.weekdaysMinRegex = mD;
Pt.isPM = gD;
Pt.meridiem = bD;
function Gd(e, t, n, s) {
  var o = Sr(), i = Uo().set(s, t);
  return o[n](i, e);
}
function hw(e, t, n) {
  if (yr(e) && (t = e, e = void 0), e = e || "", t != null)
    return Gd(e, t, n, "month");
  var s, o = [];
  for (s = 0; s < 12; s++)
    o[s] = Gd(e, s, n, "month");
  return o;
}
function ag(e, t, n, s) {
  typeof e == "boolean" ? (yr(t) && (n = t, t = void 0), t = t || "") : (t = e, n = t, e = !1, yr(t) && (n = t, t = void 0), t = t || "");
  var o = Sr(), i = e ? o._week.dow : 0, r, a = [];
  if (n != null)
    return Gd(t, (n + i) % 7, s, "day");
  for (r = 0; r < 7; r++)
    a[r] = Gd(t, (r + i) % 7, s, "day");
  return a;
}
function N2(e, t) {
  return hw(e, t, "months");
}
function C2(e, t) {
  return hw(e, t, "monthsShort");
}
function O2(e, t, n) {
  return ag(e, t, n, "weekdays");
}
function T2(e, t, n) {
  return ag(e, t, n, "weekdaysShort");
}
function $2(e, t, n) {
  return ag(e, t, n, "weekdaysMin");
}
Jr("en", {
  eras: [
    {
      since: "0001-01-01",
      until: 1 / 0,
      offset: 1,
      name: "Anno Domini",
      narrow: "AD",
      abbr: "AD"
    },
    {
      since: "0000-12-31",
      until: -1 / 0,
      offset: 1,
      name: "Before Christ",
      narrow: "BC",
      abbr: "BC"
    }
  ],
  dayOfMonthOrdinalParse: /\d{1,2}(th|st|nd|rd)/,
  ordinal: function(e) {
    var t = e % 10, n = bt(e % 100 / 10) === 1 ? "th" : t === 1 ? "st" : t === 2 ? "nd" : t === 3 ? "rd" : "th";
    return e + n;
  }
});
me.lang = Ks(
  "moment.lang is deprecated. Use moment.locale instead.",
  Jr
);
me.langData = Ks(
  "moment.langData is deprecated. Use moment.localeData instead.",
  Sr
);
var Xo = Math.abs;
function k2() {
  var e = this._data;
  return this._milliseconds = Xo(this._milliseconds), this._days = Xo(this._days), this._months = Xo(this._months), e.milliseconds = Xo(e.milliseconds), e.seconds = Xo(e.seconds), e.minutes = Xo(e.minutes), e.hours = Xo(e.hours), e.months = Xo(e.months), e.years = Xo(e.years), this;
}
function mw(e, t, n, s) {
  var o = vo(t, n);
  return e._milliseconds += s * o._milliseconds, e._days += s * o._days, e._months += s * o._months, e._bubble();
}
function D2(e, t) {
  return mw(this, e, t, 1);
}
function R2(e, t) {
  return mw(this, e, t, -1);
}
function dy(e) {
  return e < 0 ? Math.floor(e) : Math.ceil(e);
}
function I2() {
  var e = this._milliseconds, t = this._days, n = this._months, s = this._data, o, i, r, a, l;
  return e >= 0 && t >= 0 && n >= 0 || e <= 0 && t <= 0 && n <= 0 || (e += dy(gm(n) + t) * 864e5, t = 0, n = 0), s.milliseconds = e % 1e3, o = Vs(e / 1e3), s.seconds = o % 60, i = Vs(o / 60), s.minutes = i % 60, r = Vs(i / 60), s.hours = r % 24, t += Vs(r / 24), l = Vs(vw(t)), n += l, t -= dy(gm(l)), a = Vs(n / 12), n %= 12, s.days = t, s.months = n, s.years = a, this;
}
function vw(e) {
  return e * 4800 / 146097;
}
function gm(e) {
  return e * 146097 / 4800;
}
function A2(e) {
  if (!this.isValid())
    return NaN;
  var t, n, s = this._milliseconds;
  if (e = Xs(e), e === "month" || e === "quarter" || e === "year")
    switch (t = this._days + s / 864e5, n = this._months + vw(t), e) {
      case "month":
        return n;
      case "quarter":
        return n / 3;
      case "year":
        return n / 12;
    }
  else
    switch (t = this._days + Math.round(gm(this._months)), e) {
      case "week":
        return t / 7 + s / 6048e5;
      case "day":
        return t + s / 864e5;
      case "hour":
        return t * 24 + s / 36e5;
      case "minute":
        return t * 1440 + s / 6e4;
      case "second":
        return t * 86400 + s / 1e3;
      // Math.floor prevents floating point math errors here
      case "millisecond":
        return Math.floor(t * 864e5) + s;
      default:
        throw new Error("Unknown unit " + e);
    }
}
function xr(e) {
  return function() {
    return this.as(e);
  };
}
var gw = xr("ms"), M2 = xr("s"), P2 = xr("m"), L2 = xr("h"), V2 = xr("d"), F2 = xr("w"), U2 = xr("M"), j2 = xr("Q"), B2 = xr("y"), H2 = gw;
function Y2() {
  return vo(this);
}
function W2(e) {
  return e = Xs(e), this.isValid() ? this[e + "s"]() : NaN;
}
function aa(e) {
  return function() {
    return this.isValid() ? this._data[e] : NaN;
  };
}
var G2 = aa("milliseconds"), z2 = aa("seconds"), K2 = aa("minutes"), X2 = aa("hours"), q2 = aa("days"), J2 = aa("months"), Q2 = aa("years");
function Z2() {
  return Vs(this.days() / 7);
}
var nr = Math.round, $a = {
  ss: 44,
  // a few seconds to seconds
  s: 45,
  // seconds to minute
  m: 45,
  // minutes to hour
  h: 22,
  // hours to day
  d: 26,
  // days to month/week
  w: null,
  // weeks to month
  M: 11
  // months to year
};
function eI(e, t, n, s, o) {
  return o.relativeTime(t || 1, !!n, e, s);
}
function tI(e, t, n, s) {
  var o = vo(e).abs(), i = nr(o.as("s")), r = nr(o.as("m")), a = nr(o.as("h")), l = nr(o.as("d")), u = nr(o.as("M")), d = nr(o.as("w")), f = nr(o.as("y")), p = i <= n.ss && ["s", i] || i < n.s && ["ss", i] || r <= 1 && ["m"] || r < n.m && ["mm", r] || a <= 1 && ["h"] || a < n.h && ["hh", a] || l <= 1 && ["d"] || l < n.d && ["dd", l];
  return n.w != null && (p = p || d <= 1 && ["w"] || d < n.w && ["ww", d]), p = p || u <= 1 && ["M"] || u < n.M && ["MM", u] || f <= 1 && ["y"] || ["yy", f], p[2] = t, p[3] = +e > 0, p[4] = s, eI.apply(null, p);
}
function nI(e) {
  return e === void 0 ? nr : typeof e == "function" ? (nr = e, !0) : !1;
}
function sI(e, t) {
  return $a[e] === void 0 ? !1 : t === void 0 ? $a[e] : ($a[e] = t, e === "s" && ($a.ss = t - 1), !0);
}
function oI(e, t) {
  if (!this.isValid())
    return this.localeData().invalidDate();
  var n = !1, s = $a, o, i;
  return typeof e == "object" && (t = e, e = !1), typeof e == "boolean" && (n = e), typeof t == "object" && (s = Object.assign({}, $a, t), t.s != null && t.ss == null && (s.ss = t.s - 1)), o = this.localeData(), i = tI(this, !n, s, o), n && (i = o.pastFuture(+this, i)), o.postformat(i);
}
var nh = Math.abs;
function va(e) {
  return (e > 0) - (e < 0) || +e;
}
function Xf() {
  if (!this.isValid())
    return this.localeData().invalidDate();
  var e = nh(this._milliseconds) / 1e3, t = nh(this._days), n = nh(this._months), s, o, i, r, a = this.asSeconds(), l, u, d, f;
  return a ? (s = Vs(e / 60), o = Vs(s / 60), e %= 60, s %= 60, i = Vs(n / 12), n %= 12, r = e ? e.toFixed(3).replace(/\.?0+$/, "") : "", l = a < 0 ? "-" : "", u = va(this._months) !== va(a) ? "-" : "", d = va(this._days) !== va(a) ? "-" : "", f = va(this._milliseconds) !== va(a) ? "-" : "", l + "P" + (i ? u + i + "Y" : "") + (n ? u + n + "M" : "") + (t ? d + t + "D" : "") + (o || s || e ? "T" : "") + (o ? f + o + "H" : "") + (s ? f + s + "M" : "") + (e ? f + r + "S" : "")) : "P0D";
}
var Ot = zf.prototype;
Ot.isValid = JD;
Ot.abs = k2;
Ot.add = D2;
Ot.subtract = R2;
Ot.as = A2;
Ot.asMilliseconds = gw;
Ot.asSeconds = M2;
Ot.asMinutes = P2;
Ot.asHours = L2;
Ot.asDays = V2;
Ot.asWeeks = F2;
Ot.asMonths = U2;
Ot.asQuarters = j2;
Ot.asYears = B2;
Ot.valueOf = H2;
Ot._bubble = I2;
Ot.clone = Y2;
Ot.get = W2;
Ot.milliseconds = G2;
Ot.seconds = z2;
Ot.minutes = K2;
Ot.hours = X2;
Ot.days = q2;
Ot.weeks = Z2;
Ot.months = J2;
Ot.years = Q2;
Ot.humanize = oI;
Ot.toISOString = Xf;
Ot.toString = Xf;
Ot.toJSON = Xf;
Ot.locale = ow;
Ot.localeData = iw;
Ot.toIsoString = Ks(
  "toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",
  Xf
);
Ot.lang = rw;
He("X", 0, 0, "unix");
He("x", 0, 0, "valueOf");
Re("x", Hf);
Re("X", Nk);
Kt("X", function(e, t, n) {
  n._d = new Date(parseFloat(e) * 1e3);
});
Kt("x", function(e, t, n) {
  n._d = new Date(bt(e));
});
//! moment.js
me.version = "2.30.1";
rk(en);
me.fn = ye;
me.min = zD;
me.max = KD;
me.now = XD;
me.utc = Uo;
me.unix = S2;
me.months = N2;
me.isDate = Xc;
me.locale = Jr;
me.invalid = Ff;
me.duration = vo;
me.isMoment = mo;
me.weekdays = O2;
me.parseZone = x2;
me.localeData = Sr;
me.isDuration = od;
me.monthsShort = C2;
me.weekdaysMin = $2;
me.defineLocale = Zv;
me.updateLocale = xD;
me.locales = ND;
me.weekdaysShort = T2;
me.normalizeUnits = Xs;
me.relativeTimeRounding = nI;
me.relativeTimeThreshold = sI;
me.calendarFormat = bR;
me.prototype = ye;
me.HTML5_FMT = {
  DATETIME_LOCAL: "YYYY-MM-DDTHH:mm",
  // <input type="datetime-local" />
  DATETIME_LOCAL_SECONDS: "YYYY-MM-DDTHH:mm:ss",
  // <input type="datetime-local" step="1" />
  DATETIME_LOCAL_MS: "YYYY-MM-DDTHH:mm:ss.SSS",
  // <input type="datetime-local" step="0.001" />
  DATE: "YYYY-MM-DD",
  // <input type="date" />
  TIME: "HH:mm",
  // <input type="time" />
  TIME_SECONDS: "HH:mm:ss",
  // <input type="time" step="1" />
  TIME_MS: "HH:mm:ss.SSS",
  // <input type="time" step="0.001" />
  WEEK: "GGGG-[W]WW",
  // <input type="week" />
  MONTH: "YYYY-MM"
  // <input type="month" />
};
class rI {
  constructor(t) {
    Qe(this, "body");
    Qe(this, "createdAt");
    Qe(this, "expiration");
    Qe(this, "from");
    Qe(this, "id");
    Qe(this, "lifespan");
    Qe(this, "read");
    Qe(this, "subject");
    Qe(this, "summary");
    Qe(this, "to");
    for (const [n, s] of Object.entries(t))
      n in this && (this[n] = s);
  }
  getReadable(t) {
    return console.log(t), me(t).fromNow();
  }
  get readableCreatedAt() {
    return this.getReadable(this.createdAt);
  }
  get readableExpiration() {
    return this.getReadable(this.expiration);
  }
}
function _w(e, t) {
  return function() {
    return e.apply(t, arguments);
  };
}
const { toString: iI } = Object.prototype, { getPrototypeOf: lg } = Object, { iterator: qf, toStringTag: yw } = Symbol, Jf = /* @__PURE__ */ ((e) => (t) => {
  const n = iI.call(t);
  return e[n] || (e[n] = n.slice(8, -1).toLowerCase());
})(/* @__PURE__ */ Object.create(null)), go = (e) => (e = e.toLowerCase(), (t) => Jf(t) === e), Qf = (e) => (t) => typeof t === e, { isArray: fl } = Array, Rc = Qf("undefined");
function aI(e) {
  return e !== null && !Rc(e) && e.constructor !== null && !Rc(e.constructor) && Ss(e.constructor.isBuffer) && e.constructor.isBuffer(e);
}
const bw = go("ArrayBuffer");
function lI(e) {
  let t;
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && bw(e.buffer), t;
}
const cI = Qf("string"), Ss = Qf("function"), Ew = Qf("number"), Zf = (e) => e !== null && typeof e == "object", uI = (e) => e === !0 || e === !1, id = (e) => {
  if (Jf(e) !== "object")
    return !1;
  const t = lg(e);
  return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(yw in e) && !(qf in e);
}, dI = go("Date"), fI = go("File"), pI = go("Blob"), hI = go("FileList"), mI = (e) => Zf(e) && Ss(e.pipe), vI = (e) => {
  let t;
  return e && (typeof FormData == "function" && e instanceof FormData || Ss(e.append) && ((t = Jf(e)) === "formdata" || // detect form-data instance
  t === "object" && Ss(e.toString) && e.toString() === "[object FormData]"));
}, gI = go("URLSearchParams"), [_I, yI, bI, EI] = ["ReadableStream", "Request", "Response", "Headers"].map(go), wI = (e) => e.trim ? e.trim() : e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
function Zc(e, t, { allOwnKeys: n = !1 } = {}) {
  if (e === null || typeof e > "u")
    return;
  let s, o;
  if (typeof e != "object" && (e = [e]), fl(e))
    for (s = 0, o = e.length; s < o; s++)
      t.call(null, e[s], s, e);
  else {
    const i = n ? Object.getOwnPropertyNames(e) : Object.keys(e), r = i.length;
    let a;
    for (s = 0; s < r; s++)
      a = i[s], t.call(null, e[a], a, e);
  }
}
function ww(e, t) {
  t = t.toLowerCase();
  const n = Object.keys(e);
  let s = n.length, o;
  for (; s-- > 0; )
    if (o = n[s], t === o.toLowerCase())
      return o;
  return null;
}
const Ni = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Sw = (e) => !Rc(e) && e !== Ni;
function _m() {
  const { caseless: e } = Sw(this) && this || {}, t = {}, n = (s, o) => {
    const i = e && ww(t, o) || o;
    id(t[i]) && id(s) ? t[i] = _m(t[i], s) : id(s) ? t[i] = _m({}, s) : fl(s) ? t[i] = s.slice() : t[i] = s;
  };
  for (let s = 0, o = arguments.length; s < o; s++)
    arguments[s] && Zc(arguments[s], n);
  return t;
}
const SI = (e, t, n, { allOwnKeys: s } = {}) => (Zc(t, (o, i) => {
  n && Ss(o) ? e[i] = _w(o, n) : e[i] = o;
}, { allOwnKeys: s }), e), xI = (e) => (e.charCodeAt(0) === 65279 && (e = e.slice(1)), e), NI = (e, t, n, s) => {
  e.prototype = Object.create(t.prototype, s), e.prototype.constructor = e, Object.defineProperty(e, "super", {
    value: t.prototype
  }), n && Object.assign(e.prototype, n);
}, CI = (e, t, n, s) => {
  let o, i, r;
  const a = {};
  if (t = t || {}, e == null) return t;
  do {
    for (o = Object.getOwnPropertyNames(e), i = o.length; i-- > 0; )
      r = o[i], (!s || s(r, e, t)) && !a[r] && (t[r] = e[r], a[r] = !0);
    e = n !== !1 && lg(e);
  } while (e && (!n || n(e, t)) && e !== Object.prototype);
  return t;
}, OI = (e, t, n) => {
  e = String(e), (n === void 0 || n > e.length) && (n = e.length), n -= t.length;
  const s = e.indexOf(t, n);
  return s !== -1 && s === n;
}, TI = (e) => {
  if (!e) return null;
  if (fl(e)) return e;
  let t = e.length;
  if (!Ew(t)) return null;
  const n = new Array(t);
  for (; t-- > 0; )
    n[t] = e[t];
  return n;
}, $I = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && lg(Uint8Array)), kI = (e, t) => {
  const s = (e && e[qf]).call(e);
  let o;
  for (; (o = s.next()) && !o.done; ) {
    const i = o.value;
    t.call(e, i[0], i[1]);
  }
}, DI = (e, t) => {
  let n;
  const s = [];
  for (; (n = e.exec(t)) !== null; )
    s.push(n);
  return s;
}, RI = go("HTMLFormElement"), II = (e) => e.toLowerCase().replace(
  /[-_\s]([a-z\d])(\w*)/g,
  function(n, s, o) {
    return s.toUpperCase() + o;
  }
), fy = (({ hasOwnProperty: e }) => (t, n) => e.call(t, n))(Object.prototype), AI = go("RegExp"), xw = (e, t) => {
  const n = Object.getOwnPropertyDescriptors(e), s = {};
  Zc(n, (o, i) => {
    let r;
    (r = t(o, i, e)) !== !1 && (s[i] = r || o);
  }), Object.defineProperties(e, s);
}, MI = (e) => {
  xw(e, (t, n) => {
    if (Ss(e) && ["arguments", "caller", "callee"].indexOf(n) !== -1)
      return !1;
    const s = e[n];
    if (Ss(s)) {
      if (t.enumerable = !1, "writable" in t) {
        t.writable = !1;
        return;
      }
      t.set || (t.set = () => {
        throw Error("Can not rewrite read-only method '" + n + "'");
      });
    }
  });
}, PI = (e, t) => {
  const n = {}, s = (o) => {
    o.forEach((i) => {
      n[i] = !0;
    });
  };
  return fl(e) ? s(e) : s(String(e).split(t)), n;
}, LI = () => {
}, VI = (e, t) => e != null && Number.isFinite(e = +e) ? e : t;
function FI(e) {
  return !!(e && Ss(e.append) && e[yw] === "FormData" && e[qf]);
}
const UI = (e) => {
  const t = new Array(10), n = (s, o) => {
    if (Zf(s)) {
      if (t.indexOf(s) >= 0)
        return;
      if (!("toJSON" in s)) {
        t[o] = s;
        const i = fl(s) ? [] : {};
        return Zc(s, (r, a) => {
          const l = n(r, o + 1);
          !Rc(l) && (i[a] = l);
        }), t[o] = void 0, i;
      }
    }
    return s;
  };
  return n(e, 0);
}, jI = go("AsyncFunction"), BI = (e) => e && (Zf(e) || Ss(e)) && Ss(e.then) && Ss(e.catch), Nw = ((e, t) => e ? setImmediate : t ? ((n, s) => (Ni.addEventListener("message", ({ source: o, data: i }) => {
  o === Ni && i === n && s.length && s.shift()();
}, !1), (o) => {
  s.push(o), Ni.postMessage(n, "*");
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
  typeof setImmediate == "function",
  Ss(Ni.postMessage)
), HI = typeof queueMicrotask < "u" ? queueMicrotask.bind(Ni) : typeof process < "u" && process.nextTick || Nw, YI = (e) => e != null && Ss(e[qf]), ee = {
  isArray: fl,
  isArrayBuffer: bw,
  isBuffer: aI,
  isFormData: vI,
  isArrayBufferView: lI,
  isString: cI,
  isNumber: Ew,
  isBoolean: uI,
  isObject: Zf,
  isPlainObject: id,
  isReadableStream: _I,
  isRequest: yI,
  isResponse: bI,
  isHeaders: EI,
  isUndefined: Rc,
  isDate: dI,
  isFile: fI,
  isBlob: pI,
  isRegExp: AI,
  isFunction: Ss,
  isStream: mI,
  isURLSearchParams: gI,
  isTypedArray: $I,
  isFileList: hI,
  forEach: Zc,
  merge: _m,
  extend: SI,
  trim: wI,
  stripBOM: xI,
  inherits: NI,
  toFlatObject: CI,
  kindOf: Jf,
  kindOfTest: go,
  endsWith: OI,
  toArray: TI,
  forEachEntry: kI,
  matchAll: DI,
  isHTMLForm: RI,
  hasOwnProperty: fy,
  hasOwnProp: fy,
  // an alias to avoid ESLint no-prototype-builtins detection
  reduceDescriptors: xw,
  freezeMethods: MI,
  toObjectSet: PI,
  toCamelCase: II,
  noop: LI,
  toFiniteNumber: VI,
  findKey: ww,
  global: Ni,
  isContextDefined: Sw,
  isSpecCompliantForm: FI,
  toJSONObject: UI,
  isAsyncFn: jI,
  isThenable: BI,
  setImmediate: Nw,
  asap: HI,
  isIterable: YI
};
function ct(e, t, n, s, o) {
  Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = e, this.name = "AxiosError", t && (this.code = t), n && (this.config = n), s && (this.request = s), o && (this.response = o, this.status = o.status ? o.status : null);
}
ee.inherits(ct, Error, {
  toJSON: function() {
    return {
      // Standard
      message: this.message,
      name: this.name,
      // Microsoft
      description: this.description,
      number: this.number,
      // Mozilla
      fileName: this.fileName,
      lineNumber: this.lineNumber,
      columnNumber: this.columnNumber,
      stack: this.stack,
      // Axios
      config: ee.toJSONObject(this.config),
      code: this.code,
      status: this.status
    };
  }
});
const Cw = ct.prototype, Ow = {};
[
  "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"
  // eslint-disable-next-line func-names
].forEach((e) => {
  Ow[e] = { value: e };
});
Object.defineProperties(ct, Ow);
Object.defineProperty(Cw, "isAxiosError", { value: !0 });
ct.from = (e, t, n, s, o, i) => {
  const r = Object.create(Cw);
  return ee.toFlatObject(e, r, function(l) {
    return l !== Error.prototype;
  }, (a) => a !== "isAxiosError"), ct.call(r, e.message, t, n, s, o), r.cause = e, r.name = e.name, i && Object.assign(r, i), r;
};
const WI = null;
function ym(e) {
  return ee.isPlainObject(e) || ee.isArray(e);
}
function Tw(e) {
  return ee.endsWith(e, "[]") ? e.slice(0, -2) : e;
}
function py(e, t, n) {
  return e ? e.concat(t).map(function(o, i) {
    return o = Tw(o), !n && i ? "[" + o + "]" : o;
  }).join(n ? "." : "") : t;
}
function GI(e) {
  return ee.isArray(e) && !e.some(ym);
}
const zI = ee.toFlatObject(ee, {}, null, function(t) {
  return /^is[A-Z]/.test(t);
});
function ep(e, t, n) {
  if (!ee.isObject(e))
    throw new TypeError("target must be an object");
  t = t || new FormData(), n = ee.toFlatObject(n, {
    metaTokens: !0,
    dots: !1,
    indexes: !1
  }, !1, function(v, _) {
    return !ee.isUndefined(_[v]);
  });
  const s = n.metaTokens, o = n.visitor || d, i = n.dots, r = n.indexes, l = (n.Blob || typeof Blob < "u" && Blob) && ee.isSpecCompliantForm(t);
  if (!ee.isFunction(o))
    throw new TypeError("visitor must be a function");
  function u(m) {
    if (m === null) return "";
    if (ee.isDate(m))
      return m.toISOString();
    if (ee.isBoolean(m))
      return m.toString();
    if (!l && ee.isBlob(m))
      throw new ct("Blob is not supported. Use a Buffer instead.");
    return ee.isArrayBuffer(m) || ee.isTypedArray(m) ? l && typeof Blob == "function" ? new Blob([m]) : Buffer.from(m) : m;
  }
  function d(m, v, _) {
    let b = m;
    if (m && !_ && typeof m == "object") {
      if (ee.endsWith(v, "{}"))
        v = s ? v : v.slice(0, -2), m = JSON.stringify(m);
      else if (ee.isArray(m) && GI(m) || (ee.isFileList(m) || ee.endsWith(v, "[]")) && (b = ee.toArray(m)))
        return v = Tw(v), b.forEach(function(y, x) {
          !(ee.isUndefined(y) || y === null) && t.append(
            // eslint-disable-next-line no-nested-ternary
            r === !0 ? py([v], x, i) : r === null ? v : v + "[]",
            u(y)
          );
        }), !1;
    }
    return ym(m) ? !0 : (t.append(py(_, v, i), u(m)), !1);
  }
  const f = [], p = Object.assign(zI, {
    defaultVisitor: d,
    convertValue: u,
    isVisitable: ym
  });
  function h(m, v) {
    if (!ee.isUndefined(m)) {
      if (f.indexOf(m) !== -1)
        throw Error("Circular reference detected in " + v.join("."));
      f.push(m), ee.forEach(m, function(b, w) {
        (!(ee.isUndefined(b) || b === null) && o.call(
          t,
          b,
          ee.isString(w) ? w.trim() : w,
          v,
          p
        )) === !0 && h(b, v ? v.concat(w) : [w]);
      }), f.pop();
    }
  }
  if (!ee.isObject(e))
    throw new TypeError("data must be an object");
  return h(e), t;
}
function hy(e) {
  const t = {
    "!": "%21",
    "'": "%27",
    "(": "%28",
    ")": "%29",
    "~": "%7E",
    "%20": "+",
    "%00": "\0"
  };
  return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g, function(s) {
    return t[s];
  });
}
function cg(e, t) {
  this._pairs = [], e && ep(e, this, t);
}
const $w = cg.prototype;
$w.append = function(t, n) {
  this._pairs.push([t, n]);
};
$w.toString = function(t) {
  const n = t ? function(s) {
    return t.call(this, s, hy);
  } : hy;
  return this._pairs.map(function(o) {
    return n(o[0]) + "=" + n(o[1]);
  }, "").join("&");
};
function KI(e) {
  return encodeURIComponent(e).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
}
function kw(e, t, n) {
  if (!t)
    return e;
  const s = n && n.encode || KI;
  ee.isFunction(n) && (n = {
    serialize: n
  });
  const o = n && n.serialize;
  let i;
  if (o ? i = o(t, n) : i = ee.isURLSearchParams(t) ? t.toString() : new cg(t, n).toString(s), i) {
    const r = e.indexOf("#");
    r !== -1 && (e = e.slice(0, r)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
  }
  return e;
}
class my {
  constructor() {
    this.handlers = [];
  }
  /**
   * Add a new interceptor to the stack
   *
   * @param {Function} fulfilled The function to handle `then` for a `Promise`
   * @param {Function} rejected The function to handle `reject` for a `Promise`
   *
   * @return {Number} An ID used to remove interceptor later
   */
  use(t, n, s) {
    return this.handlers.push({
      fulfilled: t,
      rejected: n,
      synchronous: s ? s.synchronous : !1,
      runWhen: s ? s.runWhen : null
    }), this.handlers.length - 1;
  }
  /**
   * Remove an interceptor from the stack
   *
   * @param {Number} id The ID that was returned by `use`
   *
   * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise
   */
  eject(t) {
    this.handlers[t] && (this.handlers[t] = null);
  }
  /**
   * Clear all interceptors from the stack
   *
   * @returns {void}
   */
  clear() {
    this.handlers && (this.handlers = []);
  }
  /**
   * Iterate over all the registered interceptors
   *
   * This method is particularly useful for skipping over any
   * interceptors that may have become `null` calling `eject`.
   *
   * @param {Function} fn The function to call for each interceptor
   *
   * @returns {void}
   */
  forEach(t) {
    ee.forEach(this.handlers, function(s) {
      s !== null && t(s);
    });
  }
}
const Dw = {
  silentJSONParsing: !0,
  forcedJSONParsing: !0,
  clarifyTimeoutError: !1
}, XI = typeof URLSearchParams < "u" ? URLSearchParams : cg, qI = typeof FormData < "u" ? FormData : null, JI = typeof Blob < "u" ? Blob : null, QI = {
  isBrowser: !0,
  classes: {
    URLSearchParams: XI,
    FormData: qI,
    Blob: JI
  },
  protocols: ["http", "https", "file", "blob", "url", "data"]
}, ug = typeof window < "u" && typeof document < "u", bm = typeof navigator == "object" && navigator || void 0, ZI = ug && (!bm || ["ReactNative", "NativeScript", "NS"].indexOf(bm.product) < 0), eA = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", tA = ug && window.location.href || "http://localhost", nA = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  hasBrowserEnv: ug,
  hasStandardBrowserEnv: ZI,
  hasStandardBrowserWebWorkerEnv: eA,
  navigator: bm,
  origin: tA
}, Symbol.toStringTag, { value: "Module" })), Kn = {
  ...nA,
  ...QI
};
function sA(e, t) {
  return ep(e, new Kn.classes.URLSearchParams(), Object.assign({
    visitor: function(n, s, o, i) {
      return Kn.isNode && ee.isBuffer(n) ? (this.append(s, n.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
    }
  }, t));
}
function oA(e) {
  return ee.matchAll(/\w+|\[(\w*)]/g, e).map((t) => t[0] === "[]" ? "" : t[1] || t[0]);
}
function rA(e) {
  const t = {}, n = Object.keys(e);
  let s;
  const o = n.length;
  let i;
  for (s = 0; s < o; s++)
    i = n[s], t[i] = e[i];
  return t;
}
function Rw(e) {
  function t(n, s, o, i) {
    let r = n[i++];
    if (r === "__proto__") return !0;
    const a = Number.isFinite(+r), l = i >= n.length;
    return r = !r && ee.isArray(o) ? o.length : r, l ? (ee.hasOwnProp(o, r) ? o[r] = [o[r], s] : o[r] = s, !a) : ((!o[r] || !ee.isObject(o[r])) && (o[r] = []), t(n, s, o[r], i) && ee.isArray(o[r]) && (o[r] = rA(o[r])), !a);
  }
  if (ee.isFormData(e) && ee.isFunction(e.entries)) {
    const n = {};
    return ee.forEachEntry(e, (s, o) => {
      t(oA(s), o, n, 0);
    }), n;
  }
  return null;
}
function iA(e, t, n) {
  if (ee.isString(e))
    try {
      return (t || JSON.parse)(e), ee.trim(e);
    } catch (s) {
      if (s.name !== "SyntaxError")
        throw s;
    }
  return (n || JSON.stringify)(e);
}
const eu = {
  transitional: Dw,
  adapter: ["xhr", "http", "fetch"],
  transformRequest: [function(t, n) {
    const s = n.getContentType() || "", o = s.indexOf("application/json") > -1, i = ee.isObject(t);
    if (i && ee.isHTMLForm(t) && (t = new FormData(t)), ee.isFormData(t))
      return o ? JSON.stringify(Rw(t)) : t;
    if (ee.isArrayBuffer(t) || ee.isBuffer(t) || ee.isStream(t) || ee.isFile(t) || ee.isBlob(t) || ee.isReadableStream(t))
      return t;
    if (ee.isArrayBufferView(t))
      return t.buffer;
    if (ee.isURLSearchParams(t))
      return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), t.toString();
    let a;
    if (i) {
      if (s.indexOf("application/x-www-form-urlencoded") > -1)
        return sA(t, this.formSerializer).toString();
      if ((a = ee.isFileList(t)) || s.indexOf("multipart/form-data") > -1) {
        const l = this.env && this.env.FormData;
        return ep(
          a ? { "files[]": t } : t,
          l && new l(),
          this.formSerializer
        );
      }
    }
    return i || o ? (n.setContentType("application/json", !1), iA(t)) : t;
  }],
  transformResponse: [function(t) {
    const n = this.transitional || eu.transitional, s = n && n.forcedJSONParsing, o = this.responseType === "json";
    if (ee.isResponse(t) || ee.isReadableStream(t))
      return t;
    if (t && ee.isString(t) && (s && !this.responseType || o)) {
      const r = !(n && n.silentJSONParsing) && o;
      try {
        return JSON.parse(t);
      } catch (a) {
        if (r)
          throw a.name === "SyntaxError" ? ct.from(a, ct.ERR_BAD_RESPONSE, this, null, this.response) : a;
      }
    }
    return t;
  }],
  /**
   * A timeout in milliseconds to abort a request. If set to 0 (default) a
   * timeout is not created.
   */
  timeout: 0,
  xsrfCookieName: "XSRF-TOKEN",
  xsrfHeaderName: "X-XSRF-TOKEN",
  maxContentLength: -1,
  maxBodyLength: -1,
  env: {
    FormData: Kn.classes.FormData,
    Blob: Kn.classes.Blob
  },
  validateStatus: function(t) {
    return t >= 200 && t < 300;
  },
  headers: {
    common: {
      Accept: "application/json, text/plain, */*",
      "Content-Type": void 0
    }
  }
};
ee.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
  eu.headers[e] = {};
});
const aA = ee.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"
]), lA = (e) => {
  const t = {};
  let n, s, o;
  return e && e.split(`
`).forEach(function(r) {
    o = r.indexOf(":"), n = r.substring(0, o).trim().toLowerCase(), s = r.substring(o + 1).trim(), !(!n || t[n] && aA[n]) && (n === "set-cookie" ? t[n] ? t[n].push(s) : t[n] = [s] : t[n] = t[n] ? t[n] + ", " + s : s);
  }), t;
}, vy = Symbol("internals");
function kl(e) {
  return e && String(e).trim().toLowerCase();
}
function ad(e) {
  return e === !1 || e == null ? e : ee.isArray(e) ? e.map(ad) : String(e);
}
function cA(e) {
  const t = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
  let s;
  for (; s = n.exec(e); )
    t[s[1]] = s[2];
  return t;
}
const uA = (e) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());
function sh(e, t, n, s, o) {
  if (ee.isFunction(s))
    return s.call(this, t, n);
  if (o && (t = n), !!ee.isString(t)) {
    if (ee.isString(s))
      return t.indexOf(s) !== -1;
    if (ee.isRegExp(s))
      return s.test(t);
  }
}
function dA(e) {
  return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (t, n, s) => n.toUpperCase() + s);
}
function fA(e, t) {
  const n = ee.toCamelCase(" " + t);
  ["get", "set", "has"].forEach((s) => {
    Object.defineProperty(e, s + n, {
      value: function(o, i, r) {
        return this[s].call(this, t, o, i, r);
      },
      configurable: !0
    });
  });
}
let xs = class {
  constructor(t) {
    t && this.set(t);
  }
  set(t, n, s) {
    const o = this;
    function i(a, l, u) {
      const d = kl(l);
      if (!d)
        throw new Error("header name must be a non-empty string");
      const f = ee.findKey(o, d);
      (!f || o[f] === void 0 || u === !0 || u === void 0 && o[f] !== !1) && (o[f || l] = ad(a));
    }
    const r = (a, l) => ee.forEach(a, (u, d) => i(u, d, l));
    if (ee.isPlainObject(t) || t instanceof this.constructor)
      r(t, n);
    else if (ee.isString(t) && (t = t.trim()) && !uA(t))
      r(lA(t), n);
    else if (ee.isObject(t) && ee.isIterable(t)) {
      let a = {}, l, u;
      for (const d of t) {
        if (!ee.isArray(d))
          throw TypeError("Object iterator must return a key-value pair");
        a[u = d[0]] = (l = a[u]) ? ee.isArray(l) ? [...l, d[1]] : [l, d[1]] : d[1];
      }
      r(a, n);
    } else
      t != null && i(n, t, s);
    return this;
  }
  get(t, n) {
    if (t = kl(t), t) {
      const s = ee.findKey(this, t);
      if (s) {
        const o = this[s];
        if (!n)
          return o;
        if (n === !0)
          return cA(o);
        if (ee.isFunction(n))
          return n.call(this, o, s);
        if (ee.isRegExp(n))
          return n.exec(o);
        throw new TypeError("parser must be boolean|regexp|function");
      }
    }
  }
  has(t, n) {
    if (t = kl(t), t) {
      const s = ee.findKey(this, t);
      return !!(s && this[s] !== void 0 && (!n || sh(this, this[s], s, n)));
    }
    return !1;
  }
  delete(t, n) {
    const s = this;
    let o = !1;
    function i(r) {
      if (r = kl(r), r) {
        const a = ee.findKey(s, r);
        a && (!n || sh(s, s[a], a, n)) && (delete s[a], o = !0);
      }
    }
    return ee.isArray(t) ? t.forEach(i) : i(t), o;
  }
  clear(t) {
    const n = Object.keys(this);
    let s = n.length, o = !1;
    for (; s--; ) {
      const i = n[s];
      (!t || sh(this, this[i], i, t, !0)) && (delete this[i], o = !0);
    }
    return o;
  }
  normalize(t) {
    const n = this, s = {};
    return ee.forEach(this, (o, i) => {
      const r = ee.findKey(s, i);
      if (r) {
        n[r] = ad(o), delete n[i];
        return;
      }
      const a = t ? dA(i) : String(i).trim();
      a !== i && delete n[i], n[a] = ad(o), s[a] = !0;
    }), this;
  }
  concat(...t) {
    return this.constructor.concat(this, ...t);
  }
  toJSON(t) {
    const n = /* @__PURE__ */ Object.create(null);
    return ee.forEach(this, (s, o) => {
      s != null && s !== !1 && (n[o] = t && ee.isArray(s) ? s.join(", ") : s);
    }), n;
  }
  [Symbol.iterator]() {
    return Object.entries(this.toJSON())[Symbol.iterator]();
  }
  toString() {
    return Object.entries(this.toJSON()).map(([t, n]) => t + ": " + n).join(`
`);
  }
  getSetCookie() {
    return this.get("set-cookie") || [];
  }
  get [Symbol.toStringTag]() {
    return "AxiosHeaders";
  }
  static from(t) {
    return t instanceof this ? t : new this(t);
  }
  static concat(t, ...n) {
    const s = new this(t);
    return n.forEach((o) => s.set(o)), s;
  }
  static accessor(t) {
    const s = (this[vy] = this[vy] = {
      accessors: {}
    }).accessors, o = this.prototype;
    function i(r) {
      const a = kl(r);
      s[a] || (fA(o, r), s[a] = !0);
    }
    return ee.isArray(t) ? t.forEach(i) : i(t), this;
  }
};
xs.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
ee.reduceDescriptors(xs.prototype, ({ value: e }, t) => {
  let n = t[0].toUpperCase() + t.slice(1);
  return {
    get: () => e,
    set(s) {
      this[n] = s;
    }
  };
});
ee.freezeMethods(xs);
function oh(e, t) {
  const n = this || eu, s = t || n, o = xs.from(s.headers);
  let i = s.data;
  return ee.forEach(e, function(a) {
    i = a.call(n, i, o.normalize(), t ? t.status : void 0);
  }), o.normalize(), i;
}
function Iw(e) {
  return !!(e && e.__CANCEL__);
}
function pl(e, t, n) {
  ct.call(this, e ?? "canceled", ct.ERR_CANCELED, t, n), this.name = "CanceledError";
}
ee.inherits(pl, ct, {
  __CANCEL__: !0
});
function Aw(e, t, n) {
  const s = n.config.validateStatus;
  !n.status || !s || s(n.status) ? e(n) : t(new ct(
    "Request failed with status code " + n.status,
    [ct.ERR_BAD_REQUEST, ct.ERR_BAD_RESPONSE][Math.floor(n.status / 100) - 4],
    n.config,
    n.request,
    n
  ));
}
function pA(e) {
  const t = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e);
  return t && t[1] || "";
}
function hA(e, t) {
  e = e || 10;
  const n = new Array(e), s = new Array(e);
  let o = 0, i = 0, r;
  return t = t !== void 0 ? t : 1e3, function(l) {
    const u = Date.now(), d = s[i];
    r || (r = u), n[o] = l, s[o] = u;
    let f = i, p = 0;
    for (; f !== o; )
      p += n[f++], f = f % e;
    if (o = (o + 1) % e, o === i && (i = (i + 1) % e), u - r < t)
      return;
    const h = d && u - d;
    return h ? Math.round(p * 1e3 / h) : void 0;
  };
}
function mA(e, t) {
  let n = 0, s = 1e3 / t, o, i;
  const r = (u, d = Date.now()) => {
    n = d, o = null, i && (clearTimeout(i), i = null), e.apply(null, u);
  };
  return [(...u) => {
    const d = Date.now(), f = d - n;
    f >= s ? r(u, d) : (o = u, i || (i = setTimeout(() => {
      i = null, r(o);
    }, s - f)));
  }, () => o && r(o)];
}
const zd = (e, t, n = 3) => {
  let s = 0;
  const o = hA(50, 250);
  return mA((i) => {
    const r = i.loaded, a = i.lengthComputable ? i.total : void 0, l = r - s, u = o(l), d = r <= a;
    s = r;
    const f = {
      loaded: r,
      total: a,
      progress: a ? r / a : void 0,
      bytes: l,
      rate: u || void 0,
      estimated: u && a && d ? (a - r) / u : void 0,
      event: i,
      lengthComputable: a != null,
      [t ? "download" : "upload"]: !0
    };
    e(f);
  }, n);
}, gy = (e, t) => {
  const n = e != null;
  return [(s) => t[0]({
    lengthComputable: n,
    total: e,
    loaded: s
  }), t[1]];
}, _y = (e) => (...t) => ee.asap(() => e(...t)), vA = Kn.hasStandardBrowserEnv ? /* @__PURE__ */ ((e, t) => (n) => (n = new URL(n, Kn.origin), e.protocol === n.protocol && e.host === n.host && (t || e.port === n.port)))(
  new URL(Kn.origin),
  Kn.navigator && /(msie|trident)/i.test(Kn.navigator.userAgent)
) : () => !0, gA = Kn.hasStandardBrowserEnv ? (
  // Standard browser envs support document.cookie
  {
    write(e, t, n, s, o, i) {
      const r = [e + "=" + encodeURIComponent(t)];
      ee.isNumber(n) && r.push("expires=" + new Date(n).toGMTString()), ee.isString(s) && r.push("path=" + s), ee.isString(o) && r.push("domain=" + o), i === !0 && r.push("secure"), document.cookie = r.join("; ");
    },
    read(e) {
      const t = document.cookie.match(new RegExp("(^|;\\s*)(" + e + ")=([^;]*)"));
      return t ? decodeURIComponent(t[3]) : null;
    },
    remove(e) {
      this.write(e, "", Date.now() - 864e5);
    }
  }
) : (
  // Non-standard browser env (web workers, react-native) lack needed support.
  {
    write() {
    },
    read() {
      return null;
    },
    remove() {
    }
  }
);
function _A(e) {
  return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
}
function yA(e, t) {
  return t ? e.replace(/\/?\/$/, "") + "/" + t.replace(/^\/+/, "") : e;
}
function Mw(e, t, n) {
  let s = !_A(t);
  return e && (s || n == !1) ? yA(e, t) : t;
}
const yy = (e) => e instanceof xs ? { ...e } : e;
function zi(e, t) {
  t = t || {};
  const n = {};
  function s(u, d, f, p) {
    return ee.isPlainObject(u) && ee.isPlainObject(d) ? ee.merge.call({ caseless: p }, u, d) : ee.isPlainObject(d) ? ee.merge({}, d) : ee.isArray(d) ? d.slice() : d;
  }
  function o(u, d, f, p) {
    if (ee.isUndefined(d)) {
      if (!ee.isUndefined(u))
        return s(void 0, u, f, p);
    } else return s(u, d, f, p);
  }
  function i(u, d) {
    if (!ee.isUndefined(d))
      return s(void 0, d);
  }
  function r(u, d) {
    if (ee.isUndefined(d)) {
      if (!ee.isUndefined(u))
        return s(void 0, u);
    } else return s(void 0, d);
  }
  function a(u, d, f) {
    if (f in t)
      return s(u, d);
    if (f in e)
      return s(void 0, u);
  }
  const l = {
    url: i,
    method: i,
    data: i,
    baseURL: r,
    transformRequest: r,
    transformResponse: r,
    paramsSerializer: r,
    timeout: r,
    timeoutMessage: r,
    withCredentials: r,
    withXSRFToken: r,
    adapter: r,
    responseType: r,
    xsrfCookieName: r,
    xsrfHeaderName: r,
    onUploadProgress: r,
    onDownloadProgress: r,
    decompress: r,
    maxContentLength: r,
    maxBodyLength: r,
    beforeRedirect: r,
    transport: r,
    httpAgent: r,
    httpsAgent: r,
    cancelToken: r,
    socketPath: r,
    responseEncoding: r,
    validateStatus: a,
    headers: (u, d, f) => o(yy(u), yy(d), f, !0)
  };
  return ee.forEach(Object.keys(Object.assign({}, e, t)), function(d) {
    const f = l[d] || o, p = f(e[d], t[d], d);
    ee.isUndefined(p) && f !== a || (n[d] = p);
  }), n;
}
const Pw = (e) => {
  const t = zi({}, e);
  let { data: n, withXSRFToken: s, xsrfHeaderName: o, xsrfCookieName: i, headers: r, auth: a } = t;
  t.headers = r = xs.from(r), t.url = kw(Mw(t.baseURL, t.url, t.allowAbsoluteUrls), e.params, e.paramsSerializer), a && r.set(
    "Authorization",
    "Basic " + btoa((a.username || "") + ":" + (a.password ? unescape(encodeURIComponent(a.password)) : ""))
  );
  let l;
  if (ee.isFormData(n)) {
    if (Kn.hasStandardBrowserEnv || Kn.hasStandardBrowserWebWorkerEnv)
      r.setContentType(void 0);
    else if ((l = r.getContentType()) !== !1) {
      const [u, ...d] = l ? l.split(";").map((f) => f.trim()).filter(Boolean) : [];
      r.setContentType([u || "multipart/form-data", ...d].join("; "));
    }
  }
  if (Kn.hasStandardBrowserEnv && (s && ee.isFunction(s) && (s = s(t)), s || s !== !1 && vA(t.url))) {
    const u = o && i && gA.read(i);
    u && r.set(o, u);
  }
  return t;
}, bA = typeof XMLHttpRequest < "u", EA = bA && function(e) {
  return new Promise(function(n, s) {
    const o = Pw(e);
    let i = o.data;
    const r = xs.from(o.headers).normalize();
    let { responseType: a, onUploadProgress: l, onDownloadProgress: u } = o, d, f, p, h, m;
    function v() {
      h && h(), m && m(), o.cancelToken && o.cancelToken.unsubscribe(d), o.signal && o.signal.removeEventListener("abort", d);
    }
    let _ = new XMLHttpRequest();
    _.open(o.method.toUpperCase(), o.url, !0), _.timeout = o.timeout;
    function b() {
      if (!_)
        return;
      const y = xs.from(
        "getAllResponseHeaders" in _ && _.getAllResponseHeaders()
      ), N = {
        data: !a || a === "text" || a === "json" ? _.responseText : _.response,
        status: _.status,
        statusText: _.statusText,
        headers: y,
        config: e,
        request: _
      };
      Aw(function(O) {
        n(O), v();
      }, function(O) {
        s(O), v();
      }, N), _ = null;
    }
    "onloadend" in _ ? _.onloadend = b : _.onreadystatechange = function() {
      !_ || _.readyState !== 4 || _.status === 0 && !(_.responseURL && _.responseURL.indexOf("file:") === 0) || setTimeout(b);
    }, _.onabort = function() {
      _ && (s(new ct("Request aborted", ct.ECONNABORTED, e, _)), _ = null);
    }, _.onerror = function() {
      s(new ct("Network Error", ct.ERR_NETWORK, e, _)), _ = null;
    }, _.ontimeout = function() {
      let x = o.timeout ? "timeout of " + o.timeout + "ms exceeded" : "timeout exceeded";
      const N = o.transitional || Dw;
      o.timeoutErrorMessage && (x = o.timeoutErrorMessage), s(new ct(
        x,
        N.clarifyTimeoutError ? ct.ETIMEDOUT : ct.ECONNABORTED,
        e,
        _
      )), _ = null;
    }, i === void 0 && r.setContentType(null), "setRequestHeader" in _ && ee.forEach(r.toJSON(), function(x, N) {
      _.setRequestHeader(N, x);
    }), ee.isUndefined(o.withCredentials) || (_.withCredentials = !!o.withCredentials), a && a !== "json" && (_.responseType = o.responseType), u && ([p, m] = zd(u, !0), _.addEventListener("progress", p)), l && _.upload && ([f, h] = zd(l), _.upload.addEventListener("progress", f), _.upload.addEventListener("loadend", h)), (o.cancelToken || o.signal) && (d = (y) => {
      _ && (s(!y || y.type ? new pl(null, e, _) : y), _.abort(), _ = null);
    }, o.cancelToken && o.cancelToken.subscribe(d), o.signal && (o.signal.aborted ? d() : o.signal.addEventListener("abort", d)));
    const w = pA(o.url);
    if (w && Kn.protocols.indexOf(w) === -1) {
      s(new ct("Unsupported protocol " + w + ":", ct.ERR_BAD_REQUEST, e));
      return;
    }
    _.send(i || null);
  });
}, wA = (e, t) => {
  const { length: n } = e = e ? e.filter(Boolean) : [];
  if (t || n) {
    let s = new AbortController(), o;
    const i = function(u) {
      if (!o) {
        o = !0, a();
        const d = u instanceof Error ? u : this.reason;
        s.abort(d instanceof ct ? d : new pl(d instanceof Error ? d.message : d));
      }
    };
    let r = t && setTimeout(() => {
      r = null, i(new ct(`timeout ${t} of ms exceeded`, ct.ETIMEDOUT));
    }, t);
    const a = () => {
      e && (r && clearTimeout(r), r = null, e.forEach((u) => {
        u.unsubscribe ? u.unsubscribe(i) : u.removeEventListener("abort", i);
      }), e = null);
    };
    e.forEach((u) => u.addEventListener("abort", i));
    const { signal: l } = s;
    return l.unsubscribe = () => ee.asap(a), l;
  }
}, SA = function* (e, t) {
  let n = e.byteLength;
  if (n < t) {
    yield e;
    return;
  }
  let s = 0, o;
  for (; s < n; )
    o = s + t, yield e.slice(s, o), s = o;
}, xA = async function* (e, t) {
  for await (const n of NA(e))
    yield* SA(n, t);
}, NA = async function* (e) {
  if (e[Symbol.asyncIterator]) {
    yield* e;
    return;
  }
  const t = e.getReader();
  try {
    for (; ; ) {
      const { done: n, value: s } = await t.read();
      if (n)
        break;
      yield s;
    }
  } finally {
    await t.cancel();
  }
}, by = (e, t, n, s) => {
  const o = xA(e, t);
  let i = 0, r, a = (l) => {
    r || (r = !0, s && s(l));
  };
  return new ReadableStream({
    async pull(l) {
      try {
        const { done: u, value: d } = await o.next();
        if (u) {
          a(), l.close();
          return;
        }
        let f = d.byteLength;
        if (n) {
          let p = i += f;
          n(p);
        }
        l.enqueue(new Uint8Array(d));
      } catch (u) {
        throw a(u), u;
      }
    },
    cancel(l) {
      return a(l), o.return();
    }
  }, {
    highWaterMark: 2
  });
}, tp = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Lw = tp && typeof ReadableStream == "function", CA = tp && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((e) => (t) => e.encode(t))(new TextEncoder()) : async (e) => new Uint8Array(await new Response(e).arrayBuffer())), Vw = (e, ...t) => {
  try {
    return !!e(...t);
  } catch {
    return !1;
  }
}, OA = Lw && Vw(() => {
  let e = !1;
  const t = new Request(Kn.origin, {
    body: new ReadableStream(),
    method: "POST",
    get duplex() {
      return e = !0, "half";
    }
  }).headers.has("Content-Type");
  return e && !t;
}), Ey = 64 * 1024, Em = Lw && Vw(() => ee.isReadableStream(new Response("").body)), Kd = {
  stream: Em && ((e) => e.body)
};
tp && ((e) => {
  ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((t) => {
    !Kd[t] && (Kd[t] = ee.isFunction(e[t]) ? (n) => n[t]() : (n, s) => {
      throw new ct(`Response type '${t}' is not supported`, ct.ERR_NOT_SUPPORT, s);
    });
  });
})(new Response());
const TA = async (e) => {
  if (e == null)
    return 0;
  if (ee.isBlob(e))
    return e.size;
  if (ee.isSpecCompliantForm(e))
    return (await new Request(Kn.origin, {
      method: "POST",
      body: e
    }).arrayBuffer()).byteLength;
  if (ee.isArrayBufferView(e) || ee.isArrayBuffer(e))
    return e.byteLength;
  if (ee.isURLSearchParams(e) && (e = e + ""), ee.isString(e))
    return (await CA(e)).byteLength;
}, $A = async (e, t) => {
  const n = ee.toFiniteNumber(e.getContentLength());
  return n ?? TA(t);
}, kA = tp && (async (e) => {
  let {
    url: t,
    method: n,
    data: s,
    signal: o,
    cancelToken: i,
    timeout: r,
    onDownloadProgress: a,
    onUploadProgress: l,
    responseType: u,
    headers: d,
    withCredentials: f = "same-origin",
    fetchOptions: p
  } = Pw(e);
  u = u ? (u + "").toLowerCase() : "text";
  let h = wA([o, i && i.toAbortSignal()], r), m;
  const v = h && h.unsubscribe && (() => {
    h.unsubscribe();
  });
  let _;
  try {
    if (l && OA && n !== "get" && n !== "head" && (_ = await $A(d, s)) !== 0) {
      let N = new Request(t, {
        method: "POST",
        body: s,
        duplex: "half"
      }), S;
      if (ee.isFormData(s) && (S = N.headers.get("content-type")) && d.setContentType(S), N.body) {
        const [O, $] = gy(
          _,
          zd(_y(l))
        );
        s = by(N.body, Ey, O, $);
      }
    }
    ee.isString(f) || (f = f ? "include" : "omit");
    const b = "credentials" in Request.prototype;
    m = new Request(t, {
      ...p,
      signal: h,
      method: n.toUpperCase(),
      headers: d.normalize().toJSON(),
      body: s,
      duplex: "half",
      credentials: b ? f : void 0
    });
    let w = await fetch(m, p);
    const y = Em && (u === "stream" || u === "response");
    if (Em && (a || y && v)) {
      const N = {};
      ["status", "statusText", "headers"].forEach((T) => {
        N[T] = w[T];
      });
      const S = ee.toFiniteNumber(w.headers.get("content-length")), [O, $] = a && gy(
        S,
        zd(_y(a), !0)
      ) || [];
      w = new Response(
        by(w.body, Ey, O, () => {
          $ && $(), v && v();
        }),
        N
      );
    }
    u = u || "text";
    let x = await Kd[ee.findKey(Kd, u) || "text"](w, e);
    return !y && v && v(), await new Promise((N, S) => {
      Aw(N, S, {
        data: x,
        headers: xs.from(w.headers),
        status: w.status,
        statusText: w.statusText,
        config: e,
        request: m
      });
    });
  } catch (b) {
    throw v && v(), b && b.name === "TypeError" && /Load failed|fetch/i.test(b.message) ? Object.assign(
      new ct("Network Error", ct.ERR_NETWORK, e, m),
      {
        cause: b.cause || b
      }
    ) : ct.from(b, b && b.code, e, m);
  }
}), wm = {
  http: WI,
  xhr: EA,
  fetch: kA
};
ee.forEach(wm, (e, t) => {
  if (e) {
    try {
      Object.defineProperty(e, "name", { value: t });
    } catch {
    }
    Object.defineProperty(e, "adapterName", { value: t });
  }
});
const wy = (e) => `- ${e}`, DA = (e) => ee.isFunction(e) || e === null || e === !1, Fw = {
  getAdapter: (e) => {
    e = ee.isArray(e) ? e : [e];
    const { length: t } = e;
    let n, s;
    const o = {};
    for (let i = 0; i < t; i++) {
      n = e[i];
      let r;
      if (s = n, !DA(n) && (s = wm[(r = String(n)).toLowerCase()], s === void 0))
        throw new ct(`Unknown adapter '${r}'`);
      if (s)
        break;
      o[r || "#" + i] = s;
    }
    if (!s) {
      const i = Object.entries(o).map(
        ([a, l]) => `adapter ${a} ` + (l === !1 ? "is not supported by the environment" : "is not available in the build")
      );
      let r = t ? i.length > 1 ? `since :
` + i.map(wy).join(`
`) : " " + wy(i[0]) : "as no adapter specified";
      throw new ct(
        "There is no suitable adapter to dispatch the request " + r,
        "ERR_NOT_SUPPORT"
      );
    }
    return s;
  },
  adapters: wm
};
function rh(e) {
  if (e.cancelToken && e.cancelToken.throwIfRequested(), e.signal && e.signal.aborted)
    throw new pl(null, e);
}
function Sy(e) {
  return rh(e), e.headers = xs.from(e.headers), e.data = oh.call(
    e,
    e.transformRequest
  ), ["post", "put", "patch"].indexOf(e.method) !== -1 && e.headers.setContentType("application/x-www-form-urlencoded", !1), Fw.getAdapter(e.adapter || eu.adapter)(e).then(function(s) {
    return rh(e), s.data = oh.call(
      e,
      e.transformResponse,
      s
    ), s.headers = xs.from(s.headers), s;
  }, function(s) {
    return Iw(s) || (rh(e), s && s.response && (s.response.data = oh.call(
      e,
      e.transformResponse,
      s.response
    ), s.response.headers = xs.from(s.response.headers))), Promise.reject(s);
  });
}
const Uw = "1.10.0", np = {};
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
  np[e] = function(s) {
    return typeof s === e || "a" + (t < 1 ? "n " : " ") + e;
  };
});
const xy = {};
np.transitional = function(t, n, s) {
  function o(i, r) {
    return "[Axios v" + Uw + "] Transitional option '" + i + "'" + r + (s ? ". " + s : "");
  }
  return (i, r, a) => {
    if (t === !1)
      throw new ct(
        o(r, " has been removed" + (n ? " in " + n : "")),
        ct.ERR_DEPRECATED
      );
    return n && !xy[r] && (xy[r] = !0, console.warn(
      o(
        r,
        " has been deprecated since v" + n + " and will be removed in the near future"
      )
    )), t ? t(i, r, a) : !0;
  };
};
np.spelling = function(t) {
  return (n, s) => (console.warn(`${s} is likely a misspelling of ${t}`), !0);
};
function RA(e, t, n) {
  if (typeof e != "object")
    throw new ct("options must be an object", ct.ERR_BAD_OPTION_VALUE);
  const s = Object.keys(e);
  let o = s.length;
  for (; o-- > 0; ) {
    const i = s[o], r = t[i];
    if (r) {
      const a = e[i], l = a === void 0 || r(a, i, e);
      if (l !== !0)
        throw new ct("option " + i + " must be " + l, ct.ERR_BAD_OPTION_VALUE);
      continue;
    }
    if (n !== !0)
      throw new ct("Unknown option " + i, ct.ERR_BAD_OPTION);
  }
}
const ld = {
  assertOptions: RA,
  validators: np
}, _o = ld.validators;
let Vi = class {
  constructor(t) {
    this.defaults = t || {}, this.interceptors = {
      request: new my(),
      response: new my()
    };
  }
  /**
   * Dispatch a request
   *
   * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)
   * @param {?Object} config
   *
   * @returns {Promise} The Promise to be fulfilled
   */
  async request(t, n) {
    try {
      return await this._request(t, n);
    } catch (s) {
      if (s instanceof Error) {
        let o = {};
        Error.captureStackTrace ? Error.captureStackTrace(o) : o = new Error();
        const i = o.stack ? o.stack.replace(/^.+\n/, "") : "";
        try {
          s.stack ? i && !String(s.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (s.stack += `
` + i) : s.stack = i;
        } catch {
        }
      }
      throw s;
    }
  }
  _request(t, n) {
    typeof t == "string" ? (n = n || {}, n.url = t) : n = t || {}, n = zi(this.defaults, n);
    const { transitional: s, paramsSerializer: o, headers: i } = n;
    s !== void 0 && ld.assertOptions(s, {
      silentJSONParsing: _o.transitional(_o.boolean),
      forcedJSONParsing: _o.transitional(_o.boolean),
      clarifyTimeoutError: _o.transitional(_o.boolean)
    }, !1), o != null && (ee.isFunction(o) ? n.paramsSerializer = {
      serialize: o
    } : ld.assertOptions(o, {
      encode: _o.function,
      serialize: _o.function
    }, !0)), n.allowAbsoluteUrls !== void 0 || (this.defaults.allowAbsoluteUrls !== void 0 ? n.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls : n.allowAbsoluteUrls = !0), ld.assertOptions(n, {
      baseUrl: _o.spelling("baseURL"),
      withXsrfToken: _o.spelling("withXSRFToken")
    }, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
    let r = i && ee.merge(
      i.common,
      i[n.method]
    );
    i && ee.forEach(
      ["delete", "get", "head", "post", "put", "patch", "common"],
      (m) => {
        delete i[m];
      }
    ), n.headers = xs.concat(r, i);
    const a = [];
    let l = !0;
    this.interceptors.request.forEach(function(v) {
      typeof v.runWhen == "function" && v.runWhen(n) === !1 || (l = l && v.synchronous, a.unshift(v.fulfilled, v.rejected));
    });
    const u = [];
    this.interceptors.response.forEach(function(v) {
      u.push(v.fulfilled, v.rejected);
    });
    let d, f = 0, p;
    if (!l) {
      const m = [Sy.bind(this), void 0];
      for (m.unshift.apply(m, a), m.push.apply(m, u), p = m.length, d = Promise.resolve(n); f < p; )
        d = d.then(m[f++], m[f++]);
      return d;
    }
    p = a.length;
    let h = n;
    for (f = 0; f < p; ) {
      const m = a[f++], v = a[f++];
      try {
        h = m(h);
      } catch (_) {
        v.call(this, _);
        break;
      }
    }
    try {
      d = Sy.call(this, h);
    } catch (m) {
      return Promise.reject(m);
    }
    for (f = 0, p = u.length; f < p; )
      d = d.then(u[f++], u[f++]);
    return d;
  }
  getUri(t) {
    t = zi(this.defaults, t);
    const n = Mw(t.baseURL, t.url, t.allowAbsoluteUrls);
    return kw(n, t.params, t.paramsSerializer);
  }
};
ee.forEach(["delete", "get", "head", "options"], function(t) {
  Vi.prototype[t] = function(n, s) {
    return this.request(zi(s || {}, {
      method: t,
      url: n,
      data: (s || {}).data
    }));
  };
});
ee.forEach(["post", "put", "patch"], function(t) {
  function n(s) {
    return function(i, r, a) {
      return this.request(zi(a || {}, {
        method: t,
        headers: s ? {
          "Content-Type": "multipart/form-data"
        } : {},
        url: i,
        data: r
      }));
    };
  }
  Vi.prototype[t] = n(), Vi.prototype[t + "Form"] = n(!0);
});
let IA = class jw {
  constructor(t) {
    if (typeof t != "function")
      throw new TypeError("executor must be a function.");
    let n;
    this.promise = new Promise(function(i) {
      n = i;
    });
    const s = this;
    this.promise.then((o) => {
      if (!s._listeners) return;
      let i = s._listeners.length;
      for (; i-- > 0; )
        s._listeners[i](o);
      s._listeners = null;
    }), this.promise.then = (o) => {
      let i;
      const r = new Promise((a) => {
        s.subscribe(a), i = a;
      }).then(o);
      return r.cancel = function() {
        s.unsubscribe(i);
      }, r;
    }, t(function(i, r, a) {
      s.reason || (s.reason = new pl(i, r, a), n(s.reason));
    });
  }
  /**
   * Throws a `CanceledError` if cancellation has been requested.
   */
  throwIfRequested() {
    if (this.reason)
      throw this.reason;
  }
  /**
   * Subscribe to the cancel signal
   */
  subscribe(t) {
    if (this.reason) {
      t(this.reason);
      return;
    }
    this._listeners ? this._listeners.push(t) : this._listeners = [t];
  }
  /**
   * Unsubscribe from the cancel signal
   */
  unsubscribe(t) {
    if (!this._listeners)
      return;
    const n = this._listeners.indexOf(t);
    n !== -1 && this._listeners.splice(n, 1);
  }
  toAbortSignal() {
    const t = new AbortController(), n = (s) => {
      t.abort(s);
    };
    return this.subscribe(n), t.signal.unsubscribe = () => this.unsubscribe(n), t.signal;
  }
  /**
   * Returns an object that contains a new `CancelToken` and a function that, when called,
   * cancels the `CancelToken`.
   */
  static source() {
    let t;
    return {
      token: new jw(function(o) {
        t = o;
      }),
      cancel: t
    };
  }
};
function AA(e) {
  return function(n) {
    return e.apply(null, n);
  };
}
function MA(e) {
  return ee.isObject(e) && e.isAxiosError === !0;
}
const Sm = {
  Continue: 100,
  SwitchingProtocols: 101,
  Processing: 102,
  EarlyHints: 103,
  Ok: 200,
  Created: 201,
  Accepted: 202,
  NonAuthoritativeInformation: 203,
  NoContent: 204,
  ResetContent: 205,
  PartialContent: 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(Sm).forEach(([e, t]) => {
  Sm[t] = e;
});
function Bw(e) {
  const t = new Vi(e), n = _w(Vi.prototype.request, t);
  return ee.extend(n, Vi.prototype, t, { allOwnKeys: !0 }), ee.extend(n, t, null, { allOwnKeys: !0 }), n.create = function(o) {
    return Bw(zi(e, o));
  }, n;
}
const vn = Bw(eu);
vn.Axios = Vi;
vn.CanceledError = pl;
vn.CancelToken = IA;
vn.isCancel = Iw;
vn.VERSION = Uw;
vn.toFormData = ep;
vn.AxiosError = ct;
vn.Cancel = vn.CanceledError;
vn.all = function(t) {
  return Promise.all(t);
};
vn.spread = AA;
vn.isAxiosError = MA;
vn.mergeConfig = zi;
vn.AxiosHeaders = xs;
vn.formToJSON = (e) => Rw(ee.isHTMLForm(e) ? new FormData(e) : e);
vn.getAdapter = Fw.getAdapter;
vn.HttpStatusCode = Sm;
vn.default = vn;
const {
  Axios: zue,
  AxiosError: PA,
  CanceledError: Kue,
  isCancel: Xue,
  CancelToken: que,
  VERSION: Jue,
  all: Que,
  Cancel: Zue,
  isAxiosError: ede,
  spread: tde,
  toFormData: nde,
  AxiosHeaders: sde,
  HttpStatusCode: ode,
  formToJSON: rde,
  getAdapter: ide,
  mergeConfig: ade
} = vn, Bo = () => {
  let e = "";
  return window.app_path_webroot_full ? e = `${window.app_path_webroot_full}redcap_v${window.redcap_version}/` : e = `${location.protocol}//${location.host}/api`, e;
}, Ho = (e, t = [], n = {}) => {
  n = { ...{
    baseURL: e,
    timeout: 6e4
  }, ...n };
  const o = vn.create(n);
  o.interceptors.request.use(
    function(r) {
      const a = i(t);
      for (const [l, u] of Object.entries(a))
        r.params[l] = u;
      return r.headers = {
        "Content-Type": "application/json",
        "X-Requested-With": "XMLHttpRequest",
        ...r.headers
      }, r;
    },
    function(r) {
      return Promise.reject(r);
    }
  );
  function i(r = []) {
    let a = new URLSearchParams(location.search), l = {};
    for (let [u, d] of a.entries())
      r.includes(u) && (l[u] = d);
    return window.redcap_csrf_token && (l.redcap_csrf_token = window.redcap_csrf_token), l;
  }
  return o;
}, Gs = (e) => {
  var o, i, r, a, l;
  let t = "";
  const n = [
    "Something happened in setting up the request that triggered an Error"
  ];
  if (e.response) {
    let u = `The request was made and the server responded with a status code ${e.response.status}`;
    (i = (o = e == null ? void 0 : e.response) == null ? void 0 : o.data) != null && i.message && (u += ` - ${(a = (r = e == null ? void 0 : e.response) == null ? void 0 : r.data) == null ? void 0 : a.message}`), n.push(u), t = (l = e == null ? void 0 : e.response) == null ? void 0 : l.data;
  } else e.request && (n.push("The request was made but no response was received"), t = e.request);
  return e.message && n.push(e.message), t && t !== "" && (typeof t == "string" || t instanceof String) && n.push(t), n.join(`
`);
}, Ny = Object.freeze({
  TOGGLE_READ: "toggle_read",
  DELETE: "delete",
  DELETE_SELECTED: "delete_selected",
  MARK_UNREAD_SELECTED: "mark_unread_selected",
  MARK_READ_SELECTED: "mark_read_selected"
}), LA = Bo(), ih = Ho(LA, ["pid"]), ah = [
  { label: "1 minute", value: 1e3 * 60 },
  // 1 minute
  { label: "5 minutes", value: 1e3 * 60 * 5 },
  { label: "10 minutes", value: 1e3 * 60 * 10 }
], VA = () => {
  let e = null;
  const t = qe({
    ready: !1,
    loading: !1,
    settings: {},
    list: [],
    //parcels
    active: null,
    // active parcel
    selected: [],
    // list of selected (checked) parcels
    refreshInterval: !1,
    findParcel(n) {
      return this.list.find((o) => o.id === n);
    },
    get unread() {
      let n = 0;
      for (const s of this.list)
        (s == null ? void 0 : s.read) === !1 && n++;
      return n;
    },
    reset() {
      this.active = null, this.selected = [];
    },
    async fetchList() {
      try {
        this.loading = !0, this.reset();
        const n = {
          route: "ParcelController:list"
        }, s = await ih.get("", { params: n, method: "GET" }), {
          data: { data: o = [], metadata: i = {} }
        } = s;
        this.list = o.map((r) => new rI(r));
      } catch (n) {
        console.log("error fetching messages", n);
      } finally {
        this.loading = !1;
      }
    },
    async fetchSettings() {
      const n = {
        route: "ParcelController:settings"
      }, s = await ih.get("", { params: n });
      this.settings = (s == null ? void 0 : s.data) ?? {};
    },
    async sendCommand(n, s = {}) {
      const o = {
        route: "ParcelController:command"
      }, i = { action: n, args: s };
      return await ih.post("", i, { params: o });
    },
    /**
     * send commands, but use optimistic update
     *
     * @param {String} ID
     * @returns
     */
    async deleteParcel(n) {
      const s = (a) => {
        const l = this.list.indexOf(a);
        l >= 0 && this.list.splice(l, 1);
      }, o = (a) => {
        const l = this.selected.indexOf(a);
        l < 0 || this.selected.splice(l, 1);
      }, i = (a) => {
        r === this.active && (this.active = null);
      }, r = this.findParcel(n);
      if (r)
        return o(n), i(), s(r), this.sendCommand(Ny.DELETE, { id: n });
    },
    /**
     * send commands, but use optimistic update
     *
     * @param {String} ID
     * @param {Boolean} read
     * @returns
     */
    async markParcel(n, s) {
      const o = this.findParcel(n);
      return o && (o.read = s), this.sendCommand(Ny.TOGGLE_READ, { id: n, read: s });
    },
    /**
     * toggle active parcel
     * @param {Object} parcel
     */
    toggle(n) {
      this.active === n ? this.active = null : this.active = n;
    },
    async init() {
      if (!this.ready)
        return this.ready = !0, await this.fetchSettings(), await this.fetchList(), !0;
    }
  });
  return Ft(() => {
    typeof t.refreshInterval == "number" && !isNaN(t.refreshInterval) ? (e && clearInterval(e), e = setInterval(() => {
      t.fetchList();
    }, t.refreshInterval)) : clearInterval(e);
  }), t;
}, hl = Ns("parcels", VA, !0), FA = { id: "post-master" }, UA = {
  __name: "App",
  setup(e) {
    const t = hl();
    return vt(() => t.init()), (n, s) => {
      const o = le("router-view");
      return g(), E("div", FA, [
        D(o)
      ]);
    };
  }
}, oe = (e, t) => {
  const n = e.__vccOpts || e;
  for (const [s, o] of t)
    n[s] = o;
  return n;
}, jA = { class: "d-inline-block" }, BA = { class: "d-flex align-items-center" }, HA = { class: "position-relative" }, YA = ["href"], WA = {
  key: 0,
  class: "action"
}, GA = {
  key: 2,
  class: "badge bg-danger"
}, zA = {
  __name: "NotificationBadge",
  setup(e) {
    const t = hl(), n = k(() => t.loading), s = k(() => t.unread), o = k(() => {
      var r;
      return (r = t == null ? void 0 : t.settings) == null ? void 0 : r.indexURL;
    });
    vt(() => {
      var r;
      t.init(), t.refreshInterval = (r = ah == null ? void 0 : ah[0]) == null ? void 0 : r.value;
    }), Fo(() => t.refreshInterval = !1);
    function i() {
      t.fetchList();
    }
    return (r, a) => (g(), E("div", jA, [
      c("div", BA, [
        c("div", HA, [
          c("a", { href: o.value }, "Messages", 8, YA)
        ]),
        n.value ? (g(), E("span", WA, a[0] || (a[0] = [
          c("i", { class: "fa-solid fa-spinner fa-spin fa-fw" }, null, -1)
        ]))) : (g(), E("span", {
          key: 1,
          class: "action",
          onClick: i
        }, a[1] || (a[1] = [
          c("i", { class: "fas fa-sync-alt fa-fw" }, null, -1)
        ]))),
        s.value > 0 ? (g(), E("span", GA, F(s.value) + " unread", 1)) : ne("", !0)
      ])
    ]));
  }
}, KA = /* @__PURE__ */ oe(zA, [["__scopeId", "data-v-0b40fdbf"]]);
function XA() {
  return Hw().__VUE_DEVTOOLS_GLOBAL_HOOK__;
}
function Hw() {
  return typeof navigator < "u" && typeof window < "u" ? window : typeof globalThis < "u" ? globalThis : {};
}
const qA = typeof Proxy == "function", JA = "devtools-plugin:setup", QA = "plugin:settings:set";
let ga, xm;
function ZA() {
  var e;
  return ga !== void 0 || (typeof window < "u" && window.performance ? (ga = !0, xm = window.performance) : typeof globalThis < "u" && (!((e = globalThis.perf_hooks) === null || e === void 0) && e.performance) ? (ga = !0, xm = globalThis.perf_hooks.performance) : ga = !1), ga;
}
function eM() {
  return ZA() ? xm.now() : Date.now();
}
class tM {
  constructor(t, n) {
    this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = n;
    const s = {};
    if (t.settings)
      for (const r in t.settings) {
        const a = t.settings[r];
        s[r] = a.defaultValue;
      }
    const o = `__vue-devtools-plugin-settings__${t.id}`;
    let i = Object.assign({}, s);
    try {
      const r = localStorage.getItem(o), a = JSON.parse(r);
      Object.assign(i, a);
    } catch {
    }
    this.fallbacks = {
      getSettings() {
        return i;
      },
      setSettings(r) {
        try {
          localStorage.setItem(o, JSON.stringify(r));
        } catch {
        }
        i = r;
      },
      now() {
        return eM();
      }
    }, n && n.on(QA, (r, a) => {
      r === this.plugin.id && this.fallbacks.setSettings(a);
    }), this.proxiedOn = new Proxy({}, {
      get: (r, a) => this.target ? this.target.on[a] : (...l) => {
        this.onQueue.push({
          method: a,
          args: l
        });
      }
    }), this.proxiedTarget = new Proxy({}, {
      get: (r, a) => this.target ? this.target[a] : a === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(a) ? (...l) => (this.targetQueue.push({
        method: a,
        args: l,
        resolve: () => {
        }
      }), this.fallbacks[a](...l)) : (...l) => new Promise((u) => {
        this.targetQueue.push({
          method: a,
          args: l,
          resolve: u
        });
      })
    });
  }
  async setRealTarget(t) {
    this.target = t;
    for (const n of this.onQueue)
      this.target.on[n.method](...n.args);
    for (const n of this.targetQueue)
      n.resolve(await this.target[n.method](...n.args));
  }
}
function dg(e, t) {
  const n = e, s = Hw(), o = XA(), i = qA && n.enableEarlyProxy;
  if (o && (s.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !i))
    o.emit(JA, e, t);
  else {
    const r = i ? new tM(n, o) : null;
    (s.__VUE_DEVTOOLS_PLUGINS__ = s.__VUE_DEVTOOLS_PLUGINS__ || []).push({
      pluginDescriptor: n,
      setupFn: t,
      proxy: r
    }), r && t(r.proxiedTarget);
  }
}
var Ze = {};
const sr = typeof document < "u";
function Yw(e) {
  return typeof e == "object" || "displayName" in e || "props" in e || "__vccOpts" in e;
}
function nM(e) {
  return e.__esModule || e[Symbol.toStringTag] === "Module" || // support CF with dynamic imports that do not
  // add the Module string tag
  e.default && Yw(e.default);
}
const It = Object.assign;
function lh(e, t) {
  const n = {};
  for (const s in t) {
    const o = t[s];
    n[s] = Ds(o) ? o.map(e) : e(o);
  }
  return n;
}
const rc = () => {
}, Ds = Array.isArray;
function lt(e) {
  const t = Array.from(arguments).slice(1);
  console.warn.apply(console, ["[Vue Router warn]: " + e].concat(t));
}
const Ww = /#/g, sM = /&/g, oM = /\//g, rM = /=/g, iM = /\?/g, Gw = /\+/g, aM = /%5B/g, lM = /%5D/g, zw = /%5E/g, cM = /%60/g, Kw = /%7B/g, uM = /%7C/g, Xw = /%7D/g, dM = /%20/g;
function fg(e) {
  return encodeURI("" + e).replace(uM, "|").replace(aM, "[").replace(lM, "]");
}
function fM(e) {
  return fg(e).replace(Kw, "{").replace(Xw, "}").replace(zw, "^");
}
function Nm(e) {
  return fg(e).replace(Gw, "%2B").replace(dM, "+").replace(Ww, "%23").replace(sM, "%26").replace(cM, "`").replace(Kw, "{").replace(Xw, "}").replace(zw, "^");
}
function pM(e) {
  return Nm(e).replace(rM, "%3D");
}
function hM(e) {
  return fg(e).replace(Ww, "%23").replace(iM, "%3F");
}
function mM(e) {
  return e == null ? "" : hM(e).replace(oM, "%2F");
}
function Xa(e) {
  try {
    return decodeURIComponent("" + e);
  } catch {
    Ze.NODE_ENV !== "production" && lt(`Error decoding "${e}". Using original value`);
  }
  return "" + e;
}
const vM = /\/$/, gM = (e) => e.replace(vM, "");
function ch(e, t, n = "/") {
  let s, o = {}, i = "", r = "";
  const a = t.indexOf("#");
  let l = t.indexOf("?");
  return a < l && a >= 0 && (l = -1), l > -1 && (s = t.slice(0, l), i = t.slice(l + 1, a > -1 ? a : t.length), o = e(i)), a > -1 && (s = s || t.slice(0, a), r = t.slice(a, t.length)), s = bM(s ?? t, n), {
    fullPath: s + (i && "?") + i + r,
    path: s,
    query: o,
    hash: Xa(r)
  };
}
function _M(e, t) {
  const n = t.query ? e(t.query) : "";
  return t.path + (n && "?") + n + (t.hash || "");
}
function Cy(e, t) {
  return !t || !e.toLowerCase().startsWith(t.toLowerCase()) ? e : e.slice(t.length) || "/";
}
function Oy(e, t, n) {
  const s = t.matched.length - 1, o = n.matched.length - 1;
  return s > -1 && s === o && ni(t.matched[s], n.matched[o]) && qw(t.params, n.params) && e(t.query) === e(n.query) && t.hash === n.hash;
}
function ni(e, t) {
  return (e.aliasOf || e) === (t.aliasOf || t);
}
function qw(e, t) {
  if (Object.keys(e).length !== Object.keys(t).length)
    return !1;
  for (const n in e)
    if (!yM(e[n], t[n]))
      return !1;
  return !0;
}
function yM(e, t) {
  return Ds(e) ? Ty(e, t) : Ds(t) ? Ty(t, e) : e === t;
}
function Ty(e, t) {
  return Ds(t) ? e.length === t.length && e.every((n, s) => n === t[s]) : e.length === 1 && e[0] === t;
}
function bM(e, t) {
  if (e.startsWith("/"))
    return e;
  if (Ze.NODE_ENV !== "production" && !t.startsWith("/"))
    return lt(`Cannot resolve a relative location without an absolute path. Trying to resolve "${e}" from "${t}". It should look like "/${t}".`), e;
  if (!e)
    return t;
  const n = t.split("/"), s = e.split("/"), o = s[s.length - 1];
  (o === ".." || o === ".") && s.push("");
  let i = n.length - 1, r, a;
  for (r = 0; r < s.length; r++)
    if (a = s[r], a !== ".")
      if (a === "..")
        i > 1 && i--;
      else
        break;
  return n.slice(0, i).join("/") + "/" + s.slice(r).join("/");
}
const $r = {
  path: "/",
  // TODO: could we use a symbol in the future?
  name: void 0,
  params: {},
  query: {},
  hash: "",
  fullPath: "/",
  matched: [],
  meta: {},
  redirectedFrom: void 0
};
var Ic;
(function(e) {
  e.pop = "pop", e.push = "push";
})(Ic || (Ic = {}));
var ic;
(function(e) {
  e.back = "back", e.forward = "forward", e.unknown = "";
})(ic || (ic = {}));
function EM(e) {
  if (!e)
    if (sr) {
      const t = document.querySelector("base");
      e = t && t.getAttribute("href") || "/", e = e.replace(/^\w+:\/\/[^\/]+/, "");
    } else
      e = "/";
  return e[0] !== "/" && e[0] !== "#" && (e = "/" + e), gM(e);
}
const wM = /^[^#]+#/;
function SM(e, t) {
  return e.replace(wM, "#") + t;
}
function xM(e, t) {
  const n = document.documentElement.getBoundingClientRect(), s = e.getBoundingClientRect();
  return {
    behavior: t.behavior,
    left: s.left - n.left - (t.left || 0),
    top: s.top - n.top - (t.top || 0)
  };
}
const sp = () => ({
  left: window.scrollX,
  top: window.scrollY
});
function NM(e) {
  let t;
  if ("el" in e) {
    const n = e.el, s = typeof n == "string" && n.startsWith("#");
    if (Ze.NODE_ENV !== "production" && typeof e.el == "string" && (!s || !document.getElementById(e.el.slice(1))))
      try {
        const i = document.querySelector(e.el);
        if (s && i) {
          lt(`The selector "${e.el}" should be passed as "el: document.querySelector('${e.el}')" because it starts with "#".`);
          return;
        }
      } catch {
        lt(`The selector "${e.el}" is invalid. If you are using an id selector, make sure to escape it. You can find more information about escaping characters in selectors at https://mathiasbynens.be/notes/css-escapes or use CSS.escape (https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape).`);
        return;
      }
    const o = typeof n == "string" ? s ? document.getElementById(n.slice(1)) : document.querySelector(n) : n;
    if (!o) {
      Ze.NODE_ENV !== "production" && lt(`Couldn't find element using selector "${e.el}" returned by scrollBehavior.`);
      return;
    }
    t = xM(o, e);
  } else
    t = e;
  "scrollBehavior" in document.documentElement.style ? window.scrollTo(t) : window.scrollTo(t.left != null ? t.left : window.scrollX, t.top != null ? t.top : window.scrollY);
}
function $y(e, t) {
  return (history.state ? history.state.position - t : -1) + e;
}
const Cm = /* @__PURE__ */ new Map();
function CM(e, t) {
  Cm.set(e, t);
}
function OM(e) {
  const t = Cm.get(e);
  return Cm.delete(e), t;
}
let TM = () => location.protocol + "//" + location.host;
function Jw(e, t) {
  const { pathname: n, search: s, hash: o } = t, i = e.indexOf("#");
  if (i > -1) {
    let a = o.includes(e.slice(i)) ? e.slice(i).length : 1, l = o.slice(a);
    return l[0] !== "/" && (l = "/" + l), Cy(l, "");
  }
  return Cy(n, e) + s + o;
}
function $M(e, t, n, s) {
  let o = [], i = [], r = null;
  const a = ({ state: p }) => {
    const h = Jw(e, location), m = n.value, v = t.value;
    let _ = 0;
    if (p) {
      if (n.value = h, t.value = p, r && r === m) {
        r = null;
        return;
      }
      _ = v ? p.position - v.position : 0;
    } else
      s(h);
    o.forEach((b) => {
      b(n.value, m, {
        delta: _,
        type: Ic.pop,
        direction: _ ? _ > 0 ? ic.forward : ic.back : ic.unknown
      });
    });
  };
  function l() {
    r = n.value;
  }
  function u(p) {
    o.push(p);
    const h = () => {
      const m = o.indexOf(p);
      m > -1 && o.splice(m, 1);
    };
    return i.push(h), h;
  }
  function d() {
    const { history: p } = window;
    p.state && p.replaceState(It({}, p.state, { scroll: sp() }), "");
  }
  function f() {
    for (const p of i)
      p();
    i = [], window.removeEventListener("popstate", a), window.removeEventListener("beforeunload", d);
  }
  return window.addEventListener("popstate", a), window.addEventListener("beforeunload", d, {
    passive: !0
  }), {
    pauseListeners: l,
    listen: u,
    destroy: f
  };
}
function ky(e, t, n, s = !1, o = !1) {
  return {
    back: e,
    current: t,
    forward: n,
    replaced: s,
    position: window.history.length,
    scroll: o ? sp() : null
  };
}
function kM(e) {
  const { history: t, location: n } = window, s = {
    value: Jw(e, n)
  }, o = { value: t.state };
  o.value || i(s.value, {
    back: null,
    current: s.value,
    forward: null,
    // the length is off by one, we need to decrease it
    position: t.length - 1,
    replaced: !0,
    // don't add a scroll as the user may have an anchor, and we want
    // scrollBehavior to be triggered without a saved position
    scroll: null
  }, !0);
  function i(l, u, d) {
    const f = e.indexOf("#"), p = f > -1 ? (n.host && document.querySelector("base") ? e : e.slice(f)) + l : TM() + e + l;
    try {
      t[d ? "replaceState" : "pushState"](u, "", p), o.value = u;
    } catch (h) {
      Ze.NODE_ENV !== "production" ? lt("Error with push/replace State", h) : console.error(h), n[d ? "replace" : "assign"](p);
    }
  }
  function r(l, u) {
    const d = It({}, t.state, ky(
      o.value.back,
      // keep back and forward entries but override current position
      l,
      o.value.forward,
      !0
    ), u, { position: o.value.position });
    i(l, d, !0), s.value = l;
  }
  function a(l, u) {
    const d = It(
      {},
      // use current history state to gracefully handle a wrong call to
      // history.replaceState
      // https://github.com/vuejs/router/issues/366
      o.value,
      t.state,
      {
        forward: l,
        scroll: sp()
      }
    );
    Ze.NODE_ENV !== "production" && !t.state && lt(`history.state seems to have been manually replaced without preserving the necessary values. Make sure to preserve existing history state if you are manually calling history.replaceState:

history.replaceState(history.state, '', url)

You can find more information at https://router.vuejs.org/guide/migration/#Usage-of-history-state`), i(d.current, d, !0);
    const f = It({}, ky(s.value, l, null), { position: d.position + 1 }, u);
    i(l, f, !1), s.value = l;
  }
  return {
    location: s,
    state: o,
    push: a,
    replace: r
  };
}
function DM(e) {
  e = EM(e);
  const t = kM(e), n = $M(e, t.state, t.location, t.replace);
  function s(i, r = !0) {
    r || n.pauseListeners(), history.go(i);
  }
  const o = It({
    // it's overridden right after
    location: "",
    base: e,
    go: s,
    createHref: SM.bind(null, e)
  }, t, n);
  return Object.defineProperty(o, "location", {
    enumerable: !0,
    get: () => t.location.value
  }), Object.defineProperty(o, "state", {
    enumerable: !0,
    get: () => t.state.value
  }), o;
}
function li(e) {
  return e = location.host ? e || location.pathname + location.search : "", e.includes("#") || (e += "#"), Ze.NODE_ENV !== "production" && !e.endsWith("#/") && !e.endsWith("#") && lt(`A hash base must end with a "#":
"${e}" should be "${e.replace(/#.*$/, "#")}".`), DM(e);
}
function Xd(e) {
  return typeof e == "string" || e && typeof e == "object";
}
function Qw(e) {
  return typeof e == "string" || typeof e == "symbol";
}
const Om = Symbol(Ze.NODE_ENV !== "production" ? "navigation failure" : "");
var Dy;
(function(e) {
  e[e.aborted = 4] = "aborted", e[e.cancelled = 8] = "cancelled", e[e.duplicated = 16] = "duplicated";
})(Dy || (Dy = {}));
const RM = {
  1({ location: e, currentLocation: t }) {
    return `No match for
 ${JSON.stringify(e)}${t ? `
while being at
` + JSON.stringify(t) : ""}`;
  },
  2({ from: e, to: t }) {
    return `Redirected from "${e.fullPath}" to "${AM(t)}" via a navigation guard.`;
  },
  4({ from: e, to: t }) {
    return `Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`;
  },
  8({ from: e, to: t }) {
    return `Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`;
  },
  16({ from: e, to: t }) {
    return `Avoided redundant navigation to current location: "${e.fullPath}".`;
  }
};
function qa(e, t) {
  return Ze.NODE_ENV !== "production" ? It(new Error(RM[e](t)), {
    type: e,
    [Om]: !0
  }, t) : It(new Error(), {
    type: e,
    [Om]: !0
  }, t);
}
function qo(e, t) {
  return e instanceof Error && Om in e && (t == null || !!(e.type & t));
}
const IM = ["params", "query", "hash"];
function AM(e) {
  if (typeof e == "string")
    return e;
  if (e.path != null)
    return e.path;
  const t = {};
  for (const n of IM)
    n in e && (t[n] = e[n]);
  return JSON.stringify(t, null, 2);
}
const Ry = "[^/]+?", MM = {
  sensitive: !1,
  strict: !1,
  start: !0,
  end: !0
}, PM = /[.+*?^${}()[\]/\\]/g;
function LM(e, t) {
  const n = It({}, MM, t), s = [];
  let o = n.start ? "^" : "";
  const i = [];
  for (const u of e) {
    const d = u.length ? [] : [
      90
      /* PathScore.Root */
    ];
    n.strict && !u.length && (o += "/");
    for (let f = 0; f < u.length; f++) {
      const p = u[f];
      let h = 40 + (n.sensitive ? 0.25 : 0);
      if (p.type === 0)
        f || (o += "/"), o += p.value.replace(PM, "\\$&"), h += 40;
      else if (p.type === 1) {
        const { value: m, repeatable: v, optional: _, regexp: b } = p;
        i.push({
          name: m,
          repeatable: v,
          optional: _
        });
        const w = b || Ry;
        if (w !== Ry) {
          h += 10;
          try {
            new RegExp(`(${w})`);
          } catch (x) {
            throw new Error(`Invalid custom RegExp for param "${m}" (${w}): ` + x.message);
          }
        }
        let y = v ? `((?:${w})(?:/(?:${w}))*)` : `(${w})`;
        f || (y = // avoid an optional / if there are more segments e.g. /:p?-static
        // or /:p?-:p2
        _ && u.length < 2 ? `(?:/${y})` : "/" + y), _ && (y += "?"), o += y, h += 20, _ && (h += -8), v && (h += -20), w === ".*" && (h += -50);
      }
      d.push(h);
    }
    s.push(d);
  }
  if (n.strict && n.end) {
    const u = s.length - 1;
    s[u][s[u].length - 1] += 0.7000000000000001;
  }
  n.strict || (o += "/?"), n.end ? o += "$" : n.strict && !o.endsWith("/") && (o += "(?:/|$)");
  const r = new RegExp(o, n.sensitive ? "" : "i");
  function a(u) {
    const d = u.match(r), f = {};
    if (!d)
      return null;
    for (let p = 1; p < d.length; p++) {
      const h = d[p] || "", m = i[p - 1];
      f[m.name] = h && m.repeatable ? h.split("/") : h;
    }
    return f;
  }
  function l(u) {
    let d = "", f = !1;
    for (const p of e) {
      (!f || !d.endsWith("/")) && (d += "/"), f = !1;
      for (const h of p)
        if (h.type === 0)
          d += h.value;
        else if (h.type === 1) {
          const { value: m, repeatable: v, optional: _ } = h, b = m in u ? u[m] : "";
          if (Ds(b) && !v)
            throw new Error(`Provided param "${m}" is an array but it is not repeatable (* or + modifiers)`);
          const w = Ds(b) ? b.join("/") : b;
          if (!w)
            if (_)
              p.length < 2 && (d.endsWith("/") ? d = d.slice(0, -1) : f = !0);
            else
              throw new Error(`Missing required param "${m}"`);
          d += w;
        }
    }
    return d || "/";
  }
  return {
    re: r,
    score: s,
    keys: i,
    parse: a,
    stringify: l
  };
}
function VM(e, t) {
  let n = 0;
  for (; n < e.length && n < t.length; ) {
    const s = t[n] - e[n];
    if (s)
      return s;
    n++;
  }
  return e.length < t.length ? e.length === 1 && e[0] === 80 ? -1 : 1 : e.length > t.length ? t.length === 1 && t[0] === 80 ? 1 : -1 : 0;
}
function Zw(e, t) {
  let n = 0;
  const s = e.score, o = t.score;
  for (; n < s.length && n < o.length; ) {
    const i = VM(s[n], o[n]);
    if (i)
      return i;
    n++;
  }
  if (Math.abs(o.length - s.length) === 1) {
    if (Iy(s))
      return 1;
    if (Iy(o))
      return -1;
  }
  return o.length - s.length;
}
function Iy(e) {
  const t = e[e.length - 1];
  return e.length > 0 && t[t.length - 1] < 0;
}
const FM = {
  type: 0,
  value: ""
}, UM = /[a-zA-Z0-9_]/;
function jM(e) {
  if (!e)
    return [[]];
  if (e === "/")
    return [[FM]];
  if (!e.startsWith("/"))
    throw new Error(Ze.NODE_ENV !== "production" ? `Route paths should start with a "/": "${e}" should be "/${e}".` : `Invalid path "${e}"`);
  function t(h) {
    throw new Error(`ERR (${n})/"${u}": ${h}`);
  }
  let n = 0, s = n;
  const o = [];
  let i;
  function r() {
    i && o.push(i), i = [];
  }
  let a = 0, l, u = "", d = "";
  function f() {
    u && (n === 0 ? i.push({
      type: 0,
      value: u
    }) : n === 1 || n === 2 || n === 3 ? (i.length > 1 && (l === "*" || l === "+") && t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`), i.push({
      type: 1,
      value: u,
      regexp: d,
      repeatable: l === "*" || l === "+",
      optional: l === "*" || l === "?"
    })) : t("Invalid state to consume buffer"), u = "");
  }
  function p() {
    u += l;
  }
  for (; a < e.length; ) {
    if (l = e[a++], l === "\\" && n !== 2) {
      s = n, n = 4;
      continue;
    }
    switch (n) {
      case 0:
        l === "/" ? (u && f(), r()) : l === ":" ? (f(), n = 1) : p();
        break;
      case 4:
        p(), n = s;
        break;
      case 1:
        l === "(" ? n = 2 : UM.test(l) ? p() : (f(), n = 0, l !== "*" && l !== "?" && l !== "+" && a--);
        break;
      case 2:
        l === ")" ? d[d.length - 1] == "\\" ? d = d.slice(0, -1) + l : n = 3 : d += l;
        break;
      case 3:
        f(), n = 0, l !== "*" && l !== "?" && l !== "+" && a--, d = "";
        break;
      default:
        t("Unknown state");
        break;
    }
  }
  return n === 2 && t(`Unfinished custom RegExp for param "${u}"`), f(), r(), o;
}
function BM(e, t, n) {
  const s = LM(jM(e.path), n);
  if (Ze.NODE_ENV !== "production") {
    const i = /* @__PURE__ */ new Set();
    for (const r of s.keys)
      i.has(r.name) && lt(`Found duplicated params with name "${r.name}" for path "${e.path}". Only the last one will be available on "$route.params".`), i.add(r.name);
  }
  const o = It(s, {
    record: e,
    parent: t,
    // these needs to be populated by the parent
    children: [],
    alias: []
  });
  return t && !o.record.aliasOf == !t.record.aliasOf && t.children.push(o), o;
}
function HM(e, t) {
  const n = [], s = /* @__PURE__ */ new Map();
  t = Ly({ strict: !1, end: !0, sensitive: !1 }, t);
  function o(f) {
    return s.get(f);
  }
  function i(f, p, h) {
    const m = !h, v = My(f);
    Ze.NODE_ENV !== "production" && zM(v, p), v.aliasOf = h && h.record;
    const _ = Ly(t, f), b = [v];
    if ("alias" in f) {
      const x = typeof f.alias == "string" ? [f.alias] : f.alias;
      for (const N of x)
        b.push(
          // we need to normalize again to ensure the `mods` property
          // being non enumerable
          My(It({}, v, {
            // this allows us to hold a copy of the `components` option
            // so that async components cache is hold on the original record
            components: h ? h.record.components : v.components,
            path: N,
            // we might be the child of an alias
            aliasOf: h ? h.record : v
            // the aliases are always of the same kind as the original since they
            // are defined on the same record
          }))
        );
    }
    let w, y;
    for (const x of b) {
      const { path: N } = x;
      if (p && N[0] !== "/") {
        const S = p.record.path, O = S[S.length - 1] === "/" ? "" : "/";
        x.path = p.record.path + (N && O + N);
      }
      if (Ze.NODE_ENV !== "production" && x.path === "*")
        throw new Error(`Catch all routes ("*") must now be defined using a param with a custom regexp.
See more at https://router.vuejs.org/guide/migration/#Removed-star-or-catch-all-routes.`);
      if (w = BM(x, p, _), Ze.NODE_ENV !== "production" && p && N[0] === "/" && XM(w, p), h ? (h.alias.push(w), Ze.NODE_ENV !== "production" && GM(h, w)) : (y = y || w, y !== w && y.alias.push(w), m && f.name && !Py(w) && (Ze.NODE_ENV !== "production" && KM(f, p), r(f.name))), eS(w) && l(w), v.children) {
        const S = v.children;
        for (let O = 0; O < S.length; O++)
          i(S[O], w, h && h.children[O]);
      }
      h = h || w;
    }
    return y ? () => {
      r(y);
    } : rc;
  }
  function r(f) {
    if (Qw(f)) {
      const p = s.get(f);
      p && (s.delete(f), n.splice(n.indexOf(p), 1), p.children.forEach(r), p.alias.forEach(r));
    } else {
      const p = n.indexOf(f);
      p > -1 && (n.splice(p, 1), f.record.name && s.delete(f.record.name), f.children.forEach(r), f.alias.forEach(r));
    }
  }
  function a() {
    return n;
  }
  function l(f) {
    const p = qM(f, n);
    n.splice(p, 0, f), f.record.name && !Py(f) && s.set(f.record.name, f);
  }
  function u(f, p) {
    let h, m = {}, v, _;
    if ("name" in f && f.name) {
      if (h = s.get(f.name), !h)
        throw qa(1, {
          location: f
        });
      if (Ze.NODE_ENV !== "production") {
        const y = Object.keys(f.params || {}).filter((x) => !h.keys.find((N) => N.name === x));
        y.length && lt(`Discarded invalid param(s) "${y.join('", "')}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`);
      }
      _ = h.record.name, m = It(
        // paramsFromLocation is a new object
        Ay(
          p.params,
          // only keep params that exist in the resolved location
          // only keep optional params coming from a parent record
          h.keys.filter((y) => !y.optional).concat(h.parent ? h.parent.keys.filter((y) => y.optional) : []).map((y) => y.name)
        ),
        // discard any existing params in the current location that do not exist here
        // #1497 this ensures better active/exact matching
        f.params && Ay(f.params, h.keys.map((y) => y.name))
      ), v = h.stringify(m);
    } else if (f.path != null)
      v = f.path, Ze.NODE_ENV !== "production" && !v.startsWith("/") && lt(`The Matcher cannot resolve relative paths but received "${v}". Unless you directly called \`matcher.resolve("${v}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`), h = n.find((y) => y.re.test(v)), h && (m = h.parse(v), _ = h.record.name);
    else {
      if (h = p.name ? s.get(p.name) : n.find((y) => y.re.test(p.path)), !h)
        throw qa(1, {
          location: f,
          currentLocation: p
        });
      _ = h.record.name, m = It({}, p.params, f.params), v = h.stringify(m);
    }
    const b = [];
    let w = h;
    for (; w; )
      b.unshift(w.record), w = w.parent;
    return {
      name: _,
      path: v,
      params: m,
      matched: b,
      meta: WM(b)
    };
  }
  e.forEach((f) => i(f));
  function d() {
    n.length = 0, s.clear();
  }
  return {
    addRoute: i,
    resolve: u,
    removeRoute: r,
    clearRoutes: d,
    getRoutes: a,
    getRecordMatcher: o
  };
}
function Ay(e, t) {
  const n = {};
  for (const s of t)
    s in e && (n[s] = e[s]);
  return n;
}
function My(e) {
  const t = {
    path: e.path,
    redirect: e.redirect,
    name: e.name,
    meta: e.meta || {},
    aliasOf: e.aliasOf,
    beforeEnter: e.beforeEnter,
    props: YM(e),
    children: e.children || [],
    instances: {},
    leaveGuards: /* @__PURE__ */ new Set(),
    updateGuards: /* @__PURE__ */ new Set(),
    enterCallbacks: {},
    // must be declared afterwards
    // mods: {},
    components: "components" in e ? e.components || null : e.component && { default: e.component }
  };
  return Object.defineProperty(t, "mods", {
    value: {}
  }), t;
}
function YM(e) {
  const t = {}, n = e.props || !1;
  if ("component" in e)
    t.default = n;
  else
    for (const s in e.components)
      t[s] = typeof n == "object" ? n[s] : n;
  return t;
}
function Py(e) {
  for (; e; ) {
    if (e.record.aliasOf)
      return !0;
    e = e.parent;
  }
  return !1;
}
function WM(e) {
  return e.reduce((t, n) => It(t, n.meta), {});
}
function Ly(e, t) {
  const n = {};
  for (const s in e)
    n[s] = s in t ? t[s] : e[s];
  return n;
}
function Tm(e, t) {
  return e.name === t.name && e.optional === t.optional && e.repeatable === t.repeatable;
}
function GM(e, t) {
  for (const n of e.keys)
    if (!n.optional && !t.keys.find(Tm.bind(null, n)))
      return lt(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`);
  for (const n of t.keys)
    if (!n.optional && !e.keys.find(Tm.bind(null, n)))
      return lt(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`);
}
function zM(e, t) {
  t && t.record.name && !e.name && !e.path && lt(`The route named "${String(t.record.name)}" has a child without a name and an empty path. Using that name won't render the empty path child so you probably want to move the name to the child instead. If this is intentional, add a name to the child route to remove the warning.`);
}
function KM(e, t) {
  for (let n = t; n; n = n.parent)
    if (n.record.name === e.name)
      throw new Error(`A route named "${String(e.name)}" has been added as a ${t === n ? "child" : "descendant"} of a route with the same name. Route names must be unique and a nested route cannot use the same name as an ancestor.`);
}
function XM(e, t) {
  for (const n of t.keys)
    if (!e.keys.find(Tm.bind(null, n)))
      return lt(`Absolute path "${e.record.path}" must have the exact same param named "${n.name}" as its parent "${t.record.path}".`);
}
function qM(e, t) {
  let n = 0, s = t.length;
  for (; n !== s; ) {
    const i = n + s >> 1;
    Zw(e, t[i]) < 0 ? s = i : n = i + 1;
  }
  const o = JM(e);
  return o && (s = t.lastIndexOf(o, s - 1), Ze.NODE_ENV !== "production" && s < 0 && lt(`Finding ancestor route "${o.record.path}" failed for "${e.record.path}"`)), s;
}
function JM(e) {
  let t = e;
  for (; t = t.parent; )
    if (eS(t) && Zw(e, t) === 0)
      return t;
}
function eS({ record: e }) {
  return !!(e.name || e.components && Object.keys(e.components).length || e.redirect);
}
function QM(e) {
  const t = {};
  if (e === "" || e === "?")
    return t;
  const s = (e[0] === "?" ? e.slice(1) : e).split("&");
  for (let o = 0; o < s.length; ++o) {
    const i = s[o].replace(Gw, " "), r = i.indexOf("="), a = Xa(r < 0 ? i : i.slice(0, r)), l = r < 0 ? null : Xa(i.slice(r + 1));
    if (a in t) {
      let u = t[a];
      Ds(u) || (u = t[a] = [u]), u.push(l);
    } else
      t[a] = l;
  }
  return t;
}
function Vy(e) {
  let t = "";
  for (let n in e) {
    const s = e[n];
    if (n = pM(n), s == null) {
      s !== void 0 && (t += (t.length ? "&" : "") + n);
      continue;
    }
    (Ds(s) ? s.map((i) => i && Nm(i)) : [s && Nm(s)]).forEach((i) => {
      i !== void 0 && (t += (t.length ? "&" : "") + n, i != null && (t += "=" + i));
    });
  }
  return t;
}
function ZM(e) {
  const t = {};
  for (const n in e) {
    const s = e[n];
    s !== void 0 && (t[n] = Ds(s) ? s.map((o) => o == null ? null : "" + o) : s == null ? s : "" + s);
  }
  return t;
}
const tS = Symbol(Ze.NODE_ENV !== "production" ? "router view location matched" : ""), Fy = Symbol(Ze.NODE_ENV !== "production" ? "router view depth" : ""), op = Symbol(Ze.NODE_ENV !== "production" ? "router" : ""), pg = Symbol(Ze.NODE_ENV !== "production" ? "route location" : ""), $m = Symbol(Ze.NODE_ENV !== "production" ? "router view location" : "");
function Dl() {
  let e = [];
  function t(s) {
    return e.push(s), () => {
      const o = e.indexOf(s);
      o > -1 && e.splice(o, 1);
    };
  }
  function n() {
    e = [];
  }
  return {
    add: t,
    list: () => e.slice(),
    reset: n
  };
}
function eP(e, t, n) {
  const s = () => {
    e[t].delete(n);
  };
  Fo(s), Cv(s), Nv(() => {
    e[t].add(n);
  }), e[t].add(n);
}
function tP(e) {
  if (Ze.NODE_ENV !== "production" && !cn()) {
    lt("getCurrentInstance() returned null. onBeforeRouteLeave() must be called at the top of a setup function");
    return;
  }
  const t = $e(
    tS,
    // to avoid warning
    {}
  ).value;
  if (!t) {
    Ze.NODE_ENV !== "production" && lt("No active route record was found when calling `onBeforeRouteLeave()`. Make sure you call this function inside a component child of <router-view>. Maybe you called it inside of App.vue?");
    return;
  }
  eP(t, "leaveGuards", e);
}
function Pr(e, t, n, s, o, i = (r) => r()) {
  const r = s && // name is defined if record is because of the function overload
  (s.enterCallbacks[o] = s.enterCallbacks[o] || []);
  return () => new Promise((a, l) => {
    const u = (p) => {
      p === !1 ? l(qa(4, {
        from: n,
        to: t
      })) : p instanceof Error ? l(p) : Xd(p) ? l(qa(2, {
        from: t,
        to: p
      })) : (r && // since enterCallbackArray is truthy, both record and name also are
      s.enterCallbacks[o] === r && typeof p == "function" && r.push(p), a());
    }, d = i(() => e.call(s && s.instances[o], t, n, Ze.NODE_ENV !== "production" ? nP(u, t, n) : u));
    let f = Promise.resolve(d);
    if (e.length < 3 && (f = f.then(u)), Ze.NODE_ENV !== "production" && e.length > 2) {
      const p = `The "next" callback was never called inside of ${e.name ? '"' + e.name + '"' : ""}:
${e.toString()}
. If you are returning a value instead of calling "next", make sure to remove the "next" parameter from your function.`;
      if (typeof d == "object" && "then" in d)
        f = f.then((h) => u._called ? h : (lt(p), Promise.reject(new Error("Invalid navigation guard"))));
      else if (d !== void 0 && !u._called) {
        lt(p), l(new Error("Invalid navigation guard"));
        return;
      }
    }
    f.catch((p) => l(p));
  });
}
function nP(e, t, n) {
  let s = 0;
  return function() {
    s++ === 1 && lt(`The "next" callback was called more than once in one navigation guard when going from "${n.fullPath}" to "${t.fullPath}". It should be called exactly one time in each navigation guard. This will fail in production.`), e._called = !0, s === 1 && e.apply(null, arguments);
  };
}
function uh(e, t, n, s, o = (i) => i()) {
  const i = [];
  for (const r of e) {
    Ze.NODE_ENV !== "production" && !r.components && !r.children.length && lt(`Record with path "${r.path}" is either missing a "component(s)" or "children" property.`);
    for (const a in r.components) {
      let l = r.components[a];
      if (Ze.NODE_ENV !== "production") {
        if (!l || typeof l != "object" && typeof l != "function")
          throw lt(`Component "${a}" in record with path "${r.path}" is not a valid component. Received "${String(l)}".`), new Error("Invalid route component");
        if ("then" in l) {
          lt(`Component "${a}" in record with path "${r.path}" is a Promise instead of a function that returns a Promise. Did you write "import('./MyPage.vue')" instead of "() => import('./MyPage.vue')" ? This will break in production if not fixed.`);
          const u = l;
          l = () => u;
        } else l.__asyncLoader && // warn only once per component
        !l.__warnedDefineAsync && (l.__warnedDefineAsync = !0, lt(`Component "${a}" in record with path "${r.path}" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".`));
      }
      if (!(t !== "beforeRouteEnter" && !r.instances[a]))
        if (Yw(l)) {
          const d = (l.__vccOpts || l)[t];
          d && i.push(Pr(d, n, s, r, a, o));
        } else {
          let u = l();
          Ze.NODE_ENV !== "production" && !("catch" in u) && (lt(`Component "${a}" in record with path "${r.path}" is a function that does not return a Promise. If you were passing a functional component, make sure to add a "displayName" to the component. This will break in production if not fixed.`), u = Promise.resolve(u)), i.push(() => u.then((d) => {
            if (!d)
              throw new Error(`Couldn't resolve component "${a}" at "${r.path}"`);
            const f = nM(d) ? d.default : d;
            r.mods[a] = d, r.components[a] = f;
            const h = (f.__vccOpts || f)[t];
            return h && Pr(h, n, s, r, a, o)();
          }));
        }
    }
  }
  return i;
}
function km(e) {
  const t = $e(op), n = $e(pg);
  let s = !1, o = null;
  const i = k(() => {
    const d = C(e.to);
    return Ze.NODE_ENV !== "production" && (!s || d !== o) && (Xd(d) || (s ? lt(`Invalid value for prop "to" in useLink()
- to:`, d, `
- previous to:`, o, `
- props:`, e) : lt(`Invalid value for prop "to" in useLink()
- to:`, d, `
- props:`, e)), o = d, s = !0), t.resolve(d);
  }), r = k(() => {
    const { matched: d } = i.value, { length: f } = d, p = d[f - 1], h = n.matched;
    if (!p || !h.length)
      return -1;
    const m = h.findIndex(ni.bind(null, p));
    if (m > -1)
      return m;
    const v = Uy(d[f - 2]);
    return (
      // we are dealing with nested routes
      f > 1 && // if the parent and matched route have the same path, this link is
      // referring to the empty child. Or we currently are on a different
      // child of the same parent
      Uy(p) === v && // avoid comparing the child with its parent
      h[h.length - 1].path !== v ? h.findIndex(ni.bind(null, d[f - 2])) : m
    );
  }), a = k(() => r.value > -1 && iP(n.params, i.value.params)), l = k(() => r.value > -1 && r.value === n.matched.length - 1 && qw(n.params, i.value.params));
  function u(d = {}) {
    if (rP(d)) {
      const f = t[C(e.replace) ? "replace" : "push"](
        C(e.to)
        // avoid uncaught errors are they are logged anyway
      ).catch(rc);
      return e.viewTransition && typeof document < "u" && "startViewTransition" in document && document.startViewTransition(() => f), f;
    }
    return Promise.resolve();
  }
  if (Ze.NODE_ENV !== "production" && sr) {
    const d = cn();
    if (d) {
      const f = {
        route: i.value,
        isActive: a.value,
        isExactActive: l.value,
        error: null
      };
      d.__vrl_devtools = d.__vrl_devtools || [], d.__vrl_devtools.push(f), Ft(() => {
        f.route = i.value, f.isActive = a.value, f.isExactActive = l.value, f.error = Xd(C(e.to)) ? null : 'Invalid "to" value';
      }, { flush: "post" });
    }
  }
  return {
    route: i,
    href: k(() => i.value.href),
    isActive: a,
    isExactActive: l,
    navigate: u
  };
}
function sP(e) {
  return e.length === 1 ? e[0] : e;
}
const oP = /* @__PURE__ */ Rn({
  name: "RouterLink",
  compatConfig: { MODE: 3 },
  props: {
    to: {
      type: [String, Object],
      required: !0
    },
    replace: Boolean,
    activeClass: String,
    // inactiveClass: String,
    exactActiveClass: String,
    custom: Boolean,
    ariaCurrentValue: {
      type: String,
      default: "page"
    }
  },
  useLink: km,
  setup(e, { slots: t }) {
    const n = qe(km(e)), { options: s } = $e(op), o = k(() => ({
      [jy(e.activeClass, s.linkActiveClass, "router-link-active")]: n.isActive,
      // [getLinkClass(
      //   props.inactiveClass,
      //   options.linkInactiveClass,
      //   'router-link-inactive'
      // )]: !link.isExactActive,
      [jy(e.exactActiveClass, s.linkExactActiveClass, "router-link-exact-active")]: n.isExactActive
    }));
    return () => {
      const i = t.default && sP(t.default(n));
      return e.custom ? i : Co("a", {
        "aria-current": n.isExactActive ? e.ariaCurrentValue : null,
        href: n.href,
        // this would override user added attrs but Vue will still add
        // the listener, so we end up triggering both
        onClick: n.navigate,
        class: o.value
      }, i);
    };
  }
}), Ja = oP;
function rP(e) {
  if (!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && !e.defaultPrevented && !(e.button !== void 0 && e.button !== 0)) {
    if (e.currentTarget && e.currentTarget.getAttribute) {
      const t = e.currentTarget.getAttribute("target");
      if (/\b_blank\b/i.test(t))
        return;
    }
    return e.preventDefault && e.preventDefault(), !0;
  }
}
function iP(e, t) {
  for (const n in t) {
    const s = t[n], o = e[n];
    if (typeof s == "string") {
      if (s !== o)
        return !1;
    } else if (!Ds(o) || o.length !== s.length || s.some((i, r) => i !== o[r]))
      return !1;
  }
  return !0;
}
function Uy(e) {
  return e ? e.aliasOf ? e.aliasOf.path : e.path : "";
}
const jy = (e, t, n) => e ?? t ?? n, aP = /* @__PURE__ */ Rn({
  name: "RouterView",
  // #674 we manually inherit them
  inheritAttrs: !1,
  props: {
    name: {
      type: String,
      default: "default"
    },
    route: Object
  },
  // Better compat for @vue/compat users
  // https://github.com/vuejs/router/issues/1315
  compatConfig: { MODE: 3 },
  setup(e, { attrs: t, slots: n }) {
    Ze.NODE_ENV !== "production" && cP();
    const s = $e($m), o = k(() => e.route || s.value), i = $e(Fy, 0), r = k(() => {
      let u = C(i);
      const { matched: d } = o.value;
      let f;
      for (; (f = d[u]) && !f.components; )
        u++;
      return u;
    }), a = k(() => o.value.matched[r.value]);
    Cn(Fy, k(() => r.value + 1)), Cn(tS, a), Cn($m, o);
    const l = I();
    return nt(() => [l.value, a.value, e.name], ([u, d, f], [p, h, m]) => {
      d && (d.instances[f] = u, h && h !== d && u && u === p && (d.leaveGuards.size || (d.leaveGuards = h.leaveGuards), d.updateGuards.size || (d.updateGuards = h.updateGuards))), u && d && // if there is no instance but to and from are the same this might be
      // the first visit
      (!h || !ni(d, h) || !p) && (d.enterCallbacks[f] || []).forEach((v) => v(u));
    }, { flush: "post" }), () => {
      const u = o.value, d = e.name, f = a.value, p = f && f.components[d];
      if (!p)
        return By(n.default, { Component: p, route: u });
      const h = f.props[d], m = h ? h === !0 ? u.params : typeof h == "function" ? h(u) : h : null, _ = Co(p, It({}, m, t, {
        onVnodeUnmounted: (b) => {
          b.component.isUnmounted && (f.instances[d] = null);
        },
        ref: l
      }));
      if (Ze.NODE_ENV !== "production" && sr && _.ref) {
        const b = {
          depth: r.value,
          name: f.name,
          path: f.path,
          meta: f.meta
        };
        (Ds(_.ref) ? _.ref.map((y) => y.i) : [_.ref.i]).forEach((y) => {
          y.__vrv_devtools = b;
        });
      }
      return (
        // pass the vnode to the slot as a prop.
        // h and <component :is="..."> both accept vnodes
        By(n.default, { Component: _, route: u }) || _
      );
    };
  }
});
function By(e, t) {
  if (!e)
    return null;
  const n = e(t);
  return n.length === 1 ? n[0] : n;
}
const lP = aP;
function cP() {
  const e = cn(), t = e.parent && e.parent.type.name, n = e.parent && e.parent.subTree && e.parent.subTree.type;
  if (t && (t === "KeepAlive" || t.includes("Transition")) && typeof n == "object" && n.name === "RouterView") {
    const s = t === "KeepAlive" ? "keep-alive" : "transition";
    lt(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
Use slot props instead:

<router-view v-slot="{ Component }">
  <${s}>
    <component :is="Component" />
  </${s}>
</router-view>`);
  }
}
function Rl(e, t) {
  const n = It({}, e, {
    // remove variables that can contain vue instances
    matched: e.matched.map((s) => bP(s, ["instances", "children", "aliasOf"]))
  });
  return {
    _custom: {
      type: null,
      readOnly: !0,
      display: e.fullPath,
      tooltip: t,
      value: n
    }
  };
}
function Ou(e) {
  return {
    _custom: {
      display: e
    }
  };
}
let uP = 0;
function dP(e, t, n) {
  if (t.__hasDevtools)
    return;
  t.__hasDevtools = !0;
  const s = uP++;
  dg({
    id: "org.vuejs.router" + (s ? "." + s : ""),
    label: "Vue Router",
    packageName: "vue-router",
    homepage: "https://router.vuejs.org",
    logo: "https://router.vuejs.org/logo.png",
    componentStateTypes: ["Routing"],
    app: e
  }, (o) => {
    typeof o.now != "function" && console.warn("[Vue Router]: You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."), o.on.inspectComponent((d, f) => {
      d.instanceData && d.instanceData.state.push({
        type: "Routing",
        key: "$route",
        editable: !1,
        value: Rl(t.currentRoute.value, "Current Route")
      });
    }), o.on.visitComponentTree(({ treeNode: d, componentInstance: f }) => {
      if (f.__vrv_devtools) {
        const p = f.__vrv_devtools;
        d.tags.push({
          label: (p.name ? `${p.name.toString()}: ` : "") + p.path,
          textColor: 0,
          tooltip: "This component is rendered by &lt;router-view&gt;",
          backgroundColor: nS
        });
      }
      Ds(f.__vrl_devtools) && (f.__devtoolsApi = o, f.__vrl_devtools.forEach((p) => {
        let h = p.route.path, m = rS, v = "", _ = 0;
        p.error ? (h = p.error, m = vP, _ = gP) : p.isExactActive ? (m = oS, v = "This is exactly active") : p.isActive && (m = sS, v = "This link is active"), d.tags.push({
          label: h,
          textColor: _,
          tooltip: v,
          backgroundColor: m
        });
      }));
    }), nt(t.currentRoute, () => {
      l(), o.notifyComponentUpdate(), o.sendInspectorTree(a), o.sendInspectorState(a);
    });
    const i = "router:navigations:" + s;
    o.addTimelineLayer({
      id: i,
      label: `Router${s ? " " + s : ""} Navigations`,
      color: 4237508
    }), t.onError((d, f) => {
      o.addTimelineEvent({
        layerId: i,
        event: {
          title: "Error during Navigation",
          subtitle: f.fullPath,
          logType: "error",
          time: o.now(),
          data: { error: d },
          groupId: f.meta.__navigationId
        }
      });
    });
    let r = 0;
    t.beforeEach((d, f) => {
      const p = {
        guard: Ou("beforeEach"),
        from: Rl(f, "Current Location during this navigation"),
        to: Rl(d, "Target location")
      };
      Object.defineProperty(d.meta, "__navigationId", {
        value: r++
      }), o.addTimelineEvent({
        layerId: i,
        event: {
          time: o.now(),
          title: "Start of navigation",
          subtitle: d.fullPath,
          data: p,
          groupId: d.meta.__navigationId
        }
      });
    }), t.afterEach((d, f, p) => {
      const h = {
        guard: Ou("afterEach")
      };
      p ? (h.failure = {
        _custom: {
          type: Error,
          readOnly: !0,
          display: p ? p.message : "",
          tooltip: "Navigation Failure",
          value: p
        }
      }, h.status = Ou("❌")) : h.status = Ou("✅"), h.from = Rl(f, "Current Location during this navigation"), h.to = Rl(d, "Target location"), o.addTimelineEvent({
        layerId: i,
        event: {
          title: "End of navigation",
          subtitle: d.fullPath,
          time: o.now(),
          data: h,
          logType: p ? "warning" : "default",
          groupId: d.meta.__navigationId
        }
      });
    });
    const a = "router-inspector:" + s;
    o.addInspector({
      id: a,
      label: "Routes" + (s ? " " + s : ""),
      icon: "book",
      treeFilterPlaceholder: "Search routes"
    });
    function l() {
      if (!u)
        return;
      const d = u;
      let f = n.getRoutes().filter((p) => !p.parent || // these routes have a parent with no component which will not appear in the view
      // therefore we still need to include them
      !p.parent.record.components);
      f.forEach(lS), d.filter && (f = f.filter((p) => (
        // save matches state based on the payload
        Dm(p, d.filter.toLowerCase())
      ))), f.forEach((p) => aS(p, t.currentRoute.value)), d.rootNodes = f.map(iS);
    }
    let u;
    o.on.getInspectorTree((d) => {
      u = d, d.app === e && d.inspectorId === a && l();
    }), o.on.getInspectorState((d) => {
      if (d.app === e && d.inspectorId === a) {
        const p = n.getRoutes().find((h) => h.record.__vd_id === d.nodeId);
        p && (d.state = {
          options: pP(p)
        });
      }
    }), o.sendInspectorTree(a), o.sendInspectorState(a);
  });
}
function fP(e) {
  return e.optional ? e.repeatable ? "*" : "?" : e.repeatable ? "+" : "";
}
function pP(e) {
  const { record: t } = e, n = [
    { editable: !1, key: "path", value: t.path }
  ];
  return t.name != null && n.push({
    editable: !1,
    key: "name",
    value: t.name
  }), n.push({ editable: !1, key: "regexp", value: e.re }), e.keys.length && n.push({
    editable: !1,
    key: "keys",
    value: {
      _custom: {
        type: null,
        readOnly: !0,
        display: e.keys.map((s) => `${s.name}${fP(s)}`).join(" "),
        tooltip: "Param keys",
        value: e.keys
      }
    }
  }), t.redirect != null && n.push({
    editable: !1,
    key: "redirect",
    value: t.redirect
  }), e.alias.length && n.push({
    editable: !1,
    key: "aliases",
    value: e.alias.map((s) => s.record.path)
  }), Object.keys(e.record.meta).length && n.push({
    editable: !1,
    key: "meta",
    value: e.record.meta
  }), n.push({
    key: "score",
    editable: !1,
    value: {
      _custom: {
        type: null,
        readOnly: !0,
        display: e.score.map((s) => s.join(", ")).join(" | "),
        tooltip: "Score used to sort routes",
        value: e.score
      }
    }
  }), n;
}
const nS = 15485081, sS = 2450411, oS = 8702998, hP = 2282478, rS = 16486972, mP = 6710886, vP = 16704226, gP = 12131356;
function iS(e) {
  const t = [], { record: n } = e;
  n.name != null && t.push({
    label: String(n.name),
    textColor: 0,
    backgroundColor: hP
  }), n.aliasOf && t.push({
    label: "alias",
    textColor: 0,
    backgroundColor: rS
  }), e.__vd_match && t.push({
    label: "matches",
    textColor: 0,
    backgroundColor: nS
  }), e.__vd_exactActive && t.push({
    label: "exact",
    textColor: 0,
    backgroundColor: oS
  }), e.__vd_active && t.push({
    label: "active",
    textColor: 0,
    backgroundColor: sS
  }), n.redirect && t.push({
    label: typeof n.redirect == "string" ? `redirect: ${n.redirect}` : "redirects",
    textColor: 16777215,
    backgroundColor: mP
  });
  let s = n.__vd_id;
  return s == null && (s = String(_P++), n.__vd_id = s), {
    id: s,
    label: n.path,
    tags: t,
    children: e.children.map(iS)
  };
}
let _P = 0;
const yP = /^\/(.*)\/([a-z]*)$/;
function aS(e, t) {
  const n = t.matched.length && ni(t.matched[t.matched.length - 1], e.record);
  e.__vd_exactActive = e.__vd_active = n, n || (e.__vd_active = t.matched.some((s) => ni(s, e.record))), e.children.forEach((s) => aS(s, t));
}
function lS(e) {
  e.__vd_match = !1, e.children.forEach(lS);
}
function Dm(e, t) {
  const n = String(e.re).match(yP);
  if (e.__vd_match = !1, !n || n.length < 3)
    return !1;
  if (new RegExp(n[1].replace(/\$$/, ""), n[2]).test(t))
    return e.children.forEach((r) => Dm(r, t)), e.record.path !== "/" || t === "/" ? (e.__vd_match = e.re.test(t), !0) : !1;
  const o = e.record.path.toLowerCase(), i = Xa(o);
  return !t.startsWith("/") && (i.includes(t) || o.includes(t)) || i.startsWith(t) || o.startsWith(t) || e.record.name && String(e.record.name).includes(t) ? !0 : e.children.some((r) => Dm(r, t));
}
function bP(e, t) {
  const n = {};
  for (const s in e)
    t.includes(s) || (n[s] = e[s]);
  return n;
}
function ci(e) {
  const t = HM(e.routes, e), n = e.parseQuery || QM, s = e.stringifyQuery || Vy, o = e.history;
  if (Ze.NODE_ENV !== "production" && !o)
    throw new Error('Provide the "history" option when calling "createRouter()": https://router.vuejs.org/api/interfaces/RouterOptions.html#history');
  const i = Dl(), r = Dl(), a = Dl(), l = vv($r);
  let u = $r;
  sr && e.scrollBehavior && "scrollRestoration" in history && (history.scrollRestoration = "manual");
  const d = lh.bind(null, (J) => "" + J), f = lh.bind(null, mM), p = (
    // @ts-expect-error: intentionally avoid the type check
    lh.bind(null, Xa)
  );
  function h(J, we) {
    let Ee, De;
    return Qw(J) ? (Ee = t.getRecordMatcher(J), Ze.NODE_ENV !== "production" && !Ee && lt(`Parent route "${String(J)}" not found when adding child route`, we), De = we) : De = J, t.addRoute(De, Ee);
  }
  function m(J) {
    const we = t.getRecordMatcher(J);
    we ? t.removeRoute(we) : Ze.NODE_ENV !== "production" && lt(`Cannot remove non-existent route "${String(J)}"`);
  }
  function v() {
    return t.getRoutes().map((J) => J.record);
  }
  function _(J) {
    return !!t.getRecordMatcher(J);
  }
  function b(J, we) {
    if (we = It({}, we || l.value), typeof J == "string") {
      const A = ch(n, J, we.path), Y = t.resolve({ path: A.path }, we), Q = o.createHref(A.fullPath);
      return Ze.NODE_ENV !== "production" && (Q.startsWith("//") ? lt(`Location "${J}" resolved to "${Q}". A resolved location cannot start with multiple slashes.`) : Y.matched.length || lt(`No match found for location with path "${J}"`)), It(A, Y, {
        params: p(Y.params),
        hash: Xa(A.hash),
        redirectedFrom: void 0,
        href: Q
      });
    }
    if (Ze.NODE_ENV !== "production" && !Xd(J))
      return lt(`router.resolve() was passed an invalid location. This will fail in production.
- Location:`, J), b({});
    let Ee;
    if (J.path != null)
      Ze.NODE_ENV !== "production" && "params" in J && !("name" in J) && // @ts-expect-error: the type is never
      Object.keys(J.params).length && lt(`Path "${J.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`), Ee = It({}, J, {
        path: ch(n, J.path, we.path).path
      });
    else {
      const A = It({}, J.params);
      for (const Y in A)
        A[Y] == null && delete A[Y];
      Ee = It({}, J, {
        params: f(A)
      }), we.params = f(we.params);
    }
    const De = t.resolve(Ee, we), tt = J.hash || "";
    Ze.NODE_ENV !== "production" && tt && !tt.startsWith("#") && lt(`A \`hash\` should always start with the character "#". Replace "${tt}" with "#${tt}".`), De.params = d(p(De.params));
    const Tt = _M(s, It({}, J, {
      hash: fM(tt),
      path: De.path
    })), Fe = o.createHref(Tt);
    return Ze.NODE_ENV !== "production" && (Fe.startsWith("//") ? lt(`Location "${J}" resolved to "${Fe}". A resolved location cannot start with multiple slashes.`) : De.matched.length || lt(`No match found for location with path "${J.path != null ? J.path : J}"`)), It({
      fullPath: Tt,
      // keep the hash encoded so fullPath is effectively path + encodedQuery +
      // hash
      hash: tt,
      query: (
        // if the user is using a custom query lib like qs, we might have
        // nested objects, so we keep the query as is, meaning it can contain
        // numbers at `$route.query`, but at the point, the user will have to
        // use their own type anyway.
        // https://github.com/vuejs/router/issues/328#issuecomment-649481567
        s === Vy ? ZM(J.query) : J.query || {}
      )
    }, De, {
      redirectedFrom: void 0,
      href: Fe
    });
  }
  function w(J) {
    return typeof J == "string" ? ch(n, J, l.value.path) : It({}, J);
  }
  function y(J, we) {
    if (u !== J)
      return qa(8, {
        from: we,
        to: J
      });
  }
  function x(J) {
    return O(J);
  }
  function N(J) {
    return x(It(w(J), { replace: !0 }));
  }
  function S(J) {
    const we = J.matched[J.matched.length - 1];
    if (we && we.redirect) {
      const { redirect: Ee } = we;
      let De = typeof Ee == "function" ? Ee(J) : Ee;
      if (typeof De == "string" && (De = De.includes("?") || De.includes("#") ? De = w(De) : (
        // force empty params
        { path: De }
      ), De.params = {}), Ze.NODE_ENV !== "production" && De.path == null && !("name" in De))
        throw lt(`Invalid redirect found:
${JSON.stringify(De, null, 2)}
 when navigating to "${J.fullPath}". A redirect must contain a name or path. This will break in production.`), new Error("Invalid redirect");
      return It({
        query: J.query,
        hash: J.hash,
        // avoid transferring params if the redirect has a path
        params: De.path != null ? {} : J.params
      }, De);
    }
  }
  function O(J, we) {
    const Ee = u = b(J), De = l.value, tt = J.state, Tt = J.force, Fe = J.replace === !0, A = S(Ee);
    if (A)
      return O(
        It(w(A), {
          state: typeof A == "object" ? It({}, tt, A.state) : tt,
          force: Tt,
          replace: Fe
        }),
        // keep original redirectedFrom if it exists
        we || Ee
      );
    const Y = Ee;
    Y.redirectedFrom = we;
    let Q;
    return !Tt && Oy(s, De, Ee) && (Q = qa(16, { to: Y, from: De }), ze(
      De,
      De,
      // this is a push, the only way for it to be triggered from a
      // history.listen is with a redirect, which makes it become a push
      !0,
      // This cannot be the first navigation because the initial location
      // cannot be manually navigated to
      !1
    )), (Q ? Promise.resolve(Q) : R(Y, De)).catch((ie) => qo(ie) ? (
      // navigation redirects still mark the router as ready
      qo(
        ie,
        2
        /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
      ) ? ie : ke(ie)
    ) : (
      // reject any unknown error
      q(ie, Y, De)
    )).then((ie) => {
      if (ie) {
        if (qo(
          ie,
          2
          /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
        ))
          return Ze.NODE_ENV !== "production" && // we are redirecting to the same location we were already at
          Oy(s, b(ie.to), Y) && // and we have done it a couple of times
          we && // @ts-expect-error: added only in dev
          (we._count = we._count ? (
            // @ts-expect-error
            we._count + 1
          ) : 1) > 30 ? (lt(`Detected a possibly infinite redirection in a navigation guard when going from "${De.fullPath}" to "${Y.fullPath}". Aborting to avoid a Stack Overflow.
 Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`), Promise.reject(new Error("Infinite redirect in navigation guard"))) : O(
            // keep options
            It({
              // preserve an existing replacement but allow the redirect to override it
              replace: Fe
            }, w(ie.to), {
              state: typeof ie.to == "object" ? It({}, tt, ie.to.state) : tt,
              force: Tt
            }),
            // preserve the original redirectedFrom if any
            we || Y
          );
      } else
        ie = M(Y, De, !0, Fe, tt);
      return P(Y, De, ie), ie;
    });
  }
  function $(J, we) {
    const Ee = y(J, we);
    return Ee ? Promise.reject(Ee) : Promise.resolve();
  }
  function T(J) {
    const we = Lt.values().next().value;
    return we && typeof we.runWithContext == "function" ? we.runWithContext(J) : J();
  }
  function R(J, we) {
    let Ee;
    const [De, tt, Tt] = EP(J, we);
    Ee = uh(De.reverse(), "beforeRouteLeave", J, we);
    for (const A of De)
      A.leaveGuards.forEach((Y) => {
        Ee.push(Pr(Y, J, we));
      });
    const Fe = $.bind(null, J, we);
    return Ee.push(Fe), Et(Ee).then(() => {
      Ee = [];
      for (const A of i.list())
        Ee.push(Pr(A, J, we));
      return Ee.push(Fe), Et(Ee);
    }).then(() => {
      Ee = uh(tt, "beforeRouteUpdate", J, we);
      for (const A of tt)
        A.updateGuards.forEach((Y) => {
          Ee.push(Pr(Y, J, we));
        });
      return Ee.push(Fe), Et(Ee);
    }).then(() => {
      Ee = [];
      for (const A of Tt)
        if (A.beforeEnter)
          if (Ds(A.beforeEnter))
            for (const Y of A.beforeEnter)
              Ee.push(Pr(Y, J, we));
          else
            Ee.push(Pr(A.beforeEnter, J, we));
      return Ee.push(Fe), Et(Ee);
    }).then(() => (J.matched.forEach((A) => A.enterCallbacks = {}), Ee = uh(Tt, "beforeRouteEnter", J, we, T), Ee.push(Fe), Et(Ee))).then(() => {
      Ee = [];
      for (const A of r.list())
        Ee.push(Pr(A, J, we));
      return Ee.push(Fe), Et(Ee);
    }).catch((A) => qo(
      A,
      8
      /* ErrorTypes.NAVIGATION_CANCELLED */
    ) ? A : Promise.reject(A));
  }
  function P(J, we, Ee) {
    a.list().forEach((De) => T(() => De(J, we, Ee)));
  }
  function M(J, we, Ee, De, tt) {
    const Tt = y(J, we);
    if (Tt)
      return Tt;
    const Fe = we === $r, A = sr ? history.state : {};
    Ee && (De || Fe ? o.replace(J.fullPath, It({
      scroll: Fe && A && A.scroll
    }, tt)) : o.push(J.fullPath, tt)), l.value = J, ze(J, we, Ee, Fe), ke();
  }
  let U;
  function H() {
    U || (U = o.listen((J, we, Ee) => {
      if (!Yt.listening)
        return;
      const De = b(J), tt = S(De);
      if (tt) {
        O(It(tt, { replace: !0, force: !0 }), De).catch(rc);
        return;
      }
      u = De;
      const Tt = l.value;
      sr && CM($y(Tt.fullPath, Ee.delta), sp()), R(De, Tt).catch((Fe) => qo(
        Fe,
        12
        /* ErrorTypes.NAVIGATION_CANCELLED */
      ) ? Fe : qo(
        Fe,
        2
        /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
      ) ? (O(
        It(w(Fe.to), {
          force: !0
        }),
        De
        // avoid an uncaught rejection, let push call triggerError
      ).then((A) => {
        qo(
          A,
          20
          /* ErrorTypes.NAVIGATION_DUPLICATED */
        ) && !Ee.delta && Ee.type === Ic.pop && o.go(-1, !1);
      }).catch(rc), Promise.reject()) : (Ee.delta && o.go(-Ee.delta, !1), q(Fe, De, Tt))).then((Fe) => {
        Fe = Fe || M(
          // after navigation, all matched components are resolved
          De,
          Tt,
          !1
        ), Fe && (Ee.delta && // a new navigation has been triggered, so we do not want to revert, that will change the current history
        // entry while a different route is displayed
        !qo(
          Fe,
          8
          /* ErrorTypes.NAVIGATION_CANCELLED */
        ) ? o.go(-Ee.delta, !1) : Ee.type === Ic.pop && qo(
          Fe,
          20
          /* ErrorTypes.NAVIGATION_DUPLICATED */
        ) && o.go(-1, !1)), P(De, Tt, Fe);
      }).catch(rc);
    }));
  }
  let j = Dl(), V = Dl(), K;
  function q(J, we, Ee) {
    ke(J);
    const De = V.list();
    return De.length ? De.forEach((tt) => tt(J, we, Ee)) : (Ze.NODE_ENV !== "production" && lt("uncaught error during route navigation:"), console.error(J)), Promise.reject(J);
  }
  function re() {
    return K && l.value !== $r ? Promise.resolve() : new Promise((J, we) => {
      j.add([J, we]);
    });
  }
  function ke(J) {
    return K || (K = !J, H(), j.list().forEach(([we, Ee]) => J ? Ee(J) : we()), j.reset()), J;
  }
  function ze(J, we, Ee, De) {
    const { scrollBehavior: tt } = e;
    if (!sr || !tt)
      return Promise.resolve();
    const Tt = !Ee && OM($y(J.fullPath, 0)) || (De || !Ee) && history.state && history.state.scroll || null;
    return po().then(() => tt(J, we, Tt)).then((Fe) => Fe && NM(Fe)).catch((Fe) => q(Fe, J, we));
  }
  const We = (J) => o.go(J);
  let st;
  const Lt = /* @__PURE__ */ new Set(), Yt = {
    currentRoute: l,
    listening: !0,
    addRoute: h,
    removeRoute: m,
    clearRoutes: t.clearRoutes,
    hasRoute: _,
    getRoutes: v,
    resolve: b,
    options: e,
    push: x,
    replace: N,
    go: We,
    back: () => We(-1),
    forward: () => We(1),
    beforeEach: i.add,
    beforeResolve: r.add,
    afterEach: a.add,
    onError: V.add,
    isReady: re,
    install(J) {
      const we = this;
      J.component("RouterLink", Ja), J.component("RouterView", lP), J.config.globalProperties.$router = we, Object.defineProperty(J.config.globalProperties, "$route", {
        enumerable: !0,
        get: () => C(l)
      }), sr && // used for the initial navigation client side to avoid pushing
      // multiple times when the router is used in multiple apps
      !st && l.value === $r && (st = !0, x(o.location).catch((tt) => {
        Ze.NODE_ENV !== "production" && lt("Unexpected error when starting the router:", tt);
      }));
      const Ee = {};
      for (const tt in $r)
        Object.defineProperty(Ee, tt, {
          get: () => l.value[tt],
          enumerable: !0
        });
      J.provide(op, we), J.provide(pg, mv(Ee)), J.provide($m, l);
      const De = J.unmount;
      Lt.add(J), J.unmount = function() {
        Lt.delete(J), Lt.size < 1 && (u = $r, U && U(), U = null, l.value = $r, st = !1, K = !1), De();
      }, Ze.NODE_ENV !== "production" && sr && dP(J, we, t);
    }
  };
  function Et(J) {
    return J.reduce((we, Ee) => we.then(() => T(Ee)), Promise.resolve());
  }
  return Yt;
}
function EP(e, t) {
  const n = [], s = [], o = [], i = Math.max(t.matched.length, e.matched.length);
  for (let r = 0; r < i; r++) {
    const a = t.matched[r];
    a && (e.matched.find((u) => ni(u, a)) ? s.push(a) : n.push(a));
    const l = e.matched[r];
    l && (t.matched.find((u) => ni(u, l)) || o.push(l));
  }
  return [n, s, o];
}
function ds() {
  return $e(op);
}
function Nr(e) {
  return $e(pg);
}
const wP = {}, SP = { id: "post-master" };
function xP(e, t, n, s, o, i) {
  const r = le("router-view");
  return g(), E("div", SP, [
    D(r)
  ]);
}
const NP = /* @__PURE__ */ oe(wP, [["render", xP]]), CP = {}, OP = { class: "wrapper" }, TP = { class: "detail" };
function $P(e, t, n, s, o, i) {
  const r = le("router-view");
  return g(), E("div", OP, [
    c("aside", null, [
      D(r, { name: "Aside" })
    ]),
    c("main", null, [
      c("div", TP, [
        D(r)
      ])
    ])
  ]);
}
const kP = /* @__PURE__ */ oe(CP, [["render", $P], ["__scopeId", "data-v-54e5965f"]]), DP = {
  created() {
  }
};
function RP(e, t, n, s, o, i) {
  return g(), E("div", null, t[0] || (t[0] = [
    c("p", null, [
      c("em", null, "Parcel"),
      te(" is a system designed to securely store and manage messages that could contain sensitive data such as protected health information (PHI).")
    ], -1),
    c("p", null, "All messages are encrypted to ensure the confidentiality and integrity of the data.", -1),
    c("p", null, "Additionally, the system includes a functionality that automatically deletes messages once they reach their expiration date. This ensures that PHI is only accessible to authorized individuals for the necessary duration, and that it is subsequently removed to maintain compliance with relevant regulations.", -1),
    c("p", null, "Overall, our messaging system provides a secure and efficient way to manage PHI while maintaining compliance with relevant regulations.", -1)
  ]));
}
const IP = /* @__PURE__ */ oe(DP, [["render", RP]]), AP = ["title"], MP = {
  __name: "ParcelToolbar",
  props: {
    read: { type: Boolean, default: !1 },
    parcelId: { type: String, default: null }
  },
  setup(e) {
    const t = hl(), n = e, s = k(() => n.read ? "fa-envelope" : "fa-envelope-open");
    function o() {
      if (!confirm("Are you sure you want to delete this item?")) return;
      const a = n.parcelId;
      t.deleteParcel(a);
    }
    function i() {
      const r = n.parcelId, a = !n.read;
      t.markParcel(r, a);
    }
    return (r, a) => (g(), E("ul", null, [
      c("li", {
        onClick: Rt(o, ["stop"]),
        title: "delete"
      }, a[0] || (a[0] = [
        c("i", { class: "fa-regular fa-trash-can fa-fw" }, null, -1)
      ])),
      c("li", {
        onClick: Rt(i, ["stop"]),
        title: `mark as ${e.read ? "unread" : "read"}`
      }, [
        c("i", {
          class: Se(["fa-regular fa-empty-set fa-fw", s.value])
        }, null, 2)
      ], 8, AP)
    ]));
  }
}, PP = /* @__PURE__ */ oe(MP, [["__scopeId", "data-v-9c8eb155"]]), LP = {
  __name: "DateTime",
  props: {
    value: { type: String, default: null }
  },
  setup(e) {
    const t = e, n = k(() => {
      const s = me(), o = new Date(t.value);
      return s.isSame(o, "day") ? me(o).format("LT") : me(o).format("L");
    });
    return (s, o) => (g(), E("span", null, [
      te(F(n.value), 1),
      fe(s.$slots, "default")
    ]));
  }
}, VP = { class: "pl-2 mr-2" }, FP = ["value"], UP = { class: "flex-fill" }, jP = {
  class: "d-block",
  "data-from": ""
}, BP = { class: "d-flex" }, HP = {
  class: "d-block",
  "data-subject": ""
}, YP = ["title"], WP = {
  class: "d-block",
  "data-summary": ""
}, GP = {
  __name: "ParcelListItem",
  props: {
    parcel: {
      type: Object,
      default: () => ({})
    }
  },
  setup(e) {
    const t = hl(), n = e, { parcel: s } = he(n), o = k(() => {
      var a, l;
      return ((a = t.active) == null ? void 0 : a.id) === ((l = s.value) == null ? void 0 : l.id);
    }), i = k(() => {
      var a;
      return ((a = s.value) == null ? void 0 : a.read) === !0;
    }), r = k({
      get() {
        return t.selected.indexOf(s.value.id) >= 0;
      },
      set(a) {
        const l = s.value.id, d = [...t.selected].indexOf(l);
        if (a === !0) {
          if (d >= 0) return;
          t.selected.push(l);
        } else {
          if (d < 0) return;
          t.selected.splice(d, 1);
        }
      }
    });
    return (a, l) => (g(), E("main", {
      class: Se(["d-flex align-items-center p-2", { active: o.value, read: i.value }])
    }, [
      c("aside", VP, [
        L(c("input", {
          type: "checkbox",
          "onUpdate:modelValue": l[0] || (l[0] = (u) => r.value = u),
          value: C(s).id,
          onClick: l[1] || (l[1] = Rt(() => {
          }, ["stop"]))
        }, null, 8, FP), [
          [mn, r.value]
        ])
      ]),
      c("article", UP, [
        c("span", jP, F(C(s).from), 1),
        c("span", BP, [
          c("span", HP, F(C(s).subject), 1),
          c("span", {
            class: "d-block ml-auto text-muted text-right",
            "data-created-at": "",
            title: C(s).createdAt
          }, [
            D(LP, {
              value: C(s).createdAt
            }, null, 8, ["value"])
          ], 8, YP)
        ]),
        c("span", WP, F(C(s).summary), 1),
        D(PP, {
          "data-toolbar": "",
          read: C(s).read,
          "parcel-id": C(s).id
        }, null, 8, ["read", "parcel-id"])
      ])
    ], 2));
  }
}, zP = /* @__PURE__ */ oe(GP, [["__scopeId", "data-v-5355b812"]]), KP = {}, XP = { "data-wrapper": "" };
function qP(e, t) {
  return g(), E("div", XP, t[0] || (t[0] = [
    c("span", { class: "title" }, "Folder is empty", -1),
    c("i", { class: "icon fa-regular fa-folder-open" }, null, -1),
    c("span", { class: "description" }, "Nothing to select.", -1)
  ]));
}
const JP = /* @__PURE__ */ oe(KP, [["render", qP], ["__scopeId", "data-v-16ffa4e0"]]), QP = { class: "d-flex align-items-center" }, ZP = { class: "action" }, eL = {
  key: 0,
  class: "fa-solid fa-spinner fa-spin fa-fw"
}, tL = {
  key: 0,
  class: "badge bg-danger"
}, nL = { class: "toolbar d-flex" }, sL = { class: "ml-1 d-flex align-items-center justify-content-center" }, oL = ["indeterminate"], rL = {
  for: "select-all-checkbox",
  class: "m-0"
}, iL = { class: "ml-auto" }, aL = ["title"], lL = { class: "parcels-wrapper" }, cL = {
  __name: "ParcelList",
  setup(e) {
    const t = ds(), n = hl(), s = k(() => {
      const v = [...n.selected];
      for (const _ of n.list)
        if (v.includes(_.id) && _.read === !0)
          return !0;
      return !1;
    }), o = k(() => n.loading), i = k(() => n.list), r = k(() => n.unread), a = k(() => s.value ? "fa-envelope" : "fa-envelope-open"), l = k(() => {
      const v = [...n.selected];
      if (v.length === 0) return !1;
      const _ = n.list.map((b) => b.id);
      return v.length != _.length;
    }), u = k({
      get() {
        const v = [...n.selected];
        if (v.length === 0) return !1;
        const _ = n.list.map((b) => b.id);
        return v.length === _.length;
      },
      set(v) {
        v === !1 ? n.selected = [] : n.selected = n.list.map((_) => _.id);
      }
    }), d = k(() => [...n.selected].length <= 0);
    async function f() {
      n.fetchList();
    }
    function p(v) {
      n.toggle(v), n.active === null ? t.push("/inbox") : t.push(`/inbox/${v.id}`);
    }
    function h() {
      const v = [...n.selected], _ = v.length;
      if (!(_ < 1 || confirm(
        `Are you sure wyou want to delete ${_} element${_ === 1 ? "" : "s"}`
      ) === !1)) {
        console.log("onDeleteClickedAll clicked");
        for (const w of v)
          n.deleteParcel(w);
      }
    }
    function m() {
      const v = [...n.selected], _ = !s.value;
      for (const b of v)
        n.markParcel(b, _);
    }
    return (v, _) => (g(), E(G, null, [
      c("header", null, [
        c("div", QP, [
          _[1] || (_[1] = c("strong", null, "Inbox", -1)),
          c("span", ZP, [
            o.value ? (g(), E("i", eL)) : (g(), E("i", {
              key: 1,
              onClick: f,
              class: "fas fa-sync-alt fa-fw"
            }))
          ]),
          r.value > 0 ? (g(), E("span", tL, F(r.value) + " unread", 1)) : ne("", !0)
        ]),
        c("div", nL, [
          c("div", sL, [
            L(c("input", {
              class: "mr-2",
              type: "checkbox",
              indeterminate: l.value,
              "onUpdate:modelValue": _[0] || (_[0] = (b) => u.value = b),
              id: "select-all-checkbox"
            }, null, 8, oL), [
              [mn, u.value]
            ]),
            c("label", rL, F(u.value ? "deselect" : "select") + " all", 1)
          ]),
          c("div", iL, [
            c("ul", {
              class: Se(["actions", { disabled: d.value }])
            }, [
              c("li", null, [
                c("span", {
                  class: "action",
                  onClick: Rt(h, ["stop"]),
                  title: "delete"
                }, _[2] || (_[2] = [
                  c("i", { class: "fa-regular fa-trash-can fa-fw" }, null, -1)
                ]))
              ]),
              c("li", null, [
                c("span", {
                  class: "action",
                  onClick: Rt(m, ["stop"]),
                  title: `mark all as ${s.value ? "unread" : "read"}`
                }, [
                  c("i", {
                    class: Se(["fa-regular fa-empty-set fa-fw", a.value])
                  }, null, 2)
                ], 8, aL)
              ])
            ], 2)
          ])
        ])
      ]),
      c("div", lL, [
        i.value.length === 0 ? (g(), se(JP, {
          key: 0,
          class: "my-5"
        })) : (g(!0), E(G, { key: 1 }, ge(i.value, (b) => (g(), se(zP, {
          key: b.id,
          "data-parcel-item": "",
          parcel: b,
          onClick: Rt((w) => p(b), ["stop"])
        }, null, 8, ["parcel", "onClick"]))), 128))
      ])
    ], 64));
  }
}, Hy = /* @__PURE__ */ oe(cL, [["__scopeId", "data-v-2c04335c"]]), uL = {
  key: 0,
  class: "parcel-detail"
}, dL = { class: "border-bottom p-2" }, fL = { class: "d-flex" }, pL = { class: "d-block text-bold" }, hL = { class: "d-block" }, mL = { class: "ml-auto text-right" }, vL = { class: "time" }, gL = ["title"], _L = ["title"], yL = ["title"], bL = ["title"], EL = { class: "d-block" }, wL = { class: "p-2" }, SL = ["innerHTML"], xL = { key: 1 }, NL = {
  __name: "ParcelDetail",
  props: {
    id: {
      type: String,
      default: null
    }
  },
  setup(e) {
    const t = hl(), n = ds(), s = e, o = k(() => t.list.find((d) => d.id === s.id));
    Ft(() => {
      o.value && (t.active = o.value);
    });
    const i = k(() => t.active), r = k(() => "created at"), a = k(() => "expiration: date when the message will be automatically deleted"), l = k(() => {
      var p;
      const u = (p = o.value) == null ? void 0 : p.createdAt;
      if (!u) return "no date available";
      const d = me(u).format("LT");
      return `${me(u).format("L")}, ${d}`;
    });
    return nt(
      o,
      (u) => {
        !u || u.read === !0 || t.markParcel(u.id, !0);
      },
      {
        immediate: !0
      }
    ), nt(
      i,
      (u) => {
        u === null && n.push("/inbox");
      },
      {
        immediate: !1
      }
    ), (u, d) => o.value ? (g(), E("article", uL, [
      c("header", dL, [
        c("div", fL, [
          c("div", null, [
            c("span", pL, [
              d[0] || (d[0] = c("span", { class: "detail-label" }, "From:", -1)),
              te(F(o.value.from), 1)
            ]),
            c("span", hL, [
              d[1] || (d[1] = c("span", { class: "detail-label" }, "To:", -1)),
              te(F(o.value.to), 1)
            ])
          ]),
          c("div", mL, [
            c("div", vL, [
              c("small", {
                title: o.value.createdAt,
                class: "text-muted"
              }, "created " + F(l.value), 9, gL),
              c("small", {
                title: r.value,
                class: "text-muted"
              }, d[2] || (d[2] = [
                c("i", { class: "far fa-clock fa-fw" }, null, -1)
              ]), 8, _L),
              c("small", {
                title: o.value.expiration,
                class: "text-muted"
              }, "expires " + F(o.value.readableExpiration), 9, yL),
              c("small", {
                title: a.value,
                class: "text-muted"
              }, d[3] || (d[3] = [
                c("i", { class: "far fa-hourglass fa-fw" }, null, -1)
              ]), 8, bL)
            ])
          ])
        ]),
        c("span", EL, [
          d[4] || (d[4] = c("span", { class: "detail-label" }, "Subject:", -1)),
          te(F(o.value.subject), 1)
        ])
      ]),
      c("main", wL, [
        c("span", {
          class: "d-block",
          innerHTML: o.value.body
        }, null, 8, SL)
      ])
    ])) : (g(), E("span", xL, "Parcel ID " + F(e.id) + " was not found", 1));
  }
}, CL = /* @__PURE__ */ oe(NL, [["__scopeId", "data-v-158b73d6"]]), OL = {}, TL = {
  "data-wrapper": "",
  class: "position-absolute top-50 start-50 translate-middle"
};
function $L(e, t) {
  return g(), E("div", TL, t[0] || (t[0] = [
    c("span", { class: "title" }, "No Conversation Selected", -1),
    c("i", { class: "icon fas fa-inbox" }, null, -1),
    c("span", { class: "description" }, "Select a conversation to read.", -1)
  ]));
}
const kL = /* @__PURE__ */ oe(OL, [["render", $L], ["__scopeId", "data-v-48b655bf"]]), DL = [
  {
    path: "/",
    name: "home",
    component: NP,
    redirect: "/inbox",
    children: [
      {
        path: "inbox",
        component: kP,
        children: [
          {
            path: "",
            name: "inbox",
            components: {
              Aside: Hy,
              default: kL
            }
          },
          {
            path: ":id",
            name: "inbox-detail",
            components: {
              Aside: Hy,
              default: CL
            },
            props: { default: !0, Aside: !1 }
          }
        ]
      },
      { path: "/about", component: IP }
    ]
  }
];
let Rm;
const RL = () => (Rm = ci({
  // Provide the history implementation to use. We are using the hash history for simplicity here.
  history: li(),
  routes: DL
}), Rm);
var IL = Object.defineProperty, AL = (e, t, n) => t in e ? IL(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, lo = (e, t, n) => AL(e, typeof t != "symbol" ? t + "" : t, n);
const ML = { class: "toast-header" }, PL = ["textContent"], LL = ["textContent"], VL = { class: "toast-body" }, FL = ["textContent"], UL = /* @__PURE__ */ Rn({
  __name: "Toast",
  props: {
    visible: { type: Boolean, default: !1 },
    title: { default: "" },
    subtitle: { default: "" },
    body: { default: "" },
    animation: { type: Boolean, default: !0 },
    autohide: { type: Boolean, default: !0 },
    delay: { default: 15e3 },
    variant: {}
  },
  emits: ["hide", "hidden", "show", "shown"],
  setup(e, { expose: t, emit: n }) {
    const s = e, o = n, { visible: i, animation: r, autohide: a, delay: l } = he(s), u = I(), d = I();
    nt(i, (O) => {
      b();
    }, { immediate: !0 });
    function f() {
      u.value.show();
    }
    function p() {
      u.value.hide();
    }
    function h() {
      u.value.dispose();
    }
    function m() {
      u.value.isShown();
    }
    function v() {
      u.value.getOrCreateInstance();
    }
    function _() {
      u.value.getInstance();
    }
    function b() {
      u.value && (i.value === !0 ? f() : p());
    }
    function w() {
      o("hide", u.value);
    }
    function y() {
      o("hidden", u.value);
    }
    function x() {
      o("show", u.value);
    }
    async function N() {
      o("shown", u.value);
    }
    const S = { show: f, hide: p, dispose: h, isShown: m, getOrCreateInstance: v, getInstance: _ };
    return t({ ...S }), vt(() => {
      d.value.addEventListener("hide.bs.toast", w), d.value.addEventListener("hidden.bs.toast", y), d.value.addEventListener("show.bs.toast", x), d.value.addEventListener("shown.bs.toast", N), u.value = new bootstrap.Toast(d.value, {
        animation: r.value,
        autohide: a.value,
        delay: l.value
      }), b();
    }), (O, $) => (g(), E("div", {
      ref_key: "toastRef",
      ref: d,
      class: Se(["toast", [O.variant ? `text-bg-${O.variant}` : ""]]),
      role: "alert",
      "aria-live": "assertive",
      "aria-atomic": "true"
    }, [
      fe(O.$slots, "header", kt(Dt({ ...S })), () => [
        c("div", ML, [
          fe(O.$slots, "title", kt(Dt({ ...S })), () => [
            c("strong", {
              class: "me-auto",
              textContent: F(O.title)
            }, null, 8, PL)
          ], !0),
          fe(O.$slots, "subtitle", kt(Dt({ ...S })), () => [
            c("small", {
              textContent: F(O.subtitle)
            }, null, 8, LL)
          ], !0),
          c("button", {
            type: "button",
            class: "btn-close",
            "aria-label": "Close",
            onClick: p
          })
        ])
      ], !0),
      fe(O.$slots, "body", kt(Dt({ ...S })), () => [
        c("div", VL, [
          fe(O.$slots, "default", kt(Dt({ ...S })), () => [
            c("span", {
              textContent: F(O.body)
            }, null, 8, FL)
          ], !0)
        ])
      ], !0)
    ], 2));
  }
}), Yo = (e, t) => {
  const n = e.__vccOpts || e;
  for (const [s, o] of t)
    n[s] = o;
  return n;
}, cS = /* @__PURE__ */ Yo(UL, [["__scopeId", "data-v-c0cdbae8"]]);
function jL() {
  let e = (/* @__PURE__ */ new Date()).getTime();
  return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(t) {
    const n = (e + Math.random() * 16) % 16 | 0;
    return e = Math.floor(e / 16), (t == "x" ? n : n & 3 | 8).toString(16);
  });
}
const BL = { id: "toast-wrapper" };
let Yy;
const HL = /* @__PURE__ */ Rn({
  __name: "Toaster",
  setup(e, { expose: t }) {
    const n = {
      visible: !0,
      title: "",
      subtitle: "",
      body: "",
      animation: !0,
      autohide: !0,
      delay: 5e3,
      variant: void 0
    }, s = I(/* @__PURE__ */ new Map());
    Yy = (i, r = "top right") => {
      const a = jL(), l = { ...n, ...i, id: a };
      let u = s.value.get(r);
      u instanceof Set || (u = /* @__PURE__ */ new Set()), u.add(l), s.value.set(r, u);
    };
    function o(i, r) {
      const a = s.value.get(i);
      a == null || a.delete(r);
    }
    return t({ toast: Yy }), (i, r) => (g(), se(ns, { to: "body" }, [
      c("div", BL, [
        (g(!0), E(G, null, ge(s.value, ([a, l]) => (g(), E("div", {
          key: a,
          class: Se(["toast-group", `${a}`])
        }, [
          (g(!0), E(G, null, ge(l, (u, d) => (g(), se(cS, bn({
            key: u.id,
            ref_for: !0
          }, u, {
            onHidden: (f) => o(a, u)
          }), null, 16, ["onHidden"]))), 128))
        ], 2))), 128))
      ])
    ]));
  }
}), YL = /* @__PURE__ */ Yo(HL, [["__scopeId", "data-v-786d1c50"]]), uS = () => {
  let e = [];
  function t() {
    e = [], document.querySelectorAll("*").forEach((s) => {
      const o = getComputedStyle(s);
      o.position === "sticky" && (e.push({ element: s, originalPosition: o.position }), s.style.position = "relative");
    });
  }
  function n() {
    e.forEach((s) => {
      s.element.style.position = s.originalPosition;
    });
  }
  return { removeStickyElements: t, restoreStickyElements: n };
};
var Po = /* @__PURE__ */ ((e) => (e.SMALL = "sm", e.STANDARD = "", e.LARGE = "lg", e.EXTRA_LARGE = "xl", e))(Po || {});
const Qa = (e, t = "") => {
  let n = e.toLowerCase();
  return !Object.values(Po).includes(n) || n == "" ? "" : `${t}${n}`;
}, WL = { class: "modal-content" }, GL = { class: "modal-header" }, zL = ["innerHTML"], KL = { class: "modal-body" }, XL = ["innerHTML"], qL = { class: "modal-footer" }, JL = ["innerHTML"], QL = ["innerHTML"];
typeof window < "u" && !window._managedModals && (window._managedModals = []);
const ZL = /* @__PURE__ */ Rn({
  __name: "Modal",
  props: {
    title: { default: "" },
    body: { default: "" },
    textCancel: { default: "Cancel" },
    textOk: { type: [String, Boolean], default: "Ok" },
    backdrop: { type: [Boolean, String], default: !0 },
    keyboard: { type: Boolean, default: !0 },
    focus: { type: Boolean, default: !0 },
    disableOutsideClick: { type: Boolean, default: !1 },
    okOnly: { type: Boolean, default: !1 },
    size: { default: Po.STANDARD },
    btnSize: { default: Po.SMALL },
    visible: { type: Boolean, default: !1 }
  },
  emits: ["onShown", "onHidden"],
  setup(e, { expose: t, emit: n }) {
    const s = e, {
      backdrop: o,
      keyboard: i,
      focus: r,
      disableOutsideClick: a,
      size: l,
      btnSize: u
    } = he(s), d = n, f = k(() => Qa(l.value, "modal-")), p = k(() => Qa(u.value, "btn-")), h = I();
    let m;
    const v = cn(), _ = () => document.querySelectorAll(".modal.show").length, b = () => typeof window < "u" && window._managedModals ? window._managedModals : [], w = 1055, y = I(w), x = () => {
      const V = _();
      y.value = w + V;
    };
    let N;
    const S = uS();
    function O() {
      return new Promise((V, K) => {
        if (!h.value) return;
        S.removeStickyElements(), x(), h.value.classList.add("managed-modal");
        const q = b(), re = q.length + 1, ke = {
          element: h.value,
          priority: re,
          instance: v
        };
        q.push(ke), h.value.addEventListener("shown.bs.modal", () => {
          R();
        }, { once: !0 }), m == null || m.show(), N = V, d("onShown", m);
      });
    }
    function $(V = !0) {
      if (!h.value) return;
      const K = b(), q = K.findIndex((re) => re.element === h.value);
      q > -1 && K.splice(q, 1), h.value.addEventListener("hidden.bs.modal", () => {
        h.value && (h.value.style.display = ""), R();
      }, { once: !0 }), m == null || m.hide(), typeof N == "function" && N(V), d("onHidden", m), S.restoreStickyElements();
    }
    function T() {
      m == null || m.toggle();
    }
    const R = () => {
      const V = b();
      if (V.length === 0) return;
      V.sort((q, re) => q.priority - re.priority);
      const K = V[V.length - 1];
      V.forEach((q) => {
        q.element !== K.element ? q.element.style.opacity = "0" : q.element.style.opacity = "1";
      });
    };
    vt(() => {
      m = new bootstrap.Modal(h.value, {
        backdrop: o == null ? void 0 : o.value,
        keyboard: i.value,
        focus: r.value
      }), h.value.classList.add("managed-modal"), Ft(() => {
        (s == null ? void 0 : s.visible) === !0 ? m == null || m.show() : m == null || m.hide();
      });
    });
    function P(V) {
      (o == null ? void 0 : o.value) !== "static" && $(!1);
    }
    function M() {
      $(!1);
    }
    function U() {
      $(!1);
    }
    function H() {
      $(!0);
    }
    t({
      modal: m,
      show: O,
      hide: $,
      toggle: T,
      onHeaderCloseClicked: M,
      onCancelClicked: U,
      onOkCLicked: H
    });
    const j = { show: O, hide: $, toggle: T, modal: m };
    return (V, K) => (g(), E("div", bn({
      ref_key: "modalElement",
      ref: h,
      class: "modal fade",
      tabindex: "-1"
    }, { ...V.$attrs }, {
      onClick: Rt(P, ["self"]),
      style: { zIndex: y.value }
    }), [
      c("div", {
        class: Se(["modal-dialog", f.value])
      }, [
        c("div", WL, [
          fe(V.$slots, "header", kt(Dt({ ...j })), () => [
            c("div", GL, [
              fe(V.$slots, "title", kt(Dt({ ...j })), () => [
                c("h5", {
                  class: "modal-title",
                  innerHTML: V.title
                }, null, 8, zL)
              ], !0),
              fe(V.$slots, "header-close-button", kt(Dt({ ...j })), () => [
                c("button", {
                  type: "button",
                  class: "btn-close",
                  "aria-label": "Close",
                  onClick: M
                })
              ], !0)
            ])
          ], !0),
          c("div", KL, [
            fe(V.$slots, "default", kt(Dt({ ...j })), () => [
              c("span", { innerHTML: V.body }, null, 8, XL)
            ], !0)
          ]),
          c("div", qL, [
            fe(V.$slots, "footer", kt(Dt({ ...j })), () => [
              V.okOnly ? ne("", !0) : (g(), E("button", {
                key: 0,
                type: "button",
                class: Se(["btn btn-secondary", p.value]),
                onClick: U
              }, [
                fe(V.$slots, "button-cancel", kt(Dt({ ...j })), () => [
                  c("span", { innerHTML: V.textCancel }, null, 8, JL)
                ], !0)
              ], 2)),
              c("button", {
                type: "button",
                class: Se(["btn btn-primary", p.value]),
                onClick: H
              }, [
                fe(V.$slots, "button-ok", kt(Dt({ ...j })), () => [
                  c("span", { innerHTML: V.textOk }, null, 8, QL)
                ], !0)
              ], 2)
            ], !0)
          ])
        ])
      ], 2)
    ], 16));
  }
}), dS = /* @__PURE__ */ Yo(ZL, [["__scopeId", "data-v-b8ba4eaa"]]), eV = /* @__PURE__ */ Rn({
  __name: "ModalManager",
  setup(e, { expose: t }) {
    const n = I(void 0), s = I({});
    function o(r = {}) {
      var a;
      return r.okOnly = !1, s.value = r, (a = n.value) == null ? void 0 : a.show();
    }
    function i(r = {}) {
      var a;
      return r.okOnly = !0, s.value = r, (a = n.value) == null ? void 0 : a.show();
    }
    return t({ confirm: o, alert: i }), (r, a) => (g(), se(ns, { to: "body" }, [
      D(dS, bn({
        ref_key: "modalRef",
        ref: n
      }, { ...s.value }), null, 16)
    ]));
  }
}), tV = {
  "data-header": "",
  class: "border-bottom"
}, nV = { class: "d-flex gap-2 p-2" }, sV = { class: "p-2" }, oV = {
  "data-footer": "",
  class: "border-top p-2"
}, rV = { class: "buttons" }, iV = /* @__PURE__ */ Rn({
  __name: "DialogBox",
  props: {
    title: { default: "" },
    body: { default: "" },
    textCancel: { default: "Cancel" },
    textOk: { type: [String, Boolean], default: "Ok" },
    backdrop: { type: [Boolean, String], default: !0 },
    keyboard: { type: Boolean, default: !0 },
    focus: { type: Boolean, default: !0 },
    disableOutsideClick: { type: Boolean, default: !1 },
    okOnly: { type: Boolean, default: !1 },
    size: { default: Po.STANDARD },
    btnSize: { default: Po.SMALL },
    visible: { type: Boolean, default: !1 },
    modal: { type: Boolean, default: !1 }
  },
  setup(e, { expose: t }) {
    const n = e, { backdrop: s, disableOutsideClick: o, modal: i, size: r, btnSize: a } = he(n), l = () => document.querySelectorAll("dialog[open]").length, u = 1056, d = I(u), f = I(!1), p = I(!1), h = I(!1), m = I(), v = I(!1), _ = k(() => Qa(r.value, "modal-")), b = k(() => Qa(a.value, "btn-")), w = k(() => ({
      opening: f.value,
      closing: p.value,
      "no-backdrop": s.value === !1,
      static: v.value
    }));
    let y = null;
    const x = () => {
      const M = l();
      d.value = u + M;
    }, N = uS(), S = async () => (x(), N.removeStickyElements(), f.value = !0, m.value.addEventListener(
      "animationend",
      () => {
        f.value = !1, h.value = !0;
      },
      { once: !0 }
    ), i.value === !0 ? m.value.showModal() : m.value.show(), new Promise((M, U) => {
      y = M;
    })), O = async (M = !1) => {
      p.value = !0, m.value.addEventListener(
        "animationend",
        () => {
          m.value.close(), p.value = !1, h.value = !1, typeof y == "function" && y(M), y = null, N.restoreStickyElements();
        },
        { once: !0 }
      );
    }, $ = async () => {
      h.value === !0 ? O() : S();
    }, T = () => {
      v.value = !0, setTimeout(() => {
        v.value = !1;
      }, 200);
    }, R = () => {
      if (s.value === "static" || o.value === !0) {
        T();
        return;
      }
      O(!1);
    };
    if (i.value === !0) {
      let M = function(H) {
        if (s.value === "static" || o.value === !0) {
          T();
          return;
        }
        H.target === m.value && O(!1);
      };
      const U = new AbortController();
      vt(() => {
        document.addEventListener("click", (H) => {
          M(H);
        }, { signal: U.signal });
      }), Fo(() => {
        U.abort();
      });
    }
    const P = { show: S, hide: O, toggle: $, dialog: m };
    return t({
      show: S,
      hide: O,
      toggle: $
    }), (M, U) => (g(), E("div", {
      class: "dialog-wrapper",
      style: Jn({ zIndex: d.value })
    }, [
      c("div", {
        class: "backdrop",
        onClick: R
      }),
      c("dialog", {
        ref_key: "dialog",
        ref: m,
        class: Se(w.value)
      }, [
        c("div", {
          class: Se(["content", _.value])
        }, [
          fe(M.$slots, "header", kt(Dt({ ...P })), () => [
            c("div", tV, [
              c("div", nV, [
                fe(M.$slots, "title", kt(Dt({ ...P })), () => [
                  te(F(M.title), 1)
                ], !0),
                fe(M.$slots, "header-close-button", {}, () => [
                  c("button", {
                    class: "ms-auto",
                    type: "button",
                    "data-btn-close": "",
                    "aria-label": "Close",
                    onClick: U[0] || (U[0] = (H) => O(!1))
                  })
                ], !0)
              ])
            ])
          ], !0),
          c("div", sV, [
            fe(M.$slots, "default", kt(Dt({ ...P })), () => [
              te(F(M.body), 1)
            ], !0)
          ]),
          fe(M.$slots, "footer", kt(Dt({ ...P })), () => [
            c("div", oV, [
              c("div", rV, [
                M.okOnly ? ne("", !0) : (g(), E("button", {
                  key: 0,
                  type: "button",
                  class: Se(["btn btn-secondary", b.value]),
                  onClick: U[1] || (U[1] = (H) => O(!1))
                }, [
                  fe(M.$slots, "textCancel", kt(Dt({ ...P })), () => [
                    te(F(M.textCancel), 1)
                  ], !0)
                ], 2)),
                c("button", {
                  type: "button",
                  class: Se(["btn btn-primary", b.value]),
                  onClick: U[2] || (U[2] = (H) => O(!0))
                }, [
                  fe(M.$slots, "textOk", kt(Dt({ ...P })), () => [
                    te(F(M.textOk), 1)
                  ], !0)
                ], 2)
              ])
            ])
          ], !0)
        ], 2)
      ], 2)
    ], 4));
  }
}), fS = /* @__PURE__ */ Yo(iV, [["__scopeId", "data-v-0990c791"]]), aV = /* @__PURE__ */ Rn({
  __name: "DialogManager",
  setup(e, { expose: t }) {
    const n = I(void 0), s = I({});
    function o(r = {}) {
      var a;
      return r.okOnly = !1, s.value = r, (a = n.value) == null ? void 0 : a.show();
    }
    function i(r = {}) {
      var a;
      return r.okOnly = !0, s.value = r, (a = n.value) == null ? void 0 : a.show();
    }
    return t({ confirm: o, alert: i }), (r, a) => (g(), se(ns, { to: "body" }, [
      D(fS, bn({
        ref_key: "modalRef",
        ref: n
      }, { ...s.value }), null, 16)
    ]));
  }
}), lV = { "data-first": "" }, cV = ["disabled", "innerHTML"], uV = { "data-prev": "" }, dV = ["disabled", "innerHTML"], fV = { key: 0 }, pV = ["innerHTML"], hV = ["onClick"], mV = { "data-next": "" }, vV = ["disabled", "innerHTML"], gV = { "data-last": "" }, _V = ["disabled", "innerHTML"], yV = /* @__PURE__ */ Rn({
  __name: "Pagination",
  props: {
    modelValue: { default: 1 },
    perPage: { default: 5 },
    maxVisibleButtons: { default: 5 },
    totalItems: { default: 0 },
    hideEllipsis: { type: Boolean, default: !1 },
    hideGotoEndButtons: { type: Boolean, default: !1 },
    firstText: { default: "«" },
    prevText: { default: "‹" },
    nextText: { default: "›" },
    lastText: { default: "»" },
    ellipsisText: { default: "…" },
    size: { default: Po.STANDARD }
  },
  emits: ["update:modelValue"],
  setup(e, { emit: t }) {
    function n(y, x = 0) {
      return [...Array(y).keys()].map((N) => N + x);
    }
    const s = t, o = e, { modelValue: i, maxVisibleButtons: r, hideEllipsis: a } = he(o), l = Math.floor(r.value / 2), u = k(() => {
      let y = r.value, x = i.value <= l ? 1 : i.value - l;
      return i.value >= p.value - l && (x = p.value - y + 1), x < 1 && (x = 1), p.value < y && (y = p.value), n(y, x);
    }), d = k(() => i.value <= 1), f = k(() => i.value >= p.value), p = k(() => {
      const { perPage: y, totalItems: x } = o;
      return Math.ceil(x / y);
    });
    Ft(() => {
      p.value > 0 && i.value > p.value && s("update:modelValue", p.value);
    });
    function h(y) {
      const x = r.value - 1;
      return !(a.value === !0 || y === 0 && i.value - l - 1 <= 0 || y === x && i.value + l >= p.value || y > 0 && y < x);
    }
    function m(y) {
      y < 1 && (y = 1), y > p.value && (y = p.value), s("update:modelValue", y);
    }
    function v() {
      s("update:modelValue", 1);
    }
    function _() {
      s("update:modelValue", p.value);
    }
    function b() {
      let y = i.value - 1;
      y < 1 && (y = 1), s("update:modelValue", y);
    }
    function w() {
      let y = i.value + 1;
      y > p.value && (y = p.value), s("update:modelValue", y);
    }
    return (y, x) => (g(), E("ul", {
      class: Se(["pagination", y.size])
    }, [
      c("li", lV, [
        c("button", {
          class: "",
          disabled: d.value,
          innerHTML: y.firstText,
          onClick: v
        }, null, 8, cV)
      ]),
      c("li", uV, [
        c("button", {
          class: "",
          disabled: d.value,
          innerHTML: y.prevText,
          onClick: b
        }, null, 8, dV)
      ]),
      (g(!0), E(G, null, ge(u.value, (N, S) => (g(), E(G, null, [
        h(S) ? (g(), E("li", fV, [
          c("button", {
            disabled: "",
            class: "",
            innerHTML: y.ellipsisText
          }, null, 8, pV)
        ])) : (g(), E("li", {
          key: 1,
          "data-prev": "",
          class: Se({ active: y.modelValue === N })
        }, [
          c("button", {
            class: "",
            onClick: (O) => m(N)
          }, F(N), 9, hV)
        ], 2))
      ], 64))), 256)),
      c("li", mV, [
        c("button", {
          class: "",
          disabled: f.value,
          innerHTML: y.nextText,
          onClick: w
        }, null, 8, vV)
      ]),
      c("li", gV, [
        c("button", {
          class: "",
          disabled: f.value,
          innerHTML: y.lastText,
          onClick: _
        }, null, 8, _V)
      ])
    ], 2));
  }
}), bV = /* @__PURE__ */ Yo(yV, [["__scopeId", "data-v-2bfd7085"]]), EV = { class: "d-inline" }, wV = { class: "fw-bold" }, SV = /* @__PURE__ */ Rn({
  __name: "PageSizeDropdown",
  props: {
    options: { default: () => [25, 50, 100] },
    modelValue: { default: 50 }
  },
  emits: ["update:modelValue"],
  setup(e, { emit: t }) {
    const n = e, s = t, { options: o } = he(n), i = k({
      get: () => n.modelValue,
      set: (r) => s("update:modelValue", r)
    });
    return (r, a) => {
      const l = le("b-dropdown-item"), u = le("b-dropdown");
      return g(), se(u, bn({
        variant: "outline-primary",
        size: "sm"
      }, { ...r.$attrs }), {
        button: B(() => [
          c("div", EV, [
            fe(r.$slots, "default", { selected: i.value }, () => [
              a[0] || (a[0] = c("span", null, "Per page: ", -1)),
              c("span", wV, F(i.value), 1)
            ])
          ])
        ]),
        default: B(() => [
          (g(!0), E(G, null, ge(C(o), (d, f) => (g(), se(l, {
            key: d,
            onClick: (p) => i.value = d,
            active: d === r.modelValue
          }, {
            default: B(() => [
              te(F(d), 1)
            ]),
            _: 2
          }, 1032, ["onClick", "active"]))), 128))
        ]),
        _: 3
      }, 16);
    };
  }
}), xV = ["value"], NV = /* @__PURE__ */ Rn({
  __name: "PageSizeSelect",
  props: {
    options: { default: () => [25, 50, 100] },
    modelValue: { default: 50 }
  },
  emits: ["update:modelValue"],
  setup(e, { emit: t }) {
    const n = e, s = t, { options: o } = he(n), i = k({
      get: () => n.modelValue,
      set: (r) => s("update:modelValue", r)
    });
    return (r, a) => L((g(), E("select", {
      "onUpdate:modelValue": a[0] || (a[0] = (l) => i.value = l)
    }, [
      (g(!0), E(G, null, ge(C(o), (l, u) => (g(), E("option", {
        key: l,
        value: l
      }, F(l), 9, xV))), 128))
    ], 512)), [
      [Qt, i.value]
    ]);
  }
});
var _i = /* @__PURE__ */ ((e) => (e.ASC = "ASC", e.DESC = "DESC", e.IGNORE = "IGNORE", e))(_i || {});
class CV {
  constructor(t, n = "ASC", s) {
    lo(this, "key"), lo(this, "direction"), lo(this, "sortFn"), this.key = t, this.direction = n, this.sortFn = s;
  }
}
const Wy = (e, t) => {
  const n = (a, l) => {
    let u = typeof a, d = typeof l;
    return u == "number" && u == d;
  }, s = (a, l) => a - l, o = (a, l) => (a = a ?? "", l = l ?? "", a.localeCompare(l)), i = (a, l) => n(a, l) ? s : o, r = [...t];
  return r.sort((a, l) => {
    let u = 0;
    for (let d of e) {
      let { key: f, direction: p, sortFn: h } = d, m = p === "ASC" ? 1 : -1, v = a[f], _ = l[f];
      if (h = typeof h == "function" ? h : i(v, _), u = h(v, _, a, l, t, d, m) * m, u !== 0) return u;
    }
    return u;
  }), r;
}, OV = ["onClick"], TV = { class: "th-wrapper" }, $V = {
  key: 0,
  "data-sort-indicator": ""
}, kV = { class: "sort-index" }, DV = { class: "sort-direction" }, RV = ["onMouseover"], IV = {
  key: 0,
  class: "p-5 text-muted font-italic"
}, AV = ["colspan"], MV = ["innerHTML"];
class dh {
  constructor(t = "", n = "", s = !1, o) {
    lo(this, "key"), lo(this, "label"), lo(this, "sortable"), lo(this, "sortFn"), this.key = t, this.label = n, this.sortable = s, this.sortFn = o;
  }
}
const PV = /* @__PURE__ */ Rn({
  __name: "Table",
  props: {
    fields: { default: () => [] },
    items: { default: () => [] },
    striped: { type: Boolean, default: !1 },
    hover: { type: Boolean, default: !0 },
    externalSort: { type: Boolean, default: !1 },
    showEmpty: { type: Boolean, default: !1 },
    emptyText: { default: "nothing to display" }
  },
  emits: ["sort", "onMouseOverCell"],
  setup(e, { emit: t }) {
    const n = (v) => {
      let _ = [];
      for (const b of v)
        _ = _.concat(Object.keys(b));
      return _ = _.filter((b, w) => _.indexOf(b) == w), _;
    }, s = t, o = e, i = I([]), { fields: r, items: a } = he(o), l = k(() => {
      if (o.externalSort || i.value.length == 0) return o.items;
      const v = [...o.items];
      return Wy(i.value, v);
    }), u = k(() => {
      let v = r.value, _ = [];
      return v.length === 0 && (v = n([...a.value])), v.reduce((b, w, y) => {
        if (typeof w == "string")
          b.push(new dh(w, w));
        else if (w instanceof dh)
          b.push(w);
        else if (typeof w == "object") {
          const { key: x, label: N, sortable: S, sortFn: O } = w;
          b.push(new dh(x, N, S, O));
        }
        return b;
      }, _);
    });
    function d(v) {
      const _ = i.value.findIndex((b) => b.key === v.key);
      return _ < 0 ? "" : _ + 1;
    }
    function f(v) {
      const _ = i.value.findIndex((w) => w.key === v.key);
      if (_ < 0) return "fas fa-sort";
      const b = i.value[_];
      return b.direction === _i.ASC ? "fas fa-sort-up" : b.direction === _i.DESC ? "fas fa-sort-down" : "far fa-exclamation-triangle";
    }
    function p(v) {
      const { key: _ } = v, b = i.value.findIndex((w) => w.key === _);
      if (b < 0) {
        const w = new CV(_, _i.ASC, v.sortFn);
        i.value.push(w);
      } else {
        const w = i.value[b], y = w.direction;
        y === _i.ASC ? w.direction = _i.DESC : y === _i.DESC && i.value.splice(b, 1);
      }
      s("sort", i.value, Wy);
    }
    function h(v, _, b, w) {
      s("onMouseOverCell", v, _, b, w);
    }
    let m = I(null);
    return vt(() => {
      m.value = cn();
    }), (v, _) => (g(), E("table", bn({ ...v.$attrs }, {
      class: { striped: v.striped, hover: v.hover }
    }), [
      c("thead", null, [
        (g(!0), E(G, null, ge(u.value, (b) => (g(), E("th", {
          key: `thead-${b.key}`,
          class: Se({ sortable: b.sortable }),
          onClick: (w) => b.sortable && p(b)
        }, [
          c("span", TV, [
            fe(v.$slots, `head(${b.key})`, {
              field: b,
              data: C(m),
              value: b.label
            }, () => [
              te(F(b.label), 1)
            ], !0),
            b.sortable ? (g(), E("span", $V, [
              c("span", kV, F(d(b)), 1),
              c("span", DV, [
                c("i", {
                  class: Se(f(b))
                }, null, 2)
              ])
            ])) : ne("", !0)
          ])
        ], 10, OV))), 128))
      ]),
      c("tbody", null, [
        (g(!0), E(G, null, ge(l.value, (b, w) => (g(), E(G, {
          key: `trow-${(b == null ? void 0 : b.id) ?? w}`
        }, [
          fe(v.$slots, "row", {
            item: b,
            index: w,
            colspan: u.value.length
          }, void 0, !0),
          c("tr", null, [
            (g(!0), E(G, null, ge(u.value, (y) => (g(), E("td", {
              key: `tcell-${y.key + ((b == null ? void 0 : b.id) ?? w)}`,
              class: Se({ [`tcell-${y == null ? void 0 : y.key}`]: !0 }),
              onMouseover: (x) => h(x, b, w, y)
            }, [
              fe(v.$slots, `cell(${y == null ? void 0 : y.key})`, {
                data: C(m),
                item: b,
                field: y,
                value: b[y == null ? void 0 : y.key]
              }, () => [
                te(F(b[y == null ? void 0 : y.key]), 1)
              ], !0)
            ], 42, RV))), 128))
          ])
        ], 64))), 128))
      ]),
      c("tfoot", null, [
        fe(v.$slots, "footer", { data: C(m) }, void 0, !0)
      ]),
      v.showEmpty && l.value.length === 0 ? (g(), E("tr", IV, [
        c("td", {
          colspan: u.value.length
        }, [
          fe(v.$slots, "empty", {
            items: l.value,
            data: C(m),
            fields: u.value
          }, () => [
            c("span", { innerHTML: v.emptyText }, null, 8, MV)
          ], !0)
        ], 8, AV)
      ])) : ne("", !0)
    ], 16));
  }
}), LV = /* @__PURE__ */ Yo(PV, [["__scopeId", "data-v-b1e9b5de"]]);
var pS = /* @__PURE__ */ ((e) => (e.PRIMARY = "primary", e.SECONDARY = "secondary", e.WARNING = "warning", e.DANGER = "danger", e.INFO = "info", e))(pS || {});
const VV = { class: "d-inline-block position-relative" }, FV = ["disabled"], Gy = "data-prevent-close", UV = /* @__PURE__ */ Rn({
  __name: "Dropdown",
  props: {
    text: { default: "" },
    variant: { default: pS.PRIMARY },
    right: { type: Boolean, default: !1 },
    top: { type: Boolean, default: !1 },
    centered: { type: Boolean },
    dropup: { type: Boolean },
    dropend: { type: Boolean },
    dropstart: { type: Boolean },
    menuEnd: { type: Boolean, default: !1 },
    size: { default: Po.STANDARD },
    disabled: { type: Boolean }
  },
  emits: ["open", "close", "toggle"],
  setup(e, { expose: t, emit: n }) {
    const s = I(), o = e, i = I(), r = I(!1), a = I(o.variant), l = I(o.centered), u = I(o.dropup), d = I(o.dropend), f = I(o.dropstart), p = I(o.menuEnd), h = n, m = k(() => {
      const $ = [];
      return a != null && a.value && $.push(`btn-${a.value}`), o.size && $.push(`btn-${o.size}`), $;
    }), v = k(() => {
      const $ = [];
      return l != null && l.value && $.push("dropdown-center"), u != null && u.value && $.push("dropup"), f != null && f.value && $.push("dropstart"), !(f != null && f.value) && d != null && d.value && $.push("dropend"), $.length === 0 && $.push("dropdown"), $.unshift("btn-group"), $;
    }), _ = k(() => {
      const $ = [];
      return r.value && $.push("show"), p.value && $.push("dropdown-menu-end"), $;
    }), b = () => {
      if (!r.value) return;
      const $ = i.value.getBoundingClientRect(), T = s.value.getBoundingClientRect(), R = window.innerHeight - $.bottom, P = $.top, M = window.innerWidth - $.right, U = $.left;
      u.value = R < T.height && P >= T.height, p.value = M < T.width && U >= T.width;
    };
    async function w() {
      r.value = !0, await po(), b();
    }
    function y() {
      r.value = !1;
    }
    function x($) {
      r.value ? y() : w();
    }
    function N($) {
      const { target: T } = $;
      T != null && T.closest(`[${Gy}],[${Gy}=true]`) || y();
    }
    function S() {
      r.value && y();
    }
    nt(r, ($, T) => {
      typeof T > "u" || $ !== T && (h("toggle", { show: $ }), $ === !0 ? h("open", { show: $ }) : h("close", { show: $ }));
    }, { immediate: !0 });
    const O = {
      show: r,
      disabled: o.disabled,
      buttonClasses: m,
      onButtonClicked: x,
      onMenuClicked: N,
      onClickOutside: S,
      open: w,
      close: y
    };
    return t({
      ...O
    }), ($, T) => {
      const R = Ht("click-outside");
      return g(), E("div", {
        ref_key: "dropDownRef",
        ref: i,
        class: Se([v.value, "dropdown-wrapper"])
      }, [
        L((g(), E("div", VV, [
          fe($.$slots, "header", kt(Dt({ ...O })), () => [
            c("button", {
              class: Se(["btn dropdown-toggle", m.value]),
              type: "button",
              "aria-expanded": "false",
              onClick: x,
              disabled: $.disabled
            }, [
              fe($.$slots, "button", kt(Dt({ ...O })), () => [
                te(F($.text), 1)
              ], !0)
            ], 10, FV)
          ], !0),
          c("ul", {
            ref_key: "dropDownMenuRef",
            ref: s,
            class: Se(["dropdown-menu", _.value]),
            onClick: N
          }, [
            fe($.$slots, "default", kt(Dt({ ...O })), void 0, !0)
          ], 2)
        ])), [
          [R, S]
        ])
      ], 2);
    };
  }
}), jV = /* @__PURE__ */ Yo(UV, [["__scopeId", "data-v-4910c394"]]), BV = ["data-prevent-close"], HV = /* @__PURE__ */ Rn({
  __name: "DropdownItem",
  props: {
    active: { type: Boolean },
    preventClose: { type: Boolean }
  },
  setup(e) {
    const t = e, { preventClose: n } = he(t);
    return (s, o) => (g(), E("li", {
      "data-prevent-close": C(n) ? "" : null
    }, [
      c("span", {
        class: Se(["dropdown-item", { active: s.active }]),
        role: "button",
        tabindex: "0"
      }, [
        fe(s.$slots, "default")
      ], 2)
    ], 8, BV));
  }
}), YV = {}, WV = { "data-prevent-close": "" }, GV = { class: "dropdown-header" };
function zV(e, t) {
  return g(), E("li", WV, [
    c("h6", GV, [
      fe(e.$slots, "default")
    ])
  ]);
}
const KV = /* @__PURE__ */ Yo(YV, [["render", zV]]), XV = {};
function qV(e, t) {
  return g(), E("li", null, t[0] || (t[0] = [
    c("hr", { class: "dropdown-divider" }, null, -1)
  ]));
}
const JV = /* @__PURE__ */ Yo(XV, [["render", qV]]), QV = {
  mounted(e, t, n, s) {
    new bootstrap.Tooltip(e, {
      title: t.value,
      placement: t.arg,
      trigger: "hover"
    });
  }
}, ZV = (e, t) => {
  function n(i, r) {
    for (; i !== null; ) {
      if (i === r)
        return !0;
      i = i.parentNode;
    }
    return !1;
  }
  const s = new AbortController();
  function o(i, r) {
    document.addEventListener("click", function(a) {
      const l = a.target;
      i && (n(l, i) || r());
    }, { signal: s.signal });
  }
  return o(e, t), s;
}, eF = {
  mounted(e, t, n, s) {
    const o = t.value;
    ZV(e, o);
  }
};
class Im {
  static add(t) {
    this.list.add(t), document.body.classList.add("drawer-open");
  }
  static delete(t) {
    this.list.delete(t), this.list.size === 0 && document.body.classList.remove("drawer-open");
  }
}
lo(Im, "list", /* @__PURE__ */ new Set());
const tF = { class: "drawer-content" }, nF = { class: "drawer-header" }, sF = ["innerHTML"], oF = { class: "drawer-body" }, rF = ["innerHTML"], iF = { class: "drawer-footer" }, aF = ["innerHTML"], lF = ["innerHTML"], cF = /* @__PURE__ */ Rn({
  __name: "Drawer",
  props: {
    title: { default: "" },
    body: { default: "" },
    textCancel: { default: "Cancel" },
    textOk: { type: [String, Boolean], default: "Ok" },
    backdrop: { type: [Boolean, String], default: "static" },
    keyboard: { type: Boolean, default: !0 },
    focus: { type: Boolean, default: !0 },
    disableOutsideClick: { type: Boolean },
    okOnly: { type: Boolean, default: !1 },
    size: { default: Po.STANDARD },
    btnSize: { default: Po.SMALL },
    lazy: { type: Boolean, default: !1 }
  },
  setup(e, { expose: t }) {
    const n = e, {
      backdrop: s,
      keyboard: o,
      focus: i,
      size: r,
      btnSize: a
    } = he(n), l = k(() => Qa(r.value, "drawer-")), u = k(() => Qa(a.value, "btn-")), d = I(), f = I(!1), p = cn();
    let h;
    async function m() {
      return f.value === !0 ? void 0 : new Promise((S, O) => {
        f.value = !0, h = S;
      });
    }
    function v(S = !0) {
      f.value = !1, typeof h == "function" && h(S);
    }
    function _() {
      f.value === !0 ? m() : v(!1);
    }
    function b(S) {
      (s == null ? void 0 : s.value) !== "static" && v(!1);
    }
    function w() {
      v(!1);
    }
    function y() {
      v(!1);
    }
    function x() {
      v(!0);
    }
    function N() {
      f.value === !0 ? Im.add(p) : Im.delete(p);
    }
    return t({
      show: m,
      hide: v,
      toggle: _
    }), (S, O) => (g(), se(Lv, {
      onBeforeEnter: N,
      onAfterLeave: N
    }, {
      default: B(() => [
        f.value ? (g(), E("div", bn({
          key: 0,
          ref_key: "drawerElement",
          ref: d,
          class: "drawer",
          tabindex: "-1"
        }, { ...S.$attrs }, {
          onClick: Rt(b, ["self"])
        }), [
          c("div", {
            class: Se(["drawer-dialog", l.value])
          }, [
            c("div", tF, [
              c("div", nF, [
                fe(S.$slots, "header", {}, () => [
                  c("h5", {
                    class: "drawer-title",
                    innerHTML: S.title
                  }, null, 8, sF)
                ], !0),
                c("button", {
                  type: "button",
                  class: "btn-close",
                  "aria-label": "Close",
                  onClick: w
                })
              ]),
              c("div", oF, [
                fe(S.$slots, "default", {}, () => [
                  c("span", { innerHTML: S.body }, null, 8, rF)
                ], !0)
              ]),
              c("div", iF, [
                fe(S.$slots, "footer", {}, () => [
                  S.okOnly ? ne("", !0) : (g(), E("button", {
                    key: 0,
                    type: "button",
                    class: Se(["ms-auto btn btn-secondary", u.value]),
                    onClick: y
                  }, [
                    fe(S.$slots, "button-cancel", {}, () => [
                      c("span", { innerHTML: S.textCancel }, null, 8, aF)
                    ], !0)
                  ], 2)),
                  c("button", {
                    type: "button",
                    class: Se(["btn btn-primary", u.value]),
                    onClick: x
                  }, [
                    fe(S.$slots, "button-ok", {}, () => [
                      c("span", { innerHTML: S.textOk }, null, 8, lF)
                    ], !0)
                  ], 2)
                ], !0)
              ])
            ])
          ], 2)
        ], 16)) : ne("", !0)
      ]),
      _: 3
    }));
  }
}), uF = /* @__PURE__ */ Yo(cF, [["__scopeId", "data-v-2e49e8cb"]]), As = "b", hS = "$toaster", mS = "$modalManager", vS = "$dialogManager";
class gS {
  static getComponent() {
    if (!this.component) {
      const t = document.createElement("div");
      document.body.appendChild(t);
      const n = wn(eV).mount(t);
      this.component = n;
    }
    return this.component;
  }
}
lo(gS, "component");
class _S {
  static getComponent() {
    if (!this.component) {
      const t = document.createElement("div");
      document.body.appendChild(t);
      const n = wn(aV).mount(t);
      this.component = n;
    }
    return this.component;
  }
}
lo(_S, "component");
class yS {
  static getComponent() {
    if (!this.component) {
      const t = document.createElement("div");
      document.body.appendChild(t);
      const n = wn(YL).mount(t);
      this.component = n;
    }
    return this.component;
  }
}
lo(yS, "component");
function an() {
  return $e(hS);
}
function fs() {
  return $e(mS);
}
function dF() {
  return $e(vS);
}
function fF(e) {
  e.component(`${As}-drawer`, uF), e.component(`${As}-modal`, dS), e.component(`${As}-dialog`, fS), e.component(`${As}-pagination`, bV), e.component(`${As}-pagination-dropdown`, SV), e.component(`${As}-pagination-select`, NV), e.component(`${As}-dropdown`, jV), e.component(`${As}-dropdown-item`, HV), e.component(`${As}-dropdown-header`, KV), e.component(`${As}-dropdown-divider`, JV), e.component(`${As}-table`, LV), e.component(`${As}-toast`, cS);
}
function pF(e) {
  e.directive("tooltip", QV), e.directive("click-outside", eF);
}
const Cs = {
  install(e) {
    fF(e), pF(e);
    const t = yS.getComponent(), n = gS.getComponent(), s = _S.getComponent();
    e.provide(hS, t), e.provide(mS, n), e.provide(vS, s);
  }
}, lde = async (e) => {
  RL();
  const t = wn(UA);
  return t.use(ai()), t.use(Cs), t.use(Rm), t.mount(e), t;
}, cde = async (e) => {
  const t = wn(KA);
  return t.use(ai()), t.use(Cs), t.mount(e), t;
};
function ml(e, t = 300) {
  let n;
  return function(...s) {
    n && clearTimeout(n);
    const o = this;
    n = setTimeout(() => {
      e.apply(o, s);
    }, t);
  };
}
function hF(e, t = 0, n = 100) {
  return Math.min(Math.max(e, t), n);
}
function Lo(e, t) {
  if (Array.isArray(e) && Array.isArray(t)) {
    if (e.length !== t.length)
      return !1;
    for (let o = 0; o < e.length; o++)
      if (!Lo(e[o], t[o]))
        return !1;
    return !0;
  }
  if (typeof e != "object" || typeof t != "object" || e == null || t == null)
    return e === t;
  const n = Object.keys(e), s = Object.keys(t);
  if (n.length !== s.length)
    return !1;
  for (const o of n)
    if (!s.includes(o) || !Lo(e[o], t[o]))
      return !1;
  return !0;
}
const co = (e, t = /* @__PURE__ */ new WeakMap()) => {
  if (e === null || typeof e != "object")
    return e;
  if (t.has(e))
    return t.get(e);
  let n;
  if (Array.isArray(e))
    n = [], t.set(e, n), e.forEach((s, o) => {
      n[o] = co(s, t);
    });
  else {
    n = e.constructor ? new e.constructor() : /* @__PURE__ */ Object.create(null), t.set(e, n);
    for (const s in e)
      s in e && (n[s] = co(e[s], t));
  }
  return n;
}, hg = () => "10000000-1000-4000-8000-100000000000".replace(
  /[018]/g,
  (e) => (e ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> e / 4).toString(16)
), mF = (e) => {
  if (typeof e == "string") {
    const t = e.toLowerCase();
    if (t === "true")
      return !0;
    if (t === "false" || t === "0")
      return !1;
  } else if (typeof e == "number")
    return e !== 0;
  return !!e;
}, zy = (e, t) => {
  Object.keys(e).forEach((n) => {
    delete e[n];
  });
  for (const [n, s] of Object.entries(t))
    e[n] = s;
}, vF = (e) => {
  const t = e.getBoundingClientRect();
  return t.top >= 0 && t.left >= 0 && t.bottom <= (window.innerHeight || document.documentElement.clientHeight) && t.right <= (window.innerWidth || document.documentElement.clientWidth);
}, gF = (e) => {
  const t = document.createElement("div");
  return t.innerHTML = e, t.textContent || t.innerText || "";
}, bs = Object.freeze({
  WAITING: "waiting",
  PROCESSING: "processing",
  COMPLETED: "completed",
  ERROR: "error",
  WARNING: "warning",
  CANCELED: "canceled"
});
var Bc, vf, bS;
class _F {
  constructor(t = "") {
    Sl(this, vf);
    Sl(this, Bc);
    Lp(this, Bc, t);
  }
  get defaultConfig() {
    return {
      method: "GET",
      headers: {
        "Content-Type": "application/json",
        "X-Requested-With": "XMLHttpRequest"
      }
      // add an abort signal
      // signal: abortController.signal,
    };
  }
  getFullURL(t) {
    return new URL(t, ha(this, Bc));
  }
  makeRequest(t) {
    const n = this.getFullURL(t);
    return (o) => {
      let i = c_(this, vf, bS).call(this, n, this.defaultConfig, o);
      return new Promise((a, l) => {
        fetch(n, i).then(async (u) => {
          var p;
          const f = ((p = u.headers.get("content-type")) == null ? void 0 : p.includes("application/json")) ? await u.json() : null;
          if (!u.ok) {
            const h = f && f.message || u.status;
            return l(h);
          }
          a(f);
        }).catch((u) => {
          console.error("Error fetching data:", u), l(u);
        });
      });
    };
  }
  /**
   * use this function in a derived class to
   * override the global params
   * 
   * @param {Object} params 
   * @returns 
   */
  visitGlobalParams(t) {
    return t;
  }
  get globalQueryParams() {
    let t = new URLSearchParams(location.search), n = {};
    for (let [s, o] of t.entries())
      n[s] = o;
    return window.redcap_csrf_token && (n.redcap_csrf_token = window.redcap_csrf_token), n = this.visitGlobalParams(n), n;
  }
  async send(t, n) {
    return this.makeRequest(t)(n);
  }
}
Bc = new WeakMap(), vf = new WeakSet(), bS = function(t, n, s) {
  for (let [o, i] of Object.entries(s))
    switch (o) {
      case "data":
        if (i instanceof FormData) {
          let u = {};
          const d = i;
          for (let [f, p] of d.entries())
            f in u ? (Array.isArray(u[f]) || (u[f] = [u[f]]), u[f].push(p)) : u[f] = p;
          n.body = JSON.stringify(u);
        } else
          n.body = JSON.stringify(i);
        break;
      case "params":
        const a = { ...this.globalQueryParams, ...i }, l = t.searchParams;
        for (const [u, d] of Object.entries(a))
          l.set(u, d);
        break;
      default:
        n[o] = i;
        break;
    }
  return n;
};
var gf;
class yF extends _F {
  constructor() {
    super(...arguments);
    Sl(this, gf, ["pid"]);
  }
  visitGlobalParams(n) {
    const s = {};
    for (const [o, i] of Object.entries(n))
      ha(this, gf).includes(o) || (s[o] = i);
    return s;
  }
}
gf = new WeakMap();
let Am = "";
window.app_path_webroot_full ? Am = `${window.app_path_webroot_full}redcap_v${window.redcap_version}/` : Am = `${location.protocol}//${location.host}/api`;
const fh = new yF(Am), ac = qe({
  loading: !1,
  data: [],
  metadata: {},
  list: [],
  //
  async fetchMessages(e = 0, t = 0, n = "") {
    try {
      this.loading = !0;
      const s = {
        route: "QueueController:getList",
        page: e,
        perPage: t,
        query: n
      }, o = await fh.send("", { params: s, method: "GET" }), { data: i, metadata: r } = o;
      this.data = i, this.metadata = r;
    } catch (s) {
      console.log(s);
    } finally {
      this.loading = !1;
    }
  },
  async updatePriority(e, t) {
    try {
      const n = {
        route: "QueueController:setPriority"
      }, s = { ID: e, priority: t }, o = await fh.send("", { method: "POST", params: n, data: s }), { data: i } = o;
      return !0;
    } catch {
      return !1;
    } finally {
    }
  },
  async deleteMessage(e) {
    try {
      const t = {
        route: "QueueController:deleteMessage"
      }, n = { ID: e }, s = await fh.send("", { method: "DELETE", params: t, data: n }), { data: o } = s;
      return !0;
    } catch {
      return !1;
    } finally {
    }
  }
}), Lr = Object.freeze({
  ASC: "ASC",
  DESC: "DESC",
  IGNORE: "IGNORE"
});
class bF {
  constructor(t, n = Lr.ASC, s = null) {
    Qe(this, "key");
    Qe(this, "direction");
    Qe(this, "sortFn");
    this.key = t, this.direction = n, this.sortFn = s;
  }
}
const Ky = (e, t) => {
  const n = (a, l) => {
    let u = typeof a, d = typeof l;
    return u == "number" && u == d;
  }, s = (a, l) => a - l, o = (a, l) => (a = a ?? "", l = l ?? "", a.localeCompare(l)), i = (a, l) => n(a, l) ? s : o, r = [...t];
  return r.sort((a, l) => {
    let u = 0;
    for (let d of e) {
      let { key: f, direction: p, sortFn: h } = d, m = p === Lr.ASC ? 1 : -1, v = a[f], _ = l[f];
      if (h = typeof h == "function" ? h : i(v, _), u = h(v, _, a, l, t, d, m) * m, u !== 0) return u;
    }
    return u;
  }), r;
};
class EF {
  constructor(t) {
    Qe(this, "key", "");
    // age
    Qe(this, "label", "");
    // Person age
    Qe(this, "sortable", !1);
    // true
    /**
     * optional sorting logic for the field
     * a sort function accepts 2 parameters (a,b)
     * and follows the sorting rules
     */
    Qe(this, "sortFn", null);
    typeof t == "string" ? (this.key = t, this.label = t) : (this.key = t == null ? void 0 : t.key, this.label = t == null ? void 0 : t.label, this.sortable = (t == null ? void 0 : t.sortable) || !1, this.sortFn = (t == null ? void 0 : t.sortFn) || null);
  }
}
const wF = (e) => {
  let t = [];
  for (const n of e)
    t = t.concat(Object.keys(n));
  return t = t.filter((n, s) => t.indexOf(n) == s), t;
}, SF = {
  emits: ["sort"],
  setup(e, t) {
    const n = I([]), s = k(() => {
      if (e.externalSort || n.value.length == 0) return e.items;
      const l = [...e.items];
      return Ky(n.value, l);
    }), o = k(() => {
      let l = e.fields;
      return l.length === 0 && (l = wF([...e.items])), l.map((u) => new EF(u));
    });
    function i(l) {
      const u = n.value.findIndex((d) => d.key === l.key);
      return u < 0 ? "" : u + 1;
    }
    function r(l) {
      const u = n.value.findIndex((f) => f.key === l.key);
      if (u < 0) return "fas fa-sort";
      const d = n.value[u];
      return d.direction === Lr.ASC ? "fas fa-sort-up" : d.direction === Lr.DESC ? "fas fa-sort-down" : "far fa-exclamation-triangle";
    }
    function a(l) {
      const { key: u } = l, d = n.value.findIndex((f) => f.key === u);
      if (d < 0) {
        const f = new bF(u, Lr.ASC, l.sortFn);
        n.value.push(f);
      } else {
        const f = n.value[d], p = f.direction;
        p === Lr.ASC ? f.direction = Lr.DESC : p === Lr.DESC && n.value.splice(d, 1);
      }
      t.emit("sort", n.value, Ky);
    }
    return {
      sorts: n,
      sortedItems: s,
      mapedFields: o,
      sortBy: a,
      sortIndex: i,
      sortIcon: r
    };
  },
  props: {
    fields: { type: Array, default: [] },
    items: { type: Array, default: [] },
    striped: { type: Boolean, default: !1 },
    hover: { type: Boolean, default: !0 },
    externalSort: { type: Boolean, default: !1 },
    // sort externally
    showEmpty: { type: Boolean, default: !1 },
    emptyText: { type: String, default: "nothing to display" }
  }
}, xF = ["onClick"], NF = { class: "th-wrapper" }, CF = {
  key: 0,
  "data-sort-indicator": ""
}, OF = { class: "sort-index" }, TF = { class: "sort-direction" }, $F = {
  key: 0,
  class: "p-5 text-muted font-italic"
}, kF = ["colspan"], DF = ["innerHTML"];
function RF(e, t, n, s, o, i) {
  return g(), E("table", bn({ ...e.$attrs }, {
    class: { striped: n.striped, hover: n.hover }
  }), [
    c("thead", null, [
      (g(!0), E(G, null, ge(s.mapedFields, (r) => (g(), E("th", {
        key: `thead-${r.key}`,
        class: Se({ sortable: r.sortable }),
        onClick: (a) => r.sortable && s.sortBy(r)
      }, [
        c("span", NF, [
          fe(e.$slots, `head(${r.key})`, {
            field: r,
            data: this,
            value: r.label
          }, () => [
            te(F(r.label), 1)
          ], !0),
          r.sortable ? (g(), E("span", CF, [
            c("span", OF, F(s.sortIndex(r)), 1),
            c("span", TF, [
              c("i", {
                class: Se(s.sortIcon(r))
              }, null, 2)
            ])
          ])) : ne("", !0)
        ])
      ], 10, xF))), 128))
    ]),
    c("tbody", null, [
      (g(!0), E(G, null, ge(s.sortedItems, (r, a) => (g(), E(G, {
        key: `trow-${(r == null ? void 0 : r.id) ?? a}`
      }, [
        fe(e.$slots, "row", {
          item: r,
          index: a,
          colspan: s.mapedFields.length
        }, void 0, !0),
        c("tr", null, [
          (g(!0), E(G, null, ge(s.mapedFields, (l) => (g(), E("td", {
            key: `tcell-${l.key + ((r == null ? void 0 : r.id) ?? a)}`,
            class: Se({ [`tcell-${l.key}`]: !0 })
          }, [
            fe(e.$slots, `cell(${l.key})`, {
              data: this,
              item: r,
              field: l,
              value: r[l.key]
            }, () => [
              te(F(r[l.key]), 1)
            ], !0)
          ], 2))), 128))
        ])
      ], 64))), 128))
    ]),
    c("tfoot", null, [
      fe(e.$slots, "footer", { data: this }, void 0, !0)
    ]),
    n.showEmpty && s.sortedItems.length === 0 ? (g(), E("tr", $F, [
      c("td", {
        colspan: s.mapedFields.length
      }, [
        fe(e.$slots, "empty", {
          items: s.sortedItems,
          data: this,
          fields: s.mapedFields
        }, () => [
          c("span", { innerHTML: n.emptyText }, null, 8, DF)
        ], !0)
      ], 8, kF)
    ])) : ne("", !0)
  ], 16);
}
const IF = /* @__PURE__ */ oe(SF, [["render", RF], ["__scopeId", "data-v-c51981ff"]]);
var ki;
class AF {
  constructor() {
    Qe(this, "previousStyle");
    Sl(this, ki);
    Lp(this, ki, document.querySelector("body"));
  }
  applyStyle(t) {
    this.backupStyle();
    for (const [n, s] of Object.entries(t))
      ha(this, ki).style[n] = s;
  }
  backupStyle() {
    this.previousStyle = ha(this, ki).style;
  }
  restoreStyle() {
    this.previousStyle && (ha(this, ki).style = this.previousStyle);
  }
}
ki = new WeakMap();
const Xy = new AF(), _a = Object.freeze({
  OK: 1,
  CANCEL: 0,
  ERROR: -1
}), Il = Object.freeze({
  small: "300px",
  default: "500px",
  large: "800px",
  extra: "1140px"
});
let Al, Tu;
var Oo;
let qy = (Oo = class {
  constructor(t, n) {
    this.props = t, this.context = n;
  }
  setup() {
    const t = this, n = this.props, s = this.context, { visible: o, size: i, modelValue: r } = he(n), a = I(null), l = I(!1), u = I({}), d = k({
      get() {
        return r.value;
      },
      set(x) {
        s.emit("update:modelValue", x);
      }
    });
    nt(
      o,
      function(x) {
        x === !0 ? f() : p();
      },
      { immediate: !0 }
    ), nt(
      i,
      function(x) {
        let N = (Il == null ? void 0 : Il[x]) ?? Il.Default;
        u.value["--modal-width"] = N;
      },
      { immediate: !0 }
    );
    async function f() {
      return l.value ? void 0 : (Oo.openModals.size === 0 && Xy.applyStyle({ overflow: "hidden" }), l.value = !0, await y(), Oo.openModals.add(t), s.emit("show", s), new Promise((N, S) => {
        Al = N, Tu = S;
      }));
    }
    async function p(x = _a.CANCEL) {
      if (await y(!1), !!l.value && (l.value = !1, s.emit("hide", s, x), Oo.openModals.delete(t), Oo.openModals.size === 0 && Xy.restoreStyle(), !(!Al || !Tu))) {
        switch (x) {
          case _a.OK:
            Al(!0);
            break;
          case _a.CANCEL:
            Al(!1);
            break;
          case _a.ERROR:
            Tu(!0);
            break;
        }
        Al = Tu = null;
      }
    }
    function h() {
      return l ? p() : f();
    }
    function m() {
      p(_a.CANCEL);
    }
    function v(x) {
      n.disableOutsideClick || m();
    }
    function _(x) {
      m();
    }
    function b(x) {
      m();
    }
    function w(x) {
      p(_a.OK);
    }
    function y(x = !0) {
      if (!a.value) return;
      const N = a.value, S = N.querySelector("[data-content]");
      let O = {
        duration: 300,
        fill: "forwards",
        easing: "ease-in-out",
        direction: x ? "normal" : "reverse"
        // iterations: Infinity
      };
      const $ = (U) => {
        let H = [
          { opacity: "0" },
          { opacity: "1" }
        ];
        return U.animate(H, O);
      }, T = (U) => {
        let H = [
          { transform: "translate(0, -25%)" },
          { transform: "translate(0, 0)" }
        ];
        return U.animate(H, O);
      }, R = $(N), P = T(S);
      return Promise.all([R.finished, P.finished]);
    }
    return {
      root: a,
      isVisible: l,
      style: u,
      prompt: d,
      onBackdropClicked: v,
      onCloseClicked: _,
      onCancelClicked: b,
      onOkClicked: w,
      toggle: h,
      show: f,
      hide: p,
      cancel: m
    };
  }
  /**
   * export the props
   * @param {Function} visit optional function that can modify the default props
   * @returns 
   */
  static props(t = null) {
    const n = {
      visible: { type: Boolean, default: !1 },
      backdrop: { type: Boolean, default: !1 },
      disableOutsideClick: { type: Boolean, default: !1 },
      okOnly: { type: Boolean, default: !1 },
      okText: { type: String, default: "Ok" },
      cancelText: { type: String, default: "Cancel" },
      closeText: { type: String, default: "&times;" },
      title: { type: String, default: "" },
      body: { type: String, default: "" },
      size: { type: String, default: Il.Default },
      showPrompt: { type: Boolean, default: !1 },
      modelValue: { type: String, default: "" }
    };
    return typeof t == "function" && t(n), n;
  }
}, // TODO: keep track of open Modals
Qe(Oo, "openModals", /* @__PURE__ */ new Set()), Oo);
const MF = {
  emits: ["update:modelValue", "show", "hide"],
  setup(e, t) {
    return new qy(e, t).setup();
  },
  props: qy.props()
}, PF = { "data-dialog": "" }, LF = { "data-content": "" }, VF = { "data-header": "" }, FF = ["innerHTML"], UF = { "data-body": "" }, jF = ["innerHTML"], BF = { "data-footer": "" }, HF = ["innerHTML"], YF = ["innerHTML"];
function WF(e, t, n, s, o, i) {
  return L((g(), E("div", {
    ref: "root",
    "data-modal": "",
    onClick: t[4] || (t[4] = Rt((...r) => e.onBackdropClicked && e.onBackdropClicked(...r), ["self"])),
    style: Jn(e.style)
  }, [
    c("div", PF, [
      c("div", LF, [
        c("div", VF, [
          e.isVisible ? fe(e.$slots, "header", { key: 0 }, () => [
            c("div", { innerHTML: e.title }, null, 8, FF)
          ], !0) : ne("", !0),
          c("div", null, [
            c("span", {
              "data-close": "",
              onClick: t[0] || (t[0] = (...r) => e.onCloseClicked && e.onCloseClicked(...r))
            }, "×")
          ])
        ]),
        c("div", UF, [
          e.isVisible ? fe(e.$slots, "default", {
            key: 0,
            onOkClicked: e.onOkClicked
          }, () => [
            c("div", { innerHTML: e.body }, null, 8, jF)
          ], !0) : ne("", !0),
          e.isVisible && e.showPrompt ? fe(e.$slots, "secondary-prompt", { key: 1 }, () => [
            L(c("input", {
              class: "form-control mt-2",
              type: "text",
              "onUpdate:modelValue": t[1] || (t[1] = (r) => e.prompt = r)
            }, null, 512), [
              [Ve, e.prompt]
            ])
          ], !0) : ne("", !0)
        ]),
        c("div", BF, [
          e.isVisible ? fe(e.$slots, "footer", { key: 0 }, () => [
            fe(e.$slots, "secondary-button", {}, () => [
              e.okOnly ? ne("", !0) : (g(), E("button", {
                key: 0,
                class: "btn btn-sm btn-secondary",
                type: "button",
                "data-button-cancel": "",
                onClick: t[2] || (t[2] = (...r) => e.onCancelClicked && e.onCancelClicked(...r)),
                innerHTML: e.cancelText
              }, null, 8, HF))
            ], !0),
            fe(e.$slots, "primary-button", {}, () => [
              c("button", {
                class: "btn btn-sm btn-primary",
                type: "button",
                "data-button-ok": "",
                onClick: t[3] || (t[3] = (...r) => e.onOkClicked && e.onOkClicked(...r)),
                innerHTML: e.okText
              }, null, 8, YF)
            ], !0)
          ], !0) : ne("", !0)
        ])
      ])
    ])
  ], 4)), [
    [Gi, e.isVisible]
  ]);
}
const ES = /* @__PURE__ */ oe(MF, [["render", WF], ["__scopeId", "data-v-8e97323f"]]), GF = { "data-button": "" }, zF = ["innerHTML"], KF = {
  key: 0,
  "data-menu": ""
}, XF = "prevent-close", qF = {
  __name: "DropDown",
  props: {
    text: { type: String, default: "" },
    variant: { type: String, default: "primary" },
    right: { type: Boolean, default: !1 },
    top: { type: Boolean, default: !1 }
  },
  setup(e) {
    let t;
    const n = I(!1);
    function s(a) {
      console.log("onSlotClicked");
    }
    function o() {
      n.value = !0;
    }
    function i() {
      n.value = !1;
    }
    function r(a) {
      t && t.abort();
      const { currentTarget: l } = a;
      t = new AbortController(), n.value ? i() : o(), setTimeout(() => {
        document.addEventListener(
          "click",
          (u) => {
            const { target: d } = u;
            d != null && d.closest(
              `[${XF}]`
            ) || d === l || (i(), t.abort());
          },
          { signal: t.signal }
        );
      }, null);
    }
    return (a, l) => (g(), E("div", bn({ "data-dropdown": "" }, { ...a.$attrs }, {
      class: { right: e.right, top: e.top }
    }), [
      c("div", GF, [
        c("button", {
          class: Se(["btn btn-sm d-flex align-items-center", { [`btn-${e.variant}`]: !0 }]),
          type: "button",
          onClick: r
        }, [
          fe(a.$slots, "button", { dropdown: this }, () => [
            c("span", { innerHTML: e.text }, null, 8, zF)
          ], !0),
          fe(a.$slots, "caret", {}, () => [
            c("i", {
              class: Se(["ms-auto fas fa-caret-right fa-fw", { "fa-rotate-90": n.value }])
            }, null, 2)
          ], !0)
        ], 2)
      ]),
      n.value ? (g(), E("div", KF, [
        fe(a.$slots, "default", {
          onItemClick: s,
          dropdown: this
        }, void 0, !0)
      ])) : ne("", !0)
    ], 16));
  }
}, wS = /* @__PURE__ */ oe(qF, [["__scopeId", "data-v-8e679820"]]), JF = {
  emits: ["click"],
  setup(e, t) {
    function n() {
      t.emit("click", this);
    }
    return {
      onClick: n
    };
  }
};
function QF(e, t, n, s, o, i) {
  return g(), E("div", {
    "data-dropdown-item": "",
    onClick: t[0] || (t[0] = (...r) => s.onClick && s.onClick(...r))
  }, [
    fe(e.$slots, "default", {}, void 0, !0)
  ]);
}
const Mm = /* @__PURE__ */ oe(JF, [["render", QF], ["__scopeId", "data-v-48525a0a"]]), ZF = { "data-first": "" }, e4 = ["disabled", "innerHTML"], t4 = { "data-prev": "" }, n4 = ["disabled", "innerHTML"], s4 = { key: 0 }, o4 = ["innerHTML"], r4 = ["onClick"], i4 = { "data-next": "" }, a4 = ["disabled", "innerHTML"], l4 = { "data-last": "" }, c4 = ["disabled", "innerHTML"], u4 = Object.freeze({
  SMALL: "sm",
  NORMAL: "",
  LARGE: "lg"
}), d4 = {
  __name: "PageSelection",
  props: {
    modelValue: { type: Number, default: 1 },
    perPage: { type: Number, default: 5 },
    maxVisibleButtons: { type: Number, default: 5 },
    totalItems: { type: Number, default: 0 },
    hideEllipsis: { type: Boolean, default: !1 },
    hideGotoEndButtons: { type: Boolean, default: !1 },
    firstText: { type: String, default: "«" },
    prevText: { type: String, default: "‹" },
    nextText: { type: String, default: "›" },
    lastText: { type: String, default: "»" },
    ellipsisText: { type: String, default: "…" },
    size: {
      type: String,
      default: "",
      validator(e) {
        return Object.values(u4).includes(e);
      }
    }
  },
  emits: ["update:modelValue"],
  setup(e, { emit: t }) {
    const n = e, s = t;
    function o(y, x = 0) {
      return [...Array(y).keys()].map((N) => N + x);
    }
    const {
      modelValue: i,
      maxVisibleButtons: r,
      hideEllipsis: a
    } = he(n), l = Math.floor(r.value / 2), u = k(() => {
      let y = r.value, x = i.value <= l ? 1 : i.value - l;
      return i.value >= p.value - l && (x = p.value - y + 1), x < 1 && (x = 1), p.value < y && (y = p.value), o(y, x);
    }), d = k(() => i.value <= 1), f = k(() => i.value >= p.value), p = k(() => {
      const { perPage: y, totalItems: x } = n;
      return Math.ceil(x / y);
    });
    function h(y) {
      const x = r.value - 1;
      return !(a.value === !0 || y === 0 && i.value - l - 1 <= 0 || y === x && i.value + l >= p.value || y > 0 && y < x);
    }
    function m(y) {
      y < 1 && (y = 1), y > p.value && (y = p.value), s("update:modelValue", y);
    }
    function v() {
      s("update:modelValue", 1);
    }
    function _() {
      s("update:modelValue", p.value);
    }
    function b() {
      let y = i.value - 1;
      y < 1 && (y = 1), s("update:modelValue", y);
    }
    function w() {
      let y = i.value + 1;
      y > p.value && (y = p.value), s("update:modelValue", y);
    }
    return (y, x) => (g(), E("ul", {
      class: Se(["pagination", e.size])
    }, [
      c("li", ZF, [
        c("button", {
          class: "",
          disabled: d.value,
          innerHTML: e.firstText,
          onClick: v
        }, null, 8, e4)
      ]),
      c("li", t4, [
        c("button", {
          class: "",
          disabled: d.value,
          innerHTML: e.prevText,
          onClick: b
        }, null, 8, n4)
      ]),
      (g(!0), E(G, null, ge(u.value, (N, S) => (g(), E(G, { key: N }, [
        h(S) ? (g(), E("li", s4, [
          c("button", {
            disabled: "",
            class: "",
            innerHTML: e.ellipsisText
          }, null, 8, o4)
        ])) : (g(), E("li", {
          key: 1,
          "data-prev": "",
          class: Se({ active: e.modelValue === N })
        }, [
          c("button", {
            class: "",
            onClick: (O) => m(N)
          }, F(N), 9, r4)
        ], 2))
      ], 64))), 128)),
      c("li", i4, [
        c("button", {
          class: "",
          disabled: f.value,
          innerHTML: e.nextText,
          onClick: w
        }, null, 8, a4)
      ]),
      c("li", l4, [
        c("button", {
          class: "",
          disabled: f.value,
          innerHTML: e.lastText,
          onClick: _
        }, null, 8, c4)
      ])
    ], 2));
  }
}, qd = /* @__PURE__ */ oe(d4, [["__scopeId", "data-v-cf1b8518"]]), f4 = "fas fa-refresh", p4 = {
  emits: ["click"],
  props: {
    loading: { type: Boolean, default: !1 },
    icon: { type: String, default: f4 },
    text: { type: String, default: "" },
    callback: { type: Function, default: null }
  },
  setup(e, t) {
    const { text: n, icon: s, loading: o } = he(e);
    function i() {
      t.emit("click", this);
    }
    return {
      text: n,
      icon: s,
      loading: o,
      onButtonClicked: i
    };
  }
}, h4 = ["disabled"], m4 = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw"
}, v4 = ["innerHTML"];
function g4(e, t, n, s, o, i) {
  return g(), E("div", null, [
    c("button", {
      disabled: s.loading,
      class: "btn btn-sm btn-primary",
      onClick: t[0] || (t[0] = (...r) => s.onButtonClicked && s.onButtonClicked(...r))
    }, [
      s.loading ? (g(), E("i", m4)) : (g(), E("i", {
        key: 1,
        class: Se([s.icon, "fa-fw"])
      }, null, 2)),
      s.text ? (g(), E("span", {
        key: 2,
        class: "ml-2",
        innerHTML: s.text
      }, null, 8, v4)) : ne("", !0)
    ], 8, h4)
  ]);
}
const Jy = /* @__PURE__ */ oe(p4, [["render", g4]]);
class Vr {
  static make(t) {
    const n = document.createElement("div");
    return document.body.appendChild(n), wn(ES, { ...t }).mount(n);
  }
  static async confirm(t) {
    const n = Vr.make(t);
    return Vr.show(n);
  }
  static async alert(t) {
    const n = Vr.make({ okOnly: !0, ...t });
    return Vr.show(n);
  }
  static async prompt(t) {
    const n = Vr.make({ showPrompt: !0, ...t });
    return Vr.show(n);
  }
  static async show(t) {
    const n = () => {
      const o = t.$el.parentNode;
      o.parentNode.removeChild(o);
    };
    return new Promise((o, i) => {
      setTimeout(async () => {
        const r = await t.show();
        o(r), n();
      }, 0);
    });
  }
}
const _4 = ["disabled"], y4 = ["disabled"], b4 = ["onKeyup"], E4 = {
  __name: "Toolbar",
  props: {
    list: { type: Array, default: () => [] }
  },
  emits: ["onDelete"],
  setup(e, { emit: t }) {
    const n = t, s = e, o = I(""), i = I(null), { list: r } = he(s), a = k(() => r.value.filter(
      ({ status: h }) => h === bs.WAITING
    ).length == 0);
    async function l() {
      var h, m;
      const p = r.value.length;
      o.value = p === 1 ? (m = (h = r.value) == null ? void 0 : h[0]) == null ? void 0 : m.priority : "", await i.value.show(), r.value.forEach((v) => {
        u(v);
      });
    }
    async function u(p) {
      if (p.status !== bs.WAITING || !Number.isInteger(o.value)) return;
      const h = p.priority;
      let m = hF(o.value, 1, 100);
      if (isNaN(m)) return;
      p.priority = m;
      const v = await ac.updatePriority(p.id, m);
      return v || (p.priority = h), v;
    }
    const d = k(() => r.value.filter(
      ({ status: h }) => h !== bs.PROCESSING
    ).length == 0);
    async function f() {
      const p = r.value.length === 1 ? "this item" : "these items";
      if (!await Vr.confirm({
        title: "Are you sure?",
        body: `Do you really want to delete ${p}? This action cannot be undone.`
      })) return;
      const m = r.value.filter(
        ({ status: _ }) => _ !== bs.PROCESSING
      ), v = [];
      m.forEach(async (_) => {
        if (_.status === bs.PROCESSING) return;
        const b = ac.deleteMessage(_.id);
        v.push(b);
      }), await Promise.all(v), n("onDelete");
    }
    return (p, h) => {
      const m = le("b-dropdown-item"), v = le("b-dropdown"), _ = le("b-modal");
      return g(), E(G, null, [
        D(v, {
          variant: "outline-secondary",
          size: "sm"
        }, {
          button: B(({ show: b }) => [
            c("i", {
              class: Se(["fas fa-cog fa-fw", { "fa-rotate-90": b }])
            }, null, 2),
            h[1] || (h[1] = c("span", { class: "ms-2" }, "actions", -1))
          ]),
          default: B(() => [
            D(m, null, {
              default: B(() => [
                c("button", {
                  class: "d-flex align-items-center justify-content-between",
                  disabled: a.value,
                  onClick: l
                }, h[2] || (h[2] = [
                  c("i", { class: "fas fa-pencil fa-fw" }, null, -1),
                  c("span", { class: "ms-2" }, "edit priority", -1)
                ]), 8, _4)
              ]),
              _: 1
            }),
            D(m, null, {
              default: B(() => [
                c("button", {
                  class: "",
                  disabled: d.value,
                  onClick: f
                }, h[3] || (h[3] = [
                  c("i", { class: "fas fa-trash fa-fw" }, null, -1),
                  c("span", { class: "ms-2" }, "delete", -1)
                ]), 8, y4)
              ]),
              _: 1
            })
          ]),
          _: 1
        }),
        D(_, {
          ref_key: "priorityModal",
          ref: i
        }, {
          header: B(() => h[4] || (h[4] = [
            te(" Modify priority ")
          ])),
          default: B(({ hide: b }) => [
            h[5] || (h[5] = c("p", { class: "alert alert-info" }, " Please note that priority will only be updated for messages with a 'waiting' stutus. ", -1)),
            L(c("input", {
              class: "form-control form-control-sm",
              "onUpdate:modelValue": h[0] || (h[0] = (w) => o.value = w),
              type: "number",
              onKeyup: Fv((w) => b(!0), ["enter"])
            }, null, 40, b4), [
              [Ve, o.value]
            ])
          ]),
          _: 1
        }, 512)
      ], 64);
    };
  }
}, w4 = /* @__PURE__ */ oe(E4, [["__scopeId", "data-v-f130de3e"]]), S4 = { class: "my-2 d-flex justify-content-between align-items-center" }, x4 = { class: "d-flex mb-2" }, N4 = { class: "ms-auto me-2" }, C4 = ["value"], O4 = { class: "d-flex align-items-center justify-content-start" }, T4 = ["id", "value"], $4 = ["for"], k4 = { class: "custom-control custom-switch" }, D4 = ["checked", "indeterminate"], R4 = ["innerHTML"], I4 = ["title"], A4 = ["value", "id"], M4 = ["for"], P4 = ["innerHTML"], L4 = { class: "" }, V4 = { class: "d-flex m-auto align-items-center" }, F4 = ["title"], U4 = {
  key: 0,
  class: "d-flex"
}, j4 = ["innerHTML"], B4 = { class: "d-flex align-items-center priority" }, H4 = ["innerHTML"], Y4 = { class: "my-2 d-flex justify-content-between align-items-center" }, W4 = ["onKeyup"], G4 = {
  __name: "MessagesTable",
  setup(e) {
    const t = [
      { key: "id", label: "", sortable: !1 },
      // { key: 'data', label: 'data', sortable: true },
      { key: "key", label: "KEY", sortable: !0 },
      { key: "status", label: "STATUS", sortable: !0, sortFn: (P, M, U, H, j, V, K) => {
        const { status: q = "", priority: re = 0 } = U, { status: ke = "", priority: ze = 0 } = H, We = q.localeCompare(ke);
        return We === 0 ? re - ze : We;
      } },
      { key: "description", label: "DESCRIPTION", sortable: !0 },
      // { key: 'priority', label: 'PRIORITY', sortable: true },
      { key: "message", label: "MESSAGE", sortable: !0 },
      { key: "created_at", label: "CREATED AT", sortable: !0 },
      { key: "started_at", label: "STARTED AT", sortable: !0 },
      { key: "completed_at", label: "COMPLETED AT", sortable: !0 }
    ], n = ["status", "key", "priority", "description", "message"];
    k(() => ac.metadata);
    const s = I(!1), o = I(1), i = [25, 50, 100, 500], r = I(i[1]), a = I(""), l = I(null), u = I(Object.values(bs)), d = I([]), f = k(() => {
      const P = p.value.length, M = d.value.length;
      return M === 0 ? !1 : M !== P;
    }), p = k(() => b.value), h = k(() => {
      const P = d.value.length, M = p.value.length;
      return !(P === 0 || P < M);
    });
    function m() {
      d.value.length === 0 || f.value === !0 ? d.value = p.value : d.value = [];
    }
    const v = k(() => ac.data), _ = I([]), b = k(() => {
      d.value = [];
      let P = _.value;
      return P = P.filter((M) => u.value.includes(M.status)), a.value !== "" && (P = P.filter((M) => {
        for (const U of n)
          if (String(M == null ? void 0 : M[U]).match(a.value)) return !0;
        return !1;
      })), P;
    }), w = k(() => b.value.length), y = k(() => {
      const P = (o.value - 1) * r.value, M = P + r.value;
      return b.value.slice(P, M);
    });
    function x(P, M) {
      P.length === 0 ? _.value = [...v.value] : _.value = M(P, v.value);
    }
    const N = ml((P) => {
      o.value = 1;
      const { value: M } = P.target;
      a.value = M;
    }, 300);
    async function S() {
      await ac.fetchMessages();
    }
    function O(P) {
      let M = "";
      switch (P) {
        case bs.WAITING:
          M = "fas fa-clock text-primary";
          break;
        case bs.PROCESSING:
          M = "fas fa-spinner fa-spin text-muted";
          break;
        case bs.COMPLETED:
          M = "fas fa-check-circle text-success";
          break;
        case bs.WARNING:
          M = "fas fa-exclamation-triangle text-warning";
          break;
        case bs.ERROR:
          M = "fas fa-times-circle text-danger";
          break;
        case bs.CANCELED:
          M = "fas fa-ban text-secondary";
          break;
        default:
          M = "fas fa-check-circle text-secondary";
          break;
      }
      return M;
    }
    function $(P, M = 1, U = 100, H = 0.4) {
      return `hsl(${120 - (P - M) / (U - M) * 120} 100% 50% / ${H})`;
    }
    const T = I("");
    async function R() {
      try {
        return s.value = !0, await S(), o.value = 1, _.value = v.value, !0;
      } catch (P) {
        console.log(P);
      } finally {
        s.value = !1;
      }
    }
    return R(), (P, M) => {
      const U = le("b-dropdown-item"), H = le("b-dropdown");
      return g(), E(G, null, [
        c("div", null, [
          c("div", S4, [
            D(qd, {
              totalItems: w.value,
              modelValue: o.value,
              "onUpdate:modelValue": M[0] || (M[0] = (j) => o.value = j),
              perPage: r.value,
              size: "sm"
            }, null, 8, ["totalItems", "modelValue", "perPage"]),
            D(H, {
              class: "ms-auto",
              variant: "outline-primary",
              size: "sm"
            }, {
              button: B(() => [
                c("span", null, "Per page " + F(r.value), 1)
              ]),
              default: B(() => [
                (g(), E(G, null, ge(i, (j, V) => D(U, {
                  key: V,
                  active: j === r.value,
                  onClick: (K) => r.value = j
                }, {
                  default: B(() => [
                    te(F(j), 1)
                  ]),
                  _: 2
                }, 1032, ["active", "onClick"])), 64))
              ]),
              _: 1
            }),
            D(Jy, {
              class: "ms-2",
              onClick: R,
              loading: s.value
            }, null, 8, ["loading"])
          ]),
          c("div", x4, [
            c("div", null, [
              D(w4, {
                list: d.value,
                onOnDelete: R
              }, null, 8, ["list"])
            ]),
            c("div", N4, [
              c("input", {
                class: "form-control form-control-sm",
                type: "search",
                value: a.value,
                onInput: M[1] || (M[1] = (...j) => C(N) && C(N)(...j)),
                placeholder: "filter..."
              }, null, 40, C4)
            ]),
            D(H, {
              variant: "outline-secondary",
              size: "sm"
            }, {
              button: B(() => M[6] || (M[6] = [
                c("i", { class: "fas fa-list fa-fw" }, null, -1),
                c("span", { class: "ms-2" }, "visible statuses", -1)
              ])),
              default: B(() => [
                (g(!0), E(G, null, ge(C(bs), (j, V) => (g(), se(U, {
                  key: V,
                  "prevent-close": ""
                }, {
                  default: B(() => [
                    c("span", O4, [
                      c("span", null, [
                        L(c("input", {
                          class: "me-2",
                          type: "checkbox",
                          name: "",
                          id: `status-${j}`,
                          value: j,
                          "onUpdate:modelValue": M[2] || (M[2] = (K) => u.value = K)
                        }, null, 8, T4), [
                          [mn, u.value]
                        ])
                      ]),
                      c("span", null, [
                        c("label", {
                          for: `status-${j}`,
                          class: "m-0"
                        }, [
                          c("i", {
                            class: Se(O(j))
                          }, null, 2),
                          te(" " + F(j), 1)
                        ], 8, $4)
                      ])
                    ])
                  ]),
                  _: 2
                }, 1024))), 128))
              ]),
              _: 1
            })
          ]),
          D(IF, {
            id: "messages-table",
            fields: t,
            items: y.value,
            onSort: x,
            "show-empty": "",
            externalSort: ""
          }, {
            "head(id)": B(({ data: j, field: V, value: K }) => [
              M[8] || (M[8] = c("span", null, null, -1)),
              c("div", k4, [
                c("input", {
                  class: "custom-control-input",
                  type: "checkbox",
                  checked: h.value,
                  indeterminate: f.value,
                  onClickCapture: m,
                  id: "checkbox-select-all"
                }, null, 40, D4),
                M[7] || (M[7] = c("label", {
                  class: "custom-control-label",
                  for: "checkbox-select-all"
                }, null, -1))
              ])
            ]),
            "head(priority)": B(({ data: j, field: V, value: K }) => [
              c("span", { innerHTML: K }, null, 8, R4)
            ]),
            "cell(id)": B(({ data: j, item: V, field: K, value: q }) => [
              c("div", {
                class: "custom-control custom-switch",
                title: V.id
              }, [
                L(c("input", {
                  class: "custom-control-input",
                  type: "checkbox",
                  "onUpdate:modelValue": M[3] || (M[3] = (re) => d.value = re),
                  value: V,
                  id: `checkbox-${V.id}`
                }, null, 8, A4), [
                  [mn, d.value]
                ]),
                c("label", {
                  class: "custom-control-label",
                  for: `checkbox-${V.id}`
                }, null, 8, M4)
              ], 8, I4)
            ]),
            "cell(description)": B(({ data: j, item: V, field: K, value: q }) => [
              c("span", { innerHTML: q }, null, 8, P4)
            ]),
            "cell(status)": B(({ data: j, item: V, field: K, value: q }) => [
              c("span", L4, [
                c("span", V4, [
                  c("i", {
                    title: q,
                    class: Se(["m-auto", O(q)])
                  }, null, 10, F4)
                ]),
                q == C(bs).WAITING ? (g(), E("span", U4, [
                  c("span", {
                    class: "m-auto text-muted font-italic small text-nowrap",
                    innerHTML: `priority level ${V.priority}`
                  }, null, 8, j4)
                ])) : ne("", !0)
              ])
            ]),
            "cell(priority)": B(({ data: j, item: V, field: K, value: q }) => [
              c("span", B4, [
                c("span", {
                  style: Jn({ backgroundColor: $(q) }),
                  class: "d-flex align-items-center justify-content-center p-1 mr-1 rounded"
                }, M[9] || (M[9] = [
                  c("i", { class: "fas fa-arrow-circle-up" }, null, -1)
                ]), 4),
                c("span", {
                  innerHTML: q
                }, null, 8, H4)
              ])
            ]),
            _: 1
          }, 8, ["items"]),
          c("div", Y4, [
            D(qd, {
              totalItems: w.value,
              modelValue: o.value,
              "onUpdate:modelValue": M[4] || (M[4] = (j) => o.value = j),
              perPage: r.value,
              size: "sm"
            }, null, 8, ["totalItems", "modelValue", "perPage"]),
            D(Jy, {
              class: "ms-auto",
              onClick: R,
              loading: s.value
            }, null, 8, ["loading"])
          ])
        ]),
        D(ES, {
          ref_key: "priorityModal",
          ref: l
        }, {
          header: B(() => M[10] || (M[10] = [
            te(" Modify priority ")
          ])),
          default: B(({ onOkClicked: j }) => [
            L(c("input", {
              class: "form-control form-control-sm",
              "onUpdate:modelValue": M[5] || (M[5] = (V) => T.value = V),
              type: "number",
              onKeyup: Fv(j, ["enter"])
            }, null, 40, W4), [
              [Ve, T.value]
            ])
          ]),
          _: 1
        }, 512)
      ], 64);
    };
  }
}, z4 = /* @__PURE__ */ oe(G4, [["__scopeId", "data-v-630723bc"]]), K4 = {
  components: { MessagesTable: z4 },
  setup() {
    return {};
  }
};
function X4(e, t, n, s, o, i) {
  const r = le("MessagesTable");
  return g(), se(r);
}
const q4 = /* @__PURE__ */ oe(K4, [["render", X4]]), ude = (e) => {
  const t = wn(q4);
  return t.use(Cs), t.mount(e), t;
};
let J4 = Bo();
const ui = Ho(J4, ["pid", "request_id"], { timeout: 0 }), Q4 = async () => {
  const e = {
    params: {
      route: "DataMartController:getSettings"
    }
  };
  return ui.get("", e);
}, Z4 = async (e, t = 0, n = 10) => {
  if (typeof e != "string" && !(e instanceof String)) return;
  const s = {
    params: {
      route: "DataMartController:searchMrns",
      query: e,
      start: t,
      limit: n
    }
  };
  return ui.get("", s);
}, e3 = async (e) => {
  var t = new FormData();
  t.append("files[]", e);
  const n = {
    headers: {
      "Content-Type": "multipart/form-data"
    },
    params: {
      route: "DataMartController:importRevision"
    }
  };
  return ui.post("", t, n);
}, t3 = async (e) => {
  const t = {
    params: {
      route: "DataMartController:deleteRevision"
    },
    data: {
      revision_id: e
    }
  };
  return ui.delete("", t);
}, SS = async (e, t, n = {}) => {
  n = {
    ...n,
    params: {
      route: "DataMartController:runRevision"
    }
  };
  const s = { revision_id: e, mrn: t };
  return ui.post("", s, n);
}, n3 = async (e, t, n = !1) => {
  const s = {
    params: {
      route: "DataMartController:scheduleRevision"
    }
  }, o = { revision_id: e, mrn_list: t, send_feedback: n };
  return ui.post("", o, s);
}, s3 = async (e, t, n, s, o = [], i = null) => {
  const r = {
    params: {
      route: "DataMartController:addRevision",
      request_id: i
    }
  }, a = {
    mrns: o,
    fields: e,
    date_min: t,
    date_max: n,
    date_range_categories: s,
    request_id: i
  };
  return ui.post("", a, r);
}, o3 = async (e) => {
  const t = {
    params: {
      route: "DataMartController:approveRevision"
    }
  }, n = { revision_id: e };
  return ui.post("", n, t);
}, r3 = () => new AbortController(), i3 = () => {
  const e = tu(), t = nu(), n = Wo();
  return qe({
    ready: !1,
    // set to true after first time the settings are loaded
    loading: !1,
    error: null,
    async init() {
      try {
        this.loading = !0, await this.loadSettings(), this.ready = !0;
      } catch (o) {
        this.error = Gs(o);
      } finally {
        this.loading = !1;
      }
    },
    async loadSettings() {
      const o = (d, f) => {
        for (const [p, h] of Object.entries(d))
          p in f && (f[p] = h);
      }, i = await Q4(), { app_settings: r, fhir_metadata: a, revisions: l, user: u } = i.data;
      o(r, t), t.fhirMetadata = a, o(u, e), n.setList(l);
    }
  });
}, a3 = () => qe({
  id: "",
  can_create_revision: !1,
  can_repeat_revision: !1,
  can_use_datamart: !1,
  can_use_mapping_helper: !1,
  has_valid_access_token: !1,
  super_user: !1,
  user_email: "",
  user_firstname: "",
  user_lastname: "",
  username: "",
  get canCreateRevision() {
    return !!this.can_create_revision;
  },
  get canRepeatRevision() {
    return !!this.can_repeat_revision;
  },
  get canUseDatamart() {
    return !!this.can_use_datamart;
  },
  get hasValidAccessToken() {
    return !!this.has_valid_access_token;
  },
  get isSuperUser() {
    return !!this.super_user;
  },
  canRunRevision(e) {
    const { metadata: t } = e;
    if (!t) return !1;
    const {
      approved: n = !1,
      date: s = "",
      executed: o = !1,
      executed_at: i = "",
      id: r = "",
      request_id: a = null,
      request_status: l = null,
      total_fetchable_mrns: u = 0,
      total_non_fetched_mrns: d = 0,
      total_project_mrns: f = 0
    } = t;
    return !(u <= 0 || !n || !this.canRepeatRevision && o);
  }
});
async function* l3(e, t, n, s) {
  var i;
  e.totalMRNs = n.length;
  const o = (i = t == null ? void 0 : t.metadata) == null ? void 0 : i.id;
  for (const r of n) {
    e.currentMRN = r;
    const a = await SS(o, e.currentMRN, {
      signal: s
    }), { data: l } = a;
    yield { data: l, mrn: e.currentMRN };
  }
}
async function* c3(e, t, n) {
  var o, i, r;
  if (e.totalMRNs = ((o = t == null ? void 0 : t.metadata) == null ? void 0 : o.total_fetchable_mrns) ?? 0, e.totalMRNs < 1) return;
  const s = (i = t == null ? void 0 : t.metadata) == null ? void 0 : i.id;
  do {
    const a = await SS(s, e.currentMRN, {
      signal: n
    }), { data: l } = a;
    yield { data: l, mrn: e.currentMRN }, e.currentMRN = (r = l == null ? void 0 : l.metadata) == null ? void 0 : r.next_mrn;
  } while (e.currentMRN);
}
const Qy = () => ({
  processing: !1,
  abortController: null,
  aborted: !1,
  currentMRN: null,
  totalMRNs: 0,
  success: [],
  // successfully processed MRNs
  errors: {},
  // errors accumulator (MRN => errors)
  results: [],
  // response accumulator
  stats: {}
  // stats accumulator (category => total)
}), u3 = () => qe({
  ...Qy(),
  processing: !1,
  get totalProcessed() {
    return this.results.length;
  },
  reset() {
    const e = Qy();
    for (const [t, n] of Object.entries(e))
      this[t] = n;
  },
  async run(e, t = []) {
    try {
      this.reset(), this.processing = !0, this.abortController = r3();
      const n = this.abortController.signal, s = (t == null ? void 0 : t.length) > 0 ? l3(this, e, t, n) : c3(this, e, n);
      for await (const { data: o, mrn: i } of s) {
        if (this.aborted) break;
        this.processResponse(i, o);
      }
    } catch (n) {
      return console.log(n), n;
    } finally {
      this.processing = !1;
    }
  },
  stop() {
    this.aborted = !0, this.abortController && this.abortController.abort();
  },
  async schedule(e, t = [], n = !1) {
    var o;
    const s = (o = e == null ? void 0 : e.metadata) == null ? void 0 : o.id;
    return n3(s, t, n);
  },
  /**
   * the first iteration of the datamart does not have an MRN
   * only process the response if we have an associated MRN
   */
  processResponse(e, t) {
    var o;
    if (!e) return;
    this.results.push(t);
    const n = ((o = t == null ? void 0 : t.metadata) == null ? void 0 : o.stats) ?? {};
    for (const [i, r] of Object.entries(n))
      i in this.stats || (this.stats[i] = 0), this.stats[i] += r;
    const s = (t == null ? void 0 : t.errors) ?? [];
    s.length > 0 ? this.errors[e] = s : this.success.push(this.currentMRN);
  }
}), d3 = () => qe({
  ehr_system_name: "",
  lang: {},
  mapping_helper_url: "",
  project_id: 0,
  // standalone_authentication_flow: '',
  // standalone_launch_enabled: true,
  standalone_launch_url: "",
  user: {
    id: "",
    username: "",
    user_email: "",
    user_firstname: ""
  },
  date_range_categories: [],
  fhirMetadata: {}
}), f3 = () => qe({
  list: [],
  selected: null,
  edited: null,
  get active() {
    return this.list.length === 0 ? null : this.list[0];
  },
  get approved() {
    return this.selected ? this.isApproved(this.selected) : !1;
  },
  setList(e) {
    const t = [...e].reverse();
    this.list = [...t], this.selected = this.list[0] ?? null;
  },
  getIndex(e) {
    var s;
    const t = this.list.indexOf(e);
    return (((s = this.list) == null ? void 0 : s.length) ?? 0) - t;
  },
  isApproved(e) {
    const t = e == null ? void 0 : e.metadata;
    return t == null || t.request_id, !!(t == null ? void 0 : t.approved);
  }
});
let An = class {
  constructor(t = {}) {
    Qe(this, "name");
    Qe(this, "parent", null);
    Qe(this, "metadata");
    Qe(this, "selected", !1);
    this.name = t == null ? void 0 : t.field, this.metadata = t;
  }
  setParent(t) {
    this.parent = t;
  }
};
function* Pm(e, t) {
  if (typeof t != "function") return;
  const n = t(e);
  for (const s of n)
    yield s, s instanceof Ki && (yield* Pm(s, t));
}
let Ki = class Ps {
  constructor(t = "") {
    Qe(this, "name");
    Qe(this, "parent", null);
    Qe(this, "children", []);
    Qe(this, "query", "");
    Qe(this, "_filtered", /* @__PURE__ */ new Set());
    Qe(this, "_nodes", /* @__PURE__ */ new Set());
    // keep track of any node
    Qe(this, "_containers", /* @__PURE__ */ new Set());
    // keep track of any container
    Qe(this, "applyDateRange", !1);
    this.name = t;
  }
  get filtered() {
    return this.query === "" ? this.children : Array.from(this._filtered);
  }
  get totalFiltered() {
    let t = 0;
    for (const n of this.filtered)
      n instanceof An ? t++ : t += n.totalFiltered;
    return t;
  }
  get totalFilteredSelected() {
    let t = 0;
    for (const n of this.filtered)
      n instanceof An && n.selected ? t++ : n instanceof Ps && (t += n.totalFilteredSelected);
    return t;
  }
  get total() {
    let t = 0;
    for (const n of this.children)
      n instanceof An ? t++ : t += n.total;
    return t;
  }
  get totalSelected() {
    let t = 0;
    for (const n of this.children)
      n instanceof An && n.selected ? t++ : n instanceof Ps && (t += n.totalSelected);
    return t;
  }
  get nodes() {
    return Array.from(this._nodes);
  }
  get containers() {
    return Array.from(this._containers);
  }
  get filteredNodes() {
    let t = [];
    for (const n of this.filtered)
      n instanceof An ? t.push(n) : n instanceof Ps && (t = [...t, ...n.nodes]);
    return t;
  }
  get selectedNodes() {
    let t = [];
    const n = Pm(this, (s) => s.children);
    for (const s of n)
      s instanceof An && s.selected && t.push(s);
    return t;
  }
  get filteredSelectedNodes() {
    let t = [];
    const n = Pm(this, (s) => s.children);
    for (const s of n)
      s instanceof An && s.selected && t.push(s);
    return t;
  }
  filter(t) {
    this.query = t;
    const n = new RegExp(t, "ig");
    let s = [];
    for (const o of this.children)
      if (o instanceof An) {
        const i = /* @__PURE__ */ new Set([
          o.name,
          o.metadata.label,
          o.metadata.description
        ]);
        let r = !1;
        for (const a of Array.from(i))
          if (!(typeof a != "string" && !(a instanceof String)) && a.match(n) !== null) {
            r = !0;
            break;
          }
        if (!r) continue;
        s.push(o);
      } else o instanceof Ps && (o.filter(t), o.totalFiltered > 0 && s.push(o));
    this._filtered = /* @__PURE__ */ new Set([...s]);
  }
  /**
   * insert an object respecting some rules for proper position
   * @param {Array} array
   * @param {Node|Container} newItem
   * @returns {Array}
   */
  insertItem(t, n) {
    let s = 0;
    for (; s < t.length; ) {
      const o = t[s];
      if (n instanceof An && o instanceof Ps)
        break;
      if (n instanceof Ps && o instanceof An) {
        s++;
        continue;
      }
      if (n.name < o.name)
        break;
      s++;
    }
    return t.splice(s, 0, n), t;
  }
  /**
   * add a Node|Container to the children
   * @param {Node|Container} node
   */
  addNode(t) {
    t.setParent(this), this.addReferences(t);
    const n = this.insertItem([...this.children], t);
    this.children = n;
  }
  // add a reference to the node in the current instance and its parent container
  addReferences(t) {
    t instanceof An ? this._nodes.add(t) : t instanceof Ps && this._containers.add(t), this.parent && this.parent.addReferences(t);
  }
  getNode(t) {
    return this.children.find((s) => s.name === t);
  }
  getContainer(t) {
    return this.children.find(
      (s) => s instanceof Ps && s.name === t
    );
  }
  setParent(t) {
    this.parent = t;
  }
  contains(t) {
    let n = !1;
    for (const s of this.children) {
      if (s instanceof An && s.name === t)
        return n = !0, n;
      s instanceof Ps && (n = s.contains(t));
    }
    return n;
  }
  static fromList(t = [], n = {}, s = [], o = []) {
    const i = (a, l) => {
      let u = a.getContainer(l);
      return u || (u = new Ps(l), u.applyDateRange = o.includes(l), a.addNode(u), u);
    }, r = new Ps();
    for (const a of t) {
      const l = n[a];
      if (!l) continue;
      let u = r, { category: d = "", subcategory: f = "" } = l;
      d = d.trim(), f = f.trim(), d != "" && (u = i(
        u,
        d
      )), f != "" && (u = i(
        u,
        f
      ));
      const p = new An({ ...l });
      p.selected = s.includes(p.name), u.addNode(p);
    }
    return r;
  }
};
const Jd = "YYYY-MM-DD", p3 = (e, t, n) => {
  const s = Object.keys(e);
  return s ? Object.keys(e).length === 0 ? [] : (t.includes("id") || t.unshift("id"), Ki.fromList(
    s,
    e,
    t,
    n
  )) : [];
};
function h3(e) {
  return [
    ...new Set(e.filter((t, n) => e.indexOf(t) !== n))
  ];
}
const ph = (e, t) => {
  const n = (s) => JSON.stringify(s.sort());
  return !Array.isArray(e) || !Array.isArray(t) ? !1 : n(e) === n(t);
}, m3 = () => {
  const e = nu(), t = qe({
    current: null,
    // reference to the current revision
    dateMin: "",
    dateMax: "",
    mrns: [],
    date_range_categories: [],
    node: null,
    setRevision(n) {
      const s = (n == null ? void 0 : n.fields) ?? [], o = me((n == null ? void 0 : n.dateMin) ?? null), i = me((n == null ? void 0 : n.dateMax) ?? null), r = o.isValid() ? o.format(Jd) : "", a = i.isValid() ? i.format(Jd) : "", l = Array.isArray(
        n == null ? void 0 : n.date_range_categories
      ) ? n.date_range_categories : [], u = (n == null ? void 0 : n.mrns) ?? [];
      this.current = {
        fields: s,
        dateMin: r,
        dateMax: a,
        mrns: u,
        date_range_categories: l
      };
    },
    get new() {
      var s, o, i, r, a, l, u;
      return {
        mrns: this.mrns,
        dateMin: this.dateMin,
        dateMax: this.dateMax,
        fields: (i = (o = (s = this.node) == null ? void 0 : s.nodes) == null ? void 0 : o.filter((d) => d.selected)) == null ? void 0 : i.map((d) => d.name),
        date_range_categories: (u = (l = (a = (r = this.node) == null ? void 0 : r.containers) == null ? void 0 : a.filter((d) => d.applyDateRange)) == null ? void 0 : l.filter((d) => d.totalSelected > 0)) == null ? void 0 : u.map((d) => d.name)
      };
    },
    get isUpdated() {
      const n = this.current, s = this.new, o = (n == null ? void 0 : n.fields) ?? [], i = (s == null ? void 0 : s.fields) ?? [], r = (s == null ? void 0 : s.mrns) ?? [], a = (s == null ? void 0 : s.mrns) ?? [];
      if (!ph(o, i) || !ph(r, a) || n.dateMin !== s.dateMin || n.dateMax !== s.dateMax) return !0;
      const l = n.date_range_categories ?? [], u = s.date_range_categories ?? [];
      return !ph(
        l,
        u
      );
    },
    async submit() {
      try {
        const {
          dateMin: n,
          dateMax: s,
          fields: o,
          date_range_categories: i,
          mrns: r
        } = this.new;
        return await s3(
          o,
          n,
          s,
          i,
          r
        );
      } catch (n) {
        let s = "There was an error submitting the request";
        throw s += Gs(n), console.log(n, s), Error(s);
      }
    },
    validationErrors: [],
    validate() {
      var o, i;
      this.validationErrors = [];
      const n = this.new;
      (o = n == null ? void 0 : n.fields) != null && o.includes("id") || this.validationErrors.push(
        "the 'id' field must be included in every revision"
      ), ((i = n == null ? void 0 : n.fields) == null ? void 0 : i.length) < 2 && this.validationErrors.push(
        "please select at least 1 field beside 'id'"
      );
      const s = h3(n.mrns);
      return (s == null ? void 0 : s.length) > 0 && this.validationErrors.push(
        `duplicate MRNs found: ${s.join(", ")}`
      ), this.validationErrors;
    },
    get isValid() {
      var n;
      return ((n = this.validationErrors) == null ? void 0 : n.length) === 0;
    }
  });
  return Ft(() => {
    const n = t == null ? void 0 : t.current, s = (n == null ? void 0 : n.fields) || [], o = (n == null ? void 0 : n.date_range_categories) || [], i = e == null ? void 0 : e.fhirMetadata;
    t.node = p3(i, s, o), t.dateMin = n == null ? void 0 : n.dateMin, t.dateMax = n == null ? void 0 : n.dateMax;
  }), t;
}, vl = Ns("app", i3), tu = Ns("user", a3), mg = Ns("process", u3), nu = Ns("settings", d3), Wo = Ns("revisions", f3), su = Ns("revisionEditor", m3), v3 = () => {
  const e = vl(), t = tu(), n = mg(), s = nu(), o = Wo(), i = su();
  return {
    app: e,
    user: t,
    process: n,
    settings: s,
    revisions: o,
    revisionEditor: i
  };
}, g3 = {
  key: 0,
  class: "alert alert-danger"
}, _3 = {
  key: 2,
  class: "alert alert-info my-2"
}, y3 = {
  __name: "App",
  setup(e) {
    const t = vl(), n = I(), s = k(() => t == null ? void 0 : t.ready), o = k(() => t == null ? void 0 : t.loading), i = k(() => t == null ? void 0 : t.error);
    return vt(() => {
      t.init();
    }), (r, a) => {
      const l = le("router-view"), u = le("b-modal");
      return g(), E(G, null, [
        i.value ? (g(), E("div", g3, [
          c("span", null, F(i.value), 1)
        ])) : ne("", !0),
        s.value ? (g(), se(l, { key: 1 })) : ne("", !0),
        o.value ? (g(), E("div", _3, a[0] || (a[0] = [
          c("i", { class: "fas fa-spinner fa-spin fa-fw me-1" }, null, -1),
          c("span", null, "Loading...", -1)
        ]))) : ne("", !0),
        D(u, {
          ref_key: "loadingModalRef",
          ref: n,
          title: "Loading"
        }, {
          footer: B(() => a[1] || (a[1] = [])),
          default: B(() => [
            a[2] || (a[2] = c("i", { class: "fas fa-spinner fa-spin fa-fw me-1" }, null, -1)),
            a[3] || (a[3] = c("span", null, "Please wait...", -1))
          ]),
          _: 1
        }, 512)
      ], 64);
    };
  }
}, b3 = {};
function E3(e, t) {
  const n = le("router-view");
  return g(), E("div", null, [
    D(n)
  ]);
}
const w3 = /* @__PURE__ */ oe(b3, [["render", E3]]), S3 = { class: "d-block fw-bold" };
class $u {
  constructor(t, n) {
    Qe(this, "title", "");
    Qe(this, "description", "");
    this.title = t, this.description = n;
  }
}
const x3 = {
  __name: "RevisionWarning",
  props: {
    revision: { type: Object }
  },
  setup(e) {
    const t = Wo(), n = tu(), s = e, { revision: o } = he(s), i = k(
      () => {
        var l, u;
        return ((u = (l = o.value) == null ? void 0 : l.metadata) == null ? void 0 : u.total_fetchable_mrns) ?? 0;
      }
    ), r = k(() => t.active), a = k(() => {
      var d;
      const l = o.value, u = [];
      if (((d = l == null ? void 0 : l.metadata) == null ? void 0 : d.approved) !== !0) {
        let f = new $u(
          "This revision was not approved",
          "An administrator must approve this revision before it can be run."
        );
        u.push(f);
      }
      if (l === r.value && !(n != null && n.can_repeat_revision) && (l != null && l.metadata.executed)) {
        let f = new $u(
          "This revision was already run",
          "You are allowed to run a revision only once."
        );
        u.push(f);
      }
      if (l !== r.value) {
        let f = new $u(
          "This is not the active revision",
          "Only the most recent revision can be run."
        );
        u.push(f);
      }
      if (i.value < 1) {
        let f = new $u(
          "No fetchable records in the project",
          "You can only run a revision if you have at least 1 fetchable record in your project."
        );
        u.push(f);
      }
      return u;
    });
    return (l, u) => (g(!0), E(G, null, ge(a.value, (d, f) => (g(), E("div", {
      key: f,
      class: "alert alert-warning mt-2"
    }, [
      c("span", S3, [
        c("span", null, F(d.title), 1)
      ]),
      c("span", null, F(d.description), 1)
    ]))), 128));
  }
}, N3 = ["disabled"], C3 = {
  __name: "RequestChangeButton",
  props: {
    revision: { type: Object, default: null }
  },
  setup(e) {
    const t = Wo(), n = ds(), s = e, o = k(() => s.revision);
    function i() {
      t.edited = o.value.data, n.push({ name: "request-change" });
    }
    return (r, a) => (g(), E("div", null, [
      c("button", {
        class: "btn btn-sm btn-primary",
        onClick: i,
        disabled: !o.value
      }, a[0] || (a[0] = [
        c("i", { class: "fas fa-file-pen fa-fw me-1" }, null, -1),
        c("span", null, "Request a configuration change", -1)
      ]), 8, N3)
    ]));
  }
}, O3 = {
  __name: "DeleteRevisionButton",
  props: {
    revision: { type: Object, default: () => ({}) }
  },
  setup(e) {
    const t = vl(), n = an(), s = e, o = I();
    async function i() {
      var a, l;
      if (await o.value.show())
        try {
          const u = (l = (a = s == null ? void 0 : s.revision) == null ? void 0 : a.metadata) == null ? void 0 : l.id, d = await t3(u);
          n.toast({
            title: "Success",
            body: "the revision was deleted successfully"
          });
        } catch {
          n.toast({
            title: "Success",
            body: "there was an error deleting the revision - ".error
          });
        } finally {
          t.init();
        }
    }
    return (r, a) => {
      const l = le("b-modal");
      return g(), E(G, null, [
        c("button", {
          class: "btn btn-sm btn-danger",
          onClick: i
        }, a[0] || (a[0] = [
          c("i", { class: "fas fa-trash fa-fw" }, null, -1),
          c("span", null, "Delete revision", -1)
        ])),
        D(l, {
          ref_key: "dialogRef",
          ref: o
        }, {
          header: B(() => a[1] || (a[1] = [
            te("Confirm delete")
          ])),
          default: B(() => [
            a[2] || (a[2] = c("span", null, "Are you sure you want to delete this item?", -1))
          ]),
          _: 1
        }, 512)
      ], 64);
    };
  }
}, T3 = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw me-1"
}, $3 = {
  key: 1,
  class: "fas fa-circle-check fa-fw me-1"
}, k3 = {
  __name: "ApproveRevisionButton",
  props: {
    revision: { type: Object, default: null }
  },
  setup(e) {
    const t = vl(), n = e, s = an(), o = I(!1), i = k(() => n.revision);
    async function r() {
      var l, u;
      const a = (u = (l = i.value) == null ? void 0 : l.metadata) == null ? void 0 : u.id;
      if (a)
        try {
          o.value = !0;
          const d = await o3(a);
          s.toast({ title: "success", body: "the revision was approved" }), await t.init();
        } catch {
          s.toast({
            title: "error",
            body: "the revision was not approved - ".error
          });
        } finally {
          o.value = !1;
        }
    }
    return (a, l) => (g(), E("div", null, [
      c("button", {
        class: "btn btn-sm btn-success",
        onClick: r
      }, [
        o.value ? (g(), E("i", T3)) : (g(), E("i", $3)),
        l[0] || (l[0] = c("span", null, "Approve", -1))
      ])
    ]));
  }
}, xS = {
  __name: "DisabledReasonButton",
  props: {
    node: { type: An, default: null }
  },
  setup(e) {
    const t = fs(), n = e;
    function s() {
      var a;
      const o = n.node;
      if (!o) return;
      const i = ((a = o == null ? void 0 : o.metadata) == null ? void 0 : a.disabled_reason) ?? "disabled";
      t.alert({ title: "Mapping disabled", body: i });
    }
    return (o, i) => (g(), E("button", {
      type: "button",
      class: "ms-2 btn btn-sm text-warning",
      onClick: s
    }, i[0] || (i[0] = [
      c("i", { class: "fas fa-question-circle fa-fw" }, null, -1)
    ])));
  }
}, D3 = ["data-disabled"], R3 = { class: "node-name fw-bold border-end pe-2 me-2" }, I3 = { class: "node-label" }, A3 = {
  key: 0,
  class: "ms-2 text-muted d-block"
}, M3 = { class: "w-100" }, P3 = {
  key: 0,
  class: "text-muted"
}, L3 = {
  __name: "MetadataNode",
  props: {
    node: { type: [Ki, An], default: null }
  },
  setup(e) {
    const t = e, { node: n } = he(t), s = I(!1);
    Ft(() => {
      var l;
      ((l = n.value) == null ? void 0 : l.parent) === null && (s.value = !0);
    });
    function o(l) {
      return l instanceof An;
    }
    function i(l) {
      return l instanceof Ki;
    }
    function r() {
      var l;
      ((l = n.value) == null ? void 0 : l.parent) !== null && (s.value = !s.value);
    }
    function a(l) {
      var u, d, f, p;
      return ((d = (u = l == null ? void 0 : l.metadata) == null ? void 0 : u.description) == null ? void 0 : d.toUpperCase()) !== ((p = (f = l == null ? void 0 : l.metadata) == null ? void 0 : f.label) == null ? void 0 : p.toUpperCase());
    }
    return (l, u) => {
      var d, f, p, h, m, v, _, b, w, y;
      return o(C(n)) ? (g(), E("div", {
        key: 0,
        class: "node",
        "data-disabled": (f = (d = C(n)) == null ? void 0 : d.metadata) == null ? void 0 : f.disabled
      }, [
        c("span", R3, F((h = (p = C(n)) == null ? void 0 : p.metadata) == null ? void 0 : h.field), 1),
        c("span", I3, F((v = (m = C(n)) == null ? void 0 : m.metadata) == null ? void 0 : v.label), 1),
        a(C(n)) ? (g(), E("small", A3, F((b = (_ = C(n)) == null ? void 0 : _.metadata) == null ? void 0 : b.description), 1)) : ne("", !0),
        (y = (w = C(n)) == null ? void 0 : w.metadata) != null && y.disabled ? (g(), se(xS, {
          key: 1,
          node: C(n)
        }, null, 8, ["node"])) : ne("", !0)
      ], 8, D3)) : i(C(n)) ? (g(), E("div", {
        key: 1,
        class: Se(["node-container d-flex p-2", { "border rounded": C(n).parent !== null }])
      }, [
        C(n).parent !== null ? (g(), E("div", {
          key: 0,
          onClick: Rt(r, ["stop"])
        }, [
          c("i", {
            class: Se(["node-open-status fas fa-circle-chevron-right fa-fw", { "fa-rotate-90": s.value }])
          }, null, 2)
        ])) : ne("", !0),
        c("div", M3, [
          c("div", null, [
            c("span", {
              class: "container-name d-block fw-bold",
              onClick: Rt(r, ["stop"])
            }, F(C(n).name), 1),
            C(n).parent !== null ? (g(), E("small", P3, F(`${C(n).total} field${C(n).total === 1 ? "" : "s"} `), 1)) : ne("", !0)
          ]),
          s.value ? (g(!0), E(G, { key: 0 }, ge(C(n).children, (x, N) => (g(), se(NS, {
            key: `${N} ${x == null ? void 0 : x.name}`,
            node: x
          }, {
            "container-end": B(({ node: S }) => [
              fe(l.$slots, "container-end", { node: S }, void 0, !0)
            ]),
            _: 2
          }, 1032, ["node"]))), 128)) : ne("", !0)
        ]),
        fe(l.$slots, "container-end", { node: C(n) }, void 0, !0)
      ], 2)) : ne("", !0);
    };
  }
}, NS = /* @__PURE__ */ oe(L3, [["__scopeId", "data-v-b9bc106c"]]), V3 = { key: 0 }, F3 = ["href"], U3 = { key: 0 }, j3 = {
  __name: "RevisionMetadata",
  props: {
    revision: { type: Object }
  },
  setup(e) {
    const t = e, { revision: n } = he(t), s = k(() => {
      var a, l;
      return (l = (a = n.value) == null ? void 0 : a.metadata) == null ? void 0 : l.creator;
    }), o = k(
      () => {
        var a, l;
        return !!((l = (a = n.value) == null ? void 0 : a.metadata) != null && l.executed);
      }
    ), i = k(() => {
      var l, u;
      const a = me((u = (l = n.value) == null ? void 0 : l.metadata) == null ? void 0 : u.executed_at);
      return a.isValid ? a.format("YYYY-MM-DD hh:mm:ss") : !1;
    }), r = k(() => {
      var l, u;
      const a = (u = (l = n.value) == null ? void 0 : l.metadata) == null ? void 0 : u.date;
      return a ? me(a).fromNow() : "";
    });
    return (a, l) => (g(), E("div", kt(Dt(a.$attrs)), [
      s.value ? (g(), E("div", V3, [
        l[0] || (l[0] = c("span", { class: "fw-bold" }, " Created by: ", -1)),
        c("a", {
          href: `mailto:${s.value.user_email}`
        }, F(`${s.value.user_firstname} ${s.value.user_lastname}`), 9, F3)
      ])) : ne("", !0),
      c("div", null, [
        l[1] || (l[1] = c("span", { class: "fw-bold" }, "Creation date: ", -1)),
        c("span", null, F(r.value), 1)
      ]),
      c("div", null, [
        l[2] || (l[2] = c("span", { class: "fw-bold" }, "Last executed: ", -1)),
        o.value && i.value ? (g(), E("span", U3, F(i.value), 1)) : (g(), E(G, { key: 1 }, [
          te(" never")
        ], 64))
      ])
    ], 16));
  }
}, B3 = { class: "card mt-2" }, H3 = { class: "card-header d-flex" }, Y3 = { key: 1 }, W3 = { class: "card-body" }, G3 = {
  key: 0,
  class: "text-nowrap"
}, z3 = { class: "card-footer d-flex justify-content-end gap-2" }, K3 = {
  __name: "RevisionDetails",
  props: {
    revision: { type: Object }
  },
  setup(e) {
    const t = nu(), n = e, { revision: s } = he(n), o = k(() => t == null ? void 0 : t.fhirMetadata), i = k(() => {
      var f, p;
      const u = { min: null, max: null }, d = s.value;
      if (d) {
        let h = "MM-DD-YYYY", m = me((f = d == null ? void 0 : d.data) == null ? void 0 : f.dateMin), v = me((p = d == null ? void 0 : d.data) == null ? void 0 : p.dateMax);
        m.isValid() && (u.min = m.format(h)), v.isValid() && (u.max = v.format(h));
      }
      return u;
    }), r = k(() => {
      const { min: u, max: d } = i.value;
      if (!u && !d) return "no date range specified (get all available data)";
      let f = "";
      return f += `from ${u || "----"}`, f += ` to ${d || "----"}`, f;
    }), a = k(() => {
      var d, f;
      const u = (f = (d = s.value) == null ? void 0 : d.data) == null ? void 0 : f.fields;
      if (u && Object.keys(o.value).length !== 0)
        return Ki.fromList(u, o.value);
    });
    function l(u) {
      var m;
      const { min: d, max: f } = i.value;
      if (!d && !f) return !1;
      const p = s.value, h = ((m = p == null ? void 0 : p.data) == null ? void 0 : m.date_range_categories) ?? [];
      return Array.isArray(h) ? h.includes(u) : !1;
    }
    return (u, d) => (g(), E("div", null, [
      c("div", B3, [
        c("section", H3, [
          C(s) ? (g(), se(j3, {
            key: 0,
            class: "fs-6",
            revision: C(s)
          }, null, 8, ["revision"])) : (g(), E("span", Y3, "No revision selected"))
        ]),
        c("section", W3, [
          fe(u.$slots, "body-start", {}, void 0, !0),
          c("div", null, [
            d[0] || (d[0] = c("span", { class: "fw-bold" }, "Date range: ", -1)),
            c("span", null, F(r.value), 1)
          ]),
          d[2] || (d[2] = c("span", { class: "fw-bold" }, "Fields in EHR for which to pull data:", -1)),
          D(NS, {
            node: a.value,
            class: "revision-fields border rounded"
          }, {
            "container-end": B(({ node: f }) => [
              l(f.name) ? (g(), E("div", G3, d[1] || (d[1] = [
                c("i", { class: "fas fa-clock fa-fw" }, null, -1),
                c("span", null, "date range is applied", -1)
              ]))) : ne("", !0)
            ]),
            _: 1
          }, 8, ["node"]),
          fe(u.$slots, "body-end", {}, void 0, !0)
        ]),
        c("section", z3, [
          fe(u.$slots, "footer", {}, void 0, !0)
        ])
      ])
    ]));
  }
}, CS = /* @__PURE__ */ oe(K3, [["__scopeId", "data-v-0e138eec"]]), X3 = {
  __name: "SelectedRevisionDetails",
  setup(e) {
    const t = Wo(), n = tu(), s = k(() => t == null ? void 0 : t.selected);
    return (o, i) => (g(), se(CS, { revision: s.value }, {
      "body-start": B(() => [
        D(x3, { revision: s.value }, null, 8, ["revision"])
      ]),
      footer: B(() => [
        s.value && C(n).isSuperUser ? (g(), se(O3, {
          key: 0,
          revision: s.value
        }, null, 8, ["revision"])) : ne("", !0),
        C(t).isApproved(s.value) && (C(n).isSuperUser || C(n).can_create_revision) ? (g(), se(C3, {
          key: 1,
          revision: s.value
        }, null, 8, ["revision"])) : s.value && !C(t).isApproved(s.value) && C(n).isSuperUser ? (g(), se(k3, {
          key: 2,
          revision: s.value
        }, null, 8, ["revision"])) : ne("", !0)
      ]),
      _: 1
    }, 8, ["revision"]));
  }
}, q3 = /* @__PURE__ */ oe(X3, [["__scopeId", "data-v-a917cb4d"]]), J3 = { class: "progress-stacked" }, Q3 = ["aria-valuenow"], Z3 = { class: "progress-bar progress-bar-animated text-bg-primary" }, e8 = ["aria-valuenow"], t8 = { class: "progress-bar progress-bar-animated text-bg-warning" }, n8 = ["aria-valuenow"], s8 = { class: "progress-bar progress-bar-animated text-bg-danger" }, o8 = {
  __name: "ProcessBar",
  props: {
    total: { type: Number, default: 0 },
    success: { type: Number, default: 0 },
    warnings: { type: Number, default: 0 },
    errors: { type: Number, default: 0 },
    text: { type: String, default: "" }
  },
  setup(e) {
    const t = e, { total: n, success: s, warnings: o, errors: i } = he(t), r = k(() => n.value === 0 ? 0 : s.value / n.value * 100), a = k(() => n.value === 0 ? 0 : o.value / n.value * 100), l = k(() => n.value === 0 ? 0 : i.value / n.value * 100);
    return (u, d) => (g(), E("div", J3, [
      c("div", {
        class: "progress",
        role: "progressbar",
        "aria-valuenow": r.value,
        "aria-valuemin": "0",
        "aria-valuemax": "100",
        style: Jn(`width: ${r.value}%`)
      }, [
        c("div", Z3, F(C(s)), 1)
      ], 12, Q3),
      c("div", {
        class: "progress",
        role: "progressbar",
        "aria-valuenow": a.value,
        "aria-valuemin": "0",
        "aria-valuemax": "100",
        style: Jn(`width: ${a.value}%`)
      }, [
        c("div", t8, F(C(o)), 1)
      ], 12, e8),
      c("div", {
        class: "progress",
        role: "progressbar",
        "aria-valuenow": l.value,
        "aria-valuemin": "0",
        "aria-valuemax": "100",
        style: Jn(`width: ${l.value}%`)
      }, [
        c("div", s8, F(C(i)), 1)
      ], 12, n8)
    ]));
  }
}, r8 = /* @__PURE__ */ oe(o8, [["__scopeId", "data-v-4bf72be2"]]), OS = (e) => (n, s, o = 300) => new Promise((r) => {
  let a = null;
  function l(u) {
    a || (a = u);
    const d = u - a, f = Math.min(d / o, 1), p = (s - n) * f, h = n + p;
    if (e(h, {
      startTime: a,
      timestamp: u,
      progress: d,
      percentage: f
    }), f < 1) {
      requestAnimationFrame(l);
      return;
    }
    r(!0);
  }
  requestAnimationFrame(l);
}), TS = (e = [], { perPageOptions: t = null, limit: n = null, page: s = 1 }) => (t = t ?? [25, 50, 100, 250], {
  page: s ?? 1,
  limit: n ?? (t == null ? void 0 : t[0]) ?? 10,
  perPageOptions: [...t],
  get total() {
    return this.allItems.length ?? 0;
  },
  get totalPages() {
    var o;
    return this.limit === 0 ? 0 : Math.ceil(((o = this.allItems) == null ? void 0 : o.length) / this.limit);
  },
  get allItems() {
    return Array.isArray(e) ? [...e] : typeof e == "function" ? e() : [];
  },
  get items() {
    return this.allItems.slice(this.start, this.end);
  },
  get start() {
    const o = parseInt(this.page), i = parseInt(this.limit);
    return (o - 1) * i;
  },
  get end() {
    return this.limit * this.page;
  }
}), gl = () => {
  var s;
  const e = (o) => {
    const i = document.createElement("textarea");
    i.value = o, document.body.appendChild(i), i.select();
    try {
      return document.execCommand("copy"), !0;
    } finally {
      document.body.removeChild(i);
    }
  }, t = (o) => navigator.clipboard.writeText(o);
  let n = (s = navigator == null ? void 0 : navigator.clipboard) != null && s.writeText ? t : e;
  return {
    copy: (o) => new Promise((r, a) => {
      try {
        const l = n(o);
        l instanceof Promise ? l.then(() => {
          console.log(
            "Text copied to clipboard ✌🏼:",
            o
          ), r(o);
        }).catch((u) => {
          console.error("Failed to copy text:", u), a(u);
        }) : l === !0 && (console.log("Text copied to clipboard ✌🏼:", o), r(o));
      } catch (l) {
        console.error("Failed to copy text:", l), a(l);
      }
    })
  };
}, i8 = {
  __name: "AnimatedCounter",
  props: {
    value: { type: Number, default: 0 },
    duration: { type: Number, default: 300 }
    //milliseconds
  },
  setup(e) {
    const t = e, n = I(!1), s = I(0), o = I(""), i = OS((r) => {
      o.value = r;
    });
    return Ft(async () => {
      const r = s.value, a = t.value;
      s.value = a, n.value = !0, await i(r, a, t.duration), n.value = !1;
    }), (r, a) => fe(r.$slots, "default", {
      animating: n.value,
      text: o.value
    }, () => [
      c("span", {
        class: Se({ animating: n.value })
      }, F(o.value), 3)
    ]);
  }
}, a8 = { class: "table table-striped table-hover table-bordered table-sm" }, l8 = { class: "text-end" }, c8 = { key: 0 }, u8 = {
  __name: "StatsTable",
  props: {
    stats: { type: Object, default: () => ({}) }
  },
  setup(e) {
    const t = e, { stats: n } = he(t), s = k(() => Object.keys(n.value).length === 0);
    return (o, i) => (g(), E("table", a8, [
      i[1] || (i[1] = c("thead", null, [
        c("tr", null, [
          c("th", null, "Category"),
          c("th", { class: "text-end" }, "Total")
        ])
      ], -1)),
      c("tbody", null, [
        (g(!0), E(G, null, ge(C(n), (r, a) => (g(), E("tr", {
          key: `stat-${a}`
        }, [
          c("td", null, F(a), 1),
          c("td", l8, [
            D(i8, { value: r }, {
              default: B(({ animating: l, text: u }) => [
                c("span", {
                  class: Se(["counter", { animating: l }])
                }, F(parseInt(u)), 3)
              ]),
              _: 2
            }, 1032, ["value"])
          ])
        ]))), 128)),
        s.value ? (g(), E("tr", c8, i[0] || (i[0] = [
          c("td", {
            colspan: "2",
            class: "fst-italic"
          }, "No updates", -1)
        ]))) : ne("", !0)
      ])
    ]));
  }
}, d8 = /* @__PURE__ */ oe(u8, [["__scopeId", "data-v-68605e0a"]]), f8 = { class: "my-2 table table-hover table-striped table-bordered" }, p8 = { key: 0 }, h8 = {
  __name: "ErrorsTable",
  props: {
    errors: { type: Array, default: () => [] }
  },
  setup(e) {
    const t = e, n = I(1), s = I(10), o = k(() => {
      const r = (n.value - 1) * s.value, a = r + s.value;
      return t.errors.slice(r, a);
    }), i = k(() => {
      var r;
      return ((r = t.errors) == null ? void 0 : r.length) === 0;
    });
    return (r, a) => {
      const l = le("b-pagination");
      return g(), E(G, null, [
        c("table", f8, [
          a[2] || (a[2] = c("thead", null, [
            c("tr", null, [
              c("th", null, "MRN"),
              c("th", null, "Error")
            ])
          ], -1)),
          c("tbody", null, [
            (g(!0), E(G, null, ge(o.value, (u, d) => (g(), E("tr", {
              key: `${u.mrn}-error-${d}`
            }, [
              c("td", null, F(u.mrn), 1),
              c("td", null, F(u.error.message), 1)
            ]))), 128)),
            i.value ? (g(), E("tr", p8, a[1] || (a[1] = [
              c("td", {
                colspan: "2",
                class: "fst-italic"
              }, "No errors", -1)
            ]))) : ne("", !0)
          ])
        ]),
        D(l, {
          modelValue: n.value,
          "onUpdate:modelValue": a[0] || (a[0] = (u) => n.value = u),
          totalItems: e.errors.length,
          perPage: s.value,
          size: "sm"
        }, null, 8, ["modelValue", "totalItems", "perPage"])
      ], 64);
    };
  }
};
class m8 {
  constructor(t) {
    Qe(this, "startTime", null);
    Qe(this, "active", !1);
    Qe(this, "elapsed", 0);
    Qe(this, "callback", null);
    this.setCallback(t);
  }
  setCallback(t) {
    this.callback = t;
  }
  start() {
    this.active = !0, requestAnimationFrame(this.update.bind(this));
  }
  reset() {
    this.startTime = null, this.elapsed = 0;
  }
  update(t) {
    this.active != !1 && (this.startTime === null && (this.startTime = t), this.elapsed = t - this.startTime, typeof this.callback == "function" && this.callback(this.elapsed, this, { startTime: this.startTime }), requestAnimationFrame(this.update.bind(this)));
  }
  stop() {
    this.active = !1;
  }
}
const v8 = { class: "stopwatch" }, g8 = {
  __name: "StopWatchDisplay",
  props: {
    time: { type: Number, default: 0 }
  },
  setup(e) {
    const t = e, n = k(() => isNaN(t.time) ? void 0 : (t.time / 1e3).toFixed(2)), s = k(() => (me(), me(Date.now() + t.time).fromNow(!0)));
    return (o, i) => (g(), E("div", v8, [
      i[0] || (i[0] = c("i", { class: "fas fa-clock fa-fw me-1" }, null, -1)),
      c("span", null, "Elapsed time: " + F(n.value), 1),
      c("span", null, "(" + F(s.value) + ")", 1)
    ]));
  }
}, _8 = /* @__PURE__ */ oe(g8, [["__scopeId", "data-v-078bbc19"]]), y8 = { class: "my-2" }, b8 = { class: "d-flex gap-2 justify-content-between" }, E8 = { key: 0 }, w8 = { class: "text-muted" }, S8 = { key: 1 }, x8 = { key: 0 }, N8 = { key: 1 }, C8 = { class: "ms-auto" }, O8 = {
  __name: "ProcessingDetails",
  setup(e) {
    const t = mg(), n = I(), s = k(() => t.processing), o = k(() => t.aborted), i = k(() => t.stats), r = k(() => {
      const _ = [];
      for (const [b, w] of Object.entries(t.errors))
        for (const y of w)
          _.push({ mrn: b, error: y });
      return _;
    }), a = k(() => Object.keys(t.errors).length), l = k(() => {
      var _;
      return (_ = t.success) == null ? void 0 : _.length;
    }), u = k(() => t.currentMRN), d = k(() => t.totalMRNs), f = k(() => t.totalProcessed), p = I(0), h = new m8((_) => p.value = _);
    Ft(() => {
      s.value === !0 ? (h.reset(), h.start(), n.value.show()) : h.stop();
    });
    function m() {
      t.stop();
    }
    function v() {
      n.value.hide();
    }
    return (_, b) => {
      const w = le("b-modal");
      return g(), se(w, {
        ref_key: "modalRef",
        ref: n,
        backdrop: "static",
        size: "lg"
      }, {
        title: B(() => b[0] || (b[0] = [
          c("span", null, "Fetching Data", -1)
        ])),
        footer: B(() => [
          c("div", C8, [
            s.value ? (g(), E("button", {
              key: 0,
              class: "btn btn-sm btn-secondary",
              onClick: m
            }, b[9] || (b[9] = [
              c("i", { class: "fas fa-ban me-1" }, null, -1),
              c("span", null, "Cancel", -1)
            ]))) : (g(), E("button", {
              key: 1,
              class: "btn btn-sm btn-secondary",
              onClick: v
            }, b[10] || (b[10] = [
              c("i", { class: "fas fa-times me-1" }, null, -1),
              c("span", null, "Close", -1)
            ])))
          ])
        ]),
        default: B(() => [
          c("div", null, [
            c("div", y8, [
              D(r8, {
                total: d.value,
                errors: a.value,
                success: l.value
              }, null, 8, ["total", "errors", "success"])
            ]),
            c("div", b8, [
              s.value ? (g(), E(G, { key: 0 }, [
                u.value ? (g(), E("div", E8, [
                  b[2] || (b[2] = c("span", null, [
                    c("i", { class: "fas fa-spinner fa-spin fa-fw me-1" })
                  ], -1)),
                  c("span", null, [
                    b[1] || (b[1] = te("Processing ")),
                    c("strong", null, F(u.value), 1)
                  ]),
                  c("span", w8, " - " + F(f.value) + "/" + F(d.value), 1)
                ])) : (g(), E("div", S8, b[3] || (b[3] = [
                  c("span", null, [
                    c("i", { class: "fas fa-spinner fa-spin fa-fw me-1" })
                  ], -1)
                ])))
              ], 64)) : (g(), E(G, { key: 1 }, [
                o.value ? (g(), E("div", x8, b[4] || (b[4] = [
                  c("i", { class: "fas fa-ban me-1 text-danger" }, null, -1),
                  c("span", null, "Cancelled", -1)
                ]))) : (g(), E("div", N8, b[5] || (b[5] = [
                  c("i", { class: "fas fa-check-circle me-1 text-success" }, null, -1),
                  c("span", null, "Completed", -1)
                ])))
              ], 64)),
              D(_8, {
                time: p.value,
                class: "text-muted fw-lighter fst-italic"
              }, null, 8, ["time"])
            ]),
            b[8] || (b[8] = c("hr", null, null, -1)),
            c("div", null, [
              b[6] || (b[6] = c("span", { class: "d-block fs-4 mb-2" }, "Stats:", -1)),
              D(d8, { stats: i.value }, null, 8, ["stats"]),
              b[7] || (b[7] = c("span", { class: "d-block fs-4 mb-2" }, "Errors:", -1)),
              D(h8, { errors: r.value }, null, 8, ["errors"])
            ])
          ])
        ]),
        _: 1
      }, 512);
    };
  }
}, $S = /* @__PURE__ */ oe(O8, [["__scopeId", "data-v-054770fb"]]), T8 = { class: "badge bg-primary" }, $8 = { class: "form-check" }, k8 = { class: "form-check" }, D8 = ["disabled"], R8 = {
  key: 1,
  class: "btn btn-sm btn-outline-primary",
  disabled: ""
}, kS = {
  __name: "FetchButton",
  props: {
    disabled: { type: Boolean, default: !1 },
    mrns: { type: Array, default: null }
  },
  emits: ["fetch-confirmed"],
  setup(e, { emit: t }) {
    const n = vl(), s = mg(), o = Wo(), i = tu(), r = fs(), a = an(), l = t, u = e, { mrns: d, disabled: f } = he(u), p = k(() => o.selected === o.active), h = k(() => {
      var N, S;
      return (S = (N = o == null ? void 0 : o.selected) == null ? void 0 : N.metadata) == null ? void 0 : S.approved;
    }), m = I(!1), v = I(!1), _ = k(() => s.processing), b = k(() => {
      var N, S;
      return ((S = (N = o == null ? void 0 : o.selected) == null ? void 0 : N.metadata) == null ? void 0 : S.total_fetchable_mrns) ?? 0;
    }), w = k(() => Array.isArray(d.value) ? d.value.length : b.value), y = k(() => f.value ? f.value : !p.value || !h.value || w.value === 0 || !i.canRunRevision(o.selected));
    Ft(() => {
      m.value === !1 && (v.value = !1);
    });
    async function x() {
      var N, S, O;
      l("fetch-confirmed", {
        backgroundFetch: m.value,
        sendMessage: v.value
      });
      try {
        if (m.value) {
          const $ = await s.schedule(o.selected, d.value, v.value), T = ((N = $ == null ? void 0 : $.data) == null ? void 0 : N.message) ?? "the process was successfully scheduled";
          a.toast({ title: "Success", body: T });
        } else
          await s.run(o.selected, d.value);
      } catch ($) {
        let T = $;
        $ instanceof PA && (T = ((O = (S = $ == null ? void 0 : $.response) == null ? void 0 : S.data) == null ? void 0 : O.message) ?? "unexpected error"), r.alert({ title: "Error", body: T });
      } finally {
        n.init();
      }
    }
    return (N, S) => {
      const O = le("b-dropdown-item"), $ = le("b-dropdown-divider"), T = le("b-dropdown");
      return _.value ? (g(), E("button", R8, S[7] || (S[7] = [
        c("i", { class: "fas fa-spinner fa-spin fa-fw me-1" }, null, -1),
        c("span", null, "Processing", -1)
      ]))) : (g(), se(T, {
        key: 0,
        "menu-end": "",
        variant: "success",
        size: "sm",
        disabled: y.value
      }, {
        button: B(() => [
          S[2] || (S[2] = c("i", { class: "fa-solid fa-cloud-arrow-down fa-fw" }, null, -1)),
          S[3] || (S[3] = c("span", { class: "mx-1" }, "Fetch data", -1)),
          c("span", T8, F(w.value) + " records", 1)
        ]),
        default: B(() => [
          D(O, { "data-prevent-close": "" }, {
            default: B(() => [
              c("div", $8, [
                L(c("input", {
                  class: "form-check-input",
                  type: "checkbox",
                  "onUpdate:modelValue": S[0] || (S[0] = (R) => m.value = R),
                  id: "fetch-background-checkbox"
                }, null, 512), [
                  [mn, m.value]
                ]),
                S[4] || (S[4] = c("label", {
                  class: "form-check-label",
                  for: "fetch-background-checkbox"
                }, [
                  c("i", { class: "fas fa-clock fa-fw me-1" }),
                  c("span", null, "Fetch in a background process")
                ], -1))
              ])
            ]),
            _: 1
          }),
          D(O, { "data-prevent-close": "" }, {
            default: B(() => [
              c("div", k8, [
                L(c("input", {
                  class: "form-check-input",
                  type: "checkbox",
                  "onUpdate:modelValue": S[1] || (S[1] = (R) => v.value = R),
                  id: "send-message-checkbox",
                  disabled: !m.value
                }, null, 8, D8), [
                  [mn, v.value]
                ]),
                S[5] || (S[5] = c("label", {
                  class: "form-check-label",
                  for: "send-message-checkbox"
                }, [
                  c("i", { class: "fas fa-envelope fa-fw me-1" }),
                  c("span", null, "Send me a message when completed")
                ], -1))
              ])
            ]),
            _: 1
          }),
          D($),
          D(O, null, {
            default: B(() => [
              c("div", { onClick: x }, S[6] || (S[6] = [
                c("i", { class: "fas fa-check fa-fw me-1" }, null, -1),
                c("span", null, "Confirm", -1)
              ]))
            ]),
            _: 1
          })
        ]),
        _: 1
      }, 8, ["disabled"]));
    };
  }
}, I8 = {
  __name: "SearchButton",
  setup(e) {
    const t = ds();
    function n() {
      t.push({ name: "search" });
    }
    return (s, o) => (g(), E("button", {
      class: "btn btn-sm btn-primary",
      onClick: n
    }, o[0] || (o[0] = [
      c("i", { class: "fa-solid fa-magnifying-glass fa-fw me-1" }, null, -1),
      c("span", null, "Select and fetch records...", -1)
    ])));
  }
}, A8 = ["title"], M8 = { class: "fw-bold" }, P8 = { class: "border-start ps-2 ms-auto" }, L8 = {
  key: 0,
  class: "fas fa-check-circle text-success"
}, V8 = {
  key: 1,
  class: "fas fa-ban text-danger"
}, F8 = {
  __name: "RevisionsDropdown",
  setup(e) {
    $e("store");
    const t = Wo(), n = k(() => t.selected), s = k(() => t.list ?? []);
    function o(i) {
      t.selected = i;
    }
    return (i, r) => (g(), se(wS, { variant: "outline-primary" }, {
      button: B(() => [
        c("span", null, [
          n.value ? (g(), E(G, { key: 0 }, [
            te(" Revision " + F(C(t).getIndex(n.value)), 1)
          ], 64)) : (g(), E(G, { key: 1 }, [
            te("-----")
          ], 64))
        ])
      ]),
      default: B(() => [
        (g(!0), E(G, null, ge(s.value, (a, l) => (g(), se(Mm, {
          key: l,
          active: a === n.value,
          onClick: (u) => o(a)
        }, {
          default: B(() => {
            var u, d;
            return [
              c("div", {
                class: "d-flex gap-2",
                title: (u = a == null ? void 0 : a.metadata) == null ? void 0 : u.id
              }, [
                c("div", null, [
                  c("span", M8, "#" + F(C(t).getIndex(a)), 1)
                ]),
                c("span", null, "Revision date: " + F((d = a == null ? void 0 : a.metadata) == null ? void 0 : d.date), 1),
                c("div", P8, [
                  C(t).isApproved(a) ? (g(), E("i", L8)) : (g(), E("i", V8))
                ])
              ], 8, A8)
            ];
          }),
          _: 2
        }, 1032, ["active", "onClick"]))), 128))
      ]),
      _: 1
    }));
  }
}, U8 = /* @__PURE__ */ oe(F8, [["__scopeId", "data-v-3e305bc6"]]);
function j8(e, t = null) {
  const n = [], s = t || Object.keys(e[0]);
  n.push(s.join(","));
  for (const o of e) {
    const i = s.map((r) => `"${o[r] === null || o[r] === void 0 ? "" : String(o[r]).replace(/"/g, '""')}"`);
    n.push(i.join(","));
  }
  return n.join(`
`);
}
function Lm(e, t, n = null) {
  const s = j8(e, n);
  rp(s, { fileName: t, fileType: "text/csv;charset=utf-8;" });
}
const rp = (e, { fileName: t = "download.txt", fileType: n = "text/plain" }) => {
  const s = new Blob([e], { type: n }), o = URL.createObjectURL(s), i = document.createElement("a");
  i.href = o, i.download = t, i.click(), URL.revokeObjectURL(o);
};
function Zy(e, t = ",", n = '"') {
  const s = [];
  let o = "", i = !1;
  for (let r = 0; r < e.length; r++) {
    const a = e[r];
    a === n ? i && r + 1 < e.length && e[r + 1] === n ? (o += n, r++) : i = !i : a === t && !i ? (s.push(o), o = "") : o += a;
  }
  return s.push(o), s;
}
function B8(e, t = ",", n = '"') {
  const s = e.split(`
`).filter((r) => r.trim() !== ""), o = [], i = Zy(s[0], t, n);
  for (let r = 1; r < s.length; r++) {
    const a = {}, l = Zy(s[r], t, n);
    for (let u = 0; u < i.length; u++)
      a[i[u]] = l[u] !== void 0 ? l[u] : "";
    o.push(a);
  }
  return o;
}
function H8(e) {
  const t = [Object.keys(e[0])];
  for (const o of e) {
    const i = Object.values(o).map((r) => typeof r == "string" ? `"${r.replace(/"/g, '""')}"` : r);
    t.push(i);
  }
  const n = t.map((o) => o.join(",")).join(`
`);
  return `data:text/csv;charset=utf-8,${encodeURIComponent(n)}`;
}
function Y8(e, t = "data-export") {
  const n = document.createElement("a");
  n.setAttribute("href", e), n.setAttribute("download", t), document.body.appendChild(n), n.click(), document.body.removeChild(n);
}
const W8 = {
  __name: "RevisionOptionsDropdown",
  setup(e) {
    const t = Wo(), n = ds(), s = I(), o = k(() => t.selected);
    function i() {
      var u, d, f;
      const l = (d = (u = o.value) == null ? void 0 : u.metadata) == null ? void 0 : d.id;
      Lm([(f = o.value) == null ? void 0 : f.data], `revision-${l}.csv`);
    }
    function r() {
      s.value.click();
    }
    async function a() {
      const { files: l } = s.value;
      if (l.length === 0) return;
      const d = (await e3(l[0])).data;
      t.edited = d, n.push({ name: "request-change" });
    }
    return (l, u) => (g(), E("div", null, [
      D(wS, { variant: "outline-secondary" }, {
        button: B(() => u[0] || (u[0] = [
          c("span", null, [
            c("i", { class: "fas fa-cog fa-fw" })
          ], -1)
        ])),
        default: B(() => [
          D(Mm, { onClick: i }, {
            default: B(() => u[1] || (u[1] = [
              c("i", { class: "fas fa-file-export fa-fw me-1" }, null, -1),
              c("span", null, "Export", -1)
            ])),
            _: 1
          }),
          D(Mm, { onClick: r }, {
            default: B(() => u[2] || (u[2] = [
              c("i", { class: "fas fa-file-import fa-fw me-1" }, null, -1),
              c("span", null, "Import", -1)
            ])),
            _: 1
          })
        ]),
        _: 1
      }),
      c("input", {
        type: "file",
        class: "d-none",
        ref_key: "fileRef",
        ref: s,
        onChange: a
      }, null, 544)
    ]));
  }
}, G8 = /* @__PURE__ */ oe(W8, [["__scopeId", "data-v-9afd39d7"]]), z8 = { class: "d-flex" }, K8 = { class: "d-flex gap-2" }, X8 = { class: "ms-auto d-flex gap-2" }, q8 = {
  __name: "HomePage",
  setup(e) {
    return (t, n) => (g(), E("div", null, [
      c("div", z8, [
        c("div", K8, [
          c("div", null, [
            D(U8)
          ]),
          c("div", null, [
            D(G8)
          ])
        ]),
        c("div", X8, [
          D(I8),
          D(kS)
        ])
      ]),
      D(q3, { class: "mt-2" }),
      D($S)
    ]));
  }
}, J8 = {}, Q8 = { class: "error-wrapper" }, Z8 = { class: "mt-5" };
function e5(e, t) {
  const n = le("router-link");
  return g(), E("div", Q8, [
    fe(e.$slots, "title", {}, () => [
      t[0] || (t[0] = c("span", { class: "error-title" }, "Error 404", -1))
    ], !0),
    fe(e.$slots, "description", {}, () => [
      t[1] || (t[1] = c("span", { class: "error-description" }, "Sorry, we couldn't find this page.", -1))
    ], !0),
    fe(e.$slots, "subdescription", {}, () => [
      t[2] || (t[2] = c("span", { class: "error-sub-description" }, "But dont worry, you can find plenty of other things on the homepage..", -1))
    ], !0),
    c("div", Z8, [
      D(n, {
        to: "/",
        class: "btn btn-sm btn-primary"
      }, {
        default: B(() => t[3] || (t[3] = [
          c("i", { class: "fas fa-arrow-left fa-fw me-1" }, null, -1),
          c("span", null, "Back to Home", -1)
        ])),
        _: 1
      })
    ])
  ]);
}
const la = /* @__PURE__ */ oe(J8, [["render", e5], ["__scopeId", "data-v-00842725"]]), t5 = { class: "d-flex gap-2 align-items-center mb-2" }, n5 = { key: 0 }, s5 = { class: "ms-auto" }, o5 = { class: "table table-bordered table-striped table-hover" }, r5 = {
  key: 0,
  class: "form-check form-switch"
}, i5 = ["id", "value"], a5 = ["for"], l5 = { key: 0 }, c5 = {
  __name: "MRNsResultsTable",
  props: {
    mrns: { type: Array, default: () => [] },
    selected: { type: Array, default: () => [] }
  },
  emits: ["update:mrns", "update:selected"],
  setup(e, { emit: t }) {
    const n = e, s = t, { mrns: o } = he(n), i = I({
      page: 1,
      limit: 10,
      total: 0,
      get start() {
        const p = parseInt(this.page), h = parseInt(this.limit);
        return (p - 1) * h;
      }
    }), r = I(!1), a = k({
      get: () => n.selected,
      set: (p) => s("update:selected", p)
    });
    let l = I("");
    const u = k({
      get() {
        return l.value;
      },
      set(p) {
        i.value.page = 1, l.value = p, d(l.value);
      }
    });
    Ft(() => {
      l.value === "" && s("update:mrns", []);
    }), nt(
      () => i.value.page,
      (p) => {
        d(l.value);
      },
      { deep: !0 }
    );
    const d = ml(async (p) => {
      await f(p);
    }, 300);
    async function f(p) {
      try {
        r.value = !0;
        const h = i.value;
        if (typeof p != "string" && !(p instanceof String)) return;
        if (p === "") {
          s("update:mrns", []), h.total = 0;
          return;
        }
        const m = await Z4(p, h == null ? void 0 : h.start, h == null ? void 0 : h.limit), { data: v } = m;
        s("update:mrns", v.list), h.total = v.total;
      } catch (h) {
        console.log(h);
      } finally {
        r.value = !1;
      }
    }
    return (p, h) => {
      const m = le("b-pagination");
      return g(), E("div", null, [
        c("div", t5, [
          D(m, {
            modelValue: i.value.page,
            "onUpdate:modelValue": h[0] || (h[0] = (v) => i.value.page = v),
            totalItems: i.value.total,
            perPage: i.value.limit,
            size: "sm"
          }, null, 8, ["modelValue", "totalItems", "perPage"]),
          r.value ? (g(), E("div", n5, h[3] || (h[3] = [
            c("i", { class: "fas fa-spinner fa-spin fa-fw" }, null, -1)
          ]))) : ne("", !0),
          c("div", s5, [
            L(c("input", {
              class: "form-control form-control-sm",
              type: "search",
              placeholder: "search...",
              "onUpdate:modelValue": h[1] || (h[1] = (v) => u.value = v)
            }, null, 512), [
              [Ve, u.value]
            ])
          ])
        ]),
        c("table", o5, [
          h[5] || (h[5] = c("thead", null, [
            c("tr", null, [
              c("th", null, "MRN")
            ])
          ], -1)),
          c("tbody", null, [
            (g(!0), E(G, null, ge(C(o), (v) => (g(), E("tr", {
              key: v == null ? void 0 : v.mrn
            }, [
              c("td", null, [
                v.mrn ? (g(), E("div", r5, [
                  L(c("input", {
                    class: "form-check-input",
                    type: "checkbox",
                    id: `mrn-${v.mrn}`,
                    "onUpdate:modelValue": h[2] || (h[2] = (_) => a.value = _),
                    value: v.mrn
                  }, null, 8, i5), [
                    [mn, a.value]
                  ]),
                  c("label", {
                    class: "form-check-label",
                    for: `mrn-${v.mrn}`
                  }, [
                    c("span", null, F(v.mrn), 1)
                  ], 8, a5)
                ])) : ne("", !0)
              ])
            ]))), 128)),
            C(o).length ? ne("", !0) : (g(), E("tr", l5, h[4] || (h[4] = [
              c("td", null, "nothing to show", -1)
            ])))
          ])
        ])
      ]);
    };
  }
}, u5 = { class: "d-flex flex-column gap-2" }, d5 = { class: "table table-bordered table-striped table-hover" }, f5 = { class: "d-flex align-items-center" }, p5 = { class: "ms-auto" }, h5 = ["onClick"], m5 = { key: 0 }, v5 = {
  __name: "SelectedMRNsTable",
  props: {
    mrns: { type: Array, default: () => [] }
  },
  emits: ["remove"],
  setup(e, { emit: t }) {
    const n = t, s = e, { mrns: o } = he(s), i = I({});
    nt(o, () => {
      var u;
      let a = ((u = i.value) == null ? void 0 : u.page) ?? 1;
      i.value = TS(o.value, { perPageOptions: [10] });
      const { totalPages: l = 0 } = i.value;
      for (; l < a; )
        a--, i.value.page = a;
    });
    function r(a) {
      n("remove", a);
    }
    return (a, l) => {
      const u = le("b-pagination");
      return g(), E("div", u5, [
        D(u, {
          modelValue: i.value.page,
          "onUpdate:modelValue": l[0] || (l[0] = (d) => i.value.page = d),
          totalItems: i.value.total,
          "per-page": i.value.limit,
          size: "sm"
        }, null, 8, ["modelValue", "totalItems", "per-page"]),
        c("table", d5, [
          l[3] || (l[3] = c("thead", null, [
            c("tr", null, [
              c("th", null, "MRN")
            ])
          ], -1)),
          c("tbody", null, [
            (g(!0), E(G, null, ge(i.value.items, (d) => (g(), E("tr", { key: d }, [
              c("td", null, [
                c("div", f5, [
                  c("span", null, F(d), 1),
                  c("div", p5, [
                    c("button", {
                      class: "btn btn-sm",
                      onClick: (f) => r(d)
                    }, l[1] || (l[1] = [
                      c("i", { class: "fas fa-trash fa-fw" }, null, -1)
                    ]), 8, h5)
                  ])
                ])
              ])
            ]))), 128)),
            C(o).length ? ne("", !0) : (g(), E("tr", m5, l[2] || (l[2] = [
              c("td", null, "nothing to show", -1)
            ])))
          ])
        ])
      ]);
    };
  }
}, g5 = { class: "d-flex gap-2 mb-2" }, _5 = { class: "ms-auto" }, y5 = { class: "card" }, b5 = { class: "card-body" }, E5 = { class: "mrn-results" }, w5 = { class: "selected-mrns border-top pt-2" }, S5 = { class: "d-flex" }, x5 = { class: "mb-2 ms-auto" }, N5 = { class: "d-flex align-items-center gap-2 ms-auto" }, C5 = {
  __name: "SearchPage",
  setup(e) {
    const t = ds(), n = I([]), s = I([]);
    function o() {
      s.value = [];
    }
    function i() {
      t.push({ name: "home" });
    }
    function r() {
      o();
    }
    function a(l) {
      const u = s.value;
      if (!Array.isArray(u)) return;
      const d = u.indexOf(l);
      d < 0 || (u.splice(d, 1), s.value = u);
    }
    return (l, u) => (g(), E(G, null, [
      c("div", null, [
        c("div", g5, [
          c("div", null, [
            c("button", {
              class: "btn btn-sm btn-secondary",
              onClick: i
            }, u[3] || (u[3] = [
              c("i", { class: "fas fa-chevron-left fa-fw me-1" }, null, -1),
              c("span", null, "Back", -1)
            ]))
          ]),
          c("div", _5, [
            D(kS, { mrns: s.value }, null, 8, ["mrns"])
          ])
        ]),
        c("div", y5, [
          u[6] || (u[6] = c("div", { class: "card-header border-bottom mb-2" }, [
            c("span", { class: "fw-bold" }, "Select fetchable MRNs available in the project and fetch their data")
          ], -1)),
          c("section", b5, [
            c("section", E5, [
              D(c5, {
                mrns: n.value,
                "onUpdate:mrns": u[0] || (u[0] = (d) => n.value = d),
                selected: s.value,
                "onUpdate:selected": u[1] || (u[1] = (d) => s.value = d)
              }, null, 8, ["mrns", "selected"])
            ]),
            c("section", w5, [
              c("div", S5, [
                c("div", x5, [
                  c("div", N5, [
                    c("span", null, [
                      u[4] || (u[4] = te("Total MRNs selected: ")),
                      c("strong", null, F(s.value.length), 1)
                    ]),
                    c("button", {
                      class: "btn btn-sm btn-danger",
                      onClick: r
                    }, u[5] || (u[5] = [
                      c("i", { class: "fas fa-trash fa-fw me-1" }, null, -1),
                      c("span", null, "Clear selection", -1)
                    ]))
                  ])
                ])
              ]),
              D(v5, {
                mrns: s.value,
                "onUpdate:mrns": u[2] || (u[2] = (d) => s.value = d),
                onRemove: a
              }, null, 8, ["mrns"])
            ])
          ])
        ])
      ]),
      D($S)
    ], 64));
  }
}, O5 = /* @__PURE__ */ oe(C5, [["__scopeId", "data-v-9bc2f4b8"]]), T5 = ["data-disabled"], $5 = { class: "form-check form-switch" }, k5 = ["id", "value", "disabled"], D5 = ["for", "title"], R5 = { class: "node-name fw-bold border-end me-2 pe-2" }, I5 = { class: "node-label" }, A5 = {
  key: 0,
  class: "text-muted d-block"
}, M5 = { class: "w-100" }, P5 = { class: "d-flex align-items-start" }, L5 = {
  key: 0,
  class: "text-muted"
}, V5 = {
  key: 0,
  class: "border-end pe-1 me-1"
}, F5 = { class: "ms-auto d-flex flex-column gap-2" }, U5 = { class: "d-flex" }, j5 = ["textContent"], B5 = {
  key: 0,
  class: "form-check form-switch"
}, H5 = ["id", "checked", "disabled"], Y5 = ["for"], W5 = {
  __name: "MetadataSelectionNode",
  props: {
    node: { type: [Ki, An], default: null },
    dateRange: { type: Object, default: null }
  },
  setup(e) {
    const t = nu(), n = e, { node: s, dateRange: o } = he(n), i = k({
      get: () => {
        var _, b, w;
        const v = (_ = s.value) == null ? void 0 : _.parent;
        return v ? ((w = (b = v == null ? void 0 : v.nodes) == null ? void 0 : b.filter((y) => y.selected)) == null ? void 0 : w.map((y) => y.name)) ?? [] : [];
      },
      set: (v) => {
        s.value.selected = !s.value.selected;
      }
    });
    function r(v) {
      var b;
      const _ = (b = v == null ? void 0 : v.target) == null ? void 0 : b.checked;
      s.value.applyDateRange = _;
    }
    const a = I(!1);
    Ft(() => {
      var v;
      ((v = s.value) == null ? void 0 : v.parent) === null && (a.value = !0);
    });
    function l() {
      return s.value.totalFilteredSelected === s.value.totalFiltered;
    }
    function u() {
      return s.value instanceof An;
    }
    function d() {
      return s.value instanceof Ki;
    }
    function f() {
      var v;
      ((v = s.value) == null ? void 0 : v.parent) !== null && (a.value = !a.value);
    }
    function p() {
      const v = s.value.filteredNodes, _ = !l();
      for (const b of v)
        b.selected = _;
    }
    function h() {
      var _, b, w, y;
      const v = s.value;
      return ((b = (_ = v == null ? void 0 : v.metadata) == null ? void 0 : _.description) == null ? void 0 : b.toUpperCase()) !== ((y = (w = v == null ? void 0 : v.metadata) == null ? void 0 : w.label) == null ? void 0 : y.toUpperCase());
    }
    function m() {
      var b;
      const v = s.value;
      return ((b = t == null ? void 0 : t.date_range_categories) == null ? void 0 : b.find(
        (w) => w.name === v.name
      )) !== void 0;
    }
    return (v, _) => {
      var b, w, y, x, N, S, O, $, T, R, P, M, U, H;
      return u() ? (g(), E("div", {
        key: 0,
        class: "node d-flex gap-2",
        "data-disabled": (w = (b = C(s)) == null ? void 0 : b.metadata) == null ? void 0 : w.disabled
      }, [
        c("div", $5, [
          L((g(), E("input", {
            class: "form-check-input",
            type: "checkbox",
            role: "switch",
            id: C(s).name,
            "onUpdate:modelValue": _[0] || (_[0] = (j) => i.value = j),
            value: (y = C(s)) == null ? void 0 : y.name,
            disabled: ((x = C(s)) == null ? void 0 : x.name) === "id",
            key: `node-${C(s).name}`
          }, null, 8, k5)), [
            [mn, i.value]
          ]),
          c("label", {
            class: "form-check-label",
            for: C(s).name,
            title: (S = (N = C(s)) == null ? void 0 : N.metadata) == null ? void 0 : S.description
          }, [
            c("span", R5, F(($ = (O = C(s)) == null ? void 0 : O.metadata) == null ? void 0 : $.field), 1),
            c("span", I5, F((R = (T = C(s)) == null ? void 0 : T.metadata) == null ? void 0 : R.label), 1),
            h() ? (g(), E("small", A5, F((M = (P = C(s)) == null ? void 0 : P.metadata) == null ? void 0 : M.description), 1)) : ne("", !0)
          ], 8, D5),
          (H = (U = C(s)) == null ? void 0 : U.metadata) != null && H.disabled ? (g(), se(xS, {
            key: 0,
            node: C(s)
          }, null, 8, ["node"])) : ne("", !0)
        ])
      ], 8, T5)) : d() ? (g(), E("div", {
        key: 1,
        class: Se(["node-container d-flex p-2", { "border rounded": C(s).parent !== null }])
      }, [
        C(s).parent !== null ? (g(), E("div", {
          key: 0,
          onClick: Rt(f, ["stop"])
        }, [
          c("i", {
            class: Se(["node-open-status fas fa-circle-chevron-right fa-fw", { "fa-rotate-90": a.value }])
          }, null, 2)
        ])) : ne("", !0),
        c("div", M5, [
          c("div", null, [
            c("div", P5, [
              c("div", null, [
                c("span", {
                  class: "container-name fw-bold d-block",
                  onClick: Rt(f, ["stop"])
                }, F(C(s).name), 1),
                C(s).parent !== null ? (g(), E("small", L5, [
                  C(s).query ? (g(), E("span", V5, "showing " + F(C(s).totalFiltered) + "/" + F(C(s).total), 1)) : ne("", !0),
                  c("span", null, F(C(s).totalFilteredSelected) + "/" + F(C(s).totalFiltered) + " " + F(`field${C(s).totalSelected === 1 ? "" : "s"} selected`), 1)
                ])) : ne("", !0)
              ]),
              c("div", F5, [
                c("div", U5, [
                  C(s).parent !== null ? (g(), E("button", {
                    type: "button",
                    key: `toggle-${C(s).name}`,
                    class: Se(["btn btn-sm ms-auto", {
                      "btn-success": l(),
                      "btn-outline-secondary": !l()
                    }]),
                    onClick: p
                  }, [
                    c("span", {
                      textContent: F(
                        C(s).totalFilteredSelected === C(s).totalFiltered ? "deselect all" : "select all"
                      )
                    }, null, 8, j5)
                  ], 2)) : ne("", !0)
                ]),
                fe(v.$slots, "container-header-end", { node: C(s) }, void 0, !0),
                m() ? (g(), E("div", B5, [
                  c("input", {
                    class: "form-check-input",
                    type: "checkbox",
                    id: `${C(s).name}-apply-date-range`,
                    checked: C(s).applyDateRange,
                    onChange: r,
                    disabled: !Object.keys(C(o)).length || C(s).totalSelected === 0
                  }, null, 40, H5),
                  c("label", {
                    class: "form-check-label",
                    for: `${C(s).name}-apply-date-range`
                  }, _[1] || (_[1] = [
                    c("span", null, "apply date range", -1)
                  ]), 8, Y5)
                ])) : ne("", !0)
              ])
            ])
          ]),
          a.value ? (g(!0), E(G, { key: 0 }, ge(C(s).filtered, (j) => (g(), se(DS, {
            key: `${j == null ? void 0 : j.name}`,
            node: j,
            "date-range": C(o)
          }, null, 8, ["node", "date-range"]))), 128)) : ne("", !0)
        ])
      ], 2)) : ne("", !0);
    };
  }
}, DS = /* @__PURE__ */ oe(W5, [["__scopeId", "data-v-04daeade"]]), G5 = { class: "d-flex gap-2 align-items-center" }, z5 = ["value", "max"], K5 = ["value", "min"], eb = "YYYY-MM-DD", X5 = {
  __name: "DateRange",
  props: {
    min: { type: String, default: "" },
    max: { type: String, default: "" }
  },
  emits: ["update:min", "update:max"],
  setup(e, { emit: t }) {
    const n = e, s = t, o = I(), i = I();
    function r(d) {
      return d === "" ? !0 : !!me(d).isValid();
    }
    k(() => a(n.min, n.max));
    function a(d, f) {
      return !r(d) || !r(f) ? !1 : d === "" || f === "" ? !0 : !me(d).isAfter(me(f));
    }
    function l() {
      var h, m;
      let d = (h = o == null ? void 0 : o.value) == null ? void 0 : h.value;
      const f = me(d);
      if (!f.isValid()) {
        s("update:min", "");
        return;
      }
      d = f.format(eb), s("update:min", d);
      const p = me((m = i == null ? void 0 : i.value) == null ? void 0 : m.value);
      p.isValid() && p.isBefore(f) && s("update:max", d);
    }
    function u() {
      var h, m;
      let d = (h = i == null ? void 0 : i.value) == null ? void 0 : h.value;
      const f = me(d);
      if (!f.isValid()) {
        s("update:max", "");
        return;
      }
      d = f.format(eb), s("update:max", d);
      const p = me((m = o == null ? void 0 : o.value) == null ? void 0 : m.value);
      p.isValid() && p.isAfter(f) && s("update:min", d);
    }
    return (d, f) => (g(), E("div", G5, [
      f[0] || (f[0] = c("label", { for: "start-date" }, "from", -1)),
      c("input", {
        ref_key: "minRef",
        ref: o,
        type: "date",
        id: "start-date",
        class: "form-control",
        value: e.min,
        onChange: l,
        max: e.max
      }, null, 40, z5),
      f[1] || (f[1] = c("label", { for: "end-date" }, "to", -1)),
      c("input", {
        ref_key: "maxRef",
        ref: i,
        type: "date",
        id: "end-date",
        class: "form-control",
        value: e.max,
        onChange: u,
        min: e.min
      }, null, 40, K5)
    ]));
  }
}, q5 = { class: "card" }, J5 = { class: "card-header d-flex align-items-center" }, Q5 = { class: "ms-auto" }, Z5 = { class: "card-body" }, eU = { class: "border rounded p-2" }, tU = { class: "border rounded p-2 mt-2" }, nU = { class: "card-footer" }, sU = { class: "d-flex gap-2 justify-content-end" }, RS = {
  __name: "RevisionEditor",
  props: {
    revision: { type: Object, default: null }
  },
  setup(e) {
    const t = su(), n = e, { revision: s } = he(n), o = k({
      get: () => (t == null ? void 0 : t.dateMin) || "",
      set: (d) => t.dateMin = d
    }), i = k({
      get: () => (t == null ? void 0 : t.dateMax) || "",
      set: (d) => t.dateMax = d
    }), r = k(() => t == null ? void 0 : t.node), a = ml((d) => {
      r.value.filter(d);
    }, 300), l = k(() => {
      const d = {}, f = me(o.value), p = me(i.value);
      return f.isValid() && (d.min = f.format(Jd)), p.isValid() && (d.max = p.format(Jd)), d;
    }), u = k({
      get: () => r.value.query,
      set: (d) => a(d)
    });
    return Ft(() => {
      t.setRevision(s.value);
    }), (d, f) => (g(), E("div", q5, [
      c("div", J5, [
        f[3] || (f[3] = c("span", { class: "fs-5" }, "Source list", -1)),
        c("div", Q5, [
          L(c("input", {
            class: "form-control",
            type: "search",
            "onUpdate:modelValue": f[0] || (f[0] = (p) => u.value = p),
            placeholder: "type to search..."
          }, null, 512), [
            [Ve, u.value]
          ])
        ])
      ]),
      c("div", Z5, [
        c("div", eU, [
          f[4] || (f[4] = c("span", { class: "fw-bold d-block mb-2" }, "If pulling time-based data, select the range of time from which to pull data (optional)", -1)),
          D(X5, {
            min: o.value,
            "onUpdate:min": f[1] || (f[1] = (p) => o.value = p),
            max: i.value,
            "onUpdate:max": f[2] || (f[2] = (p) => i.value = p)
          }, null, 8, ["min", "max"])
        ]),
        c("div", tU, [
          D(DS, {
            node: r.value,
            "date-range": l.value
          }, null, 8, ["node", "date-range"])
        ])
      ]),
      c("div", nU, [
        c("div", sU, [
          fe(d.$slots, "buttons")
        ])
      ])
    ]));
  }
}, oU = ["disabled"], rU = {
  __name: "RequestChangePage",
  setup(e) {
    const t = su(), n = Wo(), s = vl(), o = ds(), i = an(), r = k(() => {
      var f;
      return n.edited ?? ((f = n.selected) == null ? void 0 : f.data);
    }), a = k(() => t.isUpdated);
    function l() {
      o.push({ name: "home" });
    }
    function u() {
      l();
    }
    async function d() {
      try {
        const f = t.validate();
        if ((f == null ? void 0 : f.length) > 0) throw Error(f == null ? void 0 : f.join(`
`));
        const p = await t.submit();
        i.toast({ title: "Success", body: "Revision submitted" }), s.init(), l();
      } catch (f) {
        i.toast({
          title: "Error",
          body: f,
          autohide: !1
        });
      }
    }
    return (f, p) => (g(), E(G, null, [
      c("div", { class: "mb-2" }, [
        c("button", {
          class: "btn btn-sm btn-secondary",
          onClick: u
        }, p[0] || (p[0] = [
          c("i", { class: "fas fa-chevron-left fa-fw" }, null, -1),
          c("span", null, "Back", -1)
        ]))
      ]),
      D(RS, { revision: r.value }, {
        buttons: B(() => [
          c("button", {
            class: "btn btn-sm btn-secondary",
            onClick: u
          }, p[1] || (p[1] = [
            c("i", { class: "fas fa-times fa-fw" }, null, -1),
            c("span", null, "Cancel", -1)
          ])),
          c("button", {
            class: "btn btn-sm btn-primary",
            onClick: d,
            disabled: !a.value
          }, p[2] || (p[2] = [
            c("i", { class: "fas fa-check-circle fa-fw" }, null, -1),
            c("span", null, "Submit", -1)
          ]), 8, oU)
        ]),
        _: 1
      }, 8, ["revision"])
    ], 64));
  }
}, iU = ["value"], aU = ["value"], lU = ["value"], cU = ["value"], uU = ["value"], dU = ["value"], fU = ["value"], IS = {
  __name: "RevisionForm",
  props: {
    revision: { type: Object },
    user_id: { type: String },
    request_id: { type: String }
  },
  setup(e) {
    const t = e, n = k(() => t == null ? void 0 : t.user_id), s = k(() => t == null ? void 0 : t.request_id), o = k(() => {
      var u;
      return (u = t == null ? void 0 : t.revision) == null ? void 0 : u.fields;
    }), i = k(() => {
      var u;
      return (u = t == null ? void 0 : t.revision) == null ? void 0 : u.dateMin;
    }), r = k(() => {
      var u;
      return (u = t == null ? void 0 : t.revision) == null ? void 0 : u.dateMax;
    }), a = k(
      () => {
        var u;
        return (u = t == null ? void 0 : t.revision) == null ? void 0 : u.date_range_categories;
      }
    ), l = k(() => {
      var u;
      return (u = t == null ? void 0 : t.revision) == null ? void 0 : u.mrns;
    });
    return (u, d) => (g(), E("div", null, [
      c("input", {
        type: "hidden",
        name: "datamart[user_id]",
        value: n.value
      }, null, 8, iU),
      c("input", {
        type: "hidden",
        name: "datamart[request_id]",
        value: s.value
      }, null, 8, aU),
      c("input", {
        type: "hidden",
        name: "datamart[daterange][min]",
        value: i.value
      }, null, 8, lU),
      c("input", {
        type: "hidden",
        name: "datamart[daterange][max]",
        value: r.value
      }, null, 8, cU),
      (g(!0), E(G, null, ge(a.value, (f, p) => (g(), E("input", {
        key: p,
        type: "hidden",
        name: "datamart[date_range_categories][]",
        value: f
      }, null, 8, uU))), 128)),
      (g(!0), E(G, null, ge(o.value, (f, p) => (g(), E("input", {
        key: p,
        type: "hidden",
        name: "datamart[fields][]",
        value: f
      }, null, 8, dU))), 128)),
      (g(!0), E(G, null, ge(l.value, (f, p) => (g(), E("input", {
        key: p,
        type: "hidden",
        name: "datamart[mrns][]",
        value: f
      }, null, 8, fU))), 128))
    ]));
  }
}, pU = { class: "d-flex" }, hU = { class: "ms-auto text-muted" }, mU = {
  __name: "MrnListEditor",
  setup(e) {
    const t = su(), n = (a) => a.split(`
`).filter((l) => l.trim() !== ""), s = ml((a) => {
      o.value = a, t.mrns = n(a);
    }, 300), o = I(""), i = k({
      get: () => o.value,
      set: (a) => s(a)
    }), r = k(() => t.mrns.length);
    return (a, l) => (g(), E("div", null, [
      L(c("textarea", {
        class: "form-control",
        rows: "5",
        "onUpdate:modelValue": l[0] || (l[0] = (u) => i.value = u)
      }, null, 512), [
        [Ve, i.value]
      ]),
      c("div", pU, [
        c("div", hU, [
          l[1] || (l[1] = c("span", null, "Total MRNs: ", -1)),
          c("span", null, F(r.value), 1)
        ])
      ])
    ]));
  }
}, vU = { class: "card mt-2" }, gU = { class: "card-body" }, _U = { class: "card-footer" }, yU = {
  key: 0,
  class: "alert alert-danger"
}, bU = {
  __name: "CreateProjectPage",
  setup(e) {
    const t = su(), n = k(() => t.isValid), s = k(() => t.validationErrors);
    return nt(
      () => t == null ? void 0 : t.new,
      () => t.validate(),
      { immediate: !1, deep: !0 }
    ), (o, i) => {
      var r;
      return g(), E("div", null, [
        D(IS, {
          revision: (r = C(t)) == null ? void 0 : r.new
        }, null, 8, ["revision"]),
        D(RS),
        c("div", vU, [
          i[1] || (i[1] = c("div", { class: "card-header" }, [
            c("span", { class: "fs-5" }, "Enter medical record numbers of patients to import from the EHR (one per line, optional)")
          ], -1)),
          c("div", gU, [
            D(mU)
          ]),
          c("div", _U, [
            n.value ? ne("", !0) : (g(), E("div", yU, [
              i[0] || (i[0] = c("span", null, "This revision is invalid", -1)),
              c("ul", null, [
                (g(!0), E(G, null, ge(s.value, (a, l) => (g(), E("li", { key: l }, [
                  c("span", null, F(a), 1)
                ]))), 128))
              ])
            ]))
          ])
        ])
      ]);
    };
  }
}, EU = { class: "mrn-list border p-2 rounded" }, wU = { class: "d-flex d-none" }, SU = { class: "ms-auto text-muted" }, xU = {
  __name: "MrnList",
  props: {
    mrns: { type: Array, default: () => [] }
  },
  setup(e) {
    const t = e, n = k(() => {
      var s;
      return ((s = t == null ? void 0 : t.mrns) == null ? void 0 : s.length) ?? 0;
    });
    return (s, o) => (g(), E("div", EU, [
      c("details", null, [
        c("summary", null, [
          o[0] || (o[0] = c("span", null, "Total MRNs: ", -1)),
          c("span", null, F(n.value), 1)
        ]),
        c("ul", null, [
          (g(!0), E(G, null, ge(e.mrns, (i, r) => (g(), E("li", {
            key: `${r}-${i}`
          }, F(i), 1))), 128))
        ])
      ]),
      c("div", wU, [
        c("div", SU, [
          o[1] || (o[1] = c("span", null, "Total MRNs: ", -1)),
          c("span", null, F(n.value), 1)
        ])
      ])
    ]));
  }
}, NU = /* @__PURE__ */ oe(xU, [["__scopeId", "data-v-743f2c61"]]), CU = { class: "mt-2" }, OU = {
  __name: "ReviewProjectPage",
  setup(e) {
    const t = Wo(), n = k(() => t == null ? void 0 : t.selected), s = k(() => {
      var i, r, a;
      return (a = (r = (i = n.value) == null ? void 0 : i.metadata) == null ? void 0 : r.creator) == null ? void 0 : a.id;
    }), o = k(() => {
      var i, r;
      return (r = (i = n.value) == null ? void 0 : i.metadata) == null ? void 0 : r.request_id;
    });
    return (i, r) => {
      var a;
      return g(), E("div", null, [
        D(IS, {
          revision: (a = n.value) == null ? void 0 : a.data,
          user_id: s.value,
          request_id: o.value
        }, null, 8, ["revision", "user_id", "request_id"]),
        D(CS, { revision: n.value }, {
          "body-end": B(() => {
            var l, u;
            return [
              c("div", CU, [
                r[0] || (r[0] = c("span", { class: "fw-bold" }, "MRNs", -1)),
                D(NU, {
                  mrns: (u = (l = n.value) == null ? void 0 : l.data) == null ? void 0 : u.mrns
                }, null, 8, ["mrns"])
              ])
            ];
          }),
          _: 1
        }, 8, ["revision"])
      ]);
    };
  }
}, TU = { class: "folder" }, $U = {
  key: 0,
  class: "fas fa-chevron-down fa-fw"
}, kU = {
  key: 1,
  class: "fas fa-chevron-right fa-fw"
}, DU = { class: "children" }, RU = {
  __name: "FolderNode",
  props: {
    data: { type: Object }
  },
  setup(e) {
    const t = I(!0);
    function n() {
      t.value = !t.value;
    }
    return (s, o) => (g(), E("div", TU, [
      c("div", {
        class: "header",
        onClick: n
      }, [
        c("span", null, [
          t.value ? (g(), E("i", $U)) : (g(), E("i", kU))
        ]),
        c("span", null, F(e.data.name) + " (" + F(e.data.children.length) + ")", 1)
      ]),
      c("div", DU, [
        t.value ? fe(s.$slots, "default", { key: 0 }, void 0, !0) : ne("", !0)
      ])
    ]));
  }
}, IU = /* @__PURE__ */ oe(RU, [["__scopeId", "data-v-61b4b6ce"]]), AU = { class: "file" }, MU = { class: "text-muted" }, PU = {
  __name: "FileNode",
  props: {
    data: { type: Object }
  },
  setup(e) {
    return (t, n) => (g(), E("div", AU, [
      c("small", MU, F(e.data.name) + " - " + F(e.data.size), 1)
    ]));
  }
}, AS = {
  __name: "FileExplorer",
  props: {
    data: { type: Object },
    parent: { type: Object, default: null }
  },
  setup(e) {
    return (t, n) => e.data.type === "folder" ? (g(), se(IU, {
      key: 0,
      data: e.data
    }, {
      default: B(() => [
        (g(!0), E(G, null, ge(e.data.children, (s, o) => (g(), se(AS, {
          key: `${o}-${s == null ? void 0 : s.name}`,
          data: s,
          parent: e.data
        }, null, 8, ["data", "parent"]))), 128))
      ]),
      _: 1
    }, 8, ["data"])) : e.data.type === "file" ? (g(), se(PU, {
      key: 1,
      data: e.data
    }, null, 8, ["data"])) : ne("", !0);
  }
}, LU = () => ({
  type: "folder",
  name: "/",
  children: [
    {
      type: "folder",
      name: "Folder1",
      children: [
        {
          type: "file",
          name: "File1.txt",
          size: "2KB"
        },
        {
          type: "file",
          name: "File2.txt",
          size: "3KB"
        }
      ]
    },
    {
      type: "folder",
      name: "Folder2",
      children: [
        {
          type: "folder",
          name: "SubFolder1",
          children: [
            {
              type: "file",
              name: "File3.txt",
              size: "4KB"
            }
          ]
        },
        {
          type: "file",
          name: "File4.txt",
          size: "1KB"
        }
      ]
    },
    {
      type: "file",
      name: "File5.txt",
      size: "5KB"
    }
  ]
}), VU = { class: "p-5" }, FU = {
  __name: "TestPage",
  setup(e) {
    return (t, n) => (g(), E("div", VU, [
      D(AS, {
        data: C(LU)()
      }, null, 8, ["data"])
    ]));
  }
}, UU = [
  {
    path: "/",
    component: w3,
    // redirect: '/inbox',
    children: [
      { path: "", name: "home", component: q8 },
      { path: "test", name: "test", component: FU },
      {
        path: "request-change",
        name: "request-change",
        component: rU
      },
      {
        path: "create-project",
        name: "create-project",
        component: bU
      },
      {
        path: "review-project",
        name: "review-project",
        component: OU
      },
      { path: "search", name: "search", component: O5 },
      { path: "/:pathMatch(.*)*", component: la }
    ]
  }
];
let ku;
const jU = () => ku || (ku = ci({
  // Provide the history implementation to use. We are using the hash history for simplicity here.
  history: li(),
  routes: UU
}), ku), fde = (e) => {
  const t = wn(y3);
  t.use(Cs);
  const n = jU();
  t.use(n), t.use(ai()), t.mount(e);
  const s = t.runWithContext(() => v3());
  return { app: t, router: n, store: s };
}, BU = Bo(), MS = Ho(BU, ["pid"]), HU = (e = {}) => {
  const t = {
    route: "DataMartController:checkDesign",
    params: e
  };
  return MS.get("", { params: t });
}, PS = (e = {}) => {
  const t = {
    route: "DataMartController:fixDesign",
    params: e
  }, n = {};
  return MS.post("", n, { params: t });
}, Ml = Object.freeze({
  READY: 0,
  PROCESSING: 2,
  PROCESSED: 3,
  ERROR: 4
});
class YU {
  constructor(t = {}) {
    /* {
        params: {formName: "labs"}
        text: "Add this field to the `labs`instrument: \"labs_unit\""
        type: "ADD_FIELDS"
    } */
    Qe(this, "_id", "");
    Qe(this, "_description", "");
    Qe(this, "_parameters", {});
    Qe(this, "_status", Ml.READY);
    Qe(this, "_criticality", 0);
    Qe(this, "_action_type", "");
    for (let [n, s] of Object.entries(t))
      `_${n}` in this && (this[n] = s);
  }
  get id() {
    return this._id;
  }
  set id(t) {
    this._id = t;
  }
  get description() {
    return this._description;
  }
  set description(t) {
    this._description = t;
  }
  get parameters() {
    return this._parameters;
  }
  set parameters(t) {
    this._parameters = t;
  }
  get action_type() {
    return this._action_type;
  }
  set action_type(t) {
    this._action_type = t;
  }
  get criticality() {
    return this._criticality;
  }
  set criticality(t) {
    this._criticality = parseInt(t);
  }
  get status() {
    return this._status;
  }
  set status(t) {
    t in Object.values(Ml) ? this._status = t : this._status = Ml.ERROR;
  }
  isReady() {
    return this.status === Ml.READY;
  }
  resetStatus() {
    this.status = Ml.READY;
  }
}
const hh = (e, t) => ({ message: e, variant: t }), WU = () => qe({
  ready: !1,
  commands: [],
  privileges: {
    design: !1
  },
  project_metadata: {
    draft_mode: !1,
    can_be_modified: !1,
    status: null
  },
  error: null,
  async init() {
    try {
      this.ready = !1, await this.checkDesign();
    } catch (t) {
      this.error = t;
    } finally {
      this.ready = !0;
    }
  },
  async checkDesign() {
    var t, n;
    try {
      const s = await HU(), o = ((t = s == null ? void 0 : s.data) == null ? void 0 : t.commands) ?? [], i = ((n = s == null ? void 0 : s.data) == null ? void 0 : n.settings) ?? {};
      this.commands = o.map((r) => new YU(r)), this.privileges = (i == null ? void 0 : i.privileges) ?? {}, this.project_metadata = (i == null ? void 0 : i.project_metadata) ?? {};
    } catch (s) {
      this.error = s;
    } finally {
      this.ready = !0;
    }
  },
  async fixDesign() {
    try {
      return await PS();
    } catch (t) {
      this.error = t;
    }
  },
  get canBeModified() {
    var t;
    return ((t = this.project_metadata) == null ? void 0 : t.can_be_modified) === !0;
  },
  get isDraftMode() {
    var t;
    return ((t = this.project_metadata) == null ? void 0 : t.draft_mode) === !0;
  },
  get isProjectStatusDevelopment() {
    var t;
    return ((t = this.project_metadata) == null ? void 0 : t.status) === "development";
  },
  get hasDesignPrivileges() {
    var t;
    return ((t = this.privileges) == null ? void 0 : t.design) === !0;
  },
  get warnings() {
    const t = [];
    if (this.hasDesignPrivileges) {
      if (this.isDraftMode) {
        let n = hh(
          'Please remember that all changes made in "draft mode" must be committed',
          "warning"
        );
        t.push(n);
      }
      if (!this.isDraftMode && !this.isProjectStatusDevelopment) {
        let n = hh(
          'To fix the design of this project, please enter "draft mode" or move the project to "development" status, then return to this page',
          "info"
        );
        t.push(n);
      }
    } else {
      let n = hh(
        "To fix the design of this project, please ask your administrator to visit this page",
        "info"
      );
      t.push(n);
    }
    return t;
  }
}), GU = () => qe({
  loading: !1,
  error: null,
  async fixDesign() {
    try {
      return this.loading = !0, await PS();
    } catch (t) {
      this.error = t;
    } finally {
      this.loading = !1;
    }
  }
}), vg = Ns("app", WU), zU = Ns("fix-design", GU), KU = { class: "table-wrapper" }, XU = { class: "table table-bordered table-striped table-hover" }, qU = ["data-id"], JU = { class: "description" }, QU = { class: "text-center" }, ZU = { class: "text-center" }, ej = {
  __name: "ActionsList",
  props: {
    commands: { type: Array, default: () => [] }
  },
  setup(e) {
    function t(s) {
      switch (s) {
        case 1:
          return "info";
        case 2:
          return "primary";
        case 3:
          return "warning";
        case 4:
          return "danger";
        default:
          return "secondary";
      }
    }
    function n(s) {
      switch (s) {
        case "automatic_action":
          return ["fa-wand-magic-sparkles"];
        case "manual_action":
          return ["fa-user"];
        default:
          return ["fa-question-circle"];
      }
    }
    return (s, o) => (g(), E("div", null, [
      o[1] || (o[1] = c("p", { class: "alert alert-warning" }, " Please be aware that you may need to run this tool multiple times, depending on the extent of modifications required for your project. ", -1)),
      o[2] || (o[2] = c("p", null, "The following actions should be performed:", -1)),
      c("div", KU, [
        c("table", XU, [
          o[0] || (o[0] = c("thead", null, [
            c("tr", null, [
              c("th", { scope: "col" }, "#"),
              c("th", { scope: "col" }, "description"),
              c("th", { scope: "col" }, "criticality"),
              c("th", { scope: "col" }, "action type")
            ])
          ], -1)),
          c("tbody", null, [
            (g(!0), E(G, null, ge(e.commands, (i, r) => (g(), E("tr", {
              key: `${r}-${i == null ? void 0 : i.id}`,
              class: "command",
              "data-id": i.id
            }, [
              c("td", null, F(r + 1), 1),
              c("td", null, [
                c("span", JU, F(i.description), 1)
              ]),
              c("td", QU, [
                c("span", {
                  class: Se(["badge", `bg-${t(
                    i.criticality
                  )}`])
                }, F(i.criticality), 3)
              ]),
              c("td", ZU, [
                c("i", {
                  class: Se([
                    "fas",
                    n(i.action_type)
                  ]),
                  "fixed-width": ""
                }, null, 2)
              ])
            ], 8, qU))), 128))
          ])
        ])
      ])
    ]));
  }
}, tj = /* @__PURE__ */ oe(ej, [["__scopeId", "data-v-66acddb0"]]), nj = { key: 0 }, sj = ["disabled"], oj = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw me-1"
}, rj = {
  key: 1,
  class: "fas fa-wrench fa-fw me-1"
}, ij = {
  __name: "ActionButton",
  emits: ["fix-success", "fix-error"],
  setup(e, { emit: t }) {
    const n = vg(), s = zU(), o = t, i = k(() => (s == null ? void 0 : s.loading) ?? !1);
    async function r() {
      var l, u;
      let a = "";
      try {
        const d = await s.fixDesign(), f = ((l = d == null ? void 0 : d.data) == null ? void 0 : l.success) ?? !1;
        a = ((u = d == null ? void 0 : d.data) == null ? void 0 : u.message) ?? "", o(f === !0 ? "fix-success" : "fix-error", a);
      } catch (d) {
        a = Gs(d), o("fix-error", a);
      }
    }
    return (a, l) => {
      var u;
      return (u = C(n)) != null && u.canBeModified ? (g(), E("div", nj, [
        c("button", {
          class: "btn btn-sm btn-success",
          onClick: r,
          disabled: i.value
        }, [
          i.value ? (g(), E("i", oj)) : (g(), E("i", rj)),
          l[0] || (l[0] = c("span", null, "Fix design", -1))
        ], 8, sj)
      ])) : ne("", !0);
    };
  }
}, aj = {
  class: "card",
  style: { width: "18rem" }
}, lj = { class: "card-body" }, cj = {
  __name: "CriticalityLevelsLegend",
  setup(e) {
    function t(n) {
      switch (n) {
        case 1:
          return "info";
        case 2:
          return "primary";
        case 3:
          return "warning";
        case 4:
          return "danger";
        default:
          return "secondary";
      }
    }
    return (n, s) => (g(), E("div", aj, [
      c("div", lj, [
        s[4] || (s[4] = c("h5", { class: "card-title" }, "Criticality levels", -1)),
        c("div", null, [
          c("section", null, [
            c("span", null, [
              c("span", {
                class: Se(["badge", `bg-${t(1)}`])
              }, "1", 2),
              s[0] || (s[0] = te(": low"))
            ])
          ]),
          c("section", null, [
            c("span", null, [
              c("span", {
                class: Se(["badge", `bg-${t(2)}`])
              }, "2", 2),
              s[1] || (s[1] = te(": medium"))
            ])
          ]),
          c("section", null, [
            c("span", null, [
              c("span", {
                class: Se(["badge", `bg-${t(3)}`])
              }, "3", 2),
              s[2] || (s[2] = te(": high"))
            ])
          ]),
          c("section", null, [
            c("span", null, [
              c("span", {
                class: Se(["badge", `bg-${t(4)}`])
              }, "4", 2),
              s[3] || (s[3] = te(": critical"))
            ])
          ])
        ])
      ])
    ]));
  }
}, uj = {}, dj = {
  class: "card",
  style: { width: "18rem" }
};
function fj(e, t) {
  return g(), E("div", dj, t[0] || (t[0] = [
    Av('<div class="card-body"><h5 class="card-title">Action Types</h5><div><section><div id="legend-action-automatic"><i class="fas fa-wand-magic-sparkles fa-fw"></i><span>: automatic</span></div></section><section><div id="legend-action-manual"><i class="fas fa-user fa-fw"></i><span>: manual</span></div></section></div></div>', 1)
  ]));
}
const pj = /* @__PURE__ */ oe(uj, [["render", fj]]), hj = {
  __name: "WarningsList",
  setup(e) {
    const t = vg(), n = k(() => t.warnings);
    return (s, o) => (g(), E("div", null, [
      (g(!0), E(G, null, ge(n.value, (i, r) => (g(), E("div", {
        key: r,
        class: Se(["alert", `alert-${i == null ? void 0 : i.variant}`])
      }, [
        o[0] || (o[0] = c("i", { class: "fas fa-info-circle fa-fw me-1" }, null, -1)),
        c("span", null, F(i == null ? void 0 : i.message), 1)
      ], 2))), 128))
    ]));
  }
}, mj = { key: 0 }, vj = { class: "toast-container position-fixed top-0 end-0 p-3" }, gj = { class: "mt-2 d-flex" }, _j = ["onClick"], yj = { class: "d-flex gap-2" }, bj = ["onClick"], Ej = {
  __name: "App",
  setup(e) {
    const t = vg(), n = fs(), s = I(5e3), o = I(2e4), i = k(() => t == null ? void 0 : t.error), r = k(() => (t == null ? void 0 : t.ready) ?? !1), a = k(() => (t == null ? void 0 : t.commands) ?? []), l = I();
    function u() {
      var p;
      (p = l.value) == null || p.show();
    }
    async function d(p) {
      var h;
      (h = l.value) == null || h.hide(), await n.alert({ title: "Success", body: p }), t.init();
    }
    async function f(p) {
      var h;
      (h = l.value) == null || h.hide(), await n.alert({ title: "Error", body: p }), t.init();
    }
    return vt(() => {
      t.init();
    }), (p, h) => {
      var _;
      const m = le("b-toast"), v = le("b-modal");
      return r.value ? (g(), E("div", mj, [
        c("div", vj, [
          i.value ? (g(), se(m, {
            key: 0,
            visible: "",
            autohide: !1,
            variant: "danger",
            title: "Design Health check error"
          }, {
            default: B(() => [
              te(F(i.value), 1)
            ]),
            _: 1
          })) : ((_ = a.value) == null ? void 0 : _.length) === 0 ? (g(), se(m, {
            key: 1,
            visible: "",
            delay: s.value,
            variant: "success"
          }, {
            title: B(() => h[0] || (h[0] = [
              c("div", { class: "me-auto" }, [
                c("span", { class: "d-block" }, "Design Health check")
              ], -1)
            ])),
            default: B(() => [
              h[1] || (h[1] = c("i", { class: "fas fa-check-to-slot fa-fw me-1" }, null, -1)),
              h[2] || (h[2] = c("span", null, "All tests successful", -1))
            ]),
            _: 1
          }, 8, ["delay"])) : (g(), se(m, {
            key: 2,
            visible: "",
            delay: o.value,
            variant: "warning"
          }, {
            title: B(() => h[3] || (h[3] = [
              c("div", { class: "me-auto" }, [
                c("span", { class: "d-block" }, "Design mismatch")
              ], -1)
            ])),
            default: B(({ hide: b }) => [
              h[5] || (h[5] = c("i", { class: "fas fa-circle-exclamation fa-fw me-1" }, null, -1)),
              h[6] || (h[6] = c("span", null, "The design of this project could prevent the Data Mart feature from working as intended.", -1)),
              c("div", gj, [
                c("button", {
                  class: "ms-auto btn btn-sm btn-secondary",
                  onClick: (w) => u(b())
                }, h[4] || (h[4] = [
                  c("i", { class: "fas fa-circle-info fa-fw me-1" }, null, -1),
                  c("span", null, "Learn more", -1)
                ]), 8, _j)
              ])
            ]),
            _: 1
          }, 8, ["delay"]))
        ]),
        D(v, {
          ref_key: "commandsModalRef",
          ref: l,
          size: "lg",
          title: "Design mismatch"
        }, {
          footer: B(({ hide: b }) => [
            D(ij, {
              onFixSuccess: d,
              onFixError: f
            }),
            c("button", {
              class: "btn btn-sm btn-secondary",
              onClick: b
            }, h[7] || (h[7] = [
              c("i", { class: "fas fa-times fa-fw me-1" }, null, -1),
              c("span", null, "Close", -1)
            ]), 8, bj)
          ]),
          default: B(() => [
            c("div", null, [
              D(tj, { commands: a.value }, null, 8, ["commands"]),
              D(hj),
              c("div", yj, [
                D(cj),
                D(pj)
              ])
            ])
          ]),
          _: 1
        }, 512)
      ])) : ne("", !0);
    };
  }
}, pde = (e) => {
  const t = wn(Ej);
  return t.use(Cs), t.use(ai()), t.mount(e), { app: t };
}, LS = () => qe({
  counter: 123
}), wj = Ns("test", LS), Sj = Ns("test", LS, !0), xj = { class: "d-inline-block" }, mh = {
  __name: "CounterViewer",
  props: {
    counter: { type: Number, default: 0 }
  },
  setup(e) {
    return (t, n) => (g(), E("div", xj, F(e.counter), 1));
  }
}, Nj = { class: "border rounded p-2 my-2" }, Cj = {
  __name: "App",
  setup(e) {
    const t = $e("store"), n = wj(), s = Sj();
    function o() {
      console.log(t, "sasas"), console.log(n == null ? void 0 : n.counter), t.test.counter++;
    }
    function i() {
      s.counter++;
    }
    function r() {
      n.counter++;
    }
    return (a, l) => (g(), E("div", Nj, [
      c("button", { onClick: o }, "increment store"),
      c("button", { onClick: i }, "increment shared"),
      c("button", { onClick: r }, "increment use"),
      c("div", null, [
        l[0] || (l[0] = c("span", { class: "fw-bold" }, "Store: ", -1)),
        D(mh, {
          counter: C(n).counter
        }, null, 8, ["counter"])
      ]),
      c("div", null, [
        l[1] || (l[1] = c("span", { class: "fw-bold" }, "Injected Store: ", -1)),
        D(mh, {
          counter: C(t).test.counter
        }, null, 8, ["counter"])
      ]),
      c("div", null, [
        l[2] || (l[2] = c("span", { class: "fw-bold" }, "Shared Store: ", -1)),
        D(mh, {
          counter: C(s).counter
        }, null, 8, ["counter"])
      ]),
      c("pre", null, F(a.$store), 1)
    ]));
  }
}, hde = (e) => {
  const t = wn(Cj);
  return t.use(Cs), t.use(ai()), t.mount(e), { app: t };
}, Oj = Bo(), gg = Ho(Oj, ["pid"], { timeout: 0 }), Tj = (e, t = null, n = {}) => {
  const s = {
    route: "FhirMappingHelperController:getResource",
    mrn: e,
    fhir_category: t,
    params: n
  };
  return gg.get("", { params: s });
}, $j = (e, t, n) => {
  const s = {
    route: "FhirMappingHelperController:getFhirRequest"
  }, o = {
    relative_url: t,
    options: n,
    method: e
  };
  return gg.post("", o, { params: s });
}, kj = (e = {}) => {
  const t = {
    route: "FhirMappingHelperController:getSettings",
    params: e
  };
  return gg.get("", { params: t });
}, Dj = (e, t) => {
  const n = qe({
    category: e,
    loading: !0,
    error: null,
    data: null,
    get total() {
      var o, i;
      return ((i = (o = this.data) == null ? void 0 : o.data) == null ? void 0 : i.length) ?? 0;
    }
  });
  return (async () => {
    try {
      const o = await t();
      n.data = (o == null ? void 0 : o.data) ?? [];
    } catch (o) {
      n.error = Gs(o);
    } finally {
      n.loading = !1;
    }
  })(), n;
}, Rj = [25, 50, 100, 250], VS = (e, t) => {
  if (e === null)
    return !1;
  if (typeof e == "string" || typeof e == "number" || typeof e == "boolean") {
    const n = new RegExp(t, "i");
    return e.toString().match(n);
  }
  if (typeof e == "object") {
    for (const [n, s] of Object.entries(e))
      if (VS(s, t))
        return !0;
  }
  return !1;
}, Ij = (e, t, n = "") => {
  const s = e.visibleStatuses, o = [
    ({ data: r }) => VS(r, n),
    (r) => Aj(r, s)
  ];
  return TS(((r) => {
    let a = [...r];
    return a = a.filter((l) => {
      e.queryError = null;
      try {
        for (const u of o)
          if (!u(l)) return !1;
        return !0;
      } catch (u) {
        return console.log(u), e.queryError = "Please use a valid regular expression", !1;
      }
    }), a;
  })(t), { perPageOptions: Rj });
}, Aj = (e, t) => {
  var s;
  if ((t == null ? void 0 : t.length) === 0) return !0;
  const n = (s = e == null ? void 0 : e.mapping_status) == null ? void 0 : s.status;
  return console.log(n), t.includes(n);
}, Mj = () => qe({
  mrn: null,
  dateFrom: null,
  dateTo: null,
  results: [],
  // all fetching processes
  rotate: !1,
  // rotate results
  active: null,
  pagination: null,
  query: "",
  queryError: null,
  visibleStatuses: [],
  get patient() {
    var n, s, o;
    const t = this.getProcessByCategory("Demographics");
    return (o = (s = (n = t == null ? void 0 : t.data) == null ? void 0 : n.data) == null ? void 0 : s[0]) == null ? void 0 : o.data;
  },
  get total() {
    let t = 0;
    for (const n of this.results)
      t += n.total;
    return t;
  },
  /**
   * overall loading state
   */
  get loading() {
    for (const t of this.results)
      if (t.loading) return !0;
    return !1;
  },
  /**
   * get a date range in a FHIR compatible format
   */
  get dateRange() {
    const t = (i) => {
      if (typeof i == "string" && i.trim() !== "" && (i = me(i), !!i.isValid()))
        return i.format("YYYY-MM-DD");
    }, n = [], s = t(this.dateFrom), o = t(this.dateTo);
    return s && n.push(`ge${s}`), o && n.push(`le${o}`), n;
  },
  getProcessByCategory(t) {
    return this.results.find((s) => s.category === t);
  },
  async fetchAll(t, n = {}) {
    var r;
    (() => {
      this.active = null, this.results = [];
    })();
    let o = null;
    ((r = this.dateRange) == null ? void 0 : r.length) > 0 && (n.date = this.dateRange);
    const i = [];
    for (const a of t) {
      o = a;
      try {
        let l = {};
        const d = Dj(o, () => l = Tj(
          this.mrn,
          o,
          n
        ));
        this.results.push(d), i.push(l);
      } catch {
        console.log(`there was an error fetching ${o}`);
      }
    }
    return Promise.allSettled(i);
  },
  hasFilters() {
    var t, n;
    return ((t = this.query) == null ? void 0 : t.length) > 0 || ((n = this.visibleStatuses) == null ? void 0 : n.length) > 0;
  },
  removeFilters() {
    this.setQuery(""), this.queryError = null, this.setVisibleStatuses([]);
  },
  /**
   * set the active process
   * and update the pagination
   * @param {Object} process 
   */
  setActive(t) {
    this.active = t, this.removeFilters(), this.updatePagination();
  },
  /**
   * set the query
   * and update the pagination
   * @param {String} process 
   */
  setQuery(t) {
    this.query = t, this.updatePagination();
  },
  setVisibleStatuses(t) {
    this.visibleStatuses = t, this.updatePagination();
  },
  updatePagination() {
    var n, s;
    const t = ((s = (n = this.active) == null ? void 0 : n.data) == null ? void 0 : s.data) ?? [];
    this.pagination = qe(Ij(this, t, this.query));
  }
}), Pj = () => qe({
  categories: [],
  selectedCategories: [],
  async fetchCategories() {
    const e = await kj(), t = e == null ? void 0 : e.data, n = (t == null ? void 0 : t.available_categories) ?? [];
    return this.selectedCategories = this.categories = n, t;
  }
}), Lj = (e) => typeof e == "string" || e instanceof String, tb = ["GET", "POST", "PUT", "DELETE"], Vj = () => qe({
  loading: !1,
  response: null,
  relativeURL: "",
  methods: [...tb],
  method: tb[0],
  parameters: [],
  addParameter() {
    const e = qe({
      key: "",
      value: "",
      enabled: !0
    });
    this.parameters.push(e);
  },
  removeParameter(e) {
    const t = this.parameters.findIndex((n) => n === e);
    return t < 0 ? !1 : (this.parameters.splice(t, 1), !0);
  },
  async fetch() {
    var e, t;
    try {
      this.loading = !0, this.response = null;
      const n = this.parameters.filter(
        (i) => i.enabled
      ), s = {};
      for (const i of n) {
        const { key: r, value: a } = i;
        Lj(r) && (Array.isArray(s[r]) || (s[r] = []), s[r].push(a));
      }
      const o = await $j(
        this.method,
        this.relativeURL,
        s
      );
      this.response = (t = (e = o == null ? void 0 : o.data) == null ? void 0 : e.metadata) == null ? void 0 : t.payload;
    } catch (n) {
      this.response = Gs(n);
    } finally {
      this.loading = !1;
    }
  }
}), Go = Ns("search", Mj), ou = Ns("customRequest", Vj), FS = Ns("settings", Pj), Fj = {
  key: 0,
  class: "alert alert-danger m-2"
}, Uj = { style: { "white-space": "pre" } }, jj = {
  __name: "App",
  setup(e) {
    const t = FS(), n = I(!1), s = I();
    return vt(async () => {
      try {
        s.value = null, n.value = !0, await t.fetchCategories();
      } catch (o) {
        s.value = Gs(o), console.log("There was an error loading the settings.", o);
      } finally {
        n.value = !1;
      }
    }), (o, i) => {
      const r = le("router-view");
      return g(), E(G, null, [
        s.value ? (g(), E("div", Fj, [
          c("span", Uj, F(s.value), 1)
        ])) : ne("", !0),
        n.value ? (g(), E(G, { key: 1 }, [
          i[0] || (i[0] = c("i", { class: "fas fa-spinner fa-spin fa-fw me-1" }, null, -1)),
          i[1] || (i[1] = c("span", null, "Loading...", -1))
        ], 64)) : s.value ? ne("", !0) : (g(), se(r, { key: 2 }))
      ], 64);
    };
  }
}, Bj = { class: "nav nav-tabs" }, Hj = {
  __name: "NavigationBar",
  setup(e) {
    const t = {
      props: { ...Ja.props },
      setup(s, { slots: o }) {
        const { href: i, isExactActive: r } = km(s);
        return () => Co(
          Ja,
          { ...s, custom: !0 },
          () => Co(
            n,
            { active: r.value, href: i.value },
            () => o.default()
          )
        );
      }
    }, n = {
      props: {
        active: { type: Boolean },
        href: { type: String }
      },
      setup(s, { slots: o }) {
        return () => Co(
          "li",
          {
            class: { "nav-item": !0 }
          },
          [
            Co(
              "a",
              {
                class: { active: s.active, "nav-link": !0 },
                href: s.href
              },
              o.default()
            )
          ]
        );
      }
    };
    return (s, o) => (g(), E("ul", Bj, [
      D(t, { to: { name: "home" } }, {
        default: B(() => o[0] || (o[0] = [
          te("Home")
        ])),
        _: 1
      }),
      D(t, { to: { name: "custom-request" } }, {
        default: B(() => o[1] || (o[1] = [
          te("Custom request")
        ])),
        _: 1
      })
    ]));
  }
}, Yj = /* @__PURE__ */ oe(Hj, [["__scopeId", "data-v-33b04e66"]]), Wj = {
  __name: "MainLayout",
  setup(e) {
    return (t, n) => {
      const s = le("router-view");
      return g(), E("div", null, [
        D(Yj, { class: "mb-2" }),
        D(s)
      ]);
    };
  }
}, Gj = ["data-key"], zj = ["data-value", "innerHTML"], Kj = {
  __name: "ValueViewer",
  props: {
    value: {}
  },
  setup(e) {
    const t = (n) => !isNaN(n);
    return (n, s) => e.value !== null && typeof e.value == "object" ? (g(!0), E(G, { key: 0 }, ge(e.value, (o, i) => (g(), E("div", {
      key: i,
      class: "table-cell value-wrapper"
    }, [
      t(i) ? ne("", !0) : (g(), E("span", {
        key: 0,
        class: "cell-key text-muted me-2",
        "data-key": i
      }, F(`${i}:`), 9, Gj)),
      D(Vm, { value: o }, null, 8, ["value"])
    ]))), 128)) : (g(), E("span", {
      key: 1,
      class: "cell-value",
      "data-value": e.value,
      innerHTML: e.value
    }, null, 8, zj));
  }
}, Vm = /* @__PURE__ */ oe(Kj, [["__scopeId", "data-v-29dbcf0d"]]), Xj = {
  __name: "TextMarker",
  props: {
    query: { type: String }
  },
  setup(e) {
    const t = e, n = I(null), o = (() => {
      const r = "data-marker-id";
      let a = 1;
      const l = /* @__PURE__ */ new Map(), u = () => {
        if (l.size > 0)
          for (const [_, { marked: b, text: w }] of l)
            b == null || b.replaceWith(w), l.delete(_);
      }, d = (_, b) => {
        a++, _.setAttribute(r, a), _.setAttribute("key", `${r}-${a}`), l.set(a, { marked: _, text: b });
      }, f = (_, b, w) => {
        const y = document.createElement("span"), x = document.createTextNode(_), N = document.createElement("mark");
        N.textContent = b;
        const S = document.createTextNode(w);
        return y.appendChild(x), y.appendChild(N), y.appendChild(S), y;
      }, p = (_, b = "") => {
        try {
          return new RegExp(_, b);
        } catch {
          return console.log("Invalid regular expression"), !1;
        }
      }, h = (_, b) => {
        var $, T, R;
        if (_.nodeValue === "") return;
        const w = p(
          `(?<before>.*?)(?<found>${b})(?<after>.*)`,
          "i"
        );
        if (!w) return;
        const y = _.nodeValue.match(w);
        if (!y || !y.groups || y.groups.found === "") return;
        const x = ($ = y.groups) == null ? void 0 : $.before, N = (T = y.groups) == null ? void 0 : T.found, S = (R = y.groups) == null ? void 0 : R.after, O = f(x, N, S);
        d(O, _), _.replaceWith(O);
      }, m = (_, b) => {
        for (let w of [..._.childNodes])
          w.nodeType === Node.TEXT_NODE ? h(w, b) : m(w, b);
      };
      return (_, b) => {
        u(), m(_, b);
      };
    })(n.value), i = _E();
    return Ft(() => {
      i.default(), n.value && o(n.value, t.query);
    }), (r, a) => (g(), E("span", {
      ref_key: "rootEl",
      ref: n,
      key: `marker-${e.query}`
    }, [
      fe(r.$slots, "default", {}, void 0, !0)
    ]));
  }
}, nb = /* @__PURE__ */ oe(Xj, [["__scopeId", "data-v-6d6d7426"]]), qj = {
  key: 0,
  class: "badge rounded-pill text-bg-primary"
}, Jj = {
  key: 1,
  class: "badge rounded-pill text-bg-light"
}, Qj = {
  __name: "MappingStatus",
  props: {
    mapped: {
      type: Boolean
    }
  },
  setup(e) {
    return (t, n) => (g(), E("div", null, [
      e.mapped ? (g(), E("span", qj, "Mapped")) : (g(), E("span", Jj, "Not Mapped"))
    ]));
  }
}, Zj = { "data-table-wrapper": "" }, e6 = {
  key: 0,
  class: "rotated-entries border p-2"
}, t6 = ["data-key"], n6 = {
  key: 1,
  class: "table table-bordered table-striped table-hover"
}, s6 = ["data-status"], o6 = { class: "badge round-pill bg-primary" }, r6 = {
  key: 0,
  class: "text-muted fst-italic"
}, i6 = {
  __name: "ResourceEntriesTable",
  setup(e) {
    function t(u) {
      const d = /* @__PURE__ */ new Set();
      return u.forEach((f) => {
        Object.keys(f).forEach((p) => {
          d.add(p);
        });
      }), Array.from(d);
    }
    const n = Go(), s = k(() => n.pagination.items), o = k(() => n.rotate), i = k(() => s.value.map(({ data: u }) => u)), r = k(
      () => s.value.map(({ mapping_status: u }) => u ?? [])
    );
    function a(u) {
      var d;
      return (d = r.value) == null ? void 0 : d[u];
    }
    const l = k(() => t(i.value));
    return (u, d) => (g(), E("div", Zj, [
      o.value ? (g(), E("div", e6, [
        (g(!0), E(G, null, ge(i.value, (f, p) => (g(), E("div", {
          key: `index-${p}`,
          class: "rotated-entry border mb-2"
        }, [
          (g(!0), E(G, null, ge(l.value, (h) => (g(), E("div", {
            key: `key-${h}`,
            class: "value-wrapper border-bottom p-2"
          }, [
            c("span", {
              class: "fw-bold me-2",
              "data-key": h
            }, F(h) + ":", 9, t6),
            D(nb, {
              query: C(n).query
            }, {
              default: B(() => [
                D(Vm, {
                  value: f[h]
                }, null, 8, ["value"])
              ]),
              _: 2
            }, 1032, ["query"])
          ]))), 128))
        ]))), 128))
      ])) : (g(), E("table", n6, [
        c("thead", null, [
          c("tr", null, [
            d[0] || (d[0] = c("th", null, [
              c("span", null, "Mapping status")
            ], -1)),
            (g(!0), E(G, null, ge(l.value, (f, p) => (g(), E("th", {
              key: `key-${p}`
            }, [
              c("span", null, F(f), 1)
            ]))), 128))
          ])
        ]),
        c("tbody", null, [
          (g(!0), E(G, null, ge(i.value, (f, p) => {
            var h, m, v;
            return g(), E("tr", {
              key: `index-${p}`
            }, [
              c("td", {
                "data-status": u.status = a(p)
              }, [
                c("span", o6, F((m = (h = u.status) == null ? void 0 : h.status) == null ? void 0 : m.toUpperCase()), 1),
                (v = u.status) != null && v.reason ? (g(), E("small", r6, F(u.status.reason), 1)) : ne("", !0)
              ], 8, s6),
              (g(!0), E(G, null, ge(l.value, (_, b) => {
                var w, y, x, N;
                return g(), E("td", {
                  key: `key-${b}-${_}`
                }, [
                  (y = (w = u.status) == null ? void 0 : w.mapped_fields) != null && y.length ? (g(), se(Qj, {
                    key: 0,
                    mapped: (N = (x = u.status) == null ? void 0 : x.mapped_fields) == null ? void 0 : N.includes(_)
                  }, null, 8, ["mapped"])) : ne("", !0),
                  D(nb, {
                    query: C(n).query
                  }, {
                    default: B(() => [
                      D(Vm, {
                        value: f[_]
                      }, null, 8, ["value"])
                    ]),
                    _: 2
                  }, 1032, ["query"])
                ]);
              }), 128))
            ]);
          }), 128))
        ])
      ]))
    ]));
  }
}, a6 = /* @__PURE__ */ oe(i6, [["__scopeId", "data-v-362b77cd"]]), l6 = { key: 0 }, c6 = { class: "text-nowrap d-flex align-items-center" }, u6 = { class: "me-2" }, d6 = { class: "ms-auto" }, f6 = { key: 0 }, p6 = {
  key: 1,
  class: "badge bg-danger rounded-pill"
}, h6 = {
  key: 2,
  class: "badge bg-primary rounded-pill"
}, m6 = { class: "d-flex align-items-center" }, v6 = { class: "ms-auto" }, g6 = { class: "badge bg-primary rounded-pill" }, _6 = ["innerHTML"], y6 = {
  __name: "ResultsDropdown",
  emits: ["result-selected"],
  setup(e, { emit: t }) {
    const n = Go(), s = k(() => n.active), o = k(() => n.results), i = k(() => n.total), a = (() => {
      const u = I("errorModal"), d = I("");
      return { show: async (p) => {
        d.value = (p == null ? void 0 : p.message) || "there was an error fetching this resource", (typeof p == "string" || p instanceof String) && p.trim() !== "" && (d.value = p), u.value.show();
      }, ref: u, message: () => d.value };
    })();
    function l(u) {
      if (u != null && u.error) {
        a.show(u.error);
        return;
      }
      u != null && u.loading || n.setActive(u);
    }
    return (u, d) => {
      var v;
      const f = le("b-dropdown-item"), p = le("b-dropdown-divider"), h = le("b-dropdown"), m = le("b-modal");
      return g(), E(G, null, [
        D(h, { size: "sm" }, {
          button: B(() => [
            s.value ? (g(), E(G, { key: 1 }, [
              te(F(s.value.category), 1)
            ], 64)) : (g(), E("span", l6, "Select a resource..."))
          ]),
          default: B(() => [
            (g(!0), E(G, null, ge(o.value, (_, b) => (g(), se(f, {
              key: b,
              active: s.value == _,
              onClick: (w) => l(_),
              disabled: _.loading
            }, {
              default: B(() => {
                var w, y;
                return [
                  c("div", c6, [
                    c("span", u6, F(_.category), 1),
                    c("span", d6, [
                      _.loading ? (g(), E("span", f6, d[0] || (d[0] = [
                        c("i", { class: "fas fa-spinner fa-spin fa-fw" }, null, -1)
                      ]))) : _ != null && _.error ? (g(), E("span", p6, "error")) : (g(), E("span", h6, F((y = (w = _ == null ? void 0 : _.data) == null ? void 0 : w.data) == null ? void 0 : y.length), 1))
                    ])
                  ])
                ];
              }),
              _: 2
            }, 1032, ["active", "onClick", "disabled"]))), 128)),
            D(p),
            D(f, null, {
              default: B(() => [
                c("span", m6, [
                  d[1] || (d[1] = c("span", { class: "fw-bold" }, "Total", -1)),
                  c("span", v6, [
                    c("span", g6, F(i.value), 1)
                  ])
                ])
              ]),
              _: 1
            })
          ]),
          _: 1
        }),
        D(m, {
          ref: (v = C(a)) == null ? void 0 : v.ref,
          size: "xl",
          class: "modal-error",
          "ok-only": ""
        }, {
          title: B(() => d[2] || (d[2] = [
            te("Error")
          ])),
          default: B(() => {
            var _;
            return [
              c("div", {
                innerHTML: (_ = C(a)) == null ? void 0 : _.message()
              }, null, 8, _6)
            ];
          }),
          _: 1
        }, 512)
      ], 64);
    };
  }
}, b6 = /* @__PURE__ */ oe(y6, [["__scopeId", "data-v-10b35a9e"]]), E6 = {
  __name: "RotateResultsButton",
  setup(e) {
    const t = Go();
    function n() {
      t.rotate = !t.rotate;
    }
    return (s, o) => (g(), E("div", null, [
      c("button", {
        class: "btn btn-sm btn-secondary",
        onClick: n
      }, [
        c("i", {
          class: Se(["fas fa-sync fa-fw me-1", { "fa-rotate-90": C(t).rotate }])
        }, null, 2),
        o[0] || (o[0] = c("span", null, "Rotate results", -1))
      ])
    ]));
  }
}, w6 = /* @__PURE__ */ oe(E6, [["__scopeId", "data-v-d9820123"]]), S6 = { class: "" }, x6 = { class: "fw-bold" }, N6 = {
  key: 0,
  class: "fst-italic type-null"
}, C6 = {
  key: 1,
  class: "type-boolean"
}, O6 = {
  key: 2,
  class: "type-number"
}, T6 = {
  key: 3,
  class: "type-string"
}, $6 = {
  __name: "JsonTree",
  props: {
    json: { default: null },
    index: { type: Number, default: 0 }
  },
  setup(e) {
    const t = e, n = I(!1);
    function s(a) {
      return Array.isArray(a) ? "array" : typeof a == "object" && a !== null ? "object" : typeof a == "number" ? "number" : typeof a == "string" ? "string" : typeof a == "boolean" ? "boolean" : a === null ? "null" : "unknown";
    }
    const o = k(() => s(t.json)), i = k(() => {
      const a = {
        open: "",
        close: ""
      };
      return o.value === "array" ? (a.open = "[", a.close = "]") : o.value === "object" && (a.open = "{", a.close = "}"), a;
    });
    function r() {
      n.value = !n.value;
    }
    return (a, l) => (g(), E("span", {
      class: Se({ collapsed: n.value })
    }, [
      o.value === "object" || o.value === "array" ? (g(), E("span", {
        key: 0,
        class: "indicator me-1",
        onClick: Rt(r, ["stop"])
      })) : ne("", !0),
      c("span", null, F(i.value.open), 1),
      L(c("span", S6, [
        (g(!0), E(G, null, ge(e.json, (u, d) => (g(), E("div", {
          key: `${e.index}-el-${d}`,
          class: "ms-4"
        }, [
          c("span", x6, F(d) + ": ", 1),
          Array.isArray(u) ? (g(), se(Qd, {
            key: 0,
            index: e.index + 1,
            json: u
          }, null, 8, ["index", "json"])) : typeof u == "object" && u !== null ? (g(), se(Qd, {
            key: 1,
            index: e.index + 1,
            json: u
          }, null, 8, ["index", "json"])) : (g(), E(G, { key: 2 }, [
            s(u) === "null" ? (g(), E("span", N6, "null")) : s(u) === "boolean" ? (g(), E("span", C6, F(u), 1)) : s(u) === "number" ? (g(), E("span", O6, F(u), 1)) : s(u) === "string" ? (g(), E("span", T6, '"' + F(u) + '"', 1)) : ne("", !0),
            l[0] || (l[0] = c("span", null, ",", -1))
          ], 64))
        ]))), 128))
      ], 512), [
        [Gi, !n.value]
      ]),
      c("span", null, F(i.value.close), 1)
    ], 2));
  }
}, Qd = /* @__PURE__ */ oe($6, [["__scopeId", "data-v-01ff7aaf"]]), k6 = ["disabled"], D6 = { class: "tree-wrapper" }, R6 = {
  __name: "ShowCodeButton",
  setup(e) {
    const t = Go(), n = an(), s = gl(), o = I(), i = k(() => {
      var l, u, d;
      return (d = (u = (l = t.active) == null ? void 0 : l.data) == null ? void 0 : u.metadata) == null ? void 0 : d.payload;
    });
    function r() {
      if (!i.value) return;
      const l = JSON.stringify(i.value, null, "	");
      rp(l, {});
    }
    async function a() {
      try {
        const l = JSON.stringify(i.value, null, 2);
        await s.copy(l), n.toast({ title: "Success", body: "Payload copied to clipboard" });
      } catch (l) {
        n.toast({
          title: "Error",
          body: `Payload NOT copied to clipboard - ${l}`
        });
      }
    }
    return (l, u) => {
      const d = le("b-modal");
      return g(), E(G, null, [
        c("div", null, [
          c("button", {
            class: "btn btn-sm btn-outline-secondary",
            onClick: u[0] || (u[0] = (f) => o.value.show()),
            disabled: !i.value
          }, u[2] || (u[2] = [
            c("i", { class: "fas fa-code fa-fw me-1" }, null, -1),
            c("span", null, "Show payload", -1)
          ]), 8, k6)
        ]),
        D(d, {
          ref_key: "jsonModalRef",
          ref: o,
          size: "xl",
          "ok-only": "",
          title: "Payload"
        }, {
          footer: B(({}) => [
            c("div", { class: "d-flex gap-2" }, [
              c("button", {
                class: "btn btn-sm btn-outline-primary",
                onClick: a
              }, u[3] || (u[3] = [
                c("i", { class: "fas fa-copy fa-fw me-1" }, null, -1),
                c("span", null, "Copy", -1)
              ])),
              c("button", {
                class: "btn btn-sm btn-outline-primary",
                onClick: r
              }, u[4] || (u[4] = [
                c("i", { class: "fas fa-file-arrow-down fa-fw me-1" }, null, -1),
                c("span", null, "Download", -1)
              ]))
            ]),
            c("div", null, [
              c("button", {
                class: "btn btn-sm btn-secondary",
                onClick: u[1] || (u[1] = (f) => o.value.hide())
              }, u[5] || (u[5] = [
                c("span", null, "Close", -1)
              ]))
            ])
          ]),
          default: B(() => [
            c("div", D6, [
              D(Qd, { json: i.value }, null, 8, ["json"])
            ])
          ]),
          _: 1
        }, 512)
      ], 64);
    };
  }
}, I6 = /* @__PURE__ */ oe(R6, [["__scopeId", "data-v-57deab33"]]), A6 = { class: "d-flex align-items-center gap-2" }, M6 = ["title"], P6 = {
  __name: "QueryInput",
  setup(e) {
    const t = Go(), n = ml((i) => {
      t.setQuery(i);
    }, 300), s = k(() => t.queryError), o = k({
      get: () => t.query,
      set: (i) => n(i)
    });
    return (i, r) => (g(), E("div", A6, [
      L(c("input", {
        class: "form-control form-control-sm",
        type: "search",
        name: "query",
        placeholder: "search...",
        "onUpdate:modelValue": r[0] || (r[0] = (a) => o.value = a)
      }, null, 512), [
        [Ve, o.value]
      ]),
      s.value ? (g(), E("span", {
        key: 0,
        title: s.value,
        class: "text-danger"
      }, r[1] || (r[1] = [
        c("i", { class: "fas fa-info-circle fa-fw" }, null, -1)
      ]), 8, M6)) : ne("", !0)
    ]));
  }
}, L6 = {
  "data-prevent-close": "",
  class: "p-2"
}, V6 = ["id", "value"], F6 = ["for"], U6 = {
  __name: "MappingStatusSelect",
  setup(e) {
    const t = Go(), n = k(() => {
      var r, a;
      return ((a = (r = t.active) == null ? void 0 : r.data) == null ? void 0 : a.data) ?? [];
    }), s = k(
      () => n.value.map(({ mapping_status: r }) => r ?? [])
    ), o = k(() => {
      var a;
      const r = new Set(
        (a = s.value) == null ? void 0 : a.map(({ status: l }) => l)
      );
      return Array.from(r);
    }), i = k({
      get: () => t.visibleStatuses,
      set: (r) => {
        t.setVisibleStatuses([...r]);
      }
    });
    return (r, a) => {
      var u;
      const l = le("b-dropdown");
      return g(), se(l, {
        size: "sm",
        disabled: ((u = o.value) == null ? void 0 : u.length) === 0,
        variant: "outline-primary"
      }, {
        button: B(() => a[1] || (a[1] = [
          te("Mapping status")
        ])),
        default: B(() => [
          c("div", L6, [
            (g(!0), E(G, null, ge(o.value, (d, f) => (g(), E("div", {
              key: f,
              class: "form-check form-switch"
            }, [
              L(c("input", {
                class: "form-check-input",
                type: "checkbox",
                id: `status-${f}`,
                value: d,
                "onUpdate:modelValue": a[0] || (a[0] = (p) => i.value = p)
              }, null, 8, V6), [
                [mn, i.value]
              ]),
              c("label", {
                class: "form-check-label",
                for: `status-${f}`
              }, F(d), 9, F6)
            ]))), 128))
          ])
        ]),
        _: 1
      }, 8, ["disabled"]);
    };
  }
}, j6 = { class: "d-flex flex-column border rounded p-2 gap-2" }, B6 = { class: "d-flex gap-2" }, H6 = { class: "d-flex gap-2" }, Y6 = { class: "ms-auto" }, W6 = { class: "d-flex" }, G6 = { class: "d-flex gap-2 ms-auto" }, z6 = {
  __name: "ResultsToolbar",
  setup(e) {
    const t = Go(), n = k({
      get: () => {
        var r;
        return (r = t.pagination) == null ? void 0 : r.limit;
      },
      set: (r) => t.pagination.limit = r
    }), s = k({
      get: () => {
        var r;
        return (r = t.pagination) == null ? void 0 : r.page;
      },
      set: (r) => t.pagination.page = r
    }), o = k({
      get: () => {
        var r;
        return (r = t == null ? void 0 : t.pagination) == null ? void 0 : r.total;
      }
    }), i = k({
      get: () => {
        var r;
        return (r = t.pagination) == null ? void 0 : r.perPageOptions;
      }
    });
    return (r, a) => {
      const l = le("b-pagination"), u = le("b-pagination-dropdown");
      return g(), E("div", j6, [
        c("div", B6, [
          c("div", H6, [
            D(w6),
            D(U6),
            D(P6)
          ]),
          c("div", Y6, [
            D(I6)
          ])
        ]),
        c("div", W6, [
          D(b6),
          c("div", G6, [
            D(l, {
              size: "sm",
              perPage: n.value,
              totalItems: o.value,
              modelValue: s.value,
              "onUpdate:modelValue": a[0] || (a[0] = (d) => s.value = d)
            }, null, 8, ["perPage", "totalItems", "modelValue"]),
            D(u, {
              options: i.value,
              modelValue: n.value,
              "onUpdate:modelValue": a[1] || (a[1] = (d) => n.value = d)
            }, null, 8, ["options", "modelValue"])
          ])
        ])
      ]);
    };
  }
}, K6 = { "data-prevent-close": "" }, X6 = { class: "line-item px-2 text-nowrap border-bottom mb-2" }, q6 = ["indeterminate"], J6 = ["value", "id"], Q6 = ["for"], Z6 = {
  __name: "CategoriesDropdown",
  props: {
    categories: { type: Array },
    selected: { type: Array },
    variant: { type: String, default: "light" }
  },
  emits: ["update:selected"],
  setup(e, { emit: t }) {
    const n = e, s = k(() => {
      var u, d;
      const a = ((u = n == null ? void 0 : n.selected) == null ? void 0 : u.length) ?? 0, l = ((d = n == null ? void 0 : n.categories) == null ? void 0 : d.length) ?? 0;
      return a === 0 ? !1 : a !== l;
    }), o = k({
      get() {
        var a, l;
        return ((a = n == null ? void 0 : n.selected) == null ? void 0 : a.length) === ((l = n == null ? void 0 : n.categories) == null ? void 0 : l.length);
      },
      set(a) {
        a ? i("update:selected", n.categories) : i("update:selected", []);
      }
    }), i = t, r = k({
      get: () => n.selected,
      set: (a) => {
        i("update:selected", a);
      }
    });
    return (a, l) => {
      const u = le("b-dropdown");
      return g(), se(u, {
        variant: e.variant,
        size: "sm"
      }, {
        default: B(() => [
          c("div", K6, [
            c("div", X6, [
              L(c("input", {
                class: "form-check-input",
                type: "checkbox",
                id: "checkbox-all",
                value: !0,
                "onUpdate:modelValue": l[0] || (l[0] = (d) => o.value = d),
                indeterminate: s.value
              }, null, 8, q6), [
                [mn, o.value]
              ]),
              l[2] || (l[2] = c("label", {
                class: "form-label ms-2",
                for: "checkbox-all"
              }, "All categories", -1))
            ]),
            (g(!0), E(G, null, ge(e.categories, (d) => (g(), E("div", {
              key: `${d}`,
              class: "line-item px-2 text-nowrap"
            }, [
              L(c("input", {
                class: "form-check-input",
                type: "checkbox",
                value: d,
                id: `checkbox-${d}`,
                "onUpdate:modelValue": l[1] || (l[1] = (f) => r.value = f)
              }, null, 8, J6), [
                [mn, r.value]
              ]),
              c("label", {
                class: "form-label ms-2",
                for: `checkbox-${d}`
              }, F(d), 9, Q6)
            ]))), 128))
          ])
        ]),
        _: 1
      }, 8, ["variant"]);
    };
  }
}, eB = /* @__PURE__ */ oe(Z6, [["__scopeId", "data-v-89bd9d40"]]), tB = { class: "d-flex" }, nB = { class: "d-flex border p-2 rounded flex-column gap-2" }, sB = { class: "d-flex align-items-center gap-2" }, oB = { class: "d-flex" }, rB = { class: "ms-auto" }, iB = { class: "btn-group" }, aB = ["disabled"], lB = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw me-1"
}, cB = {
  key: 1,
  class: "fas fa-cloud-arrow-down fa-fw me-1"
}, uB = { class: "mx-1 fw-bold" }, dB = {
  __name: "SearchForm",
  setup(e) {
    const t = Go(), n = FS(), s = k(() => n.categories), o = k({
      get: () => n.selectedCategories,
      set: (d) => n.selectedCategories = d
    }), i = k({
      get: () => t.mrn,
      set: (d) => t.mrn = d
    }), r = k({
      get: () => t.dateFrom,
      set: (d) => t.dateFrom = d
    }), a = k({
      get: () => t.dateTo,
      set: (d) => t.dateTo = d
    }), l = () => {
      var f;
      if ((((f = t == null ? void 0 : t.results) == null ? void 0 : f.length) ?? 0) !== 0) {
        for (const p of t.results)
          if (!(p.error || p.total === 0)) {
            t.setActive(p);
            break;
          }
      }
    };
    async function u() {
      t.setActive(null), await t.fetchAll(o.value), t.active === null && l();
    }
    return (d, f) => {
      var p, h, m;
      return g(), E("div", tB, [
        c("div", nB, [
          c("div", sB, [
            c("div", null, [
              f[4] || (f[4] = c("label", {
                class: "form-label",
                for: "mrn"
              }, "MRN", -1)),
              L(c("input", {
                class: "form-control form-control-sm",
                type: "text",
                id: "mrn",
                placeholder: "MRN",
                "onUpdate:modelValue": f[0] || (f[0] = (v) => i.value = v)
              }, null, 512), [
                [Ve, i.value]
              ])
            ]),
            c("div", null, [
              f[5] || (f[5] = c("label", {
                class: "form-label",
                for: "date-from"
              }, "Date from", -1)),
              L(c("input", {
                type: "date",
                class: "form-control form-control-sm",
                id: "date-from",
                placeholder: "date-from",
                "onUpdate:modelValue": f[1] || (f[1] = (v) => r.value = v)
              }, null, 512), [
                [Ve, r.value]
              ])
            ]),
            c("div", null, [
              f[6] || (f[6] = c("label", {
                class: "form-label",
                for: "date-to"
              }, "Date to", -1)),
              L(c("input", {
                type: "date",
                class: "form-control form-control-sm",
                id: "date-to",
                placeholder: "date-to",
                "onUpdate:modelValue": f[2] || (f[2] = (v) => a.value = v)
              }, null, 512), [
                [Ve, a.value]
              ])
            ])
          ]),
          c("div", oB, [
            c("div", rB, [
              c("div", iB, [
                c("button", {
                  class: "btn btn-sm btn-success",
                  onClick: u,
                  disabled: !i.value || C(t).loading || ((p = o.value) == null ? void 0 : p.length) === 0
                }, [
                  C(t).loading ? (g(), E("i", lB)) : (g(), E("i", cB)),
                  f[7] || (f[7] = c("span", null, "Fetch", -1)),
                  c("span", uB, F(((h = o.value) == null ? void 0 : h.length) ?? 0), 1),
                  c("span", null, "resource" + F(((m = o.value) == null ? void 0 : m.length) === 1 ? "" : "s"), 1)
                ], 8, aB),
                D(eB, {
                  categories: s.value,
                  selected: o.value,
                  "onUpdate:selected": f[3] || (f[3] = (v) => o.value = v),
                  variant: "success"
                }, null, 8, ["categories", "selected"])
              ])
            ])
          ])
        ])
      ]);
    };
  }
}, fB = {
  __name: "AnimatedCounter",
  props: {
    value: { type: Number, default: 0 },
    duration: { type: Number, default: 300 }
    //milliseconds
  },
  setup(e) {
    const t = e, n = I(!1), s = I(0), o = I(""), i = OS((r) => {
      o.value = r;
    });
    return Ft(async () => {
      const r = s.value, a = t.value;
      s.value = a, n.value = !0, await i(r, a, t.duration), n.value = !1;
    }), (r, a) => fe(r.$slots, "default", {
      animating: n.value,
      text: o.value
    }, () => [
      c("span", {
        class: Se({ animating: n.value })
      }, F(o.value), 3)
    ]);
  }
}, pB = { class: "border rounded p-2" }, hB = { class: "fw-bold fs-3" }, mB = { class: "d-block text-muted fst-italic total-entries" }, vB = { class: "d-flex align-items-center gap-2" }, gB = { class: "text-muted fst-italic" }, _B = ["disabled"], yB = { key: 0 }, bB = { class: "badge bg-warning" }, EB = { class: "patient-details" }, wB = {
  key: 1,
  style: { "max-width": "500px" }
}, SB = {
  __name: "PatientPreview",
  setup(e) {
    const t = Go(), n = an(), s = gl();
    function o(l) {
      const u = /* @__PURE__ */ new Date(), d = new Date(l), f = u.getFullYear() - d.getFullYear();
      return u.getMonth() < d.getMonth() || u.getMonth() === d.getMonth() && u.getDate() < d.getDate() ? f - 1 : f;
    }
    const i = k(() => t.total), r = k(() => t.patient);
    async function a(l) {
      try {
        await s.copy(l), n.toast({ title: "Success", body: "FHIR ID copied to clipboard" });
      } catch (u) {
        n.toast({
          title: "Error",
          body: `FHIR ID NOT copied to clipboard - ${u}`
        });
      }
    }
    return (l, u) => {
      var d, f, p, h, m, v, _, b, w;
      return g(), E("div", pB, [
        r.value ? (g(), E(G, { key: 0 }, [
          c("span", hB, F(`${(d = r.value) == null ? void 0 : d["name-given"]} ${(f = r.value) == null ? void 0 : f["name-family"]}`), 1),
          c("small", mB, [
            u[1] || (u[1] = te(" Total entries: ")),
            D(fB, { value: i.value }, {
              default: B(({ animating: y, text: x }) => [
                c("span", {
                  class: Se(["counter", { animating: y }])
                }, F(parseInt(x)), 3)
              ]),
              _: 1
            }, 8, ["value"])
          ]),
          c("div", vB, [
            c("small", gB, [
              u[2] || (u[2] = c("span", { class: "fw-bold" }, "FHIR ID", -1)),
              te(": " + F((p = r.value) == null ? void 0 : p["fhir-id"]), 1)
            ]),
            c("button", {
              class: "btn btn-sm btn-outline-primary",
              onClick: u[0] || (u[0] = (y) => {
                var x;
                return a((x = r.value) == null ? void 0 : x["fhir-id"]);
              }),
              disabled: !((h = r.value) != null && h["fhir-id"])
            }, u[3] || (u[3] = [
              c("i", { class: "fas fa-copy fa-fw" }, null, -1)
            ]), 8, _B)
          ]),
          (m = r.value) != null && m.deceasedBoolean ? (g(), E("div", yB, [
            c("span", bB, [
              u[4] || (u[4] = c("span", { class: "fw-bold" }, "Deceased:", -1)),
              c("span", null, F(C(me)((v = r.value) == null ? void 0 : v.deceasedDateTime).format(
                "YYYY-MM-DD"
              )), 1)
            ])
          ])) : ne("", !0),
          c("div", EB, [
            c("div", null, [
              u[5] || (u[5] = c("span", { class: "fw-bold" }, "Gender", -1)),
              te(": " + F((_ = r.value) == null ? void 0 : _.gender), 1)
            ]),
            c("div", null, [
              u[6] || (u[6] = c("span", { class: "fw-bold" }, "DOB", -1)),
              te(": " + F((b = r.value) == null ? void 0 : b.birthDate), 1)
            ]),
            c("div", null, [
              u[7] || (u[7] = c("span", { class: "fw-bold" }, "Age", -1)),
              te(": " + F(o((w = r.value) == null ? void 0 : w.birthDate)), 1)
            ])
          ])
        ], 64)) : (g(), E("div", wB, u[8] || (u[8] = [
          c("span", { class: "fw-bold fs-5 d-block mb-2" }, "No preview available", -1),
          c("span", { class: "fst-italic text-muted" }, 'To display a preview of the patient, select "Demographics" from the dropdown menu and click "Fetch resources."', -1)
        ])))
      ]);
    };
  }
}, xB = /* @__PURE__ */ oe(SB, [["__scopeId", "data-v-1a101241"]]), NB = { class: "d-flex gap-2" }, CB = {
  "data-results": "",
  class: "my-2"
}, OB = {
  key: 0,
  class: "alert alert-info"
}, TB = {
  key: 1,
  class: "border rounded p-2"
}, $B = {
  __name: "HomePage",
  setup(e) {
    const t = Go(), n = k(() => {
      var s;
      return ((s = t.pagination) == null ? void 0 : s.items) ?? [];
    });
    return (s, o) => {
      var r, a;
      const i = le("router-view");
      return g(), E("div", null, [
        c("div", NB, [
          D(dB),
          D(xB, { class: "flex-grow-1" })
        ]),
        (a = (r = C(t)) == null ? void 0 : r.results) != null && a.length ? (g(), se(z6, {
          key: 0,
          class: "my-2"
        })) : ne("", !0),
        c("div", CB, [
          C(t).hasFilters() > 0 ? (g(), E("div", OB, [
            o[2] || (o[2] = c("small", null, "A filter has been applied to the entries", -1)),
            c("button", {
              class: "btn btn-sm btn-outline-secondary ms-2",
              onClick: o[0] || (o[0] = (l) => C(t).removeFilters())
            }, o[1] || (o[1] = [
              c("i", { class: "fas fa-times fa-fw me-1" }, null, -1),
              c("span", null, "Remove filter", -1)
            ]))
          ])) : ne("", !0),
          n.value.length === 0 ? (g(), E("div", TB, o[3] || (o[3] = [
            c("span", { class: "fst-italic" }, "no entries", -1)
          ]))) : (g(), se(a6, { key: 2 }))
        ]),
        D(i)
      ]);
    };
  }
}, kB = { class: "btn-group" }, DB = ["disabled"], RB = ["onClick"], IB = { class: "fst-italic p-2 text-muted" }, AB = { key: 0 }, MB = { class: "d-flex align-items-center" }, PB = { class: "me-2" }, LB = { class: "ms-auto" }, VB = ["onClick"], FB = ["disabled"], sb = "__mapping_helper_requests", UB = {
  __name: "SavedRequestsDropdown",
  setup(e) {
    const t = ou(), n = I([]), s = I(""), o = I(), i = k(() => {
      var p, h;
      return !(((p = t == null ? void 0 : t.relativeURL) == null ? void 0 : p.trim()) !== "" || ((h = t == null ? void 0 : t.parameters) == null ? void 0 : h.length) > 0);
    });
    function r() {
      const p = localStorage.getItem(sb), h = JSON.parse(p) ?? [];
      n.value = h;
    }
    function a() {
      localStorage.setItem(sb, JSON.stringify(Ye(n.value)));
    }
    function l() {
      const p = {
        name: s.value,
        method: t.method,
        relativeURL: t.relativeURL,
        parameters: t.parameters
      };
      n.value.push(p), a(), o.value.hide();
    }
    function u(p) {
      var m;
      const h = (m = n.value) == null ? void 0 : m.findIndex((v) => v === p);
      h < 0 || (n.value.splice(h, 1), a());
    }
    function d() {
      s.value = "", o.value.show();
    }
    function f(p) {
      t.method = p == null ? void 0 : p.method, t.relativeURL = (p == null ? void 0 : p.relativeURL) ?? "", t.parameters = [...(p == null ? void 0 : p.parameters) ?? []];
    }
    return vt(() => r()), (p, h) => {
      const m = le("b-dropdown-divider"), v = le("b-dropdown-item"), _ = le("b-dropdown"), b = le("b-modal");
      return g(), E("div", null, [
        D(_, {
          variant: "success",
          size: "sm"
        }, {
          header: B(({ onButtonClicked: w }) => [
            c("div", kB, [
              c("button", {
                class: "btn btn-outline-info btn-sm",
                onClick: d,
                disabled: i.value
              }, h[1] || (h[1] = [
                c("i", { class: "fas fa-floppy-disk fa-fw me-1" }, null, -1),
                c("span", null, "Save request...", -1)
              ]), 8, DB),
              c("button", {
                type: "button",
                class: "btn btn-sm btn-outline-info dropdown-toggle dropdown-toggle-split",
                onClick: w
              }, h[2] || (h[2] = [
                c("span", { class: "visually-hidden" }, "Toggle Dropdown", -1)
              ]), 8, RB)
            ])
          ]),
          default: B(() => {
            var w;
            return [
              c("div", IB, [
                ((w = n.value) == null ? void 0 : w.length) === 0 ? (g(), E("span", AB, "No saved requests")) : (g(), E(G, { key: 1 }, [
                  h[3] || (h[3] = c("span", null, "Restore a request", -1)),
                  D(m)
                ], 64))
              ]),
              (g(!0), E(G, null, ge(n.value, (y, x) => (g(), se(v, {
                key: x,
                onClick: (N) => f(y)
              }, {
                default: B(() => [
                  c("div", MB, [
                    c("span", PB, F(y.name), 1),
                    c("span", LB, [
                      c("button", {
                        class: "btn btn-sm btn-outline-danger",
                        onClick: Rt((N) => u(y), ["stop"])
                      }, h[4] || (h[4] = [
                        c("i", { class: "fas fa-trash fa-fw" }, null, -1)
                      ]), 8, VB)
                    ])
                  ])
                ]),
                _: 2
              }, 1032, ["onClick"]))), 128))
            ];
          }),
          _: 1
        }),
        D(b, {
          ref_key: "saveRequestModalRef",
          ref: o
        }, {
          header: B(() => h[5] || (h[5] = [
            te("Save request")
          ])),
          footer: B(() => [
            c("div", null, [
              c("button", {
                class: "btn btn-sm btn-primary",
                disabled: !s.value,
                onClick: l
              }, h[6] || (h[6] = [
                c("i", { class: "fas fa-database fa-fw me-1" }, null, -1),
                c("span", null, "Save", -1)
              ]), 8, FB)
            ])
          ]),
          default: B(() => [
            c("div", null, [
              L(c("input", {
                class: "form-control form-control-sm",
                type: "text",
                id: "request-name",
                "onUpdate:modelValue": h[0] || (h[0] = (w) => s.value = w),
                placeholder: "Save as..."
              }, null, 512), [
                [Ve, s.value]
              ])
            ])
          ]),
          _: 1
        }, 512)
      ]);
    };
  }
}, jB = { class: "d-flex" }, BB = { class: "d-flex gap-2 align-items-center ms-auto" }, HB = ["disabled"], YB = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw me-1"
}, WB = {
  key: 1,
  class: "fas fa-cloud-arrow-down fa-fw me-1"
}, GB = {
  __name: "RequestToolbar",
  setup(e) {
    const t = ou(), n = k(() => t.loading), s = k(() => t.relativeURL.trim() === "");
    function o() {
      t.fetch();
    }
    function i() {
      t.addParameter();
    }
    return (r, a) => (g(), E("div", jB, [
      c("div", null, [
        c("button", {
          class: "btn btn-sm btn-outline-success",
          onClick: i
        }, a[0] || (a[0] = [
          c("i", { class: "fas fa-circle-plus fa-fw me-1" }, null, -1),
          c("span", null, "Add query parameter", -1)
        ]))
      ]),
      c("div", BB, [
        D(UB),
        c("button", {
          class: "btn btn-sm btn-outline-primary",
          onClick: o,
          disabled: s.value
        }, [
          n.value ? (g(), E("i", YB)) : (g(), E("i", WB)),
          a[1] || (a[1] = c("span", null, "Fetch", -1))
        ], 8, HB)
      ])
    ]));
  }
}, zB = { class: "table table-bordered table-striped table-hover" }, KB = { key: 0 }, XB = { class: "d-flex" }, qB = ["onUpdate:modelValue"], JB = ["onUpdate:modelValue"], QB = ["onUpdate:modelValue"], ZB = { class: "d-flex gap-2" }, eH = ["onClick"], tH = {
  __name: "ParametersList",
  setup(e) {
    const t = ou();
    function n(s) {
      t.removeParameter(s);
    }
    return (s, o) => {
      var i, r;
      return g(), E("table", zB, [
        o[2] || (o[2] = c("thead", null, [
          c("tr", null, [
            c("th", null, "Enabled"),
            c("th", null, "Key"),
            c("th", null, "Value"),
            c("th", null, "Actions")
          ])
        ], -1)),
        c("tbody", null, [
          ((r = (i = C(t)) == null ? void 0 : i.parameters) == null ? void 0 : r.length) === 0 ? (g(), E("tr", KB, o[0] || (o[0] = [
            c("td", { colspan: "4" }, [
              c("span", { class: "fst-italic" }, "no entries")
            ], -1)
          ]))) : (g(!0), E(G, { key: 1 }, ge(C(t).parameters, (a, l) => (g(), E("tr", { key: l }, [
            c("td", null, [
              c("div", XB, [
                L(c("input", {
                  class: "form-check-input",
                  type: "checkbox",
                  "onUpdate:modelValue": (u) => a.enabled = u,
                  name: "request-enabled"
                }, null, 8, qB), [
                  [mn, a.enabled]
                ])
              ])
            ]),
            c("td", null, [
              L(c("input", {
                class: "form-control form-control-sm",
                type: "text",
                "onUpdate:modelValue": (u) => a.key = u,
                placeholder: "key",
                name: "request-key"
              }, null, 8, JB), [
                [Ve, a.key]
              ])
            ]),
            c("td", null, [
              L(c("input", {
                class: "form-control form-control-sm",
                type: "text",
                "onUpdate:modelValue": (u) => a.value = u,
                placeholder: "value",
                name: "request-value"
              }, null, 8, QB), [
                [Ve, a.value]
              ])
            ]),
            c("td", null, [
              c("div", ZB, [
                c("button", {
                  class: "btn btn-sm btn-danger ms-auto",
                  onClick: (u) => n(a)
                }, o[1] || (o[1] = [
                  c("i", { class: "fas fa-trash fa-fw" }, null, -1)
                ]), 8, eH)
              ])
            ])
          ]))), 128))
        ])
      ]);
    };
  }
}, nH = {
  key: 0,
  class: "border rounded p-2"
}, sH = {
  __name: "ResponseViewer",
  setup(e) {
    const t = ou(), n = an(), s = gl(), o = I(!0);
    function i() {
      const l = t == null ? void 0 : t.response;
      if (!l) return;
      const u = JSON.stringify(l, null, "	");
      rp(u, { fileName: "download.json" });
    }
    async function r() {
      try {
        const l = JSON.stringify(t == null ? void 0 : t.response, null, 2);
        await s.copy(l), n.toast({ title: "Success", body: "Payload copied to clipboard" });
      } catch (l) {
        n.toast({
          title: "Error",
          body: `Payload NOT copied to clipboard - ${l}`
        });
      }
    }
    const a = k(() => t.response);
    return (l, u) => (g(), E("div", null, [
      a.value ? (g(), E("div", nH, [
        u[2] || (u[2] = c("h3", null, "Response", -1)),
        c("div", { class: "d-flex gap-2" }, [
          c("button", {
            class: "btn btn-sm btn-outline-primary",
            onClick: r
          }, u[0] || (u[0] = [
            c("i", { class: "fas fa-copy fa-fw me-1" }, null, -1),
            c("span", null, "Copy", -1)
          ])),
          c("button", {
            class: "btn btn-sm btn-outline-primary",
            onClick: i
          }, u[1] || (u[1] = [
            c("i", { class: "fas fa-file-arrow-down fa-fw me-1" }, null, -1),
            c("span", null, "Download", -1)
          ]))
        ]),
        o.value ? (g(), se(Qd, {
          key: 0,
          json: a.value
        }, null, 8, ["json"])) : ne("", !0)
      ])) : ne("", !0)
    ]));
  }
}, oH = { class: "d-flex flex-column gap-2 border rounded p-2 mb-2" }, rH = { class: "d-flex gap-2 align-items-center" }, iH = { class: "input-group" }, aH = {
  __name: "RequestForm",
  setup(e) {
    const t = ou();
    return (n, s) => (g(), E("div", null, [
      c("div", oH, [
        c("div", rH, [
          c("div", iH, [
            s[1] || (s[1] = c("span", { class: "input-group-text" }, "FHIR endpoint", -1)),
            L(c("input", {
              class: "form-control form-control-sm",
              type: "text",
              placeholder: "e.g.: Patient",
              "onUpdate:modelValue": s[0] || (s[0] = (o) => C(t).relativeURL = o),
              name: "request-relative-url"
            }, null, 512), [
              [Ve, C(t).relativeURL]
            ])
          ])
        ]),
        D(GB)
      ]),
      D(tH),
      D(sH)
    ]));
  }
}, lH = {
  __name: "CustomRequestPage",
  setup(e) {
    return (t, n) => (g(), se(aH));
  }
}, cH = /* @__PURE__ */ oe(lH, [["__scopeId", "data-v-c483f91d"]]), uH = [
  {
    path: "/",
    component: Wj,
    // redirect: '/inbox',
    children: [
      { path: "", name: "home", component: $B },
      {
        path: "custom-request",
        name: "custom-request",
        component: cH
      }
    ]
  },
  { path: "/:pathMatch(.*)*", component: la }
];
let Du;
const dH = () => Du || (Du = ci({
  // Provide the history implementation to use. We are using the hash history for simplicity here.
  history: li(),
  routes: uH
}), Du), mde = (e) => {
  const t = wn(jj);
  t.use(Cs), t.use(ai());
  const n = dH();
  return t.use(n), t.mount(e), { app: t };
}, fH = {}, pH = {
  class: "position-fixed top-0 start-50 translate-middle-x",
  style: { "z-index": "1030" }
}, hH = { class: "mt-2" };
function mH(e, t) {
  const n = le("b-toast");
  return g(), E("div", pH, [
    c("div", hH, [
      D(n, {
        autohide: !1,
        visible: "",
        title: "Loading"
      }, {
        default: B(() => t[0] || (t[0] = [
          c("i", { class: "fas fa-spinner fa-spin fa-fw me-2" }, null, -1),
          c("span", null, "Please wait...", -1)
        ])),
        _: 1
      })
    ])
  ]);
}
const vH = /* @__PURE__ */ oe(fH, [["render", mH]]);
function Ru(e, t, n) {
  return Array.isArray(e) ? (e.length = Math.max(e.length, t), e.splice(t, 1, n), n) : (e[t] = n, n);
}
function vh(e, t) {
  if (Array.isArray(e)) {
    e.splice(t, 1);
    return;
  }
  delete e[t];
}
var _t = {};
let Wl;
const Ac = (e) => Wl = e, US = _t.NODE_ENV !== "production" ? Symbol("pinia") : (
  /* istanbul ignore next */
  Symbol()
);
function Xi(e) {
  return e && typeof e == "object" && Object.prototype.toString.call(e) === "[object Object]" && typeof e.toJSON != "function";
}
var $o;
(function(e) {
  e.direct = "direct", e.patchObject = "patch object", e.patchFunction = "patch function";
})($o || ($o = {}));
const Wr = typeof window < "u", ob = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof global == "object" && global.global === global ? global : typeof globalThis == "object" ? globalThis : { HTMLElement: null };
function gH(e, { autoBom: t = !1 } = {}) {
  return t && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type) ? new Blob(["\uFEFF", e], { type: e.type }) : e;
}
function _g(e, t, n) {
  const s = new XMLHttpRequest();
  s.open("GET", e), s.responseType = "blob", s.onload = function() {
    HS(s.response, t, n);
  }, s.onerror = function() {
    console.error("could not download file");
  }, s.send();
}
function jS(e) {
  const t = new XMLHttpRequest();
  t.open("HEAD", e, !1);
  try {
    t.send();
  } catch {
  }
  return t.status >= 200 && t.status <= 299;
}
function cd(e) {
  try {
    e.dispatchEvent(new MouseEvent("click"));
  } catch {
    const n = document.createEvent("MouseEvents");
    n.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), e.dispatchEvent(n);
  }
}
const ud = typeof navigator == "object" ? navigator : { userAgent: "" }, BS = /Macintosh/.test(ud.userAgent) && /AppleWebKit/.test(ud.userAgent) && !/Safari/.test(ud.userAgent), HS = Wr ? (
  // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program
  typeof HTMLAnchorElement < "u" && "download" in HTMLAnchorElement.prototype && !BS ? _H : (
    // Use msSaveOrOpenBlob as a second approach
    "msSaveOrOpenBlob" in ud ? yH : (
      // Fallback to using FileReader and a popup
      bH
    )
  )
) : () => {
};
function _H(e, t = "download", n) {
  const s = document.createElement("a");
  s.download = t, s.rel = "noopener", typeof e == "string" ? (s.href = e, s.origin !== location.origin ? jS(s.href) ? _g(e, t, n) : (s.target = "_blank", cd(s)) : cd(s)) : (s.href = URL.createObjectURL(e), setTimeout(function() {
    URL.revokeObjectURL(s.href);
  }, 4e4), setTimeout(function() {
    cd(s);
  }, 0));
}
function yH(e, t = "download", n) {
  if (typeof e == "string")
    if (jS(e))
      _g(e, t, n);
    else {
      const s = document.createElement("a");
      s.href = e, s.target = "_blank", setTimeout(function() {
        cd(s);
      });
    }
  else
    navigator.msSaveOrOpenBlob(gH(e, n), t);
}
function bH(e, t, n, s) {
  if (s = s || open("", "_blank"), s && (s.document.title = s.document.body.innerText = "downloading..."), typeof e == "string")
    return _g(e, t, n);
  const o = e.type === "application/octet-stream", i = /constructor/i.test(String(ob.HTMLElement)) || "safari" in ob, r = /CriOS\/[\d]+/.test(navigator.userAgent);
  if ((r || o && i || BS) && typeof FileReader < "u") {
    const a = new FileReader();
    a.onloadend = function() {
      let l = a.result;
      if (typeof l != "string")
        throw s = null, new Error("Wrong reader.result type");
      l = r ? l : l.replace(/^data:[^;]*;/, "data:attachment/file;"), s ? s.location.href = l : location.assign(l), s = null;
    }, a.readAsDataURL(e);
  } else {
    const a = URL.createObjectURL(e);
    s ? s.location.assign(a) : location.href = a, s = null, setTimeout(function() {
      URL.revokeObjectURL(a);
    }, 4e4);
  }
}
function Mn(e, t) {
  const n = "🍍 " + e;
  typeof __VUE_DEVTOOLS_TOAST__ == "function" ? __VUE_DEVTOOLS_TOAST__(n, t) : t === "error" ? console.error(n) : t === "warn" ? console.warn(n) : console.log(n);
}
function yg(e) {
  return "_a" in e && "install" in e;
}
function YS() {
  if (!("clipboard" in navigator))
    return Mn("Your browser doesn't support the Clipboard API", "error"), !0;
}
function WS(e) {
  return e instanceof Error && e.message.toLowerCase().includes("document is not focused") ? (Mn('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', "warn"), !0) : !1;
}
async function EH(e) {
  if (!YS())
    try {
      await navigator.clipboard.writeText(JSON.stringify(e.state.value)), Mn("Global state copied to clipboard.");
    } catch (t) {
      if (WS(t))
        return;
      Mn("Failed to serialize the state. Check the console for more details.", "error"), console.error(t);
    }
}
async function wH(e) {
  if (!YS())
    try {
      GS(e, JSON.parse(await navigator.clipboard.readText())), Mn("Global state pasted from clipboard.");
    } catch (t) {
      if (WS(t))
        return;
      Mn("Failed to deserialize the state from clipboard. Check the console for more details.", "error"), console.error(t);
    }
}
async function SH(e) {
  try {
    HS(new Blob([JSON.stringify(e.state.value)], {
      type: "text/plain;charset=utf-8"
    }), "pinia-state.json");
  } catch (t) {
    Mn("Failed to export the state as JSON. Check the console for more details.", "error"), console.error(t);
  }
}
let Jo;
function xH() {
  Jo || (Jo = document.createElement("input"), Jo.type = "file", Jo.accept = ".json");
  function e() {
    return new Promise((t, n) => {
      Jo.onchange = async () => {
        const s = Jo.files;
        if (!s)
          return t(null);
        const o = s.item(0);
        return t(o ? { text: await o.text(), file: o } : null);
      }, Jo.oncancel = () => t(null), Jo.onerror = n, Jo.click();
    });
  }
  return e;
}
async function NH(e) {
  try {
    const n = await xH()();
    if (!n)
      return;
    const { text: s, file: o } = n;
    GS(e, JSON.parse(s)), Mn(`Global state imported from "${o.name}".`);
  } catch (t) {
    Mn("Failed to import the state from JSON. Check the console for more details.", "error"), console.error(t);
  }
}
function GS(e, t) {
  for (const n in t) {
    const s = e.state.value[n];
    s ? Object.assign(s, t[n]) : e.state.value[n] = t[n];
  }
}
function Zs(e) {
  return {
    _custom: {
      display: e
    }
  };
}
const zS = "🍍 Pinia (root)", dd = "_root";
function CH(e) {
  return yg(e) ? {
    id: dd,
    label: zS
  } : {
    id: e.$id,
    label: e.$id
  };
}
function OH(e) {
  if (yg(e)) {
    const n = Array.from(e._s.keys()), s = e._s;
    return {
      state: n.map((i) => ({
        editable: !0,
        key: i,
        value: e.state.value[i]
      })),
      getters: n.filter((i) => s.get(i)._getters).map((i) => {
        const r = s.get(i);
        return {
          editable: !1,
          key: i,
          value: r._getters.reduce((a, l) => (a[l] = r[l], a), {})
        };
      })
    };
  }
  const t = {
    state: Object.keys(e.$state).map((n) => ({
      editable: !0,
      key: n,
      value: e.$state[n]
    }))
  };
  return e._getters && e._getters.length && (t.getters = e._getters.map((n) => ({
    editable: !1,
    key: n,
    value: e[n]
  }))), e._customProperties.size && (t.customProperties = Array.from(e._customProperties).map((n) => ({
    editable: !0,
    key: n,
    value: e[n]
  }))), t;
}
function TH(e) {
  return e ? Array.isArray(e) ? e.reduce((t, n) => (t.keys.push(n.key), t.operations.push(n.type), t.oldValue[n.key] = n.oldValue, t.newValue[n.key] = n.newValue, t), {
    oldValue: {},
    keys: [],
    operations: [],
    newValue: {}
  }) : {
    operation: Zs(e.type),
    key: Zs(e.key),
    oldValue: e.oldValue,
    newValue: e.newValue
  } : {};
}
function $H(e) {
  switch (e) {
    case $o.direct:
      return "mutation";
    case $o.patchFunction:
      return "$patch";
    case $o.patchObject:
      return "$patch";
    default:
      return "unknown";
  }
}
let ka = !0;
const fd = [], yi = "pinia:mutations", Yn = "pinia", { assign: kH } = Object, Zd = (e) => "🍍 " + e;
function DH(e, t) {
  dg({
    id: "dev.esm.pinia",
    label: "Pinia 🍍",
    logo: "https://pinia.vuejs.org/logo.svg",
    packageName: "pinia",
    homepage: "https://pinia.vuejs.org",
    componentStateTypes: fd,
    app: e
  }, (n) => {
    typeof n.now != "function" && Mn("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."), n.addTimelineLayer({
      id: yi,
      label: "Pinia 🍍",
      color: 15064968
    }), n.addInspector({
      id: Yn,
      label: "Pinia 🍍",
      icon: "storage",
      treeFilterPlaceholder: "Search stores",
      actions: [
        {
          icon: "content_copy",
          action: () => {
            EH(t);
          },
          tooltip: "Serialize and copy the state"
        },
        {
          icon: "content_paste",
          action: async () => {
            await wH(t), n.sendInspectorTree(Yn), n.sendInspectorState(Yn);
          },
          tooltip: "Replace the state with the content of your clipboard"
        },
        {
          icon: "save",
          action: () => {
            SH(t);
          },
          tooltip: "Save the state as a JSON file"
        },
        {
          icon: "folder_open",
          action: async () => {
            await NH(t), n.sendInspectorTree(Yn), n.sendInspectorState(Yn);
          },
          tooltip: "Import the state from a JSON file"
        }
      ],
      nodeActions: [
        {
          icon: "restore",
          tooltip: 'Reset the state (with "$reset")',
          action: (s) => {
            const o = t._s.get(s);
            o ? typeof o.$reset != "function" ? Mn(`Cannot reset "${s}" store because it doesn't have a "$reset" method implemented.`, "warn") : (o.$reset(), Mn(`Store "${s}" reset.`)) : Mn(`Cannot reset "${s}" store because it wasn't found.`, "warn");
          }
        }
      ]
    }), n.on.inspectComponent((s, o) => {
      const i = s.componentInstance && s.componentInstance.proxy;
      if (i && i._pStores) {
        const r = s.componentInstance.proxy._pStores;
        Object.values(r).forEach((a) => {
          s.instanceData.state.push({
            type: Zd(a.$id),
            key: "state",
            editable: !0,
            value: a._isOptionsAPI ? {
              _custom: {
                value: Ye(a.$state),
                actions: [
                  {
                    icon: "restore",
                    tooltip: "Reset the state of this store",
                    action: () => a.$reset()
                  }
                ]
              }
            } : (
              // NOTE: workaround to unwrap transferred refs
              Object.keys(a.$state).reduce((l, u) => (l[u] = a.$state[u], l), {})
            )
          }), a._getters && a._getters.length && s.instanceData.state.push({
            type: Zd(a.$id),
            key: "getters",
            editable: !1,
            value: a._getters.reduce((l, u) => {
              try {
                l[u] = a[u];
              } catch (d) {
                l[u] = d;
              }
              return l;
            }, {})
          });
        });
      }
    }), n.on.getInspectorTree((s) => {
      if (s.app === e && s.inspectorId === Yn) {
        let o = [t];
        o = o.concat(Array.from(t._s.values())), s.rootNodes = (s.filter ? o.filter((i) => "$id" in i ? i.$id.toLowerCase().includes(s.filter.toLowerCase()) : zS.toLowerCase().includes(s.filter.toLowerCase())) : o).map(CH);
      }
    }), globalThis.$pinia = t, n.on.getInspectorState((s) => {
      if (s.app === e && s.inspectorId === Yn) {
        const o = s.nodeId === dd ? t : t._s.get(s.nodeId);
        if (!o)
          return;
        o && (s.nodeId !== dd && (globalThis.$store = Ye(o)), s.state = OH(o));
      }
    }), n.on.editInspectorState((s, o) => {
      if (s.app === e && s.inspectorId === Yn) {
        const i = s.nodeId === dd ? t : t._s.get(s.nodeId);
        if (!i)
          return Mn(`store "${s.nodeId}" not found`, "error");
        const { path: r } = s;
        yg(i) ? r.unshift("state") : (r.length !== 1 || !i._customProperties.has(r[0]) || r[0] in i.$state) && r.unshift("$state"), ka = !1, s.set(i, r, s.state.value), ka = !0;
      }
    }), n.on.editComponentState((s) => {
      if (s.type.startsWith("🍍")) {
        const o = s.type.replace(/^🍍\s*/, ""), i = t._s.get(o);
        if (!i)
          return Mn(`store "${o}" not found`, "error");
        const { path: r } = s;
        if (r[0] !== "state")
          return Mn(`Invalid path for store "${o}":
${r}
Only state can be modified.`);
        r[0] = "$state", ka = !1, s.set(i, r, s.state.value), ka = !0;
      }
    });
  });
}
function RH(e, t) {
  fd.includes(Zd(t.$id)) || fd.push(Zd(t.$id)), dg({
    id: "dev.esm.pinia",
    label: "Pinia 🍍",
    logo: "https://pinia.vuejs.org/logo.svg",
    packageName: "pinia",
    homepage: "https://pinia.vuejs.org",
    componentStateTypes: fd,
    app: e,
    settings: {
      logStoreChanges: {
        label: "Notify about new/deleted stores",
        type: "boolean",
        defaultValue: !0
      }
      // useEmojis: {
      //   label: 'Use emojis in messages ⚡️',
      //   type: 'boolean',
      //   defaultValue: true,
      // },
    }
  }, (n) => {
    const s = typeof n.now == "function" ? n.now.bind(n) : Date.now;
    t.$onAction(({ after: r, onError: a, name: l, args: u }) => {
      const d = KS++;
      n.addTimelineEvent({
        layerId: yi,
        event: {
          time: s(),
          title: "🛫 " + l,
          subtitle: "start",
          data: {
            store: Zs(t.$id),
            action: Zs(l),
            args: u
          },
          groupId: d
        }
      }), r((f) => {
        Gr = void 0, n.addTimelineEvent({
          layerId: yi,
          event: {
            time: s(),
            title: "🛬 " + l,
            subtitle: "end",
            data: {
              store: Zs(t.$id),
              action: Zs(l),
              args: u,
              result: f
            },
            groupId: d
          }
        });
      }), a((f) => {
        Gr = void 0, n.addTimelineEvent({
          layerId: yi,
          event: {
            time: s(),
            logType: "error",
            title: "💥 " + l,
            subtitle: "end",
            data: {
              store: Zs(t.$id),
              action: Zs(l),
              args: u,
              error: f
            },
            groupId: d
          }
        });
      });
    }, !0), t._customProperties.forEach((r) => {
      nt(() => C(t[r]), (a, l) => {
        n.notifyComponentUpdate(), n.sendInspectorState(Yn), ka && n.addTimelineEvent({
          layerId: yi,
          event: {
            time: s(),
            title: "Change",
            subtitle: r,
            data: {
              newValue: a,
              oldValue: l
            },
            groupId: Gr
          }
        });
      }, { deep: !0 });
    }), t.$subscribe(({ events: r, type: a }, l) => {
      if (n.notifyComponentUpdate(), n.sendInspectorState(Yn), !ka)
        return;
      const u = {
        time: s(),
        title: $H(a),
        data: kH({ store: Zs(t.$id) }, TH(r)),
        groupId: Gr
      };
      a === $o.patchFunction ? u.subtitle = "⤵️" : a === $o.patchObject ? u.subtitle = "🧩" : r && !Array.isArray(r) && (u.subtitle = r.type), r && (u.data["rawEvent(s)"] = {
        _custom: {
          display: "DebuggerEvent",
          type: "object",
          tooltip: "raw DebuggerEvent[]",
          value: r
        }
      }), n.addTimelineEvent({
        layerId: yi,
        event: u
      });
    }, { detached: !0, flush: "sync" });
    const o = t._hotUpdate;
    t._hotUpdate = lr((r) => {
      o(r), n.addTimelineEvent({
        layerId: yi,
        event: {
          time: s(),
          title: "🔥 " + t.$id,
          subtitle: "HMR update",
          data: {
            store: Zs(t.$id),
            info: Zs("HMR update")
          }
        }
      }), n.notifyComponentUpdate(), n.sendInspectorTree(Yn), n.sendInspectorState(Yn);
    });
    const { $dispose: i } = t;
    t.$dispose = () => {
      i(), n.notifyComponentUpdate(), n.sendInspectorTree(Yn), n.sendInspectorState(Yn), n.getSettings().logStoreChanges && Mn(`Disposed "${t.$id}" store 🗑`);
    }, n.notifyComponentUpdate(), n.sendInspectorTree(Yn), n.sendInspectorState(Yn), n.getSettings().logStoreChanges && Mn(`"${t.$id}" store installed 🆕`);
  });
}
let KS = 0, Gr;
function rb(e, t, n) {
  const s = t.reduce((o, i) => (o[i] = Ye(e)[i], o), {});
  for (const o in s)
    e[o] = function() {
      const i = KS, r = n ? new Proxy(e, {
        get(...l) {
          return Gr = i, Reflect.get(...l);
        },
        set(...l) {
          return Gr = i, Reflect.set(...l);
        }
      }) : e;
      Gr = i;
      const a = s[o].apply(r, arguments);
      return Gr = void 0, a;
    };
}
function IH({ app: e, store: t, options: n }) {
  if (!t.$id.startsWith("__hot:")) {
    if (t._isOptionsAPI = !!n.state, !t._p._testing) {
      rb(t, Object.keys(n.actions), t._isOptionsAPI);
      const s = t._hotUpdate;
      Ye(t)._hotUpdate = function(o) {
        s.apply(this, arguments), rb(t, Object.keys(o._hmrPayload.actions), !!t._isOptionsAPI);
      };
    }
    RH(
      e,
      // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?
      t
    );
  }
}
function _l() {
  const e = uv(!0), t = e.run(() => I({}));
  let n = [], s = [];
  const o = lr({
    install(i) {
      Ac(o), o._a = i, i.provide(US, o), i.config.globalProperties.$pinia = o, _t.NODE_ENV !== "production" && _t.NODE_ENV !== "test" && Wr && DH(i, o), s.forEach((r) => n.push(r)), s = [];
    },
    use(i) {
      return this._a ? n.push(i) : s.push(i), this;
    },
    _p: n,
    // it's actually undefined here
    // @ts-expect-error
    _a: null,
    _e: e,
    _s: /* @__PURE__ */ new Map(),
    state: t
  });
  return _t.NODE_ENV !== "production" && _t.NODE_ENV !== "test" && Wr && typeof Proxy < "u" && o.use(IH), o;
}
function XS(e, t) {
  for (const n in t) {
    const s = t[n];
    if (!(n in e))
      continue;
    const o = e[n];
    Xi(o) && Xi(s) && !ut(s) && !Us(s) ? e[n] = XS(o, s) : e[n] = s;
  }
  return e;
}
const qS = () => {
};
function ib(e, t, n, s = qS) {
  e.push(t);
  const o = () => {
    const i = e.indexOf(t);
    i > -1 && (e.splice(i, 1), s());
  };
  return !n && dv() && C1(o), o;
}
function ya(e, ...t) {
  e.slice().forEach((n) => {
    n(...t);
  });
}
const AH = (e) => e(), ab = Symbol(), gh = Symbol();
function Fm(e, t) {
  e instanceof Map && t instanceof Map ? t.forEach((n, s) => e.set(s, n)) : e instanceof Set && t instanceof Set && t.forEach(e.add, e);
  for (const n in t) {
    if (!t.hasOwnProperty(n))
      continue;
    const s = t[n], o = e[n];
    Xi(o) && Xi(s) && e.hasOwnProperty(n) && !ut(s) && !Us(s) ? e[n] = Fm(o, s) : e[n] = s;
  }
  return e;
}
const MH = _t.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : (
  /* istanbul ignore next */
  Symbol()
);
function PH(e) {
  return !Xi(e) || !e.hasOwnProperty(MH);
}
const { assign: Ls } = Object;
function lb(e) {
  return !!(ut(e) && e.effect);
}
function cb(e, t, n, s) {
  const { state: o, actions: i, getters: r } = t, a = n.state.value[e];
  let l;
  function u() {
    !a && (_t.NODE_ENV === "production" || !s) && (n.state.value[e] = o ? o() : {});
    const d = _t.NODE_ENV !== "production" && s ? (
      // use ref() to unwrap refs inside state TODO: check if this is still necessary
      he(I(o ? o() : {}).value)
    ) : he(n.state.value[e]);
    return Ls(d, i, Object.keys(r || {}).reduce((f, p) => (_t.NODE_ENV !== "production" && p in d && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${p}" in store "${e}".`), f[p] = lr(k(() => {
      Ac(n);
      const h = n._s.get(e);
      return r[p].call(h, h);
    })), f), {}));
  }
  return l = Um(e, u, t, n, s, !0), l;
}
function Um(e, t, n = {}, s, o, i) {
  let r;
  const a = Ls({ actions: {} }, n);
  if (_t.NODE_ENV !== "production" && !s._e.active)
    throw new Error("Pinia destroyed");
  const l = { deep: !0 };
  _t.NODE_ENV !== "production" && (l.onTrigger = (R) => {
    u ? h = R : u == !1 && !O._hotUpdating && (Array.isArray(h) ? h.push(R) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
  });
  let u, d, f = [], p = [], h;
  const m = s.state.value[e];
  !i && !m && (_t.NODE_ENV === "production" || !o) && (s.state.value[e] = {});
  const v = I({});
  let _;
  function b(R) {
    let P;
    u = d = !1, _t.NODE_ENV !== "production" && (h = []), typeof R == "function" ? (R(s.state.value[e]), P = {
      type: $o.patchFunction,
      storeId: e,
      events: h
    }) : (Fm(s.state.value[e], R), P = {
      type: $o.patchObject,
      payload: R,
      storeId: e,
      events: h
    });
    const M = _ = Symbol();
    po().then(() => {
      _ === M && (u = !0);
    }), d = !0, ya(f, P, s.state.value[e]);
  }
  const w = i ? function() {
    const { state: P } = n, M = P ? P() : {};
    this.$patch((U) => {
      Ls(U, M);
    });
  } : (
    /* istanbul ignore next */
    _t.NODE_ENV !== "production" ? () => {
      throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`);
    } : qS
  );
  function y() {
    r.stop(), f = [], p = [], s._s.delete(e);
  }
  const x = (R, P = "") => {
    if (ab in R)
      return R[gh] = P, R;
    const M = function() {
      Ac(s);
      const U = Array.from(arguments), H = [], j = [];
      function V(re) {
        H.push(re);
      }
      function K(re) {
        j.push(re);
      }
      ya(p, {
        args: U,
        name: M[gh],
        store: O,
        after: V,
        onError: K
      });
      let q;
      try {
        q = R.apply(this && this.$id === e ? this : O, U);
      } catch (re) {
        throw ya(j, re), re;
      }
      return q instanceof Promise ? q.then((re) => (ya(H, re), re)).catch((re) => (ya(j, re), Promise.reject(re))) : (ya(H, q), q);
    };
    return M[ab] = !0, M[gh] = P, M;
  }, N = /* @__PURE__ */ lr({
    actions: {},
    getters: {},
    state: [],
    hotState: v
  }), S = {
    _p: s,
    // _s: scope,
    $id: e,
    $onAction: ib.bind(null, p),
    $patch: b,
    $reset: w,
    $subscribe(R, P = {}) {
      const M = ib(f, R, P.detached, () => U()), U = r.run(() => nt(() => s.state.value[e], (H) => {
        (P.flush === "sync" ? d : u) && R({
          storeId: e,
          type: $o.direct,
          events: h
        }, H);
      }, Ls({}, l, P)));
      return M;
    },
    $dispose: y
  }, O = qe(_t.NODE_ENV !== "production" || _t.NODE_ENV !== "production" && _t.NODE_ENV !== "test" && Wr ? Ls(
    {
      _hmrPayload: N,
      _customProperties: lr(/* @__PURE__ */ new Set())
      // devtools custom properties
    },
    S
    // must be added later
    // setupStore
  ) : S);
  s._s.set(e, O);
  const T = (s._a && s._a.runWithContext || AH)(() => s._e.run(() => (r = uv()).run(() => t({ action: x }))));
  for (const R in T) {
    const P = T[R];
    if (ut(P) && !lb(P) || Us(P))
      _t.NODE_ENV !== "production" && o ? Ru(v.value, R, Ra(T, R)) : i || (m && PH(P) && (ut(P) ? P.value = m[R] : Fm(P, m[R])), s.state.value[e][R] = P), _t.NODE_ENV !== "production" && N.state.push(R);
    else if (typeof P == "function") {
      const M = _t.NODE_ENV !== "production" && o ? P : x(P, R);
      T[R] = M, _t.NODE_ENV !== "production" && (N.actions[R] = P), a.actions[R] = P;
    } else _t.NODE_ENV !== "production" && lb(P) && (N.getters[R] = i ? (
      // @ts-expect-error
      n.getters[R]
    ) : P, Wr && (T._getters || // @ts-expect-error: same
    (T._getters = lr([]))).push(R));
  }
  if (Ls(O, T), Ls(Ye(O), T), Object.defineProperty(O, "$state", {
    get: () => _t.NODE_ENV !== "production" && o ? v.value : s.state.value[e],
    set: (R) => {
      if (_t.NODE_ENV !== "production" && o)
        throw new Error("cannot set hotState");
      b((P) => {
        Ls(P, R);
      });
    }
  }), _t.NODE_ENV !== "production" && (O._hotUpdate = lr((R) => {
    O._hotUpdating = !0, R._hmrPayload.state.forEach((P) => {
      if (P in O.$state) {
        const M = R.$state[P], U = O.$state[P];
        typeof M == "object" && Xi(M) && Xi(U) ? XS(M, U) : R.$state[P] = U;
      }
      Ru(O, P, Ra(R.$state, P));
    }), Object.keys(O.$state).forEach((P) => {
      P in R.$state || vh(O, P);
    }), u = !1, d = !1, s.state.value[e] = Ra(R._hmrPayload, "hotState"), d = !0, po().then(() => {
      u = !0;
    });
    for (const P in R._hmrPayload.actions) {
      const M = R[P];
      Ru(O, P, x(M, P));
    }
    for (const P in R._hmrPayload.getters) {
      const M = R._hmrPayload.getters[P], U = i ? (
        // special handling of options api
        k(() => (Ac(s), M.call(O, O)))
      ) : M;
      Ru(O, P, U);
    }
    Object.keys(O._hmrPayload.getters).forEach((P) => {
      P in R._hmrPayload.getters || vh(O, P);
    }), Object.keys(O._hmrPayload.actions).forEach((P) => {
      P in R._hmrPayload.actions || vh(O, P);
    }), O._hmrPayload = R._hmrPayload, O._getters = R._getters, O._hotUpdating = !1;
  })), _t.NODE_ENV !== "production" && _t.NODE_ENV !== "test" && Wr) {
    const R = {
      writable: !0,
      configurable: !0,
      // avoid warning on devtools trying to display this property
      enumerable: !1
    };
    ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((P) => {
      Object.defineProperty(O, P, Ls({ value: O[P] }, R));
    });
  }
  return s._p.forEach((R) => {
    if (_t.NODE_ENV !== "production" && _t.NODE_ENV !== "test" && Wr) {
      const P = r.run(() => R({
        store: O,
        app: s._a,
        pinia: s,
        options: a
      }));
      Object.keys(P || {}).forEach((M) => O._customProperties.add(M)), Ls(O, P);
    } else
      Ls(O, r.run(() => R({
        store: O,
        app: s._a,
        pinia: s,
        options: a
      })));
  }), _t.NODE_ENV !== "production" && O.$state && typeof O.$state == "object" && typeof O.$state.constructor == "function" && !O.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
	state: () => new MyClass()
Found in store "${O.$id}".`), m && i && n.hydrate && n.hydrate(O.$state, m), u = !0, d = !0, O;
}
/*! #__NO_SIDE_EFFECTS__ */
// @__NO_SIDE_EFFECTS__
function Ut(e, t, n) {
  let s, o;
  const i = typeof t == "function";
  if (typeof e == "string")
    s = e, o = i ? n : t;
  else if (o = e, s = e.id, _t.NODE_ENV !== "production" && typeof s != "string")
    throw new Error('[🍍]: "defineStore()" must be passed a store id as its first argument.');
  function r(a, l) {
    const u = wE();
    if (a = // in test mode, ignore the argument provided as we can always retrieve a
    // pinia instance with getActivePinia()
    (_t.NODE_ENV === "test" && Wl && Wl._testing ? null : a) || (u ? $e(US, null) : null), a && Ac(a), _t.NODE_ENV !== "production" && !Wl)
      throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
This will fail in production.`);
    a = Wl, a._s.has(s) || (i ? Um(s, t, o, a) : cb(s, o, a), _t.NODE_ENV !== "production" && (r._pinia = a));
    const d = a._s.get(s);
    if (_t.NODE_ENV !== "production" && l) {
      const f = "__hot:" + s, p = i ? Um(f, t, o, a, !0) : cb(f, Ls({}, o), a, !0);
      l._hotUpdate(p), delete a.state.value[f], a._s.delete(f);
    }
    if (_t.NODE_ENV !== "production" && Wr) {
      const f = cn();
      if (f && f.proxy && // avoid adding stores that are just built for hot module replacement
      !l) {
        const p = f.proxy, h = "_pStores" in p ? p._pStores : p._pStores = {};
        h[s] = d;
      }
    }
    return d;
  }
  return r.$id = s, r;
}
let pd = {};
const ip = (e) => pd = e, ls = (e) => {
  const t = pd == null ? void 0 : pd[e];
  return t ?? (console.error(`Translation error: could not find a translation for key ${e}`), !1);
}, LH = (e, t = {}) => e.replace(/{{\s*(\w+)\s*}}/g, (n, s) => s in t ? t[s] : (console.warn(`Replacement warning: no replacement found for placeholder "${s}"`), n)), ub = (e, t) => {
  const n = t.arg, s = t.value || {}, o = ls(n);
  if (o) {
    const i = LH(o, s);
    e.innerHTML = i;
  } else
    e.innerHTML = `-- translation not found for key "${n}" --`;
}, ap = {
  // called before bound element's attributes
  // or event listeners are applied
  created(e, t, n, s) {
  },
  // called right before the element is inserted into the DOM.
  beforeMount(e, t, n, s) {
    ub(e, t);
  },
  // called when the bound element's parent component
  // and all its children are mounted.
  mounted(e, t, n, s) {
  },
  // called before the parent component is updated
  beforeUpdate(e, t, n, s) {
  },
  // called after the parent component and
  // all of its children have updated
  updated(e, t, n, s) {
    ub(e, t);
  },
  // called before the parent component is unmounted
  beforeUnmount(e, t, n, s) {
  },
  // called when the parent component is unmounted
  unmounted(e, t, n, s) {
  }
};
let VH = Bo();
const di = Ho(VH, [], { timeout: 0 }), FH = async () => {
  const e = {
    params: {
      route: "CdisController:getSettings"
    }
  };
  return di.get("", e);
}, UH = async (e) => {
  const t = {
    params: {
      route: "CdisController:saveSettings"
    }
  };
  return di.post("", { settings: e }, t);
}, jH = async (e) => {
  const t = {
    params: {
      route: "CdisController:saveCustomMapping"
    }
  };
  return di.post("", { customMapping: e }, t);
}, BH = async (e) => {
  const t = {
    params: {
      route: "CdisController:upsertFhirSettings"
    }
  };
  return di.post("", { settings: e }, t);
}, HH = async (e) => {
  const t = {
    params: {
      route: "CdisController:deleteFhirSystem",
      ehr_id: e
    }
  };
  return di.delete("", t);
}, YH = async (e) => {
  const t = {
    params: {
      route: "CdisController:updateFhirSystemsOrder"
    }
  };
  return di.post("", { order: e }, t);
}, WH = async () => {
  const e = {
    params: {
      route: "CdisController:getExpiredTokens"
    }
  };
  return di.get("", e);
}, GH = async (e) => {
  const t = {
    params: {
      route: "CdisController:deleteExpiredTokens",
      ehr_id: e
    }
  };
  return di.delete("", t);
}, zH = "app-settings", bg = /* @__PURE__ */ Ut(zH, () => {
  const e = I(!1), t = I(), n = qe({}), s = I([]), o = I({}), i = I({}), r = I(""), a = k(() => !Lo(o.value, i.value)), l = k({
    get: () => n.value,
    set: (f) => {
      ip(f), n.value = f;
    }
  });
  function u() {
    i.value = { ...o.value };
  }
  async function d() {
    try {
      if (a.value)
        return e.value = !0, await UH(this.newConfig);
    } catch (f) {
      console.log(f), t.value = f;
    } finally {
      e.value = !1;
    }
  }
  return {
    loading: e,
    error: t,
    breakTheGlassUserTypes: s,
    redcapConfig: o,
    newConfig: i,
    redirectURL: r,
    isDirty: a,
    lang: l,
    reset: u,
    save: d
  };
});
let KH = -1;
const XH = "fhir-system", Eg = /* @__PURE__ */ Ut(XH, () => {
  const e = I(!1), t = I(), n = I([]), s = I([]), o = I({}), i = I({}), r = k(() => !Lo(o.value, i.value)), a = k(() => !Lo(s.value, n.value)), l = k(() => {
    var S, O, $, T, R, P;
    if (((S = s.value) == null ? void 0 : S.length) !== ((O = n.value) == null ? void 0 : O.length)) return !0;
    for (const M in n.value) {
      const U = (T = ($ = n.value) == null ? void 0 : $[M]) == null ? void 0 : T.ehr_id, H = (P = (R = s.value) == null ? void 0 : R[M]) == null ? void 0 : P.ehr_id;
      if (U !== H) return !0;
    }
    return !1;
  }), u = k(() => s.value.map((S) => S.ehr_id));
  function d(S) {
    return s.value.find(($) => $.ehr_id === S);
  }
  function f(S) {
    o.value = S;
    const O = co(S);
    i.value = O;
  }
  function p(S) {
    const O = i.value;
    O.fhir_custom_auth_params = S, i.value = O;
  }
  function h() {
    s.value = co(n.value), s.value.length === 0 ? f(null) : f(s.value[0]);
  }
  function m(S) {
    var R;
    const O = [...s.value], $ = O.findIndex(
      (P) => (P == null ? void 0 : P.ehr_id) === (S == null ? void 0 : S.ehr_id)
    );
    if ($ < 0) return;
    const T = O[$];
    O.splice($, 1), s.value = [...O], ((R = o.value) == null ? void 0 : R.ehr_id) === (T == null ? void 0 : T.ehr_id) && (s.value.length === 0 ? this.setCurrent(null) : f(s.value[0]));
  }
  function v() {
    var O;
    return {
      ehr_name: "new system",
      order: ((O = s.value) == null ? void 0 : O.length) + 1,
      ehr_id: "",
      client_id: "",
      client_secret: "",
      fhir_base_url: "",
      fhir_token_url: "",
      fhir_authorize_url: "",
      fhir_identity_provider: null,
      patient_identifier_string: "",
      fhir_custom_auth_params: []
    };
  }
  async function _(S) {
    S.ehr_id = KH--;
    const O = await w(S);
    if (!O)
      throw new Error("Could not add the new FHIR system");
    return console.log(`FHIR system added - ID: ${O}`), O;
  }
  function b(S) {
    var $;
    n.value = co(S), s.value = [...S];
    const O = ($ = s.value) == null ? void 0 : $[0];
    f(O);
  }
  async function w(S) {
    try {
      return e.value = !0, await BH(S);
    } catch (O) {
      console.log(O), t.value = O;
    } finally {
      e.value = !1;
    }
  }
  async function y(S) {
    return await HH(S);
  }
  async function x() {
    if (l.value)
      try {
        return e.value = !0, await YH(u.value);
      } catch (S) {
        console.log(S), t.value = S;
      } finally {
        e.value = !1;
      }
  }
  async function N() {
    if (!r.value && !a.value) return;
    const S = await w(Ye(i.value));
    S == null || S.data, await x();
  }
  return {
    loading: e,
    error: t,
    originalList: n,
    list: s,
    current: o,
    form: i,
    isDirty: r,
    listChanged: a,
    orderChanged: l,
    order: u,
    setCurrent: f,
    findByEhrId: d,
    updateAuthParams: p,
    reset: h,
    remove: m,
    makeNewSystem: v,
    add: _,
    init: b,
    upsert: w,
    delete: y,
    updateOrder: x,
    save: N
  };
}), qH = () => {
  let e = {};
  return {
    addError(t, n) {
      const s = (n == null ? void 0 : n.message) ?? n;
      t in e || (e[t] = []), e[t].push(s);
    },
    hasErrors() {
      return !!Object.keys(e).find(
        (n) => (n == null ? void 0 : n.length) > 0
      );
    },
    errors: () => e
  };
}, wg = (e) => (n) => {
  const s = qH();
  for (const [o, i] of Object.entries(e))
    for (const r of i) {
      if (typeof r != "function") {
        console.warn(
          `the provided rule ${r} is not a valid function`
        );
        continue;
      }
      try {
        const a = r(n == null ? void 0 : n[o]);
      } catch (a) {
        s.addError(o, a);
      }
    }
  return s;
}, no = (e) => {
  const t = (e == null ? void 0 : e.message) ?? "this value is required";
  return (n) => {
    if (typeof n == "string" && (n = n.trim(), n.length < 1))
      throw new Error(t);
    if (Array.isArray(n) && n.length === 0)
      throw new Error(t);
    if ((n instanceof Set || n instanceof Map) && n.size === 0)
      throw new Error(t);
    if (typeof n == "object" && n !== null && Object.keys(n).length === 0)
      throw new Error(t);
    if (!n) throw new Error(t);
  };
}, JH = (e = [], t) => {
  const n = `this value must be one of these: '${e.join(", ")}`;
  return (s) => {
    if (!e.includes(s)) throw new Error(n);
  };
}, QH = (e) => {
  const t = e == null ? void 0 : e.message;
  return (n) => {
    if (n !== !0) throw new Error(t);
  };
}, ZH = (e) => {
  const t = e == null ? void 0 : e.message;
  return (n) => {
    if (n !== !1) throw new Error(t);
  };
}, e7 = (e = []) => (t) => {
  for (const n of e)
    n(t);
}, t7 = [
  "field",
  "temporal",
  "label",
  "description",
  "category",
  "subcategory",
  "identifier",
  "disabled",
  "disabled_reason"
], n7 = () => [
  "field",
  "label",
  "description",
  "category",
  "subcategory",
  "temporal",
  "identifier",
  "disabled",
  "disabled_reason"
], s7 = (e = []) => (t) => {
  if (!(!t || typeof t != "object")) {
    for (const [n, s] of Object.entries(t))
      e.includes(n) || delete t[n];
    return { ...t };
  }
}, o7 = (e) => {
  const t = ["temporal", "identifier", "disabled"];
  for (const [n, s] of Object.entries(e))
    t.includes(n) && (e[n] = mF(s));
  return e;
}, db = s7(t7), r7 = "custom-mappings", JS = /* @__PURE__ */ Ut(r7, () => {
  const e = I(!1), t = I(), n = I([]), s = I([]), o = I([]), i = k(() => {
    if (s.value.length !== o.value.length) return !0;
    for (const m in s.value) {
      const v = s.value[m], _ = o.value[m];
      if (!Lo(v, _)) return !0;
    }
    return !1;
  });
  function r() {
    return {
      temporal: !0,
      identifier: !1,
      disabled: !1
    };
  }
  function a() {
    o.value = [];
    for (const m of s.value)
      o.value.push({ ...m });
  }
  function l(m) {
    const v = [...o.value], _ = v.findIndex((b) => b === m);
    _ < 0 || (v[_], v.splice(_, 1), o.value = v);
  }
  function u(m) {
    o.value.push(m);
  }
  function d(m, v) {
    const _ = o.value.findIndex((w) => w === m);
    if (_ < 0) return;
    const b = o.value[_];
    for (const [w, y] of Object.entries(v))
      b[w] = y;
    o.value[_] = b;
  }
  function f(m) {
    const v = (m == null ? void 0 : m.validCategories) ?? [];
    n.value = [...v];
    const _ = (m == null ? void 0 : m.list) ?? [];
    s.value = [..._], a();
  }
  async function p() {
    try {
      return e.value = !0, await jH(o.value);
    } catch (m) {
      console.log(t), t.value = m;
    } finally {
      e.value = !1;
    }
  }
  function h(m) {
    const v = {
      field: [no()],
      category: [
        e7([no(), JH(n.value)])
      ],
      label: [no()],
      temporal: [
        QH({
          message: "the 'temporal' field must be set to 'true'"
        })
      ],
      identifier: [
        ZH({
          message: "the 'identifier' field must be set to 'false'"
        })
      ]
    };
    return wg(v)(m);
  }
  return {
    loading: e,
    error: t,
    validCategories: n,
    originalList: s,
    list: o,
    isDirty: i,
    useDefaultEntry: r,
    reset: a,
    remove: l,
    add: u,
    edit: d,
    init: f,
    save: p,
    validate: h
  };
}), i7 = "main", ru = /* @__PURE__ */ Ut(i7, () => {
  const e = bg(), t = Eg(), n = JS(), s = I(!1), o = I(!1), i = I(), r = k(() => e.isDirty || t.isDirty || t.orderChanged || t.listChanged || n.isDirty);
  async function a() {
    try {
      o.value = !0, await l(), s.value = !0;
    } catch (f) {
      f.value = useError(f);
    } finally {
      o.value = !1;
    }
  }
  async function l() {
    const f = await FH(), {
      lang: p,
      redcapConfig: h,
      redirectURL: m,
      breakTheGlassUserTypes: v,
      fhirSystems: _,
      customMappingsData: b
    } = f.data;
    e.lang = p, e.redirectURL = m, e.redcapConfig = h, e.breakTheGlassUserTypes = v, e.newConfig = { ...h }, t.init(_), n.init(b);
  }
  function u() {
    e.reset(), t.reset(), n.reset();
  }
  async function d() {
    try {
      o.value = !0;
      let f = !1;
      e.isDirty && (await e.save(), f = !0), (t.isDirty || t.listChanged) && (await t.save(), f = !0), t.orderChanged && (await t.updateOrder(), f = !0), n.isDirty && (await n.save(), f = !0), f && await l();
    } catch (f) {
      console.log(f);
    } finally {
      o.value = !1;
    }
  }
  return {
    ready: s,
    loading: o,
    error: i,
    savePending: r,
    init: a,
    loadSettings: l,
    resetChanges: u,
    saveChanges: d
  };
}), a7 = "tools", l7 = /* @__PURE__ */ Ut(a7, () => {
  const e = I(!1), t = I(), n = I([]);
  async function s() {
    var i;
    try {
      e.value = !0;
      const r = await WH();
      n.value = ((i = r == null ? void 0 : r.data) == null ? void 0 : i.expiredTokens) ?? [];
    } catch (r) {
      t.value = r;
    } finally {
      e.value = !1;
    }
  }
  async function o(i) {
    try {
      return e.value = !0, await GH(i);
    } catch (r) {
      t.value = r;
    } finally {
      e.value = !1;
    }
  }
  return {
    loading: e,
    error: t,
    expiredTokens: n,
    fetchExpiredTokens: s,
    clearExpiredTokens: o
  };
}), c7 = {
  key: 0,
  class: "alert alert-danger"
}, u7 = {
  __name: "App",
  setup(e) {
    const t = ru(), n = k(() => t.loading), s = k(() => t.ready), o = k(() => t.error);
    return vt(() => {
      t.init();
    }), (i, r) => {
      const a = le("router-view");
      return g(), E(G, null, [
        o.value ? (g(), E("div", c7, F(o.value), 1)) : ne("", !0),
        s.value ? (g(), se(a, { key: 1 })) : ne("", !0),
        n.value ? (g(), se(vH, { key: 2 })) : ne("", !0)
      ], 64);
    };
  }
}, d7 = ["href"], f7 = ["href", "onClick"], Iu = {
  __name: "NavTabLink",
  props: {
    ...Ja.props,
    activeClass: { type: String, default: "active" },
    inactiveClass: { type: String, default: "" },
    disabled: { type: Boolean, default: !1 }
    // if this function returns false, then stop the navigation
  },
  setup(e) {
    const t = e, n = k(
      () => typeof t.to == "string" && t.to.startsWith("http")
    );
    function s(o) {
      t.disabled !== !0 && o();
    }
    return (o, i) => n.value ? (g(), E("a", bn({ key: 0 }, o.$attrs, {
      href: o.to,
      target: "_blank",
      class: { disabled: e.disabled }
    }), [
      fe(o.$slots, "default")
    ], 16, d7)) : (g(), se(C(Ja), bn({ key: 1 }, o.$props, { custom: "" }), {
      default: B(({ isExactActive: r, href: a, navigate: l }) => [
        c("a", bn({ class: "nav-link" }, o.$attrs, {
          href: a,
          onClick: Rt((u) => s(l), ["prevent"]),
          class: {
            [r ? e.activeClass : e.inactiveClass]: !0,
            disabled: e.disabled
          }
        }), [
          fe(o.$slots, "default")
        ], 16, f7)
      ]),
      _: 3
    }, 16));
  }
}, p7 = {
  class: "position-fixed top-0 start-50 translate-middle-x",
  style: { "z-index": "1030" }
}, h7 = { class: "p-3 mb-2 d-flex justify-content-center" }, m7 = {
  __name: "PendingSaveAlert",
  setup(e) {
    const t = ru();
    function n() {
      t.resetChanges();
    }
    async function s() {
      await t.saveChanges();
    }
    return (o, i) => {
      const r = le("b-toast");
      return g(), E("div", p7, [
        c("div", h7, [
          D(r, {
            autohide: !1,
            visible: ""
          }, {
            title: B(() => i[0] || (i[0] = [
              c("div", { class: "me-auto" }, [
                c("i", { class: "fas fa-warning fa-fw me-2 text-warning" }),
                c("span", null, "Unsaved changes")
              ], -1)
            ])),
            default: B(() => [
              i[3] || (i[3] = c("span", null, "Careful - you have unsaved changes!", -1)),
              c("div", { class: "pt-2 d-flex justify-content-start gap-2" }, [
                c("button", {
                  type: "button",
                  class: "btn btn-sm btn-secondary",
                  onClick: n
                }, i[1] || (i[1] = [
                  c("i", { class: "fas fa-rotate-left fa-fw me-2" }, null, -1),
                  c("span", null, "Revert", -1)
                ])),
                c("button", {
                  type: "button",
                  class: "btn btn-sm btn-primary",
                  onClick: s
                }, i[2] || (i[2] = [
                  c("i", { class: "fas fa-save fa-fw me-2" }, null, -1),
                  c("span", null, "Save Changes", -1)
                ]))
              ])
            ]),
            _: 1
          })
        ])
      ]);
    };
  }
}, v7 = /* @__PURE__ */ oe(m7, [["__scopeId", "data-v-b6ef5d3b"]]), g7 = { class: "nav nav-tabs" }, _7 = { class: "nav-item" }, y7 = { class: "nav-item" }, b7 = { class: "nav-item" }, E7 = { class: "nav-item" }, w7 = {
  __name: "SettingsMenu",
  setup(e) {
    const t = ru(), n = k(() => t.savePending), s = k(() => t.loading);
    return (o, i) => (g(), E("div", null, [
      c("ul", g7, [
        c("li", _7, [
          D(Iu, {
            to: { name: "home" },
            disabled: n.value
          }, {
            default: B(() => i[0] || (i[0] = [
              te("Settings")
            ])),
            _: 1
          }, 8, ["disabled"])
        ]),
        c("li", y7, [
          D(Iu, {
            to: { name: "fhir-systems" },
            disabled: n.value
          }, {
            default: B(() => i[1] || (i[1] = [
              te("FHIR Systems")
            ])),
            _: 1
          }, 8, ["disabled"])
        ]),
        c("li", b7, [
          D(Iu, {
            to: { name: "custom-mappings" },
            disabled: n.value
          }, {
            default: B(() => i[2] || (i[2] = [
              te("Custom Mappings")
            ])),
            _: 1
          }, 8, ["disabled"])
        ]),
        c("li", E7, [
          D(Iu, {
            to: { name: "tools" },
            disabled: n.value
          }, {
            default: B(() => i[3] || (i[3] = [
              te("Tools")
            ])),
            _: 1
          }, 8, ["disabled"])
        ])
      ]),
      !s.value && n.value ? (g(), se(v7, { key: 0 })) : ne("", !0)
    ]));
  }
}, S7 = { class: "border rounded" }, x7 = {
  __name: "MainLayout",
  setup(e) {
    return (t, n) => {
      const s = le("router-view");
      return g(), E("div", null, [
        D(w7, { class: "navigation-tabs" }),
        c("div", S7, [
          D(s)
        ])
      ]);
    };
  }
}, N7 = /* @__PURE__ */ oe(x7, [["__scopeId", "data-v-e3b52831"]]), C7 = (e) => !!new RegExp(
  "^(https?:\\/\\/)?((([a-zA-Z\\d](([a-zA-Z\\d-]*[a-zA-Z\\d])?))\\.)+[a-zA-Z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-zA-Z\\d%_.~+]*)*(\\?[;&a-zA-Z\\d%_.~+=-]*)?(\\#[-a-zA-Z\\d_]*)?$",
  "i"
).test(e), O7 = { class: "settings-container p-2" }, T7 = { class: "section-title" }, $7 = { class: "row" }, k7 = { class: "col" }, D7 = { class: "section-label" }, R7 = { class: "col" }, I7 = { value: "0" }, A7 = { value: "1" }, M7 = { class: "row mt-4" }, P7 = { class: "col" }, L7 = { class: "section-label" }, V7 = { class: "col" }, F7 = { value: "0" }, U7 = { value: "1" }, j7 = { class: "text-danger" }, B7 = { class: "section-title" }, H7 = { class: "section-description" }, Y7 = { class: "row mt-4" }, W7 = { class: "col" }, G7 = { class: "section-label" }, z7 = { class: "col" }, K7 = { value: "0" }, X7 = { value: "1" }, q7 = { class: "section-title" }, J7 = { class: "section-description" }, Q7 = { class: "row mt-4" }, Z7 = { class: "col" }, eY = { class: "section-label" }, tY = { class: "col" }, nY = { value: "" }, sY = { value: "enabled" }, oY = { class: "row mt-4" }, rY = { class: "col" }, iY = { class: "section-label" }, aY = { class: "col" }, lY = ["value"], cY = { class: "section-title" }, uY = { class: "row mt-4" }, dY = { class: "col" }, fY = { class: "section-label" }, pY = { class: "col" }, hY = { class: "input-group mb-3" }, mY = { class: "text-danger" }, vY = { class: "row mt-4" }, gY = { class: "col" }, _Y = { class: "section-label" }, yY = { class: "col" }, bY = { class: "text-danger" }, EY = { class: "row mt-4" }, wY = { class: "col" }, SY = { class: "section-label" }, xY = { class: "col" }, NY = { value: "0" }, CY = { value: "1" }, OY = { class: "row mt-4" }, TY = { class: "col" }, $Y = { class: "section-label" }, kY = { class: "text-danger" }, DY = { class: "col" }, RY = { value: "0" }, IY = { value: "1" }, AY = { class: "row mt-4" }, MY = { class: "col" }, PY = { class: "section-label" }, LY = { class: "col" }, VY = { class: "d-flex align-items-center gap-2" }, FY = { class: "fw-bold" }, UY = { class: "fw-bold" }, jY = { class: "row mt-4" }, BY = { class: "col" }, HY = { class: "section-label" }, YY = { class: "col" }, WY = { class: "d-flex align-items-center gap-2" }, GY = { class: "fw-bold" }, zY = { class: "row mt-4" }, KY = { class: "col" }, XY = { class: "section-label" }, qY = { class: "col" }, JY = { value: "0" }, QY = { value: "1" }, ZY = { class: "row mt-4" }, e9 = { class: "col" }, t9 = { class: "section-label" }, n9 = { class: "col" }, s9 = { value: "0" }, o9 = { value: "2" }, r9 = { value: "1" }, i9 = { class: "row mt-4" }, a9 = { class: "col" }, l9 = { class: "section-label" }, c9 = { class: "col" }, u9 = { value: "1" }, d9 = { value: "0" }, f9 = { class: "footer d-flex align-items-center justify-content-end border-top py-2" }, p9 = ["disabled"], h9 = {
  __name: "HomePage",
  setup(e) {
    const t = bg(), n = ru(), s = fs(), {
      newConfig: o,
      breakTheGlassUserTypes: i,
      isDirty: r
    } = he(t), a = k(() => n.loading);
    function l() {
      const d = event.target.value;
      C7(d) ? s.alert({ title: "<span>Success</span>", body: `The URL ${d} is valid` }) : s.alert({ title: "Error", body: `The URL ${d} is NOT valid` });
    }
    function u() {
      n.saveChanges();
    }
    return (d, f) => {
      const p = Ht("tt");
      return g(), E("div", O7, [
        c("section", null, [
          c("div", T7, [
            L(c("span", null, null, 512), [
              [p, void 0, "ws_267"]
            ])
          ]),
          c("div", $7, [
            c("div", k7, [
              c("div", D7, [
                f[15] || (f[15] = c("i", { class: "fas fa-database fa-fw me-1" }, null, -1)),
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_265"]
                ])
              ]),
              L(c("span", null, null, 512), [
                [p, void 0, "ws_288"]
              ])
            ]),
            c("div", R7, [
              L(c("select", {
                class: "form-select form-select-sm",
                "onUpdate:modelValue": f[0] || (f[0] = (h) => C(o).fhir_ddp_enabled = h)
              }, [
                L(c("option", I7, null, 512), [
                  [p, void 0, "global_23"]
                ]),
                L(c("option", A7, null, 512), [
                  [p, void 0, "system_config_27"]
                ])
              ], 512), [
                [Qt, C(o).fhir_ddp_enabled]
              ]),
              L(c("span", null, null, 512), [
                [p, void 0, "ws_216"]
              ])
            ])
          ]),
          c("div", M7, [
            c("div", P7, [
              c("div", L7, [
                f[16] || (f[16] = c("i", { class: "fas fa-shopping-cart fa-fw me-1" }, null, -1)),
                L(c("span", null, null, 512), [
                  [p, void 0, "global_155"]
                ])
              ]),
              L(c("span", null, null, 512), [
                [p, void 0, "ws_295"]
              ])
            ]),
            c("div", V7, [
              L(c("select", {
                class: "form-select form-select-sm",
                "onUpdate:modelValue": f[1] || (f[1] = (h) => C(o).fhir_data_mart_create_project = h)
              }, [
                L(c("option", F7, null, 512), [
                  [p, void 0, "global_23"]
                ]),
                L(c("option", U7, null, 512), [
                  [p, void 0, "system_config_27"]
                ])
              ], 512), [
                [Qt, C(o).fhir_data_mart_create_project]
              ]),
              L(c("span", j7, null, 512), [
                [p, void 0, "ws_243"]
              ])
            ])
          ])
        ]),
        f[20] || (f[20] = c("hr", null, null, -1)),
        c("section", null, [
          c("div", B7, [
            L(c("span", null, null, 512), [
              [p, void 0, "cc_cdp_auto_adjudication_title"]
            ])
          ]),
          c("div", H7, [
            L(c("span", null, null, 512), [
              [p, void 0, "cc_cdp_auto_adjudication_description"]
            ])
          ]),
          c("div", Y7, [
            c("div", W7, [
              c("div", G7, [
                L(c("span", null, null, 512), [
                  [p, void 0, "cc_cdp_auto_adjudication_label"]
                ])
              ])
            ]),
            c("div", z7, [
              L(c("select", {
                class: "form-select form-select-sm",
                "onUpdate:modelValue": f[2] || (f[2] = (h) => C(o).fhir_cdp_allow_auto_adjudication = h)
              }, [
                L(c("option", K7, null, 512), [
                  [p, void 0, "global_23"]
                ]),
                L(c("option", X7, null, 512), [
                  [p, void 0, "system_config_27"]
                ])
              ], 512), [
                [Qt, C(o).fhir_cdp_allow_auto_adjudication]
              ])
            ])
          ])
        ]),
        f[21] || (f[21] = c("hr", null, null, -1)),
        c("section", null, [
          c("div", q7, [
            L(c("span", null, null, 512), [
              [p, void 0, "break_glass_003"]
            ])
          ]),
          c("div", J7, [
            L(c("span", null, null, 512), [
              [p, void 0, "break_glass_004"]
            ])
          ]),
          c("div", Q7, [
            c("div", Z7, [
              c("div", eY, [
                L(c("span", null, null, 512), [
                  [p, void 0, "break_the_glass_settings_01"]
                ])
              ])
            ]),
            c("div", tY, [
              L(c("select", {
                class: "form-select form-select-sm",
                "onUpdate:modelValue": f[3] || (f[3] = (h) => C(o).fhir_break_the_glass_enabled = h)
              }, [
                L(c("option", nY, null, 512), [
                  [p, void 0, "break_the_glass_disabled"]
                ]),
                L(c("option", sY, null, 512), [
                  [p, void 0, "break_the_glass_enabled"]
                ])
              ], 512), [
                [Qt, C(o).fhir_break_the_glass_enabled]
              ]),
              L(c("span", null, null, 512), [
                [p, void 0, "break_glass_description"]
              ])
            ])
          ]),
          c("div", oY, [
            c("div", rY, [
              c("div", iY, [
                L(c("span", null, null, 512), [
                  [p, void 0, "break_glass_007"]
                ])
              ]),
              L(c("span", null, null, 512), [
                [p, void 0, "break_glass_ehr"]
              ])
            ]),
            c("div", aY, [
              L(c("select", {
                class: "form-select form-select-sm",
                "onUpdate:modelValue": f[4] || (f[4] = (h) => C(o).fhir_break_the_glass_ehr_usertype = h)
              }, [
                (g(!0), E(G, null, ge(C(i), (h, m) => (g(), E("option", {
                  key: m,
                  value: h
                }, F(h), 9, lY))), 128))
              ], 512), [
                [Qt, C(o).fhir_break_the_glass_ehr_usertype]
              ]),
              L(c("span", null, null, 512), [
                [p, void 0, "break_glass_usertype_ehr"]
              ])
            ])
          ])
        ]),
        f[22] || (f[22] = c("hr", null, null, -1)),
        c("section", null, [
          c("div", cY, [
            L(c("span", null, null, 512), [
              [p, void 0, "ws_233"]
            ])
          ]),
          f[17] || (f[17] = c("div", { class: "section-description" }, null, -1)),
          c("div", uY, [
            c("div", dY, [
              c("div", fY, [
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_74"]
                ])
              ]),
              L(c("span", null, null, 512), [
                [p, void 0, "ws_274"]
              ]),
              c("div", null, [
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_230"]
                ])
              ])
            ]),
            c("div", pY, [
              c("div", hY, [
                L(c("input", {
                  type: "text",
                  class: "form-control form-control-sm",
                  placeholder: "URL...",
                  "onUpdate:modelValue": f[5] || (f[5] = (h) => C(o).fhir_url_user_access = h)
                }, null, 512), [
                  [Ve, C(o).fhir_url_user_access]
                ]),
                L(c("button", {
                  class: "btn btn-outline-secondary",
                  type: "button",
                  onClick: f[6] || (f[6] = (h) => l(C(o).fhir_url_user_access))
                }, null, 512), [
                  [p, void 0, "edit_project_138"]
                ])
              ]),
              L(c("span", null, null, 512), [
                [p, void 0, "ws_94"]
              ]),
              c("div", mY, [
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_97"]
                ])
              ])
            ])
          ]),
          c("div", vY, [
            c("div", gY, [
              c("div", _Y, [
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_69"]
                ])
              ]),
              L(c("span", null, null, 512), [
                [p, void 0, "ws_269"]
              ])
            ]),
            c("div", yY, [
              L(c("textarea", {
                class: "form-control form-control-sm",
                "onUpdate:modelValue": f[7] || (f[7] = (h) => C(o).fhir_custom_text = h)
              }, null, 512), [
                [Ve, C(o).fhir_custom_text]
              ]),
              L(c("span", null, null, 512), [
                [p, void 0, "system_config_195"]
              ]),
              c("div", null, [
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_71"]
                ])
              ]),
              c("div", bY, [
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_268"]
                ])
              ])
            ])
          ]),
          c("div", EY, [
            c("div", wY, [
              c("div", SY, [
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_270"]
                ])
              ])
            ]),
            c("div", xY, [
              L(c("select", {
                class: "form-select form-select-sm",
                "onUpdate:modelValue": f[8] || (f[8] = (h) => C(o).fhir_display_info_project_setup = h)
              }, [
                L(c("option", NY, null, 512), [
                  [p, void 0, "ws_272"]
                ]),
                L(c("option", CY, null, 512), [
                  [p, void 0, "ws_271"]
                ])
              ], 512), [
                [Qt, C(o).fhir_display_info_project_setup]
              ]),
              L(c("span", null, null, 512), [
                [p, void 0, "ws_273"]
              ])
            ])
          ]),
          c("div", OY, [
            c("div", TY, [
              c("div", $Y, [
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_275"]
                ])
              ]),
              c("div", kY, [
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_99"]
                ])
              ])
            ]),
            c("div", DY, [
              L(c("select", {
                class: "form-select form-select-sm",
                "onUpdate:modelValue": f[9] || (f[9] = (h) => C(o).fhir_user_rights_super_users_only = h)
              }, [
                L(c("option", RY, null, 512), [
                  [p, void 0, "ws_276"]
                ]),
                L(c("option", IY, null, 512), [
                  [p, void 0, "ws_277"]
                ])
              ], 512), [
                [Qt, C(o).fhir_user_rights_super_users_only]
              ]),
              L(c("span", null, null, 512), [
                [p, void 0, "ws_278"]
              ])
            ])
          ]),
          c("div", AY, [
            c("div", MY, [
              c("div", PY, [
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_84"]
                ])
              ])
            ]),
            c("div", LY, [
              c("div", VY, [
                L(c("span", FY, null, 512), [
                  [p, void 0, "ws_91"]
                ]),
                L(c("input", {
                  class: "form-control form-control-sm",
                  type: "number",
                  min: "1",
                  max: "999",
                  step: "1",
                  style: { width: "4rem" },
                  "onUpdate:modelValue": f[10] || (f[10] = (h) => C(o).fhir_data_fetch_interval = h)
                }, null, 512), [
                  [Ve, C(o).fhir_data_fetch_interval]
                ]),
                L(c("span", UY, null, 512), [
                  [p, void 0, "control_center_406"]
                ]),
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_88"]
                ])
              ]),
              L(c("span", null, null, 512), [
                [p, void 0, "ws_279"]
              ])
            ])
          ]),
          c("div", jY, [
            c("div", BY, [
              c("div", HY, [
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_85"]
                ])
              ]),
              L(c("span", null, null, 512), [
                [p, void 0, "ws_87"]
              ])
            ]),
            c("div", YY, [
              c("div", WY, [
                L(c("input", {
                  class: "form-control form-control-sm",
                  type: "number",
                  min: "1",
                  max: "100",
                  step: "1",
                  style: { width: "4rem" },
                  "onUpdate:modelValue": f[11] || (f[11] = (h) => C(o).fhir_stop_fetch_inactivity_days = h)
                }, null, 512), [
                  [Ve, C(o).fhir_stop_fetch_inactivity_days]
                ]),
                L(c("span", GY, null, 512), [
                  [p, void 0, "scheduling_25"]
                ]),
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_89"]
                ])
              ]),
              L(c("span", null, null, 512), [
                [p, void 0, "ws_280"]
              ])
            ])
          ]),
          c("div", zY, [
            c("div", KY, [
              c("div", XY, [
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_252"]
                ])
              ]),
              c("div", null, [
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_255"]
                ])
              ])
            ]),
            c("div", qY, [
              L(c("select", {
                class: "form-select form-select-sm",
                "onUpdate:modelValue": f[12] || (f[12] = (h) => C(o).fhir_convert_timestamp_from_gmt = h)
              }, [
                L(c("option", JY, null, 512), [
                  [p, void 0, "ws_254"]
                ]),
                L(c("option", QY, null, 512), [
                  [p, void 0, "ws_253"]
                ])
              ], 512), [
                [Qt, C(o).fhir_convert_timestamp_from_gmt]
              ]),
              L(c("span", null, null, 512), [
                [p, void 0, "ws_256"]
              ])
            ])
          ]),
          c("div", ZY, [
            c("div", e9, [
              c("div", t9, [
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_299"]
                ])
              ]),
              c("div", null, [
                L(c("span", null, null, 512), [
                  [p, void 0, "ws_339"]
                ])
              ])
            ]),
            c("div", n9, [
              L(c("select", {
                class: "form-select form-select-sm",
                "onUpdate:modelValue": f[13] || (f[13] = (h) => C(o).fhir_include_email_address = h)
              }, [
                L(c("option", s9, null, 512), [
                  [p, void 0, "ws_301"]
                ]),
                L(c("option", o9, null, 512), [
                  [p, void 0, "ws_300"]
                ]),
                L(c("option", r9, null, 512), [
                  [p, void 0, "ws_338"]
                ])
              ], 512), [
                [Qt, C(o).fhir_include_email_address]
              ])
            ])
          ]),
          c("div", i9, [
            c("div", a9, [
              c("div", l9, [
                L(c("span", null, null, 512), [
                  [p, void 0, "override_system_bundle_ca_title"]
                ])
              ]),
              c("div", null, [
                L(c("span", null, null, 512), [
                  [p, void 0, "override_system_bundle_ca_description"]
                ])
              ])
            ]),
            c("div", c9, [
              L(c("select", {
                class: "form-select form-select-sm",
                "onUpdate:modelValue": f[14] || (f[14] = (h) => C(o).override_system_bundle_ca = h)
              }, [
                L(c("option", u9, null, 512), [
                  [p, void 0, "override_system_bundle_ca_use_redcap"]
                ]),
                L(c("option", d9, null, 512), [
                  [p, void 0, "override_system_bundle_ca_use_system"]
                ])
              ], 512), [
                [Qt, C(o).override_system_bundle_ca]
              ])
            ])
          ])
        ]),
        c("div", f9, [
          a.value ? (g(), E("button", {
            key: 1,
            class: "btn btn-primary btn-sm",
            onClick: u,
            disabled: ""
          }, [
            f[19] || (f[19] = c("i", { class: "fas fa-spinner fa-spin fa-fw me-2" }, null, -1)),
            L(c("span", null, null, 512), [
              [p, void 0, "control_center_4876"]
            ])
          ])) : (g(), E("button", {
            key: 0,
            class: "btn btn-primary btn-sm",
            onClick: u,
            disabled: !C(r)
          }, [
            f[18] || (f[18] = c("i", { class: "fas fa-save fa-fw me-2" }, null, -1)),
            L(c("span", null, null, 512), [
              [p, void 0, "control_center_4876"]
            ])
          ], 8, p9))
        ])
      ]);
    };
  }
}, m9 = /* @__PURE__ */ oe(h9, [["__scopeId", "data-v-daebc63e"]]);
function v9(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
function lp(e) {
  if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
  var t = e.default;
  if (typeof t == "function") {
    var n = function s() {
      return this instanceof s ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
    };
    n.prototype = t.prototype;
  } else n = {};
  return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(e).forEach(function(s) {
    var o = Object.getOwnPropertyDescriptor(e, s);
    Object.defineProperty(n, s, o.get ? o : {
      enumerable: !0,
      get: function() {
        return e[s];
      }
    });
  }), n;
}
var hd = { exports: {} }, Au = { exports: {} }, _h = {}, Oe = {};
const Za = Symbol(Oe.NODE_ENV !== "production" ? "Fragment" : ""), ja = Symbol(Oe.NODE_ENV !== "production" ? "Teleport" : ""), cp = Symbol(Oe.NODE_ENV !== "production" ? "Suspense" : ""), Mc = Symbol(Oe.NODE_ENV !== "production" ? "KeepAlive" : ""), Sg = Symbol(
  Oe.NODE_ENV !== "production" ? "BaseTransition" : ""
), si = Symbol(Oe.NODE_ENV !== "production" ? "openBlock" : ""), xg = Symbol(Oe.NODE_ENV !== "production" ? "createBlock" : ""), Ng = Symbol(
  Oe.NODE_ENV !== "production" ? "createElementBlock" : ""
), up = Symbol(Oe.NODE_ENV !== "production" ? "createVNode" : ""), dp = Symbol(
  Oe.NODE_ENV !== "production" ? "createElementVNode" : ""
), yl = Symbol(
  Oe.NODE_ENV !== "production" ? "createCommentVNode" : ""
), fp = Symbol(
  Oe.NODE_ENV !== "production" ? "createTextVNode" : ""
), Cg = Symbol(
  Oe.NODE_ENV !== "production" ? "createStaticVNode" : ""
), pp = Symbol(
  Oe.NODE_ENV !== "production" ? "resolveComponent" : ""
), hp = Symbol(
  Oe.NODE_ENV !== "production" ? "resolveDynamicComponent" : ""
), mp = Symbol(
  Oe.NODE_ENV !== "production" ? "resolveDirective" : ""
), vp = Symbol(
  Oe.NODE_ENV !== "production" ? "resolveFilter" : ""
), gp = Symbol(
  Oe.NODE_ENV !== "production" ? "withDirectives" : ""
), _p = Symbol(Oe.NODE_ENV !== "production" ? "renderList" : ""), Og = Symbol(Oe.NODE_ENV !== "production" ? "renderSlot" : ""), Tg = Symbol(Oe.NODE_ENV !== "production" ? "createSlots" : ""), iu = Symbol(
  Oe.NODE_ENV !== "production" ? "toDisplayString" : ""
), Pc = Symbol(Oe.NODE_ENV !== "production" ? "mergeProps" : ""), yp = Symbol(
  Oe.NODE_ENV !== "production" ? "normalizeClass" : ""
), bp = Symbol(
  Oe.NODE_ENV !== "production" ? "normalizeStyle" : ""
), el = Symbol(
  Oe.NODE_ENV !== "production" ? "normalizeProps" : ""
), bl = Symbol(
  Oe.NODE_ENV !== "production" ? "guardReactiveProps" : ""
), Ep = Symbol(Oe.NODE_ENV !== "production" ? "toHandlers" : ""), ef = Symbol(Oe.NODE_ENV !== "production" ? "camelize" : ""), QS = Symbol(Oe.NODE_ENV !== "production" ? "capitalize" : ""), tf = Symbol(
  Oe.NODE_ENV !== "production" ? "toHandlerKey" : ""
), Lc = Symbol(
  Oe.NODE_ENV !== "production" ? "setBlockTracking" : ""
), ZS = Symbol(Oe.NODE_ENV !== "production" ? "pushScopeId" : ""), ex = Symbol(Oe.NODE_ENV !== "production" ? "popScopeId" : ""), wp = Symbol(Oe.NODE_ENV !== "production" ? "withCtx" : ""), tx = Symbol(Oe.NODE_ENV !== "production" ? "unref" : ""), nx = Symbol(Oe.NODE_ENV !== "production" ? "isRef" : ""), Sp = Symbol(Oe.NODE_ENV !== "production" ? "withMemo" : ""), $g = Symbol(Oe.NODE_ENV !== "production" ? "isMemoSame" : ""), qi = {
  [Za]: "Fragment",
  [ja]: "Teleport",
  [cp]: "Suspense",
  [Mc]: "KeepAlive",
  [Sg]: "BaseTransition",
  [si]: "openBlock",
  [xg]: "createBlock",
  [Ng]: "createElementBlock",
  [up]: "createVNode",
  [dp]: "createElementVNode",
  [yl]: "createCommentVNode",
  [fp]: "createTextVNode",
  [Cg]: "createStaticVNode",
  [pp]: "resolveComponent",
  [hp]: "resolveDynamicComponent",
  [mp]: "resolveDirective",
  [vp]: "resolveFilter",
  [gp]: "withDirectives",
  [_p]: "renderList",
  [Og]: "renderSlot",
  [Tg]: "createSlots",
  [iu]: "toDisplayString",
  [Pc]: "mergeProps",
  [yp]: "normalizeClass",
  [bp]: "normalizeStyle",
  [el]: "normalizeProps",
  [bl]: "guardReactiveProps",
  [Ep]: "toHandlers",
  [ef]: "camelize",
  [QS]: "capitalize",
  [tf]: "toHandlerKey",
  [Lc]: "setBlockTracking",
  [ZS]: "pushScopeId",
  [ex]: "popScopeId",
  [wp]: "withCtx",
  [tx]: "unref",
  [nx]: "isRef",
  [Sp]: "withMemo",
  [$g]: "isMemoSame"
};
function sx(e) {
  Object.getOwnPropertySymbols(e).forEach((t) => {
    qi[t] = e[t];
  });
}
const g9 = {
  HTML: 0,
  0: "HTML",
  SVG: 1,
  1: "SVG",
  MATH_ML: 2,
  2: "MATH_ML"
}, _9 = {
  ROOT: 0,
  0: "ROOT",
  ELEMENT: 1,
  1: "ELEMENT",
  TEXT: 2,
  2: "TEXT",
  COMMENT: 3,
  3: "COMMENT",
  SIMPLE_EXPRESSION: 4,
  4: "SIMPLE_EXPRESSION",
  INTERPOLATION: 5,
  5: "INTERPOLATION",
  ATTRIBUTE: 6,
  6: "ATTRIBUTE",
  DIRECTIVE: 7,
  7: "DIRECTIVE",
  COMPOUND_EXPRESSION: 8,
  8: "COMPOUND_EXPRESSION",
  IF: 9,
  9: "IF",
  IF_BRANCH: 10,
  10: "IF_BRANCH",
  FOR: 11,
  11: "FOR",
  TEXT_CALL: 12,
  12: "TEXT_CALL",
  VNODE_CALL: 13,
  13: "VNODE_CALL",
  JS_CALL_EXPRESSION: 14,
  14: "JS_CALL_EXPRESSION",
  JS_OBJECT_EXPRESSION: 15,
  15: "JS_OBJECT_EXPRESSION",
  JS_PROPERTY: 16,
  16: "JS_PROPERTY",
  JS_ARRAY_EXPRESSION: 17,
  17: "JS_ARRAY_EXPRESSION",
  JS_FUNCTION_EXPRESSION: 18,
  18: "JS_FUNCTION_EXPRESSION",
  JS_CONDITIONAL_EXPRESSION: 19,
  19: "JS_CONDITIONAL_EXPRESSION",
  JS_CACHE_EXPRESSION: 20,
  20: "JS_CACHE_EXPRESSION",
  JS_BLOCK_STATEMENT: 21,
  21: "JS_BLOCK_STATEMENT",
  JS_TEMPLATE_LITERAL: 22,
  22: "JS_TEMPLATE_LITERAL",
  JS_IF_STATEMENT: 23,
  23: "JS_IF_STATEMENT",
  JS_ASSIGNMENT_EXPRESSION: 24,
  24: "JS_ASSIGNMENT_EXPRESSION",
  JS_SEQUENCE_EXPRESSION: 25,
  25: "JS_SEQUENCE_EXPRESSION",
  JS_RETURN_STATEMENT: 26,
  26: "JS_RETURN_STATEMENT"
}, y9 = {
  ELEMENT: 0,
  0: "ELEMENT",
  COMPONENT: 1,
  1: "COMPONENT",
  SLOT: 2,
  2: "SLOT",
  TEMPLATE: 3,
  3: "TEMPLATE"
}, b9 = {
  NOT_CONSTANT: 0,
  0: "NOT_CONSTANT",
  CAN_SKIP_PATCH: 1,
  1: "CAN_SKIP_PATCH",
  CAN_CACHE: 2,
  2: "CAN_CACHE",
  CAN_STRINGIFY: 3,
  3: "CAN_STRINGIFY"
}, In = {
  start: { line: 1, column: 1, offset: 0 },
  end: { line: 1, column: 1, offset: 0 },
  source: ""
};
function ox(e, t = "") {
  return {
    type: 0,
    source: t,
    children: e,
    helpers: /* @__PURE__ */ new Set(),
    components: [],
    directives: [],
    hoists: [],
    imports: [],
    cached: [],
    temps: 0,
    codegenNode: void 0,
    loc: In
  };
}
function tl(e, t, n, s, o, i, r, a = !1, l = !1, u = !1, d = In) {
  return e && (a ? (e.helper(si), e.helper(Zi(e.inSSR, u))) : e.helper(Qi(e.inSSR, u)), r && e.helper(gp)), {
    type: 13,
    tag: t,
    props: n,
    children: s,
    patchFlag: o,
    dynamicProps: i,
    directives: r,
    isBlock: a,
    disableTracking: l,
    isComponent: u,
    loc: d
  };
}
function Qr(e, t = In) {
  return {
    type: 17,
    loc: t,
    elements: e
  };
}
function ks(e, t = In) {
  return {
    type: 15,
    loc: t,
    properties: e
  };
}
function hn(e, t) {
  return {
    type: 16,
    loc: In,
    key: Ge(e) ? rt(e, !0) : e,
    value: t
  };
}
function rt(e, t = !1, n = In, s = 0) {
  return {
    type: 4,
    loc: n,
    content: e,
    isStatic: t,
    constType: t ? 3 : s
  };
}
function E9(e, t) {
  return {
    type: 5,
    loc: t,
    content: Ge(e) ? rt(e, !1, t) : e
  };
}
function Bs(e, t = In) {
  return {
    type: 8,
    loc: t,
    children: e
  };
}
function Nn(e, t = [], n = In) {
  return {
    type: 14,
    loc: n,
    callee: e,
    arguments: t
  };
}
function Ji(e, t = void 0, n = !1, s = !1, o = In) {
  return {
    type: 18,
    params: e,
    returns: t,
    newline: n,
    isSlot: s,
    loc: o
  };
}
function nf(e, t, n, s = !0) {
  return {
    type: 19,
    test: e,
    consequent: t,
    alternate: n,
    newline: s,
    loc: In
  };
}
function rx(e, t, n = !1, s = !1) {
  return {
    type: 20,
    index: e,
    value: t,
    needPauseTracking: n,
    inVOnce: s,
    needArraySpread: !1,
    loc: In
  };
}
function ix(e) {
  return {
    type: 21,
    body: e,
    loc: In
  };
}
function w9(e) {
  return {
    type: 22,
    elements: e,
    loc: In
  };
}
function S9(e, t, n) {
  return {
    type: 23,
    test: e,
    consequent: t,
    alternate: n,
    loc: In
  };
}
function x9(e, t) {
  return {
    type: 24,
    left: e,
    right: t,
    loc: In
  };
}
function N9(e) {
  return {
    type: 25,
    expressions: e,
    loc: In
  };
}
function C9(e) {
  return {
    type: 26,
    returns: e,
    loc: In
  };
}
function Qi(e, t) {
  return e || t ? up : dp;
}
function Zi(e, t) {
  return e || t ? xg : Ng;
}
function xp(e, { helper: t, removeHelper: n, inSSR: s }) {
  e.isBlock || (e.isBlock = !0, n(Qi(s, e.isComponent)), t(si), t(Zi(s, e.isComponent)));
}
const fb = new Uint8Array([123, 123]), pb = new Uint8Array([125, 125]);
function hb(e) {
  return e >= 97 && e <= 122 || e >= 65 && e <= 90;
}
function $s(e) {
  return e === 32 || e === 10 || e === 9 || e === 12 || e === 13;
}
function kr(e) {
  return e === 47 || e === 62 || $s(e);
}
function sf(e) {
  const t = new Uint8Array(e.length);
  for (let n = 0; n < e.length; n++)
    t[n] = e.charCodeAt(n);
  return t;
}
const Ln = {
  Cdata: new Uint8Array([67, 68, 65, 84, 65, 91]),
  // CDATA[
  CdataEnd: new Uint8Array([93, 93, 62]),
  // ]]>
  CommentEnd: new Uint8Array([45, 45, 62]),
  // `-->`
  ScriptEnd: new Uint8Array([60, 47, 115, 99, 114, 105, 112, 116]),
  // `<\/script`
  StyleEnd: new Uint8Array([60, 47, 115, 116, 121, 108, 101]),
  // `</style`
  TitleEnd: new Uint8Array([60, 47, 116, 105, 116, 108, 101]),
  // `</title`
  TextareaEnd: new Uint8Array([
    60,
    47,
    116,
    101,
    120,
    116,
    97,
    114,
    101,
    97
  ])
  // `</textarea
};
class O9 {
  constructor(t, n) {
    this.stack = t, this.cbs = n, this.state = 1, this.buffer = "", this.sectionStart = 0, this.index = 0, this.entityStart = 0, this.baseState = 1, this.inRCDATA = !1, this.inXML = !1, this.inVPre = !1, this.newlines = [], this.mode = 0, this.delimiterOpen = fb, this.delimiterClose = pb, this.delimiterIndex = -1, this.currentSequence = void 0, this.sequenceIndex = 0;
  }
  get inSFCRoot() {
    return this.mode === 2 && this.stack.length === 0;
  }
  reset() {
    this.state = 1, this.mode = 0, this.buffer = "", this.sectionStart = 0, this.index = 0, this.baseState = 1, this.inRCDATA = !1, this.currentSequence = void 0, this.newlines.length = 0, this.delimiterOpen = fb, this.delimiterClose = pb;
  }
  /**
   * Generate Position object with line / column information using recorded
   * newline positions. We know the index is always going to be an already
   * processed index, so all the newlines up to this index should have been
   * recorded.
   */
  getPos(t) {
    let n = 1, s = t + 1;
    for (let o = this.newlines.length - 1; o >= 0; o--) {
      const i = this.newlines[o];
      if (t > i) {
        n = o + 2, s = t - i;
        break;
      }
    }
    return {
      column: s,
      line: n,
      offset: t
    };
  }
  peek() {
    return this.buffer.charCodeAt(this.index + 1);
  }
  stateText(t) {
    t === 60 ? (this.index > this.sectionStart && this.cbs.ontext(this.sectionStart, this.index), this.state = 5, this.sectionStart = this.index) : !this.inVPre && t === this.delimiterOpen[0] && (this.state = 2, this.delimiterIndex = 0, this.stateInterpolationOpen(t));
  }
  stateInterpolationOpen(t) {
    if (t === this.delimiterOpen[this.delimiterIndex])
      if (this.delimiterIndex === this.delimiterOpen.length - 1) {
        const n = this.index + 1 - this.delimiterOpen.length;
        n > this.sectionStart && this.cbs.ontext(this.sectionStart, n), this.state = 3, this.sectionStart = n;
      } else
        this.delimiterIndex++;
    else this.inRCDATA ? (this.state = 32, this.stateInRCDATA(t)) : (this.state = 1, this.stateText(t));
  }
  stateInterpolation(t) {
    t === this.delimiterClose[0] && (this.state = 4, this.delimiterIndex = 0, this.stateInterpolationClose(t));
  }
  stateInterpolationClose(t) {
    t === this.delimiterClose[this.delimiterIndex] ? this.delimiterIndex === this.delimiterClose.length - 1 ? (this.cbs.oninterpolation(this.sectionStart, this.index + 1), this.inRCDATA ? this.state = 32 : this.state = 1, this.sectionStart = this.index + 1) : this.delimiterIndex++ : (this.state = 3, this.stateInterpolation(t));
  }
  stateSpecialStartSequence(t) {
    const n = this.sequenceIndex === this.currentSequence.length;
    if (!(n ? (
      // If we are at the end of the sequence, make sure the tag name has ended
      kr(t)
    ) : (
      // Otherwise, do a case-insensitive comparison
      (t | 32) === this.currentSequence[this.sequenceIndex]
    )))
      this.inRCDATA = !1;
    else if (!n) {
      this.sequenceIndex++;
      return;
    }
    this.sequenceIndex = 0, this.state = 6, this.stateInTagName(t);
  }
  /** Look for an end tag. For <title> and <textarea>, also decode entities. */
  stateInRCDATA(t) {
    if (this.sequenceIndex === this.currentSequence.length) {
      if (t === 62 || $s(t)) {
        const n = this.index - this.currentSequence.length;
        if (this.sectionStart < n) {
          const s = this.index;
          this.index = n, this.cbs.ontext(this.sectionStart, n), this.index = s;
        }
        this.sectionStart = n + 2, this.stateInClosingTagName(t), this.inRCDATA = !1;
        return;
      }
      this.sequenceIndex = 0;
    }
    (t | 32) === this.currentSequence[this.sequenceIndex] ? this.sequenceIndex += 1 : this.sequenceIndex === 0 ? this.currentSequence === Ln.TitleEnd || this.currentSequence === Ln.TextareaEnd && !this.inSFCRoot ? !this.inVPre && t === this.delimiterOpen[0] && (this.state = 2, this.delimiterIndex = 0, this.stateInterpolationOpen(t)) : this.fastForwardTo(60) && (this.sequenceIndex = 1) : this.sequenceIndex = +(t === 60);
  }
  stateCDATASequence(t) {
    t === Ln.Cdata[this.sequenceIndex] ? ++this.sequenceIndex === Ln.Cdata.length && (this.state = 28, this.currentSequence = Ln.CdataEnd, this.sequenceIndex = 0, this.sectionStart = this.index + 1) : (this.sequenceIndex = 0, this.state = 23, this.stateInDeclaration(t));
  }
  /**
   * When we wait for one specific character, we can speed things up
   * by skipping through the buffer until we find it.
   *
   * @returns Whether the character was found.
   */
  fastForwardTo(t) {
    for (; ++this.index < this.buffer.length; ) {
      const n = this.buffer.charCodeAt(this.index);
      if (n === 10 && this.newlines.push(this.index), n === t)
        return !0;
    }
    return this.index = this.buffer.length - 1, !1;
  }
  /**
   * Comments and CDATA end with `-->` and `]]>`.
   *
   * Their common qualities are:
   * - Their end sequences have a distinct character they start with.
   * - That character is then repeated, so we have to check multiple repeats.
   * - All characters but the start character of the sequence can be skipped.
   */
  stateInCommentLike(t) {
    t === this.currentSequence[this.sequenceIndex] ? ++this.sequenceIndex === this.currentSequence.length && (this.currentSequence === Ln.CdataEnd ? this.cbs.oncdata(this.sectionStart, this.index - 2) : this.cbs.oncomment(this.sectionStart, this.index - 2), this.sequenceIndex = 0, this.sectionStart = this.index + 1, this.state = 1) : this.sequenceIndex === 0 ? this.fastForwardTo(this.currentSequence[0]) && (this.sequenceIndex = 1) : t !== this.currentSequence[this.sequenceIndex - 1] && (this.sequenceIndex = 0);
  }
  startSpecial(t, n) {
    this.enterRCDATA(t, n), this.state = 31;
  }
  enterRCDATA(t, n) {
    this.inRCDATA = !0, this.currentSequence = t, this.sequenceIndex = n;
  }
  stateBeforeTagName(t) {
    t === 33 ? (this.state = 22, this.sectionStart = this.index + 1) : t === 63 ? (this.state = 24, this.sectionStart = this.index + 1) : hb(t) ? (this.sectionStart = this.index, this.mode === 0 ? this.state = 6 : this.inSFCRoot ? this.state = 34 : this.inXML ? this.state = 6 : t === 116 ? this.state = 30 : this.state = t === 115 ? 29 : 6) : t === 47 ? this.state = 8 : (this.state = 1, this.stateText(t));
  }
  stateInTagName(t) {
    kr(t) && this.handleTagName(t);
  }
  stateInSFCRootTagName(t) {
    if (kr(t)) {
      const n = this.buffer.slice(this.sectionStart, this.index);
      n !== "template" && this.enterRCDATA(sf("</" + n), 0), this.handleTagName(t);
    }
  }
  handleTagName(t) {
    this.cbs.onopentagname(this.sectionStart, this.index), this.sectionStart = -1, this.state = 11, this.stateBeforeAttrName(t);
  }
  stateBeforeClosingTagName(t) {
    $s(t) || (t === 62 ? (Oe.NODE_ENV !== "production" && this.cbs.onerr(14, this.index), this.state = 1, this.sectionStart = this.index + 1) : (this.state = hb(t) ? 9 : 27, this.sectionStart = this.index));
  }
  stateInClosingTagName(t) {
    (t === 62 || $s(t)) && (this.cbs.onclosetag(this.sectionStart, this.index), this.sectionStart = -1, this.state = 10, this.stateAfterClosingTagName(t));
  }
  stateAfterClosingTagName(t) {
    t === 62 && (this.state = 1, this.sectionStart = this.index + 1);
  }
  stateBeforeAttrName(t) {
    t === 62 ? (this.cbs.onopentagend(this.index), this.inRCDATA ? this.state = 32 : this.state = 1, this.sectionStart = this.index + 1) : t === 47 ? (this.state = 7, Oe.NODE_ENV !== "production" && this.peek() !== 62 && this.cbs.onerr(22, this.index)) : t === 60 && this.peek() === 47 ? (this.cbs.onopentagend(this.index), this.state = 5, this.sectionStart = this.index) : $s(t) || (Oe.NODE_ENV !== "production" && t === 61 && this.cbs.onerr(
      19,
      this.index
    ), this.handleAttrStart(t));
  }
  handleAttrStart(t) {
    t === 118 && this.peek() === 45 ? (this.state = 13, this.sectionStart = this.index) : t === 46 || t === 58 || t === 64 || t === 35 ? (this.cbs.ondirname(this.index, this.index + 1), this.state = 14, this.sectionStart = this.index + 1) : (this.state = 12, this.sectionStart = this.index);
  }
  stateInSelfClosingTag(t) {
    t === 62 ? (this.cbs.onselfclosingtag(this.index), this.state = 1, this.sectionStart = this.index + 1, this.inRCDATA = !1) : $s(t) || (this.state = 11, this.stateBeforeAttrName(t));
  }
  stateInAttrName(t) {
    t === 61 || kr(t) ? (this.cbs.onattribname(this.sectionStart, this.index), this.handleAttrNameEnd(t)) : Oe.NODE_ENV !== "production" && (t === 34 || t === 39 || t === 60) && this.cbs.onerr(
      17,
      this.index
    );
  }
  stateInDirName(t) {
    t === 61 || kr(t) ? (this.cbs.ondirname(this.sectionStart, this.index), this.handleAttrNameEnd(t)) : t === 58 ? (this.cbs.ondirname(this.sectionStart, this.index), this.state = 14, this.sectionStart = this.index + 1) : t === 46 && (this.cbs.ondirname(this.sectionStart, this.index), this.state = 16, this.sectionStart = this.index + 1);
  }
  stateInDirArg(t) {
    t === 61 || kr(t) ? (this.cbs.ondirarg(this.sectionStart, this.index), this.handleAttrNameEnd(t)) : t === 91 ? this.state = 15 : t === 46 && (this.cbs.ondirarg(this.sectionStart, this.index), this.state = 16, this.sectionStart = this.index + 1);
  }
  stateInDynamicDirArg(t) {
    t === 93 ? this.state = 14 : (t === 61 || kr(t)) && (this.cbs.ondirarg(this.sectionStart, this.index + 1), this.handleAttrNameEnd(t), Oe.NODE_ENV !== "production" && this.cbs.onerr(
      27,
      this.index
    ));
  }
  stateInDirModifier(t) {
    t === 61 || kr(t) ? (this.cbs.ondirmodifier(this.sectionStart, this.index), this.handleAttrNameEnd(t)) : t === 46 && (this.cbs.ondirmodifier(this.sectionStart, this.index), this.sectionStart = this.index + 1);
  }
  handleAttrNameEnd(t) {
    this.sectionStart = this.index, this.state = 17, this.cbs.onattribnameend(this.index), this.stateAfterAttrName(t);
  }
  stateAfterAttrName(t) {
    t === 61 ? this.state = 18 : t === 47 || t === 62 ? (this.cbs.onattribend(0, this.sectionStart), this.sectionStart = -1, this.state = 11, this.stateBeforeAttrName(t)) : $s(t) || (this.cbs.onattribend(0, this.sectionStart), this.handleAttrStart(t));
  }
  stateBeforeAttrValue(t) {
    t === 34 ? (this.state = 19, this.sectionStart = this.index + 1) : t === 39 ? (this.state = 20, this.sectionStart = this.index + 1) : $s(t) || (this.sectionStart = this.index, this.state = 21, this.stateInAttrValueNoQuotes(t));
  }
  handleInAttrValue(t, n) {
    (t === n || this.fastForwardTo(n)) && (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(
      n === 34 ? 3 : 2,
      this.index + 1
    ), this.state = 11);
  }
  stateInAttrValueDoubleQuotes(t) {
    this.handleInAttrValue(t, 34);
  }
  stateInAttrValueSingleQuotes(t) {
    this.handleInAttrValue(t, 39);
  }
  stateInAttrValueNoQuotes(t) {
    $s(t) || t === 62 ? (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = -1, this.cbs.onattribend(1, this.index), this.state = 11, this.stateBeforeAttrName(t)) : (Oe.NODE_ENV !== "production" && t === 34 || t === 39 || t === 60 || t === 61 || t === 96) && this.cbs.onerr(
      18,
      this.index
    );
  }
  stateBeforeDeclaration(t) {
    t === 91 ? (this.state = 26, this.sequenceIndex = 0) : this.state = t === 45 ? 25 : 23;
  }
  stateInDeclaration(t) {
    (t === 62 || this.fastForwardTo(62)) && (this.state = 1, this.sectionStart = this.index + 1);
  }
  stateInProcessingInstruction(t) {
    (t === 62 || this.fastForwardTo(62)) && (this.cbs.onprocessinginstruction(this.sectionStart, this.index), this.state = 1, this.sectionStart = this.index + 1);
  }
  stateBeforeComment(t) {
    t === 45 ? (this.state = 28, this.currentSequence = Ln.CommentEnd, this.sequenceIndex = 2, this.sectionStart = this.index + 1) : this.state = 23;
  }
  stateInSpecialComment(t) {
    (t === 62 || this.fastForwardTo(62)) && (this.cbs.oncomment(this.sectionStart, this.index), this.state = 1, this.sectionStart = this.index + 1);
  }
  stateBeforeSpecialS(t) {
    t === Ln.ScriptEnd[3] ? this.startSpecial(Ln.ScriptEnd, 4) : t === Ln.StyleEnd[3] ? this.startSpecial(Ln.StyleEnd, 4) : (this.state = 6, this.stateInTagName(t));
  }
  stateBeforeSpecialT(t) {
    t === Ln.TitleEnd[3] ? this.startSpecial(Ln.TitleEnd, 4) : t === Ln.TextareaEnd[3] ? this.startSpecial(Ln.TextareaEnd, 4) : (this.state = 6, this.stateInTagName(t));
  }
  startEntity() {
  }
  stateInEntity() {
  }
  /**
   * Iterates through the buffer, calling the function corresponding to the current state.
   *
   * States that are more likely to be hit are higher up, as a performance improvement.
   */
  parse(t) {
    for (this.buffer = t; this.index < this.buffer.length; ) {
      const n = this.buffer.charCodeAt(this.index);
      switch (n === 10 && this.newlines.push(this.index), this.state) {
        case 1: {
          this.stateText(n);
          break;
        }
        case 2: {
          this.stateInterpolationOpen(n);
          break;
        }
        case 3: {
          this.stateInterpolation(n);
          break;
        }
        case 4: {
          this.stateInterpolationClose(n);
          break;
        }
        case 31: {
          this.stateSpecialStartSequence(n);
          break;
        }
        case 32: {
          this.stateInRCDATA(n);
          break;
        }
        case 26: {
          this.stateCDATASequence(n);
          break;
        }
        case 19: {
          this.stateInAttrValueDoubleQuotes(n);
          break;
        }
        case 12: {
          this.stateInAttrName(n);
          break;
        }
        case 13: {
          this.stateInDirName(n);
          break;
        }
        case 14: {
          this.stateInDirArg(n);
          break;
        }
        case 15: {
          this.stateInDynamicDirArg(n);
          break;
        }
        case 16: {
          this.stateInDirModifier(n);
          break;
        }
        case 28: {
          this.stateInCommentLike(n);
          break;
        }
        case 27: {
          this.stateInSpecialComment(n);
          break;
        }
        case 11: {
          this.stateBeforeAttrName(n);
          break;
        }
        case 6: {
          this.stateInTagName(n);
          break;
        }
        case 34: {
          this.stateInSFCRootTagName(n);
          break;
        }
        case 9: {
          this.stateInClosingTagName(n);
          break;
        }
        case 5: {
          this.stateBeforeTagName(n);
          break;
        }
        case 17: {
          this.stateAfterAttrName(n);
          break;
        }
        case 20: {
          this.stateInAttrValueSingleQuotes(n);
          break;
        }
        case 18: {
          this.stateBeforeAttrValue(n);
          break;
        }
        case 8: {
          this.stateBeforeClosingTagName(n);
          break;
        }
        case 10: {
          this.stateAfterClosingTagName(n);
          break;
        }
        case 29: {
          this.stateBeforeSpecialS(n);
          break;
        }
        case 30: {
          this.stateBeforeSpecialT(n);
          break;
        }
        case 21: {
          this.stateInAttrValueNoQuotes(n);
          break;
        }
        case 7: {
          this.stateInSelfClosingTag(n);
          break;
        }
        case 23: {
          this.stateInDeclaration(n);
          break;
        }
        case 22: {
          this.stateBeforeDeclaration(n);
          break;
        }
        case 25: {
          this.stateBeforeComment(n);
          break;
        }
        case 24: {
          this.stateInProcessingInstruction(n);
          break;
        }
        case 33: {
          this.stateInEntity();
          break;
        }
      }
      this.index++;
    }
    this.cleanup(), this.finish();
  }
  /**
   * Remove data that has already been consumed from the buffer.
   */
  cleanup() {
    this.sectionStart !== this.index && (this.state === 1 || this.state === 32 && this.sequenceIndex === 0 ? (this.cbs.ontext(this.sectionStart, this.index), this.sectionStart = this.index) : (this.state === 19 || this.state === 20 || this.state === 21) && (this.cbs.onattribdata(this.sectionStart, this.index), this.sectionStart = this.index));
  }
  finish() {
    this.handleTrailingData(), this.cbs.onend();
  }
  /** Handle any trailing data. */
  handleTrailingData() {
    const t = this.buffer.length;
    this.sectionStart >= t || (this.state === 28 ? this.currentSequence === Ln.CdataEnd ? this.cbs.oncdata(this.sectionStart, t) : this.cbs.oncomment(this.sectionStart, t) : this.state === 6 || this.state === 11 || this.state === 18 || this.state === 17 || this.state === 12 || this.state === 13 || this.state === 14 || this.state === 15 || this.state === 16 || this.state === 20 || this.state === 19 || this.state === 21 || this.state === 9 || this.cbs.ontext(this.sectionStart, t));
  }
  emitCodePoint(t, n) {
  }
}
const T9 = {
  COMPILER_IS_ON_ELEMENT: "COMPILER_IS_ON_ELEMENT",
  COMPILER_V_BIND_SYNC: "COMPILER_V_BIND_SYNC",
  COMPILER_V_BIND_OBJECT_ORDER: "COMPILER_V_BIND_OBJECT_ORDER",
  COMPILER_V_ON_NATIVE: "COMPILER_V_ON_NATIVE",
  COMPILER_V_IF_V_FOR_PRECEDENCE: "COMPILER_V_IF_V_FOR_PRECEDENCE",
  COMPILER_NATIVE_TEMPLATE: "COMPILER_NATIVE_TEMPLATE",
  COMPILER_INLINE_TEMPLATE: "COMPILER_INLINE_TEMPLATE",
  COMPILER_FILTERS: "COMPILER_FILTERS"
}, $9 = {
  COMPILER_IS_ON_ELEMENT: {
    message: 'Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".',
    link: "https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html"
  },
  COMPILER_V_BIND_SYNC: {
    message: (e) => `.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${e}.sync\` should be changed to \`v-model:${e}\`.`,
    link: "https://v3-migration.vuejs.org/breaking-changes/v-model.html"
  },
  COMPILER_V_BIND_OBJECT_ORDER: {
    message: 'v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.',
    link: "https://v3-migration.vuejs.org/breaking-changes/v-bind.html"
  },
  COMPILER_V_ON_NATIVE: {
    message: ".native modifier for v-on has been removed as is no longer necessary.",
    link: "https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html"
  },
  COMPILER_V_IF_V_FOR_PRECEDENCE: {
    message: "v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with <template> tags or use a computed property that filters v-for data source.",
    link: "https://v3-migration.vuejs.org/breaking-changes/v-if-v-for.html"
  },
  COMPILER_NATIVE_TEMPLATE: {
    message: "<template> with no special directives will render as a native template element instead of its inner content in Vue 3."
  },
  COMPILER_INLINE_TEMPLATE: {
    message: '"inline-template" has been removed in Vue 3.',
    link: "https://v3-migration.vuejs.org/breaking-changes/inline-template-attribute.html"
  },
  COMPILER_FILTERS: {
    message: 'filters have been removed in Vue 3. The "|" symbol will be treated as native JavaScript bitwise OR operator. Use method calls or computed properties instead.',
    link: "https://v3-migration.vuejs.org/breaking-changes/filters.html"
  }
};
function jm(e, { compatConfig: t }) {
  const n = t && t[e];
  return e === "MODE" ? n || 3 : n;
}
function Zr(e, t) {
  const n = jm("MODE", t), s = jm(e, t);
  return n === 3 ? s === !0 : s !== !1;
}
function ea(e, t, n, ...s) {
  const o = Zr(e, t);
  return Oe.NODE_ENV !== "production" && o && Vc(e, t, n, ...s), o;
}
function Vc(e, t, n, ...s) {
  if (jm(e, t) === "suppress-warning")
    return;
  const { message: i, link: r } = $9[e], a = `(deprecation ${e}) ${typeof i == "function" ? i(...s) : i}${r ? `
  Details: ${r}` : ""}`, l = new SyntaxError(a);
  l.code = e, n && (l.loc = n), t.onWarn(l);
}
function kg(e) {
  throw e;
}
function ax(e) {
  Oe.NODE_ENV !== "production" && console.warn(`[Vue warn] ${e.message}`);
}
function Bt(e, t, n, s) {
  const o = Oe.NODE_ENV !== "production" ? (n || lx)[e] + (s || "") : `https://vuejs.org/error-reference/#compiler-${e}`, i = new SyntaxError(String(o));
  return i.code = e, i.loc = t, i;
}
const k9 = {
  ABRUPT_CLOSING_OF_EMPTY_COMMENT: 0,
  0: "ABRUPT_CLOSING_OF_EMPTY_COMMENT",
  CDATA_IN_HTML_CONTENT: 1,
  1: "CDATA_IN_HTML_CONTENT",
  DUPLICATE_ATTRIBUTE: 2,
  2: "DUPLICATE_ATTRIBUTE",
  END_TAG_WITH_ATTRIBUTES: 3,
  3: "END_TAG_WITH_ATTRIBUTES",
  END_TAG_WITH_TRAILING_SOLIDUS: 4,
  4: "END_TAG_WITH_TRAILING_SOLIDUS",
  EOF_BEFORE_TAG_NAME: 5,
  5: "EOF_BEFORE_TAG_NAME",
  EOF_IN_CDATA: 6,
  6: "EOF_IN_CDATA",
  EOF_IN_COMMENT: 7,
  7: "EOF_IN_COMMENT",
  EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT: 8,
  8: "EOF_IN_SCRIPT_HTML_COMMENT_LIKE_TEXT",
  EOF_IN_TAG: 9,
  9: "EOF_IN_TAG",
  INCORRECTLY_CLOSED_COMMENT: 10,
  10: "INCORRECTLY_CLOSED_COMMENT",
  INCORRECTLY_OPENED_COMMENT: 11,
  11: "INCORRECTLY_OPENED_COMMENT",
  INVALID_FIRST_CHARACTER_OF_TAG_NAME: 12,
  12: "INVALID_FIRST_CHARACTER_OF_TAG_NAME",
  MISSING_ATTRIBUTE_VALUE: 13,
  13: "MISSING_ATTRIBUTE_VALUE",
  MISSING_END_TAG_NAME: 14,
  14: "MISSING_END_TAG_NAME",
  MISSING_WHITESPACE_BETWEEN_ATTRIBUTES: 15,
  15: "MISSING_WHITESPACE_BETWEEN_ATTRIBUTES",
  NESTED_COMMENT: 16,
  16: "NESTED_COMMENT",
  UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME: 17,
  17: "UNEXPECTED_CHARACTER_IN_ATTRIBUTE_NAME",
  UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE: 18,
  18: "UNEXPECTED_CHARACTER_IN_UNQUOTED_ATTRIBUTE_VALUE",
  UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME: 19,
  19: "UNEXPECTED_EQUALS_SIGN_BEFORE_ATTRIBUTE_NAME",
  UNEXPECTED_NULL_CHARACTER: 20,
  20: "UNEXPECTED_NULL_CHARACTER",
  UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME: 21,
  21: "UNEXPECTED_QUESTION_MARK_INSTEAD_OF_TAG_NAME",
  UNEXPECTED_SOLIDUS_IN_TAG: 22,
  22: "UNEXPECTED_SOLIDUS_IN_TAG",
  X_INVALID_END_TAG: 23,
  23: "X_INVALID_END_TAG",
  X_MISSING_END_TAG: 24,
  24: "X_MISSING_END_TAG",
  X_MISSING_INTERPOLATION_END: 25,
  25: "X_MISSING_INTERPOLATION_END",
  X_MISSING_DIRECTIVE_NAME: 26,
  26: "X_MISSING_DIRECTIVE_NAME",
  X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END: 27,
  27: "X_MISSING_DYNAMIC_DIRECTIVE_ARGUMENT_END",
  X_V_IF_NO_EXPRESSION: 28,
  28: "X_V_IF_NO_EXPRESSION",
  X_V_IF_SAME_KEY: 29,
  29: "X_V_IF_SAME_KEY",
  X_V_ELSE_NO_ADJACENT_IF: 30,
  30: "X_V_ELSE_NO_ADJACENT_IF",
  X_V_FOR_NO_EXPRESSION: 31,
  31: "X_V_FOR_NO_EXPRESSION",
  X_V_FOR_MALFORMED_EXPRESSION: 32,
  32: "X_V_FOR_MALFORMED_EXPRESSION",
  X_V_FOR_TEMPLATE_KEY_PLACEMENT: 33,
  33: "X_V_FOR_TEMPLATE_KEY_PLACEMENT",
  X_V_BIND_NO_EXPRESSION: 34,
  34: "X_V_BIND_NO_EXPRESSION",
  X_V_ON_NO_EXPRESSION: 35,
  35: "X_V_ON_NO_EXPRESSION",
  X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET: 36,
  36: "X_V_SLOT_UNEXPECTED_DIRECTIVE_ON_SLOT_OUTLET",
  X_V_SLOT_MIXED_SLOT_USAGE: 37,
  37: "X_V_SLOT_MIXED_SLOT_USAGE",
  X_V_SLOT_DUPLICATE_SLOT_NAMES: 38,
  38: "X_V_SLOT_DUPLICATE_SLOT_NAMES",
  X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN: 39,
  39: "X_V_SLOT_EXTRANEOUS_DEFAULT_SLOT_CHILDREN",
  X_V_SLOT_MISPLACED: 40,
  40: "X_V_SLOT_MISPLACED",
  X_V_MODEL_NO_EXPRESSION: 41,
  41: "X_V_MODEL_NO_EXPRESSION",
  X_V_MODEL_MALFORMED_EXPRESSION: 42,
  42: "X_V_MODEL_MALFORMED_EXPRESSION",
  X_V_MODEL_ON_SCOPE_VARIABLE: 43,
  43: "X_V_MODEL_ON_SCOPE_VARIABLE",
  X_V_MODEL_ON_PROPS: 44,
  44: "X_V_MODEL_ON_PROPS",
  X_INVALID_EXPRESSION: 45,
  45: "X_INVALID_EXPRESSION",
  X_KEEP_ALIVE_INVALID_CHILDREN: 46,
  46: "X_KEEP_ALIVE_INVALID_CHILDREN",
  X_PREFIX_ID_NOT_SUPPORTED: 47,
  47: "X_PREFIX_ID_NOT_SUPPORTED",
  X_MODULE_MODE_NOT_SUPPORTED: 48,
  48: "X_MODULE_MODE_NOT_SUPPORTED",
  X_CACHE_HANDLER_NOT_SUPPORTED: 49,
  49: "X_CACHE_HANDLER_NOT_SUPPORTED",
  X_SCOPE_ID_NOT_SUPPORTED: 50,
  50: "X_SCOPE_ID_NOT_SUPPORTED",
  X_VNODE_HOOKS: 51,
  51: "X_VNODE_HOOKS",
  X_V_BIND_INVALID_SAME_NAME_ARGUMENT: 52,
  52: "X_V_BIND_INVALID_SAME_NAME_ARGUMENT",
  __EXTEND_POINT__: 53,
  53: "__EXTEND_POINT__"
}, lx = {
  // parse errors
  0: "Illegal comment.",
  1: "CDATA section is allowed only in XML context.",
  2: "Duplicate attribute.",
  3: "End tag cannot have attributes.",
  4: "Illegal '/' in tags.",
  5: "Unexpected EOF in tag.",
  6: "Unexpected EOF in CDATA section.",
  7: "Unexpected EOF in comment.",
  8: "Unexpected EOF in script.",
  9: "Unexpected EOF in tag.",
  10: "Incorrectly closed comment.",
  11: "Incorrectly opened comment.",
  12: "Illegal tag name. Use '&lt;' to print '<'.",
  13: "Attribute value was expected.",
  14: "End tag name was expected.",
  15: "Whitespace was expected.",
  16: "Unexpected '<!--' in comment.",
  17: `Attribute name cannot contain U+0022 ("), U+0027 ('), and U+003C (<).`,
  18: "Unquoted attribute value cannot contain U+0022 (\"), U+0027 ('), U+003C (<), U+003D (=), and U+0060 (`).",
  19: "Attribute name cannot start with '='.",
  21: "'<?' is allowed only in XML context.",
  20: "Unexpected null character.",
  22: "Illegal '/' in tags.",
  // Vue-specific parse errors
  23: "Invalid end tag.",
  24: "Element is missing end tag.",
  25: "Interpolation end sign was not found.",
  27: "End bracket for dynamic directive argument was not found. Note that dynamic directive argument cannot contain spaces.",
  26: "Legal directive name was expected.",
  // transform errors
  28: "v-if/v-else-if is missing expression.",
  29: "v-if/else branches must use unique keys.",
  30: "v-else/v-else-if has no adjacent v-if or v-else-if.",
  31: "v-for is missing expression.",
  32: "v-for has invalid expression.",
  33: "<template v-for> key should be placed on the <template> tag.",
  34: "v-bind is missing expression.",
  52: "v-bind with same-name shorthand only allows static argument.",
  35: "v-on is missing expression.",
  36: "Unexpected custom directive on <slot> outlet.",
  37: "Mixed v-slot usage on both the component and nested <template>. When there are multiple named slots, all slots should use <template> syntax to avoid scope ambiguity.",
  38: "Duplicate slot names found. ",
  39: "Extraneous children found when component already has explicitly named default slot. These children will be ignored.",
  40: "v-slot can only be used on components or <template> tags.",
  41: "v-model is missing expression.",
  42: "v-model value must be a valid JavaScript member expression.",
  43: "v-model cannot be used on v-for or v-slot scope variables because they are not writable.",
  44: `v-model cannot be used on a prop, because local prop bindings are not writable.
Use a v-bind binding combined with a v-on listener that emits update:x event instead.`,
  45: "Error parsing JavaScript expression: ",
  46: "<KeepAlive> expects exactly one child component.",
  51: "@vnode-* hooks in templates are no longer supported. Use the vue: prefix instead. For example, @vnode-mounted should be changed to @vue:mounted. @vnode-* hooks support has been removed in 3.4.",
  // generic errors
  47: '"prefixIdentifiers" option is not supported in this build of compiler.',
  48: "ES module mode is not supported in this build of compiler.",
  49: '"cacheHandlers" option is only supported when the "prefixIdentifiers" option is enabled.',
  50: '"scopeId" option is only supported in module mode.',
  // just to fulfill types
  53: ""
};
function D9(e, t, n = !1, s = [], o = /* @__PURE__ */ Object.create(null)) {
}
function R9(e, t, n) {
  return !1;
}
function I9(e, t) {
  if (e && (e.type === "ObjectProperty" || e.type === "ArrayPattern")) {
    let n = t.length;
    for (; n--; ) {
      const s = t[n];
      if (s.type === "AssignmentExpression")
        return !0;
      if (s.type !== "ObjectProperty" && !s.type.endsWith("Pattern"))
        break;
    }
  }
  return !1;
}
function A9(e) {
  let t = e.length;
  for (; t--; ) {
    const n = e[t];
    if (n.type === "NewExpression")
      return !0;
    if (n.type !== "MemberExpression")
      break;
  }
  return !1;
}
function M9(e, t) {
  for (const n of e.params)
    for (const s of ar(n))
      t(s);
}
function P9(e, t) {
  for (const n of e.body)
    if (n.type === "VariableDeclaration") {
      if (n.declare) continue;
      for (const s of n.declarations)
        for (const o of ar(s.id))
          t(o);
    } else if (n.type === "FunctionDeclaration" || n.type === "ClassDeclaration") {
      if (n.declare || !n.id) continue;
      t(n.id);
    } else L9(n) && V9(n, !0, t);
}
function L9(e) {
  return e.type === "ForOfStatement" || e.type === "ForInStatement" || e.type === "ForStatement";
}
function V9(e, t, n) {
  const s = e.type === "ForStatement" ? e.init : e.left;
  if (s && s.type === "VariableDeclaration" && (s.kind === "var" && t))
    for (const o of s.declarations)
      for (const i of ar(o.id))
        n(i);
}
function ar(e, t = []) {
  switch (e.type) {
    case "Identifier":
      t.push(e);
      break;
    case "MemberExpression":
      let n = e;
      for (; n.type === "MemberExpression"; )
        n = n.object;
      t.push(n);
      break;
    case "ObjectPattern":
      for (const s of e.properties)
        s.type === "RestElement" ? ar(s.argument, t) : ar(s.value, t);
      break;
    case "ArrayPattern":
      e.elements.forEach((s) => {
        s && ar(s, t);
      });
      break;
    case "RestElement":
      ar(e.argument, t);
      break;
    case "AssignmentPattern":
      ar(e.left, t);
      break;
  }
  return t;
}
const F9 = (e) => /Function(?:Expression|Declaration)$|Method$/.test(e.type), cx = (e) => e && (e.type === "ObjectProperty" || e.type === "ObjectMethod") && !e.computed, U9 = (e, t) => cx(t) && t.key === e, ux = [
  "TSAsExpression",
  // foo as number
  "TSTypeAssertion",
  // (<number>foo)
  "TSNonNullExpression",
  // foo!
  "TSInstantiationExpression",
  // foo<string>
  "TSSatisfiesExpression"
  // foo satisfies T
];
function dx(e) {
  return ux.includes(e.type) ? dx(e.expression) : e;
}
const cs = (e) => e.type === 4 && e.isStatic;
function Dg(e) {
  switch (e) {
    case "Teleport":
    case "teleport":
      return ja;
    case "Suspense":
    case "suspense":
      return cp;
    case "KeepAlive":
    case "keep-alive":
      return Mc;
    case "BaseTransition":
    case "base-transition":
      return Sg;
  }
}
const j9 = /^\d|[^\$\w\xA0-\uFFFF]/, au = (e) => !j9.test(e), B9 = /[A-Za-z_$\xA0-\uFFFF]/, H9 = /[\.\?\w$\xA0-\uFFFF]/, Y9 = /\s+[.[]\s*|\s*[.[]\s+/g, fx = (e) => e.type === 4 ? e.content : e.loc.source, px = (e) => {
  const t = fx(e).trim().replace(Y9, (a) => a.trim());
  let n = 0, s = [], o = 0, i = 0, r = null;
  for (let a = 0; a < t.length; a++) {
    const l = t.charAt(a);
    switch (n) {
      case 0:
        if (l === "[")
          s.push(n), n = 1, o++;
        else if (l === "(")
          s.push(n), n = 2, i++;
        else if (!(a === 0 ? B9 : H9).test(l))
          return !1;
        break;
      case 1:
        l === "'" || l === '"' || l === "`" ? (s.push(n), n = 3, r = l) : l === "[" ? o++ : l === "]" && (--o || (n = s.pop()));
        break;
      case 2:
        if (l === "'" || l === '"' || l === "`")
          s.push(n), n = 3, r = l;
        else if (l === "(")
          i++;
        else if (l === ")") {
          if (a === t.length - 1)
            return !1;
          --i || (n = s.pop());
        }
        break;
      case 3:
        l === r && (n = s.pop(), r = null);
        break;
    }
  }
  return !o && !i;
}, W9 = Jt, Rg = px, G9 = /^\s*(async\s*)?(\([^)]*?\)|[\w$_]+)\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/, hx = (e) => G9.test(fx(e)), z9 = Jt, mx = hx;
function K9(e, t, n = t.length) {
  return vx(
    {
      offset: e.offset,
      line: e.line,
      column: e.column
    },
    t,
    n
  );
}
function vx(e, t, n = t.length) {
  let s = 0, o = -1;
  for (let i = 0; i < n; i++)
    t.charCodeAt(i) === 10 && (s++, o = i);
  return e.offset += n, e.line += s, e.column = o === -1 ? e.column + n : n - o, e;
}
function Bm(e, t) {
  if (!e)
    throw new Error(t || "unexpected compiler condition");
}
function zn(e, t, n = !1) {
  for (let s = 0; s < e.props.length; s++) {
    const o = e.props[s];
    if (o.type === 7 && (n || o.exp) && (Ge(t) ? o.name === t : t.test(o.name)))
      return o;
  }
}
function nl(e, t, n = !1, s = !1) {
  for (let o = 0; o < e.props.length; o++) {
    const i = e.props[o];
    if (i.type === 6) {
      if (n) continue;
      if (i.name === t && (i.value || s))
        return i;
    } else if (i.name === "bind" && (i.exp || s) && dr(i.arg, t))
      return i;
  }
}
function dr(e, t) {
  return !!(e && cs(e) && e.content === t);
}
function gx(e) {
  return e.props.some(
    (t) => t.type === 7 && t.name === "bind" && (!t.arg || // v-bind="obj"
    t.arg.type !== 4 || // v-bind:[_ctx.foo]
    !t.arg.isStatic)
    // v-bind:[foo]
  );
}
function md(e) {
  return e.type === 5 || e.type === 2;
}
function Ig(e) {
  return e.type === 7 && e.name === "slot";
}
function sl(e) {
  return e.type === 1 && e.tagType === 3;
}
function Fc(e) {
  return e.type === 1 && e.tagType === 2;
}
const X9 = /* @__PURE__ */ new Set([el, bl]);
function _x(e, t = []) {
  if (e && !Ge(e) && e.type === 14) {
    const n = e.callee;
    if (!Ge(n) && X9.has(n))
      return _x(
        e.arguments[0],
        t.concat(e)
      );
  }
  return [e, t];
}
function Uc(e, t, n) {
  let s, o = e.type === 13 ? e.props : e.arguments[2], i = [], r;
  if (o && !Ge(o) && o.type === 14) {
    const a = _x(o);
    o = a[0], i = a[1], r = i[i.length - 1];
  }
  if (o == null || Ge(o))
    s = ks([t]);
  else if (o.type === 14) {
    const a = o.arguments[0];
    !Ge(a) && a.type === 15 ? mb(t, a) || a.properties.unshift(t) : o.callee === Ep ? s = Nn(n.helper(Pc), [
      ks([t]),
      o
    ]) : o.arguments.unshift(ks([t])), !s && (s = o);
  } else o.type === 15 ? (mb(t, o) || o.properties.unshift(t), s = o) : (s = Nn(n.helper(Pc), [
    ks([t]),
    o
  ]), r && r.callee === bl && (r = i[i.length - 2]));
  e.type === 13 ? r ? r.arguments[0] = s : e.props = s : r ? r.arguments[0] = s : e.arguments[2] = s;
}
function mb(e, t) {
  let n = !1;
  if (e.key.type === 4) {
    const s = e.key.content;
    n = t.properties.some(
      (o) => o.key.type === 4 && o.key.content === s
    );
  }
  return n;
}
function ol(e, t) {
  return `_${t}_${e.replace(/[^\w]/g, (n, s) => n === "-" ? "_" : e.charCodeAt(s).toString())}`;
}
function Qs(e, t) {
  if (!e || Object.keys(t).length === 0)
    return !1;
  switch (e.type) {
    case 1:
      for (let n = 0; n < e.props.length; n++) {
        const s = e.props[n];
        if (s.type === 7 && (Qs(s.arg, t) || Qs(s.exp, t)))
          return !0;
      }
      return e.children.some((n) => Qs(n, t));
    case 11:
      return Qs(e.source, t) ? !0 : e.children.some((n) => Qs(n, t));
    case 9:
      return e.branches.some((n) => Qs(n, t));
    case 10:
      return Qs(e.condition, t) ? !0 : e.children.some((n) => Qs(n, t));
    case 4:
      return !e.isStatic && au(e.content) && !!t[e.content];
    case 8:
      return e.children.some((n) => mt(n) && Qs(n, t));
    case 5:
    case 12:
      return Qs(e.content, t);
    case 2:
    case 3:
    case 20:
      return !1;
    default:
      return !1;
  }
}
function yx(e) {
  return e.type === 14 && e.callee === Sp ? e.arguments[1].returns : e;
}
const bx = /([\s\S]*?)\s+(?:in|of)\s+(\S[\s\S]*)/, Ex = {
  parseMode: "base",
  ns: 0,
  delimiters: ["{{", "}}"],
  getNamespace: () => 0,
  isVoidTag: Ta,
  isPreTag: Ta,
  isIgnoreNewlineTag: Ta,
  isCustomElement: Ta,
  onError: kg,
  onWarn: ax,
  comments: Oe.NODE_ENV !== "production",
  prefixIdentifiers: !1
};
let xt = Ex, jc = null, mr = "", Hn = null, Ct = null, gs = "", er = -1, bi = -1, Ag = 0, Fr = !1, Hm = null;
const sn = [], qt = new O9(sn, {
  onerr: hs,
  ontext(e, t) {
    Mu(Fn(e, t), e, t);
  },
  ontextentity(e, t, n) {
    Mu(e, t, n);
  },
  oninterpolation(e, t) {
    if (Fr)
      return Mu(Fn(e, t), e, t);
    let n = e + qt.delimiterOpen.length, s = t - qt.delimiterClose.length;
    for (; $s(mr.charCodeAt(n)); )
      n++;
    for (; $s(mr.charCodeAt(s - 1)); )
      s--;
    let o = Fn(n, s);
    o.includes("&") && (o = xt.decodeEntities(o, !1)), Ym({
      type: 5,
      content: gd(o, !1, gn(n, s)),
      loc: gn(e, t)
    });
  },
  onopentagname(e, t) {
    const n = Fn(e, t);
    Hn = {
      type: 1,
      tag: n,
      ns: xt.getNamespace(n, sn[0], xt.ns),
      tagType: 0,
      // will be refined on tag close
      props: [],
      children: [],
      loc: gn(e - 1, t),
      codegenNode: void 0
    };
  },
  onopentagend(e) {
    gb(e);
  },
  onclosetag(e, t) {
    const n = Fn(e, t);
    if (!xt.isVoidTag(n)) {
      let s = !1;
      for (let o = 0; o < sn.length; o++)
        if (sn[o].tag.toLowerCase() === n.toLowerCase()) {
          s = !0, o > 0 && hs(24, sn[0].loc.start.offset);
          for (let r = 0; r <= o; r++) {
            const a = sn.shift();
            vd(a, t, r < o);
          }
          break;
        }
      s || hs(23, wx(e, 60));
    }
  },
  onselfclosingtag(e) {
    const t = Hn.tag;
    Hn.isSelfClosing = !0, gb(e), sn[0] && sn[0].tag === t && vd(sn.shift(), e);
  },
  onattribname(e, t) {
    Ct = {
      type: 6,
      name: Fn(e, t),
      nameLoc: gn(e, t),
      value: void 0,
      loc: gn(e)
    };
  },
  ondirname(e, t) {
    const n = Fn(e, t), s = n === "." || n === ":" ? "bind" : n === "@" ? "on" : n === "#" ? "slot" : n.slice(2);
    if (!Fr && s === "" && hs(26, e), Fr || s === "")
      Ct = {
        type: 6,
        name: n,
        nameLoc: gn(e, t),
        value: void 0,
        loc: gn(e)
      };
    else if (Ct = {
      type: 7,
      name: s,
      rawName: n,
      exp: void 0,
      arg: void 0,
      modifiers: n === "." ? [rt("prop")] : [],
      loc: gn(e)
    }, s === "pre") {
      Fr = qt.inVPre = !0, Hm = Hn;
      const o = Hn.props;
      for (let i = 0; i < o.length; i++)
        o[i].type === 7 && (o[i] = iW(o[i]));
    }
  },
  ondirarg(e, t) {
    if (e === t) return;
    const n = Fn(e, t);
    if (Fr)
      Ct.name += n, Ci(Ct.nameLoc, t);
    else {
      const s = n[0] !== "[";
      Ct.arg = gd(
        s ? n : n.slice(1, -1),
        s,
        gn(e, t),
        s ? 3 : 0
      );
    }
  },
  ondirmodifier(e, t) {
    const n = Fn(e, t);
    if (Fr)
      Ct.name += "." + n, Ci(Ct.nameLoc, t);
    else if (Ct.name === "slot") {
      const s = Ct.arg;
      s && (s.content += "." + n, Ci(s.loc, t));
    } else {
      const s = rt(n, !0, gn(e, t));
      Ct.modifiers.push(s);
    }
  },
  onattribdata(e, t) {
    gs += Fn(e, t), er < 0 && (er = e), bi = t;
  },
  onattribentity(e, t, n) {
    gs += e, er < 0 && (er = t), bi = n;
  },
  onattribnameend(e) {
    const t = Ct.loc.start.offset, n = Fn(t, e);
    Ct.type === 7 && (Ct.rawName = n), Hn.props.some(
      (s) => (s.type === 7 ? s.rawName : s.name) === n
    ) && hs(2, t);
  },
  onattribend(e, t) {
    if (Hn && Ct) {
      if (Ci(Ct.loc, t), e !== 0)
        if (gs.includes("&") && (gs = xt.decodeEntities(
          gs,
          !0
        )), Ct.type === 6)
          Ct.name === "class" && (gs = xx(gs).trim()), e === 1 && !gs && hs(13, t), Ct.value = {
            type: 2,
            content: gs,
            loc: e === 1 ? gn(er, bi) : gn(er - 1, bi + 1)
          }, qt.inSFCRoot && Hn.tag === "template" && Ct.name === "lang" && gs && gs !== "html" && qt.enterRCDATA(sf("</template"), 0);
        else {
          let n = 0;
          Ct.exp = gd(
            gs,
            !1,
            gn(er, bi),
            0,
            n
          ), Ct.name === "for" && (Ct.forParseResult = J9(Ct.exp));
          let s = -1;
          Ct.name === "bind" && (s = Ct.modifiers.findIndex(
            (o) => o.content === "sync"
          )) > -1 && ea(
            "COMPILER_V_BIND_SYNC",
            xt,
            Ct.loc,
            Ct.rawName
          ) && (Ct.name = "model", Ct.modifiers.splice(s, 1));
        }
      (Ct.type !== 7 || Ct.name !== "pre") && Hn.props.push(Ct);
    }
    gs = "", er = bi = -1;
  },
  oncomment(e, t) {
    xt.comments && Ym({
      type: 3,
      content: Fn(e, t),
      loc: gn(e - 4, t + 3)
    });
  },
  onend() {
    const e = mr.length;
    if (Oe.NODE_ENV !== "production" && qt.state !== 1)
      switch (qt.state) {
        case 5:
        case 8:
          hs(5, e);
          break;
        case 3:
        case 4:
          hs(
            25,
            qt.sectionStart
          );
          break;
        case 28:
          qt.currentSequence === Ln.CdataEnd ? hs(6, e) : hs(7, e);
          break;
        case 6:
        case 7:
        case 9:
        case 11:
        case 12:
        case 13:
        case 14:
        case 15:
        case 16:
        case 17:
        case 18:
        case 19:
        // "
        case 20:
        // '
        case 21:
          hs(9, e);
          break;
      }
    for (let t = 0; t < sn.length; t++)
      vd(sn[t], e - 1), hs(24, sn[t].loc.start.offset);
  },
  oncdata(e, t) {
    sn[0].ns !== 0 ? Mu(Fn(e, t), e, t) : hs(1, e - 9);
  },
  onprocessinginstruction(e) {
    (sn[0] ? sn[0].ns : xt.ns) === 0 && hs(
      21,
      e - 1
    );
  }
}), vb = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/, q9 = /^\(|\)$/g;
function J9(e) {
  const t = e.loc, n = e.content, s = n.match(bx);
  if (!s) return;
  const [, o, i] = s, r = (f, p, h = !1) => {
    const m = t.start.offset + p, v = m + f.length;
    return gd(
      f,
      !1,
      gn(m, v),
      0,
      h ? 1 : 0
      /* Normal */
    );
  }, a = {
    source: r(i.trim(), n.indexOf(i, o.length)),
    value: void 0,
    key: void 0,
    index: void 0,
    finalized: !1
  };
  let l = o.trim().replace(q9, "").trim();
  const u = o.indexOf(l), d = l.match(vb);
  if (d) {
    l = l.replace(vb, "").trim();
    const f = d[1].trim();
    let p;
    if (f && (p = n.indexOf(f, u + l.length), a.key = r(f, p, !0)), d[2]) {
      const h = d[2].trim();
      h && (a.index = r(
        h,
        n.indexOf(
          h,
          a.key ? p + f.length : u + l.length
        ),
        !0
      ));
    }
  }
  return l && (a.value = r(l, u, !0)), a;
}
function Fn(e, t) {
  return mr.slice(e, t);
}
function gb(e) {
  qt.inSFCRoot && (Hn.innerLoc = gn(e + 1, e + 1)), Ym(Hn);
  const { tag: t, ns: n } = Hn;
  n === 0 && xt.isPreTag(t) && Ag++, xt.isVoidTag(t) ? vd(Hn, e) : (sn.unshift(Hn), (n === 1 || n === 2) && (qt.inXML = !0)), Hn = null;
}
function Mu(e, t, n) {
  {
    const i = sn[0] && sn[0].tag;
    i !== "script" && i !== "style" && e.includes("&") && (e = xt.decodeEntities(e, !1));
  }
  const s = sn[0] || jc, o = s.children[s.children.length - 1];
  o && o.type === 2 ? (o.content += e, Ci(o.loc, n)) : s.children.push({
    type: 2,
    content: e,
    loc: gn(t, n)
  });
}
function vd(e, t, n = !1) {
  n ? Ci(e.loc, wx(t, 60)) : Ci(e.loc, Q9(t, 62) + 1), qt.inSFCRoot && (e.children.length ? e.innerLoc.end = it({}, e.children[e.children.length - 1].loc.end) : e.innerLoc.end = it({}, e.innerLoc.start), e.innerLoc.source = Fn(
    e.innerLoc.start.offset,
    e.innerLoc.end.offset
  ));
  const { tag: s, ns: o, children: i } = e;
  if (Fr || (s === "slot" ? e.tagType = 2 : _b(e) ? e.tagType = 3 : eW(e) && (e.tagType = 1)), qt.inRCDATA || (e.children = Sx(i)), o === 0 && xt.isIgnoreNewlineTag(s)) {
    const r = i[0];
    r && r.type === 2 && (r.content = r.content.replace(/^\r?\n/, ""));
  }
  o === 0 && xt.isPreTag(s) && Ag--, Hm === e && (Fr = qt.inVPre = !1, Hm = null), qt.inXML && (sn[0] ? sn[0].ns : xt.ns) === 0 && (qt.inXML = !1);
  {
    const r = e.props;
    if (Oe.NODE_ENV !== "production" && Zr(
      "COMPILER_V_IF_V_FOR_PRECEDENCE",
      xt
    )) {
      let l = !1, u = !1;
      for (let d = 0; d < r.length; d++) {
        const f = r[d];
        if (f.type === 7 && (f.name === "if" ? l = !0 : f.name === "for" && (u = !0)), l && u) {
          Vc(
            "COMPILER_V_IF_V_FOR_PRECEDENCE",
            xt,
            e.loc
          );
          break;
        }
      }
    }
    if (!qt.inSFCRoot && Zr(
      "COMPILER_NATIVE_TEMPLATE",
      xt
    ) && e.tag === "template" && !_b(e)) {
      Oe.NODE_ENV !== "production" && Vc(
        "COMPILER_NATIVE_TEMPLATE",
        xt,
        e.loc
      );
      const l = sn[0] || jc, u = l.children.indexOf(e);
      l.children.splice(u, 1, ...e.children);
    }
    const a = r.find(
      (l) => l.type === 6 && l.name === "inline-template"
    );
    a && ea(
      "COMPILER_INLINE_TEMPLATE",
      xt,
      a.loc
    ) && e.children.length && (a.value = {
      type: 2,
      content: Fn(
        e.children[0].loc.start.offset,
        e.children[e.children.length - 1].loc.end.offset
      ),
      loc: a.loc
    });
  }
}
function Q9(e, t) {
  let n = e;
  for (; mr.charCodeAt(n) !== t && n < mr.length - 1; ) n++;
  return n;
}
function wx(e, t) {
  let n = e;
  for (; mr.charCodeAt(n) !== t && n >= 0; ) n--;
  return n;
}
const Z9 = /* @__PURE__ */ new Set(["if", "else", "else-if", "for", "slot"]);
function _b({ tag: e, props: t }) {
  if (e === "template") {
    for (let n = 0; n < t.length; n++)
      if (t[n].type === 7 && Z9.has(t[n].name))
        return !0;
  }
  return !1;
}
function eW({ tag: e, props: t }) {
  if (xt.isCustomElement(e))
    return !1;
  if (e === "component" || tW(e.charCodeAt(0)) || Dg(e) || xt.isBuiltInComponent && xt.isBuiltInComponent(e) || xt.isNativeTag && !xt.isNativeTag(e))
    return !0;
  for (let n = 0; n < t.length; n++) {
    const s = t[n];
    if (s.type === 6) {
      if (s.name === "is" && s.value) {
        if (s.value.content.startsWith("vue:"))
          return !0;
        if (ea(
          "COMPILER_IS_ON_ELEMENT",
          xt,
          s.loc
        ))
          return !0;
      }
    } else if (
      // :is on plain element - only treat as component in compat mode
      s.name === "bind" && dr(s.arg, "is") && ea(
        "COMPILER_IS_ON_ELEMENT",
        xt,
        s.loc
      )
    )
      return !0;
  }
  return !1;
}
function tW(e) {
  return e > 64 && e < 91;
}
const nW = /\r\n/g;
function Sx(e, t) {
  const n = xt.whitespace !== "preserve";
  let s = !1;
  for (let o = 0; o < e.length; o++) {
    const i = e[o];
    if (i.type === 2)
      if (Ag)
        i.content = i.content.replace(nW, `
`);
      else if (sW(i.content)) {
        const r = e[o - 1] && e[o - 1].type, a = e[o + 1] && e[o + 1].type;
        !r || !a || n && (r === 3 && (a === 3 || a === 1) || r === 1 && (a === 3 || a === 1 && oW(i.content))) ? (s = !0, e[o] = null) : i.content = " ";
      } else n && (i.content = xx(i.content));
  }
  return s ? e.filter(Boolean) : e;
}
function sW(e) {
  for (let t = 0; t < e.length; t++)
    if (!$s(e.charCodeAt(t)))
      return !1;
  return !0;
}
function oW(e) {
  for (let t = 0; t < e.length; t++) {
    const n = e.charCodeAt(t);
    if (n === 10 || n === 13)
      return !0;
  }
  return !1;
}
function xx(e) {
  let t = "", n = !1;
  for (let s = 0; s < e.length; s++)
    $s(e.charCodeAt(s)) ? n || (t += " ", n = !0) : (t += e[s], n = !1);
  return t;
}
function Ym(e) {
  (sn[0] || jc).children.push(e);
}
function gn(e, t) {
  return {
    start: qt.getPos(e),
    // @ts-expect-error allow late attachment
    end: t == null ? t : qt.getPos(t),
    // @ts-expect-error allow late attachment
    source: t == null ? t : Fn(e, t)
  };
}
function rW(e) {
  return gn(e.start.offset, e.end.offset);
}
function Ci(e, t) {
  e.end = qt.getPos(t), e.source = Fn(e.start.offset, t);
}
function iW(e) {
  const t = {
    type: 6,
    name: e.rawName,
    nameLoc: gn(
      e.loc.start.offset,
      e.loc.start.offset + e.rawName.length
    ),
    value: void 0,
    loc: e.loc
  };
  if (e.exp) {
    const n = e.exp.loc;
    n.end.offset < e.loc.end.offset && (n.start.offset--, n.start.column--, n.end.offset++, n.end.column++), t.value = {
      type: 2,
      content: e.exp.content,
      loc: n
    };
  }
  return t;
}
function gd(e, t = !1, n, s = 0, o = 0) {
  return rt(e, t, n, s);
}
function hs(e, t, n) {
  xt.onError(
    Bt(e, gn(t, t), void 0, n)
  );
}
function aW() {
  qt.reset(), Hn = null, Ct = null, gs = "", er = -1, bi = -1, sn.length = 0;
}
function Mg(e, t) {
  if (aW(), mr = e, xt = it({}, Ex), t) {
    let o;
    for (o in t)
      t[o] != null && (xt[o] = t[o]);
  }
  if (Oe.NODE_ENV !== "production" && !xt.decodeEntities)
    throw new Error(
      "[@vue/compiler-core] decodeEntities option is required in browser builds."
    );
  qt.mode = xt.parseMode === "html" ? 1 : xt.parseMode === "sfc" ? 2 : 0, qt.inXML = xt.ns === 1 || xt.ns === 2;
  const n = t && t.delimiters;
  n && (qt.delimiterOpen = sf(n[0]), qt.delimiterClose = sf(n[1]));
  const s = jc = ox([], e);
  return qt.parse(mr), s.loc = gn(0, e.length), s.children = Sx(s.children), jc = null, s;
}
function lW(e, t) {
  _d(
    e,
    void 0,
    t,
    // Root node is unfortunately non-hoistable due to potential parent
    // fallthrough attributes.
    Nx(e, e.children[0])
  );
}
function Nx(e, t) {
  const { children: n } = e;
  return n.length === 1 && t.type === 1 && !Fc(t);
}
function _d(e, t, n, s = !1, o = !1) {
  const { children: i } = e, r = [];
  for (let d = 0; d < i.length; d++) {
    const f = i[d];
    if (f.type === 1 && f.tagType === 0) {
      const p = s ? 0 : Es(f, n);
      if (p > 0) {
        if (p >= 2) {
          f.codegenNode.patchFlag = -1, r.push(f);
          continue;
        }
      } else {
        const h = f.codegenNode;
        if (h.type === 13) {
          const m = h.patchFlag;
          if ((m === void 0 || m === 512 || m === 1) && Ox(f, n) >= 2) {
            const v = Tx(f);
            v && (h.props = n.hoist(v));
          }
          h.dynamicProps && (h.dynamicProps = n.hoist(h.dynamicProps));
        }
      }
    } else if (f.type === 12 && (s ? 0 : Es(f, n)) >= 2) {
      r.push(f);
      continue;
    }
    if (f.type === 1) {
      const p = f.tagType === 1;
      p && n.scopes.vSlot++, _d(f, e, n, !1, o), p && n.scopes.vSlot--;
    } else if (f.type === 11)
      _d(f, e, n, f.children.length === 1, !0);
    else if (f.type === 9)
      for (let p = 0; p < f.branches.length; p++)
        _d(
          f.branches[p],
          e,
          n,
          f.branches[p].children.length === 1,
          o
        );
  }
  let a = !1;
  if (r.length === i.length && e.type === 1) {
    if (e.tagType === 0 && e.codegenNode && e.codegenNode.type === 13 && Ce(e.codegenNode.children))
      e.codegenNode.children = l(
        Qr(e.codegenNode.children)
      ), a = !0;
    else if (e.tagType === 1 && e.codegenNode && e.codegenNode.type === 13 && e.codegenNode.children && !Ce(e.codegenNode.children) && e.codegenNode.children.type === 15) {
      const d = u(e.codegenNode, "default");
      d && (d.returns = l(
        Qr(d.returns)
      ), a = !0);
    } else if (e.tagType === 3 && t && t.type === 1 && t.tagType === 1 && t.codegenNode && t.codegenNode.type === 13 && t.codegenNode.children && !Ce(t.codegenNode.children) && t.codegenNode.children.type === 15) {
      const d = zn(e, "slot", !0), f = d && d.arg && u(t.codegenNode, d.arg);
      f && (f.returns = l(
        Qr(f.returns)
      ), a = !0);
    }
  }
  if (!a)
    for (const d of r)
      d.codegenNode = n.cache(d.codegenNode);
  function l(d) {
    const f = n.cache(d);
    return o && n.hmr && (f.needArraySpread = !0), f;
  }
  function u(d, f) {
    if (d.children && !Ce(d.children) && d.children.type === 15) {
      const p = d.children.properties.find(
        (h) => h.key === f || h.key.content === f
      );
      return p && p.value;
    }
  }
  r.length && n.transformHoist && n.transformHoist(i, n, e);
}
function Es(e, t) {
  const { constantCache: n } = t;
  switch (e.type) {
    case 1:
      if (e.tagType !== 0)
        return 0;
      const s = n.get(e);
      if (s !== void 0)
        return s;
      const o = e.codegenNode;
      if (o.type !== 13 || o.isBlock && e.tag !== "svg" && e.tag !== "foreignObject" && e.tag !== "math")
        return 0;
      if (o.patchFlag === void 0) {
        let r = 3;
        const a = Ox(e, t);
        if (a === 0)
          return n.set(e, 0), 0;
        a < r && (r = a);
        for (let l = 0; l < e.children.length; l++) {
          const u = Es(e.children[l], t);
          if (u === 0)
            return n.set(e, 0), 0;
          u < r && (r = u);
        }
        if (r > 1)
          for (let l = 0; l < e.props.length; l++) {
            const u = e.props[l];
            if (u.type === 7 && u.name === "bind" && u.exp) {
              const d = Es(u.exp, t);
              if (d === 0)
                return n.set(e, 0), 0;
              d < r && (r = d);
            }
          }
        if (o.isBlock) {
          for (let l = 0; l < e.props.length; l++)
            if (e.props[l].type === 7)
              return n.set(e, 0), 0;
          t.removeHelper(si), t.removeHelper(
            Zi(t.inSSR, o.isComponent)
          ), o.isBlock = !1, t.helper(Qi(t.inSSR, o.isComponent));
        }
        return n.set(e, r), r;
      } else
        return n.set(e, 0), 0;
    case 2:
    case 3:
      return 3;
    case 9:
    case 11:
    case 10:
      return 0;
    case 5:
    case 12:
      return Es(e.content, t);
    case 4:
      return e.constType;
    case 8:
      let i = 3;
      for (let r = 0; r < e.children.length; r++) {
        const a = e.children[r];
        if (Ge(a) || us(a))
          continue;
        const l = Es(a, t);
        if (l === 0)
          return 0;
        l < i && (i = l);
      }
      return i;
    case 20:
      return 2;
    default:
      return 0;
  }
}
const cW = /* @__PURE__ */ new Set([
  yp,
  bp,
  el,
  bl
]);
function Cx(e, t) {
  if (e.type === 14 && !Ge(e.callee) && cW.has(e.callee)) {
    const n = e.arguments[0];
    if (n.type === 4)
      return Es(n, t);
    if (n.type === 14)
      return Cx(n, t);
  }
  return 0;
}
function Ox(e, t) {
  let n = 3;
  const s = Tx(e);
  if (s && s.type === 15) {
    const { properties: o } = s;
    for (let i = 0; i < o.length; i++) {
      const { key: r, value: a } = o[i], l = Es(r, t);
      if (l === 0)
        return l;
      l < n && (n = l);
      let u;
      if (a.type === 4 ? u = Es(a, t) : a.type === 14 ? u = Cx(a, t) : u = 0, u === 0)
        return u;
      u < n && (n = u);
    }
  }
  return n;
}
function Tx(e) {
  const t = e.codegenNode;
  if (t.type === 13)
    return t.props;
}
function $x(e, {
  filename: t = "",
  prefixIdentifiers: n = !1,
  hoistStatic: s = !1,
  hmr: o = !1,
  cacheHandlers: i = !1,
  nodeTransforms: r = [],
  directiveTransforms: a = {},
  transformHoist: l = null,
  isBuiltInComponent: u = Jt,
  isCustomElement: d = Jt,
  expressionPlugins: f = [],
  scopeId: p = null,
  slotted: h = !0,
  ssr: m = !1,
  inSSR: v = !1,
  ssrCssVars: _ = "",
  bindingMetadata: b = pt,
  inline: w = !1,
  isTS: y = !1,
  onError: x = kg,
  onWarn: N = ax,
  compatConfig: S
}) {
  const O = t.replace(/\?.*$/, "").match(/([^/\\]+)\.\w+$/), $ = {
    // options
    filename: t,
    selfName: O && fo(Gt(O[1])),
    prefixIdentifiers: n,
    hoistStatic: s,
    hmr: o,
    cacheHandlers: i,
    nodeTransforms: r,
    directiveTransforms: a,
    transformHoist: l,
    isBuiltInComponent: u,
    isCustomElement: d,
    expressionPlugins: f,
    scopeId: p,
    slotted: h,
    ssr: m,
    inSSR: v,
    ssrCssVars: _,
    bindingMetadata: b,
    inline: w,
    isTS: y,
    onError: x,
    onWarn: N,
    compatConfig: S,
    // state
    root: e,
    helpers: /* @__PURE__ */ new Map(),
    components: /* @__PURE__ */ new Set(),
    directives: /* @__PURE__ */ new Set(),
    hoists: [],
    imports: [],
    cached: [],
    constantCache: /* @__PURE__ */ new WeakMap(),
    temps: 0,
    identifiers: /* @__PURE__ */ Object.create(null),
    scopes: {
      vFor: 0,
      vSlot: 0,
      vPre: 0,
      vOnce: 0
    },
    parent: null,
    grandParent: null,
    currentNode: e,
    childIndex: 0,
    inVOnce: !1,
    // methods
    helper(T) {
      const R = $.helpers.get(T) || 0;
      return $.helpers.set(T, R + 1), T;
    },
    removeHelper(T) {
      const R = $.helpers.get(T);
      if (R) {
        const P = R - 1;
        P ? $.helpers.set(T, P) : $.helpers.delete(T);
      }
    },
    helperString(T) {
      return `_${qi[$.helper(T)]}`;
    },
    replaceNode(T) {
      if (Oe.NODE_ENV !== "production") {
        if (!$.currentNode)
          throw new Error("Node being replaced is already removed.");
        if (!$.parent)
          throw new Error("Cannot replace root node.");
      }
      $.parent.children[$.childIndex] = $.currentNode = T;
    },
    removeNode(T) {
      if (Oe.NODE_ENV !== "production" && !$.parent)
        throw new Error("Cannot remove root node.");
      const R = $.parent.children, P = T ? R.indexOf(T) : $.currentNode ? $.childIndex : -1;
      if (Oe.NODE_ENV !== "production" && P < 0)
        throw new Error("node being removed is not a child of current parent");
      !T || T === $.currentNode ? ($.currentNode = null, $.onNodeRemoved()) : $.childIndex > P && ($.childIndex--, $.onNodeRemoved()), $.parent.children.splice(P, 1);
    },
    onNodeRemoved: Jt,
    addIdentifiers(T) {
    },
    removeIdentifiers(T) {
    },
    hoist(T) {
      Ge(T) && (T = rt(T)), $.hoists.push(T);
      const R = rt(
        `_hoisted_${$.hoists.length}`,
        !1,
        T.loc,
        2
      );
      return R.hoisted = T, R;
    },
    cache(T, R = !1, P = !1) {
      const M = rx(
        $.cached.length,
        T,
        R,
        P
      );
      return $.cached.push(M), M;
    }
  };
  return $.filters = /* @__PURE__ */ new Set(), $;
}
function kx(e, t) {
  const n = $x(e, t);
  lu(e, n), t.hoistStatic && lW(e, n), t.ssr || uW(e, n), e.helpers = /* @__PURE__ */ new Set([...n.helpers.keys()]), e.components = [...n.components], e.directives = [...n.directives], e.imports = n.imports, e.hoists = n.hoists, e.temps = n.temps, e.cached = n.cached, e.transformed = !0, e.filters = [...n.filters];
}
function uW(e, t) {
  const { helper: n } = t, { children: s } = e;
  if (s.length === 1) {
    const o = s[0];
    if (Nx(e, o) && o.codegenNode) {
      const i = o.codegenNode;
      i.type === 13 && xp(i, t), e.codegenNode = i;
    } else
      e.codegenNode = o;
  } else if (s.length > 1) {
    let o = 64;
    Oe.NODE_ENV !== "production" && s.filter((i) => i.type !== 3).length === 1 && (o |= 2048), e.codegenNode = tl(
      t,
      n(Za),
      void 0,
      e.children,
      o,
      void 0,
      void 0,
      !0,
      void 0,
      !1
    );
  }
}
function dW(e, t) {
  let n = 0;
  const s = () => {
    n--;
  };
  for (; n < e.children.length; n++) {
    const o = e.children[n];
    Ge(o) || (t.grandParent = t.parent, t.parent = e, t.childIndex = n, t.onNodeRemoved = s, lu(o, t));
  }
}
function lu(e, t) {
  t.currentNode = e;
  const { nodeTransforms: n } = t, s = [];
  for (let i = 0; i < n.length; i++) {
    const r = n[i](e, t);
    if (r && (Ce(r) ? s.push(...r) : s.push(r)), t.currentNode)
      e = t.currentNode;
    else
      return;
  }
  switch (e.type) {
    case 3:
      t.ssr || t.helper(yl);
      break;
    case 5:
      t.ssr || t.helper(iu);
      break;
    // for container types, further traverse downwards
    case 9:
      for (let i = 0; i < e.branches.length; i++)
        lu(e.branches[i], t);
      break;
    case 10:
    case 11:
    case 1:
    case 0:
      dW(e, t);
      break;
  }
  t.currentNode = e;
  let o = s.length;
  for (; o--; )
    s[o]();
}
function Pg(e, t) {
  const n = Ge(e) ? (s) => s === e : (s) => e.test(s);
  return (s, o) => {
    if (s.type === 1) {
      const { props: i } = s;
      if (s.tagType === 3 && i.some(Ig))
        return;
      const r = [];
      for (let a = 0; a < i.length; a++) {
        const l = i[a];
        if (l.type === 7 && n(l.name)) {
          i.splice(a, 1), a--;
          const u = t(s, l, o);
          u && r.push(u);
        }
      }
      return r;
    }
  };
}
const Np = "/*@__PURE__*/", Dx = (e) => `${qi[e]}: _${qi[e]}`;
function fW(e, {
  mode: t = "function",
  prefixIdentifiers: n = t === "module",
  sourceMap: s = !1,
  filename: o = "template.vue.html",
  scopeId: i = null,
  optimizeImports: r = !1,
  runtimeGlobalName: a = "Vue",
  runtimeModuleName: l = "vue",
  ssrRuntimeModuleName: u = "vue/server-renderer",
  ssr: d = !1,
  isTS: f = !1,
  inSSR: p = !1
}) {
  const h = {
    mode: t,
    prefixIdentifiers: n,
    sourceMap: s,
    filename: o,
    scopeId: i,
    optimizeImports: r,
    runtimeGlobalName: a,
    runtimeModuleName: l,
    ssrRuntimeModuleName: u,
    ssr: d,
    isTS: f,
    inSSR: p,
    source: e.source,
    code: "",
    column: 1,
    line: 1,
    offset: 0,
    indentLevel: 0,
    pure: !1,
    map: void 0,
    helper(v) {
      return `_${qi[v]}`;
    },
    push(v, _ = -2, b) {
      h.code += v;
    },
    indent() {
      m(++h.indentLevel);
    },
    deindent(v = !1) {
      v ? --h.indentLevel : m(--h.indentLevel);
    },
    newline() {
      m(h.indentLevel);
    }
  };
  function m(v) {
    h.push(
      `
` + "  ".repeat(v),
      0
      /* Start */
    );
  }
  return h;
}
function Rx(e, t = {}) {
  const n = fW(e, t);
  t.onContextCreated && t.onContextCreated(n);
  const {
    mode: s,
    push: o,
    prefixIdentifiers: i,
    indent: r,
    deindent: a,
    newline: l,
    scopeId: u,
    ssr: d
  } = n, f = Array.from(e.helpers), p = f.length > 0, h = !i && s !== "module";
  pW(e, n);
  const v = d ? "ssrRender" : "render", b = (d ? ["_ctx", "_push", "_parent", "_attrs"] : ["_ctx", "_cache"]).join(", ");
  if (o(`function ${v}(${b}) {`), r(), h && (o("with (_ctx) {"), r(), p && (o(
    `const { ${f.map(Dx).join(", ")} } = _Vue
`,
    -1
    /* End */
  ), l())), e.components.length && (yh(e.components, "component", n), (e.directives.length || e.temps > 0) && l()), e.directives.length && (yh(e.directives, "directive", n), e.temps > 0 && l()), e.filters && e.filters.length && (l(), yh(e.filters, "filter", n), l()), e.temps > 0) {
    o("let ");
    for (let w = 0; w < e.temps; w++)
      o(`${w > 0 ? ", " : ""}_temp${w}`);
  }
  return (e.components.length || e.directives.length || e.temps) && (o(
    `
`,
    0
    /* Start */
  ), l()), d || o("return "), e.codegenNode ? es(e.codegenNode, n) : o("null"), h && (a(), o("}")), a(), o("}"), {
    ast: e,
    code: n.code,
    preamble: "",
    map: n.map ? n.map.toJSON() : void 0
  };
}
function pW(e, t) {
  const {
    ssr: n,
    prefixIdentifiers: s,
    push: o,
    newline: i,
    runtimeModuleName: r,
    runtimeGlobalName: a,
    ssrRuntimeModuleName: l
  } = t, u = a, d = Array.from(e.helpers);
  if (d.length > 0 && (o(
    `const _Vue = ${u}
`,
    -1
    /* End */
  ), e.hoists.length)) {
    const f = [
      up,
      dp,
      yl,
      fp,
      Cg
    ].filter((p) => d.includes(p)).map(Dx).join(", ");
    o(
      `const { ${f} } = _Vue
`,
      -1
      /* End */
    );
  }
  hW(e.hoists, t), i(), o("return ");
}
function yh(e, t, { helper: n, push: s, newline: o, isTS: i }) {
  const r = n(
    t === "filter" ? vp : t === "component" ? pp : mp
  );
  for (let a = 0; a < e.length; a++) {
    let l = e[a];
    const u = l.endsWith("__self");
    u && (l = l.slice(0, -6)), s(
      `const ${ol(l, t)} = ${r}(${JSON.stringify(l)}${u ? ", true" : ""})${i ? "!" : ""}`
    ), a < e.length - 1 && o();
  }
}
function hW(e, t) {
  if (!e.length)
    return;
  t.pure = !0;
  const { push: n, newline: s } = t;
  s();
  for (let o = 0; o < e.length; o++) {
    const i = e[o];
    i && (n(`const _hoisted_${o + 1} = `), es(i, t), s());
  }
  t.pure = !1;
}
function mW(e) {
  return Ge(e) || e.type === 4 || e.type === 2 || e.type === 5 || e.type === 8;
}
function Lg(e, t) {
  const n = e.length > 3 || Oe.NODE_ENV !== "production" && e.some((s) => Ce(s) || !mW(s));
  t.push("["), n && t.indent(), cu(e, t, n), n && t.deindent(), t.push("]");
}
function cu(e, t, n = !1, s = !0) {
  const { push: o, newline: i } = t;
  for (let r = 0; r < e.length; r++) {
    const a = e[r];
    Ge(a) ? o(
      a,
      -3
      /* Unknown */
    ) : Ce(a) ? Lg(a, t) : es(a, t), r < e.length - 1 && (n ? (s && o(","), i()) : s && o(", "));
  }
}
function es(e, t) {
  if (Ge(e)) {
    t.push(
      e,
      -3
      /* Unknown */
    );
    return;
  }
  if (us(e)) {
    t.push(t.helper(e));
    return;
  }
  switch (e.type) {
    case 1:
    case 9:
    case 11:
      Oe.NODE_ENV !== "production" && Bm(
        e.codegenNode != null,
        "Codegen node is missing for element/if/for node. Apply appropriate transforms first."
      ), es(e.codegenNode, t);
      break;
    case 2:
      vW(e, t);
      break;
    case 4:
      Ix(e, t);
      break;
    case 5:
      gW(e, t);
      break;
    case 12:
      es(e.codegenNode, t);
      break;
    case 8:
      Ax(e, t);
      break;
    case 3:
      yW(e, t);
      break;
    case 13:
      bW(e, t);
      break;
    case 14:
      wW(e, t);
      break;
    case 15:
      SW(e, t);
      break;
    case 17:
      xW(e, t);
      break;
    case 18:
      NW(e, t);
      break;
    case 19:
      CW(e, t);
      break;
    case 20:
      OW(e, t);
      break;
    case 21:
      cu(e.body, t, !0, !1);
      break;
    // SSR only types
    case 22:
      break;
    case 23:
      break;
    case 24:
      break;
    case 25:
      break;
    case 26:
      break;
    /* v8 ignore start */
    case 10:
      break;
    default:
      if (Oe.NODE_ENV !== "production")
        return Bm(!1, `unhandled codegen node type: ${e.type}`), e;
  }
}
function vW(e, t) {
  t.push(JSON.stringify(e.content), -3, e);
}
function Ix(e, t) {
  const { content: n, isStatic: s } = e;
  t.push(
    s ? JSON.stringify(n) : n,
    -3,
    e
  );
}
function gW(e, t) {
  const { push: n, helper: s, pure: o } = t;
  o && n(Np), n(`${s(iu)}(`), es(e.content, t), n(")");
}
function Ax(e, t) {
  for (let n = 0; n < e.children.length; n++) {
    const s = e.children[n];
    Ge(s) ? t.push(
      s,
      -3
      /* Unknown */
    ) : es(s, t);
  }
}
function _W(e, t) {
  const { push: n } = t;
  if (e.type === 8)
    n("["), Ax(e, t), n("]");
  else if (e.isStatic) {
    const s = au(e.content) ? e.content : JSON.stringify(e.content);
    n(s, -2, e);
  } else
    n(`[${e.content}]`, -3, e);
}
function yW(e, t) {
  const { push: n, helper: s, pure: o } = t;
  o && n(Np), n(
    `${s(yl)}(${JSON.stringify(e.content)})`,
    -3,
    e
  );
}
function bW(e, t) {
  const { push: n, helper: s, pure: o } = t, {
    tag: i,
    props: r,
    children: a,
    patchFlag: l,
    dynamicProps: u,
    directives: d,
    isBlock: f,
    disableTracking: p,
    isComponent: h
  } = e;
  let m;
  if (l)
    if (Oe.NODE_ENV !== "production")
      if (l < 0)
        m = l + ` /* ${ql[l]} */`;
      else {
        const _ = Object.keys(ql).map(Number).filter((b) => b > 0 && l & b).map((b) => ql[b]).join(", ");
        m = l + ` /* ${_} */`;
      }
    else
      m = String(l);
  d && n(s(gp) + "("), f && n(`(${s(si)}(${p ? "true" : ""}), `), o && n(Np);
  const v = f ? Zi(t.inSSR, h) : Qi(t.inSSR, h);
  n(s(v) + "(", -2, e), cu(
    EW([i, r, a, m, u]),
    t
  ), n(")"), f && n(")"), d && (n(", "), es(d, t), n(")"));
}
function EW(e) {
  let t = e.length;
  for (; t-- && e[t] == null; )
    ;
  return e.slice(0, t + 1).map((n) => n || "null");
}
function wW(e, t) {
  const { push: n, helper: s, pure: o } = t, i = Ge(e.callee) ? e.callee : s(e.callee);
  o && n(Np), n(i + "(", -2, e), cu(e.arguments, t), n(")");
}
function SW(e, t) {
  const { push: n, indent: s, deindent: o, newline: i } = t, { properties: r } = e;
  if (!r.length) {
    n("{}", -2, e);
    return;
  }
  const a = r.length > 1 || Oe.NODE_ENV !== "production" && r.some((l) => l.value.type !== 4);
  n(a ? "{" : "{ "), a && s();
  for (let l = 0; l < r.length; l++) {
    const { key: u, value: d } = r[l];
    _W(u, t), n(": "), es(d, t), l < r.length - 1 && (n(","), i());
  }
  a && o(), n(a ? "}" : " }");
}
function xW(e, t) {
  Lg(e.elements, t);
}
function NW(e, t) {
  const { push: n, indent: s, deindent: o } = t, { params: i, returns: r, body: a, newline: l, isSlot: u } = e;
  u && n(`_${qi[wp]}(`), n("(", -2, e), Ce(i) ? cu(i, t) : i && es(i, t), n(") => "), (l || a) && (n("{"), s()), r ? (l && n("return "), Ce(r) ? Lg(r, t) : es(r, t)) : a && es(a, t), (l || a) && (o(), n("}")), u && (e.isNonScopedSlot && n(", undefined, true"), n(")"));
}
function CW(e, t) {
  const { test: n, consequent: s, alternate: o, newline: i } = e, { push: r, indent: a, deindent: l, newline: u } = t;
  if (n.type === 4) {
    const f = !au(n.content);
    f && r("("), Ix(n, t), f && r(")");
  } else
    r("("), es(n, t), r(")");
  i && a(), t.indentLevel++, i || r(" "), r("? "), es(s, t), t.indentLevel--, i && u(), i || r(" "), r(": ");
  const d = o.type === 19;
  d || t.indentLevel++, es(o, t), d || t.indentLevel--, i && l(
    !0
    /* without newline */
  );
}
function OW(e, t) {
  const { push: n, helper: s, indent: o, deindent: i, newline: r } = t, { needPauseTracking: a, needArraySpread: l } = e;
  l && n("[...("), n(`_cache[${e.index}] || (`), a && (o(), n(`${s(Lc)}(-1`), e.inVOnce && n(", true"), n("),"), r(), n("(")), n(`_cache[${e.index}] = `), es(e.value, t), a && (n(`).cacheIndex = ${e.index},`), r(), n(`${s(Lc)}(1),`), r(), n(`_cache[${e.index}]`), i()), n(")"), l && n(")]");
}
const TW = new RegExp(
  "\\b" + "arguments,await,break,case,catch,class,const,continue,debugger,default,delete,do,else,export,extends,finally,for,function,if,import,let,new,return,super,switch,throw,try,var,void,while,with,yield".split(",").join("\\b|\\b") + "\\b"
), $W = /'(?:[^'\\]|\\.)*'|"(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*\$\{|\}(?:[^`\\]|\\.)*`|`(?:[^`\\]|\\.)*`/g;
function Oi(e, t, n = !1, s = !1) {
  const o = e.content;
  if (o.trim())
    try {
      new Function(
        s ? ` ${o} ` : `return ${n ? `(${o}) => {}` : `(${o})`}`
      );
    } catch (i) {
      let r = i.message;
      const a = o.replace($W, "").match(TW);
      a && (r = `avoid using JavaScript keyword as property name: "${a[0]}"`), t.onError(
        Bt(
          45,
          e.loc,
          void 0,
          r
        )
      );
    }
}
const Mx = (e, t) => {
  if (e.type === 5)
    e.content = yd(
      e.content,
      t
    );
  else if (e.type === 1) {
    const n = zn(e, "memo");
    for (let s = 0; s < e.props.length; s++) {
      const o = e.props[s];
      if (o.type === 7 && o.name !== "for") {
        const i = o.exp, r = o.arg;
        i && i.type === 4 && !(o.name === "on" && r) && // key has been processed in transformFor(vMemo + vFor)
        !(n && r && r.type === 4 && r.content === "key") && (o.exp = yd(
          i,
          t,
          // slot args must be processed as function params
          o.name === "slot"
        )), r && r.type === 4 && !r.isStatic && (o.arg = yd(r, t));
      }
    }
  }
};
function yd(e, t, n = !1, s = !1, o = Object.create(t.identifiers)) {
  return Oe.NODE_ENV !== "production" && Oi(e, t, n, s), e;
}
function Px(e) {
  return Ge(e) ? e : e.type === 4 ? e.content : e.children.map(Px).join("");
}
const kW = Pg(
  /^(if|else|else-if)$/,
  (e, t, n) => Lx(e, t, n, (s, o, i) => {
    const r = n.parent.children;
    let a = r.indexOf(s), l = 0;
    for (; a-- >= 0; ) {
      const u = r[a];
      u && u.type === 9 && (l += u.branches.length);
    }
    return () => {
      if (i)
        s.codegenNode = bb(
          o,
          l,
          n
        );
      else {
        const u = RW(s.codegenNode);
        u.alternate = bb(
          o,
          l + s.branches.length - 1,
          n
        );
      }
    };
  })
);
function Lx(e, t, n, s) {
  if (t.name !== "else" && (!t.exp || !t.exp.content.trim())) {
    const o = t.exp ? t.exp.loc : e.loc;
    n.onError(
      Bt(28, t.loc)
    ), t.exp = rt("true", !1, o);
  }
  if (Oe.NODE_ENV !== "production" && t.exp && Oi(t.exp, n), t.name === "if") {
    const o = yb(e, t), i = {
      type: 9,
      loc: rW(e.loc),
      branches: [o]
    };
    if (n.replaceNode(i), s)
      return s(i, o, !0);
  } else {
    const o = n.parent.children, i = [];
    let r = o.indexOf(e);
    for (; r-- >= -1; ) {
      const a = o[r];
      if (a && a.type === 3) {
        n.removeNode(a), Oe.NODE_ENV !== "production" && i.unshift(a);
        continue;
      }
      if (a && a.type === 2 && !a.content.trim().length) {
        n.removeNode(a);
        continue;
      }
      if (a && a.type === 9) {
        t.name === "else-if" && a.branches[a.branches.length - 1].condition === void 0 && n.onError(
          Bt(30, e.loc)
        ), n.removeNode();
        const l = yb(e, t);
        if (Oe.NODE_ENV !== "production" && i.length && // #3619 ignore comments if the v-if is direct child of <transition>
        !(n.parent && n.parent.type === 1 && (n.parent.tag === "transition" || n.parent.tag === "Transition")) && (l.children = [...i, ...l.children]), Oe.NODE_ENV !== "production") {
          const d = l.userKey;
          d && a.branches.forEach(({ userKey: f }) => {
            DW(f, d) && n.onError(
              Bt(
                29,
                l.userKey.loc
              )
            );
          });
        }
        a.branches.push(l);
        const u = s && s(a, l, !1);
        lu(l, n), u && u(), n.currentNode = null;
      } else
        n.onError(
          Bt(30, e.loc)
        );
      break;
    }
  }
}
function yb(e, t) {
  const n = e.tagType === 3;
  return {
    type: 10,
    loc: e.loc,
    condition: t.name === "else" ? void 0 : t.exp,
    children: n && !zn(e, "for") ? e.children : [e],
    userKey: nl(e, "key"),
    isTemplateIf: n
  };
}
function bb(e, t, n) {
  return e.condition ? nf(
    e.condition,
    Eb(e, t, n),
    // make sure to pass in asBlock: true so that the comment node call
    // closes the current block.
    Nn(n.helper(yl), [
      Oe.NODE_ENV !== "production" ? '"v-if"' : '""',
      "true"
    ])
  ) : Eb(e, t, n);
}
function Eb(e, t, n) {
  const { helper: s } = n, o = hn(
    "key",
    rt(
      `${t}`,
      !1,
      In,
      2
    )
  ), { children: i } = e, r = i[0];
  if (i.length !== 1 || r.type !== 1)
    if (i.length === 1 && r.type === 11) {
      const l = r.codegenNode;
      return Uc(l, o, n), l;
    } else {
      let l = 64;
      return Oe.NODE_ENV !== "production" && !e.isTemplateIf && i.filter((u) => u.type !== 3).length === 1 && (l |= 2048), tl(
        n,
        s(Za),
        ks([o]),
        i,
        l,
        void 0,
        void 0,
        !0,
        !1,
        !1,
        e.loc
      );
    }
  else {
    const l = r.codegenNode, u = yx(l);
    return u.type === 13 && xp(u, n), Uc(u, o, n), l;
  }
}
function DW(e, t) {
  if (!e || e.type !== t.type)
    return !1;
  if (e.type === 6) {
    if (e.value.content !== t.value.content)
      return !1;
  } else {
    const n = e.exp, s = t.exp;
    if (n.type !== s.type || n.type !== 4 || n.isStatic !== s.isStatic || n.content !== s.content)
      return !1;
  }
  return !0;
}
function RW(e) {
  for (; ; )
    if (e.type === 19)
      if (e.alternate.type === 19)
        e = e.alternate;
      else
        return e;
    else e.type === 20 && (e = e.value);
}
const Vx = (e, t, n) => {
  const { modifiers: s, loc: o } = e, i = e.arg;
  let { exp: r } = e;
  if (r && r.type === 4 && !r.content.trim() && (r = void 0), !r) {
    if (i.type !== 4 || !i.isStatic)
      return n.onError(
        Bt(
          52,
          i.loc
        )
      ), {
        props: [
          hn(i, rt("", !0, o))
        ]
      };
    Fx(e), r = e.exp;
  }
  return i.type !== 4 ? (i.children.unshift("("), i.children.push(') || ""')) : i.isStatic || (i.content = `${i.content} || ""`), s.some((a) => a.content === "camel") && (i.type === 4 ? i.isStatic ? i.content = Gt(i.content) : i.content = `${n.helperString(ef)}(${i.content})` : (i.children.unshift(`${n.helperString(ef)}(`), i.children.push(")"))), n.inSSR || (s.some((a) => a.content === "prop") && wb(i, "."), s.some((a) => a.content === "attr") && wb(i, "^")), {
    props: [hn(i, r)]
  };
}, Fx = (e, t) => {
  const n = e.arg, s = Gt(n.content);
  e.exp = rt(s, !1, n.loc);
}, wb = (e, t) => {
  e.type === 4 ? e.isStatic ? e.content = t + e.content : e.content = `\`${t}\${${e.content}}\`` : (e.children.unshift(`'${t}' + (`), e.children.push(")"));
}, IW = Pg(
  "for",
  (e, t, n) => {
    const { helper: s, removeHelper: o } = n;
    return Ux(e, t, n, (i) => {
      const r = Nn(s(_p), [
        i.source
      ]), a = sl(e), l = zn(e, "memo"), u = nl(e, "key", !1, !0);
      u && u.type === 7 && !u.exp && Fx(u);
      let f = u && (u.type === 6 ? u.value ? rt(u.value.content, !0) : void 0 : u.exp);
      const p = u && f ? hn("key", f) : null, h = i.source.type === 4 && i.source.constType > 0, m = h ? 64 : u ? 128 : 256;
      return i.codegenNode = tl(
        n,
        s(Za),
        void 0,
        r,
        m,
        void 0,
        void 0,
        !0,
        !h,
        !1,
        e.loc
      ), () => {
        let v;
        const { children: _ } = i;
        Oe.NODE_ENV !== "production" && a && e.children.some((y) => {
          if (y.type === 1) {
            const x = nl(y, "key");
            if (x)
              return n.onError(
                Bt(
                  33,
                  x.loc
                )
              ), !0;
          }
        });
        const b = _.length !== 1 || _[0].type !== 1, w = Fc(e) ? e : a && e.children.length === 1 && Fc(e.children[0]) ? e.children[0] : null;
        if (w ? (v = w.codegenNode, a && p && Uc(v, p, n)) : b ? v = tl(
          n,
          s(Za),
          p ? ks([p]) : void 0,
          e.children,
          64,
          void 0,
          void 0,
          !0,
          void 0,
          !1
        ) : (v = _[0].codegenNode, a && p && Uc(v, p, n), v.isBlock !== !h && (v.isBlock ? (o(si), o(
          Zi(n.inSSR, v.isComponent)
        )) : o(
          Qi(n.inSSR, v.isComponent)
        )), v.isBlock = !h, v.isBlock ? (s(si), s(Zi(n.inSSR, v.isComponent))) : s(Qi(n.inSSR, v.isComponent))), l) {
          const y = Ji(
            of(i.parseResult, [
              rt("_cached")
            ])
          );
          y.body = ix([
            Bs(["const _memo = (", l.exp, ")"]),
            Bs([
              "if (_cached",
              ...f ? [" && _cached.key === ", f] : [],
              ` && ${n.helperString(
                $g
              )}(_cached, _memo)) return _cached`
            ]),
            Bs(["const _item = ", v]),
            rt("_item.memo = _memo"),
            rt("return _item")
          ]), r.arguments.push(
            y,
            rt("_cache"),
            rt(String(n.cached.length))
          ), n.cached.push(null);
        } else
          r.arguments.push(
            Ji(
              of(i.parseResult),
              v,
              !0
            )
          );
      };
    });
  }
);
function Ux(e, t, n, s) {
  if (!t.exp) {
    n.onError(
      Bt(31, t.loc)
    );
    return;
  }
  const o = t.forParseResult;
  if (!o) {
    n.onError(
      Bt(32, t.loc)
    );
    return;
  }
  Vg(o, n);
  const { addIdentifiers: i, removeIdentifiers: r, scopes: a } = n, { source: l, value: u, key: d, index: f } = o, p = {
    type: 11,
    loc: t.loc,
    source: l,
    valueAlias: u,
    keyAlias: d,
    objectIndexAlias: f,
    parseResult: o,
    children: sl(e) ? e.children : [e]
  };
  n.replaceNode(p), a.vFor++;
  const h = s && s(p);
  return () => {
    a.vFor--, h && h();
  };
}
function Vg(e, t) {
  e.finalized || (Oe.NODE_ENV !== "production" && (Oi(e.source, t), e.key && Oi(
    e.key,
    t,
    !0
  ), e.index && Oi(
    e.index,
    t,
    !0
  ), e.value && Oi(
    e.value,
    t,
    !0
  )), e.finalized = !0);
}
function of({ value: e, key: t, index: n }, s = []) {
  return AW([e, t, n, ...s]);
}
function AW(e) {
  let t = e.length;
  for (; t-- && !e[t]; )
    ;
  return e.slice(0, t + 1).map((n, s) => n || rt("_".repeat(s + 1), !1));
}
const Sb = rt("undefined", !1), jx = (e, t) => {
  if (e.type === 1 && (e.tagType === 1 || e.tagType === 3)) {
    const n = zn(e, "slot");
    if (n)
      return n.exp, t.scopes.vSlot++, () => {
        t.scopes.vSlot--;
      };
  }
}, MW = (e, t) => {
  let n;
  if (sl(e) && e.props.some(Ig) && (n = zn(e, "for"))) {
    const s = n.forParseResult;
    if (s) {
      Vg(s, t);
      const { value: o, key: i, index: r } = s, { addIdentifiers: a, removeIdentifiers: l } = t;
      return o && a(o), i && a(i), r && a(r), () => {
        o && l(o), i && l(i), r && l(r);
      };
    }
  }
}, PW = (e, t, n, s) => Ji(
  e,
  n,
  !1,
  !0,
  n.length ? n[0].loc : s
);
function Bx(e, t, n = PW) {
  t.helper(wp);
  const { children: s, loc: o } = e, i = [], r = [];
  let a = t.scopes.vSlot > 0 || t.scopes.vFor > 0;
  const l = zn(e, "slot", !0);
  if (l) {
    const { arg: _, exp: b } = l;
    _ && !cs(_) && (a = !0), i.push(
      hn(
        _ || rt("default", !0),
        n(b, void 0, s, o)
      )
    );
  }
  let u = !1, d = !1;
  const f = [], p = /* @__PURE__ */ new Set();
  let h = 0;
  for (let _ = 0; _ < s.length; _++) {
    const b = s[_];
    let w;
    if (!sl(b) || !(w = zn(b, "slot", !0))) {
      b.type !== 3 && f.push(b);
      continue;
    }
    if (l) {
      t.onError(
        Bt(37, w.loc)
      );
      break;
    }
    u = !0;
    const { children: y, loc: x } = b, {
      arg: N = rt("default", !0),
      exp: S,
      loc: O
    } = w;
    let $;
    cs(N) ? $ = N ? N.content : "default" : a = !0;
    const T = zn(b, "for"), R = n(S, T, y, x);
    let P, M;
    if (P = zn(b, "if"))
      a = !0, r.push(
        nf(
          P.exp,
          Pu(N, R, h++),
          Sb
        )
      );
    else if (M = zn(
      b,
      /^else(-if)?$/,
      !0
      /* allowEmpty */
    )) {
      let U = _, H;
      for (; U-- && (H = s[U], H.type === 3); )
        ;
      if (H && sl(H) && zn(H, /^(else-)?if$/)) {
        let j = r[r.length - 1];
        for (; j.alternate.type === 19; )
          j = j.alternate;
        j.alternate = M.exp ? nf(
          M.exp,
          Pu(
            N,
            R,
            h++
          ),
          Sb
        ) : Pu(N, R, h++);
      } else
        t.onError(
          Bt(30, M.loc)
        );
    } else if (T) {
      a = !0;
      const U = T.forParseResult;
      U ? (Vg(U, t), r.push(
        Nn(t.helper(_p), [
          U.source,
          Ji(
            of(U),
            Pu(N, R),
            !0
          )
        ])
      )) : t.onError(
        Bt(
          32,
          T.loc
        )
      );
    } else {
      if ($) {
        if (p.has($)) {
          t.onError(
            Bt(
              38,
              O
            )
          );
          continue;
        }
        p.add($), $ === "default" && (d = !0);
      }
      i.push(hn(N, R));
    }
  }
  if (!l) {
    const _ = (b, w) => {
      const y = n(b, void 0, w, o);
      return t.compatConfig && (y.isNonScopedSlot = !0), hn("default", y);
    };
    u ? f.length && // #3766
    // with whitespace: 'preserve', whitespaces between slots will end up in
    // implicitDefaultChildren. Ignore if all implicit children are whitespaces.
    f.some((b) => Hx(b)) && (d ? t.onError(
      Bt(
        39,
        f[0].loc
      )
    ) : i.push(
      _(void 0, f)
    )) : i.push(_(void 0, s));
  }
  const m = a ? 2 : bd(e.children) ? 3 : 1;
  let v = ks(
    i.concat(
      hn(
        "_",
        // 2 = compiled but dynamic = can skip normalization, but must run diff
        // 1 = compiled and static = can skip normalization AND diff as optimized
        rt(
          m + (Oe.NODE_ENV !== "production" ? ` /* ${p1[m]} */` : ""),
          !1
        )
      )
    ),
    o
  );
  return r.length && (v = Nn(t.helper(Tg), [
    v,
    Qr(r)
  ])), {
    slots: v,
    hasDynamicSlots: a
  };
}
function Pu(e, t, n) {
  const s = [
    hn("name", e),
    hn("fn", t)
  ];
  return n != null && s.push(
    hn("key", rt(String(n), !0))
  ), ks(s);
}
function bd(e) {
  for (let t = 0; t < e.length; t++) {
    const n = e[t];
    switch (n.type) {
      case 1:
        if (n.tagType === 2 || bd(n.children))
          return !0;
        break;
      case 9:
        if (bd(n.branches)) return !0;
        break;
      case 10:
      case 11:
        if (bd(n.children)) return !0;
        break;
    }
  }
  return !1;
}
function Hx(e) {
  return e.type !== 2 && e.type !== 12 ? !0 : e.type === 2 ? !!e.content.trim() : Hx(e.content);
}
const Yx = /* @__PURE__ */ new WeakMap(), Wx = (e, t) => function() {
  if (e = t.currentNode, !(e.type === 1 && (e.tagType === 0 || e.tagType === 1)))
    return;
  const { tag: s, props: o } = e, i = e.tagType === 1;
  let r = i ? Gx(e, t) : `"${s}"`;
  const a = mt(r) && r.callee === hp;
  let l, u, d = 0, f, p, h, m = (
    // dynamic component may resolve to plain elements
    a || r === ja || r === cp || !i && // <svg> and <foreignObject> must be forced into blocks so that block
    // updates inside get proper isSVG flag at runtime. (#639, #643)
    // This is technically web-specific, but splitting the logic out of core
    // leads to too much unnecessary complexity.
    (s === "svg" || s === "foreignObject" || s === "math")
  );
  if (o.length > 0) {
    const v = Fg(
      e,
      t,
      void 0,
      i,
      a
    );
    l = v.props, d = v.patchFlag, p = v.dynamicPropNames;
    const _ = v.directives;
    h = _ && _.length ? Qr(
      _.map((b) => zx(b, t))
    ) : void 0, v.shouldUseBlock && (m = !0);
  }
  if (e.children.length > 0)
    if (r === Mc && (m = !0, d |= 1024, Oe.NODE_ENV !== "production" && e.children.length > 1 && t.onError(
      Bt(46, {
        start: e.children[0].loc.start,
        end: e.children[e.children.length - 1].loc.end,
        source: ""
      })
    )), i && // Teleport is not a real component and has dedicated runtime handling
    r !== ja && // explained above.
    r !== Mc) {
      const { slots: _, hasDynamicSlots: b } = Bx(e, t);
      u = _, b && (d |= 1024);
    } else if (e.children.length === 1 && r !== ja) {
      const _ = e.children[0], b = _.type, w = b === 5 || b === 8;
      w && Es(_, t) === 0 && (d |= 1), w || b === 2 ? u = _ : u = e.children;
    } else
      u = e.children;
  p && p.length && (f = VW(p)), e.codegenNode = tl(
    t,
    r,
    l,
    u,
    d === 0 ? void 0 : d,
    f,
    h,
    !!m,
    !1,
    i,
    e.loc
  );
};
function Gx(e, t, n = !1) {
  let { tag: s } = e;
  const o = Wm(s), i = nl(
    e,
    "is",
    !1,
    !0
    /* allow empty */
  );
  if (i)
    if (o || Zr(
      "COMPILER_IS_ON_ELEMENT",
      t
    )) {
      let a;
      if (i.type === 6 ? a = i.value && rt(i.value.content, !0) : (a = i.exp, a || (a = rt("is", !1, i.arg.loc))), a)
        return Nn(t.helper(hp), [
          a
        ]);
    } else i.type === 6 && i.value.content.startsWith("vue:") && (s = i.value.content.slice(4));
  const r = Dg(s) || t.isBuiltInComponent(s);
  return r ? (n || t.helper(r), r) : (t.helper(pp), t.components.add(s), ol(s, "component"));
}
function Fg(e, t, n = e.props, s, o, i = !1) {
  const { tag: r, loc: a, children: l } = e;
  let u = [];
  const d = [], f = [], p = l.length > 0;
  let h = !1, m = 0, v = !1, _ = !1, b = !1, w = !1, y = !1, x = !1;
  const N = [], S = (R) => {
    u.length && (d.push(
      ks(xb(u), a)
    ), u = []), R && d.push(R);
  }, O = () => {
    t.scopes.vFor > 0 && u.push(
      hn(
        rt("ref_for", !0),
        rt("true")
      )
    );
  }, $ = ({ key: R, value: P }) => {
    if (cs(R)) {
      const M = R.content, U = Do(M);
      if (U && (!s || o) && // omit the flag for click handlers because hydration gives click
      // dedicated fast path.
      M.toLowerCase() !== "onclick" && // omit v-model handlers
      M !== "onUpdate:modelValue" && // omit onVnodeXXX hooks
      !fr(M) && (w = !0), U && fr(M) && (x = !0), U && P.type === 14 && (P = P.arguments[0]), P.type === 20 || (P.type === 4 || P.type === 8) && Es(P, t) > 0)
        return;
      M === "ref" ? v = !0 : M === "class" ? _ = !0 : M === "style" ? b = !0 : M !== "key" && !N.includes(M) && N.push(M), s && (M === "class" || M === "style") && !N.includes(M) && N.push(M);
    } else
      y = !0;
  };
  for (let R = 0; R < n.length; R++) {
    const P = n[R];
    if (P.type === 6) {
      const { loc: M, name: U, nameLoc: H, value: j } = P;
      let V = !0;
      if (U === "ref" && (v = !0, O()), U === "is" && (Wm(r) || j && j.content.startsWith("vue:") || Zr(
        "COMPILER_IS_ON_ELEMENT",
        t
      )))
        continue;
      u.push(
        hn(
          rt(U, !0, H),
          rt(
            j ? j.content : "",
            V,
            j ? j.loc : M
          )
        )
      );
    } else {
      const { name: M, arg: U, exp: H, loc: j, modifiers: V } = P, K = M === "bind", q = M === "on";
      if (M === "slot") {
        s || t.onError(
          Bt(40, j)
        );
        continue;
      }
      if (M === "once" || M === "memo" || M === "is" || K && dr(U, "is") && (Wm(r) || Zr(
        "COMPILER_IS_ON_ELEMENT",
        t
      )) || q && i)
        continue;
      if (
        // #938: elements with dynamic keys should be forced into blocks
        (K && dr(U, "key") || // inline before-update hooks need to force block so that it is invoked
        // before children
        q && p && dr(U, "vue:before-update")) && (h = !0), K && dr(U, "ref") && O(), !U && (K || q)
      ) {
        if (y = !0, H)
          if (K) {
            if (O(), S(), Oe.NODE_ENV !== "production" && d.some((ze) => ze.type === 15 ? ze.properties.some(({ key: We }) => We.type !== 4 || !We.isStatic ? !0 : We.content !== "class" && We.content !== "style" && !Do(We.content)) : !0) && ea(
              "COMPILER_V_BIND_OBJECT_ORDER",
              t,
              j
            ), Zr(
              "COMPILER_V_BIND_OBJECT_ORDER",
              t
            )) {
              d.unshift(H);
              continue;
            }
            d.push(H);
          } else
            S({
              type: 14,
              loc: j,
              callee: t.helper(Ep),
              arguments: s ? [H] : [H, "true"]
            });
        else
          t.onError(
            Bt(
              K ? 34 : 35,
              j
            )
          );
        continue;
      }
      K && V.some((ke) => ke.content === "prop") && (m |= 32);
      const re = t.directiveTransforms[M];
      if (re) {
        const { props: ke, needRuntime: ze } = re(P, e, t);
        !i && ke.forEach($), q && U && !cs(U) ? S(ks(ke, a)) : u.push(...ke), ze && (f.push(P), us(ze) && Yx.set(P, ze));
      } else sv(M) || (f.push(P), p && (h = !0));
    }
  }
  let T;
  if (d.length ? (S(), d.length > 1 ? T = Nn(
    t.helper(Pc),
    d,
    a
  ) : T = d[0]) : u.length && (T = ks(
    xb(u),
    a
  )), y ? m |= 16 : (_ && !s && (m |= 2), b && !s && (m |= 4), N.length && (m |= 8), w && (m |= 32)), !h && (m === 0 || m === 32) && (v || x || f.length > 0) && (m |= 512), !t.inSSR && T)
    switch (T.type) {
      case 15:
        let R = -1, P = -1, M = !1;
        for (let j = 0; j < T.properties.length; j++) {
          const V = T.properties[j].key;
          cs(V) ? V.content === "class" ? R = j : V.content === "style" && (P = j) : V.isHandlerKey || (M = !0);
        }
        const U = T.properties[R], H = T.properties[P];
        M ? T = Nn(
          t.helper(el),
          [T]
        ) : (U && !cs(U.value) && (U.value = Nn(
          t.helper(yp),
          [U.value]
        )), H && // the static style is compiled into an object,
        // so use `hasStyleBinding` to ensure that it is a dynamic style binding
        (b || H.value.type === 4 && H.value.content.trim()[0] === "[" || // v-bind:style and style both exist,
        // v-bind:style with static literal object
        H.value.type === 17) && (H.value = Nn(
          t.helper(bp),
          [H.value]
        )));
        break;
      case 14:
        break;
      default:
        T = Nn(
          t.helper(el),
          [
            Nn(t.helper(bl), [
              T
            ])
          ]
        );
        break;
    }
  return {
    props: T,
    directives: f,
    patchFlag: m,
    dynamicPropNames: N,
    shouldUseBlock: h
  };
}
function xb(e) {
  const t = /* @__PURE__ */ new Map(), n = [];
  for (let s = 0; s < e.length; s++) {
    const o = e[s];
    if (o.key.type === 8 || !o.key.isStatic) {
      n.push(o);
      continue;
    }
    const i = o.key.content, r = t.get(i);
    r ? (i === "style" || i === "class" || Do(i)) && LW(r, o) : (t.set(i, o), n.push(o));
  }
  return n;
}
function LW(e, t) {
  e.value.type === 17 ? e.value.elements.push(t.value) : e.value = Qr(
    [e.value, t.value],
    e.loc
  );
}
function zx(e, t) {
  const n = [], s = Yx.get(e);
  s ? n.push(t.helperString(s)) : (t.helper(mp), t.directives.add(e.name), n.push(ol(e.name, "directive")));
  const { loc: o } = e;
  if (e.exp && n.push(e.exp), e.arg && (e.exp || n.push("void 0"), n.push(e.arg)), Object.keys(e.modifiers).length) {
    e.arg || (e.exp || n.push("void 0"), n.push("void 0"));
    const i = rt("true", !1, o);
    n.push(
      ks(
        e.modifiers.map(
          (r) => hn(r, i)
        ),
        o
      )
    );
  }
  return Qr(n, e.loc);
}
function VW(e) {
  let t = "[";
  for (let n = 0, s = e.length; n < s; n++)
    t += JSON.stringify(e[n]), n < s - 1 && (t += ", ");
  return t + "]";
}
function Wm(e) {
  return e === "component" || e === "Component";
}
const FW = (e, t) => {
  if (Fc(e)) {
    const { children: n, loc: s } = e, { slotName: o, slotProps: i } = Kx(e, t), r = [
      t.prefixIdentifiers ? "_ctx.$slots" : "$slots",
      o,
      "{}",
      "undefined",
      "true"
    ];
    let a = 2;
    i && (r[2] = i, a = 3), n.length && (r[3] = Ji([], n, !1, !1, s), a = 4), t.scopeId && !t.slotted && (a = 5), r.splice(a), e.codegenNode = Nn(
      t.helper(Og),
      r,
      s
    );
  }
};
function Kx(e, t) {
  let n = '"default"', s;
  const o = [];
  for (let i = 0; i < e.props.length; i++) {
    const r = e.props[i];
    if (r.type === 6)
      r.value && (r.name === "name" ? n = JSON.stringify(r.value.content) : (r.name = Gt(r.name), o.push(r)));
    else if (r.name === "bind" && dr(r.arg, "name")) {
      if (r.exp)
        n = r.exp;
      else if (r.arg && r.arg.type === 4) {
        const a = Gt(r.arg.content);
        n = r.exp = rt(a, !1, r.arg.loc);
      }
    } else
      r.name === "bind" && r.arg && cs(r.arg) && (r.arg.content = Gt(r.arg.content)), o.push(r);
  }
  if (o.length > 0) {
    const { props: i, directives: r } = Fg(
      e,
      t,
      o,
      !1,
      !1
    );
    s = i, r.length && t.onError(
      Bt(
        36,
        r[0].loc
      )
    );
  }
  return {
    slotName: n,
    slotProps: s
  };
}
const Ug = (e, t, n, s) => {
  const { loc: o, modifiers: i, arg: r } = e;
  !e.exp && !i.length && n.onError(Bt(35, o));
  let a;
  if (r.type === 4)
    if (r.isStatic) {
      let f = r.content;
      Oe.NODE_ENV !== "production" && f.startsWith("vnode") && n.onError(Bt(51, r.loc)), f.startsWith("vue:") && (f = `vnode-${f.slice(4)}`);
      const p = t.tagType !== 0 || f.startsWith("vnode") || !/[A-Z]/.test(f) ? (
        // for non-element and vnode lifecycle event listeners, auto convert
        // it to camelCase. See issue #2249
        to(Gt(f))
      ) : (
        // preserve case for plain element listeners that have uppercase
        // letters, as these may be custom elements' custom events
        `on:${f}`
      );
      a = rt(p, !0, r.loc);
    } else
      a = Bs([
        `${n.helperString(tf)}(`,
        r,
        ")"
      ]);
  else
    a = r, a.children.unshift(`${n.helperString(tf)}(`), a.children.push(")");
  let l = e.exp;
  l && !l.content.trim() && (l = void 0);
  let u = n.cacheHandlers && !l && !n.inVOnce;
  if (l) {
    const f = Rg(l), p = !(f || mx(l)), h = l.content.includes(";");
    Oe.NODE_ENV !== "production" && Oi(
      l,
      n,
      !1,
      h
    ), (p || u && f) && (l = Bs([
      `${p ? "$event" : "(...args)"} => ${h ? "{" : "("}`,
      l,
      h ? "}" : ")"
    ]));
  }
  let d = {
    props: [
      hn(
        a,
        l || rt("() => {}", !1, o)
      )
    ]
  };
  return s && (d = s(d)), u && (d.props[0].value = n.cache(d.props[0].value)), d.props.forEach((f) => f.key.isHandlerKey = !0), d;
}, UW = (e, t) => {
  if (e.type === 0 || e.type === 1 || e.type === 11 || e.type === 10)
    return () => {
      const n = e.children;
      let s, o = !1;
      for (let i = 0; i < n.length; i++) {
        const r = n[i];
        if (md(r)) {
          o = !0;
          for (let a = i + 1; a < n.length; a++) {
            const l = n[a];
            if (md(l))
              s || (s = n[i] = Bs(
                [r],
                r.loc
              )), s.children.push(" + ", l), n.splice(a, 1), a--;
            else {
              s = void 0;
              break;
            }
          }
        }
      }
      if (!(!o || // if this is a plain element with a single text child, leave it
      // as-is since the runtime has dedicated fast path for this by directly
      // setting textContent of the element.
      // for component root it's always normalized anyway.
      n.length === 1 && (e.type === 0 || e.type === 1 && e.tagType === 0 && // #3756
      // custom directives can potentially add DOM elements arbitrarily,
      // we need to avoid setting textContent of the element at runtime
      // to avoid accidentally overwriting the DOM elements added
      // by the user through custom directives.
      !e.props.find(
        (i) => i.type === 7 && !t.directiveTransforms[i.name]
      ) && e.tag !== "template")))
        for (let i = 0; i < n.length; i++) {
          const r = n[i];
          if (md(r) || r.type === 8) {
            const a = [];
            (r.type !== 2 || r.content !== " ") && a.push(r), !t.ssr && Es(r, t) === 0 && a.push(
              1 + (Oe.NODE_ENV !== "production" ? ` /* ${ql[1]} */` : "")
            ), n[i] = {
              type: 12,
              content: r,
              loc: r.loc,
              codegenNode: Nn(
                t.helper(fp),
                a
              )
            };
          }
        }
    };
}, Nb = /* @__PURE__ */ new WeakSet(), jW = (e, t) => {
  if (e.type === 1 && zn(e, "once", !0))
    return Nb.has(e) || t.inVOnce || t.inSSR ? void 0 : (Nb.add(e), t.inVOnce = !0, t.helper(Lc), () => {
      t.inVOnce = !1;
      const n = t.currentNode;
      n.codegenNode && (n.codegenNode = t.cache(
        n.codegenNode,
        !0,
        !0
      ));
    });
}, jg = (e, t, n) => {
  const { exp: s, arg: o } = e;
  if (!s)
    return n.onError(
      Bt(41, e.loc)
    ), Lu();
  const i = s.loc.source.trim(), r = s.type === 4 ? s.content : i, a = n.bindingMetadata[i];
  if (a === "props" || a === "props-aliased")
    return n.onError(Bt(44, s.loc)), Lu();
  if (!r.trim() || !Rg(s))
    return n.onError(
      Bt(42, s.loc)
    ), Lu();
  const l = o || rt("modelValue", !0), u = o ? cs(o) ? `onUpdate:${Gt(o.content)}` : Bs(['"onUpdate:" + ', o]) : "onUpdate:modelValue";
  let d;
  const f = n.isTS ? "($event: any)" : "$event";
  d = Bs([
    `${f} => ((`,
    s,
    ") = $event)"
  ]);
  const p = [
    // modelValue: foo
    hn(l, e.exp),
    // "onUpdate:modelValue": $event => (foo = $event)
    hn(u, d)
  ];
  if (e.modifiers.length && t.tagType === 1) {
    const h = e.modifiers.map((v) => v.content).map((v) => (au(v) ? v : JSON.stringify(v)) + ": true").join(", "), m = o ? cs(o) ? `${o.content}Modifiers` : Bs([o, ' + "Modifiers"']) : "modelModifiers";
    p.push(
      hn(
        m,
        rt(
          `{ ${h} }`,
          !1,
          e.loc,
          2
        )
      )
    );
  }
  return Lu(p);
};
function Lu(e = []) {
  return { props: e };
}
const BW = /[\w).+\-_$\]]/, HW = (e, t) => {
  Zr("COMPILER_FILTERS", t) && (e.type === 5 ? rf(e.content, t) : e.type === 1 && e.props.forEach((n) => {
    n.type === 7 && n.name !== "for" && n.exp && rf(n.exp, t);
  }));
};
function rf(e, t) {
  if (e.type === 4)
    Cb(e, t);
  else
    for (let n = 0; n < e.children.length; n++) {
      const s = e.children[n];
      typeof s == "object" && (s.type === 4 ? Cb(s, t) : s.type === 8 ? rf(e, t) : s.type === 5 && rf(s.content, t));
    }
}
function Cb(e, t) {
  const n = e.content;
  let s = !1, o = !1, i = !1, r = !1, a = 0, l = 0, u = 0, d = 0, f, p, h, m, v = [];
  for (h = 0; h < n.length; h++)
    if (p = f, f = n.charCodeAt(h), s)
      f === 39 && p !== 92 && (s = !1);
    else if (o)
      f === 34 && p !== 92 && (o = !1);
    else if (i)
      f === 96 && p !== 92 && (i = !1);
    else if (r)
      f === 47 && p !== 92 && (r = !1);
    else if (f === 124 && // pipe
    n.charCodeAt(h + 1) !== 124 && n.charCodeAt(h - 1) !== 124 && !a && !l && !u)
      m === void 0 ? (d = h + 1, m = n.slice(0, h).trim()) : _();
    else {
      switch (f) {
        case 34:
          o = !0;
          break;
        // "
        case 39:
          s = !0;
          break;
        // '
        case 96:
          i = !0;
          break;
        // `
        case 40:
          u++;
          break;
        // (
        case 41:
          u--;
          break;
        // )
        case 91:
          l++;
          break;
        // [
        case 93:
          l--;
          break;
        // ]
        case 123:
          a++;
          break;
        // {
        case 125:
          a--;
          break;
      }
      if (f === 47) {
        let b = h - 1, w;
        for (; b >= 0 && (w = n.charAt(b), w === " "); b--)
          ;
        (!w || !BW.test(w)) && (r = !0);
      }
    }
  m === void 0 ? m = n.slice(0, h).trim() : d !== 0 && _();
  function _() {
    v.push(n.slice(d, h).trim()), d = h + 1;
  }
  if (v.length) {
    for (Oe.NODE_ENV !== "production" && Vc(
      "COMPILER_FILTERS",
      t,
      e.loc
    ), h = 0; h < v.length; h++)
      m = YW(m, v[h], t);
    e.content = m, e.ast = void 0;
  }
}
function YW(e, t, n) {
  n.helper(vp);
  const s = t.indexOf("(");
  if (s < 0)
    return n.filters.add(t), `${ol(t, "filter")}(${e})`;
  {
    const o = t.slice(0, s), i = t.slice(s + 1);
    return n.filters.add(o), `${ol(o, "filter")}(${e}${i !== ")" ? "," + i : i}`;
  }
}
const Ob = /* @__PURE__ */ new WeakSet(), WW = (e, t) => {
  if (e.type === 1) {
    const n = zn(e, "memo");
    return !n || Ob.has(e) ? void 0 : (Ob.add(e), () => {
      const s = e.codegenNode || t.currentNode.codegenNode;
      s && s.type === 13 && (e.tagType !== 1 && xp(s, t), e.codegenNode = Nn(t.helper(Sp), [
        n.exp,
        Ji(void 0, s),
        "_cache",
        String(t.cached.length)
      ]), t.cached.push(null));
    });
  }
};
function Xx(e) {
  return [
    [
      jW,
      kW,
      WW,
      IW,
      HW,
      ...Oe.NODE_ENV !== "production" ? [Mx] : [],
      FW,
      Wx,
      jx,
      UW
    ],
    {
      on: Ug,
      bind: Vx,
      model: jg
    }
  ];
}
function qx(e, t = {}) {
  const n = t.onError || kg, s = t.mode === "module";
  t.prefixIdentifiers === !0 ? n(Bt(47)) : s && n(Bt(48));
  const o = !1;
  t.cacheHandlers && n(Bt(49)), t.scopeId && !s && n(Bt(50));
  const i = it({}, t, {
    prefixIdentifiers: o
  }), r = Ge(e) ? Mg(e, i) : e, [a, l] = Xx();
  return kx(
    r,
    it({}, i, {
      nodeTransforms: [
        ...a,
        ...t.nodeTransforms || []
        // user transforms
      ],
      directiveTransforms: it(
        {},
        l,
        t.directiveTransforms || {}
        // user transforms
      )
    })
  ), Rx(r, i);
}
const GW = {
  DATA: "data",
  PROPS: "props",
  PROPS_ALIASED: "props-aliased",
  SETUP_LET: "setup-let",
  SETUP_CONST: "setup-const",
  SETUP_REACTIVE_CONST: "setup-reactive-const",
  SETUP_MAYBE_REF: "setup-maybe-ref",
  SETUP_REF: "setup-ref",
  OPTIONS: "options",
  LITERAL_CONST: "literal-const"
}, Jx = () => ({ props: [] });
var ts = {};
const Bg = Symbol(ts.NODE_ENV !== "production" ? "vModelRadio" : ""), Hg = Symbol(
  ts.NODE_ENV !== "production" ? "vModelCheckbox" : ""
), Yg = Symbol(ts.NODE_ENV !== "production" ? "vModelText" : ""), Wg = Symbol(
  ts.NODE_ENV !== "production" ? "vModelSelect" : ""
), af = Symbol(
  ts.NODE_ENV !== "production" ? "vModelDynamic" : ""
), Gg = Symbol(
  ts.NODE_ENV !== "production" ? "vOnModifiersGuard" : ""
), zg = Symbol(
  ts.NODE_ENV !== "production" ? "vOnKeysGuard" : ""
), Kg = Symbol(ts.NODE_ENV !== "production" ? "vShow" : ""), Cp = Symbol(ts.NODE_ENV !== "production" ? "Transition" : ""), Xg = Symbol(
  ts.NODE_ENV !== "production" ? "TransitionGroup" : ""
);
sx({
  [Bg]: "vModelRadio",
  [Hg]: "vModelCheckbox",
  [Yg]: "vModelText",
  [Wg]: "vModelSelect",
  [af]: "vModelDynamic",
  [Gg]: "withModifiers",
  [zg]: "withKeys",
  [Kg]: "vShow",
  [Cp]: "Transition",
  [Xg]: "TransitionGroup"
});
let ba;
function zW(e, t = !1) {
  return ba || (ba = document.createElement("div")), t ? (ba.innerHTML = `<div foo="${e.replace(/"/g, "&quot;")}">`, ba.children[0].getAttribute("foo")) : (ba.innerHTML = e, ba.textContent);
}
const qg = {
  parseMode: "html",
  isVoidTag: v1,
  isNativeTag: (e) => iv(e) || av(e) || lv(e),
  isPreTag: (e) => e === "pre",
  isIgnoreNewlineTag: (e) => e === "pre" || e === "textarea",
  decodeEntities: zW,
  isBuiltInComponent: (e) => {
    if (e === "Transition" || e === "transition")
      return Cp;
    if (e === "TransitionGroup" || e === "transition-group")
      return Xg;
  },
  // https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
  getNamespace(e, t, n) {
    let s = t ? t.ns : n;
    if (t && s === 2)
      if (t.tag === "annotation-xml") {
        if (e === "svg")
          return 1;
        t.props.some(
          (o) => o.type === 6 && o.name === "encoding" && o.value != null && (o.value.content === "text/html" || o.value.content === "application/xhtml+xml")
        ) && (s = 0);
      } else /^m(?:[ions]|text)$/.test(t.tag) && e !== "mglyph" && e !== "malignmark" && (s = 0);
    else t && s === 1 && (t.tag === "foreignObject" || t.tag === "desc" || t.tag === "title") && (s = 0);
    if (s === 0) {
      if (e === "svg")
        return 1;
      if (e === "math")
        return 2;
    }
    return s;
  }
}, Qx = (e) => {
  e.type === 1 && e.props.forEach((t, n) => {
    t.type === 6 && t.name === "style" && t.value && (e.props[n] = {
      type: 7,
      name: "bind",
      arg: rt("style", !0, t.loc),
      exp: KW(t.value.content, t.loc),
      modifiers: [],
      loc: t.loc
    });
  });
}, KW = (e, t) => {
  const n = rv(e);
  return rt(
    JSON.stringify(n),
    !1,
    t,
    3
  );
};
function Fs(e, t) {
  return Bt(
    e,
    t,
    ts.NODE_ENV !== "production" ? Zx : void 0
  );
}
const XW = {
  X_V_HTML_NO_EXPRESSION: 53,
  53: "X_V_HTML_NO_EXPRESSION",
  X_V_HTML_WITH_CHILDREN: 54,
  54: "X_V_HTML_WITH_CHILDREN",
  X_V_TEXT_NO_EXPRESSION: 55,
  55: "X_V_TEXT_NO_EXPRESSION",
  X_V_TEXT_WITH_CHILDREN: 56,
  56: "X_V_TEXT_WITH_CHILDREN",
  X_V_MODEL_ON_INVALID_ELEMENT: 57,
  57: "X_V_MODEL_ON_INVALID_ELEMENT",
  X_V_MODEL_ARG_ON_ELEMENT: 58,
  58: "X_V_MODEL_ARG_ON_ELEMENT",
  X_V_MODEL_ON_FILE_INPUT_ELEMENT: 59,
  59: "X_V_MODEL_ON_FILE_INPUT_ELEMENT",
  X_V_MODEL_UNNECESSARY_VALUE: 60,
  60: "X_V_MODEL_UNNECESSARY_VALUE",
  X_V_SHOW_NO_EXPRESSION: 61,
  61: "X_V_SHOW_NO_EXPRESSION",
  X_TRANSITION_INVALID_CHILDREN: 62,
  62: "X_TRANSITION_INVALID_CHILDREN",
  X_IGNORED_SIDE_EFFECT_TAG: 63,
  63: "X_IGNORED_SIDE_EFFECT_TAG",
  __EXTEND_POINT__: 64,
  64: "__EXTEND_POINT__"
}, Zx = {
  53: "v-html is missing expression.",
  54: "v-html will override element children.",
  55: "v-text is missing expression.",
  56: "v-text will override element children.",
  57: "v-model can only be used on <input>, <textarea> and <select> elements.",
  58: "v-model argument is not supported on plain elements.",
  59: "v-model cannot be used on file inputs since they are read-only. Use a v-on:change listener instead.",
  60: "Unnecessary value binding used alongside v-model. It will interfere with v-model's behavior.",
  61: "v-show is missing expression.",
  62: "<Transition> expects exactly one child element or component.",
  63: "Tags with side effect (<script> and <style>) are ignored in client component templates."
}, qW = (e, t, n) => {
  const { exp: s, loc: o } = e;
  return s || n.onError(
    Fs(53, o)
  ), t.children.length && (n.onError(
    Fs(54, o)
  ), t.children.length = 0), {
    props: [
      hn(
        rt("innerHTML", !0, o),
        s || rt("", !0)
      )
    ]
  };
}, JW = (e, t, n) => {
  const { exp: s, loc: o } = e;
  return s || n.onError(
    Fs(55, o)
  ), t.children.length && (n.onError(
    Fs(56, o)
  ), t.children.length = 0), {
    props: [
      hn(
        rt("textContent", !0),
        s ? Es(s, n) > 0 ? s : Nn(
          n.helperString(iu),
          [s],
          o
        ) : rt("", !0)
      )
    ]
  };
}, QW = (e, t, n) => {
  const s = jg(e, t, n);
  if (!s.props.length || t.tagType === 1)
    return s;
  e.arg && n.onError(
    Fs(
      58,
      e.arg.loc
    )
  );
  function o() {
    const a = zn(t, "bind");
    a && dr(a.arg, "value") && n.onError(
      Fs(
        60,
        a.loc
      )
    );
  }
  const { tag: i } = t, r = n.isCustomElement(i);
  if (i === "input" || i === "textarea" || i === "select" || r) {
    let a = Yg, l = !1;
    if (i === "input" || r) {
      const u = nl(t, "type");
      if (u) {
        if (u.type === 7)
          a = af;
        else if (u.value)
          switch (u.value.content) {
            case "radio":
              a = Bg;
              break;
            case "checkbox":
              a = Hg;
              break;
            case "file":
              l = !0, n.onError(
                Fs(
                  59,
                  e.loc
                )
              );
              break;
            default:
              ts.NODE_ENV !== "production" && o();
              break;
          }
      } else gx(t) ? a = af : ts.NODE_ENV !== "production" && o();
    } else i === "select" ? a = Wg : ts.NODE_ENV !== "production" && o();
    l || (s.needRuntime = n.helper(a));
  } else
    n.onError(
      Fs(
        57,
        e.loc
      )
    );
  return s.props = s.props.filter(
    (a) => !(a.key.type === 4 && a.key.content === "modelValue")
  ), s;
}, ZW = /* @__PURE__ */ On("passive,once,capture"), eG = /* @__PURE__ */ On(
  // event propagation management
  "stop,prevent,self,ctrl,shift,alt,meta,exact,middle"
), tG = /* @__PURE__ */ On("left,right"), eN = /* @__PURE__ */ On("onkeyup,onkeydown,onkeypress"), nG = (e, t, n, s) => {
  const o = [], i = [], r = [];
  for (let a = 0; a < t.length; a++) {
    const l = t[a].content;
    l === "native" && ea(
      "COMPILER_V_ON_NATIVE",
      n,
      s
    ) || ZW(l) ? r.push(l) : tG(l) ? cs(e) ? eN(e.content.toLowerCase()) ? o.push(l) : i.push(l) : (o.push(l), i.push(l)) : eG(l) ? i.push(l) : o.push(l);
  }
  return {
    keyModifiers: o,
    nonKeyModifiers: i,
    eventOptionModifiers: r
  };
}, Tb = (e, t) => cs(e) && e.content.toLowerCase() === "onclick" ? rt(t, !0) : e.type !== 4 ? Bs([
  "(",
  e,
  `) === "onClick" ? "${t}" : (`,
  e,
  ")"
]) : e, sG = (e, t, n) => Ug(e, t, n, (s) => {
  const { modifiers: o } = e;
  if (!o.length) return s;
  let { key: i, value: r } = s.props[0];
  const { keyModifiers: a, nonKeyModifiers: l, eventOptionModifiers: u } = nG(i, o, n, e.loc);
  if (l.includes("right") && (i = Tb(i, "onContextmenu")), l.includes("middle") && (i = Tb(i, "onMouseup")), l.length && (r = Nn(n.helper(Gg), [
    r,
    JSON.stringify(l)
  ])), a.length && // if event name is dynamic, always wrap with keys guard
  (!cs(i) || eN(i.content.toLowerCase())) && (r = Nn(n.helper(zg), [
    r,
    JSON.stringify(a)
  ])), u.length) {
    const d = u.map(fo).join("");
    i = cs(i) ? rt(`${i.content}${d}`, !0) : Bs(["(", i, `) + "${d}"`]);
  }
  return {
    props: [hn(i, r)]
  };
}), oG = (e, t, n) => {
  const { exp: s, loc: o } = e;
  return s || n.onError(
    Fs(61, o)
  ), {
    props: [],
    needRuntime: n.helper(Kg)
  };
}, rG = (e, t) => {
  if (e.type === 1 && e.tagType === 1 && t.isBuiltInComponent(e.tag) === Cp)
    return () => {
      if (!e.children.length)
        return;
      tN(e) && t.onError(
        Fs(
          62,
          {
            start: e.children[0].loc.start,
            end: e.children[e.children.length - 1].loc.end,
            source: ""
          }
        )
      );
      const s = e.children[0];
      if (s.type === 1)
        for (const o of s.props)
          o.type === 7 && o.name === "show" && e.props.push({
            type: 6,
            name: "persisted",
            nameLoc: e.loc,
            value: void 0,
            loc: e.loc
          });
    };
};
function tN(e) {
  const t = e.children = e.children.filter(
    (s) => s.type !== 3 && !(s.type === 2 && !s.content.trim())
  ), n = t[0];
  return t.length !== 1 || n.type === 11 || n.type === 9 && n.branches.some(tN);
}
const iG = (e, t) => {
  e.type === 1 && e.tagType === 0 && (e.tag === "script" || e.tag === "style") && (ts.NODE_ENV !== "production" && t.onError(
    Fs(
      63,
      e.loc
    )
  ), t.removeNode());
};
function aG(e, t) {
  return e in $b ? $b[e].has(t) : t in kb ? kb[t].has(e) : !(e in Db && Db[e].has(t) || t in Rb && Rb[t].has(e));
}
const Ea = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]), Ei = /* @__PURE__ */ new Set([]), $b = {
  head: /* @__PURE__ */ new Set([
    "base",
    "basefront",
    "bgsound",
    "link",
    "meta",
    "title",
    "noscript",
    "noframes",
    "style",
    "script",
    "template"
  ]),
  optgroup: /* @__PURE__ */ new Set(["option"]),
  select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]),
  // table
  table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]),
  tr: /* @__PURE__ */ new Set(["td", "th"]),
  colgroup: /* @__PURE__ */ new Set(["col"]),
  tbody: /* @__PURE__ */ new Set(["tr"]),
  thead: /* @__PURE__ */ new Set(["tr"]),
  tfoot: /* @__PURE__ */ new Set(["tr"]),
  // these elements can not have any children elements
  script: Ei,
  iframe: Ei,
  option: Ei,
  textarea: Ei,
  style: Ei,
  title: Ei
}, kb = {
  // sections
  html: Ei,
  body: /* @__PURE__ */ new Set(["html"]),
  head: /* @__PURE__ */ new Set(["html"]),
  // table
  td: /* @__PURE__ */ new Set(["tr"]),
  colgroup: /* @__PURE__ */ new Set(["table"]),
  caption: /* @__PURE__ */ new Set(["table"]),
  tbody: /* @__PURE__ */ new Set(["table"]),
  tfoot: /* @__PURE__ */ new Set(["table"]),
  col: /* @__PURE__ */ new Set(["colgroup"]),
  th: /* @__PURE__ */ new Set(["tr"]),
  thead: /* @__PURE__ */ new Set(["table"]),
  tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]),
  // data list
  dd: /* @__PURE__ */ new Set(["dl", "div"]),
  dt: /* @__PURE__ */ new Set(["dl", "div"]),
  // other
  figcaption: /* @__PURE__ */ new Set(["figure"]),
  // li: new Set(["ul", "ol"]),
  summary: /* @__PURE__ */ new Set(["details"]),
  area: /* @__PURE__ */ new Set(["map"])
}, Db = {
  p: /* @__PURE__ */ new Set([
    "address",
    "article",
    "aside",
    "blockquote",
    "center",
    "details",
    "dialog",
    "dir",
    "div",
    "dl",
    "fieldset",
    "figure",
    "footer",
    "form",
    "h1",
    "h2",
    "h3",
    "h4",
    "h5",
    "h6",
    "header",
    "hgroup",
    "hr",
    "li",
    "main",
    "nav",
    "menu",
    "ol",
    "p",
    "pre",
    "section",
    "table",
    "ul"
  ]),
  svg: /* @__PURE__ */ new Set([
    "b",
    "blockquote",
    "br",
    "code",
    "dd",
    "div",
    "dl",
    "dt",
    "em",
    "embed",
    "h1",
    "h2",
    "h3",
    "h4",
    "h5",
    "h6",
    "hr",
    "i",
    "img",
    "li",
    "menu",
    "meta",
    "ol",
    "p",
    "pre",
    "ruby",
    "s",
    "small",
    "span",
    "strong",
    "sub",
    "sup",
    "table",
    "u",
    "ul",
    "var"
  ])
}, Rb = {
  a: /* @__PURE__ */ new Set(["a"]),
  button: /* @__PURE__ */ new Set(["button"]),
  dd: /* @__PURE__ */ new Set(["dd", "dt"]),
  dt: /* @__PURE__ */ new Set(["dd", "dt"]),
  form: /* @__PURE__ */ new Set(["form"]),
  li: /* @__PURE__ */ new Set(["li"]),
  h1: Ea,
  h2: Ea,
  h3: Ea,
  h4: Ea,
  h5: Ea,
  h6: Ea
}, lG = (e, t) => {
  if (e.type === 1 && e.tagType === 0 && t.parent && t.parent.type === 1 && t.parent.tagType === 0 && !aG(t.parent.tag, e.tag)) {
    const n = new SyntaxError(
      `<${e.tag}> cannot be child of <${t.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`
    );
    n.loc = e.loc, t.onWarn(n);
  }
}, nN = [
  Qx,
  ...ts.NODE_ENV !== "production" ? [rG, lG] : []
], sN = {
  cloak: Jx,
  html: qW,
  text: JW,
  model: QW,
  // override compiler-core
  on: sG,
  // override compiler-core
  show: oG
};
function cG(e, t = {}) {
  return qx(
    e,
    it({}, qg, t, {
      nodeTransforms: [
        // ignore <script> and <tag>
        // this is not put inside DOMNodeTransforms because that list is used
        // by compiler-ssr to generate vnode fallback branches
        iG,
        ...nN,
        ...t.nodeTransforms || []
      ],
      directiveTransforms: it(
        {},
        sN,
        t.directiveTransforms || {}
      ),
      transformHoist: null
    })
  );
}
function uG(e, t = {}) {
  return Mg(e, it({}, qg, t));
}
const dG = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  BASE_TRANSITION: Sg,
  BindingTypes: GW,
  CAMELIZE: ef,
  CAPITALIZE: QS,
  CREATE_BLOCK: xg,
  CREATE_COMMENT: yl,
  CREATE_ELEMENT_BLOCK: Ng,
  CREATE_ELEMENT_VNODE: dp,
  CREATE_SLOTS: Tg,
  CREATE_STATIC: Cg,
  CREATE_TEXT: fp,
  CREATE_VNODE: up,
  CompilerDeprecationTypes: T9,
  ConstantTypes: b9,
  DOMDirectiveTransforms: sN,
  DOMErrorCodes: XW,
  DOMErrorMessages: Zx,
  DOMNodeTransforms: nN,
  ElementTypes: y9,
  ErrorCodes: k9,
  FRAGMENT: Za,
  GUARD_REACTIVE_PROPS: bl,
  IS_MEMO_SAME: $g,
  IS_REF: nx,
  KEEP_ALIVE: Mc,
  MERGE_PROPS: Pc,
  NORMALIZE_CLASS: yp,
  NORMALIZE_PROPS: el,
  NORMALIZE_STYLE: bp,
  Namespaces: g9,
  NodeTypes: _9,
  OPEN_BLOCK: si,
  POP_SCOPE_ID: ex,
  PUSH_SCOPE_ID: ZS,
  RENDER_LIST: _p,
  RENDER_SLOT: Og,
  RESOLVE_COMPONENT: pp,
  RESOLVE_DIRECTIVE: mp,
  RESOLVE_DYNAMIC_COMPONENT: hp,
  RESOLVE_FILTER: vp,
  SET_BLOCK_TRACKING: Lc,
  SUSPENSE: cp,
  TELEPORT: ja,
  TO_DISPLAY_STRING: iu,
  TO_HANDLERS: Ep,
  TO_HANDLER_KEY: tf,
  TRANSITION: Cp,
  TRANSITION_GROUP: Xg,
  TS_NODE_TYPES: ux,
  UNREF: tx,
  V_MODEL_CHECKBOX: Hg,
  V_MODEL_DYNAMIC: af,
  V_MODEL_RADIO: Bg,
  V_MODEL_SELECT: Wg,
  V_MODEL_TEXT: Yg,
  V_ON_WITH_KEYS: zg,
  V_ON_WITH_MODIFIERS: Gg,
  V_SHOW: Kg,
  WITH_CTX: wp,
  WITH_DIRECTIVES: gp,
  WITH_MEMO: Sp,
  advancePositionWithClone: K9,
  advancePositionWithMutation: vx,
  assert: Bm,
  baseCompile: qx,
  baseParse: Mg,
  buildDirectiveArgs: zx,
  buildProps: Fg,
  buildSlots: Bx,
  checkCompatEnabled: ea,
  compile: cG,
  convertToBlock: xp,
  createArrayExpression: Qr,
  createAssignmentExpression: x9,
  createBlockStatement: ix,
  createCacheExpression: rx,
  createCallExpression: Nn,
  createCompilerError: Bt,
  createCompoundExpression: Bs,
  createConditionalExpression: nf,
  createDOMCompilerError: Fs,
  createForLoopParams: of,
  createFunctionExpression: Ji,
  createIfStatement: S9,
  createInterpolation: E9,
  createObjectExpression: ks,
  createObjectProperty: hn,
  createReturnStatement: C9,
  createRoot: ox,
  createSequenceExpression: N9,
  createSimpleExpression: rt,
  createStructuralDirectiveTransform: Pg,
  createTemplateLiteral: w9,
  createTransformContext: $x,
  createVNodeCall: tl,
  errorMessages: lx,
  extractIdentifiers: ar,
  findDir: zn,
  findProp: nl,
  forAliasRE: bx,
  generate: Rx,
  generateCodeFrame: h1,
  getBaseTransformPreset: Xx,
  getConstantType: Es,
  getMemoedVNodeCall: yx,
  getVNodeBlockHelper: Zi,
  getVNodeHelper: Qi,
  hasDynamicKeyVBind: gx,
  hasScopeRef: Qs,
  helperNameMap: qi,
  injectProp: Uc,
  isCoreComponent: Dg,
  isFnExpression: mx,
  isFnExpressionBrowser: hx,
  isFnExpressionNode: z9,
  isFunctionType: F9,
  isInDestructureAssignment: I9,
  isInNewExpression: A9,
  isMemberExpression: Rg,
  isMemberExpressionBrowser: px,
  isMemberExpressionNode: W9,
  isReferencedIdentifier: R9,
  isSimpleIdentifier: au,
  isSlotOutlet: Fc,
  isStaticArgOf: dr,
  isStaticExp: cs,
  isStaticProperty: cx,
  isStaticPropertyKey: U9,
  isTemplateNode: sl,
  isText: md,
  isVSlot: Ig,
  locStub: In,
  noopDirectiveTransform: Jx,
  parse: uG,
  parserOptions: qg,
  processExpression: yd,
  processFor: Ux,
  processIf: Lx,
  processSlotOutlet: Kx,
  registerRuntimeHelpers: sx,
  resolveComponentType: Gx,
  stringifyExpression: Px,
  toValidAssetId: ol,
  trackSlotScopes: jx,
  trackVForSlotScopes: MW,
  transform: kx,
  transformBind: Vx,
  transformElement: Wx,
  transformExpression: Mx,
  transformModel: jg,
  transformOn: Ug,
  transformStyle: Qx,
  traverseNode: lu,
  unwrapTSNode: dx,
  walkBlockDeclarations: P9,
  walkFunctionParams: M9,
  walkIdentifiers: D9,
  warnDeprecation: Vc
}, Symbol.toStringTag, { value: "Module" })), oN = /* @__PURE__ */ lp(dG), rN = /* @__PURE__ */ lp(tk), iN = /* @__PURE__ */ lp(TC);
/**
* vue v3.5.13
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
var Ib;
function fG() {
  return Ib || (Ib = 1, function(e) {
    Object.defineProperty(e, "__esModule", { value: !0 });
    var t = oN, n = rN, s = iN;
    function o(l) {
      var u = /* @__PURE__ */ Object.create(null);
      if (l)
        for (var d in l)
          u[d] = l[d];
      return u.default = l, Object.freeze(u);
    }
    var i = /* @__PURE__ */ o(n);
    const r = /* @__PURE__ */ Object.create(null);
    function a(l, u) {
      if (!s.isString(l))
        if (l.nodeType)
          l = l.innerHTML;
        else
          return s.NOOP;
      const d = s.genCacheKey(l, u), f = r[d];
      if (f)
        return f;
      if (l[0] === "#") {
        const v = document.querySelector(l);
        l = v ? v.innerHTML : "";
      }
      const p = s.extend(
        {
          hoistStatic: !0,
          onError: void 0,
          onWarn: s.NOOP
        },
        u
      );
      !p.isCustomElement && typeof customElements < "u" && (p.isCustomElement = (v) => !!customElements.get(v));
      const { code: h } = t.compile(l, p), m = new Function("Vue", h)(i);
      return m._rc = !0, r[d] = m;
    }
    n.registerRuntimeCompiler(a), e.compile = a, Object.keys(n).forEach(function(l) {
      l !== "default" && !Object.prototype.hasOwnProperty.call(e, l) && (e[l] = n[l]);
    });
  }(_h)), _h;
}
var bh = {};
/**
* vue v3.5.13
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/
var Ab;
function pG() {
  return Ab || (Ab = 1, function(e) {
    Object.defineProperty(e, "__esModule", { value: !0 });
    var t = oN, n = rN, s = iN;
    function o(l) {
      var u = /* @__PURE__ */ Object.create(null);
      if (l)
        for (var d in l)
          u[d] = l[d];
      return u.default = l, Object.freeze(u);
    }
    var i = /* @__PURE__ */ o(n);
    const r = /* @__PURE__ */ Object.create(null);
    function a(l, u) {
      if (!s.isString(l))
        if (l.nodeType)
          l = l.innerHTML;
        else
          return n.warn("invalid template option: ", l), s.NOOP;
      const d = s.genCacheKey(l, u), f = r[d];
      if (f)
        return f;
      if (l[0] === "#") {
        const _ = document.querySelector(l);
        _ || n.warn(`Template element not found or is empty: ${l}`), l = _ ? _.innerHTML : "";
      }
      const p = s.extend(
        {
          hoistStatic: !0,
          onError: m,
          onWarn: (_) => m(_, !0)
        },
        u
      );
      !p.isCustomElement && typeof customElements < "u" && (p.isCustomElement = (_) => !!customElements.get(_));
      const { code: h } = t.compile(l, p);
      function m(_, b = !1) {
        const w = b ? _.message : `Template compilation error: ${_.message}`, y = _.loc && s.generateCodeFrame(
          l,
          _.loc.start.offset,
          _.loc.end.offset
        );
        n.warn(y ? `${w}
${y}` : w);
      }
      const v = new Function("Vue", h)(i);
      return v._rc = !0, r[d] = v;
    }
    n.registerRuntimeCompiler(a), e.compile = a, Object.keys(n).forEach(function(l) {
      l !== "default" && !Object.prototype.hasOwnProperty.call(e, l) && (e[l] = n[l]);
    });
  }(bh)), bh;
}
var Mb;
function hG() {
  if (Mb) return Au.exports;
  Mb = 1;
  var e = {};
  return e.NODE_ENV === "production" ? Au.exports = fG() : Au.exports = pG(), Au.exports;
}
/**!
 * Sortable 1.14.0
 * @author	RubaXa   <trash@rubaxa.org>
 * @author	owenm    <owen23355@gmail.com>
 * @license MIT
 */
function Pb(e, t) {
  var n = Object.keys(e);
  if (Object.getOwnPropertySymbols) {
    var s = Object.getOwnPropertySymbols(e);
    t && (s = s.filter(function(o) {
      return Object.getOwnPropertyDescriptor(e, o).enumerable;
    })), n.push.apply(n, s);
  }
  return n;
}
function Vo(e) {
  for (var t = 1; t < arguments.length; t++) {
    var n = arguments[t] != null ? arguments[t] : {};
    t % 2 ? Pb(Object(n), !0).forEach(function(s) {
      mG(e, s, n[s]);
    }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(n)) : Pb(Object(n)).forEach(function(s) {
      Object.defineProperty(e, s, Object.getOwnPropertyDescriptor(n, s));
    });
  }
  return e;
}
function Ed(e) {
  "@babel/helpers - typeof";
  return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Ed = function(t) {
    return typeof t;
  } : Ed = function(t) {
    return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
  }, Ed(e);
}
function mG(e, t, n) {
  return t in e ? Object.defineProperty(e, t, {
    value: n,
    enumerable: !0,
    configurable: !0,
    writable: !0
  }) : e[t] = n, e;
}
function zs() {
  return zs = Object.assign || function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var n = arguments[t];
      for (var s in n)
        Object.prototype.hasOwnProperty.call(n, s) && (e[s] = n[s]);
    }
    return e;
  }, zs.apply(this, arguments);
}
function vG(e, t) {
  if (e == null) return {};
  var n = {}, s = Object.keys(e), o, i;
  for (i = 0; i < s.length; i++)
    o = s[i], !(t.indexOf(o) >= 0) && (n[o] = e[o]);
  return n;
}
function gG(e, t) {
  if (e == null) return {};
  var n = vG(e, t), s, o;
  if (Object.getOwnPropertySymbols) {
    var i = Object.getOwnPropertySymbols(e);
    for (o = 0; o < i.length; o++)
      s = i[o], !(t.indexOf(s) >= 0) && Object.prototype.propertyIsEnumerable.call(e, s) && (n[s] = e[s]);
  }
  return n;
}
function _G(e) {
  return yG(e) || bG(e) || EG(e) || wG();
}
function yG(e) {
  if (Array.isArray(e)) return Gm(e);
}
function bG(e) {
  if (typeof Symbol < "u" && e[Symbol.iterator] != null || e["@@iterator"] != null) return Array.from(e);
}
function EG(e, t) {
  if (e) {
    if (typeof e == "string") return Gm(e, t);
    var n = Object.prototype.toString.call(e).slice(8, -1);
    if (n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set") return Array.from(e);
    if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Gm(e, t);
  }
}
function Gm(e, t) {
  (t == null || t > e.length) && (t = e.length);
  for (var n = 0, s = new Array(t); n < t; n++) s[n] = e[n];
  return s;
}
function wG() {
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
var SG = "1.14.0";
function vr(e) {
  if (typeof window < "u" && window.navigator)
    return !!/* @__PURE__ */ navigator.userAgent.match(e);
}
var Cr = vr(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i), uu = vr(/Edge/i), Lb = vr(/firefox/i), lc = vr(/safari/i) && !vr(/chrome/i) && !vr(/android/i), aN = vr(/iP(ad|od|hone)/i), xG = vr(/chrome/i) && vr(/android/i), lN = {
  capture: !1,
  passive: !1
};
function yt(e, t, n) {
  e.addEventListener(t, n, !Cr && lN);
}
function ht(e, t, n) {
  e.removeEventListener(t, n, !Cr && lN);
}
function lf(e, t) {
  if (t) {
    if (t[0] === ">" && (t = t.substring(1)), e)
      try {
        if (e.matches)
          return e.matches(t);
        if (e.msMatchesSelector)
          return e.msMatchesSelector(t);
        if (e.webkitMatchesSelector)
          return e.webkitMatchesSelector(t);
      } catch {
        return !1;
      }
    return !1;
  }
}
function NG(e) {
  return e.host && e !== document && e.host.nodeType ? e.host : e.parentNode;
}
function eo(e, t, n, s) {
  if (e) {
    n = n || document;
    do {
      if (t != null && (t[0] === ">" ? e.parentNode === n && lf(e, t) : lf(e, t)) || s && e === n)
        return e;
      if (e === n) break;
    } while (e = NG(e));
  }
  return null;
}
var Vb = /\s+/g;
function ln(e, t, n) {
  if (e && t)
    if (e.classList)
      e.classList[n ? "add" : "remove"](t);
    else {
      var s = (" " + e.className + " ").replace(Vb, " ").replace(" " + t + " ", " ");
      e.className = (s + (n ? " " + t : "")).replace(Vb, " ");
    }
}
function Le(e, t, n) {
  var s = e && e.style;
  if (s) {
    if (n === void 0)
      return document.defaultView && document.defaultView.getComputedStyle ? n = document.defaultView.getComputedStyle(e, "") : e.currentStyle && (n = e.currentStyle), t === void 0 ? n : n[t];
    !(t in s) && t.indexOf("webkit") === -1 && (t = "-webkit-" + t), s[t] = n + (typeof n == "string" ? "" : "px");
  }
}
function Fi(e, t) {
  var n = "";
  if (typeof e == "string")
    n = e;
  else
    do {
      var s = Le(e, "transform");
      s && s !== "none" && (n = s + " " + n);
    } while (!t && (e = e.parentNode));
  var o = window.DOMMatrix || window.WebKitCSSMatrix || window.CSSMatrix || window.MSCSSMatrix;
  return o && new o(n);
}
function cN(e, t, n) {
  if (e) {
    var s = e.getElementsByTagName(t), o = 0, i = s.length;
    if (n)
      for (; o < i; o++)
        n(s[o], o);
    return s;
  }
  return [];
}
function ko() {
  var e = document.scrollingElement;
  return e || document.documentElement;
}
function rn(e, t, n, s, o) {
  if (!(!e.getBoundingClientRect && e !== window)) {
    var i, r, a, l, u, d, f;
    if (e !== window && e.parentNode && e !== ko() ? (i = e.getBoundingClientRect(), r = i.top, a = i.left, l = i.bottom, u = i.right, d = i.height, f = i.width) : (r = 0, a = 0, l = window.innerHeight, u = window.innerWidth, d = window.innerHeight, f = window.innerWidth), (t || n) && e !== window && (o = o || e.parentNode, !Cr))
      do
        if (o && o.getBoundingClientRect && (Le(o, "transform") !== "none" || n && Le(o, "position") !== "static")) {
          var p = o.getBoundingClientRect();
          r -= p.top + parseInt(Le(o, "border-top-width")), a -= p.left + parseInt(Le(o, "border-left-width")), l = r + i.height, u = a + i.width;
          break;
        }
      while (o = o.parentNode);
    if (s && e !== window) {
      var h = Fi(o || e), m = h && h.a, v = h && h.d;
      h && (r /= v, a /= m, f /= m, d /= v, l = r + d, u = a + f);
    }
    return {
      top: r,
      left: a,
      bottom: l,
      right: u,
      width: f,
      height: d
    };
  }
}
function Fb(e, t, n) {
  for (var s = zr(e, !0), o = rn(e)[t]; s; ) {
    var i = rn(s)[n], r = void 0;
    if (r = o >= i, !r) return s;
    if (s === ko()) break;
    s = zr(s, !1);
  }
  return !1;
}
function rl(e, t, n, s) {
  for (var o = 0, i = 0, r = e.children; i < r.length; ) {
    if (r[i].style.display !== "none" && r[i] !== Je.ghost && (s || r[i] !== Je.dragged) && eo(r[i], n.draggable, e, !1)) {
      if (o === t)
        return r[i];
      o++;
    }
    i++;
  }
  return null;
}
function Jg(e, t) {
  for (var n = e.lastElementChild; n && (n === Je.ghost || Le(n, "display") === "none" || t && !lf(n, t)); )
    n = n.previousElementSibling;
  return n || null;
}
function fn(e, t) {
  var n = 0;
  if (!e || !e.parentNode)
    return -1;
  for (; e = e.previousElementSibling; )
    e.nodeName.toUpperCase() !== "TEMPLATE" && e !== Je.clone && (!t || lf(e, t)) && n++;
  return n;
}
function Ub(e) {
  var t = 0, n = 0, s = ko();
  if (e)
    do {
      var o = Fi(e), i = o.a, r = o.d;
      t += e.scrollLeft * i, n += e.scrollTop * r;
    } while (e !== s && (e = e.parentNode));
  return [t, n];
}
function CG(e, t) {
  for (var n in e)
    if (e.hasOwnProperty(n)) {
      for (var s in t)
        if (t.hasOwnProperty(s) && t[s] === e[n][s]) return Number(n);
    }
  return -1;
}
function zr(e, t) {
  if (!e || !e.getBoundingClientRect) return ko();
  var n = e, s = !1;
  do
    if (n.clientWidth < n.scrollWidth || n.clientHeight < n.scrollHeight) {
      var o = Le(n);
      if (n.clientWidth < n.scrollWidth && (o.overflowX == "auto" || o.overflowX == "scroll") || n.clientHeight < n.scrollHeight && (o.overflowY == "auto" || o.overflowY == "scroll")) {
        if (!n.getBoundingClientRect || n === document.body) return ko();
        if (s || t) return n;
        s = !0;
      }
    }
  while (n = n.parentNode);
  return ko();
}
function OG(e, t) {
  if (e && t)
    for (var n in t)
      t.hasOwnProperty(n) && (e[n] = t[n]);
  return e;
}
function Eh(e, t) {
  return Math.round(e.top) === Math.round(t.top) && Math.round(e.left) === Math.round(t.left) && Math.round(e.height) === Math.round(t.height) && Math.round(e.width) === Math.round(t.width);
}
var uc;
function uN(e, t) {
  return function() {
    if (!uc) {
      var n = arguments, s = this;
      n.length === 1 ? e.call(s, n[0]) : e.apply(s, n), uc = setTimeout(function() {
        uc = void 0;
      }, t);
    }
  };
}
function TG() {
  clearTimeout(uc), uc = void 0;
}
function dN(e, t, n) {
  e.scrollLeft += t, e.scrollTop += n;
}
function Qg(e) {
  var t = window.Polymer, n = window.jQuery || window.Zepto;
  return t && t.dom ? t.dom(e).cloneNode(!0) : n ? n(e).clone(!0)[0] : e.cloneNode(!0);
}
function jb(e, t) {
  Le(e, "position", "absolute"), Le(e, "top", t.top), Le(e, "left", t.left), Le(e, "width", t.width), Le(e, "height", t.height);
}
function wh(e) {
  Le(e, "position", ""), Le(e, "top", ""), Le(e, "left", ""), Le(e, "width", ""), Le(e, "height", "");
}
var Xn = "Sortable" + (/* @__PURE__ */ new Date()).getTime();
function $G() {
  var e = [], t;
  return {
    captureAnimationState: function() {
      if (e = [], !!this.options.animation) {
        var s = [].slice.call(this.el.children);
        s.forEach(function(o) {
          if (!(Le(o, "display") === "none" || o === Je.ghost)) {
            e.push({
              target: o,
              rect: rn(o)
            });
            var i = Vo({}, e[e.length - 1].rect);
            if (o.thisAnimationDuration) {
              var r = Fi(o, !0);
              r && (i.top -= r.f, i.left -= r.e);
            }
            o.fromRect = i;
          }
        });
      }
    },
    addAnimationState: function(s) {
      e.push(s);
    },
    removeAnimationState: function(s) {
      e.splice(CG(e, {
        target: s
      }), 1);
    },
    animateAll: function(s) {
      var o = this;
      if (!this.options.animation) {
        clearTimeout(t), typeof s == "function" && s();
        return;
      }
      var i = !1, r = 0;
      e.forEach(function(a) {
        var l = 0, u = a.target, d = u.fromRect, f = rn(u), p = u.prevFromRect, h = u.prevToRect, m = a.rect, v = Fi(u, !0);
        v && (f.top -= v.f, f.left -= v.e), u.toRect = f, u.thisAnimationDuration && Eh(p, f) && !Eh(d, f) && // Make sure animatingRect is on line between toRect & fromRect
        (m.top - f.top) / (m.left - f.left) === (d.top - f.top) / (d.left - f.left) && (l = DG(m, p, h, o.options)), Eh(f, d) || (u.prevFromRect = d, u.prevToRect = f, l || (l = o.options.animation), o.animate(u, m, f, l)), l && (i = !0, r = Math.max(r, l), clearTimeout(u.animationResetTimer), u.animationResetTimer = setTimeout(function() {
          u.animationTime = 0, u.prevFromRect = null, u.fromRect = null, u.prevToRect = null, u.thisAnimationDuration = null;
        }, l), u.thisAnimationDuration = l);
      }), clearTimeout(t), i ? t = setTimeout(function() {
        typeof s == "function" && s();
      }, r) : typeof s == "function" && s(), e = [];
    },
    animate: function(s, o, i, r) {
      if (r) {
        Le(s, "transition", ""), Le(s, "transform", "");
        var a = Fi(this.el), l = a && a.a, u = a && a.d, d = (o.left - i.left) / (l || 1), f = (o.top - i.top) / (u || 1);
        s.animatingX = !!d, s.animatingY = !!f, Le(s, "transform", "translate3d(" + d + "px," + f + "px,0)"), this.forRepaintDummy = kG(s), Le(s, "transition", "transform " + r + "ms" + (this.options.easing ? " " + this.options.easing : "")), Le(s, "transform", "translate3d(0,0,0)"), typeof s.animated == "number" && clearTimeout(s.animated), s.animated = setTimeout(function() {
          Le(s, "transition", ""), Le(s, "transform", ""), s.animated = !1, s.animatingX = !1, s.animatingY = !1;
        }, r);
      }
    }
  };
}
function kG(e) {
  return e.offsetWidth;
}
function DG(e, t, n, s) {
  return Math.sqrt(Math.pow(t.top - e.top, 2) + Math.pow(t.left - e.left, 2)) / Math.sqrt(Math.pow(t.top - n.top, 2) + Math.pow(t.left - n.left, 2)) * s.animation;
}
var wa = [], Sh = {
  initializeByDefault: !0
}, du = {
  mount: function(t) {
    for (var n in Sh)
      Sh.hasOwnProperty(n) && !(n in t) && (t[n] = Sh[n]);
    wa.forEach(function(s) {
      if (s.pluginName === t.pluginName)
        throw "Sortable: Cannot mount plugin ".concat(t.pluginName, " more than once");
    }), wa.push(t);
  },
  pluginEvent: function(t, n, s) {
    var o = this;
    this.eventCanceled = !1, s.cancel = function() {
      o.eventCanceled = !0;
    };
    var i = t + "Global";
    wa.forEach(function(r) {
      n[r.pluginName] && (n[r.pluginName][i] && n[r.pluginName][i](Vo({
        sortable: n
      }, s)), n.options[r.pluginName] && n[r.pluginName][t] && n[r.pluginName][t](Vo({
        sortable: n
      }, s)));
    });
  },
  initializePlugins: function(t, n, s, o) {
    wa.forEach(function(a) {
      var l = a.pluginName;
      if (!(!t.options[l] && !a.initializeByDefault)) {
        var u = new a(t, n, t.options);
        u.sortable = t, u.options = t.options, t[l] = u, zs(s, u.defaults);
      }
    });
    for (var i in t.options)
      if (t.options.hasOwnProperty(i)) {
        var r = this.modifyOption(t, i, t.options[i]);
        typeof r < "u" && (t.options[i] = r);
      }
  },
  getEventProperties: function(t, n) {
    var s = {};
    return wa.forEach(function(o) {
      typeof o.eventProperties == "function" && zs(s, o.eventProperties.call(n[o.pluginName], t));
    }), s;
  },
  modifyOption: function(t, n, s) {
    var o;
    return wa.forEach(function(i) {
      t[i.pluginName] && i.optionListeners && typeof i.optionListeners[n] == "function" && (o = i.optionListeners[n].call(t[i.pluginName], s));
    }), o;
  }
};
function Gl(e) {
  var t = e.sortable, n = e.rootEl, s = e.name, o = e.targetEl, i = e.cloneEl, r = e.toEl, a = e.fromEl, l = e.oldIndex, u = e.newIndex, d = e.oldDraggableIndex, f = e.newDraggableIndex, p = e.originalEvent, h = e.putSortable, m = e.extraEventProperties;
  if (t = t || n && n[Xn], !!t) {
    var v, _ = t.options, b = "on" + s.charAt(0).toUpperCase() + s.substr(1);
    window.CustomEvent && !Cr && !uu ? v = new CustomEvent(s, {
      bubbles: !0,
      cancelable: !0
    }) : (v = document.createEvent("Event"), v.initEvent(s, !0, !0)), v.to = r || n, v.from = a || n, v.item = o || n, v.clone = i, v.oldIndex = l, v.newIndex = u, v.oldDraggableIndex = d, v.newDraggableIndex = f, v.originalEvent = p, v.pullMode = h ? h.lastPutMode : void 0;
    var w = Vo(Vo({}, m), du.getEventProperties(s, t));
    for (var y in w)
      v[y] = w[y];
    n && n.dispatchEvent(v), _[b] && _[b].call(t, v);
  }
}
var RG = ["evt"], ms = function(t, n) {
  var s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, o = s.evt, i = gG(s, RG);
  du.pluginEvent.bind(Je)(t, n, Vo({
    dragEl: Ne,
    parentEl: un,
    ghostEl: at,
    rootEl: nn,
    nextEl: wi,
    lastDownEl: wd,
    cloneEl: dn,
    cloneHidden: Br,
    dragStarted: zl,
    putSortable: Vn,
    activeSortable: Je.active,
    originalEvent: o,
    oldIndex: Da,
    oldDraggableIndex: dc,
    newIndex: Ts,
    newDraggableIndex: Ur,
    hideGhostForTarget: mN,
    unhideGhostForTarget: vN,
    cloneNowHidden: function() {
      Br = !0;
    },
    cloneNowShown: function() {
      Br = !1;
    },
    dispatchSortableEvent: function(a) {
      os({
        sortable: n,
        name: a,
        originalEvent: o
      });
    }
  }, i));
};
function os(e) {
  Gl(Vo({
    putSortable: Vn,
    cloneEl: dn,
    targetEl: Ne,
    rootEl: nn,
    oldIndex: Da,
    oldDraggableIndex: dc,
    newIndex: Ts,
    newDraggableIndex: Ur
  }, e));
}
var Ne, un, at, nn, wi, wd, dn, Br, Da, Ts, dc, Ur, Vu, Vn, Oa = !1, cf = !1, uf = [], vi, qs, xh, Nh, Bb, Hb, zl, Sa, fc, pc = !1, Fu = !1, Sd, Bn, Ch = [], zm = !1, df = [], Op = typeof document < "u", Uu = aN, Yb = uu || Cr ? "cssFloat" : "float", IG = Op && !xG && !aN && "draggable" in document.createElement("div"), fN = function() {
  if (Op) {
    if (Cr)
      return !1;
    var e = document.createElement("x");
    return e.style.cssText = "pointer-events:auto", e.style.pointerEvents === "auto";
  }
}(), pN = function(t, n) {
  var s = Le(t), o = parseInt(s.width) - parseInt(s.paddingLeft) - parseInt(s.paddingRight) - parseInt(s.borderLeftWidth) - parseInt(s.borderRightWidth), i = rl(t, 0, n), r = rl(t, 1, n), a = i && Le(i), l = r && Le(r), u = a && parseInt(a.marginLeft) + parseInt(a.marginRight) + rn(i).width, d = l && parseInt(l.marginLeft) + parseInt(l.marginRight) + rn(r).width;
  if (s.display === "flex")
    return s.flexDirection === "column" || s.flexDirection === "column-reverse" ? "vertical" : "horizontal";
  if (s.display === "grid")
    return s.gridTemplateColumns.split(" ").length <= 1 ? "vertical" : "horizontal";
  if (i && a.float && a.float !== "none") {
    var f = a.float === "left" ? "left" : "right";
    return r && (l.clear === "both" || l.clear === f) ? "vertical" : "horizontal";
  }
  return i && (a.display === "block" || a.display === "flex" || a.display === "table" || a.display === "grid" || u >= o && s[Yb] === "none" || r && s[Yb] === "none" && u + d > o) ? "vertical" : "horizontal";
}, AG = function(t, n, s) {
  var o = s ? t.left : t.top, i = s ? t.right : t.bottom, r = s ? t.width : t.height, a = s ? n.left : n.top, l = s ? n.right : n.bottom, u = s ? n.width : n.height;
  return o === a || i === l || o + r / 2 === a + u / 2;
}, MG = function(t, n) {
  var s;
  return uf.some(function(o) {
    var i = o[Xn].options.emptyInsertThreshold;
    if (!(!i || Jg(o))) {
      var r = rn(o), a = t >= r.left - i && t <= r.right + i, l = n >= r.top - i && n <= r.bottom + i;
      if (a && l)
        return s = o;
    }
  }), s;
}, hN = function(t) {
  function n(i, r) {
    return function(a, l, u, d) {
      var f = a.options.group.name && l.options.group.name && a.options.group.name === l.options.group.name;
      if (i == null && (r || f))
        return !0;
      if (i == null || i === !1)
        return !1;
      if (r && i === "clone")
        return i;
      if (typeof i == "function")
        return n(i(a, l, u, d), r)(a, l, u, d);
      var p = (r ? a : l).options.group.name;
      return i === !0 || typeof i == "string" && i === p || i.join && i.indexOf(p) > -1;
    };
  }
  var s = {}, o = t.group;
  (!o || Ed(o) != "object") && (o = {
    name: o
  }), s.name = o.name, s.checkPull = n(o.pull, !0), s.checkPut = n(o.put), s.revertClone = o.revertClone, t.group = s;
}, mN = function() {
  !fN && at && Le(at, "display", "none");
}, vN = function() {
  !fN && at && Le(at, "display", "");
};
Op && document.addEventListener("click", function(e) {
  if (cf)
    return e.preventDefault(), e.stopPropagation && e.stopPropagation(), e.stopImmediatePropagation && e.stopImmediatePropagation(), cf = !1, !1;
}, !0);
var gi = function(t) {
  if (Ne) {
    t = t.touches ? t.touches[0] : t;
    var n = MG(t.clientX, t.clientY);
    if (n) {
      var s = {};
      for (var o in t)
        t.hasOwnProperty(o) && (s[o] = t[o]);
      s.target = s.rootEl = n, s.preventDefault = void 0, s.stopPropagation = void 0, n[Xn]._onDragOver(s);
    }
  }
}, PG = function(t) {
  Ne && Ne.parentNode[Xn]._isOutsideThisEl(t.target);
};
function Je(e, t) {
  if (!(e && e.nodeType && e.nodeType === 1))
    throw "Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));
  this.el = e, this.options = t = zs({}, t), e[Xn] = this;
  var n = {
    group: null,
    sort: !0,
    disabled: !1,
    store: null,
    handle: null,
    draggable: /^[uo]l$/i.test(e.nodeName) ? ">li" : ">*",
    swapThreshold: 1,
    // percentage; 0 <= x <= 1
    invertSwap: !1,
    // invert always
    invertedSwapThreshold: null,
    // will be set to same as swapThreshold if default
    removeCloneOnHide: !0,
    direction: function() {
      return pN(e, this.options);
    },
    ghostClass: "sortable-ghost",
    chosenClass: "sortable-chosen",
    dragClass: "sortable-drag",
    ignore: "a, img",
    filter: null,
    preventOnFilter: !0,
    animation: 0,
    easing: null,
    setData: function(r, a) {
      r.setData("Text", a.textContent);
    },
    dropBubble: !1,
    dragoverBubble: !1,
    dataIdAttr: "data-id",
    delay: 0,
    delayOnTouchOnly: !1,
    touchStartThreshold: (Number.parseInt ? Number : window).parseInt(window.devicePixelRatio, 10) || 1,
    forceFallback: !1,
    fallbackClass: "sortable-fallback",
    fallbackOnBody: !1,
    fallbackTolerance: 0,
    fallbackOffset: {
      x: 0,
      y: 0
    },
    supportPointer: Je.supportPointer !== !1 && "PointerEvent" in window && !lc,
    emptyInsertThreshold: 5
  };
  du.initializePlugins(this, e, n);
  for (var s in n)
    !(s in t) && (t[s] = n[s]);
  hN(t);
  for (var o in this)
    o.charAt(0) === "_" && typeof this[o] == "function" && (this[o] = this[o].bind(this));
  this.nativeDraggable = t.forceFallback ? !1 : IG, this.nativeDraggable && (this.options.touchStartThreshold = 1), t.supportPointer ? yt(e, "pointerdown", this._onTapStart) : (yt(e, "mousedown", this._onTapStart), yt(e, "touchstart", this._onTapStart)), this.nativeDraggable && (yt(e, "dragover", this), yt(e, "dragenter", this)), uf.push(this.el), t.store && t.store.get && this.sort(t.store.get(this) || []), zs(this, $G());
}
Je.prototype = /** @lends Sortable.prototype */
{
  constructor: Je,
  _isOutsideThisEl: function(t) {
    !this.el.contains(t) && t !== this.el && (Sa = null);
  },
  _getDirection: function(t, n) {
    return typeof this.options.direction == "function" ? this.options.direction.call(this, t, n, Ne) : this.options.direction;
  },
  _onTapStart: function(t) {
    if (t.cancelable) {
      var n = this, s = this.el, o = this.options, i = o.preventOnFilter, r = t.type, a = t.touches && t.touches[0] || t.pointerType && t.pointerType === "touch" && t, l = (a || t).target, u = t.target.shadowRoot && (t.path && t.path[0] || t.composedPath && t.composedPath()[0]) || l, d = o.filter;
      if (YG(s), !Ne && !(/mousedown|pointerdown/.test(r) && t.button !== 0 || o.disabled) && !u.isContentEditable && !(!this.nativeDraggable && lc && l && l.tagName.toUpperCase() === "SELECT") && (l = eo(l, o.draggable, s, !1), !(l && l.animated) && wd !== l)) {
        if (Da = fn(l), dc = fn(l, o.draggable), typeof d == "function") {
          if (d.call(this, t, l, this)) {
            os({
              sortable: n,
              rootEl: u,
              name: "filter",
              targetEl: l,
              toEl: s,
              fromEl: s
            }), ms("filter", n, {
              evt: t
            }), i && t.cancelable && t.preventDefault();
            return;
          }
        } else if (d && (d = d.split(",").some(function(f) {
          if (f = eo(u, f.trim(), s, !1), f)
            return os({
              sortable: n,
              rootEl: f,
              name: "filter",
              targetEl: l,
              fromEl: s,
              toEl: s
            }), ms("filter", n, {
              evt: t
            }), !0;
        }), d)) {
          i && t.cancelable && t.preventDefault();
          return;
        }
        o.handle && !eo(u, o.handle, s, !1) || this._prepareDragStart(t, a, l);
      }
    }
  },
  _prepareDragStart: function(t, n, s) {
    var o = this, i = o.el, r = o.options, a = i.ownerDocument, l;
    if (s && !Ne && s.parentNode === i) {
      var u = rn(s);
      if (nn = i, Ne = s, un = Ne.parentNode, wi = Ne.nextSibling, wd = s, Vu = r.group, Je.dragged = Ne, vi = {
        target: Ne,
        clientX: (n || t).clientX,
        clientY: (n || t).clientY
      }, Bb = vi.clientX - u.left, Hb = vi.clientY - u.top, this._lastX = (n || t).clientX, this._lastY = (n || t).clientY, Ne.style["will-change"] = "all", l = function() {
        if (ms("delayEnded", o, {
          evt: t
        }), Je.eventCanceled) {
          o._onDrop();
          return;
        }
        o._disableDelayedDragEvents(), !Lb && o.nativeDraggable && (Ne.draggable = !0), o._triggerDragStart(t, n), os({
          sortable: o,
          name: "choose",
          originalEvent: t
        }), ln(Ne, r.chosenClass, !0);
      }, r.ignore.split(",").forEach(function(d) {
        cN(Ne, d.trim(), Oh);
      }), yt(a, "dragover", gi), yt(a, "mousemove", gi), yt(a, "touchmove", gi), yt(a, "mouseup", o._onDrop), yt(a, "touchend", o._onDrop), yt(a, "touchcancel", o._onDrop), Lb && this.nativeDraggable && (this.options.touchStartThreshold = 4, Ne.draggable = !0), ms("delayStart", this, {
        evt: t
      }), r.delay && (!r.delayOnTouchOnly || n) && (!this.nativeDraggable || !(uu || Cr))) {
        if (Je.eventCanceled) {
          this._onDrop();
          return;
        }
        yt(a, "mouseup", o._disableDelayedDrag), yt(a, "touchend", o._disableDelayedDrag), yt(a, "touchcancel", o._disableDelayedDrag), yt(a, "mousemove", o._delayedDragTouchMoveHandler), yt(a, "touchmove", o._delayedDragTouchMoveHandler), r.supportPointer && yt(a, "pointermove", o._delayedDragTouchMoveHandler), o._dragStartTimer = setTimeout(l, r.delay);
      } else
        l();
    }
  },
  _delayedDragTouchMoveHandler: function(t) {
    var n = t.touches ? t.touches[0] : t;
    Math.max(Math.abs(n.clientX - this._lastX), Math.abs(n.clientY - this._lastY)) >= Math.floor(this.options.touchStartThreshold / (this.nativeDraggable && window.devicePixelRatio || 1)) && this._disableDelayedDrag();
  },
  _disableDelayedDrag: function() {
    Ne && Oh(Ne), clearTimeout(this._dragStartTimer), this._disableDelayedDragEvents();
  },
  _disableDelayedDragEvents: function() {
    var t = this.el.ownerDocument;
    ht(t, "mouseup", this._disableDelayedDrag), ht(t, "touchend", this._disableDelayedDrag), ht(t, "touchcancel", this._disableDelayedDrag), ht(t, "mousemove", this._delayedDragTouchMoveHandler), ht(t, "touchmove", this._delayedDragTouchMoveHandler), ht(t, "pointermove", this._delayedDragTouchMoveHandler);
  },
  _triggerDragStart: function(t, n) {
    n = n || t.pointerType == "touch" && t, !this.nativeDraggable || n ? this.options.supportPointer ? yt(document, "pointermove", this._onTouchMove) : n ? yt(document, "touchmove", this._onTouchMove) : yt(document, "mousemove", this._onTouchMove) : (yt(Ne, "dragend", this), yt(nn, "dragstart", this._onDragStart));
    try {
      document.selection ? xd(function() {
        document.selection.empty();
      }) : window.getSelection().removeAllRanges();
    } catch {
    }
  },
  _dragStarted: function(t, n) {
    if (Oa = !1, nn && Ne) {
      ms("dragStarted", this, {
        evt: n
      }), this.nativeDraggable && yt(document, "dragover", PG);
      var s = this.options;
      !t && ln(Ne, s.dragClass, !1), ln(Ne, s.ghostClass, !0), Je.active = this, t && this._appendGhost(), os({
        sortable: this,
        name: "start",
        originalEvent: n
      });
    } else
      this._nulling();
  },
  _emulateDragOver: function() {
    if (qs) {
      this._lastX = qs.clientX, this._lastY = qs.clientY, mN();
      for (var t = document.elementFromPoint(qs.clientX, qs.clientY), n = t; t && t.shadowRoot && (t = t.shadowRoot.elementFromPoint(qs.clientX, qs.clientY), t !== n); )
        n = t;
      if (Ne.parentNode[Xn]._isOutsideThisEl(t), n)
        do {
          if (n[Xn]) {
            var s = void 0;
            if (s = n[Xn]._onDragOver({
              clientX: qs.clientX,
              clientY: qs.clientY,
              target: t,
              rootEl: n
            }), s && !this.options.dragoverBubble)
              break;
          }
          t = n;
        } while (n = n.parentNode);
      vN();
    }
  },
  _onTouchMove: function(t) {
    if (vi) {
      var n = this.options, s = n.fallbackTolerance, o = n.fallbackOffset, i = t.touches ? t.touches[0] : t, r = at && Fi(at, !0), a = at && r && r.a, l = at && r && r.d, u = Uu && Bn && Ub(Bn), d = (i.clientX - vi.clientX + o.x) / (a || 1) + (u ? u[0] - Ch[0] : 0) / (a || 1), f = (i.clientY - vi.clientY + o.y) / (l || 1) + (u ? u[1] - Ch[1] : 0) / (l || 1);
      if (!Je.active && !Oa) {
        if (s && Math.max(Math.abs(i.clientX - this._lastX), Math.abs(i.clientY - this._lastY)) < s)
          return;
        this._onDragStart(t, !0);
      }
      if (at) {
        r ? (r.e += d - (xh || 0), r.f += f - (Nh || 0)) : r = {
          a: 1,
          b: 0,
          c: 0,
          d: 1,
          e: d,
          f
        };
        var p = "matrix(".concat(r.a, ",").concat(r.b, ",").concat(r.c, ",").concat(r.d, ",").concat(r.e, ",").concat(r.f, ")");
        Le(at, "webkitTransform", p), Le(at, "mozTransform", p), Le(at, "msTransform", p), Le(at, "transform", p), xh = d, Nh = f, qs = i;
      }
      t.cancelable && t.preventDefault();
    }
  },
  _appendGhost: function() {
    if (!at) {
      var t = this.options.fallbackOnBody ? document.body : nn, n = rn(Ne, !0, Uu, !0, t), s = this.options;
      if (Uu) {
        for (Bn = t; Le(Bn, "position") === "static" && Le(Bn, "transform") === "none" && Bn !== document; )
          Bn = Bn.parentNode;
        Bn !== document.body && Bn !== document.documentElement ? (Bn === document && (Bn = ko()), n.top += Bn.scrollTop, n.left += Bn.scrollLeft) : Bn = ko(), Ch = Ub(Bn);
      }
      at = Ne.cloneNode(!0), ln(at, s.ghostClass, !1), ln(at, s.fallbackClass, !0), ln(at, s.dragClass, !0), Le(at, "transition", ""), Le(at, "transform", ""), Le(at, "box-sizing", "border-box"), Le(at, "margin", 0), Le(at, "top", n.top), Le(at, "left", n.left), Le(at, "width", n.width), Le(at, "height", n.height), Le(at, "opacity", "0.8"), Le(at, "position", Uu ? "absolute" : "fixed"), Le(at, "zIndex", "100000"), Le(at, "pointerEvents", "none"), Je.ghost = at, t.appendChild(at), Le(at, "transform-origin", Bb / parseInt(at.style.width) * 100 + "% " + Hb / parseInt(at.style.height) * 100 + "%");
    }
  },
  _onDragStart: function(t, n) {
    var s = this, o = t.dataTransfer, i = s.options;
    if (ms("dragStart", this, {
      evt: t
    }), Je.eventCanceled) {
      this._onDrop();
      return;
    }
    ms("setupClone", this), Je.eventCanceled || (dn = Qg(Ne), dn.draggable = !1, dn.style["will-change"] = "", this._hideClone(), ln(dn, this.options.chosenClass, !1), Je.clone = dn), s.cloneId = xd(function() {
      ms("clone", s), !Je.eventCanceled && (s.options.removeCloneOnHide || nn.insertBefore(dn, Ne), s._hideClone(), os({
        sortable: s,
        name: "clone"
      }));
    }), !n && ln(Ne, i.dragClass, !0), n ? (cf = !0, s._loopId = setInterval(s._emulateDragOver, 50)) : (ht(document, "mouseup", s._onDrop), ht(document, "touchend", s._onDrop), ht(document, "touchcancel", s._onDrop), o && (o.effectAllowed = "move", i.setData && i.setData.call(s, o, Ne)), yt(document, "drop", s), Le(Ne, "transform", "translateZ(0)")), Oa = !0, s._dragStartId = xd(s._dragStarted.bind(s, n, t)), yt(document, "selectstart", s), zl = !0, lc && Le(document.body, "user-select", "none");
  },
  // Returns true - if no further action is needed (either inserted or another condition)
  _onDragOver: function(t) {
    var n = this.el, s = t.target, o, i, r, a = this.options, l = a.group, u = Je.active, d = Vu === l, f = a.sort, p = Vn || u, h, m = this, v = !1;
    if (zm) return;
    function _(q, re) {
      ms(q, m, Vo({
        evt: t,
        isOwner: d,
        axis: h ? "vertical" : "horizontal",
        revert: r,
        dragRect: o,
        targetRect: i,
        canSort: f,
        fromSortable: p,
        target: s,
        completed: w,
        onMove: function(ze, We) {
          return ju(nn, n, Ne, o, ze, rn(ze), t, We);
        },
        changed: y
      }, re));
    }
    function b() {
      _("dragOverAnimationCapture"), m.captureAnimationState(), m !== p && p.captureAnimationState();
    }
    function w(q) {
      return _("dragOverCompleted", {
        insertion: q
      }), q && (d ? u._hideClone() : u._showClone(m), m !== p && (ln(Ne, Vn ? Vn.options.ghostClass : u.options.ghostClass, !1), ln(Ne, a.ghostClass, !0)), Vn !== m && m !== Je.active ? Vn = m : m === Je.active && Vn && (Vn = null), p === m && (m._ignoreWhileAnimating = s), m.animateAll(function() {
        _("dragOverAnimationComplete"), m._ignoreWhileAnimating = null;
      }), m !== p && (p.animateAll(), p._ignoreWhileAnimating = null)), (s === Ne && !Ne.animated || s === n && !s.animated) && (Sa = null), !a.dragoverBubble && !t.rootEl && s !== document && (Ne.parentNode[Xn]._isOutsideThisEl(t.target), !q && gi(t)), !a.dragoverBubble && t.stopPropagation && t.stopPropagation(), v = !0;
    }
    function y() {
      Ts = fn(Ne), Ur = fn(Ne, a.draggable), os({
        sortable: m,
        name: "change",
        toEl: n,
        newIndex: Ts,
        newDraggableIndex: Ur,
        originalEvent: t
      });
    }
    if (t.preventDefault !== void 0 && t.cancelable && t.preventDefault(), s = eo(s, a.draggable, n, !0), _("dragOver"), Je.eventCanceled) return v;
    if (Ne.contains(t.target) || s.animated && s.animatingX && s.animatingY || m._ignoreWhileAnimating === s)
      return w(!1);
    if (cf = !1, u && !a.disabled && (d ? f || (r = un !== nn) : Vn === this || (this.lastPutMode = Vu.checkPull(this, u, Ne, t)) && l.checkPut(this, u, Ne, t))) {
      if (h = this._getDirection(t, s) === "vertical", o = rn(Ne), _("dragOverValid"), Je.eventCanceled) return v;
      if (r)
        return un = nn, b(), this._hideClone(), _("revert"), Je.eventCanceled || (wi ? nn.insertBefore(Ne, wi) : nn.appendChild(Ne)), w(!0);
      var x = Jg(n, a.draggable);
      if (!x || UG(t, h, this) && !x.animated) {
        if (x === Ne)
          return w(!1);
        if (x && n === t.target && (s = x), s && (i = rn(s)), ju(nn, n, Ne, o, s, i, t, !!s) !== !1)
          return b(), n.appendChild(Ne), un = n, y(), w(!0);
      } else if (x && FG(t, h, this)) {
        var N = rl(n, 0, a, !0);
        if (N === Ne)
          return w(!1);
        if (s = N, i = rn(s), ju(nn, n, Ne, o, s, i, t, !1) !== !1)
          return b(), n.insertBefore(Ne, N), un = n, y(), w(!0);
      } else if (s.parentNode === n) {
        i = rn(s);
        var S = 0, O, $ = Ne.parentNode !== n, T = !AG(Ne.animated && Ne.toRect || o, s.animated && s.toRect || i, h), R = h ? "top" : "left", P = Fb(s, "top", "top") || Fb(Ne, "top", "top"), M = P ? P.scrollTop : void 0;
        Sa !== s && (O = i[R], pc = !1, Fu = !T && a.invertSwap || $), S = jG(t, s, i, h, T ? 1 : a.swapThreshold, a.invertedSwapThreshold == null ? a.swapThreshold : a.invertedSwapThreshold, Fu, Sa === s);
        var U;
        if (S !== 0) {
          var H = fn(Ne);
          do
            H -= S, U = un.children[H];
          while (U && (Le(U, "display") === "none" || U === at));
        }
        if (S === 0 || U === s)
          return w(!1);
        Sa = s, fc = S;
        var j = s.nextElementSibling, V = !1;
        V = S === 1;
        var K = ju(nn, n, Ne, o, s, i, t, V);
        if (K !== !1)
          return (K === 1 || K === -1) && (V = K === 1), zm = !0, setTimeout(VG, 30), b(), V && !j ? n.appendChild(Ne) : s.parentNode.insertBefore(Ne, V ? j : s), P && dN(P, 0, M - P.scrollTop), un = Ne.parentNode, O !== void 0 && !Fu && (Sd = Math.abs(O - rn(s)[R])), y(), w(!0);
      }
      if (n.contains(Ne))
        return w(!1);
    }
    return !1;
  },
  _ignoreWhileAnimating: null,
  _offMoveEvents: function() {
    ht(document, "mousemove", this._onTouchMove), ht(document, "touchmove", this._onTouchMove), ht(document, "pointermove", this._onTouchMove), ht(document, "dragover", gi), ht(document, "mousemove", gi), ht(document, "touchmove", gi);
  },
  _offUpEvents: function() {
    var t = this.el.ownerDocument;
    ht(t, "mouseup", this._onDrop), ht(t, "touchend", this._onDrop), ht(t, "pointerup", this._onDrop), ht(t, "touchcancel", this._onDrop), ht(document, "selectstart", this);
  },
  _onDrop: function(t) {
    var n = this.el, s = this.options;
    if (Ts = fn(Ne), Ur = fn(Ne, s.draggable), ms("drop", this, {
      evt: t
    }), un = Ne && Ne.parentNode, Ts = fn(Ne), Ur = fn(Ne, s.draggable), Je.eventCanceled) {
      this._nulling();
      return;
    }
    Oa = !1, Fu = !1, pc = !1, clearInterval(this._loopId), clearTimeout(this._dragStartTimer), Km(this.cloneId), Km(this._dragStartId), this.nativeDraggable && (ht(document, "drop", this), ht(n, "dragstart", this._onDragStart)), this._offMoveEvents(), this._offUpEvents(), lc && Le(document.body, "user-select", ""), Le(Ne, "transform", ""), t && (zl && (t.cancelable && t.preventDefault(), !s.dropBubble && t.stopPropagation()), at && at.parentNode && at.parentNode.removeChild(at), (nn === un || Vn && Vn.lastPutMode !== "clone") && dn && dn.parentNode && dn.parentNode.removeChild(dn), Ne && (this.nativeDraggable && ht(Ne, "dragend", this), Oh(Ne), Ne.style["will-change"] = "", zl && !Oa && ln(Ne, Vn ? Vn.options.ghostClass : this.options.ghostClass, !1), ln(Ne, this.options.chosenClass, !1), os({
      sortable: this,
      name: "unchoose",
      toEl: un,
      newIndex: null,
      newDraggableIndex: null,
      originalEvent: t
    }), nn !== un ? (Ts >= 0 && (os({
      rootEl: un,
      name: "add",
      toEl: un,
      fromEl: nn,
      originalEvent: t
    }), os({
      sortable: this,
      name: "remove",
      toEl: un,
      originalEvent: t
    }), os({
      rootEl: un,
      name: "sort",
      toEl: un,
      fromEl: nn,
      originalEvent: t
    }), os({
      sortable: this,
      name: "sort",
      toEl: un,
      originalEvent: t
    })), Vn && Vn.save()) : Ts !== Da && Ts >= 0 && (os({
      sortable: this,
      name: "update",
      toEl: un,
      originalEvent: t
    }), os({
      sortable: this,
      name: "sort",
      toEl: un,
      originalEvent: t
    })), Je.active && ((Ts == null || Ts === -1) && (Ts = Da, Ur = dc), os({
      sortable: this,
      name: "end",
      toEl: un,
      originalEvent: t
    }), this.save()))), this._nulling();
  },
  _nulling: function() {
    ms("nulling", this), nn = Ne = un = at = wi = dn = wd = Br = vi = qs = zl = Ts = Ur = Da = dc = Sa = fc = Vn = Vu = Je.dragged = Je.ghost = Je.clone = Je.active = null, df.forEach(function(t) {
      t.checked = !0;
    }), df.length = xh = Nh = 0;
  },
  handleEvent: function(t) {
    switch (t.type) {
      case "drop":
      case "dragend":
        this._onDrop(t);
        break;
      case "dragenter":
      case "dragover":
        Ne && (this._onDragOver(t), LG(t));
        break;
      case "selectstart":
        t.preventDefault();
        break;
    }
  },
  /**
   * Serializes the item into an array of string.
   * @returns {String[]}
   */
  toArray: function() {
    for (var t = [], n, s = this.el.children, o = 0, i = s.length, r = this.options; o < i; o++)
      n = s[o], eo(n, r.draggable, this.el, !1) && t.push(n.getAttribute(r.dataIdAttr) || HG(n));
    return t;
  },
  /**
   * Sorts the elements according to the array.
   * @param  {String[]}  order  order of the items
   */
  sort: function(t, n) {
    var s = {}, o = this.el;
    this.toArray().forEach(function(i, r) {
      var a = o.children[r];
      eo(a, this.options.draggable, o, !1) && (s[i] = a);
    }, this), n && this.captureAnimationState(), t.forEach(function(i) {
      s[i] && (o.removeChild(s[i]), o.appendChild(s[i]));
    }), n && this.animateAll();
  },
  /**
   * Save the current sorting
   */
  save: function() {
    var t = this.options.store;
    t && t.set && t.set(this);
  },
  /**
   * For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree.
   * @param   {HTMLElement}  el
   * @param   {String}       [selector]  default: `options.draggable`
   * @returns {HTMLElement|null}
   */
  closest: function(t, n) {
    return eo(t, n || this.options.draggable, this.el, !1);
  },
  /**
   * Set/get option
   * @param   {string} name
   * @param   {*}      [value]
   * @returns {*}
   */
  option: function(t, n) {
    var s = this.options;
    if (n === void 0)
      return s[t];
    var o = du.modifyOption(this, t, n);
    typeof o < "u" ? s[t] = o : s[t] = n, t === "group" && hN(s);
  },
  /**
   * Destroy
   */
  destroy: function() {
    ms("destroy", this);
    var t = this.el;
    t[Xn] = null, ht(t, "mousedown", this._onTapStart), ht(t, "touchstart", this._onTapStart), ht(t, "pointerdown", this._onTapStart), this.nativeDraggable && (ht(t, "dragover", this), ht(t, "dragenter", this)), Array.prototype.forEach.call(t.querySelectorAll("[draggable]"), function(n) {
      n.removeAttribute("draggable");
    }), this._onDrop(), this._disableDelayedDragEvents(), uf.splice(uf.indexOf(this.el), 1), this.el = t = null;
  },
  _hideClone: function() {
    if (!Br) {
      if (ms("hideClone", this), Je.eventCanceled) return;
      Le(dn, "display", "none"), this.options.removeCloneOnHide && dn.parentNode && dn.parentNode.removeChild(dn), Br = !0;
    }
  },
  _showClone: function(t) {
    if (t.lastPutMode !== "clone") {
      this._hideClone();
      return;
    }
    if (Br) {
      if (ms("showClone", this), Je.eventCanceled) return;
      Ne.parentNode == nn && !this.options.group.revertClone ? nn.insertBefore(dn, Ne) : wi ? nn.insertBefore(dn, wi) : nn.appendChild(dn), this.options.group.revertClone && this.animate(Ne, dn), Le(dn, "display", ""), Br = !1;
    }
  }
};
function LG(e) {
  e.dataTransfer && (e.dataTransfer.dropEffect = "move"), e.cancelable && e.preventDefault();
}
function ju(e, t, n, s, o, i, r, a) {
  var l, u = e[Xn], d = u.options.onMove, f;
  return window.CustomEvent && !Cr && !uu ? l = new CustomEvent("move", {
    bubbles: !0,
    cancelable: !0
  }) : (l = document.createEvent("Event"), l.initEvent("move", !0, !0)), l.to = t, l.from = e, l.dragged = n, l.draggedRect = s, l.related = o || t, l.relatedRect = i || rn(t), l.willInsertAfter = a, l.originalEvent = r, e.dispatchEvent(l), d && (f = d.call(u, l, r)), f;
}
function Oh(e) {
  e.draggable = !1;
}
function VG() {
  zm = !1;
}
function FG(e, t, n) {
  var s = rn(rl(n.el, 0, n.options, !0)), o = 10;
  return t ? e.clientX < s.left - o || e.clientY < s.top && e.clientX < s.right : e.clientY < s.top - o || e.clientY < s.bottom && e.clientX < s.left;
}
function UG(e, t, n) {
  var s = rn(Jg(n.el, n.options.draggable)), o = 10;
  return t ? e.clientX > s.right + o || e.clientX <= s.right && e.clientY > s.bottom && e.clientX >= s.left : e.clientX > s.right && e.clientY > s.top || e.clientX <= s.right && e.clientY > s.bottom + o;
}
function jG(e, t, n, s, o, i, r, a) {
  var l = s ? e.clientY : e.clientX, u = s ? n.height : n.width, d = s ? n.top : n.left, f = s ? n.bottom : n.right, p = !1;
  if (!r) {
    if (a && Sd < u * o) {
      if (!pc && (fc === 1 ? l > d + u * i / 2 : l < f - u * i / 2) && (pc = !0), pc)
        p = !0;
      else if (fc === 1 ? l < d + Sd : l > f - Sd)
        return -fc;
    } else if (l > d + u * (1 - o) / 2 && l < f - u * (1 - o) / 2)
      return BG(t);
  }
  return p = p || r, p && (l < d + u * i / 2 || l > f - u * i / 2) ? l > d + u / 2 ? 1 : -1 : 0;
}
function BG(e) {
  return fn(Ne) < fn(e) ? 1 : -1;
}
function HG(e) {
  for (var t = e.tagName + e.className + e.src + e.href + e.textContent, n = t.length, s = 0; n--; )
    s += t.charCodeAt(n);
  return s.toString(36);
}
function YG(e) {
  df.length = 0;
  for (var t = e.getElementsByTagName("input"), n = t.length; n--; ) {
    var s = t[n];
    s.checked && df.push(s);
  }
}
function xd(e) {
  return setTimeout(e, 0);
}
function Km(e) {
  return clearTimeout(e);
}
Op && yt(document, "touchmove", function(e) {
  (Je.active || Oa) && e.cancelable && e.preventDefault();
});
Je.utils = {
  on: yt,
  off: ht,
  css: Le,
  find: cN,
  is: function(t, n) {
    return !!eo(t, n, t, !1);
  },
  extend: OG,
  throttle: uN,
  closest: eo,
  toggleClass: ln,
  clone: Qg,
  index: fn,
  nextTick: xd,
  cancelNextTick: Km,
  detectDirection: pN,
  getChild: rl
};
Je.get = function(e) {
  return e[Xn];
};
Je.mount = function() {
  for (var e = arguments.length, t = new Array(e), n = 0; n < e; n++)
    t[n] = arguments[n];
  t[0].constructor === Array && (t = t[0]), t.forEach(function(s) {
    if (!s.prototype || !s.prototype.constructor)
      throw "Sortable: Mounted plugin must be a constructor function, not ".concat({}.toString.call(s));
    s.utils && (Je.utils = Vo(Vo({}, Je.utils), s.utils)), du.mount(s);
  });
};
Je.create = function(e, t) {
  return new Je(e, t);
};
Je.version = SG;
var Sn = [], Kl, Xm, qm = !1, Th, $h, ff, Xl;
function WG() {
  function e() {
    this.defaults = {
      scroll: !0,
      forceAutoScrollFallback: !1,
      scrollSensitivity: 30,
      scrollSpeed: 10,
      bubbleScroll: !0
    };
    for (var t in this)
      t.charAt(0) === "_" && typeof this[t] == "function" && (this[t] = this[t].bind(this));
  }
  return e.prototype = {
    dragStarted: function(n) {
      var s = n.originalEvent;
      this.sortable.nativeDraggable ? yt(document, "dragover", this._handleAutoScroll) : this.options.supportPointer ? yt(document, "pointermove", this._handleFallbackAutoScroll) : s.touches ? yt(document, "touchmove", this._handleFallbackAutoScroll) : yt(document, "mousemove", this._handleFallbackAutoScroll);
    },
    dragOverCompleted: function(n) {
      var s = n.originalEvent;
      !this.options.dragOverBubble && !s.rootEl && this._handleAutoScroll(s);
    },
    drop: function() {
      this.sortable.nativeDraggable ? ht(document, "dragover", this._handleAutoScroll) : (ht(document, "pointermove", this._handleFallbackAutoScroll), ht(document, "touchmove", this._handleFallbackAutoScroll), ht(document, "mousemove", this._handleFallbackAutoScroll)), Wb(), Nd(), TG();
    },
    nulling: function() {
      ff = Xm = Kl = qm = Xl = Th = $h = null, Sn.length = 0;
    },
    _handleFallbackAutoScroll: function(n) {
      this._handleAutoScroll(n, !0);
    },
    _handleAutoScroll: function(n, s) {
      var o = this, i = (n.touches ? n.touches[0] : n).clientX, r = (n.touches ? n.touches[0] : n).clientY, a = document.elementFromPoint(i, r);
      if (ff = n, s || this.options.forceAutoScrollFallback || uu || Cr || lc) {
        kh(n, this.options, a, s);
        var l = zr(a, !0);
        qm && (!Xl || i !== Th || r !== $h) && (Xl && Wb(), Xl = setInterval(function() {
          var u = zr(document.elementFromPoint(i, r), !0);
          u !== l && (l = u, Nd()), kh(n, o.options, u, s);
        }, 10), Th = i, $h = r);
      } else {
        if (!this.options.bubbleScroll || zr(a, !0) === ko()) {
          Nd();
          return;
        }
        kh(n, this.options, zr(a, !1), !1);
      }
    }
  }, zs(e, {
    pluginName: "scroll",
    initializeByDefault: !0
  });
}
function Nd() {
  Sn.forEach(function(e) {
    clearInterval(e.pid);
  }), Sn = [];
}
function Wb() {
  clearInterval(Xl);
}
var kh = uN(function(e, t, n, s) {
  if (t.scroll) {
    var o = (e.touches ? e.touches[0] : e).clientX, i = (e.touches ? e.touches[0] : e).clientY, r = t.scrollSensitivity, a = t.scrollSpeed, l = ko(), u = !1, d;
    Xm !== n && (Xm = n, Nd(), Kl = t.scroll, d = t.scrollFn, Kl === !0 && (Kl = zr(n, !0)));
    var f = 0, p = Kl;
    do {
      var h = p, m = rn(h), v = m.top, _ = m.bottom, b = m.left, w = m.right, y = m.width, x = m.height, N = void 0, S = void 0, O = h.scrollWidth, $ = h.scrollHeight, T = Le(h), R = h.scrollLeft, P = h.scrollTop;
      h === l ? (N = y < O && (T.overflowX === "auto" || T.overflowX === "scroll" || T.overflowX === "visible"), S = x < $ && (T.overflowY === "auto" || T.overflowY === "scroll" || T.overflowY === "visible")) : (N = y < O && (T.overflowX === "auto" || T.overflowX === "scroll"), S = x < $ && (T.overflowY === "auto" || T.overflowY === "scroll"));
      var M = N && (Math.abs(w - o) <= r && R + y < O) - (Math.abs(b - o) <= r && !!R), U = S && (Math.abs(_ - i) <= r && P + x < $) - (Math.abs(v - i) <= r && !!P);
      if (!Sn[f])
        for (var H = 0; H <= f; H++)
          Sn[H] || (Sn[H] = {});
      (Sn[f].vx != M || Sn[f].vy != U || Sn[f].el !== h) && (Sn[f].el = h, Sn[f].vx = M, Sn[f].vy = U, clearInterval(Sn[f].pid), (M != 0 || U != 0) && (u = !0, Sn[f].pid = setInterval((function() {
        s && this.layer === 0 && Je.active._onTouchMove(ff);
        var j = Sn[this.layer].vy ? Sn[this.layer].vy * a : 0, V = Sn[this.layer].vx ? Sn[this.layer].vx * a : 0;
        typeof d == "function" && d.call(Je.dragged.parentNode[Xn], V, j, e, ff, Sn[this.layer].el) !== "continue" || dN(Sn[this.layer].el, V, j);
      }).bind({
        layer: f
      }), 24))), f++;
    } while (t.bubbleScroll && p !== l && (p = zr(p, !1)));
    qm = u;
  }
}, 30), gN = function(t) {
  var n = t.originalEvent, s = t.putSortable, o = t.dragEl, i = t.activeSortable, r = t.dispatchSortableEvent, a = t.hideGhostForTarget, l = t.unhideGhostForTarget;
  if (n) {
    var u = s || i;
    a();
    var d = n.changedTouches && n.changedTouches.length ? n.changedTouches[0] : n, f = document.elementFromPoint(d.clientX, d.clientY);
    l(), u && !u.el.contains(f) && (r("spill"), this.onSpill({
      dragEl: o,
      putSortable: s
    }));
  }
};
function Zg() {
}
Zg.prototype = {
  startIndex: null,
  dragStart: function(t) {
    var n = t.oldDraggableIndex;
    this.startIndex = n;
  },
  onSpill: function(t) {
    var n = t.dragEl, s = t.putSortable;
    this.sortable.captureAnimationState(), s && s.captureAnimationState();
    var o = rl(this.sortable.el, this.startIndex, this.options);
    o ? this.sortable.el.insertBefore(n, o) : this.sortable.el.appendChild(n), this.sortable.animateAll(), s && s.animateAll();
  },
  drop: gN
};
zs(Zg, {
  pluginName: "revertOnSpill"
});
function e_() {
}
e_.prototype = {
  onSpill: function(t) {
    var n = t.dragEl, s = t.putSortable, o = s || this.sortable;
    o.captureAnimationState(), n.parentNode && n.parentNode.removeChild(n), o.animateAll();
  },
  drop: gN
};
zs(e_, {
  pluginName: "removeOnSpill"
});
var Ms;
function GG() {
  function e() {
    this.defaults = {
      swapClass: "sortable-swap-highlight"
    };
  }
  return e.prototype = {
    dragStart: function(n) {
      var s = n.dragEl;
      Ms = s;
    },
    dragOverValid: function(n) {
      var s = n.completed, o = n.target, i = n.onMove, r = n.activeSortable, a = n.changed, l = n.cancel;
      if (r.options.swap) {
        var u = this.sortable.el, d = this.options;
        if (o && o !== u) {
          var f = Ms;
          i(o) !== !1 ? (ln(o, d.swapClass, !0), Ms = o) : Ms = null, f && f !== Ms && ln(f, d.swapClass, !1);
        }
        a(), s(!0), l();
      }
    },
    drop: function(n) {
      var s = n.activeSortable, o = n.putSortable, i = n.dragEl, r = o || this.sortable, a = this.options;
      Ms && ln(Ms, a.swapClass, !1), Ms && (a.swap || o && o.options.swap) && i !== Ms && (r.captureAnimationState(), r !== s && s.captureAnimationState(), zG(i, Ms), r.animateAll(), r !== s && s.animateAll());
    },
    nulling: function() {
      Ms = null;
    }
  }, zs(e, {
    pluginName: "swap",
    eventProperties: function() {
      return {
        swapItem: Ms
      };
    }
  });
}
function zG(e, t) {
  var n = e.parentNode, s = t.parentNode, o, i;
  !n || !s || n.isEqualNode(t) || s.isEqualNode(e) || (o = fn(e), i = fn(t), n.isEqualNode(s) && o < i && i++, n.insertBefore(t, n.children[o]), s.insertBefore(e, s.children[i]));
}
var ot = [], Os = [], Pl, Js, Ll = !1, vs = !1, xa = !1, Xt, Vl, Bu;
function KG() {
  function e(t) {
    for (var n in this)
      n.charAt(0) === "_" && typeof this[n] == "function" && (this[n] = this[n].bind(this));
    t.options.supportPointer ? yt(document, "pointerup", this._deselectMultiDrag) : (yt(document, "mouseup", this._deselectMultiDrag), yt(document, "touchend", this._deselectMultiDrag)), yt(document, "keydown", this._checkKeyDown), yt(document, "keyup", this._checkKeyUp), this.defaults = {
      selectedClass: "sortable-selected",
      multiDragKey: null,
      setData: function(o, i) {
        var r = "";
        ot.length && Js === t ? ot.forEach(function(a, l) {
          r += (l ? ", " : "") + a.textContent;
        }) : r = i.textContent, o.setData("Text", r);
      }
    };
  }
  return e.prototype = {
    multiDragKeyDown: !1,
    isMultiDrag: !1,
    delayStartGlobal: function(n) {
      var s = n.dragEl;
      Xt = s;
    },
    delayEnded: function() {
      this.isMultiDrag = ~ot.indexOf(Xt);
    },
    setupClone: function(n) {
      var s = n.sortable, o = n.cancel;
      if (this.isMultiDrag) {
        for (var i = 0; i < ot.length; i++)
          Os.push(Qg(ot[i])), Os[i].sortableIndex = ot[i].sortableIndex, Os[i].draggable = !1, Os[i].style["will-change"] = "", ln(Os[i], this.options.selectedClass, !1), ot[i] === Xt && ln(Os[i], this.options.chosenClass, !1);
        s._hideClone(), o();
      }
    },
    clone: function(n) {
      var s = n.sortable, o = n.rootEl, i = n.dispatchSortableEvent, r = n.cancel;
      this.isMultiDrag && (this.options.removeCloneOnHide || ot.length && Js === s && (Gb(!0, o), i("clone"), r()));
    },
    showClone: function(n) {
      var s = n.cloneNowShown, o = n.rootEl, i = n.cancel;
      this.isMultiDrag && (Gb(!1, o), Os.forEach(function(r) {
        Le(r, "display", "");
      }), s(), Bu = !1, i());
    },
    hideClone: function(n) {
      var s = this;
      n.sortable;
      var o = n.cloneNowHidden, i = n.cancel;
      this.isMultiDrag && (Os.forEach(function(r) {
        Le(r, "display", "none"), s.options.removeCloneOnHide && r.parentNode && r.parentNode.removeChild(r);
      }), o(), Bu = !0, i());
    },
    dragStartGlobal: function(n) {
      n.sortable, !this.isMultiDrag && Js && Js.multiDrag._deselectMultiDrag(), ot.forEach(function(s) {
        s.sortableIndex = fn(s);
      }), ot = ot.sort(function(s, o) {
        return s.sortableIndex - o.sortableIndex;
      }), xa = !0;
    },
    dragStarted: function(n) {
      var s = this, o = n.sortable;
      if (this.isMultiDrag) {
        if (this.options.sort && (o.captureAnimationState(), this.options.animation)) {
          ot.forEach(function(r) {
            r !== Xt && Le(r, "position", "absolute");
          });
          var i = rn(Xt, !1, !0, !0);
          ot.forEach(function(r) {
            r !== Xt && jb(r, i);
          }), vs = !0, Ll = !0;
        }
        o.animateAll(function() {
          vs = !1, Ll = !1, s.options.animation && ot.forEach(function(r) {
            wh(r);
          }), s.options.sort && Hu();
        });
      }
    },
    dragOver: function(n) {
      var s = n.target, o = n.completed, i = n.cancel;
      vs && ~ot.indexOf(s) && (o(!1), i());
    },
    revert: function(n) {
      var s = n.fromSortable, o = n.rootEl, i = n.sortable, r = n.dragRect;
      ot.length > 1 && (ot.forEach(function(a) {
        i.addAnimationState({
          target: a,
          rect: vs ? rn(a) : r
        }), wh(a), a.fromRect = r, s.removeAnimationState(a);
      }), vs = !1, XG(!this.options.removeCloneOnHide, o));
    },
    dragOverCompleted: function(n) {
      var s = n.sortable, o = n.isOwner, i = n.insertion, r = n.activeSortable, a = n.parentEl, l = n.putSortable, u = this.options;
      if (i) {
        if (o && r._hideClone(), Ll = !1, u.animation && ot.length > 1 && (vs || !o && !r.options.sort && !l)) {
          var d = rn(Xt, !1, !0, !0);
          ot.forEach(function(p) {
            p !== Xt && (jb(p, d), a.appendChild(p));
          }), vs = !0;
        }
        if (!o)
          if (vs || Hu(), ot.length > 1) {
            var f = Bu;
            r._showClone(s), r.options.animation && !Bu && f && Os.forEach(function(p) {
              r.addAnimationState({
                target: p,
                rect: Vl
              }), p.fromRect = Vl, p.thisAnimationDuration = null;
            });
          } else
            r._showClone(s);
      }
    },
    dragOverAnimationCapture: function(n) {
      var s = n.dragRect, o = n.isOwner, i = n.activeSortable;
      if (ot.forEach(function(a) {
        a.thisAnimationDuration = null;
      }), i.options.animation && !o && i.multiDrag.isMultiDrag) {
        Vl = zs({}, s);
        var r = Fi(Xt, !0);
        Vl.top -= r.f, Vl.left -= r.e;
      }
    },
    dragOverAnimationComplete: function() {
      vs && (vs = !1, Hu());
    },
    drop: function(n) {
      var s = n.originalEvent, o = n.rootEl, i = n.parentEl, r = n.sortable, a = n.dispatchSortableEvent, l = n.oldIndex, u = n.putSortable, d = u || this.sortable;
      if (s) {
        var f = this.options, p = i.children;
        if (!xa)
          if (f.multiDragKey && !this.multiDragKeyDown && this._deselectMultiDrag(), ln(Xt, f.selectedClass, !~ot.indexOf(Xt)), ~ot.indexOf(Xt))
            ot.splice(ot.indexOf(Xt), 1), Pl = null, Gl({
              sortable: r,
              rootEl: o,
              name: "deselect",
              targetEl: Xt
            });
          else {
            if (ot.push(Xt), Gl({
              sortable: r,
              rootEl: o,
              name: "select",
              targetEl: Xt
            }), s.shiftKey && Pl && r.el.contains(Pl)) {
              var h = fn(Pl), m = fn(Xt);
              if (~h && ~m && h !== m) {
                var v, _;
                for (m > h ? (_ = h, v = m) : (_ = m, v = h + 1); _ < v; _++)
                  ~ot.indexOf(p[_]) || (ln(p[_], f.selectedClass, !0), ot.push(p[_]), Gl({
                    sortable: r,
                    rootEl: o,
                    name: "select",
                    targetEl: p[_]
                  }));
              }
            } else
              Pl = Xt;
            Js = d;
          }
        if (xa && this.isMultiDrag) {
          if (vs = !1, (i[Xn].options.sort || i !== o) && ot.length > 1) {
            var b = rn(Xt), w = fn(Xt, ":not(." + this.options.selectedClass + ")");
            if (!Ll && f.animation && (Xt.thisAnimationDuration = null), d.captureAnimationState(), !Ll && (f.animation && (Xt.fromRect = b, ot.forEach(function(x) {
              if (x.thisAnimationDuration = null, x !== Xt) {
                var N = vs ? rn(x) : b;
                x.fromRect = N, d.addAnimationState({
                  target: x,
                  rect: N
                });
              }
            })), Hu(), ot.forEach(function(x) {
              p[w] ? i.insertBefore(x, p[w]) : i.appendChild(x), w++;
            }), l === fn(Xt))) {
              var y = !1;
              ot.forEach(function(x) {
                if (x.sortableIndex !== fn(x)) {
                  y = !0;
                  return;
                }
              }), y && a("update");
            }
            ot.forEach(function(x) {
              wh(x);
            }), d.animateAll();
          }
          Js = d;
        }
        (o === i || u && u.lastPutMode !== "clone") && Os.forEach(function(x) {
          x.parentNode && x.parentNode.removeChild(x);
        });
      }
    },
    nullingGlobal: function() {
      this.isMultiDrag = xa = !1, Os.length = 0;
    },
    destroyGlobal: function() {
      this._deselectMultiDrag(), ht(document, "pointerup", this._deselectMultiDrag), ht(document, "mouseup", this._deselectMultiDrag), ht(document, "touchend", this._deselectMultiDrag), ht(document, "keydown", this._checkKeyDown), ht(document, "keyup", this._checkKeyUp);
    },
    _deselectMultiDrag: function(n) {
      if (!(typeof xa < "u" && xa) && Js === this.sortable && !(n && eo(n.target, this.options.draggable, this.sortable.el, !1)) && !(n && n.button !== 0))
        for (; ot.length; ) {
          var s = ot[0];
          ln(s, this.options.selectedClass, !1), ot.shift(), Gl({
            sortable: this.sortable,
            rootEl: this.sortable.el,
            name: "deselect",
            targetEl: s
          });
        }
    },
    _checkKeyDown: function(n) {
      n.key === this.options.multiDragKey && (this.multiDragKeyDown = !0);
    },
    _checkKeyUp: function(n) {
      n.key === this.options.multiDragKey && (this.multiDragKeyDown = !1);
    }
  }, zs(e, {
    // Static methods & properties
    pluginName: "multiDrag",
    utils: {
      /**
       * Selects the provided multi-drag item
       * @param  {HTMLElement} el    The element to be selected
       */
      select: function(n) {
        var s = n.parentNode[Xn];
        !s || !s.options.multiDrag || ~ot.indexOf(n) || (Js && Js !== s && (Js.multiDrag._deselectMultiDrag(), Js = s), ln(n, s.options.selectedClass, !0), ot.push(n));
      },
      /**
       * Deselects the provided multi-drag item
       * @param  {HTMLElement} el    The element to be deselected
       */
      deselect: function(n) {
        var s = n.parentNode[Xn], o = ot.indexOf(n);
        !s || !s.options.multiDrag || !~o || (ln(n, s.options.selectedClass, !1), ot.splice(o, 1));
      }
    },
    eventProperties: function() {
      var n = this, s = [], o = [];
      return ot.forEach(function(i) {
        s.push({
          multiDragElement: i,
          index: i.sortableIndex
        });
        var r;
        vs && i !== Xt ? r = -1 : vs ? r = fn(i, ":not(." + n.options.selectedClass + ")") : r = fn(i), o.push({
          multiDragElement: i,
          index: r
        });
      }), {
        items: _G(ot),
        clones: [].concat(Os),
        oldIndicies: s,
        newIndicies: o
      };
    },
    optionListeners: {
      multiDragKey: function(n) {
        return n = n.toLowerCase(), n === "ctrl" ? n = "Control" : n.length > 1 && (n = n.charAt(0).toUpperCase() + n.substr(1)), n;
      }
    }
  });
}
function XG(e, t) {
  ot.forEach(function(n, s) {
    var o = t.children[n.sortableIndex + (e ? Number(s) : 0)];
    o ? t.insertBefore(n, o) : t.appendChild(n);
  });
}
function Gb(e, t) {
  Os.forEach(function(n, s) {
    var o = t.children[n.sortableIndex + (e ? Number(s) : 0)];
    o ? t.insertBefore(n, o) : t.appendChild(n);
  });
}
function Hu() {
  ot.forEach(function(e) {
    e !== Xt && e.parentNode && e.parentNode.removeChild(e);
  });
}
Je.mount(new WG());
Je.mount(e_, Zg);
const qG = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  MultiDrag: KG,
  Sortable: Je,
  Swap: GG,
  default: Je
}, Symbol.toStringTag, { value: "Module" })), JG = /* @__PURE__ */ lp(qG);
var QG = hd.exports, zb;
function ZG() {
  return zb || (zb = 1, function(e, t) {
    (function(s, o) {
      e.exports = o(hG(), JG);
    })(typeof self < "u" ? self : QG, function(n, s) {
      return (
        /******/
        function(o) {
          var i = {};
          function r(a) {
            if (i[a])
              return i[a].exports;
            var l = i[a] = {
              /******/
              i: a,
              /******/
              l: !1,
              /******/
              exports: {}
              /******/
            };
            return o[a].call(l.exports, l, l.exports, r), l.l = !0, l.exports;
          }
          return r.m = o, r.c = i, r.d = function(a, l, u) {
            r.o(a, l) || Object.defineProperty(a, l, { enumerable: !0, get: u });
          }, r.r = function(a) {
            typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(a, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(a, "__esModule", { value: !0 });
          }, r.t = function(a, l) {
            if (l & 1 && (a = r(a)), l & 8 || l & 4 && typeof a == "object" && a && a.__esModule) return a;
            var u = /* @__PURE__ */ Object.create(null);
            if (r.r(u), Object.defineProperty(u, "default", { enumerable: !0, value: a }), l & 2 && typeof a != "string") for (var d in a) r.d(u, d, (function(f) {
              return a[f];
            }).bind(null, d));
            return u;
          }, r.n = function(a) {
            var l = a && a.__esModule ? (
              /******/
              function() {
                return a.default;
              }
            ) : (
              /******/
              function() {
                return a;
              }
            );
            return r.d(l, "a", l), l;
          }, r.o = function(a, l) {
            return Object.prototype.hasOwnProperty.call(a, l);
          }, r.p = "", r(r.s = "fb15");
        }({
          /***/
          "00ee": (
            /***/
            function(o, i, r) {
              var a = r("b622"), l = a("toStringTag"), u = {};
              u[l] = "z", o.exports = String(u) === "[object z]";
            }
          ),
          /***/
          "0366": (
            /***/
            function(o, i, r) {
              var a = r("1c0b");
              o.exports = function(l, u, d) {
                if (a(l), u === void 0) return l;
                switch (d) {
                  case 0:
                    return function() {
                      return l.call(u);
                    };
                  case 1:
                    return function(f) {
                      return l.call(u, f);
                    };
                  case 2:
                    return function(f, p) {
                      return l.call(u, f, p);
                    };
                  case 3:
                    return function(f, p, h) {
                      return l.call(u, f, p, h);
                    };
                }
                return function() {
                  return l.apply(u, arguments);
                };
              };
            }
          ),
          /***/
          "057f": (
            /***/
            function(o, i, r) {
              var a = r("fc6a"), l = r("241c").f, u = {}.toString, d = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [], f = function(p) {
                try {
                  return l(p);
                } catch {
                  return d.slice();
                }
              };
              o.exports.f = function(h) {
                return d && u.call(h) == "[object Window]" ? f(h) : l(a(h));
              };
            }
          ),
          /***/
          "06cf": (
            /***/
            function(o, i, r) {
              var a = r("83ab"), l = r("d1e7"), u = r("5c6c"), d = r("fc6a"), f = r("c04e"), p = r("5135"), h = r("0cfb"), m = Object.getOwnPropertyDescriptor;
              i.f = a ? m : function(_, b) {
                if (_ = d(_), b = f(b, !0), h) try {
                  return m(_, b);
                } catch {
                }
                if (p(_, b)) return u(!l.f.call(_, b), _[b]);
              };
            }
          ),
          /***/
          "0cfb": (
            /***/
            function(o, i, r) {
              var a = r("83ab"), l = r("d039"), u = r("cc12");
              o.exports = !a && !l(function() {
                return Object.defineProperty(u("div"), "a", {
                  get: function() {
                    return 7;
                  }
                }).a != 7;
              });
            }
          ),
          /***/
          "13d5": (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("d58f").left, u = r("a640"), d = r("ae40"), f = u("reduce"), p = d("reduce", { 1: 0 });
              a({ target: "Array", proto: !0, forced: !f || !p }, {
                reduce: function(m) {
                  return l(this, m, arguments.length, arguments.length > 1 ? arguments[1] : void 0);
                }
              });
            }
          ),
          /***/
          "14c3": (
            /***/
            function(o, i, r) {
              var a = r("c6b6"), l = r("9263");
              o.exports = function(u, d) {
                var f = u.exec;
                if (typeof f == "function") {
                  var p = f.call(u, d);
                  if (typeof p != "object")
                    throw TypeError("RegExp exec method returned something other than an Object or null");
                  return p;
                }
                if (a(u) !== "RegExp")
                  throw TypeError("RegExp#exec called on incompatible receiver");
                return l.call(u, d);
              };
            }
          ),
          /***/
          "159b": (
            /***/
            function(o, i, r) {
              var a = r("da84"), l = r("fdbc"), u = r("17c2"), d = r("9112");
              for (var f in l) {
                var p = a[f], h = p && p.prototype;
                if (h && h.forEach !== u) try {
                  d(h, "forEach", u);
                } catch {
                  h.forEach = u;
                }
              }
            }
          ),
          /***/
          "17c2": (
            /***/
            function(o, i, r) {
              var a = r("b727").forEach, l = r("a640"), u = r("ae40"), d = l("forEach"), f = u("forEach");
              o.exports = !d || !f ? function(h) {
                return a(this, h, arguments.length > 1 ? arguments[1] : void 0);
              } : [].forEach;
            }
          ),
          /***/
          "1be4": (
            /***/
            function(o, i, r) {
              var a = r("d066");
              o.exports = a("document", "documentElement");
            }
          ),
          /***/
          "1c0b": (
            /***/
            function(o, i) {
              o.exports = function(r) {
                if (typeof r != "function")
                  throw TypeError(String(r) + " is not a function");
                return r;
              };
            }
          ),
          /***/
          "1c7e": (
            /***/
            function(o, i, r) {
              var a = r("b622"), l = a("iterator"), u = !1;
              try {
                var d = 0, f = {
                  next: function() {
                    return { done: !!d++ };
                  },
                  return: function() {
                    u = !0;
                  }
                };
                f[l] = function() {
                  return this;
                }, Array.from(f, function() {
                  throw 2;
                });
              } catch {
              }
              o.exports = function(p, h) {
                if (!h && !u) return !1;
                var m = !1;
                try {
                  var v = {};
                  v[l] = function() {
                    return {
                      next: function() {
                        return { done: m = !0 };
                      }
                    };
                  }, p(v);
                } catch {
                }
                return m;
              };
            }
          ),
          /***/
          "1d80": (
            /***/
            function(o, i) {
              o.exports = function(r) {
                if (r == null) throw TypeError("Can't call method on " + r);
                return r;
              };
            }
          ),
          /***/
          "1dde": (
            /***/
            function(o, i, r) {
              var a = r("d039"), l = r("b622"), u = r("2d00"), d = l("species");
              o.exports = function(f) {
                return u >= 51 || !a(function() {
                  var p = [], h = p.constructor = {};
                  return h[d] = function() {
                    return { foo: 1 };
                  }, p[f](Boolean).foo !== 1;
                });
              };
            }
          ),
          /***/
          "23cb": (
            /***/
            function(o, i, r) {
              var a = r("a691"), l = Math.max, u = Math.min;
              o.exports = function(d, f) {
                var p = a(d);
                return p < 0 ? l(p + f, 0) : u(p, f);
              };
            }
          ),
          /***/
          "23e7": (
            /***/
            function(o, i, r) {
              var a = r("da84"), l = r("06cf").f, u = r("9112"), d = r("6eeb"), f = r("ce4e"), p = r("e893"), h = r("94ca");
              o.exports = function(m, v) {
                var _ = m.target, b = m.global, w = m.stat, y, x, N, S, O, $;
                if (b ? x = a : w ? x = a[_] || f(_, {}) : x = (a[_] || {}).prototype, x) for (N in v) {
                  if (O = v[N], m.noTargetGet ? ($ = l(x, N), S = $ && $.value) : S = x[N], y = h(b ? N : _ + (w ? "." : "#") + N, m.forced), !y && S !== void 0) {
                    if (typeof O == typeof S) continue;
                    p(O, S);
                  }
                  (m.sham || S && S.sham) && u(O, "sham", !0), d(x, N, O, m);
                }
              };
            }
          ),
          /***/
          "241c": (
            /***/
            function(o, i, r) {
              var a = r("ca84"), l = r("7839"), u = l.concat("length", "prototype");
              i.f = Object.getOwnPropertyNames || function(f) {
                return a(f, u);
              };
            }
          ),
          /***/
          "25f0": (
            /***/
            function(o, i, r) {
              var a = r("6eeb"), l = r("825a"), u = r("d039"), d = r("ad6d"), f = "toString", p = RegExp.prototype, h = p[f], m = u(function() {
                return h.call({ source: "a", flags: "b" }) != "/a/b";
              }), v = h.name != f;
              (m || v) && a(RegExp.prototype, f, function() {
                var b = l(this), w = String(b.source), y = b.flags, x = String(y === void 0 && b instanceof RegExp && !("flags" in p) ? d.call(b) : y);
                return "/" + w + "/" + x;
              }, { unsafe: !0 });
            }
          ),
          /***/
          "2ca0": (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("06cf").f, u = r("50c4"), d = r("5a34"), f = r("1d80"), p = r("ab13"), h = r("c430"), m = "".startsWith, v = Math.min, _ = p("startsWith"), b = !h && !_ && !!function() {
                var w = l(String.prototype, "startsWith");
                return w && !w.writable;
              }();
              a({ target: "String", proto: !0, forced: !b && !_ }, {
                startsWith: function(y) {
                  var x = String(f(this));
                  d(y);
                  var N = u(v(arguments.length > 1 ? arguments[1] : void 0, x.length)), S = String(y);
                  return m ? m.call(x, S, N) : x.slice(N, N + S.length) === S;
                }
              });
            }
          ),
          /***/
          "2d00": (
            /***/
            function(o, i, r) {
              var a = r("da84"), l = r("342f"), u = a.process, d = u && u.versions, f = d && d.v8, p, h;
              f ? (p = f.split("."), h = p[0] + p[1]) : l && (p = l.match(/Edge\/(\d+)/), (!p || p[1] >= 74) && (p = l.match(/Chrome\/(\d+)/), p && (h = p[1]))), o.exports = h && +h;
            }
          ),
          /***/
          "342f": (
            /***/
            function(o, i, r) {
              var a = r("d066");
              o.exports = a("navigator", "userAgent") || "";
            }
          ),
          /***/
          "35a1": (
            /***/
            function(o, i, r) {
              var a = r("f5df"), l = r("3f8c"), u = r("b622"), d = u("iterator");
              o.exports = function(f) {
                if (f != null) return f[d] || f["@@iterator"] || l[a(f)];
              };
            }
          ),
          /***/
          "37e8": (
            /***/
            function(o, i, r) {
              var a = r("83ab"), l = r("9bf2"), u = r("825a"), d = r("df75");
              o.exports = a ? Object.defineProperties : function(p, h) {
                u(p);
                for (var m = d(h), v = m.length, _ = 0, b; v > _; ) l.f(p, b = m[_++], h[b]);
                return p;
              };
            }
          ),
          /***/
          "3bbe": (
            /***/
            function(o, i, r) {
              var a = r("861d");
              o.exports = function(l) {
                if (!a(l) && l !== null)
                  throw TypeError("Can't set " + String(l) + " as a prototype");
                return l;
              };
            }
          ),
          /***/
          "3ca3": (
            /***/
            function(o, i, r) {
              var a = r("6547").charAt, l = r("69f3"), u = r("7dd0"), d = "String Iterator", f = l.set, p = l.getterFor(d);
              u(String, "String", function(h) {
                f(this, {
                  type: d,
                  string: String(h),
                  index: 0
                });
              }, function() {
                var m = p(this), v = m.string, _ = m.index, b;
                return _ >= v.length ? { value: void 0, done: !0 } : (b = a(v, _), m.index += b.length, { value: b, done: !1 });
              });
            }
          ),
          /***/
          "3f8c": (
            /***/
            function(o, i) {
              o.exports = {};
            }
          ),
          /***/
          4160: (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("17c2");
              a({ target: "Array", proto: !0, forced: [].forEach != l }, {
                forEach: l
              });
            }
          ),
          /***/
          "428f": (
            /***/
            function(o, i, r) {
              var a = r("da84");
              o.exports = a;
            }
          ),
          /***/
          "44ad": (
            /***/
            function(o, i, r) {
              var a = r("d039"), l = r("c6b6"), u = "".split;
              o.exports = a(function() {
                return !Object("z").propertyIsEnumerable(0);
              }) ? function(d) {
                return l(d) == "String" ? u.call(d, "") : Object(d);
              } : Object;
            }
          ),
          /***/
          "44d2": (
            /***/
            function(o, i, r) {
              var a = r("b622"), l = r("7c73"), u = r("9bf2"), d = a("unscopables"), f = Array.prototype;
              f[d] == null && u.f(f, d, {
                configurable: !0,
                value: l(null)
              }), o.exports = function(p) {
                f[d][p] = !0;
              };
            }
          ),
          /***/
          "44e7": (
            /***/
            function(o, i, r) {
              var a = r("861d"), l = r("c6b6"), u = r("b622"), d = u("match");
              o.exports = function(f) {
                var p;
                return a(f) && ((p = f[d]) !== void 0 ? !!p : l(f) == "RegExp");
              };
            }
          ),
          /***/
          4930: (
            /***/
            function(o, i, r) {
              var a = r("d039");
              o.exports = !!Object.getOwnPropertySymbols && !a(function() {
                return !String(Symbol());
              });
            }
          ),
          /***/
          "4d64": (
            /***/
            function(o, i, r) {
              var a = r("fc6a"), l = r("50c4"), u = r("23cb"), d = function(f) {
                return function(p, h, m) {
                  var v = a(p), _ = l(v.length), b = u(m, _), w;
                  if (f && h != h) {
                    for (; _ > b; )
                      if (w = v[b++], w != w) return !0;
                  } else for (; _ > b; b++)
                    if ((f || b in v) && v[b] === h) return f || b || 0;
                  return !f && -1;
                };
              };
              o.exports = {
                // `Array.prototype.includes` method
                // https://tc39.github.io/ecma262/#sec-array.prototype.includes
                includes: d(!0),
                // `Array.prototype.indexOf` method
                // https://tc39.github.io/ecma262/#sec-array.prototype.indexof
                indexOf: d(!1)
              };
            }
          ),
          /***/
          "4de4": (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("b727").filter, u = r("1dde"), d = r("ae40"), f = u("filter"), p = d("filter");
              a({ target: "Array", proto: !0, forced: !f || !p }, {
                filter: function(m) {
                  return l(this, m, arguments.length > 1 ? arguments[1] : void 0);
                }
              });
            }
          ),
          /***/
          "4df4": (
            /***/
            function(o, i, r) {
              var a = r("0366"), l = r("7b0b"), u = r("9bdd"), d = r("e95a"), f = r("50c4"), p = r("8418"), h = r("35a1");
              o.exports = function(v) {
                var _ = l(v), b = typeof this == "function" ? this : Array, w = arguments.length, y = w > 1 ? arguments[1] : void 0, x = y !== void 0, N = h(_), S = 0, O, $, T, R, P, M;
                if (x && (y = a(y, w > 2 ? arguments[2] : void 0, 2)), N != null && !(b == Array && d(N)))
                  for (R = N.call(_), P = R.next, $ = new b(); !(T = P.call(R)).done; S++)
                    M = x ? u(R, y, [T.value, S], !0) : T.value, p($, S, M);
                else
                  for (O = f(_.length), $ = new b(O); O > S; S++)
                    M = x ? y(_[S], S) : _[S], p($, S, M);
                return $.length = S, $;
              };
            }
          ),
          /***/
          "4fad": (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("6f53").entries;
              a({ target: "Object", stat: !0 }, {
                entries: function(d) {
                  return l(d);
                }
              });
            }
          ),
          /***/
          "50c4": (
            /***/
            function(o, i, r) {
              var a = r("a691"), l = Math.min;
              o.exports = function(u) {
                return u > 0 ? l(a(u), 9007199254740991) : 0;
              };
            }
          ),
          /***/
          5135: (
            /***/
            function(o, i) {
              var r = {}.hasOwnProperty;
              o.exports = function(a, l) {
                return r.call(a, l);
              };
            }
          ),
          /***/
          5319: (
            /***/
            function(o, i, r) {
              var a = r("d784"), l = r("825a"), u = r("7b0b"), d = r("50c4"), f = r("a691"), p = r("1d80"), h = r("8aa5"), m = r("14c3"), v = Math.max, _ = Math.min, b = Math.floor, w = /\$([$&'`]|\d\d?|<[^>]*>)/g, y = /\$([$&'`]|\d\d?)/g, x = function(N) {
                return N === void 0 ? N : String(N);
              };
              a("replace", 2, function(N, S, O, $) {
                var T = $.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE, R = $.REPLACE_KEEPS_$0, P = T ? "$" : "$0";
                return [
                  // `String.prototype.replace` method
                  // https://tc39.github.io/ecma262/#sec-string.prototype.replace
                  function(H, j) {
                    var V = p(this), K = H == null ? void 0 : H[N];
                    return K !== void 0 ? K.call(H, V, j) : S.call(String(V), H, j);
                  },
                  // `RegExp.prototype[@@replace]` method
                  // https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace
                  function(U, H) {
                    if (!T && R || typeof H == "string" && H.indexOf(P) === -1) {
                      var j = O(S, U, this, H);
                      if (j.done) return j.value;
                    }
                    var V = l(U), K = String(this), q = typeof H == "function";
                    q || (H = String(H));
                    var re = V.global;
                    if (re) {
                      var ke = V.unicode;
                      V.lastIndex = 0;
                    }
                    for (var ze = []; ; ) {
                      var We = m(V, K);
                      if (We === null || (ze.push(We), !re)) break;
                      var st = String(We[0]);
                      st === "" && (V.lastIndex = h(K, d(V.lastIndex), ke));
                    }
                    for (var Lt = "", Yt = 0, Et = 0; Et < ze.length; Et++) {
                      We = ze[Et];
                      for (var J = String(We[0]), we = v(_(f(We.index), K.length), 0), Ee = [], De = 1; De < We.length; De++) Ee.push(x(We[De]));
                      var tt = We.groups;
                      if (q) {
                        var Tt = [J].concat(Ee, we, K);
                        tt !== void 0 && Tt.push(tt);
                        var Fe = String(H.apply(void 0, Tt));
                      } else
                        Fe = M(J, K, we, Ee, tt, H);
                      we >= Yt && (Lt += K.slice(Yt, we) + Fe, Yt = we + J.length);
                    }
                    return Lt + K.slice(Yt);
                  }
                ];
                function M(U, H, j, V, K, q) {
                  var re = j + U.length, ke = V.length, ze = y;
                  return K !== void 0 && (K = u(K), ze = w), S.call(q, ze, function(We, st) {
                    var Lt;
                    switch (st.charAt(0)) {
                      case "$":
                        return "$";
                      case "&":
                        return U;
                      case "`":
                        return H.slice(0, j);
                      case "'":
                        return H.slice(re);
                      case "<":
                        Lt = K[st.slice(1, -1)];
                        break;
                      default:
                        var Yt = +st;
                        if (Yt === 0) return We;
                        if (Yt > ke) {
                          var Et = b(Yt / 10);
                          return Et === 0 ? We : Et <= ke ? V[Et - 1] === void 0 ? st.charAt(1) : V[Et - 1] + st.charAt(1) : We;
                        }
                        Lt = V[Yt - 1];
                    }
                    return Lt === void 0 ? "" : Lt;
                  });
                }
              });
            }
          ),
          /***/
          5692: (
            /***/
            function(o, i, r) {
              var a = r("c430"), l = r("c6cd");
              (o.exports = function(u, d) {
                return l[u] || (l[u] = d !== void 0 ? d : {});
              })("versions", []).push({
                version: "3.6.5",
                mode: a ? "pure" : "global",
                copyright: "© 2020 Denis Pushkarev (zloirock.ru)"
              });
            }
          ),
          /***/
          "56ef": (
            /***/
            function(o, i, r) {
              var a = r("d066"), l = r("241c"), u = r("7418"), d = r("825a");
              o.exports = a("Reflect", "ownKeys") || function(p) {
                var h = l.f(d(p)), m = u.f;
                return m ? h.concat(m(p)) : h;
              };
            }
          ),
          /***/
          "5a34": (
            /***/
            function(o, i, r) {
              var a = r("44e7");
              o.exports = function(l) {
                if (a(l))
                  throw TypeError("The method doesn't accept regular expressions");
                return l;
              };
            }
          ),
          /***/
          "5c6c": (
            /***/
            function(o, i) {
              o.exports = function(r, a) {
                return {
                  enumerable: !(r & 1),
                  configurable: !(r & 2),
                  writable: !(r & 4),
                  value: a
                };
              };
            }
          ),
          /***/
          "5db7": (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("a2bf"), u = r("7b0b"), d = r("50c4"), f = r("1c0b"), p = r("65f0");
              a({ target: "Array", proto: !0 }, {
                flatMap: function(m) {
                  var v = u(this), _ = d(v.length), b;
                  return f(m), b = p(v, 0), b.length = l(b, v, v, _, 0, 1, m, arguments.length > 1 ? arguments[1] : void 0), b;
                }
              });
            }
          ),
          /***/
          6547: (
            /***/
            function(o, i, r) {
              var a = r("a691"), l = r("1d80"), u = function(d) {
                return function(f, p) {
                  var h = String(l(f)), m = a(p), v = h.length, _, b;
                  return m < 0 || m >= v ? d ? "" : void 0 : (_ = h.charCodeAt(m), _ < 55296 || _ > 56319 || m + 1 === v || (b = h.charCodeAt(m + 1)) < 56320 || b > 57343 ? d ? h.charAt(m) : _ : d ? h.slice(m, m + 2) : (_ - 55296 << 10) + (b - 56320) + 65536);
                };
              };
              o.exports = {
                // `String.prototype.codePointAt` method
                // https://tc39.github.io/ecma262/#sec-string.prototype.codepointat
                codeAt: u(!1),
                // `String.prototype.at` method
                // https://github.com/mathiasbynens/String.prototype.at
                charAt: u(!0)
              };
            }
          ),
          /***/
          "65f0": (
            /***/
            function(o, i, r) {
              var a = r("861d"), l = r("e8b5"), u = r("b622"), d = u("species");
              o.exports = function(f, p) {
                var h;
                return l(f) && (h = f.constructor, typeof h == "function" && (h === Array || l(h.prototype)) ? h = void 0 : a(h) && (h = h[d], h === null && (h = void 0))), new (h === void 0 ? Array : h)(p === 0 ? 0 : p);
              };
            }
          ),
          /***/
          "69f3": (
            /***/
            function(o, i, r) {
              var a = r("7f9a"), l = r("da84"), u = r("861d"), d = r("9112"), f = r("5135"), p = r("f772"), h = r("d012"), m = l.WeakMap, v, _, b, w = function(T) {
                return b(T) ? _(T) : v(T, {});
              }, y = function(T) {
                return function(R) {
                  var P;
                  if (!u(R) || (P = _(R)).type !== T)
                    throw TypeError("Incompatible receiver, " + T + " required");
                  return P;
                };
              };
              if (a) {
                var x = new m(), N = x.get, S = x.has, O = x.set;
                v = function(T, R) {
                  return O.call(x, T, R), R;
                }, _ = function(T) {
                  return N.call(x, T) || {};
                }, b = function(T) {
                  return S.call(x, T);
                };
              } else {
                var $ = p("state");
                h[$] = !0, v = function(T, R) {
                  return d(T, $, R), R;
                }, _ = function(T) {
                  return f(T, $) ? T[$] : {};
                }, b = function(T) {
                  return f(T, $);
                };
              }
              o.exports = {
                set: v,
                get: _,
                has: b,
                enforce: w,
                getterFor: y
              };
            }
          ),
          /***/
          "6eeb": (
            /***/
            function(o, i, r) {
              var a = r("da84"), l = r("9112"), u = r("5135"), d = r("ce4e"), f = r("8925"), p = r("69f3"), h = p.get, m = p.enforce, v = String(String).split("String");
              (o.exports = function(_, b, w, y) {
                var x = y ? !!y.unsafe : !1, N = y ? !!y.enumerable : !1, S = y ? !!y.noTargetGet : !1;
                if (typeof w == "function" && (typeof b == "string" && !u(w, "name") && l(w, "name", b), m(w).source = v.join(typeof b == "string" ? b : "")), _ === a) {
                  N ? _[b] = w : d(b, w);
                  return;
                } else x ? !S && _[b] && (N = !0) : delete _[b];
                N ? _[b] = w : l(_, b, w);
              })(Function.prototype, "toString", function() {
                return typeof this == "function" && h(this).source || f(this);
              });
            }
          ),
          /***/
          "6f53": (
            /***/
            function(o, i, r) {
              var a = r("83ab"), l = r("df75"), u = r("fc6a"), d = r("d1e7").f, f = function(p) {
                return function(h) {
                  for (var m = u(h), v = l(m), _ = v.length, b = 0, w = [], y; _ > b; )
                    y = v[b++], (!a || d.call(m, y)) && w.push(p ? [y, m[y]] : m[y]);
                  return w;
                };
              };
              o.exports = {
                // `Object.entries` method
                // https://tc39.github.io/ecma262/#sec-object.entries
                entries: f(!0),
                // `Object.values` method
                // https://tc39.github.io/ecma262/#sec-object.values
                values: f(!1)
              };
            }
          ),
          /***/
          "73d9": (
            /***/
            function(o, i, r) {
              var a = r("44d2");
              a("flatMap");
            }
          ),
          /***/
          7418: (
            /***/
            function(o, i) {
              i.f = Object.getOwnPropertySymbols;
            }
          ),
          /***/
          "746f": (
            /***/
            function(o, i, r) {
              var a = r("428f"), l = r("5135"), u = r("e538"), d = r("9bf2").f;
              o.exports = function(f) {
                var p = a.Symbol || (a.Symbol = {});
                l(p, f) || d(p, f, {
                  value: u.f(f)
                });
              };
            }
          ),
          /***/
          7839: (
            /***/
            function(o, i) {
              o.exports = [
                "constructor",
                "hasOwnProperty",
                "isPrototypeOf",
                "propertyIsEnumerable",
                "toLocaleString",
                "toString",
                "valueOf"
              ];
            }
          ),
          /***/
          "7b0b": (
            /***/
            function(o, i, r) {
              var a = r("1d80");
              o.exports = function(l) {
                return Object(a(l));
              };
            }
          ),
          /***/
          "7c73": (
            /***/
            function(o, i, r) {
              var a = r("825a"), l = r("37e8"), u = r("7839"), d = r("d012"), f = r("1be4"), p = r("cc12"), h = r("f772"), m = ">", v = "<", _ = "prototype", b = "script", w = h("IE_PROTO"), y = function() {
              }, x = function(T) {
                return v + b + m + T + v + "/" + b + m;
              }, N = function(T) {
                T.write(x("")), T.close();
                var R = T.parentWindow.Object;
                return T = null, R;
              }, S = function() {
                var T = p("iframe"), R = "java" + b + ":", P;
                return T.style.display = "none", f.appendChild(T), T.src = String(R), P = T.contentWindow.document, P.open(), P.write(x("document.F=Object")), P.close(), P.F;
              }, O, $ = function() {
                try {
                  O = document.domain && new ActiveXObject("htmlfile");
                } catch {
                }
                $ = O ? N(O) : S();
                for (var T = u.length; T--; ) delete $[_][u[T]];
                return $();
              };
              d[w] = !0, o.exports = Object.create || function(R, P) {
                var M;
                return R !== null ? (y[_] = a(R), M = new y(), y[_] = null, M[w] = R) : M = $(), P === void 0 ? M : l(M, P);
              };
            }
          ),
          /***/
          "7dd0": (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("9ed3"), u = r("e163"), d = r("d2bb"), f = r("d44e"), p = r("9112"), h = r("6eeb"), m = r("b622"), v = r("c430"), _ = r("3f8c"), b = r("ae93"), w = b.IteratorPrototype, y = b.BUGGY_SAFARI_ITERATORS, x = m("iterator"), N = "keys", S = "values", O = "entries", $ = function() {
                return this;
              };
              o.exports = function(T, R, P, M, U, H, j) {
                l(P, R, M);
                var V = function(Et) {
                  if (Et === U && ze) return ze;
                  if (!y && Et in re) return re[Et];
                  switch (Et) {
                    case N:
                      return function() {
                        return new P(this, Et);
                      };
                    case S:
                      return function() {
                        return new P(this, Et);
                      };
                    case O:
                      return function() {
                        return new P(this, Et);
                      };
                  }
                  return function() {
                    return new P(this);
                  };
                }, K = R + " Iterator", q = !1, re = T.prototype, ke = re[x] || re["@@iterator"] || U && re[U], ze = !y && ke || V(U), We = R == "Array" && re.entries || ke, st, Lt, Yt;
                if (We && (st = u(We.call(new T())), w !== Object.prototype && st.next && (!v && u(st) !== w && (d ? d(st, w) : typeof st[x] != "function" && p(st, x, $)), f(st, K, !0, !0), v && (_[K] = $))), U == S && ke && ke.name !== S && (q = !0, ze = function() {
                  return ke.call(this);
                }), (!v || j) && re[x] !== ze && p(re, x, ze), _[R] = ze, U)
                  if (Lt = {
                    values: V(S),
                    keys: H ? ze : V(N),
                    entries: V(O)
                  }, j) for (Yt in Lt)
                    (y || q || !(Yt in re)) && h(re, Yt, Lt[Yt]);
                  else a({ target: R, proto: !0, forced: y || q }, Lt);
                return Lt;
              };
            }
          ),
          /***/
          "7f9a": (
            /***/
            function(o, i, r) {
              var a = r("da84"), l = r("8925"), u = a.WeakMap;
              o.exports = typeof u == "function" && /native code/.test(l(u));
            }
          ),
          /***/
          "825a": (
            /***/
            function(o, i, r) {
              var a = r("861d");
              o.exports = function(l) {
                if (!a(l))
                  throw TypeError(String(l) + " is not an object");
                return l;
              };
            }
          ),
          /***/
          "83ab": (
            /***/
            function(o, i, r) {
              var a = r("d039");
              o.exports = !a(function() {
                return Object.defineProperty({}, 1, { get: function() {
                  return 7;
                } })[1] != 7;
              });
            }
          ),
          /***/
          8418: (
            /***/
            function(o, i, r) {
              var a = r("c04e"), l = r("9bf2"), u = r("5c6c");
              o.exports = function(d, f, p) {
                var h = a(f);
                h in d ? l.f(d, h, u(0, p)) : d[h] = p;
              };
            }
          ),
          /***/
          "861d": (
            /***/
            function(o, i) {
              o.exports = function(r) {
                return typeof r == "object" ? r !== null : typeof r == "function";
              };
            }
          ),
          /***/
          8875: (
            /***/
            function(o, i, r) {
              var a, l, u;
              (function(d, f) {
                l = [], a = f, u = typeof a == "function" ? a.apply(i, l) : a, u !== void 0 && (o.exports = u);
              })(typeof self < "u" ? self : this, function() {
                function d() {
                  var f = Object.getOwnPropertyDescriptor(document, "currentScript");
                  if (!f && "currentScript" in document && document.currentScript || f && f.get !== d && document.currentScript)
                    return document.currentScript;
                  try {
                    throw new Error();
                  } catch (O) {
                    var p = /.*at [^(]*\((.*):(.+):(.+)\)$/ig, h = /@([^@]*):(\d+):(\d+)\s*$/ig, m = p.exec(O.stack) || h.exec(O.stack), v = m && m[1] || !1, _ = m && m[2] || !1, b = document.location.href.replace(document.location.hash, ""), w, y, x, N = document.getElementsByTagName("script");
                    v === b && (w = document.documentElement.outerHTML, y = new RegExp("(?:[^\\n]+?\\n){0," + (_ - 2) + "}[^<]*<script>([\\d\\D]*?)<\\/script>[\\d\\D]*", "i"), x = w.replace(y, "$1").trim());
                    for (var S = 0; S < N.length; S++)
                      if (N[S].readyState === "interactive" || N[S].src === v || v === b && N[S].innerHTML && N[S].innerHTML.trim() === x)
                        return N[S];
                    return null;
                  }
                }
                return d;
              });
            }
          ),
          /***/
          8925: (
            /***/
            function(o, i, r) {
              var a = r("c6cd"), l = Function.toString;
              typeof a.inspectSource != "function" && (a.inspectSource = function(u) {
                return l.call(u);
              }), o.exports = a.inspectSource;
            }
          ),
          /***/
          "8aa5": (
            /***/
            function(o, i, r) {
              var a = r("6547").charAt;
              o.exports = function(l, u, d) {
                return u + (d ? a(l, u).length : 1);
              };
            }
          ),
          /***/
          "8bbf": (
            /***/
            function(o, i) {
              o.exports = n;
            }
          ),
          /***/
          "90e3": (
            /***/
            function(o, i) {
              var r = 0, a = Math.random();
              o.exports = function(l) {
                return "Symbol(" + String(l === void 0 ? "" : l) + ")_" + (++r + a).toString(36);
              };
            }
          ),
          /***/
          9112: (
            /***/
            function(o, i, r) {
              var a = r("83ab"), l = r("9bf2"), u = r("5c6c");
              o.exports = a ? function(d, f, p) {
                return l.f(d, f, u(1, p));
              } : function(d, f, p) {
                return d[f] = p, d;
              };
            }
          ),
          /***/
          9263: (
            /***/
            function(o, i, r) {
              var a = r("ad6d"), l = r("9f7f"), u = RegExp.prototype.exec, d = String.prototype.replace, f = u, p = function() {
                var _ = /a/, b = /b*/g;
                return u.call(_, "a"), u.call(b, "a"), _.lastIndex !== 0 || b.lastIndex !== 0;
              }(), h = l.UNSUPPORTED_Y || l.BROKEN_CARET, m = /()??/.exec("")[1] !== void 0, v = p || m || h;
              v && (f = function(b) {
                var w = this, y, x, N, S, O = h && w.sticky, $ = a.call(w), T = w.source, R = 0, P = b;
                return O && ($ = $.replace("y", ""), $.indexOf("g") === -1 && ($ += "g"), P = String(b).slice(w.lastIndex), w.lastIndex > 0 && (!w.multiline || w.multiline && b[w.lastIndex - 1] !== `
`) && (T = "(?: " + T + ")", P = " " + P, R++), x = new RegExp("^(?:" + T + ")", $)), m && (x = new RegExp("^" + T + "$(?!\\s)", $)), p && (y = w.lastIndex), N = u.call(O ? x : w, P), O ? N ? (N.input = N.input.slice(R), N[0] = N[0].slice(R), N.index = w.lastIndex, w.lastIndex += N[0].length) : w.lastIndex = 0 : p && N && (w.lastIndex = w.global ? N.index + N[0].length : y), m && N && N.length > 1 && d.call(N[0], x, function() {
                  for (S = 1; S < arguments.length - 2; S++)
                    arguments[S] === void 0 && (N[S] = void 0);
                }), N;
              }), o.exports = f;
            }
          ),
          /***/
          "94ca": (
            /***/
            function(o, i, r) {
              var a = r("d039"), l = /#|\.prototype\./, u = function(m, v) {
                var _ = f[d(m)];
                return _ == h ? !0 : _ == p ? !1 : typeof v == "function" ? a(v) : !!v;
              }, d = u.normalize = function(m) {
                return String(m).replace(l, ".").toLowerCase();
              }, f = u.data = {}, p = u.NATIVE = "N", h = u.POLYFILL = "P";
              o.exports = u;
            }
          ),
          /***/
          "99af": (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("d039"), u = r("e8b5"), d = r("861d"), f = r("7b0b"), p = r("50c4"), h = r("8418"), m = r("65f0"), v = r("1dde"), _ = r("b622"), b = r("2d00"), w = _("isConcatSpreadable"), y = 9007199254740991, x = "Maximum allowed index exceeded", N = b >= 51 || !l(function() {
                var T = [];
                return T[w] = !1, T.concat()[0] !== T;
              }), S = v("concat"), O = function(T) {
                if (!d(T)) return !1;
                var R = T[w];
                return R !== void 0 ? !!R : u(T);
              }, $ = !N || !S;
              a({ target: "Array", proto: !0, forced: $ }, {
                concat: function(R) {
                  var P = f(this), M = m(P, 0), U = 0, H, j, V, K, q;
                  for (H = -1, V = arguments.length; H < V; H++)
                    if (q = H === -1 ? P : arguments[H], O(q)) {
                      if (K = p(q.length), U + K > y) throw TypeError(x);
                      for (j = 0; j < K; j++, U++) j in q && h(M, U, q[j]);
                    } else {
                      if (U >= y) throw TypeError(x);
                      h(M, U++, q);
                    }
                  return M.length = U, M;
                }
              });
            }
          ),
          /***/
          "9bdd": (
            /***/
            function(o, i, r) {
              var a = r("825a");
              o.exports = function(l, u, d, f) {
                try {
                  return f ? u(a(d)[0], d[1]) : u(d);
                } catch (h) {
                  var p = l.return;
                  throw p !== void 0 && a(p.call(l)), h;
                }
              };
            }
          ),
          /***/
          "9bf2": (
            /***/
            function(o, i, r) {
              var a = r("83ab"), l = r("0cfb"), u = r("825a"), d = r("c04e"), f = Object.defineProperty;
              i.f = a ? f : function(h, m, v) {
                if (u(h), m = d(m, !0), u(v), l) try {
                  return f(h, m, v);
                } catch {
                }
                if ("get" in v || "set" in v) throw TypeError("Accessors not supported");
                return "value" in v && (h[m] = v.value), h;
              };
            }
          ),
          /***/
          "9ed3": (
            /***/
            function(o, i, r) {
              var a = r("ae93").IteratorPrototype, l = r("7c73"), u = r("5c6c"), d = r("d44e"), f = r("3f8c"), p = function() {
                return this;
              };
              o.exports = function(h, m, v) {
                var _ = m + " Iterator";
                return h.prototype = l(a, { next: u(1, v) }), d(h, _, !1, !0), f[_] = p, h;
              };
            }
          ),
          /***/
          "9f7f": (
            /***/
            function(o, i, r) {
              var a = r("d039");
              function l(u, d) {
                return RegExp(u, d);
              }
              i.UNSUPPORTED_Y = a(function() {
                var u = l("a", "y");
                return u.lastIndex = 2, u.exec("abcd") != null;
              }), i.BROKEN_CARET = a(function() {
                var u = l("^r", "gy");
                return u.lastIndex = 2, u.exec("str") != null;
              });
            }
          ),
          /***/
          a2bf: (
            /***/
            function(o, i, r) {
              var a = r("e8b5"), l = r("50c4"), u = r("0366"), d = function(f, p, h, m, v, _, b, w) {
                for (var y = v, x = 0, N = b ? u(b, w, 3) : !1, S; x < m; ) {
                  if (x in h) {
                    if (S = N ? N(h[x], x, p) : h[x], _ > 0 && a(S))
                      y = d(f, p, S, l(S.length), y, _ - 1) - 1;
                    else {
                      if (y >= 9007199254740991) throw TypeError("Exceed the acceptable array length");
                      f[y] = S;
                    }
                    y++;
                  }
                  x++;
                }
                return y;
              };
              o.exports = d;
            }
          ),
          /***/
          a352: (
            /***/
            function(o, i) {
              o.exports = s;
            }
          ),
          /***/
          a434: (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("23cb"), u = r("a691"), d = r("50c4"), f = r("7b0b"), p = r("65f0"), h = r("8418"), m = r("1dde"), v = r("ae40"), _ = m("splice"), b = v("splice", { ACCESSORS: !0, 0: 0, 1: 2 }), w = Math.max, y = Math.min, x = 9007199254740991, N = "Maximum allowed length exceeded";
              a({ target: "Array", proto: !0, forced: !_ || !b }, {
                splice: function(O, $) {
                  var T = f(this), R = d(T.length), P = l(O, R), M = arguments.length, U, H, j, V, K, q;
                  if (M === 0 ? U = H = 0 : M === 1 ? (U = 0, H = R - P) : (U = M - 2, H = y(w(u($), 0), R - P)), R + U - H > x)
                    throw TypeError(N);
                  for (j = p(T, H), V = 0; V < H; V++)
                    K = P + V, K in T && h(j, V, T[K]);
                  if (j.length = H, U < H) {
                    for (V = P; V < R - H; V++)
                      K = V + H, q = V + U, K in T ? T[q] = T[K] : delete T[q];
                    for (V = R; V > R - H + U; V--) delete T[V - 1];
                  } else if (U > H)
                    for (V = R - H; V > P; V--)
                      K = V + H - 1, q = V + U - 1, K in T ? T[q] = T[K] : delete T[q];
                  for (V = 0; V < U; V++)
                    T[V + P] = arguments[V + 2];
                  return T.length = R - H + U, j;
                }
              });
            }
          ),
          /***/
          a4d3: (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("da84"), u = r("d066"), d = r("c430"), f = r("83ab"), p = r("4930"), h = r("fdbf"), m = r("d039"), v = r("5135"), _ = r("e8b5"), b = r("861d"), w = r("825a"), y = r("7b0b"), x = r("fc6a"), N = r("c04e"), S = r("5c6c"), O = r("7c73"), $ = r("df75"), T = r("241c"), R = r("057f"), P = r("7418"), M = r("06cf"), U = r("9bf2"), H = r("d1e7"), j = r("9112"), V = r("6eeb"), K = r("5692"), q = r("f772"), re = r("d012"), ke = r("90e3"), ze = r("b622"), We = r("e538"), st = r("746f"), Lt = r("d44e"), Yt = r("69f3"), Et = r("b727").forEach, J = q("hidden"), we = "Symbol", Ee = "prototype", De = ze("toPrimitive"), tt = Yt.set, Tt = Yt.getterFor(we), Fe = Object[Ee], A = l.Symbol, Y = u("JSON", "stringify"), Q = M.f, ie = U.f, ue = R.f, de = H.f, be = K("symbols"), ve = K("op-symbols"), _e = K("string-to-symbol-registry"), pe = K("symbol-to-string-registry"), Be = K("wks"), xe = l.QObject, Ae = !xe || !xe[Ee] || !xe[Ee].findChild, Ke = f && m(function() {
                return O(ie({}, "a", {
                  get: function() {
                    return ie(this, "a", { value: 7 }).a;
                  }
                })).a != 7;
              }) ? function(je, Me, Xe) {
                var wt = Q(Fe, Me);
                wt && delete Fe[Me], ie(je, Me, Xe), wt && je !== Fe && ie(Fe, Me, wt);
              } : ie, ft = function(je, Me) {
                var Xe = be[je] = O(A[Ee]);
                return tt(Xe, {
                  type: we,
                  tag: je,
                  description: Me
                }), f || (Xe.description = Me), Xe;
              }, X = h ? function(je) {
                return typeof je == "symbol";
              } : function(je) {
                return Object(je) instanceof A;
              }, z = function(Me, Xe, wt) {
                Me === Fe && z(ve, Xe, wt), w(Me);
                var $t = N(Xe, !0);
                return w(wt), v(be, $t) ? (wt.enumerable ? (v(Me, J) && Me[J][$t] && (Me[J][$t] = !1), wt = O(wt, { enumerable: S(0, !1) })) : (v(Me, J) || ie(Me, J, S(1, {})), Me[J][$t] = !0), Ke(Me, $t, wt)) : ie(Me, $t, wt);
              }, Z = function(Me, Xe) {
                w(Me);
                var wt = x(Xe), $t = $(wt).concat(Nt(wt));
                return Et($t, function(ps) {
                  (!f || Te.call(wt, ps)) && z(Me, ps, wt[ps]);
                }), Me;
              }, ce = function(Me, Xe) {
                return Xe === void 0 ? O(Me) : Z(O(Me), Xe);
              }, Te = function(Me) {
                var Xe = N(Me, !0), wt = de.call(this, Xe);
                return this === Fe && v(be, Xe) && !v(ve, Xe) ? !1 : wt || !v(this, Xe) || !v(be, Xe) || v(this, J) && this[J][Xe] ? wt : !0;
              }, Pe = function(Me, Xe) {
                var wt = x(Me), $t = N(Xe, !0);
                if (!(wt === Fe && v(be, $t) && !v(ve, $t))) {
                  var ps = Q(wt, $t);
                  return ps && v(be, $t) && !(v(wt, J) && wt[J][$t]) && (ps.enumerable = !0), ps;
                }
              }, et = function(Me) {
                var Xe = ue(x(Me)), wt = [];
                return Et(Xe, function($t) {
                  !v(be, $t) && !v(re, $t) && wt.push($t);
                }), wt;
              }, Nt = function(Me) {
                var Xe = Me === Fe, wt = ue(Xe ? ve : x(Me)), $t = [];
                return Et(wt, function(ps) {
                  v(be, ps) && (!Xe || v(Fe, ps)) && $t.push(be[ps]);
                }), $t;
              };
              if (p || (A = function() {
                if (this instanceof A) throw TypeError("Symbol is not a constructor");
                var Me = !arguments.length || arguments[0] === void 0 ? void 0 : String(arguments[0]), Xe = ke(Me), wt = function($t) {
                  this === Fe && wt.call(ve, $t), v(this, J) && v(this[J], Xe) && (this[J][Xe] = !1), Ke(this, Xe, S(1, $t));
                };
                return f && Ae && Ke(Fe, Xe, { configurable: !0, set: wt }), ft(Xe, Me);
              }, V(A[Ee], "toString", function() {
                return Tt(this).tag;
              }), V(A, "withoutSetter", function(je) {
                return ft(ke(je), je);
              }), H.f = Te, U.f = z, M.f = Pe, T.f = R.f = et, P.f = Nt, We.f = function(je) {
                return ft(ze(je), je);
              }, f && (ie(A[Ee], "description", {
                configurable: !0,
                get: function() {
                  return Tt(this).description;
                }
              }), d || V(Fe, "propertyIsEnumerable", Te, { unsafe: !0 }))), a({ global: !0, wrap: !0, forced: !p, sham: !p }, {
                Symbol: A
              }), Et($(Be), function(je) {
                st(je);
              }), a({ target: we, stat: !0, forced: !p }, {
                // `Symbol.for` method
                // https://tc39.github.io/ecma262/#sec-symbol.for
                for: function(je) {
                  var Me = String(je);
                  if (v(_e, Me)) return _e[Me];
                  var Xe = A(Me);
                  return _e[Me] = Xe, pe[Xe] = Me, Xe;
                },
                // `Symbol.keyFor` method
                // https://tc39.github.io/ecma262/#sec-symbol.keyfor
                keyFor: function(Me) {
                  if (!X(Me)) throw TypeError(Me + " is not a symbol");
                  if (v(pe, Me)) return pe[Me];
                },
                useSetter: function() {
                  Ae = !0;
                },
                useSimple: function() {
                  Ae = !1;
                }
              }), a({ target: "Object", stat: !0, forced: !p, sham: !f }, {
                // `Object.create` method
                // https://tc39.github.io/ecma262/#sec-object.create
                create: ce,
                // `Object.defineProperty` method
                // https://tc39.github.io/ecma262/#sec-object.defineproperty
                defineProperty: z,
                // `Object.defineProperties` method
                // https://tc39.github.io/ecma262/#sec-object.defineproperties
                defineProperties: Z,
                // `Object.getOwnPropertyDescriptor` method
                // https://tc39.github.io/ecma262/#sec-object.getownpropertydescriptors
                getOwnPropertyDescriptor: Pe
              }), a({ target: "Object", stat: !0, forced: !p }, {
                // `Object.getOwnPropertyNames` method
                // https://tc39.github.io/ecma262/#sec-object.getownpropertynames
                getOwnPropertyNames: et,
                // `Object.getOwnPropertySymbols` method
                // https://tc39.github.io/ecma262/#sec-object.getownpropertysymbols
                getOwnPropertySymbols: Nt
              }), a({ target: "Object", stat: !0, forced: m(function() {
                P.f(1);
              }) }, {
                getOwnPropertySymbols: function(Me) {
                  return P.f(y(Me));
                }
              }), Y) {
                var gt = !p || m(function() {
                  var je = A();
                  return Y([je]) != "[null]" || Y({ a: je }) != "{}" || Y(Object(je)) != "{}";
                });
                a({ target: "JSON", stat: !0, forced: gt }, {
                  // eslint-disable-next-line no-unused-vars
                  stringify: function(Me, Xe, wt) {
                    for (var $t = [Me], ps = 1, Mp; arguments.length > ps; ) $t.push(arguments[ps++]);
                    if (Mp = Xe, !(!b(Xe) && Me === void 0 || X(Me)))
                      return _(Xe) || (Xe = function(QN, vu) {
                        if (typeof Mp == "function" && (vu = Mp.call(this, QN, vu)), !X(vu)) return vu;
                      }), $t[1] = Xe, Y.apply(null, $t);
                  }
                });
              }
              A[Ee][De] || j(A[Ee], De, A[Ee].valueOf), Lt(A, we), re[J] = !0;
            }
          ),
          /***/
          a630: (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("4df4"), u = r("1c7e"), d = !u(function(f) {
                Array.from(f);
              });
              a({ target: "Array", stat: !0, forced: d }, {
                from: l
              });
            }
          ),
          /***/
          a640: (
            /***/
            function(o, i, r) {
              var a = r("d039");
              o.exports = function(l, u) {
                var d = [][l];
                return !!d && a(function() {
                  d.call(null, u || function() {
                    throw 1;
                  }, 1);
                });
              };
            }
          ),
          /***/
          a691: (
            /***/
            function(o, i) {
              var r = Math.ceil, a = Math.floor;
              o.exports = function(l) {
                return isNaN(l = +l) ? 0 : (l > 0 ? a : r)(l);
              };
            }
          ),
          /***/
          ab13: (
            /***/
            function(o, i, r) {
              var a = r("b622"), l = a("match");
              o.exports = function(u) {
                var d = /./;
                try {
                  "/./"[u](d);
                } catch {
                  try {
                    return d[l] = !1, "/./"[u](d);
                  } catch {
                  }
                }
                return !1;
              };
            }
          ),
          /***/
          ac1f: (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("9263");
              a({ target: "RegExp", proto: !0, forced: /./.exec !== l }, {
                exec: l
              });
            }
          ),
          /***/
          ad6d: (
            /***/
            function(o, i, r) {
              var a = r("825a");
              o.exports = function() {
                var l = a(this), u = "";
                return l.global && (u += "g"), l.ignoreCase && (u += "i"), l.multiline && (u += "m"), l.dotAll && (u += "s"), l.unicode && (u += "u"), l.sticky && (u += "y"), u;
              };
            }
          ),
          /***/
          ae40: (
            /***/
            function(o, i, r) {
              var a = r("83ab"), l = r("d039"), u = r("5135"), d = Object.defineProperty, f = {}, p = function(h) {
                throw h;
              };
              o.exports = function(h, m) {
                if (u(f, h)) return f[h];
                m || (m = {});
                var v = [][h], _ = u(m, "ACCESSORS") ? m.ACCESSORS : !1, b = u(m, 0) ? m[0] : p, w = u(m, 1) ? m[1] : void 0;
                return f[h] = !!v && !l(function() {
                  if (_ && !a) return !0;
                  var y = { length: -1 };
                  _ ? d(y, 1, { enumerable: !0, get: p }) : y[1] = 1, v.call(y, b, w);
                });
              };
            }
          ),
          /***/
          ae93: (
            /***/
            function(o, i, r) {
              var a = r("e163"), l = r("9112"), u = r("5135"), d = r("b622"), f = r("c430"), p = d("iterator"), h = !1, m = function() {
                return this;
              }, v, _, b;
              [].keys && (b = [].keys(), "next" in b ? (_ = a(a(b)), _ !== Object.prototype && (v = _)) : h = !0), v == null && (v = {}), !f && !u(v, p) && l(v, p, m), o.exports = {
                IteratorPrototype: v,
                BUGGY_SAFARI_ITERATORS: h
              };
            }
          ),
          /***/
          b041: (
            /***/
            function(o, i, r) {
              var a = r("00ee"), l = r("f5df");
              o.exports = a ? {}.toString : function() {
                return "[object " + l(this) + "]";
              };
            }
          ),
          /***/
          b0c0: (
            /***/
            function(o, i, r) {
              var a = r("83ab"), l = r("9bf2").f, u = Function.prototype, d = u.toString, f = /^\s*function ([^ (]*)/, p = "name";
              a && !(p in u) && l(u, p, {
                configurable: !0,
                get: function() {
                  try {
                    return d.call(this).match(f)[1];
                  } catch {
                    return "";
                  }
                }
              });
            }
          ),
          /***/
          b622: (
            /***/
            function(o, i, r) {
              var a = r("da84"), l = r("5692"), u = r("5135"), d = r("90e3"), f = r("4930"), p = r("fdbf"), h = l("wks"), m = a.Symbol, v = p ? m : m && m.withoutSetter || d;
              o.exports = function(_) {
                return u(h, _) || (f && u(m, _) ? h[_] = m[_] : h[_] = v("Symbol." + _)), h[_];
              };
            }
          ),
          /***/
          b64b: (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("7b0b"), u = r("df75"), d = r("d039"), f = d(function() {
                u(1);
              });
              a({ target: "Object", stat: !0, forced: f }, {
                keys: function(h) {
                  return u(l(h));
                }
              });
            }
          ),
          /***/
          b727: (
            /***/
            function(o, i, r) {
              var a = r("0366"), l = r("44ad"), u = r("7b0b"), d = r("50c4"), f = r("65f0"), p = [].push, h = function(m) {
                var v = m == 1, _ = m == 2, b = m == 3, w = m == 4, y = m == 6, x = m == 5 || y;
                return function(N, S, O, $) {
                  for (var T = u(N), R = l(T), P = a(S, O, 3), M = d(R.length), U = 0, H = $ || f, j = v ? H(N, M) : _ ? H(N, 0) : void 0, V, K; M > U; U++) if ((x || U in R) && (V = R[U], K = P(V, U, T), m)) {
                    if (v) j[U] = K;
                    else if (K) switch (m) {
                      case 3:
                        return !0;
                      // some
                      case 5:
                        return V;
                      // find
                      case 6:
                        return U;
                      // findIndex
                      case 2:
                        p.call(j, V);
                    }
                    else if (w) return !1;
                  }
                  return y ? -1 : b || w ? w : j;
                };
              };
              o.exports = {
                // `Array.prototype.forEach` method
                // https://tc39.github.io/ecma262/#sec-array.prototype.foreach
                forEach: h(0),
                // `Array.prototype.map` method
                // https://tc39.github.io/ecma262/#sec-array.prototype.map
                map: h(1),
                // `Array.prototype.filter` method
                // https://tc39.github.io/ecma262/#sec-array.prototype.filter
                filter: h(2),
                // `Array.prototype.some` method
                // https://tc39.github.io/ecma262/#sec-array.prototype.some
                some: h(3),
                // `Array.prototype.every` method
                // https://tc39.github.io/ecma262/#sec-array.prototype.every
                every: h(4),
                // `Array.prototype.find` method
                // https://tc39.github.io/ecma262/#sec-array.prototype.find
                find: h(5),
                // `Array.prototype.findIndex` method
                // https://tc39.github.io/ecma262/#sec-array.prototype.findIndex
                findIndex: h(6)
              };
            }
          ),
          /***/
          c04e: (
            /***/
            function(o, i, r) {
              var a = r("861d");
              o.exports = function(l, u) {
                if (!a(l)) return l;
                var d, f;
                if (u && typeof (d = l.toString) == "function" && !a(f = d.call(l)) || typeof (d = l.valueOf) == "function" && !a(f = d.call(l)) || !u && typeof (d = l.toString) == "function" && !a(f = d.call(l))) return f;
                throw TypeError("Can't convert object to primitive value");
              };
            }
          ),
          /***/
          c430: (
            /***/
            function(o, i) {
              o.exports = !1;
            }
          ),
          /***/
          c6b6: (
            /***/
            function(o, i) {
              var r = {}.toString;
              o.exports = function(a) {
                return r.call(a).slice(8, -1);
              };
            }
          ),
          /***/
          c6cd: (
            /***/
            function(o, i, r) {
              var a = r("da84"), l = r("ce4e"), u = "__core-js_shared__", d = a[u] || l(u, {});
              o.exports = d;
            }
          ),
          /***/
          c740: (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("b727").findIndex, u = r("44d2"), d = r("ae40"), f = "findIndex", p = !0, h = d(f);
              f in [] && Array(1)[f](function() {
                p = !1;
              }), a({ target: "Array", proto: !0, forced: p || !h }, {
                findIndex: function(v) {
                  return l(this, v, arguments.length > 1 ? arguments[1] : void 0);
                }
              }), u(f);
            }
          ),
          /***/
          c8ba: (
            /***/
            function(o, i) {
              var r;
              r = /* @__PURE__ */ function() {
                return this;
              }();
              try {
                r = r || new Function("return this")();
              } catch {
                typeof window == "object" && (r = window);
              }
              o.exports = r;
            }
          ),
          /***/
          c975: (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("4d64").indexOf, u = r("a640"), d = r("ae40"), f = [].indexOf, p = !!f && 1 / [1].indexOf(1, -0) < 0, h = u("indexOf"), m = d("indexOf", { ACCESSORS: !0, 1: 0 });
              a({ target: "Array", proto: !0, forced: p || !h || !m }, {
                indexOf: function(_) {
                  return p ? f.apply(this, arguments) || 0 : l(this, _, arguments.length > 1 ? arguments[1] : void 0);
                }
              });
            }
          ),
          /***/
          ca84: (
            /***/
            function(o, i, r) {
              var a = r("5135"), l = r("fc6a"), u = r("4d64").indexOf, d = r("d012");
              o.exports = function(f, p) {
                var h = l(f), m = 0, v = [], _;
                for (_ in h) !a(d, _) && a(h, _) && v.push(_);
                for (; p.length > m; ) a(h, _ = p[m++]) && (~u(v, _) || v.push(_));
                return v;
              };
            }
          ),
          /***/
          caad: (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("4d64").includes, u = r("44d2"), d = r("ae40"), f = d("indexOf", { ACCESSORS: !0, 1: 0 });
              a({ target: "Array", proto: !0, forced: !f }, {
                includes: function(h) {
                  return l(this, h, arguments.length > 1 ? arguments[1] : void 0);
                }
              }), u("includes");
            }
          ),
          /***/
          cc12: (
            /***/
            function(o, i, r) {
              var a = r("da84"), l = r("861d"), u = a.document, d = l(u) && l(u.createElement);
              o.exports = function(f) {
                return d ? u.createElement(f) : {};
              };
            }
          ),
          /***/
          ce4e: (
            /***/
            function(o, i, r) {
              var a = r("da84"), l = r("9112");
              o.exports = function(u, d) {
                try {
                  l(a, u, d);
                } catch {
                  a[u] = d;
                }
                return d;
              };
            }
          ),
          /***/
          d012: (
            /***/
            function(o, i) {
              o.exports = {};
            }
          ),
          /***/
          d039: (
            /***/
            function(o, i) {
              o.exports = function(r) {
                try {
                  return !!r();
                } catch {
                  return !0;
                }
              };
            }
          ),
          /***/
          d066: (
            /***/
            function(o, i, r) {
              var a = r("428f"), l = r("da84"), u = function(d) {
                return typeof d == "function" ? d : void 0;
              };
              o.exports = function(d, f) {
                return arguments.length < 2 ? u(a[d]) || u(l[d]) : a[d] && a[d][f] || l[d] && l[d][f];
              };
            }
          ),
          /***/
          d1e7: (
            /***/
            function(o, i, r) {
              var a = {}.propertyIsEnumerable, l = Object.getOwnPropertyDescriptor, u = l && !a.call({ 1: 2 }, 1);
              i.f = u ? function(f) {
                var p = l(this, f);
                return !!p && p.enumerable;
              } : a;
            }
          ),
          /***/
          d28b: (
            /***/
            function(o, i, r) {
              var a = r("746f");
              a("iterator");
            }
          ),
          /***/
          d2bb: (
            /***/
            function(o, i, r) {
              var a = r("825a"), l = r("3bbe");
              o.exports = Object.setPrototypeOf || ("__proto__" in {} ? function() {
                var u = !1, d = {}, f;
                try {
                  f = Object.getOwnPropertyDescriptor(Object.prototype, "__proto__").set, f.call(d, []), u = d instanceof Array;
                } catch {
                }
                return function(h, m) {
                  return a(h), l(m), u ? f.call(h, m) : h.__proto__ = m, h;
                };
              }() : void 0);
            }
          ),
          /***/
          d3b7: (
            /***/
            function(o, i, r) {
              var a = r("00ee"), l = r("6eeb"), u = r("b041");
              a || l(Object.prototype, "toString", u, { unsafe: !0 });
            }
          ),
          /***/
          d44e: (
            /***/
            function(o, i, r) {
              var a = r("9bf2").f, l = r("5135"), u = r("b622"), d = u("toStringTag");
              o.exports = function(f, p, h) {
                f && !l(f = h ? f : f.prototype, d) && a(f, d, { configurable: !0, value: p });
              };
            }
          ),
          /***/
          d58f: (
            /***/
            function(o, i, r) {
              var a = r("1c0b"), l = r("7b0b"), u = r("44ad"), d = r("50c4"), f = function(p) {
                return function(h, m, v, _) {
                  a(m);
                  var b = l(h), w = u(b), y = d(b.length), x = p ? y - 1 : 0, N = p ? -1 : 1;
                  if (v < 2) for (; ; ) {
                    if (x in w) {
                      _ = w[x], x += N;
                      break;
                    }
                    if (x += N, p ? x < 0 : y <= x)
                      throw TypeError("Reduce of empty array with no initial value");
                  }
                  for (; p ? x >= 0 : y > x; x += N) x in w && (_ = m(_, w[x], x, b));
                  return _;
                };
              };
              o.exports = {
                // `Array.prototype.reduce` method
                // https://tc39.github.io/ecma262/#sec-array.prototype.reduce
                left: f(!1),
                // `Array.prototype.reduceRight` method
                // https://tc39.github.io/ecma262/#sec-array.prototype.reduceright
                right: f(!0)
              };
            }
          ),
          /***/
          d784: (
            /***/
            function(o, i, r) {
              r("ac1f");
              var a = r("6eeb"), l = r("d039"), u = r("b622"), d = r("9263"), f = r("9112"), p = u("species"), h = !l(function() {
                var w = /./;
                return w.exec = function() {
                  var y = [];
                  return y.groups = { a: "7" }, y;
                }, "".replace(w, "$<a>") !== "7";
              }), m = function() {
                return "a".replace(/./, "$0") === "$0";
              }(), v = u("replace"), _ = function() {
                return /./[v] ? /./[v]("a", "$0") === "" : !1;
              }(), b = !l(function() {
                var w = /(?:)/, y = w.exec;
                w.exec = function() {
                  return y.apply(this, arguments);
                };
                var x = "ab".split(w);
                return x.length !== 2 || x[0] !== "a" || x[1] !== "b";
              });
              o.exports = function(w, y, x, N) {
                var S = u(w), O = !l(function() {
                  var U = {};
                  return U[S] = function() {
                    return 7;
                  }, ""[w](U) != 7;
                }), $ = O && !l(function() {
                  var U = !1, H = /a/;
                  return w === "split" && (H = {}, H.constructor = {}, H.constructor[p] = function() {
                    return H;
                  }, H.flags = "", H[S] = /./[S]), H.exec = function() {
                    return U = !0, null;
                  }, H[S](""), !U;
                });
                if (!O || !$ || w === "replace" && !(h && m && !_) || w === "split" && !b) {
                  var T = /./[S], R = x(S, ""[w], function(U, H, j, V, K) {
                    return H.exec === d ? O && !K ? { done: !0, value: T.call(H, j, V) } : { done: !0, value: U.call(j, H, V) } : { done: !1 };
                  }, {
                    REPLACE_KEEPS_$0: m,
                    REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE: _
                  }), P = R[0], M = R[1];
                  a(String.prototype, w, P), a(
                    RegExp.prototype,
                    S,
                    y == 2 ? function(U, H) {
                      return M.call(U, this, H);
                    } : function(U) {
                      return M.call(U, this);
                    }
                  );
                }
                N && f(RegExp.prototype[S], "sham", !0);
              };
            }
          ),
          /***/
          d81d: (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("b727").map, u = r("1dde"), d = r("ae40"), f = u("map"), p = d("map");
              a({ target: "Array", proto: !0, forced: !f || !p }, {
                map: function(m) {
                  return l(this, m, arguments.length > 1 ? arguments[1] : void 0);
                }
              });
            }
          ),
          /***/
          da84: (
            /***/
            function(o, i, r) {
              (function(a) {
                var l = function(u) {
                  return u && u.Math == Math && u;
                };
                o.exports = // eslint-disable-next-line no-undef
                l(typeof globalThis == "object" && globalThis) || l(typeof window == "object" && window) || l(typeof self == "object" && self) || l(typeof a == "object" && a) || // eslint-disable-next-line no-new-func
                Function("return this")();
              }).call(this, r("c8ba"));
            }
          ),
          /***/
          dbb4: (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("83ab"), u = r("56ef"), d = r("fc6a"), f = r("06cf"), p = r("8418");
              a({ target: "Object", stat: !0, sham: !l }, {
                getOwnPropertyDescriptors: function(m) {
                  for (var v = d(m), _ = f.f, b = u(v), w = {}, y = 0, x, N; b.length > y; )
                    N = _(v, x = b[y++]), N !== void 0 && p(w, x, N);
                  return w;
                }
              });
            }
          ),
          /***/
          dbf1: (
            /***/
            function(o, i, r) {
              (function(a) {
                r.d(i, "a", function() {
                  return u;
                });
                function l() {
                  return typeof window < "u" ? window.console : a.console;
                }
                var u = l();
              }).call(this, r("c8ba"));
            }
          ),
          /***/
          ddb0: (
            /***/
            function(o, i, r) {
              var a = r("da84"), l = r("fdbc"), u = r("e260"), d = r("9112"), f = r("b622"), p = f("iterator"), h = f("toStringTag"), m = u.values;
              for (var v in l) {
                var _ = a[v], b = _ && _.prototype;
                if (b) {
                  if (b[p] !== m) try {
                    d(b, p, m);
                  } catch {
                    b[p] = m;
                  }
                  if (b[h] || d(b, h, v), l[v]) {
                    for (var w in u)
                      if (b[w] !== u[w]) try {
                        d(b, w, u[w]);
                      } catch {
                        b[w] = u[w];
                      }
                  }
                }
              }
            }
          ),
          /***/
          df75: (
            /***/
            function(o, i, r) {
              var a = r("ca84"), l = r("7839");
              o.exports = Object.keys || function(d) {
                return a(d, l);
              };
            }
          ),
          /***/
          e01a: (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("83ab"), u = r("da84"), d = r("5135"), f = r("861d"), p = r("9bf2").f, h = r("e893"), m = u.Symbol;
              if (l && typeof m == "function" && (!("description" in m.prototype) || // Safari 12 bug
              m().description !== void 0)) {
                var v = {}, _ = function() {
                  var S = arguments.length < 1 || arguments[0] === void 0 ? void 0 : String(arguments[0]), O = this instanceof _ ? new m(S) : S === void 0 ? m() : m(S);
                  return S === "" && (v[O] = !0), O;
                };
                h(_, m);
                var b = _.prototype = m.prototype;
                b.constructor = _;
                var w = b.toString, y = String(m("test")) == "Symbol(test)", x = /^Symbol\((.*)\)[^)]+$/;
                p(b, "description", {
                  configurable: !0,
                  get: function() {
                    var S = f(this) ? this.valueOf() : this, O = w.call(S);
                    if (d(v, S)) return "";
                    var $ = y ? O.slice(7, -1) : O.replace(x, "$1");
                    return $ === "" ? void 0 : $;
                  }
                }), a({ global: !0, forced: !0 }, {
                  Symbol: _
                });
              }
            }
          ),
          /***/
          e163: (
            /***/
            function(o, i, r) {
              var a = r("5135"), l = r("7b0b"), u = r("f772"), d = r("e177"), f = u("IE_PROTO"), p = Object.prototype;
              o.exports = d ? Object.getPrototypeOf : function(h) {
                return h = l(h), a(h, f) ? h[f] : typeof h.constructor == "function" && h instanceof h.constructor ? h.constructor.prototype : h instanceof Object ? p : null;
              };
            }
          ),
          /***/
          e177: (
            /***/
            function(o, i, r) {
              var a = r("d039");
              o.exports = !a(function() {
                function l() {
                }
                return l.prototype.constructor = null, Object.getPrototypeOf(new l()) !== l.prototype;
              });
            }
          ),
          /***/
          e260: (
            /***/
            function(o, i, r) {
              var a = r("fc6a"), l = r("44d2"), u = r("3f8c"), d = r("69f3"), f = r("7dd0"), p = "Array Iterator", h = d.set, m = d.getterFor(p);
              o.exports = f(Array, "Array", function(v, _) {
                h(this, {
                  type: p,
                  target: a(v),
                  // target
                  index: 0,
                  // next index
                  kind: _
                  // kind
                });
              }, function() {
                var v = m(this), _ = v.target, b = v.kind, w = v.index++;
                return !_ || w >= _.length ? (v.target = void 0, { value: void 0, done: !0 }) : b == "keys" ? { value: w, done: !1 } : b == "values" ? { value: _[w], done: !1 } : { value: [w, _[w]], done: !1 };
              }, "values"), u.Arguments = u.Array, l("keys"), l("values"), l("entries");
            }
          ),
          /***/
          e439: (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("d039"), u = r("fc6a"), d = r("06cf").f, f = r("83ab"), p = l(function() {
                d(1);
              }), h = !f || p;
              a({ target: "Object", stat: !0, forced: h, sham: !f }, {
                getOwnPropertyDescriptor: function(v, _) {
                  return d(u(v), _);
                }
              });
            }
          ),
          /***/
          e538: (
            /***/
            function(o, i, r) {
              var a = r("b622");
              i.f = a;
            }
          ),
          /***/
          e893: (
            /***/
            function(o, i, r) {
              var a = r("5135"), l = r("56ef"), u = r("06cf"), d = r("9bf2");
              o.exports = function(f, p) {
                for (var h = l(p), m = d.f, v = u.f, _ = 0; _ < h.length; _++) {
                  var b = h[_];
                  a(f, b) || m(f, b, v(p, b));
                }
              };
            }
          ),
          /***/
          e8b5: (
            /***/
            function(o, i, r) {
              var a = r("c6b6");
              o.exports = Array.isArray || function(u) {
                return a(u) == "Array";
              };
            }
          ),
          /***/
          e95a: (
            /***/
            function(o, i, r) {
              var a = r("b622"), l = r("3f8c"), u = a("iterator"), d = Array.prototype;
              o.exports = function(f) {
                return f !== void 0 && (l.Array === f || d[u] === f);
              };
            }
          ),
          /***/
          f5df: (
            /***/
            function(o, i, r) {
              var a = r("00ee"), l = r("c6b6"), u = r("b622"), d = u("toStringTag"), f = l(/* @__PURE__ */ function() {
                return arguments;
              }()) == "Arguments", p = function(h, m) {
                try {
                  return h[m];
                } catch {
                }
              };
              o.exports = a ? l : function(h) {
                var m, v, _;
                return h === void 0 ? "Undefined" : h === null ? "Null" : typeof (v = p(m = Object(h), d)) == "string" ? v : f ? l(m) : (_ = l(m)) == "Object" && typeof m.callee == "function" ? "Arguments" : _;
              };
            }
          ),
          /***/
          f772: (
            /***/
            function(o, i, r) {
              var a = r("5692"), l = r("90e3"), u = a("keys");
              o.exports = function(d) {
                return u[d] || (u[d] = l(d));
              };
            }
          ),
          /***/
          fb15: (
            /***/
            function(o, i, r) {
              if (r.r(i), typeof window < "u") {
                var a = window.document.currentScript;
                {
                  var l = r("8875");
                  a = l(), "currentScript" in document || Object.defineProperty(document, "currentScript", { get: l });
                }
                var u = a && a.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);
                u && (r.p = u[1]);
              }
              r("99af"), r("4de4"), r("4160"), r("c975"), r("d81d"), r("a434"), r("159b"), r("a4d3"), r("e439"), r("dbb4"), r("b64b");
              function d(X, z, Z) {
                return z in X ? Object.defineProperty(X, z, {
                  value: Z,
                  enumerable: !0,
                  configurable: !0,
                  writable: !0
                }) : X[z] = Z, X;
              }
              function f(X, z) {
                var Z = Object.keys(X);
                if (Object.getOwnPropertySymbols) {
                  var ce = Object.getOwnPropertySymbols(X);
                  z && (ce = ce.filter(function(Te) {
                    return Object.getOwnPropertyDescriptor(X, Te).enumerable;
                  })), Z.push.apply(Z, ce);
                }
                return Z;
              }
              function p(X) {
                for (var z = 1; z < arguments.length; z++) {
                  var Z = arguments[z] != null ? arguments[z] : {};
                  z % 2 ? f(Object(Z), !0).forEach(function(ce) {
                    d(X, ce, Z[ce]);
                  }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(X, Object.getOwnPropertyDescriptors(Z)) : f(Object(Z)).forEach(function(ce) {
                    Object.defineProperty(X, ce, Object.getOwnPropertyDescriptor(Z, ce));
                  });
                }
                return X;
              }
              function h(X) {
                if (Array.isArray(X)) return X;
              }
              r("e01a"), r("d28b"), r("e260"), r("d3b7"), r("3ca3"), r("ddb0");
              function m(X, z) {
                if (!(typeof Symbol > "u" || !(Symbol.iterator in Object(X)))) {
                  var Z = [], ce = !0, Te = !1, Pe = void 0;
                  try {
                    for (var et = X[Symbol.iterator](), Nt; !(ce = (Nt = et.next()).done) && (Z.push(Nt.value), !(z && Z.length === z)); ce = !0)
                      ;
                  } catch (gt) {
                    Te = !0, Pe = gt;
                  } finally {
                    try {
                      !ce && et.return != null && et.return();
                    } finally {
                      if (Te) throw Pe;
                    }
                  }
                  return Z;
                }
              }
              r("a630"), r("fb6a"), r("b0c0"), r("25f0");
              function v(X, z) {
                (z == null || z > X.length) && (z = X.length);
                for (var Z = 0, ce = new Array(z); Z < z; Z++)
                  ce[Z] = X[Z];
                return ce;
              }
              function _(X, z) {
                if (X) {
                  if (typeof X == "string") return v(X, z);
                  var Z = Object.prototype.toString.call(X).slice(8, -1);
                  if (Z === "Object" && X.constructor && (Z = X.constructor.name), Z === "Map" || Z === "Set") return Array.from(X);
                  if (Z === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Z)) return v(X, z);
                }
              }
              function b() {
                throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
              }
              function w(X, z) {
                return h(X) || m(X, z) || _(X, z) || b();
              }
              function y(X) {
                if (Array.isArray(X)) return v(X);
              }
              function x(X) {
                if (typeof Symbol < "u" && Symbol.iterator in Object(X)) return Array.from(X);
              }
              function N() {
                throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
              }
              function S(X) {
                return y(X) || x(X) || _(X) || N();
              }
              var O = r("a352"), $ = /* @__PURE__ */ r.n(O);
              function T(X) {
                X.parentElement !== null && X.parentElement.removeChild(X);
              }
              function R(X, z, Z) {
                var ce = Z === 0 ? X.children[0] : X.children[Z - 1].nextSibling;
                X.insertBefore(z, ce);
              }
              var P = r("dbf1");
              r("13d5"), r("4fad"), r("ac1f"), r("5319");
              function M(X) {
                var z = /* @__PURE__ */ Object.create(null);
                return function(ce) {
                  var Te = z[ce];
                  return Te || (z[ce] = X(ce));
                };
              }
              var U = /-(\w)/g, H = M(function(X) {
                return X.replace(U, function(z, Z) {
                  return Z.toUpperCase();
                });
              });
              r("5db7"), r("73d9");
              var j = ["Start", "Add", "Remove", "Update", "End"], V = ["Choose", "Unchoose", "Sort", "Filter", "Clone"], K = ["Move"], q = [K, j, V].flatMap(function(X) {
                return X;
              }).map(function(X) {
                return "on".concat(X);
              }), re = {
                manage: K,
                manageAndEmit: j,
                emit: V
              };
              function ke(X) {
                return q.indexOf(X) !== -1;
              }
              r("caad"), r("2ca0");
              var ze = ["a", "abbr", "address", "area", "article", "aside", "audio", "b", "base", "bdi", "bdo", "blockquote", "body", "br", "button", "canvas", "caption", "cite", "code", "col", "colgroup", "data", "datalist", "dd", "del", "details", "dfn", "dialog", "div", "dl", "dt", "em", "embed", "fieldset", "figcaption", "figure", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "iframe", "img", "input", "ins", "kbd", "label", "legend", "li", "link", "main", "map", "mark", "math", "menu", "menuitem", "meta", "meter", "nav", "noscript", "object", "ol", "optgroup", "option", "output", "p", "param", "picture", "pre", "progress", "q", "rb", "rp", "rt", "rtc", "ruby", "s", "samp", "script", "section", "select", "slot", "small", "source", "span", "strong", "style", "sub", "summary", "sup", "svg", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "title", "tr", "track", "u", "ul", "var", "video", "wbr"];
              function We(X) {
                return ze.includes(X);
              }
              function st(X) {
                return ["transition-group", "TransitionGroup"].includes(X);
              }
              function Lt(X) {
                return ["id", "class", "role", "style"].includes(X) || X.startsWith("data-") || X.startsWith("aria-") || X.startsWith("on");
              }
              function Yt(X) {
                return X.reduce(function(z, Z) {
                  var ce = w(Z, 2), Te = ce[0], Pe = ce[1];
                  return z[Te] = Pe, z;
                }, {});
              }
              function Et(X) {
                var z = X.$attrs, Z = X.componentData, ce = Z === void 0 ? {} : Z, Te = Yt(Object.entries(z).filter(function(Pe) {
                  var et = w(Pe, 2), Nt = et[0];
                  return et[1], Lt(Nt);
                }));
                return p(p({}, Te), ce);
              }
              function J(X) {
                var z = X.$attrs, Z = X.callBackBuilder, ce = Yt(we(z));
                Object.entries(Z).forEach(function(Pe) {
                  var et = w(Pe, 2), Nt = et[0], gt = et[1];
                  re[Nt].forEach(function(je) {
                    ce["on".concat(je)] = gt(je);
                  });
                });
                var Te = "[data-draggable]".concat(ce.draggable || "");
                return p(p({}, ce), {}, {
                  draggable: Te
                });
              }
              function we(X) {
                return Object.entries(X).filter(function(z) {
                  var Z = w(z, 2), ce = Z[0];
                  return Z[1], !Lt(ce);
                }).map(function(z) {
                  var Z = w(z, 2), ce = Z[0], Te = Z[1];
                  return [H(ce), Te];
                }).filter(function(z) {
                  var Z = w(z, 2), ce = Z[0];
                  return Z[1], !ke(ce);
                });
              }
              r("c740");
              function Ee(X, z) {
                if (!(X instanceof z))
                  throw new TypeError("Cannot call a class as a function");
              }
              function De(X, z) {
                for (var Z = 0; Z < z.length; Z++) {
                  var ce = z[Z];
                  ce.enumerable = ce.enumerable || !1, ce.configurable = !0, "value" in ce && (ce.writable = !0), Object.defineProperty(X, ce.key, ce);
                }
              }
              function tt(X, z, Z) {
                return z && De(X.prototype, z), X;
              }
              var Tt = function(z) {
                var Z = z.el;
                return Z;
              }, Fe = function(z, Z) {
                return z.__draggable_context = Z;
              }, A = function(z) {
                return z.__draggable_context;
              }, Y = /* @__PURE__ */ function() {
                function X(z) {
                  var Z = z.nodes, ce = Z.header, Te = Z.default, Pe = Z.footer, et = z.root, Nt = z.realList;
                  Ee(this, X), this.defaultNodes = Te, this.children = [].concat(S(ce), S(Te), S(Pe)), this.externalComponent = et.externalComponent, this.rootTransition = et.transition, this.tag = et.tag, this.realList = Nt;
                }
                return tt(X, [{
                  key: "render",
                  value: function(Z, ce) {
                    var Te = this.tag, Pe = this.children, et = this._isRootComponent, Nt = et ? {
                      default: function() {
                        return Pe;
                      }
                    } : Pe;
                    return Z(Te, ce, Nt);
                  }
                }, {
                  key: "updated",
                  value: function() {
                    var Z = this.defaultNodes, ce = this.realList;
                    Z.forEach(function(Te, Pe) {
                      Fe(Tt(Te), {
                        element: ce[Pe],
                        index: Pe
                      });
                    });
                  }
                }, {
                  key: "getUnderlyingVm",
                  value: function(Z) {
                    return A(Z);
                  }
                }, {
                  key: "getVmIndexFromDomIndex",
                  value: function(Z, ce) {
                    var Te = this.defaultNodes, Pe = Te.length, et = ce.children, Nt = et.item(Z);
                    if (Nt === null)
                      return Pe;
                    var gt = A(Nt);
                    if (gt)
                      return gt.index;
                    if (Pe === 0)
                      return 0;
                    var je = Tt(Te[0]), Me = S(et).findIndex(function(Xe) {
                      return Xe === je;
                    });
                    return Z < Me ? 0 : Pe;
                  }
                }, {
                  key: "_isRootComponent",
                  get: function() {
                    return this.externalComponent || this.rootTransition;
                  }
                }]), X;
              }(), Q = r("8bbf");
              function ie(X, z) {
                var Z = X[z];
                return Z ? Z() : [];
              }
              function ue(X) {
                var z = X.$slots, Z = X.realList, ce = X.getKey, Te = Z || [], Pe = ["header", "footer"].map(function(Xe) {
                  return ie(z, Xe);
                }), et = w(Pe, 2), Nt = et[0], gt = et[1], je = z.item;
                if (!je)
                  throw new Error("draggable element must have an item slot");
                var Me = Te.flatMap(function(Xe, wt) {
                  return je({
                    element: Xe,
                    index: wt
                  }).map(function($t) {
                    return $t.key = ce(Xe), $t.props = p(p({}, $t.props || {}), {}, {
                      "data-draggable": !0
                    }), $t;
                  });
                });
                if (Me.length !== Te.length)
                  throw new Error("Item slot must have only one child");
                return {
                  header: Nt,
                  footer: gt,
                  default: Me
                };
              }
              function de(X) {
                var z = st(X), Z = !We(X) && !z;
                return {
                  transition: z,
                  externalComponent: Z,
                  tag: Z ? Object(Q.resolveComponent)(X) : z ? Q.TransitionGroup : X
                };
              }
              function be(X) {
                var z = X.$slots, Z = X.tag, ce = X.realList, Te = X.getKey, Pe = ue({
                  $slots: z,
                  realList: ce,
                  getKey: Te
                }), et = de(Z);
                return new Y({
                  nodes: Pe,
                  root: et,
                  realList: ce
                });
              }
              function ve(X, z) {
                var Z = this;
                Object(Q.nextTick)(function() {
                  return Z.$emit(X.toLowerCase(), z);
                });
              }
              function _e(X) {
                var z = this;
                return function(Z, ce) {
                  if (z.realList !== null)
                    return z["onDrag".concat(X)](Z, ce);
                };
              }
              function pe(X) {
                var z = this, Z = _e.call(this, X);
                return function(ce, Te) {
                  Z.call(z, ce, Te), ve.call(z, X, ce);
                };
              }
              var Be = null, xe = {
                list: {
                  type: Array,
                  required: !1,
                  default: null
                },
                modelValue: {
                  type: Array,
                  required: !1,
                  default: null
                },
                itemKey: {
                  type: [String, Function],
                  required: !0
                },
                clone: {
                  type: Function,
                  default: function(z) {
                    return z;
                  }
                },
                tag: {
                  type: String,
                  default: "div"
                },
                move: {
                  type: Function,
                  default: null
                },
                componentData: {
                  type: Object,
                  required: !1,
                  default: null
                }
              }, Ae = ["update:modelValue", "change"].concat(S([].concat(S(re.manageAndEmit), S(re.emit)).map(function(X) {
                return X.toLowerCase();
              }))), Ke = Object(Q.defineComponent)({
                name: "draggable",
                inheritAttrs: !1,
                props: xe,
                emits: Ae,
                data: function() {
                  return {
                    error: !1
                  };
                },
                render: function() {
                  try {
                    this.error = !1;
                    var z = this.$slots, Z = this.$attrs, ce = this.tag, Te = this.componentData, Pe = this.realList, et = this.getKey, Nt = be({
                      $slots: z,
                      tag: ce,
                      realList: Pe,
                      getKey: et
                    });
                    this.componentStructure = Nt;
                    var gt = Et({
                      $attrs: Z,
                      componentData: Te
                    });
                    return Nt.render(Q.h, gt);
                  } catch (je) {
                    return this.error = !0, Object(Q.h)("pre", {
                      style: {
                        color: "red"
                      }
                    }, je.stack);
                  }
                },
                created: function() {
                  this.list !== null && this.modelValue !== null && P.a.error("modelValue and list props are mutually exclusive! Please set one or another.");
                },
                mounted: function() {
                  var z = this;
                  if (!this.error) {
                    var Z = this.$attrs, ce = this.$el, Te = this.componentStructure;
                    Te.updated();
                    var Pe = J({
                      $attrs: Z,
                      callBackBuilder: {
                        manageAndEmit: function(gt) {
                          return pe.call(z, gt);
                        },
                        emit: function(gt) {
                          return ve.bind(z, gt);
                        },
                        manage: function(gt) {
                          return _e.call(z, gt);
                        }
                      }
                    }), et = ce.nodeType === 1 ? ce : ce.parentElement;
                    this._sortable = new $.a(et, Pe), this.targetDomElement = et, et.__draggable_component__ = this;
                  }
                },
                updated: function() {
                  this.componentStructure.updated();
                },
                beforeUnmount: function() {
                  this._sortable !== void 0 && this._sortable.destroy();
                },
                computed: {
                  realList: function() {
                    var z = this.list;
                    return z || this.modelValue;
                  },
                  getKey: function() {
                    var z = this.itemKey;
                    return typeof z == "function" ? z : function(Z) {
                      return Z[z];
                    };
                  }
                },
                watch: {
                  $attrs: {
                    handler: function(z) {
                      var Z = this._sortable;
                      Z && we(z).forEach(function(ce) {
                        var Te = w(ce, 2), Pe = Te[0], et = Te[1];
                        Z.option(Pe, et);
                      });
                    },
                    deep: !0
                  }
                },
                methods: {
                  getUnderlyingVm: function(z) {
                    return this.componentStructure.getUnderlyingVm(z) || null;
                  },
                  getUnderlyingPotencialDraggableComponent: function(z) {
                    return z.__draggable_component__;
                  },
                  emitChanges: function(z) {
                    var Z = this;
                    Object(Q.nextTick)(function() {
                      return Z.$emit("change", z);
                    });
                  },
                  alterList: function(z) {
                    if (this.list) {
                      z(this.list);
                      return;
                    }
                    var Z = S(this.modelValue);
                    z(Z), this.$emit("update:modelValue", Z);
                  },
                  spliceList: function() {
                    var z = arguments, Z = function(Te) {
                      return Te.splice.apply(Te, S(z));
                    };
                    this.alterList(Z);
                  },
                  updatePosition: function(z, Z) {
                    var ce = function(Pe) {
                      return Pe.splice(Z, 0, Pe.splice(z, 1)[0]);
                    };
                    this.alterList(ce);
                  },
                  getRelatedContextFromMoveEvent: function(z) {
                    var Z = z.to, ce = z.related, Te = this.getUnderlyingPotencialDraggableComponent(Z);
                    if (!Te)
                      return {
                        component: Te
                      };
                    var Pe = Te.realList, et = {
                      list: Pe,
                      component: Te
                    };
                    if (Z !== ce && Pe) {
                      var Nt = Te.getUnderlyingVm(ce) || {};
                      return p(p({}, Nt), et);
                    }
                    return et;
                  },
                  getVmIndexFromDomIndex: function(z) {
                    return this.componentStructure.getVmIndexFromDomIndex(z, this.targetDomElement);
                  },
                  onDragStart: function(z) {
                    this.context = this.getUnderlyingVm(z.item), z.item._underlying_vm_ = this.clone(this.context.element), Be = z.item;
                  },
                  onDragAdd: function(z) {
                    var Z = z.item._underlying_vm_;
                    if (Z !== void 0) {
                      T(z.item);
                      var ce = this.getVmIndexFromDomIndex(z.newIndex);
                      this.spliceList(ce, 0, Z);
                      var Te = {
                        element: Z,
                        newIndex: ce
                      };
                      this.emitChanges({
                        added: Te
                      });
                    }
                  },
                  onDragRemove: function(z) {
                    if (R(this.$el, z.item, z.oldIndex), z.pullMode === "clone") {
                      T(z.clone);
                      return;
                    }
                    var Z = this.context, ce = Z.index, Te = Z.element;
                    this.spliceList(ce, 1);
                    var Pe = {
                      element: Te,
                      oldIndex: ce
                    };
                    this.emitChanges({
                      removed: Pe
                    });
                  },
                  onDragUpdate: function(z) {
                    T(z.item), R(z.from, z.item, z.oldIndex);
                    var Z = this.context.index, ce = this.getVmIndexFromDomIndex(z.newIndex);
                    this.updatePosition(Z, ce);
                    var Te = {
                      element: this.context.element,
                      oldIndex: Z,
                      newIndex: ce
                    };
                    this.emitChanges({
                      moved: Te
                    });
                  },
                  computeFutureIndex: function(z, Z) {
                    if (!z.element)
                      return 0;
                    var ce = S(Z.to.children).filter(function(Nt) {
                      return Nt.style.display !== "none";
                    }), Te = ce.indexOf(Z.related), Pe = z.component.getVmIndexFromDomIndex(Te), et = ce.indexOf(Be) !== -1;
                    return et || !Z.willInsertAfter ? Pe : Pe + 1;
                  },
                  onDragMove: function(z, Z) {
                    var ce = this.move, Te = this.realList;
                    if (!ce || !Te)
                      return !0;
                    var Pe = this.getRelatedContextFromMoveEvent(z), et = this.computeFutureIndex(Pe, z), Nt = p(p({}, this.context), {}, {
                      futureIndex: et
                    }), gt = p(p({}, z), {}, {
                      relatedContext: Pe,
                      draggedContext: Nt
                    });
                    return ce(gt, Z);
                  },
                  onDragEnd: function() {
                    Be = null;
                  }
                }
              }), ft = Ke;
              i.default = ft;
            }
          ),
          /***/
          fb6a: (
            /***/
            function(o, i, r) {
              var a = r("23e7"), l = r("861d"), u = r("e8b5"), d = r("23cb"), f = r("50c4"), p = r("fc6a"), h = r("8418"), m = r("b622"), v = r("1dde"), _ = r("ae40"), b = v("slice"), w = _("slice", { ACCESSORS: !0, 0: 0, 1: 2 }), y = m("species"), x = [].slice, N = Math.max;
              a({ target: "Array", proto: !0, forced: !b || !w }, {
                slice: function(O, $) {
                  var T = p(this), R = f(T.length), P = d(O, R), M = d($ === void 0 ? R : $, R), U, H, j;
                  if (u(T) && (U = T.constructor, typeof U == "function" && (U === Array || u(U.prototype)) ? U = void 0 : l(U) && (U = U[y], U === null && (U = void 0)), U === Array || U === void 0))
                    return x.call(T, P, M);
                  for (H = new (U === void 0 ? Array : U)(N(M - P, 0)), j = 0; P < M; P++, j++) P in T && h(H, j, T[P]);
                  return H.length = j, H;
                }
              });
            }
          ),
          /***/
          fc6a: (
            /***/
            function(o, i, r) {
              var a = r("44ad"), l = r("1d80");
              o.exports = function(u) {
                return a(l(u));
              };
            }
          ),
          /***/
          fdbc: (
            /***/
            function(o, i) {
              o.exports = {
                CSSRuleList: 0,
                CSSStyleDeclaration: 0,
                CSSValueList: 0,
                ClientRectList: 0,
                DOMRectList: 0,
                DOMStringList: 0,
                DOMTokenList: 1,
                DataTransferItemList: 0,
                FileList: 0,
                HTMLAllCollection: 0,
                HTMLCollection: 0,
                HTMLFormElement: 0,
                HTMLSelectElement: 0,
                MediaList: 0,
                MimeTypeArray: 0,
                NamedNodeMap: 0,
                NodeList: 1,
                PaintRequestList: 0,
                Plugin: 0,
                PluginArray: 0,
                SVGLengthList: 0,
                SVGNumberList: 0,
                SVGPathSegList: 0,
                SVGPointList: 0,
                SVGStringList: 0,
                SVGTransformList: 0,
                SourceBufferList: 0,
                StyleSheetList: 0,
                TextTrackCueList: 0,
                TextTrackList: 0,
                TouchList: 0
              };
            }
          ),
          /***/
          fdbf: (
            /***/
            function(o, i, r) {
              var a = r("4930");
              o.exports = a && !Symbol.sham && typeof Symbol.iterator == "symbol";
            }
          )
          /******/
        }).default
      );
    });
  }(hd)), hd.exports;
}
var ez = ZG();
const tz = /* @__PURE__ */ v9(ez), nz = { class: "nav-item" }, sz = ["onClick"], oz = { class: "ellipsis" }, rz = {
  __name: "FhirSystemsTabs",
  props: {
    elements: { type: Array, default: () => [] },
    active: { type: Object, default: () => {
    } },
    loading: { type: Boolean, default: !1 }
  },
  emits: ["update:elements", "system-selected"],
  setup(e, { emit: t }) {
    const n = t, s = e, o = I("-- no name --"), i = k({
      get: () => s.elements,
      set: (a) => n("update:elements", a)
    });
    async function r(a, l) {
      n("system-selected", a, l);
    }
    return (a, l) => (g(), se(C(tz), {
      class: "nav nav-tabs",
      tag: "ul",
      modelValue: i.value,
      "onUpdate:modelValue": l[0] || (l[0] = (u) => i.value = u),
      handle: ".handle",
      "item-key": "ehr_id"
    }, {
      item: B(({ element: u, index: d }) => {
        var f;
        return [
          c("li", nz, [
            c("span", {
              class: Se(["nav-link", {
                active: (u == null ? void 0 : u.ehr_id) === ((f = e.active) == null ? void 0 : f.ehr_id)
              }]),
              "aria-current": "page"
            }, [
              c("button", {
                type: "button",
                class: "btn btn-sm",
                onClick: Rt((p) => r(u, d), ["prevent"])
              }, [
                c("span", oz, F(u.ehr_name ?? o.value), 1)
              ], 8, sz),
              l[1] || (l[1] = c("button", {
                type: "button",
                class: "handle btn btn-sm visible-hover",
                style: { cursor: "move" }
              }, [
                c("i", { class: "fa fa-align-justify" })
              ], -1))
            ], 2)
          ])
        ];
      }),
      _: 1
    }, 8, ["modelValue"]));
  }
}, iz = /* @__PURE__ */ oe(rz, [["__scopeId", "data-v-d48fd07f"]]), az = ["innerHTML"], Eo = {
  __name: "ErrorList",
  props: {
    errors: { type: Array, default: () => [] }
  },
  setup(e) {
    return (t, n) => (g(), E("div", null, [
      (g(!0), E(G, null, ge(e.errors, (s, o) => (g(), E("small", {
        key: o,
        class: "d-block text-danger",
        innerHTML: s
      }, null, 8, az))), 128))
    ]));
  }
}, lz = { class: "d-flex gap-2" }, Kb = {
  __name: "AuthenticationParameterEntry",
  props: {
    name: { type: String, default: "" },
    value: { type: String, default: "" },
    context: { type: String, default: "" }
  },
  emits: ["update:name", "update:value", "update:context"],
  setup(e, { expose: t, emit: n }) {
    const s = wg({
      name: [no()],
      value: [no()]
    }), o = e, i = n, r = k(
      () => s({ name: l.value, value: u.value, context: d.value })
    ), a = k(() => r.value.errors()), l = k({
      get: () => o.name,
      set: (f) => i("update:name", f)
    }), u = k({
      get: () => o.value,
      set: (f) => i("update:value", f)
    }), d = k({
      get: () => o.context,
      set: (f) => i("update:context", f)
    });
    return t({ validation: r }), (f, p) => (g(), E("div", lz, [
      c("div", null, [
        L(c("input", {
          class: "form-control form-control-sm",
          type: "text",
          placeholder: "key...",
          "onUpdate:modelValue": p[0] || (p[0] = (h) => l.value = h)
        }, null, 512), [
          [Ve, l.value]
        ]),
        D(Eo, {
          errors: a.value.name
        }, null, 8, ["errors"])
      ]),
      c("div", null, [
        L(c("input", {
          class: "form-control form-control-sm",
          type: "text",
          placeholder: "value...",
          "onUpdate:modelValue": p[1] || (p[1] = (h) => u.value = h)
        }, null, 512), [
          [Ve, u.value]
        ]),
        D(Eo, {
          errors: a.value.value
        }, null, 8, ["errors"])
      ]),
      c("div", null, [
        L(c("select", {
          class: "form-select form-select-sm",
          "onUpdate:modelValue": p[2] || (p[2] = (h) => d.value = h)
        }, p[3] || (p[3] = [
          c("option", { value: "" }, "Always", -1),
          c("option", { value: "ehr" }, "ehr launch", -1),
          c("option", { value: "standalone" }, "standalone launch", -1)
        ]), 512), [
          [Qt, d.value]
        ])
      ]),
      fe(f.$slots, "default")
    ]));
  }
}, cz = { class: "my-2" }, uz = {
  key: 0,
  class: "fst-italic text-muted d-block"
}, dz = { class: "d-flex flex-column gap-2" }, fz = ["onClick"], pz = { class: "d-flex gap-2 justify-content-end" }, hz = ["onClick"], mz = ["onClick", "disabled"], vz = {
  __name: "AuthenticationParameterManager",
  props: { modelValue: { type: Array, default: () => [] } },
  emits: ["update:modelValue"],
  setup(e, { emit: t }) {
    const n = () => ({ name: "", value: "", context: "" }), s = e, o = t, i = I(), r = I({}), a = I(), l = k(
      () => {
        var h, m;
        return !((m = (h = a.value) == null ? void 0 : h.validation) != null && m.hasErrors());
      }
    ), u = k({
      get: () => s.modelValue,
      set: (h) => o("update:modelValue", h)
    });
    function d(h) {
      const m = u.value;
      m.push(h), u.value = [...m];
    }
    async function f() {
      r.value = n(), await i.value.show() && d(r.value);
    }
    function p(h) {
      const m = u.value, v = m.find((_) => _ === h);
      v < 0 || (m.splice(v, 1), u.value = [...m]);
    }
    return (h, m) => {
      var b;
      const v = le("b-modal"), _ = Ht("tt");
      return g(), E(G, null, [
        c("div", cz, [
          c("button", {
            type: "button",
            class: "btn btn-primary btn-sm",
            onClick: f
          }, [
            m[3] || (m[3] = c("i", { class: "fas fa-plus fa-fw me-1" }, null, -1)),
            L(c("span", null, null, 512), [
              [_, void 0, "cdis_custom_auth_params_05"]
            ]),
            m[4] || (m[4] = c("span", null, "...", -1))
          ])
        ]),
        ((b = u.value) == null ? void 0 : b.length) === 0 ? (g(), E("span", uz, "no params...")) : ne("", !0),
        c("div", dz, [
          (g(!0), E(G, null, ge(u.value, (w, y) => (g(), se(Kb, {
            key: `${y}`,
            name: w.name,
            "onUpdate:name": (x) => w.name = x,
            value: w.value,
            "onUpdate:value": (x) => w.value = x,
            context: w.context,
            "onUpdate:context": (x) => w.context = x
          }, {
            default: B(() => [
              c("div", null, [
                c("button", {
                  type: "button",
                  class: "btn btn-sm btn-danger",
                  onClick: (x) => p(w)
                }, m[5] || (m[5] = [
                  c("i", { class: "fas fa-trash fa-fw" }, null, -1)
                ]), 8, fz)
              ])
            ]),
            _: 2
          }, 1032, ["name", "onUpdate:name", "value", "onUpdate:value", "context", "onUpdate:context"]))), 128))
        ]),
        (g(), se(ns, { to: "body" }, [
          D(v, {
            ref_key: "newParamModal",
            ref: i
          }, {
            title: B(() => m[6] || (m[6] = [
              te("New Authentication Parameter")
            ])),
            footer: B(({ hide: w }) => [
              c("div", pz, [
                c("button", {
                  class: "btn btn-sm btn-secondary",
                  type: "button",
                  onClick: (y) => w(!1)
                }, m[7] || (m[7] = [
                  c("i", { class: "fas fa-times fa-fw me-1" }, null, -1),
                  c("span", null, "Cancel", -1)
                ]), 8, hz),
                c("button", {
                  class: "btn btn-sm btn-primary",
                  type: "button",
                  onClick: (y) => w(!0),
                  disabled: !l.value
                }, m[8] || (m[8] = [
                  c("i", { class: "fas fa-check fa-fw me-1" }, null, -1),
                  c("span", null, "OK", -1)
                ]), 8, mz)
              ])
            ]),
            default: B(() => [
              D(Kb, {
                ref_key: "newAuthParamRef",
                ref: a,
                name: r.value.name,
                "onUpdate:name": m[0] || (m[0] = (w) => r.value.name = w),
                value: r.value.value,
                "onUpdate:value": m[1] || (m[1] = (w) => r.value.value = w),
                context: r.value.context,
                "onUpdate:context": m[2] || (m[2] = (w) => r.value.context = w)
              }, null, 8, ["name", "value", "context"])
            ]),
            _: 1
          }, 512)
        ]))
      ], 64);
    };
  }
}, gz = { class: "input-group" }, _z = ["type"], yz = {
  __name: "SecretInput",
  props: {
    modelValue: { type: String, default: "" },
    showText: { type: String, default: "show" },
    hideText: { type: String, default: "hide" }
  },
  emits: ["update:modelValue"],
  setup(e, { emit: t }) {
    const n = e, s = t, o = k({
      get: () => n.modelValue,
      set: (l) => s("update:modelValue", l)
    }), i = k(() => r.value === "password" ? n.showText : n.hideText), r = I("password");
    function a() {
      r.value === "password" ? r.value = "text" : r.value = "password";
    }
    return (l, u) => (g(), E("div", gz, [
      L(c("input", bn({
        type: r.value,
        class: "form-control form-control-sm",
        autocomplete: "one-time-code",
        "onUpdate:modelValue": u[0] || (u[0] = (d) => o.value = d)
      }, { ...l.$attrs }), null, 16, _z), [
        [Vv, o.value]
      ]),
      c("button", {
        type: "button",
        class: "btn btn-sm btn-outline-secondary",
        onClick: a
      }, F(i.value), 1)
    ]));
  }
}, bz = { class: "d-flex gap-2" }, Ez = ["onClick"], wz = { class: "d-block" }, Sz = { class: "fst-italic text-break" }, xz = { class: "d-block" }, Nz = { class: "fst-italic text-break" }, Cz = {
  __name: "CapabilityStatementParser",
  emits: ["copy"],
  setup(e, { emit: t }) {
    const n = fs(), s = t, o = I(!1), i = I(), r = I(), a = I(), l = I();
    async function u(p) {
      var m, v, _, b, w, y, x;
      if (typeof p != "string") return;
      const h = (N) => N.replace(/\/+$/, "") + "";
      r.value = `${h(p)}/metadata`;
      try {
        o.value = !0;
        const N = await vn.get(r.value, {
          headers: { accept: "Application/JSON" }
        }), S = (y = (w = (b = (_ = (v = (m = N == null ? void 0 : N.data) == null ? void 0 : m.rest) == null ? void 0 : v[0]) == null ? void 0 : _.security) == null ? void 0 : b.extension) == null ? void 0 : w[0]) == null ? void 0 : y.extension;
        a.value = null, l.value = null;
        for (const $ of S)
          ($ == null ? void 0 : $.url) === "authorize" ? a.value = $ == null ? void 0 : $.valueUri : ($ == null ? void 0 : $.url) === "token" && (l.value = $ == null ? void 0 : $.valueUri);
        const O = [];
        return a.value || O.push("Could not find the autorize URL"), l.value || O.push("Could not find the token URL"), (O == null ? void 0 : O.length) === 0 ? (x = i.value) == null ? void 0 : x.show() : d(O.join(`
`));
      } catch (N) {
        d(N);
      } finally {
        o.value = !1;
      }
    }
    function d(p) {
      n.alert({
        title: "Error",
        body: `<pre>There was an error fetching the capability statement:
${p}</pre>`
      });
    }
    function f() {
      var p;
      s("copy", { authorizeURL: a.value, tokenURL: l.value }), (p = i.value) == null || p.hide();
    }
    return (p, h) => {
      const m = le("b-modal");
      return g(), E("div", null, [
        fe(p.$slots, "default", {
          parse: u,
          loading: o.value
        }),
        (g(), se(ns, { to: "body" }, [
          D(m, {
            ref_key: "capabilityStatementModal",
            ref: i,
            size: "lg"
          }, {
            header: B(() => h[0] || (h[0] = [
              c("i", { class: "fas fa-circle-check fa-fw me-1 text-success" }, null, -1),
              c("span", null, "Success", -1)
            ])),
            footer: B(({ hide: v }) => [
              c("div", bz, [
                c("button", {
                  class: "btn btn-sm btn-secondary",
                  type: "button",
                  onClick: v
                }, h[1] || (h[1] = [
                  c("i", { class: "fas fa-times fa-fw me-1" }, null, -1),
                  c("span", null, "Close", -1)
                ]), 8, Ez),
                c("button", {
                  class: "btn btn-sm btn-primary",
                  type: "button",
                  onClick: f
                }, h[2] || (h[2] = [
                  c("i", { class: "fas fa-copy fa-fw me-1" }, null, -1),
                  c("span", null, "Copy", -1)
                ]))
              ])
            ]),
            default: B(() => [
              c("div", null, [
                c("p", null, [
                  h[3] || (h[3] = te(" The FHIR URLs below for your Authorize endpoint and Token endpoint were found from the FHIR Capability Statement (")),
                  c("i", null, F(r.value), 1),
                  h[4] || (h[4] = te("). "))
                ]),
                h[7] || (h[7] = c("p", null, " You may copy these URLs into their corresponding text boxes on this page. ", -1)),
                c("div", wz, [
                  h[5] || (h[5] = c("span", { class: "fw-bold me-2 text-nowrap" }, "Authorize URL:", -1)),
                  c("span", Sz, F(a.value), 1)
                ]),
                c("div", xz, [
                  h[6] || (h[6] = c("span", { class: "fw-bold me-2 text-nowrap" }, "Token URL:", -1)),
                  c("span", Nz, F(l.value), 1)
                ])
              ])
            ]),
            _: 1
          }, 512)
        ]))
      ]);
    };
  }
}, Oz = {
  __name: "CopyWrapper",
  setup(e) {
    const t = gl(), n = an();
    function s(o, i = !0, r = {}) {
      t.copy(o), i && n.toast({
        title: "Success",
        body: "Text was copied to the clipboard",
        ...r
      });
    }
    return (o, i) => fe(o.$slots, "default", { copy: s });
  }
}, Tz = { class: "container-fluid" }, $z = { action: "" }, kz = { class: "row d-none" }, Dz = { class: "col" }, Rz = ["for"], Iz = { class: "col" }, Az = ["id"], Mz = { class: "row" }, Pz = { class: "col" }, Lz = ["for"], Vz = { class: "col" }, Fz = ["id"], Uz = { class: "text-muted" }, jz = { class: "row" }, Bz = { class: "col" }, Hz = ["for"], Yz = { class: "col" }, Wz = { class: "input-group" }, Gz = ["id", "value"], zz = ["onClick"], Kz = { class: "text-muted" }, Xz = { class: "row" }, qz = { class: "col" }, Jz = { class: "subsection-title" }, Qz = { class: "d-block" }, Zz = { class: "d-block" }, eK = { class: "col" }, tK = { class: "col" }, nK = ["for"], sK = { class: "col" }, oK = ["id"], rK = { class: "col" }, iK = ["for"], aK = { class: "col" }, lK = { class: "row" }, cK = { class: "col" }, uK = { class: "subsection-title" }, dK = { class: "d-block" }, fK = { class: "d-block" }, pK = { class: "d-block text-muted" }, hK = { class: "row ms-5 grid-auto-1fr" }, mK = ["for"], vK = ["id"], gK = { class: "text-muted" }, _K = ["onClick", "disabled"], yK = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw me-1"
}, bK = {
  key: 1,
  class: "fas fa-magnifying-glass fa-fw me-1"
}, EK = ["for"], wK = ["id"], SK = ["for"], xK = ["id"], NK = { class: "row" }, CK = { class: "col" }, OK = ["for"], TK = { class: "d-block" }, $K = { class: "col" }, kK = ["id"], DK = { class: "text-muted" }, RK = { class: "d-block" }, IK = { class: "d-block" }, AK = { class: "row" }, MK = { class: "col" }, PK = ["for"], LK = { class: "d-block" }, VK = { class: "col" }, FK = ["id"], UK = { class: "text-muted" }, jK = { class: "d-block" }, BK = { class: "text-primary" }, HK = { class: "d-block" }, YK = { class: "row" }, WK = { class: "subsection-title" }, GK = { class: "subsection-description" }, zK = {
  __name: "FhirSettingsForm",
  props: /* @__PURE__ */ jn({
    // data: { type: Object, default: () => ({}) },
    redirectUrl: { type: String, default: () => "" }
  }, {
    data: { default: () => ({}) },
    dataModifiers: {}
  }),
  emits: /* @__PURE__ */ jn(["update:data"], ["update:data"]),
  setup(e, { emit: t }) {
    const n = At(e, "data"), s = I(hg());
    function o({ authorizeURL: i, tokenURL: r }) {
      n.value.fhir_authorize_url = i, n.value.fhir_token_url = r;
    }
    return (i, r) => {
      const a = Ht("tt");
      return g(), E("div", null, [
        c("section", Tz, [
          c("form", $z, [
            c("div", kz, [
              c("div", Dz, [
                c("label", {
                  for: `${s.value}-order`
                }, "order", 8, Rz)
              ]),
              c("div", Iz, [
                L(c("input", {
                  type: "text",
                  class: "form-control form-control-sm",
                  id: `${s.value}-input-order`,
                  "onUpdate:modelValue": r[0] || (r[0] = (l) => n.value.order = l)
                }, null, 8, Az), [
                  [Ve, n.value.order]
                ])
              ])
            ]),
            c("div", Mz, [
              c("div", Pz, [
                L((g(), E("label", {
                  for: `${s.value}-input-ehr_name`
                }, r[10] || (r[10] = [
                  te("ehr_name")
                ]), 8, Lz)), [
                  [a, void 0, "ws_214"]
                ]),
                L(c("p", null, null, 512), [
                  [a, void 0, "ws_235"]
                ])
              ]),
              c("div", Vz, [
                L(c("input", {
                  type: "text",
                  class: "form-control form-control-sm",
                  id: `${s.value}-input-ehr_name`,
                  "onUpdate:modelValue": r[1] || (r[1] = (l) => n.value.ehr_name = l)
                }, null, 8, Fz), [
                  [Ve, n.value.ehr_name]
                ]),
                c("small", Uz, [
                  L(c("span", null, null, 512), [
                    [a, void 0, "control_center_4881"]
                  ])
                ])
              ])
            ]),
            c("div", jz, [
              c("div", Bz, [
                L((g(), E("label", {
                  for: `${s.value}-input-redirect-url`
                }, r[11] || (r[11] = [
                  te("redirect URL")
                ]), 8, Hz)), [
                  [a, void 0, "ws_237"]
                ]),
                L(c("p", null, null, 512), [
                  [a, void 0, "ws_238"]
                ])
              ]),
              c("div", Yz, [
                c("div", Wz, [
                  c("input", {
                    type: "text",
                    class: "form-control form-control-sm",
                    id: `${s.value}-input-redirect-url`,
                    value: e.redirectUrl,
                    disabled: ""
                  }, null, 8, Gz),
                  D(Oz, null, {
                    default: B(({ copy: l }) => [
                      c("button", {
                        type: "button",
                        class: "btn btn-sm btn-outline-secondary",
                        onClick: Rt((u) => l(e.redirectUrl), ["prevent"])
                      }, r[12] || (r[12] = [
                        c("i", { class: "fas fa-copy fa-fw" }, null, -1)
                      ]), 8, zz)
                    ]),
                    _: 1
                  })
                ]),
                c("small", Kz, [
                  L(c("span", null, null, 512), [
                    [a, void 0, "ws_239"]
                  ])
                ])
              ])
            ]),
            c("div", Xz, [
              c("div", qz, [
                c("div", Jz, [
                  L(c("span", Qz, null, 512), [
                    [a, void 0, "ws_219"]
                  ])
                ]),
                L(c("span", Zz, null, 512), [
                  [a, void 0, "ws_220"]
                ])
              ]),
              c("div", eK, [
                c("div", tK, [
                  L((g(), E("label", {
                    for: `${s.value}-input-client_id`
                  }, r[13] || (r[13] = [
                    te("client_id")
                  ]), 8, nK)), [
                    [a, void 0, "ws_221"]
                  ])
                ]),
                c("div", sK, [
                  L(c("input", {
                    type: "text",
                    class: "form-control form-control-sm",
                    id: `${s.value}-input-client_id`,
                    autocomplete: "one-time-code",
                    "onUpdate:modelValue": r[2] || (r[2] = (l) => n.value.client_id = l)
                  }, null, 8, oK), [
                    [Ve, n.value.client_id]
                  ])
                ]),
                c("div", rK, [
                  L((g(), E("label", {
                    for: `${s.value}-client_secret`
                  }, r[14] || (r[14] = [
                    te("client_secret")
                  ]), 8, iK)), [
                    [a, void 0, "ws_222"]
                  ])
                ]),
                c("div", aK, [
                  D(yz, {
                    id: `${s.value}-client_secret`,
                    modelValue: n.value.client_secret,
                    "onUpdate:modelValue": r[3] || (r[3] = (l) => n.value.client_secret = l),
                    "show-text": C(ls)("ws_223")
                  }, null, 8, ["id", "modelValue", "show-text"])
                ])
              ])
            ]),
            c("div", lK, [
              c("div", cK, [
                c("div", uK, [
                  L(c("span", dK, null, 512), [
                    [a, void 0, "ws_224"]
                  ])
                ]),
                L(c("span", fK, null, 512), [
                  [a, void 0, "ws_225"]
                ]),
                c("small", pK, [
                  L(c("span", null, null, 512), [
                    [a, void 0, "ws_260"]
                  ])
                ])
              ])
            ]),
            c("div", hK, [
              c("div", null, [
                L((g(), E("label", {
                  for: `${s.value}-input-fhir_base_url`
                }, r[15] || (r[15] = [
                  te("fhir_base_url")
                ]), 8, mK)), [
                  [a, void 0, "ws_228"]
                ])
              ]),
              c("div", null, [
                L(c("input", {
                  type: "text",
                  class: "form-control form-control-sm",
                  id: `${s.value}-input-fhir_base_url`,
                  "onUpdate:modelValue": r[4] || (r[4] = (l) => n.value.fhir_base_url = l)
                }, null, 8, vK), [
                  [Ve, n.value.fhir_base_url]
                ]),
                c("small", gK, [
                  L(c("span", null, null, 512), [
                    [a, void 0, "ws_229"]
                  ])
                ]),
                D(Cz, { onCopy: o }, {
                  default: B(({ parse: l, loading: u }) => [
                    c("button", {
                      type: "button",
                      class: "btn btn-sm btn-primary mt-2",
                      onClick: (d) => l(n.value.fhir_base_url),
                      disabled: u || !n.value.fhir_base_url
                    }, [
                      u ? (g(), E("i", yK)) : (g(), E("i", bK)),
                      L(c("span", null, null, 512), [
                        [a, void 0, "ws_231"]
                      ])
                    ], 8, _K)
                  ]),
                  _: 1
                })
              ]),
              c("div", null, [
                L((g(), E("label", {
                  for: `${s.value}-input-fhir_token_url`
                }, r[16] || (r[16] = [
                  te("fhir_token_url")
                ]), 8, EK)), [
                  [a, void 0, "ws_226"]
                ])
              ]),
              c("div", null, [
                L(c("input", {
                  type: "text",
                  class: "form-control form-control-sm",
                  id: `${s.value}-input-fhir_token_url`,
                  "onUpdate:modelValue": r[5] || (r[5] = (l) => n.value.fhir_token_url = l)
                }, null, 8, wK), [
                  [Ve, n.value.fhir_token_url]
                ])
              ]),
              c("div", null, [
                L((g(), E("label", {
                  for: `${s.value}-input-fhir_authorize_url`
                }, r[17] || (r[17] = [
                  te("fhir_authorize_url")
                ]), 8, SK)), [
                  [a, void 0, "ws_227"]
                ])
              ]),
              c("div", null, [
                L(c("input", {
                  type: "text",
                  class: "form-control form-control-sm",
                  id: `${s.value}-input-fhir_authorize_url`,
                  "onUpdate:modelValue": r[6] || (r[6] = (l) => n.value.fhir_authorize_url = l)
                }, null, 8, xK), [
                  [Ve, n.value.fhir_authorize_url]
                ])
              ])
            ]),
            c("div", NK, [
              c("div", CK, [
                L((g(), E("label", {
                  for: `${s.value}-input-fhir_identity_provider`
                }, r[18] || (r[18] = [
                  te("fhir_identity_provider")
                ]), 8, OK)), [
                  [a, void 0, "fhir_identity_provider_title"]
                ]),
                L(c("span", TK, null, 512), [
                  [a, void 0, "fhir_identity_provider_subtitle"]
                ])
              ]),
              c("div", $K, [
                L(c("input", {
                  type: "text",
                  class: "form-control form-control-sm",
                  id: `${s.value}-input-fhir_identity_provider`,
                  "onUpdate:modelValue": r[7] || (r[7] = (l) => n.value.fhir_identity_provider = l)
                }, null, 8, kK), [
                  [Ve, n.value.fhir_identity_provider]
                ]),
                c("small", DK, [
                  L(c("span", RK, null, 512), [
                    [a, void 0, "fhir_identity_provider_description"]
                  ]),
                  L(c("span", IK, null, 512), [
                    [a, void 0, "fhir_identity_provider_description2"]
                  ])
                ])
              ])
            ]),
            c("div", AK, [
              c("div", MK, [
                L((g(), E("label", {
                  for: `${s.value}-input-patient_identifier_string`
                }, r[19] || (r[19] = [
                  te("patient_identifier_string")
                ]), 8, PK)), [
                  [a, void 0, "ws_217"]
                ]),
                L(c("span", LK, null, 512), [
                  [a, void 0, "ws_218"]
                ])
              ]),
              c("div", VK, [
                L(c("input", {
                  type: "text",
                  class: "form-control form-control-sm",
                  id: `${s.value}-input-patient_identifier_string`,
                  "onUpdate:modelValue": r[8] || (r[8] = (l) => n.value.patient_identifier_string = l)
                }, null, 8, FK), [
                  [Ve, n.value.patient_identifier_string]
                ]),
                c("small", UK, [
                  L(c("span", jK, null, 512), [
                    [a, void 0, "control_center_4882"]
                  ])
                ]),
                c("small", BK, [
                  L(c("span", HK, null, 512), [
                    [a, void 0, "control_center_4883"]
                  ])
                ])
              ])
            ]),
            c("div", YK, [
              c("div", WK, [
                L(c("span", null, null, 512), [
                  [a, void 0, "cdis_custom_auth_params_01"]
                ])
              ]),
              c("div", GK, [
                L(c("span", null, null, 512), [
                  [a, void 0, "cdis_custom_auth_params_02"]
                ]),
                L(c("span", null, null, 512), [
                  [a, void 0, "cdis_custom_auth_params_04"]
                ])
              ]),
              D(vz, {
                modelValue: n.value.fhir_custom_auth_params,
                "onUpdate:modelValue": r[9] || (r[9] = (l) => n.value.fhir_custom_auth_params = l)
              }, null, 8, ["modelValue"])
            ])
          ])
        ])
      ]);
    };
  }
}, Xb = /* @__PURE__ */ oe(zK, [["__scopeId", "data-v-19851c4f"]]);
class KK {
  constructor() {
    this.events = {};
  }
  on(t, n) {
    this.events[t] || (this.events[t] = []), this.events[t].push(n);
  }
  off(t, n) {
    this.events[t] && (this.events[t] = this.events[t].filter((s) => s !== n));
  }
  emit(t, ...n) {
    this.events[t] && this.events[t].forEach((s) => s(...n));
  }
}
const _N = ({ multiple: e = !1 } = {}) => {
  const t = new KK();
  function n(r) {
    return new Promise((l, u) => {
      r || u();
      var d = new FileReader();
      d.onload = (f) => {
        var p = f.target.result;
        l(p);
      }, d.readAsText(r);
    });
  }
  async function s(r) {
    const a = r.target, l = (a == null ? void 0 : a.files) ?? [];
    if (l.length === 0) return;
    const u = [];
    for (const d of l) {
      const f = await n(d);
      u.push(f);
    }
    t.emit("files-read", u);
  }
  const o = () => {
    const r = document.createElement("input");
    return r.setAttribute("type", "file"), e && r.setAttribute("multiple", !0), r.style.display = "none", r.addEventListener("change", s), document.body.appendChild(r), r;
  };
  let i = null;
  return {
    async select() {
      return new Promise((a, l) => {
        const u = (d) => {
          a(d), t.off("files-read", u), document.body.removeChild(i), i = null;
        };
        i || (i = o()), i.click(), t.on("files-read", u);
      });
    }
  };
}, XK = { class: "p-2 fhir-system-page" }, qK = { class: "d-flex gap-2 fhir-system-actions border-bottom py-2" }, JK = { class: "dropdown" }, QK = { class: "dropdown-menu" }, ZK = { class: "p-2 border-top" }, eX = { class: "d-flex justify-content-end mt-2 footer py-2 border-top" }, tX = {
  key: 0,
  class: "btn btn-sm btn-primary",
  disabled: ""
}, nX = ["disabled"], sX = { class: "d-flex justify-content-end gap-2" }, oX = ["onClick"], rX = {
  __name: "FhirSystemsPage",
  setup(e) {
    const t = Eg(), n = ru(), s = bg(), o = fs(), i = an(), r = _N(), { loading: a, form: l, current: u } = he(t), d = k(() => s.redirectURL), f = k(() => n.savePending), p = k({
      get: () => t.list,
      set: (O) => t.list = O
    }), h = I(), m = I({});
    async function v(O, $) {
      t.setCurrent(O);
    }
    async function _() {
      var O;
      try {
        const $ = (O = u.value) == null ? void 0 : O.ehr_id, T = await t.save();
        await n.loadSettings();
        const R = t.findByEhrId($);
        if (!R) return;
        t.setCurrent(R), i.toast({ title: "Success", body: "Settings saved" });
      } catch ($) {
        const T = Gs($);
        i.toast({ title: "Error", body: T });
      }
    }
    function b() {
      var O;
      m.value = t.makeNewSystem(), (O = h.value) == null || O.show();
    }
    async function w() {
      var O;
      try {
        const $ = await t.add(m.value);
        i.toast({ title: "Success", body: "New FHIR system created" }), await n.loadSettings();
      } catch ($) {
        const T = Gs($);
        i.toast({ title: "Error", body: T });
      } finally {
        (O = h.value) == null || O.hide();
      }
    }
    async function y() {
      if (!await o.confirm({
        title: "Confirm delete",
        body: "Are you sure you want to delete this element?"
      })) return;
      const $ = u.value, T = $ == null ? void 0 : $.ehr_id;
      T < 0 ? t.remove($) : (await t.delete(T), await n.loadSettings()), i.toast({
        title: "Success",
        body: "The settings were removed successfully."
      });
    }
    async function x() {
      const O = await r.select();
      N(O);
    }
    function N(O) {
      var T;
      if ((O == null ? void 0 : O.length) < 1) {
        console.error("no files selected");
        return;
      }
      const $ = O == null ? void 0 : O[0];
      try {
        const R = JSON.parse($);
        m.value = R, (T = h.value) == null || T.show(), i.toast({
          title: "Import Successful",
          body: "The file was imported. Please review the data before saving."
        });
      } catch (R) {
        i.toast({
          title: "Import Error",
          body: "There was an error importing the file. Please make sure to select a valid JSON file."
        }), console.error(R);
      }
    }
    function S() {
      const O = t.current;
      if (!O) return;
      const $ = JSON.stringify(O), T = `${O.ehr_name}.json`;
      rp($, {
        fileName: T
      }), i.toast({
        title: "Export Successful",
        body: `The setttings have been exported as '${T}'.`
      });
    }
    return ii(() => {
    }), (O, $) => {
      const T = le("b-modal");
      return g(), E("div", XK, [
        $[13] || ($[13] = Av("<p data-v-cd3c99d0> This interface enables the connection of REDCap with multiple FHIR (Fast Healthcare Interoperability Resources) systems. FHIR is a standard for electronic healthcare information exchange, while SMART on FHIR provides specifications for integrating apps with Electronic Health Records using FHIR standards and OAuth2 security. </p><h6 data-v-cd3c99d0>Using This Page:</h6><ol data-v-cd3c99d0><li data-v-cd3c99d0><strong data-v-cd3c99d0>Navigation Tabs:</strong> Each tab corresponds to a different FHIR system. Select a tab to view or edit its settings. </li><li data-v-cd3c99d0><strong data-v-cd3c99d0>FHIR System Settings:</strong> In each tab, fill in the necessary information for connecting to a FHIR system. </li><li data-v-cd3c99d0><strong data-v-cd3c99d0>Adding a New FHIR System:</strong> Click the button next to the navigation tabs to add a new system. A new tab will appear for entering the new system&#39;s settings. </li><li data-v-cd3c99d0><strong data-v-cd3c99d0>Reorder the FHIR Systems:</strong> Drag and drop a tab to change the order of the FHIR systems. After changing the order, click the save icon to persist the change. The first one will be used as the default for projects where a specific FHIR system is not selected. </li></ol>", 3)),
        c("div", qK, [
          c("div", JK, [
            $[5] || ($[5] = c("button", {
              class: "btn btn-secondary dropdown-toggle",
              type: "button",
              id: "dropdownMenuButton1",
              "data-bs-toggle": "dropdown",
              "aria-expanded": "false"
            }, [
              c("i", { class: "fas fa-cog fa-fw" })
            ], -1)),
            c("ul", QK, [
              c("li", null, [
                c("a", {
                  class: "dropdown-item",
                  href: "#",
                  onClick: Rt(x, ["prevent"])
                }, $[3] || ($[3] = [
                  c("i", { class: "fas fa-file-import fa-fw me-1" }, null, -1),
                  c("span", null, "Import", -1)
                ]))
              ]),
              c("li", null, [
                c("a", {
                  class: "dropdown-item",
                  href: "#",
                  onClick: Rt(S, ["prevent"])
                }, $[4] || ($[4] = [
                  c("i", { class: "fas fa-file-export fa-fw me-1" }, null, -1),
                  c("span", null, "Export", -1)
                ]))
              ])
            ])
          ]),
          c("div", { class: "ms-auto d-flex gap-2" }, [
            c("button", {
              type: "button",
              class: "btn btn-sm btn-danger",
              onClick: y
            }, $[6] || ($[6] = [
              c("i", { class: "fas fa-trash fa-fw me-1" }, null, -1),
              c("span", null, "Delete", -1)
            ]))
          ]),
          c("button", {
            type: "button",
            class: "btn btn-sm btn-success",
            onClick: b
          }, $[7] || ($[7] = [
            c("i", { class: "fas fa-plus fa-fw me-1" }, null, -1),
            c("span", null, "Add", -1)
          ]))
        ]),
        c("div", null, [
          D(iz, {
            elements: p.value,
            "onUpdate:elements": $[0] || ($[0] = (R) => p.value = R),
            active: C(u),
            "save-pending": f.value,
            loading: C(a),
            onSystemSelected: v
          }, null, 8, ["elements", "active", "save-pending", "loading"]),
          c("div", ZK, [
            D(Xb, {
              data: C(l),
              "onUpdate:data": $[1] || ($[1] = (R) => ut(l) ? l.value = R : null),
              "redirect-url": d.value
            }, null, 8, ["data", "redirect-url"]),
            c("div", eX, [
              C(a) ? (g(), E("button", tX, $[8] || ($[8] = [
                c("i", { class: "fas fa-spinner fa-spin fa-fw me-1" }, null, -1),
                c("span", null, "Loading...", -1)
              ]))) : (g(), E("button", {
                key: 1,
                class: "btn btn-sm btn-primary",
                onClick: _,
                disabled: !f.value
              }, $[9] || ($[9] = [
                c("i", { class: "fas fa-save fa-fw me-1" }, null, -1),
                c("span", null, "Save", -1)
              ]), 8, nX))
            ])
          ])
        ]),
        D(T, {
          ref_key: "newSystemModal",
          ref: h,
          size: "xl"
        }, {
          title: B(() => $[10] || ($[10] = [
            te("New FHIR System")
          ])),
          footer: B(({ hide: R }) => [
            c("div", sX, [
              c("button", {
                class: "btn btn-sm btn-secondary",
                type: "button",
                onClick: R
              }, $[11] || ($[11] = [
                c("i", { class: "fas fa-times fa-fw me-1" }, null, -1),
                c("span", null, "Cancel", -1)
              ]), 8, oX),
              c("button", {
                class: "btn btn-sm btn-primary",
                type: "button",
                onClick: w
              }, $[12] || ($[12] = [
                c("i", { class: "fas fa-save fa-fw me-1" }, null, -1),
                c("span", null, "Save", -1)
              ]))
            ])
          ]),
          default: B(() => [
            D(Xb, {
              data: m.value,
              "onUpdate:data": $[2] || ($[2] = (R) => m.value = R),
              "redirect-url": d.value
            }, null, 8, ["data", "redirect-url"])
          ]),
          _: 1
        }, 512)
      ]);
    };
  }
}, iX = /* @__PURE__ */ oe(rX, [["__scopeId", "data-v-cd3c99d0"]]), aX = { class: "table table-bordered table-hover table-striped" }, lX = ["onMouseenter", "onMouseleave", "onMouseover"], cX = { class: "text-center" }, uX = { class: "text-center" }, dX = { class: "text-center" }, fX = { class: "ellipsis" }, pX = {
  __name: "CustomMappingTable",
  props: {
    items: { type: Array, default: () => [] }
  },
  emits: ["mouseenter-row", "mouseleave-row", "mouseover-row"],
  setup(e, { emit: t }) {
    const n = t, s = {
      props: {
        value: { type: Boolean, default: !1 }
      },
      setup(a, { slots: l }) {
        return () => Co("i", {
          class: `fa-regular fa-fw ${(a == null ? void 0 : a.value) === !0 ? "fa-square-check" : "fa-square"}`,
          innerHTML: ""
        });
      }
    };
    function o(a, l, u) {
      n("mouseover-row", { event: a, item: l, index: u });
    }
    function i(a, l, u) {
      n("mouseenter-row", { event: a, item: l, index: u });
    }
    function r(a, l, u) {
      n("mouseleave-row", { event: a, item: l, index: u });
    }
    return (a, l) => (g(), E("div", null, [
      fe(a.$slots, "before-table", {}, void 0, !0),
      c("table", aX, [
        c("thead", null, [
          c("tr", null, [
            l[0] || (l[0] = c("th", null, "field", -1)),
            l[1] || (l[1] = c("th", null, "label", -1)),
            l[2] || (l[2] = c("th", null, "description", -1)),
            l[3] || (l[3] = c("th", null, "category", -1)),
            l[4] || (l[4] = c("th", null, "subcategory", -1)),
            l[5] || (l[5] = c("th", null, "temporal", -1)),
            l[6] || (l[6] = c("th", null, "identifier", -1)),
            l[7] || (l[7] = c("th", null, "disabled", -1)),
            l[8] || (l[8] = c("th", null, "disabled_reason", -1)),
            fe(a.$slots, "after-header-cell", { items: e.items }, void 0, !0)
          ])
        ]),
        c("tbody", null, [
          (g(!0), E(G, null, ge(e.items, (u, d) => (g(), E("tr", {
            key: u == null ? void 0 : u.field,
            class: "position-relative",
            onMouseenter: (f) => i(f, u, d),
            onMouseleave: (f) => r(f, u, d),
            onMouseover: (f) => o(f, u, d)
          }, [
            c("td", null, F(u == null ? void 0 : u.field), 1),
            c("td", null, F(u == null ? void 0 : u.label), 1),
            c("td", null, F(u == null ? void 0 : u.description), 1),
            c("td", null, F(u == null ? void 0 : u.category), 1),
            c("td", null, F(u == null ? void 0 : u.subcategory), 1),
            c("td", cX, [
              D(s, {
                value: u == null ? void 0 : u.temporal
              }, null, 8, ["value"])
            ]),
            c("td", uX, [
              D(s, {
                value: u == null ? void 0 : u.identifier
              }, null, 8, ["value"])
            ]),
            c("td", dX, [
              D(s, {
                value: u == null ? void 0 : u.disabled
              }, null, 8, ["value"])
            ]),
            c("td", null, [
              c("div", fX, F(u == null ? void 0 : u.disabled_reason), 1)
            ])
          ], 40, lX))), 128))
        ])
      ]),
      fe(a.$slots, "default", {}, void 0, !0)
    ]));
  }
}, hX = /* @__PURE__ */ oe(pX, [["__scopeId", "data-v-dad9cf5c"]]), mX = { action: "" }, vX = { class: "mb-3" }, gX = { class: "mb-3" }, _X = { class: "mb-3" }, yX = { class: "mb-3" }, bX = ["value"], EX = { class: "mb-3" }, wX = { class: "mb-3" }, SX = { class: "d-flex gap-2" }, xX = { class: "form-check" }, NX = { class: "form-check" }, CX = { class: "form-check" }, OX = { class: "mb-3" }, TX = ["disabled", "placeholder"], $X = {
  __name: "CustomMappingForm",
  props: {
    data: { type: Object, default: () => ({}) },
    errors: { type: Object, default: () => ({}) },
    validCategories: { type: Array, default: () => [] }
  },
  emits: ["update:data"],
  setup(e, { emit: t }) {
    const n = e, s = t, o = k({
      get: () => n.data,
      set: (i) => s("update:data", i)
    });
    return (i, r) => {
      var a, l, u, d, f, p, h, m;
      return g(), E("form", mX, [
        c("div", vX, [
          r[9] || (r[9] = c("label", {
            class: "form-label",
            for: "input-field"
          }, "field", -1)),
          L(c("input", {
            class: "form-control form-control-sm",
            type: "text",
            "onUpdate:modelValue": r[0] || (r[0] = (v) => o.value.field = v),
            id: "input-field",
            required: "",
            placeholder: "Unique identifier..."
          }, null, 512), [
            [Ve, o.value.field]
          ]),
          D(Eo, {
            errors: (a = e.errors) == null ? void 0 : a.field
          }, null, 8, ["errors"])
        ]),
        c("div", gX, [
          r[10] || (r[10] = c("label", {
            class: "form-label",
            for: "input-label"
          }, "label", -1)),
          L(c("input", {
            class: "form-control form-control-sm",
            type: "text",
            "onUpdate:modelValue": r[1] || (r[1] = (v) => o.value.label = v),
            id: "input-label",
            placeholder: "Short name..."
          }, null, 512), [
            [Ve, o.value.label]
          ]),
          D(Eo, {
            errors: (l = e.errors) == null ? void 0 : l.label
          }, null, 8, ["errors"])
        ]),
        c("div", _X, [
          r[11] || (r[11] = c("label", {
            class: "form-label",
            for: "input-description"
          }, "description", -1)),
          L(c("input", {
            class: "form-control form-control-sm",
            type: "text",
            "onUpdate:modelValue": r[2] || (r[2] = (v) => o.value.description = v),
            id: "input-description",
            placeholder: "Fully-specified name..."
          }, null, 512), [
            [Ve, o.value.description]
          ]),
          D(Eo, {
            errors: (u = e.errors) == null ? void 0 : u.description
          }, null, 8, ["errors"])
        ]),
        c("div", yX, [
          r[13] || (r[13] = c("label", {
            class: "form-label",
            for: "select-category"
          }, "category", -1)),
          L(c("select", {
            id: "select-category",
            class: "form-select form-select-sm",
            "onUpdate:modelValue": r[3] || (r[3] = (v) => o.value.category = v)
          }, [
            r[12] || (r[12] = c("option", {
              value: "",
              disabled: ""
            }, "Select a CDIS category...", -1)),
            (g(!0), E(G, null, ge(e.validCategories, (v, _) => (g(), E("option", {
              key: _,
              value: v
            }, F(v), 9, bX))), 128))
          ], 512), [
            [Qt, o.value.category]
          ]),
          D(Eo, {
            errors: (d = e.errors) == null ? void 0 : d.category
          }, null, 8, ["errors"])
        ]),
        c("div", EX, [
          r[14] || (r[14] = c("label", {
            class: "form-label",
            for: "input-subcategory"
          }, "subcategory", -1)),
          L(c("input", {
            class: "form-control form-control-sm",
            type: "text",
            "onUpdate:modelValue": r[4] || (r[4] = (v) => o.value.subcategory = v),
            id: "input-subcategory",
            placeholder: "CDIS sub-category..."
          }, null, 512), [
            [Ve, o.value.subcategory]
          ]),
          D(Eo, {
            errors: (f = e.errors) == null ? void 0 : f.subcategory
          }, null, 8, ["errors"])
        ]),
        c("div", wX, [
          c("div", SX, [
            c("div", xX, [
              L(c("input", {
                class: "form-check-input",
                type: "checkbox",
                "onUpdate:modelValue": r[5] || (r[5] = (v) => o.value.temporal = v),
                id: "input-temporal"
              }, null, 512), [
                [mn, o.value.temporal]
              ]),
              r[15] || (r[15] = c("label", {
                class: "form-check-label",
                for: "input-temporal"
              }, "temporal", -1))
            ]),
            c("div", NX, [
              L(c("input", {
                class: "form-check-input",
                type: "checkbox",
                "onUpdate:modelValue": r[6] || (r[6] = (v) => o.value.identifier = v),
                id: "input-identifier"
              }, null, 512), [
                [mn, o.value.identifier]
              ]),
              r[16] || (r[16] = c("label", {
                class: "form-check-label",
                for: "input-identifier"
              }, "identifier", -1))
            ]),
            c("div", CX, [
              L(c("input", {
                class: "form-check-input",
                type: "checkbox",
                "onUpdate:modelValue": r[7] || (r[7] = (v) => o.value.disabled = v),
                id: "input-disabled"
              }, null, 512), [
                [mn, o.value.disabled]
              ]),
              r[17] || (r[17] = c("label", {
                class: "form-check-label",
                for: "input-disabled"
              }, "disabled", -1))
            ])
          ]),
          D(Eo, {
            errors: (p = e.errors) == null ? void 0 : p.temporal
          }, null, 8, ["errors"]),
          D(Eo, {
            errors: (h = e.errors) == null ? void 0 : h.identifier
          }, null, 8, ["errors"]),
          D(Eo, {
            errors: (m = e.errors) == null ? void 0 : m.disabled
          }, null, 8, ["errors"])
        ]),
        c("div", OX, [
          r[18] || (r[18] = c("label", {
            class: "form-label",
            for: "input-disabled_reason"
          }, "disabled reason", -1)),
          L(c("textarea", {
            class: "form-control form-control-sm",
            rows: "3",
            "onUpdate:modelValue": r[8] || (r[8] = (v) => o.value.disabled_reason = v),
            id: "input-disabled_reason",
            disabled: !o.value.disabled,
            placeholder: `${o.value.disabled ? "Explain why this field is disabled..." : ""}`
          }, null, 8, TX), [
            [Ve, o.value.disabled_reason]
          ])
        ])
      ]);
    };
  }
}, kX = /* @__PURE__ */ oe($X, [["__scopeId", "data-v-251683a1"]]), DX = {
  "data-menu": "",
  class: ""
}, RX = {
  __name: "ItemMenu",
  props: {
    visible: { type: Boolean, default: !1 }
  },
  emits: ["edit", "remove"],
  setup(e, { emit: t }) {
    const n = t;
    function s() {
      n("remove");
    }
    function o(i) {
      n("edit");
    }
    return (i, r) => (g(), E("div", DX, [
      c("div", { class: "d-flex gap-2" }, [
        c("button", {
          class: "btn btn-sm btn-light",
          onClick: o
        }, r[0] || (r[0] = [
          c("i", { class: "fas fa-pencil fa-fw" }, null, -1)
        ])),
        c("button", {
          class: "btn btn-sm btn-light",
          onClick: s
        }, r[1] || (r[1] = [
          c("i", { class: "fas fa-trash fa-fw" }, null, -1)
        ]))
      ])
    ]));
  }
}, IX = /* @__PURE__ */ oe(RX, [["__scopeId", "data-v-52fe97b4"]]), AX = { class: "p-2" }, MX = { class: "d-flex gap-2 my-2" }, PX = { class: "dropdown" }, LX = { class: "dropdown-menu" }, VX = { class: "ms-auto" }, FX = ["disabled"], UX = {
  "data-menu": "",
  class: "position-absolute top-50 translate-middle-y end-0 me-2"
}, jX = { class: "d-flex gap-2" }, BX = ["onClick"], HX = ["onClick"], YX = { class: "d-flex gap-2 justify-content-end" }, WX = ["disabled"], GX = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw me-2"
}, zX = {
  key: 1,
  class: "fas fa-save fa-fw me-2"
}, KX = { style: { "max-height": "500px", "overflow-y": "auto" } }, XX = { class: "table table-sm table-striped table-hover table-bordered" }, qX = { class: "d-flex gap-2 p-2" }, JX = ["onClick"], QX = { class: "d-flex gap-2 p-2" }, ZX = ["onClick"], eq = ["disabled"], tq = {
  __name: "CustomMappingsPage",
  setup(e) {
    const t = JS(), n = fs(), s = an(), o = _N(), i = n7(), r = Object.freeze({
      CREATE: "create",
      EDIT: "edit"
    }), a = I(""), l = I(), u = I(), d = I({}), f = I(), p = I(), h = I(), m = I([]), v = k(() => {
      let j = "untitled";
      switch (a.value) {
        case r.CREATE:
          j = "New Item";
          break;
        case r.EDIT:
          j = "Edit Item";
          break;
        default:
          j = "untitled";
          break;
      }
      return j;
    }), _ = k({
      get: () => t.list,
      set: (j) => t.list = j
    }), b = k(() => t.loading), w = k(() => t.isDirty), y = k(() => t.validCategories), x = I();
    function N({ event: j, item: V, index: K }) {
      x.value = V, j.target.querySelector("td:last-child").appendChild(p.value), p.value.style.position = "absolute", p.value.style.pointerEvents = "all", p.value.style.opacity = 1, p.value.style.right = 0, p.value.style.top = "50%", p.value.style.transform = "translateY(-50%)";
    }
    function S({ event: j, item: V, index: K }) {
      x.value = null;
    }
    function O() {
      u.value = null, a.value = r.CREATE, d.value = t.useDefaultEntry(), l.value.show();
    }
    function $() {
      const j = (re, ke) => Array.from({ length: ke - re + 1 }, (ze, We) => We + re), V = (re = 1) => {
        var We, st;
        const ke = ((We = y.value) == null ? void 0 : We.length) ?? 1;
        return {
          field: `example-${re}`,
          label: `Label ${re}`,
          description: `Description ${re}`,
          category: ((st = y.value) == null ? void 0 : st[re % ke]) ?? "",
          subcategory: "",
          temporal: !0,
          identifier: !1,
          disabled: !1
        };
      }, K = "custom mappings template.csv", q = j(0, 2).map((re) => V(re));
      Lm(q, K, i);
    }
    function T() {
      u.value = x.value, a.value = r.EDIT, d.value = { ...x.value }, l.value.show();
    }
    async function R() {
      const j = x.value;
      await n.confirm({
        title: "Confirm delete",
        body: "Are you sure you want to delete this element?"
      }) && t.remove(j);
    }
    function P() {
      const j = db(d.value);
      switch (a.value) {
        case r.CREATE:
          t.add(j);
          break;
        case r.EDIT:
          t.edit(u.value, j);
          break;
      }
      l.value.hide(), u.value = null, d.value = {};
    }
    async function M() {
      await t.save();
    }
    async function U() {
      try {
        m.value = [];
        const j = await o.select();
        if ((j == null ? void 0 : j.length) < 1) return;
        let V = B8(j == null ? void 0 : j[0]);
        if (!Array.isArray(V)) {
          const ke = "invalid format";
          throw new Error(ke);
        }
        V = V.map((ke) => o7(db(ke)));
        const K = [], q = [];
        for (const [ke, ze] of Object.entries(V)) {
          const We = t.validate(ze);
          if (We.hasErrors()) {
            const st = We.errors();
            for (const [Lt, Yt] of Object.entries(st))
              for (const Et of Yt)
                K.push({ index: ke, field: Lt, message: Et });
          } else q.push(ze);
        }
        const re = K.length;
        if (re > 0) {
          const ke = `${re} validation error${re === 1 ? " was" : "s were"} found. Please review your data.`, ze = new Error(ke);
          throw ze.details = [...K], ze;
        } else
          t.list = [], q.forEach((ke) => {
            t.add(ke);
          });
        s.toast({
          title: "Import Successful",
          body: "The file was imported. Please review the data before saving."
        });
      } catch (j) {
        if (j.details) {
          const V = h.value;
          m.value = [...j.details], await V.show();
        } else
          s.toast({
            title: "Import Error",
            body: "There was an error importing the file. Please make sure to select a valid CSV file."
          });
      }
    }
    function H() {
      const j = _.value, V = "custom mappings.csv";
      Lm(j, V, i), s.toast({
        title: "Export Successful",
        body: `The setttings have been exported as '${V}'.`
      });
    }
    return Ft(() => {
      f.value = t.validate(d.value);
    }), (j, V) => {
      const K = le("b-modal"), q = Ht("tt");
      return g(), E("div", AX, [
        c("div", null, [
          L(c("p", null, null, 512), [
            [q, void 0, "cdis_custom_mapping_description"]
          ]),
          c("div", MX, [
            c("div", PX, [
              V[4] || (V[4] = c("button", {
                class: "btn btn-sm btn-secondary dropdown-toggle",
                type: "button",
                id: "dropdownMenuButton1",
                "data-bs-toggle": "dropdown",
                "aria-expanded": "false"
              }, [
                c("i", { class: "fas fa-cog fa-fw" })
              ], -1)),
              c("ul", LX, [
                c("li", null, [
                  c("a", {
                    class: "dropdown-item",
                    href: "#",
                    onClick: Rt(U, ["prevent"])
                  }, V[2] || (V[2] = [
                    c("i", { class: "fas fa-file-import fa-fw me-1" }, null, -1),
                    c("span", null, "Import", -1)
                  ]))
                ]),
                c("li", null, [
                  c("a", {
                    class: "dropdown-item",
                    href: "#",
                    onClick: Rt(H, ["prevent"])
                  }, V[3] || (V[3] = [
                    c("i", { class: "fas fa-file-export fa-fw me-1" }, null, -1),
                    c("span", null, "Export", -1)
                  ]))
                ])
              ])
            ]),
            c("div", null, [
              c("button", {
                type: "button",
                class: "btn btn-sm btn-primary",
                onClick: $
              }, V[5] || (V[5] = [
                c("i", { class: "fas fa-download fa-fw me-1" }, null, -1),
                c("span", null, "CSV Template", -1)
              ]))
            ]),
            c("div", VX, [
              c("button", {
                class: "btn btn-sm btn-success",
                onClick: O,
                disabled: b.value
              }, V[6] || (V[6] = [
                c("i", { class: "fas fa-plus fa-fw" }, null, -1),
                c("span", null, "Add", -1)
              ]), 8, FX)
            ])
          ])
        ]),
        D(hX, {
          onMouseenterRow: N,
          onMouseleaveRow: S,
          id: "custom-mappings-table",
          items: _.value,
          "onUpdate:items": V[0] || (V[0] = (re) => _.value = re)
        }, {
          "after-cell": B(({ data: { item: re } }) => [
            c("div", UX, [
              c("div", jX, [
                c("button", {
                  class: "btn btn-sm btn-light",
                  onClick: (ke) => T(re)
                }, V[7] || (V[7] = [
                  c("i", { class: "fas fa-pencil fa-fw" }, null, -1)
                ]), 8, BX),
                c("button", {
                  class: "btn btn-sm btn-light",
                  onClick: (ke) => R(re)
                }, V[8] || (V[8] = [
                  c("i", { class: "fas fa-trash fa-fw" }, null, -1)
                ]), 8, HX)
              ])
            ])
          ]),
          _: 1
        }, 8, ["items"]),
        c("div", {
          ref_key: "itemMenu",
          ref: p,
          class: "me-2"
        }, [
          x.value ? (g(), se(IX, {
            key: 0,
            onEdit: T,
            onRemove: R
          })) : ne("", !0)
        ], 512),
        c("div", YX, [
          c("button", {
            type: "button",
            class: "btn btn-sm btn-primary",
            disabled: b.value || !w.value,
            onClick: M
          }, [
            b.value ? (g(), E("i", GX)) : (g(), E("i", zX)),
            V[9] || (V[9] = c("span", null, "Save", -1))
          ], 8, WX)
        ]),
        D(K, {
          ref_key: "errorsModal",
          ref: h
        }, {
          title: B(() => V[10] || (V[10] = [
            te("Import Error")
          ])),
          footer: B(({ hide: re }) => [
            c("div", qX, [
              c("button", {
                class: "btn btn-sm btn-secondary",
                onClick: re
              }, V[12] || (V[12] = [
                c("i", { class: "fas fa-times fa-fw me-1" }, null, -1),
                c("span", null, "Ok", -1)
              ]), 8, JX)
            ])
          ]),
          default: B(() => [
            c("div", KX, [
              c("table", XX, [
                V[11] || (V[11] = c("thead", null, [
                  c("tr", { style: { "text-transform": "capitalize" } }, [
                    c("th", null, "entry"),
                    c("th", null, "field"),
                    c("th", null, "message")
                  ])
                ], -1)),
                c("tbody", null, [
                  (g(!0), E(G, null, ge(m.value, (re, ke) => (g(), E("tr", { key: ke }, [
                    c("td", null, F(re.index), 1),
                    c("td", null, F(re.field), 1),
                    c("td", null, F(re.message), 1)
                  ]))), 128))
                ])
              ])
            ])
          ]),
          _: 1
        }, 512),
        D(K, {
          ref_key: "upsertModal",
          ref: l
        }, {
          title: B(() => [
            te(F(v.value), 1)
          ]),
          footer: B(({ hide: re }) => {
            var ke;
            return [
              c("div", QX, [
                c("button", {
                  class: "btn btn-sm btn-secondary",
                  onClick: re
                }, V[13] || (V[13] = [
                  c("i", { class: "fas fa-times fa-fw me-1" }, null, -1),
                  c("span", null, "Cancel", -1)
                ]), 8, ZX),
                c("button", {
                  class: "btn btn-sm btn-primary",
                  onClick: P,
                  disabled: (ke = f.value) == null ? void 0 : ke.hasErrors()
                }, V[14] || (V[14] = [
                  c("i", { class: "fas fa-check fa-fw me-1" }, null, -1),
                  c("span", null, "Accept", -1)
                ]), 8, eq)
              ])
            ];
          }),
          default: B(() => {
            var re;
            return [
              c("div", null, [
                D(kX, {
                  data: d.value,
                  "onUpdate:data": V[1] || (V[1] = (ke) => d.value = ke),
                  errors: (re = f.value) == null ? void 0 : re.errors(),
                  validCategories: y.value
                }, null, 8, ["data", "errors", "validCategories"])
              ])
            ];
          }),
          _: 1
        }, 512)
      ]);
    };
  }
}, nq = /* @__PURE__ */ oe(tq, [["__scopeId", "data-v-b413a14e"]]), sq = { class: "d-flex align-items-center" }, oq = { class: "fs-4 me-2" }, rq = ["disabled"], iq = {
  key: 0,
  class: "text-secondary"
}, aq = {
  key: 1,
  class: "text-secondary"
}, lq = { class: "table table-sm table-bordered table-hover table-striped my-2" }, cq = ["title"], uq = ["disabled", "onClick"], dq = {
  __name: "ExpiredTokensTable",
  setup(e) {
    const t = fs();
    Eg();
    const n = l7(), { loading: s, expiredTokens: o } = he(n);
    async function i(l) {
      await t.confirm({
        title: "Confirm delete",
        body: ls("cc_fhir_clear_expired_tokens_confirmation")
      }) && (await n.clearExpiredTokens(l), r());
    }
    async function r() {
      n.fetchExpiredTokens();
    }
    async function a() {
      r();
    }
    return vt(() => {
      r();
    }), (l, u) => {
      const d = Ht("tt");
      return g(), E("div", null, [
        c("div", sq, [
          L(c("span", oq, null, 512), [
            [d, void 0, "cc_fhir_clear_expired_tokens_title"]
          ]),
          c("button", {
            type: "button",
            class: "btn btn-sm btn-light",
            disabled: C(s),
            onClick: a
          }, [
            C(s) ? (g(), E("span", iq, u[0] || (u[0] = [
              c("i", { class: "fas fa-spinner fa-spin fa-fw" }, null, -1)
            ]))) : (g(), E("span", aq, u[1] || (u[1] = [
              c("i", { class: "fas fa-refresh fa-fw" }, null, -1)
            ])))
          ], 8, rq)
        ]),
        L(c("span", null, null, 512), [
          [d, void 0, "cc_fhir_clear_expired_tokens_description"]
        ]),
        c("table", lq, [
          u[3] || (u[3] = c("thead", null, [
            c("tr", null, [
              c("th", null, "EHR"),
              c("th", null, "Expired Tokens"),
              c("th", null, "Actions")
            ])
          ], -1)),
          c("tbody", null, [
            (g(!0), E(G, null, ge(C(o), (f, p) => (g(), E("tr", {
              title: `EHR ID: ${f.ehr_id}`
            }, [
              c("td", null, F(f.ehr_name ?? "-- no name --"), 1),
              c("td", null, F(f.expired_token_count ?? 0), 1),
              c("td", null, [
                c("button", {
                  type: "button",
                  class: "btn btn-sm btn-light",
                  disabled: f.expired_token_count === 0,
                  onClick: (h) => i(f.ehr_id)
                }, u[2] || (u[2] = [
                  c("span", { class: "text-danger" }, [
                    c("i", { class: "fas fa-trash fa-fw" })
                  ], -1)
                ]), 8, uq)
              ])
            ], 8, cq))), 256))
          ])
        ])
      ]);
    };
  }
}, fq = { class: "p-2" }, pq = {
  __name: "ToolsPage",
  setup(e) {
    return (t, n) => (g(), E("div", fq, [
      D(dq)
    ]));
  }
}, hq = {
  class: "p-5 bg-danger",
  ref: "subscriber"
}, mq = {
  class: "p-5 bg-success",
  ref: "moveTarget"
}, vq = {
  __name: "TestPage",
  setup(e) {
    function t(i, r) {
      if (Array.isArray(i) && Array.isArray(r)) {
        if (i.length !== r.length)
          return !1;
        for (let u = 0; u < i.length; u++)
          if (!t(i[u], r[u]))
            return !1;
        return !0;
      }
      if (typeof i != "object" || typeof r != "object" || i == null || r == null)
        return i === r;
      const a = Object.keys(i), l = Object.keys(r);
      if (a.length !== l.length)
        return !1;
      for (const u of a)
        if (!l.includes(u) || !t(i[u], r[u]))
          return !1;
      return !0;
    }
    const o = t([{ ehr_id: "5", order: "0", ehr_name: "Epic App Orchard", client_id: "8503bafc-8fe8-4631-a657-0b4a00019bf5", client_secret: "N2vo/GfFcsXoeCdxMXjHffyYNEu8K8DjAeY2gsdtePWr5XDa/GA2tW40NgD56iDXyYaKvCZXhiz0qDQ2t5Twyg==", fhir_base_url: "https://vendorservices.epic.com/interconnect-amcurprd-oauth/api/FHIR/R4/", fhir_token_url: "https://vendorservices.epic.com/interconnect-amcurprd-oauth/oauth2/token", fhir_authorize_url: "https://vendorservices.epic.com/interconnect-amcurprd-oauth/oauth2/authorize", fhir_identity_provider: null, patient_identifier_string: "urn:oid:1.2.840.114350.1.13.0.1.7.5.737384.14", fhir_custom_auth_params: [{ name: "sdf", value: "sdf" }, { value: "sdasdf", context: "standalone", name: "ss" }] }, { ehr_id: "3", order: "1", ehr_name: "Smart Health It", client_id: "something", client_secret: "this is secret", fhir_base_url: "https://launch.smarthealthit.org/v/r4/sim/WzIsIiIsIiIsIkFVVE8iLDAsMCwwLCIiLCIiLCIiLCIiLCIiLCIiLCIiLDAsMF0/fhir", fhir_token_url: "https://launch.smarthealthit.org/v/r4/sim/WzIsIiIsIiIsIkFVVE8iLDAsMCwwLCIiLCIiLCIiLCIiLCIiLCIiLCIiLDAsMF0/auth/token", fhir_authorize_url: "https://launch.smarthealthit.org/v/r4/sim/WzIsIiIsIiIsIkFVVE8iLDAsMCwwLCIiLCIiLCIiLCIiLCIiLCIiLCIiLDAsMF0/auth/authorize", fhir_identity_provider: "https://launch.smarthealthit.org/v/r4/sim/WzIsIiIsIiIsIkFVVE8iLDAsMCwwLCIiLCIiLCIiLCIiLCIiLCIiLCIiLDAsMF0/fhir", patient_identifier_string: "http://hospital.smarthealthit.org", fhir_custom_auth_params: [] }, { ehr_id: "2", order: "2", ehr_name: "Open Cerner", client_id: "96719634-18f7-47db-a015-739c8aff289b", client_secret: "", fhir_base_url: "https://fhir-ehr-code.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d", fhir_token_url: "https://authorization.cerner.com/tenants/ec2458f2-1e24-41c8-b71b-0e701af7583d/protocols/oauth2/profiles/smart-v1/token", fhir_authorize_url: "https://authorization.cerner.com/tenants/ec2458f2-1e24-41c8-b71b-0e701af7583d/protocols/oauth2/profiles/smart-v1/personas/provider/authorize", fhir_identity_provider: "", patient_identifier_string: "", fhir_custom_auth_params: [] }], [{ ehr_id: "5", order: "0", ehr_name: "Epic App Orchard", client_id: "8503bafc-8fe8-4631-a657-0b4a00019bf5", client_secret: "N2vo/GfFcsXoeCdxMXjHffyYNEu8K8DjAeY2gsdtePWr5XDa/GA2tW40NgD56iDXyYaKvCZXhiz0qDQ2t5Twyg==", fhir_base_url: "https://vendorservices.epic.com/interconnect-amcurprd-oauth/api/FHIR/R4/", fhir_token_url: "https://vendorservices.epic.com/interconnect-amcurprd-oauth/oauth2/token", fhir_authorize_url: "https://vendorservices.epic.com/interconnect-amcurprd-oauth/oauth2/authorize", fhir_identity_provider: null, patient_identifier_string: "urn:oid:1.2.840.114350.1.13.0.1.7.5.737384.14", fhir_custom_auth_params: [{ name: "sdf", value: "sdf" }, { value: "sdasdf", context: "standalone", name: "ss" }] }, { ehr_id: "3", order: "1", ehr_name: "Smart Health It", client_id: "something", client_secret: "this is secret", fhir_base_url: "https://launch.smarthealthit.org/v/r4/sim/WzIsIiIsIiIsIkFVVE8iLDAsMCwwLCIiLCIiLCIiLCIiLCIiLCIiLCIiLDAsMF0/fhir", fhir_token_url: "https://launch.smarthealthit.org/v/r4/sim/WzIsIiIsIiIsIkFVVE8iLDAsMCwwLCIiLCIiLCIiLCIiLCIiLCIiLCIiLDAsMF0/auth/token", fhir_authorize_url: "https://launch.smarthealthit.org/v/r4/sim/WzIsIiIsIiIsIkFVVE8iLDAsMCwwLCIiLCIiLCIiLCIiLCIiLCIiLCIiLDAsMF0/auth/authorize", fhir_identity_provider: "https://launch.smarthealthit.org/v/r4/sim/WzIsIiIsIiIsIkFVVE8iLDAsMCwwLCIiLCIiLCIiLCIiLCIiLCIiLCIiLDAsMF0/fhir", patient_identifier_string: "http://hospital.smarthealthit.org", fhir_custom_auth_params: [] }, { ehr_id: "2", order: "2", ehr_name: "Open Cerner", client_id: "96719634-18f7-47db-a015-739c8aff289b", client_secret: "", fhir_base_url: "https://fhir-ehr-code.cerner.com/r4/ec2458f2-1e24-41c8-b71b-0e701af7583d", fhir_token_url: "https://authorization.cerner.com/tenants/ec2458f2-1e24-41c8-b71b-0e701af7583d/protocols/oauth2/profiles/smart-v1/token", fhir_authorize_url: "https://authorization.cerner.com/tenants/ec2458f2-1e24-41c8-b71b-0e701af7583d/protocols/oauth2/profiles/smart-v1/personas/provider/authorize", fhir_identity_provider: "", patient_identifier_string: "", fhir_custom_auth_params: [] }, { ehr_name: "new systems", order: 4, ehr_id: -4 }]);
    return (i, r) => (g(), E(G, null, [
      r[0] || (r[0] = c("div", { class: "p-5" }, "Test", -1)),
      c("div", hq, "Subscriber", 512),
      c("div", mq, "Move Here", 512),
      te(" " + F(C(o)), 1)
    ], 64));
  }
}, gq = [
  {
    path: "/",
    component: N7,
    // redirect: '/inbox',
    children: [
      { path: "", name: "home", component: m9 },
      { path: "fhir-systems", name: "fhir-systems", component: iX },
      { path: "custom-mappings", name: "custom-mappings", component: nq },
      { path: "tools", name: "tools", component: pq },
      { path: "test", name: "test", component: vq },
      { path: "/:pathMatch(.*)*", component: la }
    ]
  }
];
let Yu;
const _q = () => Yu || (Yu = ci({
  // Provide the history implementation to use. We are using the hash history for simplicity here.
  history: li(),
  routes: gq
}), Yu), yq = (e) => {
  const t = e.arg || "top", n = document.createElement("div");
  return n.className = `tooltip tooltip-${t}`, n.style.position = "absolute", n.style.padding = "5px 10px", n.style.backgroundColor = "rgba(0, 0, 0, 0.75)", n.style.color = "white", n.style.fontWeight = "200", n.style.borderRadius = "4px", n.style.whiteSpace = "nowrap", n.style.transition = "opacity 0.2s", n.style.opacity = "0", n.style.pointerEvents = "none", n.innerText = e.value, n;
}, bq = () => {
  const e = document.createElement("div");
  return e.className = "tooltip-caret", e.style.position = "absolute", e.style.width = "0", e.style.height = "0", e.style.borderStyle = "solid", e;
}, Eq = (e, t) => {
  switch (e.style.top = "revert", e.style.right = "revert", e.style.bottom = "revert", e.style.left = "revert", t) {
    case "top":
      e.style.borderWidth = "5px 5px 0 5px", e.style.borderColor = "rgba(0, 0, 0, 0.75) transparent transparent transparent", e.style.bottom = "-5px", e.style.left = "50%", e.style.transform = "translateX(-50%)";
      break;
    case "bottom":
      e.style.borderWidth = "0 5px 5px 5px", e.style.borderColor = "transparent transparent rgba(0, 0, 0, 0.75) transparent", e.style.top = "-5px", e.style.left = "50%", e.style.transform = "translateX(-50%)";
      break;
    case "left":
      e.style.borderWidth = "5px 0 5px 5px", e.style.borderColor = "transparent transparent transparent rgba(0, 0, 0, 0.75)", e.style.top = "50%", e.style.right = "-5px", e.style.transform = "translateY(-50%)";
      break;
    case "right":
      e.style.borderWidth = "5px 5px 5px 0", e.style.borderColor = "transparent rgba(0, 0, 0, 0.75) transparent transparent", e.style.top = "50%", e.style.left = "-5px", e.style.transform = "translateY(-50%)";
      break;
    case "move":
      e.style.display = "none";
      break;
    case "auto":
    default:
      e.style.borderWidth = "0 5px 5px 5px", e.style.borderColor = "transparent transparent rgba(0, 0, 0, 0.75) transparent", e.style.top = "-5px", e.style.left = "50%", e.style.transform = "translateX(-50%)";
      break;
  }
}, qb = (e, t, n, s, o) => {
  if (!n) return;
  const i = t.getBoundingClientRect(), r = n.getBoundingClientRect();
  let a, l;
  switch (o) {
    case "top":
      a = i.top + window.scrollY - r.height - 8, l = i.left + window.scrollX + (i.width - r.width) / 2;
      break;
    case "bottom":
      a = i.bottom + window.scrollY + 8, l = i.left + window.scrollX + (i.width - r.width) / 2;
      break;
    case "left":
      a = i.top + window.scrollY + (i.height - r.height) / 2, l = i.left + window.scrollX - r.width - 8;
      break;
    case "right":
      a = i.top + window.scrollY + (i.height - r.height) / 2, l = i.right + window.scrollX + 8;
      break;
    case "move":
      a = e.pageY + 10, l = e.pageX + 10;
      break;
    case "auto":
    default:
      a = i.bottom + window.scrollY + 8, l = i.left + window.scrollX + (i.width - r.width) / 2;
      break;
  }
  n.style.top = `${a}px`, n.style.left = `${l}px`, Eq(s, o);
}, wq = (e, t) => {
  const n = t.arg || "top";
  let s, o;
  const i = I(!1), r = (d) => {
    s || (s = yq(t), o = bq(), s.appendChild(o), document.body.appendChild(s), e._tooltip = s), i.value = !0, s.style.opacity = "1", qb(d, e, s, o, n);
  }, a = () => {
    s && (i.value = !1, s.style.opacity = "0", s.addEventListener(
      "transitionend",
      () => {
        const d = s == null ? void 0 : s.parentNode;
        !d || !d.contains(s) || (d.removeChild(s), e._tooltip = s = null);
      },
      { once: !0 }
    ));
  }, l = (d) => {
    i.value && qb(d, e, s, o, n);
  }, u = new AbortController();
  e.addEventListener("mouseenter", r, { signal: u.signal }), e.addEventListener("mouseleave", a, { signal: u.signal }), e.addEventListener("mousemove", l, {
    signal: u.signal
  }), e._abortController = u;
}, Sq = (e) => {
  e._abortController.abort(), e._tooltip && document.body.removeChild(e._tooltip);
}, Tp = {
  mounted(e, t) {
    wq(e, t);
  },
  beforeUnmount(e) {
    Sq(e);
  }
}, xq = {
  mounted(e, t) {
    let n = 0, s = 0, o = 0, i = 0, r = !1;
    const a = new AbortController(), l = a.signal;
    e._abortController = a;
    const u = t.value ? e.querySelector(t.value) : e;
    if (!u) {
      console.warn(`v-draggable: Target "${t.value}" not found.`);
      return;
    }
    u.style.cursor = "move";
    const d = (h) => {
      if (t.arg === "direct" && h.target !== u)
        return;
      h.preventDefault();
      const m = e.getBoundingClientRect();
      n = h.clientX, s = h.clientY, o = n - (m.left + window.scrollX), i = s - (m.top + window.scrollY), r = !0, document.addEventListener("mousemove", f, { signal: l }), document.addEventListener("mouseup", p, { signal: l });
    }, f = (h) => {
      if (!r) return;
      h.preventDefault();
      const m = h.clientX - o, v = h.clientY - i;
      e.style.position = "absolute", e.style.left = `${m}px`, e.style.top = `${v}px`;
    }, p = () => {
      r && (r = !1, console.log("Dragging stopped."));
    };
    u.addEventListener("mousedown", d, { signal: l });
  },
  unmounted(e) {
    e._abortController && (e._abortController.abort(), delete e._abortController);
  }
}, Nq = {
  mounted(e, t) {
    e.style.overflow = "hidden", e.style.resize = "none";
    const n = t.value && t.value > 0 ? t.value : 1 / 0, s = () => {
      e.style.height = "auto";
      const o = e.scrollHeight;
      if (n !== 1 / 0) {
        const r = (parseFloat(window.getComputedStyle(e).lineHeight) || 0) * n;
        if (o > r) {
          e.style.height = r + "px", e.style.overflowY = "auto";
          return;
        }
      }
      e.style.height = o + "px", e.style.overflowY = "hidden";
    };
    e.resizeTextareaEvent = s, e.addEventListener("input", e.resizeTextareaEvent), s();
  },
  beforeUnmount(e) {
    e.removeEventListener("input", e == null ? void 0 : e.resizeTextareaEvent);
  }
}, yN = {}, Cq = ({ store: e }) => {
  yN[e.$id] = e;
}, Oq = () => yN, t_ = {}, pf = I([]);
let Jm = !1;
const El = ({ store: e }) => {
  t_[e.$id] = e, nt(
    () => e.error,
    (t) => {
      Jm || Tq();
    },
    { immediate: !0 }
    // Run immediately to capture initial state
  );
};
function Tq() {
  const e = Object.values(t_).map((t) => t == null ? void 0 : t.error).filter((t) => t != null);
  JSON.stringify(e) !== JSON.stringify(pf.value) && (pf.value = e);
}
const $p = () => pf, n_ = () => {
  Jm = !0, Object.values(t_).forEach((e) => {
    e.error !== void 0 && (e.error = null);
  }), pf.value = [], Jm = !1;
}, vde = (e) => {
  const t = wn(u7), n = _l();
  n.use(El), t.use(n);
  const s = _q();
  return t.directive("tt", ap), t.use(s), t.use(ai()), t.use(Cs), t.mount(e), { app: t };
};
let $q = Bo();
const Tn = Ho($q, ["pid"], { timeout: 0 }), Pn = {
  // balance
  checkBalance() {
    const e = {
      route: "RewardsController:checkBalance"
    };
    return Tn.get("", { params: e });
  },
  getSettings() {
    const e = {
      route: "RewardsController:getSettings"
    };
    return Tn.get("", { params: e });
  },
  // reward options
  getRewardOption(e) {
    const t = {
      route: "RewardsController:getRewardOption",
      reward_option_id: e
    };
    return Tn.get("", { params: t });
  },
  listRewardOptions(e = 1, t = 100) {
    const n = {
      route: "RewardsController:listRewardOptions",
      _page: e,
      _per_page: t
    };
    return Tn.get("", { params: n });
  },
  createRewardOption(e, t, n) {
    const s = {
      route: "RewardsController:createRewardOption"
    }, o = { product: e, value_amount: t, eligibility_logic: n };
    return Tn.post("", o, { params: s });
  },
  updateRewardOption(e, t, n, s) {
    const o = {
      route: "RewardsController:updateRewardOption",
      reward_option_id: e
    }, i = { product: t, value_amount: n, eligibility_logic: s };
    return Tn.post("", i, { params: o });
  },
  deleteRewardOption(e, t = !1) {
    const n = {
      route: "RewardsController:deleteRewardOption",
      reward_option_id: e,
      force: t ? 1 : 0
    };
    return Tn.delete("", { params: n });
  },
  restoreRewardOption(e) {
    const t = {
      route: "RewardsController:restoreRewardOption",
      reward_option_id: e
    }, n = {};
    return Tn.post("", n, { params: t });
  },
  // products
  listProducts(e = 1, t = 100) {
    const n = {
      route: "RewardsController:listProducts",
      _page: e,
      _per_page: t
    };
    return Tn.get("", { params: n });
  },
  // products
  getCatalog(e = 1, t = 100) {
    const n = {
      route: "RewardsController:getCatalog",
      _page: e,
      _per_page: t
    };
    return Tn.get("", { params: n });
  },
  getChoiceProducts(e = 1, t = 100) {
    const n = {
      route: "RewardsController:getChoiceProducts",
      _page: e,
      _per_page: t
    };
    return Tn.get("", { params: n });
  },
  getChoiceProduct(e) {
    const t = {
      route: "RewardsController:getChoiceProduct",
      utid: e
    };
    return Tn.get("", { params: t });
  },
  // participants
  getRecord(e) {
    const t = {
      route: "RewardsController:getRecord",
      record_id: e
    };
    return Tn.get("", { params: t });
  },
  listRecords({
    arm_num: e = 1,
    page: t = 1,
    perPage: n = 100,
    query: s = "",
    status: o = []
  }) {
    const i = {
      route: "RewardsController:listRecords",
      _page: t,
      _per_page: n,
      _filter: { query: s, status: o },
      arm_num: e
    };
    return Tn.get("", { params: i });
  },
  sendOrderEmail(e, t, n, s) {
    const o = {
      route: "RewardsController:sendOrderEmail"
    }, i = {
      redcap_record_id: t,
      reward_option_id: n,
      order_id: s,
      arm_num: e
    };
    return Tn.post("", i, { params: o });
  },
  performAction(e, t, n, s, o = "") {
    const i = {
      route: "RewardsController:performAction"
    }, r = {
      action: e,
      redcap_record_id: t,
      reward_option_id: n,
      arm_num: s,
      comment: o
    };
    return Tn.post("", r, { params: i });
  },
  scheduleAction(e, t, n, s = "") {
    const o = {
      route: "RewardsController:scheduleAction"
    }, i = {
      action: e,
      reward_record_pairs: t,
      arm_num: n,
      comment: s
    };
    return Tn.post("", i, { params: o });
  },
  clearCache(e) {
    const t = {
      route: "RewardsController:clearCache"
    }, n = {
      key: e
    };
    return Tn.post("", n, { params: t });
  },
  recalculateRecordStatus(e, t, n) {
    const s = {
      route: "RewardsController:recalculateRecordStatus"
    }, o = {
      redcap_record_id: e,
      reward_option_id: t,
      arm_num: n
    };
    return Tn.post("", o, { params: s });
  }
}, ca = () => {
  const e = Nr();
  return k(() => {
    var o;
    const n = ((o = e == null ? void 0 : e.params) == null ? void 0 : o.arm_num) ?? 1;
    return n === "" || n == null ? 1 : n;
  });
}, kq = "app", s_ = /* @__PURE__ */ Ut(kq, () => {
  const e = I(!1), t = I(), n = qe({}), s = qe({}), o = qe({}), i = ca(), r = (u, d) => {
    for (const [f, p] of Object.entries(d))
      delete u[f], u[f] = p;
  };
  async function a(u, d) {
    try {
      e.value = !0;
      const f = await Pn.getSettings(), p = (f == null ? void 0 : f.data) ?? {}, {
        settings: h,
        arms: m,
        permissions: v
      } = p;
      r(n, h), r(s, m), r(o, v);
    } catch (f) {
      t.value = f;
    } finally {
      e.value = !1;
    }
  }
  async function l(u, d, f) {
    try {
      e.value = !0;
      const p = i == null ? void 0 : i.value, h = await Pn.sendOrderEmail(
        p,
        u,
        d,
        f
      ), { data: m, metadata: v } = (h == null ? void 0 : h.data) ?? {};
    } catch (p) {
      t.value = p;
    } finally {
      e.value = !1;
    }
  }
  return {
    loading: e,
    error: t,
    settings: n,
    arms: s,
    permissions: o,
    getSettings: a,
    sendOrderEmail: l
  };
}), Ba = (e, t = {}) => {
  const { locale: n = "en-US", currency: s = "USD" } = t;
  return new Intl.NumberFormat(n, {
    style: "currency",
    currency: s
  }).format(e);
}, Dq = "rewardOptions", Jb = {
  page: 1,
  perPage: 25,
  total: void 0
}, Or = /* @__PURE__ */ Ut(Dq, () => {
  const e = I({}), t = I(!1), n = I([]), s = I(), o = qe({ ...Jb });
  function i() {
    n.value = [];
    for (const [h, m] of Object.entries(Jb))
      o[h] = m;
  }
  async function r(h) {
    try {
      t.value = !0;
      const m = await Pn.getRewardOption(h), { data: v } = (m == null ? void 0 : m.data) ?? {};
      e.value = v;
    } catch (m) {
      s.value = m;
    } finally {
      t.value = !1;
    }
  }
  async function a(h = void 0, m = void 0) {
    try {
      t.value = !0;
      const v = await Pn.listRewardOptions(h, m), { data: _, metadata: b } = (v == null ? void 0 : v.data) ?? {};
      n.value = _, o.total = (b == null ? void 0 : b.total) ?? 0;
    } catch (v) {
      s.value = v;
    } finally {
      t.value = !1;
    }
  }
  async function l(h, m, v) {
    try {
      return t.value = !0, await Pn.createRewardOption(h, m, v);
    } catch (_) {
      s.value = _;
    } finally {
      t.value = !1;
    }
  }
  async function u(h, m, v, _) {
    try {
      return t.value = !0, await Pn.updateRewardOption(h, m, v, _);
    } catch (b) {
      s.value = b;
    } finally {
      t.value = !1;
    }
  }
  async function d(h) {
    try {
      return t.value = !0, await Pn.deleteRewardOption(h);
    } catch (m) {
      s.value = m;
    } finally {
      t.value = !1;
    }
  }
  async function f(h) {
    try {
      return t.value = !0, await Pn.deleteRewardOption(h, !0);
    } catch (m) {
      s.value = m;
    } finally {
      t.value = !1;
    }
  }
  async function p(h) {
    try {
      return t.value = !0, await Pn.restoreRewardOption(h);
    } catch (m) {
      s.value = m;
    } finally {
      t.value = !1;
    }
  }
  return {
    loading: t,
    error: s,
    currentItem: e,
    list: n,
    pagination: o,
    resetList: i,
    fetch: r,
    fetchList: a,
    create: l,
    update: u,
    remove: d,
    forceRemove: f,
    restore: p
  };
}), Rq = "products", Qb = {
  page: 1,
  perPage: 25,
  total: void 0
}, kp = /* @__PURE__ */ Ut(Rq, () => {
  I();
  const e = I(!1), t = I([]), n = I(), s = qe({ ...Qb });
  function o() {
    t.value = [];
    for (const [a, l] of Object.entries(Qb))
      s[a] = l;
  }
  async function i(a = void 0, l = void 0) {
    try {
      e.value = !0;
      const u = await Pn.listProducts(a, l), { data: d, metadata: f } = (u == null ? void 0 : u.data) ?? {};
      t.value = d, s.total = (f == null ? void 0 : f.total) ?? 0;
    } catch (u) {
      n.value = u;
    } finally {
      e.value = !1;
    }
  }
  function r(a) {
    const l = t.value ?? [];
    for (const u of l)
      if ((u == null ? void 0 : u.product_id) === a) return u;
  }
  return {
    loading: e,
    error: n,
    list: t,
    pagination: s,
    resetList: o,
    fetchList: i,
    findItem: r
  };
}), Iq = "records", Zb = {
  page: 1,
  perPage: 25,
  total: void 0,
  totalPages: 0
}, ua = /* @__PURE__ */ Ut(Iq, () => {
  const e = I(), t = I(!1), n = I([]), s = I(), o = qe({ ...Zb }), i = I(""), r = I([]), a = ca(), l = I(!1);
  let u = I(!1);
  function d() {
    n.value = [];
    for (const [_, b] of Object.entries(Zb))
      o[_] = b;
  }
  async function f(_) {
    try {
      t.value = !0;
      const b = await Pn.getRecord(_), { data: w } = (b == null ? void 0 : b.data) ?? {};
      e.value = w;
    } catch (b) {
      s.value = b;
    } finally {
      t.value = !1;
    }
  }
  async function p(_, b) {
    _ in o && (u.value = !0, o[_] = b, await po(), u.value = !1);
  }
  async function h(_ = 1) {
    try {
      t.value = !0;
      const b = await Pn.listRecords({
        arm_num: _,
        page: o.page,
        perPage: o.perPage,
        query: i.value,
        status: r.value
      }), { data: w, metadata: y } = (b == null ? void 0 : b.data) ?? {};
      n.value = w, o.total = (y == null ? void 0 : y.total) ?? 0, l.value = (y == null ? void 0 : y.cached) ?? !1;
    } catch (b) {
      s.value = b;
    } finally {
      t.value = !1;
    }
  }
  async function m() {
    try {
      const _ = l.value;
      return _ ? (t.value = !0, await Pn.clearCache(_)) : void 0;
    } catch (_) {
      s.value = _;
    } finally {
      t.value = !1;
    }
  }
  const v = async () => await h(a.value);
  return nt(
    [() => o.total, () => o.perPage],
    ([_, b]) => {
      u.value || (o.totalPages = _ && b ? Math.ceil(_ / b) : 0, o.page > o.totalPages && (o.page = 1));
    }
  ), nt([() => o.page, () => o.perPage], () => {
    t.value || u.value || v();
  }), {
    loading: t,
    error: s,
    currentItem: e,
    list: n,
    pagination: o,
    query: i,
    selectedStatus: r,
    disablePaginationWatcher: u,
    cached: l,
    updatePaginationSilently: p,
    resetList: d,
    fetch: f,
    fetchList: h,
    clearCache: m,
    loadRecords: v
  };
}), Aq = "provider", Mq = /* @__PURE__ */ Ut(Aq, () => {
  const e = I(!1), t = I(0), n = I();
  async function s() {
    try {
      e.value = !0;
      const o = await Pn.checkBalance();
      t.value = o.data;
    } catch (o) {
      n.value = o;
    } finally {
      e.value = !1;
    }
  }
  return {
    loading: e,
    error: n,
    balance: t,
    checkBalance: s
  };
}), xn = Object.freeze({
  REVIEWER_APPROVAL: "reviewer:approval",
  REVIEWER_REJECTION: "reviewer:rejection",
  REVIEWER_RESTORE: "reviewer:restore",
  BUYER_APPROVAL: "buyer:approval",
  BUYER_REJECTION: "buyer:rejection",
  PLACE_ORDER: "place_order",
  SEND_EMAIL: "send_email",
  REVERT: "revert"
}), Wu = Object.freeze({
  PENDING: "pending",
  COMPLETED: "completed",
  ERROR: "error",
  UNKNOWN: "unknown"
}), Ie = Object.freeze({
  INVALID: "invalid",
  ELIGIBLE: "eligible",
  INELIGIBLE: "ineligible",
  PENDING: "pending",
  REVIEWER_APPROVED: "reviewer:approved",
  REVIEWER_REJECTED: "reviewer:rejected",
  BUYER_APPROVED: "buyer:approved",
  BUYER_REJECTED: "buyer:rejected",
  ORDER_PLACED: "order:placed",
  COMPLETED: "completed",
  SCHEDULED: "scheduled",
  PROCESSING: "processing",
  CANCELED: "canceled",
  ERROR: "error",
  UNKNOWN: "unknown"
}), Qm = [
  Ie.COMPLETED,
  Ie.ELIGIBLE,
  Ie.BUYER_APPROVED,
  Ie.BUYER_REJECTED,
  Ie.REVIEWER_APPROVED,
  Ie.REVIEWER_REJECTED,
  Ie.SCHEDULED,
  Ie.ORDER_PLACED
], Wt = Object.freeze({
  PENDING: "pending",
  COMPLETED: "completed",
  REJECTED: "rejected"
}), bN = "review-selection", So = qe({}), EN = (e, t) => {
  var o;
  const n = `${bN}-${e}-${t}`;
  if (So != null && So[e] || (So[e] = {}), (o = So[e]) != null && o[n])
    return So[e][n];
  const s = (/* @__PURE__ */ Ut(n, () => {
    const i = ua(), r = I([]), a = I(!1), l = I(), u = k(() => t), d = k(() => {
      const S = {};
      for (const O of i.list)
        S[O.record_id] = O;
      return S;
    }), f = k(() => {
      var O, $, T, R;
      const S = {};
      for (const P of r.value) {
        const M = (R = (T = ($ = (O = d.value) == null ? void 0 : O[P]) == null ? void 0 : $.reward_options) == null ? void 0 : T[t]) == null ? void 0 : R.status;
        M in S || (S[M] = []), S[M].push(P);
      }
      return S;
    }), p = (S) => {
      r.value = r.value.filter((O) => {
        var T, R, P, M;
        return ((M = (P = (R = (T = d.value) == null ? void 0 : T[O]) == null ? void 0 : R.reward_options) == null ? void 0 : P[t]) == null ? void 0 : M.status) !== S;
      });
    }, h = (S) => {
      var $;
      const O = ($ = d.value) == null ? void 0 : $.filter((T) => {
        var P, M;
        return ((M = (P = T == null ? void 0 : T.reward_options) == null ? void 0 : P[t]) == null ? void 0 : M.status) === S;
      });
      r.value = [
        ...r.value,
        ...O.map((T) => T.id)
      ];
    }, m = (S) => {
      const O = `${S}`;
      v(O) < 0 ? _(O) : b(O);
    }, v = (S) => r.value.findIndex((O) => O == S), _ = (S) => {
      v(S) >= 0 || r.value.push(S);
    }, b = (S) => {
      const O = v(S);
      O < 0 || r.value.splice(O, 1);
    }, w = k(() => {
      var $, T;
      const S = [Ie.ELIGIBLE, Ie.REVIEWER_APPROVED], O = [];
      for (const R of Object.values(d.value)) {
        const P = (T = ($ = R == null ? void 0 : R.reward_options) == null ? void 0 : $[t]) == null ? void 0 : T.status;
        S.includes(P) && O.push(`${R.record_id}`);
      }
      return O;
    }), y = k(() => {
      const S = r.value, O = w.value;
      return {
        length: S.length,
        total: O.length,
        indeterminate: S.length > 0 && S.length != O.length,
        checked: S.length > 0 && O.length === S.length,
        disabled: O.length === 0
      };
    });
    return {
      id: u,
      loading: a,
      error: l,
      selected: r,
      selectionByStatus: f,
      checkboxState: y,
      deselectByStatus: p,
      selectByStatus: h,
      toggle: m,
      toggleGroup: () => {
        let S = w.value, O = r.value;
        const $ = O.length === 0 || O.length !== S.length;
        for (const T of S) {
          const R = T;
          $ ? _(R) : b(R);
        }
      },
      checkSelection: (S) => v(S) > -1
    };
  }))();
  return So[e][n] = s, s;
}, o_ = /* @__PURE__ */ Ut(bN, () => {
  const e = ca(), t = I(), n = I(), s = I(), o = k(() => (So == null ? void 0 : So[e.value]) ?? {}), i = (l) => {
    for (const [u, d] of Object.entries(o.value))
      d.deselectByStatus(l);
  }, r = () => {
    for (const [l, u] of Object.entries(o.value))
      u.selected = [];
  }, a = () => {
    var l, u;
    t.value = [], n.value = [], s.value = [];
    for (const [d, f] of Object.entries(o.value)) {
      const p = f.id, h = (((l = f.selectionByStatus) == null ? void 0 : l[Ie.ELIGIBLE]) ?? []).map((v) => ({ [p]: v })), m = (((u = f.selectionByStatus) == null ? void 0 : u[Ie.REVIEWER_APPROVED]) ?? []).map((v) => ({ [p]: v }));
      n.value.push(...h), s.value.push(...m), t.value.push(...h, ...m);
    }
  };
  return Ft(() => a()), {
    arm_stores: o,
    selected: t,
    eligibleSelected: n,
    approvedSelected: s,
    delesectStatusInStores: i,
    reset: r,
    updateSelected: a
  };
}), Pq = {
  key: 0,
  class: ""
}, Lq = {
  class: "d-flex flex-column",
  style: { "min-width": "150px", width: "min-content" }
}, Vq = {
  class: "text-muted d-block text-wrap text-end",
  style: { "font-size": "10px" }
}, Fq = ["title"], Uq = {
  class: "border rounded-start px-2 py-1 flex-grow-1",
  style: { "font-size": "24px", "line-height": "24px" }
}, jq = {
  key: 0,
  class: "fa fas fa-spinner fa-spin fa-fw"
}, Bq = {
  key: 1,
  class: "fa fas fa-refresh fa-fw"
}, Hq = {
  __name: "AccountInfo",
  setup(e) {
    const t = Mq(), n = k(() => t.balance), s = k(() => t.loading), o = () => {
      t.checkBalance();
    };
    return o(), (i, r) => n.value ? (g(), E("div", Pq, [
      c("div", Lq, [
        c("small", Vq, F(n.value.accountName), 1),
        c("div", {
          class: "d-flex",
          title: n.value.accountName
        }, [
          c("div", Uq, [
            c("span", null, F(C(Ba)(n.value.amount, { currency: n.value.currency })), 1)
          ]),
          c("button", {
            type: "button",
            class: "btn btn-sm btn-secondary rounded-0 rounded-end",
            onClick: o
          }, [
            s.value ? (g(), E("i", jq)) : (g(), E("i", Bq))
          ])
        ], 8, Fq)
      ])
    ])) : ne("", !0);
  }
}, Yq = {
  key: 0,
  class: "alert alert-danger"
}, Wq = {
  __name: "ErrorsVisualizer",
  setup(e) {
    const t = I(), n = $p();
    return Ft(async () => {
      var o, i;
      if ((o = n.value) == null || o.length, ((i = n.value) == null ? void 0 : i.length) === 0) return;
      const s = t.value;
      s && (await s.show(), n_());
    }), (s, o) => {
      const i = le("b-modal");
      return g(), se(i, {
        ref_key: "modalRef",
        ref: t,
        "ok-only": ""
      }, {
        title: B(() => o[0] || (o[0] = [
          c("span", null, "Error", -1)
        ])),
        default: B(() => [
          (g(!0), E(G, null, ge(C(n), (r, a) => (g(), E(G, { key: a }, [
            r ? (g(), E("div", Yq, F(C(Gs)(r)), 1)) : ne("", !0)
          ], 64))), 128))
        ]),
        _: 1
      }, 512);
    };
  }
}, Gq = { class: "d-block" }, zq = {
  "data-menu": "",
  class: "d-flex mb-2 align-items-end"
}, Kq = { class: "nav nav-tabs" }, Xq = { class: "nav-item" }, qq = { class: "nav-item" }, Jq = { "data-account-info": "" }, Qq = {
  __name: "App",
  setup(e) {
    const t = s_(), n = Or();
    return vt(() => {
      t.getSettings(), n.fetchList();
    }), (s, o) => {
      const i = le("router-link"), r = le("router-view");
      return g(), E("div", Gq, [
        (g(), se(ns, { to: "body" }, [
          D(Wq)
        ])),
        c("div", zq, [
          c("ul", Kq, [
            c("li", Xq, [
              D(i, {
                class: "nav-link",
                activeClass: "active",
                to: { name: "review" }
              }, {
                default: B(() => o[0] || (o[0] = [
                  te("Compensation approval")
                ])),
                _: 1
              })
            ]),
            c("li", qq, [
              D(i, {
                class: "nav-link",
                exactActiveClass: "active",
                to: { name: "reward-options" }
              }, {
                default: B(() => o[1] || (o[1] = [
                  te("Compensation Options")
                ])),
                _: 1
              })
            ])
          ]),
          c("div", Jq, [
            D(Hq)
          ])
        ]),
        D(r)
      ]);
    };
  }
}, Zq = /* @__PURE__ */ oe(Qq, [["__scopeId", "data-v-5d4e9e49"]]), eJ = {};
function tJ(e, t) {
  const n = le("router-view");
  return g(), E("div", null, [
    D(n)
  ]);
}
const nJ = /* @__PURE__ */ oe(eJ, [["render", tJ]]), sJ = {};
function oJ(e, t) {
  return g(), E("div", null, t[0] || (t[0] = [
    c("span", null, "Home", -1),
    c("p", null, " Lorem ipsum dolor sit amet consectetur adipisicing elit. Repellendus quidem, quae, expedita nobis impedit tempora voluptate ullam explicabo quas adipisci exercitationem nemo. Assumenda magni consectetur consequuntur dolorem aliquam vitae minus. ", -1)
  ]));
}
const rJ = /* @__PURE__ */ oe(sJ, [["render", oJ]]), iJ = {};
function aJ(e, t) {
  const n = le("router-view");
  return g(), E("div", null, [
    D(n)
  ]);
}
const lJ = /* @__PURE__ */ oe(iJ, [["render", aJ]]), fu = /* @__PURE__ */ Ut("reward-options-service", () => {
  const e = fs(), t = an(), n = Or(), s = kp(), o = async (i = "Are you sure?") => await e.confirm({
    title: "Confirm",
    body: i
  });
  return {
    async create(i, r, a) {
      await n.create(
        i,
        r,
        a
      ), n.fetchList(), t.toast({
        title: "Success",
        body: "The item has been created."
      });
    },
    async update(i, r, a, l) {
      await n.update(
        i,
        r,
        a,
        l
      ), n.fetchList(), t.toast({
        title: "Success",
        body: "The item has been updated."
      }), n.currentItem = void 0;
    },
    async delete(i) {
      await o(
        "Are you sure you want to delete this item?"
      ) && (await n.remove(i), n.fetchList(), t.toast({
        title: "Success",
        body: "The item has been deleted."
      }));
    },
    async forceDelete(i) {
      await o(
        "Are you sure you want to permanently delete this item?"
      ) && (await n.forceRemove(i), n.fetchList(), t.toast({
        title: "Success",
        body: "The item has been deleted."
      }));
    },
    async restore(i) {
      await o(
        "Are you sure you want to restore this item?"
      ) && (await n.restore(i), n.fetchList(), t.toast({
        title: "Success",
        body: "The item han been restored."
      }));
    },
    edit(i) {
      n.currentItem = i;
    },
    showLogic(i) {
      const { eligibility_logic: r = void 0 } = i;
      r && e.alert({
        title: "Eligibility Logic",
        body: `<code>${r}</code>`
      });
    },
    async prepareEditData(i) {
      var a, l;
      ((a = n == null ? void 0 : n.currentItem) == null ? void 0 : a.reward_option_id) !== i && await n.fetch(i), ((l = s.list) == null ? void 0 : l.length) < 1 && await s.fetchList();
    }
  };
});
class ws {
  static allows(t) {
    var o;
    const n = s_();
    return ((o = k(() => n.permissions).value) == null ? void 0 : o[t]) ?? !1;
  }
  static denies(t) {
    return !ws.allows(t);
  }
}
const wN = /* @__PURE__ */ Ut("currentCellStore", () => {
  const e = an(), t = ua(), n = Or(), s = I(!1), o = I(null), i = qe({}), r = qe({}), a = I(""), l = k(
    () => {
      var x;
      return ((x = i == null ? void 0 : i.reward_options) == null ? void 0 : x[r == null ? void 0 : r.reward_option_id]) ?? {};
    }
  ), u = k(() => l.value.status ?? null), d = k(() => l.value.orders ?? []), f = I(-1), p = k(() => {
    var x;
    return (x = l.value.orders) == null ? void 0 : x.at(f.value);
  }), { eligibility_logic: h } = p.value || {}, m = k(
    () => Qm.includes(u.value)
  );
  function v() {
    a.value = "";
  }
  function _(x, N) {
    zy(i, x), zy(r, N), v();
  }
  function b(x) {
    switch (x) {
      case xn.REVIEWER_APPROVAL:
      case xn.REVIEWER_REJECTION:
      case xn.REVIEWER_RESTORE:
        return ws.allows("review_eligibility");
      case xn.BUYER_APPROVAL:
      case xn.BUYER_REJECTION:
      case xn.PLACE_ORDER:
        return ws.allows("place_orders");
      case xn.SEND_EMAIL:
      case xn.REVERT:
        return ws.allows("review_eligibility") || ws.allows("place_orders");
      default:
        return !1;
    }
  }
  async function w(x, {
    success: N = void 0,
    error: S = void 0
  } = {}) {
    try {
      const O = r == null ? void 0 : r.reward_option_id, $ = i == null ? void 0 : i.record_id;
      s.value = !0;
      const T = await Pn.performAction(
        x,
        $,
        O,
        i == null ? void 0 : i.arm_number,
        a.value
      );
      return e.toast({
        title: "Success",
        body: N ?? `'${x}' performed`
      }), T;
    } catch (O) {
      o.value = O, O && e.toast({
        title: "Error",
        body: O
      });
    } finally {
      await t.loadRecords(), y(), s.value = !1;
    }
  }
  async function y() {
    const x = i.record_id, N = r.reward_option_id, S = t.list.find(
      ($) => $.record_id === x
    ), O = n.list.find(
      ($) => $.reward_option_id === N
    );
    S && O ? _(S, O) : _({}, {});
  }
  return {
    error: o,
    loading: s,
    comment: a,
    record: i,
    reward_option: r,
    data: l,
    currentOrder: p,
    status: u,
    orders: d,
    orderAvailable: m,
    eligibility_logic: h,
    update: _,
    canPerformAction: b,
    performAction: w
  };
}), cJ = /* @__PURE__ */ Ut("scheduling-service", () => {
  fs();
  const e = an(), t = o_(), n = ua(), s = I(!1), o = I(), i = ca();
  return {
    loading: s,
    error: o,
    schedule: async (a, l) => {
      try {
        o.value = null, s.value = !0, console.log(a, "armNum", i == null ? void 0 : i.value, l, Pn), await Pn.scheduleAction(a, l, i == null ? void 0 : i.value), e.toast({
          title: "Success",
          body: `The selected items have been scheduled for '${a}'.`
        });
      } catch (u) {
        o.value = u, console.error(u);
      } finally {
        s.value = !1, t.reset(), n.loadRecords();
      }
    }
  };
}), uJ = { class: "value-amount" }, dJ = ["textContent"], fJ = {
  __name: "ValueAmount",
  props: {
    value: { type: Number, default: 0 }
  },
  setup(e) {
    const t = e, n = k(() => Ba(t.value));
    return (s, o) => (g(), E("div", uJ, [
      c("span", {
        textContent: F(n.value)
      }, null, 8, dJ)
    ]));
  }
}, SN = /* @__PURE__ */ oe(fJ, [["__scopeId", "data-v-8aa61c6a"]]), pJ = ["width", "height"], hJ = ["fill"], mJ = ["fill"], hf = {
  __name: "TextRibbon",
  props: {
    text: { type: String, default: "" },
    textColor: { type: String, default: "white" },
    backgroundColor: { type: String, default: "#A00000" }
  },
  setup(e) {
    const t = I(), n = I(100), s = I(100), o = () => {
      const i = t.value;
      if (i) {
        const r = i.clientHeight;
        s.value = r, n.value = r;
      }
    };
    return vt(() => {
      o(), window.addEventListener("resize", o);
    }), (i, r) => (g(), E("svg", {
      ref_key: "root",
      ref: t,
      "data-ribbon": "",
      width: n.value,
      height: s.value,
      viewBox: "0 0 100 100",
      preserveAspectRatio: "xMidYMid meet"
    }, [
      c("polygon", {
        points: "0,0 100,100 100,50 50,0",
        fill: e.backgroundColor,
        style: { opacity: "0.8" }
      }, null, 8, hJ),
      c("text", {
        "text-anchor": "middle",
        "dominant-baseline": "middle",
        x: "50",
        y: "50",
        fill: e.textColor,
        transform: "rotate(45,50,50) translate(0,-16)",
        style: { "font-size": "14px", "font-family": "Open Sans, Helvetica, Arial, sans-serif", "font-weight": "bold" }
      }, F(e.text), 9, mJ)
    ], 8, pJ));
  }
}, vJ = { class: "card" }, gJ = { class: "card-header" }, _J = { class: "d-flex justify-content-start align-items-center" }, yJ = { class: "card-body" }, bJ = { class: "d-flex flex-column align-items-center" }, EJ = { class: "fs-6" }, wJ = { class: "small text-muted" }, SJ = { class: "card-footer" }, xJ = { class: "d-flex justify-content-center gap-2" }, NJ = ["disabled"], CJ = ["disabled"], OJ = ["disabled"], TJ = {
  __name: "RewardOption",
  props: {
    data: { type: Object, default: null }
  },
  emits: ["show-edit-modal"],
  setup(e, { emit: t }) {
    const n = fu(), s = kp(), o = Or(), i = gl(), r = an(), a = e, { loading: l } = he(o), u = t, { data: d } = he(a);
    k(() => {
      const b = s.findItem(d.value.provider_product_id);
      return b ? Object.values((b == null ? void 0 : b.imageUrls) ?? {}).at(1) : !1;
    });
    async function f() {
      n.delete(d.value.reward_option_id);
    }
    async function p() {
      n.restore(d.value.reward_option_id);
    }
    function h() {
      u("show-edit-modal", d.value);
    }
    function m() {
      n.forceDelete(d.value.reward_option_id);
    }
    function v() {
      n.showLogic(d.value);
    }
    async function _() {
      var y;
      const b = (y = d.value) == null ? void 0 : y.reward_option_id;
      if (!b) {
        r.toast({ title: "Error", body: "Could not copy the Option ID to clipboard" });
        return;
      }
      const w = `R-${b}`;
      await i.copy(w), r.toast({ title: "Success", body: `Reward Option ID '${w}' copied to clipboard` });
    }
    return (b, w) => {
      var y, x, N, S, O;
      return g(), E("div", null, [
        c("div", vJ, [
          c("div", gJ, [
            c("div", _J, [
              c("span", null, "R-" + F((y = C(d)) == null ? void 0 : y.reward_option_id), 1),
              c("button", {
                type: "button",
                class: "btn btn-xs btn-outline-primary ms-auto",
                onClick: _
              }, w[0] || (w[0] = [
                c("i", { class: "fas fa-copy fa-fw" }, null, -1)
              ]))
            ]),
            (x = C(d)) != null && x.is_deleted ? (g(), se(hf, {
              key: 0,
              text: "DELETED"
            })) : ((N = C(d)) == null ? void 0 : N.is_valid) !== !0 ? (g(), E(G, { key: 1 }, [
              (S = b.rewardOption) != null && S.is_valid ? ne("", !0) : (g(), se(hf, {
                key: 0,
                text: "INVALID",
                backgroundColor: "#ffc107",
                textColor: "#333"
              }))
            ], 64)) : ne("", !0)
          ]),
          c("div", yJ, [
            c("div", bJ, [
              D(SN, {
                value: C(d).value_amount
              }, null, 8, ["value"]),
              c("span", EJ, F(C(d).description), 1),
              c("span", wJ, F(C(d).provider_product_id), 1)
            ])
          ]),
          c("div", SJ, [
            c("div", xJ, [
              c("button", {
                type: "button",
                class: "btn btn-sm btn-outline-secondary",
                onClick: v
              }, w[1] || (w[1] = [
                c("i", { class: "fas fa-square-root-variable fa-fw me-1 text-primary" }, null, -1),
                c("span", null, null, -1)
              ])),
              (O = C(d)) != null && O.is_deleted ? (g(), E(G, { key: 0 }, [
                c("button", {
                  type: "button",
                  class: "btn btn-sm btn-outline-secondary text-success",
                  onClick: p
                }, w[2] || (w[2] = [
                  c("i", { class: "fas fa-refresh fa-fw me-1 text-success" }, null, -1),
                  c("span", null, "Restore", -1)
                ])),
                c("button", {
                  type: "button",
                  class: "btn btn-sm btn-outline-secondary text-danger",
                  onClick: m,
                  disabled: C(ws).denies("manage_reward_options")
                }, w[3] || (w[3] = [
                  c("i", { class: "fas fa-trash fa-fw me-1 text-danger" }, null, -1),
                  c("span", null, "Force Delete", -1)
                ]), 8, NJ)
              ], 64)) : (g(), E(G, { key: 1 }, [
                c("button", {
                  type: "button",
                  class: "btn btn-sm btn-outline-secondary text-secondary",
                  onClick: h,
                  disabled: C(ws).denies("manage_reward_options") || C(l)
                }, w[4] || (w[4] = [
                  c("i", { class: "fas fa-pencil fa-fw me-1 text-primary" }, null, -1),
                  c("span", null, "Edit", -1)
                ]), 8, CJ),
                c("button", {
                  type: "button",
                  class: "btn btn-sm btn-outline-secondary text-danger",
                  onClick: f,
                  disabled: C(ws).denies("manage_reward_options")
                }, w[5] || (w[5] = [
                  c("i", { class: "fas fa-trash fa-fw me-1 text-danger" }, null, -1),
                  c("span", null, "Delete", -1)
                ]), 8, OJ)
              ], 64))
            ])
          ])
        ])
      ]);
    };
  }
}, $J = /* @__PURE__ */ oe(TJ, [["__scopeId", "data-v-aec06c64"]]), kJ = {
  "data-wrapper": "",
  class: "d-flex rounded"
}, DJ = { class: "text-center m-auto" }, RJ = { class: "mt-2" }, IJ = {
  __name: "AddRewardOptionButton",
  setup(e) {
    return (t, n) => (g(), E("div", kJ, [
      c("div", DJ, [
        n[0] || (n[0] = c("div", { class: "fs-1" }, [
          c("i", { class: "fas fa-icons fa-fw" })
        ], -1)),
        c("div", RJ, [
          fe(t.$slots, "default", {}, void 0, !0)
        ])
      ])
    ]));
  }
}, AJ = /* @__PURE__ */ oe(IJ, [["__scopeId", "data-v-732c34e6"]]), MJ = {}, PJ = {
  "data-loader": "",
  class: "p-2 d-inline-block"
};
function LJ(e, t) {
  return g(), E("div", PJ, t[0] || (t[0] = [
    c("div", null, [
      c("i", { class: "fa fa-spinner fa-spin fa-fw me-2" }),
      c("span", null, "loading")
    ], -1)
  ]));
}
const xN = /* @__PURE__ */ oe(MJ, [["render", LJ], ["__scopeId", "data-v-d4330199"]]), VJ = { "data-button": "" }, FJ = { key: 0 }, UJ = { key: 1 }, jJ = ["onClick"], BJ = ["src", "alt"], HJ = { class: "ms-auto text-end" }, YJ = { class: "d-block" }, WJ = { key: 0 }, GJ = {
  __name: "ProductDropdown",
  props: /* @__PURE__ */ jn({
    products: { type: Object }
  }, {
    product: {},
    productModifiers: {}
  }),
  emits: ["update:product"],
  setup(e) {
    const t = At(e, "product"), n = (s) => {
      t.value = s;
    };
    return (s, o) => {
      const i = le("b-dropdown-header"), r = le("b-dropdown-item"), a = le("b-dropdown");
      return e.products ? (g(), se(a, {
        key: 0,
        size: "sm",
        "data-dropdown": ""
      }, {
        button: B(() => {
          var l;
          return [
            c("span", VJ, [
              (l = t.value) != null && l.name ? (g(), E("span", FJ, F(t.value.name), 1)) : (g(), E("span", UJ, "Choose a product..."))
            ])
          ];
        }),
        default: B(() => [
          D(i, null, {
            default: B(() => o[0] || (o[0] = [
              c("span", null, "Products", -1)
            ])),
            _: 1
          }),
          (g(!0), E(G, null, ge(e.products, (l) => (g(), se(r, {
            key: l.product_id,
            active: t.value === l
          }, {
            default: B(() => [
              c("div", {
                class: "d-flex gap-2",
                "data-item": "",
                onClick: (u) => n(l)
              }, [
                c("img", {
                  src: l.image,
                  alt: l.name
                }, null, 8, BJ),
                c("div", HJ, [
                  c("span", YJ, F(l.name), 1),
                  l.value ? (g(), E("span", WJ, F(C(Ba)(l.faceValue)), 1)) : l.minValue && l.maxValue ? (g(), E(G, { key: 1 }, [
                    c("span", null, F(C(Ba)(l.minValue)), 1),
                    o[1] || (o[1] = c("span", null, " - ", -1)),
                    c("span", null, F(C(Ba)(l.maxValue)), 1)
                  ], 64)) : ne("", !0)
                ])
              ], 8, jJ)
            ]),
            _: 2
          }, 1032, ["active"]))), 128))
        ]),
        _: 1
      })) : ne("", !0);
    };
  }
}, zJ = /* @__PURE__ */ oe(GJ, [["__scopeId", "data-v-b99f2775"]]), KJ = (e) => {
  const { openLogicEditor: t, logicSuggestSearchTip: n } = window;
  if (!t || !n) {
    console.warn("Cannot initialize the Logic Text Area");
    return;
  }
  const s = e;
  s.addEventListener("click", (o) => {
    t(s);
  }), s.addEventListener("keydown", (o) => {
    n(s, o);
  });
}, XJ = {
  "data-form": "",
  class: "d-inline-block"
}, qJ = { class: "fields-container p-2" }, JJ = { class: "d-flex gap-2" }, QJ = { class: "w-100" }, ZJ = { class: "w-100" }, eQ = { class: "input-group input-group-sm mb-3" }, tQ = ["min", "max", "step"], nQ = { class: "d-flex gap-2" }, sQ = {
  __name: "RewardOptionForm",
  props: {
    product: {},
    productModifiers: {},
    value_amount: {},
    value_amountModifiers: {},
    eligibility_logic: {},
    eligibility_logicModifiers: {}
  },
  emits: ["update:product", "update:value_amount", "update:eligibility_logic"],
  setup(e) {
    const t = kp(), n = k(() => t.list), s = I(), o = At(e, "product"), i = At(e, "value_amount"), r = At(e, "eligibility_logic");
    return vt(async () => {
      var l;
      const a = s.value;
      KJ(a), ((l = t.list) == null ? void 0 : l.length) < 1 && await t.fetchList();
    }), (a, l) => {
      var u, d, f, p, h, m;
      return g(), E("div", XJ, [
        c("div", qJ, [
          c("div", JJ, [
            c("div", QJ, [
              l[4] || (l[4] = c("label", {
                for: "field-products",
                class: "form-label"
              }, "Products", -1)),
              D(zJ, {
                products: n.value,
                product: o.value,
                "onUpdate:product": l[0] || (l[0] = (v) => o.value = v)
              }, null, 8, ["products", "product"])
            ]),
            c("div", ZJ, [
              (u = o.value) != null && u.minValue && ((d = o.value) != null && d.maxValue) ? (g(), E(G, { key: 0 }, [
                l[6] || (l[6] = c("label", {
                  for: "field-amount",
                  class: "form-label"
                }, "Amount", -1)),
                c("div", eQ, [
                  l[5] || (l[5] = c("span", { class: "input-group-text" }, "$", -1)),
                  L(c("input", {
                    class: "form-control form-control-sm",
                    type: "number",
                    id: "field-amount",
                    name: "field-amount",
                    "onUpdate:modelValue": l[1] || (l[1] = (v) => i.value = v),
                    min: ((f = o.value) == null ? void 0 : f.minValue) ?? 0,
                    max: ((p = o.value) == null ? void 0 : p.maxValue) ?? "",
                    step: ((h = o.value) == null ? void 0 : h.minValue) ?? 1
                  }, null, 8, tQ), [
                    [Ve, i.value]
                  ])
                ])
              ], 64)) : (m = o.value) != null && m.faceValue ? (g(), E(G, { key: 1 }, [
                l[7] || (l[7] = c("label", {
                  for: "field-amount",
                  class: "form-label"
                }, "Amount", -1)),
                L(c("input", {
                  class: "form-control form-control-sm",
                  type: "number",
                  id: "field-amount",
                  name: "field-amount",
                  "onUpdate:modelValue": l[2] || (l[2] = (v) => i.value = v),
                  disabled: ""
                }, null, 512), [
                  [Ve, i.value]
                ])
              ], 64)) : (g(), E(G, { key: 2 }, [
                l[8] || (l[8] = c("label", {
                  for: "field-amount",
                  class: "form-label"
                }, "Amount", -1)),
                l[9] || (l[9] = c("div", { class: "input-group input-group-sm mb-3" }, [
                  c("span", { class: "input-group-text" }, "$"),
                  c("input", {
                    class: "form-control form-control-sm",
                    type: "text",
                    id: "field-amount",
                    name: "field-amount",
                    disabled: "",
                    placeholder: "..."
                  })
                ], -1))
              ], 64))
            ])
          ]),
          c("div", null, [
            l[10] || (l[10] = c("label", {
              for: "field-eligibility-logic",
              class: "form-label"
            }, "Eligibility Logic", -1)),
            L(c("textarea", {
              ref_key: "logicTextAreaRef",
              ref: s,
              class: "form-control form-control-sm",
              id: "field-eligibility-logic",
              name: "field-eligibility-logic",
              "onUpdate:modelValue": l[3] || (l[3] = (v) => r.value = v)
            }, null, 512), [
              [Ve, r.value]
            ])
          ])
        ]),
        c("div", nQ, [
          fe(a.$slots, "footer", {}, void 0, !0)
        ])
      ]);
    };
  }
}, NN = /* @__PURE__ */ oe(sQ, [["__scopeId", "data-v-db8363b4"]]), oQ = ["disabled"], rQ = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw"
}, iQ = {
  key: 1,
  class: "fas fa-save fa-fw"
}, aQ = {
  __name: "CreateRewardOptionModal",
  props: {
    visible: { default: !1 },
    visibleModifiers: {}
  },
  emits: ["update:visible"],
  setup(e) {
    const t = Or(), n = fu(), s = At(e, "visible"), o = I(), i = I(), r = I(), a = I();
    function l(v) {
      if (ut(v)) {
        const _ = v.value;
        return _ == null || _ === "";
      } else
        return console.error("Provided variable is not a Vue ref."), !1;
    }
    const u = k(() => !l(i) && !l(r) && !l(a)), d = k(() => t.loading);
    function f() {
      s.value = !1;
    }
    async function p() {
      await n.create(
        i.value,
        r.value,
        a.value
      ), f();
    }
    const h = () => {
      i.value = void 0, r.value = void 0, a.value = void 0;
    };
    function m() {
      s.value = !1;
    }
    return Ft(async () => {
      s.value === !0 && h();
    }), (v, _) => {
      const b = le("b-modal");
      return g(), se(b, {
        visible: s.value,
        ref_key: "modalRef",
        ref: o,
        backdrop: "static",
        onOnHidden: m
      }, {
        title: B(() => _[3] || (_[3] = [
          c("span", null, "Create Option", -1)
        ])),
        footer: B(() => [
          c("button", {
            type: "button",
            class: "btn btn-sm btn-secondary",
            onClick: f
          }, _[4] || (_[4] = [
            c("i", { class: "fas fa-times fa-fw" }, null, -1),
            c("span", null, "Cancel", -1)
          ])),
          c("button", {
            type: "button",
            class: "btn btn-sm btn-primary",
            onClick: p,
            disabled: d.value || !u.value
          }, [
            d.value ? (g(), E("i", rQ)) : (g(), E("i", iQ)),
            _[5] || (_[5] = c("span", null, "Save", -1))
          ], 8, oQ)
        ]),
        default: B(() => [
          D(NN, {
            product: i.value,
            "onUpdate:product": _[0] || (_[0] = (w) => i.value = w),
            value_amount: r.value,
            "onUpdate:value_amount": _[1] || (_[1] = (w) => r.value = w),
            eligibility_logic: a.value,
            "onUpdate:eligibility_logic": _[2] || (_[2] = (w) => a.value = w)
          }, null, 8, ["product", "value_amount", "eligibility_logic"])
        ]),
        _: 1
      }, 8, ["visible"]);
    };
  }
}, lQ = ["disabled"], cQ = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw"
}, uQ = {
  key: 1,
  class: "fas fa-save fa-fw"
}, dQ = {
  __name: "EditRewardOptionModal",
  props: /* @__PURE__ */ jn({
    reward_option_id: { type: Number }
  }, {
    visible: { default: !1 },
    visibleModifiers: {}
  }),
  emits: ["update:visible"],
  setup(e) {
    const t = e, { reward_option_id: n } = he(t), s = At(e, "visible");
    I();
    const o = fu(), i = Or(), r = kp(), a = I(), l = I(), u = I(), d = k(() => i.loading);
    function f() {
      var b, w, y;
      const v = (b = i.currentItem) == null ? void 0 : b.provider_product_id, _ = r.findItem(v);
      a.value = _, l.value = (w = i.currentItem) == null ? void 0 : w.value_amount, u.value = (y = i.currentItem) == null ? void 0 : y.eligibility_logic;
    }
    function p() {
      s.value = !1;
    }
    async function h() {
      await o.update(
        n.value,
        a.value,
        l.value,
        u.value
      ), p();
    }
    function m() {
      s.value = !1;
    }
    return Ft(async () => {
      s.value === !0 && f();
    }), (v, _) => {
      const b = le("b-modal");
      return g(), se(b, {
        visible: s.value,
        backdrop: "static",
        onOnHidden: m
      }, {
        title: B(() => [
          c("span", null, "Editing Option #" + F(C(n)), 1)
        ]),
        footer: B(() => [
          c("button", {
            type: "button",
            class: "btn btn-sm btn-secondary",
            onClick: p
          }, _[3] || (_[3] = [
            c("i", { class: "fas fa-times fa-fw" }, null, -1),
            c("span", null, "Cancel", -1)
          ])),
          c("button", {
            type: "button",
            class: "btn btn-sm btn-primary",
            onClick: h,
            disabled: d.value
          }, [
            d.value ? (g(), E("i", cQ)) : (g(), E("i", uQ)),
            _[4] || (_[4] = c("span", null, "Save", -1))
          ], 8, lQ)
        ]),
        default: B(() => [
          D(NN, {
            product: a.value,
            "onUpdate:product": _[0] || (_[0] = (w) => a.value = w),
            value_amount: l.value,
            "onUpdate:value_amount": _[1] || (_[1] = (w) => l.value = w),
            eligibility_logic: u.value,
            "onUpdate:eligibility_logic": _[2] || (_[2] = (w) => u.value = w)
          }, null, 8, ["product", "value_amount", "eligibility_logic"])
        ]),
        _: 1
      }, 8, ["visible"]);
    };
  }
}, fQ = { class: "reward-options" }, pQ = {
  class: "d-flex",
  key: "approval-button"
}, hQ = ["disabled"], mQ = {
  __name: "RewardOptionList",
  setup(e) {
    const t = Or(), n = fu(), { loading: s } = he(t), o = I(!1), i = I(!1), r = qe({}), a = k(() => t.list);
    function l() {
      o.value = !0;
    }
    function u(d) {
      const f = d;
      n.edit(f), n.prepareEditData(f == null ? void 0 : f.reward_option_id), Object.assign(r, f), i.value = !0;
    }
    return vt(() => t.fetchList()), (d, f) => (g(), E(G, null, [
      c("div", fQ, [
        D(m0, { name: "fade" }, {
          default: B(() => [
            (g(!0), E(G, null, ge(a.value, (p, h) => (g(), se($J, {
              key: `${h}-${p.reward_option_id}`,
              class: "reward-option",
              data: p,
              "data-reward-option": "",
              onShowEditModal: u
            }, null, 8, ["data"]))), 128)),
            c("div", pQ, [
              D(AJ, null, {
                default: B(() => [
                  c("button", {
                    type: "button",
                    onClick: l,
                    class: "btn btn-sm btn-primary",
                    disabled: C(ws).denies("manage_reward_options")
                  }, f[2] || (f[2] = [
                    c("i", { class: "fas fa-plus fa-fw" }, null, -1),
                    c("span", null, "Add Option", -1)
                  ]), 8, hQ)
                ]),
                _: 1
              })
            ])
          ]),
          _: 1
        })
      ]),
      C(s) ? (g(), se(xN, { key: 0 })) : ne("", !0),
      (g(), se(ns, { to: "body" }, [
        D(aQ, {
          visible: o.value,
          "onUpdate:visible": f[0] || (f[0] = (p) => o.value = p)
        }, null, 8, ["visible"]),
        D(dQ, {
          visible: i.value,
          "onUpdate:visible": f[1] || (f[1] = (p) => i.value = p),
          reward_option_id: r == null ? void 0 : r.reward_option_id
        }, null, 8, ["visible", "reward_option_id"])
      ]))
    ], 64));
  }
}, vQ = /* @__PURE__ */ oe(mQ, [["__scopeId", "data-v-c0e81acf"]]), gQ = {
  __name: "ReviewPage",
  setup(e) {
    const t = ds(), n = Nr(), s = ua(), o = Or(), i = k(() => o.list), { loading: r } = he(o), { pagination: a, loading: l } = he(s);
    return Ft(() => {
      var u;
      r.value || ((u = i.value) == null ? void 0 : u.length) > 0 || t.push({ name: "reward-options" });
    }), nt(
      () => n.params.arm_num,
      async (u, d) => {
        await s.updatePaginationSilently("page", 1), await s.loadRecords();
      }
    ), (u, d) => {
      const f = le("router-view");
      return g(), E("div", null, [
        D(f)
      ]);
    };
  }
}, _Q = { "data-wrapper": "" }, yQ = {
  "data-badge": "",
  class: "text-bg-light"
}, bQ = ["textContent"], EQ = {
  __name: "StatusIndicator",
  props: {
    status: { type: String, default: "unknown" }
  },
  setup(e) {
    return (t, n) => (g(), E("div", _Q, [
      c("span", yQ, [
        e.status === "loading" ? (g(), E(G, { key: 0 }, [
          n[0] || (n[0] = c("i", { class: "fas fa-spinner fa-spin fa-fw" }, null, -1)),
          n[1] || (n[1] = c("span", null, null, -1))
        ], 64)) : e.status === C(Ie).COMPLETED ? (g(), E(G, { key: 1 }, [
          n[2] || (n[2] = c("i", { class: "fas fa-circle-check fa-fw text-success" }, null, -1)),
          n[3] || (n[3] = c("span", null, "Completed", -1))
        ], 64)) : e.status === C(Ie).ELIGIBLE ? (g(), E(G, { key: 2 }, [
          n[4] || (n[4] = c("i", { class: "fas fa-clipboard fa-fw text-secondary" }, null, -1)),
          n[5] || (n[5] = c("span", null, "Eligible", -1))
        ], 64)) : e.status === C(Ie).UNKNOWN ? (g(), E(G, { key: 3 }, [
          n[6] || (n[6] = c("i", { class: "fas fa-circle-question fa-fw text-success" }, null, -1)),
          n[7] || (n[7] = c("span", null, "Unknown", -1))
        ], 64)) : e.status === C(Ie).REVIEWER_APPROVED ? (g(), E(G, { key: 4 }, [
          n[8] || (n[8] = c("i", { class: "fas fa-thumbs-up fa-fw text-success" }, null, -1)),
          c("span", null, F(e.status), 1)
        ], 64)) : e.status === C(Ie).REVIEWER_REJECTED ? (g(), E(G, { key: 5 }, [
          n[9] || (n[9] = c("i", { class: "fas fa-thumbs-down fa-fw text-danger" }, null, -1)),
          c("span", null, F(e.status), 1)
        ], 64)) : e.status === C(Ie).BUYER_APPROVED ? (g(), E(G, { key: 6 }, [
          n[10] || (n[10] = c("i", { class: "fas fa-thumbs-up fa-fw text-success" }, null, -1)),
          c("span", null, F(e.status), 1)
        ], 64)) : e.status === C(Ie).BUYER_REJECTED ? (g(), E(G, { key: 7 }, [
          n[11] || (n[11] = c("i", { class: "fas fa-thumbs-down fa-fw text-danger" }, null, -1)),
          c("span", null, F(e.status), 1)
        ], 64)) : e.status === C(Ie).INELIGIBLE ? (g(), E(G, { key: 8 }, [
          n[12] || (n[12] = c("i", { class: "fas fa-ban fa-fw text-danger" }, null, -1)),
          n[13] || (n[13] = c("span", null, "Ineligible", -1))
        ], 64)) : e.status === C(Ie).INVALID ? (g(), E(G, { key: 9 }, [
          n[14] || (n[14] = c("i", { class: "fas fa-triangle-exclamation fa-fw text-warning" }, null, -1)),
          n[15] || (n[15] = c("span", null, "Invalid", -1))
        ], 64)) : e.status === C(Ie).SCHEDULED ? (g(), E(G, { key: 10 }, [
          n[16] || (n[16] = c("i", { class: "fas fa-triangle-exclamation fa-fw text-warning" }, null, -1)),
          n[17] || (n[17] = c("span", null, "Scheduled", -1))
        ], 64)) : e.status === C(Ie).ORDER_PLACED ? (g(), E(G, { key: 11 }, [
          n[18] || (n[18] = c("i", { class: "fas fa-gift fa-fw text-primary" }, null, -1)),
          c("span", null, F(e.status), 1)
        ], 64)) : (g(), E(G, { key: 12 }, [
          n[19] || (n[19] = c("i", { class: "fas fa-ban fa-fw text-danger" }, null, -1)),
          c("span", {
            textContent: F(e.status)
          }, null, 8, bQ)
        ], 64))
      ])
    ]));
  }
}, wQ = /* @__PURE__ */ oe(EQ, [["__scopeId", "data-v-9ce57a0f"]]), SQ = {
  key: 0,
  class: "d-flex align-items-center text-muted schedule-badge"
}, xQ = { class: "whitespace-nowrap" }, NQ = ["textContent"], CQ = {
  __name: "ScheduleIndicator",
  props: {
    order: { type: Object, default: null }
  },
  setup(e) {
    return (t, n) => {
      var s, o;
      return (s = e.order) != null && s.scheduled_action ? (g(), E("div", SQ, [
        c("span", xQ, [
          n[0] || (n[0] = c("i", { class: "fas fa-clock fa-fw" }, null, -1)),
          c("span", {
            textContent: F(((o = e.order) == null ? void 0 : o.scheduled_action) ?? "")
          }, null, 8, NQ)
        ])
      ])) : ne("", !0);
    };
  }
}, OQ = /* @__PURE__ */ oe(CQ, [["__scopeId", "data-v-d9fa84cf"]]), TQ = { class: "d-flex align-items-center gap-2" }, $Q = {
  key: 0,
  class: "form-check form-switch"
}, kQ = ["value"], DQ = {
  __name: "ReviewTableCell",
  props: {
    record: { type: Object },
    reward_option: { type: Object }
  },
  emits: ["show-modal", "cell-selected"],
  setup(e, { emit: t }) {
    var v;
    const n = [
      "eligible",
      "reviewer:approved",
      "buyer:approved"
    ], s = ca(), o = e, i = t, r = I(!1), { record: a, reward_option: l } = he(o), u = EN(
      s.value,
      (v = l.value) == null ? void 0 : v.reward_option_id
    );
    function d() {
      var _;
      Qm.includes((_ = h.value) == null ? void 0 : _.status) && i("cell-selected", {
        record: a.value,
        reward_option: l.value
      });
    }
    const f = k({
      get: () => u.selected,
      set: (_) => u.selected = _
    }), p = k(() => {
      var _;
      return {
        cursor: Qm.includes((_ = h.value) == null ? void 0 : _.status) ? "pointer" : "not-allowed"
      };
    }), h = k(
      () => {
        var _;
        return (_ = a.value) == null ? void 0 : _.reward_options[l.value.reward_option_id];
      }
    ), m = k(() => {
      var _, b;
      return (b = (_ = h.value) == null ? void 0 : _.orders) == null ? void 0 : b[0];
    });
    return (_, b) => {
      var w, y, x, N, S, O;
      return g(), E("div", TQ, [
        c("div", {
          "data-actions": "",
          style: Jn(p.value),
          class: "me-auto"
        }, [
          D(wQ, {
            status: r.value ? "loading" : (w = h.value) == null ? void 0 : w.status,
            onClick: d
          }, null, 8, ["status"])
        ], 4),
        D(OQ, { order: m.value }, null, 8, ["order"]),
        (x = (y = h.value) == null ? void 0 : y.reward_option) != null && x.is_deleted ? ne("", !0) : (g(), E(G, { key: 0 }, [
          !((N = m.value) != null && N.scheduled_action) && [
            "eligible",
            "reviewer:approved",
            "buyer:approved"
          ].includes((S = h.value) == null ? void 0 : S.status) ? (g(), E("div", $Q, [
            n.includes((O = h.value) == null ? void 0 : O.status) ? L((g(), E("input", {
              key: 0,
              class: "form-check-input",
              type: "checkbox",
              "onUpdate:modelValue": b[0] || (b[0] = ($) => f.value = $),
              value: C(a).record_id
            }, null, 8, kQ)), [
              [mn, f.value]
            ]) : ne("", !0)
          ])) : ne("", !0)
        ], 64))
      ]);
    };
  }
}, RQ = /* @__PURE__ */ oe(DQ, [["__scopeId", "data-v-9d5e496a"]]), IQ = { class: "small" }, AQ = { class: "d-block text-nowrap text-muted" }, MQ = ["href"], PQ = { class: "d-block text-nowrap text-muted small fst-italic" }, LQ = { class: "d-flex" }, VQ = {
  key: 0,
  class: "fas fa-clock fa-fw text-muted"
}, FQ = {
  key: 1,
  class: "fas fa-circle-check fa-fw text-success"
}, UQ = {
  key: 2,
  class: "fas fa-triangle-exclamation fa-fw text-warning"
}, jQ = {
  key: 3,
  class: "fas fa-question fa-fw"
}, BQ = { class: "d-block text-uppercase" }, HQ = { class: "d-block text-uppercase" }, YQ = ["textContent"], WQ = ["textContent"], GQ = {
  __name: "ActionRow",
  props: {
    action: { type: Object, default: null }
  },
  setup(e) {
    const t = e, { action: n } = he(t), s = k(() => n.value.performed_by ?? {}), o = (i) => {
      const r = (i == null ? void 0 : i.date) ?? !1;
      return r ? new Date(r).toLocaleString() : void 0;
    };
    return (i, r) => (g(), E("tr", IQ, [
      c("td", null, [
        c("div", null, [
          c("span", AQ, [
            r[0] || (r[0] = c("i", { class: "fas fa-user fa-fw" }, null, -1)),
            c("a", {
              href: `mailto:${s.value.user_email}`
            }, F(s.value.user_firstname) + " " + F(s.value.user_lastname), 9, MQ)
          ]),
          c("span", PQ, [
            r[1] || (r[1] = c("i", { class: "fas fa-clock fa-fw" }, null, -1)),
            te(" " + F(o(C(n).performed_at)), 1)
          ])
        ])
      ]),
      c("td", null, [
        c("div", LQ, [
          c("span", null, [
            C(n).status === C(Wu).PENDING ? (g(), E("i", VQ)) : C(n).status === C(Wu).COMPLETED ? (g(), E("i", FQ)) : C(n).status === C(Wu).ERROR ? (g(), E("i", UQ)) : C(n).status === C(Wu).UNKNOWN ? (g(), E("i", jQ)) : ne("", !0)
          ]),
          c("div", null, [
            c("span", BQ, F(C(n).stage), 1),
            c("span", HQ, F(C(n).event), 1)
          ])
        ])
      ]),
      c("td", null, [
        C(n).comment ? (g(), E("textarea", {
          key: 0,
          class: "form-control",
          readonly: "",
          textContent: F(C(n).comment)
        }, null, 8, YQ)) : ne("", !0)
      ]),
      c("td", null, [
        C(n).details ? (g(), E("textarea", {
          key: 0,
          class: "form-control",
          readonly: "",
          textContent: F(C(n).details)
        }, null, 8, WQ)) : ne("", !0)
      ])
    ]));
  }
}, zQ = /* @__PURE__ */ oe(GQ, [["__scopeId", "data-v-eae79601"]]), KQ = { class: "wrapper" }, XQ = { class: "actions-wrapper" }, qQ = { class: "actions" }, JQ = { class: "table table-bordered table-striped table-sm mt-2 small" }, QQ = { key: 0 }, ZQ = {
  __name: "ActionsList",
  setup(e) {
    const t = $e("approval-service"), { currentOrder: n = {} } = he(t), s = k(() => {
      var o;
      return (((o = n.value) == null ? void 0 : o.actions) || []).toReversed();
    });
    return (o, i) => (g(), E("div", KQ, [
      i[2] || (i[2] = c("div", { class: "border-bottom p-2" }, [
        c("i", { class: "fas fa-list fa-fw me-2" }),
        c("span", { class: "fw-bold" }, "Logs")
      ], -1)),
      c("div", XQ, [
        c("div", qQ, [
          c("table", JQ, [
            i[1] || (i[1] = c("thead", null, [
              c("tr", { class: "small" }, [
                c("th", null, "User"),
                c("th", null, "Stage/Event"),
                c("th", null, "Comment"),
                c("th", null, "Details")
              ])
            ], -1)),
            c("tbody", null, [
              (g(!0), E(G, null, ge(s.value, (r) => (g(), se(zQ, {
                key: r.action_id,
                action: r
              }, null, 8, ["action"]))), 128)),
              s.value.length == 0 ? (g(), E("tr", QQ, i[0] || (i[0] = [
                c("td", { colspan: "4" }, [
                  c("span", { class: "fst-italic text-muted p-2" }, "No logs")
                ], -1)
              ]))) : ne("", !0)
            ])
          ])
        ])
      ])
    ]));
  }
}, eZ = {
  key: 0,
  class: "d-flex flex-column justify-content-center align-items-center"
}, tZ = { class: "fw-bold fs-6 text-muted" }, nZ = {
  __name: "RewardDetails",
  setup(e) {
    const t = $e("approval-service"), { currentOrder: n = {} } = he(t);
    return (s, o) => {
      var i, r;
      return C(n) ? (g(), E("div", eZ, [
        D(SN, {
          value: (i = C(n)) == null ? void 0 : i.reward_value
        }, null, 8, ["value"]),
        c("span", tZ, F((r = C(n)) == null ? void 0 : r.reward_name), 1)
      ])) : ne("", !0);
    };
  }
}, sZ = {
  key: 0,
  class: "d-flex flex-column justify-content-start align-items-start"
}, oZ = { key: 0 }, rZ = {
  class: "border rounded p-2",
  style: { "white-space": "pre-wrap" }
}, iZ = { class: "border rounded p-2" }, aZ = { key: 1 }, lZ = { class: "border rounded p-2" }, cZ = { class: "d-block" }, uZ = { class: "d-block" }, dZ = {
  __name: "OrderDetails",
  setup(e) {
    const t = $e("approval-service"), { currentOrder: n = {}, record: s = {} } = he(t);
    return (o, i) => {
      var r, a, l, u;
      return C(n) ? (g(), E("div", sZ, [
        (r = C(s)) != null && r.participant_details ? (g(), E("details", oZ, [
          i[0] || (i[0] = c("summary", { class: "text-muted fst-italic" }, "Participant Details...", -1)),
          c("div", rZ, [
            c("code", null, F(C(s).participant_details), 1)
          ])
        ])) : ne("", !0),
        c("details", null, [
          i[1] || (i[1] = c("summary", { class: "text-muted fst-italic" }, "Eligibility Logic...", -1)),
          c("div", iZ, [
            c("code", null, F((a = C(n)) == null ? void 0 : a.eligibility_logic), 1)
          ])
        ]),
        (l = C(n)) != null && l.reference_order || (u = C(n)) != null && u.internal_reference ? (g(), E("details", aZ, [
          i[2] || (i[2] = c("summary", { class: "text-muted fst-italic" }, "Order Details...", -1)),
          c("div", lZ, [
            c("code", cZ, "Order: " + F(C(n).reference_order ?? "---"), 1),
            c("code", uZ, "Internal Code: " + F(C(n).internal_reference ?? "---"), 1)
          ])
        ])) : ne("", !0)
      ])) : ne("", !0);
    };
  }
}, fZ = /* @__PURE__ */ oe(dZ, [["__scopeId", "data-v-ca3f5296"]]), pZ = { class: "step-circle" }, hZ = { class: "content" }, mZ = {
  key: 0,
  class: "fas fa-check fa-fw text-light"
}, vZ = {
  key: 1,
  class: "fas fa-times fa-fw text-light"
}, gZ = { class: "step-label" }, _Z = {
  __name: "ProgressStep",
  props: {
    active: { type: Boolean, default: !1 },
    status: { type: String, default: Wt.PENDING },
    label: { type: String, default: "Step 0" }
  },
  setup(e) {
    const t = e, { active: n, status: s } = he(t), o = k(() => ({
      active: n.value,
      completed: s.value === Wt.COMPLETED,
      rejected: s.value === Wt.REJECTED
    }));
    return (i, r) => (g(), E("div", {
      class: Se(["step", o.value])
    }, [
      c("div", pZ, [
        c("span", hZ, [
          C(s) === C(Wt).COMPLETED ? (g(), E("i", mZ)) : C(s) === C(Wt).REJECTED ? (g(), E("i", vZ)) : fe(i.$slots, "circle", { key: 2 }, () => [
            r[0] || (r[0] = c("span", null, "•", -1))
          ], !0)
        ])
      ]),
      c("div", gZ, [
        fe(i.$slots, "default", {}, void 0, !0)
      ]),
      r[1] || (r[1] = c("div", { class: "indicator" }, [
        c("span", { class: "progress" })
      ], -1))
    ], 2));
  }
}, Dh = /* @__PURE__ */ oe(_Z, [["__scopeId", "data-v-6e716bd4"]]), yZ = {
  __name: "ProgressBar",
  props: {
    status: { type: String, default: null }
  },
  emits: ["go-to-step"],
  setup(e, { emit: t }) {
    const n = e, s = qe({
      reviewStep: { active: !1, status: Wt.PENDING, completed: !1, rejected: !1 },
      financeStep: { active: !1, status: Wt.PENDING, completed: !1, rejected: !1 },
      deliveryStep: { active: !1, status: Wt.PENDING, completed: !1, rejected: !1 }
    }), o = I(), i = I(), r = I();
    return nt(
      () => n.status,
      (a) => {
        switch (a) {
          case Ie.PENDING:
          case Ie.ELIGIBLE:
          case Ie.BUYER_REJECTED:
            Object.assign(s.reviewStep, { status: Wt.PENDING, active: !0 }), Object.assign(s.financeStep, { status: Wt.PENDING, active: !1 }), Object.assign(s.deliveryStep, { status: Wt.PENDING, active: !1 });
            break;
          case Ie.REVIEWER_REJECTED:
            Object.assign(s.reviewStep, { status: Wt.REJECTED, active: !1 }), Object.assign(s.financeStep, { status: Wt.PENDING, active: !1 }), Object.assign(s.deliveryStep, { status: Wt.PENDING, active: !1 });
            break;
          case Ie.REVIEWER_APPROVED:
            Object.assign(s.reviewStep, { status: Wt.COMPLETED, active: !1 }), Object.assign(s.financeStep, { status: Wt.PENDING, active: !0 }), Object.assign(s.deliveryStep, { status: Wt.PENDING, active: !1 });
            break;
          case Ie.BUYER_APPROVED:
            Object.assign(s.reviewStep, { status: Wt.COMPLETED, active: !1 }), Object.assign(s.financeStep, { status: Wt.COMPLETED, active: !1 }), Object.assign(s.deliveryStep, { status: Wt.PENDING, active: !1 });
            break;
          case Ie.ORDER_PLACED:
            Object.assign(s.reviewStep, { status: Wt.COMPLETED, active: !1 }), Object.assign(s.financeStep, { status: Wt.COMPLETED, active: !1 }), Object.assign(s.deliveryStep, { status: Wt.PENDING, active: !1 });
            break;
          case Ie.COMPLETED:
            Object.assign(s.reviewStep, { status: Wt.COMPLETED, active: !1 }), Object.assign(s.financeStep, { status: Wt.COMPLETED, active: !1 }), Object.assign(s.deliveryStep, { status: Wt.COMPLETED, active: !0 });
            break;
          default:
            Object.assign(s.reviewStep, { status: Wt.PENDING, active: !1 }), Object.assign(s.financeStep, { status: Wt.PENDING, active: !1 }), Object.assign(s.deliveryStep, { status: Wt.PENDING, active: !1 });
            break;
        }
      },
      {
        immediate: !0
      }
    ), (a, l) => (g(), E("div", null, [
      c("div", {
        "data-progress-bar-container": "",
        onClick: l[0] || (l[0] = (...u) => a.onClick && a.onClick(...u))
      }, [
        D(Dh, {
          ref_key: "reviewStep",
          ref: o,
          active: s.reviewStep.active,
          status: s.reviewStep.status
        }, {
          circle: B(() => l[1] || (l[1] = [
            c("i", { class: "fas fa-clipboard fa-fw" }, null, -1)
          ])),
          default: B(() => [
            l[2] || (l[2] = c("span", null, "Eligibility Review", -1))
          ]),
          _: 1
        }, 8, ["active", "status"]),
        D(Dh, {
          ref_key: "financeStep",
          ref: i,
          active: s.financeStep.active,
          status: s.financeStep.status
        }, {
          circle: B(() => l[3] || (l[3] = [
            c("i", { class: "fas fa-shopping-cart fa-fw" }, null, -1)
          ])),
          default: B(() => [
            l[4] || (l[4] = c("span", null, "Financial Authorization", -1))
          ]),
          _: 1
        }, 8, ["active", "status"]),
        D(Dh, {
          ref_key: "deliveryStep",
          ref: r,
          active: s.deliveryStep.active,
          status: s.deliveryStep.status
        }, {
          circle: B(() => l[5] || (l[5] = [
            c("i", { class: "fas fa-gift fa-fw" }, null, -1)
          ])),
          default: B(() => [
            l[6] || (l[6] = c("span", null, "Compensation Delivery", -1))
          ]),
          _: 1
        }, 8, ["active", "status"])
      ])
    ]));
  }
}, bZ = /* @__PURE__ */ oe(yZ, [["__scopeId", "data-v-9a20781e"]]), Rh = {
  __name: "FeedbackPanel",
  setup(e) {
    const t = $e("approval-service"), n = k({
      get: () => t.comment,
      set: (s) => t.comment = s
    });
    return (s, o) => (g(), E("div", null, [
      o[1] || (o[1] = c("label", {
        for: "note-textarea",
        class: "form-label mt-2"
      }, "Comment (optional)", -1)),
      L(c("textarea", {
        class: "form-control",
        placeholder: "Provide a comment related to your action...",
        id: "note-textarea",
        rows: "3",
        "onUpdate:modelValue": o[0] || (o[0] = (i) => n.value = i)
      }, null, 512), [
        [Ve, n.value]
      ])
    ]));
  }
}, EZ = ["disabled"], wZ = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw"
}, SZ = { class: "ms-1" }, da = {
  __name: "ActionButton",
  props: {
    action: { type: String },
    callback: { type: Function, default: () => {
    } },
    variant: { type: String, default: "btn-outline-secondary" },
    success: { type: String },
    error: { type: String }
  },
  setup(e) {
    const t = e, n = k(() => r.value || !o(t.action)), s = $e("approval-service"), { canPerformAction: o, performAction: i } = s, { loading: r, status: a } = he(s), { success: l, error: u } = he(t);
    async function d() {
      await i(t.action, {
        success: l.value,
        error: u.value
      }), typeof t.callback == "function" && t.callback();
    }
    return (f, p) => (g(), E("button", bn({
      type: "button",
      class: ["btn btn-sm", e.variant],
      onClick: d,
      disabled: n.value
    }, f.$attrs), [
      fe(f.$slots, "default", {}, () => [
        C(r) ? (g(), E("i", wZ)) : fe(f.$slots, "icon", { key: 1 }),
        c("span", SZ, [
          fe(f.$slots, "text")
        ])
      ])
    ], 16, EZ));
  }
}, xZ = {
  __name: "ReSendEmailButton",
  setup(e) {
    return (t, n) => (g(), se(da, {
      action: C(xn).SEND_EMAIL,
      variant: "btn-primary",
      success: "Email Sent!"
    }, {
      icon: B(() => n[0] || (n[0] = [
        c("i", { class: "fas fa-envelope fa-fw" }, null, -1)
      ])),
      text: B(() => n[1] || (n[1] = [
        te("Re-send Email")
      ])),
      _: 1
    }, 8, ["action"]));
  }
}, NZ = {
  __name: "SendEmailButton",
  setup(e) {
    return (t, n) => (g(), se(da, {
      action: C(xn).SEND_EMAIL
    }, {
      icon: B(() => n[0] || (n[0] = [
        c("i", { class: "fas fa-envelope fa-fw" }, null, -1)
      ])),
      text: B(() => n[1] || (n[1] = [
        te("Send Email")
      ])),
      _: 1
    }, 8, ["action"]));
  }
}, CZ = ["disabled"], OZ = {
  __name: "FinancialApproveButton",
  setup(e) {
    const t = xn.BUYER_APPROVAL, n = k(() => r.value || !o(t)), s = $e("approval-service"), { canPerformAction: o, performAction: i } = s, { loading: r, status: a } = he(s);
    async function l() {
      await i(t), a.value === Ie.COMPLETED && console.log("🥳🎉");
    }
    return (u, d) => (g(), E("button", {
      type: "button",
      class: "btn btn-sm btn-outline-secondary",
      onClick: l,
      disabled: n.value
    }, d[0] || (d[0] = [
      c("i", { class: "fas fa-thumbs-up fa-fw text-success" }, null, -1),
      c("span", { class: "ms-1" }, "Approve", -1)
    ]), 8, CZ));
  }
}, TZ = {
  __name: "FinancialRejectButton",
  setup(e) {
    return (t, n) => (g(), se(da, {
      action: C(xn).BUYER_REJECTION
    }, {
      icon: B(() => n[0] || (n[0] = [
        c("i", { class: "fas fa-thumbs-down fa-fw text-danger" }, null, -1)
      ])),
      text: B(() => n[1] || (n[1] = [
        te("Reject")
      ])),
      _: 1
    }, 8, ["action"]));
  }
}, $Z = {
  __name: "PlaceOrderButton",
  setup(e) {
    return (t, n) => (g(), se(da, {
      action: C(xn).PLACE_ORDER
    }, {
      icon: B(() => n[0] || (n[0] = [
        c("i", { class: "fas fa-gift fa-fw text-primary" }, null, -1)
      ])),
      text: B(() => n[1] || (n[1] = [
        te("Place Order")
      ])),
      _: 1
    }, 8, ["action"]));
  }
}, kZ = {
  __name: "ReviewApproveButton",
  setup(e) {
    return (t, n) => (g(), se(da, {
      action: C(xn).REVIEWER_APPROVAL
    }, {
      icon: B(() => n[0] || (n[0] = [
        c("i", { class: "fas fa-thumbs-up fa-fw text-success" }, null, -1)
      ])),
      text: B(() => n[1] || (n[1] = [
        te("Approve")
      ])),
      _: 1
    }, 8, ["action"]));
  }
}, DZ = {
  __name: "ReviewRejectButton",
  setup(e) {
    return (t, n) => (g(), se(da, {
      action: C(xn).REVIEWER_REJECTION
    }, {
      icon: B(() => n[0] || (n[0] = [
        c("i", { class: "fas fa-thumbs-down fa-fw text-danger" }, null, -1)
      ])),
      text: B(() => n[1] || (n[1] = [
        te("Reject")
      ])),
      _: 1
    }, 8, ["action"]));
  }
}, RZ = {
  __name: "ReviewRestoreButton",
  setup(e) {
    return (t, n) => (g(), se(da, {
      action: C(xn).REVIEWER_RESTORE
    }, {
      icon: B(() => n[0] || (n[0] = [
        c("i", { class: "fas fa-rotate-left fa-fw text-secondary" }, null, -1)
      ])),
      text: B(() => n[1] || (n[1] = [
        te("Restore")
      ])),
      _: 1
    }, 8, ["action"]));
  }
}, IZ = {
  class: "btn-group mr-2",
  role: "group",
  "aria-label": "First group"
}, AZ = ["href"], MZ = {
  __name: "RedeemLinkButton",
  setup(e) {
    const t = gl(), n = an(), s = $e("approval-service"), { currentOrder: o } = he(s);
    async function i() {
      var r;
      await t.copy((r = o.value) == null ? void 0 : r.redeem_link), n.toast({ title: "Success", body: "Link copied to clipboard" });
    }
    return (r, a) => (g(), E("div", IZ, [
      c("a", {
        class: "btn btn-sm btn-primary text-white text-start",
        href: C(o).redeem_link,
        target: "_blank"
      }, a[0] || (a[0] = [
        c("i", { class: "fas fa-arrow-up-right-from-square fa-fw" }, null, -1),
        c("span", { class: "ms-1" }, "Redeem link", -1)
      ]), 8, AZ),
      c("button", {
        type: "button",
        class: "btn btn-sm btn-outline-primary ms-auto",
        onClick: i
      }, a[1] || (a[1] = [
        c("i", { class: "fas fa-copy fa-fw" }, null, -1)
      ]))
    ]));
  }
}, PZ = {
  key: 0,
  class: "d-flex gap-2 justify-content-center"
}, LZ = { class: "d-flex gap-2 justify-content-center" }, VZ = { class: "d-flex gap-2 justify-content-center" }, FZ = {
  key: 4,
  class: "d-flex gap-2 justify-content-center"
}, UZ = {
  key: 5,
  class: "d-flex gap-2 justify-content-center"
}, jZ = { class: "d-flex gap-2 justify-content-center" }, BZ = {
  __name: "ActionsProvider",
  setup(e) {
    const t = $e("approval-service"), { loading: n, status: s } = he(t);
    return (o, i) => (g(), E("div", null, [
      C(s) === C(Ie).COMPLETED ? (g(), E("div", PZ, [
        D(MZ),
        D(xZ)
      ])) : C(s) === C(Ie).INVALID ? (g(), E(G, { key: 1 }, [], 64)) : [C(Ie).ELIGIBLE, C(Ie).BUYER_REJECTED].includes(C(s)) ? (g(), E(G, { key: 2 }, [
        D(Rh, { class: "mb-2" }),
        c("div", LZ, [
          D(DZ),
          D(kZ)
        ])
      ], 64)) : C(s) === C(Ie).REVIEWER_APPROVED ? (g(), E(G, { key: 3 }, [
        D(Rh, { class: "mb-2" }),
        c("div", VZ, [
          D(TZ),
          D(OZ)
        ])
      ], 64)) : C(s) === C(Ie).BUYER_APPROVED ? (g(), E("div", FZ, [
        D($Z)
      ])) : C(s) === C(Ie).ORDER_PLACED ? (g(), E("div", UZ, [
        D(NZ, null, {
          default: B(() => i[0] || (i[0] = [
            te("Send Email")
          ])),
          _: 1
        })
      ])) : C(s) === C(Ie).REVIEWER_REJECTED ? (g(), E(G, { key: 6 }, [
        D(Rh, { class: "mb-2" }),
        c("div", jZ, [
          D(RZ)
        ])
      ], 64)) : C(s) === C(Ie).PENDING ? (g(), E(G, { key: 7 }, [], 64)) : C(s) === C(Ie).BUYER_REJECTED ? (g(), E(G, { key: 8 }, [], 64)) : C(s) === C(Ie).INELIGIBLE ? (g(), E(G, { key: 9 }, [], 64)) : C(s) === C(Ie).SCHEDULED ? (g(), E(G, { key: 10 }, [], 64)) : C(s) === C(Ie).CANCELED ? (g(), E(G, { key: 11 }, [], 64)) : C(s) === C(Ie).ERROR ? (g(), E(G, { key: 12 }, [], 64)) : C(s) === C(Ie).UNKNOWN ? (g(), E(G, { key: 13 }, [], 64)) : C(s) === C(Ie).PROCESSING ? (g(), E(G, { key: 14 }, [], 64)) : ne("", !0)
    ]));
  }
}, HZ = {
  key: 0,
  class: "ms-2"
}, YZ = { class: "actions-content" }, WZ = { class: "p-2" }, GZ = { class: "d-flex flex-column mt-2" }, zZ = { class: "border rounded d-inline-block p-2" }, KZ = { class: "d-flex justify-content-center py-2" }, XZ = { class: "border-top p-2" }, qZ = { class: "actions-sidebar d-flex flex-column" }, JZ = {
  __name: "ActionsModal",
  props: {
    visible: { default: !1 },
    visibleModifiers: {}
  },
  emits: ["update:visible"],
  setup(e) {
    function t(w, y = "_self") {
      window.open(w, y).focus();
    }
    const n = $e("approval-service"), { status: s, orderAvailable: o, record: i, loading: r, currentOrder: a } = he(n), l = At(e, "visible"), u = I(), d = I(), f = I(!0);
    Ft(async () => {
      u.value && (l.value === !0 ? (await u.value.show(), l.value = !1) : (await u.value.hide(), n.update({}, {})));
    });
    let p = null, h = null, m = !1, v = !1;
    const _ = () => {
      m = !0;
    }, b = () => {
      h && (v && (v = !1, h.classList.remove("resizing")), m = !1);
    };
    return vt(() => {
      var w;
      h = (w = d.value) == null ? void 0 : w.closest(".modal-content"), h && (m = !1, v = !1, p = new ResizeObserver((y) => {
        m && (v || (v = !0, h.classList.add("resizing")));
      }), p.observe(h), h.addEventListener("mousedown", _), h.addEventListener("mouseup", b));
    }), Fo(() => {
      var y;
      const w = (y = d.value) == null ? void 0 : y.closest(".modal-content");
      w && (p.disconnect(), w.removeEventListener("mousedown", _), w.removeEventListener("mouseup", b));
    }), (w, y) => {
      const x = le("b-modal"), N = Ht("draggable");
      return L((g(), se(x, {
        ref_key: "modalRef",
        ref: u,
        size: "xl",
        class: "workflow-modal",
        backdrop: f.value
      }, {
        title: B(() => [
          y[2] || (y[2] = c("span", { class: "fw-bold" }, "Compensation Workflow", -1)),
          C(r) ? (g(), E("div", HZ, y[1] || (y[1] = [
            c("i", { class: "fas fa-spinner fa-spin fa-fw" }, null, -1)
          ]))) : ne("", !0)
        ]),
        default: B(() => {
          var S;
          return [
            c("div", {
              ref_key: "contentRef",
              ref: d,
              class: "actions-wrapper"
            }, [
              c("div", YZ, [
                c("div", WZ, [
                  D(bZ, { status: C(s) }, null, 8, ["status"]),
                  c("div", GZ, [
                    c("div", zZ, [
                      D(nZ)
                    ]),
                    c("div", KZ, [
                      c("button", {
                        type: "button",
                        class: "btn btn-xs btn-outline-primary",
                        onClick: y[0] || (y[0] = (O) => {
                          var $;
                          return t(($ = C(i)) == null ? void 0 : $.link, "_blank");
                        })
                      }, [
                        c("span", null, F((S = C(i)) == null ? void 0 : S.preview), 1),
                        y[3] || (y[3] = c("i", { class: "fas fa-arrow-up-right-from-square fa-fw ms-2" }, null, -1))
                      ])
                    ]),
                    D(fZ)
                  ])
                ]),
                c("div", XZ, [
                  D(BZ)
                ])
              ]),
              c("div", qZ, [
                D(ZQ, { class: "action-list" })
              ])
            ], 512)
          ];
        }),
        _: 1
      }, 8, ["backdrop"])), [
        [N, ".modal-header"]
      ]);
    };
  }
}, QZ = /* @__PURE__ */ oe(JZ, [["__scopeId", "data-v-16f28129"]]), ZZ = {
  __name: "ModalProvider",
  setup(e) {
    const t = wN();
    return Cn("approval-service", t), (n, s) => (g(), E("div", null, [
      fe(n.$slots, "default")
    ]));
  }
}, eee = {
  __name: "ContextMenu",
  emits: ["show", "hide"],
  setup(e, { expose: t, emit: n }) {
    const s = n, o = I(!1), i = I(0), r = I(0), a = I(null);
    function l(f, p) {
      i.value = f, r.value = p, o.value = !0, s("show");
    }
    function u() {
      o.value = !1, s("hide");
    }
    function d(f) {
      a.value && !a.value.contains(f.target) && u();
    }
    return vt(() => {
      document.addEventListener("click", d);
    }), ii(() => {
      document.removeEventListener("click", d);
    }), t({ open: l, close: u }), (f, p) => o.value ? (g(), E("div", {
      key: 0,
      ref_key: "menu",
      ref: a,
      class: "context-menu",
      style: Jn({ top: r.value + "px", left: i.value + "px" }),
      onClick: p[0] || (p[0] = Rt(() => {
      }, ["stop"]))
    }, [
      fe(f.$slots, "default", {}, void 0, !0)
    ], 4)) : ne("", !0);
  }
}, tee = /* @__PURE__ */ oe(eee, [["__scopeId", "data-v-8531ec19"]]), nee = { class: "py-2 px-2 small text-muted" }, see = { class: "p-2" }, oee = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw"
}, ree = {
  key: 1,
  class: "fas fa-refresh fa-fw"
}, iee = {
  __name: "CellContextMenu",
  props: {
    context: { type: Object }
  },
  setup(e, { expose: t }) {
    const n = e, s = Io("baseMenu"), o = I(!1), i = k(() => {
      var u;
      return (u = n.context) == null ? void 0 : u.record_id;
    }), r = k(() => {
      var u;
      return (u = n.context) == null ? void 0 : u.reward_option_id;
    }), a = k(() => {
      var u;
      return (u = n.context) == null ? void 0 : u.arm_number;
    });
    async function l() {
      var u;
      try {
        o.value = !0, await Pn.recalculateRecordStatus(
          i.value,
          r.value,
          a.value
        ), (u = s.value) == null || u.close();
      } catch (d) {
        console.log(d);
      } finally {
        o.value = !1;
      }
    }
    return t({
      open: (u, d) => {
        var f;
        !i.value || !r.value || !a.value || (u ?? (u = 0), d ?? (d = 0), (f = s.value) == null || f.open(u, d));
      }
    }), (u, d) => (g(), E("div", null, [
      D(tee, {
        ref_key: "baseMenu",
        ref: s
      }, {
        default: B(() => [
          c("div", null, [
            c("div", nee, [
              c("div", null, "recordId: " + F(i.value), 1),
              c("div", null, "rewardOptionId: " + F(r.value), 1),
              c("div", null, "armNumber: " + F(a.value), 1)
            ]),
            d[1] || (d[1] = c("div", { class: "border-top" }, null, -1)),
            c("div", see, [
              c("button", {
                type: "button",
                class: "btn btn-sm btn-outline-primary w-100",
                onClick: l
              }, [
                o.value ? (g(), E("i", oee)) : (g(), E("i", ree)),
                d[0] || (d[0] = c("span", { class: "ms-1" }, "Refresh status", -1))
              ])
            ])
          ])
        ]),
        _: 1
      }, 512)
    ]));
  }
}, aee = { class: "table-container" }, lee = { class: "table table-hover table-bordered table-striped table-sm" }, cee = { class: "d-flex" }, uee = { class: "d-flex align-items-center" }, dee = { class: "fw-bold" }, fee = ["onClick"], pee = ["title"], hee = ["data-state"], mee = ["disabled", "indeterminate", "checked", "onClick"], vee = { "data-preview": "" }, gee = ["href"], _ee = { "data-preview": "" }, yee = { key: 0 }, bee = {
  __name: "ReviewTable",
  props: {
    records: {},
    recordsModifiers: {},
    rewardOptions: {},
    rewardOptionsModifiers: {}
  },
  emits: ["update:records", "update:rewardOptions"],
  setup(e) {
    const t = wN(), n = ca(), s = I(), o = I(), i = fu(), r = qe({
      record_id: null,
      reward_option_id: null,
      arm_number: null
    }), a = Io("contextMenu"), l = At(e, "records"), u = At(e, "rewardOptions"), d = I(!1), f = (_) => EN(n.value, _);
    function p(_) {
      f(_).toggleGroup();
    }
    function h(_) {
      i.showLogic(_);
    }
    function m({ record: _, reward_option: b }) {
      t.update(_, b), s.value = _, o.value = b, po(() => {
        d.value = !0;
      });
    }
    function v(_, b, w, y) {
      var x;
      r.record_id = b, r.reward_option_id = w, r.arm_number = y, (x = a.value) == null || x.open(_.pageX, _.pageY);
    }
    return nt(
      d,
      (_) => {
        _ || setTimeout(() => {
          s.value = null, o.value = null;
        }, 500);
      }
    ), (_, b) => {
      const w = Ht("mytooltip");
      return g(), E("div", aee, [
        c("table", lee, [
          c("thead", null, [
            c("tr", null, [
              b[2] || (b[2] = c("th", null, "Record", -1)),
              b[3] || (b[3] = c("th", null, "Preview", -1)),
              (g(!0), E(G, null, ge(u.value, (y, x) => (g(), E("th", { key: x }, [
                y != null && y.is_deleted ? (g(), se(hf, {
                  key: 0,
                  text: "DELETED"
                })) : y != null && y.is_valid ? ne("", !0) : (g(), se(hf, {
                  key: 1,
                  text: "INVALID",
                  backgroundColor: "#ffc107",
                  textColor: "#333"
                })),
                c("div", cee, [
                  c("div", null, [
                    c("div", uee, [
                      c("span", dee, F(C(Ba)(
                        y.value_amount
                      )), 1),
                      c("button", {
                        class: "btn btn-xs btn-light",
                        onClick: (N) => h(y)
                      }, b[1] || (b[1] = [
                        c("i", { class: "fas fa-square-root-variable fa-fw text-primary" }, null, -1)
                      ]), 8, fee)
                    ]),
                    c("div", null, [
                      c("span", {
                        class: "text-muted small fst-italic",
                        title: y.provider_product_id
                      }, F(y.description), 9, pee)
                    ])
                  ]),
                  c("div", {
                    class: "ms-auto",
                    "data-state": _.state = f(
                      y.reward_option_id
                    ).checkboxState
                  }, [
                    y != null && y.is_deleted ? ne("", !0) : (g(), E("input", {
                      key: 0,
                      class: "form-check-input",
                      type: "checkbox",
                      disabled: _.state.disabled,
                      indeterminate: _.state.indeterminate,
                      checked: _.state.checked,
                      onClick: (N) => p(
                        y.reward_option_id
                      ),
                      value: 1
                    }, null, 8, mee))
                  ], 8, hee)
                ])
              ]))), 128))
            ])
          ]),
          c("tbody", null, [
            (g(!0), E(G, null, ge(l.value, (y, x) => {
              var N;
              return g(), E("tr", {
                key: `${x}-${y.arm_number}-${y.record_id}`,
                class: Se({ active: y.record_id === ((N = s.value) == null ? void 0 : N.record_id) })
              }, [
                c("td", vee, [
                  c("a", {
                    href: y.link,
                    target: "_blank"
                  }, [
                    c("span", null, F(y.record_id), 1)
                  ], 8, gee)
                ]),
                c("td", _ee, [
                  y.preview ? L((g(), E("span", yee, [
                    te(F(y.preview), 1)
                  ])), [
                    [w, y.participant_details, "top"]
                  ]) : ne("", !0)
                ]),
                (g(!0), E(G, null, ge(u.value, (S) => {
                  var O;
                  return g(), E("td", {
                    key: `${y.arm_number}-${S.reward_option_id}`,
                    "data-reward": "",
                    class: Se({ active: S.reward_option_id === ((O = o.value) == null ? void 0 : O.reward_option_id) })
                  }, [
                    D(RQ, {
                      record: y,
                      reward_option: S,
                      onCellSelected: m,
                      onContextmenu: Rt(($) => v(
                        $,
                        y == null ? void 0 : y.record_id,
                        S == null ? void 0 : S.reward_option_id,
                        y == null ? void 0 : y.arm_number
                      ), ["prevent"])
                    }, null, 8, ["record", "reward_option", "onContextmenu"])
                  ], 2);
                }), 128))
              ], 2);
            }), 128))
          ])
        ]),
        D(iee, {
          ref_key: "contextMenu",
          ref: a,
          context: r
        }, null, 8, ["context"]),
        D(ZZ, null, {
          default: B(() => [
            (g(), se(ns, { to: "body" }, [
              D(QZ, {
                visible: d.value,
                "onUpdate:visible": b[0] || (b[0] = (y) => d.value = y)
              }, null, 8, ["visible"])
            ]))
          ]),
          _: 1
        })
      ]);
    };
  }
}, Eee = /* @__PURE__ */ oe(bee, [["__scopeId", "data-v-2fb4d6e6"]]), wee = { "data-first": "" }, See = ["disabled", "innerHTML"], xee = { "data-prev": "" }, Nee = ["disabled", "innerHTML"], Cee = { key: 0 }, Oee = ["innerHTML"], Tee = ["onClick"], $ee = { "data-next": "" }, kee = ["disabled", "innerHTML"], Dee = { "data-last": "" }, Ree = ["disabled", "innerHTML"], Iee = Object.freeze({
  SMALL: "sm",
  NORMAL: "",
  LARGE: "lg"
}), Aee = {
  __name: "PaginationButtons",
  props: {
    modelValue: { type: Number, default: 1 },
    perPage: { type: Number, default: 5 },
    maxVisibleButtons: { type: Number, default: 5 },
    totalItems: { type: Number, default: 0 },
    hideEllipsis: { type: Boolean, default: !1 },
    hideGotoEndButtons: { type: Boolean, default: !1 },
    firstText: { type: String, default: "«" },
    prevText: { type: String, default: "‹" },
    nextText: { type: String, default: "›" },
    lastText: { type: String, default: "»" },
    ellipsisText: { type: String, default: "…" },
    size: {
      type: String,
      default: "",
      validator(e) {
        return Object.values(Iee).includes(e);
      }
    }
  },
  emits: ["update:modelValue"],
  setup(e, { emit: t }) {
    const n = e, s = t;
    function o(y, x = 0) {
      return [...Array(y).keys()].map((N) => N + x);
    }
    const {
      modelValue: i,
      maxVisibleButtons: r,
      hideEllipsis: a
    } = he(n), l = Math.floor(r.value / 2), u = k(() => {
      let y = r.value, x = i.value <= l ? 1 : i.value - l;
      return i.value >= p.value - l && (x = p.value - y + 1), x < 1 && (x = 1), p.value < y && (y = p.value), o(y, x);
    }), d = k(() => i.value <= 1), f = k(() => i.value >= p.value), p = k(() => {
      const { perPage: y, totalItems: x } = n;
      return Math.ceil(x / y);
    });
    function h(y) {
      const x = r.value - 1;
      return !(a.value === !0 || y === 0 && i.value - l - 1 <= 0 || y === x && i.value + l >= p.value || y > 0 && y < x);
    }
    function m(y) {
      y < 1 && (y = 1), y > p.value && (y = p.value), s("update:modelValue", y);
    }
    function v() {
      s("update:modelValue", 1);
    }
    function _() {
      s("update:modelValue", p.value);
    }
    function b() {
      let y = i.value - 1;
      y < 1 && (y = 1), s("update:modelValue", y);
    }
    function w() {
      let y = i.value + 1;
      y > p.value && (y = p.value), s("update:modelValue", y);
    }
    return (y, x) => (g(), E("ul", {
      class: Se(["pagination", e.size])
    }, [
      c("li", wee, [
        c("button", {
          class: "",
          disabled: d.value,
          innerHTML: e.firstText,
          onClick: v
        }, null, 8, See)
      ]),
      c("li", xee, [
        c("button", {
          class: "",
          disabled: d.value,
          innerHTML: e.prevText,
          onClick: b
        }, null, 8, Nee)
      ]),
      (g(!0), E(G, null, ge(u.value, (N, S) => (g(), E(G, { key: N }, [
        h(S) ? (g(), E("li", Cee, [
          c("button", {
            disabled: "",
            class: "",
            innerHTML: e.ellipsisText
          }, null, 8, Oee)
        ])) : (g(), E("li", {
          key: 1,
          "data-prev": "",
          class: Se({ active: e.modelValue === N })
        }, [
          c("button", {
            class: "",
            onClick: (O) => m(N)
          }, F(N), 9, Tee)
        ], 2))
      ], 64))), 128)),
      c("li", $ee, [
        c("button", {
          class: "",
          disabled: f.value,
          innerHTML: e.nextText,
          onClick: w
        }, null, 8, kee)
      ]),
      c("li", Dee, [
        c("button", {
          class: "",
          disabled: f.value,
          innerHTML: e.lastText,
          onClick: _
        }, null, 8, Ree)
      ])
    ], 2));
  }
}, Mee = /* @__PURE__ */ oe(Aee, [["__scopeId", "data-v-4578e6ce"]]), Pee = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw"
}, Lee = {
  key: 1,
  class: "fas fa-ellipsis-vertical fa-fw"
}, Vee = { class: "d-block small text-muted" }, Fee = { class: "d-block small text-muted" }, Uee = { class: "d-block small text-muted" }, jee = {
  __name: "BulkActionsMenu",
  setup(e) {
    const t = I(!1), n = o_(), s = cJ(), { selected: o, eligibleSelected: i, approvedSelected: r } = he(n);
    async function a() {
      s.schedule(xn.REVIEWER_APPROVAL, [...i.value]);
    }
    async function l() {
      s.schedule(xn.REVIEWER_REJECTION, [...i.value]);
    }
    async function u() {
      s.schedule(xn.BUYER_APPROVAL, [...r.value]);
    }
    async function d() {
      s.schedule(xn.BUYER_REJECTION, [...r.value]);
    }
    return (f, p) => {
      const h = le("b-dropdown-header"), m = le("b-dropdown-item"), v = le("b-dropdown-divider"), _ = le("b-dropdown");
      return g(), se(_, {
        variant: "outline-primary",
        size: "sm"
      }, {
        button: B(() => [
          t.value ? (g(), E("i", Pee)) : (g(), E("i", Lee)),
          p[0] || (p[0] = c("span", null, "Bulk actions", -1))
        ]),
        default: B(() => [
          D(h, null, {
            default: B(() => [
              c("small", Vee, "Approval items: " + F(C(i).length), 1)
            ]),
            _: 1
          }),
          D(m, {
            class: Se({
              disabled: C(ws).denies("review_eligibility") || t.value || C(i).length === 0
            }),
            onClick: a
          }, {
            default: B(() => p[1] || (p[1] = [
              c("i", { class: "fa fa-thumbs-up fa-fw text-success me-2" }, null, -1),
              c("span", null, "Reviewer:Approve", -1)
            ])),
            _: 1
          }, 8, ["class"]),
          D(m, {
            class: Se({
              disabled: C(ws).denies("review_eligibility") || t.value || C(i).length === 0
            }),
            onClick: l
          }, {
            default: B(() => p[2] || (p[2] = [
              c("i", { class: "fa fa-thumbs-down fa-fw text-danger me-2" }, null, -1),
              c("span", null, "Reviewer:Reject", -1)
            ])),
            _: 1
          }, 8, ["class"]),
          D(v),
          D(h, null, {
            default: B(() => [
              c("small", Fee, "Order items: " + F(C(r).length), 1)
            ]),
            _: 1
          }),
          D(m, {
            class: Se({
              disabled: C(ws).denies("place_orders") || t.value || C(r).length === 0
            }),
            onClick: u
          }, {
            default: B(() => p[3] || (p[3] = [
              c("i", { class: "fa fa-thumbs-up fa-fw text-success me-2" }, null, -1),
              c("span", null, "Buyer:Approve", -1)
            ])),
            _: 1
          }, 8, ["class"]),
          D(m, {
            class: Se({
              disabled: C(ws).denies("place_orders") || t.value || C(r).length === 0
            }),
            onClick: d
          }, {
            default: B(() => p[4] || (p[4] = [
              c("i", { class: "fa fa-thumbs-down fa-fw text-danger me-2" }, null, -1),
              c("span", null, "Buyer:Reject", -1)
            ])),
            _: 1
          }, 8, ["class"]),
          D(v),
          D(h, null, {
            default: B(() => [
              c("small", Uee, "Total items: " + F(C(o).length), 1)
            ]),
            _: 1
          })
        ]),
        _: 1
      });
    };
  }
}, Bee = /* @__PURE__ */ oe(jee, [["__scopeId", "data-v-36cb9a5b"]]), Hee = {
  key: 0,
  class: "my-stack"
}, Yee = {
  key: 1,
  class: "fas fa-filter fa-fw"
}, Wee = { class: "form-check form-switch form-check-reverse text-start" }, Gee = ["id", "value"], zee = ["for"], Kee = { class: "d-flex justify-content-center gap-2" }, Xee = ["disabled"], qee = ["disabled"], Jee = {
  key: 0,
  class: "d-flex justify-content-center fst-italic mt-2"
}, Qee = ["disabled"], Zee = {
  __name: "FilterMenu",
  setup(e) {
    const t = I(), n = an(), s = {
      [Ie.ELIGIBLE]: {
        label: Ie.ELIGIBLE,
        class: "fas fa-clipboard text-secondary"
      },
      [Ie.INELIGIBLE]: {
        label: Ie.INELIGIBLE,
        class: "fas fa-ban text-danger"
      },
      [Ie.REVIEWER_APPROVED]: {
        label: Ie.REVIEWER_APPROVED,
        class: "fas fa-thumbs-up text-success"
      },
      [Ie.REVIEWER_REJECTED]: {
        label: Ie.REVIEWER_REJECTED,
        class: "fas fa-thumbs-down text-danger"
      },
      [Ie.BUYER_APPROVED]: {
        label: Ie.BUYER_APPROVED,
        class: "fas fa-thumbs-up text-success"
      },
      [Ie.BUYER_REJECTED]: {
        label: Ie.BUYER_REJECTED,
        class: "fas fa-thumbs-down text-danger"
      },
      [Ie.ORDER_PLACED]: {
        label: Ie.ORDER_PLACED,
        class: "fas fa-gift text-secondary"
      },
      [Ie.COMPLETED]: {
        label: Ie.COMPLETED,
        class: "fas fa-circle-check text-success"
      }
    }, o = ua(), i = I(""), r = I([]), a = k(() => o.query.trim() !== "" || o.selectedStatus && o.selectedStatus.length > 0), { cached: l, loading: u } = he(o), d = () => {
      o.query = i.value, o.selectedStatus = r.value, o.loadRecords();
    }, f = () => {
      i.value = "", r.value = [], d();
    }, p = k(() => !(i.value !== o.query || !Lo(r.value, o.selectedStatus))), h = k(() => {
      var b;
      return !(i.value !== "" || ((b = r.value) == null ? void 0 : b.length) > 0);
    }), m = () => {
      t.value.close(), d();
    }, v = () => {
      t.value.close(), f();
    }, _ = async () => {
      try {
        await o.clearCache(), n.toast({ title: "Success", body: "Cache cleared." });
      } catch (b) {
        console.log(b);
      }
    };
    return vt(() => {
      i.value = o.query, r.value = o.selectedStatus;
    }), (b, w) => {
      const y = le("b-dropdown-header"), x = le("b-dropdown-item"), N = le("b-dropdown-divider"), S = le("b-dropdown");
      return g(), E("div", null, [
        D(S, {
          ref_key: "dropdownRef",
          ref: t,
          variant: "outline-secondary",
          size: "sm"
        }, {
          button: B(() => [
            a.value ? (g(), E("span", Hee, w[4] || (w[4] = [
              c("i", { class: "fas fa-filter fa-fw" }, null, -1),
              c("i", { class: "fas fa-circle-check my-stack-status fa-fw text-success" }, null, -1)
            ]))) : (g(), E("i", Yee))
          ]),
          default: B(() => [
            D(y, null, {
              default: B(() => w[5] || (w[5] = [
                c("small", { class: "d-block small text-muted" }, "Query", -1)
              ])),
              _: 1
            }),
            D(x, { "data-prevent-close": "" }, {
              default: B(() => [
                L(c("input", {
                  type: "search",
                  class: "form-control form-control-sm",
                  placeholder: "search...",
                  "onUpdate:modelValue": w[0] || (w[0] = (O) => i.value = O)
                }, null, 512), [
                  [Ve, i.value]
                ])
              ]),
              _: 1
            }),
            D(N),
            D(y, null, {
              default: B(() => w[6] || (w[6] = [
                c("small", { class: "d-block small text-muted" }, "Status", -1)
              ])),
              _: 1
            }),
            (g(), E(G, null, ge(s, (O, $) => D(x, {
              key: $,
              "data-prevent-close": ""
            }, {
              default: B(() => [
                c("div", Wee, [
                  L(c("input", {
                    class: "form-check-input",
                    type: "checkbox",
                    id: `check-status${O.label}`,
                    value: O.label,
                    "onUpdate:modelValue": w[1] || (w[1] = (T) => r.value = T)
                  }, null, 8, Gee), [
                    [mn, r.value]
                  ]),
                  c("label", {
                    class: "form-check-label",
                    for: `check-status${O.label}`
                  }, [
                    c("i", {
                      class: Se([O.class, "fa-fw me-2"])
                    }, null, 2),
                    c("span", null, F(O.label), 1)
                  ], 8, zee)
                ])
              ]),
              _: 2
            }, 1024)), 64)),
            D(N),
            D(y, null, {
              default: B(() => [
                c("div", Kee, [
                  c("button", {
                    type: "button",
                    class: "btn btn-sm btn-light",
                    onClick: w[2] || (w[2] = (O) => m()),
                    disabled: p.value || C(u)
                  }, w[7] || (w[7] = [
                    c("i", { class: "fas fa-check fa-fw text-success" }, null, -1),
                    c("span", null, "Apply", -1)
                  ]), 8, Xee),
                  c("button", {
                    type: "button",
                    class: "btn btn-sm btn-light",
                    onClick: w[3] || (w[3] = (O) => v()),
                    disabled: h.value || C(u)
                  }, w[8] || (w[8] = [
                    c("div", { class: "d-flex align-items-center gap-2" }, [
                      c("i", { class: "fas fa-ban fa-fw text-danger" }),
                      c("span", null, "Reset")
                    ], -1)
                  ]), 8, qee)
                ]),
                C(l) ? (g(), E("div", Jee, [
                  c("a", {
                    href: "#",
                    onClick: Rt(_, ["prevent"]),
                    disabled: C(u)
                  }, "clear cache", 8, Qee)
                ])) : ne("", !0)
              ]),
              _: 1
            })
          ]),
          _: 1
        }, 512)
      ]);
    };
  }
}, ete = /* @__PURE__ */ oe(Zee, [["__scopeId", "data-v-6023e340"]]), tte = { class: "d-flex gap-2" }, nte = ["disabled"], ste = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw"
}, ote = {
  key: 1,
  class: "fas fa-refresh fa-fw"
}, rte = {
  __name: "ReviewToolbar",
  setup(e) {
    const t = ua(), n = k(() => t.loading), s = qe(t.pagination);
    function o() {
      t.loadRecords();
    }
    function i() {
      o();
    }
    return (r, a) => {
      const l = le("b-pagination-dropdown");
      return g(), E("div", tte, [
        D(Mee, {
          size: "sm",
          modelValue: s.page,
          "onUpdate:modelValue": a[0] || (a[0] = (u) => s.page = u),
          perPage: s.perPage,
          totalItems: s.total
        }, null, 8, ["modelValue", "perPage", "totalItems"]),
        c("div", null, [
          c("button", {
            type: "button",
            class: "btn btn-sm btn-primary",
            disabled: n.value,
            onClick: i
          }, [
            n.value ? (g(), E("i", ste)) : (g(), E("i", ote))
          ], 8, nte)
        ]),
        D(l, {
          options: [25, 50, 100, 500],
          modelValue: s.perPage,
          "onUpdate:modelValue": a[1] || (a[1] = (u) => s.perPage = u)
        }, null, 8, ["modelValue"]),
        D(ete),
        D(Bee)
      ]);
    };
  }
}, ite = ["value"], ate = {
  __name: "ArmSelect",
  props: {
    modelValue: {},
    modelModifiers: {}
  },
  emits: ["update:modelValue"],
  setup(e) {
    const t = At(e, "modelValue"), n = s_();
    return (s, o) => L((g(), E("select", {
      "onUpdate:modelValue": o[0] || (o[0] = (i) => t.value = i),
      class: "form-select form-select-sm"
    }, [
      (g(!0), E(G, null, ge(C(n).arms, (i, r) => (g(), E("option", {
        key: r,
        value: i == null ? void 0 : i.arm_num
      }, F(i.name), 9, ite))), 128))
    ], 512)), [
      [Qt, t.value]
    ]);
  }
}, lte = { class: "d-flex align-items-center mb-2" }, cte = {
  key: 0,
  class: "fst-italic"
}, ute = {
  __name: "ReviewDashboard",
  setup(e) {
    const t = Nr(), n = ds(), s = k({
      get: () => {
        var d;
        return ((d = t.params) == null ? void 0 : d.arm_num) ?? 1;
      },
      set: (d) => n.push({ name: "arm-review", params: { arm_num: d } })
    }), o = ua(), i = Or(), r = k(
      () => o.loading && i.loading
    ), a = k(() => o.list), l = k(() => i.list);
    function u() {
      o.loadRecords();
    }
    return vt(() => u()), (d, f) => (g(), E("div", null, [
      r.value ? (g(), se(xN, { key: 0 })) : (g(), E(G, { key: 1 }, [
        c("div", lte, [
          f[3] || (f[3] = c("span", { class: "me-2" }, "Current Arm: ", -1)),
          D(ate, {
            modelValue: s.value,
            "onUpdate:modelValue": f[0] || (f[0] = (p) => s.value = p)
          }, null, 8, ["modelValue"])
        ]),
        D(rte, { class: "mb-2" }),
        a.value.length === 0 ? (g(), E("span", cte, "No items")) : (g(), se(Eee, {
          key: 1,
          records: a.value,
          "onUpdate:records": f[1] || (f[1] = (p) => a.value = p),
          rewardOptions: l.value,
          "onUpdate:rewardOptions": f[2] || (f[2] = (p) => l.value = p)
        }, null, 8, ["records", "rewardOptions"]))
      ], 64))
    ]));
  }
}, dte = [
  {
    path: "/",
    component: nJ,
    children: [
      {
        path: "",
        name: "home",
        component: rJ,
        redirect: "/review"
      },
      {
        path: "reward-options",
        component: lJ,
        children: [
          {
            path: "",
            name: "reward-options",
            component: vQ
          }
        ]
      },
      {
        path: "review",
        name: "review",
        redirect: "/review/1",
        children: [
          {
            path: ":arm_num(\\d+)",
            component: gQ,
            children: [
              {
                path: "",
                name: "arm-review",
                component: ute
              }
            ],
            props: !0
          }
        ]
      },
      { path: "/:pathMatch(.*)*", component: la }
    ]
  }
];
let Gu;
const fte = () => Gu || (Gu = ci({
  // Provide the history implementation to use. We are using the hash history for simplicity here.
  history: li(),
  routes: dte
}), Gu), CN = {}, pte = ({ store: e }) => {
  CN[e.$id] = e;
}, hte = () => CN;
function mte({ store: e, options: t }) {
  if (e.$id === "records") {
    const n = o_(), s = ca();
    nt(
      () => [e.pagination.page, e.pagination.perPage],
      () => {
        n.reset();
      }
    ), nt(
      s,
      () => {
        n.reset();
      }
    );
  }
}
const gde = (e) => {
  const t = wn(Zq);
  t.directive("mytooltip", Tp), t.directive("draggable", xq);
  const n = _l();
  n.use(mte), n.use(pte), n.use(El), t.use(n), t.use(Cs);
  const s = fte();
  t.use(s), t.use(ai()), t.mount(e);
  const o = t.runWithContext(() => hte());
  return { app: t, router: s, store: o };
}, vte = { "data-modal-content": "" }, gte = { "data-modal-header": "" }, _te = ["innerHTML"], yte = { "data-modal-body": "" }, bte = ["innerHTML"], Ete = { "data-modal-footer": "" }, wte = ["innerHTML"], Ste = ["innerHTML"], Zm = Object.freeze({
  SMALL: "sm",
  STANDARD: "",
  LARGE: "lg",
  EXTRA_LARGE: "xl"
}), e1 = (e, t = "") => {
  let n = e.toLowerCase();
  return !Object.values(Zm).includes(n) || n == "" ? "" : `${t}${n}`;
}, xte = {
  __name: "ModalDialog",
  props: /* @__PURE__ */ jn({
    title: { type: String, default: "" },
    body: { type: String, default: "" },
    textCancel: { type: String, default: "Cancel" },
    textOk: { type: String, default: "Ok" },
    backdrop: { type: Boolean, default: !0 },
    keyboard: { type: Boolean, default: !0 },
    focus: { type: Boolean, default: !0 },
    disableOutsideClick: { type: Boolean, default: !1 },
    okOnly: { type: Boolean, default: !1 },
    size: { type: String, default: Zm.STANDARD },
    btnSize: { type: String, default: Zm.SMALL }
  }, {
    visible: { type: Boolean, default: !1 },
    visibleModifiers: {}
  }),
  emits: /* @__PURE__ */ jn(["onShown", "onHidden"], ["update:visible"]),
  setup(e, { expose: t, emit: n }) {
    const s = e, { backdrop: o, size: i, btnSize: r } = he(s), a = At(e, "visible"), l = I(), u = n, d = cn(), f = k(() => e1(i.value, "modal-")), p = k(() => e1(r.value, "btn-"));
    let h;
    function m() {
      const S = new Promise(($, T) => {
        h = $;
      }), O = new AbortController();
      return l.value.addEventListener(
        "transitionend",
        () => {
          u("onShown", d), O.abort();
        },
        { signal: O.signal }
      ), a.value = !0, S;
    }
    function v(S = !0) {
      const O = new AbortController();
      l.value.addEventListener(
        "transitionend",
        () => {
          typeof h == "function" && h(S), u("onHidden", d), O.abort();
        },
        { signal: O.signal }
      ), a.value = !1;
    }
    function _() {
      console.log(a.value), a.value === !0 ? v() : m();
    }
    const b = { show: m, hide: v, toggle: _, modal: d };
    t(b);
    function w(S) {
      console.log("backdrop"), (o == null ? void 0 : o.value) !== "static" && v(!1);
    }
    function y() {
      v(!1);
    }
    function x() {
      v(!1);
    }
    function N() {
      v(!0);
    }
    return (S, O) => (g(), E("div", bn({
      ref_key: "modalRef",
      ref: l,
      tabindex: "-1"
    }, { ...S.$attrs }, {
      onClick: Rt(w, ["self"]),
      "data-modal-dialog": "",
      class: { sizeClass: f.value, visible: a.value }
    }), [
      c("div", vte, [
        c("div", gte, [
          fe(S.$slots, "header", kt(Dt({ ...b })), () => [
            c("h5", {
              class: "modal-title",
              innerHTML: e.title
            }, null, 8, _te)
          ], !0),
          c("button", {
            type: "button",
            class: "btn-close",
            "aria-label": "Close",
            onClick: y
          })
        ]),
        c("div", yte, [
          fe(S.$slots, "default", kt(Dt({ ...b })), () => [
            c("span", { innerHTML: e.body }, null, 8, bte)
          ], !0)
        ]),
        c("div", Ete, [
          fe(S.$slots, "footer", kt(Dt({ ...b })), () => [
            e.okOnly ? ne("", !0) : (g(), E("button", {
              key: 0,
              type: "button",
              class: Se(["btn btn-secondary", p.value]),
              onClick: x
            }, [
              fe(S.$slots, "button-cancel", kt(Dt({ ...b })), () => [
                c("span", { innerHTML: e.textCancel }, null, 8, wte)
              ], !0)
            ], 2)),
            c("button", {
              type: "button",
              class: Se(["btn btn-primary", p.value]),
              onClick: N
            }, [
              fe(S.$slots, "button-ok", kt(Dt({ ...b })), () => [
                c("span", { innerHTML: e.textOk }, null, 8, Ste)
              ], !0)
            ], 2)
          ], !0)
        ])
      ])
    ], 16));
  }
}, Nte = /* @__PURE__ */ oe(xte, [["__scopeId", "data-v-45cccacc"]]), Cte = { class: "modal-content" }, Ote = (e) => {
  e.beforeEach(async (t, n, s) => {
    var i, r, a;
    const o = (i = t.matched.at(-1).components) == null ? void 0 : i.modal;
    if (o) {
      if (t.matched[0].components.modal = o, n.matched.length)
        for (const l in n.matched) {
          if (!t.matched[l]) break;
          t.matched[l].components.default = n.matched[l].components.default;
        }
    } else
      (a = (r = n == null ? void 0 : n.matched[0]) == null ? void 0 : r.components) != null && a.modal && (await $te(), delete t.matched[0].components.modal);
    s();
  });
}, Ui = I(), Tte = () => {
  var e;
  typeof ((e = Ui.value) == null ? void 0 : e.showModal) == "function" && Ui.value.showModal();
}, $te = () => new Promise((e, t) => {
  var i;
  if (typeof ((i = Ui.value) == null ? void 0 : i.close) != "function")
    return;
  const n = Ui.value, s = () => {
    clearTimeout(o), n.removeEventListener(
      "animationend",
      s
    ), n.classList.remove("hidden"), n.close(), e();
  };
  n.addEventListener("animationend", s), n.classList.add("hidden");
  const o = setTimeout(() => {
    console.warn(
      "Animation did not end in expected time, resolving promise"
    ), n.removeEventListener(
      "animationend",
      s
    ), n.classList.remove("hidden"), n.close(), e();
  }, 600);
}), kte = {
  __name: "ModalRouterView",
  setup(e) {
    const t = Nr();
    return ds(), nt(
      () => t == null ? void 0 : t.meta,
      (n, s) => {
      },
      { immediate: !1 }
    ), Ft(() => {
      var n;
      Ui.value && typeof ((n = Ui.value) == null ? void 0 : n.showModal) == "function" && Tte();
    }), (n, s) => {
      const o = le("router-view");
      return g(), se(o, { name: "modal" }, {
        default: B(({ Component: i, route: r }) => [
          i ? (g(), se(Lv, { key: 0 }, {
            default: B(() => [
              (g(), se(dE, null, [
                c("div", null, [
                  te(F(r.meta) + " ", 1),
                  c("dialog", {
                    ref_key: "modalRef",
                    ref: Ui
                  }, [
                    c("div", Cte, [
                      (g(), se(Hi(i)))
                    ])
                  ], 512)
                ])
              ], 1024))
            ]),
            _: 2
          }, 1024)) : ne("", !0)
        ]),
        _: 1
      });
    };
  }
}, Dte = /* @__PURE__ */ oe(kte, [["__scopeId", "data-v-bd3dca70"]]), Rte = {
  __name: "TestComponent1",
  setup(e) {
    const t = I(), n = () => {
      const s = t.value;
      s && s.toggle();
    };
    return (s, o) => (g(), E(G, null, [
      o[1] || (o[1] = c("div", null, "test 1", -1)),
      D(Nte, {
        ref_key: "modalRef",
        ref: t
      }, {
        default: B(() => o[0] || (o[0] = [
          c("span", null, "ciao", -1)
        ])),
        _: 1
      }, 512),
      c("button", { onClick: n }, "AShow")
    ], 64));
  }
}, Ite = { class: "d-flex gap-2" }, Ate = {
  __name: "App",
  setup(e) {
    return (t, n) => {
      const s = le("router-link"), o = le("router-view");
      return g(), E(G, null, [
        c("div", Ite, [
          D(s, { to: { name: "home" } }, {
            default: B(() => n[0] || (n[0] = [
              te("Home")
            ])),
            _: 1
          }),
          D(s, { to: { name: "test1" } }, {
            default: B(() => n[1] || (n[1] = [
              te("Test 1")
            ])),
            _: 1
          }),
          D(s, { to: { name: "test2" } }, {
            default: B(() => n[2] || (n[2] = [
              te("Test 2")
            ])),
            _: 1
          }),
          D(s, { to: { name: "test3" } }, {
            default: B(() => n[3] || (n[3] = [
              te("Test 3")
            ])),
            _: 1
          }),
          D(s, { to: { name: "modal" } }, {
            default: B(() => n[4] || (n[4] = [
              te("Modal")
            ])),
            _: 1
          })
        ]),
        D(o, null, {
          default: B(({ Component: i }) => [
            (g(), se(Hi(i)))
          ]),
          _: 1
        }),
        D(C(Dte))
      ], 64);
    };
  }
}, Mte = /* @__PURE__ */ oe(Ate, [["__scopeId", "data-v-6f5e95c4"]]), Pte = {};
function Lte(e, t) {
  const n = le("router-view");
  return g(), E("div", null, [
    D(n)
  ]);
}
const Vte = /* @__PURE__ */ oe(Pte, [["render", Lte]]), Fte = {};
function Ute(e, t) {
  return g(), E("div", null, t[0] || (t[0] = [
    c("span", null, "Home", -1)
  ]));
}
const jte = /* @__PURE__ */ oe(Fte, [["render", Ute]]), Bte = {};
function Hte(e, t) {
  const n = le("router-view");
  return g(), E("div", null, [
    t[0] || (t[0] = c("span", null, "Subpage", -1)),
    D(n)
  ]);
}
const Yte = /* @__PURE__ */ oe(Bte, [["render", Hte]]), Ih = {
  __name: "TestComponent2",
  setup(e) {
    const t = ds();
    function n() {
      t.back();
    }
    return (s, o) => (g(), E(G, null, [
      o[0] || (o[0] = c("div", null, "test 2", -1)),
      c("button", { onClick: n }, "close")
    ], 64));
  }
}, Wte = {};
function Gte(e, t) {
  return g(), E("div", null, t[0] || (t[0] = [
    c("span", null, "Modal", -1),
    c("span", null, "Modal", -1),
    c("span", null, "Modal", -1),
    c("span", null, "Modal", -1),
    c("span", null, "Modal", -1)
  ]));
}
const zte = /* @__PURE__ */ oe(Wte, [["render", Gte]]), Kte = {};
function Xte(e, t) {
  return g(), E("div");
}
const qte = /* @__PURE__ */ oe(Kte, [["render", Xte]]), Jte = [
  {
    path: "/",
    component: Vte,
    children: [
      { path: "", name: "home", component: jte },
      {
        path: "test1",
        component: Yte,
        children: [
          {
            path: "",
            name: "test1",
            component: Rte
          },
          {
            path: "test2",
            name: "test2",
            component: Ih,
            meta: { modal: Ih }
          },
          {
            path: "test3",
            name: "test3",
            components: { modal: Ih }
          }
        ]
      }
    ]
  },
  {
    path: "/modal",
    name: "modal",
    components: {
      default: qte,
      modal: zte
    }
    // beforeEnter: [keepDefaultView],
  },
  { path: "/:pathMatch(.*)*", component: la }
];
let Fl;
const Qte = () => Fl || (Fl = ci({
  // Provide the history implementation to use. We are using the hash history for simplicity here.
  history: li(),
  routes: Jte
}), Ote(Fl), Fl), _de = (e) => {
  const t = wn(Mte);
  t.use(Cs);
  const n = Qte();
  return t.use(n), t.mount(e), { app: t, router: n };
}, ON = 500;
let Zte = Bo();
const Ah = Ho(Zte, ["pid"], { timeout: 0 }), ev = {
  // balance
  getRecords(e = 1, t = ON) {
    const n = {
      route: "CdpController:getDdpRecordsDataStats",
      _page: e,
      _per_page: t
    };
    return Ah.get("", { params: n });
  },
  processField(e) {
    const t = {
      route: "CdpController:processField"
    }, n = { ...e };
    return Ah.post("", n, { params: t });
  },
  processCachedData(e, t) {
    const n = {
      route: "CdpController:processCachedData"
    }, s = { background: e, send_feedback: t };
    return Ah.post("", s, { params: n });
  }
}, ene = "recordsMetadata", TN = /* @__PURE__ */ Ut(ene, () => {
  const e = I(!1), t = I(), n = I([]), s = qe({}), o = k(() => (s == null ? void 0 : s.page) ?? 0), i = k(() => (s == null ? void 0 : s.total) ?? 0), r = k(() => (s == null ? void 0 : s.total_pages) ?? 0), a = k(() => (s == null ? void 0 : s.next_page) ?? 0), l = k(() => (s == null ? void 0 : s.per_page) ?? ON), u = k(() => (s == null ? void 0 : s.total_current_page) ?? 0), d = k(() => {
    let p = 0;
    for (const h of n.value)
      p += parseInt(h == null ? void 0 : h.total) ?? 0;
    return p;
  });
  async function f(p, h) {
    try {
      e.value = !0;
      const m = await ev.getRecords(p, h), { data: v, metadata: _ } = (m == null ? void 0 : m.data) ?? {};
      n.value = v, Object.assign(s, _);
    } catch (m) {
      t.value = m;
    } finally {
      e.value = !1;
    }
  }
  return {
    loading: e,
    error: t,
    data: n,
    metadata: s,
    page: o,
    total: i,
    total_pages: r,
    next_page: a,
    totalValues: d,
    per_page: l,
    total_current_page: u,
    getRecords: f
  };
}), tne = "adjudication", nne = /* @__PURE__ */ Ut(tne, () => {
  const e = TN(), t = I(!1), n = I(!1), s = I(!1), o = I(!1), i = I(), r = I([]), a = I([]), l = I(0), u = I(0), d = I(!1), f = I(), p = qe({
    total_fields: 0,
    total_values: 0,
    processed_fields: 0,
    successful_fields: 0,
    errors: 0,
    adjudicated_values: 0,
    excluded_values: 0,
    unprocessed_values: 0
  }), h = (N, S) => {
    const O = S == null ? void 0 : S.error;
    O && a.value.push({
      label: `${N == null ? void 0 : N.record}-${N == null ? void 0 : N.event_id}-${N == null ? void 0 : N.field_name}`,
      field: N,
      error: O
    });
  }, m = (N, S) => {
    r.value.push({
      ...S,
      total_values: N.total ?? 0
    });
  }, v = () => {
    const N = [...(e == null ? void 0 : e.data) ?? []];
    p.total_fields = N.length ?? 0, p.total_values = 0, N.forEach((S) => {
      p.total_values += (S == null ? void 0 : S.total) ?? 0;
    }), p.processed_fields = 0, p.successful_fields = 0, p.errors = 0, p.adjudicated_values = 0, p.excluded_values = 0, p.unprocessed_values = 0;
  }, _ = (N, S) => {
    const O = (S == null ? void 0 : S.error) ?? null;
    p.processed_fields += 1, p.successful_fields += O ? 0 : 1, p.errors += O ? 1 : 0, p.adjudicated_values += (S == null ? void 0 : S.adjudicated) ?? 0, p.excluded_values += (S == null ? void 0 : S.excluded) ?? 0, p.unprocessed_values += O ? (N == null ? void 0 : N.total) ?? 0 : 0;
  }, b = () => {
    v(), d.value = !1, r.value = [], a.value = [], l.value = 0, u.value = 0;
  };
  return {
    processing: n,
    error: i,
    showProcessingModal: s,
    showSummaryModal: o,
    currentField: f,
    results: r,
    totalFields: l,
    totalValues: u,
    errors: a,
    stats: p,
    process: async () => {
      try {
        b(), o.value = !1, s.value = !0, n.value = !0;
        const N = e.data;
        l.value = N.length, u.value = e.totalValues;
        for (const S of N) {
          if (d.value) break;
          f.value = S;
          const $ = (await ev.processField(S)).data;
          h(S, $), m(S, $), _(S, $);
        }
        f.value = null;
      } catch (N) {
        console.log(N), i.value = N;
      } finally {
        n.value = !1, s.value = !1, o.value = !0;
      }
    },
    stopProcess: async () => {
      d.value = !0;
    },
    schedule: async (N = !1) => {
      try {
        return t.value = !0, (await ev.processCachedData(!0, N)).data;
      } catch (S) {
        console.log(S), i.value = S;
      } finally {
        t.value = !1;
      }
    }
  };
}), sne = { class: "btn-group" }, one = ["disabled"], rne = {
  "data-prevent-close": "",
  class: "px-2",
  style: { width: "400px" }
}, ine = { class: "form-check form-switch" }, ane = {
  __name: "ProcessButton",
  setup(e) {
    const t = $e("records-store"), n = $e("adjudication-store"), s = dF(), o = an(), i = I(!1), r = k(
      () => t.loading || n.loading
    ), a = async () => await s.confirm({
      title: "Please confirm",
      body: "You are about to initiate the adjudication process. Please note that existing data may be overwritten based on the 'preselect strategy' defined in your mapping configuration."
    });
    async function l() {
      await a() && (await n.process(), t.getRecords(1));
    }
    async function u() {
      if (!await a()) return;
      await n.schedule(i.value) && o.toast({
        title: "Success",
        body: "Auto-adjudication has been added to the background queue."
      });
    }
    return (d, f) => {
      const p = le("b-dropdown");
      return g(), E("div", sne, [
        c("button", {
          type: "button",
          class: "btn btn-sm btn-primary",
          onClick: l,
          disabled: r.value
        }, f[1] || (f[1] = [
          c("i", { class: "fas fa-circle-check fa-fw me-1" }, null, -1),
          c("span", null, "Process", -1)
        ]), 8, one),
        D(p, {
          size: "sm",
          disabled: r.value
        }, {
          button: B(() => f[2] || (f[2] = [])),
          default: B(() => [
            c("div", rne, [
              f[5] || (f[5] = c("span", { class: "d-block fw-bold" }, "Background Processing Options", -1)),
              f[6] || (f[6] = c("div", { class: "small text-muted fw-lighter" }, " When a large number of values needs to be processed it is possible to start the process in background and get a message when completed. ", -1)),
              c("div", { class: "my-2" }, [
                c("button", {
                  type: "button",
                  class: "btn btn-sm btn-primary",
                  onClick: u
                }, f[3] || (f[3] = [
                  c("i", { class: "fas fa-circle-check fa-fw me-1" }, null, -1),
                  c("span", null, "Process in background", -1)
                ]))
              ]),
              c("div", ine, [
                L(c("input", {
                  type: "checkbox",
                  class: "form-check-input",
                  id: "send-message-checkbox",
                  "onUpdate:modelValue": f[0] || (f[0] = (h) => i.value = h)
                }, null, 512), [
                  [mn, i.value]
                ]),
                f[4] || (f[4] = c("label", {
                  class: "small form-check-label",
                  for: "send-message-checkbox"
                }, [
                  c("i", { class: "fas fa-envelope fa-fw me-1" }),
                  c("span", null, "Send me a message when completed")
                ], -1))
              ])
            ])
          ]),
          _: 1
        }, 8, ["disabled"])
      ]);
    };
  }
}, lne = /* @__PURE__ */ oe(ane, [["__scopeId", "data-v-ed0db6b2"]]), cne = { key: 0 }, une = ["innerHTML"], dne = {
  __name: "AdjudicationPanel",
  setup(e) {
    const t = $e("records-store"), { totalValues: n, page: s, total: o, total_pages: i, next_page: r } = he(t);
    return (a, l) => (g(), E("div", null, [
      C(r) ? (g(), E("span", cne, " You are on page " + F(C(s)) + " of " + F(C(i)) + ". ", 1)) : ne("", !0),
      c("span", {
        innerHTML: `There ${C(o) === 1 ? "is" : "are"} <b>${C(o)}</b> field${C(o) === 1 ? "" : "s"} with
            <b>${C(n)}</b> value${C(n) === 1 ? "" : "s"} ready
            to be processed in this project.`
      }, null, 8, une),
      l[0] || (l[0] = c("span", { class: "d-block" }, "Click the button below to start the instant adjudication process.", -1)),
      D(lne, { class: "mt-2" })
    ]));
  }
}, fne = {}, pne = { class: "progress-stacked" };
function hne(e, t) {
  return g(), E("div", pne, [
    fe(e.$slots, "default", {}, void 0, !0)
  ]);
}
const $N = /* @__PURE__ */ oe(fne, [["render", hne], ["__scopeId", "data-v-01613a89"]]), mne = ["aria-label", "aria-valuenow"], vne = { key: 0 }, gne = {
  __name: "ProgressBar",
  props: {
    label: { type: String, default: "Progress segment" },
    width: { type: Number, required: !0 },
    colorClass: { type: String, default: "" },
    animated: { type: Boolean, default: !1 },
    striped: { type: Boolean, default: !1 },
    showWidth: { type: Boolean, default: !1 }
  },
  setup(e) {
    return (t, n) => (g(), E("div", {
      class: "progress",
      role: "progressbar",
      "aria-label": e.label,
      "aria-valuenow": e.width,
      "aria-valuemin": "0",
      "aria-valuemax": "100",
      style: Jn({ width: `${e.width}%` })
    }, [
      c("div", {
        class: Se(["progress-bar", {
          [e.colorClass]: !!e.colorClass,
          "progress-bar-animated": e.animated,
          "progress-bar-striped": e.striped
        }])
      }, [
        fe(t.$slots, "default", {}, () => [
          e.showWidth ? (g(), E("span", vne, F(`${e.width}%`), 1)) : ne("", !0)
        ], !0)
      ], 2)
    ], 12, mne));
  }
}, hc = /* @__PURE__ */ oe(gne, [["__scopeId", "data-v-0079f4a1"]]), _ne = { class: "small" }, yne = { class: "fw-bold" }, bne = { class: "small" }, Ene = { class: "fw-bold" }, wne = {
  __name: "FieldsProgressBar",
  setup(e) {
    const t = $e("adjudication-store"), n = k(() => t.stats), s = k(() => t.processing), o = (i, r) => r === 0 || i === 0 ? 0 : Math.round(r / i * 100);
    return (i, r) => (g(), E("div", null, [
      D($N, null, {
        default: B(() => [
          D(hc, {
            label: "successful adjudications",
            width: o(n.value.total_fields, n.value.successful_fields),
            "color-class": "bg-success",
            showWidth: "",
            striped: "",
            animated: s.value
          }, null, 8, ["width", "animated"]),
          D(hc, {
            label: "errors",
            width: o(n.value.total_fields, n.value.errors),
            "color-class": "bg-danger",
            showWidth: "",
            striped: "",
            animated: s.value
          }, null, 8, ["width", "animated"])
        ]),
        _: 1
      }),
      c("div", _ne, [
        c("small", null, [
          r[0] || (r[0] = c("span", null, "Successful adjudications: ", -1)),
          c("span", yne, F(n.value.successful_fields), 1)
        ])
      ]),
      c("div", bne, [
        c("small", null, [
          r[1] || (r[1] = c("span", null, "Errors: ", -1)),
          c("span", Ene, F(n.value.errors), 1)
        ])
      ])
    ]));
  }
}, Sne = { class: "small" }, xne = { class: "fw-bold" }, Nne = { class: "small" }, Cne = { class: "fw-bold" }, One = { class: "small" }, Tne = { class: "fw-bold" }, $ne = {
  __name: "ValuesProgressBar",
  setup(e) {
    const t = $e("adjudication-store"), n = k(() => t.stats), s = k(() => t.processing), o = (i, r) => r === 0 || i === 0 ? 0 : Math.round(r / i * 100);
    return (i, r) => (g(), E("div", null, [
      D($N, null, {
        default: B(() => [
          D(hc, {
            label: "adjudicated",
            width: o(n.value.total_values, n.value.adjudicated_values),
            "color-class": "bg-success",
            showWidth: "",
            striped: "",
            animated: s.value
          }, null, 8, ["width", "animated"]),
          D(hc, {
            label: "excluded",
            width: o(n.value.total_values, n.value.excluded_values),
            "color-class": "bg-warning",
            showWidth: "",
            striped: "",
            animated: s.value
          }, null, 8, ["width", "animated"]),
          D(hc, {
            label: "errors",
            width: o(n.value.total_values, n.value.unprocessed_values),
            "color-class": "bg-danger",
            showWidth: "",
            striped: "",
            animated: s.value
          }, null, 8, ["width", "animated"])
        ]),
        _: 1
      }),
      c("div", Sne, [
        c("small", null, [
          r[0] || (r[0] = c("span", null, "Adjudicated: ", -1)),
          c("span", xne, F(n.value.adjudicated_values), 1)
        ])
      ]),
      c("div", Nne, [
        c("small", null, [
          r[1] || (r[1] = c("span", null, "Excluded: ", -1)),
          c("span", Cne, F(n.value.excluded_values), 1)
        ])
      ]),
      c("div", One, [
        c("small", null, [
          r[2] || (r[2] = c("span", null, "Errors: ", -1)),
          c("span", Tne, F(n.value.unprocessed_values), 1)
        ])
      ])
    ]));
  }
}, kne = { class: "table table-sm table-striped table-hover table-bordered my-2" }, Dne = { key: 0 }, Rne = { class: "d-flex" }, zu = 5, kN = {
  __name: "ErrorsTable",
  setup(e) {
    const t = $e("adjudication-store"), n = I(1), s = k(() => t.errors ?? []), o = k(() => {
      const i = (n.value - 1) * zu, r = i + zu;
      return [...s.value].slice(i, r);
    });
    return (i, r) => (g(), E("div", null, [
      D(qd, {
        modelValue: n.value,
        "onUpdate:modelValue": r[0] || (r[0] = (a) => n.value = a),
        "per-page": zu,
        totalItems: s.value.length,
        size: "sm"
      }, null, 8, ["modelValue", "totalItems"]),
      c("table", kne, [
        s.value.length === 0 ? (g(), E("tbody", Dne, r[2] || (r[2] = [
          c("tr", null, [
            c("td", { class: "fst-italic" }, "No errors")
          ], -1)
        ]))) : (g(), E(G, { key: 1 }, [
          r[3] || (r[3] = c("thead", null, [
            c("tr", { class: "text-nowrap" }, [
              c("th", null, "Record ID"),
              c("th", null, "Event ID"),
              c("th", null, "Field Name"),
              c("th", null, "Error")
            ])
          ], -1)),
          c("tbody", null, [
            (g(!0), E(G, null, ge(o.value, (a, l) => (g(), E("tr", {
              key: `${l}-${a == null ? void 0 : a.label}`
            }, [
              c("td", null, F(a.field.record), 1),
              c("td", null, F(a.field.event_id), 1),
              c("td", null, F(a.field.field_name), 1),
              c("td", null, F(a.error), 1)
            ]))), 128))
          ])
        ], 64))
      ]),
      c("div", Rne, [
        D(qd, {
          modelValue: n.value,
          "onUpdate:modelValue": r[1] || (r[1] = (a) => n.value = a),
          "per-page": zu,
          totalItems: s.value.length,
          size: "sm"
        }, null, 8, ["modelValue", "totalItems"]),
        fe(i.$slots, "footer")
      ])
    ]));
  }
}, Ine = { class: "mt-2 d-flex flex-column gap-2" }, Ane = { class: "border rounded p-2" }, Mne = { class: "border rounded p-2" }, Pne = {
  key: 0,
  class: "border rounded p-2"
}, Lne = {
  key: 1,
  class: "border rounded p-2"
}, Vne = ["onClick"], Fne = {
  __name: "AdjudicationModal",
  setup(e) {
    const t = I(), n = $e("adjudication-store"), s = k(() => n.processing), o = k(
      () => n.showProcessingModal ?? !1
    ), i = k(() => n.currentField), r = k(() => n.errors);
    function a() {
      n.stopProcess();
    }
    return Ft(() => {
      t.value && (o.value === !0 ? t.value.show() : t.value.hide());
    }), (l, u) => {
      const d = le("b-modal");
      return g(), se(d, {
        ref_key: "modalRef",
        ref: t,
        backdrop: "static",
        size: "xl"
      }, {
        title: B(() => u[0] || (u[0] = [
          c("span", { class: "fw-bold" }, "Adjudication", -1)
        ])),
        "header-close-button": B(() => u[1] || (u[1] = [
          c("span", null, null, -1)
        ])),
        footer: B(({ hide: f }) => [
          s.value ? (g(), E("button", {
            key: 0,
            type: "button",
            class: "btn btn-sm btn-primary",
            onClick: a
          }, u[10] || (u[10] = [
            c("i", { class: "fas fa-stop fa-fw me-1" }, null, -1),
            c("span", null, "Stop", -1)
          ]))) : (g(), E("button", {
            key: 1,
            type: "button",
            class: "btn btn-sm btn-primary",
            onClick: f
          }, u[11] || (u[11] = [
            c("i", { class: "fas fa-times-circle fa-fw me-1" }, null, -1),
            c("span", null, "Close", -1)
          ]), 8, Vne))
        ]),
        default: B(() => [
          c("div", null, [
            u[9] || (u[9] = c("span", null, "REDCap is adjudicating the pending data stored in the database using the CDP mapping configuration.", -1)),
            c("div", Ine, [
              c("div", Ane, [
                u[2] || (u[2] = c("div", { class: "fw-bold text-left" }, "Values", -1)),
                D($ne)
              ]),
              c("div", Mne, [
                u[3] || (u[3] = c("div", { class: "fw-bold text-left" }, "Fields", -1)),
                D(wne)
              ]),
              s.value && i.value ? (g(), E("div", Pne, [
                u[7] || (u[7] = c("span", { class: "fw-bold" }, "Processing", -1)),
                c("div", null, [
                  u[4] || (u[4] = c("span", null, "Record ID: ", -1)),
                  te(" " + F(i.value.record), 1)
                ]),
                c("div", null, [
                  u[5] || (u[5] = c("span", null, "Event ID: ", -1)),
                  te(" " + F(i.value.event_id), 1)
                ]),
                c("div", null, [
                  u[6] || (u[6] = c("span", null, "Field name: ", -1)),
                  te(" " + F(i.value.field_name), 1)
                ])
              ])) : ne("", !0),
              r.value ? (g(), E("div", Lne, [
                u[8] || (u[8] = c("span", { class: "fw-bold" }, "Errors", -1)),
                D(kN)
              ])) : ne("", !0)
            ])
          ])
        ]),
        _: 1
      }, 512);
    };
  }
}, Une = {
  __name: "ExportErrorsButton",
  props: {
    errors: { type: Array, default: () => [] }
  },
  setup(e) {
    const t = e;
    function n() {
      const s = [];
      t.errors.forEach((i) => {
        var a, l, u;
        const r = {
          record: ((a = i == null ? void 0 : i.field) == null ? void 0 : a.record) ?? "",
          event_id: ((l = i == null ? void 0 : i.field) == null ? void 0 : l.event_id) ?? "",
          field_name: ((u = i == null ? void 0 : i.field) == null ? void 0 : u.field_name) ?? "",
          error: (i == null ? void 0 : i.error) ?? ""
        };
        s.push(r);
      });
      const o = H8(s);
      Y8(o, "cdp-adjudication-errors");
    }
    return (s, o) => (g(), E("button", {
      type: "button",
      class: "btn btn-sm btn-outline-primary ms-auto",
      onClick: n
    }, o[0] || (o[0] = [
      c("i", { class: "fas fa-file-csv fa-fw" }, null, -1),
      c("span", null, "Download CSV", -1)
    ])));
  }
}, jne = { class: "table table-bordered table-striped-table-hover table-sm" }, Bne = { class: "mt-2 d-flex flex-column gap-2" }, Hne = {
  key: 0,
  class: ""
}, Yne = ["onClick"], Wne = {
  __name: "SummaryModal",
  setup(e) {
    const t = I(), n = $e("adjudication-store"), s = k(
      () => n.showSummaryModal ?? !1
    ), o = k(() => n.stats), i = k(() => n.errors), r = cn(), a = () => {
      const l = {
        stats: Ye(o.value),
        errors: Ye(i.value),
        timestamp: Date.now()
      };
      r.proxy.$eventBus.emit("summary-closed", l);
    };
    return Ft(async () => {
      t.value && (s.value === !0 ? (await t.value.show(), a()) : t.value.hide());
    }), (l, u) => {
      const d = le("b-modal");
      return g(), se(d, {
        ref_key: "modalRef",
        ref: t,
        size: "xl"
      }, {
        title: B(() => u[0] || (u[0] = [
          c("span", { class: "fw-bold" }, "Summary", -1)
        ])),
        footer: B(({ hide: f }) => [
          c("button", {
            type: "button",
            class: "btn btn-sm btn-primary",
            onClick: f
          }, u[4] || (u[4] = [
            c("i", { class: "fas fa-times-circle fa-fw me-1" }, null, -1),
            c("span", null, "Close", -1)
          ]), 8, Yne)
        ]),
        default: B(() => [
          c("div", null, [
            c("table", jne, [
              u[1] || (u[1] = c("thead", null, [
                c("tr", null, [
                  c("th", null, "Total Fields"),
                  c("th", null, "Processed"),
                  c("th", null, "Successful"),
                  c("th", null, "Errors"),
                  c("th", null, "Adjudicated Values"),
                  c("th", null, [
                    te("Excluded Values "),
                    c("sup", { class: "" }, "1")
                  ]),
                  c("th", null, [
                    te("Unprocessed Values "),
                    c("sup", { class: "" }, "2")
                  ])
                ])
              ], -1)),
              c("tbody", null, [
                c("tr", null, [
                  c("th", null, F(o.value.total_fields), 1),
                  c("th", null, F(o.value.processed_fields), 1),
                  c("th", null, F(o.value.successful_fields), 1),
                  c("th", null, F(o.value.errors), 1),
                  c("th", null, F(o.value.adjudicated_values), 1),
                  c("th", null, F(o.value.excluded_values), 1),
                  c("th", null, F(o.value.unprocessed_values), 1)
                ])
              ])
            ]),
            u[3] || (u[3] = c("div", { class: "border rounded bg-light p-2" }, [
              c("sup", { class: "" }, "1"),
              c("span", null, "Values are excluded (not saved) in the adjudication process if:"),
              c("ul", null, [
                c("li", null, "empty"),
                c("li", null, "matching existing values"),
                c("li", null, " not the best option based on the 'preselect' mapping rule ")
              ]),
              c("sup", { class: "" }, "2"),
              c("span", null, "Unprocessed values have been skipped due to an error during the adjudication process")
            ], -1)),
            c("div", Bne, [
              i.value ? (g(), E("div", Hne, [
                u[2] || (u[2] = c("span", { class: "fw-bold" }, "Errors", -1)),
                D(kN, null, {
                  footer: B(() => [
                    D(Une, { errors: i.value }, null, 8, ["errors"])
                  ]),
                  _: 1
                })
              ])) : ne("", !0)
            ])
          ])
        ]),
        _: 1
      }, 512);
    };
  }
}, Gne = { class: "border rounded p-2 d-inline-block" }, zne = {
  __name: "App",
  setup(e) {
    const t = nne(), n = TN();
    return Cn("adjudication-store", t), Cn("records-store", n), vt(() => {
      n.getRecords(1);
    }), (s, o) => (g(), E("div", Gne, [
      o[0] || (o[0] = c("div", null, [
        c("i", { class: "fas fa-check fa-fw text-success me-2" }),
        c("span", { class: "fw-bold" }, "Instant adjudication is enabled")
      ], -1)),
      D(dne),
      D(Fne),
      D(Wne)
    ]));
  }
}, ta = new EventTarget();
ta.emit = (e, t = {}) => {
  ta.dispatchEvent(
    new CustomEvent(e, {
      detail: {
        ...t,
        timestamp: Date.now()
      }
    })
  );
};
const r_ = () => ({
  install: (e) => {
    e.config.globalProperties.$eventBus = ta, e.provide("eventBus", ta);
  }
}), yde = (e) => {
  const t = wn(zne), n = _l();
  n.use(Cq), n.use(El), t.use(n), t.use(Cs), t.use(r_()), t.mount(e);
  const s = t.runWithContext(() => Oq());
  return { app: t, store: s, eventBus: ta };
}, Dp = () => {
  const e = Nr();
  return k(() => {
    var o;
    const n = ((o = e.params) == null ? void 0 : o.arm_num) ?? 1;
    return n === "" || n == null ? 1 : n;
  });
}, Kne = "app", Xne = () => ({
  day_offset_max: 0,
  day_offset_min: 0,
  fhir_fields: {},
  fhir_source_name: "",
  mapping: [],
  mapping_helper_url: "",
  preview_fields: [],
  project: {},
  project_fields: [],
  project_id: 0,
  project_temporal_fields: [],
  translations: {}
}), pu = /* @__PURE__ */ Ut(Kne, () => {
  I(!1);
  const e = I(!1), t = I(), n = qe(Xne()), s = qe({});
  Dp();
  const o = k(() => {
    let i = (n == null ? void 0 : n.fhir_fields) ?? {};
    return Object.values(i).filter(
      (r) => r.identifier === !0
    );
  });
  return {
    loading: e,
    error: t,
    settings: n,
    arms: s,
    recordIdentifierFields: o
  };
});
let qne = Bo();
const Ul = Ho(qne, ["pid"], { timeout: 0 }), mc = {
  getSettings() {
    const e = {
      route: "CdpController:getSettings"
    };
    return Ul.get("", { params: e });
  },
  setSettings(e) {
    const t = {
      route: "CdpController:setSettings"
    }, n = { settings: e };
    return Ul.post("", n, { params: t });
  },
  setMappings(e) {
    const t = {
      route: "CdpController:setMappings"
    }, n = { mappings: e };
    return Ul.post("", n, { params: t });
  },
  exportMappings() {
    const e = {
      route: "CdpController:exportMappings"
    }, t = {};
    return Ul.post("", t, { params: e });
  },
  importMappings(e) {
    const t = {
      route: "CdpController:importMappings"
    }, n = new FormData();
    return n.append("file", e), Ul.post("", n, { params: t });
  }
}, DN = 0.01, na = 0.01, Jne = 15, i_ = 365, Ti = Object.freeze({
  MANUAL: "manual",
  INSTANT: "instant",
  AUTO: "auto"
}), Qne = "settings", Rp = /* @__PURE__ */ Ut(Qne, () => {
  const e = I(!1), t = I(), n = qe({});
  Dp();
  const s = I([]), o = I(), i = I(na), r = I();
  return {
    loading: e,
    error: t,
    arms: n,
    preview_fields: s,
    days_plus_minus: o,
    days: i,
    adjudication_method: r
  };
}), Zne = "mapping", RN = /* @__PURE__ */ Ut(Zne, () => {
  const e = I(!1), t = I(), n = qe({});
  Dp();
  const s = I([]);
  return {
    loading: e,
    error: t,
    arms: n,
    list: s
  };
}), Ku = I([]), ese = {
  app: pu,
  settings: Rp,
  mapping: RN
}, tse = () => ({
  ...Object.fromEntries(
    Object.entries(ese).map(([t, n]) => [t, n()])
  )
}), Mh = Object.freeze({
  STANDARD: "STANDARD",
  TEMPORAL: "TEMPORAL",
  IDENTIFIER: "IDENTIFIER"
}), nse = (e, t) => {
  const n = pu(), s = t;
  return (/* @__PURE__ */ Ut(e, () => {
    const i = I(e), r = I(!1), a = I(), l = I([]), u = qe(co(s)), d = () => {
      const j = co(s);
      return Object.assign(u, j), j;
    }, { fhir_fields: f, project_temporal_fields: p } = he(n.settings ?? {}), {
      events: h,
      metadata: m,
      events_forms: v,
      arms: _,
      forms: b
    } = he(n.settings.project), w = (j) => {
      const V = {
        external_source_field_name: u == null ? void 0 : u.external_source_field_name,
        event_id: u == null ? void 0 : u.event_id,
        field_name: u == null ? void 0 : u.field_name,
        temporal_field: u == null ? void 0 : u.temporal_field,
        preselect: u == null ? void 0 : u.preselect
      }, K = {
        external_source_field_name: j == null ? void 0 : j.external_source_field_name,
        event_id: j == null ? void 0 : j.event_id,
        field_name: j == null ? void 0 : j.field_name,
        temporal_field: j == null ? void 0 : j.temporal_field,
        preselect: j == null ? void 0 : j.preselect
      };
      return Lo(V, K);
    }, y = k(() => !w(s)), x = k(() => (u == null ? void 0 : u._isNew) === !0), N = k(() => (u == null ? void 0 : u._isDeleted) ?? !1), S = (j = !0) => {
      u._isDeleted = j;
    }, O = k(() => l.value.length > 0), $ = k(() => {
      var V, K;
      const j = u == null ? void 0 : u.external_source_field_name;
      return j ? ((K = (V = f.value) == null ? void 0 : V[j]) == null ? void 0 : K.temporal) ?? !1 : !1;
    }), T = k(() => {
      var re;
      const j = u.external_source_field_name, V = ((re = f.value) == null ? void 0 : re[j]) ?? {}, K = (V == null ? void 0 : V.label) ?? "", q = (V == null ? void 0 : V.description) ?? "";
      return {
        mapping_id: j,
        label: (V == null ? void 0 : V.label) ?? "",
        description: K != q ? q : null,
        metadata: V,
        type: sse(V)
      };
    }), R = k(() => t1(m.value, u.field_name)), P = k(() => t1(m.value, u.temporal_field)), M = (j) => {
      var q;
      const V = ["descriptive", "checkbox", "file"], K = co(j);
      for (const [re, ke] of Object.entries(K)) {
        const ze = new RegExp(`^${re}_complete$`, "i");
        for (const We of Object.keys((ke == null ? void 0 : ke.fields) ?? {})) {
          const st = (q = m.value) == null ? void 0 : q[We], Lt = st == null ? void 0 : st.element_type, Yt = (st == null ? void 0 : st.field_name) ?? "";
          (V.includes(Lt) || Yt.match(ze)) && delete K[re].fields[We];
        }
      }
      return K;
    }, U = k(() => {
      const j = (v == null ? void 0 : v.value) ?? {}, V = (b == null ? void 0 : b.value) ?? {}, K = [...(j == null ? void 0 : j[u == null ? void 0 : u.event_id]) ?? []];
      let q = ose(V, K);
      return M(q);
    }), H = k(() => {
      var K;
      const j = co(U.value), V = p.value.map(
        (q) => q.field_name
      );
      for (const [q, re] of Object.entries(
        j
      ))
        for (const [ke, ze] of Object.entries(
          re == null ? void 0 : re.fields
        ))
          V.includes(ke) || (K = re == null ? void 0 : re.fields) == null || delete K[ke];
      return M(j);
    });
    return nt(
      () => u == null ? void 0 : u.event_id,
      () => {
        var K, q;
        const j = Object.keys(
          U.value ?? []
        ), V = (q = (K = m == null ? void 0 : m.value) == null ? void 0 : K[u.field_name]) == null ? void 0 : q.form_name;
        j.includes(V) || (u.field_name = null);
      },
      { immediate: !0 }
    ), nt(
      () => u.external_source_field_name,
      () => {
        $.value || (u.temporal_field = null, u.preselect = null);
      },
      { immediate: !0 }
    ), {
      _id: i,
      error: a,
      loading: r,
      field: u,
      // the mapping entry
      duplicates: l,
      // helpers
      externalSourceFieldData: T,
      redcapFieldData: R,
      temporalFieldData: P,
      isDirty: y,
      isNew: x,
      isDeleted: N,
      isTemporal: $,
      isDuplicate: O,
      // read-only
      projectMetadata: m,
      temporal_fields: p,
      eventFields: U,
      eventFieldsTemporal: H,
      // methods
      equals: w,
      reset: d,
      markDeleted: S
    };
  }))();
}, t1 = (e, t) => {
  const n = e == null ? void 0 : e[t];
  return {
    name: n == null ? void 0 : n.field_name,
    label: gF((n == null ? void 0 : n.element_label) ?? ""),
    form: String((n == null ? void 0 : n.form_menu_description) ?? (n == null ? void 0 : n.form_name) ?? "")
  };
}, sse = (e) => e != null && e.identifier ? Mh.IDENTIFIER : e.temporal ? Mh.TEMPORAL : Mh.STANDARD;
function ose(e, t) {
  return Object.keys(e).reduce((n, s) => (t.includes(s) && (n[s] = e[s]), co(n)), {});
}
function rse(e) {
  return (t, n) => {
    var a, l, u, d;
    const s = ((a = e[t.external_source_field_name]) == null ? void 0 : a.category) || "", o = ((l = e[n.external_source_field_name]) == null ? void 0 : l.category) || "", i = ((u = e[t.external_source_field_name]) == null ? void 0 : u.subcategory) || "", r = ((d = e[n.external_source_field_name]) == null ? void 0 : d.subcategory) || "";
    return s < o ? -1 : s > o ? 1 : i < r ? -1 : i > r ? 1 : t.external_source_field_name < n.external_source_field_name ? -1 : t.external_source_field_name > n.external_source_field_name ? 1 : 0;
  };
}
const n1 = () => ({
  _isDeleted: !1,
  _isNew: !0,
  map_id: hg(),
  event_id: null,
  external_source_field_name: null,
  field_name: null,
  is_record_identifier: !1,
  preselect: null,
  project_id: null,
  temporal_field: null
}), ise = () => {
  let e = 0;
  return () => ++e;
}, ase = /* @__PURE__ */ Ut("mapping-service", () => {
  const e = fs(), t = an(), n = pu(), s = Rp(), o = IN(), { mapping: i, fhir_fields: r } = he(n == null ? void 0 : n.settings), a = ise(), l = I(), u = I(!1), d = I(), f = I([]), p = (U) => {
    const j = `mapping-service-${U._id = a()}`;
    return nse(j, U);
  }, h = (U, H = void 0) => {
    typeof H > "u" && (H = f.value.length);
    const j = p(U);
    f.value.splice(H, 0, j);
  }, m = () => {
    const U = n1();
    h(U);
  }, v = (U, H) => {
    const j = { ...U, _isDeleted: !1 };
    j.map_id = hg(), j._isNew = !0, h(j, H + 1);
  }, _ = (U) => {
    var V;
    const H = f.value.findIndex(
      (K) => {
        var q;
        return ((q = K == null ? void 0 : K.field) == null ? void 0 : q.map_id) === (U == null ? void 0 : U.map_id);
      }
    ), j = (V = f.value) == null ? void 0 : V[H];
    j && (j.isNew ? (j.$dispose(), f.value.splice(H, 1)) : j.markDeleted());
  }, b = (U) => {
    var V;
    const H = f.value.findIndex(
      (K) => {
        var q;
        return ((q = K == null ? void 0 : K.field) == null ? void 0 : q.map_id) === (U == null ? void 0 : U.map_id);
      }
    ), j = (V = f.value) == null ? void 0 : V[H];
    j && j.markDeleted(!1);
  };
  async function w() {
    var U;
    try {
      u.value = !0;
      const H = await mc.exportMappings();
      return (U = H == null ? void 0 : H.data) == null ? void 0 : U.download_url;
    } catch (H) {
      d.value = H;
    } finally {
      u.value = !1;
    }
  }
  async function y(U) {
    var H;
    try {
      u.value = !0;
      const j = await mc.importMappings(U), V = (H = j == null ? void 0 : j.data) == null ? void 0 : H.imported;
      return t.toast({
        title: "Success",
        body: `Total imported mappings: ${V == null ? void 0 : V.length}`
      }), await o.getSettings(), V;
    } catch (j) {
      d.value = j;
    } finally {
      u.value = !1;
    }
  }
  const x = (U, H) => {
    const j = rse(H);
    return U.sort(j);
  }, N = k(() => {
    const U = [];
    return l.value && U.push(l.value), U.push(...f.value), U;
  }), S = (U) => {
    const H = co(U), j = n.recordIdentifierFields.map((V) => V.field);
    return H.is_record_identifier = !0, H.temporal_field = null, j.includes(H.external_source_field_name) || (H.external_source_field_name = j == null ? void 0 : j[0]), p(H);
  }, O = () => {
    for (const [U, H] of N.value.entries())
      H.$dispose();
    l.value = S(n1()), f.value = [];
  }, $ = k(() => {
    for (const [U, H] of N.value.entries())
      if (H.isDeleted || H.isDirty || H.isNew) return !0;
    return !1;
  }), T = k(() => {
    for (const U of f.value) {
      if (!U.isTemporal) continue;
      const H = (U == null ? void 0 : U.field) ?? {};
      if (!(H != null && H.preselect) || !(H != null && H.temporal_field)) return !1;
    }
    return !0;
  }), R = k(() => {
    for (const [U, H] of N.value.entries())
      if (H.isDuplicate) return !0;
    return !1;
  });
  async function P() {
    var U;
    try {
      if (R.value) {
        e.alert({ title: "Error", body: "You must remove duplicate entries before you can save." });
        return;
      }
      if (u.value = !0, (s == null ? void 0 : s.adjudication_method) !== Ti.MANUAL && !T.value)
        if (await e.confirm({
          title: ls("incorrect_adjudication_strategy_warning_title"),
          body: ls("incorrect_adjudication_strategy_warning_message"),
          textCancel: "Cancel",
          textOk: "Continue"
        }))
          s.adjudication_method = Ti.MANUAL, await o.save();
        else
          return;
      const V = [(U = l.value) == null ? void 0 : U.field];
      for (const [q, re] of f.value.entries())
        V.push({ ...re.field });
      return await mc.setMappings(V);
    } catch (H) {
      d.value = H;
    } finally {
      u.value = !1;
    }
  }
  async function M() {
    for (const [U, H] of N.value.entries())
      H.isDirty && H.reset(), H.isDeleted && H.reset(), H.isNew && _(H.field);
  }
  return nt(
    i,
    () => {
      try {
        O();
        const U = x(i.value, r.value);
        for (const H of U) {
          if ((H == null ? void 0 : H.is_record_identifier) == !0) {
            l.value = S(H);
            continue;
          }
          H._isNew = !1, H._isDeleted = !1;
          const j = p(H);
          f.value.push(j);
        }
      } catch (U) {
        console.log(U);
      }
    },
    { immediate: !0 }
  ), nt(
    () => f.value.map((U) => U.field),
    // Watch the 'field' property of each object
    () => {
      f.value.forEach((H) => H.duplicates = []);
      const U = /* @__PURE__ */ new Set();
      for (let H = 0; H < f.value.length; H++) {
        const j = f.value[H];
        if (!U.has(j)) {
          for (let V = H + 1; V < f.value.length; V++) {
            const K = f.value[V];
            j.equals(K.field) && (console.log("equales"), j.duplicates.push(K), K.duplicates.push(j), U.add(K));
          }
          U.add(j);
        }
      }
    },
    { deep: !0 }
  ), {
    loading: u,
    error: d,
    stores: f,
    recordIdentifierStore: l,
    fhir_fields: r,
    isDirty: $,
    hasDuplicates: R,
    allTemporalFieldsSetForInstantAdjudication: T,
    registerEntry: p,
    createEntry: m,
    removeEntry: _,
    restoreEntry: b,
    duplicateEntry: v,
    save: P,
    reset: M,
    exportMappings: w,
    importMappings: y
  };
}), IN = /* @__PURE__ */ Ut("settings-service", () => {
  const e = I(!1), t = I();
  fs(), an(), ds(), Nr();
  const n = pu(), s = Rp(), o = RN();
  Dp();
  const i = qe({
    preview_fields: [],
    days: null,
    days_plus_minus: null,
    adjudication_method: null
  }), r = k(() => {
    var _, b, w, y, x, N, S;
    const m = { ...u.value }, v = {
      preview_fields: [...((_ = n == null ? void 0 : n.settings) == null ? void 0 : _.preview_fields) || []],
      days: String(
        (w = (b = n == null ? void 0 : n.settings) == null ? void 0 : b.project) == null ? void 0 : w.realtime_webservice_offset_days
      ),
      days_plus_minus: (x = (y = n == null ? void 0 : n.settings) == null ? void 0 : y.project) == null ? void 0 : x.realtime_webservice_offset_plusminus,
      adjudication_method: (S = (N = n == null ? void 0 : n.settings) == null ? void 0 : N.project) == null ? void 0 : S.adjudication_method
    };
    return !Lo(m, v);
  }), a = (m, v) => {
    for (const [_, b] of Object.entries(v))
      delete m[_], m[_] = b;
  };
  async function l(m, v) {
    try {
      e.value = !0;
      const _ = await mc.getSettings(), b = (_ == null ? void 0 : _.data) ?? {};
      a(i, b), a(n.settings, i);
      const { translations: w = {} } = b;
      ip(w);
    } catch (_) {
      n.error = _;
    } finally {
      e.value = !1;
    }
  }
  const u = k(() => ({
    preview_fields: [...s.preview_fields],
    days: String(s.days),
    days_plus_minus: s.days_plus_minus,
    adjudication_method: s.adjudication_method
  }));
  function d() {
    a(n.settings, i);
  }
  async function f() {
    try {
      return e.value = !0, await mc.setSettings(u.value);
    } catch (m) {
      t.value = m;
    } finally {
      e.value = !1;
    }
  }
  const p = () => {
    var m, v, _, b, w, y, x;
    s.preview_fields = [...((m = n == null ? void 0 : n.settings) == null ? void 0 : m.preview_fields) ?? []], s.days = parseFloat(
      ((_ = (v = n == null ? void 0 : n.settings) == null ? void 0 : v.project) == null ? void 0 : _.realtime_webservice_offset_days) ?? na
    ), s.days_plus_minus = (w = (b = n == null ? void 0 : n.settings) == null ? void 0 : b.project) == null ? void 0 : w.realtime_webservice_offset_plusminus, s.adjudication_method = ((x = (y = n == null ? void 0 : n.settings) == null ? void 0 : y.project) == null ? void 0 : x.adjudication_method) ?? Ti.MANUAL;
  }, h = () => {
    var m;
    o.list = [...((m = n == null ? void 0 : n.settings) == null ? void 0 : m.mapping) ?? []];
  };
  return nt(
    () => n,
    (m, v) => {
      p(), h();
    },
    {
      immediate: !0,
      deep: !0
    }
  ), {
    loading: e,
    isDirty: r,
    getSettings: l,
    reset: d,
    save: f
  };
}), lse = {
  key: 0,
  class: "alert alert-danger"
}, cse = {
  __name: "ErrorsVisualizer",
  setup(e) {
    const t = I();
    return Ft(async () => {
      var s, o;
      if ((s = Ku.value) == null || s.length, ((o = Ku.value) == null ? void 0 : o.length) === 0) return;
      const n = t.value;
      n && (await n.show(), Ku.value = []);
    }), (n, s) => {
      const o = le("b-modal");
      return g(), se(o, {
        ref_key: "modalRef",
        ref: t,
        "ok-only": ""
      }, {
        header: B(() => s[0] || (s[0] = [
          c("span", null, "Error", -1)
        ])),
        default: B(() => [
          (g(!0), E(G, null, ge(C(Ku), (i, r) => (g(), E(G, { key: r }, [
            i ? (g(), E("div", lse, F(C(Gs)(i)), 1)) : ne("", !0)
          ], 64))), 128))
        ]),
        _: 1
      }, 512);
    };
  }
}, use = {}, dse = {
  "data-loader": "",
  class: "p-2 d-inline-block"
};
function fse(e, t) {
  return g(), E("div", dse, t[0] || (t[0] = [
    c("div", null, [
      c("i", { class: "fa fa-spinner fa-spin fa-fw me-2" }),
      c("span", null, "loading")
    ], -1)
  ]));
}
const pse = /* @__PURE__ */ oe(use, [["render", fse], ["__scopeId", "data-v-17b2dbb4"]]), hse = { "data-cdp-mapping": "" }, mse = {
  __name: "App",
  setup(e) {
    const t = pu(), n = Rp(), s = ase(), o = IN();
    Cn("app-store", t), Cn("settings-store", n), Cn("mapping-service", s), Cn("settings-manager-service", o);
    const i = I(!1);
    return vt(async () => {
      await o.getSettings(), i.value = !0;
    }), (r, a) => {
      const l = le("router-view");
      return g(), E("div", hse, [
        i.value ? (g(), se(l, { key: 0 })) : (g(), se(pse, { key: 1 })),
        D(cse)
      ]);
    };
  }
};
({
  ...Ja.props
});
const vse = {
  __name: "MainLayout",
  setup(e) {
    return (t, n) => {
      const s = le("router-view");
      return g(), E("div", null, [
        D(s)
      ]);
    };
  }
}, gse = {};
function _se(e, t) {
  const n = Ht("tt");
  return L((g(), E("div", null, t[0] || (t[0] = [
    te("Preview Panel")
  ]))), [
    [n, void 0, "preview_fields_description"]
  ]);
}
const AN = /* @__PURE__ */ oe(gse, [["render", _se]]), yse = {
  class: "d-flex",
  "data-group": ""
}, bse = { class: "me-auto" }, Ese = {
  class: "px-2",
  "data-prevent-close": ""
}, wse = { style: { "max-height": "400px", "overflow-y": "auto" } }, Sse = { class: "text-muted" }, xse = {
  __name: "PreviewField",
  props: {
    fields: { type: Object, default: () => ({}) },
    selected: { type: String, default: null },
    disabled: { type: Boolean, default: !1 }
  },
  emits: ["remove", "update:selected"],
  setup(e, { emit: t }) {
    const n = e, { selected: s } = he(n), o = I(""), i = (d, f) => {
      try {
        if (d === "") return !0;
        const p = new RegExp(d, "i"), h = [
          "category",
          "subcategory",
          "description",
          "field",
          "label"
        ];
        for (const m of h)
          if ((f == null ? void 0 : f[m].match(p)) ?? !1) return !0;
        return !1;
      } catch {
        return !0;
      }
    }, r = k(() => {
      const d = {}, f = o.value;
      return Object.values(n.fields).forEach((p) => {
        const { category: h = void 0, temporal: m = !1 } = p;
        m || !h || i(f, p) && (h in d || (d[h] = []), d[h].push(p));
      }), d;
    }), a = t;
    function l() {
      a("remove", s.value);
    }
    function u(d) {
      a("update:selected", d);
    }
    return (d, f) => {
      const p = le("b-dropdown-header"), h = le("b-dropdown-item"), m = le("b-dropdown-divider"), v = le("b-dropdown");
      return g(), E("div", yse, [
        D(v, {
          variant: "outline-secondary",
          size: "sm",
          disabled: e.disabled
        }, {
          button: B(() => [
            c("span", bse, [
              C(s) ? (g(), E(G, { key: 0 }, [
                te(F(C(s)), 1)
              ], 64)) : (g(), E(G, { key: 1 }, [
                te("Select...")
              ], 64))
            ])
          ]),
          default: B(() => [
            c("div", null, [
              c("div", Ese, [
                L(c("input", {
                  class: "form-control form-control-sm",
                  type: "search",
                  "onUpdate:modelValue": f[0] || (f[0] = (_) => o.value = _)
                }, null, 512), [
                  [Ve, o.value]
                ])
              ]),
              c("div", wse, [
                (g(!0), E(G, null, ge(r.value, (_, b) => (g(), E(G, {
                  key: `${b}`
                }, [
                  D(p, null, {
                    default: B(() => [
                      c("span", Sse, F(b), 1)
                    ]),
                    _: 2
                  }, 1024),
                  (g(!0), E(G, null, ge(_, (w, y) => (g(), se(h, {
                    key: `${y}-${w.field}`,
                    onClick: (x) => u(w.field),
                    active: C(s) == w.field
                  }, {
                    default: B(() => [
                      te(F(w.field), 1)
                    ]),
                    _: 2
                  }, 1032, ["onClick", "active"]))), 128)),
                  D(m)
                ], 64))), 128))
              ])
            ])
          ]),
          _: 1
        }, 8, ["disabled"]),
        c("button", {
          class: "btn btn-sm btn-outline-secondary",
          type: "button",
          onClick: l
        }, f[1] || (f[1] = [
          c("span", null, [
            c("i", { class: "fas fa-trash fa-fw text-danger" })
          ], -1)
        ]))
      ]);
    };
  }
}, s1 = /* @__PURE__ */ oe(xse, [["__scopeId", "data-v-93f797d0"]]), Nse = { class: "fst-italic mx-1" }, Cse = { class: "d-flex flex-column gap-2 my-2" }, o1 = 5, MN = {
  __name: "PreviewPanel",
  setup(e) {
    const t = $e("app-store"), n = $e("settings-store"), s = k({
      get: () => n.preview_fields ?? [],
      set: (u) => n.preview_fields = [...u]
    }), o = k(
      () => {
        var u;
        return ((u = t == null ? void 0 : t.settings) == null ? void 0 : u.fhir_source_name) ?? "unknown";
      }
    ), i = k(() => {
      var u;
      return ((u = t == null ? void 0 : t.settings) == null ? void 0 : u.fhir_fields) ?? [];
    });
    function r() {
      var u;
      ((u = s.value) == null ? void 0 : u.length) >= o1 || s.value.push(void 0);
    }
    function a(u) {
      const d = [...s.value];
      u < 0 || (d.splice(u, 1), s.value = [...d], console.log("removeisdfasd"));
    }
    function l(u, d) {
      const f = [...s.value];
      u < 0 || u >= f.length || (f[u] = d, s.value = [...f]);
    }
    return (u, d) => {
      const f = Ht("tt");
      return g(), E("div", null, [
        c("span", null, [
          L(c("span", null, null, 512), [
            [f, void 0, "preview_fields_select_label"]
          ]),
          c("span", Nse, F(o.value), 1),
          L(c("span", null, null, 512), [
            [f, void 0, "preview_fields_select_up_to"]
          ])
        ]),
        c("div", Cse, [
          (g(!0), E(G, null, ge(s.value, (p, h) => (g(), se(s1, {
            key: h,
            fields: i.value,
            selected: s.value[h],
            onRemove: (m) => a(h),
            "onUpdate:selected": (m) => l(h, m)
          }, null, 8, ["fields", "selected", "onRemove", "onUpdate:selected"]))), 128)),
          (g(!0), E(G, null, ge(o1 - s.value.length, (p) => (g(), se(s1, {
            key: p,
            fields: [],
            selected: null,
            disabled: "",
            style: { opacity: "0" }
          }))), 128))
        ]),
        c("div", null, [
          c("button", {
            class: "btn btn-sm btn-primary",
            onClick: r
          }, " Add field ")
        ])
      ]);
    };
  }
}, Ose = {}, Tse = { class: "d-block text-muted fst-italic mt-2" };
function $se(e, t) {
  const n = Ht("tt");
  return g(), E("div", null, [
    L((g(), E("span", null, t[0] || (t[0] = [
      te("Adjudication method")
    ]))), [
      [n, void 0, "adjudication_method_description"]
    ]),
    c("small", Tse, [
      L((g(), E("span", null, t[1] || (t[1] = [
        te("Adjudication note")
      ]))), [
        [n, void 0, "adjudication_method_note"]
      ])
    ])
  ]);
}
const PN = /* @__PURE__ */ oe(Ose, [["render", $se]]), kse = { class: "form-check" }, Dse = ["value"], Rse = {
  class: "form-check-label",
  for: "manual-method"
}, Ise = { class: "d-block text-muted fst-italic" }, Ase = { class: "form-check" }, Mse = ["value", "disabled"], Pse = {
  class: "form-check-label",
  for: "instant-method"
}, Lse = { class: "d-block text-muted fst-italic" }, Vse = { class: "form-check" }, Fse = ["value", "disabled"], Use = {
  class: "form-check-label",
  for: "auto-method"
}, jse = { class: "d-block text-muted fst-italic" }, LN = {
  __name: "AdjudicationMethodPanel",
  setup(e) {
    const t = $e("settings-store"), n = $e("mapping-service"), { adjudication_method: s } = he(t), {
      allTemporalFieldsSetForInstantAdjudication: o
    } = he(n);
    return Ft(() => {
      o.value || (s.value = Ti.MANUAL);
    }), (i, r) => {
      const a = Ht("tt");
      return g(), E("div", null, [
        c("div", kse, [
          L(c("input", {
            class: "form-check-input",
            type: "radio",
            id: "manual-method",
            value: C(Ti).MANUAL,
            "onUpdate:modelValue": r[0] || (r[0] = (l) => ut(s) ? s.value = l : null)
          }, null, 8, Dse), [
            [La, C(s)]
          ]),
          c("label", Rse, [
            r[3] || (r[3] = c("span", null, "Manual", -1)),
            c("small", Ise, [
              L(c("span", null, null, 512), [
                [a, void 0, "adjudication_metod_manual_description"]
              ])
            ])
          ])
        ]),
        c("div", Ase, [
          L(c("input", {
            class: "form-check-input",
            type: "radio",
            id: "instant-method",
            value: C(Ti).INSTANT,
            "onUpdate:modelValue": r[1] || (r[1] = (l) => ut(s) ? s.value = l : null),
            disabled: !C(o)
          }, null, 8, Mse), [
            [La, C(s)]
          ]),
          c("label", Pse, [
            r[4] || (r[4] = c("span", null, "Instant", -1)),
            c("small", Lse, [
              L(c("span", null, null, 512), [
                [a, void 0, "adjudication_metod_instant_description"]
              ])
            ])
          ])
        ]),
        c("div", Vse, [
          L(c("input", {
            class: "form-check-input",
            type: "radio",
            id: "auto-method",
            value: C(Ti).AUTO,
            "onUpdate:modelValue": r[2] || (r[2] = (l) => ut(s) ? s.value = l : null),
            disabled: !C(o)
          }, null, 8, Fse), [
            [La, C(s)]
          ]),
          c("label", Use, [
            r[5] || (r[5] = c("span", null, "Auto", -1)),
            c("small", jse, [
              L(c("span", null, null, 512), [
                [a, void 0, "adjudication_metod_automatic_description"]
              ])
            ])
          ])
        ])
      ]);
    };
  }
}, Bse = {};
function Hse(e, t) {
  const n = Ht("tt");
  return L((g(), E("div", null, t[0] || (t[0] = [
    te("Offset days")
  ]))), [
    [n, void 0, "default_day_offset_description"]
  ]);
}
const VN = /* @__PURE__ */ oe(Bse, [["render", Hse]]), Yse = {
  class: "d-inline-block",
  style: { width: "10px" }
}, r1 = "±", Wse = {
  __name: "PlusMinusSelect",
  props: {
    selected: { default: null, required: !0 },
    selectedModifiers: {}
  },
  emits: ["update:selected"],
  setup(e) {
    const t = At(e, "selected");
    function n(s = null) {
      t.value = s;
    }
    return (s, o) => {
      const i = le("b-dropdown-item"), r = le("b-dropdown");
      return g(), se(r, {
        variant: "outline-secondary",
        size: "sm"
      }, {
        button: B(() => [
          c("span", Yse, F(t.value || r1), 1)
        ]),
        default: B(() => [
          D(i, {
            onClick: o[0] || (o[0] = (a) => n("+-"))
          }, {
            default: B(() => [
              c("span", null, F(r1))
            ]),
            _: 1
          }),
          D(i, {
            onClick: o[1] || (o[1] = (a) => n("+"))
          }, {
            default: B(() => o[3] || (o[3] = [
              c("span", null, "+", -1)
            ])),
            _: 1
          }),
          D(i, {
            onClick: o[2] || (o[2] = (a) => n("-"))
          }, {
            default: B(() => o[4] || (o[4] = [
              c("span", null, "-", -1)
            ])),
            _: 1
          })
        ]),
        _: 1
      });
    };
  }
}, Gse = ["step", "min", "max"], zse = {
  __name: "DaysInput",
  props: {
    days: { default: na, required: !0 },
    daysModifiers: {}
  },
  emits: ["update:days"],
  setup(e) {
    const t = At(e, "days");
    return (n, s) => (g(), E("div", null, [
      L(c("input", {
        class: "form-control form-control-sm",
        type: "number",
        step: C(DN),
        min: C(na),
        max: C(i_),
        "onUpdate:modelValue": s[0] || (s[0] = (o) => t.value = o)
      }, null, 8, Gse), [
        [Ve, t.value]
      ])
    ]));
  }
}, Kse = ["step", "min", "max"], Xse = {
  __name: "DaysRange",
  props: {
    days: { default: na, required: !0 },
    daysModifiers: {}
  },
  emits: ["update:days"],
  setup(e) {
    const t = At(e, "days");
    return (n, s) => (g(), E("div", null, [
      L(c("input", {
        class: "form-range form-range-sm",
        type: "range",
        step: C(DN),
        min: C(na),
        max: C(i_),
        "onUpdate:modelValue": s[0] || (s[0] = (o) => t.value = o)
      }, null, 8, Kse), [
        [Ve, t.value]
      ])
    ]));
  }
}, qse = { class: "d-flex gap-2" }, Jse = { class: "text-muted fst-italic small" }, FN = {
  __name: "OffsetDaysPanel",
  setup(e) {
    const t = $e("settings-store"), n = k({
      get: () => t.days,
      set: (o) => t.days = parseFloat(o)
    }), s = k({
      get: () => t.days_plus_minus,
      set: (o) => t.days_plus_minus = o
    });
    return (o, i) => {
      const r = Ht("tt");
      return g(), E("div", null, [
        c("div", qse, [
          D(Wse, {
            selected: s.value,
            "onUpdate:selected": i[0] || (i[0] = (a) => s.value = a)
          }, null, 8, ["selected"]),
          D(zse, {
            days: n.value,
            "onUpdate:days": i[1] || (i[1] = (a) => n.value = a),
            class: "flex-fill"
          }, null, 8, ["days"])
        ]),
        D(Xse, {
          days: n.value,
          "onUpdate:days": i[2] || (i[2] = (a) => n.value = a)
        }, null, 8, ["days"]),
        L(c("span", Jse, null, 512), [
          [r, {
            min_minutes: C(Jne),
            min_days: C(na),
            max_days: C(i_)
          }, "min_max_days"]
        ])
      ]);
    };
  }
}, Qse = { class: "settings-panels" }, Zse = { class: "settings-row" }, eoe = { class: "fw-bold" }, toe = { class: "settings-row" }, noe = { class: "fw-bold" }, soe = { class: "settings-row" }, ooe = { class: "fw-bold" }, roe = {
  __name: "SettingsPanel",
  setup(e) {
    return (t, n) => {
      const s = Ht("tt");
      return g(), E("div", Qse, [
        c("div", Zse, [
          c("div", null, [
            L(c("span", eoe, null, 512), [
              [s, void 0, "preview_fields_title"]
            ]),
            D(AN)
          ]),
          D(MN)
        ]),
        c("div", toe, [
          c("div", null, [
            L(c("span", noe, null, 512), [
              [s, void 0, "default_day_offset_title"]
            ]),
            D(VN)
          ]),
          D(FN)
        ]),
        c("div", soe, [
          c("div", null, [
            L(c("span", ooe, null, 512), [
              [s, void 0, "adjudication_method_title"]
            ]),
            D(PN)
          ]),
          D(LN)
        ])
      ]);
    };
  }
}, ioe = /* @__PURE__ */ oe(roe, [["__scopeId", "data-v-7da95f72"]]);
class $i {
  constructor(t, n = null) {
    this.name = t, this.children = [];
  }
}
let Cd = class {
  constructor(t, n = null) {
    this.data = t;
  }
};
function aoe(e, t = -1) {
  const n = new $i("", null), s = {};
  let o = 0;
  for (const i in e) {
    if (o++, t >= 0 && o >= t) break;
    const r = e[i], a = r.category && r.category.trim(), l = r.subcategory && r.subcategory.trim();
    if (a) {
      let u = s[a];
      if (u || (u = new $i(a, n), s[a] = u, n.children.push(u)), l) {
        let d = u.children.find(
          (p) => p instanceof $i && p.name === l
        );
        d || (d = new $i(l, u), u.children.push(d));
        const f = new Cd(r, d);
        d.children.push(f);
      } else {
        const d = new Cd(r, u);
        u.children.push(d);
      }
    } else {
      const u = new Cd(r, n);
      n.children.push(u);
    }
  }
  return n;
}
const loe = { class: "fw-regular small fst-italic" }, coe = {
  __name: "MappingProperty",
  props: {
    field: { type: String, default: "" },
    property: { type: String, default: "" }
  },
  setup(e) {
    const t = $e("onElementSelected");
    return (n, s) => (g(), E("span", {
      onClick: s[0] || (s[0] = (o) => C(t)(`${e.field}:${e.property}`)),
      class: "mapping-property"
    }, [
      c("span", loe, "• " + F(e.property), 1)
    ]));
  }
}, uoe = /* @__PURE__ */ oe(coe, [["__scopeId", "data-v-50ad3be8"]]), doe = { class: "mapping-element" }, foe = { class: "fw-regular" }, poe = { class: "ms-2 fst-italic" }, hoe = { key: 0 }, moe = {
  __name: "MappingElement",
  props: {
    category: { type: String, default: "" },
    description: { type: String, default: "" },
    disabled: { type: Boolean, default: !1 },
    disabled_reason: { type: String, default: "" },
    field: { type: String, default: "" },
    identifier: { type: Boolean, default: !1 },
    label: { type: String, default: "" },
    properties: { type: Array, default: () => [] },
    subcategory: { type: String, default: "" },
    temporal: { type: Boolean, default: !1 }
  },
  setup(e) {
    const t = e, n = $e("onElementSelected"), s = $e("isActive"), o = k(() => s ? s(t) : !1), i = $e("registerComponent");
    return vt(() => {
      if (i) {
        const r = cn();
        i(`Element-${t.field}`, r, t);
      }
    }), (r, a) => {
      var l;
      return g(), E("div", doe, [
        c("span", {
          onClick: a[0] || (a[0] = (u) => C(n)(e.field)),
          class: Se([{ active: o.value }, "px-2 d-block mapping-label"])
        }, [
          c("span", foe, "• " + F(e.field), 1),
          c("span", poe, "(" + F(e.description) + ")", 1)
        ], 2),
        ((l = e.properties) == null ? void 0 : l.length) > 0 ? (g(), E("details", hoe, [
          a[1] || (a[1] = c("summary", { class: "small text-muted" }, "Select property...", -1)),
          (g(!0), E(G, null, ge(e.properties, (u) => (g(), se(uoe, {
            key: u,
            field: e.field,
            property: u,
            class: "d-block ms-2"
          }, null, 8, ["field", "property"]))), 128))
        ])) : ne("", !0)
      ]);
    };
  }
}, voe = /* @__PURE__ */ oe(moe, [["__scopeId", "data-v-6ab95af7"]]), goe = { "data-container": "" }, _oe = ["open"], yoe = {
  __name: "SuperMappingContainer",
  props: /* @__PURE__ */ jn({
    // Accepting either a list to be grouped or an instance for recursive rendering
    list: { type: Object, default: null },
    instance: { type: $i, default: null }
  }, {
    open: { type: Boolean, default: !1 },
    openModifiers: {}
  }),
  emits: /* @__PURE__ */ jn(["onSelected"], ["update:open"]),
  setup(e, { emit: t }) {
    const n = I(), s = e, o = At(e, "open"), i = k(() => s.instance ? s.instance : s.list ? aoe(s.list) : new $i("")), r = t, a = $e("onElementSelected", null), l = (d) => {
      a ? a(d) : r("onSelected", d);
    };
    Cn("onElementSelected", l);
    const u = new AbortController();
    return vt(() => {
      s.instance || (o.value = !0), n.value.addEventListener(
        "toggle",
        (d) => {
          o.value = d.target.open;
        },
        { signal: u.signal }
      );
    }), Fo(() => u.abort()), (d, f) => (g(), E("div", goe, [
      c("details", {
        open: o.value,
        ref_key: "detailsRef",
        ref: n
      }, [
        c("summary", null, [
          c("span", null, F(i.value.name), 1)
        ]),
        o.value ? (g(!0), E(G, { key: 0 }, ge(i.value.children, (p, h) => (g(), E(G, { key: h }, [
          p instanceof C($i) ? (g(), se(UN, {
            key: 0,
            instance: p,
            class: "px-2"
          }, null, 8, ["instance"])) : p instanceof C(Cd) ? (g(), se(voe, bn({
            key: 1,
            ref_for: !0
          }, { ...p.data }, {
            onClick: (m) => l(p)
          }), null, 16, ["onClick"])) : ne("", !0)
        ], 64))), 128)) : ne("", !0)
      ], 8, _oe)
    ]));
  }
}, UN = /* @__PURE__ */ oe(yoe, [["__scopeId", "data-v-d7de867c"]]);
function boe(e, t, n, { limit: s = 50 }) {
  const o = Ra(n), i = k(() => {
    try {
      if (typeof t != "function") return e;
      const d = new RegExp(o.value, "i");
      let f = 0, p = Array.isArray(e) ? [] : {};
      if (Array.isArray(e))
        for (const h of e) {
          if (s >= 0 && f >= s) break;
          t(h, d) && (p.push(h), f++);
        }
      else if (typeof e == "object")
        for (const [h, m] of Object.entries(e)) {
          if (s >= 0 && f >= s) break;
          t(m, d, h) && (p[h] = m, f++);
        }
      return p;
    } catch {
      return e;
    }
  }), r = (d) => Array.isArray(d) ? d.length : typeof d == "object" ? Object.keys(d).length : 0, a = k(() => r(i.value));
  k(() => r(e));
  const l = k(() => a.value === 0), u = k(() => s < 0 ? !1 : a.value > s);
  return { query: o, filteredList: i, isEmpty: l, hasMore: u };
}
const jN = {
  __name: "RenderlessFilter",
  props: /* @__PURE__ */ jn({
    limit: { type: Number, default: -1 },
    filterCallback: { type: Function, default: null },
    list: { type: [Object, Array], default: () => [] }
  }, {
    query: { type: String, default: "" },
    queryModifiers: {}
  }),
  emits: ["update:query"],
  setup(e, { expose: t }) {
    const n = e, s = At(e, "query"), { filteredList: o, isEmpty: i, hasMore: r } = boe(
      n.list,
      n.filterCallback,
      s,
      { limit: n.limit }
    );
    return t({ query: s, filteredList: o, isEmpty: i, hasMore: r }), (a, l) => fe(a.$slots, "default", {
      filteredList: C(o),
      query: s.value,
      isEmpty: C(i),
      hasMore: C(r)
    });
  }
}, Eoe = {}, woe = { class: "fst-italic" };
function Soe(e, t) {
  return g(), E("span", woe, "nothing selected");
}
const Ip = /* @__PURE__ */ oe(Eoe, [["render", Soe]]), xoe = {
  key: 0,
  "data-prevent-close": "",
  class: "px-2 results-wrapper"
}, Noe = { class: "results" }, Coe = {
  key: 0,
  class: "d-block p-2 fst-italic"
}, Ooe = {
  key: 0,
  class: "px-2 fst-italic text-muted"
}, Toe = {
  __name: "ListFilter",
  props: {
    limit: { type: Number, default: 50 },
    filterCallback: { type: Function, default: null },
    list: { type: [Object, Array], default: null }
  },
  setup(e, { expose: t }) {
    const n = I(), s = I(), o = I("");
    return t({ close: () => {
      n.value.close();
    } }), (r, a) => {
      const l = le("b-dropdown");
      return g(), se(l, {
        ref_key: "dropdownRef",
        ref: n,
        variant: "outline-secondary",
        size: "sm"
      }, {
        button: B(() => [
          fe(r.$slots, "header", {}, () => [
            D(Ip)
          ], !0)
        ]),
        default: B(({ show: u }) => [
          D(jN, {
            query: o.value,
            "onUpdate:query": a[1] || (a[1] = (d) => o.value = d),
            ref_key: "renderlessRef",
            ref: s,
            limit: e.limit,
            list: e.list,
            filterCallback: e.filterCallback
          }, {
            default: B(({ filteredList: d, isEmpty: f, hasMore: p }) => [
              u.value ? (g(), E("div", xoe, [
                L(c("input", {
                  class: "form-control form-control-sm",
                  "onUpdate:modelValue": a[0] || (a[0] = (h) => o.value = h),
                  placeholder: "Filter...",
                  type: "search"
                }, null, 512), [
                  [Ve, o.value]
                ]),
                c("div", Noe, [
                  f ? (g(), E("span", Coe, "No data")) : ne("", !0),
                  fe(r.$slots, "default", { filteredList: d }, void 0, !0)
                ]),
                p ? (g(), E("span", Ooe, "Refine your search for more results...")) : ne("", !0)
              ])) : ne("", !0)
            ]),
            _: 2
          }, 1032, ["query", "limit", "list", "filterCallback"])
        ]),
        _: 3
      }, 512);
    };
  }
}, $oe = /* @__PURE__ */ oe(Toe, [["__scopeId", "data-v-6623cf79"]]), koe = { class: "fhir-fields" }, Doe = {
  key: 0,
  class: "d-inline-block text-start"
}, Roe = { class: "d-block" }, Ioe = { class: "d-block fw-bold" }, Aoe = {
  key: 0,
  class: "d-block text-muted fst-italic"
}, Moe = {
  key: 0,
  class: "alert alert-warning d-block mt-2 small"
}, Poe = {
  __name: "FhirField",
  setup(e) {
    const t = I(), n = $e("local-mapping-service"), s = $e("app-store"), { external_source_field_name: o } = he(n.value.field), { externalSourceFieldData: i } = he(n.value), { fhir_fields: r } = he(s.settings);
    s.settings;
    const a = k(() => Object.values(r.value ?? {}).filter(
      (m) => !m.identifier
    )), l = k(() => {
      var v;
      const { disabled: h, disabled_reason: m } = u((v = i.value) == null ? void 0 : v.mapping_id);
      if (h)
        return m;
    }), u = (h) => {
      var b;
      let m, v;
      const _ = ((b = r.value) == null ? void 0 : b[h]) ?? {};
      return m = (_ == null ? void 0 : _.disabled) ?? !1, m && (v = (_ == null ? void 0 : _.disabled_reason) ?? "disabled"), { disabled: m, disabled_reason: v };
    };
    function d(h) {
      o.value = h, t.value.close();
    }
    const f = (h, m) => h.field.match(m) || h.category.match(m) || h.subcategory.match(m) || h.label.match(m) || h.description.match(m);
    return Cn("registerComponent", (h, m, v) => {
      var w;
      const { disabled: _, disabled_reason: b } = u(v == null ? void 0 : v.field);
      if (_) {
        const y = (w = m == null ? void 0 : m.proxy) == null ? void 0 : w.$el;
        y.childNodes.forEach((N) => {
          N != null && N.style && (N.style.textDecoration = "line-through");
        });
        const x = document.createElement("span");
        x.classList.add("alert", "alert-warning", "mt-2"), x.style.display = "block", x.style.fontStyle = "italic", x.innerHTML = b, y.appendChild(x);
      }
    }), Cn("isActive", (h) => i.value.mapping_id === h.field), (h, m) => (g(), E("div", koe, [
      D($oe, {
        ref_key: "filterRef",
        ref: t,
        list: a.value,
        limit: -1,
        filterCallback: f
      }, {
        header: B(() => [
          C(i).mapping_id ? (g(), E("div", Doe, [
            c("span", Roe, F(C(i).label), 1),
            c("span", Ioe, F(C(i).mapping_id), 1),
            C(i).description ? (g(), E("span", Aoe, "(" + F(C(i).description) + ")", 1)) : ne("", !0)
          ])) : ne("", !0)
        ]),
        default: B(({ filteredList: v }) => [
          D(UN, {
            list: v,
            onOnSelected: d
          }, null, 8, ["list"])
        ]),
        _: 1
      }, 8, ["list"]),
      l.value ? (g(), E("span", Moe, [
        c("small", null, F(l.value), 1)
      ])) : ne("", !0)
    ]));
  }
}, Loe = /* @__PURE__ */ oe(Poe, [["__scopeId", "data-v-f2206647"]]), Voe = {
  key: 0,
  class: "d-inline-block text-start button-label"
}, Foe = { class: "d-block" }, Uoe = { class: "d-block fw-bold" }, joe = { class: "d-block fst-italic" }, Boe = {
  class: "p-2",
  "data-prevent-close": ""
}, Hoe = { class: "results" }, Yoe = { class: "fw-bold" }, Woe = { class: "d-block" }, Goe = { class: "d-block text-muted fst-italic" }, zoe = {
  key: 0,
  "data-prevent-close": "",
  class: "px-2"
}, Koe = {
  __name: "FieldsDropdown",
  props: /* @__PURE__ */ jn({
    label: { type: String, default: "" },
    form: { type: String, default: "" },
    eventFields: { type: Object, default: () => ({}) }
  }, {
    field_name: { type: String, default: "" },
    field_nameModifiers: {}
  }),
  emits: ["update:field_name"],
  setup(e) {
    const t = e, n = I([]), s = (d, f) => n.value[d] = f, o = k(() => n.value.every((d) => d));
    nt(
      () => t.eventFields,
      (d) => {
        n.value = new Array(d.length).fill(!1);
      },
      { immediate: !0 }
    );
    const i = At(e, "field_name");
    function r(d) {
      i.value = d, l.value = "";
    }
    function a() {
    }
    const l = I("");
    function u(d, f, p) {
      return d.match(f) || p.match(f);
    }
    return (d, f) => {
      const p = le("b-dropdown-item"), h = le("b-dropdown-header"), m = le("b-dropdown");
      return g(), se(m, {
        class: "fields-dropdown",
        variant: "outline-secondary",
        size: "sm",
        onClose: a
      }, {
        button: B(() => [
          i.value ? (g(), E("span", Voe, [
            c("span", Foe, F(e.label), 1),
            c("span", Uoe, F(i.value), 1),
            c("span", joe, "(" + F(e.form) + ")", 1)
          ])) : (g(), se(Ip, { key: 1 }))
        ]),
        default: B(() => [
          c("div", null, [
            c("div", Boe, [
              L(c("input", {
                class: "form-control form-control-sm",
                "onUpdate:modelValue": f[0] || (f[0] = (v) => l.value = v),
                placeholder: "Filter...",
                type: "search"
              }, null, 512), [
                [Ve, l.value]
              ])
            ]),
            c("div", Hoe, [
              D(p, {
                active: !i.value,
                onClick: f[1] || (f[1] = (v) => r(null))
              }, {
                default: B(() => f[3] || (f[3] = [
                  te("-- none --")
                ])),
                _: 1
              }, 8, ["active"]),
              (g(!0), E(G, null, ge(e.eventFields, (v, _, b) => (g(), se(jN, {
                key: _,
                query: l.value,
                "onUpdate:query": f[2] || (f[2] = (w) => l.value = w),
                limit: 50,
                list: v.fields,
                filterCallback: u
              }, {
                default: B(({ filteredList: w, isEmpty: y, hasMore: x }) => [
                  c("template", null, [
                    te(F(s(b, y)), 1)
                  ]),
                  y ? ne("", !0) : (g(), E(G, { key: 0 }, [
                    D(h, { class: "bg-light" }, {
                      default: B(() => [
                        c("span", Yoe, F(_), 1)
                      ]),
                      _: 2
                    }, 1024),
                    (g(!0), E(G, null, ge(w, (N, S) => (g(), se(p, {
                      key: `field-${S}`,
                      active: S === i.value,
                      onClick: (O) => r(S)
                    }, {
                      default: B(() => [
                        c("span", Woe, F(N), 1),
                        c("span", Goe, F(S), 1)
                      ]),
                      _: 2
                    }, 1032, ["active", "onClick"]))), 128))
                  ], 64)),
                  x ? (g(), E(G, { key: 1 }, [
                    te("...")
                  ], 64)) : ne("", !0)
                ]),
                _: 2
              }, 1032, ["query", "list"]))), 128)),
              o.value ? (g(), E("div", zoe, f[4] || (f[4] = [
                c("span", { class: "fst-italic text-muted" }, "No results...", -1)
              ]))) : ne("", !0)
            ])
          ])
        ]),
        _: 1
      });
    };
  }
}, BN = /* @__PURE__ */ oe(Koe, [["__scopeId", "data-v-dc4e0640"]]), Xoe = {
  __name: "TemporalField",
  setup(e) {
    const t = $e("local-mapping-service"), { temporalFieldData: n, eventFieldsTemporal: s } = he(t.value), { temporal_field: o } = he(t.value.field);
    return (i, r) => (g(), se(BN, {
      field_name: C(o),
      "onUpdate:field_name": r[0] || (r[0] = (a) => ut(o) ? o.value = a : null),
      label: C(n).label,
      form: C(n).form,
      eventFields: C(s)
    }, null, 8, ["field_name", "label", "form", "eventFields"]));
  }
}, qoe = { class: "button-label" }, Joe = { key: 0 }, Qoe = { key: 1 }, Zoe = { class: "results" }, ere = {
  class: "p-2 bg-light",
  "data-prevent-close": ""
}, tre = {
  __name: "EventDropdown",
  setup(e) {
    const t = $e("app-store"), { events: n, arms: s } = he(t.settings.project), o = $e("local-mapping-service"), { event_id: i } = he(o.value.field), r = (u) => {
      var d;
      return ((d = n.value) == null ? void 0 : d[u]) ?? {};
    }, a = k(() => r(i.value));
    function l(u) {
      i.value = u;
    }
    return (u, d) => {
      const f = le("b-dropdown-item"), p = le("b-dropdown-divider"), h = le("b-dropdown");
      return g(), se(h, {
        variant: "outline-secondary",
        size: "sm",
        class: "events-dropdown"
      }, {
        button: B(() => [
          c("div", qoe, [
            a.value.name_ext ? (g(), E("span", Joe, F(`${a.value.name_ext}`), 1)) : (g(), E("span", Qoe, [
              D(Ip)
            ]))
          ])
        ]),
        default: B(() => [
          c("div", Zoe, [
            (g(!0), E(G, null, ge(C(s), (m, v) => (g(), E(G, {
              key: `arm-${m.id}`
            }, [
              c("div", ere, " Arm " + F(v) + ": " + F(m.name), 1),
              D(f, {
                active: !C(i),
                onClick: d[0] || (d[0] = (_) => l(null))
              }, {
                default: B(() => d[1] || (d[1] = [
                  c("span", null, "-- none --", -1)
                ])),
                _: 1
              }, 8, ["active"]),
              (g(!0), E(G, null, ge(m.events, (_, b) => (g(), se(f, {
                key: `event-${b}`,
                class: "d-block",
                onClick: (w) => l(b),
                active: b === C(i)
              }, {
                default: B(() => {
                  var w;
                  return [
                    te(F((w = r(b)) == null ? void 0 : w.name_ext), 1)
                  ];
                }),
                _: 2
              }, 1032, ["onClick", "active"]))), 128)),
              D(p)
            ], 64))), 128))
          ])
        ]),
        _: 1
      });
    };
  }
}, HN = /* @__PURE__ */ oe(tre, [["__scopeId", "data-v-dd3b7830"]]), YN = {
  __name: "REDCapField",
  setup(e) {
    const t = $e("local-mapping-service"), { field_name: n } = he(t.value.field), { redcapFieldData: s, eventFields: o } = he(t.value);
    return (i, r) => (g(), se(BN, {
      field_name: C(n),
      "onUpdate:field_name": r[0] || (r[0] = (a) => ut(n) ? n.value = a : null),
      label: C(s).label,
      form: C(s).form,
      eventFields: C(o)
    }, null, 8, ["field_name", "label", "form", "eventFields"]));
  }
}, i1 = Object.freeze({
  MIN: { value: "MIN", label: "Lowest numerical value" },
  MAX: { value: "MAX", label: "Highest numerical value" },
  FIRST: { value: "FIRST", label: "Earliest value (based on timestamp)" },
  LAST: { value: "LAST", label: "Latest value (based on timestamp)" },
  NEAR: { value: "NEAR", label: "Nearest value (based on timestamp)" }
}), nre = { key: 0 }, sre = {
  __name: "PreselectStrategyDropdown",
  setup(e) {
    const t = $e("local-mapping-service"), { preselect: n } = he(t.value.field), s = k(() => {
      for (const [i, r] of Object.entries(i1))
        if (r.value === n.value) return r.label;
      return null;
    });
    function o(i) {
      n.value = i;
    }
    return (i, r) => {
      const a = le("b-dropdown-item"), l = le("b-dropdown");
      return g(), se(l, {
        variant: "outline-secondary",
        size: "sm"
      }, {
        button: B(() => [
          s.value ? (g(), E("span", nre, F(s.value), 1)) : (g(), se(Ip, { key: 1 }))
        ]),
        default: B(() => [
          D(a, {
            active: !C(n),
            onClick: r[0] || (r[0] = (u) => o(i.strategy))
          }, {
            default: B(() => r[1] || (r[1] = [
              c("span", null, "-- none --", -1)
            ])),
            _: 1
          }, 8, ["active"]),
          (g(!0), E(G, null, ge(C(i1), (u, d) => (g(), se(a, {
            key: d,
            active: u.value === C(n),
            onClick: (f) => o(u.value)
          }, {
            default: B(() => [
              te(F(u.label), 1)
            ]),
            _: 2
          }, 1032, ["active", "onClick"]))), 128))
        ]),
        _: 1
      });
    };
  }
}, ore = { class: "status-indicator d-flex gap-2" }, rre = { key: 0 }, ire = { key: 0 }, are = { key: 1 }, lre = { key: 2 }, cre = { class: "d-flex flex-column gap-2" }, ure = { style: { "vertical-align": "middle" } }, dre = { class: "p-2" }, fre = { class: "action-buttons d-flex gap-2" }, pre = {
  __name: "MappingRow",
  props: {
    store: { type: Object, default: () => ({}) },
    index: { type: Number }
  },
  setup(e) {
    const t = e, n = I(), { store: s, index: o } = he(t), i = $e("mapping-service");
    Cn("local-mapping-service", s);
    const { isNew: r, isDirty: a, isDeleted: l, isDuplicate: u, isTemporal: d, field: f } = he(
      s.value
    );
    function p() {
      i.removeEntry(f.value);
    }
    function h() {
      i.restoreEntry(f.value);
    }
    function m() {
      i.duplicateEntry(f.value, o.value);
    }
    const v = () => {
      if (vF(n.value) || !r.value) return;
      const b = 40, w = n.value.getBoundingClientRect().top, y = window.scrollY + w - b;
      window.scrollTo({
        top: y,
        behavior: "smooth"
      });
    };
    return vt(() => v()), (_, b) => {
      const w = Ht("mytooltip");
      return g(), E("tr", {
        ref_key: "rowRef",
        ref: n,
        class: Se(["mapping-row", { dirty: C(a), deleted: C(l) }])
      }, [
        c("td", null, [
          c("div", ore, [
            C(l) ? L((g(), E("div", rre, b[0] || (b[0] = [
              c("i", { class: "fas fa-trash fa-fw" }, null, -1)
            ]))), [
              [w, "deleted entry", "left"]
            ]) : (g(), E(G, { key: 1 }, [
              C(u) ? L((g(), E("div", ire, b[1] || (b[1] = [
                c("i", { class: "fas fa-copy fa-fw text-danger" }, null, -1)
              ]))), [
                [w, "this is a duplicate entry", "left"]
              ]) : ne("", !0),
              C(a) ? L((g(), E("div", are, b[2] || (b[2] = [
                c("i", { class: "fas fa-edit fa-fw" }, null, -1)
              ]))), [
                [w, "modified entry", "left"]
              ]) : ne("", !0),
              C(r) ? L((g(), E("div", lre, b[3] || (b[3] = [
                c("i", { class: "fas fa-circle-plus fa-fw" }, null, -1)
              ]))), [
                [w, "new entry", "left"]
              ]) : ne("", !0)
            ], 64))
          ]),
          D(Loe)
        ]),
        c("td", null, [
          c("div", cre, [
            D(HN),
            D(YN)
          ])
        ]),
        c("td", null, [
          L(D(Xoe, {
            disabled: !C(d)
          }, null, 8, ["disabled"]), [
            [Gi, C(d)]
          ])
        ]),
        c("td", null, [
          L(D(sre, {
            disabled: !C(d)
          }, null, 8, ["disabled"]), [
            [Gi, C(d)]
          ])
        ]),
        c("td", ure, [
          c("div", dre, [
            c("div", fre, [
              C(l) ? L((g(), E("button", {
                key: 0,
                type: "button",
                class: "btn btn-outline-success btn-xs",
                onClick: h
              }, b[4] || (b[4] = [
                c("i", { class: "fas fa-refresh fa-fw" }, null, -1)
              ]))), [
                [w, "restore entry", "left"]
              ]) : (g(), E(G, { key: 1 }, [
                L((g(), E("button", {
                  type: "button",
                  class: "btn btn-outline-danger btn-xs",
                  onClick: p
                }, b[5] || (b[5] = [
                  c("i", { class: "fas fa-trash fa-fw" }, null, -1)
                ]))), [
                  [w, "remove entry", "left"]
                ]),
                L((g(), E("button", {
                  type: "button",
                  class: "btn btn-outline-secondary btn-xs",
                  onClick: m
                }, b[6] || (b[6] = [
                  c("i", { class: "fas fa-copy fa-fw" }, null, -1)
                ]))), [
                  [w, "duplicate entry", "left"]
                ])
              ], 64))
            ])
          ])
        ])
      ], 2);
    };
  }
}, hre = /* @__PURE__ */ oe(pre, [["__scopeId", "data-v-1f453bb2"]]), mre = { class: "d-flex gap-2 align-items-center" }, vre = { class: "fw-bold" }, gre = { class: "ms-auto d-flex gap-2" }, _re = {
  class: "btn-group ms-auto",
  role: "group",
  "aria-label": "Basic example"
}, yre = { class: "d-none" }, bre = { class: "py-2 fw-medium" }, Ere = { class: "d-flex flex-column justify-content-center align-items-center text-center" }, wre = { class: "text-muted fst-italic" }, Sre = ["href"], xre = {
  __name: "MappingButtons",
  setup(e) {
    const t = $e("mapping-service"), n = I(), s = I(), o = I();
    async function i(u) {
      const d = u.target.files, f = d == null ? void 0 : d[0];
      f && (await t.importMappings(f), u.target.value = "");
    }
    const r = () => t.createEntry(), a = async () => {
      o.value = null;
      const u = await t.exportMappings();
      o.value = u, o.value && n.value.show();
    }, l = () => s.value.click();
    return (u, d) => {
      const f = le("b-dialog"), p = Ht("tt");
      return g(), E(G, null, [
        c("div", mre, [
          L(c("span", vre, null, 512), [
            [p, void 0, "mapping_table_title"]
          ]),
          c("div", gre, [
            c("div", _re, [
              c("button", {
                type: "button",
                class: "btn btn-sm btn-outline-secondary",
                onClick: a
              }, [
                d[1] || (d[1] = c("i", { class: "fas fa-download fa-fw me-1" }, null, -1)),
                L((g(), E("span", null, d[0] || (d[0] = [
                  te("export")
                ]))), [
                  [p, void 0, "export"]
                ])
              ]),
              c("button", {
                type: "button",
                class: "btn btn-sm btn-outline-secondary",
                onClick: l
              }, [
                d[3] || (d[3] = c("i", { class: "fas fa-upload fa-fw me-1" }, null, -1)),
                L((g(), E("span", null, d[2] || (d[2] = [
                  te("import")
                ]))), [
                  [p, void 0, "import"]
                ])
              ])
            ]),
            c("button", {
              type: "button",
              class: "btn btn-sm btn-success",
              onClick: r
            }, [
              d[5] || (d[5] = c("i", { class: "fas fa-list fa-fw me-1" }, null, -1)),
              L((g(), E("span", null, d[4] || (d[4] = [
                te("Add new entry")
              ]))), [
                [p, void 0, "find_more_sources_fields_to_map"]
              ])
            ])
          ])
        ]),
        c("div", yre, [
          c("input", {
            type: "file",
            ref_key: "uploadRef",
            ref: s,
            onChange: i
          }, null, 544)
        ]),
        (g(), se(ns, { to: "body" }, [
          D(f, {
            ref_key: "modalRef",
            ref: n,
            "ok-only": "",
            "text-ok": "Close"
          }, {
            title: B(() => [
              L((g(), E("span", bre, d[6] || (d[6] = [
                te("Mapping Export")
              ]))), [
                [p, void 0, "mappings_export_title"]
              ])
            ]),
            default: B(() => [
              c("div", Ere, [
                L((g(), E("span", null, d[7] || (d[7] = [
                  te("Your data is ready to be downloaded")
                ]))), [
                  [p, void 0, "mappings_export_description"]
                ]),
                L((g(), E("span", wre, d[8] || (d[8] = [
                  te("record ID and other mapped fields")
                ]))), [
                  [p, void 0, "mappings_export_note"]
                ]),
                c("a", {
                  href: o.value,
                  target: "_blank",
                  class: "d-flex btn btn-outline-secondary flex-column justify-content-center align-items-center"
                }, [
                  d[10] || (d[10] = c("i", { class: "fas fa-file-csv fa-fw fa-5x" }, null, -1)),
                  L((g(), E("span", null, d[9] || (d[9] = [
                    te("download")
                  ]))), [
                    [p, void 0, "mappings_export_download_link"]
                  ])
                ], 8, Sre)
              ])
            ]),
            _: 1
          }, 512)
        ]))
      ], 64);
    };
  }
}, Nre = {
  __name: "UniqueLabelProvider",
  props: {
    label: { type: String, required: !0 },
    index: { type: Number, required: !0 },
    labels: { type: Array, required: !0 }
  },
  setup(e) {
    const t = e, n = k(() => {
      if (t.index === 0)
        return !0;
      const s = t.labels[t.index - 1];
      return t.label !== s;
    });
    return (s, o) => fe(s.$slots, "default", {
      text: n.value ? e.label : null
    });
  }
}, Cre = {
  key: 0,
  class: "px-2 fw-bold"
}, Ore = {
  colspan: "6",
  style: { "background-color": "var(--bs-gray-400)" }
}, Tre = {
  __name: "CategoryHeader",
  props: {
    text: { type: String }
  },
  setup(e) {
    return (t, n) => e.text ? (g(), E("tr", Cre, [
      c("td", Ore, [
        c("span", null, F(e.text), 1)
      ])
    ])) : ne("", !0);
  }
}, $re = { class: "sticky-top bg-light buttons-wrapper border-top border-start border-end p-2" }, kre = { class: "table-wrapper" }, Dre = { class: "table table-sm table-bordered table-hover mb-2" }, Rre = {
  __name: "MappingTable",
  setup(e) {
    const t = $e("mapping-service"), { stores: n } = he(t), s = (i) => {
      var a, l, u, d;
      const r = ((l = (a = i == null ? void 0 : i.externalSourceFieldData) == null ? void 0 : a.metadata) == null ? void 0 : l.category) ?? "";
      return (d = (u = i == null ? void 0 : i.externalSourceFieldData) == null ? void 0 : u.metadata) == null || d.subcategory, `${r}`;
    }, o = (i) => i.map((r) => s(r));
    return (i, r) => {
      const a = Ht("tt");
      return g(), E("div", null, [
        c("div", $re, [
          D(xre)
        ]),
        c("div", kre, [
          c("table", Dre, [
            c("thead", null, [
              c("tr", null, [
                L(c("th", null, null, 512), [
                  [a, void 0, "mapping_table_header_external_source"]
                ]),
                c("th", null, [
                  L(c("span", null, null, 512), [
                    [a, void 0, "mapping_table_header_event"]
                  ]),
                  r[0] || (r[0] = c("span", null, "/", -1)),
                  L(c("span", null, null, 512), [
                    [a, void 0, "mapping_table_header_field"]
                  ])
                ]),
                L(c("th", null, null, 512), [
                  [a, void 0, "mapping_table_header_date"]
                ]),
                L(c("th", null, null, 512), [
                  [a, void 0, "mapping_table_header_preselect_strategy"]
                ]),
                L(c("th", null, null, 512), [
                  [a, void 0, "mapping_table_header_actions"]
                ])
              ])
            ]),
            c("tbody", null, [
              (g(!0), E(G, null, ge(C(n), (l, u) => (g(), E(G, {
                key: l._id
              }, [
                D(Nre, {
                  label: s(l),
                  index: u,
                  labels: o(C(n))
                }, {
                  default: B(({ text: d }) => [
                    D(Tre, { text: d }, null, 8, ["text"])
                  ]),
                  _: 2
                }, 1032, ["label", "index", "labels"]),
                D(hre, {
                  store: l,
                  index: u
                }, null, 8, ["store", "index"])
              ], 64))), 128))
            ])
          ])
        ])
      ]);
    };
  }
}, WN = /* @__PURE__ */ oe(Rre, [["__scopeId", "data-v-0423b767"]]), Ire = { class: "record-identifier-panel" }, Are = { class: "p-2" }, Mre = { class: "fw-bold" }, Pre = { class: "d-block text-muted fst-italic mt-2" }, Lre = { class: "p-2 record-identifier-settings" }, Vre = {
  class: "fw-bold",
  for: "record-identifier-event"
}, Fre = {
  class: "fw-bold",
  for: "record-identifier-field"
}, Ure = {
  __name: "RecordIdentifierPanel",
  setup(e) {
    const t = $e("mapping-service"), n = k(() => t.recordIdentifierStore);
    return Cn("local-mapping-service", n), nt(
      () => n.value.field,
      () => {
        console.log(n.value.field);
      },
      { deep: !0 }
    ), (s, o) => {
      const i = Ht("tt");
      return g(), E("div", Ire, [
        c("div", Are, [
          L((g(), E("span", Mre, o[0] || (o[0] = [
            te("Record Identifier Field (Required):")
          ]))), [
            [i, void 0, "record_identifier_section_title"]
          ]),
          c("div", null, [
            L(c("span", null, null, 512), [
              [i, void 0, "record_identifier_description"]
            ]),
            c("small", Pre, [
              L((g(), E("span", null, o[1] || (o[1] = [
                te("Adjudication note")
              ]))), [
                [i, void 0, "record_identifier_note"]
              ])
            ])
          ])
        ]),
        c("div", Lre, [
          c("div", null, [
            L(c("label", Vre, null, 512), [
              [i, void 0, "record_identifier_redcap_event_label"]
            ]),
            D(HN)
          ]),
          c("div", null, [
            L(c("label", Fre, null, 512), [
              [i, void 0, "record_identifier_redcap_field_label"]
            ]),
            D(YN)
          ])
        ])
      ]);
    };
  }
}, GN = /* @__PURE__ */ oe(Ure, [["__scopeId", "data-v-c070b5b4"]]), jre = { class: "my-2 rounded border" }, Bre = {
  __name: "MappingPanel",
  setup(e) {
    return (t, n) => (g(), E(G, null, [
      c("div", jre, [
        D(GN)
      ]),
      D(WN)
    ], 64));
  }
}, Hre = { class: "d-flex justify-content-end gap-2" }, Yre = ["disabled"], Wre = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw me-1"
}, Gre = {
  key: 1,
  class: "fas fa-save fa-fw me-2"
}, zre = ["disabled"], Kre = ["disabled"], a_ = {
  __name: "UnsavedChangesGuard",
  props: {
    checkFn: { type: Function },
    saveFn: { type: Function },
    discardFn: { type: Function }
  },
  setup(e) {
    const t = e, n = I(!1), s = I();
    tP(async (a, l) => t.checkFn() ? await s.value.show() : !0);
    async function o() {
      try {
        return n.value = !0, await t.saveFn(), s.value.hide(!0);
      } finally {
        n.value = !1;
      }
    }
    async function i() {
      return await t.discardFn(), s.value.hide(!0);
    }
    function r() {
      return s.value.hide(!1);
    }
    return (a, l) => {
      const u = le("b-modal"), d = Ht("tt");
      return g(), se(u, {
        ref_key: "confirmDialogRef",
        ref: s
      }, {
        title: B(() => [
          L(c("span", null, null, 512), [
            [d, void 0, "unsaved_changes_warning_title"]
          ])
        ]),
        footer: B(() => [
          c("div", Hre, [
            c("button", {
              type: "button",
              class: "btn btn-primary btn-sm",
              onClick: o,
              disabled: n.value
            }, [
              n.value ? (g(), E("i", Wre)) : (g(), E("i", Gre)),
              L(c("span", null, null, 512), [
                [d, void 0, "unsaved_changes_warning_save_button"]
              ])
            ], 8, Yre),
            c("button", {
              type: "button",
              class: "btn btn-danger btn-sm",
              onClick: i,
              disabled: n.value
            }, [
              l[0] || (l[0] = c("i", { class: "fas fa-trash fa-fw me-2" }, null, -1)),
              L(c("span", null, null, 512), [
                [d, void 0, "unsaved_changes_warning_discard_button"]
              ])
            ], 8, zre),
            c("button", {
              type: "button",
              class: "btn btn-secondary btn-sm",
              onClick: r,
              disabled: n.value
            }, [
              l[1] || (l[1] = c("i", { class: "fas fa-times-circle fa-fw me-2" }, null, -1)),
              L(c("span", null, null, 512), [
                [d, void 0, "unsaved_changes_warning_cancel_button"]
              ])
            ], 8, Kre)
          ])
        ]),
        default: B(() => [
          c("div", null, [
            L(c("span", null, null, 512), [
              [d, void 0, "unsaved_changes_warning_description"]
            ])
          ])
        ]),
        _: 1
      }, 512);
    };
  }
}, Xre = { open: "" }, qre = { open: "" }, Jre = { class: "sticky-bottom bg-white p-2 border-top" }, Qre = { class: "d-flex gap-2 justify-content-end" }, Zre = ["disabled"], eie = ["disabled"], tie = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw me-1"
}, nie = {
  key: 1,
  class: "fas fa-save fa-fw me-1"
}, sie = {
  __name: "HomePage",
  setup(e) {
    const t = an(), n = $e("settings-manager-service"), s = $e("mapping-service"), { isDirty: o, loading: i } = he(s), { isDirty: r, loading: a } = he(
      n
    ), l = k(() => i.value || a.value), u = k(() => o.value || r.value), d = async () => {
      const b = await n.save(), w = await s.save();
      b && w && (await n.getSettings(), t.toast({ title: "Success", body: "Data saved" }));
    }, f = () => {
      s.reset(), n.reset();
    }, p = d, h = () => u.value, m = () => d(), v = () => f(), _ = f;
    return (b, w) => (g(), E(G, null, [
      c("details", Xre, [
        w[2] || (w[2] = c("summary", null, [
          c("span", { class: "fw-bold" }, "Settings")
        ], -1)),
        D(ioe, { class: "my-2" })
      ]),
      c("details", qre, [
        w[3] || (w[3] = c("summary", null, [
          c("span", { class: "fw-bold" }, "Mappings")
        ], -1)),
        D(Bre)
      ]),
      c("div", Jre, [
        c("div", Qre, [
          c("button", {
            class: "btn btn-sm btn-outline-secondary",
            onClick: w[0] || (w[0] = (...y) => C(_) && C(_)(...y)),
            disabled: !u.value || l.value
          }, w[4] || (w[4] = [
            c("i", { class: "fas fa-refresh fa-fw me-1" }, null, -1),
            c("span", null, "Reset", -1)
          ]), 8, Zre),
          c("button", {
            class: "btn btn-sm btn-primary",
            type: "button",
            disabled: !u.value || l.value,
            onClick: w[1] || (w[1] = (...y) => C(p) && C(p)(...y))
          }, [
            l.value ? (g(), E("i", tie)) : (g(), E("i", nie)),
            w[5] || (w[5] = c("span", null, "Save", -1))
          ], 8, eie)
        ])
      ]),
      D(a_, {
        checkFn: h,
        saveFn: m,
        discardFn: v
      })
    ], 64));
  }
}, oie = /* @__PURE__ */ oe(sie, [["__scopeId", "data-v-8e463a15"]]), rie = { class: "settings-panels" }, iie = { class: "settings-row" }, aie = { class: "fw-bold" }, lie = { class: "settings-row" }, cie = { class: "fw-bold" }, uie = { class: "settings-row" }, die = { class: "fw-bold" }, fie = { class: "d-flex gap-2 justify-content-end mt-2" }, pie = ["disabled"], hie = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw me-1"
}, mie = {
  key: 1,
  class: "fas fa-refresh fa-fw me-1"
}, vie = ["disabled"], gie = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw me-1"
}, _ie = {
  key: 1,
  class: "fas fa-save fa-fw me-1"
}, yie = {
  __name: "SettingsPage",
  setup(e) {
    const t = $e("settings-manager-service"), n = k(() => t.isDirty), s = k(() => t.loading), o = () => {
      t.reset();
    }, i = async () => {
      await t.save() && await t.getSettings();
    }, r = i, a = () => n.value, l = i, u = () => t.reset();
    return (d, f) => {
      const p = Ht("tt");
      return g(), E("div", null, [
        c("div", rie, [
          c("div", iie, [
            c("div", null, [
              L(c("span", aie, null, 512), [
                [p, void 0, "preview_fields_title"]
              ]),
              D(AN)
            ]),
            D(MN)
          ]),
          c("div", lie, [
            c("div", null, [
              L(c("span", cie, null, 512), [
                [p, void 0, "default_day_offset_title"]
              ]),
              D(VN)
            ]),
            D(FN)
          ]),
          c("div", uie, [
            c("div", null, [
              L(c("span", die, null, 512), [
                [p, void 0, "adjudication_method_title"]
              ]),
              D(PN)
            ]),
            D(LN)
          ])
        ]),
        c("div", fie, [
          c("button", {
            class: "btn btn-sm btn-outline-secondary",
            onClick: o,
            disabled: s.value || !n.value
          }, [
            s.value ? (g(), E("i", hie)) : (g(), E("i", mie)),
            f[1] || (f[1] = c("span", null, "Reset", -1))
          ], 8, pie),
          c("button", {
            class: "btn btn-sm btn-primary",
            type: "button",
            disabled: s.value || !n.value,
            onClick: f[0] || (f[0] = (...h) => C(r) && C(r)(...h))
          }, [
            s.value ? (g(), E("i", gie)) : (g(), E("i", _ie)),
            f[2] || (f[2] = c("span", null, "Save", -1))
          ], 8, vie)
        ]),
        D(a_, {
          checkFn: a,
          saveFn: C(l),
          discardFn: u
        }, null, 8, ["saveFn"])
      ]);
    };
  }
}, bie = /* @__PURE__ */ oe(yie, [["__scopeId", "data-v-27c6691a"]]), Eie = { class: "my-2 rounded border" }, wie = { class: "d-flex gap-2 justify-content-end mt-2" }, Sie = ["disabled"], xie = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw me-1"
}, Nie = {
  key: 1,
  class: "fas fa-refresh fa-fw me-1"
}, Cie = ["disabled"], Oie = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw me-1"
}, Tie = {
  key: 1,
  class: "fas fa-save fa-fw me-1"
}, $ie = {
  __name: "MappingPage",
  setup(e) {
    const t = $e("settings-manager-service"), n = $e("mapping-service"), { isDirty: s, loading: o } = he(n), i = async () => {
      await n.save() && await t.getSettings();
    }, r = i, a = () => s.value, l = () => i, u = () => n.reset();
    return (d, f) => (g(), E(G, null, [
      c("div", Eie, [
        D(GN)
      ]),
      D(WN),
      f[4] || (f[4] = c("hr", null, null, -1)),
      c("div", wie, [
        c("button", {
          class: "btn btn-sm btn-outline-secondary",
          onClick: f[0] || (f[0] = (...p) => d.onResetClicked && d.onResetClicked(...p)),
          disabled: !C(s) || C(o)
        }, [
          C(o) ? (g(), E("i", xie)) : (g(), E("i", Nie)),
          f[2] || (f[2] = c("span", null, "Reset", -1))
        ], 8, Sie),
        c("button", {
          class: "btn btn-sm btn-primary",
          type: "button",
          disabled: !C(s) || C(o),
          onClick: f[1] || (f[1] = (...p) => C(r) && C(r)(...p))
        }, [
          C(o) ? (g(), E("i", Oie)) : (g(), E("i", Tie)),
          f[3] || (f[3] = c("span", null, "Save", -1))
        ], 8, Cie)
      ]),
      D(a_, {
        checkFn: a,
        saveFn: l,
        discardFn: u
      })
    ], 64));
  }
}, kie = [
  {
    path: "/",
    component: vse,
    children: [
      {
        path: "",
        name: "home",
        component: oie
      },
      {
        path: "settings",
        name: "settings",
        component: bie
      },
      {
        path: "mapping",
        name: "mapping",
        component: $ie
      },
      { path: "/:pathMatch(.*)*", component: la }
    ]
  }
];
let Xu;
const Die = () => Xu || (Xu = ci({
  // Provide the history implementation to use. We are using the hash history for simplicity here.
  history: li(),
  routes: kie
}), Xu), Ede = (e) => {
  const t = wn(mse), n = _l();
  n.use(El), t.use(n), t.use(Cs);
  const s = Die();
  t.use(s), t.directive("tt", ap), t.directive("mytooltip", Tp), t.mount(e);
  const o = t.runWithContext(() => tse());
  return { app: t, router: s, store: o };
};
let Rie = Bo();
const qu = Ho(Rie, ["pid"], { timeout: 0 }), mf = {
  getSettings() {
    const e = {
      route: "GlassBreakerController:getSettings"
    };
    return qu.get("", { params: e });
  },
  getProtectedMrnList() {
    const e = {
      route: "GlassBreakerController:getProtectedMrnList"
    };
    return qu.get("", { params: e });
  },
  breakTheGlass(e) {
    const t = {
      route: "GlassBreakerController:breakTheGlass"
    }, n = { ...e };
    return qu.post("", n, { params: t });
  },
  removeMrn(e) {
    const t = {
      route: "GlassBreakerController:removeMrn"
    }, n = { mrn: e };
    return qu.post("", n, { params: t });
  }
}, Iie = "settings", Aie = "The patient file you are attempting to access is restricted. If you have a clinical/business need to access the patient's file, please enter a reason and password and you may proceed.", Ap = /* @__PURE__ */ Ut(Iie, () => {
  const e = I(!1), t = I(), n = qe({});
  async function s() {
    try {
      e.value = !0;
      const d = await mf.getSettings(), f = (d == null ? void 0 : d.data) ?? {}, { translations: p = {} } = f;
      ip(p), Object.assign(n, f);
    } catch (d) {
      t.value = d;
    } finally {
      e.value = !1;
    }
  }
  const o = k(() => (n == null ? void 0 : n.initialize) ?? null), i = k(
    () => {
      var d;
      return ((d = n == null ? void 0 : n.initialize) == null ? void 0 : d.LegalMessage) ?? Aie;
    }
  ), r = k(() => {
    var d;
    return ((d = n == null ? void 0 : n.initialize) == null ? void 0 : d.Reasons) ?? [];
  }), a = k(() => n.ehrUser), l = k(() => n.userType), u = k(
    () => Array.isArray(n.userTypes) ? n.userTypes : []
  );
  return {
    loading: e,
    error: t,
    settings: n,
    ehrUser: a,
    preferredUserType: l,
    userTypes: u,
    LegalMessage: i,
    Reasons: r,
    initialize: o,
    getSettings: s
  };
}), Mie = "patients", hu = /* @__PURE__ */ Ut(Mie, () => {
  const e = I(!1), t = I(), n = I([]), s = I([]);
  async function o() {
    try {
      e.value = !0;
      const l = await mf.getProtectedMrnList(), u = (l == null ? void 0 : l.data) ?? {}, d = (u == null ? void 0 : u.data) ?? [];
      n.value = d;
    } catch (l) {
      t.value = l;
    } finally {
      e.value = !1;
    }
  }
  async function i(l) {
    try {
      e.value = !0;
      const u = await mf.removeMrn(l);
      return n.value = n.value.filter((d) => d !== l), s.value = s.value.filter((d) => d !== l), u;
    } catch (u) {
      t.value = u;
    } finally {
      e.value = !1;
    }
  }
  function r() {
    s.value = [];
  }
  function a(l) {
    s.value.includes(l) ? s.value = s.value.filter((u) => u !== l) : s.value.push(l);
  }
  return {
    loading: e,
    error: t,
    patients: n,
    selected: s,
    resetSelection: r,
    fetchProtectedPatients: o,
    removeMrn: i,
    toggleSelectMrn: a
  };
}), Pie = "form", zN = /* @__PURE__ */ Ut(Pie, () => {
  const e = hu(), t = wg({
    mrns: [no({ message: "provide at leat one MRN" })],
    password: [no({ message: "'password' is required" })],
    UserID: [no({ message: "'UserID' is required" })],
    UserIDType: [no({ message: "'UserIDType' is required" })],
    Reason: [no({ message: "'Reason' is required" })],
    Explanation: [no({ message: "'Explanation' is required" })]
  }), n = I(), s = I(!0), o = I(!1), i = I(), r = I([]), a = qe({
    mrns: e.selected,
    password: void 0,
    // BTG specific params matching AcceptDTO
    UserID: void 0,
    UserIDType: void 0,
    Reason: void 0,
    Explanation: void 0
  }), l = async () => {
    try {
      if (r.value = [], o.value = !0, n.value = t(a), n.value.hasErrors()) return;
      const p = await mf.breakTheGlass({ ...a });
      r.value = p.data, e.resetSelection();
    } catch (p) {
      return i.value = p, i;
    } finally {
      o.value = !1;
    }
  }, u = (p, h) => {
    s.value = !1, p in a ? a[p] = h : console.warn(`Invalid property key: ${p}`), po(() => {
      s.value = !0;
    });
  }, d = () => n.value = t(a);
  d();
  const f = ml(d, 300);
  return nt(
    a,
    (p, h) => {
      s.value && f();
    },
    { immediate: !0 }
  ), nt(
    () => e.selected,
    (p) => {
      a.mrns = p;
    },
    { immediate: !0 }
  ), {
    loading: o,
    error: i,
    validation: n,
    formData: a,
    results: r,
    runValidation: d,
    updatePropertyWithoutValidation: u,
    submit: l
  };
}), Lie = {
  settings: Ap,
  patients: hu,
  form: zN
}, Vie = () => ({
  ...Object.fromEntries(
    Object.entries(Lie).map(([t, n]) => [t, n()])
  )
}), Fie = { class: "table table-bordered table-striped table-hover table-sm" }, Uie = ["checked", "indeterminate", "disabled"], jie = { class: "d-flex" }, Bie = { class: "ms-auto" }, Hie = ["disabled"], Yie = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw"
}, Wie = {
  key: 1,
  class: "fas fa-refresh fa-fw"
}, Gie = { class: "form-check" }, zie = ["id", "value"], Kie = { style: { width: "100%" } }, Xie = { class: "d-flex" }, qie = ["for"], Jie = { class: "ms-auto" }, Qie = ["onClick"], Zie = { key: 0 }, eae = {
  __name: "PatientsList",
  setup(e) {
    const t = fs(), n = hu(), { patients: s, selected: o, loading: i } = he(n), { fetchProtectedPatients: r, toggleSelectMrn: a, removeMrn: l } = n, u = k(() => s.value.length > 0 && o.value.length === s.value.length), d = k(() => o.value.length > 0 && o.value.length < s.value.length), f = () => {
      u.value ? o.value = [] : o.value = [...s.value];
    };
    async function p() {
      await r();
    }
    async function h(m) {
      await t.confirm({
        title: "Confirm Delete",
        body: `Are you sure you want to delete MRN: ${m}?`
      }) && await l(m);
    }
    return vt(() => {
      r();
    }), (m, v) => (g(), E("table", Fie, [
      c("thead", null, [
        c("tr", null, [
          c("th", null, [
            c("input", {
              class: "form-check-input",
              type: "checkbox",
              id: "all-patients",
              checked: u.value,
              indeterminate: d.value,
              disabled: C(s).length === 0,
              onChange: f
            }, null, 40, Uie)
          ]),
          c("th", null, [
            c("div", jie, [
              v[1] || (v[1] = c("span", null, "MRN", -1)),
              c("div", Bie, [
                c("button", {
                  type: "button",
                  class: "btn btn-sm btn-outline-secondary",
                  onClick: p,
                  disabled: C(i)
                }, [
                  C(i) ? (g(), E("i", Yie)) : (g(), E("i", Wie))
                ], 8, Hie)
              ])
            ])
          ])
        ])
      ]),
      c("tbody", null, [
        (g(!0), E(G, null, ge(C(s), (_) => (g(), E("tr", { key: _ }, [
          c("td", null, [
            c("div", Gie, [
              L(c("input", {
                class: "form-check-input",
                type: "checkbox",
                id: `patient-${_}`,
                value: _,
                "onUpdate:modelValue": v[0] || (v[0] = (b) => ut(o) ? o.value = b : null)
              }, null, 8, zie), [
                [mn, C(o)]
              ])
            ])
          ]),
          c("td", Kie, [
            c("div", Xie, [
              c("label", {
                class: "form-check-label",
                for: `patient-${_}`
              }, F(_), 9, qie),
              c("div", Jie, [
                c("button", {
                  type: "button",
                  class: "btn btn-sm btn-outline-danger",
                  onClick: (b) => h(_)
                }, v[2] || (v[2] = [
                  c("i", { class: "fas fa-trash fa-fw" }, null, -1)
                ]), 8, Qie)
              ])
            ])
          ])
        ]))), 128)),
        C(s).length === 0 ? (g(), E("tr", Zie, v[3] || (v[3] = [
          c("td", { colspan: "2" }, "No MRNs", -1)
        ]))) : ne("", !0)
      ])
    ]));
  }
}, tae = { class: "d-flex flex-column gap-2" }, nae = {
  for: "patients-list",
  class: "form-label"
}, sae = {
  for: "select-reason",
  class: "form-label"
}, oae = ["value"], rae = {
  for: "text-explanation",
  class: "form-label"
}, iae = {
  for: "input-ehr-user",
  class: "form-label"
}, aae = {
  for: "select-user-type",
  class: "form-label"
}, lae = ["value"], cae = {
  for: "input-redcap-password",
  class: "form-label"
}, uae = { class: "d-flex justify-content-end mt-2" }, dae = ["disabled"], fae = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw"
}, pae = {
  key: 1,
  class: "fas fa-hammer fa-fw"
}, hae = { class: "table table-sm table-bordered table-hover table-striped" }, mae = {
  __name: "BtgForm",
  setup(e) {
    const t = Ap(), n = hu(), s = zN(), o = I(), { LegalMessage: i, Reasons: r, userTypes: a, ehrUser: l, preferredUserType: u } = he(t), { formData: d, loading: f, validation: p, results: h } = he(s), { submit: m, updatePropertyWithoutValidation: v, runValidation: _ } = s;
    async function b() {
      await m(), n.fetchProtectedPatients();
    }
    return Ft(async () => {
      if (h.value.length === 0) return;
      await o.value.show(), h.value = [];
    }), vt(() => {
      v("UserID", l.value), v("UserIDType", u.value), _();
    }), (w, y) => {
      const x = le("b-modal"), N = Ht("tt");
      return g(), E("div", null, [
        c("div", tae, [
          c("div", null, [
            L(c("label", nae, null, 512), [
              [N, void 0, "break_glass_field_patients"]
            ]),
            D(eae, { id: "patients-list" })
          ]),
          c("div", null, [
            L(c("label", sae, null, 512), [
              [N, void 0, "break_glass_field_reason"]
            ]),
            L(c("select", {
              class: "form-select form-select-sm",
              "onUpdate:modelValue": y[0] || (y[0] = (S) => C(d).Reason = S),
              id: "select-reason"
            }, [
              y[5] || (y[5] = c("option", { disabled: "" }, "Please select a reason", -1)),
              (g(!0), E(G, null, ge(C(r), (S) => (g(), E("option", {
                key: S,
                value: S
              }, F(S), 9, oae))), 128))
            ], 512), [
              [Qt, C(d).Reason]
            ])
          ]),
          c("div", null, [
            L(c("label", rae, null, 512), [
              [N, void 0, "break_glass_field_explanation"]
            ]),
            L(c("textarea", {
              class: "form-control form-control-sm",
              id: "text-explanation",
              rows: "3",
              "onUpdate:modelValue": y[1] || (y[1] = (S) => C(d).Explanation = S)
            }, null, 512), [
              [Ve, C(d).Explanation]
            ])
          ]),
          c("div", null, [
            L(c("label", iae, null, 512), [
              [N, void 0, "break_glass_field_user"]
            ]),
            L(c("input", {
              type: "text",
              class: "form-control form-control-sm",
              id: "input-ehr-user",
              readonly: "",
              disabled: "",
              "onUpdate:modelValue": y[2] || (y[2] = (S) => C(d).UserID = S)
            }, null, 512), [
              [Ve, C(d).UserID]
            ])
          ]),
          c("div", null, [
            L(c("label", aae, null, 512), [
              [N, void 0, "break_glass_field_user_type"]
            ]),
            L(c("select", {
              class: "form-select form-select-sm",
              "onUpdate:modelValue": y[3] || (y[3] = (S) => C(d).UserIDType = S),
              id: "select-user-type"
            }, [
              y[6] || (y[6] = c("option", { disabled: "" }, "Please select a user type", -1)),
              (g(!0), E(G, null, ge(C(a), (S) => (g(), E("option", {
                key: S,
                value: S
              }, F(S), 9, lae))), 128))
            ], 512), [
              [Qt, C(d).UserIDType]
            ])
          ]),
          c("div", null, [
            L(c("label", cae, null, 512), [
              [N, void 0, "break_glass_field_password"]
            ]),
            L(c("input", {
              type: "password",
              class: "form-control form-control-sm",
              id: "input-redcap-password",
              "onUpdate:modelValue": y[4] || (y[4] = (S) => C(d).password = S)
            }, null, 512), [
              [Ve, C(d).password]
            ])
          ])
        ]),
        c("div", uae, [
          c("button", {
            type: "button",
            class: "btn btn-sm btn-primary",
            onClick: b,
            disabled: C(f) || C(p).hasErrors()
          }, [
            C(f) ? (g(), E("i", fae)) : (g(), E("i", pae)),
            y[7] || (y[7] = c("span", { class: "ms-2" }, "Break The Glass", -1))
          ], 8, dae)
        ]),
        (g(), se(ns, { to: "body" }, [
          D(x, {
            ref_key: "resultsRef",
            ref: o,
            "ok-only": "",
            size: "xl"
          }, {
            title: B(() => y[8] || (y[8] = [
              te("Response")
            ])),
            default: B(() => [
              c("div", null, [
                c("table", hae, [
                  y[9] || (y[9] = c("thead", null, [
                    c("tr", null, [
                      c("th", null, "MRN"),
                      c("th", null, "Status"),
                      c("th", null, "Details")
                    ])
                  ], -1)),
                  c("tbody", null, [
                    (g(!0), E(G, null, ge(C(h), (S, O) => (g(), E("tr", { key: O }, [
                      c("td", null, [
                        c("span", null, F(S.mrn), 1)
                      ]),
                      c("td", null, [
                        c("span", null, F(S.status), 1)
                      ]),
                      c("td", null, [
                        c("span", null, F(S.details), 1)
                      ])
                    ]))), 128))
                  ])
                ])
              ])
            ]),
            _: 1
          }, 512)
        ]))
      ]);
    };
  }
}, vae = /* @__PURE__ */ oe(mae, [["__scopeId", "data-v-88695837"]]), gae = {
  key: 0,
  class: "alert alert-danger"
}, _ae = {
  key: 1,
  class: "alert alert-danger"
}, yae = {
  __name: "InitializeCheck",
  setup(e) {
    const t = Ap(), { initialize: n, ehrUser: s } = he(t);
    return (o, i) => C(n) ? C(s) ? fe(o.$slots, "default", { key: 2 }) : (g(), E("div", _ae, i[1] || (i[1] = [
      c("span", { class: "d-block" }, "No EHR user is maped to your REDCap user.", -1),
      c("span", { class: "d-block" }, "Please perform a launch from EHR.", -1)
    ]))) : (g(), E("div", gae, i[0] || (i[0] = [
      c("span", { class: "d-block" }, "There was an error initializing the Break the Glass feature.", -1),
      c("span", { class: "d-block" }, "Please make sure to have a valid access to your EHR system.", -1)
    ])));
  }
}, bae = {
  key: 0,
  class: "alert alert-danger"
}, Eae = {
  __name: "ErrorsVisualizer",
  setup(e) {
    const t = I(), n = $p();
    return Ft(async () => {
      var o, i;
      if ((o = n.value) == null || o.length, ((i = n.value) == null ? void 0 : i.length) === 0) return;
      const s = t.value;
      s && (await s.show(), n_());
    }), (s, o) => {
      const i = le("b-modal");
      return g(), se(i, {
        ref_key: "modalRef",
        ref: t,
        "ok-only": ""
      }, {
        title: B(() => o[0] || (o[0] = [
          c("span", null, "Error", -1)
        ])),
        default: B(() => [
          (g(!0), E(G, null, ge(C(n), (r, a) => (g(), E(G, { key: a }, [
            r ? (g(), E("div", bae, F(C(Gs)(r)), 1)) : ne("", !0)
          ], 64))), 128))
        ]),
        _: 1
      }, 512);
    };
  }
}, wae = { key: 0 }, Sae = { key: 1 }, xae = {
  __name: "App",
  setup(e) {
    const t = I(!1), n = Ap(), s = hu(), o = $e("eventBus");
    return nt(
      () => s.patients,
      () => {
        const i = {
          patients: Ye(s.patients)
        };
        o.emit("patients-loaded", i);
      },
      { immediate: !0 }
    ), vt(async () => {
      t.value = !0, await n.getSettings(), t.value = !1;
    }), (i, r) => (g(), E("div", null, [
      t.value ? (g(), E("div", wae, r[0] || (r[0] = [
        c("i", { class: "fas fa-spinner fa-spin fa-fw me-2" }, null, -1),
        c("span", null, "Loading...", -1)
      ]))) : (g(), E("div", Sae, [
        D(yae, null, {
          default: B(() => [
            D(vae)
          ]),
          _: 1
        })
      ])),
      (g(), se(ns, { to: "body" }, [
        D(Eae)
      ]))
    ]));
  }
}, wde = (e) => {
  const t = wn(xae), n = _l();
  n.use(El), t.use(n), t.use(Cs), t.use(r_()), t.directive("tt", ap), t.directive("mytooltip", Tp), t.mount(e);
  const s = t.runWithContext(() => Vie());
  return { app: t, store: s, eventBus: ta };
};
let Nae = Bo();
const zo = Ho(Nae, [], { timeout: 0 }), Cae = async () => {
  const e = {
    params: {
      route: "EmailUsersController:getSettings"
    }
  };
  return zo.get("", e);
}, Oae = async () => {
  const e = {
    params: {
      route: "EmailUsersController:getQueries"
    }
  };
  return zo.get("", e);
}, Tae = async ({ id: e, query: t, name: n, description: s }) => {
  const o = {
    params: {
      route: "EmailUsersController:saveQuery"
    }
  }, i = { id: e, query: t, name: n, description: s };
  return zo.post("", i, o);
}, $ae = async (e) => {
  const t = {
    params: {
      route: "EmailUsersController:deleteQuery",
      id: e
    }
  };
  return zo.delete("", t);
}, kae = async (e, t = 1, n = 50) => {
  const s = {
    params: {
      route: "EmailUsersController:testQuery",
      _page: t,
      _per_page: n
    }
  }, o = { query: e };
  return zo.post("", o, s);
}, Dae = async (e) => {
  const t = {
    params: {
      route: "EmailUsersController:generateCSV"
    }
  }, n = { query: e };
  return zo.post("", n, t);
}, Rae = async (e = { from, subject, body, query, fromName, cc, bcc }) => {
  const t = {
    params: {
      route: "EmailUsersController:sendEmails"
    }
  };
  return zo.post("", e, t);
}, Iae = (e, t, n) => {
  const s = {
    params: {
      route: "EmailUsersController:previewMessage"
    }
  }, o = { subject: e, body: t, email: n };
  return zo.post("", o, s);
}, Aae = async (e = 1, t = 50) => {
  const n = {
    params: {
      route: "EmailUsersController:getMessages",
      _page: e,
      _per_page: t
    }
  };
  return zo.get("", n);
}, Mae = async (e) => {
  const t = {
    params: {
      route: "EmailUsersController:deleteMessage",
      id: e
    }
  };
  return zo.delete("", t);
}, Pae = "app", mu = /* @__PURE__ */ Ut(Pae, () => {
  const e = I(!1), t = I(!1), n = I(), s = I(), o = I(), i = I(), r = I(), a = I();
  async function l() {
    var u;
    try {
      t.value = !0;
      const d = await Cae(), f = (u = d == null ? void 0 : d.data) == null ? void 0 : u.data, {
        lang: p = {},
        user: h = {},
        variables: m = {},
        fieldsConfig: v = []
      } = f;
      s.value = f, o.value = p, i.value = h, r.value = m, a.value = v, ip(o.value), e.value = !0;
    } catch (d) {
      n.value = d;
    } finally {
      t.value = !1;
    }
  }
  return {
    ready: e,
    loading: t,
    error: n,
    settings: s,
    lang: o,
    user: i,
    variables: r,
    fieldsConfig: a,
    init: l
  };
}), Lae = "email", fa = /* @__PURE__ */ Ut(Lae, () => {
  const e = I(!1), t = I(!1), n = I(), s = I(""), o = I(""), i = I(""), r = I(null), a = I(null), l = I(null), u = k(() => {
    var f, p;
    return !!((f = o.value) != null && f.trim() || (p = i.value) != null && p.trim());
  });
  return {
    ready: e,
    loading: t,
    error: n,
    from: s,
    fromName: r,
    subject: o,
    body: i,
    cc: a,
    bcc: l,
    previewAvailable: u,
    send: async (f) => {
      try {
        return t.value = !0, (await Rae({
          from: s.value,
          subject: o.value,
          body: i.value,
          query: f,
          fromName: r.value,
          cc: a.value,
          bcc: l.value
        })).data;
      } catch (p) {
        return n.value = p, !1;
      } finally {
        t.value = !1;
      }
    }
  };
}), Vae = "queries", pa = /* @__PURE__ */ Ut(Vae, () => {
  const e = I(!1), t = I(), n = I([]), s = I();
  async function o() {
    var d;
    try {
      e.value = !0;
      const f = await Oae(), p = (d = f == null ? void 0 : f.data) == null ? void 0 : d.data;
      n.value = p;
    } catch (f) {
      n.value = [], t.value = f;
    } finally {
      i(), e.value = !1;
    }
  }
  function i() {
    var p;
    if (!((p = s.value) != null && p.id)) return;
    const d = s.value.id, f = n.value.find((h) => h.id == d);
    s.value = f;
  }
  async function r(d) {
    try {
      e.value = !0, await Tae(d);
    } catch (f) {
      console.log(f), t.value = f;
    } finally {
      e.value = !1;
    }
  }
  async function a(d) {
    try {
      e.value = !0, await $ae(d);
    } catch (f) {
      t.value = f;
    } finally {
      e.value = !1;
    }
  }
  function l(d) {
    return n.value.find((f) => (f == null ? void 0 : f.id) == d);
  }
  function u(d) {
    s.value = d;
  }
  return {
    loading: e,
    error: t,
    list: n,
    selected: s,
    load: o,
    save: r,
    remove: a,
    selectQuery: u,
    getQuery: l
  };
}), Fae = "messages", wl = /* @__PURE__ */ Ut(Fae, () => {
  const e = I(!1), t = I(), n = I([]), s = I(1), o = I(10), i = I(), r = qe({}), a = k(() => (r == null ? void 0 : r.total) ?? 0);
  async function l() {
    var p, h;
    try {
      e.value = !0;
      const m = await Aae(s.value, o.value), v = (p = m == null ? void 0 : m.data) == null ? void 0 : p.data;
      Object.assign(r, ((h = m == null ? void 0 : m.data) == null ? void 0 : h.metadata) ?? {}), n.value = v;
    } catch (m) {
      n.value = [], t.value = m;
    } finally {
      d(), e.value = !1;
    }
  }
  async function u(p) {
    try {
      e.value = !0, await Mae(p);
    } catch (h) {
      t.value = h;
    } finally {
      e.value = !1;
    }
  }
  function d() {
    var m;
    if (!((m = i.value) != null && m.id)) return;
    const p = i.value.id, h = n.value.find((v) => v.id == p);
    i.value = h;
  }
  function f(p) {
    i.value = p;
  }
  return {
    loading: e,
    error: t,
    list: n,
    selected: i,
    metadata: r,
    page: s,
    perPage: o,
    total: a,
    load: l,
    remove: u,
    selectMessage: f
  };
}), Uae = "test-query", KN = /* @__PURE__ */ Ut(Uae, () => {
  const e = I(!1), t = I(), n = I([]), s = qe({}), o = I(1), i = I(50), r = k(() => (s == null ? void 0 : s.total) ?? 0);
  async function a(u) {
    var d, f;
    try {
      e.value = !0;
      const p = await kae(u, o.value, i.value);
      return n.value = (d = p == null ? void 0 : p.data) == null ? void 0 : d.data, Object.assign(s, ((f = p == null ? void 0 : p.data) == null ? void 0 : f.metadata) ?? {}), !0;
    } catch (p) {
      return l(), t.value = p, !1;
    } finally {
      e.value = !1;
    }
  }
  function l() {
    o.value = 1, n.value = [], Object.assign(s, {});
  }
  return {
    loading: e,
    error: t,
    list: n,
    metadata: s,
    page: o,
    perPage: i,
    totalUsers: r,
    test: a,
    reset: l
  };
}), jae = {
  app: mu,
  email: fa,
  queries: pa,
  messages: wl,
  testQuery: KN
}, Bae = () => ({
  ...Object.fromEntries(
    Object.entries(jae).map(([t, n]) => [t, n()])
  )
}), Hae = {
  key: 0,
  class: "alert alert-danger"
}, Yae = {
  __name: "ErrorsVisualizer",
  setup(e) {
    const t = I(), n = $p();
    return Ft(async () => {
      var i;
      if ((((i = n.value) == null ? void 0 : i.length) ?? 0) === 0) return;
      const o = t.value;
      o && (await o.show(), n_());
    }), (s, o) => {
      const i = le("b-modal");
      return g(), se(i, {
        ref_key: "modalRef",
        ref: t,
        "ok-only": ""
      }, {
        title: B(() => o[0] || (o[0] = [
          c("span", null, "Error", -1)
        ])),
        default: B(() => [
          (g(!0), E(G, null, ge(C(n), (r, a) => (g(), E(G, { key: a }, [
            r ? (g(), E("div", Hae, F(C(Gs)(r)), 1)) : ne("", !0)
          ], 64))), 128))
        ]),
        _: 1
      }, 512);
    };
  }
}, Wae = {
  key: 0,
  class: "p-2"
}, Gae = {
  __name: "App",
  setup(e) {
    const t = mu(), n = fa(), s = pa(), o = wl(), i = I(!1), { user: r } = he(t);
    return vt(async () => {
      var a, l;
      i.value = !0, await t.init(), n.from = ((l = (a = r.value) == null ? void 0 : a.emails) == null ? void 0 : l.at(0)) ?? "", await s.load(), await o.load(), i.value = !1;
    }), (a, l) => {
      const u = le("router-view");
      return g(), E("div", null, [
        i.value ? (g(), E("div", Wae, l[0] || (l[0] = [
          c("i", { class: "fas fa-spinner fa-spin fa-fw" }, null, -1),
          c("span", { class: "ms-1" }, "Loading", -1)
        ]))) : (g(), se(u, { key: 1 })),
        (g(), se(ns, { to: "body" }, [
          D(Yae)
        ]))
      ]);
    };
  }
}, zae = /* @__PURE__ */ oe(Gae, [["__scopeId", "data-v-02d82a46"]]), Kae = { class: "nav nav-tabs w-100 border-bottom mb-3" }, Xae = {
  __name: "MainMenu",
  setup(e) {
    const t = I([
      {
        label: "Compose Message",
        route: "/",
        icon: "fas fa-envelope fa-fw"
      },
      {
        label: "Message History",
        route: "/messages",
        icon: "fas fa-clock-rotate-left fa-fw"
      }
    ]), n = Nr(), s = (o) => typeof o == "string" ? n.path === o : o.name ? n.name === o.name : o.path ? n.path === o.path : !1;
    return (o, i) => {
      const r = le("router-link");
      return g(), E("ul", Kae, [
        (g(!0), E(G, null, ge(t.value, (a) => (g(), E("li", {
          key: a.route,
          class: "nav-item"
        }, [
          D(r, {
            to: a.route,
            class: Se(["nav-link", { active: s(a.route) }]),
            "exact-active-class": "active",
            "aria-current": "page"
          }, {
            default: B(() => [
              a.icon ? (g(), E("i", {
                key: 0,
                class: Se([a.icon, "me-1"])
              }, null, 2)) : ne("", !0),
              te(" " + F(a.label), 1)
            ]),
            _: 2
          }, 1032, ["to", "class"])
        ]))), 128))
      ]);
    };
  }
}, qae = {
  key: 1,
  class: "overlay-container"
}, Jae = { class: "overlay-page" }, Qae = { key: 2 }, Zae = {
  __name: "MainLayout",
  setup(e) {
    const t = Nr();
    return (n, s) => {
      const o = le("RouterView"), i = le("router-view");
      return g(), E("div", null, [
        C(t).meta.hideMenu ? ne("", !0) : (g(), se(Xae, {
          key: 0,
          class: "mt-2"
        })),
        C(t).meta.overlay ? (g(), E("div", qae, [
          c("div", Jae, [
            D(o)
          ])
        ])) : (g(), E("div", Qae, [
          D(i)
        ]))
      ]);
    };
  }
}, ele = /* @__PURE__ */ oe(Zae, [["__scopeId", "data-v-92ef9ea4"]]), tle = ["value"], nle = ["value"], sle = {
  __name: "QuerySelect",
  setup(e) {
    const t = I(Symbol()), n = pa(), { list: s, selected: o } = he(n), i = k({
      get: () => {
        var r;
        return ((r = o.value) == null ? void 0 : r.id) || t.value;
      },
      set: (r) => {
        if (r === t.value) {
          o.value = null;
          return;
        }
        const a = n.getQuery(r);
        o.value = a;
      }
    });
    return (r, a) => L((g(), E("select", {
      class: "form-select form-select-sm",
      "onUpdate:modelValue": a[0] || (a[0] = (l) => i.value = l)
    }, [
      c("option", { value: t.value }, "[" + F(C(ls)("email_users_156") ?? "All users...") + "]", 9, tle),
      (g(!0), E(G, null, ge(C(s), ({ id: l, name: u }, d) => (g(), E("option", {
        key: `${l}-${u}`,
        value: l
      }, F(u), 9, nle))), 128))
    ], 512)), [
      [Qt, i.value]
    ]);
  }
}, ole = { class: "table table-sm table-striped table-hover table-bordered" }, rle = { key: 0 }, ile = { class: "d-flex gap-2 align-items-center" }, ale = { key: 0 }, lle = { class: "d-flex" }, cle = ["onClick", "disabled"], ule = { class: "fw-bold" }, dle = { class: "fw-bold" }, fle = { class: "fw-bold" }, ple = ["innerHTML"], hle = ["innerHTML"], mle = {
  __name: "UsersTable",
  props: {
    users: { type: Array, default: () => [] }
  },
  setup(e) {
    const t = fa(), { subject: n, body: s, from: o, fromName: i, previewAvailable: r } = he(t), a = Io("preview-modal"), l = I(), u = I(""), d = I(""), f = () => {
      l.value = "", u.value = "", d.value = "";
    };
    async function p(h) {
      var m, v;
      try {
        l.value = h;
        const _ = await Iae(n.value, s.value, h);
        d.value = ((m = _ == null ? void 0 : _.data) == null ? void 0 : m.body) ?? "", u.value = ((v = _ == null ? void 0 : _.data) == null ? void 0 : v.subject) ?? "", await a.value.show(), f();
      } catch (_) {
        console.log(_);
      }
    }
    return (h, m) => {
      const v = le("b-modal"), _ = Ht("tt");
      return g(), E("table", ole, [
        m[10] || (m[10] = c("thead", null, [
          c("tr", null, [
            c("th", null, "Username"),
            c("th", null, "First Name"),
            c("th", null, "Last Name"),
            c("th", null, "Email")
          ])
        ], -1)),
        c("tbody", null, [
          e.users.length === 0 ? (g(), E("tr", rle, m[0] || (m[0] = [
            c("td", { colspan: "4" }, [
              c("span", { class: "fst-italic" }, "No Users")
            ], -1)
          ]))) : ne("", !0),
          (g(!0), E(G, null, ge(e.users, (b, w) => (g(), E("tr", {
            key: `${w}-${b == null ? void 0 : b.ui_id}`,
            class: Se({ suspended: b.is_suspended })
          }, [
            c("td", null, [
              c("div", ile, [
                c("span", null, F(b == null ? void 0 : b.username), 1),
                b.is_suspended ? (g(), E("span", ale, m[1] || (m[1] = [
                  c("span", null, "(suspended)", -1)
                ]))) : ne("", !0)
              ])
            ]),
            c("td", null, F(b == null ? void 0 : b.user_firstname), 1),
            c("td", null, F(b == null ? void 0 : b.user_lastname), 1),
            c("td", null, [
              c("div", lle, [
                c("span", null, F(b == null ? void 0 : b.user_email), 1),
                c("button", {
                  type: "text",
                  class: "btn btn-sm btn-light ms-auto",
                  onClick: (y) => p(b == null ? void 0 : b.user_email),
                  disabled: !C(r)
                }, m[2] || (m[2] = [
                  c("i", { class: "fas fa-file-lines fa-fw text-info" }, null, -1)
                ]), 8, cle)
              ])
            ])
          ], 2))), 128))
        ]),
        (g(), se(ns, { to: "body" }, [
          D(v, {
            ref: "preview-modal",
            "ok-only": "",
            size: "xl"
          }, {
            title: B(() => [
              L((g(), E("span", null, m[3] || (m[3] = [
                te("Message Preview")
              ]))), [
                [_, void 0, "email_users_157"]
              ])
            ]),
            default: B(() => [
              c("div", null, [
                L(c("span", ule, null, 512), [
                  [_, void 0, "email_users_108"]
                ]),
                m[4] || (m[4] = te(": ")),
                c("span", null, F(C(i) ? `${C(i)} <${C(o)}>` : C(o)), 1)
              ]),
              c("div", null, [
                L((g(), E("span", dle, m[5] || (m[5] = [
                  te("To")
                ]))), [
                  [_, void 0, "email_users_109"]
                ]),
                m[6] || (m[6] = te(": ")),
                c("span", null, F(l.value), 1)
              ]),
              c("div", null, [
                L((g(), E("span", fle, m[7] || (m[7] = [
                  te("Subject")
                ]))), [
                  [_, void 0, "email_users_10"]
                ]),
                m[8] || (m[8] = te(": ")),
                c("span", { innerHTML: u.value }, null, 8, ple)
              ]),
              m[9] || (m[9] = c("hr", null, null, -1)),
              c("div", null, [
                c("div", { innerHTML: d.value }, null, 8, hle)
              ])
            ]),
            _: 1
          }, 512)
        ]))
      ]);
    };
  }
}, vle = /* @__PURE__ */ oe(mle, [["__scopeId", "data-v-d11c1b05"]]), gle = {
  __name: "CsvDownloadButton",
  props: {
    query: { type: Object }
  },
  setup(e) {
    const t = e, { query: n } = he(t), s = I(!1), o = I(), i = an(), r = async () => {
      try {
        s.value = !0, o.value = null;
        const l = await Dae(n.value), { data: u } = l;
        o.value = u == null ? void 0 : u.url, i.toast({ title: "Success", body: "CSV file ready. Click download." });
      } catch (l) {
        console.log(l);
      } finally {
        s.value = !1;
      }
    }, a = async () => {
      location.href = o.value, o.value = null;
    };
    return (l, u) => s.value ? (g(), E("button", {
      key: 0,
      type: "button",
      class: "btn btn-sm btn-secondary",
      onClick: a
    }, u[0] || (u[0] = [
      c("i", { class: "fas fa-spinner fa-spin fa-fw me-1" }, null, -1),
      c("span", null, "Loading...", -1)
    ]))) : (g(), E(G, { key: 1 }, [
      o.value ? (g(), E("button", {
        key: 0,
        type: "button",
        class: "btn btn-sm btn-success",
        onClick: a
      }, u[1] || (u[1] = [
        c("i", { class: "fas fa-file-csv fa-fw me-1" }, null, -1),
        c("span", null, "Download", -1)
      ]))) : (g(), E("button", {
        key: 1,
        type: "button",
        class: "btn btn-sm btn-secondary",
        onClick: r
      }, u[2] || (u[2] = [
        c("i", { class: "fas fa-gears fa-fw me-1" }, null, -1),
        c("span", null, "Generate CSV...", -1)
      ])))
    ], 64));
  }
}, _le = ["disabled"], yle = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw"
}, ble = {
  key: 1,
  class: "fas fa-vial fa-fw"
}, Ele = { class: "users-table" }, wle = {
  key: 0,
  class: "alert alert-warning mt-2 m-0"
}, Sle = { class: "my-modal-footer d-flex gap-2 align-items-end w-100" }, xle = { class: "text-muted small" }, Nle = { class: "ms-auto d-flex gap-2" }, Cle = ["onClick"], Ole = {
  __name: "TestQueryButton",
  props: {
    query: { type: Object }
  },
  setup(e) {
    const t = KN(), n = fa(), s = Io("users-modal"), o = e, { query: i } = he(o), { previewAvailable: r } = he(n), { loading: a, list: l, page: u, perPage: d, metadata: f, totalUsers: p } = he(t), h = async () => await t.test(i.value), m = async () => {
      t.reset(), await h() && await s.value.show();
    };
    return nt(u, () => {
      h();
    }), (v, _) => {
      const b = le("b-pagination"), w = le("b-modal"), y = Ht("tt");
      return g(), E("button", bn({
        type: "button",
        class: "btn btn-sm btn-outline-success",
        disabled: C(a),
        onClick: m
      }, { ...v.$attrs }), [
        C(a) ? (g(), E("i", yle)) : (g(), E("i", ble)),
        fe(v.$slots, "default", {}, void 0, !0),
        (g(), se(ns, { to: "body" }, [
          D(w, {
            ref: "users-modal",
            size: "xl",
            "ok-only": ""
          }, {
            title: B(() => [
              L(c("span", null, null, 512), [
                [y, void 0, "email_users_144"]
              ])
            ]),
            footer: B(({ hide: x }) => {
              var N;
              return [
                c("div", Sle, [
                  c("div", null, [
                    c("div", xle, [
                      L(c("span", null, null, 512), [
                        [y, void 0, "email_users_145"]
                      ]),
                      c("span", null, ": " + F(((N = C(f)) == null ? void 0 : N.total) ?? 0), 1)
                    ]),
                    D(b, {
                      modelValue: C(u),
                      "onUpdate:modelValue": _[0] || (_[0] = (S) => ut(u) ? u.value = S : null),
                      totalItems: C(p),
                      perPage: C(d),
                      size: "sm"
                    }, null, 8, ["modelValue", "totalItems", "perPage"])
                  ]),
                  c("div", Nle, [
                    D(gle, { query: C(i) }, null, 8, ["query"]),
                    c("button", {
                      type: "button",
                      class: "btn btn-sm btn-primary",
                      onClick: x
                    }, "OK", 8, Cle)
                  ])
                ])
              ];
            }),
            default: B(() => [
              c("div", Ele, [
                D(vle, { users: C(l) }, null, 8, ["users"])
              ]),
              C(r) ? ne("", !0) : (g(), E("div", wle, _[1] || (_[1] = [
                c("span", { class: "fw-bold" }, "Please note:", -1),
                te(" preview is only available when "),
                c("span", { class: "fst-italic" }, "subject", -1),
                te(" or "),
                c("span", { class: "fst-italic" }, "body", -1),
                te(" are defined ")
              ])))
            ]),
            _: 1
          }, 512)
        ]))
      ], 16, _le);
    };
  }
}, XN = /* @__PURE__ */ oe(Ole, [["__scopeId", "data-v-260653a6"]]), Tle = { class: "d-flex gap-2" }, $le = { class: "input-group input-group-sm" }, kle = { class: "input-group-text" }, Dle = ["disabled", "title"], Rle = ["title"], Ile = {
  __name: "QueryToolbar",
  setup(e) {
    const t = ds(), n = pa(), { selected: s } = he(n), o = () => {
      t.push({ name: "filter-new" });
    }, i = () => {
      var r;
      t.push({ name: "filter-edit", params: { id: (r = s.value) == null ? void 0 : r.id } });
    };
    return (r, a) => {
      var u;
      const l = Ht("tt");
      return g(), E("div", Tle, [
        c("div", $le, [
          c("span", kle, [
            fe(r.$slots, "label", {}, () => [
              L((g(), E("span", null, a[0] || (a[0] = [
                te("query")
              ]))), [
                [l, void 0, "email_users_143"]
              ])
            ])
          ]),
          D(sle),
          c("button", {
            type: "button",
            class: "btn btn-sm btn-outline-secondary",
            disabled: !C(s),
            onClick: i,
            title: C(ls)("email_users_138")
          }, a[1] || (a[1] = [
            c("i", { class: "fas fa-edit fa-fw" }, null, -1)
          ]), 8, Dle),
          D(XN, {
            query: (u = C(s)) == null ? void 0 : u.query,
            title: C(ls)("email_users_140")
          }, null, 8, ["query", "title"]),
          c("button", {
            type: "button",
            class: "btn btn-sm btn-outline-primary",
            onClick: o,
            title: C(ls)("email_users_139")
          }, a[2] || (a[2] = [
            c("i", { class: "fas fa-plus fa-fw" }, null, -1)
          ]), 8, Rle)
        ])
      ]);
    };
  }
};
function qN(e, t, n) {
  return n < 0 ? t + e : n > e.length ? e + t : e.slice(0, n) + t + e.slice(n);
}
const Ale = {
  __name: "BodyTextarea",
  props: {
    modelValue: { type: String, default: "" },
    modelModifiers: {}
  },
  emits: ["update:modelValue"],
  setup(e, { expose: t }) {
    const n = $e("eventBus"), s = At(e, "modelValue"), o = Io("body-textarea"), i = I(0);
    function r() {
      var d;
      i.value = ((d = o.value) == null ? void 0 : d.selectionStart) ?? 0;
    }
    function a(d) {
      var p;
      const f = (p = d == null ? void 0 : d.target) == null ? void 0 : p.value;
      if (f == null) throw new Error("Error getting the message value");
      s.value = f;
    }
    const l = () => {
      var f;
      return (f = window == null ? void 0 : window.tinymce) == null ? void 0 : f.activeEditor;
    };
    function u(d) {
      const f = `[${d}]`, p = l();
      if (p) {
        p == null || p.insertContent(f);
        const h = p.getContent();
        s.value = h;
      } else {
        const h = i.value, m = (s == null ? void 0 : s.value) ?? "", v = qN(
          m,
          f,
          h
        );
        s.value = v;
      }
    }
    return vt(() => {
      try {
        typeof window.initTinyMCEglobal == "function" && window.initTinyMCEglobal("vue-mceditor", !1);
      } catch (d) {
        console.log(d);
      }
      n.emit("body-textarea-ready", { element: o.value });
    }), t({ insertDynamicVariable: u }), (d, f) => L((g(), E("textarea", bn({
      "onUpdate:modelValue": f[0] || (f[0] = (p) => s.value = p),
      ref: "body-textarea",
      class: "vue-mceditor",
      rows: "10",
      onInput: a,
      onBlur: r
    }, d.$attrs, { required: "" }), null, 16)), [
      [Ve, s.value]
    ]);
  }
}, Mle = ["id"], Ple = ["aria-labelledby"], Lle = {
  __name: "DropdownMenu",
  props: {
    label: {
      type: String,
      default: "Dropdown"
    },
    buttonVariant: {
      type: String,
      default: "primary"
    },
    buttonClass: {
      type: String,
      default: ""
    },
    alignRight: {
      type: Boolean,
      default: !1
    },
    id: {
      type: String,
      default: () => `dropdown-${Math.random().toString(36).substring(2, 9)}`
    }
  },
  setup(e, { expose: t }) {
    const n = I(!1), s = I(null), o = I(null), i = $e("parentDropdown", null);
    Cn("parentDropdown", {
      closeDropdown: () => {
        n.value = !1;
      }
    });
    const r = (u) => {
      n.value = !n.value, n.value && i && i.closeDropdown();
    }, a = (u) => {
      var d, f;
      !((d = o.value) != null && d.contains(u.target)) && !((f = s.value) != null && f.contains(u.target)) && n.value && (n.value = !1);
    };
    vt(() => {
      document.addEventListener("click", a);
    }), ii(() => {
      document.removeEventListener("click", a);
    });
    const l = {
      closeDropdown: a,
      toggleDropdown: r,
      parentDropdown: i,
      isOpen: n,
      close: () => n.value = !1
    };
    return t(l), (u, d) => (g(), E("div", {
      class: Se(["dropdown", { show: n.value }])
    }, [
      c("button", {
        class: Se(["btn dropdown-toggle", [
          e.buttonVariant ? `btn-${e.buttonVariant}` : "btn-primary",
          e.buttonClass
        ]]),
        type: "button",
        onClick: r,
        id: e.id,
        "aria-expanded": "false",
        ref_key: "toggleButton",
        ref: s
      }, [
        fe(u.$slots, "toggle", {}, () => [
          te(F(e.label), 1)
        ], !0)
      ], 10, Mle),
      c("div", {
        class: Se(["dropdown-menu", { show: n.value, "dropdown-menu-end": e.alignRight }]),
        "aria-labelledby": e.id,
        ref_key: "dropdownMenu",
        ref: o
      }, [
        fe(u.$slots, "default", kt(Dt({ ...l })), void 0, !0)
      ], 10, Ple)
    ], 2));
  }
}, Vle = /* @__PURE__ */ oe(Lle, [["__scopeId", "data-v-575b9e21"]]), Fle = ["disabled"], Ule = {
  key: 1,
  class: "dropdown-submenu"
}, jle = {
  __name: "DropdownItem",
  props: {
    label: {
      type: String,
      default: ""
    },
    isSubmenu: {
      type: Boolean,
      default: !1
    },
    active: {
      type: Boolean,
      default: !1
    },
    disabled: {
      type: Boolean,
      default: !1
    },
    alignRight: {
      type: Boolean,
      default: !1
    }
  },
  emits: ["click"],
  setup(e, { expose: t, emit: n }) {
    const s = e, o = n, i = I(!1), r = I(null), a = I(null), l = $e("parentDropdown", null), u = (h) => {
      s.disabled || (o("click", h), l && l.closeDropdown());
    }, d = (h) => {
      i.value = !i.value;
    }, f = (h) => {
      var m, v;
      !((m = a.value) != null && m.contains(h.target)) && !((v = r.value) != null && v.contains(h.target)) && i.value && (i.value = !1);
    };
    vt(() => {
      s.isSubmenu && document.addEventListener("click", f);
    }), ii(() => {
      s.isSubmenu && document.removeEventListener("click", f);
    });
    const p = {
      parentDropdown: l,
      toggleSubmenu: d,
      closeSubmenu: f,
      closeDropdown: (l == null ? void 0 : l.closeDropdown) ?? (() => ({})),
      close: () => i.value = !i.value
    };
    return t(p), (h, m) => e.isSubmenu ? (g(), E("div", Ule, [
      c("button", {
        class: Se(["dropdown-item dropdown-toggle", { active: e.active, disabled: e.disabled }]),
        onClick: d,
        ref_key: "submenuToggle",
        ref: r
      }, [
        fe(h.$slots, "toggle", kt(Dt({ ...p })), () => [
          te(F(e.label), 1)
        ], !0)
      ], 2),
      c("div", {
        class: Se(["dropdown-menu", { show: i.value, "dropdown-menu-end": e.alignRight }]),
        ref_key: "submenuContent",
        ref: a
      }, [
        fe(h.$slots, "default", kt(Dt({ ...p })), void 0, !0)
      ], 2)
    ])) : (g(), E("button", {
      key: 0,
      class: Se(["dropdown-item", { active: e.active, disabled: e.disabled }]),
      disabled: e.disabled,
      onClick: u
    }, [
      fe(h.$slots, "default", kt(Dt({ ...p })), void 0, !0)
    ], 10, Fle));
  }
}, a1 = /* @__PURE__ */ oe(jle, [["__scopeId", "data-v-1c9fcb56"]]), l1 = {
  __name: "DynamicVariables",
  emits: ["click"],
  setup(e, { emit: t }) {
    const n = mu(), { variables: s } = he(n), o = t;
    function i(r) {
      o("click", r);
    }
    return (r, a) => (g(), se(Vle, {
      label: "Dynamic Variables",
      buttonVariant: "outline-primary",
      buttonClass: "btn-xs"
    }, {
      default: B(() => [
        (g(!0), E(G, null, ge(C(s), (l, u) => (g(), se(a1, {
          key: u,
          label: u,
          isSubmenu: ""
        }, {
          default: B(() => [
            (g(!0), E(G, null, ge(l, (d, f) => (g(), se(a1, {
              onClick: (p) => i(d)
            }, {
              default: B(() => [
                te(F(f), 1)
              ]),
              _: 2
            }, 1032, ["onClick"]))), 256))
          ]),
          _: 2
        }, 1032, ["label"]))), 128))
      ]),
      _: 1
    }));
  }
}, Ble = {
  __name: "SubjectInput",
  props: {
    modelValue: { type: String },
    modelModifiers: {}
  },
  emits: ["update:modelValue"],
  setup(e, { expose: t }) {
    const n = At(e, "modelValue"), s = I(0);
    function o(r) {
      var a;
      s.value = ((a = r.target) == null ? void 0 : a.selectionStart) ?? 0;
    }
    function i(r) {
      n.value = qN(n.value, `[${r}]`, s.value);
    }
    return t({ insertDynamicVariable: i }), (r, a) => L((g(), E("input", {
      type: "text",
      class: "form-control form-control-sm",
      "onUpdate:modelValue": a[0] || (a[0] = (l) => n.value = l),
      onBlur: o,
      required: ""
    }, null, 544)), [
      [Ve, n.value]
    ]);
  }
}, Hle = { class: "email-properties d-flex flex-column gap-2" }, Yle = { class: "mb-2" }, Wle = {
  for: "email-from",
  class: "form-label"
}, Gle = { class: "d-flex gap-2" }, zle = ["placeholder"], Kle = ["value"], Xle = { class: "mb-2" }, qle = { class: "d-flex gap-2 align-items-center" }, Jle = {
  for: "email-to",
  class: "form-label"
}, Qle = { class: "small text-muted" }, Zle = { class: "mb-2" }, ece = { class: "d-flex gap-2" }, tce = {
  for: "email-subject",
  class: "form-label"
}, nce = { class: "d-flex gap-2" }, sce = {
  for: "email-body",
  class: "form-label"
}, oce = {
  __name: "EmailPanel",
  setup(e) {
    const t = fa(), n = mu(), { from: s, subject: o, body: i, fromName: r } = he(t), { user: a } = he(n), l = k(() => {
      var h;
      return ((h = a.value) == null ? void 0 : h.emails) ?? [];
    }), u = Io("body-textarea");
    function d(h) {
      u.value && typeof u.value.insertDynamicVariable == "function" && u.value.insertDynamicVariable(h);
    }
    const f = Io("subject-input");
    function p(h) {
      f.value && typeof f.value.insertDynamicVariable == "function" && f.value.insertDynamicVariable(h);
    }
    return (h, m) => {
      const v = Ht("tt");
      return g(), E("div", Hle, [
        c("div", Yle, [
          L((g(), E("label", Wle, m[4] || (m[4] = [
            te("From")
          ]))), [
            [v, void 0, "email_users_108"]
          ]),
          c("div", Gle, [
            L(c("input", {
              type: "text",
              id: "display-name",
              class: "form-control form-control-sm",
              placeholder: C(ls)("email_users_151"),
              "onUpdate:modelValue": m[0] || (m[0] = (_) => ut(r) ? r.value = _ : null)
            }, null, 8, zle), [
              [Ve, C(r)]
            ]),
            L(c("select", {
              class: "form-select form-select-sm flex-grow-1",
              "onUpdate:modelValue": m[1] || (m[1] = (_) => ut(s) ? s.value = _ : null)
            }, [
              (g(!0), E(G, null, ge(l.value, (_, b) => (g(), E("option", { value: _ }, F(_), 9, Kle))), 256))
            ], 512), [
              [Qt, C(s)]
            ])
          ])
        ]),
        c("div", Xle, [
          c("div", qle, [
            L((g(), E("label", Jle, m[5] || (m[5] = [
              te("To")
            ]))), [
              [v, void 0, "email_users_109"]
            ]),
            c("span", Qle, [
              m[6] || (m[6] = te("[")),
              L(c("span", null, null, 512), [
                [v, void 0, "email_users_137"]
              ]),
              m[7] || (m[7] = te("]"))
            ])
          ]),
          D(Ile)
        ]),
        c("div", Zle, [
          c("div", ece, [
            L((g(), E("label", tce, m[8] || (m[8] = [
              te("Subject")
            ]))), [
              [v, void 0, "email_users_10"]
            ]),
            D(l1, { onClick: p })
          ]),
          D(Ble, {
            ref: "subject-input",
            modelValue: C(o),
            "onUpdate:modelValue": m[2] || (m[2] = (_) => ut(o) ? o.value = _ : null)
          }, null, 8, ["modelValue"])
        ]),
        c("div", null, [
          c("div", nce, [
            L(c("label", sce, null, 512), [
              [v, void 0, "email_users_114"]
            ]),
            D(l1, { onClick: d })
          ]),
          D(Ale, {
            class: "form-control",
            modelValue: C(i),
            "onUpdate:modelValue": m[3] || (m[3] = (_) => ut(i) ? i.value = _ : null),
            ref: "body-textarea"
          }, null, 8, ["modelValue"])
        ])
      ]);
    };
  }
}, rce = /* @__PURE__ */ oe(oce, [["__scopeId", "data-v-bbf29bb4"]]), ice = ["disabled"], ace = {
  key: 0,
  class: "fas fa-spin fa-spinner fa-fw"
}, lce = {
  key: 1,
  class: "fas fa-envelope fa-fw"
}, cce = { class: "ms-1" }, uce = { class: "d-flex flex-column gap-2 confirmation-data" }, dce = { for: "from" }, fce = ["value"], pce = { key: 0 }, hce = { for: "fromName" }, mce = ["value"], vce = { for: "subject" }, gce = ["value"], _ce = { for: "body" }, yce = {
  class: "form-control form-control-sm",
  readonly: ""
}, bce = {
  __name: "SendButton",
  setup(e) {
    const t = an(), n = pa(), s = fa(), o = wl(), i = I(!1), r = Io("confirmation-modal"), { selected: a } = he(n), { from: l, subject: u, body: d, fromName: f } = he(s), p = (_) => window.filter_tags ? window.filter_tags(_) : _, h = k(() => {
      var w, y;
      const _ = p(((w = u.value) == null ? void 0 : w.trim()) ?? null), b = p(((y = d.value) == null ? void 0 : y.trim()) ?? null);
      return a.value, _ && b;
    }), m = async () => {
      var _;
      try {
        i.value = !0;
        const b = (_ = a.value) == null ? void 0 : _.query;
        await s.send(b), t.toast({ title: "Success", body: "Scheduled" });
      } finally {
        i.value = !1;
      }
    }, v = async () => {
      await r.value.show() && (await m(), await o.load());
    };
    return (_, b) => {
      const w = le("b-modal"), y = Ht("tt");
      return g(), E(G, null, [
        c("button", {
          type: "button",
          class: "btn btn-sm btn-primary",
          disabled: !h.value,
          onClick: v
        }, [
          i.value ? (g(), E("i", ace)) : (g(), E("i", lce)),
          L((g(), E("span", cce, b[0] || (b[0] = [
            te("Send")
          ]))), [
            [y, void 0, "email_users_158"]
          ])
        ], 8, ice),
        (g(), se(ns, { to: "body" }, [
          D(w, { ref: "confirmation-modal" }, {
            title: B(() => [
              L((g(), E("span", null, b[1] || (b[1] = [
                te("Please aaconfirm before sending")
              ]))), [
                [y, void 0, "email_users_131"]
              ])
            ]),
            default: B(() => {
              var x;
              return [
                c("div", uce, [
                  c("div", null, [
                    L((g(), E("label", dce, b[2] || (b[2] = [
                      te("From")
                    ]))), [
                      [y, void 0, "email_users_108"]
                    ]),
                    c("input", {
                      class: "form-control form-control-sm",
                      type: "text",
                      value: C(l),
                      readonly: ""
                    }, null, 8, fce)
                  ]),
                  (x = C(f)) != null && x.trim() ? (g(), E("div", pce, [
                    L((g(), E("label", hce, b[3] || (b[3] = [
                      te("From Name")
                    ]))), [
                      [y, void 0, "email_users_152"]
                    ]),
                    c("input", {
                      class: "form-control form-control-sm",
                      type: "text",
                      value: C(f),
                      readonly: ""
                    }, null, 8, mce)
                  ])) : ne("", !0),
                  c("div", null, [
                    L((g(), E("label", vce, b[4] || (b[4] = [
                      te("Subject")
                    ]))), [
                      [y, void 0, "email_users_10"]
                    ]),
                    c("input", {
                      class: "form-control form-control-sm",
                      type: "text",
                      value: C(u),
                      readonly: ""
                    }, null, 8, gce)
                  ]),
                  c("div", null, [
                    L((g(), E("label", _ce, b[5] || (b[5] = [
                      te("Message")
                    ]))), [
                      [y, void 0, "email_users_114"]
                    ]),
                    c("textarea", yce, F(C(d)), 1)
                  ])
                ])
              ];
            }),
            _: 1
          }, 512)
        ]))
      ], 64);
    };
  }
}, Ece = /* @__PURE__ */ oe(bce, [["__scopeId", "data-v-195bbd0e"]]), wce = { class: "p-2 d-flex flex-column gap-2" }, Sce = { class: "d-flex gap-2 align-items-center justify-content-end" }, xce = {
  __name: "HomePage",
  setup(e) {
    return (t, n) => {
      const s = le("router-view");
      return g(), E("div", wce, [
        D(rce),
        c("div", Sce, [
          D(Ece)
        ]),
        D(s)
      ]);
    };
  }
}, tv = Object.freeze({
  AND: "AND",
  AND_NOT: "AND NOT",
  OR: "OR",
  OR_NOT: "OR NOT"
}), JN = Object.freeze({
  EQUAL: { label: "=", value: "EQUAL", query: (e) => `= ${e}` },
  NOT_EQUAL: { label: "!=", value: "NOT_EQUAL", query: (e) => `!= ${e}` },
  LESS_THAN: { label: "<", value: "LESS_THAN", query: (e) => `< ${e}` },
  LESS_THAN_EQUAL: { label: "<=", value: "LESS_THAN_EQUAL", query: (e) => `<= ${e}` },
  GREATER_THAN: { label: ">", value: "GREATER_THAN", query: (e) => `> ${e}` },
  GREATER_THAN_EQUAL: { label: ">=", value: "GREATER_THAN_EQUAL", query: (e) => `>= ${e}` },
  CONTAINS: { label: "contains", value: "CONTAINS", query: (e) => `LIKE '%${e}%'` },
  DOES_NOT_CONTAIN: { label: "does not contain", value: "DOES_NOT_CONTAIN", query: (e) => `NOT LIKE '%${e}%'` },
  BEGINS_WITH: { label: "begins with", value: "BEGINS_WITH", query: (e) => `LIKE '${e}%'` },
  DOES_NOT_BEGIN_WITH: { label: "does not begin with", value: "DOES_NOT_BEGIN_WITH", query: (e) => `NOT LIKE '${e}%'` },
  ENDS_WITH: { label: "ends with", value: "ENDS_WITH", query: (e) => "LIKE '%value'" },
  DOES_NOT_ND_WITH: { label: "does not end with", value: "DOES_NOT_ND_WITH", query: (e) => `NOT LIKE '%${e}'` },
  IS_NULL: { label: "is null", value: "IS_NULL", query: () => "IS NULL" },
  IS_NOT_NULL: { label: "is not null", value: "IS_NOT_NULL", query: () => "IS NOT NULL" },
  IS_EMPTY: { label: "is empty", value: "IS_EMPTY", query: () => "= ''" },
  //(often implies a non-NULL empty string),
  IS_NOT_EMPTY: { label: "is not empty", value: "IS_NOT_EMPTY", query: () => "<> ''" },
  //(and optionally also `IS NOT NULL`, depending on your logic),
  IS_BETWEEN: { label: "is between", value: "IS_BETWEEN", query: (e, t) => `BETWEEN ${e} AND ${t}` },
  IS_NOT_BETWEEN: { label: "is not between", value: "IS_NOT_BETWEEN", query: (e, t) => `NOT BETWEEN ${e} AND ${t}` },
  IS_IN_LIST: { label: "is in list", value: "IS_IN_LIST", query: (e) => `IN (${{ ...e }})` },
  IS_NOT_IN_LIST: { label: "is not in list", value: "IS_NOT_IN_LIST", query: (e) => `NOT IN (${{ ...e }})` }
});
class ei {
  constructor(t = null, n = null, s = []) {
    this.field = t, this.condition = n, this.values = s, this.type = "rule";
  }
  toJSON() {
    return {
      type: this.type,
      field: this.field,
      condition: this.condition,
      values: this.values
    };
  }
  static fromJSON(t) {
    return new ei(t == null ? void 0 : t.field, t == null ? void 0 : t.condition, t == null ? void 0 : t.values);
  }
}
class il {
  constructor() {
    this.children = [], this.type = "group";
  }
  addChild(t, n = null) {
    this.children.push({ operator: n, node: t });
  }
  removeChild(t) {
    this.children.splice(t, 1);
  }
  toJSON() {
    return {
      type: this.type,
      children: this.children.map((t, n) => ({
        operator: t.operator,
        node: t.node.toJSON()
      }))
    };
  }
  static fromJSON(t) {
    const n = new il();
    return t.children.forEach((s) => {
      s.node.type === "rule" ? n.addChild(
        ei.fromJSON(s.node),
        s.operator
      ) : s.node.type === "group" && n.addChild(
        il.fromJSON(s.node),
        s.operator
      );
    }), n;
  }
}
class Nce {
  constructor(t) {
    this.qb = t;
  }
  moveNode(t, n, s = null) {
    let o;
    if (n.type === "group")
      o = n;
    else if (o = this.qb.parentMap.get(n), !o)
      throw new Error("Target node is not in any group.");
    if (t === o) return;
    const i = this.qb.parentMap.get(t);
    if (!i)
      throw new Error(
        "Cannot move the root node or a node without a parent."
      );
    const r = i.children.findIndex(
      (l) => l.node === t
    );
    if (r === -1)
      throw new Error("Node not found in its parent's children list.");
    const { operator: a } = i.children[r];
    i.removeChild(r), s === null || s < 0 || s > o.children.length ? o.children.push({ operator: a, node: t }) : o.children.splice(s, 0, { operator: a, node: t }), this.qb.parentMap.set(t, o);
  }
  canBePromoted(t) {
    const n = this.qb.parentMap.get(t);
    return !(!n || !this.qb.parentMap.get(n));
  }
  // move a node to the grandparent if possible
  promoteNode(t) {
    if (!this.canBePromoted(t)) return;
    const n = this.qb.parentMap.get(t), s = this.qb.parentMap.get(n), o = s.children.findIndex(
      (r) => r.node === n
    );
    if (o === -1) {
      console.warn("Parent not found in grandparent's children list.");
      return;
    }
    const i = o;
    this.moveNode(t, s, i);
  }
  canMoveUp(t) {
    const n = this.qb.parentMap.get(t);
    if (!n)
      return !1;
    const o = n.children.findIndex((i) => i.node === t);
    return o === -1 ? !1 : o > 0;
  }
  canMoveDown(t) {
    const n = this.qb.parentMap.get(t);
    if (!n)
      return !1;
    const s = n.children, o = s.findIndex((i) => i.node === t);
    return o === -1 ? !1 : o < s.length - 1;
  }
  moveUp(t) {
    const n = this.qb.parentMap.get(t);
    if (!n) {
      console.warn("Node has no parent (possibly root). Cannot move up.");
      return;
    }
    const o = n.children.findIndex((i) => i.node === t);
    if (o <= 0) {
      console.warn(
        "Node is already at the top or not found. Cannot move up."
      );
      return;
    }
    this.moveNode(t, n, o - 1);
  }
  moveDown(t) {
    const n = this.qb.parentMap.get(t);
    if (!n) {
      console.warn(
        "Node has no parent (possibly root). Cannot move down."
      );
      return;
    }
    const s = n.children, o = s.findIndex((i) => i.node === t);
    if (o === -1 || o === s.length - 1) {
      console.warn(
        "Node is already at the bottom or not found. Cannot move down."
      );
      return;
    }
    this.moveNode(t, n, o + 1);
  }
}
class sa {
  // key: node (Rule|Group), value: node (parent)
  constructor() {
    Qe(this, "autoIncrement", 0);
    // Instead of storing node.id directly, we store them in Maps
    Qe(this, "nodeById", /* @__PURE__ */ new Map());
    // key: string ID, value: node (Rule|Group)
    Qe(this, "idByNode", /* @__PURE__ */ new Map());
    // key: node (Rule|Group), value: string ID
    Qe(this, "parentMap", /* @__PURE__ */ new Map());
    this.root = new il(), this.registerNode(this.root, null), this.nodeMover = new Nce(this);
  }
  registerNode(t, n) {
    const s = String(++this.autoIncrement);
    this.nodeById.set(s, t), this.idByNode.set(t, s), this.parentMap.set(t, n);
  }
  getNodeId(t) {
    return this.idByNode.get(t) ?? null;
  }
  getNodeById(t) {
    return this.nodeById.get(String(t)) ?? null;
  }
  getNodeParent(t, n = 1) {
    for (; n-- > 0; )
      t = this.parentMap.get(t);
    return t;
  }
  /**
   * Now when you add children, just register them with the parent `Group`.
   */
  addGroup(t = null, n = null) {
    const s = new il(), o = n ?? this.root;
    return o.addChild(s, t), this.registerNode(s, o), this.addRule(new ei(), "AND", s), s;
  }
  addRule({ field: t, condition: n, values: s }, o = null, i = null) {
    const r = new ei(t, n, s), a = i ?? this.root;
    return a.addChild(r, o), this.registerNode(r, a), r;
  }
  removeNode(t, n = null) {
    n || (n = this.root);
    const s = n.children.findIndex(
      (o) => o.node === t
    );
    if (s !== -1) {
      const o = n.children[s].node;
      if (o.type === "group")
        for (; o.children.length > 0; )
          this.removeNode(o.children[0].node, o);
      n.removeChild(s);
      const i = this.getNodeId(o);
      return this.nodeById.delete(i), this.idByNode.delete(o), this.parentMap.delete(o), o;
    }
    for (const o of n.children)
      if (o.node.type === "group") {
        const i = this.removeNode(t, o.node);
        if (i) return i;
      }
    return null;
  }
  // Delegate moving methods to NodeMover.
  moveNode(t, n, s = null) {
    this.nodeMover.moveNode(t, n, s);
  }
  canBePromoted(t) {
    return this.nodeMover.canBePromoted(t);
  }
  promoteNode(t) {
    this.nodeMover.promoteNode(t);
  }
  canMoveUp(t) {
    return this.nodeMover.canMoveUp(t);
  }
  moveUp(t) {
    this.nodeMover.moveUp(t);
  }
  canMoveDown(t) {
    return this.nodeMover.canMoveDown(t);
  }
  moveDown(t) {
    this.nodeMover.moveDown(t);
  }
  toJSON() {
    return this.root.toJSON();
  }
  static fromJSON(t) {
    const n = new sa();
    n.root.children = [];
    function s(o, i, r) {
      if (o.type === "rule") {
        const { field: a, condition: l, values: u } = o, d = new ei(a, l, u);
        n.addRule(d, r, i);
      } else if (o.type === "group") {
        let a;
        i ? a = n.addGroup(r, i) : a = n.root, o.children.forEach((l) => {
          s(l.node, a, l.operator);
        });
      } else
        throw new Error(`Unknown node type: ${o.type}`);
    }
    if (t.type !== "group")
      throw new Error("Top-level JSON must describe a 'group'.");
    return t.children.forEach((o) => {
      s(
        o.node,
        /* parentGroup= */
        null,
        o.operator
      );
    }), n;
  }
}
const Cce = { class: "rounded border" }, Oce = {
  __name: "TestPage",
  setup(e) {
    const t = {
      type: "group",
      children: [
        {
          operator: "AND",
          node: {
            type: "rule",
            field: "user_email",
            condition: "is not equal",
            value: "past_3_months"
          }
        },
        {
          operator: "AND_NOT",
          node: {
            type: "rule",
            field: "user_expiration_date_TANGE",
            condition: "is between",
            value: null
          }
        }
      ]
    }, n = I(sa.fromJSON(t));
    return (s, o) => {
      const i = le("router-view");
      return g(), E("div", Cce, [
        te(F(n.value) + " ", 1),
        D(i)
      ]);
    };
  }
}, Tce = { class: "messages-table table table-sm table-hover table striped table-bordered" }, $ce = { key: 0 }, kce = { class: "d-flex gap-2 align-items-center" }, Dce = ["onClick"], Rce = {
  __name: "MessagesTable",
  emits: ["use-message"],
  setup(e, { emit: t }) {
    const n = ds();
    fs();
    const s = an(), o = wl(), i = fa();
    I(!1);
    const { list: r } = he(o), a = t, l = k(() => r.value || []), u = (p) => p ? p.length > 50 ? p.substring(0, 47) + "..." : p : "", d = (p) => p ? p.replace(/<[^>]*>/g, "") : "", f = (p) => {
      var h, m;
      i.subject = p.subject ?? "", i.body = p.body ?? "", (m = (h = window == null ? void 0 : window.tinymce) == null ? void 0 : h.activeEditor) == null || m.setContent(p.body), a("use-message", p), s.toast({ title: "Success", body: "Message loaded" }), n.push({ name: "home" });
    };
    return (p, h) => (g(), E("table", Tce, [
      h[2] || (h[2] = c("thead", null, [
        c("tr", null, [
          c("th", null, "Subject"),
          c("th", null, "Body (truncated)"),
          c("th", null, "Sent By"),
          c("th", null, "Sent At"),
          c("th", null, "Action")
        ])
      ], -1)),
      c("tbody", null, [
        l.value.length === 0 ? (g(), E("tr", $ce, h[0] || (h[0] = [
          c("td", { colspan: "5" }, [
            c("span", { class: "fst-italic" }, "No items")
          ], -1)
        ]))) : ne("", !0),
        (g(!0), E(G, null, ge(l.value, (m) => (g(), E("tr", {
          key: m.id
        }, [
          c("td", null, F(m.subject), 1),
          c("td", null, F(u(d(m.body))), 1),
          c("td", null, F(m.sent_by_username), 1),
          c("td", null, F(m.created_at), 1),
          c("td", null, [
            c("div", kce, [
              c("button", {
                class: "btn btn-xs btn-light",
                onClick: (v) => f(m)
              }, h[1] || (h[1] = [
                c("i", { class: "fas fa-file-import fa-fw" }, null, -1),
                te(" Re-use ")
              ]), 8, Dce)
            ])
          ])
        ]))), 128))
      ])
    ]));
  }
}, Ice = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw"
}, Ace = {
  key: 1,
  class: "fas fa-refresh fa-fw"
}, Mce = {
  __name: "LoadMessagesButton",
  setup(e) {
    const t = wl(), { list: n, loading: s } = he(t), { load: o } = t;
    return (i, r) => C(n).length > 0 ? (g(), E("button", {
      key: 0,
      class: "btn btn-sm btn-primary",
      onClick: r[0] || (r[0] = (...a) => C(o) && C(o)(...a))
    }, [
      C(s) ? (g(), E("i", Ice)) : (g(), E("i", Ace))
    ])) : ne("", !0);
  }
}, Pce = { class: "p-2" }, Lce = { class: "d-flex gap-2" }, Vce = {
  __name: "MessagesPage",
  setup(e) {
    const t = wl(), { page: n, perPage: s, total: o } = he(t), { load: i } = t;
    return nt(n, () => {
      i();
    }), (r, a) => {
      const l = le("b-pagination");
      return g(), E("div", Pce, [
        c("div", Lce, [
          c("div", null, [
            D(Mce)
          ]),
          D(l, {
            modelValue: C(n),
            "onUpdate:modelValue": a[0] || (a[0] = (u) => ut(n) ? n.value = u : null),
            totalItems: C(o),
            perPage: C(s),
            size: "sm",
            class: "mb-2"
          }, null, 8, ["modelValue", "totalItems", "perPage"])
        ]),
        D(Rce)
      ]);
    };
  }
}, Fce = ["value"], Uce = {
  __name: "SelectValueInput",
  props: /* @__PURE__ */ jn({
    config: { type: Object }
  }, {
    modelValue: { type: Array },
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(e) {
    const t = At(e, "modelValue"), n = k({
      get: () => t.value.at(0) ?? null,
      set: (s) => t.value = [s]
    });
    return (s, o) => {
      var i;
      return L((g(), E("select", {
        class: "form-select form-select-sm",
        "onUpdate:modelValue": o[0] || (o[0] = (r) => n.value = r)
      }, [
        o[1] || (o[1] = c("option", {
          value: "",
          disabled: ""
        }, "Select...", -1)),
        (g(!0), E(G, null, ge(((i = e.config) == null ? void 0 : i.options) ?? [], (r, a) => (g(), E("option", {
          key: a,
          value: a
        }, F(r), 9, Fce))), 128))
      ], 512)), [
        [Qt, n.value]
      ]);
    };
  }
}, jce = {
  __name: "DateValueInput",
  props: /* @__PURE__ */ jn({
    config: { type: Object }
  }, {
    modelValue: { type: Array },
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(e) {
    const t = At(e, "modelValue"), n = k({
      get: () => t.value.at(0),
      set: (s) => t.value = [s]
    });
    return (s, o) => L((g(), E("input", {
      class: "form-control form-control-sm",
      type: "date",
      "onUpdate:modelValue": o[0] || (o[0] = (i) => n.value = i)
    }, null, 512)), [
      [Ve, n.value]
    ]);
  }
}, Bce = { class: "d-flex gap-2" }, Hce = {
  __name: "DateRangeValueInput",
  props: /* @__PURE__ */ jn({
    config: { type: Object }
  }, {
    modelValue: { type: Array },
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(e) {
    const t = At(e, "modelValue"), n = I(), s = I();
    return nt(t, (o) => {
      const [i, r] = o;
      n.value = i || "", s.value = r || "";
    }, { immediate: !0 }), nt([n, s], () => {
      let o = [];
      n.value && o.push(n.value), s.value && o.push(s.value), t.value = o;
    }), (o, i) => (g(), E("div", Bce, [
      L(c("input", {
        class: "form-control form-control-sm",
        type: "date",
        "onUpdate:modelValue": i[0] || (i[0] = (r) => n.value = r)
      }, null, 512), [
        [Ve, n.value]
      ]),
      L(c("input", {
        class: "form-control form-control-sm",
        type: "date",
        "onUpdate:modelValue": i[1] || (i[1] = (r) => s.value = r)
      }, null, 512), [
        [Ve, s.value]
      ])
    ]));
  }
}, Yce = {
  __name: "StringValueInput",
  props: /* @__PURE__ */ jn({
    config: { type: Object }
  }, {
    modelValue: { type: Array },
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(e) {
    const t = At(e, "modelValue"), n = k({
      get: () => String(t.value ?? ""),
      set: (s) => t.value = [s]
    });
    return (s, o) => L((g(), E("input", {
      class: "form-control form-control-sm",
      type: "search",
      "onUpdate:modelValue": o[0] || (o[0] = (i) => n.value = i)
    }, null, 512)), [
      [Ve, n.value]
    ]);
  }
}, Wce = {
  class: "form-control form-control-sm",
  type: "search",
  disabled: ""
}, Gce = {
  __name: "NullValueInput",
  props: /* @__PURE__ */ jn({
    config: { type: Object }
  }, {
    modelValue: { type: Array },
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(e) {
    const t = At(e, "modelValue");
    return k({
      get: () => null,
      set: (n) => t.value = []
      // always set to empty
    }), (n, s) => (g(), E("input", Wce));
  }
}, zce = ["value"], Kce = ["disabled"], Xce = ["value"], qce = {
  key: 0,
  class: "form-control form-control-sm",
  type: "text",
  disabled: ""
}, Jce = { class: "ms-auto actions d-flex gap-2" }, Qce = ["disabled"], Zce = ["disabled"], eue = ["disabled"], tue = {
  __name: "PredefinedRule",
  props: /* @__PURE__ */ jn({
    config: {
      type: Array,
      required: !0
    }
  }, {
    modelValue: {
      type: Object,
      required: !0
    },
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(e) {
    const t = At(e, "modelValue"), n = e, s = $e("queryBuilder"), o = k(() => n.config.find((l) => l.name === t.value.field)), i = k(() => o.value ? o.value.conditions || [] : []), r = k(() => {
      var d, f;
      const l = (d = t.value) == null ? void 0 : d.condition;
      return ((f = i.value) == null ? void 0 : f[l]) ?? null;
    });
    nt(
      t,
      () => {
        const l = i.value;
        (!l || !Object.keys(l).includes(t.value.condition)) && (t.value.condition = "");
      },
      { deep: !0 }
    ), nt(
      () => t.value.field,
      (l, u) => {
        t.value.values = [], t.value.condition = null;
      }
    ), nt(
      r,
      (l, u) => {
        (l == null ? void 0 : l.inputType) !== (u == null ? void 0 : u.inputType) && (t.value.values = []);
      }
    );
    function a() {
      s.removeNode(t.value);
    }
    return (l, u) => {
      var d, f, p, h;
      return g(), E("div", {
        class: "rule d-flex gap-2 align-items-end border-start border-2 ps-2",
        key: C(s).getNodeId(t.value)
      }, [
        c("div", null, [
          u[11] || (u[11] = c("label", {
            class: "form-label",
            for: "field"
          }, "Field:", -1)),
          L(c("select", {
            class: "form-select form-select-sm",
            id: "field",
            "onUpdate:modelValue": u[0] || (u[0] = (m) => t.value.field = m)
          }, [
            u[10] || (u[10] = c("option", {
              value: "",
              disabled: ""
            }, "Select...", -1)),
            (g(!0), E(G, null, ge(e.config, (m) => (g(), E("option", {
              key: m.name,
              value: m.name
            }, F(m.label), 9, zce))), 128))
          ], 512), [
            [Qt, t.value.field]
          ])
        ]),
        c("div", null, [
          u[13] || (u[13] = c("label", {
            class: "form-label",
            for: "condition"
          }, "Condition:", -1)),
          L(c("select", {
            class: "form-select form-select-sm",
            id: "condition",
            "onUpdate:modelValue": u[1] || (u[1] = (m) => t.value.condition = m),
            disabled: !t.value.field
          }, [
            u[12] || (u[12] = c("option", {
              value: "",
              disabled: ""
            }, "Select...", -1)),
            (g(!0), E(G, null, ge(i.value, (m, v) => (g(), E("option", {
              key: v,
              value: v
            }, F(v), 9, Xce))), 128))
          ], 8, Kce), [
            [Qt, t.value.condition]
          ])
        ]),
        c("div", null, [
          u[14] || (u[14] = c("label", { class: "form-label" }, "Value:", -1)),
          r.value ? ((d = r.value) == null ? void 0 : d.inputType) === "select" ? (g(), se(Uce, {
            key: 1,
            modelValue: t.value.values,
            "onUpdate:modelValue": u[2] || (u[2] = (m) => t.value.values = m),
            config: r.value
          }, null, 8, ["modelValue", "config"])) : ((f = r.value) == null ? void 0 : f.inputType) === "date" ? (g(), se(jce, {
            key: 2,
            modelValue: t.value.values,
            "onUpdate:modelValue": u[3] || (u[3] = (m) => t.value.values = m),
            config: r.value
          }, null, 8, ["modelValue", "config"])) : ((p = r.value) == null ? void 0 : p.inputType) === "date_range" ? (g(), se(Hce, {
            key: 3,
            modelValue: t.value.values,
            "onUpdate:modelValue": u[4] || (u[4] = (m) => t.value.values = m),
            config: r.value
          }, null, 8, ["modelValue", "config"])) : ((h = r.value) == null ? void 0 : h.inputType) === "null" ? (g(), se(Gce, {
            key: 4,
            modelValue: t.value.values,
            "onUpdate:modelValue": u[5] || (u[5] = (m) => t.value.values = m),
            config: r.value
          }, null, 8, ["modelValue", "config"])) : (g(), se(Yce, {
            key: 5,
            modelValue: t.value.values,
            "onUpdate:modelValue": u[6] || (u[6] = (m) => t.value.values = m),
            config: r.value
          }, null, 8, ["modelValue", "config"])) : (g(), E("input", qce))
        ]),
        c("div", Jce, [
          c("button", {
            onClick: u[7] || (u[7] = (m) => C(s).moveUp(t.value)),
            class: "btn btn-xs btn-light",
            disabled: !C(s).canMoveUp(t.value)
          }, u[15] || (u[15] = [
            c("i", { class: "fas fa-chevron-up fa-fw text-primary" }, null, -1)
          ]), 8, Qce),
          c("button", {
            onClick: u[8] || (u[8] = (m) => C(s).moveDown(t.value)),
            class: "btn btn-xs btn-light",
            disabled: !C(s).canMoveDown(t.value)
          }, u[16] || (u[16] = [
            c("i", { class: "fas fa-chevron-down fa-fw text-primary" }, null, -1)
          ]), 8, Zce),
          c("button", {
            onClick: u[9] || (u[9] = (m) => C(s).promoteNode(t.value)),
            class: "btn btn-xs btn-light",
            disabled: !C(s).canBePromoted(t.value)
          }, u[17] || (u[17] = [
            c("i", { class: "fas fa-arrow-up-from-bracket fa-fw text-primary" }, null, -1)
          ]), 8, eue),
          c("button", {
            class: "btn btn-xs btn-light",
            type: "button",
            onClick: a
          }, u[18] || (u[18] = [
            c("i", { class: "fas fa-trash fa-fw text-danger" }, null, -1)
          ]))
        ])
      ]);
    };
  }
}, nue = /* @__PURE__ */ oe(tue, [["__scopeId", "data-v-e852c10f"]]), sue = ["disabled"], oue = {
  key: 0,
  class: "fas fa-spinner fa-spin fa-fw"
}, rue = {
  key: 1,
  class: "fas fa-save fa-fw"
}, iue = { class: "ms-1" }, aue = {
  __name: "SaveQueryButton",
  props: {
    id: { type: String },
    query: { type: Object, required: !0 },
    queryName: { type: String, required: !0 },
    queryDescription: { type: String, required: !0 }
  },
  emits: ["saved"],
  setup(e, { expose: t, emit: n }) {
    const s = e, o = n, i = pa(), r = $p(), a = I(!1), { id: l, query: u, queryName: d, queryDescription: f } = he(s), p = qe({
      query: { ...u.value },
      name: d.value,
      description: f.value
    }), h = k(() => {
      const _ = {
        query: u.value,
        name: d.value,
        description: f.value
      };
      return !Lo(p, _);
    }), m = k(
      () => Object.keys(u.value).length > 0 ? h.value && !a.value && d.value.trim() !== "" : !1
    ), v = async () => {
      try {
        a.value = !0;
        const _ = {
          id: l.value,
          name: d.value,
          description: f.value,
          query: u.value
        };
        if (await i.save(_), r.value.length > 0) return;
        await i.load(), p.query = _.query, p.name = _.name, p.description = _.description, o("saved", _);
      } finally {
        a.value = !1;
      }
    };
    return t({ isDirty: h }), (_, b) => {
      const w = Ht("tt");
      return g(), E("button", {
        type: "button",
        class: "btn btn-sm btn-primary",
        onClick: v,
        disabled: !m.value
      }, [
        a.value ? (g(), E("i", oue)) : (g(), E("i", rue)),
        L(c("span", iue, null, 512), [
          [w, void 0, "email_users_147"]
        ])
      ], 8, sue);
    };
  }
}, lue = { class: "d-flex flex-column px-2 gap-0 border rounded" }, cue = { class: "draggable-group d-flex flex-column" }, uue = ["draggable", "onDragstart", "onDragover", "onDragend", "onDrop"], due = {
  key: 0,
  class: "operator"
}, fue = { class: "d-flex align-items-center gap-2" }, pue = { class: "d-flex gap-2 my-2" }, hue = ["disabled"], mue = ["disabled"], vue = ["disabled"], gue = {
  __name: "GroupComponent",
  props: {
    modelValue: { type: Object, required: !0 },
    modelModifiers: {}
  },
  emits: ["update:modelValue"],
  setup(e) {
    const t = I(!1), n = At(e, "modelValue"), s = $e("queryBuilder"), o = $e("componentsRegistry"), i = () => {
      const v = {
        field: null,
        condition: JN.EQUAL.value
      }, _ = tv.AND;
      s.addRule(v, _, n.value);
    }, r = () => {
      const v = n.value.children.length > 0 ? tv.AND : null;
      s.addGroup(v, n.value);
    }, a = () => {
      s.removeNode(n.value);
    }, l = (v, _, b) => {
      s.draggedNode = v;
    }, u = (v, _, b) => {
    }, d = (v, _, b) => {
      s.moveNode(s.draggedNode, v, _), s.draggedNode = null;
    }, f = (v, _, b) => {
      const w = s.getNodeParent(v);
      w && (s.moveNode(s.draggedNode, w, _), s.draggedNode = null);
    }, p = (v, _, b) => {
      t.value = !1;
    }, h = () => t.value = !0, m = () => t.value = !1;
    return (v, _) => (g(), E("div", lue, [
      c("div", cue, [
        (g(!0), E(G, null, ge(n.value.children, (b, w) => (g(), E("div", {
          key: C(s).getNodeId(b == null ? void 0 : b.node),
          class: "child d-flex flex-column gap-2 border-dashed border-2",
          draggable: t.value,
          onDragstart: Rt((y) => l(b.node), ["self"]),
          onDragover: Rt((y) => u(b.node), ["prevent"]),
          onDragend: (y) => p(b.node),
          onDrop: Rt((y) => f(b.node, w), ["stop"])
        }, [
          b.operator && w > 0 ? (g(), E("div", due, [
            (g(), se(Hi(C(o).operatorSelect), {
              modelValue: b.operator,
              "onUpdate:modelValue": (y) => b.operator = y,
              class: "w-auto"
            }, null, 8, ["modelValue", "onUpdate:modelValue"]))
          ])) : ne("", !0),
          c("div", fue, [
            c("span", {
              class: "drag-handle",
              onMousedown: Rt(h, ["stop"]),
              onMouseup: Rt(m, ["stop"])
            }, _[3] || (_[3] = [
              c("i", { class: "fa-solid fa-grip-lines" }, null, -1)
            ]), 32),
            (g(), se(Hi(C(o).queryNode), {
              modelValue: b.node,
              "onUpdate:modelValue": (y) => b.node = y,
              onDrop: Rt((y) => d(b.node, w), ["stop"]),
              class: "flex-grow-1 my-2"
            }, null, 40, ["modelValue", "onUpdate:modelValue", "onDrop"]))
          ])
        ], 40, uue))), 128))
      ]),
      c("div", pue, [
        c("button", {
          class: "btn btn-xs btn-light",
          onClick: i
        }, _[4] || (_[4] = [
          c("i", { class: "fas fa-circle-plus fa-fw text-success" }, null, -1)
        ])),
        c("button", {
          class: "btn btn-xs btn-light",
          onClick: r
        }, _[5] || (_[5] = [
          c("i", { class: "fas fa-folder-plus fa-fw text-success" }, null, -1)
        ])),
        C(s).root !== n.value ? (g(), E(G, { key: 0 }, [
          c("button", {
            onClick: _[0] || (_[0] = (b) => C(s).moveUp(n.value)),
            class: "btn btn-xs btn-light",
            disabled: !C(s).canMoveUp(n.value)
          }, _[6] || (_[6] = [
            c("i", { class: "fas fa-chevron-up fa-fw text-primary" }, null, -1)
          ]), 8, hue),
          c("button", {
            onClick: _[1] || (_[1] = (b) => C(s).moveDown(n.value)),
            class: "btn btn-xs btn-light",
            disabled: !C(s).canMoveDown(n.value)
          }, _[7] || (_[7] = [
            c("i", { class: "fas fa-chevron-down fa-fw text-primary" }, null, -1)
          ]), 8, mue),
          c("button", {
            onClick: _[2] || (_[2] = (b) => C(s).promoteNode(n.value)),
            class: "btn btn-xs btn-light",
            disabled: !C(s).canBePromoted(n.value)
          }, _[8] || (_[8] = [
            c("i", { class: "fas fa-arrow-up-from-bracket fa-fw text-primary" }, null, -1)
          ]), 8, vue),
          c("button", {
            class: "btn btn-xs btn-light",
            onClick: a
          }, _[9] || (_[9] = [
            c("i", { class: "fas fa-trash fa-fw text-danger" }, null, -1)
          ]))
        ], 64)) : ne("", !0)
      ])
    ]));
  }
}, _ue = /* @__PURE__ */ oe(gue, [["__scopeId", "data-v-18617858"]]), yue = { value: "key" }, bue = {
  __name: "ConditionSelect",
  props: {
    modelValue: { type: String },
    modelModifiers: {}
  },
  emits: ["update:modelValue"],
  setup(e) {
    const t = At(e, "modelValue");
    return (n, s) => L((g(), E("select", {
      class: "form-select form-select-sm",
      id: "condition",
      "onUpdate:modelValue": s[0] || (s[0] = (o) => t.value = o)
    }, [
      (g(!0), E(G, null, ge(C(JN), ({ label: o, value: i }, r) => (g(), E("option", yue, F(o), 1))), 256))
    ], 512)), [
      [Qt, t.value]
    ]);
  }
}, Eue = { class: "border rounded p-2 my-2 d-flex gap-2 align-items-end" }, wue = {
  __name: "RuleComponent",
  props: {
    modelValue: { type: Object },
    modelModifiers: {}
  },
  emits: ["update:modelValue"],
  setup(e) {
    const t = At(e, "modelValue"), n = $e("queryBuilder"), s = () => {
      n.removeNode(t.value);
    };
    return (o, i) => (g(), E("div", Eue, [
      c("div", null, [
        i[3] || (i[3] = c("label", {
          class: "form-label",
          for: "field"
        }, "Field:", -1)),
        L(c("input", {
          class: "form-control form-control-sm",
          type: "text",
          id: "field",
          "onUpdate:modelValue": i[0] || (i[0] = (r) => t.value.field = r)
        }, null, 512), [
          [Ve, t.value.field]
        ])
      ]),
      c("div", null, [
        i[4] || (i[4] = c("label", {
          class: "form-label",
          for: "condition"
        }, "Condition:", -1)),
        D(bue, {
          modelValue: t.value.condition,
          "onUpdate:modelValue": i[1] || (i[1] = (r) => t.value.condition = r)
        }, null, 8, ["modelValue"])
      ]),
      c("div", null, [
        i[5] || (i[5] = c("label", {
          class: "form-label",
          for: "value"
        }, "Value:", -1)),
        L(c("input", {
          class: "form-control form-control-sm",
          type: "text",
          id: "value",
          "onUpdate:modelValue": i[2] || (i[2] = (r) => t.value.value = r)
        }, null, 512), [
          [Ve, t.value.value]
        ])
      ]),
      c("div", null, [
        c("button", {
          class: "btn btn-sm btn-danger",
          type: "button",
          onClick: s
        }, i[6] || (i[6] = [
          c("i", { class: "fas fa-trash fa-fw" }, null, -1)
        ]))
      ])
    ]));
  }
}, Sue = /* @__PURE__ */ oe(wue, [["__scopeId", "data-v-b0f124ba"]]), xue = {
  __name: "QueryNode",
  props: {
    modelValue: {
      type: Object,
      required: !0
    },
    modelModifiers: {}
  },
  emits: ["update:modelValue"],
  setup(e) {
    const t = $e("componentsRegistry"), n = At(e, "modelValue"), s = k(() => n.value instanceof ei ? t.rule : n.value instanceof il ? t.group : null);
    return (o, i) => (g(), se(Hi(s.value), {
      modelValue: n.value,
      "onUpdate:modelValue": i[0] || (i[0] = (r) => n.value = r)
    }, null, 8, ["modelValue"]));
  }
}, Nue = ["value"], Cue = {
  __name: "OperatorSelect",
  props: {
    modelValue: { type: String, default: "AND" },
    modelModifiers: {}
  },
  emits: ["update:modelValue"],
  setup(e) {
    const t = At(e, "modelValue");
    return (n, s) => L((g(), E("select", bn({
      class: "form-select form-select-sm",
      "onUpdate:modelValue": s[0] || (s[0] = (o) => t.value = o)
    }, n.$attrs), [
      (g(!0), E(G, null, ge(C(tv), (o, i) => (g(), E("option", { value: i }, F(o), 9, Nue))), 256))
    ], 16)), [
      [Qt, t.value]
    ]);
  }
}, Oue = { class: "query-builder" }, Tue = {
  __name: "QueryBuilderComponent",
  props: {
    groupComponent: {
      type: Object,
      default: _ue
    },
    ruleComponent: {
      type: Object,
      default: Sue
    },
    queryNodeComponent: {
      type: Object,
      default: xue
    },
    operatorSelectionComponent: {
      type: Object,
      default: Cue
    },
    queryBuilder: {
      type: sa,
      default: () => new sa()
    }
  },
  setup(e) {
    const t = e, n = Ra(t.queryBuilder), s = {
      group: t.groupComponent,
      rule: t.ruleComponent,
      queryNode: t.queryNodeComponent,
      operatorSelect: t.operatorSelectionComponent
    };
    return Cn("queryBuilder", n.value), Cn("componentsRegistry", s), (o, i) => (g(), E("div", Oue, [
      (g(), se(Hi(s.group), {
        modelValue: n.value.root,
        "onUpdate:modelValue": i[0] || (i[0] = (r) => n.value.root = r)
      }, null, 8, ["modelValue"]))
    ]));
  }
}, c1 = I(null);
function $ue() {
  return { beforeCloseRef: c1, setBeforeClose: (t) => {
    c1.value = t;
  } };
}
const kue = { class: "d-block" }, Due = { class: "fw-bold p-2 border-bottom rounded-top bg-light w-100" }, Rue = { key: 0 }, Iue = { key: 1 }, Aue = { class: "px-2 d-flex flex-column gap-2" }, Mue = { class: "form-wrapper" }, Pue = {
  class: "query-properties",
  style: { display: "contents" }
}, Lue = ["placeholder"], Vue = ["placeholder"], Fue = { class: "my-2 d-flex gap-2 justify-content-end actions" }, Uue = ["title", "disabled"], jue = {
  __name: "QueryManagerPage",
  setup(e) {
    const { setBeforeClose: t } = $ue(), n = mu(), s = pa(), { fieldsConfig: o } = he(n), i = Io("save-query-button-reference"), r = fs(), a = an(), l = ds(), u = Nr(), d = I(!1), f = I(""), p = I(""), h = k(() => u.params.id ?? null), m = k(() => h.value === null), v = I(O()), _ = k(() => {
      var T;
      return ((T = v.value) == null ? void 0 : T.toJSON()) ?? null;
    }), b = /* @__PURE__ */ Rn({
      name: "PredefinedRuleWrapper",
      inheritAttrs: !1,
      // if you don't want to automatically pass attributes
      setup(T, { attrs: R, slots: P }) {
        return () => Co(nue, {
          ...R,
          // forward any attributes/props
          config: o.value
          // preset our fieldsConfig
        });
      }
    }), w = () => l.push({ name: "home" }), y = () => {
      a.toast({ title: "Success", body: "Query saved" }), w();
    }, x = async () => {
      try {
        d.value = !0;
        const T = h.value;
        T && (await s.remove(T), await s.load()), w();
      } finally {
        d.value = !1;
      }
    }, N = async () => {
      await r.confirm({ title: "Confirm", body: "Are you sure you want to delete this item?" }) && (x(), w());
    };
    function S() {
      f.value = "", p.value = "";
      const T = new sa();
      return T.addRule(new ei(), "AND"), T;
    }
    function O() {
      const T = h.value;
      if (!T) return S();
      const R = s.getQuery(T);
      return R ? (f.value = R.name, p.value = R.description, sa.fromJSON(R.query)) : S();
    }
    const $ = async () => {
      var R;
      return ((R = i.value) == null ? void 0 : R.isDirty) ?? !1 ? await r.confirm({ title: "Confirm", body: "Unsaved changes detected. Are you sure you want to close?" }) : !0;
    };
    return vt(() => {
      t($);
    }), Fo(() => {
      t(null);
    }), (T, R) => {
      const P = Ht("auto-expand");
      return g(), E("div", kue, [
        c("div", Due, [
          h.value ? (g(), E("span", Rue, "Filter " + F(h.value), 1)) : (g(), E("span", Iue, "New Filter"))
        ]),
        c("div", Aue, [
          c("div", Mue, [
            c("div", Pue, [
              c("div", null, [
                R[2] || (R[2] = c("label", { for: "query-name" }, "Name", -1)),
                L(c("input", {
                  id: "query-name",
                  class: "form-control form-control-sm",
                  type: "text",
                  "onUpdate:modelValue": R[0] || (R[0] = (M) => f.value = M),
                  placeholder: C(ls)("email_users_query_name_placeholder")
                }, null, 8, Lue), [
                  [Ve, f.value]
                ])
              ]),
              c("div", null, [
                R[3] || (R[3] = c("label", { for: "query-description" }, "Description", -1)),
                L(c("textarea", {
                  id: "query-description",
                  class: "form-control form-control-sm",
                  "onUpdate:modelValue": R[1] || (R[1] = (M) => p.value = M),
                  placeholder: C(ls)("email_users_query_description_placeholder")
                }, null, 8, Vue), [
                  [P, 10],
                  [Ve, p.value]
                ])
              ])
            ]),
            c("div", null, [
              R[4] || (R[4] = c("label", { for: "query-rules" }, "User Filter", -1)),
              D(Tue, {
                id: "query-rules",
                "rule-component": C(b),
                queryBuilder: v.value
              }, null, 8, ["rule-component", "queryBuilder"])
            ])
          ]),
          c("div", Fue, [
            m.value ? ne("", !0) : (g(), E("button", {
              key: 0,
              title: C(ls)("email_users_142"),
              type: "button",
              class: "btn btn-sm btn-outline-danger",
              onClick: N,
              disabled: d.value
            }, R[5] || (R[5] = [
              c("i", { class: "fas fa-trash fa-fw" }, null, -1),
              c("span", null, "Delete", -1)
            ]), 8, Uue)),
            D(XN, {
              query: _.value,
              title: C(ls)("email_users_140")
            }, {
              default: B(() => R[6] || (R[6] = [
                c("span", { class: "ms-1" }, "Test", -1)
              ])),
              _: 1
            }, 8, ["query", "title"]),
            R[8] || (R[8] = c("div", { class: "me-auto" }, null, -1)),
            c("button", {
              type: "button",
              class: "btn btn-sm btn-secondary",
              onClick: w
            }, R[7] || (R[7] = [
              c("i", { class: "fas fa-times fa-fw" }, null, -1),
              c("span", null, "Close", -1)
            ])),
            D(aue, {
              ref: "save-query-button-reference",
              title: C(ls)("email_users_141"),
              id: h.value,
              query: _.value,
              queryName: f.value,
              queryDescription: p.value,
              onSaved: y
            }, null, 8, ["title", "id", "query", "queryName", "queryDescription"])
          ])
        ])
      ]);
    };
  }
}, u1 = /* @__PURE__ */ oe(jue, [["__scopeId", "data-v-5ceaf976"]]), Bue = [
  {
    path: "/",
    component: ele,
    // redirect: '/inbox',
    children: [
      { path: "", name: "home", component: xce, meta: { breadcrumb: "Compose Message" } },
      // { path: 'query', name: 'query-manager', component: QueryManagerPage },
      {
        path: "filter",
        // component: EmptyComponent,
        children: [
          { path: "", redirect: "new" },
          {
            // Route for creating a new query
            path: "new",
            name: "filter-new",
            component: u1,
            meta: { title: "New Filter", overlay: !0, hideMenu: !0 },
            props: { isNew: !0 }
            // Optional: pass a prop to help distinguish the mode
          },
          {
            // Route for editing an existing query
            path: ":id",
            name: "filter-edit",
            component: u1,
            meta: {
              title: (e) => `Filter ${e.params.id}`,
              overlay: !0,
              hideMenu: !0
            },
            props: !0
            // This passes the route param as a prop, so you can use `props.id` in the component
          }
        ]
      },
      {
        path: "messages",
        name: "messages",
        component: Vce,
        meta: { breadcrumb: "Messages" }
      },
      { path: "test", name: "test", component: Oce, meta: { breadcrumb: "Test" } }
    ]
  },
  { path: "/:pathMatch(.*)*", component: la }
];
let Ju;
const Hue = () => Ju || (Ju = ci({
  // Provide the history implementation to use. We are using the hash history for simplicity here.
  history: li(),
  routes: Bue
}), Ju), Sde = (e) => {
  const t = wn(zae), n = Hue(), s = _l();
  s.use(El), t.use(s), t.use(Cs), t.use(r_()), t.use(n), t.directive("tt", ap), t.directive("mytooltip", Tp), t.directive("auto-expand", Nq), t.mount(e);
  const o = t.runWithContext(() => Bae());
  return { app: t, router: n, store: o, eventBus: ta };
};
export {
  wde as BreakTheGlass,
  vde as CdisSettings,
  yde as CdpAutoAdjudicate,
  Ede as CdpMapping,
  fde as Datamart,
  pde as DatamartDesignChecker,
  Sde as EmailUsers,
  mde as MappingHelper,
  _de as ModalRoutes,
  lde as Parcel,
  cde as ParcelBadge,
  ude as QueueMonitor,
  gde as Rewards,
  hde as StoreTest
};
//# sourceMappingURL=lib.es.js.map
