const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["ListView-BOCHrncQ.js","strapi-ye6TfKul.js","strapi-D6821bIJ.css","sortable.esm-DYw6p_Rv.js","index-mKkR6X_j.js","groupBy-BW-FsOq9.js","_baseEach-BHFmNlG9.js","sortBy-BHPiSJWc.js","_baseMap-CagEH0Ml.js","index-Dll6c3MH.js","index-BRVyLNfZ.js"])))=>i.map(i=>d[i]);
import{gH as W,iY as my,fH as m,bU as Ne,ck as ke,bp as gy,aD as ze,jD as ht,ah as Np,ay as sT,by as zi,gG as lT,dN as Mp,aS as Pp,d4 as Hi,b_ as uT,gZ as hr,x as $p,d_ as Jn,eO as Wi,eR as cT,hl as Qr,i0 as pT,g1 as fn,jG as ft,iG as Ra,d$ as Rs,gL as Oo,iv as pt,bQ as vy,bN as dT,a7 as fT,hd as hT,co as yy,bw as mT,aI as gT,s as vT,c3 as yT,cG as _l,cQ as Yr,cz as fr,gr as Ca,gc as Ys,fs as xo,it as Ui,at as Xs,hh as by,bt as Dp,c7 as wl,dS as bT,a$ as xy,h1 as _y,bW as xT,ez as wy,cu as ky,k as In,F as _T,gX as fi,h9 as Fp,cf as kl,bu as Cy,fO as Sy,aJ as wT,aN as Lp,gq as hi,b5 as Os,S as kT,bS as CT,hg as Fi,ci,jB as Cl,a2 as ST,dI as Ey,cm as Bp,dP as Ay,dx as Zi,K as zo,hT as Ty,dT as ET,eI as Kt,fX as AT,hG as Sl,iU as Iy,fh as TT,iB as IT,ho as jT,iW as _o,hn as RT,dC as Jt,fY as im,dF as jy,hp as OT,cI as tt,eu as Ry,js as zT,aE as zs,fU as am,eE as NT,gQ as MT,aa as PT,g0 as $T,jp as io,g9 as sc,dQ as om,g$ as sm,cP as DT,cw as FT,aq as lm,bs as LT,fC as BT,cX as UT,aV as Up,aQ as Oy,eo as ZT,fP as HT,c8 as pr,jr as Xr,jw as Gn,fb as zy,gC as Ny,cx as My,cs as WT,bZ as qT,a3 as um,aU as VT,bR as GT,d0 as JT,cO as KT,av as YT,bx as XT,a9 as QT,b7 as eI,cA as tI,jC as nI,gA as rI,jH as iI,b2 as aI,t as oI,c4 as sI,fa as lI,H as uI,bi as cI,jv as pI,f_ as dI,h2 as fI,he as Py,en as hI,aF as mI,fQ as gI,f5 as vI,jo as yI,gd as bI,er as xI,jq as _I,dH as wI,g5 as kI,bC as CI,gh as SI,ji as EI,fK as AI,d2 as TI,cS as II,bk as lc,bP as $y,cZ as Dy,cL as Fy,aG as jI,O as RI,dL as OI,cn as zI,jy as NI,gD as MI,gy as Ly,jE as By,aW as Uy,cD as PI,B as $I,ax as DI,b8 as FI,jt as LI,c9 as BI,eF as UI,fV as ZI,hb as HI,gE as WI,fe as qI,ga as VI,ep as GI,g2 as JI,bD as KI,fL as YI,aO as XI,cT as QI,fJ as ej,fE as tj,aH as nj,c_ as rj,cM as ij,as as aj,bv as oj,cy as Zy,aC as sj,a as lj,jz as uj,gz as cj,aX as pj,cJ as dj,bX as fj,ac as hj,ai as mj,ca as gj,gF as vj,e as yj,b9 as bj,P as xj,ju as _j,fW as wj,hc as kj,jj as Cj,gb as Sj,g3 as Ej,bB as Aj,gg as Tj,d1 as Ij,cR as jj,aR as Rj,fD as Oj,bj as zj,bO as Nj,cY as Mj,cK as Pj,a1 as $j,ev as Dj,jx as Fj,gi as Lj,gx as Bj,cv as El,g4 as Hy,jl as Uj,dM as Zj,jA as Hj,cU as Wj,a0 as qj,c$ as Vj,dD as an,fx as Gj,dg as Jj,dy as Kj,dn as Yj,dj as Xj,du as Wy,fy as Qj,h5 as eR,dm as tR,h8 as nR,dz as rR,dr as iR,eX as Zp,dJ as aR,f6 as oR,ba as qy,ef as Vy,dp as sR,gW as lR,db as uR,e6 as Nt,ea as wo,es as Xt,eb as cr,h6 as uc,e5 as Wt,ec as cR,e8 as cm,ed as uo,ei as Gy,fi as pR,gV as dR,iF as fR,gR as hR,gl as mR,cF as gR,f7 as vR,bL as cc,bK as yR,p as bR,aZ as xR,c6 as _R,c5 as Ns,d5 as wR}from"./strapi-ye6TfKul.js";import{P as Rt}from"./index-mKkR6X_j.js";import{g as kR}from"./groupBy-BW-FsOq9.js";import{s as CR}from"./sortBy-BHPiSJWc.js";import{f as SR}from"./index-Dll6c3MH.js";const Jy=W.createContext(null),Hp=()=>{const e=W.useContext(Jy);if(!e)throw new Error("useCTBSession must be used within a CTBSessionProvider");return e},Oa=()=>{const{trackUsage:e}=my(),{sessionId:t}=Hp();return{trackUsage:W.useCallback((r,i)=>{const s={...i??{},ctbSessionId:t};return e(r,s)},[e,t])}},Ms={danger:{background:"danger100",borderColor:"danger200",textColor:"danger700"},warning:{background:"warning100",borderColor:"warning200",textColor:"warning600"}},ao=({title:e,variant:t="danger"})=>m.jsx(Ne,{padding:3,background:Ms[t].background,borderColor:Ms[t].borderColor,hasRadius:!0,width:"100%",children:m.jsxs(ke,{gap:2,children:[m.jsx(gy,{style:{minWidth:"16px"},fill:Ms[t].textColor}),m.jsx(ze,{variant:"omega",textColor:Ms[t].textColor,children:e})]})}),Ky=ht(Ne)`
  opacity: 0;
  transform: ${({$direction:e="up"})=>e==="up"?"translateY(10px)":"translateX(-10px)"};

  @media (prefers-reduced-motion: no-preference) {
    animation: ${({$direction:e="up"})=>e==="up"?"appearUp":"appearLeft"}
      ${({theme:e})=>e.motion.timings[200]}
      ${({theme:e})=>e.motion.easings.easeOutQuad} forwards;
  }

  @keyframes appearUp {
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes appearLeft {
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
`;var ER={STRAPI_AI_URL:"https://strapi-ai.apps.strapi.io"};const Yy="application/vnd.strapi.code",pc=15,AR=15*1024*1024,Xy=ER.STRAPI_AI_URL?.replace(/\/+$/,"")??"https://strapi-ai.apps.strapi.io",TR=`${Xy}/schemas/chat`,IR=e=>new Promise((t,n)=>{const r=new FileReader;r.onloadend=()=>t(r.result),r.onerror=n,r.readAsDataURL(e)}),jR=e=>e.startsWith("data:image/"),Wp=({src:e,alt:t,inferSize:n=!1,onLoad:r,onError:i,...s})=>{const[o,l]=W.useState(null),[c,p]=W.useState({}),[d,h]=W.useState(!0),[v,y]=W.useState(!1);W.useEffect(()=>{(async()=>{if(h(!0),y(!1),jR(e)){l(e),h(!1);return}try{const x=new URL(e);if(["strapi-ai-staging.s3.us-east-1.amazonaws.com","strapi-ai-production.s3.us-east-1.amazonaws.com"].includes(x.hostname)){l(e),h(!1);return}}catch{}try{const x=await fetch(e);if(!x.ok)throw new Error(`HTTP error! status: ${x.status}`);const S=await x.blob(),T=await IR(S);l(T),h(!1)}catch(x){console.error("Error converting image to base64:",x),y(!0),h(!1)}})()},[e,i]);const g=_=>{if(n){const{naturalWidth:x,naturalHeight:S}=_.currentTarget;p({width:x,height:S})}r&&r(_)};if(d)return m.jsx(ke,{direction:"column",gap:2,alignItems:"center",width:"100%",children:m.jsx(Np,{small:!0})});if(v)return m.jsx(ke,{direction:"column",gap:2,alignItems:"center",width:"100%",children:m.jsx(sT,{width:24,height:24,fill:"danger600"})});const k={src:o||"",alt:t,onLoad:g,...s};return n&&!s.width&&!s.height&&c.width&&c.height&&(k.width=c.width,k.height=c.height),o?m.jsx("img",{...k}):null},ga={fadeIn:zi`
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  `,scaleIn:zi`
    from {
      opacity: 0;
      transform: scale(0.7);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  `,slideUpIn:zi`
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  `,slideUpOut:zi`
    from {
      opacity: 1;
      transform: translateY(0);
    }
    to {
      opacity: 0;
      transform: translateY(10px);
    }
  `,slideDownIn:zi`
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  `,slideDownOut:zi`
    from {
      opacity: 1;
      transform: translateY(0);
    }
    to {
      opacity: 0;
      transform: translateY(-10px);
    }
  `},Qy=W.createContext(void 0),RR=(e,t)=>`${e}${Math.floor(t*255).toString(16).padStart(2,"0")}`,OR=ht.div`
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  pointer-events: auto; /* Explicitly enable pointer events */
  background: ${e=>RR(e.theme.colors.neutral800,.2)};
`,zR=ht.div`
  max-width: 80vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto; /* Explicitly enable pointer events */
  position: relative;
  animation: ${ga.scaleIn} 0.3s ease;
`,NR=ht(Wp)`
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  pointer-events: auto; /* Explicitly enable pointer events */
`,MR=({src:e,alt:t,onClose:n})=>{const r=W.useRef(null),i=W.useRef(null);return W.useEffect(()=>{const s=o=>{if(o.key==="Escape")return o.preventDefault(),o.stopPropagation(),n?.(),o.stopImmediatePropagation(),o.cancelBubble=!0,!1};return window.addEventListener("keydown",s,!0),()=>window.removeEventListener("keydown",s,!0)},[n]),W.useEffect(()=>{const s=p=>{p.target===r.current&&(p.preventDefault(),p.stopPropagation(),n?.())},o=p=>{p.stopPropagation()},l=r.current,c=i.current;return l&&l.addEventListener("click",s),c&&c.addEventListener("click",o),()=>{l&&l.removeEventListener("click",s),c&&c.removeEventListener("click",o)}},[n]),lT.createPortal(m.jsx(OR,{ref:r,children:m.jsx(zR,{ref:i,children:m.jsx(NR,{src:e,alt:t})})}),document.body)},PR=({children:e,src:t,alt:n,onClose:r,defaultOpen:i=!1})=>{const[s,o]=W.useState(i),l=()=>o(!0),c=()=>{o(!1),r?.()};return m.jsxs(Qy.Provider,{value:{isOpen:s,open:l,close:c,src:t,alt:n},children:[e,s&&m.jsx(MR,{src:t,alt:n,onClose:c})]})},$R=()=>{const e=W.useContext(Qy);if(!e)throw new Error("useFullScreenImage must be used within a FullScreenImage.Root");return e},DR=({children:e,asChild:t=!1})=>{const{open:n}=$R(),r=i=>{i.stopPropagation(),n()};return t?m.jsx("div",{onClick:r,style:{cursor:"pointer",display:"contents"},children:e}):m.jsx("div",{onClick:r,style:{cursor:"pointer"},children:e})},Qs={Root:PR,Trigger:DR},eb=W.createContext({error:null}),FR=()=>W.useContext(eb),LR=ht(Ne)`
  &:hover {
    cursor: pointer;
    background: ${({theme:e})=>e.colors.neutral100};
  }
`,BR=({children:e,error:t=null,minWidth:n,maxWidth:r})=>m.jsx(eb.Provider,{value:{error:t},children:m.jsxs(ke,{direction:"column",alignItems:"flex-start",gap:2,minWidth:n,maxWidth:r,children:[m.jsx(LR,{background:"neutral0",hasRadius:!0,borderColor:"neutral200",borderStyle:"solid",borderWidth:"1px",padding:2,width:"100%",children:m.jsx(ke,{gap:2,children:e})}),t&&m.jsx(ze,{variant:"pi",textColor:"danger500",children:t})]})}),UR=({children:e})=>{const{error:t}=FR();return m.jsx(ke,{alignItems:"center",justifyContent:"center",children:t?m.jsx(gy,{fill:"danger500"}):e})},ZR=({children:e})=>m.jsx(Ne,{grow:1,children:m.jsx(ze,{variant:"omega",ellipsis:!0,style:{userSelect:"none",maxWidth:"100px"},children:e})}),HR=({onClick:e})=>m.jsx(ke,{alignItems:"center",justifyContent:"center",shrink:0,onClick:e,children:m.jsx(Mp,{fill:"neutral500"})}),mi={Root:BR,Preview:UR,Title:ZR,Remove:HR},WR=ht(Wp)`
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: ${({theme:e})=>e.borderRadius};
`,qR=({attachment:e,onRemove:t,...n})=>m.jsx(Qs.Root,{src:e.url,alt:e.filename||"image",children:m.jsx(Qs.Trigger,{asChild:!0,children:m.jsxs(mi.Root,{...n,children:[m.jsx(mi.Preview,{children:e.status==="loading"?m.jsx(Np,{small:!0}):m.jsx(WR,{src:e.url,alt:e.filename})}),m.jsx(mi.Title,{children:e.filename||"unknown"}),t&&m.jsx(mi.Remove,{onClick:t})]})})}),VR=({attachment:e,onRemove:t,...n})=>m.jsxs(mi.Root,{...n,children:[m.jsx(mi.Preview,{children:e.status==="loading"?m.jsx(Np,{small:!0}):m.jsx(Pp,{height:24,width:24})}),m.jsx(mi.Title,{children:e.filename||"unknown"}),t&&m.jsx(mi.Remove,{onClick:t})]}),qp=({attachment:e,onRemove:t,...n})=>e.mediaType?.startsWith("image/")?m.jsx(qR,{attachment:e,onRemove:t,...n}):e.mediaType===Yy?m.jsx(VR,{attachment:e,onRemove:t,...n}):null,GR=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function Sa(e,t,n){const r=JR(e),{webkitRelativePath:i}=e,s=typeof t=="string"?t:typeof i=="string"&&i.length>0?i:`./${e.name}`;return typeof r.path!="string"&&pm(r,"path",s),pm(r,"relativePath",s),r}function JR(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),i=GR.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}function pm(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const KR=[".DS_Store","Thumbs.db"];function YR(e){return Hi(this,void 0,void 0,function*(){return el(e)&&XR(e.dataTransfer)?nO(e.dataTransfer,e.type):QR(e)?eO(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?tO(e):[]})}function XR(e){return el(e)}function QR(e){return el(e)&&el(e.target)}function el(e){return typeof e=="object"&&e!==null}function eO(e){return Jc(e.target.files).map(t=>Sa(t))}function tO(e){return Hi(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Sa(n))})}function nO(e,t){return Hi(this,void 0,void 0,function*(){if(e.items){const n=Jc(e.items).filter(i=>i.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(rO));return dm(tb(r))}return dm(Jc(e.files).map(n=>Sa(n)))})}function dm(e){return e.filter(t=>KR.indexOf(t.name)===-1)}function Jc(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function rO(e){if(typeof e.webkitGetAsEntry!="function")return fm(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?nb(t):fm(e,t)}function tb(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?tb(n):[n]],[])}function fm(e,t){return Hi(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const s=yield e.getAsFileSystemHandle();if(s===null)throw new Error(`${e} is not a File`);if(s!==void 0){const o=yield s.getFile();return o.handle=s,Sa(o)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return Sa(r,(n=t?.fullPath)!==null&&n!==void 0?n:void 0)})}function iO(e){return Hi(this,void 0,void 0,function*(){return e.isDirectory?nb(e):aO(e)})}function nb(e){const t=e.createReader();return new Promise((n,r)=>{const i=[];function s(){t.readEntries(o=>Hi(this,void 0,void 0,function*(){if(o.length){const l=Promise.all(o.map(iO));i.push(l),s()}else try{const l=yield Promise.all(i);n(l)}catch(l){r(l)}}),o=>{r(o)})}s()})}function aO(e){return Hi(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const i=Sa(r,e.fullPath);t(i)},r=>{n(r)})})})}var dc=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",i=(e.type||"").toLowerCase(),s=i.replace(/\/.*$/,"");return n.some(function(o){var l=o.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?s===l.replace(/\/.*$/,""):i===l})}return!0};function hm(e){return lO(e)||sO(e)||ib(e)||oO()}function oO(){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 sO(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function lO(e){if(Array.isArray(e))return Kc(e)}function mm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function gm(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?mm(Object(n),!0).forEach(function(r){rb(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):mm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function rb(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ko(e,t){return pO(e)||cO(e,t)||ib(e,t)||uO()}function uO(){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 ib(e,t){if(e){if(typeof e=="string")return Kc(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 Kc(e,t)}}function Kc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function cO(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,o,l;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(c){s=!0,l=c}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw l}}return r}}function pO(e){if(Array.isArray(e))return e}var dO=typeof dc=="function"?dc:dc.default,fO="file-invalid-type",hO="file-too-large",mO="file-too-small",gO="too-many-files",vO=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:fO,message:"File type must be ".concat(r)}},vm=function(t){return{code:hO,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},ym=function(t){return{code:mO,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},yO={code:gO,message:"Too many files"};function ab(e,t){var n=e.type==="application/x-moz-file"||dO(e,t);return[n,n?null:vO(t)]}function ob(e,t,n){if(Pi(e.size))if(Pi(t)&&Pi(n)){if(e.size>n)return[!1,vm(n)];if(e.size<t)return[!1,ym(t)]}else{if(Pi(t)&&e.size<t)return[!1,ym(t)];if(Pi(n)&&e.size>n)return[!1,vm(n)]}return[!0,null]}function Pi(e){return e!=null}function bO(e){var t=e.files,n=e.accept,r=e.minSize,i=e.maxSize,s=e.multiple,o=e.maxFiles,l=e.validator;return!s&&t.length>1||s&&o>=1&&t.length>o?!1:t.every(function(c){var p=ab(c,n),d=ko(p,1),h=d[0],v=ob(c,r,i),y=ko(v,1),g=y[0],k=l?l(c):null;return h&&g&&!k})}function tl(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Ps(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function bm(e){e.preventDefault()}function xO(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function _O(e){return e.indexOf("Edge/")!==-1}function wO(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return xO(e)||_O(e)}function Or(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var i=arguments.length,s=new Array(i>1?i-1:0),o=1;o<i;o++)s[o-1]=arguments[o];return t.some(function(l){return!tl(r)&&l&&l.apply(void 0,[r].concat(s)),tl(r)})}}function kO(){return"showOpenFilePicker"in window}function CO(e){if(Pi(e)){var t=Object.entries(e).filter(function(n){var r=ko(n,2),i=r[0],s=r[1],o=!0;return sb(i)||(console.warn('Skipped "'.concat(i,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),o=!1),(!Array.isArray(s)||!s.every(lb))&&(console.warn('Skipped "'.concat(i,'" because an invalid file extension was provided.')),o=!1),o}).reduce(function(n,r){var i=ko(r,2),s=i[0],o=i[1];return gm(gm({},n),{},rb({},s,o))},{});return[{description:"Files",accept:t}]}return e}function SO(e){if(Pi(e))return Object.entries(e).reduce(function(t,n){var r=ko(n,2),i=r[0],s=r[1];return[].concat(hm(t),[i],hm(s))},[]).filter(function(t){return sb(t)||lb(t)}).join(",")}function EO(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function AO(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function sb(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function lb(e){return/^.*\.[\w]+$/.test(e)}var TO=["children"],IO=["open"],jO=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],RO=["refKey","onChange","onClick"];function OO(e){return MO(e)||NO(e)||ub(e)||zO()}function zO(){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 NO(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function MO(e){if(Array.isArray(e))return Yc(e)}function fc(e,t){return DO(e)||$O(e,t)||ub(e,t)||PO()}function PO(){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 ub(e,t){if(e){if(typeof e=="string")return Yc(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 Yc(e,t)}}function Yc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function $O(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],i=!0,s=!1,o,l;try{for(n=n.call(e);!(i=(o=n.next()).done)&&(r.push(o.value),!(t&&r.length===t));i=!0);}catch(c){s=!0,l=c}finally{try{!i&&n.return!=null&&n.return()}finally{if(s)throw l}}return r}}function DO(e){if(Array.isArray(e))return e}function xm(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Yt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?xm(Object(n),!0).forEach(function(r){Xc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):xm(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Xc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function nl(e,t){if(e==null)return{};var n=FO(e,t),r,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)r=s[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function FO(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,s;for(s=0;s<r.length;s++)i=r[s],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}var Vp=W.forwardRef(function(e,t){var n=e.children,r=nl(e,TO),i=pb(r),s=i.open,o=nl(i,IO);return W.useImperativeHandle(t,function(){return{open:s}},[s]),uT.createElement(W.Fragment,null,n(Yt(Yt({},o),{},{open:s})))});Vp.displayName="Dropzone";var cb={disabled:!1,getFilesFromEvent:YR,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};Vp.defaultProps=cb;Vp.propTypes={children:Rt.func,accept:Rt.objectOf(Rt.arrayOf(Rt.string)),multiple:Rt.bool,preventDropOnDocument:Rt.bool,noClick:Rt.bool,noKeyboard:Rt.bool,noDrag:Rt.bool,noDragEventsBubbling:Rt.bool,minSize:Rt.number,maxSize:Rt.number,maxFiles:Rt.number,disabled:Rt.bool,getFilesFromEvent:Rt.func,onFileDialogCancel:Rt.func,onFileDialogOpen:Rt.func,useFsAccessApi:Rt.bool,autoFocus:Rt.bool,onDragEnter:Rt.func,onDragLeave:Rt.func,onDragOver:Rt.func,onDrop:Rt.func,onDropAccepted:Rt.func,onDropRejected:Rt.func,onError:Rt.func,validator:Rt.func};var Qc={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function pb(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=Yt(Yt({},cb),e),n=t.accept,r=t.disabled,i=t.getFilesFromEvent,s=t.maxSize,o=t.minSize,l=t.multiple,c=t.maxFiles,p=t.onDragEnter,d=t.onDragLeave,h=t.onDragOver,v=t.onDrop,y=t.onDropAccepted,g=t.onDropRejected,k=t.onFileDialogCancel,_=t.onFileDialogOpen,x=t.useFsAccessApi,S=t.autoFocus,T=t.preventDropOnDocument,I=t.noClick,O=t.noKeyboard,R=t.noDrag,B=t.noDragEventsBubbling,L=t.onError,V=t.validator,q=W.useMemo(function(){return SO(n)},[n]),D=W.useMemo(function(){return CO(n)},[n]),X=W.useMemo(function(){return typeof _=="function"?_:_m},[_]),M=W.useMemo(function(){return typeof k=="function"?k:_m},[k]),Y=W.useRef(null),w=W.useRef(null),F=W.useReducer(LO,Qc),_e=fc(F,2),se=_e[0],pe=_e[1],N=se.isFocused,Ee=se.isFileDialogActive,ie=W.useRef(typeof window<"u"&&window.isSecureContext&&x&&kO()),z=function(){!ie.current&&Ee&&setTimeout(function(){if(w.current){var he=w.current.files;he.length||(pe({type:"closeDialog"}),M())}},300)};W.useEffect(function(){return window.addEventListener("focus",z,!1),function(){window.removeEventListener("focus",z,!1)}},[w,Ee,M,ie]);var je=W.useRef([]),le=function(he){Y.current&&Y.current.contains(he.target)||(he.preventDefault(),je.current=[])};W.useEffect(function(){return T&&(document.addEventListener("dragover",bm,!1),document.addEventListener("drop",le,!1)),function(){T&&(document.removeEventListener("dragover",bm),document.removeEventListener("drop",le))}},[Y,T]),W.useEffect(function(){return!r&&S&&Y.current&&Y.current.focus(),function(){}},[Y,S,r]);var ne=W.useCallback(function(re){L?L(re):console.error(re)},[L]),Je=W.useCallback(function(re){re.preventDefault(),re.persist(),J(re),je.current=[].concat(OO(je.current),[re.target]),Ps(re)&&Promise.resolve(i(re)).then(function(he){if(!(tl(re)&&!B)){var U=he.length,oe=U>0&&bO({files:he,accept:q,minSize:o,maxSize:s,multiple:l,maxFiles:c,validator:V}),Ce=U>0&&!oe;pe({isDragAccept:oe,isDragReject:Ce,isDragActive:!0,type:"setDraggedFiles"}),p&&p(re)}}).catch(function(he){return ne(he)})},[i,p,ne,B,q,o,s,l,c,V]),Ke=W.useCallback(function(re){re.preventDefault(),re.persist(),J(re);var he=Ps(re);if(he&&re.dataTransfer)try{re.dataTransfer.dropEffect="copy"}catch{}return he&&h&&h(re),!1},[h,B]),ce=W.useCallback(function(re){re.preventDefault(),re.persist(),J(re);var he=je.current.filter(function(oe){return Y.current&&Y.current.contains(oe)}),U=he.indexOf(re.target);U!==-1&&he.splice(U,1),je.current=he,!(he.length>0)&&(pe({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ps(re)&&d&&d(re))},[Y,d,B]),Oe=W.useCallback(function(re,he){var U=[],oe=[];re.forEach(function(Ce){var Se=ab(Ce,q),Ue=fc(Se,2),dt=Ue[0],xt=Ue[1],It=ob(Ce,o,s),Xe=fc(It,2),Vt=Xe[0],jt=Xe[1],yt=V?V(Ce):null;if(dt&&Vt&&!yt)U.push(Ce);else{var mt=[xt,jt];yt&&(mt=mt.concat(yt)),oe.push({file:Ce,errors:mt.filter(function(kn){return kn})})}}),(!l&&U.length>1||l&&c>=1&&U.length>c)&&(U.forEach(function(Ce){oe.push({file:Ce,errors:[yO]})}),U.splice(0)),pe({acceptedFiles:U,fileRejections:oe,isDragReject:oe.length>0,type:"setFiles"}),v&&v(U,oe,he),oe.length>0&&g&&g(oe,he),U.length>0&&y&&y(U,he)},[pe,l,q,o,s,c,v,y,g,V]),ve=W.useCallback(function(re){re.preventDefault(),re.persist(),J(re),je.current=[],Ps(re)&&Promise.resolve(i(re)).then(function(he){tl(re)&&!B||Oe(he,re)}).catch(function(he){return ne(he)}),pe({type:"reset"})},[i,Oe,ne,B]),Re=W.useCallback(function(){if(ie.current){pe({type:"openDialog"}),X();var re={multiple:l,types:D};window.showOpenFilePicker(re).then(function(he){return i(he)}).then(function(he){Oe(he,null),pe({type:"closeDialog"})}).catch(function(he){EO(he)?(M(he),pe({type:"closeDialog"})):AO(he)?(ie.current=!1,w.current?(w.current.value=null,w.current.click()):ne(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ne(he)});return}w.current&&(pe({type:"openDialog"}),X(),w.current.value=null,w.current.click())},[pe,X,M,x,Oe,ne,D,l]),Ge=W.useCallback(function(re){!Y.current||!Y.current.isEqualNode(re.target)||(re.key===" "||re.key==="Enter"||re.keyCode===32||re.keyCode===13)&&(re.preventDefault(),Re())},[Y,Re]),Ze=W.useCallback(function(){pe({type:"focus"})},[]),E=W.useCallback(function(){pe({type:"blur"})},[]),ue=W.useCallback(function(){I||(wO()?setTimeout(Re,0):Re())},[I,Re]),H=function(he){return r?null:he},$=function(he){return O?null:H(he)},C=function(he){return R?null:H(he)},J=function(he){B&&he.stopPropagation()},ge=W.useMemo(function(){return function(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=re.refKey,U=he===void 0?"ref":he,oe=re.role,Ce=re.onKeyDown,Se=re.onFocus,Ue=re.onBlur,dt=re.onClick,xt=re.onDragEnter,It=re.onDragOver,Xe=re.onDragLeave,Vt=re.onDrop,jt=nl(re,jO);return Yt(Yt(Xc({onKeyDown:$(Or(Ce,Ge)),onFocus:$(Or(Se,Ze)),onBlur:$(Or(Ue,E)),onClick:H(Or(dt,ue)),onDragEnter:C(Or(xt,Je)),onDragOver:C(Or(It,Ke)),onDragLeave:C(Or(Xe,ce)),onDrop:C(Or(Vt,ve)),role:typeof oe=="string"&&oe!==""?oe:"presentation"},U,Y),!r&&!O?{tabIndex:0}:{}),jt)}},[Y,Ge,Ze,E,ue,Je,Ke,ce,ve,O,R,r]),be=W.useCallback(function(re){re.stopPropagation()},[]),ee=W.useMemo(function(){return function(){var re=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},he=re.refKey,U=he===void 0?"ref":he,oe=re.onChange,Ce=re.onClick,Se=nl(re,RO),Ue=Xc({accept:q,multiple:l,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:H(Or(oe,ve)),onClick:H(Or(Ce,be)),tabIndex:-1},U,w);return Yt(Yt({},Ue),Se)}},[w,n,l,ve,r]);return Yt(Yt({},se),{},{isFocused:N&&!r,getRootProps:ge,getInputProps:ee,rootRef:Y,inputRef:w,open:H(Re)})}function LO(e,t){switch(t.type){case"focus":return Yt(Yt({},e),{},{isFocused:!0});case"blur":return Yt(Yt({},e),{},{isFocused:!1});case"openDialog":return Yt(Yt({},Qc),{},{isFileDialogActive:!0});case"closeDialog":return Yt(Yt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return Yt(Yt({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return Yt(Yt({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return Yt({},Qc);default:return e}}function _m(){}const BO=({onAddFiles:e,isEnabled:t=!1})=>{const n=W.useCallback(async r=>{if(!t)return;const i=r.clipboardData?.items;if(!i||i.length===0)return;const s=[];for(const o of i)if(o.kind==="file"){const l=o.getAsFile();l&&l.type.startsWith("image/")&&s.push(l)}s.length>0&&(e(s),r.preventDefault())},[t,e]);W.useEffect(()=>(document.addEventListener("paste",n),()=>{document.removeEventListener("paste",n)}),[n])},db=W.createContext({}),UO=()=>W.useContext(db),ZO=({children:e,isEnabled:t=!0,onAddFiles:n=()=>{},accept:r={"image/*":[]},...i})=>{BO({onAddFiles:n,isEnabled:t});const{getRootProps:s,isDragActive:o}=pb({onDrop:n,noClick:!0,noKeyboard:!0,accept:r});return m.jsx(db.Provider,{value:{isEnabled:t,isDragActive:o,onAddFiles:n},children:m.jsx(ke,{direction:"column",alignItems:"flex-start",width:"100%",position:"relative",...s(),...i,children:e})})},HO=({error:e,title:t,...n})=>{const{isEnabled:r,isDragActive:i}=UO();if(!i)return null;const s=t||"Drop images here";return m.jsxs(ke,{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:2,cursor:r?"pointer":"not-allowed",width:"100%",height:"100%",borderStyle:"dashed",borderColor:e?"danger600":"primary500",background:e?"danger100":"primary100",hasRadius:!0,padding:7,justifyContent:"center",direction:"column",alignItems:"center",gap:2,...n,children:[m.jsx(Ne,{width:"24px",height:"24px",children:m.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[m.jsx("path",{d:"M19.5 13.572L12 6.072L4.5 13.572",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M12 6.072V20.072",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),m.jsx("path",{d:"M3.9998 20.072H20.0001",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]})}),m.jsxs(ke,{direction:"column",alignItems:"center",gap:2,children:[m.jsx(ze,{variant:"omega",textColor:"neutral600",textAlign:"center",children:s}),e&&m.jsx(ze,{variant:"pi",textColor:"danger600",children:e})]})]})},fb={Root:ZO,Area:HO},hb=W.createContext({size:"md",position:"bottom-right",isOpen:!1,onToggle:()=>{}}),wm={sm:{width:"350px",height:"500px"},md:{width:"480px",height:"600px"},lg:{width:"600px",height:"700px"}},WO={"bottom-right":{bottom:4,right:4},"bottom-left":{bottom:4,left:4},"top-right":{top:4,right:4},"top-left":{top:4,left:4}},qO=ht(Ne)`
  position: fixed;
  display: flex;
  flex-direction: column;
  z-index: 11;
  align-items: ${({$position:e})=>e.includes("right")?"flex-end":"flex-start"};
  ${({$position:e,theme:t})=>Object.entries(WO[e]).reduce((n,[r,i])=>({...n,[r]:t.spaces[i]}),{})}
`,VO=ht(Ne)`
  width: ${({$size:e})=>wm[e].width};
  max-height: 85vh;
  max-width: 85vw;
  display: flex;
  flex-direction: column;
  height: ${({$size:e})=>wm[e].height};

  @media (prefers-reduced-motion: no-preference) {
    animation-duration: 200ms;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);

    &[data-state='open'] {
      animation-name: ${({$position:e})=>e.startsWith("top")?ga.slideDownIn:ga.slideUpIn};
    }

    &[data-state='closed'] {
      animation-timing-function: cubic-bezier(0.25, 0.46, 0.45, 0.94);
      animation-name: ${({$position:e})=>e.startsWith("top")?ga.slideDownOut:ga.slideUpOut};
    }
  }
`,GO=({children:e,size:t="md",position:n="bottom-right",isOpen:r=!1,onToggle:i=()=>{},toggleIcon:s})=>m.jsx(hb.Provider,{value:{size:t,position:n,isOpen:r,onToggle:i},children:m.jsxs(qO,{$position:n,children:[r?m.jsx(VO,{$size:t,$position:n,background:"neutral0",shadow:"popupShadow",hasRadius:!0,borderColor:"neutral200",borderStyle:"solid",borderWidth:"1px","data-state":r?"open":"closed",children:e}):null,s&&!r&&s]})}),JO=({children:e})=>m.jsx(Ne,{padding:[2,2,2,4],borderColor:"neutral150",borderStyle:"solid",borderWidth:"0 0 1px 0",children:m.jsx(ke,{justifyContent:"space-between",alignItems:"center",children:e})}),KO=({children:e})=>m.jsx(Ne,{padding:4,flex:"1",overflow:"auto",children:e}),YO=({children:e})=>m.jsx(Ne,{padding:4,children:e}),XO=({label:e})=>{const{onToggle:t}=QO();return m.jsx(hr,{onClick:t,variant:"ghost",label:e||"Close",children:m.jsx($p,{})})},oo={Root:GO,Header:JO,Body:KO,Footer:YO,Close:XO},QO=()=>W.useContext(hb),mb=e=>m.jsxs("svg",{width:e.width||16,height:e.height||16,viewBox:"0 0 200 300",xmlns:"http://www.w3.org/2000/svg","aria-label":"Figma logo",style:{display:"block",margin:"0 auto",...e.style},...e,children:[m.jsx("title",{children:"Figma.logo"}),m.jsx("desc",{children:"Created using Figma"}),m.jsx("path",{d:"M50 300c27.6 0 50-22.4 50-50v-50H50c-27.6 0-50 22.4-50 50s22.4 50 50 50z",fill:"#0acf83"}),m.jsx("path",{d:"M50 200c-27.6 0-50-22.4-50-50s22.4-50 50-50h50v100H50z",fill:"#a259ff"}),m.jsx("path",{d:"M0 50C0 22.4 22.4 0 50 0h50v100H50C22.4 100 0 77.6 0 50z",fill:"#f24e1e"}),m.jsx("path",{d:"M100 0h50c27.6 0 50 22.4 50 50s-22.4 50-50 50h-50V0z",fill:"#ff7262"}),m.jsx("path",{d:"M200 150c0 27.6-22.4 50-50 50s-50-22.4-50-50 22.4-50 50-50 50 22.4 50 50z",fill:"#1abcfe"})]}),ez=e=>m.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:m.jsx("rect",{x:"2",y:"2",width:"11",height:"11",rx:"2",fill:"white"})}),tz=W.createContext({}),nz=({children:e,isLoading:t=!1,...n})=>m.jsx(tz.Provider,{value:{isLoading:t},children:m.jsx(ke,{direction:"column",alignItems:"flex-start",width:"100%",position:"relative",...n,children:e})}),rz=({children:e,...t})=>m.jsx(Ne,{position:"absolute",bottom:"102%",left:0,right:0,background:"neutral0",width:"100%",...t,children:e}),iz=ht(Ne)`
  padding: ${({theme:e})=>e.spaces[3]} 0};
`,az=({children:e,gap:t=2,...n})=>m.jsx(ke,{gap:t,wrap:"wrap",paddingBottom:2,maxHeight:"150px",overflow:"auto",...n,children:e}),oz=ht(Ne)`
  outline: none;
  box-shadow: none;
  transition-property: border-color, box-shadow, fill;
  transition-duration: 0.2s;

  &:focus-within {
    border: 1px solid
      ${({theme:e,$hasError:t})=>t?e.colors.danger600:e.colors.primary600};
    box-shadow: ${({theme:e,$hasError:t})=>t?e.colors.danger600:e.colors.primary600}
      0px 0px 0px 2px;
  }
`,sz=({children:e,disclaimer:t,error:n=!1,...r})=>m.jsxs(oz,{background:"neutral0",hasRadius:!0,borderColor:n?"danger600":"neutral200",borderWidth:"1px",borderStyle:"solid",width:"100%",$hasError:n,...r,children:[m.jsx(Ne,{padding:3,children:e}),t&&m.jsx(Ne,{background:"neutral100",padding:[2,3],borderColor:"neutral200",borderWidth:"1px 0 0 0",borderStyle:"solid",borderRadius:"0 0 4px 4px",children:m.jsx(ze,{variant:"pi",textColor:"neutral600",children:t})})]}),lz=({children:e})=>m.jsx(ke,{justifyContent:"flex-end",alignItems:"center",gap:2,children:e}),Ni={Root:nz,Header:rz,HeaderItem:iz,Attachments:az,Content:sz,Actions:lz};function uz(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const cz=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,pz=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,dz={};function km(e,t){return(dz.jsx?pz:cz).test(e)}const fz=/[ \t\n\f\r]/g;function hz(e){return typeof e=="object"?e.type==="text"?Cm(e.value):!1:Cm(e)}function Cm(e){return e.replace(fz,"")===""}class No{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}No.prototype.normal={};No.prototype.property={};No.prototype.space=void 0;function gb(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new No(n,r,t)}function ep(e){return e.toLowerCase()}class Fn{constructor(t,n){this.attribute=n,this.property=t}}Fn.prototype.attribute="";Fn.prototype.booleanish=!1;Fn.prototype.boolean=!1;Fn.prototype.commaOrSpaceSeparated=!1;Fn.prototype.commaSeparated=!1;Fn.prototype.defined=!1;Fn.prototype.mustUseProperty=!1;Fn.prototype.number=!1;Fn.prototype.overloadedBoolean=!1;Fn.prototype.property="";Fn.prototype.spaceSeparated=!1;Fn.prototype.space=void 0;let mz=0;const ot=qi(),un=qi(),tp=qi(),Ae=qi(),zt=qi(),_a=qi(),Vn=qi();function qi(){return 2**++mz}const np=Object.freeze(Object.defineProperty({__proto__:null,boolean:ot,booleanish:un,commaOrSpaceSeparated:Vn,commaSeparated:_a,number:Ae,overloadedBoolean:tp,spaceSeparated:zt},Symbol.toStringTag,{value:"Module"})),hc=Object.keys(np);class Gp extends Fn{constructor(t,n,r,i){let s=-1;if(super(t,n),Sm(this,"space",i),typeof r=="number")for(;++s<hc.length;){const o=hc[s];Sm(this,hc[s],(r&np[o])===np[o])}}}Gp.prototype.defined=!0;function Sm(e,t,n){n&&(e[t]=n)}function za(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Gp(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[ep(r)]=r,n[ep(s.attribute)]=r}return new No(t,n,e.space)}const vb=za({properties:{ariaActiveDescendant:null,ariaAtomic:un,ariaAutoComplete:null,ariaBusy:un,ariaChecked:un,ariaColCount:Ae,ariaColIndex:Ae,ariaColSpan:Ae,ariaControls:zt,ariaCurrent:null,ariaDescribedBy:zt,ariaDetails:null,ariaDisabled:un,ariaDropEffect:zt,ariaErrorMessage:null,ariaExpanded:un,ariaFlowTo:zt,ariaGrabbed:un,ariaHasPopup:null,ariaHidden:un,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:zt,ariaLevel:Ae,ariaLive:null,ariaModal:un,ariaMultiLine:un,ariaMultiSelectable:un,ariaOrientation:null,ariaOwns:zt,ariaPlaceholder:null,ariaPosInSet:Ae,ariaPressed:un,ariaReadOnly:un,ariaRelevant:null,ariaRequired:un,ariaRoleDescription:zt,ariaRowCount:Ae,ariaRowIndex:Ae,ariaRowSpan:Ae,ariaSelected:un,ariaSetSize:Ae,ariaSort:null,ariaValueMax:Ae,ariaValueMin:Ae,ariaValueNow:Ae,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function yb(e,t){return t in e?e[t]:t}function bb(e,t){return yb(e,t.toLowerCase())}const gz=za({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:_a,acceptCharset:zt,accessKey:zt,action:null,allow:null,allowFullScreen:ot,allowPaymentRequest:ot,allowUserMedia:ot,alt:null,as:null,async:ot,autoCapitalize:null,autoComplete:zt,autoFocus:ot,autoPlay:ot,blocking:zt,capture:null,charSet:null,checked:ot,cite:null,className:zt,cols:Ae,colSpan:null,content:null,contentEditable:un,controls:ot,controlsList:zt,coords:Ae|_a,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ot,defer:ot,dir:null,dirName:null,disabled:ot,download:tp,draggable:un,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ot,formTarget:null,headers:zt,height:Ae,hidden:tp,high:Ae,href:null,hrefLang:null,htmlFor:zt,httpEquiv:zt,id:null,imageSizes:null,imageSrcSet:null,inert:ot,inputMode:null,integrity:null,is:null,isMap:ot,itemId:null,itemProp:zt,itemRef:zt,itemScope:ot,itemType:zt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ot,low:Ae,manifest:null,max:null,maxLength:Ae,media:null,method:null,min:null,minLength:Ae,multiple:ot,muted:ot,name:null,nonce:null,noModule:ot,noValidate:ot,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:ot,optimum:Ae,pattern:null,ping:zt,placeholder:null,playsInline:ot,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ot,referrerPolicy:null,rel:zt,required:ot,reversed:ot,rows:Ae,rowSpan:Ae,sandbox:zt,scope:null,scoped:ot,seamless:ot,selected:ot,shadowRootClonable:ot,shadowRootDelegatesFocus:ot,shadowRootMode:null,shape:null,size:Ae,sizes:null,slot:null,span:Ae,spellCheck:un,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ae,step:null,style:null,tabIndex:Ae,target:null,title:null,translate:null,type:null,typeMustMatch:ot,useMap:null,value:un,width:Ae,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:zt,axis:null,background:null,bgColor:null,border:Ae,borderColor:null,bottomMargin:Ae,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ot,declare:ot,event:null,face:null,frame:null,frameBorder:null,hSpace:Ae,leftMargin:Ae,link:null,longDesc:null,lowSrc:null,marginHeight:Ae,marginWidth:Ae,noResize:ot,noHref:ot,noShade:ot,noWrap:ot,object:null,profile:null,prompt:null,rev:null,rightMargin:Ae,rules:null,scheme:null,scrolling:un,standby:null,summary:null,text:null,topMargin:Ae,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ae,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ot,disableRemotePlayback:ot,prefix:null,property:null,results:Ae,security:null,unselectable:null},space:"html",transform:bb}),vz=za({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Vn,accentHeight:Ae,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ae,amplitude:Ae,arabicForm:null,ascent:Ae,attributeName:null,attributeType:null,azimuth:Ae,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ae,by:null,calcMode:null,capHeight:Ae,className:zt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ae,diffuseConstant:Ae,direction:null,display:null,dur:null,divisor:Ae,dominantBaseline:null,download:ot,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ae,enableBackground:null,end:null,event:null,exponent:Ae,externalResourcesRequired:null,fill:null,fillOpacity:Ae,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:_a,g2:_a,glyphName:_a,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ae,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ae,horizOriginX:Ae,horizOriginY:Ae,id:null,ideographic:Ae,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ae,k:Ae,k1:Ae,k2:Ae,k3:Ae,k4:Ae,kernelMatrix:Vn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ae,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ae,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ae,overlineThickness:Ae,paintOrder:null,panose1:null,path:null,pathLength:Ae,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:zt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ae,pointsAtY:Ae,pointsAtZ:Ae,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Vn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Vn,rev:Vn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Vn,requiredFeatures:Vn,requiredFonts:Vn,requiredFormats:Vn,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ae,specularExponent:Ae,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ae,strikethroughThickness:Ae,string:null,stroke:null,strokeDashArray:Vn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ae,strokeOpacity:Ae,strokeWidth:null,style:null,surfaceScale:Ae,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Vn,tabIndex:Ae,tableValues:null,target:null,targetX:Ae,targetY:Ae,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Vn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ae,underlineThickness:Ae,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ae,values:null,vAlphabetic:Ae,vMathematical:Ae,vectorEffect:null,vHanging:Ae,vIdeographic:Ae,version:null,vertAdvY:Ae,vertOriginX:Ae,vertOriginY:Ae,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ae,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:yb}),xb=za({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),_b=za({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:bb}),wb=za({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),yz={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},bz=/[A-Z]/g,Em=/-[a-z]/g,xz=/^data[-\w.:]+$/i;function _z(e,t){const n=ep(t);let r=t,i=Fn;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&xz.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(Em,kz);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!Em.test(s)){let o=s.replace(bz,wz);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Gp}return new i(r,t)}function wz(e){return"-"+e.toLowerCase()}function kz(e){return e.charAt(1).toUpperCase()}const Cz=gb([vb,gz,xb,_b,wb],"html"),Jp=gb([vb,vz,xb,_b,wb],"svg");function Sz(e){return e.join(" ").trim()}var Kp={},Am=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,Ez=/\n/g,Az=/^\s*/,Tz=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Iz=/^:\s*/,jz=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,Rz=/^[;\s]*/,Oz=/^\s+|\s+$/g,zz=`
`,Tm="/",Im="*",$i="",Nz="comment",Mz="declaration";function Pz(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function i(g){var k=g.match(Ez);k&&(n+=k.length);var _=g.lastIndexOf(zz);r=~_?g.length-_:r+g.length}function s(){var g={line:n,column:r};return function(k){return k.position=new o(g),p(),k}}function o(g){this.start=g,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function l(g){var k=new Error(t.source+":"+n+":"+r+": "+g);if(k.reason=g,k.filename=t.source,k.line=n,k.column=r,k.source=e,!t.silent)throw k}function c(g){var k=g.exec(e);if(k){var _=k[0];return i(_),e=e.slice(_.length),k}}function p(){c(Az)}function d(g){var k;for(g=g||[];k=h();)k!==!1&&g.push(k);return g}function h(){var g=s();if(!(Tm!=e.charAt(0)||Im!=e.charAt(1))){for(var k=2;$i!=e.charAt(k)&&(Im!=e.charAt(k)||Tm!=e.charAt(k+1));)++k;if(k+=2,$i===e.charAt(k-1))return l("End of comment missing");var _=e.slice(2,k-2);return r+=2,i(_),e=e.slice(k),r+=2,g({type:Nz,comment:_})}}function v(){var g=s(),k=c(Tz);if(k){if(h(),!c(Iz))return l("property missing ':'");var _=c(jz),x=g({type:Mz,property:jm(k[0].replace(Am,$i)),value:_?jm(_[0].replace(Am,$i)):$i});return c(Rz),x}}function y(){var g=[];d(g);for(var k;k=v();)k!==!1&&(g.push(k),d(g));return g}return p(),y()}function jm(e){return e?e.replace(Oz,$i):$i}var $z=Pz,Dz=Jn&&Jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Kp,"__esModule",{value:!0});Kp.default=Lz;const Fz=Dz($z);function Lz(e,t){let n=null;if(!e||typeof e!="string")return n;const r=(0,Fz.default)(e),i=typeof t=="function";return r.forEach(s=>{if(s.type!=="declaration")return;const{property:o,value:l}=s;i?t(o,l,s):l&&(n=n||{},n[o]=l)}),n}var Al={};Object.defineProperty(Al,"__esModule",{value:!0});Al.camelCase=void 0;var Bz=/^--[a-zA-Z0-9_-]+$/,Uz=/-([a-z])/g,Zz=/^[^-]+$/,Hz=/^-(webkit|moz|ms|o|khtml)-/,Wz=/^-(ms)-/,qz=function(e){return!e||Zz.test(e)||Bz.test(e)},Vz=function(e,t){return t.toUpperCase()},Rm=function(e,t){return"".concat(t,"-")},Gz=function(e,t){return t===void 0&&(t={}),qz(e)?e:(e=e.toLowerCase(),t.reactCompat?e=e.replace(Wz,Rm):e=e.replace(Hz,Rm),e.replace(Uz,Vz))};Al.camelCase=Gz;var Jz=Jn&&Jn.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},Kz=Jz(Kp),Yz=Al;function rp(e,t){var n={};return!e||typeof e!="string"||(0,Kz.default)(e,function(r,i){r&&i&&(n[(0,Yz.camelCase)(r,t)]=i)}),n}rp.default=rp;var Xz=rp;const Qz=Wi(Xz),kb=Cb("end"),Yp=Cb("start");function Cb(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function eN(e){const t=Yp(e),n=kb(e);if(t&&n)return{start:t,end:n}}function go(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Om(e.position):"start"in e||"end"in e?Om(e):"line"in e||"column"in e?ip(e):""}function ip(e){return zm(e&&e.line)+":"+zm(e&&e.column)}function Om(e){return ip(e&&e.start)+"-"+ip(e&&e.end)}function zm(e){return e&&typeof e=="number"?e:1}class wn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?s.ruleId=r:(s.source=r.slice(0,c),s.ruleId=r.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=go(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}wn.prototype.file="";wn.prototype.name="";wn.prototype.reason="";wn.prototype.message="";wn.prototype.stack="";wn.prototype.column=void 0;wn.prototype.line=void 0;wn.prototype.ancestors=void 0;wn.prototype.cause=void 0;wn.prototype.fatal=void 0;wn.prototype.place=void 0;wn.prototype.ruleId=void 0;wn.prototype.source=void 0;const Xp={}.hasOwnProperty,tN=new Map,nN=/[A-Z]/g,rN=new Set(["table","tbody","thead","tfoot","tr"]),iN=new Set(["td","th"]),Sb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function aN(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=fN(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=dN(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Jp:Cz,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=Eb(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function Eb(e,t,n){if(t.type==="element")return oN(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return sN(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return uN(e,t,n);if(t.type==="mdxjsEsm")return lN(e,t);if(t.type==="root")return cN(e,t,n);if(t.type==="text")return pN(e,t)}function oN(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Jp,e.schema=i),e.ancestors.push(t);const s=Tb(e,t.tagName,!1),o=hN(e,t);let l=ed(e,t);return rN.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!hz(c):!0})),Ab(e,o,s,t),Qp(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function sN(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Co(e,t.position)}function lN(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Co(e,t.position)}function uN(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Jp,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:Tb(e,t.name,!0),o=mN(e,t),l=ed(e,t);return Ab(e,o,s,t),Qp(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function cN(e,t,n){const r={};return Qp(r,ed(e,t)),e.create(t,e.Fragment,r,n)}function pN(e,t){return t.value}function Ab(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Qp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function dN(e,t,n){return r;function r(i,s,o,l){const p=Array.isArray(o.children)?n:t;return l?p(s,o,l):p(s,o)}}function fN(e,t){return n;function n(r,i,s,o){const l=Array.isArray(s.children),c=Yp(r);return t(i,s,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function hN(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Xp.call(t.properties,i)){const s=gN(e,i,t.properties[i]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&iN.has(t.tagName)?r=l:n[o]=l}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function mN(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else Co(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else Co(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function ed(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:tN;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const c=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(c){const p=i.get(c)||0;o=c+"-"+p,i.set(c,p+1)}}const l=Eb(e,s,o);l!==void 0&&n.push(l)}return n}function gN(e,t,n){const r=_z(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?uz(n):Sz(n)),r.property==="style"){let i=typeof n=="object"?n:vN(e,String(n));return e.stylePropertyNameCase==="css"&&(i=yN(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?yz[r.property]||r.property:r.attribute,n]}}function vN(e,t){try{return Qz(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new wn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Sb+"#cannot-parse-style-attribute",i}}function Tb(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const l=km(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(s&&l.type==="Literal"),optional:!1}:l}r=o}else r=km(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Xp.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);Co(e)}function Co(e,t){const n=new wn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Sb+"#cannot-handle-mdx-estrees-without-createevaluater",n}function yN(e){const t={};let n;for(n in e)Xp.call(e,n)&&(t[bN(n)]=e[n]);return t}function bN(e){let t=e.replace(nN,xN);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function xN(e){return"-"+e.toLowerCase()}const mc={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},_N={};function wN(e,t){const n=_N,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Ib(e,r,i)}function Ib(e,t,n){if(kN(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Nm(e.children,t,n)}return Array.isArray(e)?Nm(e,t,n):""}function Nm(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=Ib(e[i],t,n);return r.join("")}function kN(e){return!!(e&&typeof e=="object")}const Mm=document.createElement("i");function td(e){const t="&"+e+";";Mm.innerHTML=t;const n=Mm.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Dr(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function dr(e,t){return e.length>0?(Dr(e,e.length,0,t),e):t}const Pm={}.hasOwnProperty;function CN(e){const t={};let n=-1;for(;++n<e.length;)SN(t,e[n]);return t}function SN(e,t){let n;for(n in t){const i=(Pm.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){Pm.call(i,o)||(i[o]=[]);const l=s[o];EN(i[o],Array.isArray(l)?l:l?[l]:[])}}}function EN(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Dr(e,0,0,r)}function jb(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function wa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const $r=bi(/[A-Za-z]/),Kn=bi(/[\dA-Za-z]/),AN=bi(/[#-'*+\--9=?A-Z^-~]/);function ap(e){return e!==null&&(e<32||e===127)}const op=bi(/\d/),TN=bi(/[\dA-Fa-f]/),IN=bi(/[!-/:-@[-`{-~]/);function Qe(e){return e!==null&&e<-2}function Dn(e){return e!==null&&(e<0||e===32)}function wt(e){return e===-2||e===-1||e===32}const jN=bi(new RegExp("\\p{P}|\\p{S}","u")),RN=bi(/\s/);function bi(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Na(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&Kn(e.charCodeAt(n+1))&&Kn(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Mt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(c){return wt(c)?(e.enter(n),l(c)):t(c)}function l(c){return wt(c)&&s++<i?(e.consume(c),l):(e.exit(n),t(c))}}const ON={tokenize:zN};function zN(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Mt(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),s(l)}function s(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return Qe(l)?(e.consume(l),e.exit("chunkText"),s):(e.consume(l),o)}}const NN={tokenize:MN},$m={tokenize:PN};function MN(e){const t=this,n=[];let r=0,i,s,o;return l;function l(T){if(r<n.length){const I=n[r];return t.containerState=I[1],e.attempt(I[0].continuation,c,p)(T)}return p(T)}function c(T){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&S();const I=t.events.length;let O=I,R;for(;O--;)if(t.events[O][0]==="exit"&&t.events[O][1].type==="chunkFlow"){R=t.events[O][1].end;break}x(r);let B=I;for(;B<t.events.length;)t.events[B][1].end={...R},B++;return Dr(t.events,O+1,0,t.events.slice(I)),t.events.length=B,p(T)}return l(T)}function p(T){if(r===n.length){if(!i)return v(T);if(i.currentConstruct&&i.currentConstruct.concrete)return g(T);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check($m,d,h)(T)}function d(T){return i&&S(),x(r),v(T)}function h(T){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,g(T)}function v(T){return t.containerState={},e.attempt($m,y,g)(T)}function y(T){return r++,n.push([t.currentConstruct,t.containerState]),v(T)}function g(T){if(T===null){i&&S(),x(0),e.consume(T);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),k(T)}function k(T){if(T===null){_(e.exit("chunkFlow"),!0),x(0),e.consume(T);return}return Qe(T)?(e.consume(T),_(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(T),k)}function _(T,I){const O=t.sliceStream(T);if(I&&O.push(null),T.previous=s,s&&(s.next=T),s=T,i.defineSkip(T.start),i.write(O),t.parser.lazy[T.start.line]){let R=i.events.length;for(;R--;)if(i.events[R][1].start.offset<o&&(!i.events[R][1].end||i.events[R][1].end.offset>o))return;const B=t.events.length;let L=B,V,q;for(;L--;)if(t.events[L][0]==="exit"&&t.events[L][1].type==="chunkFlow"){if(V){q=t.events[L][1].end;break}V=!0}for(x(r),R=B;R<t.events.length;)t.events[R][1].end={...q},R++;Dr(t.events,L+1,0,t.events.slice(B)),t.events.length=R}}function x(T){let I=n.length;for(;I-- >T;){const O=n[I];t.containerState=O[1],O[0].exit.call(t,e)}n.length=T}function S(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function PN(e,t,n){return Mt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Dm(e){if(e===null||Dn(e)||RN(e))return 1;if(jN(e))return 2}function nd(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const sp={name:"attention",resolveAll:$N,tokenize:DN};function $N(e,t){let n=-1,r,i,s,o,l,c,p,d;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const h={...e[r][1].end},v={...e[n][1].start};Fm(h,-c),Fm(v,c),o={type:c>1?"strongSequence":"emphasisSequence",start:h,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:v},s={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},p=[],e[r][1].end.offset-e[r][1].start.offset&&(p=dr(p,[["enter",e[r][1],t],["exit",e[r][1],t]])),p=dr(p,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),p=dr(p,nd(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),p=dr(p,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(d=2,p=dr(p,[["enter",e[n][1],t],["exit",e[n][1],t]])):d=0,Dr(e,r-1,n-r+3,p),n=r+p.length-d-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function DN(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Dm(r);let s;return o;function o(c){return s=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===s)return e.consume(c),l;const p=e.exit("attentionSequence"),d=Dm(c),h=!d||d===2&&i||n.includes(c),v=!i||i===2&&d||n.includes(r);return p._open=!!(s===42?h:h&&(i||!v)),p._close=!!(s===42?v:v&&(d||!h)),t(c)}}function Fm(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const FN={name:"autolink",tokenize:LN};function LN(e,t,n){let r=0;return i;function i(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(y){return $r(y)?(e.consume(y),o):y===64?n(y):p(y)}function o(y){return y===43||y===45||y===46||Kn(y)?(r=1,l(y)):p(y)}function l(y){return y===58?(e.consume(y),r=0,c):(y===43||y===45||y===46||Kn(y))&&r++<32?(e.consume(y),l):(r=0,p(y))}function c(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||ap(y)?n(y):(e.consume(y),c)}function p(y){return y===64?(e.consume(y),d):AN(y)?(e.consume(y),p):n(y)}function d(y){return Kn(y)?h(y):n(y)}function h(y){return y===46?(e.consume(y),r=0,d):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):v(y)}function v(y){if((y===45||Kn(y))&&r++<63){const g=y===45?v:h;return e.consume(y),g}return n(y)}}const Tl={partial:!0,tokenize:BN};function BN(e,t,n){return r;function r(s){return wt(s)?Mt(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||Qe(s)?t(s):n(s)}}const Rb={continuation:{tokenize:ZN},exit:HN,name:"blockQuote",tokenize:UN};function UN(e,t,n){const r=this;return i;function i(o){if(o===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return wt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function ZN(e,t,n){const r=this;return i;function i(o){return wt(o)?Mt(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(Rb,t,n)(o)}}function HN(e){e.exit("blockQuote")}const Ob={name:"characterEscape",tokenize:WN};function WN(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return IN(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const zb={name:"characterReference",tokenize:qN};function qN(e,t,n){const r=this;let i=0,s,o;return l;function l(h){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),c}function c(h){return h===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(h),e.exit("characterReferenceMarkerNumeric"),p):(e.enter("characterReferenceValue"),s=31,o=Kn,d(h))}function p(h){return h===88||h===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(h),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=TN,d):(e.enter("characterReferenceValue"),s=7,o=op,d(h))}function d(h){if(h===59&&i){const v=e.exit("characterReferenceValue");return o===Kn&&!td(r.sliceSerialize(v))?n(h):(e.enter("characterReferenceMarker"),e.consume(h),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(h)&&i++<s?(e.consume(h),d):n(h)}}const Lm={partial:!0,tokenize:GN},Bm={concrete:!0,name:"codeFenced",tokenize:VN};function VN(e,t,n){const r=this,i={partial:!0,tokenize:O};let s=0,o=0,l;return c;function c(R){return p(R)}function p(R){const B=r.events[r.events.length-1];return s=B&&B[1].type==="linePrefix"?B[2].sliceSerialize(B[1],!0).length:0,l=R,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(R)}function d(R){return R===l?(o++,e.consume(R),d):o<3?n(R):(e.exit("codeFencedFenceSequence"),wt(R)?Mt(e,h,"whitespace")(R):h(R))}function h(R){return R===null||Qe(R)?(e.exit("codeFencedFence"),r.interrupt?t(R):e.check(Lm,k,I)(R)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(R))}function v(R){return R===null||Qe(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),h(R)):wt(R)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Mt(e,y,"whitespace")(R)):R===96&&R===l?n(R):(e.consume(R),v)}function y(R){return R===null||Qe(R)?h(R):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(R))}function g(R){return R===null||Qe(R)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),h(R)):R===96&&R===l?n(R):(e.consume(R),g)}function k(R){return e.attempt(i,I,_)(R)}function _(R){return e.enter("lineEnding"),e.consume(R),e.exit("lineEnding"),x}function x(R){return s>0&&wt(R)?Mt(e,S,"linePrefix",s+1)(R):S(R)}function S(R){return R===null||Qe(R)?e.check(Lm,k,I)(R):(e.enter("codeFlowValue"),T(R))}function T(R){return R===null||Qe(R)?(e.exit("codeFlowValue"),S(R)):(e.consume(R),T)}function I(R){return e.exit("codeFenced"),t(R)}function O(R,B,L){let V=0;return q;function q(w){return R.enter("lineEnding"),R.consume(w),R.exit("lineEnding"),D}function D(w){return R.enter("codeFencedFence"),wt(w)?Mt(R,X,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(w):X(w)}function X(w){return w===l?(R.enter("codeFencedFenceSequence"),M(w)):L(w)}function M(w){return w===l?(V++,R.consume(w),M):V>=o?(R.exit("codeFencedFenceSequence"),wt(w)?Mt(R,Y,"whitespace")(w):Y(w)):L(w)}function Y(w){return w===null||Qe(w)?(R.exit("codeFencedFence"),B(w)):L(w)}}}function GN(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const gc={name:"codeIndented",tokenize:KN},JN={partial:!0,tokenize:YN};function KN(e,t,n){const r=this;return i;function i(p){return e.enter("codeIndented"),Mt(e,s,"linePrefix",5)(p)}function s(p){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?o(p):n(p)}function o(p){return p===null?c(p):Qe(p)?e.attempt(JN,o,c)(p):(e.enter("codeFlowValue"),l(p))}function l(p){return p===null||Qe(p)?(e.exit("codeFlowValue"),o(p)):(e.consume(p),l)}function c(p){return e.exit("codeIndented"),t(p)}}function YN(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Qe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Mt(e,s,"linePrefix",5)(o)}function s(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):Qe(o)?i(o):n(o)}}const XN={name:"codeText",previous:eM,resolve:QN,tokenize:tM};function QN(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function eM(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function tM(e,t,n){let r=0,i,s;return o;function o(h){return e.enter("codeText"),e.enter("codeTextSequence"),l(h)}function l(h){return h===96?(e.consume(h),r++,l):(e.exit("codeTextSequence"),c(h))}function c(h){return h===null?n(h):h===32?(e.enter("space"),e.consume(h),e.exit("space"),c):h===96?(s=e.enter("codeTextSequence"),i=0,d(h)):Qe(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),c):(e.enter("codeTextData"),p(h))}function p(h){return h===null||h===32||h===96||Qe(h)?(e.exit("codeTextData"),c(h)):(e.consume(h),p)}function d(h){return h===96?(e.consume(h),i++,d):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(h)):(s.type="codeTextData",p(h))}}class nM{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&so(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),so(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),so(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);so(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);so(this.left,n.reverse())}}}function so(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Nb(e){const t={};let n=-1,r,i,s,o,l,c,p;const d=new nM(e);for(;++n<d.length;){for(;n in t;)n=t[n];if(r=d.get(n),n&&r[1].type==="chunkFlow"&&d.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,s=0,s<c.length&&c[s][1].type==="lineEndingBlank"&&(s+=2),s<c.length&&c[s][1].type==="content"))for(;++s<c.length&&c[s][1].type!=="content";)c[s][1].type==="chunkText"&&(c[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,rM(d,n)),n=t[n],p=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=d.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(d.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...d.get(i)[1].start},l=d.slice(i,n),l.unshift(r),d.splice(i,n-i+1,l))}}return Dr(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!p}function rM(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],p={};let d,h,v=-1,y=n,g=0,k=0;const _=[k];for(;y;){for(;e.get(++i)[1]!==y;);s.push(i),y._tokenizer||(d=r.sliceStream(y),y.next||d.push(null),h&&o.defineSkip(y.start),y._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(d),y._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),h=y,y=y.next}for(y=n;++v<l.length;)l[v][0]==="exit"&&l[v-1][0]==="enter"&&l[v][1].type===l[v-1][1].type&&l[v][1].start.line!==l[v][1].end.line&&(k=v+1,_.push(k),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(o.events=[],y?(y._tokenizer=void 0,y.previous=void 0):_.pop(),v=_.length;v--;){const x=l.slice(_[v],_[v+1]),S=s.pop();c.push([S,S+x.length-1]),e.splice(S,2,x)}for(c.reverse(),v=-1;++v<c.length;)p[g+c[v][0]]=g+c[v][1],g+=c[v][1]-c[v][0]-1;return p}const iM={resolve:oM,tokenize:sM},aM={partial:!0,tokenize:lM};function oM(e){return Nb(e),e}function sM(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?s(l):Qe(l)?e.check(aM,o,s)(l):(e.consume(l),i)}function s(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function lM(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Mt(e,s,"linePrefix")}function s(o){if(o===null||Qe(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function Mb(e,t,n,r,i,s,o,l,c){const p=c||Number.POSITIVE_INFINITY;let d=0;return h;function h(x){return x===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(x),e.exit(s),v):x===null||x===32||x===41||ap(x)?n(x):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),k(x))}function v(x){return x===62?(e.enter(s),e.consume(x),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===62?(e.exit("chunkString"),e.exit(l),v(x)):x===null||x===60||Qe(x)?n(x):(e.consume(x),x===92?g:y)}function g(x){return x===60||x===62||x===92?(e.consume(x),y):y(x)}function k(x){return!d&&(x===null||x===41||Dn(x))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(x)):d<p&&x===40?(e.consume(x),d++,k):x===41?(e.consume(x),d--,k):x===null||x===32||x===40||ap(x)?n(x):(e.consume(x),x===92?_:k)}function _(x){return x===40||x===41||x===92?(e.consume(x),k):k(x)}}function Pb(e,t,n,r,i,s){const o=this;let l=0,c;return p;function p(y){return e.enter(r),e.enter(i),e.consume(y),e.exit(i),e.enter(s),d}function d(y){return l>999||y===null||y===91||y===93&&!c||y===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(y):y===93?(e.exit(s),e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):Qe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),h(y))}function h(y){return y===null||y===91||y===93||Qe(y)||l++>999?(e.exit("chunkString"),d(y)):(e.consume(y),c||(c=!wt(y)),y===92?v:h)}function v(y){return y===91||y===92||y===93?(e.consume(y),l++,h):h(y)}}function $b(e,t,n,r,i,s){let o;return l;function l(v){return v===34||v===39||v===40?(e.enter(r),e.enter(i),e.consume(v),e.exit(i),o=v===40?41:v,c):n(v)}function c(v){return v===o?(e.enter(i),e.consume(v),e.exit(i),e.exit(r),t):(e.enter(s),p(v))}function p(v){return v===o?(e.exit(s),c(o)):v===null?n(v):Qe(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),Mt(e,p,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(v))}function d(v){return v===o||v===null||Qe(v)?(e.exit("chunkString"),p(v)):(e.consume(v),v===92?h:d)}function h(v){return v===o||v===92?(e.consume(v),d):d(v)}}function vo(e,t){let n;return r;function r(i){return Qe(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):wt(i)?Mt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const uM={name:"definition",tokenize:pM},cM={partial:!0,tokenize:dM};function pM(e,t,n){const r=this;let i;return s;function s(y){return e.enter("definition"),o(y)}function o(y){return Pb.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function l(y){return i=wa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),c):n(y)}function c(y){return Dn(y)?vo(e,p)(y):p(y)}function p(y){return Mb(e,d,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function d(y){return e.attempt(cM,h,h)(y)}function h(y){return wt(y)?Mt(e,v,"whitespace")(y):v(y)}function v(y){return y===null||Qe(y)?(e.exit("definition"),r.parser.defined.push(i),t(y)):n(y)}}function dM(e,t,n){return r;function r(l){return Dn(l)?vo(e,i)(l):n(l)}function i(l){return $b(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return wt(l)?Mt(e,o,"whitespace")(l):o(l)}function o(l){return l===null||Qe(l)?t(l):n(l)}}const fM={name:"hardBreakEscape",tokenize:hM};function hM(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return Qe(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const mM={name:"headingAtx",resolve:gM,tokenize:vM};function gM(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Dr(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function vM(e,t,n){let r=0;return i;function i(d){return e.enter("atxHeading"),s(d)}function s(d){return e.enter("atxHeadingSequence"),o(d)}function o(d){return d===35&&r++<6?(e.consume(d),o):d===null||Dn(d)?(e.exit("atxHeadingSequence"),l(d)):n(d)}function l(d){return d===35?(e.enter("atxHeadingSequence"),c(d)):d===null||Qe(d)?(e.exit("atxHeading"),t(d)):wt(d)?Mt(e,l,"whitespace")(d):(e.enter("atxHeadingText"),p(d))}function c(d){return d===35?(e.consume(d),c):(e.exit("atxHeadingSequence"),l(d))}function p(d){return d===null||d===35||Dn(d)?(e.exit("atxHeadingText"),l(d)):(e.consume(d),p)}}const yM=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Um=["pre","script","style","textarea"],bM={concrete:!0,name:"htmlFlow",resolveTo:wM,tokenize:kM},xM={partial:!0,tokenize:SM},_M={partial:!0,tokenize:CM};function wM(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function kM(e,t,n){const r=this;let i,s,o,l,c;return p;function p(z){return d(z)}function d(z){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(z),h}function h(z){return z===33?(e.consume(z),v):z===47?(e.consume(z),s=!0,k):z===63?(e.consume(z),i=3,r.interrupt?t:N):$r(z)?(e.consume(z),o=String.fromCharCode(z),_):n(z)}function v(z){return z===45?(e.consume(z),i=2,y):z===91?(e.consume(z),i=5,l=0,g):$r(z)?(e.consume(z),i=4,r.interrupt?t:N):n(z)}function y(z){return z===45?(e.consume(z),r.interrupt?t:N):n(z)}function g(z){const je="CDATA[";return z===je.charCodeAt(l++)?(e.consume(z),l===je.length?r.interrupt?t:X:g):n(z)}function k(z){return $r(z)?(e.consume(z),o=String.fromCharCode(z),_):n(z)}function _(z){if(z===null||z===47||z===62||Dn(z)){const je=z===47,le=o.toLowerCase();return!je&&!s&&Um.includes(le)?(i=1,r.interrupt?t(z):X(z)):yM.includes(o.toLowerCase())?(i=6,je?(e.consume(z),x):r.interrupt?t(z):X(z)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(z):s?S(z):T(z))}return z===45||Kn(z)?(e.consume(z),o+=String.fromCharCode(z),_):n(z)}function x(z){return z===62?(e.consume(z),r.interrupt?t:X):n(z)}function S(z){return wt(z)?(e.consume(z),S):q(z)}function T(z){return z===47?(e.consume(z),q):z===58||z===95||$r(z)?(e.consume(z),I):wt(z)?(e.consume(z),T):q(z)}function I(z){return z===45||z===46||z===58||z===95||Kn(z)?(e.consume(z),I):O(z)}function O(z){return z===61?(e.consume(z),R):wt(z)?(e.consume(z),O):T(z)}function R(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),c=z,B):wt(z)?(e.consume(z),R):L(z)}function B(z){return z===c?(e.consume(z),c=null,V):z===null||Qe(z)?n(z):(e.consume(z),B)}function L(z){return z===null||z===34||z===39||z===47||z===60||z===61||z===62||z===96||Dn(z)?O(z):(e.consume(z),L)}function V(z){return z===47||z===62||wt(z)?T(z):n(z)}function q(z){return z===62?(e.consume(z),D):n(z)}function D(z){return z===null||Qe(z)?X(z):wt(z)?(e.consume(z),D):n(z)}function X(z){return z===45&&i===2?(e.consume(z),F):z===60&&i===1?(e.consume(z),_e):z===62&&i===4?(e.consume(z),Ee):z===63&&i===3?(e.consume(z),N):z===93&&i===5?(e.consume(z),pe):Qe(z)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(xM,ie,M)(z)):z===null||Qe(z)?(e.exit("htmlFlowData"),M(z)):(e.consume(z),X)}function M(z){return e.check(_M,Y,ie)(z)}function Y(z){return e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),w}function w(z){return z===null||Qe(z)?M(z):(e.enter("htmlFlowData"),X(z))}function F(z){return z===45?(e.consume(z),N):X(z)}function _e(z){return z===47?(e.consume(z),o="",se):X(z)}function se(z){if(z===62){const je=o.toLowerCase();return Um.includes(je)?(e.consume(z),Ee):X(z)}return $r(z)&&o.length<8?(e.consume(z),o+=String.fromCharCode(z),se):X(z)}function pe(z){return z===93?(e.consume(z),N):X(z)}function N(z){return z===62?(e.consume(z),Ee):z===45&&i===2?(e.consume(z),N):X(z)}function Ee(z){return z===null||Qe(z)?(e.exit("htmlFlowData"),ie(z)):(e.consume(z),Ee)}function ie(z){return e.exit("htmlFlow"),t(z)}}function CM(e,t,n){const r=this;return i;function i(o){return Qe(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function SM(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Tl,t,n)}}const EM={name:"htmlText",tokenize:AM};function AM(e,t,n){const r=this;let i,s,o;return l;function l(N){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(N),c}function c(N){return N===33?(e.consume(N),p):N===47?(e.consume(N),O):N===63?(e.consume(N),T):$r(N)?(e.consume(N),L):n(N)}function p(N){return N===45?(e.consume(N),d):N===91?(e.consume(N),s=0,g):$r(N)?(e.consume(N),S):n(N)}function d(N){return N===45?(e.consume(N),y):n(N)}function h(N){return N===null?n(N):N===45?(e.consume(N),v):Qe(N)?(o=h,_e(N)):(e.consume(N),h)}function v(N){return N===45?(e.consume(N),y):h(N)}function y(N){return N===62?F(N):N===45?v(N):h(N)}function g(N){const Ee="CDATA[";return N===Ee.charCodeAt(s++)?(e.consume(N),s===Ee.length?k:g):n(N)}function k(N){return N===null?n(N):N===93?(e.consume(N),_):Qe(N)?(o=k,_e(N)):(e.consume(N),k)}function _(N){return N===93?(e.consume(N),x):k(N)}function x(N){return N===62?F(N):N===93?(e.consume(N),x):k(N)}function S(N){return N===null||N===62?F(N):Qe(N)?(o=S,_e(N)):(e.consume(N),S)}function T(N){return N===null?n(N):N===63?(e.consume(N),I):Qe(N)?(o=T,_e(N)):(e.consume(N),T)}function I(N){return N===62?F(N):T(N)}function O(N){return $r(N)?(e.consume(N),R):n(N)}function R(N){return N===45||Kn(N)?(e.consume(N),R):B(N)}function B(N){return Qe(N)?(o=B,_e(N)):wt(N)?(e.consume(N),B):F(N)}function L(N){return N===45||Kn(N)?(e.consume(N),L):N===47||N===62||Dn(N)?V(N):n(N)}function V(N){return N===47?(e.consume(N),F):N===58||N===95||$r(N)?(e.consume(N),q):Qe(N)?(o=V,_e(N)):wt(N)?(e.consume(N),V):F(N)}function q(N){return N===45||N===46||N===58||N===95||Kn(N)?(e.consume(N),q):D(N)}function D(N){return N===61?(e.consume(N),X):Qe(N)?(o=D,_e(N)):wt(N)?(e.consume(N),D):V(N)}function X(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),i=N,M):Qe(N)?(o=X,_e(N)):wt(N)?(e.consume(N),X):(e.consume(N),Y)}function M(N){return N===i?(e.consume(N),i=void 0,w):N===null?n(N):Qe(N)?(o=M,_e(N)):(e.consume(N),M)}function Y(N){return N===null||N===34||N===39||N===60||N===61||N===96?n(N):N===47||N===62||Dn(N)?V(N):(e.consume(N),Y)}function w(N){return N===47||N===62||Dn(N)?V(N):n(N)}function F(N){return N===62?(e.consume(N),e.exit("htmlTextData"),e.exit("htmlText"),t):n(N)}function _e(N){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),se}function se(N){return wt(N)?Mt(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(N):pe(N)}function pe(N){return e.enter("htmlTextData"),o(N)}}const rd={name:"labelEnd",resolveAll:RM,resolveTo:OM,tokenize:zM},TM={tokenize:NM},IM={tokenize:MM},jM={tokenize:PM};function RM(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&Dr(e,0,e.length,n),e}function OM(e,t){let n=e.length,r=0,i,s,o,l;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const c={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},p={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},d={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",p,t]],l=dr(l,e.slice(s+1,s+r+3)),l=dr(l,[["enter",d,t]]),l=dr(l,nd(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),l=dr(l,[["exit",d,t],e[o-2],e[o-1],["exit",p,t]]),l=dr(l,e.slice(o+1)),l=dr(l,[["exit",c,t]]),Dr(e,s,e.length,l),e}function zM(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return l;function l(v){return s?s._inactive?h(v):(o=r.parser.defined.includes(wa(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),c):n(v)}function c(v){return v===40?e.attempt(TM,d,o?d:h)(v):v===91?e.attempt(IM,d,o?p:h)(v):o?d(v):h(v)}function p(v){return e.attempt(jM,d,h)(v)}function d(v){return t(v)}function h(v){return s._balanced=!0,n(v)}}function NM(e,t,n){return r;function r(h){return e.enter("resource"),e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),i}function i(h){return Dn(h)?vo(e,s)(h):s(h)}function s(h){return h===41?d(h):Mb(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(h)}function o(h){return Dn(h)?vo(e,c)(h):d(h)}function l(h){return n(h)}function c(h){return h===34||h===39||h===40?$b(e,p,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(h):d(h)}function p(h){return Dn(h)?vo(e,d)(h):d(h)}function d(h){return h===41?(e.enter("resourceMarker"),e.consume(h),e.exit("resourceMarker"),e.exit("resource"),t):n(h)}}function MM(e,t,n){const r=this;return i;function i(l){return Pb.call(r,e,s,o,"reference","referenceMarker","referenceString")(l)}function s(l){return r.parser.defined.includes(wa(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function PM(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const $M={name:"labelStartImage",resolveAll:rd.resolveAll,tokenize:DM};function DM(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),s}function s(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):n(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const FM={name:"labelStartLink",resolveAll:rd.resolveAll,tokenize:LM};function LM(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const vc={name:"lineEnding",tokenize:BM};function BM(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Mt(e,t,"linePrefix")}}const Hs={name:"thematicBreak",tokenize:UM};function UM(e,t,n){let r=0,i;return s;function s(p){return e.enter("thematicBreak"),o(p)}function o(p){return i=p,l(p)}function l(p){return p===i?(e.enter("thematicBreakSequence"),c(p)):r>=3&&(p===null||Qe(p))?(e.exit("thematicBreak"),t(p)):n(p)}function c(p){return p===i?(e.consume(p),r++,c):(e.exit("thematicBreakSequence"),wt(p)?Mt(e,l,"whitespace")(p):l(p))}}const Pn={continuation:{tokenize:qM},exit:GM,name:"list",tokenize:WM},ZM={partial:!0,tokenize:JM},HM={partial:!0,tokenize:VM};function WM(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(y){const g=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:op(y)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Hs,n,p)(y):p(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(y)}return n(y)}function c(y){return op(y)&&++o<10?(e.consume(y),c):(!r.interrupt||o<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),p(y)):n(y)}function p(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(Tl,r.interrupt?n:d,e.attempt(ZM,v,h))}function d(y){return r.containerState.initialBlankLine=!0,s++,v(y)}function h(y){return wt(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),v):n(y)}function v(y){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function qM(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Tl,i,s);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Mt(e,t,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!wt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(HM,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Mt(e,e.attempt(Pn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function VM(e,t,n){const r=this;return Mt(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function GM(e){e.exit(this.containerState.type)}function JM(e,t,n){const r=this;return Mt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!wt(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const Zm={name:"setextUnderline",resolveTo:KM,tokenize:YM};function KM(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function YM(e,t,n){const r=this;let i;return s;function s(p){let d=r.events.length,h;for(;d--;)if(r.events[d][1].type!=="lineEnding"&&r.events[d][1].type!=="linePrefix"&&r.events[d][1].type!=="content"){h=r.events[d][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||h)?(e.enter("setextHeadingLine"),i=p,o(p)):n(p)}function o(p){return e.enter("setextHeadingLineSequence"),l(p)}function l(p){return p===i?(e.consume(p),l):(e.exit("setextHeadingLineSequence"),wt(p)?Mt(e,c,"lineSuffix")(p):c(p))}function c(p){return p===null||Qe(p)?(e.exit("setextHeadingLine"),t(p)):n(p)}}const XM={tokenize:QM};function QM(e){const t=this,n=e.attempt(Tl,r,e.attempt(this.parser.constructs.flowInitial,i,Mt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(iM,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const eP={resolveAll:Fb()},tP=Db("string"),nP=Db("text");function Db(e){return{resolveAll:Fb(e==="text"?rP:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,l);return o;function o(d){return p(d)?s(d):l(d)}function l(d){if(d===null){n.consume(d);return}return n.enter("data"),n.consume(d),c}function c(d){return p(d)?(n.exit("data"),s(d)):(n.consume(d),c)}function p(d){if(d===null)return!0;const h=i[d];let v=-1;if(h)for(;++v<h.length;){const y=h[v];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function Fb(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function rP(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,l=0,c;for(;s--;){const p=i[s];if(typeof p=="string"){for(o=p.length;p.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(p===-2)c=!0,l++;else if(p!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const p={type:n===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...p.start},r.start.offset===r.end.offset?Object.assign(r,p):(e.splice(n,0,["enter",p,t],["exit",p,t]),n+=2)}n++}return e}const iP={42:Pn,43:Pn,45:Pn,48:Pn,49:Pn,50:Pn,51:Pn,52:Pn,53:Pn,54:Pn,55:Pn,56:Pn,57:Pn,62:Rb},aP={91:uM},oP={[-2]:gc,[-1]:gc,32:gc},sP={35:mM,42:Hs,45:[Zm,Hs],60:bM,61:Zm,95:Hs,96:Bm,126:Bm},lP={38:zb,92:Ob},uP={[-5]:vc,[-4]:vc,[-3]:vc,33:$M,38:zb,42:sp,60:[FN,EM],91:FM,92:[fM,Ob],93:rd,95:sp,96:XN},cP={null:[sp,eP]},pP={null:[42,95]},dP={null:[]},fP=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:pP,contentInitial:aP,disable:dP,document:iP,flow:sP,flowInitial:oP,insideSpan:cP,string:lP,text:uP},Symbol.toStringTag,{value:"Module"}));function hP(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],l=[];const c={attempt:B(O),check:B(R),consume:S,enter:T,exit:I,interrupt:B(R,{interrupt:!0})},p={code:null,containerState:{},defineSkip:k,events:[],now:g,parser:e,previous:null,sliceSerialize:v,sliceStream:y,write:h};let d=t.tokenize.call(p,c);return t.resolveAll&&s.push(t),p;function h(D){return o=dr(o,D),_(),o[o.length-1]!==null?[]:(L(t,0),p.events=nd(s,p.events,p),p.events)}function v(D,X){return gP(y(D),X)}function y(D){return mP(o,D)}function g(){const{_bufferIndex:D,_index:X,line:M,column:Y,offset:w}=r;return{_bufferIndex:D,_index:X,line:M,column:Y,offset:w}}function k(D){i[D.line]=D.column,q()}function _(){let D;for(;r._index<o.length;){const X=o[r._index];if(typeof X=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<X.length;)x(X.charCodeAt(r._bufferIndex));else x(X)}}function x(D){d=d(D)}function S(D){Qe(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,q()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),p.previous=D}function T(D,X){const M=X||{};return M.type=D,M.start=g(),p.events.push(["enter",M,p]),l.push(M),M}function I(D){const X=l.pop();return X.end=g(),p.events.push(["exit",X,p]),X}function O(D,X){L(D,X.from)}function R(D,X){X.restore()}function B(D,X){return M;function M(Y,w,F){let _e,se,pe,N;return Array.isArray(Y)?ie(Y):"tokenize"in Y?ie([Y]):Ee(Y);function Ee(ne){return Je;function Je(Ke){const ce=Ke!==null&&ne[Ke],Oe=Ke!==null&&ne.null,ve=[...Array.isArray(ce)?ce:ce?[ce]:[],...Array.isArray(Oe)?Oe:Oe?[Oe]:[]];return ie(ve)(Ke)}}function ie(ne){return _e=ne,se=0,ne.length===0?F:z(ne[se])}function z(ne){return Je;function Je(Ke){return N=V(),pe=ne,ne.partial||(p.currentConstruct=ne),ne.name&&p.parser.constructs.disable.null.includes(ne.name)?le():ne.tokenize.call(X?Object.assign(Object.create(p),X):p,c,je,le)(Ke)}}function je(ne){return D(pe,N),w}function le(ne){return N.restore(),++se<_e.length?z(_e[se]):F}}}function L(D,X){D.resolveAll&&!s.includes(D)&&s.push(D),D.resolve&&Dr(p.events,X,p.events.length-X,D.resolve(p.events.slice(X),p)),D.resolveTo&&(p.events=D.resolveTo(p.events,p))}function V(){const D=g(),X=p.previous,M=p.currentConstruct,Y=p.events.length,w=Array.from(l);return{from:Y,restore:F};function F(){r=D,p.previous=X,p.currentConstruct=M,p.events.length=Y,l=w,q()}}function q(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function mP(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function gP(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
`;break}case-3:{o=`\r
`;break}case-2:{o=t?" ":"	";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function vP(e){const r={constructs:CN([fP,...(e||{}).extensions||[]]),content:i(ON),defined:[],document:i(NN),flow:i(XM),lazy:{},string:i(tP),text:i(nP)};return r;function i(s){return o;function o(l){return hP(r,s,l)}}}function yP(e){for(;!Nb(e););return e}const Hm=/[\0\t\n\r]/g;function bP(){let e=1,t="",n=!0,r;return i;function i(s,o,l){const c=[];let p,d,h,v,y;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),h=0,t="",n&&(s.charCodeAt(0)===65279&&h++,n=void 0);h<s.length;){if(Hm.lastIndex=h,p=Hm.exec(s),v=p&&p.index!==void 0?p.index:s.length,y=s.charCodeAt(v),!p){t=s.slice(h);break}if(y===10&&h===v&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),h<v&&(c.push(s.slice(h,v)),e+=v-h),y){case 0:{c.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,c.push(-2);e++<d;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}h=v+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const xP=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function _P(e){return e.replace(xP,wP)}function wP(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return jb(n.slice(s?2:1),s?16:10)}return td(n)||e}const Lb={}.hasOwnProperty;function kP(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),CP(n)(yP(vP(n).document().write(bP()(e,t,!0))))}function CP(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(C),autolinkProtocol:V,autolinkEmail:V,atxHeading:s(E),blockQuote:s(Oe),characterEscape:V,characterReference:V,codeFenced:s(ve),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(ve,o),codeText:s(Re,o),codeTextData:V,data:V,codeFlowValue:V,definition:s(Ge),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(Ze),hardBreakEscape:s(ue),hardBreakTrailing:s(ue),htmlFlow:s(H,o),htmlFlowData:V,htmlText:s(H,o),htmlTextData:V,image:s($),label:o,link:s(C),listItem:s(ge),listItemValue:v,listOrdered:s(J,h),listUnordered:s(J),paragraph:s(be),reference:z,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(E),strong:s(ee),thematicBreak:s(he)},exit:{atxHeading:c(),atxHeadingSequence:O,autolink:c(),autolinkEmail:ce,autolinkProtocol:Ke,blockQuote:c(),characterEscapeValue:q,characterReferenceMarkerHexadecimal:le,characterReferenceMarkerNumeric:le,characterReferenceValue:ne,characterReference:Je,codeFenced:c(_),codeFencedFence:k,codeFencedFenceInfo:y,codeFencedFenceMeta:g,codeFlowValue:q,codeIndented:c(x),codeText:c(w),codeTextData:q,data:q,definition:c(),definitionDestinationString:I,definitionLabelString:S,definitionTitleString:T,emphasis:c(),hardBreakEscape:c(X),hardBreakTrailing:c(X),htmlFlow:c(M),htmlFlowData:q,htmlText:c(Y),htmlTextData:q,image:c(_e),label:pe,labelText:se,lineEnding:D,link:c(F),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:je,resourceDestinationString:N,resourceTitleString:Ee,resource:ie,setextHeading:c(L),setextHeadingLineSequence:B,setextHeadingText:R,strong:c(),thematicBreak:c()}};Bb(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(U){let oe={type:"root",children:[]};const Ce={stack:[oe],tokenStack:[],config:t,enter:l,exit:p,buffer:o,resume:d,data:n},Se=[];let Ue=-1;for(;++Ue<U.length;)if(U[Ue][1].type==="listOrdered"||U[Ue][1].type==="listUnordered")if(U[Ue][0]==="enter")Se.push(Ue);else{const dt=Se.pop();Ue=i(U,dt,Ue)}for(Ue=-1;++Ue<U.length;){const dt=t[U[Ue][0]];Lb.call(dt,U[Ue][1].type)&&dt[U[Ue][1].type].call(Object.assign({sliceSerialize:U[Ue][2].sliceSerialize},Ce),U[Ue][1])}if(Ce.tokenStack.length>0){const dt=Ce.tokenStack[Ce.tokenStack.length-1];(dt[1]||Wm).call(Ce,void 0,dt[0])}for(oe.position={start:pi(U.length>0?U[0][1].start:{line:1,column:1,offset:0}),end:pi(U.length>0?U[U.length-2][1].end:{line:1,column:1,offset:0})},Ue=-1;++Ue<t.transforms.length;)oe=t.transforms[Ue](oe)||oe;return oe}function i(U,oe,Ce){let Se=oe-1,Ue=-1,dt=!1,xt,It,Xe,Vt;for(;++Se<=Ce;){const jt=U[Se];switch(jt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{jt[0]==="enter"?Ue++:Ue--,Vt=void 0;break}case"lineEndingBlank":{jt[0]==="enter"&&(xt&&!Vt&&!Ue&&!Xe&&(Xe=Se),Vt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Vt=void 0}if(!Ue&&jt[0]==="enter"&&jt[1].type==="listItemPrefix"||Ue===-1&&jt[0]==="exit"&&(jt[1].type==="listUnordered"||jt[1].type==="listOrdered")){if(xt){let yt=Se;for(It=void 0;yt--;){const mt=U[yt];if(mt[1].type==="lineEnding"||mt[1].type==="lineEndingBlank"){if(mt[0]==="exit")continue;It&&(U[It][1].type="lineEndingBlank",dt=!0),mt[1].type="lineEnding",It=yt}else if(!(mt[1].type==="linePrefix"||mt[1].type==="blockQuotePrefix"||mt[1].type==="blockQuotePrefixWhitespace"||mt[1].type==="blockQuoteMarker"||mt[1].type==="listItemIndent"))break}Xe&&(!It||Xe<It)&&(xt._spread=!0),xt.end=Object.assign({},It?U[It][1].start:jt[1].end),U.splice(It||Se,0,["exit",xt,jt[2]]),Se++,Ce++}if(jt[1].type==="listItemPrefix"){const yt={type:"listItem",_spread:!1,start:Object.assign({},jt[1].start),end:void 0};xt=yt,U.splice(Se,0,["enter",yt,jt[2]]),Se++,Ce++,Xe=void 0,Vt=!0}}}return U[oe][1]._spread=dt,Ce}function s(U,oe){return Ce;function Ce(Se){l.call(this,U(Se),Se),oe&&oe.call(this,Se)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(U,oe,Ce){this.stack[this.stack.length-1].children.push(U),this.stack.push(U),this.tokenStack.push([oe,Ce||void 0]),U.position={start:pi(oe.start),end:void 0}}function c(U){return oe;function oe(Ce){U&&U.call(this,Ce),p.call(this,Ce)}}function p(U,oe){const Ce=this.stack.pop(),Se=this.tokenStack.pop();if(Se)Se[0].type!==U.type&&(oe?oe.call(this,U,Se[0]):(Se[1]||Wm).call(this,U,Se[0]));else throw new Error("Cannot close `"+U.type+"` ("+go({start:U.start,end:U.end})+"): it’s not open");Ce.position.end=pi(U.end)}function d(){return wN(this.stack.pop())}function h(){this.data.expectingFirstListItemValue=!0}function v(U){if(this.data.expectingFirstListItemValue){const oe=this.stack[this.stack.length-2];oe.start=Number.parseInt(this.sliceSerialize(U),10),this.data.expectingFirstListItemValue=void 0}}function y(){const U=this.resume(),oe=this.stack[this.stack.length-1];oe.lang=U}function g(){const U=this.resume(),oe=this.stack[this.stack.length-1];oe.meta=U}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const U=this.resume(),oe=this.stack[this.stack.length-1];oe.value=U.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const U=this.resume(),oe=this.stack[this.stack.length-1];oe.value=U.replace(/(\r?\n|\r)$/g,"")}function S(U){const oe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=oe,Ce.identifier=wa(this.sliceSerialize(U)).toLowerCase()}function T(){const U=this.resume(),oe=this.stack[this.stack.length-1];oe.title=U}function I(){const U=this.resume(),oe=this.stack[this.stack.length-1];oe.url=U}function O(U){const oe=this.stack[this.stack.length-1];if(!oe.depth){const Ce=this.sliceSerialize(U).length;oe.depth=Ce}}function R(){this.data.setextHeadingSlurpLineEnding=!0}function B(U){const oe=this.stack[this.stack.length-1];oe.depth=this.sliceSerialize(U).codePointAt(0)===61?1:2}function L(){this.data.setextHeadingSlurpLineEnding=void 0}function V(U){const Ce=this.stack[this.stack.length-1].children;let Se=Ce[Ce.length-1];(!Se||Se.type!=="text")&&(Se=re(),Se.position={start:pi(U.start),end:void 0},Ce.push(Se)),this.stack.push(Se)}function q(U){const oe=this.stack.pop();oe.value+=this.sliceSerialize(U),oe.position.end=pi(U.end)}function D(U){const oe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ce=oe.children[oe.children.length-1];Ce.position.end=pi(U.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(oe.type)&&(V.call(this,U),q.call(this,U))}function X(){this.data.atHardBreak=!0}function M(){const U=this.resume(),oe=this.stack[this.stack.length-1];oe.value=U}function Y(){const U=this.resume(),oe=this.stack[this.stack.length-1];oe.value=U}function w(){const U=this.resume(),oe=this.stack[this.stack.length-1];oe.value=U}function F(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=oe,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function _e(){const U=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";U.type+="Reference",U.referenceType=oe,delete U.url,delete U.title}else delete U.identifier,delete U.label;this.data.referenceType=void 0}function se(U){const oe=this.sliceSerialize(U),Ce=this.stack[this.stack.length-2];Ce.label=_P(oe),Ce.identifier=wa(oe).toLowerCase()}function pe(){const U=this.stack[this.stack.length-1],oe=this.resume(),Ce=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ce.type==="link"){const Se=U.children;Ce.children=Se}else Ce.alt=oe}function N(){const U=this.resume(),oe=this.stack[this.stack.length-1];oe.url=U}function Ee(){const U=this.resume(),oe=this.stack[this.stack.length-1];oe.title=U}function ie(){this.data.inReference=void 0}function z(){this.data.referenceType="collapsed"}function je(U){const oe=this.resume(),Ce=this.stack[this.stack.length-1];Ce.label=oe,Ce.identifier=wa(this.sliceSerialize(U)).toLowerCase(),this.data.referenceType="full"}function le(U){this.data.characterReferenceType=U.type}function ne(U){const oe=this.sliceSerialize(U),Ce=this.data.characterReferenceType;let Se;Ce?(Se=jb(oe,Ce==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Se=td(oe);const Ue=this.stack[this.stack.length-1];Ue.value+=Se}function Je(U){const oe=this.stack.pop();oe.position.end=pi(U.end)}function Ke(U){q.call(this,U);const oe=this.stack[this.stack.length-1];oe.url=this.sliceSerialize(U)}function ce(U){q.call(this,U);const oe=this.stack[this.stack.length-1];oe.url="mailto:"+this.sliceSerialize(U)}function Oe(){return{type:"blockquote",children:[]}}function ve(){return{type:"code",lang:null,meta:null,value:""}}function Re(){return{type:"inlineCode",value:""}}function Ge(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ze(){return{type:"emphasis",children:[]}}function E(){return{type:"heading",depth:0,children:[]}}function ue(){return{type:"break"}}function H(){return{type:"html",value:""}}function $(){return{type:"image",title:null,url:"",alt:null}}function C(){return{type:"link",title:null,url:"",children:[]}}function J(U){return{type:"list",ordered:U.type==="listOrdered",start:null,spread:U._spread,children:[]}}function ge(U){return{type:"listItem",spread:U._spread,checked:null,children:[]}}function be(){return{type:"paragraph",children:[]}}function ee(){return{type:"strong",children:[]}}function re(){return{type:"text",value:""}}function he(){return{type:"thematicBreak"}}}function pi(e){return{line:e.line,column:e.column,offset:e.offset}}function Bb(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Bb(e,r):SP(e,r)}}function SP(e,t){let n;for(n in t)if(Lb.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Wm(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+go({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+go({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+go({start:t.start,end:t.end})+") is still open")}function EP(e){const t=this;t.parser=n;function n(r){return kP(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function AP(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function TP(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
`}]}function IP(e,t){const n=t.value?t.value+`
`:"",r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=["language-"+i[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(s.data={meta:t.meta}),e.patch(t,s),s=e.applyData(t,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(t,s),s}function jP(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function RP(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function OP(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),i=Na(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let o,l=e.footnoteCounts.get(r);l===void 0?(l=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=s+1,l+=1,e.footnoteCounts.set(r,l);const c={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+i,id:n+"fnref-"+i+(l>1?"-"+l:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(o)}]};e.patch(t,c);const p={type:"element",tagName:"sup",properties:{},children:[c]};return e.patch(t,p),e.applyData(t,p)}function zP(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function NP(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Ub(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const i=e.all(t),s=i[0];s&&s.type==="text"?s.value="["+s.value:i.unshift({type:"text",value:"["});const o=i[i.length-1];return o&&o.type==="text"?o.value+=r:i.push({type:"text",value:r}),i}function MP(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ub(e,t);const i={src:Na(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"img",properties:i,children:[]};return e.patch(t,s),e.applyData(t,s)}function PP(e,t){const n={src:Na(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function $P(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function DP(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ub(e,t);const i={href:Na(r.url||"")};r.title!==null&&r.title!==void 0&&(i.title=r.title);const s={type:"element",tagName:"a",properties:i,children:e.all(t)};return e.patch(t,s),e.applyData(t,s)}function FP(e,t){const n={href:Na(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function LP(e,t,n){const r=e.all(t),i=n?BP(n):Zb(t),s={},o=[];if(typeof t.checked=="boolean"){const d=r[0];let h;d&&d.type==="element"&&d.tagName==="p"?h=d:(h={type:"element",tagName:"p",properties:{},children:[]},r.unshift(h)),h.children.length>0&&h.children.unshift({type:"text",value:" "}),h.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let l=-1;for(;++l<r.length;){const d=r[l];(i||l!==0||d.type!=="element"||d.tagName!=="p")&&o.push({type:"text",value:`
`}),d.type==="element"&&d.tagName==="p"&&!i?o.push(...d.children):o.push(d)}const c=r[r.length-1];c&&(i||c.type!=="element"||c.tagName!=="p")&&o.push({type:"text",value:`
`});const p={type:"element",tagName:"li",properties:s,children:o};return e.patch(t,p),e.applyData(t,p)}function BP(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Zb(n[r])}return t}function Zb(e){const t=e.spread;return t??e.children.length>1}function UP(e,t){const n={},r=e.all(t);let i=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++i<r.length;){const o=r[i];if(o.type==="element"&&o.tagName==="li"&&o.properties&&Array.isArray(o.properties.className)&&o.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const s={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,s),e.applyData(t,s)}function ZP(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function HP(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function WP(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function qP(e,t){const n=e.all(t),r=n.shift(),i=[];if(r){const o={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],o),i.push(o)}if(n.length>0){const o={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},l=Yp(t.children[1]),c=kb(t.children[t.children.length-1]);l&&c&&(o.position={start:l,end:c}),i.push(o)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(i,!0)};return e.patch(t,s),e.applyData(t,s)}function VP(e,t,n){const r=n?n.children:void 0,s=(r?r.indexOf(t):1)===0?"th":"td",o=n&&n.type==="table"?n.align:void 0,l=o?o.length:t.children.length;let c=-1;const p=[];for(;++c<l;){const h=t.children[c],v={},y=o?o[c]:void 0;y&&(v.align=y);let g={type:"element",tagName:s,properties:v,children:[]};h&&(g.children=e.all(h),e.patch(h,g),g=e.applyData(h,g)),p.push(g)}const d={type:"element",tagName:"tr",properties:{},children:e.wrap(p,!0)};return e.patch(t,d),e.applyData(t,d)}function GP(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const qm=9,Vm=32;function JP(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),i=0;const s=[];for(;r;)s.push(Gm(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return s.push(Gm(t.slice(i),i>0,!1)),s.join("")}function Gm(e,t,n){let r=0,i=e.length;if(t){let s=e.codePointAt(r);for(;s===qm||s===Vm;)r++,s=e.codePointAt(r)}if(n){let s=e.codePointAt(i-1);for(;s===qm||s===Vm;)i--,s=e.codePointAt(i-1)}return i>r?e.slice(r,i):""}function KP(e,t){const n={type:"text",value:JP(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function YP(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const XP={blockquote:AP,break:TP,code:IP,delete:jP,emphasis:RP,footnoteReference:OP,heading:zP,html:NP,imageReference:MP,image:PP,inlineCode:$P,linkReference:DP,link:FP,listItem:LP,list:UP,paragraph:ZP,root:HP,strong:WP,table:qP,tableCell:GP,tableRow:VP,text:KP,thematicBreak:YP,toml:$s,yaml:$s,definition:$s,footnoteDefinition:$s};function $s(){}const Hb=-1,Il=0,yo=1,rl=2,id=3,ad=4,od=5,sd=6,Wb=7,qb=8,QP=typeof self=="object"?self:globalThis,Jm=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new QP[e](t)},e$=(e,t)=>{const n=(i,s)=>(e.set(s,i),i),r=i=>{if(e.has(i))return e.get(i);const[s,o]=t[i];switch(s){case Il:case Hb:return n(o,i);case yo:{const l=n([],i);for(const c of o)l.push(r(c));return l}case rl:{const l=n({},i);for(const[c,p]of o)l[r(c)]=r(p);return l}case id:return n(new Date(o),i);case ad:{const{source:l,flags:c}=o;return n(new RegExp(l,c),i)}case od:{const l=n(new Map,i);for(const[c,p]of o)l.set(r(c),r(p));return l}case sd:{const l=n(new Set,i);for(const c of o)l.add(r(c));return l}case Wb:{const{name:l,message:c}=o;return n(Jm(l,c),i)}case qb:return n(BigInt(o),i);case"BigInt":return n(Object(BigInt(o)),i);case"ArrayBuffer":return n(new Uint8Array(o).buffer,o);case"DataView":{const{buffer:l}=new Uint8Array(o);return n(new DataView(l),o)}}return n(Jm(s,o),i)};return r},Km=e=>e$(new Map,e)(0),ca="",{toString:t$}={},{keys:n$}=Object,lo=e=>{const t=typeof e;if(t!=="object"||!e)return[Il,t];const n=t$.call(e).slice(8,-1);switch(n){case"Array":return[yo,ca];case"Object":return[rl,ca];case"Date":return[id,ca];case"RegExp":return[ad,ca];case"Map":return[od,ca];case"Set":return[sd,ca];case"DataView":return[yo,n]}return n.includes("Array")?[yo,n]:n.includes("Error")?[Wb,n]:[rl,n]},Ds=([e,t])=>e===Il&&(t==="function"||t==="symbol"),r$=(e,t,n,r)=>{const i=(o,l)=>{const c=r.push(o)-1;return n.set(l,c),c},s=o=>{if(n.has(o))return n.get(o);let[l,c]=lo(o);switch(l){case Il:{let d=o;switch(c){case"bigint":l=qb,d=o.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+c);d=null;break;case"undefined":return i([Hb],o)}return i([l,d],o)}case yo:{if(c){let v=o;return c==="DataView"?v=new Uint8Array(o.buffer):c==="ArrayBuffer"&&(v=new Uint8Array(o)),i([c,[...v]],o)}const d=[],h=i([l,d],o);for(const v of o)d.push(s(v));return h}case rl:{if(c)switch(c){case"BigInt":return i([c,o.toString()],o);case"Boolean":case"Number":case"String":return i([c,o.valueOf()],o)}if(t&&"toJSON"in o)return s(o.toJSON());const d=[],h=i([l,d],o);for(const v of n$(o))(e||!Ds(lo(o[v])))&&d.push([s(v),s(o[v])]);return h}case id:return i([l,o.toISOString()],o);case ad:{const{source:d,flags:h}=o;return i([l,{source:d,flags:h}],o)}case od:{const d=[],h=i([l,d],o);for(const[v,y]of o)(e||!(Ds(lo(v))||Ds(lo(y))))&&d.push([s(v),s(y)]);return h}case sd:{const d=[],h=i([l,d],o);for(const v of o)(e||!Ds(lo(v)))&&d.push(s(v));return h}}const{message:p}=o;return i([l,{name:c,message:p}],o)};return s},Ym=(e,{json:t,lossy:n}={})=>{const r=[];return r$(!(t||n),!!t,new Map,r)(e),r},il=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Km(Ym(e,t)):structuredClone(e):(e,t)=>Km(Ym(e,t));function i$(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function a$(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function o$(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||i$,r=e.options.footnoteBackLabel||a$,i=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",o=e.options.footnoteLabelProperties||{className:["sr-only"]},l=[];let c=-1;for(;++c<e.footnoteOrder.length;){const p=e.footnoteById.get(e.footnoteOrder[c]);if(!p)continue;const d=e.all(p),h=String(p.identifier).toUpperCase(),v=Na(h.toLowerCase());let y=0;const g=[],k=e.footnoteCounts.get(h);for(;k!==void 0&&++y<=k;){g.length>0&&g.push({type:"text",value:" "});let S=typeof n=="string"?n:n(c,y);typeof S=="string"&&(S={type:"text",value:S}),g.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+v+(y>1?"-"+y:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(c,y),className:["data-footnote-backref"]},children:Array.isArray(S)?S:[S]})}const _=d[d.length-1];if(_&&_.type==="element"&&_.tagName==="p"){const S=_.children[_.children.length-1];S&&S.type==="text"?S.value+=" ":_.children.push({type:"text",value:" "}),_.children.push(...g)}else d.push(...g);const x={type:"element",tagName:"li",properties:{id:t+"fn-"+v},children:e.wrap(d,!0)};e.patch(p,x),l.push(x)}if(l.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...il(o),id:"footnote-label"},children:[{type:"text",value:i}]},{type:"text",value:`
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(l,!0)},{type:"text",value:`
`}]}}const Vb=function(e){if(e==null)return c$;if(typeof e=="function")return jl(e);if(typeof e=="object")return Array.isArray(e)?s$(e):l$(e);if(typeof e=="string")return u$(e);throw new Error("Expected function, string, or object as test")};function s$(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=Vb(e[n]);return jl(r);function r(...i){let s=-1;for(;++s<t.length;)if(t[s].apply(this,i))return!0;return!1}}function l$(e){const t=e;return jl(n);function n(r){const i=r;let s;for(s in e)if(i[s]!==t[s])return!1;return!0}}function u$(e){return jl(t);function t(n){return n&&n.type===e}}function jl(e){return t;function t(n,r,i){return!!(p$(n)&&e.call(this,n,typeof r=="number"?r:void 0,i||void 0))}}function c$(){return!0}function p$(e){return e!==null&&typeof e=="object"&&"type"in e}const Gb=[],d$=!0,Xm=!1,f$="skip";function h$(e,t,n,r){let i;typeof t=="function"&&typeof n!="function"?(r=n,n=t):i=t;const s=Vb(i),o=r?-1:1;l(e,void 0,[])();function l(c,p,d){const h=c&&typeof c=="object"?c:{};if(typeof h.type=="string"){const y=typeof h.tagName=="string"?h.tagName:typeof h.name=="string"?h.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(c.type+(y?"<"+y+">":""))+")"})}return v;function v(){let y=Gb,g,k,_;if((!t||s(c,p,d[d.length-1]||void 0))&&(y=m$(n(c,d)),y[0]===Xm))return y;if("children"in c&&c.children){const x=c;if(x.children&&y[0]!==f$)for(k=(r?x.children.length:-1)+o,_=d.concat(x);k>-1&&k<x.children.length;){const S=x.children[k];if(g=l(S,k,_)(),g[0]===Xm)return g;k=typeof g[1]=="number"?g[1]:k+o}}return y}}}function m$(e){return Array.isArray(e)?e:typeof e=="number"?[d$,e]:e==null?Gb:[e]}function Jb(e,t,n,r){let i,s,o;typeof t=="function"&&typeof n!="function"?(s=void 0,o=t,i=n):(s=t,o=n,i=r),h$(e,s,l,i);function l(c,p){const d=p[p.length-1],h=d?d.children.indexOf(c):void 0;return o(c,h,d)}}const lp={}.hasOwnProperty,g$={};function v$(e,t){const n=t||g$,r=new Map,i=new Map,s=new Map,o={...XP,...n.handlers},l={all:p,applyData:b$,definitionById:r,footnoteById:i,footnoteCounts:s,footnoteOrder:[],handlers:o,one:c,options:n,patch:y$,wrap:_$};return Jb(e,function(d){if(d.type==="definition"||d.type==="footnoteDefinition"){const h=d.type==="definition"?r:i,v=String(d.identifier).toUpperCase();h.has(v)||h.set(v,d)}}),l;function c(d,h){const v=d.type,y=l.handlers[v];if(lp.call(l.handlers,v)&&y)return y(l,d,h);if(l.options.passThrough&&l.options.passThrough.includes(v)){if("children"in d){const{children:k,..._}=d,x=il(_);return x.children=l.all(d),x}return il(d)}return(l.options.unknownHandler||x$)(l,d,h)}function p(d){const h=[];if("children"in d){const v=d.children;let y=-1;for(;++y<v.length;){const g=l.one(v[y],d);if(g){if(y&&v[y-1].type==="break"&&(!Array.isArray(g)&&g.type==="text"&&(g.value=Qm(g.value)),!Array.isArray(g)&&g.type==="element")){const k=g.children[0];k&&k.type==="text"&&(k.value=Qm(k.value))}Array.isArray(g)?h.push(...g):h.push(g)}}}return h}}function y$(e,t){e.position&&(t.position=eN(e))}function b$(e,t){let n=t;if(e&&e.data){const r=e.data.hName,i=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const o="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:o}}n.type==="element"&&s&&Object.assign(n.properties,il(s)),"children"in n&&n.children&&i!==null&&i!==void 0&&(n.children=i)}return n}function x$(e,t){const n=t.data||{},r="value"in t&&!(lp.call(n,"hProperties")||lp.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function _$(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
`});++r<e.length;)r&&n.push({type:"text",value:`
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
`}),n}function Qm(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function eg(e,t){const n=v$(e,t),r=n.one(e,void 0),i=o$(n),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return i&&s.children.push({type:"text",value:`
`},i),s}function w$(e,t){return e&&"run"in e?async function(n,r){const i=eg(n,{file:r,...t});await e.run(i,r)}:function(n,r){return eg(n,{file:r,...e||t})}}function tg(e){if(e)throw e}var Ws=Object.prototype.hasOwnProperty,Kb=Object.prototype.toString,ng=Object.defineProperty,rg=Object.getOwnPropertyDescriptor,ig=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Kb.call(t)==="[object Array]"},ag=function(t){if(!t||Kb.call(t)!=="[object Object]")return!1;var n=Ws.call(t,"constructor"),r=t.constructor&&t.constructor.prototype&&Ws.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!r)return!1;var i;for(i in t);return typeof i>"u"||Ws.call(t,i)},og=function(t,n){ng&&n.name==="__proto__"?ng(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},sg=function(t,n){if(n==="__proto__")if(Ws.call(t,n)){if(rg)return rg(t,n).value}else return;return t[n]},k$=function e(){var t,n,r,i,s,o,l=arguments[0],c=1,p=arguments.length,d=!1;for(typeof l=="boolean"&&(d=l,l=arguments[1]||{},c=2),(l==null||typeof l!="object"&&typeof l!="function")&&(l={});c<p;++c)if(t=arguments[c],t!=null)for(n in t)r=sg(l,n),i=sg(t,n),l!==i&&(d&&i&&(ag(i)||(s=ig(i)))?(s?(s=!1,o=r&&ig(r)?r:[]):o=r&&ag(r)?r:{},og(l,{name:n,newValue:e(d,o,i)})):typeof i<"u"&&og(l,{name:n,newValue:i}));return l};const yc=Wi(k$);function up(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function C$(){const e=[],t={run:n,use:r};return t;function n(...i){let s=-1;const o=i.pop();if(typeof o!="function")throw new TypeError("Expected function as last argument, not "+o);l(null,...i);function l(c,...p){const d=e[++s];let h=-1;if(c){o(c);return}for(;++h<i.length;)(p[h]===null||p[h]===void 0)&&(p[h]=i[h]);i=p,d?S$(d,l)(...p):o(null,...p)}}function r(i){if(typeof i!="function")throw new TypeError("Expected `middelware` to be a function, not "+i);return e.push(i),t}}function S$(e,t){let n;return r;function r(...o){const l=e.length>o.length;let c;l&&o.push(i);try{c=e.apply(this,o)}catch(p){const d=p;if(l&&n)throw d;return i(d)}l||(c&&c.then&&typeof c.then=="function"?c.then(s,i):c instanceof Error?i(c):s(c))}function i(o,...l){n||(n=!0,t(o,...l))}function s(o){i(null,o)}}const Mr={basename:E$,dirname:A$,extname:T$,join:I$,sep:"/"};function E$(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Mo(e);let n=0,r=-1,i=e.length,s;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else r<0&&(s=!0,r=i+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let o=-1,l=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(s){n=i+1;break}}else o<0&&(s=!0,o=i+1),l>-1&&(e.codePointAt(i)===t.codePointAt(l--)?l<0&&(r=i):(l=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function A$(e){if(Mo(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function T$(e){Mo(e);let t=e.length,n=-1,r=0,i=-1,s=0,o;for(;t--;){const l=e.codePointAt(t);if(l===47){if(o){r=t+1;break}continue}n<0&&(o=!0,n=t+1),l===46?i<0?i=t:s!==1&&(s=1):i>-1&&(s=-1)}return i<0||n<0||s===0||s===1&&i===n-1&&i===r+1?"":e.slice(i,n)}function I$(...e){let t=-1,n;for(;++t<e.length;)Mo(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":j$(n)}function j$(e){Mo(e);const t=e.codePointAt(0)===47;let n=R$(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function R$(e,t){let n="",r=0,i=-1,s=0,o=-1,l,c;for(;++o<=e.length;){if(o<e.length)l=e.codePointAt(o);else{if(l===47)break;l=47}if(l===47){if(!(i===o-1||s===1))if(i!==o-1&&s===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf("/"),c!==n.length-1){c<0?(n="",r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf("/")),i=o,s=0;continue}}else if(n.length>0){n="",r=0,i=o,s=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1;i=o,s=0}else l===46&&s>-1?s++:s=-1}return n}function Mo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const O$={cwd:z$};function z$(){return"/"}function cp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function N$(e){if(typeof e=="string")e=new URL(e);else if(!cp(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return M$(e)}function M$(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const i=new TypeError("File URL path must not include encoded / characters");throw i.code="ERR_INVALID_FILE_URL_PATH",i}}return decodeURIComponent(t)}const bc=["history","path","basename","stem","extname","dirname"];class Yb{constructor(t){let n;t?cp(t)?n={path:t}:typeof t=="string"||P$(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":O$.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<bc.length;){const s=bc[r];s in n&&n[s]!==void 0&&n[s]!==null&&(this[s]=s==="history"?[...n[s]]:n[s])}let i;for(i in n)bc.includes(i)||(this[i]=n[i])}get basename(){return typeof this.path=="string"?Mr.basename(this.path):void 0}set basename(t){_c(t,"basename"),xc(t,"basename"),this.path=Mr.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Mr.dirname(this.path):void 0}set dirname(t){lg(this.basename,"dirname"),this.path=Mr.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Mr.extname(this.path):void 0}set extname(t){if(xc(t,"extname"),lg(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Mr.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){cp(t)&&(t=N$(t)),_c(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Mr.basename(this.path,this.extname):void 0}set stem(t){_c(t,"stem"),xc(t,"stem"),this.path=Mr.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const i=this.message(t,n,r);throw i.fatal=!0,i}info(t,n,r){const i=this.message(t,n,r);return i.fatal=void 0,i}message(t,n,r){const i=new wn(t,n,r);return this.path&&(i.name=this.path+":"+i.name,i.file=this.path),i.fatal=!1,this.messages.push(i),i}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function xc(e,t){if(e&&e.includes(Mr.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Mr.sep+"`")}function _c(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function lg(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function P$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const $$=function(e){const r=this.constructor.prototype,i=r[e],s=function(){return i.apply(s,arguments)};return Object.setPrototypeOf(s,r),s},D$={}.hasOwnProperty;class ld extends $${constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=C$()}copy(){const t=new ld;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(yc(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Cc("data",this.frozen),this.namespace[t]=n,this):D$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Cc("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const i=n.call(t,...r);typeof i=="function"&&this.transformers.use(i)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Fs(t),r=this.parser||this.Parser;return wc("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),wc("process",this.parser||this.Parser),kc("process",this.compiler||this.Compiler),n?i(void 0,n):new Promise(i);function i(s,o){const l=Fs(t),c=r.parse(l);r.run(c,l,function(d,h,v){if(d||!h||!v)return p(d);const y=h,g=r.stringify(y,v);B$(g)?v.value=g:v.result=g,p(d,v)});function p(d,h){d||!h?o(d):s?s(h):n(void 0,h)}}}processSync(t){let n=!1,r;return this.freeze(),wc("processSync",this.parser||this.Parser),kc("processSync",this.compiler||this.Compiler),this.process(t,i),cg("processSync","process",n),r;function i(s,o){n=!0,tg(s),r=o}}run(t,n,r){ug(t),this.freeze();const i=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?s(void 0,r):new Promise(s);function s(o,l){const c=Fs(n);i.run(t,c,p);function p(d,h,v){const y=h||t;d?l(d):o?o(y):r(void 0,y,v)}}}runSync(t,n){let r=!1,i;return this.run(t,n,s),cg("runSync","run",r),i;function s(o,l){tg(o),i=l,r=!0}}stringify(t,n){this.freeze();const r=Fs(n),i=this.compiler||this.Compiler;return kc("stringify",i),ug(t),i(t,r)}use(t,...n){const r=this.attachers,i=this.namespace;if(Cc("use",this.frozen),t!=null)if(typeof t=="function")c(t,n);else if(typeof t=="object")Array.isArray(t)?l(t):o(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function s(p){if(typeof p=="function")c(p,[]);else if(typeof p=="object")if(Array.isArray(p)){const[d,...h]=p;c(d,h)}else o(p);else throw new TypeError("Expected usable value, not `"+p+"`")}function o(p){if(!("plugins"in p)&&!("settings"in p))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");l(p.plugins),p.settings&&(i.settings=yc(!0,i.settings,p.settings))}function l(p){let d=-1;if(p!=null)if(Array.isArray(p))for(;++d<p.length;){const h=p[d];s(h)}else throw new TypeError("Expected a list of plugins, not `"+p+"`")}function c(p,d){let h=-1,v=-1;for(;++h<r.length;)if(r[h][0]===p){v=h;break}if(v===-1)r.push([p,...d]);else if(d.length>0){let[y,...g]=d;const k=r[v][1];up(k)&&up(y)&&(y=yc(!0,k,y)),r[v]=[p,y,...g]}}}}const F$=new ld().freeze();function wc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function kc(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Cc(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function ug(e){if(!up(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function cg(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Fs(e){return L$(e)?e:new Yb(e)}function L$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function B$(e){return typeof e=="string"||U$(e)}function U$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Z$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",pg=[],dg={allowDangerousHtml:!0},H$=/^(https?|ircs?|mailto|xmpp)$/i,W$=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function q$(e){const t=V$(e),n=G$(e);return J$(t.runSync(t.parse(n),n),e)}function V$(e){const t=e.rehypePlugins||pg,n=e.remarkPlugins||pg,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...dg}:dg;return F$().use(EP).use(n).use(w$,r).use(t)}function G$(e){const t=e.children||"",n=new Yb;return typeof t=="string"&&(n.value=t),n}function J$(e,t){const n=t.allowedElements,r=t.allowElement,i=t.components,s=t.disallowedElements,o=t.skipHtml,l=t.unwrapDisallowed,c=t.urlTransform||K$;for(const d of W$)Object.hasOwn(t,d.from)&&(""+d.from+(d.to?"use `"+d.to+"` instead":"remove it")+Z$+d.id,void 0);return t.className&&(e={type:"element",tagName:"div",properties:{className:t.className},children:e.type==="root"?e.children:[e]}),Jb(e,p),aN(e,{Fragment:m.Fragment,components:i,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function p(d,h,v){if(d.type==="raw"&&v&&typeof h=="number")return o?v.children.splice(h,1):v.children[h]={type:"text",value:d.value},h;if(d.type==="element"){let y;for(y in mc)if(Object.hasOwn(mc,y)&&Object.hasOwn(d.properties,y)){const g=d.properties[y],k=mc[y];(k===null||k.includes(d.tagName))&&(d.properties[y]=c(String(g||""),y,d))}}if(d.type==="element"){let y=n?!n.includes(d.tagName):s?s.includes(d.tagName):!1;if(!y&&r&&typeof h=="number"&&(y=!r(d,h,v)),y&&v&&typeof h=="number")return l&&d.children?v.children.splice(h,1,...d.children):v.children.splice(h,1),h}}}function K$(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),i=e.indexOf("/");return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||H$.test(e.slice(0,t))?e:""}const Xb=W.createContext(),er=()=>W.useContext(Xb);var Qb="vercel.ai.error",Y$=Symbol.for(Qb),fg,hg,gi=class ex extends(hg=Error,fg=Y$,hg){constructor({name:t,message:n,cause:r}){super(n),this[fg]=!0,this.name=t,this.cause=r}static isInstance(t){return ex.hasMarker(t,Qb)}static hasMarker(t,n){const r=Symbol.for(n);return t!=null&&typeof t=="object"&&r in t&&typeof t[r]=="boolean"&&t[r]===!0}};function tx(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var nx="AI_InvalidArgumentError",rx=`vercel.ai.error.${nx}`,X$=Symbol.for(rx),mg,gg,Q$=class extends(gg=gi,mg=X$,gg){constructor({message:t,cause:n,argument:r}){super({name:nx,message:t,cause:n}),this[mg]=!0,this.argument=r}static isInstance(t){return gi.hasMarker(t,rx)}},ix="AI_JSONParseError",ax=`vercel.ai.error.${ix}`,eD=Symbol.for(ax),vg,yg,bg=class extends(yg=gi,vg=eD,yg){constructor({text:t,cause:n}){super({name:ix,message:`JSON parsing failed: Text: ${t}.
Error message: ${tx(n)}`,cause:n}),this[vg]=!0,this.text=t}static isInstance(t){return gi.hasMarker(t,ax)}},ox="AI_TypeValidationError",sx=`vercel.ai.error.${ox}`,tD=Symbol.for(sx),xg,_g,al=class pp extends(_g=gi,xg=tD,_g){constructor({value:t,cause:n}){super({name:ox,message:`Type validation failed: Value: ${JSON.stringify(t)}.
Error message: ${tx(n)}`,cause:n}),this[xg]=!0,this.value=t}static isInstance(t){return gi.hasMarker(t,sx)}static wrap({value:t,cause:n}){return pp.isInstance(n)&&n.value===t?n:new pp({value:t,cause:n})}};class wg extends Error{constructor(t,n){super(t),this.name="ParseError",this.type=n.type,this.field=n.field,this.value=n.value,this.line=n.line}}const kg=10,nD=13,Ri=32;function Sc(e){}function rD(e){if(typeof e=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");const{onEvent:t=Sc,onError:n=Sc,onRetry:r=Sc,onComment:i}=e,s=[];let o=!0,l,c="",p=0,d;function h(x){if(o&&(o=!1,x.charCodeAt(0)===239&&x.charCodeAt(1)===187&&x.charCodeAt(2)===191&&(x=x.slice(3))),s.length===0){const I=v(x);I!==""&&s.push(I);return}if(x.indexOf(`
`)===-1&&x.indexOf("\r")===-1){s.push(x);return}s.push(x);const S=s.join("");s.length=0;const T=v(S);T!==""&&s.push(T)}function v(x){let S=0;if(x.indexOf("\r")===-1){let T=x.indexOf(`
`,S);for(;T!==-1;){if(S===T){p>0&&t({id:l,event:d,data:c}),l=void 0,c="",p=0,d=void 0,S=T+1,T=x.indexOf(`
`,S);continue}const I=x.charCodeAt(S);if(Cg(x,S,I)){const O=x.charCodeAt(S+5)===Ri?S+6:S+5,R=x.slice(O,T);if(p===0&&x.charCodeAt(T+1)===kg){t({id:l,event:d,data:R}),l=void 0,c="",d=void 0,S=T+2,T=x.indexOf(`
`,S);continue}c=p===0?R:`${c}
${R}`,p++}else Sg(x,S,I)?d=x.slice(x.charCodeAt(S+6)===Ri?S+7:S+6,T)||void 0:y(x,S,T);S=T+1,T=x.indexOf(`
`,S)}return x.slice(S)}for(;S<x.length;){const T=x.indexOf("\r",S),I=x.indexOf(`
`,S);let O=-1;if(T!==-1&&I!==-1?O=T<I?T:I:T!==-1?T===x.length-1?O=-1:O=T:I!==-1&&(O=I),O===-1)break;y(x,S,O),S=O+1,x.charCodeAt(S-1)===nD&&x.charCodeAt(S)===kg&&S++}return x.slice(S)}function y(x,S,T){if(S===T){k();return}const I=x.charCodeAt(S);if(Cg(x,S,I)){const q=x.charCodeAt(S+5)===Ri?S+6:S+5,D=x.slice(q,T);c=p===0?D:`${c}
${D}`,p++;return}if(Sg(x,S,I)){d=x.slice(x.charCodeAt(S+6)===Ri?S+7:S+6,T)||void 0;return}if(I===105&&x.charCodeAt(S+1)===100&&x.charCodeAt(S+2)===58){const q=x.slice(x.charCodeAt(S+3)===Ri?S+4:S+3,T);l=q.includes("\0")?void 0:q;return}if(I===58){if(i){const q=x.slice(S,T);i(q.slice(x.charCodeAt(S+1)===Ri?2:1))}return}const O=x.slice(S,T),R=O.indexOf(":");if(R===-1){g(O,"",O);return}const B=O.slice(0,R),L=O.charCodeAt(R+1)===Ri?2:1,V=O.slice(R+L);g(B,V,O)}function g(x,S,T){switch(x){case"event":d=S||void 0;break;case"data":c=p===0?S:`${c}
${S}`,p++;break;case"id":l=S.includes("\0")?void 0:S;break;case"retry":/^\d+$/.test(S)?r(parseInt(S,10)):n(new wg(`Invalid \`retry\` value: "${S}"`,{type:"invalid-retry",value:S,line:T}));break;default:n(new wg(`Unknown field "${x.length>20?`${x.slice(0,20)}…`:x}"`,{type:"unknown-field",field:x,value:S,line:T}));break}}function k(){p>0&&t({id:l,event:d,data:c}),l=void 0,c="",p=0,d=void 0}function _(x={}){if(x.consume&&s.length>0){const S=s.join("");y(S,0,S.length)}o=!0,l=void 0,c="",p=0,d=void 0,s.length=0}return{feed:h,reset:_}}function Cg(e,t,n){return n===100&&e.charCodeAt(t+1)===97&&e.charCodeAt(t+2)===116&&e.charCodeAt(t+3)===97&&e.charCodeAt(t+4)===58}function Sg(e,t,n){return n===101&&e.charCodeAt(t+1)===118&&e.charCodeAt(t+2)===101&&e.charCodeAt(t+3)===110&&e.charCodeAt(t+4)===116&&e.charCodeAt(t+5)===58}class lx extends TransformStream{constructor({onError:t,onRetry:n,onComment:r}={}){let i;super({start(s){i=rD({onEvent:o=>{s.enqueue(o)},onError(o){t==="terminate"?s.error(o):typeof t=="function"&&t(o)},onRetry:n,onComment:r})},transform(s){i.feed(s)}})}}var Eg;function de(e,t,n){function r(l,c){if(l._zod||Object.defineProperty(l,"_zod",{value:{def:c,constr:o,traits:new Set},enumerable:!1}),l._zod.traits.has(e))return;l._zod.traits.add(e),t(l,c);const p=o.prototype,d=Object.keys(p);for(let h=0;h<d.length;h++){const v=d[h];v in l||(l[v]=p[v].bind(l))}}const i=n?.Parent??Object;class s extends i{}Object.defineProperty(s,"name",{value:e});function o(l){var c;const p=n?.Parent?new s:this;r(p,l),(c=p._zod).deferred??(c.deferred=[]);for(const d of p._zod.deferred)d();return p}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:l=>n?.Parent&&l instanceof n.Parent?!0:l?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}class ka extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class ux extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}}(Eg=globalThis).__zod_globalConfig??(Eg.__zod_globalConfig={});const ud=globalThis.__zod_globalConfig;function ei(e){return ud}function cx(e){const t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,i])=>t.indexOf(+r)===-1).map(([r,i])=>i)}function dp(e,t){return typeof t=="bigint"?t.toString():t}function Rl(e){return{get value(){{const t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function cd(e){return e==null}function pd(e){const t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function iD(e,t){const n=e/t,r=Math.round(n),i=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}const Ag=Symbol("evaluating");function vt(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==Ag)return r===void 0&&(r=Ag,r=n()),r},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}function Vi(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function xi(...e){const t={};for(const n of e){const r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Tg(e){return JSON.stringify(e)}function aD(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const px="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function So(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const oD=Rl(()=>{if(ud.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{const e=Function;return new e(""),!0}catch{return!1}});function Ea(e){if(So(e)===!1)return!1;const t=e.constructor;if(t===void 0||typeof t!="function")return!0;const n=t.prototype;return!(So(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function dx(e){return Ea(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}const sD=new Set(["string","number","symbol"]);function Aa(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _i(e,t,n){const r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Fe(e){const t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function lD(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}const uD={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function cD(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");const s=xi(e._zod.def,{get shape(){const o={};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&(o[l]=n.shape[l])}return Vi(this,"shape",o),o},checks:[]});return _i(e,s)}function pD(e,t){const n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");const s=xi(e._zod.def,{get shape(){const o={...e._zod.def.shape};for(const l in t){if(!(l in n.shape))throw new Error(`Unrecognized key: "${l}"`);t[l]&&delete o[l]}return Vi(this,"shape",o),o},checks:[]});return _i(e,s)}function dD(e,t){if(!Ea(t))throw new Error("Invalid input to extend: expected a plain object");const n=e._zod.def.checks;if(n&&n.length>0){const s=e._zod.def.shape;for(const o in t)if(Object.getOwnPropertyDescriptor(s,o)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}const i=xi(e._zod.def,{get shape(){const s={...e._zod.def.shape,...t};return Vi(this,"shape",s),s}});return _i(e,i)}function fD(e,t){if(!Ea(t))throw new Error("Invalid input to safeExtend: expected a plain object");const n=xi(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t};return Vi(this,"shape",r),r}});return _i(e,n)}function hD(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");const n=xi(e._zod.def,{get shape(){const r={...e._zod.def.shape,...t._zod.def.shape};return Vi(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return _i(e,n)}function mD(e,t,n){const i=t._zod.def.checks;if(i&&i.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");const o=xi(t._zod.def,{get shape(){const l=t._zod.def.shape,c={...l};if(n)for(const p in n){if(!(p in l))throw new Error(`Unrecognized key: "${p}"`);n[p]&&(c[p]=e?new e({type:"optional",innerType:l[p]}):l[p])}else for(const p in l)c[p]=e?new e({type:"optional",innerType:l[p]}):l[p];return Vi(this,"shape",c),c},checks:[]});return _i(t,o)}function gD(e,t,n){const r=xi(t._zod.def,{get shape(){const i=t._zod.def.shape,s={...i};if(n)for(const o in n){if(!(o in s))throw new Error(`Unrecognized key: "${o}"`);n[o]&&(s[o]=new e({type:"nonoptional",innerType:i[o]}))}else for(const o in i)s[o]=new e({type:"nonoptional",innerType:i[o]});return Vi(this,"shape",s),s}});return _i(t,r)}function va(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function vD(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ya(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function Ls(e){return typeof e=="string"?e:e?.message}function ti(e,t,n){const r=e.message?e.message:Ls(e.inst?._zod.def?.error?.(e))??Ls(t?.error?.(e))??Ls(n.customError?.(e))??Ls(n.localeError?.(e))??"Invalid input",{inst:i,continue:s,input:o,...l}=e;return l.path??(l.path=[]),l.message=r,t?.reportInput&&(l.input=o),l}function dd(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Eo(...e){const[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}const fx=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,dp,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},hx=de("$ZodError",fx),mx=de("$ZodError",fx,{Parent:Error});function yD(e,t=n=>n.message){const n={},r=[];for(const i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function bD(e,t=n=>n.message){const n={_errors:[]},r=(i,s=[])=>{for(const o of i.issues)if(o.code==="invalid_union"&&o.errors.length)o.errors.map(l=>r({issues:l},[...s,...o.path]));else if(o.code==="invalid_key")r({issues:o.issues},[...s,...o.path]);else if(o.code==="invalid_element")r({issues:o.issues},[...s,...o.path]);else{const l=[...s,...o.path];if(l.length===0)n._errors.push(t(o));else{let c=n,p=0;for(;p<l.length;){const d=l[p];p===l.length-1?(c[d]=c[d]||{_errors:[]},c[d]._errors.push(t(o))):c[d]=c[d]||{_errors:[]},c=c[d],p++}}}};return r(e),n}const fd=e=>(t,n,r,i)=>{const s=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise)throw new ka;if(o.issues.length){const l=new(i?.Err??e)(o.issues.map(c=>ti(c,s,ei())));throw px(l,i?.callee),l}return o.value},hd=e=>async(t,n,r,i)=>{const s=r?{...r,async:!0}:{async:!0};let o=t._zod.run({value:n,issues:[]},s);if(o instanceof Promise&&(o=await o),o.issues.length){const l=new(i?.Err??e)(o.issues.map(c=>ti(c,s,ei())));throw px(l,i?.callee),l}return o.value},Ol=e=>(t,n,r)=>{const i=r?{...r,async:!1}:{async:!1},s=t._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw new ka;return s.issues.length?{success:!1,error:new(e??hx)(s.issues.map(o=>ti(o,i,ei())))}:{success:!0,data:s.value}},xD=Ol(mx),zl=e=>async(t,n,r)=>{const i=r?{...r,async:!0}:{async:!0};let s=t._zod.run({value:n,issues:[]},i);return s instanceof Promise&&(s=await s),s.issues.length?{success:!1,error:new e(s.issues.map(o=>ti(o,i,ei())))}:{success:!0,data:s.value}},_D=zl(mx),wD=e=>(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return fd(e)(t,n,i)},kD=e=>(t,n,r)=>fd(e)(t,n,r),CD=e=>async(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return hd(e)(t,n,i)},SD=e=>async(t,n,r)=>hd(e)(t,n,r),ED=e=>(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return Ol(e)(t,n,i)},AD=e=>(t,n,r)=>Ol(e)(t,n,r),TD=e=>async(t,n,r)=>{const i=r?{...r,direction:"backward"}:{direction:"backward"};return zl(e)(t,n,i)},ID=e=>async(t,n,r)=>zl(e)(t,n,r),jD=/^[cC][0-9a-z]{6,}$/,RD=/^[0-9a-z]+$/,OD=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zD=/^[0-9a-vA-V]{20}$/,ND=/^[A-Za-z0-9]{27}$/,MD=/^[a-zA-Z0-9_-]{21}$/,PD=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,$D=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Ig=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,DD=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,FD="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function LD(){return new RegExp(FD,"u")}const BD=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,UD=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ZD=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,HD=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,WD=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,gx=/^[A-Za-z0-9_-]*$/,qD=/^https?$/,VD=/^\+[1-9]\d{6,14}$/,vx="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",GD=new RegExp(`^${vx}$`);function yx(e){const t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function JD(e){return new RegExp(`^${yx(e)}$`)}function KD(e){const t=yx({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const r=`${t}(?:${n.join("|")})`;return new RegExp(`^${vx}T(?:${r})$`)}const YD=e=>{const t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},XD=/^-?\d+$/,bx=/^-?\d+(?:\.\d+)?$/,QD=/^(?:true|false)$/i,eF=/^null$/i,tF=/^[^A-Z]*$/,nF=/^[^a-z]*$/,Ln=de("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),xx={number:"number",bigint:"bigint",object:"date"},_x=de("$ZodCheckLessThan",(e,t)=>{Ln.init(e,t);const n=xx[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.maximum:i.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<s&&(t.inclusive?i.maximum=t.value:i.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),wx=de("$ZodCheckGreaterThan",(e,t)=>{Ln.init(e,t);const n=xx[typeof t.value];e._zod.onattach.push(r=>{const i=r._zod.bag,s=(t.inclusive?i.minimum:i.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>s&&(t.inclusive?i.minimum=t.value:i.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),rF=de("$ZodCheckMultipleOf",(e,t)=>{Ln.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):iD(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),iF=de("$ZodCheckNumberFormat",(e,t)=>{Ln.init(e,t),t.format=t.format||"float64";const n=t.format?.includes("int"),r=n?"int":"number",[i,s]=uD[t.format];e._zod.onattach.push(o=>{const l=o._zod.bag;l.format=t.format,l.minimum=i,l.maximum=s,n&&(l.pattern=XD)}),e._zod.check=o=>{const l=o.value;if(n){if(!Number.isInteger(l)){o.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:l,inst:e});return}if(!Number.isSafeInteger(l)){l>0?o.issues.push({input:l,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:l,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}l<i&&o.issues.push({origin:"number",input:l,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),l>s&&o.issues.push({origin:"number",input:l,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}}),aF=de("$ZodCheckMaxLength",(e,t)=>{var n;Ln.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!cd(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<i&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{const i=r.value;if(i.length<=t.maximum)return;const o=dd(i);r.issues.push({origin:o,code:"too_big",maximum:t.maximum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),oF=de("$ZodCheckMinLength",(e,t)=>{var n;Ln.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!cd(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{const i=r.value;if(i.length>=t.minimum)return;const o=dd(i);r.issues.push({origin:o,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}}),sF=de("$ZodCheckLengthEquals",(e,t)=>{var n;Ln.init(e,t),(n=e._zod.def).when??(n.when=r=>{const i=r.value;return!cd(i)&&i.length!==void 0}),e._zod.onattach.push(r=>{const i=r._zod.bag;i.minimum=t.length,i.maximum=t.length,i.length=t.length}),e._zod.check=r=>{const i=r.value,s=i.length;if(s===t.length)return;const o=dd(i),l=s>t.length;r.issues.push({origin:o,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),Nl=de("$ZodCheckStringFormat",(e,t)=>{var n,r;Ln.init(e,t),e._zod.onattach.push(i=>{const s=i._zod.bag;s.format=t.format,t.pattern&&(s.patterns??(s.patterns=new Set),s.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),lF=de("$ZodCheckRegex",(e,t)=>{Nl.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),uF=de("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=tF),Nl.init(e,t)}),cF=de("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=nF),Nl.init(e,t)}),pF=de("$ZodCheckIncludes",(e,t)=>{Ln.init(e,t);const n=Aa(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(i=>{const s=i._zod.bag;s.patterns??(s.patterns=new Set),s.patterns.add(r)}),e._zod.check=i=>{i.value.includes(t.includes,t.position)||i.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:i.value,inst:e,continue:!t.abort})}}),dF=de("$ZodCheckStartsWith",(e,t)=>{Ln.init(e,t);const n=new RegExp(`^${Aa(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),fF=de("$ZodCheckEndsWith",(e,t)=>{Ln.init(e,t);const n=new RegExp(`.*${Aa(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{const i=r._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}}),hF=de("$ZodCheckOverwrite",(e,t)=>{Ln.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}});class mF{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}const r=t.split(`
`).filter(o=>o),i=Math.min(...r.map(o=>o.length-o.trimStart().length)),s=r.map(o=>o.slice(i)).map(o=>" ".repeat(this.indent*2)+o);for(const o of s)this.content.push(o)}compile(){const t=Function,n=this?.args,i=[...(this?.content??[""]).map(s=>`  ${s}`)];return new t(...n,i.join(`
`))}}const gF={major:4,minor:4,patch:3},Bt=de("$ZodType",(e,t)=>{var n;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=gF;const r=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&r.unshift(e);for(const i of r)for(const s of i._zod.onattach)s(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{const i=(o,l,c)=>{let p=va(o),d;for(const h of l){if(h._zod.def.when){if(vD(o)||!h._zod.def.when(o))continue}else if(p)continue;const v=o.issues.length,y=h._zod.check(o);if(y instanceof Promise&&c?.async===!1)throw new ka;if(d||y instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await y,o.issues.length!==v&&(p||(p=va(o,v)))});else{if(o.issues.length===v)continue;p||(p=va(o,v))}}return d?d.then(()=>o):o},s=(o,l,c)=>{if(va(o))return o.aborted=!0,o;const p=i(l,r,c);if(p instanceof Promise){if(c.async===!1)throw new ka;return p.then(d=>e._zod.parse(d,c))}return e._zod.parse(p,c)};e._zod.run=(o,l)=>{if(l.skipChecks)return e._zod.parse(o,l);if(l.direction==="backward"){const p=e._zod.parse({value:o.value,issues:[]},{...l,skipChecks:!0});return p instanceof Promise?p.then(d=>s(d,o,l)):s(p,o,l)}const c=e._zod.parse(o,l);if(c instanceof Promise){if(l.async===!1)throw new ka;return c.then(p=>i(p,r,l))}return i(c,r,l)}}vt(e,"~standard",()=>({validate:i=>{try{const s=xD(e,i);return s.success?{value:s.data}:{issues:s.error?.issues}}catch{return _D(e,i).then(o=>o.success?{value:o.data}:{issues:o.error?.issues})}},vendor:"zod",version:1}))}),md=de("$ZodString",(e,t)=>{Bt.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??YD(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value=="string"||n.issues.push({expected:"string",code:"invalid_type",input:n.value,inst:e}),n}}),qt=de("$ZodStringFormat",(e,t)=>{Nl.init(e,t),md.init(e,t)}),vF=de("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=$D),qt.init(e,t)}),yF=de("$ZodUUID",(e,t)=>{if(t.version){const r={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(r===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=Ig(r))}else t.pattern??(t.pattern=Ig());qt.init(e,t)}),bF=de("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=DD),qt.init(e,t)}),xF=de("$ZodURL",(e,t)=>{qt.init(e,t),e._zod.check=n=>{try{const r=n.value.trim();if(!t.normalize&&t.protocol?.source===qD.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:n.value,inst:e,continue:!t.abort});return}const i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),t.normalize?n.value=i.href:n.value=r;return}catch{n.issues.push({code:"invalid_format",format:"url",input:n.value,inst:e,continue:!t.abort})}}}),_F=de("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=LD()),qt.init(e,t)}),wF=de("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=MD),qt.init(e,t)}),kF=de("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=jD),qt.init(e,t)}),CF=de("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=RD),qt.init(e,t)}),SF=de("$ZodULID",(e,t)=>{t.pattern??(t.pattern=OD),qt.init(e,t)}),EF=de("$ZodXID",(e,t)=>{t.pattern??(t.pattern=zD),qt.init(e,t)}),AF=de("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=ND),qt.init(e,t)}),TF=de("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=KD(t)),qt.init(e,t)}),IF=de("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=GD),qt.init(e,t)}),jF=de("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=JD(t)),qt.init(e,t)}),RF=de("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=PD),qt.init(e,t)}),OF=de("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=BD),qt.init(e,t),e._zod.bag.format="ipv4"}),zF=de("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=UD),qt.init(e,t),e._zod.bag.format="ipv6",e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:"invalid_format",format:"ipv6",input:n.value,inst:e,continue:!t.abort})}}}),NF=de("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=ZD),qt.init(e,t)}),MF=de("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=HD),qt.init(e,t),e._zod.check=n=>{const r=n.value.split("/");try{if(r.length!==2)throw new Error;const[i,s]=r;if(!s)throw new Error;const o=Number(s);if(`${o}`!==s)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{n.issues.push({code:"invalid_format",format:"cidrv6",input:n.value,inst:e,continue:!t.abort})}}});function kx(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const PF=de("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=WD),qt.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=n=>{kx(n.value)||n.issues.push({code:"invalid_format",format:"base64",input:n.value,inst:e,continue:!t.abort})}});function $F(e){if(!gx.test(e))return!1;const t=e.replace(/[-_]/g,r=>r==="-"?"+":"/"),n=t.padEnd(Math.ceil(t.length/4)*4,"=");return kx(n)}const DF=de("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=gx),qt.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=n=>{$F(n.value)||n.issues.push({code:"invalid_format",format:"base64url",input:n.value,inst:e,continue:!t.abort})}}),FF=de("$ZodE164",(e,t)=>{t.pattern??(t.pattern=VD),qt.init(e,t)});function LF(e,t=null){try{const n=e.split(".");if(n.length!==3)return!1;const[r]=n;if(!r)return!1;const i=JSON.parse(atob(r));return!("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))}catch{return!1}}const BF=de("$ZodJWT",(e,t)=>{qt.init(e,t),e._zod.check=n=>{LF(n.value,t.alg)||n.issues.push({code:"invalid_format",format:"jwt",input:n.value,inst:e,continue:!t.abort})}}),Cx=de("$ZodNumber",(e,t)=>{Bt.init(e,t),e._zod.pattern=e._zod.bag.pattern??bx,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}const i=n.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return n;const s=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return n.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...s?{received:s}:{}}),n}}),UF=de("$ZodNumberFormat",(e,t)=>{iF.init(e,t),Cx.init(e,t)}),ZF=de("$ZodBoolean",(e,t)=>{Bt.init(e,t),e._zod.pattern=QD,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}const i=n.value;return typeof i=="boolean"||n.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),n}}),HF=de("$ZodNull",(e,t)=>{Bt.init(e,t),e._zod.pattern=eF,e._zod.values=new Set([null]),e._zod.parse=(n,r)=>{const i=n.value;return i===null||n.issues.push({expected:"null",code:"invalid_type",input:i,inst:e}),n}}),WF=de("$ZodUnknown",(e,t)=>{Bt.init(e,t),e._zod.parse=n=>n}),qF=de("$ZodNever",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>(n.issues.push({expected:"never",code:"invalid_type",input:n.value,inst:e}),n)});function jg(e,t,n){e.issues.length&&t.issues.push(...ya(n,e.issues)),t.value[n]=e.value}const VF=de("$ZodArray",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Array.isArray(i))return n.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),n;n.value=Array(i.length);const s=[];for(let o=0;o<i.length;o++){const l=i[o],c=t.element._zod.run({value:l,issues:[]},r);c instanceof Promise?s.push(c.then(p=>jg(p,n,o))):jg(c,n,o)}return s.length?Promise.all(s).then(()=>n):n}});function ol(e,t,n,r,i,s){const o=n in r;if(e.issues.length){if(i&&s&&!o)return;t.issues.push(...ya(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function Sx(e){const t=Object.keys(e.shape);for(const r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${r}": expected a Zod schema`);const n=lD(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function Ex(e,t,n,r,i,s){const o=[],l=i.keySet,c=i.catchall._zod,p=c.def.type,d=c.optin==="optional",h=c.optout==="optional";for(const v in t){if(v==="__proto__"||l.has(v))continue;if(p==="never"){o.push(v);continue}const y=c.run({value:t[v],issues:[]},r);y instanceof Promise?e.push(y.then(g=>ol(g,n,v,t,d,h))):ol(y,n,v,t,d,h)}return o.length&&n.issues.push({code:"unrecognized_keys",keys:o,input:t,inst:s}),e.length?Promise.all(e).then(()=>n):n}const GF=de("$ZodObject",(e,t)=>{if(Bt.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){const l=t.shape;Object.defineProperty(t,"shape",{get:()=>{const c={...l};return Object.defineProperty(t,"shape",{value:c}),c}})}const r=Rl(()=>Sx(t));vt(e._zod,"propValues",()=>{const l=t.shape,c={};for(const p in l){const d=l[p]._zod;if(d.values){c[p]??(c[p]=new Set);for(const h of d.values)c[p].add(h)}}return c});const i=So,s=t.catchall;let o;e._zod.parse=(l,c)=>{o??(o=r.value);const p=l.value;if(!i(p))return l.issues.push({expected:"object",code:"invalid_type",input:p,inst:e}),l;l.value={};const d=[],h=o.shape;for(const v of o.keys){const y=h[v],g=y._zod.optin==="optional",k=y._zod.optout==="optional",_=y._zod.run({value:p[v],issues:[]},c);_ instanceof Promise?d.push(_.then(x=>ol(x,l,v,p,g,k))):ol(_,l,v,p,g,k)}return s?Ex(d,p,l,c,r.value,e):d.length?Promise.all(d).then(()=>l):l}}),JF=de("$ZodObjectJIT",(e,t)=>{GF.init(e,t);const n=e._zod.parse,r=Rl(()=>Sx(t)),i=v=>{const y=new mF(["shape","payload","ctx"]),g=r.value,k=T=>{const I=Tg(T);return`shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`};y.write("const input = payload.value;");const _=Object.create(null);let x=0;for(const T of g.keys)_[T]=`key_${x++}`;y.write("const newResult = {};");for(const T of g.keys){const I=_[T],O=Tg(T),R=v[T],B=R?._zod?.optin==="optional",L=R?._zod?.optout==="optional";y.write(`const ${I} = ${k(T)};`),B&&L?y.write(`
        if (${I}.issues.length) {
          if (${O} in input) {
            payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
              ...iss,
              path: iss.path ? [${O}, ...iss.path] : [${O}]
            })));
          }
        }
        
        if (${I}.value === undefined) {
          if (${O} in input) {
            newResult[${O}] = undefined;
          }
        } else {
          newResult[${O}] = ${I}.value;
        }
        
      `):B?y.write(`
        if (${I}.issues.length) {
          payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
            ...iss,
            path: iss.path ? [${O}, ...iss.path] : [${O}]
          })));
        }
        
        if (${I}.value === undefined) {
          if (${O} in input) {
            newResult[${O}] = undefined;
          }
        } else {
          newResult[${O}] = ${I}.value;
        }
        
      `):y.write(`
        const ${I}_present = ${O} in input;
        if (${I}.issues.length) {
          payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
            ...iss,
            path: iss.path ? [${O}, ...iss.path] : [${O}]
          })));
        }
        if (!${I}_present && !${I}.issues.length) {
          payload.issues.push({
            code: "invalid_type",
            expected: "nonoptional",
            input: undefined,
            path: [${O}]
          });
        }

        if (${I}_present) {
          if (${I}.value === undefined) {
            newResult[${O}] = undefined;
          } else {
            newResult[${O}] = ${I}.value;
          }
        }

      `)}y.write("payload.value = newResult;"),y.write("return payload;");const S=y.compile();return(T,I)=>S(v,T,I)};let s;const o=So,l=!ud.jitless,p=l&&oD.value,d=t.catchall;let h;e._zod.parse=(v,y)=>{h??(h=r.value);const g=v.value;return o(g)?l&&p&&y?.async===!1&&y.jitless!==!0?(s||(s=i(t.shape)),v=s(v,y),d?Ex([],g,v,y,h,e):v):n(v,y):(v.issues.push({expected:"object",code:"invalid_type",input:g,inst:e}),v)}});function Rg(e,t,n,r){for(const s of e)if(s.issues.length===0)return t.value=s.value,t;const i=e.filter(s=>!va(s));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:n,errors:e.map(s=>s.issues.map(o=>ti(o,r,ei())))}),t)}const Ax=de("$ZodUnion",(e,t)=>{Bt.init(e,t),vt(e._zod,"optin",()=>t.options.some(r=>r._zod.optin==="optional")?"optional":void 0),vt(e._zod,"optout",()=>t.options.some(r=>r._zod.optout==="optional")?"optional":void 0),vt(e._zod,"values",()=>{if(t.options.every(r=>r._zod.values))return new Set(t.options.flatMap(r=>Array.from(r._zod.values)))}),vt(e._zod,"pattern",()=>{if(t.options.every(r=>r._zod.pattern)){const r=t.options.map(i=>i._zod.pattern);return new RegExp(`^(${r.map(i=>pd(i.source)).join("|")})$`)}});const n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let s=!1;const o=[];for(const l of t.options){const c=l._zod.run({value:r.value,issues:[]},i);if(c instanceof Promise)o.push(c),s=!0;else{if(c.issues.length===0)return c;o.push(c)}}return s?Promise.all(o).then(l=>Rg(l,r,e,i)):Rg(o,r,e,i)}}),KF=de("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,Ax.init(e,t);const n=e._zod.parse;vt(e._zod,"propValues",()=>{const i={};for(const s of t.options){const o=s._zod.propValues;if(!o||Object.keys(o).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(const[l,c]of Object.entries(o)){i[l]||(i[l]=new Set);for(const p of c)i[l].add(p)}}return i});const r=Rl(()=>{const i=t.options,s=new Map;for(const o of i){const l=o._zod.propValues?.[t.discriminator];if(!l||l.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(o)}"`);for(const c of l){if(s.has(c))throw new Error(`Duplicate discriminator value "${String(c)}"`);s.set(c,o)}}return s});e._zod.parse=(i,s)=>{const o=i.value;if(!So(o))return i.issues.push({code:"invalid_type",expected:"object",input:o,inst:e}),i;const l=r.value.get(o?.[t.discriminator]);return l?l._zod.run(i,s):t.unionFallback||s.direction==="backward"?n(i,s):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(r.value.keys()),input:o,path:[t.discriminator],inst:e}),i)}}),YF=de("$ZodIntersection",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value,s=t.left._zod.run({value:i,issues:[]},r),o=t.right._zod.run({value:i,issues:[]},r);return s instanceof Promise||o instanceof Promise?Promise.all([s,o]).then(([c,p])=>Og(n,c,p)):Og(n,s,o)}});function fp(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ea(e)&&Ea(t)){const n=Object.keys(t),r=Object.keys(e).filter(s=>n.indexOf(s)!==-1),i={...e,...t};for(const s of r){const o=fp(e[s],t[s]);if(!o.valid)return{valid:!1,mergeErrorPath:[s,...o.mergeErrorPath]};i[s]=o.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};const n=[];for(let r=0;r<e.length;r++){const i=e[r],s=t[r],o=fp(i,s);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Og(e,t,n){const r=new Map;let i;for(const l of t.issues)if(l.code==="unrecognized_keys"){i??(i=l);for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).l=!0}else e.issues.push(l);for(const l of n.issues)if(l.code==="unrecognized_keys")for(const c of l.keys)r.has(c)||r.set(c,{}),r.get(c).r=!0;else e.issues.push(l);const s=[...r].filter(([,l])=>l.l&&l.r).map(([l])=>l);if(s.length&&i&&e.issues.push({...i,keys:s}),va(e))return e;const o=fp(t.value,n.value);if(!o.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}const XF=de("$ZodRecord",(e,t)=>{Bt.init(e,t),e._zod.parse=(n,r)=>{const i=n.value;if(!Ea(i))return n.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),n;const s=[],o=t.keyType._zod.values;if(o){n.value={};const l=new Set;for(const p of o)if(typeof p=="string"||typeof p=="number"||typeof p=="symbol"){l.add(typeof p=="number"?p.toString():p);const d=t.keyType._zod.run({value:p,issues:[]},r);if(d instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(d.issues.length){n.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map(y=>ti(y,r,ei())),input:p,path:[p],inst:e});continue}const h=d.value,v=t.valueType._zod.run({value:i[p],issues:[]},r);v instanceof Promise?s.push(v.then(y=>{y.issues.length&&n.issues.push(...ya(p,y.issues)),n.value[h]=y.value})):(v.issues.length&&n.issues.push(...ya(p,v.issues)),n.value[h]=v.value)}let c;for(const p in i)l.has(p)||(c=c??[],c.push(p));c&&c.length>0&&n.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:c})}else{n.value={};for(const l of Reflect.ownKeys(i)){if(l==="__proto__"||!Object.prototype.propertyIsEnumerable.call(i,l))continue;let c=t.keyType._zod.run({value:l,issues:[]},r);if(c instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof l=="string"&&bx.test(l)&&c.issues.length){const h=t.keyType._zod.run({value:Number(l),issues:[]},r);if(h instanceof Promise)throw new Error("Async schemas not supported in object keys currently");h.issues.length===0&&(c=h)}if(c.issues.length){t.mode==="loose"?n.value[l]=i[l]:n.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map(h=>ti(h,r,ei())),input:l,path:[l],inst:e});continue}const d=t.valueType._zod.run({value:i[l],issues:[]},r);d instanceof Promise?s.push(d.then(h=>{h.issues.length&&n.issues.push(...ya(l,h.issues)),n.value[c.value]=h.value})):(d.issues.length&&n.issues.push(...ya(l,d.issues)),n.value[c.value]=d.value)}}return s.length?Promise.all(s).then(()=>n):n}}),QF=de("$ZodEnum",(e,t)=>{Bt.init(e,t);const n=cx(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=new RegExp(`^(${n.filter(i=>sD.has(typeof i)).map(i=>typeof i=="string"?Aa(i):i.toString()).join("|")})$`),e._zod.parse=(i,s)=>{const o=i.value;return r.has(o)||i.issues.push({code:"invalid_value",values:n,input:o,inst:e}),i}}),eL=de("$ZodLiteral",(e,t)=>{if(Bt.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");const n=new Set(t.values);e._zod.values=n,e._zod.pattern=new RegExp(`^(${t.values.map(r=>typeof r=="string"?Aa(r):r?Aa(r.toString()):String(r)).join("|")})$`),e._zod.parse=(r,i)=>{const s=r.value;return n.has(s)||r.issues.push({code:"invalid_value",values:t.values,input:s,inst:e}),r}}),tL=de("$ZodTransform",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ux(e.constructor.name);const i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(o=>(n.value=o,n.fallback=!0,n));if(i instanceof Promise)throw new ka;return n.value=i,n.fallback=!0,n}});function zg(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}const Tx=de("$ZodOptional",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",e._zod.optout="optional",vt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),vt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${pd(n.source)})?$`):void 0}),e._zod.parse=(n,r)=>{if(t.innerType._zod.optin==="optional"){const i=n.value,s=t.innerType._zod.run(n,r);return s instanceof Promise?s.then(o=>zg(o,i)):zg(s,i)}return n.value===void 0?n:t.innerType._zod.run(n,r)}}),nL=de("$ZodExactOptional",(e,t)=>{Tx.init(e,t),vt(e._zod,"values",()=>t.innerType._zod.values),vt(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(n,r)=>t.innerType._zod.run(n,r)}),rL=de("$ZodNullable",(e,t)=>{Bt.init(e,t),vt(e._zod,"optin",()=>t.innerType._zod.optin),vt(e._zod,"optout",()=>t.innerType._zod.optout),vt(e._zod,"pattern",()=>{const n=t.innerType._zod.pattern;return n?new RegExp(`^(${pd(n.source)}|null)$`):void 0}),vt(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(n,r)=>n.value===null?n:t.innerType._zod.run(n,r)}),iL=de("$ZodDefault",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",vt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);if(n.value===void 0)return n.value=t.defaultValue,n;const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>Ng(s,t)):Ng(i,t)}});function Ng(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}const aL=de("$ZodPrefault",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",vt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>(r.direction==="backward"||n.value===void 0&&(n.value=t.defaultValue),t.innerType._zod.run(n,r))}),oL=de("$ZodNonOptional",(e,t)=>{Bt.init(e,t),vt(e._zod,"values",()=>{const n=t.innerType._zod.values;return n?new Set([...n].filter(r=>r!==void 0)):void 0}),e._zod.parse=(n,r)=>{const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>Mg(s,e)):Mg(i,e)}});function Mg(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}const sL=de("$ZodCatch",(e,t)=>{Bt.init(e,t),e._zod.optin="optional",vt(e._zod,"optout",()=>t.innerType._zod.optout),vt(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(s=>(n.value=s.value,s.issues.length&&(n.value=t.catchValue({...n,error:{issues:s.issues.map(o=>ti(o,r,ei()))},input:n.value}),n.issues=[],n.fallback=!0),n)):(n.value=i.value,i.issues.length&&(n.value=t.catchValue({...n,error:{issues:i.issues.map(s=>ti(s,r,ei()))},input:n.value}),n.issues=[],n.fallback=!0),n)}}),lL=de("$ZodPipe",(e,t)=>{Bt.init(e,t),vt(e._zod,"values",()=>t.in._zod.values),vt(e._zod,"optin",()=>t.in._zod.optin),vt(e._zod,"optout",()=>t.out._zod.optout),vt(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(n,r)=>{if(r.direction==="backward"){const s=t.out._zod.run(n,r);return s instanceof Promise?s.then(o=>Bs(o,t.in,r)):Bs(s,t.in,r)}const i=t.in._zod.run(n,r);return i instanceof Promise?i.then(s=>Bs(s,t.out,r)):Bs(i,t.out,r)}});function Bs(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}const uL=de("$ZodReadonly",(e,t)=>{Bt.init(e,t),vt(e._zod,"propValues",()=>t.innerType._zod.propValues),vt(e._zod,"values",()=>t.innerType._zod.values),vt(e._zod,"optin",()=>t.innerType?._zod?.optin),vt(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(n,r)=>{if(r.direction==="backward")return t.innerType._zod.run(n,r);const i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(Pg):Pg(i)}});function Pg(e){return e.value=Object.freeze(e.value),e}const cL=de("$ZodLazy",(e,t)=>{Bt.init(e,t),vt(e._zod,"innerType",()=>{const n=t;return n._cachedInner||(n._cachedInner=t.getter()),n._cachedInner}),vt(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),vt(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),vt(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),vt(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(n,r)=>e._zod.innerType._zod.run(n,r)}),pL=de("$ZodCustom",(e,t)=>{Ln.init(e,t),Bt.init(e,t),e._zod.parse=(n,r)=>n,e._zod.check=n=>{const r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(s=>$g(s,n,r,e));$g(i,n,r,e)}});function $g(e,t,n,r){if(!e){const i={code:"custom",input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(i.params=r._zod.def.params),t.issues.push(Eo(i))}}var Dg;class dL{constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...n){const r=n[0];return this._map.set(t,r),r&&typeof r=="object"&&"id"in r&&this._idmap.set(r.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){const n=this._map.get(t);return n&&typeof n=="object"&&"id"in n&&this._idmap.delete(n.id),this._map.delete(t),this}get(t){const n=t._zod.parent;if(n){const r={...this.get(n)??{}};delete r.id;const i={...r,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}}function fL(){return new dL}(Dg=globalThis).__zod_globalRegistry??(Dg.__zod_globalRegistry=fL());const co=globalThis.__zod_globalRegistry;function hL(e,t){return new e({type:"string",...Fe(t)})}function mL(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Fe(t)})}function Fg(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Fe(t)})}function gL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Fe(t)})}function vL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Fe(t)})}function yL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Fe(t)})}function bL(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Fe(t)})}function xL(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Fe(t)})}function _L(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Fe(t)})}function wL(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Fe(t)})}function kL(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Fe(t)})}function CL(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Fe(t)})}function SL(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Fe(t)})}function EL(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Fe(t)})}function AL(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Fe(t)})}function TL(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Fe(t)})}function IL(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Fe(t)})}function jL(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Fe(t)})}function RL(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Fe(t)})}function Ix(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Fe(t)})}function OL(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Fe(t)})}function zL(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Fe(t)})}function NL(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Fe(t)})}function ML(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Fe(t)})}function PL(e,t){return new e({type:"string",format:"date",check:"string_format",...Fe(t)})}function $L(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...Fe(t)})}function DL(e,t){return new e({type:"string",format:"duration",check:"string_format",...Fe(t)})}function FL(e,t){return new e({type:"number",checks:[],...Fe(t)})}function LL(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Fe(t)})}function BL(e,t){return new e({type:"boolean",...Fe(t)})}function UL(e,t){return new e({type:"null",...Fe(t)})}function ZL(e){return new e({type:"unknown"})}function HL(e,t){return new e({type:"never",...Fe(t)})}function Lg(e,t){return new _x({check:"less_than",...Fe(t),value:e,inclusive:!1})}function Ec(e,t){return new _x({check:"less_than",...Fe(t),value:e,inclusive:!0})}function Bg(e,t){return new wx({check:"greater_than",...Fe(t),value:e,inclusive:!1})}function Ac(e,t){return new wx({check:"greater_than",...Fe(t),value:e,inclusive:!0})}function Ug(e,t){return new rF({check:"multiple_of",...Fe(t),value:e})}function jx(e,t){return new aF({check:"max_length",...Fe(t),maximum:e})}function sl(e,t){return new oF({check:"min_length",...Fe(t),minimum:e})}function Rx(e,t){return new sF({check:"length_equals",...Fe(t),length:e})}function WL(e,t){return new lF({check:"string_format",format:"regex",...Fe(t),pattern:e})}function qL(e){return new uF({check:"string_format",format:"lowercase",...Fe(e)})}function VL(e){return new cF({check:"string_format",format:"uppercase",...Fe(e)})}function GL(e,t){return new pF({check:"string_format",format:"includes",...Fe(t),includes:e})}function JL(e,t){return new dF({check:"string_format",format:"starts_with",...Fe(t),prefix:e})}function KL(e,t){return new fF({check:"string_format",format:"ends_with",...Fe(t),suffix:e})}function Ma(e){return new hF({check:"overwrite",tx:e})}function YL(e){return Ma(t=>t.normalize(e))}function XL(){return Ma(e=>e.trim())}function QL(){return Ma(e=>e.toLowerCase())}function e4(){return Ma(e=>e.toUpperCase())}function t4(){return Ma(e=>aD(e))}function n4(e,t,n){return new e({type:"array",element:t,...Fe(n)})}function r4(e,t,n){const r=Fe(n);return r.abort??(r.abort=!0),new e({type:"custom",check:"custom",fn:t,...r})}function i4(e,t,n){return new e({type:"custom",check:"custom",fn:t,...Fe(n)})}function a4(e,t){const n=o4(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(Eo(i,r.value,n._zod.def));else{const s=i;s.fatal&&(s.continue=!1),s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=n),s.continue??(s.continue=!n._zod.def.abort),r.issues.push(Eo(s))}},e(r.value,r)),t);return n}function o4(e,t){const n=new Ln({check:"custom",...Fe(t)});return n._zod.check=e,n}function ll(e){let t=e?.target??"draft-2020-12";return t==="draft-4"&&(t="draft-04"),t==="draft-7"&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??co,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function Pt(e,t,n={path:[],schemaPath:[]}){var r;const i=e._zod.def,s=t.seen.get(e);if(s)return s.count++,n.schemaPath.includes(e)&&(s.cycle=n.path),s.schema;const o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);const l=e._zod.toJSONSchema?.();if(l)o.schema=l;else{const d={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,d);else{const v=o.schema,y=t.processors[i.type];if(!y)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);y(e,t,v,d)}const h=e._zod.parent;h&&(o.ref||(o.ref=h),Pt(h,t,d),t.seen.get(h).isParent=!0)}const c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io==="input"&&Tn(e)&&(delete o.schema.examples,delete o.schema.default),t.io==="input"&&"_prefault"in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function ul(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=new Map;for(const o of e.seen.entries()){const l=e.metadataRegistry.get(o[0])?.id;if(l){const c=r.get(l);if(c&&c!==o[0])throw new Error(`Duplicate schema id "${l}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(l,o[0])}}const i=o=>{const l=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const h=e.external.registry.get(o[0])?.id,v=e.external.uri??(g=>g);if(h)return{ref:v(h)};const y=o[1].defId??o[1].schema.id??`schema${e.counter++}`;return o[1].defId=y,{defId:y,ref:`${v("__shared")}#/${l}/${y}`}}if(o[1]===n)return{ref:"#"};const p=`#/${l}/`,d=o[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:p+d}},s=o=>{if(o[1].schema.$ref)return;const l=o[1],{ref:c,defId:p}=i(o);l.def={...l.schema},p&&(l.defId=p);const d=l.schema;for(const h in d)delete d[h];d.$ref=c};if(e.cycles==="throw")for(const o of e.seen.entries()){const l=o[1];if(l.cycle)throw new Error(`Cycle detected: #/${l.cycle?.join("/")}/<root>

Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const o of e.seen.entries()){const l=o[1];if(t===o[0]){s(o);continue}if(e.external){const p=e.external.registry.get(o[0])?.id;if(t!==o[0]&&p){s(o);continue}}if(e.metadataRegistry.get(o[0])?.id){s(o);continue}if(l.cycle){s(o);continue}if(l.count>1&&e.reused==="ref"){s(o);continue}}}function cl(e,t){const n=e.seen.get(t);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");const r=l=>{const c=e.seen.get(l);if(c.ref===null)return;const p=c.def??c.schema,d={...p},h=c.ref;if(c.ref=null,h){r(h);const y=e.seen.get(h),g=y.schema;if(g.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(p.allOf=p.allOf??[],p.allOf.push(g)):Object.assign(p,g),Object.assign(p,d),l._zod.parent===h)for(const _ in p)_==="$ref"||_==="allOf"||_ in d||delete p[_];if(g.$ref&&y.def)for(const _ in p)_==="$ref"||_==="allOf"||_ in y.def&&JSON.stringify(p[_])===JSON.stringify(y.def[_])&&delete p[_]}const v=l._zod.parent;if(v&&v!==h){r(v);const y=e.seen.get(v);if(y?.schema.$ref&&(p.$ref=y.schema.$ref,y.def))for(const g in p)g==="$ref"||g==="allOf"||g in y.def&&JSON.stringify(p[g])===JSON.stringify(y.def[g])&&delete p[g]}e.override({zodSchema:l,jsonSchema:p,path:c.path??[]})};for(const l of[...e.seen.entries()].reverse())r(l[0]);const i={};if(e.target==="draft-2020-12"?i.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?i.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){const l=e.external.registry.get(t)?.id;if(!l)throw new Error("Schema is missing an `id` property");i.$id=e.external.uri(l)}Object.assign(i,n.def??n.schema);const s=e.metadataRegistry.get(t)?.id;s!==void 0&&i.id===s&&delete i.id;const o=e.external?.defs??{};for(const l of e.seen.entries()){const c=l[1];c.def&&c.defId&&(c.def.id===c.defId&&delete c.def.id,o[c.defId]=c.def)}e.external||Object.keys(o).length>0&&(e.target==="draft-2020-12"?i.$defs=o:i.definitions=o);try{const l=JSON.parse(JSON.stringify(i));return Object.defineProperty(l,"~standard",{value:{...t["~standard"],jsonSchema:{input:pl(t,"input",e.processors),output:pl(t,"output",e.processors)}},enumerable:!1,writable:!1}),l}catch{throw new Error("Error converting schema to JSON.")}}function Tn(e,t){const n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);const r=e._zod.def;if(r.type==="transform")return!0;if(r.type==="array")return Tn(r.element,n);if(r.type==="set")return Tn(r.valueType,n);if(r.type==="lazy")return Tn(r.getter(),n);if(r.type==="promise"||r.type==="optional"||r.type==="nonoptional"||r.type==="nullable"||r.type==="readonly"||r.type==="default"||r.type==="prefault")return Tn(r.innerType,n);if(r.type==="intersection")return Tn(r.left,n)||Tn(r.right,n);if(r.type==="record"||r.type==="map")return Tn(r.keyType,n)||Tn(r.valueType,n);if(r.type==="pipe")return e._zod.traits.has("$ZodCodec")?!0:Tn(r.in,n)||Tn(r.out,n);if(r.type==="object"){for(const i in r.shape)if(Tn(r.shape[i],n))return!0;return!1}if(r.type==="union"){for(const i of r.options)if(Tn(i,n))return!0;return!1}if(r.type==="tuple"){for(const i of r.items)if(Tn(i,n))return!0;return!!(r.rest&&Tn(r.rest,n))}return!1}const s4=(e,t={})=>n=>{const r=ll({...n,processors:t});return Pt(e,r),ul(r,e),cl(r,e)},pl=(e,t,n={})=>r=>{const{libraryOptions:i,target:s}=r??{},o=ll({...i??{},target:s,io:t,processors:n});return Pt(e,o),ul(o,e),cl(o,e)},l4={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},Ox=(e,t,n,r)=>{const i=n;i.type="string";const{minimum:s,maximum:o,format:l,patterns:c,contentEncoding:p}=e._zod.bag;if(typeof s=="number"&&(i.minLength=s),typeof o=="number"&&(i.maxLength=o),l&&(i.format=l4[l]??l,i.format===""&&delete i.format,l==="time"&&delete i.format),p&&(i.contentEncoding=p),c&&c.size>0){const d=[...c];d.length===1?i.pattern=d[0].source:d.length>1&&(i.allOf=[...d.map(h=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:h.source}))])}},zx=(e,t,n,r)=>{const i=n,{minimum:s,maximum:o,format:l,multipleOf:c,exclusiveMaximum:p,exclusiveMinimum:d}=e._zod.bag;typeof l=="string"&&l.includes("int")?i.type="integer":i.type="number";const h=typeof d=="number"&&d>=(s??Number.NEGATIVE_INFINITY),v=typeof p=="number"&&p<=(o??Number.POSITIVE_INFINITY),y=t.target==="draft-04"||t.target==="openapi-3.0";h?y?(i.minimum=d,i.exclusiveMinimum=!0):i.exclusiveMinimum=d:typeof s=="number"&&(i.minimum=s),v?y?(i.maximum=p,i.exclusiveMaximum=!0):i.exclusiveMaximum=p:typeof o=="number"&&(i.maximum=o),typeof c=="number"&&(i.multipleOf=c)},Nx=(e,t,n,r)=>{n.type="boolean"},u4=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema")},c4=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema")},Mx=(e,t,n,r)=>{t.target==="openapi-3.0"?(n.type="string",n.nullable=!0,n.enum=[null]):n.type="null"},p4=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema")},d4=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema")},Px=(e,t,n,r)=>{n.not={}},f4=(e,t,n,r)=>{},$x=(e,t,n,r)=>{},h4=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema")},Dx=(e,t,n,r)=>{const i=e._zod.def,s=cx(i.entries);s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),n.enum=s},Fx=(e,t,n,r)=>{const i=e._zod.def,s=[];for(const o of i.values)if(o===void 0){if(t.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof o=="bigint"){if(t.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");s.push(Number(o))}else s.push(o);if(s.length!==0)if(s.length===1){const o=s[0];n.type=o===null?"null":typeof o,t.target==="draft-04"||t.target==="openapi-3.0"?n.enum=[o]:n.const=o}else s.every(o=>typeof o=="number")&&(n.type="number"),s.every(o=>typeof o=="string")&&(n.type="string"),s.every(o=>typeof o=="boolean")&&(n.type="boolean"),s.every(o=>o===null)&&(n.type="null"),n.enum=s},m4=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema")},g4=(e,t,n,r)=>{const i=n,s=e._zod.pattern;if(!s)throw new Error("Pattern not found in template literal");i.type="string",i.pattern=s.source},v4=(e,t,n,r)=>{const i=n,s={type:"string",format:"binary",contentEncoding:"binary"},{minimum:o,maximum:l,mime:c}=e._zod.bag;o!==void 0&&(s.minLength=o),l!==void 0&&(s.maxLength=l),c?c.length===1?(s.contentMediaType=c[0],Object.assign(i,s)):(Object.assign(i,s),i.anyOf=c.map(p=>({contentMediaType:p}))):Object.assign(i,s)},y4=(e,t,n,r)=>{n.type="boolean"},Lx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},b4=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Function types cannot be represented in JSON Schema")},Bx=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},x4=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema")},_4=(e,t,n,r)=>{if(t.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema")},Ux=(e,t,n,r)=>{const i=n,s=e._zod.def,{minimum:o,maximum:l}=e._zod.bag;typeof o=="number"&&(i.minItems=o),typeof l=="number"&&(i.maxItems=l),i.type="array",i.items=Pt(s.element,t,{...r,path:[...r.path,"items"]})},Zx=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="object",i.properties={};const o=s.shape;for(const p in o)i.properties[p]=Pt(o[p],t,{...r,path:[...r.path,"properties",p]});const l=new Set(Object.keys(o)),c=new Set([...l].filter(p=>{const d=s.shape[p]._zod;return t.io==="input"?d.optin===void 0:d.optout===void 0}));c.size>0&&(i.required=Array.from(c)),s.catchall?._zod.def.type==="never"?i.additionalProperties=!1:s.catchall?s.catchall&&(i.additionalProperties=Pt(s.catchall,t,{...r,path:[...r.path,"additionalProperties"]})):t.io==="output"&&(i.additionalProperties=!1)},Hx=(e,t,n,r)=>{const i=e._zod.def,s=i.inclusive===!1,o=i.options.map((l,c)=>Pt(l,t,{...r,path:[...r.path,s?"oneOf":"anyOf",c]}));s?n.oneOf=o:n.anyOf=o},Wx=(e,t,n,r)=>{const i=e._zod.def,s=Pt(i.left,t,{...r,path:[...r.path,"allOf",0]}),o=Pt(i.right,t,{...r,path:[...r.path,"allOf",1]}),l=p=>"allOf"in p&&Object.keys(p).length===1,c=[...l(s)?s.allOf:[s],...l(o)?o.allOf:[o]];n.allOf=c},w4=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="array";const o=t.target==="draft-2020-12"?"prefixItems":"items",l=t.target==="draft-2020-12"||t.target==="openapi-3.0"?"items":"additionalItems",c=s.items.map((v,y)=>Pt(v,t,{...r,path:[...r.path,o,y]})),p=s.rest?Pt(s.rest,t,{...r,path:[...r.path,l,...t.target==="openapi-3.0"?[s.items.length]:[]]}):null;t.target==="draft-2020-12"?(i.prefixItems=c,p&&(i.items=p)):t.target==="openapi-3.0"?(i.items={anyOf:c},p&&i.items.anyOf.push(p),i.minItems=c.length,p||(i.maxItems=c.length)):(i.items=c,p&&(i.additionalItems=p));const{minimum:d,maximum:h}=e._zod.bag;typeof d=="number"&&(i.minItems=d),typeof h=="number"&&(i.maxItems=h)},qx=(e,t,n,r)=>{const i=n,s=e._zod.def;i.type="object";const o=s.keyType,c=o._zod.bag?.patterns;if(s.mode==="loose"&&c&&c.size>0){const d=Pt(s.valueType,t,{...r,path:[...r.path,"patternProperties","*"]});i.patternProperties={};for(const h of c)i.patternProperties[h.source]=d}else(t.target==="draft-07"||t.target==="draft-2020-12")&&(i.propertyNames=Pt(s.keyType,t,{...r,path:[...r.path,"propertyNames"]})),i.additionalProperties=Pt(s.valueType,t,{...r,path:[...r.path,"additionalProperties"]});const p=o._zod.values;if(p){const d=[...p].filter(h=>typeof h=="string"||typeof h=="number");d.length>0&&(i.required=d)}},Vx=(e,t,n,r)=>{const i=e._zod.def,s=Pt(i.innerType,t,r),o=t.seen.get(e);t.target==="openapi-3.0"?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[s,{type:"null"}]},Gx=(e,t,n,r)=>{const i=e._zod.def;Pt(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},Jx=(e,t,n,r)=>{const i=e._zod.def;Pt(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Kx=(e,t,n,r)=>{const i=e._zod.def;Pt(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,t.io==="input"&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Yx=(e,t,n,r)=>{const i=e._zod.def;Pt(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}n.default=o},Xx=(e,t,n,r)=>{const i=e._zod.def,s=i.in._zod.traits.has("$ZodTransform"),o=t.io==="input"?s?i.out:i.in:i.out;Pt(o,t,r);const l=t.seen.get(e);l.ref=o},Qx=(e,t,n,r)=>{const i=e._zod.def;Pt(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType,n.readOnly=!0},k4=(e,t,n,r)=>{const i=e._zod.def;Pt(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},gd=(e,t,n,r)=>{const i=e._zod.def;Pt(i.innerType,t,r);const s=t.seen.get(e);s.ref=i.innerType},e0=(e,t,n,r)=>{const i=e._zod.innerType;Pt(i,t,r);const s=t.seen.get(e);s.ref=i},Zg={string:Ox,number:zx,boolean:Nx,bigint:u4,symbol:c4,null:Mx,undefined:p4,void:d4,never:Px,any:f4,unknown:$x,date:h4,enum:Dx,literal:Fx,nan:m4,template_literal:g4,file:v4,success:y4,custom:Lx,function:b4,transform:Bx,map:x4,set:_4,array:Ux,object:Zx,union:Hx,intersection:Wx,tuple:w4,record:qx,nullable:Vx,nonoptional:Gx,default:Jx,prefault:Kx,catch:Yx,pipe:Xx,readonly:Qx,promise:k4,optional:gd,lazy:e0};function t0(e,t){if("_idmap"in e){const r=e,i=ll({...t,processors:Zg}),s={};for(const c of r._idmap.entries()){const[p,d]=c;Pt(d,i)}const o={},l={registry:r,uri:t?.uri,defs:s};i.external=l;for(const c of r._idmap.entries()){const[p,d]=c;ul(i,d),o[p]=cl(i,d)}if(Object.keys(s).length>0){const c=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[c]:s}}return{schemas:o}}const n=ll({...t,processors:Zg});return Pt(e,n),ul(n,e),cl(n,e)}const C4=de("ZodISODateTime",(e,t)=>{TF.init(e,t),Qt.init(e,t)});function S4(e){return ML(C4,e)}const E4=de("ZodISODate",(e,t)=>{IF.init(e,t),Qt.init(e,t)});function A4(e){return PL(E4,e)}const T4=de("ZodISOTime",(e,t)=>{jF.init(e,t),Qt.init(e,t)});function I4(e){return $L(T4,e)}const j4=de("ZodISODuration",(e,t)=>{RF.init(e,t),Qt.init(e,t)});function R4(e){return DL(j4,e)}const O4=(e,t)=>{hx.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:n=>bD(e,n)},flatten:{value:n=>yD(e,n)},addIssue:{value:n=>{e.issues.push(n),e.message=JSON.stringify(e.issues,dp,2)}},addIssues:{value:n=>{e.issues.push(...n),e.message=JSON.stringify(e.issues,dp,2)}},isEmpty:{get(){return e.issues.length===0}}})},mr=de("ZodError",O4,{Parent:Error}),z4=fd(mr),N4=hd(mr),M4=Ol(mr),vd=zl(mr),P4=wD(mr),$4=kD(mr),D4=CD(mr),F4=SD(mr),L4=ED(mr),B4=AD(mr),U4=TD(mr),Z4=ID(mr),Hg=new WeakMap;function Po(e,t,n){const r=Object.getPrototypeOf(e);let i=Hg.get(r);if(i||(i=new Set,Hg.set(r,i)),!i.has(t)){i.add(t);for(const s in n){const o=n[s];Object.defineProperty(r,s,{configurable:!0,enumerable:!1,get(){const l=o.bind(this);return Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:l}),l},set(l){Object.defineProperty(this,s,{configurable:!0,writable:!0,enumerable:!0,value:l})}})}}}const Ut=de("ZodType",(e,t)=>(Bt.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:pl(e,"input"),output:pl(e,"output")}}),e.toJSONSchema=s4(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(n,r)=>z4(e,n,r,{callee:e.parse}),e.safeParse=(n,r)=>M4(e,n,r),e.parseAsync=async(n,r)=>N4(e,n,r,{callee:e.parseAsync}),e.safeParseAsync=async(n,r)=>vd(e,n,r),e.spa=e.safeParseAsync,e.encode=(n,r)=>P4(e,n,r),e.decode=(n,r)=>$4(e,n,r),e.encodeAsync=async(n,r)=>D4(e,n,r),e.decodeAsync=async(n,r)=>F4(e,n,r),e.safeEncode=(n,r)=>L4(e,n,r),e.safeDecode=(n,r)=>B4(e,n,r),e.safeEncodeAsync=async(n,r)=>U4(e,n,r),e.safeDecodeAsync=async(n,r)=>Z4(e,n,r),Po(e,"ZodType",{check(...n){const r=this.def;return this.clone(xi(r,{checks:[...r.checks??[],...n.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),{parent:!0})},with(...n){return this.check(...n)},clone(n,r){return _i(this,n,r)},brand(){return this},register(n,r){return n.add(this,r),this},refine(n,r){return this.check(z5(n,r))},superRefine(n,r){return this.check(N5(n,r))},overwrite(n){return this.check(Ma(n))},optional(){return cn(this)},exactOptional(){return x5(this)},nullable(){return Gg(this)},nullish(){return cn(Gg(this))},nonoptional(n){return E5(this,n)},array(){return Bn(this)},or(n){return St([this,n])},and(n){return m5(this,n)},transform(n){return Jg(this,y5(n))},default(n){return k5(this,n)},prefault(n){return S5(this,n)},catch(n){return T5(this,n)},pipe(n){return Jg(this,n)},readonly(){return R5(this)},describe(n){const r=this.clone();return co.add(r,{description:n}),r},meta(...n){if(n.length===0)return co.get(this);const r=this.clone();return co.add(r,n[0]),r},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(n){return n(this)}}),Object.defineProperty(e,"description",{get(){return co.get(e)?.description},configurable:!0}),e)),n0=de("_ZodString",(e,t)=>{md.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Ox(e,r,i);const n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,Po(e,"_ZodString",{regex(...r){return this.check(WL(...r))},includes(...r){return this.check(GL(...r))},startsWith(...r){return this.check(JL(...r))},endsWith(...r){return this.check(KL(...r))},min(...r){return this.check(sl(...r))},max(...r){return this.check(jx(...r))},length(...r){return this.check(Rx(...r))},nonempty(...r){return this.check(sl(1,...r))},lowercase(r){return this.check(qL(r))},uppercase(r){return this.check(VL(r))},trim(){return this.check(XL())},normalize(...r){return this.check(YL(...r))},toLowerCase(){return this.check(QL())},toUpperCase(){return this.check(e4())},slugify(){return this.check(t4())}})}),H4=de("ZodString",(e,t)=>{md.init(e,t),n0.init(e,t),e.email=n=>e.check(mL(W4,n)),e.url=n=>e.check(xL(q4,n)),e.jwt=n=>e.check(NL(o5,n)),e.emoji=n=>e.check(_L(V4,n)),e.guid=n=>e.check(Fg(Wg,n)),e.uuid=n=>e.check(gL(Us,n)),e.uuidv4=n=>e.check(vL(Us,n)),e.uuidv6=n=>e.check(yL(Us,n)),e.uuidv7=n=>e.check(bL(Us,n)),e.nanoid=n=>e.check(wL(G4,n)),e.guid=n=>e.check(Fg(Wg,n)),e.cuid=n=>e.check(kL(J4,n)),e.cuid2=n=>e.check(CL(K4,n)),e.ulid=n=>e.check(SL(Y4,n)),e.base64=n=>e.check(Ix(r0,n)),e.base64url=n=>e.check(OL(i5,n)),e.xid=n=>e.check(EL(X4,n)),e.ksuid=n=>e.check(AL(Q4,n)),e.ipv4=n=>e.check(TL(e5,n)),e.ipv6=n=>e.check(IL(t5,n)),e.cidrv4=n=>e.check(jL(n5,n)),e.cidrv6=n=>e.check(RL(r5,n)),e.e164=n=>e.check(zL(a5,n)),e.datetime=n=>e.check(S4(n)),e.date=n=>e.check(A4(n)),e.time=n=>e.check(I4(n)),e.duration=n=>e.check(R4(n))});function ae(e){return hL(H4,e)}const Qt=de("ZodStringFormat",(e,t)=>{qt.init(e,t),n0.init(e,t)}),W4=de("ZodEmail",(e,t)=>{bF.init(e,t),Qt.init(e,t)}),Wg=de("ZodGUID",(e,t)=>{vF.init(e,t),Qt.init(e,t)}),Us=de("ZodUUID",(e,t)=>{yF.init(e,t),Qt.init(e,t)}),q4=de("ZodURL",(e,t)=>{xF.init(e,t),Qt.init(e,t)}),V4=de("ZodEmoji",(e,t)=>{_F.init(e,t),Qt.init(e,t)}),G4=de("ZodNanoID",(e,t)=>{wF.init(e,t),Qt.init(e,t)}),J4=de("ZodCUID",(e,t)=>{kF.init(e,t),Qt.init(e,t)}),K4=de("ZodCUID2",(e,t)=>{CF.init(e,t),Qt.init(e,t)}),Y4=de("ZodULID",(e,t)=>{SF.init(e,t),Qt.init(e,t)}),X4=de("ZodXID",(e,t)=>{EF.init(e,t),Qt.init(e,t)}),Q4=de("ZodKSUID",(e,t)=>{AF.init(e,t),Qt.init(e,t)}),e5=de("ZodIPv4",(e,t)=>{OF.init(e,t),Qt.init(e,t)}),t5=de("ZodIPv6",(e,t)=>{zF.init(e,t),Qt.init(e,t)}),n5=de("ZodCIDRv4",(e,t)=>{NF.init(e,t),Qt.init(e,t)}),r5=de("ZodCIDRv6",(e,t)=>{MF.init(e,t),Qt.init(e,t)}),r0=de("ZodBase64",(e,t)=>{PF.init(e,t),Qt.init(e,t)});function i0(e){return Ix(r0,e)}const i5=de("ZodBase64URL",(e,t)=>{DF.init(e,t),Qt.init(e,t)}),a5=de("ZodE164",(e,t)=>{FF.init(e,t),Qt.init(e,t)}),o5=de("ZodJWT",(e,t)=>{BF.init(e,t),Qt.init(e,t)}),a0=de("ZodNumber",(e,t)=>{Cx.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,s)=>zx(e,r,i),Po(e,"ZodNumber",{gt(r,i){return this.check(Bg(r,i))},gte(r,i){return this.check(Ac(r,i))},min(r,i){return this.check(Ac(r,i))},lt(r,i){return this.check(Lg(r,i))},lte(r,i){return this.check(Ec(r,i))},max(r,i){return this.check(Ec(r,i))},int(r){return this.check(qg(r))},safe(r){return this.check(qg(r))},positive(r){return this.check(Bg(0,r))},nonnegative(r){return this.check(Ac(0,r))},negative(r){return this.check(Lg(0,r))},nonpositive(r){return this.check(Ec(0,r))},multipleOf(r,i){return this.check(Ug(r,i))},step(r,i){return this.check(Ug(r,i))},finite(){return this}});const n=e._zod.bag;e.minValue=Math.max(n.minimum??Number.NEGATIVE_INFINITY,n.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(n.maximum??Number.POSITIVE_INFINITY,n.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(n.format??"").includes("int")||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null});function Ta(e){return FL(a0,e)}const s5=de("ZodNumberFormat",(e,t)=>{UF.init(e,t),a0.init(e,t)});function qg(e){return LL(s5,e)}const l5=de("ZodBoolean",(e,t)=>{ZF.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Nx(e,n,r)});function lt(e){return BL(l5,e)}const u5=de("ZodNull",(e,t)=>{HF.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Mx(e,n,r)});function o0(e){return UL(u5,e)}const c5=de("ZodUnknown",(e,t)=>{WF.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>$x()});function bt(){return ZL(c5)}const p5=de("ZodNever",(e,t)=>{qF.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Px(e,n,r)});function $n(e){return HL(p5,e)}const d5=de("ZodArray",(e,t)=>{VF.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Ux(e,n,r,i),e.element=t.element,Po(e,"ZodArray",{min(n,r){return this.check(sl(n,r))},nonempty(n){return this.check(sl(1,n))},max(n,r){return this.check(jx(n,r))},length(n,r){return this.check(Rx(n,r))},unwrap(){return this.element}})});function Bn(e,t){return n4(d5,e,t)}const yd=de("ZodObject",(e,t)=>{JF.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Zx(e,n,r,i),vt(e,"shape",()=>t.shape),Po(e,"ZodObject",{keyof(){return $o(Object.keys(this._zod.def.shape))},catchall(n){return this.clone({...this._zod.def,catchall:n})},passthrough(){return this.clone({...this._zod.def,catchall:bt()})},loose(){return this.clone({...this._zod.def,catchall:bt()})},strict(){return this.clone({...this._zod.def,catchall:$n()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(n){return dD(this,n)},safeExtend(n){return fD(this,n)},merge(n){return hD(this,n)},pick(n){return cD(this,n)},omit(n){return pD(this,n)},partial(...n){return mD(u0,this,n[0])},required(...n){return gD(c0,this,n[0])}})});function $e(e,t){const n={type:"object",shape:e??{},...Fe(t)};return new yd(n)}function et(e,t){return new yd({type:"object",shape:e,catchall:$n(),...Fe(t)})}function ba(e,t){return new yd({type:"object",shape:e,catchall:bt(),...Fe(t)})}const s0=de("ZodUnion",(e,t)=>{Ax.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Hx(e,n,r,i),e.options=t.options});function St(e,t){return new s0({type:"union",options:e,...Fe(t)})}const f5=de("ZodDiscriminatedUnion",(e,t)=>{s0.init(e,t),KF.init(e,t)});function l0(e,t,n){return new f5({type:"union",options:t,discriminator:e,...Fe(n)})}const h5=de("ZodIntersection",(e,t)=>{YF.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Wx(e,n,r,i)});function m5(e,t){return new h5({type:"intersection",left:e,right:t})}const Vg=de("ZodRecord",(e,t)=>{XF.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>qx(e,n,r,i),e.keyType=t.keyType,e.valueType=t.valueType});function Ia(e,t,n){return!t||!t._zod?new Vg({type:"record",keyType:ae(),valueType:e,...Fe(t)}):new Vg({type:"record",keyType:e,valueType:t,...Fe(n)})}const hp=de("ZodEnum",(e,t)=>{QF.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(r,i,s)=>Dx(e,r,i),e.enum=t.entries,e.options=Object.values(t.entries);const n=new Set(Object.keys(t.entries));e.extract=(r,i)=>{const s={};for(const o of r)if(n.has(o))s[o]=t.entries[o];else throw new Error(`Key ${o} not found in enum`);return new hp({...t,checks:[],...Fe(i),entries:s})},e.exclude=(r,i)=>{const s={...t.entries};for(const o of r)if(n.has(o))delete s[o];else throw new Error(`Key ${o} not found in enum`);return new hp({...t,checks:[],...Fe(i),entries:s})}});function $o(e,t){const n=Array.isArray(e)?Object.fromEntries(e.map(r=>[r,r])):e;return new hp({type:"enum",entries:n,...Fe(t)})}const g5=de("ZodLiteral",(e,t)=>{eL.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Fx(e,n,r),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function xe(e,t){return new g5({type:"literal",values:Array.isArray(e)?e:[e],...Fe(t)})}const v5=de("ZodTransform",(e,t)=>{tL.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Bx(e,n),e._zod.parse=(n,r)=>{if(r.direction==="backward")throw new ux(e.constructor.name);n.addIssue=s=>{if(typeof s=="string")n.issues.push(Eo(s,n.value,t));else{const o=s;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=n.value),o.inst??(o.inst=e),n.issues.push(Eo(o))}};const i=t.transform(n.value,n);return i instanceof Promise?i.then(s=>(n.value=s,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function y5(e){return new v5({type:"transform",transform:e})}const u0=de("ZodOptional",(e,t)=>{Tx.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gd(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function cn(e){return new u0({type:"optional",innerType:e})}const b5=de("ZodExactOptional",(e,t)=>{nL.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>gd(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function x5(e){return new b5({type:"optional",innerType:e})}const _5=de("ZodNullable",(e,t)=>{rL.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Vx(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function Gg(e){return new _5({type:"nullable",innerType:e})}const w5=de("ZodDefault",(e,t)=>{iL.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Jx(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function k5(e,t){return new w5({type:"default",innerType:e,get defaultValue(){return typeof t=="function"?t():dx(t)}})}const C5=de("ZodPrefault",(e,t)=>{aL.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Kx(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function S5(e,t){return new C5({type:"prefault",innerType:e,get defaultValue(){return typeof t=="function"?t():dx(t)}})}const c0=de("ZodNonOptional",(e,t)=>{oL.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Gx(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function E5(e,t){return new c0({type:"nonoptional",innerType:e,...Fe(t)})}const A5=de("ZodCatch",(e,t)=>{sL.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Yx(e,n,r,i),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function T5(e,t){return new A5({type:"catch",innerType:e,catchValue:typeof t=="function"?t:()=>t})}const I5=de("ZodPipe",(e,t)=>{lL.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Xx(e,n,r,i),e.in=t.in,e.out=t.out});function Jg(e,t){return new I5({type:"pipe",in:e,out:t})}const j5=de("ZodReadonly",(e,t)=>{uL.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Qx(e,n,r,i),e.unwrap=()=>e._zod.def.innerType});function R5(e){return new j5({type:"readonly",innerType:e})}const O5=de("ZodLazy",(e,t)=>{cL.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>e0(e,n,r,i),e.unwrap=()=>e._zod.def.getter()});function p0(e){return new O5({type:"lazy",getter:e})}const bd=de("ZodCustom",(e,t)=>{pL.init(e,t),Ut.init(e,t),e._zod.processJSONSchema=(n,r,i)=>Lx(e,n)});function Ml(e,t){return r4(bd,e??(()=>!0),t)}function z5(e,t={}){return i4(bd,e,t)}function N5(e,t){return a4(e,t)}function vi(e,t={}){const n=new bd({type:"custom",check:"custom",fn:r=>r instanceof e,abort:!0,...Fe(t)});return n._zod.bag.Class=e,n._zod.check=r=>{r.value instanceof e||r.issues.push({code:"invalid_type",expected:e.name,input:r.value,inst:n,path:[...n._zod.def.path??[]]})},n}var Ie;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Ie||(Ie={}));var Do=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=()=>{const s=n.length,o=new Array(t);for(let l=0;l<t;l++)o[l]=n[Math.random()*s|0];return o.join("")};if(e==null)return i;if(n.includes(r))throw new Q$({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`},M5=Do();function Kg(e=globalThis){var t,n,r;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(r=(n=e.process)==null?void 0:n.versions)!=null&&r.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function Mi(e){if(e==null)return{};const t={};if(e instanceof Headers)e.forEach((n,r)=>{t[r.toLowerCase()]=n});else{Array.isArray(e)||(e=Object.entries(e));for(const[n,r]of e)r!=null&&(t[n.toLowerCase()]=r)}return t}function Yg(e,...t){const n=new Headers(Mi(e)),r=n.get("user-agent")||"";return n.set("user-agent",[r,...t].filter(Boolean).join(" ")),Object.fromEntries(n.entries())}var P5=/"__proto__"\s*:/,$5=/"constructor"\s*:/;function Xg(e){const t=JSON.parse(e);return t===null||typeof t!="object"||P5.test(e)===!1&&$5.test(e)===!1?t:D5(t)}function D5(e){let t=[e];for(;t.length;){const n=t;t=[];for(const r of n){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const i in r){const s=r[i];s&&typeof s=="object"&&t.push(s)}}}return e}function F5(e){const{stackTraceLimit:t}=Error;try{Error.stackTraceLimit=0}catch{return Xg(e)}try{return Xg(e)}finally{Error.stackTraceLimit=t}}var dl=Symbol.for("vercel.ai.validator");function L5(e){return{[dl]:!0,validate:e}}function B5(e){return typeof e=="object"&&e!==null&&dl in e&&e[dl]===!0&&"validate"in e}function U5(e){let t;return()=>(t==null&&(t=e()),t)}function Z5(e){return B5(e)?e:typeof e=="function"?e():H5(e)}function H5(e){return L5(async t=>{const n=await e["~standard"].validate(t);return n.issues==null?{success:!0,value:n.value}:{success:!1,error:new al({value:t,cause:n.issues})}})}async function Qg({value:e,schema:t}){const n=await xd({value:e,schema:t});if(!n.success)throw al.wrap({value:e,cause:n.error});return n.value}async function xd({value:e,schema:t}){const n=Z5(t);try{if(n.validate==null)return{success:!0,value:e,rawValue:e};const r=await n.validate(e);return r.success?{success:!0,value:r.value,rawValue:e}:{success:!1,error:al.wrap({value:e,cause:r.error}),rawValue:e}}catch(r){return{success:!1,error:al.wrap({value:e,cause:r}),rawValue:e}}}async function fl({text:e,schema:t}){try{const n=F5(e);return t==null?{success:!0,value:n,rawValue:n}:await xd({value:n,schema:t})}catch(n){return{success:!1,error:bg.isInstance(n)?n:new bg({text:e,cause:n}),rawValue:void 0}}}function W5({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new lx).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await fl({text:n,schema:t}))}}))}async function pa(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}function qs(e){if(e.type==="object"){e.additionalProperties=!1;const t=e.properties;if(t!=null)for(const n in t)t[n]=qs(t[n])}return e.type==="array"&&e.items!=null&&(Array.isArray(e.items)?e.items=e.items.map(t=>qs(t)):e.items=qs(e.items)),e}var q5=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")},V5=Symbol("Let zodToJsonSchema decide on which parser to use"),ev={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},G5=e=>typeof e=="string"?{...ev,name:e}:{...ev,...e};function Xn(){return{}}function J5(e,t){var n,r,i;const s={type:"array"};return(n=e.type)!=null&&n._def&&((i=(r=e.type)==null?void 0:r._def)==null?void 0:i.typeName)!==Ie.ZodAny&&(s.items=Et(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(s.minItems=e.minLength.value),e.maxLength&&(s.maxItems=e.maxLength.value),e.exactLength&&(s.minItems=e.exactLength.value,s.maxItems=e.exactLength.value),s}function K5(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function Y5(){return{type:"boolean"}}function d0(e,t){return Et(e.type._def,t)}var X5=(e,t)=>Et(e.innerType._def,t);function f0(e,t,n){const r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,s)=>f0(e,t,i))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return Q5(e)}}var Q5=e=>{const t={type:"integer",format:"unix-time"};for(const n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value;break}return t};function e6(e,t){return{...Et(e.innerType._def,t),default:e.defaultValue()}}function t6(e,t){return t.effectStrategy==="input"?Et(e.schema._def,t):Xn()}function n6(e){return{type:"string",enum:Array.from(e.values)}}var r6=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function i6(e,t){const n=[Et(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),Et(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];return n.forEach(i=>{if(r6(i))r.push(...i.allOf);else{let s=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:o,...l}=i;s=l}r.push(s)}}),r.length?{allOf:r}:void 0}function a6(e){const t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var Tc=void 0,wr={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(Tc===void 0&&(Tc=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Tc),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function h0(e,t){const n={type:"string"};if(e.checks)for(const r of e.checks)switch(r.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(t.emailStrategy){case"format:email":kr(n,"email",r.message,t);break;case"format:idn-email":kr(n,"idn-email",r.message,t);break;case"pattern:zod":En(n,wr.email,r.message,t);break}break;case"url":kr(n,"uri",r.message,t);break;case"uuid":kr(n,"uuid",r.message,t);break;case"regex":En(n,r.regex,r.message,t);break;case"cuid":En(n,wr.cuid,r.message,t);break;case"cuid2":En(n,wr.cuid2,r.message,t);break;case"startsWith":En(n,RegExp(`^${Ic(r.value,t)}`),r.message,t);break;case"endsWith":En(n,RegExp(`${Ic(r.value,t)}$`),r.message,t);break;case"datetime":kr(n,"date-time",r.message,t);break;case"date":kr(n,"date",r.message,t);break;case"time":kr(n,"time",r.message,t);break;case"duration":kr(n,"duration",r.message,t);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"includes":{En(n,RegExp(Ic(r.value,t)),r.message,t);break}case"ip":{r.version!=="v6"&&kr(n,"ipv4",r.message,t),r.version!=="v4"&&kr(n,"ipv6",r.message,t);break}case"base64url":En(n,wr.base64url,r.message,t);break;case"jwt":En(n,wr.jwt,r.message,t);break;case"cidr":{r.version!=="v6"&&En(n,wr.ipv4Cidr,r.message,t),r.version!=="v4"&&En(n,wr.ipv6Cidr,r.message,t);break}case"emoji":En(n,wr.emoji(),r.message,t);break;case"ulid":{En(n,wr.ulid,r.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{kr(n,"binary",r.message,t);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{En(n,wr.base64,r.message,t);break}}break}case"nanoid":En(n,wr.nanoid,r.message,t)}return n}function Ic(e,t){return t.patternStrategy==="escape"?s6(e):e}var o6=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function s6(e){let t="";for(let n=0;n<e.length;n++)o6.has(e[n])||(t+="\\"),t+=e[n];return t}function kr(e,t,n,r){var i;e.format||(i=e.anyOf)!=null&&i.some(s=>s.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function En(e,t,n,r){var i;e.pattern||(i=e.allOf)!=null&&i.some(s=>s.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:tv(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=tv(t,r)}function tv(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;const r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=r.i?e.source.toLowerCase():e.source;let s="",o=!1,l=!1,c=!1;for(let p=0;p<i.length;p++){if(o){s+=i[p],o=!1;continue}if(r.i){if(l){if(i[p].match(/[a-z]/)){c?(s+=i[p],s+=`${i[p-2]}-${i[p]}`.toUpperCase(),c=!1):i[p+1]==="-"&&((n=i[p+2])!=null&&n.match(/[a-z]/))?(s+=i[p],c=!0):s+=`${i[p]}${i[p].toUpperCase()}`;continue}}else if(i[p].match(/[a-z]/)){s+=`[${i[p]}${i[p].toUpperCase()}]`;continue}}if(r.m){if(i[p]==="^"){s+=`(^|(?<=[\r
]))`;continue}else if(i[p]==="$"){s+=`($|(?=[\r
]))`;continue}}if(r.s&&i[p]==="."){s+=l?`${i[p]}\r
`:`[${i[p]}\r
]`;continue}s+=i[p],i[p]==="\\"?o=!0:l&&i[p]==="]"?l=!1:!l&&i[p]==="["&&(l=!0)}try{new RegExp(s)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return s}function m0(e,t){var n,r,i,s,o,l;const c={type:"object",additionalProperties:(n=Et(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((r=e.keyType)==null?void 0:r._def.typeName)===Ie.ZodString&&((i=e.keyType._def.checks)!=null&&i.length)){const{type:p,...d}=h0(e.keyType._def,t);return{...c,propertyNames:d}}else{if(((s=e.keyType)==null?void 0:s._def.typeName)===Ie.ZodEnum)return{...c,propertyNames:{enum:e.keyType._def.values}};if(((o=e.keyType)==null?void 0:o._def.typeName)===Ie.ZodBranded&&e.keyType._def.type._def.typeName===Ie.ZodString&&((l=e.keyType._def.type._def.checks)!=null&&l.length)){const{type:p,...d}=d0(e.keyType._def,t);return{...c,propertyNames:d}}}return c}function l6(e,t){if(t.mapStrategy==="record")return m0(e,t);const n=Et(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Xn(),r=Et(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Xn();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function u6(e){const t=e.values,r=Object.keys(e.values).filter(s=>typeof t[t[s]]!="number").map(s=>t[s]),i=Array.from(new Set(r.map(s=>typeof s)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function c6(){return{not:Xn()}}function p6(){return{type:"null"}}var mp={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function d6(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in mp&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,s)=>{const o=mp[s._def.typeName];return o&&!i.includes(o)?[...i,o]:i},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((i,s)=>{const o=typeof s._def.value;switch(o){case"string":case"number":case"boolean":return[...i,o];case"bigint":return[...i,"integer"];case"object":if(s._def.value===null)return[...i,"null"];case"symbol":case"undefined":case"function":default:return i}},[]);if(r.length===n.length){const i=r.filter((s,o,l)=>l.indexOf(s)===o);return{type:i.length>1?i:i[0],enum:n.reduce((s,o)=>s.includes(o._def.value)?s:[...s,o._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(s=>!r.includes(s))],[])};return f6(e,t)}var f6=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,i)=>Et(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${i}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function h6(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[mp[e.innerType._def.typeName],"null"]};const n=Et(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function m6(e){const t={type:"number"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function g6(e,t){const n={type:"object",properties:{}},r=[],i=e.shape();for(const o in i){let l=i[o];if(l===void 0||l._def===void 0)continue;const c=y6(l),p=Et(l._def,{...t,currentPath:[...t.currentPath,"properties",o],propertyPath:[...t.currentPath,"properties",o]});p!==void 0&&(n.properties[o]=p,c||r.push(o))}r.length&&(n.required=r);const s=v6(e,t);return s!==void 0&&(n.additionalProperties=s),n}function v6(e,t){if(e.catchall._def.typeName!=="ZodNever")return Et(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function y6(e){try{return e.isOptional()}catch{return!0}}var b6=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return Et(e.innerType._def,t);const r=Et(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Xn()},r]}:Xn()},x6=(e,t)=>{if(t.pipeStrategy==="input")return Et(e.in._def,t);if(t.pipeStrategy==="output")return Et(e.out._def,t);const n=Et(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=Et(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function _6(e,t){return Et(e.type._def,t)}function w6(e,t){const r={type:"array",uniqueItems:!0,items:Et(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(r.minItems=e.minSize.value),e.maxSize&&(r.maxItems=e.maxSize.value),r}function k6(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>Et(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:Et(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>Et(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function C6(){return{not:Xn()}}function S6(){return Xn()}var E6=(e,t)=>Et(e.innerType._def,t),A6=(e,t,n)=>{switch(t){case Ie.ZodString:return h0(e,n);case Ie.ZodNumber:return m6(e);case Ie.ZodObject:return g6(e,n);case Ie.ZodBigInt:return K5(e);case Ie.ZodBoolean:return Y5();case Ie.ZodDate:return f0(e,n);case Ie.ZodUndefined:return C6();case Ie.ZodNull:return p6();case Ie.ZodArray:return J5(e,n);case Ie.ZodUnion:case Ie.ZodDiscriminatedUnion:return d6(e,n);case Ie.ZodIntersection:return i6(e,n);case Ie.ZodTuple:return k6(e,n);case Ie.ZodRecord:return m0(e,n);case Ie.ZodLiteral:return a6(e);case Ie.ZodEnum:return n6(e);case Ie.ZodNativeEnum:return u6(e);case Ie.ZodNullable:return h6(e,n);case Ie.ZodOptional:return b6(e,n);case Ie.ZodMap:return l6(e,n);case Ie.ZodSet:return w6(e,n);case Ie.ZodLazy:return()=>e.getter()._def;case Ie.ZodPromise:return _6(e,n);case Ie.ZodNaN:case Ie.ZodNever:return c6();case Ie.ZodEffects:return t6(e,n);case Ie.ZodAny:return Xn();case Ie.ZodUnknown:return S6();case Ie.ZodDefault:return e6(e,n);case Ie.ZodBranded:return d0(e,n);case Ie.ZodReadonly:return E6(e,n);case Ie.ZodCatch:return X5(e,n);case Ie.ZodPipeline:return x6(e,n);case Ie.ZodFunction:case Ie.ZodVoid:case Ie.ZodSymbol:return;default:return(r=>{})()}};function Et(e,t,n=!1){var r;const i=t.seen.get(e);if(t.override){const c=(r=t.override)==null?void 0:r.call(t,e,t,i,n);if(c!==V5)return c}if(i&&!n){const c=T6(i,t);if(c!==void 0)return c}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const o=A6(e,e.typeName,t),l=typeof o=="function"?Et(o(),t):o;if(l&&I6(e,t,l),t.postProcess){const c=t.postProcess(l,e,t);return s.jsonSchema=l,c}return s.jsonSchema=l,l}var T6=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:q5(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Xn()):t.$refStrategy==="seen"?Xn():void 0}},I6=(e,t,n)=>(e.description&&(n.description=e.description),n),j6=e=>{const t=G5(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,i])=>[i._def,{def:i._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}},R6=(e,t)=>{var n;const r=j6(t);let i=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((p,[d,h])=>{var v;return{...p,[d]:(v=Et(h._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0))!=null?v:Xn()}},{}):void 0;const s=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,o=(n=Et(e._def,s===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,s]},!1))!=null?n:Xn(),l=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;l!==void 0&&(o.title=l);const c=s===void 0?i?{...o,[r.definitionPath]:i}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,s].join("/"),[r.definitionPath]:{...i,[s]:o}};return c.$schema="http://json-schema.org/draft-07/schema#",c},O6=R6;function z6(e,t){var n;const r=(n=void 0)!=null?n:!1;return _d(()=>O6(e,{$refStrategy:r?"root":"none"}),{validate:async i=>{const s=await e.safeParseAsync(i);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function N6(e,t){var n;const r=(n=void 0)!=null?n:!1;return _d(()=>qs(t0(e,{target:"draft-7",io:"input",reused:r?"ref":"inline"})),{validate:async i=>{const s=await vd(e,i);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function M6(e){return"_zod"in e}function g0(e,t){return M6(e)?N6(e):z6(e)}var gp=Symbol.for("vercel.ai.schema");function _d(e,{validate:t}={}){return{[gp]:!0,_type:void 0,[dl]:!0,get jsonSchema(){return typeof e=="function"&&(e=e()),e},validate:t}}function P6(e){return typeof e=="object"&&e!==null&&gp in e&&e[gp]===!0&&"jsonSchema"in e&&"validate"in e}function $6(e){return e==null?_d({properties:{},additionalProperties:!1}):P6(e)?e:typeof e=="function"?e():g0(e)}var D6=Object.defineProperty,F6=(e,t)=>{for(var n in t)D6(e,n,{get:t[n],enumerable:!0})},v0="AI_NoObjectGeneratedError",y0=`vercel.ai.error.${v0}`,L6=Symbol.for(y0),b0,nv=class extends gi{constructor({message:t="No object generated.",cause:n,text:r,response:i,usage:s,finishReason:o}){super({name:v0,message:t,cause:n}),this[b0]=!0,this.text=r,this.response=i,this.usage=s,this.finishReason=o}static isInstance(t){return gi.hasMarker(t,y0)}};b0=L6;var rv="5.0.118",x0=St([ae(),vi(Uint8Array),vi(ArrayBuffer),Ml(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?n:!1},{message:"Must be a Buffer"})]),Ao=p0(()=>St([o0(),ae(),Ta(),lt(),Ia(ae(),Ao),Bn(Ao)])),on=Ia(ae(),Ia(ae(),Ao)),_0=$e({type:xe("text"),text:ae(),providerOptions:on.optional()}),B6=$e({type:xe("image"),image:St([x0,vi(URL)]),mediaType:ae().optional(),providerOptions:on.optional()}),w0=$e({type:xe("file"),data:St([x0,vi(URL)]),filename:ae().optional(),mediaType:ae(),providerOptions:on.optional()}),U6=$e({type:xe("reasoning"),text:ae(),providerOptions:on.optional()}),Z6=$e({type:xe("tool-call"),toolCallId:ae(),toolName:ae(),input:bt(),providerOptions:on.optional(),providerExecuted:lt().optional()}),H6=l0("type",[$e({type:xe("text"),value:ae()}),$e({type:xe("json"),value:Ao}),$e({type:xe("error-text"),value:ae()}),$e({type:xe("error-json"),value:Ao}),$e({type:xe("content"),value:Bn(St([$e({type:xe("text"),text:ae()}),$e({type:xe("media"),data:ae(),mediaType:ae()})]))})]),k0=$e({type:xe("tool-result"),toolCallId:ae(),toolName:ae(),output:H6,providerOptions:on.optional()}),W6=$e({role:xe("system"),content:ae(),providerOptions:on.optional()}),q6=$e({role:xe("user"),content:St([ae(),Bn(St([_0,B6,w0]))]),providerOptions:on.optional()}),V6=$e({role:xe("assistant"),content:St([ae(),Bn(St([_0,w0,U6,Z6,k0]))]),providerOptions:on.optional()}),G6=$e({role:xe("tool"),content:Bn(k0),providerOptions:on.optional()});St([W6,q6,V6,G6]);Do({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}

`)},flush(e){e.enqueue(`data: [DONE]

`)}})}});var J6=U5(()=>g0(St([et({type:xe("text-start"),id:ae(),providerMetadata:on.optional()}),et({type:xe("text-delta"),id:ae(),delta:ae(),providerMetadata:on.optional()}),et({type:xe("text-end"),id:ae(),providerMetadata:on.optional()}),et({type:xe("error"),errorText:ae()}),et({type:xe("tool-input-start"),toolCallId:ae(),toolName:ae(),providerExecuted:lt().optional(),dynamic:lt().optional()}),et({type:xe("tool-input-delta"),toolCallId:ae(),inputTextDelta:ae()}),et({type:xe("tool-input-available"),toolCallId:ae(),toolName:ae(),input:bt(),providerExecuted:lt().optional(),providerMetadata:on.optional(),dynamic:lt().optional()}),et({type:xe("tool-input-error"),toolCallId:ae(),toolName:ae(),input:bt(),providerExecuted:lt().optional(),providerMetadata:on.optional(),dynamic:lt().optional(),errorText:ae()}),et({type:xe("tool-output-available"),toolCallId:ae(),output:bt(),providerExecuted:lt().optional(),dynamic:lt().optional(),preliminary:lt().optional()}),et({type:xe("tool-output-error"),toolCallId:ae(),errorText:ae(),providerExecuted:lt().optional(),dynamic:lt().optional()}),et({type:xe("reasoning-start"),id:ae(),providerMetadata:on.optional()}),et({type:xe("reasoning-delta"),id:ae(),delta:ae(),providerMetadata:on.optional()}),et({type:xe("reasoning-end"),id:ae(),providerMetadata:on.optional()}),et({type:xe("source-url"),sourceId:ae(),url:ae(),title:ae().optional(),providerMetadata:on.optional()}),et({type:xe("source-document"),sourceId:ae(),mediaType:ae(),title:ae(),filename:ae().optional(),providerMetadata:on.optional()}),et({type:xe("file"),url:ae(),mediaType:ae(),providerMetadata:on.optional()}),et({type:Ml(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:ae().optional(),data:bt(),transient:lt().optional()}),et({type:xe("start-step")}),et({type:xe("finish-step")}),et({type:xe("start"),messageId:ae().optional(),messageMetadata:bt().optional()}),et({type:xe("finish"),finishReason:$o(["stop","length","content-filter","tool-calls","error","other","unknown"]).optional(),messageMetadata:bt().optional()}),et({type:xe("abort")}),et({type:xe("message-metadata"),messageMetadata:bt()})])));function K6(e){return e.type.startsWith("data-")}function C0(e,t){if(e===void 0&&t===void 0)return;if(e===void 0)return t;if(t===void 0)return e;const n={...e};for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){const i=t[r];if(i===void 0)continue;const s=r in e?e[r]:void 0,o=i!==null&&typeof i=="object"&&!Array.isArray(i)&&!(i instanceof Date)&&!(i instanceof RegExp),l=s!=null&&typeof s=="object"&&!Array.isArray(s)&&!(s instanceof Date)&&!(s instanceof RegExp);o&&l?n[r]=C0(s,i):n[r]=i}return n}function Y6(e){const t=["ROOT"];let n=-1,r=null;function i(c,p,d){switch(c){case'"':{n=p,t.pop(),t.push(d),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=p,r=p,t.pop(),t.push(d),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=p,t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"{":{n=p,t.pop(),t.push(d),t.push("INSIDE_OBJECT_START");break}case"[":{n=p,t.pop(),t.push(d),t.push("INSIDE_ARRAY_START");break}}}function s(c,p){switch(c){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=p,t.pop();break}}}function o(c,p){switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=p,t.pop();break}}}for(let c=0;c<e.length;c++){const p=e[c];switch(t[t.length-1]){case"ROOT":i(p,c,"FINISH");break;case"INSIDE_OBJECT_START":{switch(p){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=c,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(p){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(p){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(p){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{i(p,c,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{s(p,c);break}case"INSIDE_STRING":{switch(p){case'"':{t.pop(),n=c;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=c}break}case"INSIDE_ARRAY_START":{switch(p){case"]":{n=c,t.pop();break}default:{n=c,i(p,c,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(p){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}default:{n=c;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{i(p,c,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=c;break}case"INSIDE_NUMBER":{switch(p){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&o(p,c),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&s(p,c);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&s(p,c);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&o(p,c);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const h=e.substring(r,c+1);!"false".startsWith(h)&&!"true".startsWith(h)&&!"null".startsWith(h)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?s(p,c):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&o(p,c)):n=c;break}}}let l=e.slice(0,n+1);for(let c=t.length-1;c>=0;c--)switch(t[c]){case"INSIDE_STRING":{l+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{l+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{l+="]";break}case"INSIDE_LITERAL":{const d=e.substring(r,e.length);"true".startsWith(d)?l+="true".slice(d.length):"false".startsWith(d)?l+="false".slice(d.length):"null".startsWith(d)&&(l+="null".slice(d.length))}}return l}async function S0(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await fl({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await fl({text:Y6(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}function Vs(e){return e.type.startsWith("tool-")}function X6(e){return e.type==="dynamic-tool"}function iv(e){return Vs(e)||X6(e)}function av(e){return e.type.split("-").slice(1).join("-")}function Q6({lastMessage:e,messageId:t}){return{message:e?.role==="assistant"?e:{id:t,metadata:void 0,role:"assistant",parts:[]},activeTextParts:{},activeReasoningParts:{},partialToolCalls:{}}}function eB({stream:e,messageMetadataSchema:t,dataPartSchemas:n,runUpdateMessageJob:r,onError:i,onToolCall:s,onData:o}){return e.pipeThrough(new TransformStream({async transform(l,c){await r(async({state:p,write:d})=>{var h,v,y,g;function k(I){const R=p.message.parts.filter(Vs).find(B=>B.toolCallId===I);if(R==null)throw new Error("tool-output-error must be preceded by a tool-input-available");return R}function _(I){const R=p.message.parts.filter(B=>B.type==="dynamic-tool").find(B=>B.toolCallId===I);if(R==null)throw new Error("tool-output-error must be preceded by a tool-input-available");return R}function x(I){var O;const R=p.message.parts.find(V=>Vs(V)&&V.toolCallId===I.toolCallId),B=I,L=R;R!=null?(R.state=I.state,L.input=B.input,L.output=B.output,L.errorText=B.errorText,L.rawInput=B.rawInput,L.preliminary=B.preliminary,L.providerExecuted=(O=B.providerExecuted)!=null?O:R.providerExecuted,B.providerMetadata!=null&&R.state==="input-available"&&(R.callProviderMetadata=B.providerMetadata)):p.message.parts.push({type:`tool-${I.toolName}`,toolCallId:I.toolCallId,state:I.state,input:B.input,output:B.output,rawInput:B.rawInput,errorText:B.errorText,providerExecuted:B.providerExecuted,preliminary:B.preliminary,...B.providerMetadata!=null?{callProviderMetadata:B.providerMetadata}:{}})}function S(I){var O,R;const B=p.message.parts.find(q=>q.type==="dynamic-tool"&&q.toolCallId===I.toolCallId),L=I,V=B;B!=null?(B.state=I.state,V.toolName=I.toolName,V.input=L.input,V.output=L.output,V.errorText=L.errorText,V.rawInput=(O=L.rawInput)!=null?O:V.rawInput,V.preliminary=L.preliminary,V.providerExecuted=(R=L.providerExecuted)!=null?R:B.providerExecuted,L.providerMetadata!=null&&B.state==="input-available"&&(B.callProviderMetadata=L.providerMetadata)):p.message.parts.push({type:"dynamic-tool",toolName:I.toolName,toolCallId:I.toolCallId,state:I.state,input:L.input,output:L.output,errorText:L.errorText,preliminary:L.preliminary,providerExecuted:L.providerExecuted,...L.providerMetadata!=null?{callProviderMetadata:L.providerMetadata}:{}})}async function T(I){if(I!=null){const O=p.message.metadata!=null?C0(p.message.metadata,I):I;t!=null&&await Qg({value:O,schema:t}),p.message.metadata=O}}switch(l.type){case"text-start":{const I={type:"text",text:"",providerMetadata:l.providerMetadata,state:"streaming"};p.activeTextParts[l.id]=I,p.message.parts.push(I),d();break}case"text-delta":{const I=p.activeTextParts[l.id];I.text+=l.delta,I.providerMetadata=(h=l.providerMetadata)!=null?h:I.providerMetadata,d();break}case"text-end":{const I=p.activeTextParts[l.id];I.state="done",I.providerMetadata=(v=l.providerMetadata)!=null?v:I.providerMetadata,delete p.activeTextParts[l.id],d();break}case"reasoning-start":{const I={type:"reasoning",text:"",providerMetadata:l.providerMetadata,state:"streaming"};p.activeReasoningParts[l.id]=I,p.message.parts.push(I),d();break}case"reasoning-delta":{const I=p.activeReasoningParts[l.id];I.text+=l.delta,I.providerMetadata=(y=l.providerMetadata)!=null?y:I.providerMetadata,d();break}case"reasoning-end":{const I=p.activeReasoningParts[l.id];I.providerMetadata=(g=l.providerMetadata)!=null?g:I.providerMetadata,I.state="done",delete p.activeReasoningParts[l.id],d();break}case"file":{p.message.parts.push({type:"file",mediaType:l.mediaType,url:l.url}),d();break}case"source-url":{p.message.parts.push({type:"source-url",sourceId:l.sourceId,url:l.url,title:l.title,providerMetadata:l.providerMetadata}),d();break}case"source-document":{p.message.parts.push({type:"source-document",sourceId:l.sourceId,mediaType:l.mediaType,title:l.title,filename:l.filename,providerMetadata:l.providerMetadata}),d();break}case"tool-input-start":{const I=p.message.parts.filter(Vs);p.partialToolCalls[l.toolCallId]={text:"",toolName:l.toolName,index:I.length,dynamic:l.dynamic},l.dynamic?S({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-streaming",input:void 0,providerExecuted:l.providerExecuted}):x({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-streaming",input:void 0,providerExecuted:l.providerExecuted}),d();break}case"tool-input-delta":{const I=p.partialToolCalls[l.toolCallId];I.text+=l.inputTextDelta;const{value:O}=await S0(I.text);I.dynamic?S({toolCallId:l.toolCallId,toolName:I.toolName,state:"input-streaming",input:O}):x({toolCallId:l.toolCallId,toolName:I.toolName,state:"input-streaming",input:O}),d();break}case"tool-input-available":{l.dynamic?S({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-available",input:l.input,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata}):x({toolCallId:l.toolCallId,toolName:l.toolName,state:"input-available",input:l.input,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata}),d(),s&&!l.providerExecuted&&await s({toolCall:l});break}case"tool-input-error":{l.dynamic?S({toolCallId:l.toolCallId,toolName:l.toolName,state:"output-error",input:l.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata}):x({toolCallId:l.toolCallId,toolName:l.toolName,state:"output-error",input:void 0,rawInput:l.input,errorText:l.errorText,providerExecuted:l.providerExecuted,providerMetadata:l.providerMetadata}),d();break}case"tool-output-available":{if(l.dynamic){const I=_(l.toolCallId);S({toolCallId:l.toolCallId,toolName:I.toolName,state:"output-available",input:I.input,output:l.output,preliminary:l.preliminary})}else{const I=k(l.toolCallId);x({toolCallId:l.toolCallId,toolName:av(I),state:"output-available",input:I.input,output:l.output,providerExecuted:l.providerExecuted,preliminary:l.preliminary})}d();break}case"tool-output-error":{if(l.dynamic){const I=_(l.toolCallId);S({toolCallId:l.toolCallId,toolName:I.toolName,state:"output-error",input:I.input,errorText:l.errorText,providerExecuted:l.providerExecuted})}else{const I=k(l.toolCallId);x({toolCallId:l.toolCallId,toolName:av(I),state:"output-error",input:I.input,rawInput:I.rawInput,errorText:l.errorText,providerExecuted:l.providerExecuted})}d();break}case"start-step":{p.message.parts.push({type:"step-start"});break}case"finish-step":{p.activeTextParts={},p.activeReasoningParts={};break}case"start":{l.messageId!=null&&(p.message.id=l.messageId),await T(l.messageMetadata),(l.messageId!=null||l.messageMetadata!=null)&&d();break}case"finish":{l.finishReason!=null&&(p.finishReason=l.finishReason),await T(l.messageMetadata),l.messageMetadata!=null&&d();break}case"message-metadata":{await T(l.messageMetadata),l.messageMetadata!=null&&d();break}case"error":{i?.(new Error(l.errorText));break}default:if(K6(l)){n?.[l.type]!=null&&await Qg({value:l.data,schema:n[l.type]});const I=l;if(I.transient){o?.(I);break}const O=I.id!=null?p.message.parts.find(R=>I.type===R.type&&I.id===R.id):void 0;O!=null?O.data=I.data:p.message.parts.push(I),o?.(I),d()}}c.enqueue(l)})}}))}async function tB({stream:e,onError:t}){const n=e.getReader();try{for(;;){const{done:r}=await n.read();if(r)break}}catch(r){t?.(r)}finally{n.releaseLock()}}Do({prefix:"aitxt",size:24});Do({prefix:"aiobj",size:24});var nB=class{constructor(){this.queue=[],this.isProcessing=!1}async processQueue(){if(!this.isProcessing){for(this.isProcessing=!0;this.queue.length>0;)await this.queue[0](),this.queue.shift();this.isProcessing=!1}}async run(e){return new Promise((t,n)=>{this.queue.push(async()=>{try{await e(),t()}catch(r){n(r)}}),this.processQueue()})}};Do({prefix:"aiobj",size:24});var rB={};F6(rB,{object:()=>aB,text:()=>iB});var iB=()=>({type:"text",responseFormat:{type:"text"},async parsePartial({text:e}){return{partial:e}},async parseOutput({text:e}){return e}}),aB=({schema:e})=>{const t=$6(e);return{type:"object",responseFormat:{type:"json",schema:t.jsonSchema},async parsePartial({text:n}){const r=await S0(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:r.value};default:{const i=r.state;throw new Error(`Unsupported parse state: ${i}`)}}},async parseOutput({text:n},r){const i=await fl({text:n});if(!i.success)throw new nv({message:"No object generated: could not parse the response.",cause:i.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});const s=await xd({value:i.value,schema:t});if(!s.success)throw new nv({message:"No object generated: response did not match schema.",cause:s.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return s.value}}};async function oB(e){if(e==null)return[];if(!globalThis.FileList||!(e instanceof globalThis.FileList))throw new Error("FileList is not supported in the current environment");return Promise.all(Array.from(e).map(async t=>{const{name:n,type:r}=t,i=await new Promise((s,o)=>{const l=new FileReader;l.onload=c=>{var p;s((p=c.target)==null?void 0:p.result)},l.onerror=c=>o(c),l.readAsDataURL(t)});return{type:"file",mediaType:r,filename:n,url:i}}))}var sB=class{constructor({api:t="/api/chat",credentials:n,headers:r,body:i,fetch:s,prepareSendMessagesRequest:o,prepareReconnectToStreamRequest:l}){this.api=t,this.credentials=n,this.headers=r,this.body=i,this.fetch=s,this.prepareSendMessagesRequest=o,this.prepareReconnectToStreamRequest=l}async sendMessages({abortSignal:t,...n}){var r,i,s,o,l;const c=await pa(this.body),p=await pa(this.headers),d=await pa(this.credentials),h={...Mi(p),...Mi(n.headers)},v=await((r=this.prepareSendMessagesRequest)==null?void 0:r.call(this,{api:this.api,id:n.chatId,messages:n.messages,body:{...c,...n.body},headers:h,credentials:d,requestMetadata:n.metadata,trigger:n.trigger,messageId:n.messageId})),y=(i=v?.api)!=null?i:this.api,g=v?.headers!==void 0?Mi(v.headers):h,k=v?.body!==void 0?v.body:{...c,...n.body,id:n.chatId,messages:n.messages,trigger:n.trigger,messageId:n.messageId},_=(s=v?.credentials)!=null?s:d,S=await((o=this.fetch)!=null?o:globalThis.fetch)(y,{method:"POST",headers:Yg({"Content-Type":"application/json",...g},`ai-sdk/${rv}`,Kg()),body:JSON.stringify(k),credentials:_,signal:t});if(!S.ok)throw new Error((l=await S.text())!=null?l:"Failed to fetch the chat response.");if(!S.body)throw new Error("The response body is empty.");return this.processResponseStream(S.body)}async reconnectToStream(t){var n,r,i,s,o;const l=await pa(this.body),c=await pa(this.headers),p=await pa(this.credentials),d={...Mi(c),...Mi(t.headers)},h=await((n=this.prepareReconnectToStreamRequest)==null?void 0:n.call(this,{api:this.api,id:t.chatId,body:{...l,...t.body},headers:d,credentials:p,requestMetadata:t.metadata})),v=(r=h?.api)!=null?r:`${this.api}/${t.chatId}/stream`,y=h?.headers!==void 0?Mi(h.headers):d,g=(i=h?.credentials)!=null?i:p,_=await((s=this.fetch)!=null?s:globalThis.fetch)(v,{method:"GET",headers:Yg(y,`ai-sdk/${rv}`,Kg()),credentials:g});if(_.status===204)return null;if(!_.ok)throw new Error((o=await _.text())!=null?o:"Failed to fetch the chat response.");if(!_.body)throw new Error("The response body is empty.");return this.processResponseStream(_.body)}},lB=class extends sB{constructor(t={}){super(t)}processResponseStream(t){return W5({stream:t,schema:J6}).pipeThrough(new TransformStream({async transform(n,r){if(!n.success)throw n.error;r.enqueue(n.value)}}))}},uB=class{constructor({generateId:e=M5,id:t=e(),transport:n=new lB,messageMetadataSchema:r,dataPartSchemas:i,state:s,onError:o,onToolCall:l,onFinish:c,onData:p,sendAutomaticallyWhen:d}){this.activeResponse=void 0,this.jobExecutor=new nB,this.sendMessage=async(h,v)=>{var y,g,k,_;if(h==null){await this.makeRequest({trigger:"submit-message",messageId:(y=this.lastMessage)==null?void 0:y.id,...v});return}let x;if("text"in h||"files"in h?x={parts:[...Array.isArray(h.files)?h.files:await oB(h.files),..."text"in h&&h.text!=null?[{type:"text",text:h.text}]:[]]}:x=h,h.messageId!=null){const S=this.state.messages.findIndex(T=>T.id===h.messageId);if(S===-1)throw new Error(`message with id ${h.messageId} not found`);if(this.state.messages[S].role!=="user")throw new Error(`message with id ${h.messageId} is not a user message`);this.state.messages=this.state.messages.slice(0,S+1),this.state.replaceMessage(S,{...x,id:h.messageId,role:(g=x.role)!=null?g:"user",metadata:h.metadata})}else this.state.pushMessage({...x,id:(k=x.id)!=null?k:this.generateId(),role:(_=x.role)!=null?_:"user",metadata:h.metadata});await this.makeRequest({trigger:"submit-message",messageId:h.messageId,...v})},this.regenerate=async({messageId:h,...v}={})=>{const y=h==null?this.state.messages.length-1:this.state.messages.findIndex(g=>g.id===h);if(y===-1)throw new Error(`message ${h} not found`);this.state.messages=this.state.messages.slice(0,this.messages[y].role==="assistant"?y:y+1),await this.makeRequest({trigger:"regenerate-message",messageId:h,...v})},this.resumeStream=async(h={})=>{await this.makeRequest({trigger:"resume-stream",...h})},this.clearError=()=>{this.status==="error"&&(this.state.error=void 0,this.setStatus({status:"ready"}))},this.addToolOutput=async({state:h="output-available",tool:v,toolCallId:y,output:g,errorText:k})=>this.jobExecutor.run(async()=>{var _,x;const S=this.state.messages,T=S[S.length-1];this.state.replaceMessage(S.length-1,{...T,parts:T.parts.map(I=>iv(I)&&I.toolCallId===y?{...I,state:h,output:g,errorText:k}:I)}),this.activeResponse&&(this.activeResponse.state.message.parts=this.activeResponse.state.message.parts.map(I=>iv(I)&&I.toolCallId===y?{...I,state:h,output:g,errorText:k}:I)),this.status!=="streaming"&&this.status!=="submitted"&&((_=this.sendAutomaticallyWhen)!=null&&_.call(this,{messages:this.state.messages}))&&this.makeRequest({trigger:"submit-message",messageId:(x=this.lastMessage)==null?void 0:x.id})}),this.addToolResult=this.addToolOutput,this.stop=async()=>{var h;this.status!=="streaming"&&this.status!=="submitted"||(h=this.activeResponse)!=null&&h.abortController&&this.activeResponse.abortController.abort()},this.id=t,this.transport=n,this.generateId=e,this.messageMetadataSchema=r,this.dataPartSchemas=i,this.state=s,this.onError=o,this.onToolCall=l,this.onFinish=c,this.onData=p,this.sendAutomaticallyWhen=d}get status(){return this.state.status}setStatus({status:e,error:t}){this.status!==e&&(this.state.status=e,this.state.error=t)}get error(){return this.state.error}get messages(){return this.state.messages}get lastMessage(){return this.state.messages[this.state.messages.length-1]}set messages(e){this.state.messages=e}async makeRequest({trigger:e,metadata:t,headers:n,body:r,messageId:i}){var s,o,l,c;this.setStatus({status:"submitted",error:void 0});const p=this.lastMessage;let d=!1,h=!1,v=!1;try{const y={state:Q6({lastMessage:this.state.snapshot(p),messageId:this.generateId()}),abortController:new AbortController};y.abortController.signal.addEventListener("abort",()=>{d=!0}),this.activeResponse=y;let g;if(e==="resume-stream"){const _=await this.transport.reconnectToStream({chatId:this.id,metadata:t,headers:n,body:r});if(_==null){this.setStatus({status:"ready"});return}g=_}else g=await this.transport.sendMessages({chatId:this.id,messages:this.state.messages,abortSignal:y.abortController.signal,metadata:t,headers:n,body:r,trigger:e,messageId:i});const k=_=>this.jobExecutor.run(()=>_({state:y.state,write:()=>{var x;this.setStatus({status:"streaming"}),y.state.message.id===((x=this.lastMessage)==null?void 0:x.id)?this.state.replaceMessage(this.state.messages.length-1,y.state.message):this.state.pushMessage(y.state.message)}}));await tB({stream:eB({stream:g,onToolCall:this.onToolCall,onData:this.onData,messageMetadataSchema:this.messageMetadataSchema,dataPartSchemas:this.dataPartSchemas,runUpdateMessageJob:k,onError:_=>{throw _}}),onError:_=>{throw _}}),this.setStatus({status:"ready"})}catch(y){if(d||y.name==="AbortError")return d=!0,this.setStatus({status:"ready"}),null;v=!0,y instanceof TypeError&&(y.message.toLowerCase().includes("fetch")||y.message.toLowerCase().includes("network"))&&(h=!0),this.onError&&y instanceof Error&&this.onError(y),this.setStatus({status:"error",error:y})}finally{try{(o=this.onFinish)==null||o.call(this,{message:this.activeResponse.state.message,messages:this.state.messages,isAbort:d,isDisconnect:h,isError:v,finishReason:(s=this.activeResponse)==null?void 0:s.state.finishReason})}catch(y){console.error(y)}this.activeResponse=void 0}(l=this.sendAutomaticallyWhen)!=null&&l.call(this,{messages:this.state.messages})&&!v&&await this.makeRequest({trigger:"submit-message",messageId:(c=this.lastMessage)==null?void 0:c.id,metadata:t,headers:n,body:r})}};function cB(e,t){if(typeof e!="function")throw new TypeError(`Expected the first argument to be a \`function\`, got \`${typeof e}\`.`);let n,r=0;return function(...s){clearTimeout(n);const o=Date.now(),l=o-r,c=t-l;c<=0?(r=o,e.apply(this,s)):n=setTimeout(()=>{r=Date.now(),e.apply(this,s)},c)}}var pB=cB;const dB=Wi(pB);var E0=(e,t,n)=>{if(!t.has(e))throw TypeError("Cannot "+n)},Ft=(e,t,n)=>(E0(e,t,"read from private field"),n?n.call(e):t.get(e)),zr=(e,t,n)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,n)},di=(e,t,n,r)=>(E0(e,t,"write to private field"),t.set(e,n),n);function fB(e,t){return t!=null?dB(e,t):e}var ur,Gs,Js,po,fo,ho,ha,vp,yp,hB=class{constructor(e=[]){zr(this,ur,void 0),zr(this,Gs,"ready"),zr(this,Js,void 0),zr(this,po,new Set),zr(this,fo,new Set),zr(this,ho,new Set),this.pushMessage=t=>{di(this,ur,Ft(this,ur).concat(t)),Ft(this,ha).call(this)},this.popMessage=()=>{di(this,ur,Ft(this,ur).slice(0,-1)),Ft(this,ha).call(this)},this.replaceMessage=(t,n)=>{di(this,ur,[...Ft(this,ur).slice(0,t),this.snapshot(n),...Ft(this,ur).slice(t+1)]),Ft(this,ha).call(this)},this.snapshot=t=>structuredClone(t),this["~registerMessagesCallback"]=(t,n)=>{const r=n?fB(t,n):t;return Ft(this,po).add(r),()=>{Ft(this,po).delete(r)}},this["~registerStatusCallback"]=t=>(Ft(this,fo).add(t),()=>{Ft(this,fo).delete(t)}),this["~registerErrorCallback"]=t=>(Ft(this,ho).add(t),()=>{Ft(this,ho).delete(t)}),zr(this,ha,()=>{Ft(this,po).forEach(t=>t())}),zr(this,vp,()=>{Ft(this,fo).forEach(t=>t())}),zr(this,yp,()=>{Ft(this,ho).forEach(t=>t())}),di(this,ur,e)}get status(){return Ft(this,Gs)}set status(e){di(this,Gs,e),Ft(this,vp).call(this)}get error(){return Ft(this,Js)}set error(e){di(this,Js,e),Ft(this,yp).call(this)}get messages(){return Ft(this,ur)}set messages(e){di(this,ur,[...e]),Ft(this,ha).call(this)}};ur=new WeakMap;Gs=new WeakMap;Js=new WeakMap;po=new WeakMap;fo=new WeakMap;ho=new WeakMap;ha=new WeakMap;vp=new WeakMap;yp=new WeakMap;var ma,ov=class extends uB{constructor({messages:t,...n}){const r=new hB(t);super({...n,state:r}),zr(this,ma,void 0),this["~registerMessagesCallback"]=(i,s)=>Ft(this,ma)["~registerMessagesCallback"](i,s),this["~registerStatusCallback"]=i=>Ft(this,ma)["~registerStatusCallback"](i),this["~registerErrorCallback"]=i=>Ft(this,ma)["~registerErrorCallback"](i),di(this,ma,r)}};ma=new WeakMap;function mB({experimental_throttle:e,resume:t=!1,...n}={}){const r=W.useRef("chat"in n?n.chat:new ov(n));("chat"in n&&n.chat!==r.current||"id"in n&&r.current.id!==n.id)&&(r.current="chat"in n?n.chat:new ov(n));const s=W.useCallback(d=>r.current["~registerMessagesCallback"](d,e),[e,r.current.id]),o=W.useSyncExternalStore(s,()=>r.current.messages,()=>r.current.messages),l=W.useSyncExternalStore(r.current["~registerStatusCallback"],()=>r.current.status,()=>r.current.status),c=W.useSyncExternalStore(r.current["~registerErrorCallback"],()=>r.current.error,()=>r.current.error),p=W.useCallback(d=>{typeof d=="function"&&(d=d(r.current.messages)),r.current.messages=d},[r]);return W.useEffect(()=>{t&&r.current.resumeStream()},[t,r]),{id:r.current.id,messages:o,setMessages:p,sendMessage:r.current.sendMessage,regenerate:r.current.regenerate,clearError:r.current.clearError,stop:r.current.stop,error:c,resumeStream:r.current.resumeStream,status:l,addToolResult:r.current.addToolOutput,addToolOutput:r.current.addToolOutput}}var A0="vercel.ai.error",gB=Symbol.for(A0),T0,vB=class I0 extends Error{constructor({name:t,message:n,cause:r}){super(n),this[T0]=!0,this.name=t,this.cause=r}static isInstance(t){return I0.hasMarker(t,A0)}static hasMarker(t,n){const r=Symbol.for(n);return t!=null&&typeof t=="object"&&r in t&&typeof t[r]=="boolean"&&t[r]===!0}};T0=gB;var yi=vB;function j0(e){return e==null?"unknown error":typeof e=="string"?e:e instanceof Error?e.message:JSON.stringify(e)}var R0="AI_InvalidArgumentError",O0=`vercel.ai.error.${R0}`,yB=Symbol.for(O0),z0,bB=class extends yi{constructor({message:e,cause:t,argument:n}){super({name:R0,message:e,cause:t}),this[z0]=!0,this.argument=n}static isInstance(e){return yi.hasMarker(e,O0)}};z0=yB;var N0="AI_JSONParseError",M0=`vercel.ai.error.${N0}`,xB=Symbol.for(M0),P0,sv=class extends yi{constructor({text:e,cause:t}){super({name:N0,message:`JSON parsing failed: Text: ${e}.
Error message: ${j0(t)}`,cause:t}),this[P0]=!0,this.text=e}static isInstance(e){return yi.hasMarker(e,M0)}};P0=xB;var $0="AI_TypeValidationError",D0=`vercel.ai.error.${$0}`,_B=Symbol.for(D0),F0,wB=class bp extends yi{constructor({value:t,cause:n}){super({name:$0,message:`Type validation failed: Value: ${JSON.stringify(t)}.
Error message: ${j0(n)}`,cause:n}),this[F0]=!0,this.value=t}static isInstance(t){return yi.hasMarker(t,D0)}static wrap({value:t,cause:n}){return bp.isInstance(n)&&n.value===t?n:new bp({value:t,cause:n})}};F0=_B;var xp=wB;function lv(e=globalThis){var t,n,r;return e.window?"runtime/browser":(t=e.navigator)!=null&&t.userAgent?`runtime/${e.navigator.userAgent.toLowerCase()}`:(r=(n=e.process)==null?void 0:n.versions)!=null&&r.node?`runtime/node.js/${e.process.version.substring(0)}`:e.EdgeRuntime?"runtime/vercel-edge":"runtime/unknown"}function kB(e){return Object.fromEntries(Object.entries(e).filter(([t,n])=>n!=null))}function uv(e,...t){const n=kB(e??{}),r=new Headers(n),i=r.get("user-agent")||"";return r.set("user-agent",[i,...t].filter(Boolean).join(" ")),Object.fromEntries(r)}var Fo=({prefix:e,size:t=16,alphabet:n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",separator:r="-"}={})=>{const i=()=>{const s=n.length,o=new Array(t);for(let l=0;l<t;l++)o[l]=n[Math.random()*s|0];return o.join("")};if(e==null)return i;if(n.includes(r))throw new bB({argument:"separator",message:`The separator "${r}" must not be part of the alphabet "${n}".`});return()=>`${e}${r}${i()}`};Fo();var CB=/"__proto__"\s*:/,SB=/"constructor"\s*:/;function EB(e){const t=JSON.parse(e);return t===null||typeof t!="object"||CB.test(e)===!1&&SB.test(e)===!1?t:AB(t)}function AB(e){let t=[e];for(;t.length;){const n=t;t=[];for(const r of n){if(Object.prototype.hasOwnProperty.call(r,"__proto__"))throw new SyntaxError("Object contains forbidden prototype property");if(Object.prototype.hasOwnProperty.call(r,"constructor")&&Object.prototype.hasOwnProperty.call(r.constructor,"prototype"))throw new SyntaxError("Object contains forbidden prototype property");for(const i in r){const s=r[i];s&&typeof s=="object"&&t.push(s)}}}return e}function TB(e){const{stackTraceLimit:t}=Error;Error.stackTraceLimit=0;try{return EB(e)}finally{Error.stackTraceLimit=t}}var hl=Symbol.for("vercel.ai.validator");function IB(e){return{[hl]:!0,validate:e}}function jB(e){return typeof e=="object"&&e!==null&&hl in e&&e[hl]===!0&&"validate"in e}function RB(e){return jB(e)?e:OB(e)}function OB(e){return IB(async t=>{const n=await e["~standard"].validate(t);return n.issues==null?{success:!0,value:n.value}:{success:!1,error:new xp({value:t,cause:n.issues})}})}async function L0({value:e,schema:t}){const n=RB(t);try{if(n.validate==null)return{success:!0,value:e,rawValue:e};const r=await n.validate(e);return r.success?{success:!0,value:r.value,rawValue:e}:{success:!1,error:xp.wrap({value:e,cause:r.error}),rawValue:e}}catch(r){return{success:!1,error:xp.wrap({value:e,cause:r}),rawValue:e}}}async function ml({text:e,schema:t}){try{const n=TB(e);return t==null?{success:!0,value:n,rawValue:n}:await L0({value:n,schema:t})}catch(n){return{success:!1,error:sv.isInstance(n)?n:new sv({text:e,cause:n}),rawValue:void 0}}}function zB({stream:e,schema:t}){return e.pipeThrough(new TextDecoderStream).pipeThrough(new lx).pipeThrough(new TransformStream({async transform({data:n},r){n!=="[DONE]"&&r.enqueue(await ml({text:n,schema:t}))}}))}async function da(e){return typeof e=="function"&&(e=e()),Promise.resolve(e)}var NB=(e,t)=>{let n=0;for(;n<e.length&&n<t.length&&e[n]===t[n];n++);return[(e.length-n).toString(),...t.slice(n)].join("/")},MB=Symbol("Let zodToJsonSchema decide on which parser to use"),cv={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",strictUnions:!1,definitions:{},errorMessages:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},PB=e=>typeof e=="string"?{...cv,name:e}:{...cv,...e};function Qn(){return{}}function $B(e,t){var n,r,i;const s={type:"array"};return(n=e.type)!=null&&n._def&&((i=(r=e.type)==null?void 0:r._def)==null?void 0:i.typeName)!==Ie.ZodAny&&(s.items=At(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&(s.minItems=e.minLength.value),e.maxLength&&(s.maxItems=e.maxLength.value),e.exactLength&&(s.minItems=e.exactLength.value,s.maxItems=e.exactLength.value),s}function DB(e){const t={type:"integer",format:"int64"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function FB(){return{type:"boolean"}}function B0(e,t){return At(e.type._def,t)}var LB=(e,t)=>At(e.innerType._def,t);function U0(e,t,n){const r=n??t.dateStrategy;if(Array.isArray(r))return{anyOf:r.map((i,s)=>U0(e,t,i))};switch(r){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return BB(e)}}var BB=e=>{const t={type:"integer",format:"unix-time"};for(const n of e.checks)switch(n.kind){case"min":t.minimum=n.value;break;case"max":t.maximum=n.value;break}return t};function UB(e,t){return{...At(e.innerType._def,t),default:e.defaultValue()}}function ZB(e,t){return t.effectStrategy==="input"?At(e.schema._def,t):Qn()}function HB(e){return{type:"string",enum:Array.from(e.values)}}var WB=e=>"type"in e&&e.type==="string"?!1:"allOf"in e;function qB(e,t){const n=[At(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),At(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(i=>!!i),r=[];return n.forEach(i=>{if(WB(i))r.push(...i.allOf);else{let s=i;if("additionalProperties"in i&&i.additionalProperties===!1){const{additionalProperties:o,...l}=i;s=l}r.push(s)}}),r.length?{allOf:r}:void 0}function VB(e){const t=typeof e.value;return t!=="bigint"&&t!=="number"&&t!=="boolean"&&t!=="string"?{type:Array.isArray(e.value)?"array":"object"}:{type:t==="bigint"?"integer":t,const:e.value}}var jc=void 0,Cr={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(jc===void 0&&(jc=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),jc),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Z0(e,t){const n={type:"string"};if(e.checks)for(const r of e.checks)switch(r.kind){case"min":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value;break;case"max":n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"email":switch(t.emailStrategy){case"format:email":Sr(n,"email",r.message,t);break;case"format:idn-email":Sr(n,"idn-email",r.message,t);break;case"pattern:zod":An(n,Cr.email,r.message,t);break}break;case"url":Sr(n,"uri",r.message,t);break;case"uuid":Sr(n,"uuid",r.message,t);break;case"regex":An(n,r.regex,r.message,t);break;case"cuid":An(n,Cr.cuid,r.message,t);break;case"cuid2":An(n,Cr.cuid2,r.message,t);break;case"startsWith":An(n,RegExp(`^${Rc(r.value,t)}`),r.message,t);break;case"endsWith":An(n,RegExp(`${Rc(r.value,t)}$`),r.message,t);break;case"datetime":Sr(n,"date-time",r.message,t);break;case"date":Sr(n,"date",r.message,t);break;case"time":Sr(n,"time",r.message,t);break;case"duration":Sr(n,"duration",r.message,t);break;case"length":n.minLength=typeof n.minLength=="number"?Math.max(n.minLength,r.value):r.value,n.maxLength=typeof n.maxLength=="number"?Math.min(n.maxLength,r.value):r.value;break;case"includes":{An(n,RegExp(Rc(r.value,t)),r.message,t);break}case"ip":{r.version!=="v6"&&Sr(n,"ipv4",r.message,t),r.version!=="v4"&&Sr(n,"ipv6",r.message,t);break}case"base64url":An(n,Cr.base64url,r.message,t);break;case"jwt":An(n,Cr.jwt,r.message,t);break;case"cidr":{r.version!=="v6"&&An(n,Cr.ipv4Cidr,r.message,t),r.version!=="v4"&&An(n,Cr.ipv6Cidr,r.message,t);break}case"emoji":An(n,Cr.emoji(),r.message,t);break;case"ulid":{An(n,Cr.ulid,r.message,t);break}case"base64":{switch(t.base64Strategy){case"format:binary":{Sr(n,"binary",r.message,t);break}case"contentEncoding:base64":{n.contentEncoding="base64";break}case"pattern:zod":{An(n,Cr.base64,r.message,t);break}}break}case"nanoid":An(n,Cr.nanoid,r.message,t)}return n}function Rc(e,t){return t.patternStrategy==="escape"?JB(e):e}var GB=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function JB(e){let t="";for(let n=0;n<e.length;n++)GB.has(e[n])||(t+="\\"),t+=e[n];return t}function Sr(e,t,n,r){var i;e.format||(i=e.anyOf)!=null&&i.some(s=>s.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format}),delete e.format),e.anyOf.push({format:t,...n&&r.errorMessages&&{errorMessage:{format:n}}})):e.format=t}function An(e,t,n,r){var i;e.pattern||(i=e.allOf)!=null&&i.some(s=>s.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern}),delete e.pattern),e.allOf.push({pattern:pv(t,r),...n&&r.errorMessages&&{errorMessage:{pattern:n}}})):e.pattern=pv(t,r)}function pv(e,t){var n;if(!t.applyRegexFlags||!e.flags)return e.source;const r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=r.i?e.source.toLowerCase():e.source;let s="",o=!1,l=!1,c=!1;for(let p=0;p<i.length;p++){if(o){s+=i[p],o=!1;continue}if(r.i){if(l){if(i[p].match(/[a-z]/)){c?(s+=i[p],s+=`${i[p-2]}-${i[p]}`.toUpperCase(),c=!1):i[p+1]==="-"&&((n=i[p+2])!=null&&n.match(/[a-z]/))?(s+=i[p],c=!0):s+=`${i[p]}${i[p].toUpperCase()}`;continue}}else if(i[p].match(/[a-z]/)){s+=`[${i[p]}${i[p].toUpperCase()}]`;continue}}if(r.m){if(i[p]==="^"){s+=`(^|(?<=[\r
]))`;continue}else if(i[p]==="$"){s+=`($|(?=[\r
]))`;continue}}if(r.s&&i[p]==="."){s+=l?`${i[p]}\r
`:`[${i[p]}\r
]`;continue}s+=i[p],i[p]==="\\"?o=!0:l&&i[p]==="]"?l=!1:!l&&i[p]==="["&&(l=!0)}try{new RegExp(s)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return s}function H0(e,t){var n,r,i,s,o,l;const c={type:"object",additionalProperties:(n=At(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]}))!=null?n:t.allowedAdditionalProperties};if(((r=e.keyType)==null?void 0:r._def.typeName)===Ie.ZodString&&((i=e.keyType._def.checks)!=null&&i.length)){const{type:p,...d}=Z0(e.keyType._def,t);return{...c,propertyNames:d}}else{if(((s=e.keyType)==null?void 0:s._def.typeName)===Ie.ZodEnum)return{...c,propertyNames:{enum:e.keyType._def.values}};if(((o=e.keyType)==null?void 0:o._def.typeName)===Ie.ZodBranded&&e.keyType._def.type._def.typeName===Ie.ZodString&&((l=e.keyType._def.type._def.checks)!=null&&l.length)){const{type:p,...d}=B0(e.keyType._def,t);return{...c,propertyNames:d}}}return c}function KB(e,t){if(t.mapStrategy==="record")return H0(e,t);const n=At(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||Qn(),r=At(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||Qn();return{type:"array",maxItems:125,items:{type:"array",items:[n,r],minItems:2,maxItems:2}}}function YB(e){const t=e.values,r=Object.keys(e.values).filter(s=>typeof t[t[s]]!="number").map(s=>t[s]),i=Array.from(new Set(r.map(s=>typeof s)));return{type:i.length===1?i[0]==="string"?"string":"number":["string","number"],enum:r}}function XB(){return{not:Qn()}}function QB(){return{type:"null"}}var _p={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function eU(e,t){const n=e.options instanceof Map?Array.from(e.options.values()):e.options;if(n.every(r=>r._def.typeName in _p&&(!r._def.checks||!r._def.checks.length))){const r=n.reduce((i,s)=>{const o=_p[s._def.typeName];return o&&!i.includes(o)?[...i,o]:i},[]);return{type:r.length>1?r:r[0]}}else if(n.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){const r=n.reduce((i,s)=>{const o=typeof s._def.value;switch(o){case"string":case"number":case"boolean":return[...i,o];case"bigint":return[...i,"integer"];case"object":if(s._def.value===null)return[...i,"null"];case"symbol":case"undefined":case"function":default:return i}},[]);if(r.length===n.length){const i=r.filter((s,o,l)=>l.indexOf(s)===o);return{type:i.length>1?i:i[0],enum:n.reduce((s,o)=>s.includes(o._def.value)?s:[...s,o._def.value],[])}}}else if(n.every(r=>r._def.typeName==="ZodEnum"))return{type:"string",enum:n.reduce((r,i)=>[...r,...i._def.values.filter(s=>!r.includes(s))],[])};return tU(e,t)}var tU=(e,t)=>{const n=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,i)=>At(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${i}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return n.length?{anyOf:n}:void 0};function nU(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return{type:[_p[e.innerType._def.typeName],"null"]};const n=At(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return n&&{anyOf:[n,{type:"null"}]}}function rU(e){const t={type:"number"};if(!e.checks)return t;for(const n of e.checks)switch(n.kind){case"int":t.type="integer";break;case"min":n.inclusive?t.minimum=n.value:t.exclusiveMinimum=n.value;break;case"max":n.inclusive?t.maximum=n.value:t.exclusiveMaximum=n.value;break;case"multipleOf":t.multipleOf=n.value;break}return t}function iU(e,t){const n={type:"object",properties:{}},r=[],i=e.shape();for(const o in i){let l=i[o];if(l===void 0||l._def===void 0)continue;const c=oU(l),p=At(l._def,{...t,currentPath:[...t.currentPath,"properties",o],propertyPath:[...t.currentPath,"properties",o]});p!==void 0&&(n.properties[o]=p,c||r.push(o))}r.length&&(n.required=r);const s=aU(e,t);return s!==void 0&&(n.additionalProperties=s),n}function aU(e,t){if(e.catchall._def.typeName!=="ZodNever")return At(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function oU(e){try{return e.isOptional()}catch{return!0}}var sU=(e,t)=>{var n;if(t.currentPath.toString()===((n=t.propertyPath)==null?void 0:n.toString()))return At(e.innerType._def,t);const r=At(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:Qn()},r]}:Qn()},lU=(e,t)=>{if(t.pipeStrategy==="input")return At(e.in._def,t);if(t.pipeStrategy==="output")return At(e.out._def,t);const n=At(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=At(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",n?"1":"0"]});return{allOf:[n,r].filter(i=>i!==void 0)}};function uU(e,t){return At(e.type._def,t)}function cU(e,t){const r={type:"array",uniqueItems:!0,items:At(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&(r.minItems=e.minSize.value),e.maxSize&&(r.maxItems=e.maxSize.value),r}function pU(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((n,r)=>At(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[]),additionalItems:At(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((n,r)=>At(n._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((n,r)=>r===void 0?n:[...n,r],[])}}function dU(){return{not:Qn()}}function fU(){return Qn()}var hU=(e,t)=>At(e.innerType._def,t),mU=(e,t,n)=>{switch(t){case Ie.ZodString:return Z0(e,n);case Ie.ZodNumber:return rU(e);case Ie.ZodObject:return iU(e,n);case Ie.ZodBigInt:return DB(e);case Ie.ZodBoolean:return FB();case Ie.ZodDate:return U0(e,n);case Ie.ZodUndefined:return dU();case Ie.ZodNull:return QB();case Ie.ZodArray:return $B(e,n);case Ie.ZodUnion:case Ie.ZodDiscriminatedUnion:return eU(e,n);case Ie.ZodIntersection:return qB(e,n);case Ie.ZodTuple:return pU(e,n);case Ie.ZodRecord:return H0(e,n);case Ie.ZodLiteral:return VB(e);case Ie.ZodEnum:return HB(e);case Ie.ZodNativeEnum:return YB(e);case Ie.ZodNullable:return nU(e,n);case Ie.ZodOptional:return sU(e,n);case Ie.ZodMap:return KB(e,n);case Ie.ZodSet:return cU(e,n);case Ie.ZodLazy:return()=>e.getter()._def;case Ie.ZodPromise:return uU(e,n);case Ie.ZodNaN:case Ie.ZodNever:return XB();case Ie.ZodEffects:return ZB(e,n);case Ie.ZodAny:return Qn();case Ie.ZodUnknown:return fU();case Ie.ZodDefault:return UB(e,n);case Ie.ZodBranded:return B0(e,n);case Ie.ZodReadonly:return hU(e,n);case Ie.ZodCatch:return LB(e,n);case Ie.ZodPipeline:return lU(e,n);case Ie.ZodFunction:case Ie.ZodVoid:case Ie.ZodSymbol:return;default:return(r=>{})()}};function At(e,t,n=!1){var r;const i=t.seen.get(e);if(t.override){const c=(r=t.override)==null?void 0:r.call(t,e,t,i,n);if(c!==MB)return c}if(i&&!n){const c=gU(i,t);if(c!==void 0)return c}const s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);const o=mU(e,e.typeName,t),l=typeof o=="function"?At(o(),t):o;if(l&&vU(e,t,l),t.postProcess){const c=t.postProcess(l,e,t);return s.jsonSchema=l,c}return s.jsonSchema=l,l}var gU=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:NB(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((n,r)=>t.currentPath[r]===n)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),Qn()):t.$refStrategy==="seen"?Qn():void 0}},vU=(e,t,n)=>(e.description&&(n.description=e.description),n),yU=e=>{const t=PB(e),n=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:n,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,i])=>[i._def,{def:i._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}},bU=(e,t)=>{var n;const r=yU(t);let i=typeof t=="object"&&t.definitions?Object.entries(t.definitions).reduce((p,[d,h])=>{var v;return{...p,[d]:(v=At(h._def,{...r,currentPath:[...r.basePath,r.definitionPath,d]},!0))!=null?v:Qn()}},{}):void 0;const s=typeof t=="string"?t:t?.nameStrategy==="title"?void 0:t?.name,o=(n=At(e._def,s===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,s]},!1))!=null?n:Qn(),l=typeof t=="object"&&t.name!==void 0&&t.nameStrategy==="title"?t.name:void 0;l!==void 0&&(o.title=l);const c=s===void 0?i?{...o,[r.definitionPath]:i}:o:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,s].join("/"),[r.definitionPath]:{...i,[s]:o}};return c.$schema="http://json-schema.org/draft-07/schema#",c},xU=bU;function _U(e,t){var n;const r=(n=void 0)!=null?n:!1;return wd(xU(e,{$refStrategy:r?"root":"none"}),{validate:async i=>{const s=await e.safeParseAsync(i);return s.success?{success:!0,value:s.data}:{success:!1,error:s.error}}})}function wU(e,t){var n;const r=(n=void 0)!=null?n:!1,i=t0(e,{target:"draft-7",io:"output",reused:r?"ref":"inline"});return wd(i,{validate:async s=>{const o=await vd(e,s);return o.success?{success:!0,value:o.data}:{success:!1,error:o.error}}})}function kU(e){return"_zod"in e}function CU(e,t){return kU(e)?wU(e):_U(e)}var wp=Symbol.for("vercel.ai.schema");function wd(e,{validate:t}={}){return{[wp]:!0,_type:void 0,[hl]:!0,jsonSchema:e,validate:t}}function SU(e){return typeof e=="object"&&e!==null&&wp in e&&e[wp]===!0&&"jsonSchema"in e&&"validate"in e}function EU(e){return e==null?wd({properties:{},additionalProperties:!1}):SU(e)?e:CU(e)}var AU=Object.defineProperty,TU=(e,t)=>{for(var n in t)AU(e,n,{get:t[n],enumerable:!0})},W0="AI_NoObjectGeneratedError",q0=`vercel.ai.error.${W0}`,IU=Symbol.for(q0),V0,dv=class extends yi{constructor({message:e="No object generated.",cause:t,text:n,response:r,usage:i,finishReason:s}){super({name:W0,message:e,cause:t}),this[V0]=!0,this.text=n,this.response=r,this.usage=i,this.finishReason=s}static isInstance(e){return yi.hasMarker(e,q0)}};V0=IU;var fv="5.0.52",G0=St([ae(),vi(Uint8Array),vi(ArrayBuffer),Ml(e=>{var t,n;return(n=(t=globalThis.Buffer)==null?void 0:t.isBuffer(e))!=null?n:!1},{message:"Must be a Buffer"})]),To=p0(()=>St([o0(),ae(),Ta(),lt(),Ia(ae(),To),Bn(To)])),_t=Ia(ae(),Ia(ae(),To)),J0=$e({type:xe("text"),text:ae(),providerOptions:_t.optional()}),jU=$e({type:xe("image"),image:St([G0,vi(URL)]),mediaType:ae().optional(),providerOptions:_t.optional()}),K0=$e({type:xe("file"),data:St([G0,vi(URL)]),filename:ae().optional(),mediaType:ae(),providerOptions:_t.optional()}),RU=$e({type:xe("reasoning"),text:ae(),providerOptions:_t.optional()}),OU=$e({type:xe("tool-call"),toolCallId:ae(),toolName:ae(),input:bt(),providerOptions:_t.optional(),providerExecuted:lt().optional()}),zU=l0("type",[$e({type:xe("text"),value:ae()}),$e({type:xe("json"),value:To}),$e({type:xe("error-text"),value:ae()}),$e({type:xe("error-json"),value:To}),$e({type:xe("content"),value:Bn(St([$e({type:xe("text"),text:ae()}),$e({type:xe("media"),data:ae(),mediaType:ae()})]))})]),Y0=$e({type:xe("tool-result"),toolCallId:ae(),toolName:ae(),output:zU,providerOptions:_t.optional()}),NU=$e({role:xe("system"),content:ae(),providerOptions:_t.optional()}),MU=$e({role:xe("user"),content:St([ae(),Bn(St([J0,jU,K0]))]),providerOptions:_t.optional()}),PU=$e({role:xe("assistant"),content:St([ae(),Bn(St([J0,K0,RU,OU,Y0]))]),providerOptions:_t.optional()}),$U=$e({role:xe("tool"),content:Bn(Y0),providerOptions:_t.optional()});St([NU,MU,PU,$U]);Fo({prefix:"aitxt",size:24});(class extends TransformStream{constructor(){super({transform(e,t){t.enqueue(`data: ${JSON.stringify(e)}

`)},flush(e){e.enqueue(`data: [DONE]

`)}})}});var DU=St([et({type:xe("text-start"),id:ae(),providerMetadata:_t.optional()}),et({type:xe("text-delta"),id:ae(),delta:ae(),providerMetadata:_t.optional()}),et({type:xe("text-end"),id:ae(),providerMetadata:_t.optional()}),et({type:xe("error"),errorText:ae()}),et({type:xe("tool-input-start"),toolCallId:ae(),toolName:ae(),providerExecuted:lt().optional(),dynamic:lt().optional()}),et({type:xe("tool-input-delta"),toolCallId:ae(),inputTextDelta:ae()}),et({type:xe("tool-input-available"),toolCallId:ae(),toolName:ae(),input:bt(),providerExecuted:lt().optional(),providerMetadata:_t.optional(),dynamic:lt().optional()}),et({type:xe("tool-input-error"),toolCallId:ae(),toolName:ae(),input:bt(),providerExecuted:lt().optional(),providerMetadata:_t.optional(),dynamic:lt().optional(),errorText:ae()}),et({type:xe("tool-output-available"),toolCallId:ae(),output:bt(),providerExecuted:lt().optional(),dynamic:lt().optional(),preliminary:lt().optional()}),et({type:xe("tool-output-error"),toolCallId:ae(),errorText:ae(),providerExecuted:lt().optional(),dynamic:lt().optional()}),et({type:xe("reasoning-start"),id:ae(),providerMetadata:_t.optional()}),et({type:xe("reasoning-delta"),id:ae(),delta:ae(),providerMetadata:_t.optional()}),et({type:xe("reasoning-end"),id:ae(),providerMetadata:_t.optional()}),et({type:xe("source-url"),sourceId:ae(),url:ae(),title:ae().optional(),providerMetadata:_t.optional()}),et({type:xe("source-document"),sourceId:ae(),mediaType:ae(),title:ae(),filename:ae().optional(),providerMetadata:_t.optional()}),et({type:xe("file"),url:ae(),mediaType:ae(),providerMetadata:_t.optional()}),et({type:Ml(e=>typeof e=="string"&&e.startsWith("data-"),{message:'Type must start with "data-"'}),id:ae().optional(),data:bt(),transient:lt().optional()}),et({type:xe("start-step")}),et({type:xe("finish-step")}),et({type:xe("start"),messageId:ae().optional(),messageMetadata:bt().optional()}),et({type:xe("finish"),messageMetadata:bt().optional()}),et({type:xe("abort")}),et({type:xe("message-metadata"),messageMetadata:bt()})]);function FU(e){const t=["ROOT"];let n=-1,r=null;function i(c,p,d){switch(c){case'"':{n=p,t.pop(),t.push(d),t.push("INSIDE_STRING");break}case"f":case"t":case"n":{n=p,r=p,t.pop(),t.push(d),t.push("INSIDE_LITERAL");break}case"-":{t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=p,t.pop(),t.push(d),t.push("INSIDE_NUMBER");break}case"{":{n=p,t.pop(),t.push(d),t.push("INSIDE_OBJECT_START");break}case"[":{n=p,t.pop(),t.push(d),t.push("INSIDE_ARRAY_START");break}}}function s(c,p){switch(c){case",":{t.pop(),t.push("INSIDE_OBJECT_AFTER_COMMA");break}case"}":{n=p,t.pop();break}}}function o(c,p){switch(c){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=p,t.pop();break}}}for(let c=0;c<e.length;c++){const p=e[c];switch(t[t.length-1]){case"ROOT":i(p,c,"FINISH");break;case"INSIDE_OBJECT_START":{switch(p){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}case"}":{n=c,t.pop();break}}break}case"INSIDE_OBJECT_AFTER_COMMA":{switch(p){case'"':{t.pop(),t.push("INSIDE_OBJECT_KEY");break}}break}case"INSIDE_OBJECT_KEY":{switch(p){case'"':{t.pop(),t.push("INSIDE_OBJECT_AFTER_KEY");break}}break}case"INSIDE_OBJECT_AFTER_KEY":{switch(p){case":":{t.pop(),t.push("INSIDE_OBJECT_BEFORE_VALUE");break}}break}case"INSIDE_OBJECT_BEFORE_VALUE":{i(p,c,"INSIDE_OBJECT_AFTER_VALUE");break}case"INSIDE_OBJECT_AFTER_VALUE":{s(p,c);break}case"INSIDE_STRING":{switch(p){case'"':{t.pop(),n=c;break}case"\\":{t.push("INSIDE_STRING_ESCAPE");break}default:n=c}break}case"INSIDE_ARRAY_START":{switch(p){case"]":{n=c,t.pop();break}default:{n=c,i(p,c,"INSIDE_ARRAY_AFTER_VALUE");break}}break}case"INSIDE_ARRAY_AFTER_VALUE":{switch(p){case",":{t.pop(),t.push("INSIDE_ARRAY_AFTER_COMMA");break}case"]":{n=c,t.pop();break}default:{n=c;break}}break}case"INSIDE_ARRAY_AFTER_COMMA":{i(p,c,"INSIDE_ARRAY_AFTER_VALUE");break}case"INSIDE_STRING_ESCAPE":{t.pop(),n=c;break}case"INSIDE_NUMBER":{switch(p){case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":{n=c;break}case"e":case"E":case"-":case".":break;case",":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&o(p,c),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&s(p,c);break}case"}":{t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"&&s(p,c);break}case"]":{t.pop(),t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&o(p,c);break}default:{t.pop();break}}break}case"INSIDE_LITERAL":{const h=e.substring(r,c+1);!"false".startsWith(h)&&!"true".startsWith(h)&&!"null".startsWith(h)?(t.pop(),t[t.length-1]==="INSIDE_OBJECT_AFTER_VALUE"?s(p,c):t[t.length-1]==="INSIDE_ARRAY_AFTER_VALUE"&&o(p,c)):n=c;break}}}let l=e.slice(0,n+1);for(let c=t.length-1;c>=0;c--)switch(t[c]){case"INSIDE_STRING":{l+='"';break}case"INSIDE_OBJECT_KEY":case"INSIDE_OBJECT_AFTER_KEY":case"INSIDE_OBJECT_AFTER_COMMA":case"INSIDE_OBJECT_START":case"INSIDE_OBJECT_BEFORE_VALUE":case"INSIDE_OBJECT_AFTER_VALUE":{l+="}";break}case"INSIDE_ARRAY_START":case"INSIDE_ARRAY_AFTER_COMMA":case"INSIDE_ARRAY_AFTER_VALUE":{l+="]";break}case"INSIDE_LITERAL":{const d=e.substring(r,e.length);"true".startsWith(d)?l+="true".slice(d.length):"false".startsWith(d)?l+="false".slice(d.length):"null".startsWith(d)&&(l+="null".slice(d.length))}}return l}async function LU(e){if(e===void 0)return{value:void 0,state:"undefined-input"};let t=await ml({text:e});return t.success?{value:t.value,state:"successful-parse"}:(t=await ml({text:FU(e)}),t.success?{value:t.value,state:"repaired-parse"}:{value:void 0,state:"failed-parse"})}Fo({prefix:"aitxt",size:24});Fo({prefix:"aiobj",size:24});Fo({prefix:"aiobj",size:24});var BU={};TU(BU,{object:()=>ZU,text:()=>UU});var UU=()=>({type:"text",responseFormat:{type:"text"},async parsePartial({text:e}){return{partial:e}},async parseOutput({text:e}){return e}}),ZU=({schema:e})=>{const t=EU(e);return{type:"object",responseFormat:{type:"json",schema:t.jsonSchema},async parsePartial({text:n}){const r=await LU(n);switch(r.state){case"failed-parse":case"undefined-input":return;case"repaired-parse":case"successful-parse":return{partial:r.value};default:{const i=r.state;throw new Error(`Unsupported parse state: ${i}`)}}},async parseOutput({text:n},r){const i=await ml({text:n});if(!i.success)throw new dv({message:"No object generated: could not parse the response.",cause:i.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});const s=await L0({value:i.value,schema:t});if(!s.success)throw new dv({message:"No object generated: response did not match schema.",cause:s.error,text:n,response:r.response,usage:r.usage,finishReason:r.finishReason});return s.value}}},HU=ba({name:ae(),version:ae()}),kd=ba({_meta:cn($e({}).loose())}),Io=kd,WU=$e({method:ae(),params:cn(kd)}),qU=ba({experimental:cn($e({}).loose()),logging:cn($e({}).loose()),prompts:cn(ba({listChanged:cn(lt())})),resources:cn(ba({subscribe:cn(lt()),listChanged:cn(lt())})),tools:cn(ba({listChanged:cn(lt())}))});Io.extend({protocolVersion:ae(),capabilities:qU,serverInfo:HU,instructions:cn(ae())});var VU=Io.extend({nextCursor:cn(ae())}),GU=$e({name:ae(),description:cn(ae()),inputSchema:$e({type:xe("object"),properties:cn($e({}).loose())}).loose()}).loose();VU.extend({tools:Bn(GU)});var JU=$e({type:xe("text"),text:ae()}).loose(),KU=$e({type:xe("image"),data:i0(),mimeType:ae()}).loose(),X0=$e({uri:ae(),mimeType:cn(ae())}).loose(),YU=X0.extend({text:ae()}),XU=X0.extend({blob:i0()}),QU=$e({type:xe("resource"),resource:St([YU,XU])}).loose();Io.extend({content:Bn(St([JU,KU,QU])),isError:lt().default(!1).optional()}).or(Io.extend({toolResult:bt()}));var Pl="2.0",eZ=$e({jsonrpc:xe(Pl),id:St([ae(),Ta().int()])}).merge(WU).strict(),tZ=$e({jsonrpc:xe(Pl),id:St([ae(),Ta().int()]),result:Io}).strict(),nZ=$e({jsonrpc:xe(Pl),id:St([ae(),Ta().int()]),error:$e({code:Ta().int(),message:ae(),data:cn(bt())})}).strict(),rZ=$e({jsonrpc:xe(Pl)}).merge($e({method:ae(),params:cn(kd)})).strict();St([eZ,rZ,tZ,nZ]);var iZ=class{constructor({api:e="/api/chat",credentials:t,headers:n,body:r,fetch:i,prepareSendMessagesRequest:s,prepareReconnectToStreamRequest:o}){this.api=e,this.credentials=t,this.headers=n,this.body=r,this.fetch=i,this.prepareSendMessagesRequest=s,this.prepareReconnectToStreamRequest=o}async sendMessages({abortSignal:e,...t}){var n,r,i,s,o;const l=await da(this.body),c=await da(this.headers),p=await da(this.credentials),d=await((n=this.prepareSendMessagesRequest)==null?void 0:n.call(this,{api:this.api,id:t.chatId,messages:t.messages,body:{...l,...t.body},headers:{...c,...t.headers},credentials:p,requestMetadata:t.metadata,trigger:t.trigger,messageId:t.messageId})),h=(r=d?.api)!=null?r:this.api,v=d?.headers!==void 0?d.headers:{...c,...t.headers},y=d?.body!==void 0?d.body:{...l,...t.body,id:t.chatId,messages:t.messages,trigger:t.trigger,messageId:t.messageId},g=(i=d?.credentials)!=null?i:p,_=await((s=this.fetch)!=null?s:globalThis.fetch)(h,{method:"POST",headers:uv({"Content-Type":"application/json",...v},`ai-sdk/${fv}`,lv()),body:JSON.stringify(y),credentials:g,signal:e});if(!_.ok)throw new Error((o=await _.text())!=null?o:"Failed to fetch the chat response.");if(!_.body)throw new Error("The response body is empty.");return this.processResponseStream(_.body)}async reconnectToStream(e){var t,n,r,i,s;const o=await da(this.body),l=await da(this.headers),c=await da(this.credentials),p=await((t=this.prepareReconnectToStreamRequest)==null?void 0:t.call(this,{api:this.api,id:e.chatId,body:{...o,...e.body},headers:{...l,...e.headers},credentials:c,requestMetadata:e.metadata})),d=(n=p?.api)!=null?n:`${this.api}/${e.chatId}/stream`,h=p?.headers!==void 0?p.headers:{...l,...e.headers},v=(r=p?.credentials)!=null?r:c,g=await((i=this.fetch)!=null?i:globalThis.fetch)(d,{method:"GET",headers:uv(h,`ai-sdk/${fv}`,lv()),credentials:v});if(g.status===204)return null;if(!g.ok)throw new Error((s=await g.text())!=null?s:"Failed to fetch the chat response.");if(!g.body)throw new Error("The response body is empty.");return this.processResponseStream(g.body)}},aZ=class extends iZ{constructor(e={}){super(e)}processResponseStream(e){return zB({stream:e,schema:DU}).pipeThrough(new TransformStream({async transform(t,n){if(!t.success)throw t.error;n.enqueue(t.value)}}))}},oZ=$e({type:xe("text"),text:ae(),state:$o(["streaming","done"]).optional(),providerMetadata:_t.optional()}),sZ=$e({type:xe("reasoning"),text:ae(),state:$o(["streaming","done"]).optional(),providerMetadata:_t.optional()}),lZ=$e({type:xe("source-url"),sourceId:ae(),url:ae(),title:ae().optional(),providerMetadata:_t.optional()}),uZ=$e({type:xe("source-document"),sourceId:ae(),mediaType:ae(),title:ae(),filename:ae().optional(),providerMetadata:_t.optional()}),cZ=$e({type:xe("file"),mediaType:ae(),filename:ae().optional(),url:ae(),providerMetadata:_t.optional()}),pZ=$e({type:xe("step-start")}),dZ=$e({type:ae().startsWith("data-"),id:ae().optional(),data:bt()}),fZ=[$e({type:xe("dynamic-tool"),toolName:ae(),toolCallId:ae(),state:xe("input-streaming"),input:bt().optional(),output:$n().optional(),errorText:$n().optional()}),$e({type:xe("dynamic-tool"),toolName:ae(),toolCallId:ae(),state:xe("input-available"),input:bt(),output:$n().optional(),errorText:$n().optional(),callProviderMetadata:_t.optional()}),$e({type:xe("dynamic-tool"),toolName:ae(),toolCallId:ae(),state:xe("output-available"),input:bt(),output:bt(),errorText:$n().optional(),callProviderMetadata:_t.optional(),preliminary:lt().optional()}),$e({type:xe("dynamic-tool"),toolName:ae(),toolCallId:ae(),state:xe("output-error"),input:bt(),output:$n().optional(),errorText:ae(),callProviderMetadata:_t.optional()})],hZ=[$e({type:ae().startsWith("tool-"),toolCallId:ae(),state:xe("input-streaming"),providerExecuted:lt().optional(),input:bt().optional(),output:$n().optional(),errorText:$n().optional()}),$e({type:ae().startsWith("tool-"),toolCallId:ae(),state:xe("input-available"),providerExecuted:lt().optional(),input:bt(),output:$n().optional(),errorText:$n().optional(),callProviderMetadata:_t.optional()}),$e({type:ae().startsWith("tool-"),toolCallId:ae(),state:xe("output-available"),providerExecuted:lt().optional(),input:bt(),output:bt(),errorText:$n().optional(),callProviderMetadata:_t.optional(),preliminary:lt().optional()}),$e({type:ae().startsWith("tool-"),toolCallId:ae(),state:xe("output-error"),providerExecuted:lt().optional(),input:bt(),output:$n().optional(),errorText:ae(),callProviderMetadata:_t.optional()})];$e({id:ae(),role:$o(["system","user","assistant"]),metadata:bt().optional(),parts:Bn(St([oZ,sZ,lZ,uZ,cZ,pZ,dZ,...fZ,...hZ]))});let Jr=null;const Cd="strapi-ai-token",Q0=60*1e3,mZ=e=>{const t=Date.parse(e);return Number.isFinite(t)?t:null},gZ=(e,t=Q0,n=Date.now())=>{const r=mZ(e);return r===null||r<=n?"expired":r-t<=n?"stale":"valid"},hv=(e,t=Q0,n=Date.now())=>gZ(e,t,n)==="valid",vZ=()=>{Jr=null,sessionStorage.removeItem(Cd)},yZ=()=>{try{const e=sessionStorage.getItem(Cd);return e?JSON.parse(e):null}catch{return null}},bZ=e=>{sessionStorage.setItem(Cd,JSON.stringify(e))},gl=async()=>{if(Jr&&hv(Jr.expiresAt))return Jr;const e=yZ();if(e&&hv(e.expiresAt))return Jr=e,Jr;try{const{get:t}=cT(),{data:n}=await t("/admin/ai-token"),r=n?.token||n?.data?.token,i=n?.expiresAt||n?.data?.expiresAt;return r&&i?(Jr={token:r,expiresAt:i},bZ(Jr),Jr):null}catch{return null}},xZ=async()=>{try{if(await gl())return;await gl()}catch{}},e_=async e=>{try{return await e.json()}catch{try{return{error:await e.text()}}catch{return}}},_Z=(e,t,n)=>({Authorization:`Bearer ${e}`,"X-Strapi-Version":t?.strapiVersion||"latest","X-Strapi-User":t?.userId||"unknown","X-Strapi-Project-Id":t?.projectId||"unknown",...n}),wZ=(e,t)=>{if(e===401||e===403)return!0;const n=(t?.error||"").toString().toLowerCase();return n.includes("expired")||n.includes("invalid token")},t_=async(e,t={})=>{const n=await gl();if(!n?.token)throw new Error("Could not authorize with AI Server. Please contact your administrator.");const r=async o=>{const l=_Z(o,t.ctx,t.headers);return fetch(e,{...t,headers:l})};let i=await r(n.token),s;try{s=await e_(i.clone())}catch{}if(wZ(i.status,s)){vZ();const o=await gl();o?.token&&o.token!==n.token&&(i=await r(o.token))}return i},kZ=e=>async(t,n={})=>t_(t,{...n,ctx:e}),CZ="Too many requests",SZ="License limit",EZ="AI credit limit exceeded",AZ="Chat too long",$l=e=>()=>{const t=Qr("useAIFetch",d=>d.strapiVersion),n=Qr("useAIFetch",d=>d.projectId),r=Qr("useAIFetch-user",d=>d.userId),i=pT(void 0,{refetchOnMountOrArgChange:!0}),[s,o]=W.useState(!1),[l,c]=W.useState(null);return{isPending:s,error:l,fetch:async(d={})=>{o(!0),c(null);try{const h=`${Xy}${e}`,v=!!d.body&&!d.formData,y=await t_(h,{method:"POST",headers:v?{"Content-Type":"application/json",...d.headers||{}}:d.headers,body:d.formData?d.formData:v?JSON.stringify(d.body||{}):void 0,ctx:{strapiVersion:t,projectId:n,userId:r}});i.refetch();const g=await e_(y);if(!y.ok)throw new Error(`Error: ${y.statusText}`);return g}catch(h){return c(h instanceof Error?h.message:`Failed to fetch data from ${e}`),null}finally{o(!1)}}}},TZ=$l("/schemas/chat/generate-title"),IZ=$l("/schemas/chat/attachment"),jZ=$l("/schemas/chat/feedback"),RZ=$l("/media/upload"),OZ=e=>{const t=Qr("useAIChat",s=>s.strapiVersion),n=Qr("useAIFetch",s=>s.projectId),r=Qr("useAIChat-user",s=>s.userId),i=kZ({strapiVersion:t,projectId:n,userId:r});return mB({...e,transport:new aZ({api:TR,fetch:i})})},zZ=({chatId:e,messages:t})=>{const[n,r]=W.useState(void 0),{fetch:i,error:s,isPending:o}=TZ(),l=W.useCallback(async()=>{const p=t.at(0);if(!p||n||o||s)return;const d=p.parts.map(v=>v.type==="text"?v.text:"").join(`
`),h=await i({body:{chatId:e,message:d}});h?.data&&r(h.data.title)},[t,n,o,s,i,e]),c=W.useCallback(()=>{r(void 0)},[]);return{title:n,isGenerating:o,error:s,generateTitle:l,resetTitle:c}},NZ=1,MZ=()=>{if(typeof window>"u")return{uid:null,type:null};const e=window.location.pathname;if(e.includes("/content-types/")){const t=e.split("/content-types/")[1];if(t)return{uid:t,type:"contentType"}}if(e.includes("/component-categories/")){const t=e.split("/component-categories/")[1].split("/");if(t.length>=2)return{uid:t[1],type:"component"}}return{uid:null,type:null}},PZ=()=>{const[e,t]=W.useState([]),{components:n,contentTypes:r}=er();return W.useEffect(()=>{const o=()=>{const{uid:p,type:d}=MZ();if(!p||!d)return;const h={uid:p,type:d,timestamp:Date.now()};t(v=>{const y=v.filter(g=>g.uid!==h.uid);return[h,...y].slice(0,NZ)})};o(),window.addEventListener("popstate",o);const c=(()=>{let p=window.location.pathname;const d=setInterval(()=>{const h=window.location.pathname;h!==p&&(p=h,o())},300);return()=>clearInterval(d)})();return()=>{window.removeEventListener("popstate",o),c()}},[]),{lastSeenSchemas:W.useMemo(()=>e.filter(o=>o.type==="contentType"?Object.keys(r).some(l=>l===o.uid):o.type==="component"?Object.keys(n).some(l=>l===o.uid):!1),[e,n,r]),clearHistory:()=>{t([])}}},mv=e=>e.reduce((t,n)=>{const{name:r,...i}=n;return{...t,[r]:i}},{}),gv=e=>e.modelType==="component"?{category:e.category,kind:"component",action:"create",modelType:"component",description:e.info.description,name:e.info.displayName,uid:e.uid,attributes:mv(e.attributes),sources:e.sources}:{kind:e.kind,modelType:e.modelType,description:e.info.description,action:"create",name:e.info.pluralName,uid:e.uid,...e.plugin?{plugin:e.plugin}:{},attributes:mv(e.attributes),sources:e.sources,options:{draftAndPublish:e.options?.draftAndPublish,localized:!1}},n_=W.createContext(null),r_=()=>{const e=W.useContext(n_);if(!e)throw new Error("useStepModal must be used within a StepModal");return e},Li=({open:e,onOpenChange:t,title:n,children:r,onComplete:i,onCancel:s})=>{const[o,l]=W.useState(0),[c,p]=W.useState(!1),[d,h]=W.useState(null),v=W.Children.toArray(r).filter(B=>W.isValidElement(B)).map(B=>B.props),y=v.length,g=o===0,k=o===y-1;W.useEffect(()=>{e||(l(0),p(!1),h(null))},[e]);const _=()=>{l(0),p(!1),h(null)},x=()=>{s?.(),_(),t(!1)},S=()=>{l(B=>Math.max(0,B-1)),h(null)},T=async()=>{const B=v[o];if(B.onNext){p(!0),h(null);try{return k?(i?.(),_(),t(!1)):(await B.onNext(),l(L=>L+1)),!0}catch(L){return h(L instanceof Error?L:new Error(String(L))),!1}finally{p(!1)}}else return k?(i?.(),_(),t(!1)):l(L=>L+1),!0},I=B=>{B.preventDefault(),!c&&!v[o]?.disableNext&&T()},O={currentStep:o,goToStep:l,nextStep:T,prevStep:S,isFirstStep:g,isLastStep:k,totalSteps:y,isLoading:c,error:d,setError:h},R=v[o];return m.jsx(n_.Provider,{value:O,children:e&&m.jsx(fn.Root,{open:!0,onOpenChange:x,children:m.jsxs(fn.Content,{children:[m.jsx(fn.Header,{children:m.jsx(ze,{variant:"omega",fontWeight:"bold",children:R?.title||n})}),m.jsxs("form",{onSubmit:I,children:[m.jsxs(fn.Body,{children:[W.Children.toArray(r)[o],d&&m.jsx(Ne,{marginTop:4,padding:3,background:"danger100",color:"danger600",borderRadius:"4px",children:m.jsx(ze,{variant:"pi",children:d.message})})]}),m.jsxs(fn.Footer,{children:[g?m.jsx(ft,{variant:"tertiary",onClick:x,type:"button",children:R?.cancelLabel||"Cancel"}):m.jsx(ft,{variant:"tertiary",onClick:S,type:"button",children:R?.backLabel||"Back"}),m.jsx(ft,{variant:"default",type:"submit",disabled:c||R?.disableNext,loading:c,children:R?.nextLabel||(k?"Complete":"Next")})]})]})]})})})},$Z=({children:e})=>m.jsx(m.Fragment,{children:e});Li.Step=$Z;const vl=(e=16)=>crypto.randomUUID().slice(0,e);function Lo(){const{setAttachments:e,attachments:t,id:n}=gr(),{toggleNotification:r}=Ra(),{fetch:i}=RZ(),s=W.useCallback(d=>{d&&e(h=>[...h,...d])},[e]),o=W.useCallback(d=>{e(h=>h.map(v=>v.id===d.id?{...v,...d}:v))},[e]),l=W.useCallback(d=>{e(h=>h.filter(v=>v.id!==d.id))},[e]),c=W.useCallback(async(d,h)=>{const v=t?.length||0,y=Array.from(d).length;let g=d;if(v+y>pc){r({type:"danger",title:"File limit reached: ",message:`You can only upload up to ${pc} files`});const k=pc-v;g=d.slice(0,k)}for(const k of g)k.size>AR&&(r({type:"danger",title:"File too large: ",message:"One of the files is too large (15MB limit)"}),g=g.filter(_=>_!==k));for(const k of g){const _={id:vl(),type:"file",status:"loading",filename:k.name,mediaType:k.type,url:""};e(S=>[...S,_]);const x=new FormData;x.append("file",k),x.append("fileInfo",JSON.stringify({name:k.name,chatId:n})),i({formData:x}).then(S=>{const T=S?.data;if(!S||S.error){r({type:"danger",title:"Failed to upload file: ",message:S?.error||"Unknown error",timeout:5e3}),l(_);return}o({id:_.id,url:T?.url||"",status:"ready"})}).catch(()=>l(_))}h&&r({title:"Files attached",message:h})},[t,e,r,n,i,l,o]),p=W.useCallback(d=>{t&&e(t.filter((h,v)=>v!==d))},[e,t]);return{attachments:t,attachFiles:c,addAttachments:s,removeAttachment:l,removeAttachmentByIndex:p}}var i_={exports:{}};(function(e,t){var n={};/*!

	JSZip v3.10.1 - A JavaScript class for generating and reading zip files
	<http://stuartk.com/jszip>

	(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
	Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.

	JSZip uses the library pako released under the MIT license :
	https://github.com/nodeca/pako/blob/main/LICENSE
	*/(function(r){e.exports=r()})(function(){return function r(i,s,o){function l(d,h){if(!s[d]){if(!i[d]){var v=typeof Rs=="function"&&Rs;if(!h&&v)return v(d,!0);if(c)return c(d,!0);var y=new Error("Cannot find module '"+d+"'");throw y.code="MODULE_NOT_FOUND",y}var g=s[d]={exports:{}};i[d][0].call(g.exports,function(k){var _=i[d][1][k];return l(_||k)},g,g.exports,r,i,s,o)}return s[d].exports}for(var c=typeof Rs=="function"&&Rs,p=0;p<o.length;p++)l(o[p]);return l}({1:[function(r,i,s){var o=r("./utils"),l=r("./support"),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";s.encode=function(p){for(var d,h,v,y,g,k,_,x=[],S=0,T=p.length,I=T,O=o.getTypeOf(p)!=="string";S<p.length;)I=T-S,v=O?(d=p[S++],h=S<T?p[S++]:0,S<T?p[S++]:0):(d=p.charCodeAt(S++),h=S<T?p.charCodeAt(S++):0,S<T?p.charCodeAt(S++):0),y=d>>2,g=(3&d)<<4|h>>4,k=1<I?(15&h)<<2|v>>6:64,_=2<I?63&v:64,x.push(c.charAt(y)+c.charAt(g)+c.charAt(k)+c.charAt(_));return x.join("")},s.decode=function(p){var d,h,v,y,g,k,_=0,x=0,S="data:";if(p.substr(0,S.length)===S)throw new Error("Invalid base64 input, it looks like a data url.");var T,I=3*(p=p.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(p.charAt(p.length-1)===c.charAt(64)&&I--,p.charAt(p.length-2)===c.charAt(64)&&I--,I%1!=0)throw new Error("Invalid base64 input, bad content length.");for(T=l.uint8array?new Uint8Array(0|I):new Array(0|I);_<p.length;)d=c.indexOf(p.charAt(_++))<<2|(y=c.indexOf(p.charAt(_++)))>>4,h=(15&y)<<4|(g=c.indexOf(p.charAt(_++)))>>2,v=(3&g)<<6|(k=c.indexOf(p.charAt(_++))),T[x++]=d,g!==64&&(T[x++]=h),k!==64&&(T[x++]=v);return T}},{"./support":30,"./utils":32}],2:[function(r,i,s){var o=r("./external"),l=r("./stream/DataWorker"),c=r("./stream/Crc32Probe"),p=r("./stream/DataLengthProbe");function d(h,v,y,g,k){this.compressedSize=h,this.uncompressedSize=v,this.crc32=y,this.compression=g,this.compressedContent=k}d.prototype={getContentWorker:function(){var h=new l(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new p("data_length")),v=this;return h.on("end",function(){if(this.streamInfo.data_length!==v.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),h},getCompressedWorker:function(){return new l(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},d.createWorkerFrom=function(h,v,y){return h.pipe(new c).pipe(new p("uncompressedSize")).pipe(v.compressWorker(y)).pipe(new p("compressedSize")).withStreamInfo("compression",v)},i.exports=d},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,i,s){var o=r("./stream/GenericWorker");s.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},s.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,i,s){var o=r("./utils"),l=function(){for(var c,p=[],d=0;d<256;d++){c=d;for(var h=0;h<8;h++)c=1&c?3988292384^c>>>1:c>>>1;p[d]=c}return p}();i.exports=function(c,p){return c!==void 0&&c.length?o.getTypeOf(c)!=="string"?function(d,h,v,y){var g=l,k=y+v;d^=-1;for(var _=y;_<k;_++)d=d>>>8^g[255&(d^h[_])];return-1^d}(0|p,c,c.length,0):function(d,h,v,y){var g=l,k=y+v;d^=-1;for(var _=y;_<k;_++)d=d>>>8^g[255&(d^h.charCodeAt(_))];return-1^d}(0|p,c,c.length,0):0}},{"./utils":32}],5:[function(r,i,s){s.base64=!1,s.binary=!1,s.dir=!1,s.createFolders=!0,s.date=null,s.compression=null,s.compressionOptions=null,s.comment=null,s.unixPermissions=null,s.dosPermissions=null},{}],6:[function(r,i,s){var o=null;o=typeof Promise<"u"?Promise:r("lie"),i.exports={Promise:o}},{lie:37}],7:[function(r,i,s){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",l=r("pako"),c=r("./utils"),p=r("./stream/GenericWorker"),d=o?"uint8array":"array";function h(v,y){p.call(this,"FlateWorker/"+v),this._pako=null,this._pakoAction=v,this._pakoOptions=y,this.meta={}}s.magic="\b\0",c.inherits(h,p),h.prototype.processChunk=function(v){this.meta=v.meta,this._pako===null&&this._createPako(),this._pako.push(c.transformTo(d,v.data),!1)},h.prototype.flush=function(){p.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){p.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new l[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var v=this;this._pako.onData=function(y){v.push({data:y,meta:v.meta})}},s.compressWorker=function(v){return new h("Deflate",v)},s.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,i,s){function o(g,k){var _,x="";for(_=0;_<k;_++)x+=String.fromCharCode(255&g),g>>>=8;return x}function l(g,k,_,x,S,T){var I,O,R=g.file,B=g.compression,L=T!==d.utf8encode,V=c.transformTo("string",T(R.name)),q=c.transformTo("string",d.utf8encode(R.name)),D=R.comment,X=c.transformTo("string",T(D)),M=c.transformTo("string",d.utf8encode(D)),Y=q.length!==R.name.length,w=M.length!==D.length,F="",_e="",se="",pe=R.dir,N=R.date,Ee={crc32:0,compressedSize:0,uncompressedSize:0};k&&!_||(Ee.crc32=g.crc32,Ee.compressedSize=g.compressedSize,Ee.uncompressedSize=g.uncompressedSize);var ie=0;k&&(ie|=8),L||!Y&&!w||(ie|=2048);var z=0,je=0;pe&&(z|=16),S==="UNIX"?(je=798,z|=function(ne,Je){var Ke=ne;return ne||(Ke=Je?16893:33204),(65535&Ke)<<16}(R.unixPermissions,pe)):(je=20,z|=function(ne){return 63&(ne||0)}(R.dosPermissions)),I=N.getUTCHours(),I<<=6,I|=N.getUTCMinutes(),I<<=5,I|=N.getUTCSeconds()/2,O=N.getUTCFullYear()-1980,O<<=4,O|=N.getUTCMonth()+1,O<<=5,O|=N.getUTCDate(),Y&&(_e=o(1,1)+o(h(V),4)+q,F+="up"+o(_e.length,2)+_e),w&&(se=o(1,1)+o(h(X),4)+M,F+="uc"+o(se.length,2)+se);var le="";return le+=`
\0`,le+=o(ie,2),le+=B.magic,le+=o(I,2),le+=o(O,2),le+=o(Ee.crc32,4),le+=o(Ee.compressedSize,4),le+=o(Ee.uncompressedSize,4),le+=o(V.length,2),le+=o(F.length,2),{fileRecord:v.LOCAL_FILE_HEADER+le+V+F,dirRecord:v.CENTRAL_FILE_HEADER+o(je,2)+le+o(X.length,2)+"\0\0\0\0"+o(z,4)+o(x,4)+V+F+X}}var c=r("../utils"),p=r("../stream/GenericWorker"),d=r("../utf8"),h=r("../crc32"),v=r("../signature");function y(g,k,_,x){p.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=k,this.zipPlatform=_,this.encodeFileName=x,this.streamFiles=g,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}c.inherits(y,p),y.prototype.push=function(g){var k=g.meta.percent||0,_=this.entriesCount,x=this._sources.length;this.accumulate?this.contentBuffer.push(g):(this.bytesWritten+=g.data.length,p.prototype.push.call(this,{data:g.data,meta:{currentFile:this.currentFile,percent:_?(k+100*(_-x-1))/_:100}}))},y.prototype.openedSource=function(g){this.currentSourceOffset=this.bytesWritten,this.currentFile=g.file.name;var k=this.streamFiles&&!g.file.dir;if(k){var _=l(g,k,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:_.fileRecord,meta:{percent:0}})}else this.accumulate=!0},y.prototype.closedSource=function(g){this.accumulate=!1;var k=this.streamFiles&&!g.file.dir,_=l(g,k,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(_.dirRecord),k)this.push({data:function(x){return v.DATA_DESCRIPTOR+o(x.crc32,4)+o(x.compressedSize,4)+o(x.uncompressedSize,4)}(g),meta:{percent:100}});else for(this.push({data:_.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},y.prototype.flush=function(){for(var g=this.bytesWritten,k=0;k<this.dirRecords.length;k++)this.push({data:this.dirRecords[k],meta:{percent:100}});var _=this.bytesWritten-g,x=function(S,T,I,O,R){var B=c.transformTo("string",R(O));return v.CENTRAL_DIRECTORY_END+"\0\0\0\0"+o(S,2)+o(S,2)+o(T,4)+o(I,4)+o(B.length,2)+B}(this.dirRecords.length,_,g,this.zipComment,this.encodeFileName);this.push({data:x,meta:{percent:100}})},y.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},y.prototype.registerPrevious=function(g){this._sources.push(g);var k=this;return g.on("data",function(_){k.processChunk(_)}),g.on("end",function(){k.closedSource(k.previous.streamInfo),k._sources.length?k.prepareNextSource():k.end()}),g.on("error",function(_){k.error(_)}),this},y.prototype.resume=function(){return!!p.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},y.prototype.error=function(g){var k=this._sources;if(!p.prototype.error.call(this,g))return!1;for(var _=0;_<k.length;_++)try{k[_].error(g)}catch{}return!0},y.prototype.lock=function(){p.prototype.lock.call(this);for(var g=this._sources,k=0;k<g.length;k++)g[k].lock()},i.exports=y},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(r,i,s){var o=r("../compressions"),l=r("./ZipFileWorker");s.generateWorker=function(c,p,d){var h=new l(p.streamFiles,d,p.platform,p.encodeFileName),v=0;try{c.forEach(function(y,g){v++;var k=function(T,I){var O=T||I,R=o[O];if(!R)throw new Error(O+" is not a valid compression method !");return R}(g.options.compression,p.compression),_=g.options.compressionOptions||p.compressionOptions||{},x=g.dir,S=g.date;g._compressWorker(k,_).withStreamInfo("file",{name:y,dir:x,date:S,comment:g.comment||"",unixPermissions:g.unixPermissions,dosPermissions:g.dosPermissions}).pipe(h)}),h.entriesCount=v}catch(y){h.error(y)}return h}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(r,i,s){function o(){if(!(this instanceof o))return new o;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var l=new o;for(var c in this)typeof this[c]!="function"&&(l[c]=this[c]);return l}}(o.prototype=r("./object")).loadAsync=r("./load"),o.support=r("./support"),o.defaults=r("./defaults"),o.version="3.10.1",o.loadAsync=function(l,c){return new o().loadAsync(l,c)},o.external=r("./external"),i.exports=o},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(r,i,s){var o=r("./utils"),l=r("./external"),c=r("./utf8"),p=r("./zipEntries"),d=r("./stream/Crc32Probe"),h=r("./nodejsUtils");function v(y){return new l.Promise(function(g,k){var _=y.decompressed.getContentWorker().pipe(new d);_.on("error",function(x){k(x)}).on("end",function(){_.streamInfo.crc32!==y.decompressed.crc32?k(new Error("Corrupted zip : CRC32 mismatch")):g()}).resume()})}i.exports=function(y,g){var k=this;return g=o.extend(g||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:c.utf8decode}),h.isNode&&h.isStream(y)?l.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):o.prepareContent("the loaded zip file",y,!0,g.optimizedBinaryString,g.base64).then(function(_){var x=new p(g);return x.load(_),x}).then(function(_){var x=[l.Promise.resolve(_)],S=_.files;if(g.checkCRC32)for(var T=0;T<S.length;T++)x.push(v(S[T]));return l.Promise.all(x)}).then(function(_){for(var x=_.shift(),S=x.files,T=0;T<S.length;T++){var I=S[T],O=I.fileNameStr,R=o.resolve(I.fileNameStr);k.file(R,I.decompressed,{binary:!0,optimizedBinaryString:!0,date:I.date,dir:I.dir,comment:I.fileCommentStr.length?I.fileCommentStr:null,unixPermissions:I.unixPermissions,dosPermissions:I.dosPermissions,createFolders:g.createFolders}),I.dir||(k.file(R).unsafeOriginalName=O)}return x.zipComment.length&&(k.comment=x.zipComment),k})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(r,i,s){var o=r("../utils"),l=r("../stream/GenericWorker");function c(p,d){l.call(this,"Nodejs stream input adapter for "+p),this._upstreamEnded=!1,this._bindStream(d)}o.inherits(c,l),c.prototype._bindStream=function(p){var d=this;(this._stream=p).pause(),p.on("data",function(h){d.push({data:h,meta:{percent:0}})}).on("error",function(h){d.isPaused?this.generatedError=h:d.error(h)}).on("end",function(){d.isPaused?d._upstreamEnded=!0:d.end()})},c.prototype.pause=function(){return!!l.prototype.pause.call(this)&&(this._stream.pause(),!0)},c.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},i.exports=c},{"../stream/GenericWorker":28,"../utils":32}],13:[function(r,i,s){var o=r("readable-stream").Readable;function l(c,p,d){o.call(this,p),this._helper=c;var h=this;c.on("data",function(v,y){h.push(v)||h._helper.pause(),d&&d(y)}).on("error",function(v){h.emit("error",v)}).on("end",function(){h.push(null)})}r("../utils").inherits(l,o),l.prototype._read=function(){this._helper.resume()},i.exports=l},{"../utils":32,"readable-stream":16}],14:[function(r,i,s){i.exports={isNode:typeof Buffer<"u",newBufferFrom:function(o,l){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(o,l);if(typeof o=="number")throw new Error('The "data" argument must not be a number');return new Buffer(o,l)},allocBuffer:function(o){if(Buffer.alloc)return Buffer.alloc(o);var l=new Buffer(o);return l.fill(0),l},isBuffer:function(o){return Buffer.isBuffer(o)},isStream:function(o){return o&&typeof o.on=="function"&&typeof o.pause=="function"&&typeof o.resume=="function"}}},{}],15:[function(r,i,s){function o(R,B,L){var V,q=c.getTypeOf(B),D=c.extend(L||{},h);D.date=D.date||new Date,D.compression!==null&&(D.compression=D.compression.toUpperCase()),typeof D.unixPermissions=="string"&&(D.unixPermissions=parseInt(D.unixPermissions,8)),D.unixPermissions&&16384&D.unixPermissions&&(D.dir=!0),D.dosPermissions&&16&D.dosPermissions&&(D.dir=!0),D.dir&&(R=S(R)),D.createFolders&&(V=x(R))&&T.call(this,V,!0);var X=q==="string"&&D.binary===!1&&D.base64===!1;L&&L.binary!==void 0||(D.binary=!X),(B instanceof v&&B.uncompressedSize===0||D.dir||!B||B.length===0)&&(D.base64=!1,D.binary=!0,B="",D.compression="STORE",q="string");var M=null;M=B instanceof v||B instanceof p?B:k.isNode&&k.isStream(B)?new _(R,B):c.prepareContent(R,B,D.binary,D.optimizedBinaryString,D.base64);var Y=new y(R,M,D);this.files[R]=Y}var l=r("./utf8"),c=r("./utils"),p=r("./stream/GenericWorker"),d=r("./stream/StreamHelper"),h=r("./defaults"),v=r("./compressedObject"),y=r("./zipObject"),g=r("./generate"),k=r("./nodejsUtils"),_=r("./nodejs/NodejsStreamInputAdapter"),x=function(R){R.slice(-1)==="/"&&(R=R.substring(0,R.length-1));var B=R.lastIndexOf("/");return 0<B?R.substring(0,B):""},S=function(R){return R.slice(-1)!=="/"&&(R+="/"),R},T=function(R,B){return B=B!==void 0?B:h.createFolders,R=S(R),this.files[R]||o.call(this,R,null,{dir:!0,createFolders:B}),this.files[R]};function I(R){return Object.prototype.toString.call(R)==="[object RegExp]"}var O={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(R){var B,L,V;for(B in this.files)V=this.files[B],(L=B.slice(this.root.length,B.length))&&B.slice(0,this.root.length)===this.root&&R(L,V)},filter:function(R){var B=[];return this.forEach(function(L,V){R(L,V)&&B.push(V)}),B},file:function(R,B,L){if(arguments.length!==1)return R=this.root+R,o.call(this,R,B,L),this;if(I(R)){var V=R;return this.filter(function(D,X){return!X.dir&&V.test(D)})}var q=this.files[this.root+R];return q&&!q.dir?q:null},folder:function(R){if(!R)return this;if(I(R))return this.filter(function(q,D){return D.dir&&R.test(q)});var B=this.root+R,L=T.call(this,B),V=this.clone();return V.root=L.name,V},remove:function(R){R=this.root+R;var B=this.files[R];if(B||(R.slice(-1)!=="/"&&(R+="/"),B=this.files[R]),B&&!B.dir)delete this.files[R];else for(var L=this.filter(function(q,D){return D.name.slice(0,R.length)===R}),V=0;V<L.length;V++)delete this.files[L[V].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(R){var B,L={};try{if((L=c.extend(R||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:l.utf8encode})).type=L.type.toLowerCase(),L.compression=L.compression.toUpperCase(),L.type==="binarystring"&&(L.type="string"),!L.type)throw new Error("No output type specified.");c.checkSupport(L.type),L.platform!=="darwin"&&L.platform!=="freebsd"&&L.platform!=="linux"&&L.platform!=="sunos"||(L.platform="UNIX"),L.platform==="win32"&&(L.platform="DOS");var V=L.comment||this.comment||"";B=g.generateWorker(this,L,V)}catch(q){(B=new p("error")).error(q)}return new d(B,L.type||"string",L.mimeType)},generateAsync:function(R,B){return this.generateInternalStream(R).accumulate(B)},generateNodeStream:function(R,B){return(R=R||{}).type||(R.type="nodebuffer"),this.generateInternalStream(R).toNodejsStream(B)}};i.exports=O},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(r,i,s){i.exports=r("stream")},{stream:void 0}],17:[function(r,i,s){var o=r("./DataReader");function l(c){o.call(this,c);for(var p=0;p<this.data.length;p++)c[p]=255&c[p]}r("../utils").inherits(l,o),l.prototype.byteAt=function(c){return this.data[this.zero+c]},l.prototype.lastIndexOfSignature=function(c){for(var p=c.charCodeAt(0),d=c.charCodeAt(1),h=c.charCodeAt(2),v=c.charCodeAt(3),y=this.length-4;0<=y;--y)if(this.data[y]===p&&this.data[y+1]===d&&this.data[y+2]===h&&this.data[y+3]===v)return y-this.zero;return-1},l.prototype.readAndCheckSignature=function(c){var p=c.charCodeAt(0),d=c.charCodeAt(1),h=c.charCodeAt(2),v=c.charCodeAt(3),y=this.readData(4);return p===y[0]&&d===y[1]&&h===y[2]&&v===y[3]},l.prototype.readData=function(c){if(this.checkOffset(c),c===0)return[];var p=this.data.slice(this.zero+this.index,this.zero+this.index+c);return this.index+=c,p},i.exports=l},{"../utils":32,"./DataReader":18}],18:[function(r,i,s){var o=r("../utils");function l(c){this.data=c,this.length=c.length,this.index=0,this.zero=0}l.prototype={checkOffset:function(c){this.checkIndex(this.index+c)},checkIndex:function(c){if(this.length<this.zero+c||c<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+c+"). Corrupted zip ?")},setIndex:function(c){this.checkIndex(c),this.index=c},skip:function(c){this.setIndex(this.index+c)},byteAt:function(){},readInt:function(c){var p,d=0;for(this.checkOffset(c),p=this.index+c-1;p>=this.index;p--)d=(d<<8)+this.byteAt(p);return this.index+=c,d},readString:function(c){return o.transformTo("string",this.readData(c))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var c=this.readInt(4);return new Date(Date.UTC(1980+(c>>25&127),(c>>21&15)-1,c>>16&31,c>>11&31,c>>5&63,(31&c)<<1))}},i.exports=l},{"../utils":32}],19:[function(r,i,s){var o=r("./Uint8ArrayReader");function l(c){o.call(this,c)}r("../utils").inherits(l,o),l.prototype.readData=function(c){this.checkOffset(c);var p=this.data.slice(this.zero+this.index,this.zero+this.index+c);return this.index+=c,p},i.exports=l},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,i,s){var o=r("./DataReader");function l(c){o.call(this,c)}r("../utils").inherits(l,o),l.prototype.byteAt=function(c){return this.data.charCodeAt(this.zero+c)},l.prototype.lastIndexOfSignature=function(c){return this.data.lastIndexOf(c)-this.zero},l.prototype.readAndCheckSignature=function(c){return c===this.readData(4)},l.prototype.readData=function(c){this.checkOffset(c);var p=this.data.slice(this.zero+this.index,this.zero+this.index+c);return this.index+=c,p},i.exports=l},{"../utils":32,"./DataReader":18}],21:[function(r,i,s){var o=r("./ArrayReader");function l(c){o.call(this,c)}r("../utils").inherits(l,o),l.prototype.readData=function(c){if(this.checkOffset(c),c===0)return new Uint8Array(0);var p=this.data.subarray(this.zero+this.index,this.zero+this.index+c);return this.index+=c,p},i.exports=l},{"../utils":32,"./ArrayReader":17}],22:[function(r,i,s){var o=r("../utils"),l=r("../support"),c=r("./ArrayReader"),p=r("./StringReader"),d=r("./NodeBufferReader"),h=r("./Uint8ArrayReader");i.exports=function(v){var y=o.getTypeOf(v);return o.checkSupport(y),y!=="string"||l.uint8array?y==="nodebuffer"?new d(v):l.uint8array?new h(o.transformTo("uint8array",v)):new c(o.transformTo("array",v)):new p(v)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(r,i,s){s.LOCAL_FILE_HEADER="PK",s.CENTRAL_FILE_HEADER="PK",s.CENTRAL_DIRECTORY_END="PK",s.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",s.ZIP64_CENTRAL_DIRECTORY_END="PK",s.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,i,s){var o=r("./GenericWorker"),l=r("../utils");function c(p){o.call(this,"ConvertWorker to "+p),this.destType=p}l.inherits(c,o),c.prototype.processChunk=function(p){this.push({data:l.transformTo(this.destType,p.data),meta:p.meta})},i.exports=c},{"../utils":32,"./GenericWorker":28}],25:[function(r,i,s){var o=r("./GenericWorker"),l=r("../crc32");function c(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(c,o),c.prototype.processChunk=function(p){this.streamInfo.crc32=l(p.data,this.streamInfo.crc32||0),this.push(p)},i.exports=c},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,i,s){var o=r("../utils"),l=r("./GenericWorker");function c(p){l.call(this,"DataLengthProbe for "+p),this.propName=p,this.withStreamInfo(p,0)}o.inherits(c,l),c.prototype.processChunk=function(p){if(p){var d=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=d+p.data.length}l.prototype.processChunk.call(this,p)},i.exports=c},{"../utils":32,"./GenericWorker":28}],27:[function(r,i,s){var o=r("../utils"),l=r("./GenericWorker");function c(p){l.call(this,"DataWorker");var d=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,p.then(function(h){d.dataIsReady=!0,d.data=h,d.max=h&&h.length||0,d.type=o.getTypeOf(h),d.isPaused||d._tickAndRepeat()},function(h){d.error(h)})}o.inherits(c,l),c.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this.data=null},c.prototype.resume=function(){return!!l.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},c.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},c.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var p=null,d=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":p=this.data.substring(this.index,d);break;case"uint8array":p=this.data.subarray(this.index,d);break;case"array":case"nodebuffer":p=this.data.slice(this.index,d)}return this.index=d,this.push({data:p,meta:{percent:this.max?this.index/this.max*100:0}})},i.exports=c},{"../utils":32,"./GenericWorker":28}],28:[function(r,i,s){function o(l){this.name=l||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(l){this.emit("data",l)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(l){this.emit("error",l)}return!0},error:function(l){return!this.isFinished&&(this.isPaused?this.generatedError=l:(this.isFinished=!0,this.emit("error",l),this.previous&&this.previous.error(l),this.cleanUp()),!0)},on:function(l,c){return this._listeners[l].push(c),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(l,c){if(this._listeners[l])for(var p=0;p<this._listeners[l].length;p++)this._listeners[l][p].call(this,c)},pipe:function(l){return l.registerPrevious(this)},registerPrevious:function(l){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=l.streamInfo,this.mergeStreamInfo(),this.previous=l;var c=this;return l.on("data",function(p){c.processChunk(p)}),l.on("end",function(){c.end()}),l.on("error",function(p){c.error(p)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var l=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),l=!0),this.previous&&this.previous.resume(),!l},flush:function(){},processChunk:function(l){this.push(l)},withStreamInfo:function(l,c){return this.extraStreamInfo[l]=c,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var l in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,l)&&(this.streamInfo[l]=this.extraStreamInfo[l])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var l="Worker "+this.name;return this.previous?this.previous+" -> "+l:l}},i.exports=o},{}],29:[function(r,i,s){var o=r("../utils"),l=r("./ConvertWorker"),c=r("./GenericWorker"),p=r("../base64"),d=r("../support"),h=r("../external"),v=null;if(d.nodestream)try{v=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function y(k,_){return new h.Promise(function(x,S){var T=[],I=k._internalType,O=k._outputType,R=k._mimeType;k.on("data",function(B,L){T.push(B),_&&_(L)}).on("error",function(B){T=[],S(B)}).on("end",function(){try{var B=function(L,V,q){switch(L){case"blob":return o.newBlob(o.transformTo("arraybuffer",V),q);case"base64":return p.encode(V);default:return o.transformTo(L,V)}}(O,function(L,V){var q,D=0,X=null,M=0;for(q=0;q<V.length;q++)M+=V[q].length;switch(L){case"string":return V.join("");case"array":return Array.prototype.concat.apply([],V);case"uint8array":for(X=new Uint8Array(M),q=0;q<V.length;q++)X.set(V[q],D),D+=V[q].length;return X;case"nodebuffer":return Buffer.concat(V);default:throw new Error("concat : unsupported type '"+L+"'")}}(I,T),R);x(B)}catch(L){S(L)}T=[]}).resume()})}function g(k,_,x){var S=_;switch(_){case"blob":case"arraybuffer":S="uint8array";break;case"base64":S="string"}try{this._internalType=S,this._outputType=_,this._mimeType=x,o.checkSupport(S),this._worker=k.pipe(new l(S)),k.lock()}catch(T){this._worker=new c("error"),this._worker.error(T)}}g.prototype={accumulate:function(k){return y(this,k)},on:function(k,_){var x=this;return k==="data"?this._worker.on(k,function(S){_.call(x,S.data,S.meta)}):this._worker.on(k,function(){o.delay(_,arguments,x)}),this},resume:function(){return o.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(k){if(o.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new v(this,{objectMode:this._outputType!=="nodebuffer"},k)}},i.exports=g},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(r,i,s){if(s.base64=!0,s.array=!0,s.string=!0,s.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",s.nodebuffer=typeof Buffer<"u",s.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")s.blob=!1;else{var o=new ArrayBuffer(0);try{s.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var l=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);l.append(o),s.blob=l.getBlob("application/zip").size===0}catch{s.blob=!1}}}try{s.nodestream=!!r("readable-stream").Readable}catch{s.nodestream=!1}},{"readable-stream":16}],31:[function(r,i,s){for(var o=r("./utils"),l=r("./support"),c=r("./nodejsUtils"),p=r("./stream/GenericWorker"),d=new Array(256),h=0;h<256;h++)d[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;d[254]=d[254]=1;function v(){p.call(this,"utf-8 decode"),this.leftOver=null}function y(){p.call(this,"utf-8 encode")}s.utf8encode=function(g){return l.nodebuffer?c.newBufferFrom(g,"utf-8"):function(k){var _,x,S,T,I,O=k.length,R=0;for(T=0;T<O;T++)(64512&(x=k.charCodeAt(T)))==55296&&T+1<O&&(64512&(S=k.charCodeAt(T+1)))==56320&&(x=65536+(x-55296<<10)+(S-56320),T++),R+=x<128?1:x<2048?2:x<65536?3:4;for(_=l.uint8array?new Uint8Array(R):new Array(R),T=I=0;I<R;T++)(64512&(x=k.charCodeAt(T)))==55296&&T+1<O&&(64512&(S=k.charCodeAt(T+1)))==56320&&(x=65536+(x-55296<<10)+(S-56320),T++),x<128?_[I++]=x:(x<2048?_[I++]=192|x>>>6:(x<65536?_[I++]=224|x>>>12:(_[I++]=240|x>>>18,_[I++]=128|x>>>12&63),_[I++]=128|x>>>6&63),_[I++]=128|63&x);return _}(g)},s.utf8decode=function(g){return l.nodebuffer?o.transformTo("nodebuffer",g).toString("utf-8"):function(k){var _,x,S,T,I=k.length,O=new Array(2*I);for(_=x=0;_<I;)if((S=k[_++])<128)O[x++]=S;else if(4<(T=d[S]))O[x++]=65533,_+=T-1;else{for(S&=T===2?31:T===3?15:7;1<T&&_<I;)S=S<<6|63&k[_++],T--;1<T?O[x++]=65533:S<65536?O[x++]=S:(S-=65536,O[x++]=55296|S>>10&1023,O[x++]=56320|1023&S)}return O.length!==x&&(O.subarray?O=O.subarray(0,x):O.length=x),o.applyFromCharCode(O)}(g=o.transformTo(l.uint8array?"uint8array":"array",g))},o.inherits(v,p),v.prototype.processChunk=function(g){var k=o.transformTo(l.uint8array?"uint8array":"array",g.data);if(this.leftOver&&this.leftOver.length){if(l.uint8array){var _=k;(k=new Uint8Array(_.length+this.leftOver.length)).set(this.leftOver,0),k.set(_,this.leftOver.length)}else k=this.leftOver.concat(k);this.leftOver=null}var x=function(T,I){var O;for((I=I||T.length)>T.length&&(I=T.length),O=I-1;0<=O&&(192&T[O])==128;)O--;return O<0||O===0?I:O+d[T[O]]>I?O:I}(k),S=k;x!==k.length&&(l.uint8array?(S=k.subarray(0,x),this.leftOver=k.subarray(x,k.length)):(S=k.slice(0,x),this.leftOver=k.slice(x,k.length))),this.push({data:s.utf8decode(S),meta:g.meta})},v.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=v,o.inherits(y,p),y.prototype.processChunk=function(g){this.push({data:s.utf8encode(g.data),meta:g.meta})},s.Utf8EncodeWorker=y},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,i,s){var o=r("./support"),l=r("./base64"),c=r("./nodejsUtils"),p=r("./external");function d(_){return _}function h(_,x){for(var S=0;S<_.length;++S)x[S]=255&_.charCodeAt(S);return x}r("setimmediate"),s.newBlob=function(_,x){s.checkSupport("blob");try{return new Blob([_],{type:x})}catch{try{var S=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return S.append(_),S.getBlob(x)}catch{throw new Error("Bug : can't construct the Blob.")}}};var v={stringifyByChunk:function(_,x,S){var T=[],I=0,O=_.length;if(O<=S)return String.fromCharCode.apply(null,_);for(;I<O;)x==="array"||x==="nodebuffer"?T.push(String.fromCharCode.apply(null,_.slice(I,Math.min(I+S,O)))):T.push(String.fromCharCode.apply(null,_.subarray(I,Math.min(I+S,O)))),I+=S;return T.join("")},stringifyByChar:function(_){for(var x="",S=0;S<_.length;S++)x+=String.fromCharCode(_[S]);return x},applyCanBeUsed:{uint8array:function(){try{return o.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return o.nodebuffer&&String.fromCharCode.apply(null,c.allocBuffer(1)).length===1}catch{return!1}}()}};function y(_){var x=65536,S=s.getTypeOf(_),T=!0;if(S==="uint8array"?T=v.applyCanBeUsed.uint8array:S==="nodebuffer"&&(T=v.applyCanBeUsed.nodebuffer),T)for(;1<x;)try{return v.stringifyByChunk(_,S,x)}catch{x=Math.floor(x/2)}return v.stringifyByChar(_)}function g(_,x){for(var S=0;S<_.length;S++)x[S]=_[S];return x}s.applyFromCharCode=y;var k={};k.string={string:d,array:function(_){return h(_,new Array(_.length))},arraybuffer:function(_){return k.string.uint8array(_).buffer},uint8array:function(_){return h(_,new Uint8Array(_.length))},nodebuffer:function(_){return h(_,c.allocBuffer(_.length))}},k.array={string:y,array:d,arraybuffer:function(_){return new Uint8Array(_).buffer},uint8array:function(_){return new Uint8Array(_)},nodebuffer:function(_){return c.newBufferFrom(_)}},k.arraybuffer={string:function(_){return y(new Uint8Array(_))},array:function(_){return g(new Uint8Array(_),new Array(_.byteLength))},arraybuffer:d,uint8array:function(_){return new Uint8Array(_)},nodebuffer:function(_){return c.newBufferFrom(new Uint8Array(_))}},k.uint8array={string:y,array:function(_){return g(_,new Array(_.length))},arraybuffer:function(_){return _.buffer},uint8array:d,nodebuffer:function(_){return c.newBufferFrom(_)}},k.nodebuffer={string:y,array:function(_){return g(_,new Array(_.length))},arraybuffer:function(_){return k.nodebuffer.uint8array(_).buffer},uint8array:function(_){return g(_,new Uint8Array(_.length))},nodebuffer:d},s.transformTo=function(_,x){if(x=x||"",!_)return x;s.checkSupport(_);var S=s.getTypeOf(x);return k[S][_](x)},s.resolve=function(_){for(var x=_.split("/"),S=[],T=0;T<x.length;T++){var I=x[T];I==="."||I===""&&T!==0&&T!==x.length-1||(I===".."?S.pop():S.push(I))}return S.join("/")},s.getTypeOf=function(_){return typeof _=="string"?"string":Object.prototype.toString.call(_)==="[object Array]"?"array":o.nodebuffer&&c.isBuffer(_)?"nodebuffer":o.uint8array&&_ instanceof Uint8Array?"uint8array":o.arraybuffer&&_ instanceof ArrayBuffer?"arraybuffer":void 0},s.checkSupport=function(_){if(!o[_.toLowerCase()])throw new Error(_+" is not supported by this platform")},s.MAX_VALUE_16BITS=65535,s.MAX_VALUE_32BITS=-1,s.pretty=function(_){var x,S,T="";for(S=0;S<(_||"").length;S++)T+="\\x"+((x=_.charCodeAt(S))<16?"0":"")+x.toString(16).toUpperCase();return T},s.delay=function(_,x,S){setImmediate(function(){_.apply(S||null,x||[])})},s.inherits=function(_,x){function S(){}S.prototype=x.prototype,_.prototype=new S},s.extend=function(){var _,x,S={};for(_=0;_<arguments.length;_++)for(x in arguments[_])Object.prototype.hasOwnProperty.call(arguments[_],x)&&S[x]===void 0&&(S[x]=arguments[_][x]);return S},s.prepareContent=function(_,x,S,T,I){return p.Promise.resolve(x).then(function(O){return o.blob&&(O instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(O))!==-1)&&typeof FileReader<"u"?new p.Promise(function(R,B){var L=new FileReader;L.onload=function(V){R(V.target.result)},L.onerror=function(V){B(V.target.error)},L.readAsArrayBuffer(O)}):O}).then(function(O){var R=s.getTypeOf(O);return R?(R==="arraybuffer"?O=s.transformTo("uint8array",O):R==="string"&&(I?O=l.decode(O):S&&T!==!0&&(O=function(B){return h(B,o.uint8array?new Uint8Array(B.length):new Array(B.length))}(O))),O):p.Promise.reject(new Error("Can't read the data of '"+_+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(r,i,s){var o=r("./reader/readerFor"),l=r("./utils"),c=r("./signature"),p=r("./zipEntry"),d=r("./support");function h(v){this.files=[],this.loadOptions=v}h.prototype={checkSignature:function(v){if(!this.reader.readAndCheckSignature(v)){this.reader.index-=4;var y=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+l.pretty(y)+", expected "+l.pretty(v)+")")}},isSignature:function(v,y){var g=this.reader.index;this.reader.setIndex(v);var k=this.reader.readString(4)===y;return this.reader.setIndex(g),k},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var v=this.reader.readData(this.zipCommentLength),y=d.uint8array?"uint8array":"array",g=l.transformTo(y,v);this.zipComment=this.loadOptions.decodeFileName(g)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var v,y,g,k=this.zip64EndOfCentralSize-44;0<k;)v=this.reader.readInt(2),y=this.reader.readInt(4),g=this.reader.readData(y),this.zip64ExtensibleData[v]={id:v,length:y,value:g}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var v,y;for(v=0;v<this.files.length;v++)y=this.files[v],this.reader.setIndex(y.localHeaderOffset),this.checkSignature(c.LOCAL_FILE_HEADER),y.readLocalPart(this.reader),y.handleUTF8(),y.processAttributes()},readCentralDir:function(){var v;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(c.CENTRAL_FILE_HEADER);)(v=new p({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(v);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var v=this.reader.lastIndexOfSignature(c.CENTRAL_DIRECTORY_END);if(v<0)throw this.isSignature(0,c.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(v);var y=v;if(this.checkSignature(c.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===l.MAX_VALUE_16BITS||this.diskWithCentralDirStart===l.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===l.MAX_VALUE_16BITS||this.centralDirRecords===l.MAX_VALUE_16BITS||this.centralDirSize===l.MAX_VALUE_32BITS||this.centralDirOffset===l.MAX_VALUE_32BITS){if(this.zip64=!0,(v=this.reader.lastIndexOfSignature(c.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(v),this.checkSignature(c.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,c.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(c.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(c.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var g=this.centralDirOffset+this.centralDirSize;this.zip64&&(g+=20,g+=12+this.zip64EndOfCentralSize);var k=y-g;if(0<k)this.isSignature(y,c.CENTRAL_FILE_HEADER)||(this.reader.zero=k);else if(k<0)throw new Error("Corrupted zip: missing "+Math.abs(k)+" bytes.")},prepareReader:function(v){this.reader=o(v)},load:function(v){this.prepareReader(v),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},i.exports=h},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(r,i,s){var o=r("./reader/readerFor"),l=r("./utils"),c=r("./compressedObject"),p=r("./crc32"),d=r("./utf8"),h=r("./compressions"),v=r("./support");function y(g,k){this.options=g,this.loadOptions=k}y.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(g){var k,_;if(g.skip(22),this.fileNameLength=g.readInt(2),_=g.readInt(2),this.fileName=g.readData(this.fileNameLength),g.skip(_),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((k=function(x){for(var S in h)if(Object.prototype.hasOwnProperty.call(h,S)&&h[S].magic===x)return h[S];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+l.pretty(this.compressionMethod)+" unknown (inner file : "+l.transformTo("string",this.fileName)+")");this.decompressed=new c(this.compressedSize,this.uncompressedSize,this.crc32,k,g.readData(this.compressedSize))},readCentralPart:function(g){this.versionMadeBy=g.readInt(2),g.skip(2),this.bitFlag=g.readInt(2),this.compressionMethod=g.readString(2),this.date=g.readDate(),this.crc32=g.readInt(4),this.compressedSize=g.readInt(4),this.uncompressedSize=g.readInt(4);var k=g.readInt(2);if(this.extraFieldsLength=g.readInt(2),this.fileCommentLength=g.readInt(2),this.diskNumberStart=g.readInt(2),this.internalFileAttributes=g.readInt(2),this.externalFileAttributes=g.readInt(4),this.localHeaderOffset=g.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");g.skip(k),this.readExtraFields(g),this.parseZIP64ExtraField(g),this.fileComment=g.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var g=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),g==0&&(this.dosPermissions=63&this.externalFileAttributes),g==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var g=o(this.extraFields[1].value);this.uncompressedSize===l.MAX_VALUE_32BITS&&(this.uncompressedSize=g.readInt(8)),this.compressedSize===l.MAX_VALUE_32BITS&&(this.compressedSize=g.readInt(8)),this.localHeaderOffset===l.MAX_VALUE_32BITS&&(this.localHeaderOffset=g.readInt(8)),this.diskNumberStart===l.MAX_VALUE_32BITS&&(this.diskNumberStart=g.readInt(4))}},readExtraFields:function(g){var k,_,x,S=g.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});g.index+4<S;)k=g.readInt(2),_=g.readInt(2),x=g.readData(_),this.extraFields[k]={id:k,length:_,value:x};g.setIndex(S)},handleUTF8:function(){var g=v.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=d.utf8decode(this.fileName),this.fileCommentStr=d.utf8decode(this.fileComment);else{var k=this.findExtraFieldUnicodePath();if(k!==null)this.fileNameStr=k;else{var _=l.transformTo(g,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(_)}var x=this.findExtraFieldUnicodeComment();if(x!==null)this.fileCommentStr=x;else{var S=l.transformTo(g,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(S)}}},findExtraFieldUnicodePath:function(){var g=this.extraFields[28789];if(g){var k=o(g.value);return k.readInt(1)!==1||p(this.fileName)!==k.readInt(4)?null:d.utf8decode(k.readData(g.length-5))}return null},findExtraFieldUnicodeComment:function(){var g=this.extraFields[25461];if(g){var k=o(g.value);return k.readInt(1)!==1||p(this.fileComment)!==k.readInt(4)?null:d.utf8decode(k.readData(g.length-5))}return null}},i.exports=y},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(r,i,s){function o(k,_,x){this.name=k,this.dir=x.dir,this.date=x.date,this.comment=x.comment,this.unixPermissions=x.unixPermissions,this.dosPermissions=x.dosPermissions,this._data=_,this._dataBinary=x.binary,this.options={compression:x.compression,compressionOptions:x.compressionOptions}}var l=r("./stream/StreamHelper"),c=r("./stream/DataWorker"),p=r("./utf8"),d=r("./compressedObject"),h=r("./stream/GenericWorker");o.prototype={internalStream:function(k){var _=null,x="string";try{if(!k)throw new Error("No output type specified.");var S=(x=k.toLowerCase())==="string"||x==="text";x!=="binarystring"&&x!=="text"||(x="string"),_=this._decompressWorker();var T=!this._dataBinary;T&&!S&&(_=_.pipe(new p.Utf8EncodeWorker)),!T&&S&&(_=_.pipe(new p.Utf8DecodeWorker))}catch(I){(_=new h("error")).error(I)}return new l(_,x,"")},async:function(k,_){return this.internalStream(k).accumulate(_)},nodeStream:function(k,_){return this.internalStream(k||"nodebuffer").toNodejsStream(_)},_compressWorker:function(k,_){if(this._data instanceof d&&this._data.compression.magic===k.magic)return this._data.getCompressedWorker();var x=this._decompressWorker();return this._dataBinary||(x=x.pipe(new p.Utf8EncodeWorker)),d.createWorkerFrom(x,k,_)},_decompressWorker:function(){return this._data instanceof d?this._data.getContentWorker():this._data instanceof h?this._data:new c(this._data)}};for(var v=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],y=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},g=0;g<v.length;g++)o.prototype[v[g]]=y;i.exports=o},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(r,i,s){(function(o){var l,c,p=o.MutationObserver||o.WebKitMutationObserver;if(p){var d=0,h=new p(k),v=o.document.createTextNode("");h.observe(v,{characterData:!0}),l=function(){v.data=d=++d%2}}else if(o.setImmediate||o.MessageChannel===void 0)l="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var _=o.document.createElement("script");_.onreadystatechange=function(){k(),_.onreadystatechange=null,_.parentNode.removeChild(_),_=null},o.document.documentElement.appendChild(_)}:function(){setTimeout(k,0)};else{var y=new o.MessageChannel;y.port1.onmessage=k,l=function(){y.port2.postMessage(0)}}var g=[];function k(){var _,x;c=!0;for(var S=g.length;S;){for(x=g,g=[],_=-1;++_<S;)x[_]();S=g.length}c=!1}i.exports=function(_){g.push(_)!==1||c||l()}}).call(this,typeof Jn<"u"?Jn:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(r,i,s){var o=r("immediate");function l(){}var c={},p=["REJECTED"],d=["FULFILLED"],h=["PENDING"];function v(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,S!==l&&_(this,S)}function y(S,T,I){this.promise=S,typeof T=="function"&&(this.onFulfilled=T,this.callFulfilled=this.otherCallFulfilled),typeof I=="function"&&(this.onRejected=I,this.callRejected=this.otherCallRejected)}function g(S,T,I){o(function(){var O;try{O=T(I)}catch(R){return c.reject(S,R)}O===S?c.reject(S,new TypeError("Cannot resolve promise with itself")):c.resolve(S,O)})}function k(S){var T=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof T=="function")return function(){T.apply(S,arguments)}}function _(S,T){var I=!1;function O(L){I||(I=!0,c.reject(S,L))}function R(L){I||(I=!0,c.resolve(S,L))}var B=x(function(){T(R,O)});B.status==="error"&&O(B.value)}function x(S,T){var I={};try{I.value=S(T),I.status="success"}catch(O){I.status="error",I.value=O}return I}(i.exports=v).prototype.finally=function(S){if(typeof S!="function")return this;var T=this.constructor;return this.then(function(I){return T.resolve(S()).then(function(){return I})},function(I){return T.resolve(S()).then(function(){throw I})})},v.prototype.catch=function(S){return this.then(null,S)},v.prototype.then=function(S,T){if(typeof S!="function"&&this.state===d||typeof T!="function"&&this.state===p)return this;var I=new this.constructor(l);return this.state!==h?g(I,this.state===d?S:T,this.outcome):this.queue.push(new y(I,S,T)),I},y.prototype.callFulfilled=function(S){c.resolve(this.promise,S)},y.prototype.otherCallFulfilled=function(S){g(this.promise,this.onFulfilled,S)},y.prototype.callRejected=function(S){c.reject(this.promise,S)},y.prototype.otherCallRejected=function(S){g(this.promise,this.onRejected,S)},c.resolve=function(S,T){var I=x(k,T);if(I.status==="error")return c.reject(S,I.value);var O=I.value;if(O)_(S,O);else{S.state=d,S.outcome=T;for(var R=-1,B=S.queue.length;++R<B;)S.queue[R].callFulfilled(T)}return S},c.reject=function(S,T){S.state=p,S.outcome=T;for(var I=-1,O=S.queue.length;++I<O;)S.queue[I].callRejected(T);return S},v.resolve=function(S){return S instanceof this?S:c.resolve(new this(l),S)},v.reject=function(S){var T=new this(l);return c.reject(T,S)},v.all=function(S){var T=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var I=S.length,O=!1;if(!I)return this.resolve([]);for(var R=new Array(I),B=0,L=-1,V=new this(l);++L<I;)q(S[L],L);return V;function q(D,X){T.resolve(D).then(function(M){R[X]=M,++B!==I||O||(O=!0,c.resolve(V,R))},function(M){O||(O=!0,c.reject(V,M))})}},v.race=function(S){var T=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var I=S.length,O=!1;if(!I)return this.resolve([]);for(var R=-1,B=new this(l);++R<I;)L=S[R],T.resolve(L).then(function(V){O||(O=!0,c.resolve(B,V))},function(V){O||(O=!0,c.reject(B,V))});var L;return B}},{immediate:36}],38:[function(r,i,s){var o={};(0,r("./lib/utils/common").assign)(o,r("./lib/deflate"),r("./lib/inflate"),r("./lib/zlib/constants")),i.exports=o},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(r,i,s){var o=r("./zlib/deflate"),l=r("./utils/common"),c=r("./utils/strings"),p=r("./zlib/messages"),d=r("./zlib/zstream"),h=Object.prototype.toString,v=0,y=-1,g=0,k=8;function _(S){if(!(this instanceof _))return new _(S);this.options=l.assign({level:y,method:k,chunkSize:16384,windowBits:15,memLevel:8,strategy:g,to:""},S||{});var T=this.options;T.raw&&0<T.windowBits?T.windowBits=-T.windowBits:T.gzip&&0<T.windowBits&&T.windowBits<16&&(T.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var I=o.deflateInit2(this.strm,T.level,T.method,T.windowBits,T.memLevel,T.strategy);if(I!==v)throw new Error(p[I]);if(T.header&&o.deflateSetHeader(this.strm,T.header),T.dictionary){var O;if(O=typeof T.dictionary=="string"?c.string2buf(T.dictionary):h.call(T.dictionary)==="[object ArrayBuffer]"?new Uint8Array(T.dictionary):T.dictionary,(I=o.deflateSetDictionary(this.strm,O))!==v)throw new Error(p[I]);this._dict_set=!0}}function x(S,T){var I=new _(T);if(I.push(S,!0),I.err)throw I.msg||p[I.err];return I.result}_.prototype.push=function(S,T){var I,O,R=this.strm,B=this.options.chunkSize;if(this.ended)return!1;O=T===~~T?T:T===!0?4:0,typeof S=="string"?R.input=c.string2buf(S):h.call(S)==="[object ArrayBuffer]"?R.input=new Uint8Array(S):R.input=S,R.next_in=0,R.avail_in=R.input.length;do{if(R.avail_out===0&&(R.output=new l.Buf8(B),R.next_out=0,R.avail_out=B),(I=o.deflate(R,O))!==1&&I!==v)return this.onEnd(I),!(this.ended=!0);R.avail_out!==0&&(R.avail_in!==0||O!==4&&O!==2)||(this.options.to==="string"?this.onData(c.buf2binstring(l.shrinkBuf(R.output,R.next_out))):this.onData(l.shrinkBuf(R.output,R.next_out)))}while((0<R.avail_in||R.avail_out===0)&&I!==1);return O===4?(I=o.deflateEnd(this.strm),this.onEnd(I),this.ended=!0,I===v):O!==2||(this.onEnd(v),!(R.avail_out=0))},_.prototype.onData=function(S){this.chunks.push(S)},_.prototype.onEnd=function(S){S===v&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=l.flattenChunks(this.chunks)),this.chunks=[],this.err=S,this.msg=this.strm.msg},s.Deflate=_,s.deflate=x,s.deflateRaw=function(S,T){return(T=T||{}).raw=!0,x(S,T)},s.gzip=function(S,T){return(T=T||{}).gzip=!0,x(S,T)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(r,i,s){var o=r("./zlib/inflate"),l=r("./utils/common"),c=r("./utils/strings"),p=r("./zlib/constants"),d=r("./zlib/messages"),h=r("./zlib/zstream"),v=r("./zlib/gzheader"),y=Object.prototype.toString;function g(_){if(!(this instanceof g))return new g(_);this.options=l.assign({chunkSize:16384,windowBits:0,to:""},_||{});var x=this.options;x.raw&&0<=x.windowBits&&x.windowBits<16&&(x.windowBits=-x.windowBits,x.windowBits===0&&(x.windowBits=-15)),!(0<=x.windowBits&&x.windowBits<16)||_&&_.windowBits||(x.windowBits+=32),15<x.windowBits&&x.windowBits<48&&!(15&x.windowBits)&&(x.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var S=o.inflateInit2(this.strm,x.windowBits);if(S!==p.Z_OK)throw new Error(d[S]);this.header=new v,o.inflateGetHeader(this.strm,this.header)}function k(_,x){var S=new g(x);if(S.push(_,!0),S.err)throw S.msg||d[S.err];return S.result}g.prototype.push=function(_,x){var S,T,I,O,R,B,L=this.strm,V=this.options.chunkSize,q=this.options.dictionary,D=!1;if(this.ended)return!1;T=x===~~x?x:x===!0?p.Z_FINISH:p.Z_NO_FLUSH,typeof _=="string"?L.input=c.binstring2buf(_):y.call(_)==="[object ArrayBuffer]"?L.input=new Uint8Array(_):L.input=_,L.next_in=0,L.avail_in=L.input.length;do{if(L.avail_out===0&&(L.output=new l.Buf8(V),L.next_out=0,L.avail_out=V),(S=o.inflate(L,p.Z_NO_FLUSH))===p.Z_NEED_DICT&&q&&(B=typeof q=="string"?c.string2buf(q):y.call(q)==="[object ArrayBuffer]"?new Uint8Array(q):q,S=o.inflateSetDictionary(this.strm,B)),S===p.Z_BUF_ERROR&&D===!0&&(S=p.Z_OK,D=!1),S!==p.Z_STREAM_END&&S!==p.Z_OK)return this.onEnd(S),!(this.ended=!0);L.next_out&&(L.avail_out!==0&&S!==p.Z_STREAM_END&&(L.avail_in!==0||T!==p.Z_FINISH&&T!==p.Z_SYNC_FLUSH)||(this.options.to==="string"?(I=c.utf8border(L.output,L.next_out),O=L.next_out-I,R=c.buf2string(L.output,I),L.next_out=O,L.avail_out=V-O,O&&l.arraySet(L.output,L.output,I,O,0),this.onData(R)):this.onData(l.shrinkBuf(L.output,L.next_out)))),L.avail_in===0&&L.avail_out===0&&(D=!0)}while((0<L.avail_in||L.avail_out===0)&&S!==p.Z_STREAM_END);return S===p.Z_STREAM_END&&(T=p.Z_FINISH),T===p.Z_FINISH?(S=o.inflateEnd(this.strm),this.onEnd(S),this.ended=!0,S===p.Z_OK):T!==p.Z_SYNC_FLUSH||(this.onEnd(p.Z_OK),!(L.avail_out=0))},g.prototype.onData=function(_){this.chunks.push(_)},g.prototype.onEnd=function(_){_===p.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=l.flattenChunks(this.chunks)),this.chunks=[],this.err=_,this.msg=this.strm.msg},s.Inflate=g,s.inflate=k,s.inflateRaw=function(_,x){return(x=x||{}).raw=!0,k(_,x)},s.ungzip=k},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(r,i,s){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";s.assign=function(p){for(var d=Array.prototype.slice.call(arguments,1);d.length;){var h=d.shift();if(h){if(typeof h!="object")throw new TypeError(h+"must be non-object");for(var v in h)h.hasOwnProperty(v)&&(p[v]=h[v])}}return p},s.shrinkBuf=function(p,d){return p.length===d?p:p.subarray?p.subarray(0,d):(p.length=d,p)};var l={arraySet:function(p,d,h,v,y){if(d.subarray&&p.subarray)p.set(d.subarray(h,h+v),y);else for(var g=0;g<v;g++)p[y+g]=d[h+g]},flattenChunks:function(p){var d,h,v,y,g,k;for(d=v=0,h=p.length;d<h;d++)v+=p[d].length;for(k=new Uint8Array(v),d=y=0,h=p.length;d<h;d++)g=p[d],k.set(g,y),y+=g.length;return k}},c={arraySet:function(p,d,h,v,y){for(var g=0;g<v;g++)p[y+g]=d[h+g]},flattenChunks:function(p){return[].concat.apply([],p)}};s.setTyped=function(p){p?(s.Buf8=Uint8Array,s.Buf16=Uint16Array,s.Buf32=Int32Array,s.assign(s,l)):(s.Buf8=Array,s.Buf16=Array,s.Buf32=Array,s.assign(s,c))},s.setTyped(o)},{}],42:[function(r,i,s){var o=r("./common"),l=!0,c=!0;try{String.fromCharCode.apply(null,[0])}catch{l=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{c=!1}for(var p=new o.Buf8(256),d=0;d<256;d++)p[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;function h(v,y){if(y<65537&&(v.subarray&&c||!v.subarray&&l))return String.fromCharCode.apply(null,o.shrinkBuf(v,y));for(var g="",k=0;k<y;k++)g+=String.fromCharCode(v[k]);return g}p[254]=p[254]=1,s.string2buf=function(v){var y,g,k,_,x,S=v.length,T=0;for(_=0;_<S;_++)(64512&(g=v.charCodeAt(_)))==55296&&_+1<S&&(64512&(k=v.charCodeAt(_+1)))==56320&&(g=65536+(g-55296<<10)+(k-56320),_++),T+=g<128?1:g<2048?2:g<65536?3:4;for(y=new o.Buf8(T),_=x=0;x<T;_++)(64512&(g=v.charCodeAt(_)))==55296&&_+1<S&&(64512&(k=v.charCodeAt(_+1)))==56320&&(g=65536+(g-55296<<10)+(k-56320),_++),g<128?y[x++]=g:(g<2048?y[x++]=192|g>>>6:(g<65536?y[x++]=224|g>>>12:(y[x++]=240|g>>>18,y[x++]=128|g>>>12&63),y[x++]=128|g>>>6&63),y[x++]=128|63&g);return y},s.buf2binstring=function(v){return h(v,v.length)},s.binstring2buf=function(v){for(var y=new o.Buf8(v.length),g=0,k=y.length;g<k;g++)y[g]=v.charCodeAt(g);return y},s.buf2string=function(v,y){var g,k,_,x,S=y||v.length,T=new Array(2*S);for(g=k=0;g<S;)if((_=v[g++])<128)T[k++]=_;else if(4<(x=p[_]))T[k++]=65533,g+=x-1;else{for(_&=x===2?31:x===3?15:7;1<x&&g<S;)_=_<<6|63&v[g++],x--;1<x?T[k++]=65533:_<65536?T[k++]=_:(_-=65536,T[k++]=55296|_>>10&1023,T[k++]=56320|1023&_)}return h(T,k)},s.utf8border=function(v,y){var g;for((y=y||v.length)>v.length&&(y=v.length),g=y-1;0<=g&&(192&v[g])==128;)g--;return g<0||g===0?y:g+p[v[g]]>y?g:y}},{"./common":41}],43:[function(r,i,s){i.exports=function(o,l,c,p){for(var d=65535&o|0,h=o>>>16&65535|0,v=0;c!==0;){for(c-=v=2e3<c?2e3:c;h=h+(d=d+l[p++]|0)|0,--v;);d%=65521,h%=65521}return d|h<<16|0}},{}],44:[function(r,i,s){i.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(r,i,s){var o=function(){for(var l,c=[],p=0;p<256;p++){l=p;for(var d=0;d<8;d++)l=1&l?3988292384^l>>>1:l>>>1;c[p]=l}return c}();i.exports=function(l,c,p,d){var h=o,v=d+p;l^=-1;for(var y=d;y<v;y++)l=l>>>8^h[255&(l^c[y])];return-1^l}},{}],46:[function(r,i,s){var o,l=r("../utils/common"),c=r("./trees"),p=r("./adler32"),d=r("./crc32"),h=r("./messages"),v=0,y=4,g=0,k=-2,_=-1,x=4,S=2,T=8,I=9,O=286,R=30,B=19,L=2*O+1,V=15,q=3,D=258,X=D+q+1,M=42,Y=113,w=1,F=2,_e=3,se=4;function pe(E,ue){return E.msg=h[ue],ue}function N(E){return(E<<1)-(4<E?9:0)}function Ee(E){for(var ue=E.length;0<=--ue;)E[ue]=0}function ie(E){var ue=E.state,H=ue.pending;H>E.avail_out&&(H=E.avail_out),H!==0&&(l.arraySet(E.output,ue.pending_buf,ue.pending_out,H,E.next_out),E.next_out+=H,ue.pending_out+=H,E.total_out+=H,E.avail_out-=H,ue.pending-=H,ue.pending===0&&(ue.pending_out=0))}function z(E,ue){c._tr_flush_block(E,0<=E.block_start?E.block_start:-1,E.strstart-E.block_start,ue),E.block_start=E.strstart,ie(E.strm)}function je(E,ue){E.pending_buf[E.pending++]=ue}function le(E,ue){E.pending_buf[E.pending++]=ue>>>8&255,E.pending_buf[E.pending++]=255&ue}function ne(E,ue){var H,$,C=E.max_chain_length,J=E.strstart,ge=E.prev_length,be=E.nice_match,ee=E.strstart>E.w_size-X?E.strstart-(E.w_size-X):0,re=E.window,he=E.w_mask,U=E.prev,oe=E.strstart+D,Ce=re[J+ge-1],Se=re[J+ge];E.prev_length>=E.good_match&&(C>>=2),be>E.lookahead&&(be=E.lookahead);do if(re[(H=ue)+ge]===Se&&re[H+ge-1]===Ce&&re[H]===re[J]&&re[++H]===re[J+1]){J+=2,H++;do;while(re[++J]===re[++H]&&re[++J]===re[++H]&&re[++J]===re[++H]&&re[++J]===re[++H]&&re[++J]===re[++H]&&re[++J]===re[++H]&&re[++J]===re[++H]&&re[++J]===re[++H]&&J<oe);if($=D-(oe-J),J=oe-D,ge<$){if(E.match_start=ue,be<=(ge=$))break;Ce=re[J+ge-1],Se=re[J+ge]}}while((ue=U[ue&he])>ee&&--C!=0);return ge<=E.lookahead?ge:E.lookahead}function Je(E){var ue,H,$,C,J,ge,be,ee,re,he,U=E.w_size;do{if(C=E.window_size-E.lookahead-E.strstart,E.strstart>=U+(U-X)){for(l.arraySet(E.window,E.window,U,U,0),E.match_start-=U,E.strstart-=U,E.block_start-=U,ue=H=E.hash_size;$=E.head[--ue],E.head[ue]=U<=$?$-U:0,--H;);for(ue=H=U;$=E.prev[--ue],E.prev[ue]=U<=$?$-U:0,--H;);C+=U}if(E.strm.avail_in===0)break;if(ge=E.strm,be=E.window,ee=E.strstart+E.lookahead,re=C,he=void 0,he=ge.avail_in,re<he&&(he=re),H=he===0?0:(ge.avail_in-=he,l.arraySet(be,ge.input,ge.next_in,he,ee),ge.state.wrap===1?ge.adler=p(ge.adler,be,he,ee):ge.state.wrap===2&&(ge.adler=d(ge.adler,be,he,ee)),ge.next_in+=he,ge.total_in+=he,he),E.lookahead+=H,E.lookahead+E.insert>=q)for(J=E.strstart-E.insert,E.ins_h=E.window[J],E.ins_h=(E.ins_h<<E.hash_shift^E.window[J+1])&E.hash_mask;E.insert&&(E.ins_h=(E.ins_h<<E.hash_shift^E.window[J+q-1])&E.hash_mask,E.prev[J&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=J,J++,E.insert--,!(E.lookahead+E.insert<q)););}while(E.lookahead<X&&E.strm.avail_in!==0)}function Ke(E,ue){for(var H,$;;){if(E.lookahead<X){if(Je(E),E.lookahead<X&&ue===v)return w;if(E.lookahead===0)break}if(H=0,E.lookahead>=q&&(E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+q-1])&E.hash_mask,H=E.prev[E.strstart&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=E.strstart),H!==0&&E.strstart-H<=E.w_size-X&&(E.match_length=ne(E,H)),E.match_length>=q)if($=c._tr_tally(E,E.strstart-E.match_start,E.match_length-q),E.lookahead-=E.match_length,E.match_length<=E.max_lazy_match&&E.lookahead>=q){for(E.match_length--;E.strstart++,E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+q-1])&E.hash_mask,H=E.prev[E.strstart&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=E.strstart,--E.match_length!=0;);E.strstart++}else E.strstart+=E.match_length,E.match_length=0,E.ins_h=E.window[E.strstart],E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+1])&E.hash_mask;else $=c._tr_tally(E,0,E.window[E.strstart]),E.lookahead--,E.strstart++;if($&&(z(E,!1),E.strm.avail_out===0))return w}return E.insert=E.strstart<q-1?E.strstart:q-1,ue===y?(z(E,!0),E.strm.avail_out===0?_e:se):E.last_lit&&(z(E,!1),E.strm.avail_out===0)?w:F}function ce(E,ue){for(var H,$,C;;){if(E.lookahead<X){if(Je(E),E.lookahead<X&&ue===v)return w;if(E.lookahead===0)break}if(H=0,E.lookahead>=q&&(E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+q-1])&E.hash_mask,H=E.prev[E.strstart&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=E.strstart),E.prev_length=E.match_length,E.prev_match=E.match_start,E.match_length=q-1,H!==0&&E.prev_length<E.max_lazy_match&&E.strstart-H<=E.w_size-X&&(E.match_length=ne(E,H),E.match_length<=5&&(E.strategy===1||E.match_length===q&&4096<E.strstart-E.match_start)&&(E.match_length=q-1)),E.prev_length>=q&&E.match_length<=E.prev_length){for(C=E.strstart+E.lookahead-q,$=c._tr_tally(E,E.strstart-1-E.prev_match,E.prev_length-q),E.lookahead-=E.prev_length-1,E.prev_length-=2;++E.strstart<=C&&(E.ins_h=(E.ins_h<<E.hash_shift^E.window[E.strstart+q-1])&E.hash_mask,H=E.prev[E.strstart&E.w_mask]=E.head[E.ins_h],E.head[E.ins_h]=E.strstart),--E.prev_length!=0;);if(E.match_available=0,E.match_length=q-1,E.strstart++,$&&(z(E,!1),E.strm.avail_out===0))return w}else if(E.match_available){if(($=c._tr_tally(E,0,E.window[E.strstart-1]))&&z(E,!1),E.strstart++,E.lookahead--,E.strm.avail_out===0)return w}else E.match_available=1,E.strstart++,E.lookahead--}return E.match_available&&($=c._tr_tally(E,0,E.window[E.strstart-1]),E.match_available=0),E.insert=E.strstart<q-1?E.strstart:q-1,ue===y?(z(E,!0),E.strm.avail_out===0?_e:se):E.last_lit&&(z(E,!1),E.strm.avail_out===0)?w:F}function Oe(E,ue,H,$,C){this.good_length=E,this.max_lazy=ue,this.nice_length=H,this.max_chain=$,this.func=C}function ve(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=T,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new l.Buf16(2*L),this.dyn_dtree=new l.Buf16(2*(2*R+1)),this.bl_tree=new l.Buf16(2*(2*B+1)),Ee(this.dyn_ltree),Ee(this.dyn_dtree),Ee(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new l.Buf16(V+1),this.heap=new l.Buf16(2*O+1),Ee(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new l.Buf16(2*O+1),Ee(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Re(E){var ue;return E&&E.state?(E.total_in=E.total_out=0,E.data_type=S,(ue=E.state).pending=0,ue.pending_out=0,ue.wrap<0&&(ue.wrap=-ue.wrap),ue.status=ue.wrap?M:Y,E.adler=ue.wrap===2?0:1,ue.last_flush=v,c._tr_init(ue),g):pe(E,k)}function Ge(E){var ue=Re(E);return ue===g&&function(H){H.window_size=2*H.w_size,Ee(H.head),H.max_lazy_match=o[H.level].max_lazy,H.good_match=o[H.level].good_length,H.nice_match=o[H.level].nice_length,H.max_chain_length=o[H.level].max_chain,H.strstart=0,H.block_start=0,H.lookahead=0,H.insert=0,H.match_length=H.prev_length=q-1,H.match_available=0,H.ins_h=0}(E.state),ue}function Ze(E,ue,H,$,C,J){if(!E)return k;var ge=1;if(ue===_&&(ue=6),$<0?(ge=0,$=-$):15<$&&(ge=2,$-=16),C<1||I<C||H!==T||$<8||15<$||ue<0||9<ue||J<0||x<J)return pe(E,k);$===8&&($=9);var be=new ve;return(E.state=be).strm=E,be.wrap=ge,be.gzhead=null,be.w_bits=$,be.w_size=1<<be.w_bits,be.w_mask=be.w_size-1,be.hash_bits=C+7,be.hash_size=1<<be.hash_bits,be.hash_mask=be.hash_size-1,be.hash_shift=~~((be.hash_bits+q-1)/q),be.window=new l.Buf8(2*be.w_size),be.head=new l.Buf16(be.hash_size),be.prev=new l.Buf16(be.w_size),be.lit_bufsize=1<<C+6,be.pending_buf_size=4*be.lit_bufsize,be.pending_buf=new l.Buf8(be.pending_buf_size),be.d_buf=1*be.lit_bufsize,be.l_buf=3*be.lit_bufsize,be.level=ue,be.strategy=J,be.method=H,Ge(E)}o=[new Oe(0,0,0,0,function(E,ue){var H=65535;for(H>E.pending_buf_size-5&&(H=E.pending_buf_size-5);;){if(E.lookahead<=1){if(Je(E),E.lookahead===0&&ue===v)return w;if(E.lookahead===0)break}E.strstart+=E.lookahead,E.lookahead=0;var $=E.block_start+H;if((E.strstart===0||E.strstart>=$)&&(E.lookahead=E.strstart-$,E.strstart=$,z(E,!1),E.strm.avail_out===0)||E.strstart-E.block_start>=E.w_size-X&&(z(E,!1),E.strm.avail_out===0))return w}return E.insert=0,ue===y?(z(E,!0),E.strm.avail_out===0?_e:se):(E.strstart>E.block_start&&(z(E,!1),E.strm.avail_out),w)}),new Oe(4,4,8,4,Ke),new Oe(4,5,16,8,Ke),new Oe(4,6,32,32,Ke),new Oe(4,4,16,16,ce),new Oe(8,16,32,32,ce),new Oe(8,16,128,128,ce),new Oe(8,32,128,256,ce),new Oe(32,128,258,1024,ce),new Oe(32,258,258,4096,ce)],s.deflateInit=function(E,ue){return Ze(E,ue,T,15,8,0)},s.deflateInit2=Ze,s.deflateReset=Ge,s.deflateResetKeep=Re,s.deflateSetHeader=function(E,ue){return E&&E.state?E.state.wrap!==2?k:(E.state.gzhead=ue,g):k},s.deflate=function(E,ue){var H,$,C,J;if(!E||!E.state||5<ue||ue<0)return E?pe(E,k):k;if($=E.state,!E.output||!E.input&&E.avail_in!==0||$.status===666&&ue!==y)return pe(E,E.avail_out===0?-5:k);if($.strm=E,H=$.last_flush,$.last_flush=ue,$.status===M)if($.wrap===2)E.adler=0,je($,31),je($,139),je($,8),$.gzhead?(je($,($.gzhead.text?1:0)+($.gzhead.hcrc?2:0)+($.gzhead.extra?4:0)+($.gzhead.name?8:0)+($.gzhead.comment?16:0)),je($,255&$.gzhead.time),je($,$.gzhead.time>>8&255),je($,$.gzhead.time>>16&255),je($,$.gzhead.time>>24&255),je($,$.level===9?2:2<=$.strategy||$.level<2?4:0),je($,255&$.gzhead.os),$.gzhead.extra&&$.gzhead.extra.length&&(je($,255&$.gzhead.extra.length),je($,$.gzhead.extra.length>>8&255)),$.gzhead.hcrc&&(E.adler=d(E.adler,$.pending_buf,$.pending,0)),$.gzindex=0,$.status=69):(je($,0),je($,0),je($,0),je($,0),je($,0),je($,$.level===9?2:2<=$.strategy||$.level<2?4:0),je($,3),$.status=Y);else{var ge=T+($.w_bits-8<<4)<<8;ge|=(2<=$.strategy||$.level<2?0:$.level<6?1:$.level===6?2:3)<<6,$.strstart!==0&&(ge|=32),ge+=31-ge%31,$.status=Y,le($,ge),$.strstart!==0&&(le($,E.adler>>>16),le($,65535&E.adler)),E.adler=1}if($.status===69)if($.gzhead.extra){for(C=$.pending;$.gzindex<(65535&$.gzhead.extra.length)&&($.pending!==$.pending_buf_size||($.gzhead.hcrc&&$.pending>C&&(E.adler=d(E.adler,$.pending_buf,$.pending-C,C)),ie(E),C=$.pending,$.pending!==$.pending_buf_size));)je($,255&$.gzhead.extra[$.gzindex]),$.gzindex++;$.gzhead.hcrc&&$.pending>C&&(E.adler=d(E.adler,$.pending_buf,$.pending-C,C)),$.gzindex===$.gzhead.extra.length&&($.gzindex=0,$.status=73)}else $.status=73;if($.status===73)if($.gzhead.name){C=$.pending;do{if($.pending===$.pending_buf_size&&($.gzhead.hcrc&&$.pending>C&&(E.adler=d(E.adler,$.pending_buf,$.pending-C,C)),ie(E),C=$.pending,$.pending===$.pending_buf_size)){J=1;break}J=$.gzindex<$.gzhead.name.length?255&$.gzhead.name.charCodeAt($.gzindex++):0,je($,J)}while(J!==0);$.gzhead.hcrc&&$.pending>C&&(E.adler=d(E.adler,$.pending_buf,$.pending-C,C)),J===0&&($.gzindex=0,$.status=91)}else $.status=91;if($.status===91)if($.gzhead.comment){C=$.pending;do{if($.pending===$.pending_buf_size&&($.gzhead.hcrc&&$.pending>C&&(E.adler=d(E.adler,$.pending_buf,$.pending-C,C)),ie(E),C=$.pending,$.pending===$.pending_buf_size)){J=1;break}J=$.gzindex<$.gzhead.comment.length?255&$.gzhead.comment.charCodeAt($.gzindex++):0,je($,J)}while(J!==0);$.gzhead.hcrc&&$.pending>C&&(E.adler=d(E.adler,$.pending_buf,$.pending-C,C)),J===0&&($.status=103)}else $.status=103;if($.status===103&&($.gzhead.hcrc?($.pending+2>$.pending_buf_size&&ie(E),$.pending+2<=$.pending_buf_size&&(je($,255&E.adler),je($,E.adler>>8&255),E.adler=0,$.status=Y)):$.status=Y),$.pending!==0){if(ie(E),E.avail_out===0)return $.last_flush=-1,g}else if(E.avail_in===0&&N(ue)<=N(H)&&ue!==y)return pe(E,-5);if($.status===666&&E.avail_in!==0)return pe(E,-5);if(E.avail_in!==0||$.lookahead!==0||ue!==v&&$.status!==666){var be=$.strategy===2?function(ee,re){for(var he;;){if(ee.lookahead===0&&(Je(ee),ee.lookahead===0)){if(re===v)return w;break}if(ee.match_length=0,he=c._tr_tally(ee,0,ee.window[ee.strstart]),ee.lookahead--,ee.strstart++,he&&(z(ee,!1),ee.strm.avail_out===0))return w}return ee.insert=0,re===y?(z(ee,!0),ee.strm.avail_out===0?_e:se):ee.last_lit&&(z(ee,!1),ee.strm.avail_out===0)?w:F}($,ue):$.strategy===3?function(ee,re){for(var he,U,oe,Ce,Se=ee.window;;){if(ee.lookahead<=D){if(Je(ee),ee.lookahead<=D&&re===v)return w;if(ee.lookahead===0)break}if(ee.match_length=0,ee.lookahead>=q&&0<ee.strstart&&(U=Se[oe=ee.strstart-1])===Se[++oe]&&U===Se[++oe]&&U===Se[++oe]){Ce=ee.strstart+D;do;while(U===Se[++oe]&&U===Se[++oe]&&U===Se[++oe]&&U===Se[++oe]&&U===Se[++oe]&&U===Se[++oe]&&U===Se[++oe]&&U===Se[++oe]&&oe<Ce);ee.match_length=D-(Ce-oe),ee.match_length>ee.lookahead&&(ee.match_length=ee.lookahead)}if(ee.match_length>=q?(he=c._tr_tally(ee,1,ee.match_length-q),ee.lookahead-=ee.match_length,ee.strstart+=ee.match_length,ee.match_length=0):(he=c._tr_tally(ee,0,ee.window[ee.strstart]),ee.lookahead--,ee.strstart++),he&&(z(ee,!1),ee.strm.avail_out===0))return w}return ee.insert=0,re===y?(z(ee,!0),ee.strm.avail_out===0?_e:se):ee.last_lit&&(z(ee,!1),ee.strm.avail_out===0)?w:F}($,ue):o[$.level].func($,ue);if(be!==_e&&be!==se||($.status=666),be===w||be===_e)return E.avail_out===0&&($.last_flush=-1),g;if(be===F&&(ue===1?c._tr_align($):ue!==5&&(c._tr_stored_block($,0,0,!1),ue===3&&(Ee($.head),$.lookahead===0&&($.strstart=0,$.block_start=0,$.insert=0))),ie(E),E.avail_out===0))return $.last_flush=-1,g}return ue!==y?g:$.wrap<=0?1:($.wrap===2?(je($,255&E.adler),je($,E.adler>>8&255),je($,E.adler>>16&255),je($,E.adler>>24&255),je($,255&E.total_in),je($,E.total_in>>8&255),je($,E.total_in>>16&255),je($,E.total_in>>24&255)):(le($,E.adler>>>16),le($,65535&E.adler)),ie(E),0<$.wrap&&($.wrap=-$.wrap),$.pending!==0?g:1)},s.deflateEnd=function(E){var ue;return E&&E.state?(ue=E.state.status)!==M&&ue!==69&&ue!==73&&ue!==91&&ue!==103&&ue!==Y&&ue!==666?pe(E,k):(E.state=null,ue===Y?pe(E,-3):g):k},s.deflateSetDictionary=function(E,ue){var H,$,C,J,ge,be,ee,re,he=ue.length;if(!E||!E.state||(J=(H=E.state).wrap)===2||J===1&&H.status!==M||H.lookahead)return k;for(J===1&&(E.adler=p(E.adler,ue,he,0)),H.wrap=0,he>=H.w_size&&(J===0&&(Ee(H.head),H.strstart=0,H.block_start=0,H.insert=0),re=new l.Buf8(H.w_size),l.arraySet(re,ue,he-H.w_size,H.w_size,0),ue=re,he=H.w_size),ge=E.avail_in,be=E.next_in,ee=E.input,E.avail_in=he,E.next_in=0,E.input=ue,Je(H);H.lookahead>=q;){for($=H.strstart,C=H.lookahead-(q-1);H.ins_h=(H.ins_h<<H.hash_shift^H.window[$+q-1])&H.hash_mask,H.prev[$&H.w_mask]=H.head[H.ins_h],H.head[H.ins_h]=$,$++,--C;);H.strstart=$,H.lookahead=q-1,Je(H)}return H.strstart+=H.lookahead,H.block_start=H.strstart,H.insert=H.lookahead,H.lookahead=0,H.match_length=H.prev_length=q-1,H.match_available=0,E.next_in=be,E.input=ee,E.avail_in=ge,H.wrap=J,g},s.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(r,i,s){i.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(r,i,s){i.exports=function(o,l){var c,p,d,h,v,y,g,k,_,x,S,T,I,O,R,B,L,V,q,D,X,M,Y,w,F;c=o.state,p=o.next_in,w=o.input,d=p+(o.avail_in-5),h=o.next_out,F=o.output,v=h-(l-o.avail_out),y=h+(o.avail_out-257),g=c.dmax,k=c.wsize,_=c.whave,x=c.wnext,S=c.window,T=c.hold,I=c.bits,O=c.lencode,R=c.distcode,B=(1<<c.lenbits)-1,L=(1<<c.distbits)-1;e:do{I<15&&(T+=w[p++]<<I,I+=8,T+=w[p++]<<I,I+=8),V=O[T&B];t:for(;;){if(T>>>=q=V>>>24,I-=q,(q=V>>>16&255)===0)F[h++]=65535&V;else{if(!(16&q)){if(!(64&q)){V=O[(65535&V)+(T&(1<<q)-1)];continue t}if(32&q){c.mode=12;break e}o.msg="invalid literal/length code",c.mode=30;break e}D=65535&V,(q&=15)&&(I<q&&(T+=w[p++]<<I,I+=8),D+=T&(1<<q)-1,T>>>=q,I-=q),I<15&&(T+=w[p++]<<I,I+=8,T+=w[p++]<<I,I+=8),V=R[T&L];n:for(;;){if(T>>>=q=V>>>24,I-=q,!(16&(q=V>>>16&255))){if(!(64&q)){V=R[(65535&V)+(T&(1<<q)-1)];continue n}o.msg="invalid distance code",c.mode=30;break e}if(X=65535&V,I<(q&=15)&&(T+=w[p++]<<I,(I+=8)<q&&(T+=w[p++]<<I,I+=8)),g<(X+=T&(1<<q)-1)){o.msg="invalid distance too far back",c.mode=30;break e}if(T>>>=q,I-=q,(q=h-v)<X){if(_<(q=X-q)&&c.sane){o.msg="invalid distance too far back",c.mode=30;break e}if(Y=S,(M=0)===x){if(M+=k-q,q<D){for(D-=q;F[h++]=S[M++],--q;);M=h-X,Y=F}}else if(x<q){if(M+=k+x-q,(q-=x)<D){for(D-=q;F[h++]=S[M++],--q;);if(M=0,x<D){for(D-=q=x;F[h++]=S[M++],--q;);M=h-X,Y=F}}}else if(M+=x-q,q<D){for(D-=q;F[h++]=S[M++],--q;);M=h-X,Y=F}for(;2<D;)F[h++]=Y[M++],F[h++]=Y[M++],F[h++]=Y[M++],D-=3;D&&(F[h++]=Y[M++],1<D&&(F[h++]=Y[M++]))}else{for(M=h-X;F[h++]=F[M++],F[h++]=F[M++],F[h++]=F[M++],2<(D-=3););D&&(F[h++]=F[M++],1<D&&(F[h++]=F[M++]))}break}}break}}while(p<d&&h<y);p-=D=I>>3,T&=(1<<(I-=D<<3))-1,o.next_in=p,o.next_out=h,o.avail_in=p<d?d-p+5:5-(p-d),o.avail_out=h<y?y-h+257:257-(h-y),c.hold=T,c.bits=I}},{}],49:[function(r,i,s){var o=r("../utils/common"),l=r("./adler32"),c=r("./crc32"),p=r("./inffast"),d=r("./inftrees"),h=1,v=2,y=0,g=-2,k=1,_=852,x=592;function S(M){return(M>>>24&255)+(M>>>8&65280)+((65280&M)<<8)+((255&M)<<24)}function T(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function I(M){var Y;return M&&M.state?(Y=M.state,M.total_in=M.total_out=Y.total=0,M.msg="",Y.wrap&&(M.adler=1&Y.wrap),Y.mode=k,Y.last=0,Y.havedict=0,Y.dmax=32768,Y.head=null,Y.hold=0,Y.bits=0,Y.lencode=Y.lendyn=new o.Buf32(_),Y.distcode=Y.distdyn=new o.Buf32(x),Y.sane=1,Y.back=-1,y):g}function O(M){var Y;return M&&M.state?((Y=M.state).wsize=0,Y.whave=0,Y.wnext=0,I(M)):g}function R(M,Y){var w,F;return M&&M.state?(F=M.state,Y<0?(w=0,Y=-Y):(w=1+(Y>>4),Y<48&&(Y&=15)),Y&&(Y<8||15<Y)?g:(F.window!==null&&F.wbits!==Y&&(F.window=null),F.wrap=w,F.wbits=Y,O(M))):g}function B(M,Y){var w,F;return M?(F=new T,(M.state=F).window=null,(w=R(M,Y))!==y&&(M.state=null),w):g}var L,V,q=!0;function D(M){if(q){var Y;for(L=new o.Buf32(512),V=new o.Buf32(32),Y=0;Y<144;)M.lens[Y++]=8;for(;Y<256;)M.lens[Y++]=9;for(;Y<280;)M.lens[Y++]=7;for(;Y<288;)M.lens[Y++]=8;for(d(h,M.lens,0,288,L,0,M.work,{bits:9}),Y=0;Y<32;)M.lens[Y++]=5;d(v,M.lens,0,32,V,0,M.work,{bits:5}),q=!1}M.lencode=L,M.lenbits=9,M.distcode=V,M.distbits=5}function X(M,Y,w,F){var _e,se=M.state;return se.window===null&&(se.wsize=1<<se.wbits,se.wnext=0,se.whave=0,se.window=new o.Buf8(se.wsize)),F>=se.wsize?(o.arraySet(se.window,Y,w-se.wsize,se.wsize,0),se.wnext=0,se.whave=se.wsize):(F<(_e=se.wsize-se.wnext)&&(_e=F),o.arraySet(se.window,Y,w-F,_e,se.wnext),(F-=_e)?(o.arraySet(se.window,Y,w-F,F,0),se.wnext=F,se.whave=se.wsize):(se.wnext+=_e,se.wnext===se.wsize&&(se.wnext=0),se.whave<se.wsize&&(se.whave+=_e))),0}s.inflateReset=O,s.inflateReset2=R,s.inflateResetKeep=I,s.inflateInit=function(M){return B(M,15)},s.inflateInit2=B,s.inflate=function(M,Y){var w,F,_e,se,pe,N,Ee,ie,z,je,le,ne,Je,Ke,ce,Oe,ve,Re,Ge,Ze,E,ue,H,$,C=0,J=new o.Buf8(4),ge=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!M||!M.state||!M.output||!M.input&&M.avail_in!==0)return g;(w=M.state).mode===12&&(w.mode=13),pe=M.next_out,_e=M.output,Ee=M.avail_out,se=M.next_in,F=M.input,N=M.avail_in,ie=w.hold,z=w.bits,je=N,le=Ee,ue=y;e:for(;;)switch(w.mode){case k:if(w.wrap===0){w.mode=13;break}for(;z<16;){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}if(2&w.wrap&&ie===35615){J[w.check=0]=255&ie,J[1]=ie>>>8&255,w.check=c(w.check,J,2,0),z=ie=0,w.mode=2;break}if(w.flags=0,w.head&&(w.head.done=!1),!(1&w.wrap)||(((255&ie)<<8)+(ie>>8))%31){M.msg="incorrect header check",w.mode=30;break}if((15&ie)!=8){M.msg="unknown compression method",w.mode=30;break}if(z-=4,E=8+(15&(ie>>>=4)),w.wbits===0)w.wbits=E;else if(E>w.wbits){M.msg="invalid window size",w.mode=30;break}w.dmax=1<<E,M.adler=w.check=1,w.mode=512&ie?10:12,z=ie=0;break;case 2:for(;z<16;){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}if(w.flags=ie,(255&w.flags)!=8){M.msg="unknown compression method",w.mode=30;break}if(57344&w.flags){M.msg="unknown header flags set",w.mode=30;break}w.head&&(w.head.text=ie>>8&1),512&w.flags&&(J[0]=255&ie,J[1]=ie>>>8&255,w.check=c(w.check,J,2,0)),z=ie=0,w.mode=3;case 3:for(;z<32;){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}w.head&&(w.head.time=ie),512&w.flags&&(J[0]=255&ie,J[1]=ie>>>8&255,J[2]=ie>>>16&255,J[3]=ie>>>24&255,w.check=c(w.check,J,4,0)),z=ie=0,w.mode=4;case 4:for(;z<16;){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}w.head&&(w.head.xflags=255&ie,w.head.os=ie>>8),512&w.flags&&(J[0]=255&ie,J[1]=ie>>>8&255,w.check=c(w.check,J,2,0)),z=ie=0,w.mode=5;case 5:if(1024&w.flags){for(;z<16;){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}w.length=ie,w.head&&(w.head.extra_len=ie),512&w.flags&&(J[0]=255&ie,J[1]=ie>>>8&255,w.check=c(w.check,J,2,0)),z=ie=0}else w.head&&(w.head.extra=null);w.mode=6;case 6:if(1024&w.flags&&(N<(ne=w.length)&&(ne=N),ne&&(w.head&&(E=w.head.extra_len-w.length,w.head.extra||(w.head.extra=new Array(w.head.extra_len)),o.arraySet(w.head.extra,F,se,ne,E)),512&w.flags&&(w.check=c(w.check,F,ne,se)),N-=ne,se+=ne,w.length-=ne),w.length))break e;w.length=0,w.mode=7;case 7:if(2048&w.flags){if(N===0)break e;for(ne=0;E=F[se+ne++],w.head&&E&&w.length<65536&&(w.head.name+=String.fromCharCode(E)),E&&ne<N;);if(512&w.flags&&(w.check=c(w.check,F,ne,se)),N-=ne,se+=ne,E)break e}else w.head&&(w.head.name=null);w.length=0,w.mode=8;case 8:if(4096&w.flags){if(N===0)break e;for(ne=0;E=F[se+ne++],w.head&&E&&w.length<65536&&(w.head.comment+=String.fromCharCode(E)),E&&ne<N;);if(512&w.flags&&(w.check=c(w.check,F,ne,se)),N-=ne,se+=ne,E)break e}else w.head&&(w.head.comment=null);w.mode=9;case 9:if(512&w.flags){for(;z<16;){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}if(ie!==(65535&w.check)){M.msg="header crc mismatch",w.mode=30;break}z=ie=0}w.head&&(w.head.hcrc=w.flags>>9&1,w.head.done=!0),M.adler=w.check=0,w.mode=12;break;case 10:for(;z<32;){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}M.adler=w.check=S(ie),z=ie=0,w.mode=11;case 11:if(w.havedict===0)return M.next_out=pe,M.avail_out=Ee,M.next_in=se,M.avail_in=N,w.hold=ie,w.bits=z,2;M.adler=w.check=1,w.mode=12;case 12:if(Y===5||Y===6)break e;case 13:if(w.last){ie>>>=7&z,z-=7&z,w.mode=27;break}for(;z<3;){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}switch(w.last=1&ie,z-=1,3&(ie>>>=1)){case 0:w.mode=14;break;case 1:if(D(w),w.mode=20,Y!==6)break;ie>>>=2,z-=2;break e;case 2:w.mode=17;break;case 3:M.msg="invalid block type",w.mode=30}ie>>>=2,z-=2;break;case 14:for(ie>>>=7&z,z-=7&z;z<32;){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}if((65535&ie)!=(ie>>>16^65535)){M.msg="invalid stored block lengths",w.mode=30;break}if(w.length=65535&ie,z=ie=0,w.mode=15,Y===6)break e;case 15:w.mode=16;case 16:if(ne=w.length){if(N<ne&&(ne=N),Ee<ne&&(ne=Ee),ne===0)break e;o.arraySet(_e,F,se,ne,pe),N-=ne,se+=ne,Ee-=ne,pe+=ne,w.length-=ne;break}w.mode=12;break;case 17:for(;z<14;){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}if(w.nlen=257+(31&ie),ie>>>=5,z-=5,w.ndist=1+(31&ie),ie>>>=5,z-=5,w.ncode=4+(15&ie),ie>>>=4,z-=4,286<w.nlen||30<w.ndist){M.msg="too many length or distance symbols",w.mode=30;break}w.have=0,w.mode=18;case 18:for(;w.have<w.ncode;){for(;z<3;){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}w.lens[ge[w.have++]]=7&ie,ie>>>=3,z-=3}for(;w.have<19;)w.lens[ge[w.have++]]=0;if(w.lencode=w.lendyn,w.lenbits=7,H={bits:w.lenbits},ue=d(0,w.lens,0,19,w.lencode,0,w.work,H),w.lenbits=H.bits,ue){M.msg="invalid code lengths set",w.mode=30;break}w.have=0,w.mode=19;case 19:for(;w.have<w.nlen+w.ndist;){for(;Oe=(C=w.lencode[ie&(1<<w.lenbits)-1])>>>16&255,ve=65535&C,!((ce=C>>>24)<=z);){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}if(ve<16)ie>>>=ce,z-=ce,w.lens[w.have++]=ve;else{if(ve===16){for($=ce+2;z<$;){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}if(ie>>>=ce,z-=ce,w.have===0){M.msg="invalid bit length repeat",w.mode=30;break}E=w.lens[w.have-1],ne=3+(3&ie),ie>>>=2,z-=2}else if(ve===17){for($=ce+3;z<$;){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}z-=ce,E=0,ne=3+(7&(ie>>>=ce)),ie>>>=3,z-=3}else{for($=ce+7;z<$;){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}z-=ce,E=0,ne=11+(127&(ie>>>=ce)),ie>>>=7,z-=7}if(w.have+ne>w.nlen+w.ndist){M.msg="invalid bit length repeat",w.mode=30;break}for(;ne--;)w.lens[w.have++]=E}}if(w.mode===30)break;if(w.lens[256]===0){M.msg="invalid code -- missing end-of-block",w.mode=30;break}if(w.lenbits=9,H={bits:w.lenbits},ue=d(h,w.lens,0,w.nlen,w.lencode,0,w.work,H),w.lenbits=H.bits,ue){M.msg="invalid literal/lengths set",w.mode=30;break}if(w.distbits=6,w.distcode=w.distdyn,H={bits:w.distbits},ue=d(v,w.lens,w.nlen,w.ndist,w.distcode,0,w.work,H),w.distbits=H.bits,ue){M.msg="invalid distances set",w.mode=30;break}if(w.mode=20,Y===6)break e;case 20:w.mode=21;case 21:if(6<=N&&258<=Ee){M.next_out=pe,M.avail_out=Ee,M.next_in=se,M.avail_in=N,w.hold=ie,w.bits=z,p(M,le),pe=M.next_out,_e=M.output,Ee=M.avail_out,se=M.next_in,F=M.input,N=M.avail_in,ie=w.hold,z=w.bits,w.mode===12&&(w.back=-1);break}for(w.back=0;Oe=(C=w.lencode[ie&(1<<w.lenbits)-1])>>>16&255,ve=65535&C,!((ce=C>>>24)<=z);){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}if(Oe&&!(240&Oe)){for(Re=ce,Ge=Oe,Ze=ve;Oe=(C=w.lencode[Ze+((ie&(1<<Re+Ge)-1)>>Re)])>>>16&255,ve=65535&C,!(Re+(ce=C>>>24)<=z);){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}ie>>>=Re,z-=Re,w.back+=Re}if(ie>>>=ce,z-=ce,w.back+=ce,w.length=ve,Oe===0){w.mode=26;break}if(32&Oe){w.back=-1,w.mode=12;break}if(64&Oe){M.msg="invalid literal/length code",w.mode=30;break}w.extra=15&Oe,w.mode=22;case 22:if(w.extra){for($=w.extra;z<$;){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}w.length+=ie&(1<<w.extra)-1,ie>>>=w.extra,z-=w.extra,w.back+=w.extra}w.was=w.length,w.mode=23;case 23:for(;Oe=(C=w.distcode[ie&(1<<w.distbits)-1])>>>16&255,ve=65535&C,!((ce=C>>>24)<=z);){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}if(!(240&Oe)){for(Re=ce,Ge=Oe,Ze=ve;Oe=(C=w.distcode[Ze+((ie&(1<<Re+Ge)-1)>>Re)])>>>16&255,ve=65535&C,!(Re+(ce=C>>>24)<=z);){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}ie>>>=Re,z-=Re,w.back+=Re}if(ie>>>=ce,z-=ce,w.back+=ce,64&Oe){M.msg="invalid distance code",w.mode=30;break}w.offset=ve,w.extra=15&Oe,w.mode=24;case 24:if(w.extra){for($=w.extra;z<$;){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}w.offset+=ie&(1<<w.extra)-1,ie>>>=w.extra,z-=w.extra,w.back+=w.extra}if(w.offset>w.dmax){M.msg="invalid distance too far back",w.mode=30;break}w.mode=25;case 25:if(Ee===0)break e;if(ne=le-Ee,w.offset>ne){if((ne=w.offset-ne)>w.whave&&w.sane){M.msg="invalid distance too far back",w.mode=30;break}Je=ne>w.wnext?(ne-=w.wnext,w.wsize-ne):w.wnext-ne,ne>w.length&&(ne=w.length),Ke=w.window}else Ke=_e,Je=pe-w.offset,ne=w.length;for(Ee<ne&&(ne=Ee),Ee-=ne,w.length-=ne;_e[pe++]=Ke[Je++],--ne;);w.length===0&&(w.mode=21);break;case 26:if(Ee===0)break e;_e[pe++]=w.length,Ee--,w.mode=21;break;case 27:if(w.wrap){for(;z<32;){if(N===0)break e;N--,ie|=F[se++]<<z,z+=8}if(le-=Ee,M.total_out+=le,w.total+=le,le&&(M.adler=w.check=w.flags?c(w.check,_e,le,pe-le):l(w.check,_e,le,pe-le)),le=Ee,(w.flags?ie:S(ie))!==w.check){M.msg="incorrect data check",w.mode=30;break}z=ie=0}w.mode=28;case 28:if(w.wrap&&w.flags){for(;z<32;){if(N===0)break e;N--,ie+=F[se++]<<z,z+=8}if(ie!==(4294967295&w.total)){M.msg="incorrect length check",w.mode=30;break}z=ie=0}w.mode=29;case 29:ue=1;break e;case 30:ue=-3;break e;case 31:return-4;case 32:default:return g}return M.next_out=pe,M.avail_out=Ee,M.next_in=se,M.avail_in=N,w.hold=ie,w.bits=z,(w.wsize||le!==M.avail_out&&w.mode<30&&(w.mode<27||Y!==4))&&X(M,M.output,M.next_out,le-M.avail_out)?(w.mode=31,-4):(je-=M.avail_in,le-=M.avail_out,M.total_in+=je,M.total_out+=le,w.total+=le,w.wrap&&le&&(M.adler=w.check=w.flags?c(w.check,_e,le,M.next_out-le):l(w.check,_e,le,M.next_out-le)),M.data_type=w.bits+(w.last?64:0)+(w.mode===12?128:0)+(w.mode===20||w.mode===15?256:0),(je==0&&le===0||Y===4)&&ue===y&&(ue=-5),ue)},s.inflateEnd=function(M){if(!M||!M.state)return g;var Y=M.state;return Y.window&&(Y.window=null),M.state=null,y},s.inflateGetHeader=function(M,Y){var w;return M&&M.state&&2&(w=M.state).wrap?((w.head=Y).done=!1,y):g},s.inflateSetDictionary=function(M,Y){var w,F=Y.length;return M&&M.state?(w=M.state).wrap!==0&&w.mode!==11?g:w.mode===11&&l(1,Y,F,0)!==w.check?-3:X(M,Y,F,F)?(w.mode=31,-4):(w.havedict=1,y):g},s.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(r,i,s){var o=r("../utils/common"),l=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],c=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],p=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],d=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];i.exports=function(h,v,y,g,k,_,x,S){var T,I,O,R,B,L,V,q,D,X=S.bits,M=0,Y=0,w=0,F=0,_e=0,se=0,pe=0,N=0,Ee=0,ie=0,z=null,je=0,le=new o.Buf16(16),ne=new o.Buf16(16),Je=null,Ke=0;for(M=0;M<=15;M++)le[M]=0;for(Y=0;Y<g;Y++)le[v[y+Y]]++;for(_e=X,F=15;1<=F&&le[F]===0;F--);if(F<_e&&(_e=F),F===0)return k[_++]=20971520,k[_++]=20971520,S.bits=1,0;for(w=1;w<F&&le[w]===0;w++);for(_e<w&&(_e=w),M=N=1;M<=15;M++)if(N<<=1,(N-=le[M])<0)return-1;if(0<N&&(h===0||F!==1))return-1;for(ne[1]=0,M=1;M<15;M++)ne[M+1]=ne[M]+le[M];for(Y=0;Y<g;Y++)v[y+Y]!==0&&(x[ne[v[y+Y]]++]=Y);if(L=h===0?(z=Je=x,19):h===1?(z=l,je-=257,Je=c,Ke-=257,256):(z=p,Je=d,-1),M=w,B=_,pe=Y=ie=0,O=-1,R=(Ee=1<<(se=_e))-1,h===1&&852<Ee||h===2&&592<Ee)return 1;for(;;){for(V=M-pe,D=x[Y]<L?(q=0,x[Y]):x[Y]>L?(q=Je[Ke+x[Y]],z[je+x[Y]]):(q=96,0),T=1<<M-pe,w=I=1<<se;k[B+(ie>>pe)+(I-=T)]=V<<24|q<<16|D|0,I!==0;);for(T=1<<M-1;ie&T;)T>>=1;if(T!==0?(ie&=T-1,ie+=T):ie=0,Y++,--le[M]==0){if(M===F)break;M=v[y+x[Y]]}if(_e<M&&(ie&R)!==O){for(pe===0&&(pe=_e),B+=w,N=1<<(se=M-pe);se+pe<F&&!((N-=le[se+pe])<=0);)se++,N<<=1;if(Ee+=1<<se,h===1&&852<Ee||h===2&&592<Ee)return 1;k[O=ie&R]=_e<<24|se<<16|B-_|0}}return ie!==0&&(k[B+ie]=M-pe<<24|64<<16|0),S.bits=_e,0}},{"../utils/common":41}],51:[function(r,i,s){i.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(r,i,s){var o=r("../utils/common"),l=0,c=1;function p(C){for(var J=C.length;0<=--J;)C[J]=0}var d=0,h=29,v=256,y=v+1+h,g=30,k=19,_=2*y+1,x=15,S=16,T=7,I=256,O=16,R=17,B=18,L=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],V=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],q=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],D=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],X=new Array(2*(y+2));p(X);var M=new Array(2*g);p(M);var Y=new Array(512);p(Y);var w=new Array(256);p(w);var F=new Array(h);p(F);var _e,se,pe,N=new Array(g);function Ee(C,J,ge,be,ee){this.static_tree=C,this.extra_bits=J,this.extra_base=ge,this.elems=be,this.max_length=ee,this.has_stree=C&&C.length}function ie(C,J){this.dyn_tree=C,this.max_code=0,this.stat_desc=J}function z(C){return C<256?Y[C]:Y[256+(C>>>7)]}function je(C,J){C.pending_buf[C.pending++]=255&J,C.pending_buf[C.pending++]=J>>>8&255}function le(C,J,ge){C.bi_valid>S-ge?(C.bi_buf|=J<<C.bi_valid&65535,je(C,C.bi_buf),C.bi_buf=J>>S-C.bi_valid,C.bi_valid+=ge-S):(C.bi_buf|=J<<C.bi_valid&65535,C.bi_valid+=ge)}function ne(C,J,ge){le(C,ge[2*J],ge[2*J+1])}function Je(C,J){for(var ge=0;ge|=1&C,C>>>=1,ge<<=1,0<--J;);return ge>>>1}function Ke(C,J,ge){var be,ee,re=new Array(x+1),he=0;for(be=1;be<=x;be++)re[be]=he=he+ge[be-1]<<1;for(ee=0;ee<=J;ee++){var U=C[2*ee+1];U!==0&&(C[2*ee]=Je(re[U]++,U))}}function ce(C){var J;for(J=0;J<y;J++)C.dyn_ltree[2*J]=0;for(J=0;J<g;J++)C.dyn_dtree[2*J]=0;for(J=0;J<k;J++)C.bl_tree[2*J]=0;C.dyn_ltree[2*I]=1,C.opt_len=C.static_len=0,C.last_lit=C.matches=0}function Oe(C){8<C.bi_valid?je(C,C.bi_buf):0<C.bi_valid&&(C.pending_buf[C.pending++]=C.bi_buf),C.bi_buf=0,C.bi_valid=0}function ve(C,J,ge,be){var ee=2*J,re=2*ge;return C[ee]<C[re]||C[ee]===C[re]&&be[J]<=be[ge]}function Re(C,J,ge){for(var be=C.heap[ge],ee=ge<<1;ee<=C.heap_len&&(ee<C.heap_len&&ve(J,C.heap[ee+1],C.heap[ee],C.depth)&&ee++,!ve(J,be,C.heap[ee],C.depth));)C.heap[ge]=C.heap[ee],ge=ee,ee<<=1;C.heap[ge]=be}function Ge(C,J,ge){var be,ee,re,he,U=0;if(C.last_lit!==0)for(;be=C.pending_buf[C.d_buf+2*U]<<8|C.pending_buf[C.d_buf+2*U+1],ee=C.pending_buf[C.l_buf+U],U++,be===0?ne(C,ee,J):(ne(C,(re=w[ee])+v+1,J),(he=L[re])!==0&&le(C,ee-=F[re],he),ne(C,re=z(--be),ge),(he=V[re])!==0&&le(C,be-=N[re],he)),U<C.last_lit;);ne(C,I,J)}function Ze(C,J){var ge,be,ee,re=J.dyn_tree,he=J.stat_desc.static_tree,U=J.stat_desc.has_stree,oe=J.stat_desc.elems,Ce=-1;for(C.heap_len=0,C.heap_max=_,ge=0;ge<oe;ge++)re[2*ge]!==0?(C.heap[++C.heap_len]=Ce=ge,C.depth[ge]=0):re[2*ge+1]=0;for(;C.heap_len<2;)re[2*(ee=C.heap[++C.heap_len]=Ce<2?++Ce:0)]=1,C.depth[ee]=0,C.opt_len--,U&&(C.static_len-=he[2*ee+1]);for(J.max_code=Ce,ge=C.heap_len>>1;1<=ge;ge--)Re(C,re,ge);for(ee=oe;ge=C.heap[1],C.heap[1]=C.heap[C.heap_len--],Re(C,re,1),be=C.heap[1],C.heap[--C.heap_max]=ge,C.heap[--C.heap_max]=be,re[2*ee]=re[2*ge]+re[2*be],C.depth[ee]=(C.depth[ge]>=C.depth[be]?C.depth[ge]:C.depth[be])+1,re[2*ge+1]=re[2*be+1]=ee,C.heap[1]=ee++,Re(C,re,1),2<=C.heap_len;);C.heap[--C.heap_max]=C.heap[1],function(Se,Ue){var dt,xt,It,Xe,Vt,jt,yt=Ue.dyn_tree,mt=Ue.max_code,kn=Ue.stat_desc.static_tree,Er=Ue.stat_desc.has_stree,Zn=Ue.stat_desc.extra_bits,Ar=Ue.stat_desc.extra_base,vr=Ue.stat_desc.max_length,ni=0;for(Xe=0;Xe<=x;Xe++)Se.bl_count[Xe]=0;for(yt[2*Se.heap[Se.heap_max]+1]=0,dt=Se.heap_max+1;dt<_;dt++)vr<(Xe=yt[2*yt[2*(xt=Se.heap[dt])+1]+1]+1)&&(Xe=vr,ni++),yt[2*xt+1]=Xe,mt<xt||(Se.bl_count[Xe]++,Vt=0,Ar<=xt&&(Vt=Zn[xt-Ar]),jt=yt[2*xt],Se.opt_len+=jt*(Xe+Vt),Er&&(Se.static_len+=jt*(kn[2*xt+1]+Vt)));if(ni!==0){do{for(Xe=vr-1;Se.bl_count[Xe]===0;)Xe--;Se.bl_count[Xe]--,Se.bl_count[Xe+1]+=2,Se.bl_count[vr]--,ni-=2}while(0<ni);for(Xe=vr;Xe!==0;Xe--)for(xt=Se.bl_count[Xe];xt!==0;)mt<(It=Se.heap[--dt])||(yt[2*It+1]!==Xe&&(Se.opt_len+=(Xe-yt[2*It+1])*yt[2*It],yt[2*It+1]=Xe),xt--)}}(C,J),Ke(re,Ce,C.bl_count)}function E(C,J,ge){var be,ee,re=-1,he=J[1],U=0,oe=7,Ce=4;for(he===0&&(oe=138,Ce=3),J[2*(ge+1)+1]=65535,be=0;be<=ge;be++)ee=he,he=J[2*(be+1)+1],++U<oe&&ee===he||(U<Ce?C.bl_tree[2*ee]+=U:ee!==0?(ee!==re&&C.bl_tree[2*ee]++,C.bl_tree[2*O]++):U<=10?C.bl_tree[2*R]++:C.bl_tree[2*B]++,re=ee,Ce=(U=0)===he?(oe=138,3):ee===he?(oe=6,3):(oe=7,4))}function ue(C,J,ge){var be,ee,re=-1,he=J[1],U=0,oe=7,Ce=4;for(he===0&&(oe=138,Ce=3),be=0;be<=ge;be++)if(ee=he,he=J[2*(be+1)+1],!(++U<oe&&ee===he)){if(U<Ce)for(;ne(C,ee,C.bl_tree),--U!=0;);else ee!==0?(ee!==re&&(ne(C,ee,C.bl_tree),U--),ne(C,O,C.bl_tree),le(C,U-3,2)):U<=10?(ne(C,R,C.bl_tree),le(C,U-3,3)):(ne(C,B,C.bl_tree),le(C,U-11,7));re=ee,Ce=(U=0)===he?(oe=138,3):ee===he?(oe=6,3):(oe=7,4)}}p(N);var H=!1;function $(C,J,ge,be){le(C,(d<<1)+(be?1:0),3),function(ee,re,he,U){Oe(ee),je(ee,he),je(ee,~he),o.arraySet(ee.pending_buf,ee.window,re,he,ee.pending),ee.pending+=he}(C,J,ge)}s._tr_init=function(C){H||(function(){var J,ge,be,ee,re,he=new Array(x+1);for(ee=be=0;ee<h-1;ee++)for(F[ee]=be,J=0;J<1<<L[ee];J++)w[be++]=ee;for(w[be-1]=ee,ee=re=0;ee<16;ee++)for(N[ee]=re,J=0;J<1<<V[ee];J++)Y[re++]=ee;for(re>>=7;ee<g;ee++)for(N[ee]=re<<7,J=0;J<1<<V[ee]-7;J++)Y[256+re++]=ee;for(ge=0;ge<=x;ge++)he[ge]=0;for(J=0;J<=143;)X[2*J+1]=8,J++,he[8]++;for(;J<=255;)X[2*J+1]=9,J++,he[9]++;for(;J<=279;)X[2*J+1]=7,J++,he[7]++;for(;J<=287;)X[2*J+1]=8,J++,he[8]++;for(Ke(X,y+1,he),J=0;J<g;J++)M[2*J+1]=5,M[2*J]=Je(J,5);_e=new Ee(X,L,v+1,y,x),se=new Ee(M,V,0,g,x),pe=new Ee(new Array(0),q,0,k,T)}(),H=!0),C.l_desc=new ie(C.dyn_ltree,_e),C.d_desc=new ie(C.dyn_dtree,se),C.bl_desc=new ie(C.bl_tree,pe),C.bi_buf=0,C.bi_valid=0,ce(C)},s._tr_stored_block=$,s._tr_flush_block=function(C,J,ge,be){var ee,re,he=0;0<C.level?(C.strm.data_type===2&&(C.strm.data_type=function(U){var oe,Ce=4093624447;for(oe=0;oe<=31;oe++,Ce>>>=1)if(1&Ce&&U.dyn_ltree[2*oe]!==0)return l;if(U.dyn_ltree[18]!==0||U.dyn_ltree[20]!==0||U.dyn_ltree[26]!==0)return c;for(oe=32;oe<v;oe++)if(U.dyn_ltree[2*oe]!==0)return c;return l}(C)),Ze(C,C.l_desc),Ze(C,C.d_desc),he=function(U){var oe;for(E(U,U.dyn_ltree,U.l_desc.max_code),E(U,U.dyn_dtree,U.d_desc.max_code),Ze(U,U.bl_desc),oe=k-1;3<=oe&&U.bl_tree[2*D[oe]+1]===0;oe--);return U.opt_len+=3*(oe+1)+5+5+4,oe}(C),ee=C.opt_len+3+7>>>3,(re=C.static_len+3+7>>>3)<=ee&&(ee=re)):ee=re=ge+5,ge+4<=ee&&J!==-1?$(C,J,ge,be):C.strategy===4||re===ee?(le(C,2+(be?1:0),3),Ge(C,X,M)):(le(C,4+(be?1:0),3),function(U,oe,Ce,Se){var Ue;for(le(U,oe-257,5),le(U,Ce-1,5),le(U,Se-4,4),Ue=0;Ue<Se;Ue++)le(U,U.bl_tree[2*D[Ue]+1],3);ue(U,U.dyn_ltree,oe-1),ue(U,U.dyn_dtree,Ce-1)}(C,C.l_desc.max_code+1,C.d_desc.max_code+1,he+1),Ge(C,C.dyn_ltree,C.dyn_dtree)),ce(C),be&&Oe(C)},s._tr_tally=function(C,J,ge){return C.pending_buf[C.d_buf+2*C.last_lit]=J>>>8&255,C.pending_buf[C.d_buf+2*C.last_lit+1]=255&J,C.pending_buf[C.l_buf+C.last_lit]=255&ge,C.last_lit++,J===0?C.dyn_ltree[2*ge]++:(C.matches++,J--,C.dyn_ltree[2*(w[ge]+v+1)]++,C.dyn_dtree[2*z(J)]++),C.last_lit===C.lit_bufsize-1},s._tr_align=function(C){le(C,2,3),ne(C,I,X),function(J){J.bi_valid===16?(je(J,J.bi_buf),J.bi_buf=0,J.bi_valid=0):8<=J.bi_valid&&(J.pending_buf[J.pending++]=255&J.bi_buf,J.bi_buf>>=8,J.bi_valid-=8)}(C)}},{"../utils/common":41}],53:[function(r,i,s){i.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(r,i,s){(function(o){(function(l,c){if(!l.setImmediate){var p,d,h,v,y=1,g={},k=!1,_=l.document,x=Object.getPrototypeOf&&Object.getPrototypeOf(l);x=x&&x.setTimeout?x:l,p={}.toString.call(l.process)==="[object process]"?function(O){n.nextTick(function(){T(O)})}:function(){if(l.postMessage&&!l.importScripts){var O=!0,R=l.onmessage;return l.onmessage=function(){O=!1},l.postMessage("","*"),l.onmessage=R,O}}()?(v="setImmediate$"+Math.random()+"$",l.addEventListener?l.addEventListener("message",I,!1):l.attachEvent("onmessage",I),function(O){l.postMessage(v+O,"*")}):l.MessageChannel?((h=new MessageChannel).port1.onmessage=function(O){T(O.data)},function(O){h.port2.postMessage(O)}):_&&"onreadystatechange"in _.createElement("script")?(d=_.documentElement,function(O){var R=_.createElement("script");R.onreadystatechange=function(){T(O),R.onreadystatechange=null,d.removeChild(R),R=null},d.appendChild(R)}):function(O){setTimeout(T,0,O)},x.setImmediate=function(O){typeof O!="function"&&(O=new Function(""+O));for(var R=new Array(arguments.length-1),B=0;B<R.length;B++)R[B]=arguments[B+1];var L={callback:O,args:R};return g[y]=L,p(y),y++},x.clearImmediate=S}function S(O){delete g[O]}function T(O){if(k)setTimeout(T,0,O);else{var R=g[O];if(R){k=!0;try{(function(B){var L=B.callback,V=B.args;switch(V.length){case 0:L();break;case 1:L(V[0]);break;case 2:L(V[0],V[1]);break;case 3:L(V[0],V[1],V[2]);break;default:L.apply(c,V)}})(R)}finally{S(O),k=!1}}}}function I(O){O.source===l&&typeof O.data=="string"&&O.data.indexOf(v)===0&&T(+O.data.slice(v.length))}})(typeof self>"u"?o===void 0?this:o:self)}).call(this,typeof Jn<"u"?Jn:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(i_);var DZ=i_.exports;const FZ=Wi(DZ);var Dl={};(function(e){e.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1,e.find=(t,n)=>t.nodes.find(r=>r.type===n),e.exceedsLimit=(t,n,r=1,i)=>i===!1||!e.isInteger(t)||!e.isInteger(n)?!1:(Number(n)-Number(t))/Number(r)>=i,e.escapeNode=(t,n=0,r)=>{const i=t.nodes[n];i&&(r&&i.type===r||i.type==="open"||i.type==="close")&&i.escaped!==!0&&(i.value="\\"+i.value,i.escaped=!0)},e.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0),e.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1,e.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0,e.reduce=t=>t.reduce((n,r)=>(r.type==="text"&&n.push(r.value),r.type==="range"&&(r.type="text"),n),[]),e.flatten=(...t)=>{const n=[],r=i=>{for(let s=0;s<i.length;s++){const o=i[s];if(Array.isArray(o)){r(o);continue}o!==void 0&&n.push(o)}return n};return r(t),n}})(Dl);const vv=Dl;var Sd=(e,t={})=>{const n=(r,i={})=>{const s=t.escapeInvalid&&vv.isInvalidBrace(i),o=r.invalid===!0&&t.escapeInvalid===!0;let l="";if(r.value)return(s||o)&&vv.isOpenOrClose(r)?"\\"+r.value:r.value;if(r.value)return r.value;if(r.nodes)for(const c of r.nodes)l+=n(c);return l};return n(e)};/*!
 * is-number <https://github.com/jonschlinkert/is-number>
 *
 * Copyright (c) 2014-present, Jon Schlinkert.
 * Released under the MIT License.
 */var LZ=function(e){return typeof e=="number"?e-e===0:typeof e=="string"&&e.trim()!==""?Number.isFinite?Number.isFinite(+e):isFinite(+e):!1};/*!
 * to-regex-range <https://github.com/micromatch/to-regex-range>
 *
 * Copyright (c) 2015-present, Jon Schlinkert.
 * Released under the MIT License.
 */const yv=LZ,Bi=(e,t,n)=>{if(yv(e)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(t===void 0||e===t)return String(e);if(yv(t)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let r={relaxZeros:!0,...n};typeof r.strictZeros=="boolean"&&(r.relaxZeros=r.strictZeros===!1);let i=String(r.relaxZeros),s=String(r.shorthand),o=String(r.capture),l=String(r.wrap),c=e+":"+t+"="+i+s+o+l;if(Bi.cache.hasOwnProperty(c))return Bi.cache[c].result;let p=Math.min(e,t),d=Math.max(e,t);if(Math.abs(p-d)===1){let k=e+"|"+t;return r.capture?`(${k})`:r.wrap===!1?k:`(?:${k})`}let h=Cv(e)||Cv(t),v={min:e,max:t,a:p,b:d},y=[],g=[];if(h&&(v.isPadded=h,v.maxLen=String(v.max).length),p<0){let k=d<0?Math.abs(d):1;g=bv(k,Math.abs(p),v,r),p=v.a=0}return d>=0&&(y=bv(p,d,v,r)),v.negatives=g,v.positives=y,v.result=BZ(g,y),r.capture===!0?v.result=`(${v.result})`:r.wrap!==!1&&y.length+g.length>1&&(v.result=`(?:${v.result})`),Bi.cache[c]=v,v.result};function BZ(e,t,n){let r=Oc(e,t,"-",!1)||[],i=Oc(t,e,"",!1)||[],s=Oc(e,t,"-?",!0)||[];return r.concat(s).concat(i).join("|")}function UZ(e,t){let n=1,r=1,i=_v(e,n),s=new Set([t]);for(;e<=i&&i<=t;)s.add(i),n+=1,i=_v(e,n);for(i=wv(t+1,r)-1;e<i&&i<=t;)s.add(i),r+=1,i=wv(t+1,r)-1;return s=[...s],s.sort(WZ),s}function ZZ(e,t,n){if(e===t)return{pattern:e,count:[],digits:0};let r=HZ(e,t),i=r.length,s="",o=0;for(let l=0;l<i;l++){let[c,p]=r[l];c===p?s+=c:c!=="0"||p!=="9"?s+=qZ(c,p):o++}return o&&(s+=n.shorthand===!0?"\\d":"[0-9]"),{pattern:s,count:[o],digits:i}}function bv(e,t,n,r){let i=UZ(e,t),s=[],o=e,l;for(let c=0;c<i.length;c++){let p=i[c],d=ZZ(String(o),String(p),r),h="";if(!n.isPadded&&l&&l.pattern===d.pattern){l.count.length>1&&l.count.pop(),l.count.push(d.count[0]),l.string=l.pattern+kv(l.count),o=p+1;continue}n.isPadded&&(h=VZ(p,n,r)),d.string=h+d.pattern+kv(d.count),s.push(d),o=p+1,l=d}return s}function Oc(e,t,n,r,i){let s=[];for(let o of e){let{string:l}=o;!r&&!xv(t,"string",l)&&s.push(n+l),r&&xv(t,"string",l)&&s.push(n+l)}return s}function HZ(e,t){let n=[];for(let r=0;r<e.length;r++)n.push([e[r],t[r]]);return n}function WZ(e,t){return e>t?1:t>e?-1:0}function xv(e,t,n){return e.some(r=>r[t]===n)}function _v(e,t){return Number(String(e).slice(0,-t)+"9".repeat(t))}function wv(e,t){return e-e%Math.pow(10,t)}function kv(e){let[t=0,n=""]=e;return n||t>1?`{${t+(n?","+n:"")}}`:""}function qZ(e,t,n){return`[${e}${t-e===1?"":"-"}${t}]`}function Cv(e){return/^-?(0+)\d/.test(e)}function VZ(e,t,n){if(!t.isPadded)return e;let r=Math.abs(t.maxLen-String(e).length),i=n.relaxZeros!==!1;switch(r){case 0:return"";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${r}}`:`0{${r}}`}}Bi.cache={};Bi.clearCache=()=>Bi.cache={};var GZ=Bi;/*!
 * fill-range <https://github.com/jonschlinkert/fill-range>
 *
 * Copyright (c) 2014-present, Jon Schlinkert.
 * Licensed under the MIT License.
 */const JZ=Oo,a_=GZ,Sv=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),KZ=e=>t=>e===!0?Number(t):String(t),zc=e=>typeof e=="number"||typeof e=="string"&&e!=="",bo=e=>Number.isInteger(+e),Nc=e=>{let t=`${e}`,n=-1;if(t[0]==="-"&&(t=t.slice(1)),t==="0")return!1;for(;t[++n]==="0";);return n>0},YZ=(e,t,n)=>typeof e=="string"||typeof t=="string"?!0:n.stringify===!0,XZ=(e,t,n)=>{if(t>0){let r=e[0]==="-"?"-":"";r&&(e=e.slice(1)),e=r+e.padStart(r?t-1:t,"0")}return n===!1?String(e):e},yl=(e,t)=>{let n=e[0]==="-"?"-":"";for(n&&(e=e.slice(1),t--);e.length<t;)e="0"+e;return n?"-"+e:e},QZ=(e,t,n)=>{e.negatives.sort((l,c)=>l<c?-1:l>c?1:0),e.positives.sort((l,c)=>l<c?-1:l>c?1:0);let r=t.capture?"":"?:",i="",s="",o;return e.positives.length&&(i=e.positives.map(l=>yl(String(l),n)).join("|")),e.negatives.length&&(s=`-(${r}${e.negatives.map(l=>yl(String(l),n)).join("|")})`),i&&s?o=`${i}|${s}`:o=i||s,t.wrap?`(${r}${o})`:o},o_=(e,t,n,r)=>{if(n)return a_(e,t,{wrap:!1,...r});let i=String.fromCharCode(e);if(e===t)return i;let s=String.fromCharCode(t);return`[${i}-${s}]`},s_=(e,t,n)=>{if(Array.isArray(e)){let r=n.wrap===!0,i=n.capture?"":"?:";return r?`(${i}${e.join("|")})`:e.join("|")}return a_(e,t,n)},l_=(...e)=>new RangeError("Invalid range arguments: "+JZ.inspect(...e)),u_=(e,t,n)=>{if(n.strictRanges===!0)throw l_([e,t]);return[]},e3=(e,t)=>{if(t.strictRanges===!0)throw new TypeError(`Expected step "${e}" to be a number`);return[]},t3=(e,t,n=1,r={})=>{let i=Number(e),s=Number(t);if(!Number.isInteger(i)||!Number.isInteger(s)){if(r.strictRanges===!0)throw l_([e,t]);return[]}i===0&&(i=0),s===0&&(s=0);let o=i>s,l=String(e),c=String(t),p=String(n);n=Math.max(Math.abs(n),1);let d=Nc(l)||Nc(c)||Nc(p),h=d?Math.max(l.length,c.length,p.length):0,v=d===!1&&YZ(e,t,r)===!1,y=r.transform||KZ(v);if(r.toRegex&&n===1)return o_(yl(e,h),yl(t,h),!0,r);let g={negatives:[],positives:[]},k=S=>g[S<0?"negatives":"positives"].push(Math.abs(S)),_=[],x=0;for(;o?i>=s:i<=s;)r.toRegex===!0&&n>1?k(i):_.push(XZ(y(i,x),h,v)),i=o?i-n:i+n,x++;return r.toRegex===!0?n>1?QZ(g,r,h):s_(_,null,{wrap:!1,...r}):_},n3=(e,t,n=1,r={})=>{if(!bo(e)&&e.length>1||!bo(t)&&t.length>1)return u_(e,t,r);let i=r.transform||(v=>String.fromCharCode(v)),s=`${e}`.charCodeAt(0),o=`${t}`.charCodeAt(0),l=s>o,c=Math.min(s,o),p=Math.max(s,o);if(r.toRegex&&n===1)return o_(c,p,!1,r);let d=[],h=0;for(;l?s>=o:s<=o;)d.push(i(s,h)),s=l?s-n:s+n,h++;return r.toRegex===!0?s_(d,null,{wrap:!1,options:r}):d},Ks=(e,t,n,r={})=>{if(t==null&&zc(e))return[e];if(!zc(e)||!zc(t))return u_(e,t,r);if(typeof n=="function")return Ks(e,t,1,{transform:n});if(Sv(n))return Ks(e,t,0,n);let i={...r};return i.capture===!0&&(i.wrap=!0),n=n||i.step||1,bo(n)?bo(e)&&bo(t)?t3(e,t,n,i):n3(e,t,Math.max(Math.abs(n),1),i):n!=null&&!Sv(n)?e3(n,i):Ks(e,t,1,n)};var c_=Ks;const r3=c_,Ev=Dl,i3=(e,t={})=>{const n=(r,i={})=>{const s=Ev.isInvalidBrace(i),o=r.invalid===!0&&t.escapeInvalid===!0,l=s===!0||o===!0,c=t.escapeInvalid===!0?"\\":"";let p="";if(r.isOpen===!0)return c+r.value;if(r.isClose===!0)return console.log("node.isClose",c,r.value),c+r.value;if(r.type==="open")return l?c+r.value:"(";if(r.type==="close")return l?c+r.value:")";if(r.type==="comma")return r.prev.type==="comma"?"":l?r.value:"|";if(r.value)return r.value;if(r.nodes&&r.ranges>0){const d=Ev.reduce(r.nodes),h=r3(...d,{...t,wrap:!1,toRegex:!0,strictZeros:!0});if(h.length!==0)return d.length>1&&h.length>1?`(${h})`:h}if(r.nodes)for(const d of r.nodes)p+=n(d,r);return p};return n(e)};var a3=i3;const o3=c_,Av=Sd,xa=Dl,Di=(e="",t="",n=!1)=>{const r=[];if(e=[].concat(e),t=[].concat(t),!t.length)return e;if(!e.length)return n?xa.flatten(t).map(i=>`{${i}}`):t;for(const i of e)if(Array.isArray(i))for(const s of i)r.push(Di(s,t,n));else for(let s of t)n===!0&&typeof s=="string"&&(s=`{${s}}`),r.push(Array.isArray(s)?Di(i,s,n):i+s);return xa.flatten(r)},s3=(e,t={})=>{const n=t.rangeLimit===void 0?1e3:t.rangeLimit,r=(i,s={})=>{i.queue=[];let o=s,l=s.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,l=o.queue;if(i.invalid||i.dollar){l.push(Di(l.pop(),Av(i,t)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){l.push(Di(l.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){const h=xa.reduce(i.nodes);if(xa.exceedsLimit(...h,t.step,n))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let v=o3(...h,t);v.length===0&&(v=Av(i,t)),l.push(Di(l.pop(),v)),i.nodes=[];return}const c=xa.encloseBrace(i);let p=i.queue,d=i;for(;d.type!=="brace"&&d.type!=="root"&&d.parent;)d=d.parent,p=d.queue;for(let h=0;h<i.nodes.length;h++){const v=i.nodes[h];if(v.type==="comma"&&i.type==="brace"){h===1&&p.push(""),p.push("");continue}if(v.type==="close"){l.push(Di(l.pop(),p,c));continue}if(v.value&&v.type!=="open"){p.push(Di(p.pop(),v.value));continue}v.nodes&&r(v,i)}return p};return xa.flatten(r(e))};var l3=s3,u3={MAX_LENGTH:1e4,CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_COMMA:",",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_NO_BREAK_SPACE:" ",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SINGLE_QUOTE:"'",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};const c3=Sd,{MAX_LENGTH:Tv,CHAR_BACKSLASH:Mc,CHAR_BACKTICK:p3,CHAR_COMMA:d3,CHAR_DOT:f3,CHAR_LEFT_PARENTHESES:h3,CHAR_RIGHT_PARENTHESES:m3,CHAR_LEFT_CURLY_BRACE:g3,CHAR_RIGHT_CURLY_BRACE:v3,CHAR_LEFT_SQUARE_BRACKET:Iv,CHAR_RIGHT_SQUARE_BRACKET:jv,CHAR_DOUBLE_QUOTE:y3,CHAR_SINGLE_QUOTE:b3,CHAR_NO_BREAK_SPACE:x3,CHAR_ZERO_WIDTH_NOBREAK_SPACE:_3}=u3,w3=(e,t={})=>{if(typeof e!="string")throw new TypeError("Expected a string");const n=t||{},r=typeof n.maxLength=="number"?Math.min(Tv,n.maxLength):Tv;if(e.length>r)throw new SyntaxError(`Input length (${e.length}), exceeds max characters (${r})`);const i={type:"root",input:e,nodes:[]},s=[i];let o=i,l=i,c=0;const p=e.length;let d=0,h=0,v;const y=()=>e[d++],g=k=>{if(k.type==="text"&&l.type==="dot"&&(l.type="text"),l&&l.type==="text"&&k.type==="text"){l.value+=k.value;return}return o.nodes.push(k),k.parent=o,k.prev=l,l=k,k};for(g({type:"bos"});d<p;)if(o=s[s.length-1],v=y(),!(v===_3||v===x3)){if(v===Mc){g({type:"text",value:(t.keepEscaping?v:"")+y()});continue}if(v===jv){g({type:"text",value:"\\"+v});continue}if(v===Iv){c++;let k;for(;d<p&&(k=y());){if(v+=k,k===Iv){c++;continue}if(k===Mc){v+=y();continue}if(k===jv&&(c--,c===0))break}g({type:"text",value:v});continue}if(v===h3){o=g({type:"paren",nodes:[]}),s.push(o),g({type:"text",value:v});continue}if(v===m3){if(o.type!=="paren"){g({type:"text",value:v});continue}o=s.pop(),g({type:"text",value:v}),o=s[s.length-1];continue}if(v===y3||v===b3||v===p3){const k=v;let _;for(t.keepQuotes!==!0&&(v="");d<p&&(_=y());){if(_===Mc){v+=_+y();continue}if(_===k){t.keepQuotes===!0&&(v+=_);break}v+=_}g({type:"text",value:v});continue}if(v===g3){h++;const _={type:"brace",open:!0,close:!1,dollar:l.value&&l.value.slice(-1)==="$"||o.dollar===!0,depth:h,commas:0,ranges:0,nodes:[]};o=g(_),s.push(o),g({type:"open",value:v});continue}if(v===v3){if(o.type!=="brace"){g({type:"text",value:v});continue}const k="close";o=s.pop(),o.close=!0,g({type:k,value:v}),h--,o=s[s.length-1];continue}if(v===d3&&h>0){if(o.ranges>0){o.ranges=0;const k=o.nodes.shift();o.nodes=[k,{type:"text",value:c3(o)}]}g({type:"comma",value:v}),o.commas++;continue}if(v===f3&&h>0&&o.commas===0){const k=o.nodes;if(h===0||k.length===0){g({type:"text",value:v});continue}if(l.type==="dot"){if(o.range=[],l.value+=v,l.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,l.type="text";continue}o.ranges++,o.args=[];continue}if(l.type==="range"){k.pop();const _=k[k.length-1];_.value+=l.value+v,l=_,o.ranges--;continue}g({type:"dot",value:v});continue}g({type:"text",value:v})}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(x=>{x.nodes||(x.type==="open"&&(x.isOpen=!0),x.type==="close"&&(x.isClose=!0),x.nodes||(x.type="text"),x.invalid=!0)});const k=s[s.length-1],_=k.nodes.indexOf(o);k.nodes.splice(_,1,...o.nodes)}while(s.length>0);return g({type:"eos"}),i};var k3=w3;const Rv=Sd,C3=a3,S3=l3,E3=k3,Yn=(e,t={})=>{let n=[];if(Array.isArray(e))for(const r of e){const i=Yn.create(r,t);Array.isArray(i)?n.push(...i):n.push(i)}else n=[].concat(Yn.create(e,t));return t&&t.expand===!0&&t.nodupes===!0&&(n=[...new Set(n)]),n};Yn.parse=(e,t={})=>E3(e,t);Yn.stringify=(e,t={})=>Rv(typeof e=="string"?Yn.parse(e,t):e,t);Yn.compile=(e,t={})=>(typeof e=="string"&&(e=Yn.parse(e,t)),C3(e,t));Yn.expand=(e,t={})=>{typeof e=="string"&&(e=Yn.parse(e,t));let n=S3(e,t);return t.noempty===!0&&(n=n.filter(Boolean)),t.nodupes===!0&&(n=[...new Set(n)]),n};Yn.create=(e,t={})=>e===""||e.length<3?[e]:t.expand!==!0?Yn.compile(e,t):Yn.expand(e,t);var A3=Yn,Bo={};const T3=Oo,Nr="\\\\/",Ov=`[^${Nr}]`,I3=0,Kr="\\.",j3="\\+",R3="\\?",Fl="\\/",O3="(?=.)",p_="[^/]",Ed=`(?:${Fl}|$)`,d_=`(?:^|${Fl})`,Ad=`${Kr}{1,2}${Ed}`,z3=`(?!${Kr})`,N3=`(?!${d_}${Ad})`,M3=`(?!${Kr}{0,1}${Ed})`,P3=`(?!${Ad})`,$3=`[^.${Fl}]`,D3=`${p_}*?`,f_={DOT_LITERAL:Kr,PLUS_LITERAL:j3,QMARK_LITERAL:R3,SLASH_LITERAL:Fl,ONE_CHAR:O3,QMARK:p_,END_ANCHOR:Ed,DOTS_SLASH:Ad,NO_DOT:z3,NO_DOTS:N3,NO_DOT_SLASH:M3,NO_DOTS_SLASH:P3,QMARK_NO_DOT:$3,STAR:D3,START_ANCHOR:d_},F3={...f_,SLASH_LITERAL:`[${Nr}]`,QMARK:Ov,STAR:`${Ov}*?`,DOTS_SLASH:`${Kr}{1,2}(?:[${Nr}]|$)`,NO_DOT:`(?!${Kr})`,NO_DOTS:`(?!(?:^|[${Nr}])${Kr}{1,2}(?:[${Nr}]|$))`,NO_DOT_SLASH:`(?!${Kr}{0,1}(?:[${Nr}]|$))`,NO_DOTS_SLASH:`(?!${Kr}{1,2}(?:[${Nr}]|$))`,QMARK_NO_DOT:`[^.${Nr}]`,START_ANCHOR:`(?:^|[${Nr}])`,END_ANCHOR:`(?:[${Nr}]|$)`},L3={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};var Ll={DEFAULT_MAX_EXTGLOB_RECURSION:I3,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:L3,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:T3.sep,extglobChars(e){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${e.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(e){return e===!0?F3:f_}};(function(e){var t={};const n=Oo,r=t.platform==="win32",{REGEX_BACKSLASH:i,REGEX_REMOVE_BACKSLASH:s,REGEX_SPECIAL_CHARS:o,REGEX_SPECIAL_CHARS_GLOBAL:l}=Ll;e.isObject=c=>c!==null&&typeof c=="object"&&!Array.isArray(c),e.hasRegexChars=c=>o.test(c),e.isRegexChar=c=>c.length===1&&e.hasRegexChars(c),e.escapeRegex=c=>c.replace(l,"\\$1"),e.toPosixSlashes=c=>c.replace(i,"/"),e.removeBackslashes=c=>c.replace(s,p=>p==="\\"?"":p),e.supportsLookbehinds=()=>{const c=t.version.slice(1).split(".").map(Number);return c.length===3&&c[0]>=9||c[0]===8&&c[1]>=10},e.isWindows=c=>c&&typeof c.windows=="boolean"?c.windows:r===!0||n.sep==="\\",e.escapeLast=(c,p,d)=>{const h=c.lastIndexOf(p,d);return h===-1?c:c[h-1]==="\\"?e.escapeLast(c,p,h-1):`${c.slice(0,h)}\\${c.slice(h)}`},e.removePrefix=(c,p={})=>{let d=c;return d.startsWith("./")&&(d=d.slice(2),p.prefix="./"),d},e.wrapOutput=(c,p={},d={})=>{const h=d.contains?"":"^",v=d.contains?"":"$";let y=`${h}(?:${c})${v}`;return p.negated===!0&&(y=`(?:^(?!${y}).*$)`),y}})(Bo);const zv=Bo,{CHAR_ASTERISK:Pc,CHAR_AT:B3,CHAR_BACKWARD_SLASH:mo,CHAR_COMMA:U3,CHAR_DOT:$c,CHAR_EXCLAMATION_MARK:Dc,CHAR_FORWARD_SLASH:h_,CHAR_LEFT_CURLY_BRACE:Fc,CHAR_LEFT_PARENTHESES:Lc,CHAR_LEFT_SQUARE_BRACKET:Z3,CHAR_PLUS:H3,CHAR_QUESTION_MARK:Nv,CHAR_RIGHT_CURLY_BRACE:W3,CHAR_RIGHT_PARENTHESES:Mv,CHAR_RIGHT_SQUARE_BRACKET:q3}=Ll,Pv=e=>e===h_||e===mo,$v=e=>{e.isPrefix!==!0&&(e.depth=e.isGlobstar?1/0:1)},V3=(e,t)=>{const n=t||{},r=e.length-1,i=n.parts===!0||n.scanToEnd===!0,s=[],o=[],l=[];let c=e,p=-1,d=0,h=0,v=!1,y=!1,g=!1,k=!1,_=!1,x=!1,S=!1,T=!1,I=!1,O=!1,R=0,B,L,V={value:"",depth:0,isGlob:!1};const q=()=>p>=r,D=()=>c.charCodeAt(p+1),X=()=>(B=L,c.charCodeAt(++p));for(;p<r;){L=X();let _e;if(L===mo){S=V.backslashes=!0,L=X(),L===Fc&&(x=!0);continue}if(x===!0||L===Fc){for(R++;q()!==!0&&(L=X());){if(L===mo){S=V.backslashes=!0,X();continue}if(L===Fc){R++;continue}if(x!==!0&&L===$c&&(L=X())===$c){if(v=V.isBrace=!0,g=V.isGlob=!0,O=!0,i===!0)continue;break}if(x!==!0&&L===U3){if(v=V.isBrace=!0,g=V.isGlob=!0,O=!0,i===!0)continue;break}if(L===W3&&(R--,R===0)){x=!1,v=V.isBrace=!0,O=!0;break}}if(i===!0)continue;break}if(L===h_){if(s.push(p),o.push(V),V={value:"",depth:0,isGlob:!1},O===!0)continue;if(B===$c&&p===d+1){d+=2;continue}h=p+1;continue}if(n.noext!==!0&&(L===H3||L===B3||L===Pc||L===Nv||L===Dc)===!0&&D()===Lc){if(g=V.isGlob=!0,k=V.isExtglob=!0,O=!0,L===Dc&&p===d&&(I=!0),i===!0){for(;q()!==!0&&(L=X());){if(L===mo){S=V.backslashes=!0,L=X();continue}if(L===Mv){g=V.isGlob=!0,O=!0;break}}continue}break}if(L===Pc){if(B===Pc&&(_=V.isGlobstar=!0),g=V.isGlob=!0,O=!0,i===!0)continue;break}if(L===Nv){if(g=V.isGlob=!0,O=!0,i===!0)continue;break}if(L===Z3){for(;q()!==!0&&(_e=X());){if(_e===mo){S=V.backslashes=!0,X();continue}if(_e===q3){y=V.isBracket=!0,g=V.isGlob=!0,O=!0;break}}if(i===!0)continue;break}if(n.nonegate!==!0&&L===Dc&&p===d){T=V.negated=!0,d++;continue}if(n.noparen!==!0&&L===Lc){if(g=V.isGlob=!0,i===!0){for(;q()!==!0&&(L=X());){if(L===Lc){S=V.backslashes=!0,L=X();continue}if(L===Mv){O=!0;break}}continue}break}if(g===!0){if(O=!0,i===!0)continue;break}}n.noext===!0&&(k=!1,g=!1);let M=c,Y="",w="";d>0&&(Y=c.slice(0,d),c=c.slice(d),h-=d),M&&g===!0&&h>0?(M=c.slice(0,h),w=c.slice(h)):g===!0?(M="",w=c):M=c,M&&M!==""&&M!=="/"&&M!==c&&Pv(M.charCodeAt(M.length-1))&&(M=M.slice(0,-1)),n.unescape===!0&&(w&&(w=zv.removeBackslashes(w)),M&&S===!0&&(M=zv.removeBackslashes(M)));const F={prefix:Y,input:e,start:d,base:M,glob:w,isBrace:v,isBracket:y,isGlob:g,isExtglob:k,isGlobstar:_,negated:T,negatedExtglob:I};if(n.tokens===!0&&(F.maxDepth=0,Pv(L)||o.push(V),F.tokens=o),n.parts===!0||n.tokens===!0){let _e;for(let se=0;se<s.length;se++){const pe=_e?_e+1:d,N=s[se],Ee=e.slice(pe,N);n.tokens&&(se===0&&d!==0?(o[se].isPrefix=!0,o[se].value=Y):o[se].value=Ee,$v(o[se]),F.maxDepth+=o[se].depth),(se!==0||Ee!=="")&&l.push(Ee),_e=N}if(_e&&_e+1<e.length){const se=e.slice(_e+1);l.push(se),n.tokens&&(o[o.length-1].value=se,$v(o[o.length-1]),F.maxDepth+=o[o.length-1].depth)}F.slashes=s,F.parts=l}return F};var G3=V3;const jo=Ll,_n=Bo,{MAX_LENGTH:bl,POSIX_REGEX_SOURCE:J3,REGEX_NON_SPECIAL_CHARS:K3,REGEX_SPECIAL_CHARS_BACKREF:Y3,REPLACEMENTS:m_}=jo,X3=(e,t)=>{if(typeof t.expandRange=="function")return t.expandRange(...e,t);e.sort();const n=`[${e.join("-")}]`;try{new RegExp(n)}catch{return e.map(i=>_n.escapeRegex(i)).join("..")}return n},fa=(e,t)=>`Missing ${e}: "${t}" - use "\\\\${t}" to match literal characters`,g_=e=>{const t=[];let n=0,r=0,i=0,s="",o=!1;for(const l of e){if(o===!0){s+=l,o=!1;continue}if(l==="\\"){s+=l,o=!0;continue}if(l==='"'){i=i===1?0:1,s+=l;continue}if(i===0){if(l==="[")n++;else if(l==="]"&&n>0)n--;else if(n===0){if(l==="(")r++;else if(l===")"&&r>0)r--;else if(l==="|"&&r===0){t.push(s),s="";continue}}}s+=l}return t.push(s),t},Q3=e=>{let t=!1;for(const n of e){if(t===!0){t=!1;continue}if(n==="\\"){t=!0;continue}if(/[?*+@!()[\]{}]/.test(n))return!1}return!0},v_=e=>{let t=e.trim(),n=!0;for(;n===!0;)n=!1,/^@\([^\\()[\]{}|]+\)$/.test(t)&&(t=t.slice(2,-1),n=!0);if(Q3(t))return t.replace(/\\(.)/g,"$1")},e9=e=>{const t=e.map(v_).filter(Boolean);for(let n=0;n<t.length;n++)for(let r=n+1;r<t.length;r++){const i=t[n],s=t[r],o=i[0];if(!(!o||i!==o.repeat(i.length)||s!==o.repeat(s.length))&&(i===s||i.startsWith(s)||s.startsWith(i)))return!0}return!1},kp=(e,t=!0)=>{if(e[0]!=="+"&&e[0]!=="*"||e[1]!=="(")return;let n=0,r=0,i=0,s=!1;for(let o=1;o<e.length;o++){const l=e[o];if(s===!0){s=!1;continue}if(l==="\\"){s=!0;continue}if(l==='"'){i=i===1?0:1;continue}if(i!==1){if(l==="["){n++;continue}if(l==="]"&&n>0){n--;continue}if(!(n>0)){if(l==="("){r++;continue}if(l===")"&&(r--,r===0))return t===!0&&o!==e.length-1?void 0:{type:e[0],body:e.slice(2,o),end:o}}}}},t9=e=>{let t=0;const n=[];for(;t<e.length;){const i=kp(e.slice(t),!1);if(!i||i.type!=="*")return;const s=g_(i.body).map(l=>l.trim());if(s.length!==1)return;const o=v_(s[0]);if(!o||o.length!==1)return;n.push(o),t+=i.end+1}return n.length<1?void 0:`${n.length===1?_n.escapeRegex(n[0]):`[${n.map(i=>_n.escapeRegex(i)).join("")}]`}*`},n9=e=>{let t=0,n=e.trim(),r=kp(n);for(;r;)t++,n=r.body.trim(),r=kp(n);return t},r9=(e,t)=>{if(t.maxExtglobRecursion===!1)return{risky:!1};const n=typeof t.maxExtglobRecursion=="number"?t.maxExtglobRecursion:jo.DEFAULT_MAX_EXTGLOB_RECURSION,r=g_(e).map(i=>i.trim());if(r.length>1&&(r.some(i=>i==="")||r.some(i=>/^[*?]+$/.test(i))||e9(r)))return{risky:!0};for(const i of r){const s=t9(i);if(s)return{risky:!0,safeOutput:s};if(n9(i)>n)return{risky:!0}}return{risky:!1}},Td=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");e=m_[e]||e;const n={...t},r=typeof n.maxLength=="number"?Math.min(bl,n.maxLength):bl;let i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);const s={type:"bos",value:"",output:n.prepend||""},o=[s],l=n.capture?"":"?:",c=_n.isWindows(t),p=jo.globChars(c),d=jo.extglobChars(p),{DOT_LITERAL:h,PLUS_LITERAL:v,SLASH_LITERAL:y,ONE_CHAR:g,DOTS_SLASH:k,NO_DOT:_,NO_DOT_SLASH:x,NO_DOTS_SLASH:S,QMARK:T,QMARK_NO_DOT:I,STAR:O,START_ANCHOR:R}=p,B=ce=>`(${l}(?:(?!${R}${ce.dot?k:h}).)*?)`,L=n.dot?"":_,V=n.dot?T:I;let q=n.bash===!0?B(n):O;n.capture&&(q=`(${q})`),typeof n.noext=="boolean"&&(n.noextglob=n.noext);const D={input:e,index:-1,start:0,dot:n.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};e=_n.removePrefix(e,D),i=e.length;const X=[],M=[],Y=[];let w=s,F;const _e=()=>D.index===i-1,se=D.peek=(ce=1)=>e[D.index+ce],pe=D.advance=()=>e[++D.index]||"",N=()=>e.slice(D.index+1),Ee=(ce="",Oe=0)=>{D.consumed+=ce,D.index+=Oe},ie=ce=>{D.output+=ce.output!=null?ce.output:ce.value,Ee(ce.value)},z=()=>{let ce=1;for(;se()==="!"&&(se(2)!=="("||se(3)==="?");)pe(),D.start++,ce++;return ce%2===0?!1:(D.negated=!0,D.start++,!0)},je=ce=>{D[ce]++,Y.push(ce)},le=ce=>{D[ce]--,Y.pop()},ne=ce=>{if(w.type==="globstar"){const Oe=D.braces>0&&(ce.type==="comma"||ce.type==="brace"),ve=ce.extglob===!0||X.length&&(ce.type==="pipe"||ce.type==="paren");ce.type!=="slash"&&ce.type!=="paren"&&!Oe&&!ve&&(D.output=D.output.slice(0,-w.output.length),w.type="star",w.value="*",w.output=q,D.output+=w.output)}if(X.length&&ce.type!=="paren"&&(X[X.length-1].inner+=ce.value),(ce.value||ce.output)&&ie(ce),w&&w.type==="text"&&ce.type==="text"){w.value+=ce.value,w.output=(w.output||"")+ce.value;return}ce.prev=w,o.push(ce),w=ce},Je=(ce,Oe)=>{const ve={...d[Oe],conditions:1,inner:""};ve.prev=w,ve.parens=D.parens,ve.output=D.output,ve.startIndex=D.index,ve.tokensIndex=o.length;const Re=(n.capture?"(":"")+ve.open;je("parens"),ne({type:ce,value:Oe,output:D.output?"":g}),ne({type:"paren",extglob:!0,value:pe(),output:Re}),X.push(ve)},Ke=ce=>{const Oe=e.slice(ce.startIndex,D.index+1),ve=e.slice(ce.startIndex+2,D.index),Re=r9(ve,n);if((ce.type==="plus"||ce.type==="star")&&Re.risky){const E=Re.safeOutput?(ce.output?"":g)+(n.capture?`(${Re.safeOutput})`:Re.safeOutput):void 0,ue=o[ce.tokensIndex];ue.type="text",ue.value=Oe,ue.output=E||_n.escapeRegex(Oe);for(let H=ce.tokensIndex+1;H<o.length;H++)o[H].value="",o[H].output="",delete o[H].suffix;D.output=ce.output+ue.output,D.backtrack=!0,ne({type:"paren",extglob:!0,value:F,output:""}),le("parens");return}let Ge=ce.close+(n.capture?")":""),Ze;if(ce.type==="negate"){let E=q;if(ce.inner&&ce.inner.length>1&&ce.inner.includes("/")&&(E=B(n)),(E!==q||_e()||/^\)+$/.test(N()))&&(Ge=ce.close=`)$))${E}`),ce.inner.includes("*")&&(Ze=N())&&/^\.[^\\/.]+$/.test(Ze)){const ue=Td(Ze,{...t,fastpaths:!1}).output;Ge=ce.close=`)${ue})${E})`}ce.prev.type==="bos"&&(D.negatedExtglob=!0)}ne({type:"paren",extglob:!0,value:F,output:Ge}),le("parens")};if(n.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(e)){let ce=!1,Oe=e.replace(Y3,(ve,Re,Ge,Ze,E,ue)=>Ze==="\\"?(ce=!0,ve):Ze==="?"?Re?Re+Ze+(E?T.repeat(E.length):""):ue===0?V+(E?T.repeat(E.length):""):T.repeat(Ge.length):Ze==="."?h.repeat(Ge.length):Ze==="*"?Re?Re+Ze+(E?q:""):q:Re?ve:`\\${ve}`);return ce===!0&&(n.unescape===!0?Oe=Oe.replace(/\\/g,""):Oe=Oe.replace(/\\+/g,ve=>ve.length%2===0?"\\\\":ve?"\\":"")),Oe===e&&n.contains===!0?(D.output=e,D):(D.output=_n.wrapOutput(Oe,D,t),D)}for(;!_e();){if(F=pe(),F==="\0")continue;if(F==="\\"){const ve=se();if(ve==="/"&&n.bash!==!0||ve==="."||ve===";")continue;if(!ve){F+="\\",ne({type:"text",value:F});continue}const Re=/^\\+/.exec(N());let Ge=0;if(Re&&Re[0].length>2&&(Ge=Re[0].length,D.index+=Ge,Ge%2!==0&&(F+="\\")),n.unescape===!0?F=pe():F+=pe(),D.brackets===0){ne({type:"text",value:F});continue}}if(D.brackets>0&&(F!=="]"||w.value==="["||w.value==="[^")){if(n.posix!==!1&&F===":"){const ve=w.value.slice(1);if(ve.includes("[")&&(w.posix=!0,ve.includes(":"))){const Re=w.value.lastIndexOf("["),Ge=w.value.slice(0,Re),Ze=w.value.slice(Re+2),E=J3[Ze];if(E){w.value=Ge+E,D.backtrack=!0,pe(),!s.output&&o.indexOf(w)===1&&(s.output=g);continue}}}(F==="["&&se()!==":"||F==="-"&&se()==="]")&&(F=`\\${F}`),F==="]"&&(w.value==="["||w.value==="[^")&&(F=`\\${F}`),n.posix===!0&&F==="!"&&w.value==="["&&(F="^"),w.value+=F,ie({value:F});continue}if(D.quotes===1&&F!=='"'){F=_n.escapeRegex(F),w.value+=F,ie({value:F});continue}if(F==='"'){D.quotes=D.quotes===1?0:1,n.keepQuotes===!0&&ne({type:"text",value:F});continue}if(F==="("){je("parens"),ne({type:"paren",value:F});continue}if(F===")"){if(D.parens===0&&n.strictBrackets===!0)throw new SyntaxError(fa("opening","("));const ve=X[X.length-1];if(ve&&D.parens===ve.parens+1){Ke(X.pop());continue}ne({type:"paren",value:F,output:D.parens?")":"\\)"}),le("parens");continue}if(F==="["){if(n.nobracket===!0||!N().includes("]")){if(n.nobracket!==!0&&n.strictBrackets===!0)throw new SyntaxError(fa("closing","]"));F=`\\${F}`}else je("brackets");ne({type:"bracket",value:F});continue}if(F==="]"){if(n.nobracket===!0||w&&w.type==="bracket"&&w.value.length===1){ne({type:"text",value:F,output:`\\${F}`});continue}if(D.brackets===0){if(n.strictBrackets===!0)throw new SyntaxError(fa("opening","["));ne({type:"text",value:F,output:`\\${F}`});continue}le("brackets");const ve=w.value.slice(1);if(w.posix!==!0&&ve[0]==="^"&&!ve.includes("/")&&(F=`/${F}`),w.value+=F,ie({value:F}),n.literalBrackets===!1||_n.hasRegexChars(ve))continue;const Re=_n.escapeRegex(w.value);if(D.output=D.output.slice(0,-w.value.length),n.literalBrackets===!0){D.output+=Re,w.value=Re;continue}w.value=`(${l}${Re}|${w.value})`,D.output+=w.value;continue}if(F==="{"&&n.nobrace!==!0){je("braces");const ve={type:"brace",value:F,output:"(",outputIndex:D.output.length,tokensIndex:D.tokens.length};M.push(ve),ne(ve);continue}if(F==="}"){const ve=M[M.length-1];if(n.nobrace===!0||!ve){ne({type:"text",value:F,output:F});continue}let Re=")";if(ve.dots===!0){const Ge=o.slice(),Ze=[];for(let E=Ge.length-1;E>=0&&(o.pop(),Ge[E].type!=="brace");E--)Ge[E].type!=="dots"&&Ze.unshift(Ge[E].value);Re=X3(Ze,n),D.backtrack=!0}if(ve.comma!==!0&&ve.dots!==!0){const Ge=D.output.slice(0,ve.outputIndex),Ze=D.tokens.slice(ve.tokensIndex);ve.value=ve.output="\\{",F=Re="\\}",D.output=Ge;for(const E of Ze)D.output+=E.output||E.value}ne({type:"brace",value:F,output:Re}),le("braces"),M.pop();continue}if(F==="|"){X.length>0&&X[X.length-1].conditions++,ne({type:"text",value:F});continue}if(F===","){let ve=F;const Re=M[M.length-1];Re&&Y[Y.length-1]==="braces"&&(Re.comma=!0,ve="|"),ne({type:"comma",value:F,output:ve});continue}if(F==="/"){if(w.type==="dot"&&D.index===D.start+1){D.start=D.index+1,D.consumed="",D.output="",o.pop(),w=s;continue}ne({type:"slash",value:F,output:y});continue}if(F==="."){if(D.braces>0&&w.type==="dot"){w.value==="."&&(w.output=h);const ve=M[M.length-1];w.type="dots",w.output+=F,w.value+=F,ve.dots=!0;continue}if(D.braces+D.parens===0&&w.type!=="bos"&&w.type!=="slash"){ne({type:"text",value:F,output:h});continue}ne({type:"dot",value:F,output:h});continue}if(F==="?"){if(!(w&&w.value==="(")&&n.noextglob!==!0&&se()==="("&&se(2)!=="?"){Je("qmark",F);continue}if(w&&w.type==="paren"){const Re=se();let Ge=F;if(Re==="<"&&!_n.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(w.value==="("&&!/[!=<:]/.test(Re)||Re==="<"&&!/<([!=]|\w+>)/.test(N()))&&(Ge=`\\${F}`),ne({type:"text",value:F,output:Ge});continue}if(n.dot!==!0&&(w.type==="slash"||w.type==="bos")){ne({type:"qmark",value:F,output:I});continue}ne({type:"qmark",value:F,output:T});continue}if(F==="!"){if(n.noextglob!==!0&&se()==="("&&(se(2)!=="?"||!/[!=<:]/.test(se(3)))){Je("negate",F);continue}if(n.nonegate!==!0&&D.index===0){z();continue}}if(F==="+"){if(n.noextglob!==!0&&se()==="("&&se(2)!=="?"){Je("plus",F);continue}if(w&&w.value==="("||n.regex===!1){ne({type:"plus",value:F,output:v});continue}if(w&&(w.type==="bracket"||w.type==="paren"||w.type==="brace")||D.parens>0){ne({type:"plus",value:F});continue}ne({type:"plus",value:v});continue}if(F==="@"){if(n.noextglob!==!0&&se()==="("&&se(2)!=="?"){ne({type:"at",extglob:!0,value:F,output:""});continue}ne({type:"text",value:F});continue}if(F!=="*"){(F==="$"||F==="^")&&(F=`\\${F}`);const ve=K3.exec(N());ve&&(F+=ve[0],D.index+=ve[0].length),ne({type:"text",value:F});continue}if(w&&(w.type==="globstar"||w.star===!0)){w.type="star",w.star=!0,w.value+=F,w.output=q,D.backtrack=!0,D.globstar=!0,Ee(F);continue}let ce=N();if(n.noextglob!==!0&&/^\([^?]/.test(ce)){Je("star",F);continue}if(w.type==="star"){if(n.noglobstar===!0){Ee(F);continue}const ve=w.prev,Re=ve.prev,Ge=ve.type==="slash"||ve.type==="bos",Ze=Re&&(Re.type==="star"||Re.type==="globstar");if(n.bash===!0&&(!Ge||ce[0]&&ce[0]!=="/")){ne({type:"star",value:F,output:""});continue}const E=D.braces>0&&(ve.type==="comma"||ve.type==="brace"),ue=X.length&&(ve.type==="pipe"||ve.type==="paren");if(!Ge&&ve.type!=="paren"&&!E&&!ue){ne({type:"star",value:F,output:""});continue}for(;ce.slice(0,3)==="/**";){const H=e[D.index+4];if(H&&H!=="/")break;ce=ce.slice(3),Ee("/**",3)}if(ve.type==="bos"&&_e()){w.type="globstar",w.value+=F,w.output=B(n),D.output=w.output,D.globstar=!0,Ee(F);continue}if(ve.type==="slash"&&ve.prev.type!=="bos"&&!Ze&&_e()){D.output=D.output.slice(0,-(ve.output+w.output).length),ve.output=`(?:${ve.output}`,w.type="globstar",w.output=B(n)+(n.strictSlashes?")":"|$)"),w.value+=F,D.globstar=!0,D.output+=ve.output+w.output,Ee(F);continue}if(ve.type==="slash"&&ve.prev.type!=="bos"&&ce[0]==="/"){const H=ce[1]!==void 0?"|$":"";D.output=D.output.slice(0,-(ve.output+w.output).length),ve.output=`(?:${ve.output}`,w.type="globstar",w.output=`${B(n)}${y}|${y}${H})`,w.value+=F,D.output+=ve.output+w.output,D.globstar=!0,Ee(F+pe()),ne({type:"slash",value:"/",output:""});continue}if(ve.type==="bos"&&ce[0]==="/"){w.type="globstar",w.value+=F,w.output=`(?:^|${y}|${B(n)}${y})`,D.output=w.output,D.globstar=!0,Ee(F+pe()),ne({type:"slash",value:"/",output:""});continue}D.output=D.output.slice(0,-w.output.length),w.type="globstar",w.output=B(n),w.value+=F,D.output+=w.output,D.globstar=!0,Ee(F);continue}const Oe={type:"star",value:F,output:q};if(n.bash===!0){Oe.output=".*?",(w.type==="bos"||w.type==="slash")&&(Oe.output=L+Oe.output),ne(Oe);continue}if(w&&(w.type==="bracket"||w.type==="paren")&&n.regex===!0){Oe.output=F,ne(Oe);continue}(D.index===D.start||w.type==="slash"||w.type==="dot")&&(w.type==="dot"?(D.output+=x,w.output+=x):n.dot===!0?(D.output+=S,w.output+=S):(D.output+=L,w.output+=L),se()!=="*"&&(D.output+=g,w.output+=g)),ne(Oe)}for(;D.brackets>0;){if(n.strictBrackets===!0)throw new SyntaxError(fa("closing","]"));D.output=_n.escapeLast(D.output,"["),le("brackets")}for(;D.parens>0;){if(n.strictBrackets===!0)throw new SyntaxError(fa("closing",")"));D.output=_n.escapeLast(D.output,"("),le("parens")}for(;D.braces>0;){if(n.strictBrackets===!0)throw new SyntaxError(fa("closing","}"));D.output=_n.escapeLast(D.output,"{"),le("braces")}if(n.strictSlashes!==!0&&(w.type==="star"||w.type==="bracket")&&ne({type:"maybe_slash",value:"",output:`${y}?`}),D.backtrack===!0){D.output="";for(const ce of D.tokens)D.output+=ce.output!=null?ce.output:ce.value,ce.suffix&&(D.output+=ce.suffix)}return D};Td.fastpaths=(e,t)=>{const n={...t},r=typeof n.maxLength=="number"?Math.min(bl,n.maxLength):bl,i=e.length;if(i>r)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${r}`);e=m_[e]||e;const s=_n.isWindows(t),{DOT_LITERAL:o,SLASH_LITERAL:l,ONE_CHAR:c,DOTS_SLASH:p,NO_DOT:d,NO_DOTS:h,NO_DOTS_SLASH:v,STAR:y,START_ANCHOR:g}=jo.globChars(s),k=n.dot?h:d,_=n.dot?v:d,x=n.capture?"":"?:",S={negated:!1,prefix:""};let T=n.bash===!0?".*?":y;n.capture&&(T=`(${T})`);const I=L=>L.noglobstar===!0?T:`(${x}(?:(?!${g}${L.dot?p:o}).)*?)`,O=L=>{switch(L){case"*":return`${k}${c}${T}`;case".*":return`${o}${c}${T}`;case"*.*":return`${k}${T}${o}${c}${T}`;case"*/*":return`${k}${T}${l}${c}${_}${T}`;case"**":return k+I(n);case"**/*":return`(?:${k}${I(n)}${l})?${_}${c}${T}`;case"**/*.*":return`(?:${k}${I(n)}${l})?${_}${T}${o}${c}${T}`;case"**/.*":return`(?:${k}${I(n)}${l})?${o}${c}${T}`;default:{const V=/^(.*?)\.(\w+)$/.exec(L);if(!V)return;const q=O(V[1]);return q?q+o+V[2]:void 0}}},R=_n.removePrefix(e,S);let B=O(R);return B&&n.strictSlashes!==!0&&(B+=`${l}?`),B};var i9=Td;const a9=Oo,o9=G3,Cp=i9,Id=Bo,s9=Ll,l9=e=>e&&typeof e=="object"&&!Array.isArray(e),sn=(e,t,n=!1)=>{if(Array.isArray(e)){const d=e.map(v=>sn(v,t,n));return v=>{for(const y of d){const g=y(v);if(g)return g}return!1}}const r=l9(e)&&e.tokens&&e.input;if(e===""||typeof e!="string"&&!r)throw new TypeError("Expected pattern to be a non-empty string");const i=t||{},s=Id.isWindows(t),o=r?sn.compileRe(e,t):sn.makeRe(e,t,!1,!0),l=o.state;delete o.state;let c=()=>!1;if(i.ignore){const d={...t,ignore:null,onMatch:null,onResult:null};c=sn(i.ignore,d,n)}const p=(d,h=!1)=>{const{isMatch:v,match:y,output:g}=sn.test(d,o,t,{glob:e,posix:s}),k={glob:e,state:l,regex:o,posix:s,input:d,output:g,match:y,isMatch:v};return typeof i.onResult=="function"&&i.onResult(k),v===!1?(k.isMatch=!1,h?k:!1):c(d)?(typeof i.onIgnore=="function"&&i.onIgnore(k),k.isMatch=!1,h?k:!1):(typeof i.onMatch=="function"&&i.onMatch(k),h?k:!0)};return n&&(p.state=l),p};sn.test=(e,t,n,{glob:r,posix:i}={})=>{if(typeof e!="string")throw new TypeError("Expected input to be a string");if(e==="")return{isMatch:!1,output:""};const s=n||{},o=s.format||(i?Id.toPosixSlashes:null);let l=e===r,c=l&&o?o(e):e;return l===!1&&(c=o?o(e):e,l=c===r),(l===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?l=sn.matchBase(e,t,n,i):l=t.exec(c)),{isMatch:!!l,match:l,output:c}};sn.matchBase=(e,t,n,r=Id.isWindows(n))=>(t instanceof RegExp?t:sn.makeRe(t,n)).test(a9.basename(e));sn.isMatch=(e,t,n)=>sn(t,n)(e);sn.parse=(e,t)=>Array.isArray(e)?e.map(n=>sn.parse(n,t)):Cp(e,{...t,fastpaths:!1});sn.scan=(e,t)=>o9(e,t);sn.compileRe=(e,t,n=!1,r=!1)=>{if(n===!0)return e.output;const i=t||{},s=i.contains?"":"^",o=i.contains?"":"$";let l=`${s}(?:${e.output})${o}`;e&&e.negated===!0&&(l=`^(?!${l}).*$`);const c=sn.toRegex(l,t);return r===!0&&(c.state=e),c};sn.makeRe=(e,t={},n=!1,r=!1)=>{if(!e||typeof e!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return t.fastpaths!==!1&&(e[0]==="."||e[0]==="*")&&(i.output=Cp.fastpaths(e,t)),i.output||(i=Cp(e,t)),sn.compileRe(i,t,n,r)};sn.toRegex=(e,t)=>{try{const n=t||{};return new RegExp(e,n.flags||(n.nocase?"i":""))}catch(n){if(t&&t.debug===!0)throw n;return/$^/}};sn.constants=s9;var u9=sn,c9=u9;const y_=Oo,b_=A3,Fr=c9,Sp=Bo,Dv=e=>e===""||e==="./",x_=e=>{const t=e.indexOf("{");return t>-1&&e.indexOf("}",t)>-1},Lt=(e,t,n)=>{t=[].concat(t),e=[].concat(e);let r=new Set,i=new Set,s=new Set,o=0,l=d=>{s.add(d.output),n&&n.onResult&&n.onResult(d)};for(let d=0;d<t.length;d++){let h=Fr(String(t[d]),{...n,onResult:l},!0),v=h.state.negated||h.state.negatedExtglob;v&&o++;for(let y of e){let g=h(y,!0);(v?!g.isMatch:g.isMatch)&&(v?r.add(g.output):(r.delete(g.output),i.add(g.output)))}}let p=(o===t.length?[...s]:[...i]).filter(d=>!r.has(d));if(n&&p.length===0){if(n.failglob===!0)throw new Error(`No matches found for "${t.join(", ")}"`);if(n.nonull===!0||n.nullglob===!0)return n.unescape?t.map(d=>d.replace(/\\/g,"")):t}return p};Lt.match=Lt;Lt.matcher=(e,t)=>Fr(e,t);Lt.isMatch=(e,t,n)=>Fr(t,n)(e);Lt.any=Lt.isMatch;Lt.not=(e,t,n={})=>{t=[].concat(t).map(String);let r=new Set,i=[],s=l=>{n.onResult&&n.onResult(l),i.push(l.output)},o=new Set(Lt(e,t,{...n,onResult:s}));for(let l of i)o.has(l)||r.add(l);return[...r]};Lt.contains=(e,t,n)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${y_.inspect(e)}"`);if(Array.isArray(t))return t.some(r=>Lt.contains(e,r,n));if(typeof t=="string"){if(Dv(e)||Dv(t))return!1;if(e.includes(t)||e.startsWith("./")&&e.slice(2).includes(t))return!0}return Lt.isMatch(e,t,{...n,contains:!0})};Lt.matchKeys=(e,t,n)=>{if(!Sp.isObject(e))throw new TypeError("Expected the first argument to be an object");let r=Lt(Object.keys(e),t,n),i={};for(let s of r)i[s]=e[s];return i};Lt.some=(e,t,n)=>{let r=[].concat(e);for(let i of[].concat(t)){let s=Fr(String(i),n);if(r.some(o=>s(o)))return!0}return!1};Lt.every=(e,t,n)=>{let r=[].concat(e);for(let i of[].concat(t)){let s=Fr(String(i),n);if(!r.every(o=>s(o)))return!1}return!0};Lt.all=(e,t,n)=>{if(typeof e!="string")throw new TypeError(`Expected a string: "${y_.inspect(e)}"`);return[].concat(t).every(r=>Fr(r,n)(e))};Lt.capture=(e,t,n)=>{let r=Sp.isWindows(n),s=Fr.makeRe(String(e),{...n,capture:!0}).exec(r?Sp.toPosixSlashes(t):t);if(s)return s.slice(1).map(o=>o===void 0?"":o)};Lt.makeRe=(...e)=>Fr.makeRe(...e);Lt.scan=(...e)=>Fr.scan(...e);Lt.parse=(e,t)=>{let n=[];for(let r of[].concat(e||[]))for(let i of b_(String(r),t))n.push(Fr.parse(i,t));return n};Lt.braces=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return t&&t.nobrace===!0||!x_(e)?[e]:b_(e,t)};Lt.braceExpand=(e,t)=>{if(typeof e!="string")throw new TypeError("Expected a string");return Lt.braces(e,{...t,expand:!0})};Lt.hasBraces=x_;var p9=Lt;const d9=Wi(p9),f9=[".ts",".tsx",".js",".jsx",".md",".json"],Bc=5e3,h9=["**/node_modules/**","**/.git/**","**/.next/**","**/dist/**","**/build/**","**/.cache/**","**/coverage/**","**/test/**","**/__tests__/**","**/*.test.*","**/*.spec.*"],__=(e,t=[])=>d9.isMatch(e,[...h9,...t])?!1:f9.some(n=>e.toLowerCase().endsWith(n)),w_=e=>{const t=e.split(`
`);return t.length<=Bc?e:`${t.slice(0,Bc).join(`
`)}

// ... [${t.length-Bc} lines truncated, file too long] ...

`};async function m9(e,t={}){const r=await new FZ().loadAsync(e),i=[];return await Promise.all(Object.keys(r.files).map(async s=>{const o=r.files[s];if(!(o.dir||!__(s,t.ignorePatterns)))try{const l=await o.async("string");i.push({path:s,content:w_(l)})}catch(l){console.warn(`Failed to read file ${s}:`,l)}})),i.sort((s,o)=>s.path.localeCompare(o.path))}async function g9(e,t={}){const n=[];let r="Project";if(e.length>0){const o=(e[0].webkitRelativePath||"").split("/");o.length>0&&o[0]&&(r=o[0])}return await Promise.all(Array.from(e).map(async i=>{const s=i.webkitRelativePath||i.name;if(__(s,t.ignorePatterns))try{const o=await i.text();n.push({path:s.includes("/")?s.substring(s.indexOf("/")+1):s,content:w_(o)})}catch(o){console.warn(`Failed to read file ${s}:`,o)}})),{files:n.sort((i,s)=>i.path.localeCompare(s.path)),projectName:r}}async function v9(e,t={}){const n=e.name.replace(".zip","");return{files:await m9(e,t),projectName:n}}function y9({onSuccess:e,onError:t}={}){const[n,r]=W.useState(null),[i,s]=W.useState(!1),{fetch:o,isPending:l,error:c}=IZ(),{id:p}=gr(),d=async(y,g)=>{const k=await o({body:{chatId:p,name:y,type:"code",files:g}});if(!k?.data)throw new Error("Failed to upload project");return k.data};return{processZipFile:async y=>{try{r(null),s(!0);const{files:g,projectName:k}=await v9(y,{ignorePatterns:["**/node_modules/**"]}),_=await d(k,g);return e?.({..._,id:vl(),status:"ready"},k),_}catch(g){throw r("Failed to process zip file"),t?.("Failed to process zip file"),console.error("Error processing zip:",g),g}finally{s(!1)}},processFolder:async y=>{try{r(null),s(!0);const{files:g,projectName:k}=await g9(y,{ignorePatterns:["**/node_modules/**"]}),_=await d(k,g);return e?.({..._,id:vl(),status:"ready"},k),_}catch(g){throw r("Failed to process folder"),t?.("Failed to process folder"),console.error("Error processing folder:",g),g}finally{s(!1)}},isLoading:i||l,error:c||n}}const Un=()=>{const{formatMessage:e}=pt();return{t:(n,r)=>e({id:n,defaultMessage:r})}},k_=W.createContext({isCodeUploadOpen:!1,submitOnFinish:!1,openCodeUpload:()=>{},closeCodeUpload:()=>{}}),jd=()=>W.useContext(k_),b9=({children:e})=>{const[t,n]=W.useState(!1),[r,i]=W.useState(!1),s=l=>{n(!0),i(l??!1)},o=()=>n(!1);return m.jsxs(k_.Provider,{value:{isCodeUploadOpen:t,submitOnFinish:r,openCodeUpload:s,closeCodeUpload:o},children:[t&&m.jsx(w9,{}),e]})},Fv=({importType:e,onAddFiles:t,error:n})=>{const[r,i]=W.useState(!1),s=W.useRef(null),{t:o}=Un(),l=g=>{g.preventDefault()},c=g=>{g.preventDefault(),i(!0)},p=()=>i(!1),d=g=>{g.preventDefault(),s.current?.click()},h=()=>{const g=s.current?.files;g&&t(Array.from(g))},v=async g=>{const k=g.createReader(),_=()=>new Promise((T,I)=>{k.readEntries(T,I)}),x=[];let S=[];do{S=await _();for(const T of S)if(T.isFile){const I=T,O=await new Promise((R,B)=>{I.file(R,B)});Object.defineProperty(O,"webkitRelativePath",{writable:!0,value:T.fullPath.substring(1)}),x.push(O)}else if(T.isDirectory){const O=await v(T);x.push(...O)}}while(S.length>0);return x},y=async g=>{if(g.preventDefault(),i(!1),!!g.dataTransfer?.items)if(e==="folder"){const k=g.dataTransfer.items,_=[];for(let x=0;x<k.length;x++){const T=k[x].webkitGetAsEntry?.();if(T){if(T.isDirectory){const I=await v(T);_.push(...I)}else if(T.isFile){const I=await new Promise((O,R)=>{T.file(O,R)});_.push(I)}}}_.length>0&&t(_)}else g.dataTransfer.files&&t(Array.from(g.dataTransfer.files))};return m.jsxs(ke,{position:"relative",cursor:"pointer",width:"100%",height:"100%",minHeight:"140px",borderStyle:"dashed",borderColor:r?"primary500":n?"danger600":"neutral200",background:r?"primary100":n?"danger100":"neutral100",hasRadius:!0,padding:7,justifyContent:"center",direction:"column",alignItems:"center",gap:2,onDragEnter:c,onDragLeave:p,onDragOver:l,onDrop:y,children:[e==="zip"?m.jsx(vy,{width:"24px",height:"24px"}):m.jsx(Pp,{width:"24px",height:"24px"}),m.jsxs(ke,{direction:"column",alignItems:"center",gap:2,children:[m.jsxs(ze,{variant:"omega",textColor:"neutral600",textAlign:"center",children:[e==="zip"?o("chat.code-upload.drop-zone","Drop here a .zip file here or"):o("chat.code-upload.drop-zone-folder","Drop here a folder here or")," ",m.jsx(ze,{variant:"omega",textColor:"primary600",onClick:d,children:o("chat.code-upload.drop-zone-browse","browse files")})]}),n&&m.jsx(ze,{variant:"pi",textColor:"danger600",children:n})]}),m.jsx(Ne,{tag:"input",position:"absolute",left:0,right:0,bottom:0,top:0,width:"100%",name:"code","aria-label":"Upload project",tabIndex:-1,zIndex:1,ref:s,onChange:h,style:{opacity:0,cursor:"pointer"},type:"file",...e==="zip"?{accept:".zip",multiple:!1}:{multiple:!0,webkitdirectory:"",directory:""}})]})},x9=({setFileName:e,error:t,processZipFile:n,processFolder:r})=>{const{t:i}=Un(),{nextStep:s}=r_();return m.jsxs(ke,{direction:"column",gap:6,alignItems:"start",width:"100%",children:[m.jsxs(ke,{direction:"column",gap:2,alignItems:"start",children:[m.jsx(ze,{variant:"beta",children:i("chat.code-upload.title","Import code")}),m.jsx(ze,{variant:"omega",textColor:"neutral600",children:i("chat.code-upload.description","Your app will be analyzed by AI. Make sure to remove all sensitive data before importation.")})]}),m.jsxs(ke,{gap:3,width:"100%",wrap:"wrap",children:[m.jsx(Ne,{flex:1,minWidth:"200px",children:m.jsx(Fv,{importType:"zip",onAddFiles:o=>{if(o.length>0){const l=o[0];e(l.name.replace(".zip","")),s(),n(l)}},error:t})}),m.jsx(Ne,{flex:1,minWidth:"200px",children:m.jsx(Fv,{importType:"folder",onAddFiles:async o=>{if(o.length>0)try{const p=(o[0].webkitRelativePath||"").split("/")[0]||"Project";e(p),s(),await r(o)}catch(l){console.error("Error processing folder:",l)}},error:t})})]})]})},_9=({projectName:e,isLoading:t,error:n})=>{const{t:r}=Un();return m.jsxs(ke,{direction:"column",gap:6,alignItems:"start",width:"100%",children:[m.jsxs(ke,{direction:"column",gap:2,alignItems:"start",children:[m.jsx(ze,{variant:"beta",children:r("chat.code-upload.confirmation-title","Confirm Code Import")}),m.jsx(ze,{variant:"omega",textColor:"neutral600",children:r("chat.code-upload.confirmation-description","Your code is ready to be imported. Click finish to add it to your chat.")})]}),m.jsx(Ne,{width:"100%",children:m.jsx(qp,{attachment:{id:vl(),status:t?"loading":"ready",filename:e||"",url:"",type:"file",mediaType:Yy},error:n,minWidth:"256px"})})]})},w9=()=>{const[e,t]=W.useState(null),[n,r]=W.useState(null),{t:i}=Un(),{addAttachments:s}=Lo(),{processZipFile:o,processFolder:l,isLoading:c,error:p}=y9({onSuccess:I=>r(I)}),{isCodeUploadOpen:d,closeCodeUpload:h,submitOnFinish:v}=jd(),{sendMessage:y,openChat:g,input:k,setInput:_}=gr(),x=()=>{t(null),r(null),h()},S=async()=>{g(),n&&v?y({role:"user",parts:[{type:"text",text:"Create schemas from my uploaded project"},n]}):n&&(k||_("Create schemas from my uploaded project"),s([n])),h()},T=()=>!!n;return m.jsxs(Li,{open:d,onOpenChange:I=>{I||x()},title:i("chat.code-upload.header","Import code"),onCancel:x,onComplete:S,children:[m.jsx(Li.Step,{title:i("chat.code-upload.step1-title","Import code"),nextLabel:i("chat.code-upload.continue-button","Continue"),cancelLabel:i("common.cancel","Cancel"),disableNext:!n||c,onNext:T,children:m.jsx(x9,{setFileName:t,error:p,processZipFile:o,processFolder:l})}),m.jsx(Li.Step,{title:i("chat.code-upload.step2-title","Confirm"),nextLabel:i("common.finish","Finish"),backLabel:i("form.button.back","Back"),disableNext:!n||c,children:m.jsx(_9,{projectName:e,isLoading:c,error:p})})]})},k9=ht(Ne)`
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
  width: 100%;
  border-radius: 4px 4px 0 0;
  overflow: hidden;
  cursor: pointer;
`,C9=ht(Wp)`
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  // make it appear gracefully when first rendering
  animation: ${ga.fadeIn} 0.3s ease;
`,S9=ht(yT)`
  height: 100%;
  width: 100%;
  ${({$selected:e,theme:t})=>e?`
      border: 2px solid ${t.colors.primary600};
      outline: 0px solid transparent;
    `:`
      border: 2px solid transparent;
      outline: 1px solid ${t.colors.neutral200};
    `}
  transition: all 0.2s ease-in-out;
`,E9=({imageUrl:e,imageName:t,selected:n=!1,onSelect:r})=>m.jsx(Qs.Root,{src:e,alt:t,children:m.jsxs(S9,{role:"button",$selected:n,children:[m.jsxs(dT,{children:[m.jsx(fT,{checked:n,onCheckedChange:r}),m.jsx(hT,{position:"end",children:m.jsx(Qs.Trigger,{children:m.jsx(hr,{label:"Preview",type:"button",children:m.jsx(yy,{})})})}),m.jsx(k9,{onClick:r,children:m.jsx(C9,{src:e,alt:t})})]}),m.jsx(mT,{children:m.jsx(gT,{children:m.jsx(vT,{children:t})})})]})}),C_="strapi-ai-figma-token",Rd=()=>{try{return localStorage.getItem(C_)||""}catch(e){return console.error("Error accessing localStorage:",e),""}},A9=e=>{try{localStorage.setItem(C_,e)}catch(t){console.error("Error saving to localStorage:",t)}},Ep=()=>!!Rd(),T9=e=>{const t=/figma\.com\/(?:file|design)\/([a-zA-Z0-9]+)\/.*[?&]node-id=([^&]+)/,n=e.match(t);if(!n)throw new Error("Invalid Figma URL");const r=n[1],i=decodeURIComponent(n[2]).replace(/-/g,":");return{fileKey:r,nodeId:i}},S_=()=>{const e=Rd();if(!e)throw new Error("Figma API token is required");return e},I9=async(e,t)=>{const n=S_();try{const r=`https://api.figma.com/v1/files/${e}/nodes?ids=${t}`,i=await fetch(r,{headers:{"X-Figma-Token":n}});if(!i.ok)throw new Error(`Figma API error: ${i.status} ${i.statusText}`);return(await i.json()).nodes[t]}catch(r){const i=r instanceof Error?r.message:"Failed to fetch Figma data";throw new Error(i)}},E_=e=>{const t=[];if(e.type==="FRAME")return t.push({id:e.id,name:e.name}),t;if(e.children&&e.children.length>0)for(const n of e.children)t.push(...E_(n));return t},j9=async(e,t)=>{const n=S_();if(t.length===0)return{images:{}};try{const r=t.slice(0,50).join(","),i=`https://api.figma.com/v1/images/${e}?ids=${r}&format=png&scale=0.4`,s=await fetch(i,{headers:{"X-Figma-Token":n}});if(!s.ok){const l=await s.text();throw new Error(`Figma API image error: ${s.status} ${s.statusText} - ${l}`)}const o=await s.json();if(o.err)throw new Error(`Figma API image error: ${o.err}`);return o}catch(r){const i=r instanceof Error?r.message:"Failed to fetch Figma node images";throw new Error(i)}};function R9({onSuccess:e,onError:t}={}){const[n,r]=W.useState(!1),[i,s]=W.useState(null);return{processFigmaUrl:async l=>{try{if(!Ep()){const x="Figma API token is required";throw s(x),t?.(x),new Error(x)}r(!0),s(null);const{fileKey:c,nodeId:p}=T9(l),d=await I9(c,p);if(!d.document)return;const h=E_(d.document),v=new Map(h.map(x=>[x.id,x.name])),y=h.map(x=>x.id),k=(await j9(c,y)).images,_=Object.entries(k).map(([x,S])=>({id:x,type:"file",filename:v.get(x),mediaType:"image/png",url:S,status:"ready"}));return e?.(_),_}catch(c){const p=c instanceof Error?c.message:"Unknown error processing Figma URL";throw s(p),t?.(p),console.error("Error processing Figma URL:",c),c}finally{r(!1)}},isLoading:n,error:i}}const A_=W.createContext({isFigmaUploadOpen:!1,submitOnFinish:!1,openFigmaUpload:()=>{},closeFigmaUpload:()=>{}}),Od=()=>{const e=W.useContext(A_);if(!e)throw new Error("useUploadFigmaToChat must be used within an UploadFigmaToChatProvider");return e},O9=({children:e})=>{const[t,n]=W.useState(!1),[r,i]=W.useState(!1),s=l=>{n(!0),i(l??!1)},o=()=>n(!1);return m.jsxs(A_.Provider,{value:{isFigmaUploadOpen:t,submitOnFinish:r,openFigmaUpload:s,closeFigmaUpload:o},children:[t&&m.jsx(M9,{}),e]})},z9=({figmaUrl:e,setFigmaUrl:t})=>{const{t:n}=Un(),{isLoading:r}=r_(),[i,s]=W.useState(!Ep()),[o,l]=W.useState(Rd),c=()=>{o.trim()&&(A9(o),s(!1))};return i?m.jsxs(ke,{direction:"column",gap:6,alignItems:"start",children:[m.jsxs(ke,{direction:"column",gap:2,alignItems:"start",children:[m.jsx(ze,{variant:"beta",children:n("chat.figma-upload.token-title","Enter Figma API Token")}),m.jsx(ze,{variant:"omega",textColor:"neutral600",children:n("chat.figma-upload.token-description","To access your Figma designs, you need to provide a personal access token. This will be stored securely in your browser.")}),m.jsx(_l,{href:"https://help.figma.com/hc/en-us/articles/8085703771159-Manage-personal-access-tokens",isExternal:!0,children:n("chat.figma-upload.token-help","How to get a Figma API token")})]}),m.jsx(Ne,{width:"100%",children:m.jsx(Yr,{name:"figma-token",placeholder:n("chat.figma-upload.token-placeholder","Enter Figma API token"),"aria-label":n("chat.figma-upload.token-placeholder","Enter Figma API token"),value:o,onChange:p=>l(p.target.value),width:"100%",disabled:r,type:"password"})}),m.jsxs(ke,{gap:2,children:[m.jsx(ft,{onClick:c,disabled:!o.trim(),variant:"secondary",children:n("chat.figma-upload.save-token","Save token")}),m.jsx(ft,{onClick:()=>s(!1),variant:"tertiary",disabled:!Ep(),children:n("chat.figma-upload.cancel","Cancel")})]})]}):m.jsxs(ke,{direction:"column",gap:6,alignItems:"start",children:[m.jsxs(ke,{direction:"column",gap:2,alignItems:"start",width:"100%",children:[m.jsxs(ke,{justifyContent:"space-between",alignItems:"center",width:"100%",children:[m.jsx(ze,{variant:"beta",children:n("chat.figma-upload.title","Import Figma Design")}),m.jsx(ft,{onClick:()=>s(!0),variant:"tertiary",size:"S",children:n("chat.figma-upload.edit-token","Edit API token")})]}),m.jsx(ze,{variant:"omega",textColor:"neutral600",children:n("chat.figma-upload.description","Ask to turn your designs into schemas by attaching a link to one or multiple frames in your Figma files. (Max 15 frames)")})]}),m.jsx(Ne,{width:"100%",children:m.jsx(Yr,{name:"figma-url",placeholder:n("chat.figma-upload.url-placeholder","Enter Figma URL"),"aria-label":n("chat.figma-upload.url-placeholder","Enter Figma URL"),value:e,onChange:p=>t(p.target.value),width:"100%",disabled:r,type:"url"})})]})},N9=({images:e,selectedImages:t,setSelectedImages:n})=>{const{t:r}=Un(),i=()=>{if(t.length===e.length)n([]);else{const o=e.map(l=>l.id);n(o)}};if(e.length===0)return m.jsx(ke,{direction:"column",gap:4,alignItems:"center",padding:4,children:m.jsx(ze,{variant:"omega",children:r("chat.figma-upload.no-images","No frames found in the Figma file.")})});const s=o=>{const l=t.includes(o)?t.filter(c=>c!==o):[...t,o];n(l)};return m.jsxs(ke,{direction:"column",gap:4,alignItems:"start",width:"100%",height:"min(45vh, 400px)",children:[m.jsxs(ke,{justifyContent:"space-between",width:"100%",alignItems:"center",children:[m.jsx(ze,{variant:"beta",children:r("chat.figma-upload.select-images","Select Frames to Import")}),m.jsxs(ke,{gap:3,alignItems:"center",children:[m.jsxs(ze,{children:[t.length," of ",e.length," selected"]}),m.jsx(ft,{onClick:i,type:"button",variant:"secondary",children:t.length===e.length?r("chat.figma-upload.deselect-all","Deselect All"):r("chat.figma-upload.select-all","Select All")})]})]}),m.jsx(Ne,{paddingRight:4,width:"100%",style:{overflowY:"auto"},children:m.jsx(fr.Root,{gap:4,children:e.map((o,l)=>{const c=t.includes(o.id);return m.jsx(fr.Item,{col:6,xs:12,padding:"1px",children:m.jsx(E9,{imageUrl:o.url,imageName:o.filename||`Frame ${l+1}`,selected:c,onSelect:()=>s(o.id)})},o.id)})})})]})},M9=()=>{const[e,t]=W.useState(""),[n,r]=W.useState([]),[i,s]=W.useState([]),{t:o}=Un(),{addAttachments:l}=Lo(),{isFigmaUploadOpen:c,closeFigmaUpload:p,submitOnFinish:d}=Od(),{input:h,setInput:v,setMessages:y,sendMessage:g,openChat:k}=gr(),{processFigmaUrl:_,isLoading:x,error:S}=R9({onSuccess:B=>{r(B);const L=B.slice(0,15).map(V=>V.id);s(L)}}),T=async()=>(await _(e),!0),I=B=>{if(!B)return!1;try{const L=new URL(B);return L.hostname==="www.figma.com"||L.hostname==="figma.com"}catch{return!1}},O=()=>{t(""),r([]),s([]),p()},R=()=>{const B=n.filter(L=>i.includes(L.id));if(B.length===0){p();return}k(),d?(g({role:"user",parts:[{type:"text",text:"Create schemas from the attached images"},...B]}),p()):(h||v("Create schemas from the attached images"),l(B),p())};return m.jsxs(Li,{open:c,onOpenChange:B=>{B||O()},title:o("chat.figma-upload.header","Import from Figma"),onCancel:O,onComplete:R,children:[m.jsx(Li.Step,{title:o("chat.figma-upload.step1-title","Enter Figma URL"),nextLabel:o("chat.figma-upload.import-button","Import"),cancelLabel:o("form.button.cancel","Cancel"),disableNext:!e||x||!I(e),onNext:T,children:m.jsx(z9,{figmaUrl:e,setFigmaUrl:t,error:S})}),m.jsx(Li.Step,{title:o("chat.figma-upload.step2-title","Preview Images"),nextLabel:o("form.button.finish","Finish"),backLabel:o("form.button.back","Back"),disableNext:i.length===0,children:m.jsx(N9,{images:n,selectedImages:i,setSelectedImages:s})})]})},Lv=e=>e.startsWith("plugin::"),Bv=(e,t)=>{if(e.plugin||Lv(e.uid))return!0;if(t&&"modelType"in t&&t.modelType==="contentType"){const n=t;return!!n.plugin||Lv(String(n.uid))}return!1},P9={create:"NEW",remove:"REMOVED",update:"CHANGED"},Uc=(e,t,n)=>({...t,name:e,status:n}),$9=(e,t,n)=>{if(!t||n?.status==="NEW")return"NEW";const r=Ys(e,["status"]),i=Ys(t,["status"]);return xo(r,i)?t.status:"CHANGED"},Uv=(e,t)=>e.action?P9[e.action]:t?t.status:"NEW",Zv=({action:e,attributes:t},n)=>{if(e==="create"||!n)return Object.entries(t).map(([o,l])=>Uc(o,l,"NEW"));const r=n.attributes.reduce((o,l)=>({...o,[l.name]:l}),{}),i=Object.entries(t).map(([o,l])=>{const c=r[o],p=$9({...l,name:o},c,n);return Uc(o,l,p)});if(n?.status==="NEW")return i;const s=Object.entries(r).filter(([o])=>!t[o]).map(([o,l])=>Uc(o,l,"REMOVED"));return[...i,...s]},D9=(e,t)=>{const n=Ca.singular(e.name).toLowerCase().replace(/ /g,"-"),r=Ca.plural(e.name).toLowerCase().replace(/ /g,"-");if(e.modelType==="component")return{category:e.category||"default",modelName:n,attributes:Zv(e,t),info:{displayName:e.name,description:e.description},modelType:e.modelType,uid:e.uid,collectionName:r,status:Uv(e,t),globalId:n};const i={uid:e.uid,modelType:e.modelType,modelName:n,kind:e.kind,info:{displayName:e.name.charAt(0).toUpperCase()+e.name.slice(1),singularName:t?.info?.singularName||n,pluralName:t?.info?.pluralName||r},collectionName:r,attributes:Zv(e,t),options:{draftAndPublish:e.options?.draftAndPublish??!0},pluginOptions:{i18n:{localized:e.options?.localized??!1}},visible:!0,status:Uv(e,t),globalId:n,restrictRelationsTo:null};if(Bv(e,t)&&t&&t.modelType==="contentType"){const s=t;return{...i,plugin:s.plugin??e.plugin,globalId:s.globalId,modelName:s.modelName,collectionName:s.collectionName,info:{...i.info,singularName:s.info.singularName,pluralName:s.info.pluralName},options:{...s.options,...i.options,draftAndPublish:e.options?.draftAndPublish??s.options?.draftAndPublish??!0},pluginOptions:{...s.pluginOptions,...i.pluginOptions,i18n:{...s.pluginOptions?.i18n??{},...i.pluginOptions?.i18n??{},localized:e.options?.localized??s.pluginOptions?.i18n?.localized??!1}},visible:s.visible,restrictRelationsTo:s.restrictRelationsTo}}return Bv(e,t)&&e.plugin?{...i,plugin:e.plugin}:i},F9=W.createContext(void 0),L9={create:"add",update:"update",remove:"delete"};function B9(e){if(e.role!=="assistant")return[];const t=[];return e.parts?.forEach((n,r)=>{if(n&&typeof n=="object"&&n.type==="tool-schemaGenerationTool"){const i=n.output;if(!i||i.error||!Array.isArray(i.schemas))return;const s=n.toolCallId??`${e.id}-${r}`;i.schemas.forEach((o,l)=>{const c=`${s}-${o.uid??o.name??l}`,p=o.action||"update";t.push({type:p,schema:o,revisionId:c})})}}),t}const U9=({children:e})=>{const[t,n]=W.useState(null),{messages:r,status:i}=gr(),{contentTypes:s,components:o,applyChange:l}=er(),c=Ui("SchemaChatProvider",d=>d.dispatch),p=Ui("SchemaChatProvider",d=>d.state);return W.useEffect(()=>{const d=r[r.length-1];if(!d||d.role!=="assistant"||i!=="ready")return;const h=B9(d),v=p.completedActions.includes(Xs.contentTypeBuilder.addField);h.forEach(y=>{const g=s[y.schema.uid]||o[y.schema.uid],k=D9(y.schema,g);!v&&y.schema.attributes&&y.type!=="remove"&&Object.keys(y.schema.attributes).length>0&&c({type:"set_completed_actions",payload:[Xs.contentTypeBuilder.addField]}),l({action:L9[y.type],schema:k})}),n(d.id)},[r]),m.jsx(F9.Provider,{value:{lastRevisedId:t,setLastRevisedId:n},children:e})},T_=W.createContext(void 0),Hv=()=>Math.random().toString(36).substring(2,15),Z9=({children:e,defaultOpen:t=!1})=>{const[n,r]=W.useState(Hv()),[i,s]=W.useState(t),[o,l]=W.useState(0),[c,p]=W.useState(""),[d,h]=W.useState([]),{trackUsage:v}=Oa(),{components:y,contentTypes:g}=er(),{lastSeenSchemas:k}=PZ(),_=W.useMemo(()=>[...Object.values(g).filter(M=>M.status!=="REMOVED").filter(M=>M.uid!=="plugin::users-permissions.user").filter(M=>M.visible).map(gv),...Object.values(y).filter(M=>M.status!=="REMOVED").map(gv)],[g,y]),{id:x,messages:S,sendMessage:T,status:I,stop:O,...R}=OZ({id:n?.toString(),experimental_throttle:100}),B=async(M,Y)=>{if(!(I==="streaming"||I==="submitted"))return T(M,{...Y,body:{...Y?.body,schemas:_,metadata:{lastSeenSchemas:k.map(w=>w.uid)}}})},L=M=>{if(M.preventDefault(),I==="streaming"||I==="submitted")return;const Y=d.filter(F=>F.status!=="loading");if(c.trim().length===0&&d.length===0)return;const w=Y.map(F=>({type:"file",filename:F.filename,mediaType:F.mediaType,url:F.url}));B({text:c,files:w}),p(""),h([])},{title:V,generateTitle:q,resetTitle:D}=zZ({chatId:x,messages:S});W.useEffect(()=>{S.length>=1&&!V&&q()},[S.length,V,q]),W.useEffect(()=>{I==="error"?v("didAnswerMessage",{successful:!1}):I==="ready"&&S.length>0&&S[S.length-1]?.role==="assistant"&&v("didAnswerMessage",{successful:!0})},[I,S,v]);const X=by();return m.jsx(T_.Provider,{value:{isChatEnabled:X,id:x,status:I,stop:O,sendMessage:B,...R,messages:S,handleSubmit:L,input:c,setInput:p,handleInputChange:M=>p(M.target.value),reset:()=>{O(),r(Hv()),v("didStartNewChat"),D()},schemas:_,title:V,isChatOpen:i,openChat:()=>{s(!0),o===0&&v("didStartNewChat"),l(M=>M+1)},closeChat:()=>s(!1),attachments:d,setAttachments:h},children:e})},H9=({children:e,defaultOpen:t=!1})=>m.jsx(Z9,{defaultOpen:t,children:m.jsx(U9,{children:m.jsx(b9,{children:m.jsx(O9,{children:m.jsx(W9,{children:e})})})})});function gr(){const e=W.useContext(T_);if(e===void 0)throw new Error("useStrapiChat must be used within a ChatProvider");return e}const I_=()=>{const{fetch:e,isPending:t,error:n}=jZ(),{id:r,messages:i,schemas:s}=gr(),{toggleNotification:o}=Ra(),{trackUsage:l}=Oa(),{t:c}=Un(),[p,d]=W.useState({}),h=g=>!!p[g];return{upvoteMessage:g=>h(g)?Promise.resolve():(l("didVoteAnswer",{value:"positive"}),o({type:"success",message:c("chat.feedback.submitted","Thank you for your feedback! ")}),d(k=>({...k,[g]:"upvote"})),e({body:{type:"upvote",chatId:r,messageId:g,messages:i,schemas:s}})),downvoteMessage:(g,k,_)=>(l("didVoteAnswer",{value:"negative"}),o({type:"success",message:c("chat.feedback.submitted","Thank you for your feedback! ")}),e({body:{type:"downvote",chatId:r,messageId:g,messages:i,feedback:k,reasons:_,schemas:s}})),isPending:t,error:n}},j_=W.createContext({isFeedbackModalOpen:!1,currentMessageId:null,openFeedbackModal:()=>{},closeFeedbackModal:()=>{}}),R_=()=>W.useContext(j_),W9=({children:e})=>{const[t,n]=W.useState(!1),[r,i]=W.useState(null),s=l=>{i(l),n(!0)},o=()=>{n(!1),i(null)};return m.jsxs(j_.Provider,{value:{isFeedbackModalOpen:t,currentMessageId:r,openFeedbackModal:s,closeFeedbackModal:o},children:[t&&r&&m.jsx(G9,{}),e]})},q9=ht(ke)`
  &:hover {
    background-color: ${({theme:e})=>e.colors.neutral100};
  }

  &.selected {
    background-color: ${({theme:e})=>e.colors.primary100};
    border-color: ${({theme:e})=>e.colors.primary200};
  }
`,V9=({id:e,label:t,selected:n,onClick:r})=>m.jsxs(q9,{className:n?"selected":"",justifyContent:"space-between",hasRadius:!0,width:"100%",cursor:"pointer",borderColor:"neutral200",padding:3,gap:3,onClick:()=>r(e),children:[m.jsx(ze,{variant:"omega",fontWeight:"bold",children:t}),m.jsx(wl,{name:`feedback-${e}`,value:e,checked:n,onChange:()=>r(e)})]}),G9=()=>{const[e,t]=W.useState(""),[n,r]=W.useState([]),{t:i}=Un(),{toggleNotification:s}=Ra(),{closeFeedbackModal:o,currentMessageId:l}=R_(),{downvoteMessage:c,isPending:p}=I_(),d=[{id:"invalid_schema",label:i("chat.feedback.reason.invalid_schema","Invalid schema")},{id:"bad_recommendation",label:i("chat.feedback.reason.bad_recommendation","Bad recommendation")},{id:"slow",label:i("chat.feedback.reason.slow","Slow")},{id:"instructions_ignored",label:i("chat.feedback.reason.instructions_ignored","Instructions ignored")},{id:"being_lazy",label:i("chat.feedback.reason.being_lazy","Being lazy")},{id:"other",label:i("chat.feedback.reason.other","Other")}],h=y=>{r(g=>g.includes(y)?g.filter(k=>k!==y):[...g,y])},v=async()=>{if(n.length!==0)try{await c(l,e,n),t(""),r([]),o()}catch{s({type:"danger",message:i("chat.feedback.error","An error occurred while submitting your feedback")})}};return m.jsx(fn.Root,{open:!0,onOpenChange:o,children:m.jsxs(fn.Content,{children:[m.jsx(fn.Header,{children:m.jsx(ze,{variant:"omega",fontWeight:"bold",children:i("chat.feedback.title","Give feedback")})}),m.jsx(fn.Body,{children:m.jsxs(ke,{direction:"column",alignItems:"start",gap:6,width:"100%",children:[m.jsxs(ke,{direction:"column",alignItems:"start",gap:2,children:[m.jsx(ze,{variant:"beta",fontWeight:"bold",children:i("chat.feedback.title","Give feedback")}),m.jsx(ze,{variant:"omega",children:i("chat.feedback.subtitle","Provide additional feedback on this message. Select all that apply.")})]}),m.jsx(fr.Root,{width:"100%",gap:2,children:d.map(y=>m.jsx(fr.Item,{col:6,xs:12,children:m.jsx(V9,{id:y.id,label:y.label,selected:n.includes(y.id),onClick:h},y.id)},y.id))}),m.jsxs(ke,{direction:"column",gap:2,width:"100%",alignItems:"start",children:[m.jsx(ze,{variant:"omega",children:i("chat.feedback.comment.label","How can we improve? (optional)")}),m.jsx(Ne,{width:"100%",children:m.jsx(Dp,{name:"feedback",placeholder:i("chat.feedback.placeholder","Your feedback..."),onChange:y=>t(y.target.value),value:e})})]})]})}),m.jsxs(fn.Footer,{children:[m.jsx(fn.Close,{children:m.jsx(ft,{variant:"tertiary",onClick:o,children:i("form.button.cancel","Cancel")})}),m.jsx(ft,{onClick:v,loading:p,disabled:n.length===0,children:i("form.button.submit","Submit")})]})]})})},O_=W.createContext(void 0),z_=()=>{const e=W.useContext(O_);if(!e)throw new Error("Collapsible components must be wrapped in <Collapsible />");return e},J9=ht(Ne)`
  overflow: hidden;
  transition: height ${({theme:e})=>e.motion.timings[200]}
    ${({theme:e})=>e.motion.easings.easeOutQuad};
`,K9=({children:e,defaultOpen:t=!1})=>{const[n,r]=W.useState(t);return m.jsx(O_.Provider,{value:{open:n,toggle:()=>r(i=>!i)},children:e})},Y9=({children:e})=>{const{toggle:t,open:n}=z_();return m.jsx(Ne,{onClick:t,style:{cursor:"pointer"},children:typeof e=="function"?e({open:n}):e})},X9=({children:e})=>{const{open:t}=z_(),n=W.useRef(null),[r,i]=W.useState(0);return W.useLayoutEffect(()=>{if(n.current){const s=n.current.scrollHeight;i(s)}},[e]),m.jsx(J9,{ref:n,role:"region","aria-hidden":!t,style:{height:t?`${r}px`:0,visibility:r===0?"hidden":"visible"},children:e})},Q9=zi`
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
`,e8=ht(xT)`
  animation: ${Q9} 1s linear infinite;
`,t8=ht(Ne)`
  transform: rotate(${({$open:e})=>e?"180deg":"0deg"});
  transition: transform ${({theme:e})=>e.motion.timings[200]}
    ${({theme:e})=>e.motion.easings.easeOutQuad};
`,n8=({status:e})=>{switch(e){case"update":return m.jsx(ze,{fontWeight:"semiBold",textColor:"warning500",children:"M"});case"remove":return m.jsx(ze,{fontWeight:"semiBold",textColor:"danger500",children:"D"});case"create":return m.jsx(ze,{fontWeight:"semiBold",textColor:"success500",children:"N"});default:return null}},r8=({title:e,steps:t,state:n})=>{const r=()=>{switch(n){case"success":return m.jsx(_y,{fill:"success500"});case"loading":return m.jsx(e8,{});case"error":return m.jsx($p,{fill:"danger500"});default:return null}};return m.jsx(Ne,{borderWidth:"1px",borderColor:"neutral200",borderStyle:"solid",hasRadius:!0,marginBottom:3,width:"336px",children:m.jsxs(K9,{defaultOpen:!1,children:[m.jsx(Y9,{children:({open:i})=>m.jsx(Ne,{padding:3,borderColor:"neutral200",borderWidth:i?"0 0 1px 0":"0",borderStyle:"solid",children:m.jsxs(ke,{gap:2,alignItems:"center",children:[r(),m.jsx(ze,{children:e}),m.jsx(ke,{marginLeft:"auto",children:m.jsx(t8,{as:bT,$open:i})})]})})}),m.jsx(X9,{children:m.jsx(ke,{gap:3,padding:3,direction:"column",children:t.map(i=>m.jsxs(ke,{gap:2,justifyContent:"space-between",width:"100%",padding:[0,1],children:[i.link?m.jsx(_l,{tag:xy,to:i.link,children:m.jsx(ze,{children:i.description})}):m.jsx(ze,{children:i.description}),m.jsx(n8,{status:i.status})]},i.id))})})]})})},i8=ht(ze)`
  max-width: 65ch;
  margin: 0 auto;
  overflow-wrap: anywhere;
  word-break: break-word;

  h1,
  h2,
  h3,
  h4,
  h5,
  h6 {
    margin-top: 1.25em;
    margin-bottom: 0.5em;
    font-weight: bold;
  }

  p {
    margin-bottom: 1em;
  }

  ul,
  ol {
    padding-left: 1.5em; /* indentation for bullet points */
    margin-bottom: 1em;
  }

  li {
    margin-bottom: 0.5em;
    list-style-type: disc; /* or whatever style you prefer */
  }

  strong {
    font-weight: bold;
  }

  /* code blocks, blockquotes, etc. */
  code {
    background-color: ${({theme:e})=>e.colors.neutral100};
    padding: 0.2em 0.4em;
    border-radius: ${({theme:e})=>e.borderRadius};
    border-color: ${({theme:e})=>e.colors.neutral150};
    border-style: solid;
    font-family: 'SF Mono', SFMono-Regular, ui-monospace, 'DejaVu Sans Mono', Menlo, Consolas,
      monospace;
  }

  /* links */
  a {
    color: ${({theme:e})=>e.colors.primary500};
    background-color: ${({theme:e})=>e.colors.neutral100};
    padding: 0.2em 0.4em;
    border-radius: ${({theme:e})=>e.borderRadius};
    border-color: ${({theme:e})=>e.colors.neutral150};
    border-style: solid;
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }
`,a8=ht(ze)`
  overflow-wrap: anywhere;
  word-break: break-word;
`,o8=e=>e&&typeof e=="object"&&e.type==="tool-schemaGenerationTool",s8=e=>e?e.charAt(0).toUpperCase()+e.slice(1):"",l8=e=>{const t=(e.kind??e.modelType)==="component";if(e.uid)return t?`/plugins/content-type-builder/component-categories/${e.category??""}/${e.uid}`:`/plugins/content-type-builder/content-types/${e.uid}`},u8=e=>{const t=e.output?.schemas??[],n=e.input?.schemas??[],r=t.length?t:n,i=r.length,s=e.output?e.output.error?"error":"success":"loading",o=r.map((c,p)=>({id:`${e.toolCallId??"schemaGenerationTool"}-${c.uid??c.name??p}`,description:s8(c.name??c.uid??"Schema"),status:c.action==="create"||c.action==="update"||c.action==="remove"?c.action:"update",link:l8(c)}));return{type:"marker",title:s==="success"?`Updated ${i} schema${i===1?"":"s"}`:s==="error"?`Failed to update schema${i===1?"":"s"}`:"Updating schemas",state:s,steps:o}},c8=({part:e})=>{if(e.type==="text")return m.jsx(i8,{children:m.jsx(q$,{components:{a:({node:t,...n})=>m.jsx("a",{target:"_blank",rel:"noopener noreferrer",...n})},children:e.text})});if(o8(e)){const t=u8(e);return m.jsx(r8,{...t})}return null},p8=({message:e})=>{const t=e.parts.some(r=>r.type==="text"&&r.text.trim()!==""),n=e.parts.filter(r=>r.type==="file");return m.jsxs(Ky,{as:ke,direction:"column",alignItems:"flex-end",style:{alignSelf:"flex-end"},gap:2,maxWidth:"80%",children:[t?m.jsx(Ne,{background:"neutral150",borderStyle:"none",padding:["10px","16px"],hasRadius:!0,children:e.parts.map((r,i)=>r.type!=="text"?null:m.jsx(a8,{children:r.text},i))}):null,n.map((r,i)=>m.jsx(qp,{attachment:{...r,status:"ready"}},`${r.type==="file"?r.filename:r.type}-${i}`))]})},d8=({message:e,isLoading:t})=>{const{upvoteMessage:n}=I_(),{openFeedbackModal:r}=R_();return m.jsxs(Ne,{style:{alignSelf:"flex-start"},maxWidth:"90%",children:[e.parts.map((i,s)=>m.jsx(c8,{part:i},s)),t?m.jsxs(ke,{gap:1,children:[m.jsx(hr,{label:"Upvote",size:"XS",variant:"ghost",onClick:()=>n(e.id),children:m.jsx(wy,{})}),m.jsx(hr,{label:"Downvote",size:"XS",variant:"ghost",onClick:()=>r(e.id),children:m.jsx(ky,{})})]}):null]})},f8=({message:e,isLoading:t})=>e.role==="user"?m.jsx(p8,{message:e}):m.jsx(d8,{message:e}),h8=ht(Ne).attrs({as:"textarea"})`
  border: none;
  resize: none;
  background: transparent;
  outline: none !important;
  width: 100%;
  min-height: 44px;
  max-height: 160px;
  line-height: ${({theme:e})=>e.lineHeights[4]};
  font-size: ${({theme:e})=>e.fontSizes[2]};
  color: ${({theme:e})=>e.colors.neutral800};
  padding-bottom: ${({theme:e})=>e.spaces[1]};
  overflow-y: auto;

  /* Show partial lines when content exceeds visible area */
  height: ${({rows:e,theme:t})=>e===5?`calc(${e} * ${t.lineHeights[4]} * 1em + 0.7em)`:`calc(${e} * ${t.lineHeights[4]} * 1em)`};

  &:disabled,
  &::placeholder {
    color: ${({theme:e})=>e.colors.neutral600};
  }
`,m8=({value:e,onChange:t,onSubmit:n,placeholder:r})=>{const i=W.useRef(null),[s,o]=W.useState(1),l=p=>{if(!p)return 1;const d=(p.match(/\n/g)||[]).length+1;return Math.min(d,5)};W.useEffect(()=>{o(l(e))},[e]);const c=p=>{i.current?.value.trim()&&p.key==="Enter"&&!p.shiftKey&&n&&(p.preventDefault(),n(p),setTimeout(()=>{i.current?.focus()},10))};return W.useEffect(()=>{i.current?.focus()},[i]),m.jsx(h8,{ref:i,value:e,onChange:t,onKeyDown:c,placeholder:r,rows:s})},g8=W.forwardRef(({children:e,onOpen:t,onClose:n,popoverPlacement:r,...i},s)=>{const o=W.useRef(null),l=_T(s,o),c=p=>{p&&typeof t=="function"?t():!p&&typeof n=="function"&&n()};return m.jsxs(In.Root,{onOpenChange:c,children:[m.jsx(In.Trigger,{ref:l,...i,children:i.label}),m.jsx(In.Content,{zIndex:1e4,popoverPlacement:r,children:e})]})}),Zc=In.Item,v8=ht(ke)`
  @media (max-height: 500px) {
    display: none;
  }
`,y8=()=>{const{sendMessage:e}=gr(),{t}=Un(),{trackUsage:n}=Oa(),r=[t("chat.input.defaults.generate","Generate a product schema"),t("chat.input.defaults.ctb","Tell me about the Content-Type Builder"),t("chat.input.defaults.strapi","Tell me about Strapi")],i={[t("chat.input.defaults.generate","Generate a product schema")]:"generate-product-schema",[t("chat.input.defaults.ctb","Tell me about the Content-Type Builder")]:"tell-me-about-the-content-type-builder",[t("chat.input.defaults.strapi","Tell me about Strapi")]:"tell-me-about-strapi"},s=t("chat.input.defaults.title","How can I help you?");return m.jsx(Ky,{children:m.jsxs(v8,{direction:"column",alignItems:"flex-start",gap:3,children:[m.jsx(ze,{variant:"omega",fontWeight:"bold",children:s}),m.jsx(ke,{direction:"column",alignItems:"flex-start",gap:2,children:r.map(o=>m.jsx(ft,{startIcon:m.jsx(kl,{fill:"neutral500"}),size:"M",variant:"tertiary",onClick:()=>{n("didUsePresetPrompt",{promptType:i[o]}),e({text:o})},children:m.jsx(ze,{fontWeight:"regular",children:o})},o))})]})})},b8=e=>{try{return JSON.parse(e.message).error}catch{return e}},x8=()=>{const{error:e}=gr(),{t}=Un(),n=t("chat.messages.error","Something went wrong."),r=t("chat.messages.too-many-requests","Too many requests, please try again later."),i=t("chat.messages.license-limit-reached","License limit reached, please try again tomorrow."),s=t("chat.messages.license-limit-exceeded","AI credit limit exceeded."),o=t("chat.messages.too-long-error","This conversation reached its maximum length. Start a new conversation");if(!e)return null;const l=b8(e);return!l||typeof l!="string"?null:l===CZ?m.jsx(ao,{title:r,variant:"warning"}):l===SZ?m.jsx(ao,{title:i,variant:"warning"}):l.split(".")[0]===EZ?m.jsx(ao,{title:s,variant:"danger"}):l===AZ?m.jsx(ao,{title:o,variant:"danger"}):m.jsx(ao,{title:n,variant:"danger"})},_8=({messages:e})=>{const t=W.useRef(null),{status:n}=gr();return W.useEffect(()=>{const r=setTimeout(()=>{t.current?.scrollIntoView({behavior:"smooth"})},20);return()=>clearTimeout(r)},[e,n]),m.jsxs(m.Fragment,{children:[m.jsxs(ke,{direction:"column",gap:5,children:[e.map((r,i)=>m.jsx(f8,{message:r,isLoading:(n==="streaming"||n==="submitted")&&i===e.length-1},r.id)),n==="error"&&m.jsx(x8,{})]}),m.jsx("div",{ref:t})]})},w8=()=>{const{attachments:e,removeAttachmentByIndex:t}=Lo();return e.length?m.jsx(Ni.Attachments,{children:e.map((n,r)=>m.jsx(Ne,{maxWidth:"250px",children:m.jsx(qp,{attachment:n,onRemove:()=>t(r)})},n.filename))}):null},k8=()=>{const{attachFiles:e}=Lo(),{openCodeUpload:t}=jd(),{openFigmaUpload:n}=Od(),{t:r}=Un(),i=W.useRef(null),s=r("chat.tooltips.upload-attachments","Upload attachments"),o=r("chat.attachments.menu.import-code","Import code"),l=r("chat.attachments.menu.attach-image","Attach image"),c=r("chat.attachments.menu.import-figma","Import from Figma");return m.jsxs(g8,{label:s,icon:m.jsx(Lp,{}),tag:hr,popoverPlacement:"top-end",children:[m.jsx(Zc,{startIcon:m.jsx(Sy,{}),onSelect:()=>t(),children:o}),m.jsx(Zc,{startIcon:m.jsx(mb,{}),onSelect:()=>n(),children:c}),m.jsx("input",{type:"file",accept:"image/*",multiple:!0,hidden:!0,ref:i}),m.jsx(Zc,{startIcon:m.jsx(wT,{}),onSelect:()=>{const p=i.current;p&&(p.onchange=d=>{const h=d.target;h.files&&h.files.length>0&&e(Array.from(h.files))},p.click())},children:l})]})},C8=({children:e})=>{const[t,n]=W.useState("");return W.useEffect(()=>{const r=["",".","..","..."];let i=0;const s=setInterval(()=>{i=(i+1)%r.length,n(r[i])},400);return()=>clearInterval(s)},[]),m.jsxs(ze,{variant:"pi",textColor:"neutral600",children:[e,t]})},S8=e=>{const{input:t,handleSubmit:n,handleInputChange:r,messages:i,status:s,stop:o,attachments:l}=gr(),{t:c}=Un(),p=s==="streaming"||s==="submitted";return m.jsx(m.Fragment,{children:m.jsx("form",{onSubmit:n,...e,children:m.jsxs(Ni.Root,{isLoading:p,gap:4,children:[m.jsxs(Ni.Header,{minHeight:0,children:[i.length===0&&m.jsx(Ni.HeaderItem,{children:m.jsx(y8,{})}),p&&m.jsx(Ni.HeaderItem,{children:m.jsx(C8,{children:c("chat.input.thinking","Strapi AI is thinking")})})]}),m.jsxs(Ni.Content,{children:[m.jsx(fb.Area,{}),m.jsx(w8,{}),m.jsx(Ne,{paddingBottom:3,children:m.jsx(m8,{value:t,onChange:r,onSubmit:n,placeholder:c("chat.input.placeholder","Ask Strapi AI...")})}),m.jsxs(Ni.Actions,{children:[m.jsx(k8,{}),p?m.jsx(hr,{label:c("chat.tooltips.stop-generation","Stop"),type:"button",variant:"default",onClick:d=>{d.preventDefault(),o()},children:m.jsx(ez,{})}):m.jsx(hr,{label:c("chat.tooltips.send-message","Send"),variant:"default",type:"submit",disabled:t.trim().length===0&&l.length===0,children:m.jsx(Cy,{})})]})]})]})})})},E8=()=>{const{title:e,messages:t,isChatOpen:n,isChatEnabled:r,openChat:i,closeChat:s,reset:o}=gr(),{attachFiles:l}=Lo(),{t:c}=Un(),p=Ui("Chat",x=>x.state),h=Qr("Chat",x=>x.currentEnvironment)==="production";W.useEffect(()=>{p.enabled&&p.tours.contentTypeBuilder?.currentStep===1&&!p.tours.contentTypeBuilder?.isCompleted&&!n&&i&&i()},[p.tours.contentTypeBuilder?.currentStep,p.tours.contentTypeBuilder?.isCompleted,p.enabled,n,i]);const v=c("chat.tooltips.open-chat","Open chat"),y=c("chat.tooltips.close-chat","Close chat"),g=c("chat.tooltips.create-chat","New conversation"),k=c("chat.header.default-title","New conversation"),_=c("chat.input.strapi-ai-can-make-errors","Strapi AI can make mistakes.");return!r||h?null:m.jsx(fb.Root,{onAddFiles:x=>{l(x)},children:m.jsxs(oo.Root,{size:"md",position:"bottom-right",isOpen:n,onToggle:n?s:i,toggleIcon:m.jsx(hr,{onClick:n?s:i,label:n?y:v,variant:"default",size:"L",children:m.jsx(kl,{})}),children:[m.jsxs(oo.Header,{children:[m.jsx(ze,{tag:"h3",variant:"omega",fontWeight:"bold",children:e||k}),m.jsxs(ke,{gap:0,children:[m.jsx(hr,{label:g,variant:"ghost",onClick:o,children:m.jsx(fi,{})}),m.jsx(oo.Close,{label:y})]})]}),m.jsx(oo.Body,{children:m.jsxs(Fp.contentTypeBuilder.AIChat,{children:[t.length?null:m.jsx(ze,{variant:"pi",textColor:"neutral600",children:_}),m.jsx(_8,{messages:t})]})}),m.jsx(oo.Footer,{children:m.jsx(S8,{})})]})})},Q=e=>`${hi}.${e}`,Wv=({status:e})=>{switch(e){case"UNCHANGED":return null;case"CHANGED":return m.jsx(ze,{fontWeight:"semiBold",textColor:"alternative500",children:"M"});case"REMOVED":return m.jsx(ze,{fontWeight:"semiBold",textColor:"danger500",children:"D"});case"NEW":return m.jsx(ze,{fontWeight:"semiBold",textColor:"success500",children:"N"})}},Sq=({status:e})=>{switch(e){case"CHANGED":return m.jsx(Os,{fontWeight:"bold",textColor:"alternative600",backgroundColor:"alternative100",borderColor:"alternative200",children:"Modified"});case"REMOVED":return m.jsx(Os,{fontWeight:"bold",textColor:"danger600",backgroundColor:"danger100",borderColor:"danger200",children:"Deleted"});case"NEW":return m.jsx(Os,{fontWeight:"bold",textColor:"success600",backgroundColor:"success100",borderColor:"success200",children:"New"});case"UNCHANGED":default:return m.jsx(Os,{style:{visibility:"hidden"},fontWeight:"bold",textColor:"warning600",backgroundColor:"warning100",borderColor:"warning200",children:"Unchanged"})}},N_=W.createContext(),Pa=()=>W.useContext(N_),A8=()=>{const{componentsGroupedByCategory:e,isInDevelopmentMode:t,sortedContentTypesList:n}=er(),{trackUsage:r}=Oa(),[i,s]=W.useState(""),{onOpenModalCreateSchema:o}=Pa(),{locale:l}=pt(),{contains:c}=kT(l,{sensitivity:"base"}),p=CT(l,{sensitivity:"base"}),d=()=>{r("willCreateContentType"),o({modalType:"contentType",kind:"collectionType",actionType:"create",forTarget:"contentType"})},h=()=>{r("willCreateSingleType"),o({modalType:"contentType",kind:"singleType",actionType:"create",forTarget:"contentType"})},v=()=>{r("willCreateComponent"),o({modalType:"component",kind:null,actionType:"create",forTarget:"component"})},y=Object.entries(e).map(([_,x])=>({name:_,title:Fi(_),links:x.map(S=>({name:S.uid,to:`/plugins/${hi}/component-categories/${_}/${S.uid}`,title:S.info.displayName,status:S.status})).sort((S,T)=>p.compare(S.title,T.title))})).sort((_,x)=>p.compare(_.title,x.title)),g=n.filter(_=>_.visible).map(_=>({kind:_.kind,name:_.name,to:_.to,title:_.title,status:_.status}));return{menu:[{name:"models",title:{id:`${Q("menu.section.models.name")}`,defaultMessage:"Collection Types"},customLink:t?{id:`${Q("button.model.create")}`,defaultMessage:"Create new collection type",onClick:d}:void 0,links:g.filter(_=>_.kind==="collectionType")},{name:"singleTypes",title:{id:`${Q("menu.section.single-types.name")}`,defaultMessage:"Single Types"},customLink:t?{id:`${Q("button.single-types.create")}`,defaultMessage:"Create new single type",onClick:h}:void 0,links:g.filter(_=>_.kind==="singleType")},{name:"components",title:{id:`${Q("menu.section.components.name")}`,defaultMessage:"Components"},customLink:t?{id:`${Q("button.component.create")}`,defaultMessage:"Create a new component",onClick:v}:void 0,links:y}].map(_=>{if(_.links.some(T=>"links"in T&&Array.isArray(T.links))){let T=0;return{..._,links:_.links.reduce((I,O)=>{const R="links"in O?O.links.filter(B=>c(B.title,i)):[];return R.length===0||(T+=R.length,I.push({...O,links:R.sort((B,L)=>p.compare(B.title,L.title))})),I},[]),linksCount:T}}const S=_.links.filter(T=>c(T.title,i)).sort((T,I)=>p.compare(T.title,I.title));return{..._,links:S,linksCount:S.length}}),search:{value:i,onChange:s,clear:()=>s("")}}},T8=ht(Bp)`
  transform: scaleX(-1);
`,I8=ht(In.Item)`
  color: ${({theme:e})=>e.colors.danger600};

  &:hover {
    background: ${({theme:e,disabled:t})=>!t&&e.colors.danger100};
  }
`,j8=()=>{const{menu:e,search:t}=A8(),{saveSchema:n,isModified:r,history:i,isInDevelopmentMode:s}=er(),{formatMessage:o}=pt(),[l,c]=W.useState(!1),[p,d]=W.useState(!1);W.useEffect(()=>{if(!s)return;const _=x=>{(x.ctrlKey||x.metaKey)&&(x.key==="Enter"?r&&(x.preventDefault(),n()):x.key==="z"&&!x.shiftKey?(x.preventDefault(),i.undo()):(x.key==="y"||x.shiftKey&&x.key==="z"||x.key==="Z")&&(x.preventDefault(),i.redo()))};return document.addEventListener("keydown",_),()=>{document.removeEventListener("keydown",_)}});const h=()=>{d(!0)},v=()=>{c(!1),d(!1),i.discardAllChanges()},y=()=>{i.undo()},g=()=>{i.redo()},k=o({id:Q("plugin.name"),defaultMessage:"Content-Type Builder"});return m.jsxs(ci.Main,{"aria-label":k,children:[m.jsx(ci.Header,{label:k}),m.jsx(Cl,{background:"neutral150"}),m.jsxs(ci.Content,{children:[m.jsxs(ke,{padding:5,gap:3,direction:"column",alignItems:"stretch",children:[m.jsx(Fp.contentTypeBuilder.Save,{children:m.jsxs(ke,{gap:2,children:[m.jsx(ft,{flex:1,onClick:_=>{_.preventDefault(),n()},type:"submit",disabled:!r||!s,fullWidth:!0,size:"S",children:o({id:"global.save",defaultMessage:"Save"})}),m.jsxs(In.Root,{open:l,onOpenChange:c,children:[m.jsxs(In.Trigger,{size:"S",endIcon:null,paddingTop:"4px",paddingLeft:"7px",paddingRight:"7px",variant:"tertiary",children:[m.jsx(ST,{fill:"neutral500","aria-hidden":!0,focusable:!1}),m.jsx(Ey,{tag:"span",children:o({id:"global.more.actions",defaultMessage:"More actions"})})]}),m.jsxs(In.Content,{zIndex:1,children:[m.jsx(In.Item,{disabled:!i.canUndo||!s,onSelect:y,startIcon:m.jsx(T8,{}),children:o({id:"global.last-change.undo",defaultMessage:"Undo last change"})}),m.jsx(In.Item,{disabled:!i.canRedo||!s,onSelect:g,startIcon:m.jsx(Bp,{}),children:o({id:"global.last-change.redo",defaultMessage:"Redo last change"})}),m.jsx(In.Separator,{}),m.jsx(I8,{disabled:!i.canDiscardAll||!s,onSelect:h,children:m.jsxs(ke,{gap:2,children:[m.jsx($p,{}),m.jsx(ze,{children:o({id:"global.last-changes.discard",defaultMessage:"Discard last changes"})})]})})]})]})]})}),m.jsx(Ay,{value:t.value,onChange:_=>t.onChange(_.target.value),onClear:()=>t.onChange(""),placeholder:o({id:Q("search.placeholder"),defaultMessage:"Search"}),size:"S",children:void 0,name:"search_contentType",clearLabel:o({id:"clearLabel",defaultMessage:"Clear"}),"aria-label":o({id:Q("search.placeholder"),defaultMessage:"Search"})})]}),m.jsx(ci.Sections,{children:e.map(_=>m.jsx(W.Fragment,{children:m.jsx(ci.Section,{label:o({id:_.title.id,defaultMessage:_.title.defaultMessage}),link:_.customLink&&{label:o({id:_.customLink?.id,defaultMessage:_.customLink?.defaultMessage}),onClick:_.customLink?.onClick},sectionId:_.name,children:_.links.map(x=>{const S=o({id:x.name,defaultMessage:x.title});return"links"in x?m.jsx(ci.SubSection,{label:x.title,children:x.links.map(T=>{const I=o({id:T.name,defaultMessage:T.title});return m.jsx(ci.Link,{to:T.to,label:I,endAction:m.jsx(Ne,{tag:"span",textAlign:"center",width:"24px",children:m.jsx(Wv,{status:T.status})})},T.name)})},x.name):m.jsx(ci.Link,{to:x.to,label:S,endAction:m.jsx(Ne,{tag:"span",textAlign:"center",width:"24px",children:m.jsx(Wv,{status:x.status})})},x.name)})})},_.name))})]}),m.jsx(Zi.Root,{open:p,onOpenChange:d,children:m.jsx(zo,{onConfirm:v,children:o({id:Q("popUpWarning.discardAll.message"),defaultMessage:"Are you sure you want to discard all changes?"})})})]})},qv=()=>{if(crypto.randomUUID)return`ctb-${crypto.randomUUID()}`},R8=({children:e})=>{const[t,n]=W.useState(()=>qv()),r=W.useCallback(()=>{n(qv())},[]),i=W.useMemo(()=>({sessionId:t,regenerateSessionId:r}),[t,r]);return m.jsx(Jy.Provider,{value:i,children:e})},O8="timeout",z8=30*1e3,N8=()=>{const{get:e}=Ty(),t=async n=>{const r=n??Date.now();if(Date.now()-r>z8)throw new Error(O8);try{if((await e("/content-type-builder/update-schema-status"))?.data?.data?.isUpdating===!0)return new Promise(s=>{setTimeout(()=>t(r).then(s),200)})}catch{return new Promise(s=>{setTimeout(()=>t(r).then(s),200)})}};return t},M8=e=>CR(Object.keys(e).map(t=>({visible:e[t].visible,name:t,title:e[t].info.displayName,plugin:e[t].plugin,uid:t,to:`/plugins/${hi}/content-types/${t}`,kind:e[t].kind,restrictRelationsTo:e[t].restrictRelationsTo,status:e[t].status})).filter(t=>t!==null),t=>ET(t.title)),P8=({components:e,contentTypes:t})=>{const n={newContentTypes:0,editedContentTypes:0,deletedContentTypes:0,newComponents:0,editedComponents:0,deletedComponents:0,newFields:0,editedFields:0,deletedFields:0},r=Object.values(e).filter(s=>["NEW","CHANGED","REMOVED"].includes(s.status)).map(s=>{const o=Vv(s),l=o.action;return Gv({...s,action:l},n,"component"),o}),i=Object.values(t).filter(s=>["NEW","CHANGED","REMOVED"].includes(s.status)).map(s=>{const o=Vv(s),l=o.action;return Gv({...s,action:l},n,"contentType"),o});return{requestData:{components:r,contentTypes:i},trackingEventProperties:n}},$8=e=>Object.fromEntries(Object.entries(e).filter(([t,n])=>Array.isArray(n)?n.length>0:typeof n=="object"&&n!==null?Object.keys(n).length>0:n!=null)),D8=e=>"customField"in e?{...e,type:"customField"}:"targetAttribute"in e?{...e,targetAttribute:e.targetAttribute==="-"?null:e.targetAttribute,...e.conditions&&{conditions:e.conditions}}:e,Vv=e=>{let t;switch(e.status){case"NEW":t="create";break;case"CHANGED":t="update";break;case"REMOVED":return{action:"delete",uid:e.uid};default:throw new Error("Invalid status")}return{action:t,uid:e.uid,category:"category"in e?e.category:void 0,...Ys(e,["info","options","visible","uid","restrictRelationsTo"]),...e.options,...e.info,attributes:e.attributes.map(n=>{let r;switch(n.status){case"NEW":r="create";break;case"REMOVED":return{action:"delete",name:n.name};case"UNCHANGED":case"CHANGED":default:r="update"}return{action:r,name:n.name,properties:$8(Ys(D8(n),["status","name"]))}})}},Gv=(e,t,n)=>{if(!e||typeof e.action!="string")return;const r=n==="contentType";switch(e.action){case"create":r?t.newContentTypes++:t.newComponents++;break;case"update":r?t.editedContentTypes++:t.editedComponents++;break;case"delete":r?t.deletedContentTypes++:t.deletedComponents++;break}Array.isArray(e.attributes)&&(e.action==="delete"?t.deletedFields+=e.attributes.length:e.attributes.forEach(i=>{if(!(!i||typeof i.status!="string"))switch(i.status){case"NEW":t.newFields++;break;case"CHANGED":t.editedFields++;break;case"REMOVED":t.deletedFields++;break}}))},F8=e=>Object.keys(e).reduce((n,r)=>{const i=Kt(e,[r]),s=L8(i);return s.childComponents.length>0&&n.push(s),n},[]),L8=e=>({component:e.uid,childComponents:e.attributes.filter(t=>{const{type:n}=t;return n==="component"}).map(t=>({component:t.component}))}),B8=e=>{const t=Object.keys(e).reduce((n,r)=>{const i=e?.[r]?.attributes??[],s=U8(i,r);return[...n,...s]},[]);return Z8(t)},U8=(e,t)=>e.reduce((n,r)=>{const{type:i}=r;return i==="component"&&n.push({component:r.component,parentCompoUid:t}),n},[]),Z8=e=>{const t=new Map;return e.forEach(({component:r,parentCompoUid:i})=>{t.has(r)||t.set(r,new Set),t.get(r).add(i)}),Array.from(t.entries()).map(([r,i])=>({component:r,uidsOfAllParents:Array.from(i)}))},H8=(e,t)=>{const n=Object.keys(e).map(r=>Kt(e,[r,...t],""));return AT(n)},W8=e=>e["content-type-builder_dataManagerProvider"]||TT,q8=["InitialData","ContentTypesConfiguration","ContentTypeSettings","ComponentConfiguration"],V8=()=>jy.util.invalidateTags(q8),G8=({children:e})=>{const t=Sl(),n=Iy(W8),r=Ui("DataManagerProvider",le=>le.dispatch),i=IT(),{sessionId:s,regenerateSessionId:o}=Hp(),{components:l,contentTypes:c,reservedNames:p,initialComponents:d,initialContentTypes:h,isLoading:v}=n.current,{toggleNotification:y}=Ra(),{lockAppWithAutoreload:g,unlockAppWithAutoreload:k}=jT(),_=N8(),S=_o("DataManagerProvider",le=>le.getPlugin)("content-type-builder"),T=Qr("DataManagerProvider",le=>le.autoReload),{formatMessage:I}=pt(),{trackUsage:O}=Oa(),R=RT("DataManagerProvider",le=>le.refetchPermissions),{onCloseModal:B}=Pa(),[L,V]=W.useState(!1),q=W.useRef(null),D=W.useMemo(()=>!(xo(l,d)&&xo(c,h)),[l,c,d,h]),X=Ty(),M=T,Y=W.useRef(async()=>{});Y.current=async()=>{try{const[le,ne]=await Promise.all([X.get("/content-type-builder/schema"),X.get("/content-type-builder/reserved-names")]),{components:Je,contentTypes:Ke}=le.data.data;t(Jt.init({components:im(Je,ce=>({...ce,status:"UNCHANGED"})),contentTypes:im(Ke,ce=>({...ce,status:"UNCHANGED"})),reservedNames:ne.data})),t(Jt.clearHistory())}catch(le){console.error({err:le}),y({type:"danger",message:I({id:"notification.error",defaultMessage:"An error occurred"})})}},W.useEffect(()=>(Y.current(),q.current=i.pathname,()=>{t(Jt.reloadPlugin())}),[]),W.useEffect(()=>{const le=i.pathname,ne=q.current,Je="/plugins/content-type-builder";if(ne){const Ke=le.includes(Je);!ne.includes(Je)&&Ke&&o()}q.current=le},[i.pathname,o]),W.useEffect(()=>{T||y({type:"info",message:I({id:Q("notification.info.autoreaload-disable")})})},[T,y,I]);const w=le=>F8(le),F=le=>B8(le),_e=async()=>{await R()},se=async()=>{V(!0);const le=S?.apis?.forms,ne=Object.entries(n.current.contentTypes).reduce((Oe,[ve,Re])=>(Oe[ve]=le.mutateContentTypeSchema(Re,h[ve]),Oe),{}),{requestData:Je,trackingEventProperties:Ke}=P8({components:n.current.components,contentTypes:ne});O("willUpdateCTBSchema",{...Ke,ctbSessionId:s});const ce=Object.keys(n.current.contentTypes).length>0;g();try{await X.post("/content-type-builder/update-schema",{data:Je}),ce&&O("didCreateGuidedTourCollectionType"),await _(),o(),await Y.current(),await _e(),t(V8())}catch(Oe){console.error({err:Oe}),y({type:"danger",message:I({id:"notification.error",defaultMessage:"An error occurred"})}),O("didUpdateCTBSchema",{...Ke,success:!1,ctbSessionId:s})}finally{V(!1),k(),t(jy.util.invalidateTags(["GuidedTourMeta","HomepageKeyStatistics"])),r({type:"set_completed_actions",payload:[Xs.contentTypeBuilder.createSchema]}),O("didUpdateCTBSchema",{...Ke,success:!0,ctbSessionId:s})}},pe=W.useMemo(()=>w(l),[l]),N=W.useMemo(()=>F(l),[l]),Ee=W.useMemo(()=>H8(l,["category"]),[l]),ie=W.useMemo(()=>kR(l,"category"),[l]),z=W.useMemo(()=>M8(c),[c]),je={componentsThatHaveOtherComponentInTheirAttributes:pe,nestedComponents:N,saveSchema:se,reservedNames:p,components:l,contentTypes:c,initialComponents:d,initialContentTypes:h,isSaving:L,isModified:D,isInDevelopmentMode:M,allComponentsCategories:Ee,componentsGroupedByCategory:ie,sortedContentTypesList:z,isLoading:v,addAttribute(le){t(Jt.addAttribute(le))},editAttribute(le){t(Jt.editAttribute(le))},addCustomFieldAttribute(le){t(Jt.addCustomFieldAttribute(le))},editCustomFieldAttribute(le){t(Jt.editCustomFieldAttribute(le))},addCreatedComponentToDynamicZone(le){t(Jt.addCreatedComponentToDynamicZone(le))},createSchema(le){t(Jt.createSchema(le))},createComponentSchema({data:le,uid:ne,componentCategory:Je}){t(Jt.createComponentSchema({data:le,uid:ne,componentCategory:Je}))},changeDynamicZoneComponents({forTarget:le,targetUid:ne,dynamicZoneTarget:Je,newComponents:Ke}){t(Jt.changeDynamicZoneComponents({forTarget:le,targetUid:ne,dynamicZoneTarget:Je,newComponents:Ke}))},removeAttribute(le){le.forTarget==="contentType"&&O("willDeleteFieldOfContentType"),t(Jt.removeField(le))},removeComponentFromDynamicZone(le){t(Jt.removeComponentFromDynamicZone(le))},deleteComponent(le){window.confirm(I({id:Q("popUpWarning.bodyMessage.component.delete")}))&&(B(),t(Jt.deleteComponent(le)))},deleteContentType(le){window.confirm(I({id:Q("popUpWarning.bodyMessage.contentType.delete")}))&&(B(),t(Jt.deleteContentType(le)))},updateComponentSchema({data:le,componentUID:ne}){t(Jt.updateComponentSchema({data:le,uid:ne}))},updateComponentUid({componentUID:le,newComponentUID:ne}){t(Jt.updateComponentUid({uid:le,newComponentUID:ne}))},updateSchema(le){t(Jt.updateSchema(le))},moveAttribute(le){t(Jt.moveAttribute(le))},applyChange(le){t(Jt.applyChange(le))},history:{undo(){t(Jt.undo())},redo(){t(Jt.redo())},discardAllChanges(){t(Jt.discardAll())},canUndo:n.past.length>0,canRedo:n.future.length>0,canDiscardAll:D}};return m.jsx(Xb.Provider,{value:je,children:e})},J8=()=>{const{formatMessage:e}=pt(),{isModified:t,isSaving:n}=er(),r=e({id:Q("prompt.unsaved"),defaultMessage:"Are you sure you want to leave? All your modifications will be lost."}),i=OT(s=>s.currentLocation.pathname.startsWith("/plugins/content-type-builder/")&&!s.nextLocation.pathname.startsWith("/plugins/content-type-builder/")&&t);return W.useEffect(()=>{const s=o=>{t&&!n&&(o.preventDefault(),o.returnValue="")};return window.addEventListener("beforeunload",s),()=>window.removeEventListener("beforeunload",s)},[r,t,n]),i.state==="blocked"?m.jsx(Zi.Root,{open:!0,onOpenChange:()=>i.reset(),children:m.jsx(zo,{onConfirm:()=>i.proceed(),children:r})}):null},M_=e=>e.kind==="collectionType"&&(e.restrictRelationsTo===null||Array.isArray(e.restrictRelationsTo)&&e.restrictRelationsTo.length>0),Ap=(e,t)=>e.find(({name:n})=>n===t),K8=(e,t)=>!e||!t?{}:{[e]:t[e]},Y8=e=>(e?.inner||[]).reduce((t,n)=>(n.path&&(t[n.path.split("[").join(".").split("]").join("")]={id:n.message,defaultMessage:n.message,values:K8(n?.type,n?.params)}),t),{}),X8=[{label:"All",children:[{label:"images (JPEG, PNG, GIF, SVG, TIFF, ICO, DVU)",value:"images"},{label:"videos (MPEG, MP4, Quicktime, WMV, AVI, FLV)",value:"videos"},{label:"audios (MP3, WAV, OGG)",value:"audios"},{label:"files (CSV, ZIP, PDF, Excel, JSON, ...)",value:"files"}]}],Q8=({intlLabel:e,name:t,onChange:n,value:r=null})=>{const{formatMessage:i}=pt(),s=r===null||r?.length===0?i({id:"global.none",defaultMessage:"None"}):[...r].sort().map(l=>Fi(l)).join(", "),o=e.id?i({id:e.id,defaultMessage:e.defaultMessage}):t;return m.jsxs(tt.Root,{name:t,children:[m.jsx(tt.Label,{children:o}),m.jsx(Ry,{customizeContent:()=>s,onChange:l=>{l.length>0?n({target:{name:t,value:l,type:"allowed-types-select"}}):n({target:{name:t,value:null,type:"allowed-types-select"}})},options:X8,value:r||[]})]})},Jv={biginteger:io,blocks:UT,boolean:BT,collectionType:lm,component:LT,contentType:lm,date:zs,datetime:zs,decimal:io,dynamiczone:FT,email:DT,enum:sm,enumeration:sm,file:sc,files:sc,float:io,integer:io,json:om,JSON:om,media:sc,number:io,password:$T,relation:PT,richtext:MT,singleType:NT,string:am,text:am,time:zs,timestamp:zs,uid:zT},eH=ht(Ne)`
  svg {
    height: 100%;
    width: 100%;
  }
`,Ro=({type:e,customField:t=null,...n})=>{const r=_o("AttributeIcon",s=>s.customFields.get);let i=Jv[e];if(t){const o=r(t)?.icon;o&&(i=o)}return Jv[e]?m.jsx(eH,{width:"3.2rem",height:"3.2rem",shrink:0,...n,"aria-hidden":!0,children:m.jsx(Ne,{tag:i})}):null},P_=ht(Ne)`
  width: 100%;
  height: 100%;
  border: 1px solid ${({theme:e})=>e.colors.neutral200};
  text-align: left;
  &:hover {
    cursor: pointer;
    background: ${({theme:e})=>e.colors.primary100};
    border: 1px solid ${({theme:e})=>e.colors.primary200};
  }
`,tH=[],nH=()=>m.jsx(ke,{grow:1,justifyContent:"flex-end",children:m.jsxs(ke,{gap:1,hasRadius:!0,background:"alternative100",padding:"0.2rem 0.4rem",children:[m.jsx(kl,{width:"1rem",height:"1rem",fill:"alternative600"}),m.jsx(ze,{textColor:"alternative600",variant:"sigma",children:"New"})]})}),rH=({type:e="text"})=>{const{formatMessage:t}=pt(),{onClickSelectField:n}=Pa(),r=()=>{n({attributeType:e,step:e==="component"?"1":null})};return m.jsx(P_,{padding:4,tag:"button",hasRadius:!0,type:"button",onClick:r,children:m.jsxs(ke,{children:[m.jsx(Ro,{type:e}),m.jsxs(Ne,{paddingLeft:4,width:"100%",children:[m.jsxs(ke,{justifyContent:"space-between",children:[m.jsx(ze,{fontWeight:"bold",textColor:"neutral800",children:t({id:Q(`attribute.${e}`),defaultMessage:e})}),tH.includes(e)&&m.jsx(nH,{})]}),m.jsx(ke,{children:m.jsx(ze,{variant:"pi",textColor:"neutral600",children:t({id:Q(`attribute.${e}.description`),defaultMessage:"A type for modeling data"})})})]})]})})},iH=({attributes:e})=>m.jsx(Up,{tagName:"button",children:m.jsx(ke,{direction:"column",alignItems:"stretch",gap:8,children:e.map((t,n)=>m.jsx(fr.Root,{gap:3,children:t.map(r=>m.jsx(fr.Item,{col:6,xs:12,direction:"column",alignItems:"stretch",children:m.jsx(rH,{type:r})},r))},n))})}),aH=({customFieldUid:e,customField:t})=>{const{type:n,intlLabel:r,intlDescription:i}=t,{formatMessage:s}=pt(),{onClickSelectCustomField:o}=Pa(),l=()=>{o({attributeType:n,customFieldUid:e})};return m.jsx(P_,{padding:4,tag:"button",hasRadius:!0,type:"button",onClick:l,children:m.jsxs(ke,{children:[m.jsx(Ro,{type:n,customField:e}),m.jsxs(Ne,{paddingLeft:4,children:[m.jsx(ke,{children:m.jsx(ze,{fontWeight:"bold",textColor:"neutral800",children:s(r)})}),m.jsx(ke,{children:m.jsx(ze,{variant:"pi",textColor:"neutral600",children:s(i)})})]})]})})},oH=ht(Ne)`
  background: ${({theme:e})=>`linear-gradient(180deg, rgba(234, 234, 239, 0) 0%, ${e.colors.neutral150} 100%)`};
  opacity: 0.33;
`,sH=()=>m.jsx(ke,{wrap:"wrap",gap:4,children:[...Array(4)].map((e,t)=>m.jsx(oH,{height:"138px",width:"375px",hasRadius:!0},`empty-card-${t}`))}),lH=()=>{const{formatMessage:e}=pt();return m.jsxs(Ne,{position:"relative",children:[m.jsx(sH,{}),m.jsx(Ne,{position:"absolute",top:6,width:"100%",children:m.jsxs(ke,{alignItems:"center",justifyContent:"center",direction:"column",children:[m.jsx(Oy,{width:"160px",height:"88px"}),m.jsx(Ne,{paddingTop:6,paddingBottom:4,children:m.jsxs(Ne,{textAlign:"center",children:[m.jsx(ze,{variant:"delta",tag:"p",textColor:"neutral600",children:e({id:Q("modalForm.empty.heading"),defaultMessage:"Nothing in here yet."})}),m.jsx(Ne,{paddingTop:4,children:m.jsx(ze,{variant:"delta",tag:"p",textColor:"neutral600",children:e({id:Q("modalForm.empty.sub-heading"),defaultMessage:"Find what you are looking for through a wide range of extensions."})})})]})}),m.jsx(ZT,{tag:xy,to:`https://market.strapi.io?${HT.stringify({categories:"Custom fields"})}`,variant:"secondary",target:"_blank",startIcon:m.jsx(fi,{}),children:e({id:Q("modalForm.empty.button"),defaultMessage:"Add custom fields"})})]})})]})},uH=()=>{const{formatMessage:e}=pt(),t=_o("CustomFieldsList",i=>i.customFields.getAll),n=Object.entries(t());if(!n.length)return m.jsx(lH,{});const r=n.sort((i,s)=>i[1].name>s[1].name?1:-1);return m.jsx(Up,{tagName:"button",children:m.jsxs(ke,{direction:"column",alignItems:"stretch",gap:3,children:[m.jsx(fr.Root,{gap:3,children:r.map(([i,s])=>m.jsx(fr.Item,{col:6,xs:12,direction:"column",alignItems:"stretch",children:m.jsx(aH,{customFieldUid:i,customField:s},i)},i))}),m.jsx(_l,{href:"https://docs.strapi.io/developer-docs/latest/development/custom-fields.html",isExternal:!0,children:e({id:Q("modalForm.tabs.custom.howToLink"),defaultMessage:"How to add custom fields"})})]})})},cH=({attributes:e,forTarget:t,kind:n})=>{const{formatMessage:r}=pt(),i=Q("modalForm.tabs.default"),s=Q("modalForm.tabs.custom"),o=t.includes("component")?"component":n,l=Q(`modalForm.sub-header.chooseAttribute.${o}`);return m.jsx(fn.Body,{children:m.jsxs(pr.Root,{variant:"simple",defaultValue:"default",children:[m.jsxs(ke,{justifyContent:"space-between",children:[m.jsx(ze,{variant:"beta",tag:"h2",children:r({id:l,defaultMessage:"Select a field"})}),m.jsxs(pr.List,{children:[m.jsx(pr.Trigger,{value:"default",children:r({id:i,defaultMessage:"Default"})}),m.jsx(pr.Trigger,{value:"custom",children:r({id:s,defaultMessage:"Custom"})})]})]}),m.jsx(Cl,{marginBottom:6}),m.jsx(pr.Content,{value:"default",children:m.jsx(iH,{attributes:e})}),m.jsx(pr.Content,{value:"custom",children:m.jsx(uH,{})})]})})},pH=({intlLabel:e,name:t,options:n,onChange:r,value:i=null})=>{const{formatMessage:s}=pt(),o=e.id?s({id:e.id,defaultMessage:e.defaultMessage},{...e.values}):t,l=c=>{let p="";c==="true"&&(p=!0),c==="false"&&(p=!1),r({target:{name:t,value:p,type:"select-default-boolean"}})};return m.jsxs(tt.Root,{name:t,children:[m.jsx(tt.Label,{children:o}),m.jsx(Xr,{onChange:l,value:(i===null?"":i).toString(),children:n.map(({metadatas:{intlLabel:c,disabled:p,hidden:d},key:h,value:v})=>m.jsx(Gn,{value:v,disabled:p,hidden:d,children:c.defaultMessage},h))})]})},dH=ht(ke)`
  position: relative;
  align-items: stretch;

  label {
    max-width: 50%;
    cursor: pointer;
    user-select: none;
    flex: 1;

    ${zy()}
  }

  input {
    position: absolute;
    opacity: 0;
  }

  .option {
    height: 100%;
    will-change: transform, opacity;
    background: ${({theme:e})=>e.colors.neutral0};
    border: 1px solid ${({theme:e})=>e.colors.neutral200};
    border-radius: ${({theme:e})=>e.borderRadius};

    .checkmark {
      position: relative;
      display: block;
      will-change: transform;
      background: ${({theme:e})=>e.colors.neutral0};
      width: ${({theme:e})=>e.spaces[5]};
      height: ${({theme:e})=>e.spaces[5]};
      border: solid 1px ${({theme:e})=>e.colors.neutral300};
      border-radius: 50%;

      &:before,
      &:after {
        content: '';
        display: block;
        border-radius: 50%;
        width: ${({theme:e})=>e.spaces[3]};
        height: ${({theme:e})=>e.spaces[3]};
        position: absolute;
        top: 3px;
        left: 3px;
      }

      &:after {
        transform: scale(0);
        transition: inherit;
        will-change: transform;
      }
    }
  }

  .container input:checked ~ div {
    background: ${({theme:e})=>e.colors.primary100};
    color: ${({theme:e})=>e.colors.primary600};
    .checkmark {
      border: solid 1px ${({theme:e})=>e.colors.primary600};
      &::after {
        background: ${({theme:e})=>e.colors.primary600};
        transform: scale(1);
      }
    }
  }
`,zd=({intlLabel:e,name:t,onChange:n,radios:r=[],value:i})=>{const{formatMessage:s}=pt();return m.jsxs(ke,{direction:"column",alignItems:"stretch",gap:2,children:[m.jsx(ze,{variant:"pi",fontWeight:"bold",textColor:"neutral800",htmlFor:t,tag:"label",children:s(e)}),m.jsx(dH,{gap:4,alignItems:"stretch",children:r.map(o=>m.jsxs("label",{htmlFor:o.value.toString(),className:"container",children:[m.jsx("input",{id:o.value.toString(),name:t,className:"option-input",checked:o.value===i,value:o.value,onChange:n,type:"radio"},o.value),m.jsx(Ne,{className:"option",padding:4,children:m.jsxs(ke,{children:[m.jsx(Ne,{paddingRight:4,children:m.jsx("span",{className:"checkmark"})}),m.jsxs(ke,{direction:"column",alignItems:"stretch",gap:2,children:[m.jsx(ze,{fontWeight:"bold",children:s(o.title)}),m.jsx(ze,{variant:"pi",textColor:"neutral600",children:s(o.description)})]})]})})]},o.value))})]})},fH=({onChange:e,name:t,intlLabel:n,...r})=>{const i=s=>{const o=s.target.value!=="false";e({target:{name:t,value:o,type:"boolean-radio-group"}})};return m.jsx(zd,{...r,name:t,onChange:i,intlLabel:n})},hH=({error:e,intlLabel:t,modifiedData:n,name:r,onChange:i,value:s=null})=>{const{formatMessage:o}=pt(),l=t.id?o({id:t.id,defaultMessage:t.defaultMessage},{...t.values}):r,c=n.type==="biginteger"?"text":"number",p=!n.type,d=e?o({id:e,defaultMessage:e}):"";return m.jsxs(ke,{direction:"column",alignItems:"stretch",gap:2,children:[m.jsx(wl,{id:r,name:r,onCheckedChange:h=>{i({target:{name:r,value:h?c==="text"?"0":0:null}})},checked:s!==null,children:l}),s!==null&&m.jsx(Ne,{paddingLeft:6,style:{maxWidth:"200px"},children:c==="text"?m.jsxs(tt.Root,{error:d,name:r,children:[m.jsx(Yr,{"aria-label":l,disabled:p,onChange:i,value:s===null?"":s,type:"text"}),m.jsx(tt.Error,{})]}):m.jsxs(tt.Root,{error:d,name:r,children:[m.jsx(Ny,{"aria-label":l,disabled:p,onValueChange:h=>{i({target:{name:r,value:h??0,type:c}})},value:s||0}),m.jsx(tt.Error,{})]})})]})},mH=({onChange:e,...t})=>{const{formatMessage:n}=pt(),{toggleNotification:r}=Ra(),i=s=>{r({type:"info",message:n({id:Q("contentType.kind.change.warning"),defaultMessage:"You just changed the kind of a content type: API will be reset (routes, controllers, and services will be overwritten)."})}),e(s)};return m.jsx(zd,{...t,onChange:i})},gH=({description:e,disabled:t=!1,intlLabel:n,isCreating:r,name:i,onChange:s,value:o=!1})=>{const{formatMessage:l}=pt(),[c,p]=W.useState(!1),d=n.id?l({id:n.id,defaultMessage:n.defaultMessage},{...n.values}):i,h=e?l({id:e.id,defaultMessage:e.defaultMessage},{...e.values}):"",v=()=>{s({target:{name:i,value:!1}}),p(!1)},y=g=>{if(!g&&!r){p(!0);return}s({target:{name:i,value:!!g}})};return m.jsxs(m.Fragment,{children:[m.jsxs(tt.Root,{hint:h,name:i,children:[m.jsx(wl,{checked:o,disabled:t,onCheckedChange:y,children:d}),m.jsx(tt.Hint,{})]}),m.jsx(Zi.Root,{open:c,onOpenChange:g=>p(g),children:m.jsx(zo,{endAction:m.jsx(ft,{onClick:v,variant:"danger",width:"100%",justifyContent:"center",children:l({id:Q("popUpWarning.draft-publish.button.confirm"),defaultMessage:"Yes, disable"})}),children:l({id:Q("popUpWarning.draft-publish.message"),defaultMessage:"If you disable the draft & publish, your drafts will be deleted."})})})]})},vH=({deleteComponent:e,deleteContentType:t,isAttributeModal:n,isCustomFieldModal:r,isComponentAttribute:i,isComponentToDzModal:s,isContentTypeModal:o,isCreatingComponent:l,isCreatingComponentAttribute:c,isCreatingComponentInDz:p,isCreatingComponentWhileAddingAField:d,isCreatingContentType:h,isCreatingDz:v,isComponentModal:y,isDzAttribute:g,isEditingAttribute:k,isInFirstComponentStep:_,onSubmitAddComponentAttribute:x,onSubmitAddComponentToDz:S,onSubmitCreateContentType:T,onSubmitCreateComponent:I,onSubmitCreateDz:O,onSubmitEditAttribute:R,onSubmitEditComponent:B,onSubmitEditContentType:L,onSubmitEditCustomFieldAttribute:V,onSubmitEditDz:q,onClickFinish:D})=>{const{formatMessage:X}=pt();return s?p?m.jsx(ft,{variant:"secondary",type:"submit",onClick:M=>{M.preventDefault(),S(M,!0)},startIcon:m.jsx(fi,{}),children:X({id:Q("form.button.add-first-field-to-created-component"),defaultMessage:"Add first field to the component"})}):m.jsx(ft,{variant:"default",type:"submit",onClick:M=>{M.preventDefault(),S(M,!1)},children:X({id:"global.finish",defaultMessage:"Finish"})}):n&&g&&!v?m.jsx(ft,{variant:"default",type:"submit",onClick:M=>{M.preventDefault(),D(),q(M,!1)},children:X({id:"global.finish",defaultMessage:"Finish"})}):n&&g&&v?m.jsx(m.Fragment,{children:m.jsx(ft,{variant:"secondary",type:"submit",onClick:M=>{M.preventDefault(),O(M,!0)},startIcon:m.jsx(fi,{}),children:X({id:Q("form.button.add-components-to-dynamiczone"),defaultMessage:"Add components to the zone"})})}):n&&i?_?m.jsx(ft,{variant:"secondary",type:"submit",onClick:M=>{M.preventDefault(),x(M,!0)},children:X(c?{id:Q("form.button.configure-component"),defaultMessage:"Configure the component"}:{id:Q("form.button.select-component"),defaultMessage:"Configure the component"})}):m.jsxs(ke,{gap:2,children:[m.jsx(ft,{variant:"secondary",type:"submit",onClick:M=>{M.preventDefault(),x(M,!0)},startIcon:m.jsx(fi,{}),children:X(d?{id:Q("form.button.add-first-field-to-created-component"),defaultMessage:"Add first field to the component"}:{id:Q("form.button.add-field"),defaultMessage:"Add another field"})}),m.jsx(ft,{variant:"default",type:"button",onClick:M=>{M.preventDefault(),D(),x(M,!1)},children:X({id:"global.finish",defaultMessage:"Finish"})})]}):n&&!i&&!g?m.jsxs(ke,{gap:2,children:[m.jsx(ft,{type:k?"button":"submit",variant:"secondary",onClick:M=>{M.preventDefault(),R(M,!0)},startIcon:m.jsx(fi,{}),children:X({id:Q("form.button.add-field"),defaultMessage:"Add another field"})}),m.jsx(ft,{type:k?"submit":"button",variant:"default",onClick:M=>{M.preventDefault(),D(),R(M,!1)},children:X({id:"global.finish",defaultMessage:"Finish"})})]}):o?m.jsxs(ke,{gap:2,children:[!h&&m.jsxs(m.Fragment,{children:[m.jsx(ft,{type:"button",variant:"danger",onClick:M=>{M.preventDefault(),t()},children:X({id:"global.delete",defaultMessage:"Delete"})}),m.jsx(ft,{type:"submit",variant:"default",onClick:M=>{M.preventDefault(),L(M,!1)},children:X({id:"global.finish",defaultMessage:"Finish"})})]}),h&&m.jsx(ft,{type:"submit",variant:"secondary",onClick:M=>{M.preventDefault(),T(M,!0)},children:X({id:"global.continue",defaultMessage:"Continue"})})]}):y?m.jsxs(ke,{gap:2,children:[!l&&m.jsxs(m.Fragment,{children:[m.jsx(ft,{type:"button",variant:"danger",onClick:M=>{M.preventDefault(),e()},children:X({id:"global.delete",defaultMessage:"Delete"})}),m.jsx(ft,{type:"submit",variant:"default",onClick:M=>{M.preventDefault(),B(M,!1)},children:X({id:"global.finish",defaultMessage:"Finish"})})]}),l&&m.jsx(ft,{type:"submit",variant:"secondary",onClick:M=>{M.preventDefault(),I(M,!0)},children:X({id:"global.continue",defaultMessage:"Continue"})})]}):r?m.jsxs(ke,{gap:2,children:[m.jsx(ft,{type:k?"button":"submit",variant:"secondary",onClick:M=>{M.preventDefault(),V(M,!0)},startIcon:m.jsx(fi,{}),children:X({id:Q("form.button.add-field"),defaultMessage:"Add another field"})}),m.jsx(ft,{type:k?"submit":"button",variant:"default",onClick:M=>{M.preventDefault(),D(),V(M,!1)},children:X({id:"global.finish",defaultMessage:"Finish"})})]}):null},yH=({actionType:e=null,attributeName:t,attributeType:n,contentTypeKind:r,dynamicZoneTarget:i,forTarget:s,modalType:o=null,targetUid:l,customFieldUid:c=null,showBackLink:p=!1})=>{const{formatMessage:d}=pt(),{components:h,contentTypes:v}=er(),{onOpenModalAddField:y}=Pa();let g="component",k=[];const _=s==="component"?h[l]:v[l],x=_?.info.displayName;if(o==="contentType"&&(g=r),["component"].includes(o||"")&&(g="component"),["component","contentType"].includes(o||"")){let T=Q(`modalForm.component.header-${e}`);return o==="contentType"&&(T=Q(`modalForm.${r}.header-create`)),e==="edit"&&(T=Q("modalForm.header-edit")),m.jsx(fn.Header,{children:m.jsxs(ke,{children:[m.jsx(Ne,{children:m.jsx(Ro,{type:g})}),m.jsx(Ne,{paddingLeft:3,children:m.jsx(fn.Title,{children:d({id:T},{name:x})})})]})})}return k=[{label:x,info:{category:"category"in _&&_?.category||"",name:_?.info?.displayName}}],o==="chooseAttribute"&&(g=s==="component"?"component":"kind"in _?_.kind:""),o==="addComponentToDynamicZone"&&(g="dynamiczone",k.push({label:i})),(o==="attribute"||o==="customField")&&(g=n,k.push({label:t})),m.jsx(fn.Header,{children:m.jsxs(ke,{gap:3,children:[p&&m.jsx(_l,{"aria-label":d({id:Q("modalForm.header.back"),defaultMessage:"Back"}),startIcon:m.jsx(My,{}),onClick:()=>y({forTarget:s,targetUid:l}),href:"#back",isExternal:!1}),m.jsx(Ro,{type:g,customField:c}),m.jsx(WT,{label:k.map(({label:T})=>T).join(","),children:k.map(({label:T,info:I},O,R)=>{if(T=Fi(T),!T)return null;const B=`${T}.${O}`;return I?.category&&(T=`${T} (${Fi(I.category)} - ${Fi(I.name)})`),m.jsx(qT,{isCurrent:O===R.length-1,children:T},B)})})]})})},bH=({modalType:e,forTarget:t,kind:n,actionType:r,step:i})=>{switch(e){case"chooseAttribute":return Q(`modalForm.sub-header.chooseAttribute.${t?.includes("component")?"component":n||"collectionType"}`);case"attribute":return Q(`modalForm.sub-header.attribute.${r}${i!=="null"&&i!==null&&r!=="edit"?".step":""}`);case"customField":return Q(`modalForm.sub-header.attribute.${r}`);case"addComponentToDynamicZone":return Q("modalForm.sub-header.addComponentToDynamicZone");default:return Q("configurations")}},xH=({actionType:e,modalType:t,forTarget:n,kind:r,step:i,attributeType:s,attributeName:o,customField:l})=>{const{formatMessage:c}=pt(),p=t==="customField"?l?.intlLabel:{id:Q(`attribute.${s}`)};return m.jsxs(ke,{direction:"column",alignItems:"flex-start",paddingBottom:1,gap:1,children:[m.jsx(ze,{tag:"h2",variant:"beta",children:c({id:bH({actionType:e,forTarget:n,kind:r,step:i,modalType:t}),defaultMessage:"Add new field"},{type:p?Fi(c(p)):"",name:Fi(o),step:i})}),m.jsx(ze,{variant:"pi",textColor:"neutral600",children:c({id:Q(`attribute.${s}.description`),defaultMessage:"A type for modeling data"})})]})},$_={alien:Bj,apps:Lj,archive:Fj,arrowDown:Dj,arrowLeft:My,arrowRight:$j,arrowUp:Cy,attachment:Lp,bell:Pj,bold:Mj,book:Nj,briefcase:zj,brush:lc,bulletList:Oj,calendar:Rj,car:jj,cast:Ij,chartBubble:Tj,chartCircle:Aj,chartPie:Ej,check:_y,clock:Sj,cloud:Cj,code:Sy,cog:kj,collapse:wj,command:_j,connector:xj,crop:bj,crown:yj,cup:vj,cursor:gj,dashboard:mj,database:hj,discuss:fj,doctor:dj,earth:pj,emotionHappy:cj,emotionUnhappy:uj,envelop:lj,exit:sj,expand:yy,eye:Zy,feather:um,file:oj,fileError:aj,filePdf:ij,fileXls:rj,fileZip:vy,fileCsv:nj,filter:tj,folder:Pp,gate:ej,gift:QI,globe:XI,grid:YI,handHeart:KI,hashtag:JI,headphone:GI,heart:VI,house:qI,information:WI,italic:HI,key:ZI,landscape:UI,layer:BI,layout:LI,lightbulb:FI,link:DI,lock:$I,magic:PI,manyToMany:Uy,manyToOne:By,manyWays:Ly,medium:MI,message:NI,microphone:zI,monitor:OI,moon:RI,music:jI,oneToMany:Fy,oneToOne:Dy,oneWay:$y,paint:lc,paintBrush:lc,paperPlane:II,pencil:TI,phone:AI,picture:EI,pin:SI,pinMap:CI,plane:kI,play:wI,plus:fi,priceTag:_I,puzzle:xI,question:bI,quote:yI,refresh:Bp,restaurant:vI,rocket:gI,rotate:mI,scissors:hI,search:Py,seed:fI,server:dI,shield:pI,shirt:cI,shoppingCart:uI,slideshow:lI,stack:sI,star:oI,store:aI,strikeThrough:iI,sun:rI,television:nI,thumbDown:ky,thumbUp:wy,train:tI,twitter:eI,typhoon:QT,underline:XT,user:YT,volumeMute:KT,volumeUp:JT,walk:GT,wheelchair:VT,write:um},_H=ht(ke)`
  label {
    ${zy()}
    border-radius: ${({theme:e})=>e.borderRadius};
    border: 1px solid ${({theme:e})=>e.colors.neutral100};
  }
`,wH=({iconKey:e,name:t,onChange:n,isSelected:r,ariaLabel:i})=>{const s=$_[e];return m.jsx(tt.Root,{name:t,required:!1,children:m.jsxs(tt.Label,{children:[m.jsxs(Ey,{children:[i,m.jsx(tt.Input,{type:"radio",checked:r,onChange:n,value:e,"aria-checked":r})]}),m.jsx(El,{label:e,children:m.jsx(ke,{padding:2,cursor:"pointer",hasRadius:!0,background:r?"primary200":void 0,children:m.jsx(s,{width:"2rem",height:"2rem",fill:r?"primary600":"neutral300"})})})]})})},kH=({intlLabel:e,name:t,onChange:n,value:r=""})=>{const{formatMessage:i}=pt(),[s,o]=W.useState(!1),[l,c]=W.useState(""),p=Object.keys($_),[d,h]=W.useState(p),v=W.useRef(null),y=W.useRef(null),g=()=>{o(!s)},k=({target:{value:S}})=>{c(S),h(()=>p.filter(T=>T.toLowerCase().includes(S.toLowerCase())))},_=()=>{g(),c(""),h(p)},x=()=>{n({target:{name:t,value:""}})};return W.useEffect(()=>{s&&y.current?.focus()},[s]),m.jsxs(m.Fragment,{children:[m.jsxs(ke,{justifyContent:"space-between",paddingBottom:2,children:[m.jsx(ze,{variant:"pi",fontWeight:"bold",textColor:"neutral800",tag:"label",children:i(e)}),m.jsxs(ke,{gap:1,children:[s?m.jsx(Ay,{ref:y,name:"searchbar",placeholder:i({id:Q("ComponentIconPicker.search.placeholder"),defaultMessage:"Search for an icon"}),onBlur:()=>{l||g()},onChange:k,value:l,onClear:_,clearLabel:i({id:Q("IconPicker.search.clear.label"),defaultMessage:"Clear the icon search"}),children:i({id:Q("IconPicker.search.placeholder.label"),defaultMessage:"Search for an icon"})}):m.jsx(hr,{ref:v,onClick:g,withTooltip:!1,label:i({id:Q("IconPicker.search.button.label"),defaultMessage:"Search icon button"}),variant:"ghost",children:m.jsx(Py,{})}),r&&m.jsx(El,{label:i({id:Q("IconPicker.remove.tooltip"),defaultMessage:"Remove the selected icon"}),children:m.jsx(hr,{onClick:x,withTooltip:!1,label:i({id:Q("IconPicker.remove.button"),defaultMessage:"Remove the selected icon"}),variant:"ghost",children:m.jsx(Mp,{})})})]})]}),m.jsx(_H,{position:"relative",padding:1,background:"neutral100",hasRadius:!0,wrap:"wrap",gap:2,maxHeight:"126px",overflow:"auto",textAlign:"center",children:d.length>0?d.map(S=>m.jsx(wH,{iconKey:S,name:t,onChange:n,isSelected:S===r,ariaLabel:i({id:Q("IconPicker.icon.label"),defaultMessage:"Select {icon} icon"},{icon:S})},S)):m.jsx(Ne,{padding:4,grow:2,children:m.jsx(ze,{variant:"delta",textColor:"neutral600",textAlign:"center",children:i({id:Q("IconPicker.emptyState.label"),defaultMessage:"No icon found"})})})})]})},CH=({description:e,error:t,intlLabel:n,modifiedData:r,name:i,onChange:s,value:o})=>{const{formatMessage:l}=pt(),c=W.useRef(s),p=r?.displayName||"",d=W.useRef(p),h=W.useRef(o);W.useEffect(()=>{if(p&&p!==d.current){const k=Hy(p);let _=k;try{_=Ca(k,2)}catch{}c.current({target:{name:i,value:_}}),h.current=_,d.current=p}else p||(c.current({target:{name:i,value:""}}),h.current="",d.current="")},[p,i,o]);const v=t?l({id:t,defaultMessage:t}):"",y=e?l({id:e.id,defaultMessage:e.defaultMessage},{...e.values}):"",g=l(n);return m.jsxs(tt.Root,{error:v,hint:y,name:i,children:[m.jsx(tt.Label,{children:g}),m.jsx(Yr,{onChange:s,value:o||"",type:"text"}),m.jsx(tt.Error,{})]})},Kv=e=>{if(e instanceof Date&&Yv(e))return e;if(typeof e=="string"||typeof e=="number"){const t=new Date(e);if(Yv(t))return t}},Yv=e=>!isNaN(e.getTime()),SH=e=>{const[t,n]=e.split(":");return`${t}:${n}`},EH=e=>e.split(":").length===2?`${e}:00.000`:e,AH=e=>{if(e)return e.split(":").length>2?SH(e):e},TH=e=>{if(e)return EH(e)},IH=({value:e})=>AH(e),Xv=(e,t,n,r)=>{const i=TH(r);e({target:{name:t,value:i,type:n}})},jH=({autoComplete:e,customInputs:t,description:n,disabled:r,intlLabel:i,labelAction:s,error:o,name:l,onChange:c,onDelete:p,options:d=[],placeholder:h,required:v,step:y,type:g,value:k,isNullable:_,autoFocus:x,attribute:S,attributeName:T,conditionFields:I,...O})=>{const{formatMessage:R}=pt(),B=(pe,N)=>{if(pe&&(N==="minLength"&&N in pe||N==="maxLength"&&N in pe||N==="max"&&N in pe||N==="min"&&N in pe))return pe[N]},{hint:L}=RH({description:n,fieldSchema:{minLength:B(S,"minLength"),maxLength:B(S,"maxLength"),max:B(S,"max"),min:B(S,"min")},type:S?.type||g}),[V,q]=W.useState(!1),D=t?t[g]:null,X=k??void 0,M=X??"";function Y(pe){if(!pe)return null;if(typeof pe=="string")return R({id:pe,defaultMessage:pe});const N={...pe.values};return R({id:pe.id,defaultMessage:pe?.defaultMessage??pe.id},N)}const w=Y(o)??void 0;if(D)return m.jsx(D,{...O,attribute:S,description:n,hint:L,disabled:r,intlLabel:i,labelAction:s,error:w||"",name:l,onChange:c,onDelete:p,options:d,required:v,placeholder:h,type:g,value:X,autoFocus:x,attributeName:T,conditionFields:I});const F=i.id?R({id:i.id,defaultMessage:i.defaultMessage},{...i.values}):l,_e=h?R({id:h.id,defaultMessage:h.defaultMessage},{...h.values}):"",se=()=>{switch(g){case"json":return m.jsx(Vj,{value:X,disabled:r,onChange:pe=>{const N=S&&"required"in S&&!S?.required&&!pe.length?null:pe;c({target:{name:l,value:N}},!1)},minHeight:"25.2rem",maxHeight:"50.4rem"});case"bool":return m.jsx(qj,{checked:k===null?null:k||!1,disabled:r,offLabel:R({id:"app.components.ToggleCheckbox.off-label",defaultMessage:"False"}),onLabel:R({id:"app.components.ToggleCheckbox.on-label",defaultMessage:"True"}),onChange:pe=>{c({target:{name:l,value:pe.target.checked}})}});case"checkbox":return m.jsx(wl,{disabled:r,onCheckedChange:pe=>{c({target:{name:l,value:pe}})},checked:!!X,children:F});case"datetime":{const pe=Kv(X);return m.jsx(Wj,{clearLabel:R({id:"clearLabel",defaultMessage:"Clear"}),disabled:r,onChange:N=>{const Ee=N?N.toISOString():null;c({target:{name:l,value:Ee,type:g}})},onClear:()=>c({target:{name:l,value:null,type:g}}),placeholder:_e,value:pe})}case"date":{const pe=Kv(X);return m.jsx(Hj,{clearLabel:R({id:"clearLabel",defaultMessage:"Clear"}),disabled:r,onChange:N=>{c({target:{name:l,value:N?SR(N,{representation:"date"}):null,type:g}})},onClear:()=>c({target:{name:l,value:null,type:g}}),placeholder:_e,value:pe})}case"number":return m.jsx(Ny,{disabled:r,onValueChange:pe=>{c({target:{name:l,value:pe,type:g}})},placeholder:_e,step:y,value:X,autoFocus:x});case"email":return m.jsx(Yr,{autoComplete:e,disabled:r,onChange:pe=>{c({target:{name:l,value:pe.target.value,type:g}})},placeholder:_e,type:"email",value:M,autoFocus:x});case"timestamp":case"text":case"string":return m.jsx(Yr,{autoComplete:e,disabled:r,onChange:pe=>{c({target:{name:l,value:pe.target.value,type:g}})},placeholder:_e,type:"text",value:M,autoFocus:x});case"password":return m.jsx(Yr,{autoComplete:e,disabled:r,endAction:m.jsx("button",{"aria-label":R({id:"Auth.form.password.show-password",defaultMessage:"Show password"}),onClick:()=>{q(pe=>!pe)},style:{border:"none",padding:0,background:"transparent"},type:"button",children:V?m.jsx(Zy,{fill:"neutral500"}):m.jsx(Zj,{fill:"neutral500"})}),onChange:pe=>{c({target:{name:l,value:pe.target.value,type:g}})},placeholder:_e,type:V?"text":"password",value:M});case"select":return m.jsx(Xr,{disabled:r,onChange:pe=>{c({target:{name:l,value:pe,type:"select"}})},placeholder:_e,value:X,children:d.map(({metadatas:{intlLabel:pe,disabled:N,hidden:Ee},key:ie,value:z})=>m.jsx(Gn,{value:z,disabled:N,hidden:Ee,children:R(pe)},ie))});case"textarea":return m.jsx(Dp,{disabled:r,onChange:pe=>c({target:{name:l,value:pe.target.value,type:g}}),placeholder:_e,value:M});case"time":{const pe=IH({value:X});return m.jsx(Uj,{clearLabel:R({id:"clearLabel",defaultMessage:"Clear"}),disabled:r,onChange:N=>Xv(c,l,g,N),onClear:()=>Xv(c,l,g,void 0),value:pe})}default:return m.jsx(Yr,{disabled:!0,placeholder:"Not supported",type:"text",value:""})}};return m.jsxs(tt.Root,{error:w,name:l,hint:L,required:v,children:[g!=="checkbox"?m.jsx(tt.Label,{action:s,children:F}):null,se(),m.jsx(tt.Error,{}),m.jsx(tt.Hint,{})]})},RH=({description:e,fieldSchema:t,type:n})=>{const{formatMessage:r}=pt(),i=()=>e?.id?r({id:e.id,defaultMessage:e.defaultMessage},{...e.values}):"";return{hint:(()=>{const{maximum:o,minimum:l}=zH(t),c=OH({type:n,minimum:l,maximum:o}),p=typeof l=="number",d=typeof o=="number",h=d&&p,v=d||p;return!e?.id&&!v?"":r({id:"content-manager.form.Input.hint.text",defaultMessage:"{min, select, undefined {} other {min. {min}}}{divider}{max, select, undefined {} other {max. {max}}}{unit}{br}{description}"},{min:l,max:o,description:i(),unit:c?.message&&v?r(c.message,c.values):null,divider:h?r({id:"content-manager.form.Input.hint.minMaxDivider",defaultMessage:" / "}):null,br:v?m.jsx("br",{}):null})})()}},OH=({type:e,minimum:t,maximum:n})=>{if(e&&!["string","uid","richtext","email","password","text"].includes(e))return{};const r=Math.max(t||0,n||0);return{message:{id:"content-manager.form.Input.hint.character.unit",defaultMessage:"{maxValue, plural, one { character} other { characters}}"},values:{maxValue:r}}},zH=e=>{if(!e)return{maximum:void 0,minimum:void 0};const{minLength:t,maxLength:n,max:r,min:i}=e;let s,o;const l=Number(i),c=Number(t);Number.isNaN(l)?Number.isNaN(c)||(s=c):s=l;const p=Number(r),d=Number(n);return Number.isNaN(p)?Number.isNaN(d)||(o=d):o=p,{maximum:o,minimum:s}},Tp=W.memo(jH,xo),NH=({oneThatIsCreatingARelationWithAnother:e,target:t})=>{const{contentTypes:n,sortedContentTypesList:r}=er(),i=Sl(),s=r.filter(M_),o=n[t];if(!o)return null;const l=({uid:c,plugin:p,title:d,restrictRelationsTo:h})=>()=>{const v=p?`${p}_${d}`:d;i(an.onChangeRelationTarget({target:{value:c,oneThatIsCreatingARelationWithAnother:e,selectedContentTypeFriendlyName:v,targetContentTypeAllowedRelations:h}}))};return m.jsxs(In.Root,{children:[m.jsx(MH,{children:`${o.info.displayName} ${o.plugin?`(from: ${o.plugin})`:""}`}),m.jsx(In.Content,{zIndex:"popover",children:s.map(({uid:c,title:p,restrictRelationsTo:d,plugin:h})=>m.jsxs(In.Item,{onSelect:l({uid:c,plugin:h,title:p,restrictRelationsTo:d}),children:[p," ",h&&m.jsxs(m.Fragment,{children:["(from: ",h,")"]})]},c))})]})},MH=ht(In.Trigger)`
  max-width: 16.8rem;
  span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
`,Qv=({disabled:e=!1,error:t,header:n,isMain:r=!1,name:i,onChange:s,oneThatIsCreatingARelationWithAnother:o="",target:l,value:c=""})=>m.jsxs(Ne,{background:"neutral100",hasRadius:!0,borderColor:"neutral200",children:[m.jsx(ke,{paddingTop:r?4:1,paddingBottom:r?3:1,justifyContent:"center",children:r?m.jsx(ze,{variant:"pi",fontWeight:"bold",textColor:"neutral800",children:n}):m.jsx(NH,{target:l,oneThatIsCreatingARelationWithAnother:o})}),m.jsx(Cl,{background:"neutral200"}),m.jsx(Ne,{padding:4,children:m.jsx(Tp,{disabled:e,error:t?.id||null,intlLabel:{id:Q("form.attribute.item.defineRelation.fieldName"),defaultMessage:"Field name"},name:i,onChange:s,type:"text",value:c})})]});var PH=Jj,$H=Gj,DH="[object RegExp]";function FH(e){return $H(e)&&PH(e)==DH}var LH=FH,BH=LH,UH=Yj,ey=Kj,ty=ey&&ey.isRegExp,ZH=ty?UH(ty):BH,HH=ZH,WH=Xj,qH=WH("length"),VH=qH,D_="\\ud800-\\udfff",GH="\\u0300-\\u036f",JH="\\ufe20-\\ufe2f",KH="\\u20d0-\\u20ff",YH=GH+JH+KH,XH="\\ufe0e\\ufe0f",QH="["+D_+"]",Ip="["+YH+"]",jp="\\ud83c[\\udffb-\\udfff]",eW="(?:"+Ip+"|"+jp+")",F_="[^"+D_+"]",L_="(?:\\ud83c[\\udde6-\\uddff]){2}",B_="[\\ud800-\\udbff][\\udc00-\\udfff]",tW="\\u200d",U_=eW+"?",Z_="["+XH+"]?",nW="(?:"+tW+"(?:"+[F_,L_,B_].join("|")+")"+Z_+U_+")*",rW=Z_+U_+nW,iW="(?:"+[F_+Ip+"?",Ip,L_,B_,QH].join("|")+")",ny=RegExp(jp+"(?="+jp+")|"+iW+rW,"g");function aW(e){for(var t=ny.lastIndex=0;ny.test(e);)++t;return t}var oW=aW,sW=VH,lW=Wy,uW=oW;function cW(e){return lW(e)?uW(e):sW(e)}var pW=cW,ry=tR,dW=iR,fW=Wy,hW=Qj,mW=HH,gW=pW,vW=rR,yW=eR,iy=nR,bW=30,xW="...",_W=/\w*$/;function wW(e,t){var n=bW,r=xW;if(hW(t)){var i="separator"in t?t.separator:i;n="length"in t?yW(t.length):n,r="omission"in t?ry(t.omission):r}e=iy(e);var s=e.length;if(fW(e)){var o=vW(e);s=o.length}if(n>=s)return e;var l=n-gW(r);if(l<1)return r;var c=o?dW(o,0,l).join(""):e.slice(0,l);if(i===void 0)return c+r;if(o&&(l+=c.length-l),mW(i)){if(e.slice(l).search(i)){var p,d=c;for(i.global||(i=RegExp(i.source,iy(_W.exec(i))+"g")),i.lastIndex=0;p=i.exec(d);)var h=p.index;c=c.slice(0,h===void 0?l:h)}}else if(e.indexOf(ry(i),l)!=l){var v=c.lastIndexOf(i);v>-1&&(c=c.slice(0,v))}return c+r}var kW=wW;const ay=Wi(kW),CW=ht(Ne)`
  position: relative;
  width: 100%;
  &::before {
    content: '';
    position: absolute;
    top: calc(50% - 0px);
    height: 2px;
    width: 100%;
    background-color: ${({theme:e})=>e.colors.primary600};
    z-index: 0;
  }
`,SW=ht(Ne)`
  background: ${({theme:e,$isSelected:t})=>e.colors[t?"primary100":"neutral0"]};
  border: 1px solid
    ${({theme:e,$isSelected:t})=>e.colors[t?"primary700":"neutral200"]};
  border-radius: ${({theme:e})=>e.borderRadius};
  z-index: 1;
  flex: 0 0 2.4rem;
  svg {
    width: 2.4rem;
    height: 2.4rem;
    max-width: unset;
    path {
      fill: ${({theme:e,$isSelected:t})=>e.colors[t?"primary700":"neutral500"]};
    }
  }
  cursor: pointer;
  &:disabled {
    cursor: not-allowed;
    background: ${({theme:e})=>e.colors.neutral150};

    svg {
      path {
        fill: ${({theme:e})=>e.colors.neutral300};
      }
    }
  }
  display: flex;
  justify-content: center;
  align-items: center;
`,EW=ht(ke)`
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
`,AW={oneWay:$y,oneToOne:Dy,oneToMany:Fy,manyToOne:By,manyToMany:Uy,manyWay:Ly},TW=["oneWay","oneToOne","oneToMany","manyToOne","manyToMany","manyWay"],IW=["oneWay","manyWay"],jW=({naturePickerType:e,oneThatIsCreatingARelationWithAnother:t,relationType:n,target:r,targetUid:i})=>{const s=Sl(),{formatMessage:o}=pt(),{contentTypes:l}=er(),p=(e==="component"?"component":Kt(l,[i,"kind"],""))==="collectionType"?TW:IW,d=n==="manyToOne",h=Kt(l,[r,"info","displayName"],"unknown"),v=d?h:t,y=d?t:h,g=Ca(v,n==="manyToMany"?2:1),k=Kt(l,[r,"restrictRelationsTo"],null),_=Ca(y,["manyToMany","oneToMany","manyToOne","manyWay"].includes(n)?2:1);return n?m.jsxs(ke,{style:{flex:1},children:[m.jsx(CW,{children:m.jsx(ke,{paddingLeft:9,paddingRight:9,paddingTop:1,justifyContent:"center",children:m.jsx(Up,{tagName:"button",children:m.jsx(ke,{gap:3,children:p.map(x=>{const S=AW[x],T=k===null||k.includes(x);return m.jsx(SW,{tag:"button",$isSelected:n===x,disabled:!T,onClick:()=>{T&&s(an.onChangeRelationType({target:{oneThatIsCreatingARelationWithAnother:t,value:x}}))},padding:2,type:"button","aria-label":o({id:Q(`relation.${x}`)}),"aria-pressed":n===x,"data-relation-type":x,children:m.jsx(S,{"aria-hidden":"true"},x)},x)})})})})}),m.jsxs(EW,{justifyContent:"center",children:[m.jsxs(ze,{children:[ay(g,{length:24})," "]}),m.jsxs(ze,{textColor:"primary600",children:[o({id:Q(`relation.${n}`)})," "]}),m.jsx(ze,{children:ay(_,{length:24})})]})]}):null},RW=({formErrors:e,mainBoxHeader:t,modifiedData:n,naturePickerType:r,onChange:i,targetUid:s})=>{const o=Zp(n.relation,n.targetAttribute);return m.jsxs(ke,{style:{position:"relative"},children:[m.jsx(Qv,{isMain:!0,header:t,error:e?.name||null,name:"name",onChange:i,value:n?.name||""}),m.jsx(jW,{naturePickerType:r,oneThatIsCreatingARelationWithAnother:t,relationType:o,target:n.target,targetUid:s}),m.jsx(Qv,{disabled:["oneWay","manyWay"].includes(o),error:e?.targetAttribute||null,name:"targetAttribute",onChange:i,oneThatIsCreatingARelationWithAnother:t,target:n.target,value:n?.targetAttribute||""})]})},OW=({error:e=null,intlLabel:t,name:n,onChange:r,value:i=void 0,isCreating:s,dynamicZoneTarget:o})=>{const{formatMessage:l}=pt(),{allComponentsCategories:c}=er(),[p,d]=W.useState(c),h=e?l({id:e,defaultMessage:e}):"",v=l(t),y=k=>{r({target:{name:n,value:k,type:"select-category"}})},g=k=>{d(_=>[..._,k]),y(k)};return m.jsxs(tt.Root,{error:h,name:n,children:[m.jsx(tt.Label,{children:v}),m.jsx(aR,{disabled:!s&&!o,onChange:y,onCreateOption:g,value:i,creatable:!0,children:p.map(k=>m.jsx(oR,{value:k,children:k},k))}),m.jsx(tt.Error,{})]})},Rp=(e,t)=>t.find(n=>n.component===e),H_=(e,t,n=0)=>{const r=Rp(e,t);if(!r||!r.childComponents||r.childComponents.length===0)return n;let i=n;return r.childComponents.forEach(s=>{const o=H_(s.component,t,n+1);o>i&&(i=o)}),i},W_=(e,t)=>{const n=(s,o)=>{const l=[];if(l.push(o),!s.uidsOfAllParents)return l;for(const c of s.uidsOfAllParents){const p=Rp(c,t);p&&l.push(...n(p,o+1))}return l},r=Rp(e,t);return r?Math.max(...n(r,1)):0},zW=({error:e=null,intlLabel:t,isAddingAComponentToAnotherComponent:n,isCreating:r,isCreatingComponentWhileAddingAField:i,componentToCreate:s,name:o,onChange:l,targetUid:c,forTarget:p,value:d})=>{const{formatMessage:h}=pt(),v=e?h({id:e,defaultMessage:e}):"",y=h(t),{componentsGroupedByCategory:g,componentsThatHaveOtherComponentInTheirAttributes:k,nestedComponents:_}=er(),x=p==="component";let S=Object.entries(g).reduce((T,I)=>{const[O,R]=I,B=R.map(L=>({uid:L.uid,label:L.info.displayName,categoryName:O}));return[...T,...B]},[]);return n&&(S=S.filter(({uid:T})=>{const I=H_(T,k),O=W_(c,_);return I+O<=qy})),x&&(S=S.filter(T=>T.uid!==c)),i&&(S=[{uid:d,label:s?.displayName,categoryName:s?.category}]),m.jsxs(tt.Root,{error:v,name:o,children:[m.jsx(tt.Label,{children:y}),m.jsx(Xr,{disabled:i||!r,onChange:T=>{l({target:{name:o,value:T,type:"select-category"}})},value:d||"",children:S.map(T=>m.jsx(Gn,{value:T.uid,children:`${T.categoryName} - ${T.label}`},T.uid))}),m.jsx(tt.Error,{})]})},NW=({dynamicZoneTarget:e,intlLabel:t,name:n,onChange:r,value:i,targetUid:s})=>{const{formatMessage:o}=pt(),{componentsGroupedByCategory:l,contentTypes:c}=er(),p=Ap(c[s].attributes,e);if(!p)return null;const d="components"in p?p?.components:[],h=Object.keys(l).reduce((g,k)=>{const _=l[k].filter(({uid:x})=>!d.includes(x));return _.length>0&&(g[k]=_),g},{}),v=Object.entries(h).reduce((g,k)=>{const[_,x]=k,S={label:_,children:x.map(({uid:T,info:{displayName:I}})=>({label:I,value:T}))};return g.push(S),g},[]),y=o({id:Q("components.SelectComponents.displayed-value"),defaultMessage:"{number, plural, =0 {# components} one {# component} other {# components}} selected"},{number:i?.length??0});return m.jsxs(tt.Root,{name:n,children:[m.jsx(tt.Label,{children:o(t)}),m.jsx(Ry,{id:"select1",customizeContent:()=>y,onChange:g=>{r({target:{name:n,value:g,type:"select-components"}})},options:v,value:i||[]})]})},MW=({intlLabel:e,error:t=void 0,modifiedData:n,name:r,onChange:i,options:s,value:o=""})=>{const{formatMessage:l}=pt(),c=l(e),p=t?l({id:t,defaultMessage:t}):"",d=h=>{i({target:{name:r,value:h,type:"select"}}),o&&n.default!==void 0&&n.default!==null&&i({target:{name:"default",value:null}})};return m.jsxs(tt.Root,{error:p,name:r,children:[m.jsx(tt.Label,{children:c}),m.jsx(Xr,{onChange:d,value:o||"",children:s.map(({metadatas:{intlLabel:h,disabled:v,hidden:y},key:g,value:k})=>m.jsx(Gn,{value:k,disabled:v,hidden:y,children:l({id:h.id,defaultMessage:h.defaultMessage},h.values)},g))}),m.jsx(tt.Error,{})]})},PW=({intlLabel:e,error:t=void 0,modifiedData:n,name:r,onChange:i,options:s,value:o=""})=>{const{formatMessage:l}=pt(),c=l(e),p=t?l({id:t,defaultMessage:t}):"",d=h=>{i({target:{name:r,value:h,type:"select"}}),o&&(h==="biginteger"&&o!=="biginteger"&&(n.default!==void 0&&n.default!==null&&i({target:{name:"default",value:null}}),n.max!==void 0&&n.max!==null&&i({target:{name:"max",value:null}}),n.min!==void 0&&n.min!==null&&i({target:{name:"min",value:null}})),typeof h=="string"&&["decimal","float","integer"].includes(h)&&o==="biginteger"&&(n.default!==void 0&&n.default!==null&&i({target:{name:"default",value:null}}),n.max!==void 0&&n.max!==null&&i({target:{name:"max",value:null}}),n.min!==void 0&&n.min!==null&&i({target:{name:"min",value:null}})))};return m.jsxs(tt.Root,{error:p,name:r,children:[m.jsx(tt.Label,{children:c}),m.jsx(Xr,{onChange:d,value:o||"",children:s.map(({metadatas:{intlLabel:h,disabled:v,hidden:y},key:g,value:k})=>m.jsx(Gn,{value:k,disabled:v,hidden:y,children:l(h)},g))}),m.jsx(tt.Error,{})]})},$W=({description:e=null,error:t=null,intlLabel:n,modifiedData:r,name:i,onChange:s,value:o=null})=>{const{formatMessage:l}=pt(),c=W.useRef(s),p=W.useRef(o),d=W.useRef(r?.displayName||""),h=r?.displayName||"";W.useEffect(()=>{if(h&&h!==d.current){const k=Hy(h);c.current({target:{name:i,value:k}}),p.current=k,d.current=h}else h||(c.current({target:{name:i,value:""}}),p.current="",d.current="")},[h,i,o]);const v=t?l({id:t,defaultMessage:t}):"",y=e?l({id:e.id,defaultMessage:e.defaultMessage},{...e.values}):"",g=l(n);return m.jsxs(tt.Root,{error:v,hint:y,name:i,children:[m.jsx(tt.Label,{children:g}),m.jsx(Yr,{onChange:s,value:o||"",type:"text"}),m.jsx(tt.Error,{}),m.jsx(tt.Hint,{})]})},Eq=(e,t)=>{const n=[];return Object.entries(e).forEach(([r,i])=>{if(i.attributes){const s=Array.isArray(i.attributes)?i.attributes.reduce((o,l,c)=>(o[c.toString()]=l,o),{}):i.attributes;Object.entries(s).forEach(([o,l])=>{l.conditions?.visible&&Object.entries(l.conditions.visible).forEach(([,c])=>{const[p]=c;p&&p.var===t&&n.push({contentTypeUid:r,contentType:i.info.displayName,attribute:l.name||o})})})}}),n},DW=(e,t,n)=>{if(!e?.visible)return"";const[[r,i]]=Object.entries(e.visible),[s,o]=i,l=t.find(v=>v.name===s.var),c=l?l.name:s.var,p=r==="=="?"is":"is not",d=String(o);return`If ${c} ${p} ${d}, then ${r==="=="?"Show":"Hide"} ${n}`},FW=(e,t)=>e.filter(n=>{const r=n.type==="boolean"||n.type==="enumeration",i=n.name!==t;return r&&i}).map(n=>({name:n.name,type:n.type,enum:n.type==="enumeration"?n.enum:void 0})),oy=({form:e,formErrors:t,genericInputProps:n,modifiedData:r,onChange:i})=>{const{formatMessage:s}=pt();return m.jsx(m.Fragment,{children:e.map((o,l)=>o.items.length===0?null:m.jsxs(Ne,{children:[o.sectionTitle&&m.jsx(Ne,{paddingBottom:4,children:m.jsx(ze,{variant:"delta",tag:"h3",children:s(o.sectionTitle)})}),o.intlLabel&&m.jsx(ze,{variant:"pi",textColor:"neutral600",children:s(o.intlLabel)}),m.jsx(fr.Root,{gap:4,children:o.items.map((c,p)=>{const d=`${l}.${p}`,h=Kt(r,c.name,void 0),v=Object.keys(t).find(g=>g===c.name),y=v?t[v].id:Kt(t,[...c.name.split(".").filter(g=>g!=="componentToCreate"),"id"],null);if(c.type==="pushRight")return m.jsx(fr.Item,{col:c.size||6,xs:12,direction:"column",alignItems:"stretch",children:m.jsx("div",{})},c.name||d);if(c.type==="condition-form"){const g=Kt(r,c.name),k=n.contentTypeSchema?.attributes||[];if(!n.contentTypeSchema)return console.warn("contentTypeSchema is undefined, skipping condition form"),null;const _=FW(k,r.name),x=s({id:"form.attribute.condition.no-fields",defaultMessage:"No boolean or enumeration fields available to set conditions on."});return m.jsx(fr.Item,{col:c.size||12,xs:12,direction:"column",alignItems:"stretch",children:!g||Object.keys(g).length===0?m.jsxs(Ne,{children:[g&&Object.keys(g).length>0&&m.jsx(ze,{variant:"sigma",textColor:"neutral800",marginBottom:2,children:DW(g,_,n.attributeName||r.name)}),m.jsx(El,{label:x,children:m.jsx(ft,{marginTop:g&&Object.keys(g).length>0?0:4,fullWidth:!0,variant:"secondary",onClick:()=>{i({target:{name:c.name,value:{visible:{"==":[{var:""},""]}}}})},startIcon:m.jsx("span",{"aria-hidden":!0,children:"＋"}),disabled:_.length===0,children:s({id:"form.attribute.condition.apply",defaultMessage:"Apply condition"})})})]}):m.jsx(Tp,{...c,...n,error:y,onChange:i,value:h,autoFocus:p===0,attributeName:r.name,conditionFields:_,onDelete:()=>{i({target:{name:c.name}})}})},c.name||d)}return m.jsx(fr.Item,{col:c.size||6,xs:12,direction:"column",alignItems:"stretch",children:m.jsx(Tp,{...c,...n,error:y,onChange:i,value:h,autoFocus:p===0})},c.name||d)})})]},l))})},LW=({description:e=null,disabled:t=!1,error:n="",intlLabel:r,labelAction:i,name:s,onChange:o,placeholder:l=null,value:c=""})=>{const{formatMessage:p}=pt(),d=n?p({id:n,defaultMessage:n}):"",h=e?p({id:e.id,defaultMessage:e.defaultMessage},{...e.values}):"",v=p(r),y=l?p({id:l.id,defaultMessage:l.defaultMessage},{...l.values}):"",g=Array.isArray(c)?c.join(`
`):"",k=_=>{const x=_.target.value.split(`
`);o({target:{name:s,value:x}})};return m.jsxs(tt.Root,{error:d,hint:h,name:s,children:[m.jsx(tt.Label,{action:i,children:v}),m.jsx(Dp,{disabled:t,onChange:k,placeholder:y,value:g}),m.jsx(tt.Error,{}),m.jsx(tt.Hint,{})]})},BW=({disabled:e,tooltipMessage:t,onClick:n,marginTop:r=4})=>{const{formatMessage:i}=pt(),s=m.jsx(ft,{marginTop:r,fullWidth:!0,variant:"secondary",disabled:e,onClick:n,startIcon:m.jsx("span",{"aria-hidden":!0,children:"＋"}),children:i({id:"form.attribute.condition.apply",defaultMessage:"Apply condition"})});return t?m.jsx(El,{description:t,children:s}):s},UW=ht(Ro)`
  width: 16px !important;
  height: 16px !important;
  svg {
    width: 16px !important;
    height: 16px !important;
  }
`,ZW=e=>{if(!e?.visible)return{dependsOn:"",operator:"is",value:"",action:"show"};const[[t,n]]=Object.entries(e.visible),[r,i]=n;return{dependsOn:r.var,operator:t==="=="?"is":"isNot",value:i,action:"show"}},HW=e=>{if(!e.dependsOn)return null;const t=Vy(),n={dependsOn:e.dependsOn,operator:e.operator,value:e.value};try{return t.validate(n),{visible:{[e.operator==="is"&&e.action==="show"||e.operator==="isNot"&&e.action==="hide"?"==":"!="]:[{var:e.dependsOn},e.value]}}}catch{return null}},WW=({name:e,value:t,onChange:n,onDelete:r,attributeName:i,conditionFields:s=[]})=>{const{formatMessage:o}=pt(),[l,c]=W.useState(ZW(t)),[p,d]=W.useState(!1),h=!!t?.visible;Array.isArray(s)||(s=[]);const v=s.find(O=>O.name===l.dependsOn),y=v?.type==="enumeration",g=O=>{c(O);const R=Vy(),B={dependsOn:O.dependsOn,operator:O.operator,value:O.value};try{R.validate(B);const L=O.operator==="is"&&O.action==="show"||O.operator==="isNot"&&O.action==="hide"?"==":"!=",V=O.dependsOn?{visible:{[L]:[{var:O.dependsOn},O.value]}}:null;V&&n({target:{name:e,value:V}})}catch{}},k=()=>{const O={dependsOn:"",operator:"is",value:"",action:"show"};c(O),n({target:{name:e,value:HW(O)}})},_=()=>{c({dependsOn:"",operator:"is",value:"",action:"show"}),n({target:{name:e,value:null}}),r(),d(!1)},x=O=>{const R=O?.toString()||"",L=s.find(q=>q.name===R)?.type==="enumeration",V={...l,dependsOn:R,value:R?L?"":!1:l.value};g(V)},S=O=>{const R=O?.toString()||"is",B={...l,operator:R};g(B)},T=O=>{const R=y?O?.toString():O?.toString()==="true",B={...l,value:R};g(B)},I=O=>{const R=O?.toString()||"show",B={...l,action:R};g(B)};return h?m.jsx(Ne,{marginTop:2,children:m.jsxs(Ne,{background:"neutral0",hasRadius:!0,borderColor:"neutral200",borderWidth:.5,borderStyle:"solid",children:[m.jsxs(ke,{justifyContent:"space-between",alignItems:"center",padding:4,children:[m.jsx(ze,{variant:"sigma",textColor:"neutral800",children:o({id:Q("form.attribute.condition.title"),defaultMessage:"Condition for {name}"},{name:m.jsx("strong",{children:i})})}),m.jsxs(Zi.Root,{open:p,onOpenChange:d,children:[m.jsx(Zi.Trigger,{children:m.jsx(hr,{label:"Delete",children:m.jsx(Mp,{})})}),m.jsx(zo,{onConfirm:_,children:o({id:Q("popUpWarning.bodyMessage.delete-condition"),defaultMessage:"Are you sure you want to delete this condition?"})})]})]}),m.jsxs(Ne,{background:"neutral100",padding:4,children:[m.jsx(Ne,{paddingBottom:2,children:m.jsx(ze,{variant:"sigma",textColor:"neutral600",style:{textTransform:"uppercase",letterSpacing:1},children:o({id:Q("form.attribute.condition.if"),defaultMessage:"IF"})})}),m.jsxs(ke,{gap:4,children:[m.jsx(Ne,{minWidth:0,flex:1,children:m.jsx(tt.Root,{name:`${e}.field`,children:m.jsx(Xr,{value:l.dependsOn,onChange:x,placeholder:o({id:Q("form.attribute.condition.field"),defaultMessage:"field"}),children:s.map(O=>m.jsx(Gn,{value:O.name,children:m.jsxs(ke,{gap:2,alignItems:"center",children:[m.jsx(UW,{type:O.type}),m.jsx("span",{children:O.name})]})},O.name))})})}),m.jsx(Ne,{minWidth:0,flex:1,children:m.jsx(tt.Root,{name:`${e}.operator`,children:m.jsxs(Xr,{value:l.operator,onChange:S,disabled:!l.dependsOn,placeholder:o({id:Q("form.attribute.condition.operator"),defaultMessage:"condition"}),children:[m.jsx(Gn,{value:"is",children:o({id:Q("form.attribute.condition.operator.is"),defaultMessage:"is"})}),m.jsx(Gn,{value:"isNot",children:o({id:Q("form.attribute.condition.operator.isNot"),defaultMessage:"is not"})})]})})}),m.jsx(Ne,{minWidth:0,flex:1,children:m.jsx(tt.Root,{name:`${e}.value`,children:m.jsx(Xr,{value:l.value?.toString()||"",onChange:T,disabled:!l.dependsOn,placeholder:o({id:Q("form.attribute.condition.value"),defaultMessage:"value"}),children:y&&v?.enum?v.enum.map(O=>m.jsx(Gn,{value:O,children:O},O)):m.jsxs(m.Fragment,{children:[m.jsx(Gn,{value:"true",children:o({id:Q("form.attribute.condition.value.true"),defaultMessage:"true"})}),m.jsx(Gn,{value:"false",children:o({id:Q("form.attribute.condition.value.false"),defaultMessage:"false"})})]})})})})]})]}),m.jsxs(Ne,{background:"neutral100",padding:4,children:[m.jsx(Ne,{paddingBottom:4,children:m.jsx(ze,{variant:"sigma",textColor:"neutral600",style:{textTransform:"uppercase",letterSpacing:1},children:o({id:Q("form.attribute.condition.then"),defaultMessage:"THEN"})})}),m.jsx(Ne,{paddingBottom:4,children:m.jsx(tt.Root,{name:`${e}.action`,children:m.jsxs(Xr,{value:l.action,onChange:I,placeholder:o({id:Q("form.attribute.condition.action"),defaultMessage:"action"}),children:[m.jsxs(Gn,{value:"show",children:["Show ",m.jsx("span",{style:{fontWeight:"bold"},children:i||e})]}),m.jsxs(Gn,{value:"hide",children:["Hide ",m.jsx("span",{style:{fontWeight:"bold"},children:i||e})]})]})})})]})]})}):m.jsx(Ne,{padding:4,margin:4,hasRadius:!0,background:"neutral0",borderColor:"neutral200",children:m.jsx(BW,{onClick:k})})},Pr={name:"name",type:"text",intlLabel:{id:"global.name",defaultMessage:"Name"},description:{id:Q("modalForm.attribute.form.base.name.description"),defaultMessage:"No space is allowed for the name of the attribute"}},qW={sections:[{sectionTitle:null,items:[Pr]}]},ja={base(e=""){return[{sectionTitle:null,items:[{name:`${e}displayName`,type:"text",intlLabel:{id:Q("contentType.displayName.label"),defaultMessage:"Display Name"}},{name:`${e}category`,type:"select-category",intlLabel:{id:Q("modalForm.components.create-component.category.label"),defaultMessage:"Select a category or enter a name to create a new one"}}]},{sectionTitle:null,items:[{name:`${e}icon`,type:"icon-picker",size:12,intlLabel:{id:Q("modalForm.components.icon.label"),defaultMessage:"Icon"}}]}]},advanced(){return[]}},Be={default:{name:"default",type:"text",intlLabel:{id:Q("form.attribute.settings.default"),defaultMessage:"Default value"}},max:{name:"max",type:"checkbox-with-number-field",intlLabel:{id:Q("form.attribute.item.maximum"),defaultMessage:"Maximum value"}},maxLength:{name:"maxLength",type:"checkbox-with-number-field",intlLabel:{id:Q("form.attribute.item.maximumLength"),defaultMessage:"Maximum length"}},min:{name:"min",type:"checkbox-with-number-field",intlLabel:{id:Q("form.attribute.item.minimum"),defaultMessage:"Minimum value"}},minLength:{name:"minLength",type:"checkbox-with-number-field",intlLabel:{id:Q("form.attribute.item.minimumLength"),defaultMessage:"Minimum length"}},private:{name:"private",type:"checkbox",intlLabel:{id:Q("form.attribute.item.privateField"),defaultMessage:"Private field"},description:{id:Q("form.attribute.item.privateField.description"),defaultMessage:"This field will not show up in the API response"}},regex:{intlLabel:{id:Q("form.attribute.item.text.regex"),defaultMessage:"RegExp pattern"},name:"regex",type:"text",description:{id:Q("form.attribute.item.text.regex.description"),defaultMessage:"The text of the regular expression"}},required:{name:"required",type:"checkbox",intlLabel:{id:Q("form.attribute.item.requiredField"),defaultMessage:"Required field"},description:{id:Q("form.attribute.item.requiredField.description"),defaultMessage:"You won't be able to create an entry if this field is empty"}},unique:{name:"unique",type:"checkbox",intlLabel:{id:Q("form.attribute.item.uniqueField"),defaultMessage:"Unique field"},description:{id:Q("form.attribute.item.uniqueField.description"),defaultMessage:"You won't be able to create an entry if there is an existing entry with identical content"}}},xn={sectionTitle:{id:Q("form.attribute.condition.title"),defaultMessage:"Condition"},intlLabel:{id:Q("form.attribute.condition.description"),defaultMessage:"Toggle field settings depending on the value of another boolean or enumeration field."},items:[{name:"conditions",type:"condition-form",intlLabel:{id:Q("form.attribute.condition.label"),defaultMessage:"Conditions"},validations:{required:!0}}]},VW={blocks(){return{sections:[{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Be.required,Be.private]},xn]}},boolean(){return{sections:[{sectionTitle:null,items:[{autoFocus:!0,type:"select-default-boolean",intlLabel:{id:Q("form.attribute.settings.default"),defaultMessage:"Default value"},name:"default",options:[{value:"true",key:"true",metadatas:{intlLabel:{id:"true",defaultMessage:"true"}}},{value:"",key:"null",metadatas:{intlLabel:{id:"null",defaultMessage:"null"}}},{value:"false",key:"false",metadatas:{intlLabel:{id:"false",defaultMessage:"false"}}}]}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Be.required,Be.private]},xn]}},component({repeatable:e},t){if(t==="1")return{sections:ja.advanced()};if(e){const n={...Be.min,intlLabel:{id:Q("form.attribute.item.minimumComponents"),defaultMessage:"Minimum components"}},r={...Be.max,intlLabel:{id:Q("form.attribute.item.maximumComponents"),defaultMessage:"Maximum components"}};return{sections:[{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Be.required,Be.private,n,r]},xn]}}return{sections:[{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Be.required,Be.private]},xn]}},date({type:e}){return{sections:[{sectionTitle:null,items:[{...Be.default,type:e||"date",value:null,withDefaultValue:!1,disabled:!e,autoFocus:!1}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Be.required,Be.unique,Be.private]},xn]}},dynamiczone(){return{sections:[{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Be.required,Be.max,Be.min]},xn]}},email(){return{sections:[{sectionTitle:null,items:[{...Be.default,type:"email"}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Be.required,Be.unique,Be.maxLength,Be.minLength,Be.private]},xn]}},enumeration(e){return{sections:[{sectionTitle:null,items:[{name:"default",type:"select",intlLabel:{id:Q("form.attribute.settings.default"),defaultMessage:"Default value"},validations:{},options:[{key:"__null_reset_value__",value:"",metadatas:{intlLabel:{id:"components.InputSelect.option.placeholder",defaultMessage:"Choose here"}}},...(e.enum||[]).filter((t,n)=>e.enum.indexOf(t)===n&&t).map(t=>({key:t,value:t,metadatas:{intlLabel:{id:`${t}.no-override`,defaultMessage:t}}}))]},{intlLabel:{id:Q("form.attribute.item.enumeration.graphql"),defaultMessage:"Name override for GraphQL"},name:"enumName",type:"text",validations:{},description:{id:Q("form.attribute.item.enumeration.graphql.description"),defaultMessage:"Allows you to override the default generated name for GraphQL"}}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Be.required,Be.private]},xn]}},json(){return{sections:[{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Be.required,Be.private]},xn]}},media(){return{sections:[{sectionTitle:null,items:[{intlLabel:{id:Q("form.attribute.media.allowed-types"),defaultMessage:"Select allowed types of media"},name:"allowedTypes",type:"allowed-types-select",size:7,value:"",validations:{}}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Be.required,Be.private]},xn]}},number(e){const t=e.type==="decimal"||e.type==="float"?"any":1;return{sections:[{sectionTitle:null,items:[{autoFocus:!0,name:"default",type:e.type==="biginteger"?"text":"number",step:t,intlLabel:{id:Q("form.attribute.settings.default"),defaultMessage:"Default value"},validations:{}}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Be.required,Be.unique,Be.max,Be.min,Be.private]},xn]}},password(){return{sections:[{sectionTitle:null,items:[Be.default]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Be.required,Be.maxLength,Be.minLength,Be.private]},xn]}},relation(){return{sections:[{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Be.private]},xn]}},richtext(){return{sections:[{sectionTitle:null,items:[Be.default]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Be.required,Be.maxLength,Be.minLength,Be.private]},xn]}},text(){return{sections:[{sectionTitle:null,items:[Be.default,Be.regex]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Be.required,Be.unique,Be.maxLength,Be.minLength,Be.private]},xn]}},uid(e){return{sections:[{sectionTitle:null,items:[{...Be.default,disabled:!!e.targetField,type:"text"}]},{sectionTitle:{id:"global.settings",defaultMessage:"Settings"},items:[Be.required,Be.maxLength,Be.minLength,Be.private,Be.regex]},xn]}}},Op={intlLabel:{id:"global.type",defaultMessage:"Type"},name:"createComponent",type:"boolean-radio-group",size:12,radios:[{title:{id:Q("form.attribute.component.option.create"),defaultMessage:"Create a new component"},description:{id:Q("form.attribute.component.option.create.description"),defaultMessage:"A component is shared across types and components, it will be available and accessible everywhere."},value:!0},{title:{id:Q("form.attribute.component.option.reuse-existing"),defaultMessage:"Use an existing component"},description:{id:Q("form.attribute.component.option.reuse-existing.description"),defaultMessage:"Reuse a component already created to keep your data consistent across content-types."},value:!1}]},GW={component(e,t){if(t==="1"){const n=e.createComponent===!0?ja.base("componentToCreate."):[];return{sections:[{sectionTitle:null,items:[Op]},...n]}}return{sections:[{sectionTitle:null,items:[Pr,{name:"component",type:"select-component",intlLabel:{id:Q("modalForm.attributes.select-component"),defaultMessage:"Select a component"},isMultiple:!1}]},{sectionTitle:null,items:[{intlLabel:{id:"global.type",defaultMessage:"Type"},name:"repeatable",type:"boolean-radio-group",size:12,radios:[{title:{id:Q("form.attribute.component.option.repeatable"),defaultMessage:"Repeatable component"},description:{id:Q("form.attribute.component.option.repeatable.description"),defaultMessage:"Best for multiple instances (array) of ingredients, meta tags, etc.."},value:!0},{title:{id:Q("form.attribute.component.option.single"),defaultMessage:"Single component"},description:{id:Q("form.attribute.component.option.single.description"),defaultMessage:"Best for grouping fields like full address, main information, etc..."},value:!1}]}]}]}},date(){return{sections:[{sectionTitle:null,items:[Pr,{intlLabel:{id:"global.type",defaultMessage:"Type"},name:"type",type:"select-date",options:[{key:"__null_reset_value__",value:"",metadatas:{intlLabel:{id:"components.InputSelect.option.placeholder",defaultMessage:"Choose here"},hidden:!0}},{key:"date",value:"date",metadatas:{intlLabel:{id:Q("form.attribute.item.date.type.date"),defaultMessage:"date (ex: 01/01/{currentYear})",values:{currentYear:new Date().getFullYear()}}}},{key:"datetime",value:"datetime",metadatas:{intlLabel:{id:Q("form.attribute.item.date.type.datetime"),defaultMessage:"datetime (ex: 01/01/{currentYear} 00:00 AM)",values:{currentYear:new Date().getFullYear()}}}},{key:"time",value:"time",metadatas:{intlLabel:{id:Q("form.attribute.item.date.type.time"),defaultMessage:"time (ex: 00:00 AM)"}}}]}]}]}},enumeration(){return{sections:[{sectionTitle:null,items:[Pr]},{sectionTitle:null,items:[{name:"enum",type:"textarea-enum",size:6,intlLabel:{id:Q("form.attribute.item.enumeration.rules"),defaultMessage:"Values (one line per value)"},placeholder:{id:Q("form.attribute.item.enumeration.placeholder"),defaultMessage:`Ex:
morning
noon
evening`},validations:{required:!0}}]}]}},media(){return{sections:[{sectionTitle:null,items:[Pr]},{sectionTitle:null,items:[{intlLabel:{id:"global.type",defaultMessage:"Type"},name:"multiple",size:12,type:"boolean-radio-group",radios:[{title:{id:Q("form.attribute.media.option.multiple"),defaultMessage:"Multiple media"},description:{id:Q("form.attribute.media.option.multiple.description"),defaultMessage:"Best for sliders, carousels or multiple files download"},value:!0},{title:{id:Q("form.attribute.media.option.single"),defaultMessage:"Single media"},description:{id:Q("form.attribute.media.option.single.description"),defaultMessage:"Best for avatar, profile picture or cover"},value:!1}]}]}]}},number(){return{sections:[{sectionTitle:null,items:[Pr,{intlLabel:{id:Q("form.attribute.item.number.type"),defaultMessage:"Number format"},name:"type",type:"select-number",options:[{key:"__null_reset_value__",value:"",metadatas:{intlLabel:{id:"components.InputSelect.option.placeholder",defaultMessage:"Choose here"},hidden:!0}},{key:"integer",value:"integer",metadatas:{intlLabel:{id:Q("form.attribute.item.number.type.integer"),defaultMessage:"integer (ex: 10)"}}},{key:"biginteger",value:"biginteger",metadatas:{intlLabel:{id:Q("form.attribute.item.number.type.biginteger"),defaultMessage:"biginteger (ex: 123456789)"}}},{key:"decimal",value:"decimal",metadatas:{intlLabel:{id:Q("form.attribute.item.number.type.decimal"),defaultMessage:"decimal (ex: 2.22)"}}},{key:"float",value:"float",metadatas:{intlLabel:{id:Q("form.attribute.item.number.type.float"),defaultMessage:"decimal (ex: 3.3333333)"}}}]}]}]}},relation(){return{sections:[{sectionTitle:null,items:[{intlLabel:{id:"FIXME",defaultMessage:"FIXME"},name:"relation",size:12,type:"relation"}]}]}},string(){return{sections:[{sectionTitle:null,items:[Pr]},{sectionTitle:null,items:[{intlLabel:{id:"global.type",defaultMessage:"Type"},name:"type",size:12,type:"radio-group",radios:[{title:{id:Q("form.attribute.text.option.short-text"),defaultMessage:"Sort text"},description:{id:Q("form.attribute.text.option.short-text.description"),defaultMessage:"Best for titles, names, links (URL). It also enables exact search on the field."},value:"string"},{title:{id:Q("form.attribute.text.option.long-text"),defaultMessage:"Long text"},description:{id:Q("form.attribute.text.option.long-text.description"),defaultMessage:"Best for descriptions, biography. Exact search is disabled."},value:"text"}]}]}]}},text(){return{sections:[{sectionTitle:null,items:[Pr]},{sectionTitle:null,items:[{intlLabel:{id:"global.type",defaultMessage:"Type"},name:"type",size:12,type:"radio-group",radios:[{title:{id:Q("form.attribute.text.option.short-text"),defaultMessage:"Sort text"},description:{id:Q("form.attribute.text.option.short-text.description"),defaultMessage:"Best for titles, names, links (URL). It also enables exact search on the field."},value:"string"},{title:{id:Q("form.attribute.text.option.long-text"),defaultMessage:"Long text"},description:{id:Q("form.attribute.text.option.long-text.description"),defaultMessage:"Best for descriptions, biography. Exact search is disabled."},value:"text"}]}]}]}},uid(e,t,n){const r=n.filter(({type:i})=>["string","text"].includes(i)).map(({name:i})=>({key:i,value:i,metadatas:{intlLabel:{id:`${i}.no-override`,defaultMessage:i}}}));return{sections:[{sectionTitle:null,items:[{...Pr,placeholder:{id:Q("modalForm.attribute.form.base.name.placeholder"),defaultMessage:"e.g. slug, seoUrl, canonicalUrl"}},{intlLabel:{id:Q("modalForm.attribute.target-field"),defaultMessage:"Attached field"},name:"targetField",type:"select",options:[{key:"__null_reset_value__",value:"",metadatas:{intlLabel:{id:"global.none",defaultMessage:"None"}}},...r]}]}]}}},sy={advanced:VW,base:GW};var JW=sR;function KW(e){return e&&e.length?JW(e):[]}var YW=KW;const XW=Wi(YW),Hc=e=>e?lR(e,{decamelize:!1,lowercase:!1,separator:"_"}):"";var xl={exports:{}};/**
 * @license
 * Lodash lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
 */xl.exports;(function(e,t){(function(){function n(K,fe,A){switch(A.length){case 0:return K.call(fe);case 1:return K.call(fe,A[0]);case 2:return K.call(fe,A[0],A[1]);case 3:return K.call(fe,A[0],A[1],A[2])}return K.apply(fe,A)}function r(K,fe,A,Pe){for(var Ve=-1,De=K==null?0:K.length;++Ve<De;){var jn=K[Ve];fe(Pe,jn,A(jn),K)}return Pe}function i(K,fe){for(var A=-1,Pe=K==null?0:K.length;++A<Pe&&fe(K[A],A,K)!==!1;);return K}function s(K,fe){for(var A=K==null?0:K.length;A--&&fe(K[A],A,K)!==!1;);return K}function o(K,fe){for(var A=-1,Pe=K==null?0:K.length;++A<Pe;)if(!fe(K[A],A,K))return!1;return!0}function l(K,fe){for(var A=-1,Pe=K==null?0:K.length,Ve=0,De=[];++A<Pe;){var jn=K[A];fe(jn,A,K)&&(De[Ve++]=jn)}return De}function c(K,fe){return!!(K!=null&&K.length)&&T(K,fe,0)>-1}function p(K,fe,A){for(var Pe=-1,Ve=K==null?0:K.length;++Pe<Ve;)if(A(fe,K[Pe]))return!0;return!1}function d(K,fe){for(var A=-1,Pe=K==null?0:K.length,Ve=Array(Pe);++A<Pe;)Ve[A]=fe(K[A],A,K);return Ve}function h(K,fe){for(var A=-1,Pe=fe.length,Ve=K.length;++A<Pe;)K[Ve+A]=fe[A];return K}function v(K,fe,A,Pe){var Ve=-1,De=K==null?0:K.length;for(Pe&&De&&(A=K[++Ve]);++Ve<De;)A=fe(A,K[Ve],Ve,K);return A}function y(K,fe,A,Pe){var Ve=K==null?0:K.length;for(Pe&&Ve&&(A=K[--Ve]);Ve--;)A=fe(A,K[Ve],Ve,K);return A}function g(K,fe){for(var A=-1,Pe=K==null?0:K.length;++A<Pe;)if(fe(K[A],A,K))return!0;return!1}function k(K){return K.split("")}function _(K){return K.match(fw)||[]}function x(K,fe,A){var Pe;return A(K,function(Ve,De,jn){if(fe(Ve,De,jn))return Pe=De,!1}),Pe}function S(K,fe,A,Pe){for(var Ve=K.length,De=A+(Pe?1:-1);Pe?De--:++De<Ve;)if(fe(K[De],De,K))return De;return-1}function T(K,fe,A){return fe===fe?ve(K,fe,A):S(K,O,A)}function I(K,fe,A,Pe){for(var Ve=A-1,De=K.length;++Ve<De;)if(Pe(K[Ve],fe))return Ve;return-1}function O(K){return K!==K}function R(K,fe){var A=K==null?0:K.length;return A?D(K,fe)/A:Gi}function B(K){return function(fe){return fe==null?C:fe[K]}}function L(K){return function(fe){return K==null?C:K[fe]}}function V(K,fe,A,Pe,Ve){return Ve(K,function(De,jn,pu){A=Pe?(Pe=!1,De):fe(A,De,jn,pu)}),A}function q(K,fe){var A=K.length;for(K.sort(fe);A--;)K[A]=K[A].c;return K}function D(K,fe){for(var A,Pe=-1,Ve=K.length;++Pe<Ve;){var De=fe(K[Pe]);De!==C&&(A=A===C?De:A+De)}return A}function X(K,fe){for(var A=-1,Pe=Array(K);++A<K;)Pe[A]=fe(A);return Pe}function M(K,fe){return d(fe,function(A){return[A,K[A]]})}function Y(K){return K&&K.slice(0,E(K)+1).replace(ru,"")}function w(K){return function(fe){return K(fe)}}function F(K,fe){return d(fe,function(A){return K[A]})}function _e(K,fe){return K.has(fe)}function se(K,fe){for(var A=-1,Pe=K.length;++A<Pe&&T(fe,K[A],0)>-1;);return A}function pe(K,fe){for(var A=K.length;A--&&T(fe,K[A],0)>-1;);return A}function N(K,fe){for(var A=K.length,Pe=0;A--;)K[A]===fe&&++Pe;return Pe}function Ee(K){return"\\"+Gw[K]}function ie(K,fe){return K==null?C:K[fe]}function z(K){return Uw.test(K)}function je(K){return Zw.test(K)}function le(K){for(var fe,A=[];!(fe=K.next()).done;)A.push(fe.value);return A}function ne(K){var fe=-1,A=Array(K.size);return K.forEach(function(Pe,Ve){A[++fe]=[Ve,Pe]}),A}function Je(K,fe){return function(A){return K(fe(A))}}function Ke(K,fe){for(var A=-1,Pe=K.length,Ve=0,De=[];++A<Pe;){var jn=K[A];jn!==fe&&jn!==Ce||(K[A]=Ce,De[Ve++]=A)}return De}function ce(K){var fe=-1,A=Array(K.size);return K.forEach(function(Pe){A[++fe]=Pe}),A}function Oe(K){var fe=-1,A=Array(K.size);return K.forEach(function(Pe){A[++fe]=[Pe,Pe]}),A}function ve(K,fe,A){for(var Pe=A-1,Ve=K.length;++Pe<Ve;)if(K[Pe]===fe)return Pe;return-1}function Re(K,fe,A){for(var Pe=A+1;Pe--;)if(K[Pe]===fe)return Pe;return Pe}function Ge(K){return z(K)?ue(K):Xw(K)}function Ze(K){return z(K)?H(K):k(K)}function E(K){for(var fe=K.length;fe--&&uw.test(K.charAt(fe)););return fe}function ue(K){for(var fe=lu.lastIndex=0;lu.test(K);)++fe;return fe}function H(K){return K.match(lu)||[]}function $(K){return K.match(Bw)||[]}var C,J="4.18.1",ge=200,be="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",ee="Expected a function",re="Invalid `variable` option passed into `_.template`",he="Invalid `imports` option passed into `_.template`",U="__lodash_hash_undefined__",oe=500,Ce="__lodash_placeholder__",Se=1,Ue=2,dt=4,xt=1,It=2,Xe=1,Vt=2,jt=4,yt=8,mt=16,kn=32,Er=64,Zn=128,Ar=256,vr=512,ni=30,Uo="...",Bl=800,Zo=16,$a=1,Ho=2,Ul=3,Lr=1/0,Tr=9007199254740991,Zl=17976931348623157e292,Gi=NaN,tr=4294967295,Hl=tr-1,qe=tr>>>1,Tt=[["ary",Zn],["bind",Xe],["bindKey",Vt],["curry",yt],["curryRight",mt],["flip",vr],["partial",kn],["partialRight",Er],["rearg",Ar]],Zt="[object Arguments]",it="[object Array]",ln="[object AsyncFunction]",Ht="[object Boolean]",nn="[object Date]",Wl="[object DOMException]",Ji="[object Error]",Ki="[object Function]",ql="[object GeneratorFunction]",Hn="[object Map]",Da="[object Number]",G_="[object Null]",Br="[object Object]",Nd="[object Promise]",J_="[object Proxy]",Fa="[object RegExp]",yr="[object Set]",La="[object String]",Wo="[object Symbol]",K_="[object Undefined]",Ba="[object WeakMap]",Y_="[object WeakSet]",Ua="[object ArrayBuffer]",Yi="[object DataView]",Vl="[object Float32Array]",Gl="[object Float64Array]",Jl="[object Int8Array]",Kl="[object Int16Array]",Yl="[object Int32Array]",Xl="[object Uint8Array]",Ql="[object Uint8ClampedArray]",eu="[object Uint16Array]",tu="[object Uint32Array]",X_=/\b__p\+='';/g,Q_=/\b(__p\+=)''\+/g,ew=/(__e\(.*?\)|\b__t\))\+'';/g,Md=/&(?:amp|lt|gt|quot|#39);/g,Pd=/[&<>"']/g,tw=RegExp(Md.source),nw=RegExp(Pd.source),rw=/<%-([\s\S]+?)%>/g,iw=/<%([\s\S]+?)%>/g,$d=/<%=([\s\S]+?)%>/g,aw=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ow=/^\w*$/,sw=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,nu=/[\\^$.*+?()[\]{}|]/g,lw=RegExp(nu.source),ru=/^\s+/,uw=/\s/,cw=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,pw=/\{\n\/\* \[wrapped with (.+)\] \*/,dw=/,? & /,fw=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Dd=/[()=,{}\[\]\/\s]/,hw=/\\(\\)?/g,mw=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Fd=/\w*$/,gw=/^[-+]0x[0-9a-f]+$/i,vw=/^0b[01]+$/i,yw=/^\[object .+?Constructor\]$/,bw=/^0o[0-7]+$/i,xw=/^(?:0|[1-9]\d*)$/,_w=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,qo=/($^)/,ww=/['\n\r\u2028\u2029\\]/g,Vo="\\ud800-\\udfff",kw="\\u0300-\\u036f",Cw="\\ufe20-\\ufe2f",Sw="\\u20d0-\\u20ff",Ld=kw+Cw+Sw,Bd="\\u2700-\\u27bf",Ud="a-z\\xdf-\\xf6\\xf8-\\xff",Ew="\\xac\\xb1\\xd7\\xf7",Aw="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Tw="\\u2000-\\u206f",Iw=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Zd="A-Z\\xc0-\\xd6\\xd8-\\xde",Hd="\\ufe0e\\ufe0f",Wd=Ew+Aw+Tw+Iw,iu="['’]",jw="["+Vo+"]",qd="["+Wd+"]",Go="["+Ld+"]",Vd="\\d+",Rw="["+Bd+"]",Gd="["+Ud+"]",Jd="[^"+Vo+Wd+Vd+Bd+Ud+Zd+"]",au="\\ud83c[\\udffb-\\udfff]",Ow="(?:"+Go+"|"+au+")",Kd="[^"+Vo+"]",ou="(?:\\ud83c[\\udde6-\\uddff]){2}",su="[\\ud800-\\udbff][\\udc00-\\udfff]",Xi="["+Zd+"]",Yd="\\u200d",Xd="(?:"+Gd+"|"+Jd+")",zw="(?:"+Xi+"|"+Jd+")",Qd="(?:"+iu+"(?:d|ll|m|re|s|t|ve))?",ef="(?:"+iu+"(?:D|LL|M|RE|S|T|VE))?",tf=Ow+"?",nf="["+Hd+"]?",Nw="(?:"+Yd+"(?:"+[Kd,ou,su].join("|")+")"+nf+tf+")*",Mw="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Pw="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",rf=nf+tf+Nw,$w="(?:"+[Rw,ou,su].join("|")+")"+rf,Dw="(?:"+[Kd+Go+"?",Go,ou,su,jw].join("|")+")",Fw=RegExp(iu,"g"),Lw=RegExp(Go,"g"),lu=RegExp(au+"(?="+au+")|"+Dw+rf,"g"),Bw=RegExp([Xi+"?"+Gd+"+"+Qd+"(?="+[qd,Xi,"$"].join("|")+")",zw+"+"+ef+"(?="+[qd,Xi+Xd,"$"].join("|")+")",Xi+"?"+Xd+"+"+Qd,Xi+"+"+ef,Pw,Mw,Vd,$w].join("|"),"g"),Uw=RegExp("["+Yd+Vo+Ld+Hd+"]"),Zw=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Hw=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],$t={};$t[Vl]=$t[Gl]=$t[Jl]=$t[Kl]=$t[Yl]=$t[Xl]=$t[Ql]=$t[eu]=$t[tu]=!0,$t[Zt]=$t[it]=$t[Ua]=$t[Ht]=$t[Yi]=$t[nn]=$t[Ji]=$t[Ki]=$t[Hn]=$t[Da]=$t[Br]=$t[Fa]=$t[yr]=$t[La]=$t[Ba]=!1;var Ot={};Ot[Zt]=Ot[it]=Ot[Ua]=Ot[Yi]=Ot[Ht]=Ot[nn]=Ot[Vl]=Ot[Gl]=Ot[Jl]=Ot[Kl]=Ot[Yl]=Ot[Hn]=Ot[Da]=Ot[Br]=Ot[Fa]=Ot[yr]=Ot[La]=Ot[Wo]=Ot[Xl]=Ot[Ql]=Ot[eu]=Ot[tu]=!0,Ot[Ji]=Ot[Ki]=Ot[Ba]=!1;var Ww={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",Ĳ:"IJ",ĳ:"ij",Œ:"Oe",œ:"oe",ŉ:"'n",ſ:"s"},qw={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Vw={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Gw={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Jw=parseFloat,Kw=parseInt,af=typeof Jn=="object"&&Jn&&Jn.Object===Object&&Jn,Yw=typeof self=="object"&&self&&self.Object===Object&&self,mn=af||Yw||Function("return this")(),uu=t&&!t.nodeType&&t,wi=uu&&!0&&e&&!e.nodeType&&e,of=wi&&wi.exports===uu,cu=of&&af.process,nr=function(){try{var K=wi&&wi.require&&wi.require("util").types;return K||cu&&cu.binding&&cu.binding("util")}catch{}}(),sf=nr&&nr.isArrayBuffer,lf=nr&&nr.isDate,uf=nr&&nr.isMap,cf=nr&&nr.isRegExp,pf=nr&&nr.isSet,df=nr&&nr.isTypedArray,Xw=B("length"),Qw=L(Ww),e1=L(qw),t1=L(Vw),n1=function K(fe){function A(a){if(en(a)&&!nt(a)&&!(a instanceof De)){if(a instanceof Ve)return a;if(Ct.call(a,"__wrapped__"))return oh(a)}return new Ve(a)}function Pe(){}function Ve(a,u){this.__wrapped__=a,this.__actions__=[],this.__chain__=!!u,this.__index__=0,this.__values__=C}function De(a){this.__wrapped__=a,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=tr,this.__views__=[]}function jn(){var a=new De(this.__wrapped__);return a.__actions__=Rn(this.__actions__),a.__dir__=this.__dir__,a.__filtered__=this.__filtered__,a.__iteratees__=Rn(this.__iteratees__),a.__takeCount__=this.__takeCount__,a.__views__=Rn(this.__views__),a}function pu(){if(this.__filtered__){var a=new De(this);a.__dir__=-1,a.__filtered__=!0}else a=this.clone(),a.__dir__*=-1;return a}function r1(){var a=this.__wrapped__.value(),u=this.__dir__,f=nt(a),b=u<0,j=f?a.length:0,P=dk(0,j,this.__views__),Z=P.start,G=P.end,te=G-Z,ye=b?G:Z-1,me=this.__iteratees__,we=me.length,Me=0,Le=vn(te,this.__takeCount__);if(!f||!b&&j==te&&Le==te)return zf(a,this.__actions__);var We=[];e:for(;te--&&Me<Le;){ye+=u;for(var rt=-1,He=a[ye];++rt<we;){var ut=me[rt],ct=ut.iteratee,bn=ut.type,Mn=ct(He);if(bn==Ho)He=Mn;else if(!Mn){if(bn==$a)continue e;break e}}We[Me++]=He}return We}function ki(a){var u=-1,f=a==null?0:a.length;for(this.clear();++u<f;){var b=a[u];this.set(b[0],b[1])}}function i1(){this.__data__=eo?eo(null):{},this.size=0}function a1(a){var u=this.has(a)&&delete this.__data__[a];return this.size-=u?1:0,u}function o1(a){var u=this.__data__;if(eo){var f=u[a];return f===U?C:f}return Ct.call(u,a)?u[a]:C}function s1(a){var u=this.__data__;return eo?u[a]!==C:Ct.call(u,a)}function l1(a,u){var f=this.__data__;return this.size+=this.has(a)?0:1,f[a]=eo&&u===C?U:u,this}function Ur(a){var u=-1,f=a==null?0:a.length;for(this.clear();++u<f;){var b=a[u];this.set(b[0],b[1])}}function u1(){this.__data__=[],this.size=0}function c1(a){var u=this.__data__,f=Jo(u,a);return!(f<0)&&(f==u.length-1?u.pop():Cs.call(u,f,1),--this.size,!0)}function p1(a){var u=this.__data__,f=Jo(u,a);return f<0?C:u[f][1]}function d1(a){return Jo(this.__data__,a)>-1}function f1(a,u){var f=this.__data__,b=Jo(f,a);return b<0?(++this.size,f.push([a,u])):f[b][1]=u,this}function Zr(a){var u=-1,f=a==null?0:a.length;for(this.clear();++u<f;){var b=a[u];this.set(b[0],b[1])}}function h1(){this.size=0,this.__data__={hash:new ki,map:new(Xa||Ur),string:new ki}}function m1(a){var u=ss(this,a).delete(a);return this.size-=u?1:0,u}function g1(a){return ss(this,a).get(a)}function v1(a){return ss(this,a).has(a)}function y1(a,u){var f=ss(this,a),b=f.size;return f.set(a,u),this.size+=f.size==b?0:1,this}function Ci(a){var u=-1,f=a==null?0:a.length;for(this.__data__=new Zr;++u<f;)this.add(a[u])}function b1(a){return this.__data__.set(a,U),this}function x1(a){return this.__data__.has(a)}function br(a){this.size=(this.__data__=new Ur(a)).size}function _1(){this.__data__=new Ur,this.size=0}function w1(a){var u=this.__data__,f=u.delete(a);return this.size=u.size,f}function k1(a){return this.__data__.get(a)}function C1(a){return this.__data__.has(a)}function S1(a,u){var f=this.__data__;if(f instanceof Ur){var b=f.__data__;if(!Xa||b.length<ge-1)return b.push([a,u]),this.size=++f.size,this;f=this.__data__=new Zr(b)}return f.set(a,u),this.size=f.size,this}function ff(a,u){var f=nt(a),b=!f&&ji(a),j=!f&&!b&&li(a),P=!f&&!b&&!j&&ua(a),Z=f||b||j||P,G=Z?X(a.length,_E):[],te=G.length;for(var ye in a)!u&&!Ct.call(a,ye)||Z&&(ye=="length"||j&&(ye=="offset"||ye=="parent")||P&&(ye=="buffer"||ye=="byteLength"||ye=="byteOffset")||qr(ye,te))||G.push(ye);return G}function hf(a){var u=a.length;return u?a[_u(0,u-1)]:C}function E1(a,u){return ls(Rn(a),Si(u,0,a.length))}function A1(a){return ls(Rn(a))}function du(a,u,f){(f===C||_r(a[u],f))&&(f!==C||u in a)||Ir(a,u,f)}function Za(a,u,f){var b=a[u];Ct.call(a,u)&&_r(b,f)&&(f!==C||u in a)||Ir(a,u,f)}function Jo(a,u){for(var f=a.length;f--;)if(_r(a[f][0],u))return f;return-1}function T1(a,u,f,b){return si(a,function(j,P,Z){u(b,j,f(j),Z)}),b}function mf(a,u){return a&&Rr(u,hn(u),a)}function I1(a,u){return a&&Rr(u,zn(u),a)}function Ir(a,u,f){u=="__proto__"&&Ss?Ss(a,u,{configurable:!0,enumerable:!0,value:f,writable:!0}):a[u]=f}function fu(a,u){for(var f=-1,b=u.length,j=pn(b),P=a==null;++f<b;)j[f]=P?C:Lu(a,u[f]);return j}function Si(a,u,f){return a===a&&(f!==C&&(a=a<=f?a:f),u!==C&&(a=a>=u?a:u)),a}function rr(a,u,f,b,j,P){var Z,G=u&Se,te=u&Ue,ye=u&dt;if(f&&(Z=j?f(a,b,j,P):f(a)),Z!==C)return Z;if(!Gt(a))return a;var me=nt(a);if(me){if(Z=hk(a),!G)return Rn(a,Z)}else{var we=yn(a),Me=we==Ki||we==ql;if(li(a))return Mf(a,G);if(we==Br||we==Zt||Me&&!j){if(Z=te||Me?{}:Qf(a),!G)return te?ik(a,I1(Z,a)):rk(a,mf(Z,a))}else{if(!Ot[we])return j?a:{};Z=mk(a,we,G)}}P||(P=new br);var Le=P.get(a);if(Le)return Le;P.set(a,Z),Kh(a)?a.forEach(function(He){Z.add(rr(He,u,f,He,a,P))}):Jh(a)&&a.forEach(function(He,ut){Z.set(ut,rr(He,u,f,ut,a,P))});var We=ye?te?Ou:Ru:te?zn:hn,rt=me?C:We(a);return i(rt||a,function(He,ut){rt&&(ut=He,He=a[ut]),Za(Z,ut,rr(He,u,f,ut,a,P))}),Z}function j1(a){var u=hn(a);return function(f){return gf(f,a,u)}}function gf(a,u,f){var b=f.length;if(a==null)return!b;for(a=Dt(a);b--;){var j=f[b],P=u[j],Z=a[j];if(Z===C&&!(j in a)||!P(Z))return!1}return!0}function vf(a,u,f){if(typeof a!="function")throw new sr(ee);return no(function(){a.apply(C,f)},u)}function Ha(a,u,f,b){var j=-1,P=c,Z=!0,G=a.length,te=[],ye=u.length;if(!G)return te;f&&(u=d(u,w(f))),b?(P=p,Z=!1):u.length>=ge&&(P=_e,Z=!1,u=new Ci(u));e:for(;++j<G;){var me=a[j],we=f==null?me:f(me);if(me=b||me!==0?me:0,Z&&we===we){for(var Me=ye;Me--;)if(u[Me]===we)continue e;te.push(me)}else P(u,we,b)||te.push(me)}return te}function R1(a,u){var f=!0;return si(a,function(b,j,P){return f=!!u(b,j,P)}),f}function Ko(a,u,f){for(var b=-1,j=a.length;++b<j;){var P=a[b],Z=u(P);if(Z!=null&&(G===C?Z===Z&&!qn(Z):f(Z,G)))var G=Z,te=P}return te}function O1(a,u,f,b){var j=a.length;for(f=at(f),f<0&&(f=-f>j?0:j+f),b=b===C||b>j?j:at(b),b<0&&(b+=j),b=f>b?0:Ch(b);f<b;)a[f++]=u;return a}function yf(a,u){var f=[];return si(a,function(b,j,P){u(b,j,P)&&f.push(b)}),f}function gn(a,u,f,b,j){var P=-1,Z=a.length;for(f||(f=vk),j||(j=[]);++P<Z;){var G=a[P];u>0&&f(G)?u>1?gn(G,u-1,f,b,j):h(j,G):b||(j[j.length]=G)}return j}function jr(a,u){return a&&Xu(a,u,hn)}function hu(a,u){return a&&Bh(a,u,hn)}function Yo(a,u){return l(u,function(f){return Vr(a[f])})}function Ei(a,u){u=ii(u,a);for(var f=0,b=u.length;a!=null&&f<b;)a=a[xr(u[f++])];return f&&f==b?a:C}function bf(a,u,f){var b=u(a);return nt(a)?b:h(b,f(a))}function Cn(a){return a==null?a===C?K_:G_:Ii&&Ii in Dt(a)?pk(a):kk(a)}function mu(a,u){return a>u}function z1(a,u){return a!=null&&Ct.call(a,u)}function N1(a,u){return a!=null&&u in Dt(a)}function M1(a,u,f){return a>=vn(u,f)&&a<dn(u,f)}function gu(a,u,f){for(var b=f?p:c,j=a[0].length,P=a.length,Z=P,G=pn(P),te=1/0,ye=[];Z--;){var me=a[Z];Z&&u&&(me=d(me,w(u))),te=vn(me.length,te),G[Z]=!f&&(u||j>=120&&me.length>=120)?new Ci(Z&&me):C}me=a[0];var we=-1,Me=G[0];e:for(;++we<j&&ye.length<te;){var Le=me[we],We=u?u(Le):Le;if(Le=f||Le!==0?Le:0,!(Me?_e(Me,We):b(ye,We,f))){for(Z=P;--Z;){var rt=G[Z];if(!(rt?_e(rt,We):b(a[Z],We,f)))continue e}Me&&Me.push(We),ye.push(Le)}}return ye}function P1(a,u,f,b){return jr(a,function(j,P,Z){u(b,f(j),P,Z)}),b}function Wa(a,u,f){u=ii(u,a),a=rh(a,u);var b=a==null?a:a[xr(ar(u))];return b==null?C:n(b,a,f)}function xf(a){return en(a)&&Cn(a)==Zt}function $1(a){return en(a)&&Cn(a)==Ua}function D1(a){return en(a)&&Cn(a)==nn}function qa(a,u,f,b,j){return a===u||(a==null||u==null||!en(a)&&!en(u)?a!==a&&u!==u:F1(a,u,f,b,qa,j))}function F1(a,u,f,b,j,P){var Z=nt(a),G=nt(u),te=Z?it:yn(a),ye=G?it:yn(u);te=te==Zt?Br:te,ye=ye==Zt?Br:ye;var me=te==Br,we=ye==Br,Me=te==ye;if(Me&&li(a)){if(!li(u))return!1;Z=!0,me=!1}if(Me&&!me)return P||(P=new br),Z||ua(a)?Yf(a,u,f,b,j,P):uk(a,u,te,f,b,j,P);if(!(f&xt)){var Le=me&&Ct.call(a,"__wrapped__"),We=we&&Ct.call(u,"__wrapped__");if(Le||We){var rt=Le?a.value():a,He=We?u.value():u;return P||(P=new br),j(rt,He,f,b,P)}}return!!Me&&(P||(P=new br),ck(a,u,f,b,j,P))}function L1(a){return en(a)&&yn(a)==Hn}function vu(a,u,f,b){var j=f.length,P=j,Z=!b;if(a==null)return!P;for(a=Dt(a);j--;){var G=f[j];if(Z&&G[2]?G[1]!==a[G[0]]:!(G[0]in a))return!1}for(;++j<P;){G=f[j];var te=G[0],ye=a[te],me=G[1];if(Z&&G[2]){if(ye===C&&!(te in a))return!1}else{var we=new br;if(b)var Me=b(ye,me,te,a,u,we);if(!(Me===C?qa(me,ye,xt|It,b,we):Me))return!1}}return!0}function _f(a){return!(!Gt(a)||bk(a))&&(Vr(a)?EE:yw).test(Ti(a))}function B1(a){return en(a)&&Cn(a)==Fa}function U1(a){return en(a)&&yn(a)==yr}function Z1(a){return en(a)&&fs(a.length)&&!!$t[Cn(a)]}function wf(a){return typeof a=="function"?a:a==null?Nn:typeof a=="object"?nt(a)?Sf(a[0],a[1]):Cf(a):jh(a)}function yu(a){if(!Ja(a))return OE(a);var u=[];for(var f in Dt(a))Ct.call(a,f)&&f!="constructor"&&u.push(f);return u}function H1(a){if(!Gt(a))return wk(a);var u=Ja(a),f=[];for(var b in a)(b!="constructor"||!u&&Ct.call(a,b))&&f.push(b);return f}function bu(a,u){return a<u}function kf(a,u){var f=-1,b=On(a)?pn(a.length):[];return si(a,function(j,P,Z){b[++f]=u(j,P,Z)}),b}function Cf(a){var u=zu(a);return u.length==1&&u[0][2]?th(u[0][0],u[0][1]):function(f){return f===a||vu(f,a,u)}}function Sf(a,u){return Nu(a)&&eh(u)?th(xr(a),u):function(f){var b=Lu(f,a);return b===C&&b===u?Bu(f,a):qa(u,b,xt|It)}}function Xo(a,u,f,b,j){a!==u&&Xu(u,function(P,Z){if(j||(j=new br),Gt(P))W1(a,u,Z,f,Xo,b,j);else{var G=b?b(Pu(a,Z),P,Z+"",a,u,j):C;G===C&&(G=P),du(a,Z,G)}},zn)}function W1(a,u,f,b,j,P,Z){var G=Pu(a,f),te=Pu(u,f),ye=Z.get(te);if(ye)return du(a,f,ye),C;var me=P?P(G,te,f+"",a,u,Z):C,we=me===C;if(we){var Me=nt(te),Le=!Me&&li(te),We=!Me&&!Le&&ua(te);me=te,Me||Le||We?nt(G)?me=G:rn(G)?me=Rn(G):Le?(we=!1,me=Mf(te,!0)):We?(we=!1,me=Pf(te,!0)):me=[]:Ka(te)||ji(te)?(me=G,ji(G)?me=Sh(G):Gt(G)&&!Vr(G)||(me=Qf(te))):we=!1}we&&(Z.set(te,me),j(me,te,b,P,Z),Z.delete(te)),du(a,f,me)}function Ef(a,u){var f=a.length;if(f)return u+=u<0?f:0,qr(u,f)?a[u]:C}function Af(a,u,f){u=u.length?d(u,function(j){return nt(j)?function(P){return Ei(P,j.length===1?j[0]:j)}:j}):[Nn];var b=-1;return u=d(u,w(Ye())),q(kf(a,function(j,P,Z){return{a:d(u,function(G){return G(j)}),b:++b,c:j}}),function(j,P){return nk(j,P,f)})}function q1(a,u){return Tf(a,u,function(f,b){return Bu(a,b)})}function Tf(a,u,f){for(var b=-1,j=u.length,P={};++b<j;){var Z=u[b],G=Ei(a,Z);f(G,Z)&&Va(P,ii(Z,a),G)}return P}function V1(a){return function(u){return Ei(u,a)}}function xu(a,u,f,b){var j=b?I:T,P=-1,Z=u.length,G=a;for(a===u&&(u=Rn(u)),f&&(G=d(a,w(f)));++P<Z;)for(var te=0,ye=u[P],me=f?f(ye):ye;(te=j(G,me,te,b))>-1;)G!==a&&Cs.call(G,te,1),Cs.call(a,te,1);return a}function If(a,u){for(var f=a?u.length:0,b=f-1;f--;){var j=u[f];if(f==b||j!==P){var P=j;qr(j)?Cs.call(a,j,1):Cu(a,j)}}return a}function _u(a,u){return a+As(Dh()*(u-a+1))}function G1(a,u,f,b){for(var j=-1,P=dn(Es((u-a)/(f||1)),0),Z=pn(P);P--;)Z[b?P:++j]=a,a+=f;return Z}function wu(a,u){var f="";if(!a||u<1||u>Tr)return f;do u%2&&(f+=a),u=As(u/2),u&&(a+=a);while(u);return f}function st(a,u){return tc(nh(a,u,Nn),a+"")}function J1(a){return hf(ra(a))}function K1(a,u){var f=ra(a);return ls(f,Si(u,0,f.length))}function Va(a,u,f,b){if(!Gt(a))return a;u=ii(u,a);for(var j=-1,P=u.length,Z=P-1,G=a;G!=null&&++j<P;){var te=xr(u[j]),ye=f;if(te==="__proto__"||te==="constructor"||te==="prototype")return a;if(j!=Z){var me=G[te];ye=b?b(me,te,G):C,ye===C&&(ye=Gt(me)?me:qr(u[j+1])?[]:{})}Za(G,te,ye),G=G[te]}return a}function Y1(a){return ls(ra(a))}function ir(a,u,f){var b=-1,j=a.length;u<0&&(u=-u>j?0:j+u),f=f>j?j:f,f<0&&(f+=j),j=u>f?0:f-u>>>0,u>>>=0;for(var P=pn(j);++b<j;)P[b]=a[b+u];return P}function X1(a,u){var f;return si(a,function(b,j,P){return f=u(b,j,P),!f}),!!f}function Qo(a,u,f){var b=0,j=a==null?b:a.length;if(typeof u=="number"&&u===u&&j<=qe){for(;b<j;){var P=b+j>>>1,Z=a[P];Z!==null&&!qn(Z)&&(f?Z<=u:Z<u)?b=P+1:j=P}return j}return ku(a,u,Nn,f)}function ku(a,u,f,b){var j=0,P=a==null?0:a.length;if(P===0)return 0;u=f(u);for(var Z=u!==u,G=u===null,te=qn(u),ye=u===C;j<P;){var me=As((j+P)/2),we=f(a[me]),Me=we!==C,Le=we===null,We=we===we,rt=qn(we);if(Z)var He=b||We;else He=ye?We&&(b||Me):G?We&&Me&&(b||!Le):te?We&&Me&&!Le&&(b||!rt):!Le&&!rt&&(b?we<=u:we<u);He?j=me+1:P=me}return vn(P,Hl)}function jf(a,u){for(var f=-1,b=a.length,j=0,P=[];++f<b;){var Z=a[f],G=u?u(Z):Z;if(!f||!_r(G,te)){var te=G;P[j++]=Z===0?0:Z}}return P}function Rf(a){return typeof a=="number"?a:qn(a)?Gi:+a}function Wn(a){if(typeof a=="string")return a;if(nt(a))return d(a,Wn)+"";if(qn(a))return Fh?Fh.call(a):"";var u=a+"";return u=="0"&&1/a==-Lr?"-0":u}function ri(a,u,f){var b=-1,j=c,P=a.length,Z=!0,G=[],te=G;if(f)Z=!1,j=p;else if(P>=ge){var ye=u?null:ZE(a);if(ye)return ce(ye);Z=!1,j=_e,te=new Ci}else te=u?[]:G;e:for(;++b<P;){var me=a[b],we=u?u(me):me;if(me=f||me!==0?me:0,Z&&we===we){for(var Me=te.length;Me--;)if(te[Me]===we)continue e;u&&te.push(we),G.push(me)}else j(te,we,f)||(te!==G&&te.push(we),G.push(me))}return G}function Cu(a,u){u=ii(u,a);var f=-1,b=u.length;if(!b)return!0;for(;++f<b;){var j=xr(u[f]);if(j==="__proto__"&&!Ct.call(a,"__proto__")||(j==="constructor"||j==="prototype")&&f<b-1)return!1}var P=rh(a,u);return P==null||delete P[xr(ar(u))]}function Of(a,u,f,b){return Va(a,u,f(Ei(a,u)),b)}function es(a,u,f,b){for(var j=a.length,P=b?j:-1;(b?P--:++P<j)&&u(a[P],P,a););return f?ir(a,b?0:P,b?P+1:j):ir(a,b?P+1:0,b?j:P)}function zf(a,u){var f=a;return f instanceof De&&(f=f.value()),v(u,function(b,j){return j.func.apply(j.thisArg,h([b],j.args))},f)}function Su(a,u,f){var b=a.length;if(b<2)return b?ri(a[0]):[];for(var j=-1,P=pn(b);++j<b;)for(var Z=a[j],G=-1;++G<b;)G!=j&&(P[j]=Ha(P[j]||Z,a[G],u,f));return ri(gn(P,1),u,f)}function Nf(a,u,f){for(var b=-1,j=a.length,P=u.length,Z={};++b<j;)f(Z,a[b],b<P?u[b]:C);return Z}function Eu(a){return rn(a)?a:[]}function Au(a){return typeof a=="function"?a:Nn}function ii(a,u){return nt(a)?a:Nu(a,u)?[a]:qh(kt(a))}function ai(a,u,f){var b=a.length;return f=f===C?b:f,!u&&f>=b?a:ir(a,u,f)}function Mf(a,u){if(u)return a.slice();var f=a.length,b=zh?zh(f):new a.constructor(f);return a.copy(b),b}function Tu(a){var u=new a.constructor(a.byteLength);return new ws(u).set(new ws(a)),u}function Q1(a,u){return new a.constructor(u?Tu(a.buffer):a.buffer,a.byteOffset,a.byteLength)}function ek(a){var u=new a.constructor(a.source,Fd.exec(a));return u.lastIndex=a.lastIndex,u}function tk(a){return to?Dt(to.call(a)):{}}function Pf(a,u){return new a.constructor(u?Tu(a.buffer):a.buffer,a.byteOffset,a.length)}function $f(a,u){if(a!==u){var f=a!==C,b=a===null,j=a===a,P=qn(a),Z=u!==C,G=u===null,te=u===u,ye=qn(u);if(!G&&!ye&&!P&&a>u||P&&Z&&te&&!G&&!ye||b&&Z&&te||!f&&te||!j)return 1;if(!b&&!P&&!ye&&a<u||ye&&f&&j&&!b&&!P||G&&f&&j||!Z&&j||!te)return-1}return 0}function nk(a,u,f){for(var b=-1,j=a.a,P=u.a,Z=j.length,G=f.length;++b<Z;){var te=$f(j[b],P[b]);if(te)return b>=G?te:te*(f[b]=="desc"?-1:1)}return a.b-u.b}function Df(a,u,f,b){for(var j=-1,P=a.length,Z=f.length,G=-1,te=u.length,ye=dn(P-Z,0),me=pn(te+ye),we=!b;++G<te;)me[G]=u[G];for(;++j<Z;)(we||j<P)&&(me[f[j]]=a[j]);for(;ye--;)me[G++]=a[j++];return me}function Ff(a,u,f,b){for(var j=-1,P=a.length,Z=-1,G=f.length,te=-1,ye=u.length,me=dn(P-G,0),we=pn(me+ye),Me=!b;++j<me;)we[j]=a[j];for(var Le=j;++te<ye;)we[Le+te]=u[te];for(;++Z<G;)(Me||j<P)&&(we[Le+f[Z]]=a[j++]);return we}function Rn(a,u){var f=-1,b=a.length;for(u||(u=pn(b));++f<b;)u[f]=a[f];return u}function Rr(a,u,f,b){var j=!f;f||(f={});for(var P=-1,Z=u.length;++P<Z;){var G=u[P],te=b?b(f[G],a[G],G,f,a):C;te===C&&(te=a[G]),j?Ir(f,G,te):Za(f,G,te)}return f}function rk(a,u){return Rr(a,ec(a),u)}function ik(a,u){return Rr(a,Hh(a),u)}function ts(a,u){return function(f,b){var j=nt(f)?r:T1,P=u?u():{};return j(f,a,Ye(b,2),P)}}function ea(a){return st(function(u,f){var b=-1,j=f.length,P=j>1?f[j-1]:C,Z=j>2?f[2]:C;for(P=a.length>3&&typeof P=="function"?(j--,P):C,Z&&Sn(f[0],f[1],Z)&&(P=j<3?C:P,j=1),u=Dt(u);++b<j;){var G=f[b];G&&a(u,G,b,P)}return u})}function Lf(a,u){return function(f,b){if(f==null)return f;if(!On(f))return a(f,b);for(var j=f.length,P=u?j:-1,Z=Dt(f);(u?P--:++P<j)&&b(Z[P],P,Z)!==!1;);return f}}function Bf(a){return function(u,f,b){for(var j=-1,P=Dt(u),Z=b(u),G=Z.length;G--;){var te=Z[a?G:++j];if(f(P[te],te,P)===!1)break}return u}}function ak(a,u,f){function b(){return(this&&this!==mn&&this instanceof b?P:a).apply(j?f:this,arguments)}var j=u&Xe,P=Ga(a);return b}function Uf(a){return function(u){u=kt(u);var f=z(u)?Ze(u):C,b=f?f[0]:u.charAt(0),j=f?ai(f,1).join(""):u.slice(1);return b[a]()+j}}function ta(a){return function(u){return v(Ih(Th(u).replace(Fw,"")),a,"")}}function Ga(a){return function(){var u=arguments;switch(u.length){case 0:return new a;case 1:return new a(u[0]);case 2:return new a(u[0],u[1]);case 3:return new a(u[0],u[1],u[2]);case 4:return new a(u[0],u[1],u[2],u[3]);case 5:return new a(u[0],u[1],u[2],u[3],u[4]);case 6:return new a(u[0],u[1],u[2],u[3],u[4],u[5]);case 7:return new a(u[0],u[1],u[2],u[3],u[4],u[5],u[6])}var f=la(a.prototype),b=a.apply(f,u);return Gt(b)?b:f}}function ok(a,u,f){function b(){for(var P=arguments.length,Z=pn(P),G=P,te=na(b);G--;)Z[G]=arguments[G];var ye=P<3&&Z[0]!==te&&Z[P-1]!==te?[]:Ke(Z,te);return P-=ye.length,P<f?Vf(a,u,ns,b.placeholder,C,Z,ye,C,C,f-P):n(this&&this!==mn&&this instanceof b?j:a,this,Z)}var j=Ga(a);return b}function Zf(a){return function(u,f,b){var j=Dt(u);if(!On(u)){var P=Ye(f,3);u=hn(u),f=function(G){return P(j[G],G,j)}}var Z=a(u,f,b);return Z>-1?j[P?u[Z]:Z]:C}}function Hf(a){return Wr(function(u){var f=u.length,b=f,j=Ve.prototype.thru;for(a&&u.reverse();b--;){var P=u[b];if(typeof P!="function")throw new sr(ee);if(j&&!Z&&os(P)=="wrapper")var Z=new Ve([],!0)}for(b=Z?b:f;++b<f;){P=u[b];var G=os(P),te=G=="wrapper"?Qu(P):C;Z=te&&Mu(te[0])&&te[1]==(Zn|yt|kn|Ar)&&!te[4].length&&te[9]==1?Z[os(te[0])].apply(Z,te[3]):P.length==1&&Mu(P)?Z[G]():Z.thru(P)}return function(){var ye=arguments,me=ye[0];if(Z&&ye.length==1&&nt(me))return Z.plant(me).value();for(var we=0,Me=f?u[we].apply(this,ye):me;++we<f;)Me=u[we].call(this,Me);return Me}})}function ns(a,u,f,b,j,P,Z,G,te,ye){function me(){for(var ut=arguments.length,ct=pn(ut),bn=ut;bn--;)ct[bn]=arguments[bn];if(We)var Mn=na(me),ui=N(ct,Mn);if(b&&(ct=Df(ct,b,j,We)),P&&(ct=Ff(ct,P,Z,We)),ut-=ui,We&&ut<ye)return Vf(a,u,ns,me.placeholder,f,ct,Ke(ct,Mn),G,te,ye-ut);var tn=Me?f:this,lr=Le?tn[a]:a;return ut=ct.length,G?ct=Ck(ct,G):rt&&ut>1&&ct.reverse(),we&&te<ut&&(ct.length=te),this&&this!==mn&&this instanceof me&&(lr=He||Ga(lr)),lr.apply(tn,ct)}var we=u&Zn,Me=u&Xe,Le=u&Vt,We=u&(yt|mt),rt=u&vr,He=Le?C:Ga(a);return me}function Wf(a,u){return function(f,b){return P1(f,a,u(b),{})}}function rs(a,u){return function(f,b){var j;if(f===C&&b===C)return u;if(f!==C&&(j=f),b!==C){if(j===C)return b;typeof f=="string"||typeof b=="string"?(f=Wn(f),b=Wn(b)):(f=Rf(f),b=Rf(b)),j=a(f,b)}return j}}function Iu(a){return Wr(function(u){return u=d(u,w(Ye())),st(function(f){var b=this;return a(u,function(j){return n(j,b,f)})})})}function is(a,u){u=u===C?" ":Wn(u);var f=u.length;if(f<2)return f?wu(u,a):u;var b=wu(u,Es(a/Ge(u)));return z(u)?ai(Ze(b),0,a).join(""):b.slice(0,a)}function sk(a,u,f,b){function j(){for(var G=-1,te=arguments.length,ye=-1,me=b.length,we=pn(me+te),Me=this&&this!==mn&&this instanceof j?Z:a;++ye<me;)we[ye]=b[ye];for(;te--;)we[ye++]=arguments[++G];return n(Me,P?f:this,we)}var P=u&Xe,Z=Ga(a);return j}function qf(a){return function(u,f,b){return b&&typeof b!="number"&&Sn(u,f,b)&&(f=b=C),u=Gr(u),f===C?(f=u,u=0):f=Gr(f),b=b===C?u<f?1:-1:Gr(b),G1(u,f,b,a)}}function as(a){return function(u,f){return typeof u=="string"&&typeof f=="string"||(u=or(u),f=or(f)),a(u,f)}}function Vf(a,u,f,b,j,P,Z,G,te,ye){var me=u&yt,we=me?Z:C,Me=me?C:Z,Le=me?P:C,We=me?C:P;u|=me?kn:Er,u&=~(me?Er:kn),u&jt||(u&=-4);var rt=[a,u,j,Le,we,We,Me,G,te,ye],He=f.apply(C,rt);return Mu(a)&&Wh(He,rt),He.placeholder=b,ih(He,a,u)}function ju(a){var u=ia[a];return function(f,b){if(f=or(f),b=b==null?0:vn(at(b),292),b&&$h(f)){var j=(kt(f)+"e").split("e");return j=(kt(u(j[0]+"e"+(+j[1]+b)))+"e").split("e"),+(j[0]+"e"+(+j[1]-b))}return u(f)}}function Gf(a){return function(u){var f=yn(u);return f==Hn?ne(u):f==yr?Oe(u):M(u,a(u))}}function Hr(a,u,f,b,j,P,Z,G){var te=u&Vt;if(!te&&typeof a!="function")throw new sr(ee);var ye=b?b.length:0;if(ye||(u&=-97,b=j=C),Z=Z===C?Z:dn(at(Z),0),G=G===C?G:at(G),ye-=j?j.length:0,u&Er){var me=b,we=j;b=j=C}var Me=te?C:Qu(a),Le=[a,u,f,b,j,me,we,P,Z,G];if(Me&&_k(Le,Me),a=Le[0],u=Le[1],f=Le[2],b=Le[3],j=Le[4],G=Le[9]=Le[9]===C?te?0:a.length:dn(Le[9]-ye,0),!G&&u&(yt|mt)&&(u&=-25),u&&u!=Xe)We=u==yt||u==mt?ok(a,u,G):u!=kn&&u!=(Xe|kn)||j.length?ns.apply(C,Le):sk(a,u,f,b);else var We=ak(a,u,f);return ih((Me?Uh:Wh)(We,Le),a,u)}function Jf(a,u,f,b){return a===C||_r(a,aa[f])&&!Ct.call(b,f)?u:a}function Kf(a,u,f,b,j,P){return Gt(a)&&Gt(u)&&(P.set(u,a),Xo(a,u,C,Kf,P),P.delete(u)),a}function lk(a){return Ka(a)?C:a}function Yf(a,u,f,b,j,P){var Z=f&xt,G=a.length,te=u.length;if(G!=te&&!(Z&&te>G))return!1;var ye=P.get(a),me=P.get(u);if(ye&&me)return ye==u&&me==a;var we=-1,Me=!0,Le=f&It?new Ci:C;for(P.set(a,u),P.set(u,a);++we<G;){var We=a[we],rt=u[we];if(b)var He=Z?b(rt,We,we,u,a,P):b(We,rt,we,a,u,P);if(He!==C){if(He)continue;Me=!1;break}if(Le){if(!g(u,function(ut,ct){if(!_e(Le,ct)&&(We===ut||j(We,ut,f,b,P)))return Le.push(ct)})){Me=!1;break}}else if(We!==rt&&!j(We,rt,f,b,P)){Me=!1;break}}return P.delete(a),P.delete(u),Me}function uk(a,u,f,b,j,P,Z){switch(f){case Yi:if(a.byteLength!=u.byteLength||a.byteOffset!=u.byteOffset)return!1;a=a.buffer,u=u.buffer;case Ua:return!(a.byteLength!=u.byteLength||!P(new ws(a),new ws(u)));case Ht:case nn:case Da:return _r(+a,+u);case Ji:return a.name==u.name&&a.message==u.message;case Fa:case La:return a==u+"";case Hn:var G=ne;case yr:var te=b&xt;if(G||(G=ce),a.size!=u.size&&!te)return!1;var ye=Z.get(a);if(ye)return ye==u;b|=It,Z.set(a,u);var me=Yf(G(a),G(u),b,j,P,Z);return Z.delete(a),me;case Wo:if(to)return to.call(a)==to.call(u)}return!1}function ck(a,u,f,b,j,P){var Z=f&xt,G=Ru(a),te=G.length;if(te!=Ru(u).length&&!Z)return!1;for(var ye=te;ye--;){var me=G[ye];if(!(Z?me in u:Ct.call(u,me)))return!1}var we=P.get(a),Me=P.get(u);if(we&&Me)return we==u&&Me==a;var Le=!0;P.set(a,u),P.set(u,a);for(var We=Z;++ye<te;){me=G[ye];var rt=a[me],He=u[me];if(b)var ut=Z?b(He,rt,me,u,a,P):b(rt,He,me,a,u,P);if(!(ut===C?rt===He||j(rt,He,f,b,P):ut)){Le=!1;break}We||(We=me=="constructor")}if(Le&&!We){var ct=a.constructor,bn=u.constructor;ct!=bn&&"constructor"in a&&"constructor"in u&&!(typeof ct=="function"&&ct instanceof ct&&typeof bn=="function"&&bn instanceof bn)&&(Le=!1)}return P.delete(a),P.delete(u),Le}function Wr(a){return tc(nh(a,C,uh),a+"")}function Ru(a){return bf(a,hn,ec)}function Ou(a){return bf(a,zn,Hh)}function os(a){for(var u=a.name+"",f=sa[u],b=Ct.call(sa,u)?f.length:0;b--;){var j=f[b],P=j.func;if(P==null||P==a)return j.name}return u}function na(a){return(Ct.call(A,"placeholder")?A:a).placeholder}function Ye(){var a=A.iteratee||Zu;return a=a===Zu?wf:a,arguments.length?a(arguments[0],arguments[1]):a}function ss(a,u){var f=a.__data__;return yk(u)?f[typeof u=="string"?"string":"hash"]:f.map}function zu(a){for(var u=hn(a),f=u.length;f--;){var b=u[f],j=a[b];u[f]=[b,j,eh(j)]}return u}function Ai(a,u){var f=ie(a,u);return _f(f)?f:C}function pk(a){var u=Ct.call(a,Ii),f=a[Ii];try{a[Ii]=C;var b=!0}catch{}var j=xs.call(a);return b&&(u?a[Ii]=f:delete a[Ii]),j}function dk(a,u,f){for(var b=-1,j=f.length;++b<j;){var P=f[b],Z=P.size;switch(P.type){case"drop":a+=Z;break;case"dropRight":u-=Z;break;case"take":u=vn(u,a+Z);break;case"takeRight":a=dn(a,u-Z)}}return{start:a,end:u}}function fk(a){var u=a.match(pw);return u?u[1].split(dw):[]}function Xf(a,u,f){u=ii(u,a);for(var b=-1,j=u.length,P=!1;++b<j;){var Z=xr(u[b]);if(!(P=a!=null&&f(a,Z)))break;a=a[Z]}return P||++b!=j?P:(j=a==null?0:a.length,!!j&&fs(j)&&qr(Z,j)&&(nt(a)||ji(a)))}function hk(a){var u=a.length,f=new a.constructor(u);return u&&typeof a[0]=="string"&&Ct.call(a,"index")&&(f.index=a.index,f.input=a.input),f}function Qf(a){return typeof a.constructor!="function"||Ja(a)?{}:la(ks(a))}function mk(a,u,f){var b=a.constructor;switch(u){case Ua:return Tu(a);case Ht:case nn:return new b(+a);case Yi:return Q1(a,f);case Vl:case Gl:case Jl:case Kl:case Yl:case Xl:case Ql:case eu:case tu:return Pf(a,f);case Hn:return new b;case Da:case La:return new b(a);case Fa:return ek(a);case yr:return new b;case Wo:return tk(a)}}function gk(a,u){var f=u.length;if(!f)return a;var b=f-1;return u[b]=(f>1?"& ":"")+u[b],u=u.join(f>2?", ":" "),a.replace(cw,`{
/* [wrapped with `+u+`] */
`)}function vk(a){return nt(a)||ji(a)||!!(Ph&&a&&a[Ph])}function qr(a,u){var f=typeof a;return u=u??Tr,!!u&&(f=="number"||f!="symbol"&&xw.test(a))&&a>-1&&a%1==0&&a<u}function Sn(a,u,f){if(!Gt(f))return!1;var b=typeof u;return!!(b=="number"?On(f)&&qr(u,f.length):b=="string"&&u in f)&&_r(f[u],a)}function Nu(a,u){if(nt(a))return!1;var f=typeof a;return!(f!="number"&&f!="symbol"&&f!="boolean"&&a!=null&&!qn(a))||ow.test(a)||!aw.test(a)||u!=null&&a in Dt(u)}function yk(a){var u=typeof a;return u=="string"||u=="number"||u=="symbol"||u=="boolean"?a!=="__proto__":a===null}function Mu(a){var u=os(a),f=A[u];if(typeof f!="function"||!(u in De.prototype))return!1;if(a===f)return!0;var b=Qu(f);return!!b&&a===b[0]}function bk(a){return!!Oh&&Oh in a}function Ja(a){var u=a&&a.constructor;return a===(typeof u=="function"&&u.prototype||aa)}function eh(a){return a===a&&!Gt(a)}function th(a,u){return function(f){return f!=null&&f[a]===u&&(u!==C||a in Dt(f))}}function xk(a){var u=ps(a,function(b){return f.size===oe&&f.clear(),b}),f=u.cache;return u}function _k(a,u){var f=a[1],b=u[1],j=f|b,P=j<(Xe|Vt|Zn),Z=b==Zn&&f==yt||b==Zn&&f==Ar&&a[7].length<=u[8]||b==(Zn|Ar)&&u[7].length<=u[8]&&f==yt;if(!P&&!Z)return a;b&Xe&&(a[2]=u[2],j|=f&Xe?0:jt);var G=u[3];if(G){var te=a[3];a[3]=te?Df(te,G,u[4]):G,a[4]=te?Ke(a[3],Ce):u[4]}return G=u[5],G&&(te=a[5],a[5]=te?Ff(te,G,u[6]):G,a[6]=te?Ke(a[5],Ce):u[6]),G=u[7],G&&(a[7]=G),b&Zn&&(a[8]=a[8]==null?u[8]:vn(a[8],u[8])),a[9]==null&&(a[9]=u[9]),a[0]=u[0],a[1]=j,a}function wk(a){var u=[];if(a!=null)for(var f in Dt(a))u.push(f);return u}function kk(a){return xs.call(a)}function nh(a,u,f){return u=dn(u===C?a.length-1:u,0),function(){for(var b=arguments,j=-1,P=dn(b.length-u,0),Z=pn(P);++j<P;)Z[j]=b[u+j];j=-1;for(var G=pn(u+1);++j<u;)G[j]=b[j];return G[u]=f(Z),n(a,this,G)}}function rh(a,u){return u.length<2?a:Ei(a,ir(u,0,-1))}function Ck(a,u){for(var f=a.length,b=vn(u.length,f),j=Rn(a);b--;){var P=u[b];a[b]=qr(P,f)?j[P]:C}return a}function Pu(a,u){if((u!=="constructor"||typeof a[u]!="function")&&u!="__proto__")return a[u]}function ih(a,u,f){var b=u+"";return tc(a,gk(b,Sk(fk(b),f)))}function ah(a){var u=0,f=0;return function(){var b=zE(),j=Zo-(b-f);if(f=b,j>0){if(++u>=Bl)return arguments[0]}else u=0;return a.apply(C,arguments)}}function ls(a,u){var f=-1,b=a.length,j=b-1;for(u=u===C?b:u;++f<u;){var P=_u(f,j),Z=a[P];a[P]=a[f],a[f]=Z}return a.length=u,a}function xr(a){if(typeof a=="string"||qn(a))return a;var u=a+"";return u=="0"&&1/a==-Lr?"-0":u}function Ti(a){if(a!=null){try{return bs.call(a)}catch{}try{return a+""}catch{}}return""}function Sk(a,u){return i(Tt,function(f){var b="_."+f[0];u&f[1]&&!c(a,b)&&a.push(b)}),a.sort()}function oh(a){if(a instanceof De)return a.clone();var u=new Ve(a.__wrapped__,a.__chain__);return u.__actions__=Rn(a.__actions__),u.__index__=a.__index__,u.__values__=a.__values__,u}function Ek(a,u,f){u=(f?Sn(a,u,f):u===C)?1:dn(at(u),0);var b=a==null?0:a.length;if(!b||u<1)return[];for(var j=0,P=0,Z=pn(Es(b/u));j<b;)Z[P++]=ir(a,j,j+=u);return Z}function Ak(a){for(var u=-1,f=a==null?0:a.length,b=0,j=[];++u<f;){var P=a[u];P&&(j[b++]=P)}return j}function Tk(){var a=arguments.length;if(!a)return[];for(var u=pn(a-1),f=arguments[0],b=a;b--;)u[b-1]=arguments[b];return h(nt(f)?Rn(f):[f],gn(u,1))}function Ik(a,u,f){var b=a==null?0:a.length;return b?(u=f||u===C?1:at(u),ir(a,u<0?0:u,b)):[]}function jk(a,u,f){var b=a==null?0:a.length;return b?(u=f||u===C?1:at(u),u=b-u,ir(a,0,u<0?0:u)):[]}function Rk(a,u){return a&&a.length?es(a,Ye(u,3),!0,!0):[]}function Ok(a,u){return a&&a.length?es(a,Ye(u,3),!0):[]}function zk(a,u,f,b){var j=a==null?0:a.length;return j?(f&&typeof f!="number"&&Sn(a,u,f)&&(f=0,b=j),O1(a,u,f,b)):[]}function sh(a,u,f){var b=a==null?0:a.length;if(!b)return-1;var j=f==null?0:at(f);return j<0&&(j=dn(b+j,0)),S(a,Ye(u,3),j)}function lh(a,u,f){var b=a==null?0:a.length;if(!b)return-1;var j=b-1;return f!==C&&(j=at(f),j=f<0?dn(b+j,0):vn(j,b-1)),S(a,Ye(u,3),j,!0)}function uh(a){return a!=null&&a.length?gn(a,1):[]}function Nk(a){return a!=null&&a.length?gn(a,Lr):[]}function Mk(a,u){return a!=null&&a.length?(u=u===C?1:at(u),gn(a,u)):[]}function Pk(a){for(var u=-1,f=a==null?0:a.length,b={};++u<f;){var j=a[u];Ir(b,j[0],j[1])}return b}function ch(a){return a&&a.length?a[0]:C}function $k(a,u,f){var b=a==null?0:a.length;if(!b)return-1;var j=f==null?0:at(f);return j<0&&(j=dn(b+j,0)),T(a,u,j)}function Dk(a){return a!=null&&a.length?ir(a,0,-1):[]}function Fk(a,u){return a==null?"":RE.call(a,u)}function ar(a){var u=a==null?0:a.length;return u?a[u-1]:C}function Lk(a,u,f){var b=a==null?0:a.length;if(!b)return-1;var j=b;return f!==C&&(j=at(f),j=j<0?dn(b+j,0):vn(j,b-1)),u===u?Re(a,u,j):S(a,O,j,!0)}function Bk(a,u){return a&&a.length?Ef(a,at(u)):C}function ph(a,u){return a&&a.length&&u&&u.length?xu(a,u):a}function Uk(a,u,f){return a&&a.length&&u&&u.length?xu(a,u,Ye(f,2)):a}function Zk(a,u,f){return a&&a.length&&u&&u.length?xu(a,u,C,f):a}function Hk(a,u){var f=[];if(!a||!a.length)return f;var b=-1,j=[],P=a.length;for(u=Ye(u,3);++b<P;){var Z=a[b];u(Z,b,a)&&(f.push(Z),j.push(b))}return If(a,j),f}function $u(a){return a==null?a:ME.call(a)}function Wk(a,u,f){var b=a==null?0:a.length;return b?(f&&typeof f!="number"&&Sn(a,u,f)?(u=0,f=b):(u=u==null?0:at(u),f=f===C?b:at(f)),ir(a,u,f)):[]}function qk(a,u){return Qo(a,u)}function Vk(a,u,f){return ku(a,u,Ye(f,2))}function Gk(a,u){var f=a==null?0:a.length;if(f){var b=Qo(a,u);if(b<f&&_r(a[b],u))return b}return-1}function Jk(a,u){return Qo(a,u,!0)}function Kk(a,u,f){return ku(a,u,Ye(f,2),!0)}function Yk(a,u){if(a!=null&&a.length){var f=Qo(a,u,!0)-1;if(_r(a[f],u))return f}return-1}function Xk(a){return a&&a.length?jf(a):[]}function Qk(a,u){return a&&a.length?jf(a,Ye(u,2)):[]}function eC(a){var u=a==null?0:a.length;return u?ir(a,1,u):[]}function tC(a,u,f){return a&&a.length?(u=f||u===C?1:at(u),ir(a,0,u<0?0:u)):[]}function nC(a,u,f){var b=a==null?0:a.length;return b?(u=f||u===C?1:at(u),u=b-u,ir(a,u<0?0:u,b)):[]}function rC(a,u){return a&&a.length?es(a,Ye(u,3),!1,!0):[]}function iC(a,u){return a&&a.length?es(a,Ye(u,3)):[]}function aC(a){return a&&a.length?ri(a):[]}function oC(a,u){return a&&a.length?ri(a,Ye(u,2)):[]}function sC(a,u){return u=typeof u=="function"?u:C,a&&a.length?ri(a,C,u):[]}function Du(a){if(!a||!a.length)return[];var u=0;return a=l(a,function(f){if(rn(f))return u=dn(f.length,u),!0}),X(u,function(f){return d(a,B(f))})}function dh(a,u){if(!a||!a.length)return[];var f=Du(a);return u==null?f:d(f,function(b){return n(u,C,b)})}function lC(a,u){return Nf(a||[],u||[],Za)}function uC(a,u){return Nf(a||[],u||[],Va)}function fh(a){var u=A(a);return u.__chain__=!0,u}function cC(a,u){return u(a),a}function us(a,u){return u(a)}function pC(){return fh(this)}function dC(){return new Ve(this.value(),this.__chain__)}function fC(){this.__values__===C&&(this.__values__=kh(this.value()));var a=this.__index__>=this.__values__.length;return{done:a,value:a?C:this.__values__[this.__index__++]}}function hC(){return this}function mC(a){for(var u,f=this;f instanceof Pe;){var b=oh(f);b.__index__=0,b.__values__=C,u?j.__wrapped__=b:u=b;var j=b;f=f.__wrapped__}return j.__wrapped__=a,u}function gC(){var a=this.__wrapped__;if(a instanceof De){var u=a;return this.__actions__.length&&(u=new De(this)),u=u.reverse(),u.__actions__.push({func:us,args:[$u],thisArg:C}),new Ve(u,this.__chain__)}return this.thru($u)}function vC(){return zf(this.__wrapped__,this.__actions__)}function yC(a,u,f){var b=nt(a)?o:R1;return f&&Sn(a,u,f)&&(u=C),b(a,Ye(u,3))}function bC(a,u){return(nt(a)?l:yf)(a,Ye(u,3))}function xC(a,u){return gn(cs(a,u),1)}function _C(a,u){return gn(cs(a,u),Lr)}function wC(a,u,f){return f=f===C?1:at(f),gn(cs(a,u),f)}function hh(a,u){return(nt(a)?i:si)(a,Ye(u,3))}function mh(a,u){return(nt(a)?s:Lh)(a,Ye(u,3))}function kC(a,u,f,b){a=On(a)?a:ra(a),f=f&&!b?at(f):0;var j=a.length;return f<0&&(f=dn(j+f,0)),hs(a)?f<=j&&a.indexOf(u,f)>-1:!!j&&T(a,u,f)>-1}function cs(a,u){return(nt(a)?d:kf)(a,Ye(u,3))}function CC(a,u,f,b){return a==null?[]:(nt(u)||(u=u==null?[]:[u]),f=b?C:f,nt(f)||(f=f==null?[]:[f]),Af(a,u,f))}function SC(a,u,f){var b=nt(a)?v:V,j=arguments.length<3;return b(a,Ye(u,4),f,j,si)}function EC(a,u,f){var b=nt(a)?y:V,j=arguments.length<3;return b(a,Ye(u,4),f,j,Lh)}function AC(a,u){return(nt(a)?l:yf)(a,ds(Ye(u,3)))}function TC(a){return(nt(a)?hf:J1)(a)}function IC(a,u,f){return u=(f?Sn(a,u,f):u===C)?1:at(u),(nt(a)?E1:K1)(a,u)}function jC(a){return(nt(a)?A1:Y1)(a)}function RC(a){if(a==null)return 0;if(On(a))return hs(a)?Ge(a):a.length;var u=yn(a);return u==Hn||u==yr?a.size:yu(a).length}function OC(a,u,f){var b=nt(a)?g:X1;return f&&Sn(a,u,f)&&(u=C),b(a,Ye(u,3))}function zC(a,u){if(typeof u!="function")throw new sr(ee);return a=at(a),function(){if(--a<1)return u.apply(this,arguments)}}function gh(a,u,f){return u=f?C:u,u=a&&u==null?a.length:u,Hr(a,Zn,C,C,C,C,u)}function vh(a,u){var f;if(typeof u!="function")throw new sr(ee);return a=at(a),function(){return--a>0&&(f=u.apply(this,arguments)),a<=1&&(u=C),f}}function yh(a,u,f){u=f?C:u;var b=Hr(a,yt,C,C,C,C,C,u);return b.placeholder=yh.placeholder,b}function bh(a,u,f){u=f?C:u;var b=Hr(a,mt,C,C,C,C,C,u);return b.placeholder=bh.placeholder,b}function xh(a,u,f){function b(tn){var lr=Me,ro=Le;return Me=Le=C,ct=tn,rt=a.apply(ro,lr)}function j(tn){return ct=tn,He=no(G,u),bn?b(tn):rt}function P(tn){var lr=tn-ut,ro=tn-ct,rm=u-lr;return Mn?vn(rm,We-ro):rm}function Z(tn){var lr=tn-ut,ro=tn-ct;return ut===C||lr>=u||lr<0||Mn&&ro>=We}function G(){var tn=js();return Z(tn)?te(tn):(He=no(G,P(tn)),C)}function te(tn){return He=C,ui&&Me?b(tn):(Me=Le=C,rt)}function ye(){He!==C&&Zh(He),ct=0,Me=ut=Le=He=C}function me(){return He===C?rt:te(js())}function we(){var tn=js(),lr=Z(tn);if(Me=arguments,Le=this,ut=tn,lr){if(He===C)return j(ut);if(Mn)return Zh(He),He=no(G,u),b(ut)}return He===C&&(He=no(G,u)),rt}var Me,Le,We,rt,He,ut,ct=0,bn=!1,Mn=!1,ui=!0;if(typeof a!="function")throw new sr(ee);return u=or(u)||0,Gt(f)&&(bn=!!f.leading,Mn="maxWait"in f,We=Mn?dn(or(f.maxWait)||0,u):We,ui="trailing"in f?!!f.trailing:ui),we.cancel=ye,we.flush=me,we}function NC(a){return Hr(a,vr)}function ps(a,u){if(typeof a!="function"||u!=null&&typeof u!="function")throw new sr(ee);var f=function(){var b=arguments,j=u?u.apply(this,b):b[0],P=f.cache;if(P.has(j))return P.get(j);var Z=a.apply(this,b);return f.cache=P.set(j,Z)||P,Z};return f.cache=new(ps.Cache||Zr),f}function ds(a){if(typeof a!="function")throw new sr(ee);return function(){var u=arguments;switch(u.length){case 0:return!a.call(this);case 1:return!a.call(this,u[0]);case 2:return!a.call(this,u[0],u[1]);case 3:return!a.call(this,u[0],u[1],u[2])}return!a.apply(this,u)}}function MC(a){return vh(2,a)}function PC(a,u){if(typeof a!="function")throw new sr(ee);return u=u===C?u:at(u),st(a,u)}function $C(a,u){if(typeof a!="function")throw new sr(ee);return u=u==null?0:dn(at(u),0),st(function(f){var b=f[u],j=ai(f,0,u);return b&&h(j,b),n(a,this,j)})}function DC(a,u,f){var b=!0,j=!0;if(typeof a!="function")throw new sr(ee);return Gt(f)&&(b="leading"in f?!!f.leading:b,j="trailing"in f?!!f.trailing:j),xh(a,u,{leading:b,maxWait:u,trailing:j})}function FC(a){return gh(a,1)}function LC(a,u){return rc(Au(u),a)}function BC(){if(!arguments.length)return[];var a=arguments[0];return nt(a)?a:[a]}function UC(a){return rr(a,dt)}function ZC(a,u){return u=typeof u=="function"?u:C,rr(a,dt,u)}function HC(a){return rr(a,Se|dt)}function WC(a,u){return u=typeof u=="function"?u:C,rr(a,Se|dt,u)}function qC(a,u){return u==null||gf(a,u,hn(u))}function _r(a,u){return a===u||a!==a&&u!==u}function On(a){return a!=null&&fs(a.length)&&!Vr(a)}function rn(a){return en(a)&&On(a)}function VC(a){return a===!0||a===!1||en(a)&&Cn(a)==Ht}function GC(a){return en(a)&&a.nodeType===1&&!Ka(a)}function JC(a){if(a==null)return!0;if(On(a)&&(nt(a)||typeof a=="string"||typeof a.splice=="function"||li(a)||ua(a)||ji(a)))return!a.length;var u=yn(a);if(u==Hn||u==yr)return!a.size;if(Ja(a))return!yu(a).length;for(var f in a)if(Ct.call(a,f))return!1;return!0}function KC(a,u){return qa(a,u)}function YC(a,u,f){f=typeof f=="function"?f:C;var b=f?f(a,u):C;return b===C?qa(a,u,C,f):!!b}function Fu(a){if(!en(a))return!1;var u=Cn(a);return u==Ji||u==Wl||typeof a.message=="string"&&typeof a.name=="string"&&!Ka(a)}function XC(a){return typeof a=="number"&&$h(a)}function Vr(a){if(!Gt(a))return!1;var u=Cn(a);return u==Ki||u==ql||u==ln||u==J_}function _h(a){return typeof a=="number"&&a==at(a)}function fs(a){return typeof a=="number"&&a>-1&&a%1==0&&a<=Tr}function Gt(a){var u=typeof a;return a!=null&&(u=="object"||u=="function")}function en(a){return a!=null&&typeof a=="object"}function QC(a,u){return a===u||vu(a,u,zu(u))}function eS(a,u,f){return f=typeof f=="function"?f:C,vu(a,u,zu(u),f)}function tS(a){return wh(a)&&a!=+a}function nS(a){if(HE(a))throw new gs(be);return _f(a)}function rS(a){return a===null}function iS(a){return a==null}function wh(a){return typeof a=="number"||en(a)&&Cn(a)==Da}function Ka(a){if(!en(a)||Cn(a)!=Br)return!1;var u=ks(a);if(u===null)return!0;var f=Ct.call(u,"constructor")&&u.constructor;return typeof f=="function"&&f instanceof f&&bs.call(f)==CE}function aS(a){return _h(a)&&a>=-Tr&&a<=Tr}function hs(a){return typeof a=="string"||!nt(a)&&en(a)&&Cn(a)==La}function qn(a){return typeof a=="symbol"||en(a)&&Cn(a)==Wo}function oS(a){return a===C}function sS(a){return en(a)&&yn(a)==Ba}function lS(a){return en(a)&&Cn(a)==Y_}function kh(a){if(!a)return[];if(On(a))return hs(a)?Ze(a):Rn(a);if(Ya&&a[Ya])return le(a[Ya]());var u=yn(a);return(u==Hn?ne:u==yr?ce:ra)(a)}function Gr(a){return a?(a=or(a),a===Lr||a===-Lr?(a<0?-1:1)*Zl:a===a?a:0):a===0?a:0}function at(a){var u=Gr(a),f=u%1;return u===u?f?u-f:u:0}function Ch(a){return a?Si(at(a),0,tr):0}function or(a){if(typeof a=="number")return a;if(qn(a))return Gi;if(Gt(a)){var u=typeof a.valueOf=="function"?a.valueOf():a;a=Gt(u)?u+"":u}if(typeof a!="string")return a===0?a:+a;a=Y(a);var f=vw.test(a);return f||bw.test(a)?Kw(a.slice(2),f?2:8):gw.test(a)?Gi:+a}function Sh(a){return Rr(a,zn(a))}function uS(a){return a?Si(at(a),-Tr,Tr):a===0?a:0}function kt(a){return a==null?"":Wn(a)}function cS(a,u){var f=la(a);return u==null?f:mf(f,u)}function pS(a,u){return x(a,Ye(u,3),jr)}function dS(a,u){return x(a,Ye(u,3),hu)}function fS(a,u){return a==null?a:Xu(a,Ye(u,3),zn)}function hS(a,u){return a==null?a:Bh(a,Ye(u,3),zn)}function mS(a,u){return a&&jr(a,Ye(u,3))}function gS(a,u){return a&&hu(a,Ye(u,3))}function vS(a){return a==null?[]:Yo(a,hn(a))}function yS(a){return a==null?[]:Yo(a,zn(a))}function Lu(a,u,f){var b=a==null?C:Ei(a,u);return b===C?f:b}function bS(a,u){return a!=null&&Xf(a,u,z1)}function Bu(a,u){return a!=null&&Xf(a,u,N1)}function hn(a){return On(a)?ff(a):yu(a)}function zn(a){return On(a)?ff(a,!0):H1(a)}function xS(a,u){var f={};return u=Ye(u,3),jr(a,function(b,j,P){Ir(f,u(b,j,P),b)}),f}function _S(a,u){var f={};return u=Ye(u,3),jr(a,function(b,j,P){Ir(f,j,u(b,j,P))}),f}function wS(a,u){return Eh(a,ds(Ye(u)))}function Eh(a,u){if(a==null)return{};var f=d(Ou(a),function(b){return[b]});return u=Ye(u),Tf(a,f,function(b,j){return u(b,j[0])})}function kS(a,u,f){u=ii(u,a);var b=-1,j=u.length;for(j||(j=1,a=C);++b<j;){var P=a==null?C:a[xr(u[b])];P===C&&(b=j,P=f),a=Vr(P)?P.call(a):P}return a}function CS(a,u,f){return a==null?a:Va(a,u,f)}function SS(a,u,f,b){return b=typeof b=="function"?b:C,a==null?a:Va(a,u,f,b)}function ES(a,u,f){var b=nt(a),j=b||li(a)||ua(a);if(u=Ye(u,4),f==null){var P=a&&a.constructor;f=j?b?new P:[]:Gt(a)&&Vr(P)?la(ks(a)):{}}return(j?i:jr)(a,function(Z,G,te){return u(f,Z,G,te)}),f}function AS(a,u){return a==null||Cu(a,u)}function TS(a,u,f){return a==null?a:Of(a,u,Au(f))}function IS(a,u,f,b){return b=typeof b=="function"?b:C,a==null?a:Of(a,u,Au(f),b)}function ra(a){return a==null?[]:F(a,hn(a))}function jS(a){return a==null?[]:F(a,zn(a))}function RS(a,u,f){return f===C&&(f=u,u=C),f!==C&&(f=or(f),f=f===f?f:0),u!==C&&(u=or(u),u=u===u?u:0),Si(or(a),u,f)}function OS(a,u,f){return u=Gr(u),f===C?(f=u,u=0):f=Gr(f),a=or(a),M1(a,u,f)}function zS(a,u,f){if(f&&typeof f!="boolean"&&Sn(a,u,f)&&(u=f=C),f===C&&(typeof u=="boolean"?(f=u,u=C):typeof a=="boolean"&&(f=a,a=C)),a===C&&u===C?(a=0,u=1):(a=Gr(a),u===C?(u=a,a=0):u=Gr(u)),a>u){var b=a;a=u,u=b}if(f||a%1||u%1){var j=Dh();return vn(a+j*(u-a+Jw("1e-"+((j+"").length-1))),u)}return _u(a,u)}function Ah(a){return oc(kt(a).toLowerCase())}function Th(a){return a=kt(a),a&&a.replace(_w,Qw).replace(Lw,"")}function NS(a,u,f){a=kt(a),u=Wn(u);var b=a.length;f=f===C?b:Si(at(f),0,b);var j=f;return f-=u.length,f>=0&&a.slice(f,j)==u}function MS(a){return a=kt(a),a&&nw.test(a)?a.replace(Pd,e1):a}function PS(a){return a=kt(a),a&&lw.test(a)?a.replace(nu,"\\$&"):a}function $S(a,u,f){a=kt(a),u=at(u);var b=u?Ge(a):0;if(!u||b>=u)return a;var j=(u-b)/2;return is(As(j),f)+a+is(Es(j),f)}function DS(a,u,f){a=kt(a),u=at(u);var b=u?Ge(a):0;return u&&b<u?a+is(u-b,f):a}function FS(a,u,f){a=kt(a),u=at(u);var b=u?Ge(a):0;return u&&b<u?is(u-b,f)+a:a}function LS(a,u,f){return f||u==null?u=0:u&&(u=+u),NE(kt(a).replace(ru,""),u||0)}function BS(a,u,f){return u=(f?Sn(a,u,f):u===C)?1:at(u),wu(kt(a),u)}function US(){var a=arguments,u=kt(a[0]);return a.length<3?u:u.replace(a[1],a[2])}function ZS(a,u,f){return f&&typeof f!="number"&&Sn(a,u,f)&&(u=f=C),(f=f===C?tr:f>>>0)?(a=kt(a),a&&(typeof u=="string"||u!=null&&!ic(u))&&(u=Wn(u),!u&&z(a))?ai(Ze(a),0,f):a.split(u,f)):[]}function HS(a,u,f){return a=kt(a),f=f==null?0:Si(at(f),0,a.length),u=Wn(u),a.slice(f,f+u.length)==u}function WS(a,u,f){var b=A.templateSettings;f&&Sn(a,u,f)&&(u=C),a=kt(a),u=ac({},u,b,Jf);var j=ac({},u.imports,b.imports,Jf),P=hn(j),Z=F(j,P);i(P,function(He){if(Dd.test(He))throw new gs(he)});var G,te,ye=0,me=u.interpolate||qo,we="__p+='",Me=Gu((u.escape||qo).source+"|"+me.source+"|"+(me===$d?mw:qo).source+"|"+(u.evaluate||qo).source+"|$","g"),Le=Ct.call(u,"sourceURL")?"//# sourceURL="+(u.sourceURL+"").replace(/\s/g," ")+`
`:"";a.replace(Me,function(He,ut,ct,bn,Mn,ui){return ct||(ct=bn),we+=a.slice(ye,ui).replace(ww,Ee),ut&&(G=!0,we+="'+__e("+ut+")+'"),Mn&&(te=!0,we+="';"+Mn+`;
__p+='`),ct&&(we+="'+((__t=("+ct+"))==null?'':__t)+'"),ye=ui+He.length,He}),we+="';";var We=Ct.call(u,"variable")&&u.variable;if(We){if(Dd.test(We))throw new gs(re)}else we="with(obj){"+we+"}";we=(te?we.replace(X_,""):we).replace(Q_,"$1").replace(ew,"$1;"),we="function("+(We||"obj")+"){"+(We?"":"obj||(obj={});")+"var __t,__p=''"+(G?",__e=_.escape":"")+(te?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+we+"return __p}";var rt=nm(function(){return Rh(P,Le+"return "+we).apply(C,Z)});if(rt.source=we,Fu(rt))throw rt;return rt}function qS(a){return kt(a).toLowerCase()}function VS(a){return kt(a).toUpperCase()}function GS(a,u,f){if(a=kt(a),a&&(f||u===C))return Y(a);if(!a||!(u=Wn(u)))return a;var b=Ze(a),j=Ze(u);return ai(b,se(b,j),pe(b,j)+1).join("")}function JS(a,u,f){if(a=kt(a),a&&(f||u===C))return a.slice(0,E(a)+1);if(!a||!(u=Wn(u)))return a;var b=Ze(a);return ai(b,0,pe(b,Ze(u))+1).join("")}function KS(a,u,f){if(a=kt(a),a&&(f||u===C))return a.replace(ru,"");if(!a||!(u=Wn(u)))return a;var b=Ze(a);return ai(b,se(b,Ze(u))).join("")}function YS(a,u){var f=ni,b=Uo;if(Gt(u)){var j="separator"in u?u.separator:j;f="length"in u?at(u.length):f,b="omission"in u?Wn(u.omission):b}a=kt(a);var P=a.length;if(z(a)){var Z=Ze(a);P=Z.length}if(f>=P)return a;var G=f-Ge(b);if(G<1)return b;var te=Z?ai(Z,0,G).join(""):a.slice(0,G);if(j===C)return te+b;if(Z&&(G+=te.length-G),ic(j)){if(a.slice(G).search(j)){var ye,me=te;for(j.global||(j=Gu(j.source,kt(Fd.exec(j))+"g")),j.lastIndex=0;ye=j.exec(me);)var we=ye.index;te=te.slice(0,we===C?G:we)}}else if(a.indexOf(Wn(j),G)!=G){var Me=te.lastIndexOf(j);Me>-1&&(te=te.slice(0,Me))}return te+b}function XS(a){return a=kt(a),a&&tw.test(a)?a.replace(Md,t1):a}function Ih(a,u,f){return a=kt(a),u=f?C:u,u===C?je(a)?$(a):_(a):a.match(u)||[]}function QS(a){var u=a==null?0:a.length,f=Ye();return a=u?d(a,function(b){if(typeof b[1]!="function")throw new sr(ee);return[f(b[0]),b[1]]}):[],st(function(b){for(var j=-1;++j<u;){var P=a[j];if(n(P[0],this,b))return n(P[1],this,b)}})}function eE(a){return j1(rr(a,Se))}function Uu(a){return function(){return a}}function tE(a,u){return a==null||a!==a?u:a}function Nn(a){return a}function Zu(a){return wf(typeof a=="function"?a:rr(a,Se))}function nE(a){return Cf(rr(a,Se))}function rE(a,u){return Sf(a,rr(u,Se))}function Hu(a,u,f){var b=hn(u),j=Yo(u,b);f!=null||Gt(u)&&(j.length||!b.length)||(f=u,u=a,a=this,j=Yo(u,hn(u)));var P=!(Gt(f)&&"chain"in f&&!f.chain),Z=Vr(a);return i(j,function(G){var te=u[G];a[G]=te,Z&&(a.prototype[G]=function(){var ye=this.__chain__;if(P||ye){var me=a(this.__wrapped__);return(me.__actions__=Rn(this.__actions__)).push({func:te,args:arguments,thisArg:a}),me.__chain__=ye,me}return te.apply(a,h([this.value()],arguments))})}),a}function iE(){return mn._===this&&(mn._=SE),this}function Wu(){}function aE(a){return a=at(a),st(function(u){return Ef(u,a)})}function jh(a){return Nu(a)?B(xr(a)):V1(a)}function oE(a){return function(u){return a==null?C:Ei(a,u)}}function qu(){return[]}function Vu(){return!1}function sE(){return{}}function lE(){return""}function uE(){return!0}function cE(a,u){if(a=at(a),a<1||a>Tr)return[];var f=tr,b=vn(a,tr);u=Ye(u),a-=tr;for(var j=X(b,u);++f<a;)u(f);return j}function pE(a){return nt(a)?d(a,xr):qn(a)?[a]:Rn(qh(kt(a)))}function dE(a){var u=++kE;return kt(a)+u}function fE(a){return a&&a.length?Ko(a,Nn,mu):C}function hE(a,u){return a&&a.length?Ko(a,Ye(u,2),mu):C}function mE(a){return R(a,Nn)}function gE(a,u){return R(a,Ye(u,2))}function vE(a){return a&&a.length?Ko(a,Nn,bu):C}function yE(a,u){return a&&a.length?Ko(a,Ye(u,2),bu):C}function bE(a){return a&&a.length?D(a,Nn):0}function xE(a,u){return a&&a.length?D(a,Ye(u,2)):0}fe=fe==null?mn:Qi.defaults(mn.Object(),fe,Qi.pick(mn,Hw));var pn=fe.Array,ms=fe.Date,gs=fe.Error,Rh=fe.Function,ia=fe.Math,Dt=fe.Object,Gu=fe.RegExp,_E=fe.String,sr=fe.TypeError,vs=pn.prototype,wE=Rh.prototype,aa=Dt.prototype,ys=fe["__core-js_shared__"],bs=wE.toString,Ct=aa.hasOwnProperty,kE=0,Oh=function(){var a=/[^.]+$/.exec(ys&&ys.keys&&ys.keys.IE_PROTO||"");return a?"Symbol(src)_1."+a:""}(),xs=aa.toString,CE=bs.call(Dt),SE=mn._,EE=Gu("^"+bs.call(Ct).replace(nu,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),_s=of?fe.Buffer:C,oi=fe.Symbol,ws=fe.Uint8Array,zh=_s?_s.allocUnsafe:C,ks=Je(Dt.getPrototypeOf,Dt),Nh=Dt.create,Mh=aa.propertyIsEnumerable,Cs=vs.splice,Ph=oi?oi.isConcatSpreadable:C,Ya=oi?oi.iterator:C,Ii=oi?oi.toStringTag:C,Ss=function(){try{var a=Ai(Dt,"defineProperty");return a({},"",{}),a}catch{}}(),AE=fe.clearTimeout!==mn.clearTimeout&&fe.clearTimeout,TE=ms&&ms.now!==mn.Date.now&&ms.now,IE=fe.setTimeout!==mn.setTimeout&&fe.setTimeout,Es=ia.ceil,As=ia.floor,Ju=Dt.getOwnPropertySymbols,jE=_s?_s.isBuffer:C,$h=fe.isFinite,RE=vs.join,OE=Je(Dt.keys,Dt),dn=ia.max,vn=ia.min,zE=ms.now,NE=fe.parseInt,Dh=ia.random,ME=vs.reverse,Ku=Ai(fe,"DataView"),Xa=Ai(fe,"Map"),Yu=Ai(fe,"Promise"),oa=Ai(fe,"Set"),Qa=Ai(fe,"WeakMap"),eo=Ai(Dt,"create"),Ts=Qa&&new Qa,sa={},PE=Ti(Ku),$E=Ti(Xa),DE=Ti(Yu),FE=Ti(oa),LE=Ti(Qa),Is=oi?oi.prototype:C,to=Is?Is.valueOf:C,Fh=Is?Is.toString:C,la=function(){function a(){}return function(u){if(!Gt(u))return{};if(Nh)return Nh(u);a.prototype=u;var f=new a;return a.prototype=C,f}}();A.templateSettings={escape:rw,evaluate:iw,interpolate:$d,variable:"",imports:{_:A}},A.prototype=Pe.prototype,A.prototype.constructor=A,Ve.prototype=la(Pe.prototype),Ve.prototype.constructor=Ve,De.prototype=la(Pe.prototype),De.prototype.constructor=De,ki.prototype.clear=i1,ki.prototype.delete=a1,ki.prototype.get=o1,ki.prototype.has=s1,ki.prototype.set=l1,Ur.prototype.clear=u1,Ur.prototype.delete=c1,Ur.prototype.get=p1,Ur.prototype.has=d1,Ur.prototype.set=f1,Zr.prototype.clear=h1,Zr.prototype.delete=m1,Zr.prototype.get=g1,Zr.prototype.has=v1,Zr.prototype.set=y1,Ci.prototype.add=Ci.prototype.push=b1,Ci.prototype.has=x1,br.prototype.clear=_1,br.prototype.delete=w1,br.prototype.get=k1,br.prototype.has=C1,br.prototype.set=S1;var si=Lf(jr),Lh=Lf(hu,!0),Xu=Bf(),Bh=Bf(!0),Uh=Ts?function(a,u){return Ts.set(a,u),a}:Nn,BE=Ss?function(a,u){return Ss(a,"toString",{configurable:!0,enumerable:!1,value:Uu(u),writable:!0})}:Nn,UE=st,Zh=AE||function(a){return mn.clearTimeout(a)},ZE=oa&&1/ce(new oa([,-0]))[1]==Lr?function(a){return new oa(a)}:Wu,Qu=Ts?function(a){return Ts.get(a)}:Wu,ec=Ju?function(a){return a==null?[]:(a=Dt(a),l(Ju(a),function(u){return Mh.call(a,u)}))}:qu,Hh=Ju?function(a){for(var u=[];a;)h(u,ec(a)),a=ks(a);return u}:qu,yn=Cn;(Ku&&yn(new Ku(new ArrayBuffer(1)))!=Yi||Xa&&yn(new Xa)!=Hn||Yu&&yn(Yu.resolve())!=Nd||oa&&yn(new oa)!=yr||Qa&&yn(new Qa)!=Ba)&&(yn=function(a){var u=Cn(a),f=u==Br?a.constructor:C,b=f?Ti(f):"";if(b)switch(b){case PE:return Yi;case $E:return Hn;case DE:return Nd;case FE:return yr;case LE:return Ba}return u});var HE=ys?Vr:Vu,Wh=ah(Uh),no=IE||function(a,u){return mn.setTimeout(a,u)},tc=ah(BE),qh=xk(function(a){var u=[];return a.charCodeAt(0)===46&&u.push(""),a.replace(sw,function(f,b,j,P){u.push(j?P.replace(hw,"$1"):b||f)}),u}),WE=st(function(a,u){return rn(a)?Ha(a,gn(u,1,rn,!0)):[]}),qE=st(function(a,u){var f=ar(u);return rn(f)&&(f=C),rn(a)?Ha(a,gn(u,1,rn,!0),Ye(f,2)):[]}),VE=st(function(a,u){var f=ar(u);return rn(f)&&(f=C),rn(a)?Ha(a,gn(u,1,rn,!0),C,f):[]}),GE=st(function(a){var u=d(a,Eu);return u.length&&u[0]===a[0]?gu(u):[]}),JE=st(function(a){var u=ar(a),f=d(a,Eu);return u===ar(f)?u=C:f.pop(),f.length&&f[0]===a[0]?gu(f,Ye(u,2)):[]}),KE=st(function(a){var u=ar(a),f=d(a,Eu);return u=typeof u=="function"?u:C,u&&f.pop(),f.length&&f[0]===a[0]?gu(f,C,u):[]}),YE=st(ph),XE=Wr(function(a,u){var f=a==null?0:a.length,b=fu(a,u);return If(a,d(u,function(j){return qr(j,f)?+j:j}).sort($f)),b}),QE=st(function(a){return ri(gn(a,1,rn,!0))}),eA=st(function(a){var u=ar(a);return rn(u)&&(u=C),ri(gn(a,1,rn,!0),Ye(u,2))}),tA=st(function(a){var u=ar(a);return u=typeof u=="function"?u:C,ri(gn(a,1,rn,!0),C,u)}),nA=st(function(a,u){return rn(a)?Ha(a,u):[]}),rA=st(function(a){return Su(l(a,rn))}),iA=st(function(a){var u=ar(a);return rn(u)&&(u=C),Su(l(a,rn),Ye(u,2))}),aA=st(function(a){var u=ar(a);return u=typeof u=="function"?u:C,Su(l(a,rn),C,u)}),oA=st(Du),sA=st(function(a){var u=a.length,f=u>1?a[u-1]:C;return f=typeof f=="function"?(a.pop(),f):C,dh(a,f)}),lA=Wr(function(a){var u=a.length,f=u?a[0]:0,b=this.__wrapped__,j=function(P){return fu(P,a)};return!(u>1||this.__actions__.length)&&b instanceof De&&qr(f)?(b=b.slice(f,+f+(u?1:0)),b.__actions__.push({func:us,args:[j],thisArg:C}),new Ve(b,this.__chain__).thru(function(P){return u&&!P.length&&P.push(C),P})):this.thru(j)}),uA=ts(function(a,u,f){Ct.call(a,f)?++a[f]:Ir(a,f,1)}),cA=Zf(sh),pA=Zf(lh),dA=ts(function(a,u,f){Ct.call(a,f)?a[f].push(u):Ir(a,f,[u])}),fA=st(function(a,u,f){var b=-1,j=typeof u=="function",P=On(a)?pn(a.length):[];return si(a,function(Z){P[++b]=j?n(u,Z,f):Wa(Z,u,f)}),P}),hA=ts(function(a,u,f){Ir(a,f,u)}),mA=ts(function(a,u,f){a[f?0:1].push(u)},function(){return[[],[]]}),gA=st(function(a,u){if(a==null)return[];var f=u.length;return f>1&&Sn(a,u[0],u[1])?u=[]:f>2&&Sn(u[0],u[1],u[2])&&(u=[u[0]]),Af(a,gn(u,1),[])}),js=TE||function(){return mn.Date.now()},nc=st(function(a,u,f){var b=Xe;if(f.length){var j=Ke(f,na(nc));b|=kn}return Hr(a,b,u,f,j)}),Vh=st(function(a,u,f){var b=Xe|Vt;if(f.length){var j=Ke(f,na(Vh));b|=kn}return Hr(u,b,a,f,j)}),vA=st(function(a,u){return vf(a,1,u)}),yA=st(function(a,u,f){return vf(a,or(u)||0,f)});ps.Cache=Zr;var bA=UE(function(a,u){u=u.length==1&&nt(u[0])?d(u[0],w(Ye())):d(gn(u,1),w(Ye()));var f=u.length;return st(function(b){for(var j=-1,P=vn(b.length,f);++j<P;)b[j]=u[j].call(this,b[j]);return n(a,this,b)})}),rc=st(function(a,u){return Hr(a,kn,C,u,Ke(u,na(rc)))}),Gh=st(function(a,u){return Hr(a,Er,C,u,Ke(u,na(Gh)))}),xA=Wr(function(a,u){return Hr(a,Ar,C,C,C,u)}),_A=as(mu),wA=as(function(a,u){return a>=u}),ji=xf(function(){return arguments}())?xf:function(a){return en(a)&&Ct.call(a,"callee")&&!Mh.call(a,"callee")},nt=pn.isArray,kA=sf?w(sf):$1,li=jE||Vu,CA=lf?w(lf):D1,Jh=uf?w(uf):L1,ic=cf?w(cf):B1,Kh=pf?w(pf):U1,ua=df?w(df):Z1,SA=as(bu),EA=as(function(a,u){return a<=u}),AA=ea(function(a,u){if(Ja(u)||On(u))return Rr(u,hn(u),a),C;for(var f in u)Ct.call(u,f)&&Za(a,f,u[f])}),Yh=ea(function(a,u){Rr(u,zn(u),a)}),Xh=ea(function(a,u,f,b){Rr(u,zn(u),a,b)}),ac=ea(function(a,u,f,b){Rr(u,hn(u),a,b)}),TA=Wr(fu),IA=st(function(a,u){a=Dt(a);var f=-1,b=u.length,j=b>2?u[2]:C;for(j&&Sn(u[0],u[1],j)&&(b=1);++f<b;)for(var P=u[f],Z=zn(P),G=-1,te=Z.length;++G<te;){var ye=Z[G],me=a[ye];(me===C||_r(me,aa[ye])&&!Ct.call(a,ye))&&(a[ye]=P[ye])}return a}),jA=st(function(a){return a.push(C,Kf),n(Qh,C,a)}),RA=Wf(function(a,u,f){u!=null&&typeof u.toString!="function"&&(u=xs.call(u)),a[u]=f},Uu(Nn)),OA=Wf(function(a,u,f){u!=null&&typeof u.toString!="function"&&(u=xs.call(u)),Ct.call(a,u)?a[u].push(f):a[u]=[f]},Ye),zA=st(Wa),NA=ea(function(a,u,f){Xo(a,u,f)}),Qh=ea(function(a,u,f,b){Xo(a,u,f,b)}),MA=Wr(function(a,u){var f={};if(a==null)return f;var b=!1;u=d(u,function(P){return P=ii(P,a),b||(b=P.length>1),P}),Rr(a,Ou(a),f),b&&(f=rr(f,Se|Ue|dt,lk));for(var j=u.length;j--;)Cu(f,u[j]);return f}),PA=Wr(function(a,u){return a==null?{}:q1(a,u)}),em=Gf(hn),tm=Gf(zn),$A=ta(function(a,u,f){return u=u.toLowerCase(),a+(f?Ah(u):u)}),DA=ta(function(a,u,f){return a+(f?"-":"")+u.toLowerCase()}),FA=ta(function(a,u,f){return a+(f?" ":"")+u.toLowerCase()}),LA=Uf("toLowerCase"),BA=ta(function(a,u,f){return a+(f?"_":"")+u.toLowerCase()}),UA=ta(function(a,u,f){return a+(f?" ":"")+oc(u)}),ZA=ta(function(a,u,f){return a+(f?" ":"")+u.toUpperCase()}),oc=Uf("toUpperCase"),nm=st(function(a,u){try{return n(a,C,u)}catch(f){return Fu(f)?f:new gs(f)}}),HA=Wr(function(a,u){return i(u,function(f){f=xr(f),Ir(a,f,nc(a[f],a))}),a}),WA=Hf(),qA=Hf(!0),VA=st(function(a,u){return function(f){return Wa(f,a,u)}}),GA=st(function(a,u){return function(f){return Wa(a,f,u)}}),JA=Iu(d),KA=Iu(o),YA=Iu(g),XA=qf(),QA=qf(!0),eT=rs(function(a,u){return a+u},0),tT=ju("ceil"),nT=rs(function(a,u){return a/u},1),rT=ju("floor"),iT=rs(function(a,u){return a*u},1),aT=ju("round"),oT=rs(function(a,u){return a-u},0);return A.after=zC,A.ary=gh,A.assign=AA,A.assignIn=Yh,A.assignInWith=Xh,A.assignWith=ac,A.at=TA,A.before=vh,A.bind=nc,A.bindAll=HA,A.bindKey=Vh,A.castArray=BC,A.chain=fh,A.chunk=Ek,A.compact=Ak,A.concat=Tk,A.cond=QS,A.conforms=eE,A.constant=Uu,A.countBy=uA,A.create=cS,A.curry=yh,A.curryRight=bh,A.debounce=xh,A.defaults=IA,A.defaultsDeep=jA,A.defer=vA,A.delay=yA,A.difference=WE,A.differenceBy=qE,A.differenceWith=VE,A.drop=Ik,A.dropRight=jk,A.dropRightWhile=Rk,A.dropWhile=Ok,A.fill=zk,A.filter=bC,A.flatMap=xC,A.flatMapDeep=_C,A.flatMapDepth=wC,A.flatten=uh,A.flattenDeep=Nk,A.flattenDepth=Mk,A.flip=NC,A.flow=WA,A.flowRight=qA,A.fromPairs=Pk,A.functions=vS,A.functionsIn=yS,A.groupBy=dA,A.initial=Dk,A.intersection=GE,A.intersectionBy=JE,A.intersectionWith=KE,A.invert=RA,A.invertBy=OA,A.invokeMap=fA,A.iteratee=Zu,A.keyBy=hA,A.keys=hn,A.keysIn=zn,A.map=cs,A.mapKeys=xS,A.mapValues=_S,A.matches=nE,A.matchesProperty=rE,A.memoize=ps,A.merge=NA,A.mergeWith=Qh,A.method=VA,A.methodOf=GA,A.mixin=Hu,A.negate=ds,A.nthArg=aE,A.omit=MA,A.omitBy=wS,A.once=MC,A.orderBy=CC,A.over=JA,A.overArgs=bA,A.overEvery=KA,A.overSome=YA,A.partial=rc,A.partialRight=Gh,A.partition=mA,A.pick=PA,A.pickBy=Eh,A.property=jh,A.propertyOf=oE,A.pull=YE,A.pullAll=ph,A.pullAllBy=Uk,A.pullAllWith=Zk,A.pullAt=XE,A.range=XA,A.rangeRight=QA,A.rearg=xA,A.reject=AC,A.remove=Hk,A.rest=PC,A.reverse=$u,A.sampleSize=IC,A.set=CS,A.setWith=SS,A.shuffle=jC,A.slice=Wk,A.sortBy=gA,A.sortedUniq=Xk,A.sortedUniqBy=Qk,A.split=ZS,A.spread=$C,A.tail=eC,A.take=tC,A.takeRight=nC,A.takeRightWhile=rC,A.takeWhile=iC,A.tap=cC,A.throttle=DC,A.thru=us,A.toArray=kh,A.toPairs=em,A.toPairsIn=tm,A.toPath=pE,A.toPlainObject=Sh,A.transform=ES,A.unary=FC,A.union=QE,A.unionBy=eA,A.unionWith=tA,A.uniq=aC,A.uniqBy=oC,A.uniqWith=sC,A.unset=AS,A.unzip=Du,A.unzipWith=dh,A.update=TS,A.updateWith=IS,A.values=ra,A.valuesIn=jS,A.without=nA,A.words=Ih,A.wrap=LC,A.xor=rA,A.xorBy=iA,A.xorWith=aA,A.zip=oA,A.zipObject=lC,A.zipObjectDeep=uC,A.zipWith=sA,A.entries=em,A.entriesIn=tm,A.extend=Yh,A.extendWith=Xh,Hu(A,A),A.add=eT,A.attempt=nm,A.camelCase=$A,A.capitalize=Ah,A.ceil=tT,A.clamp=RS,A.clone=UC,A.cloneDeep=HC,A.cloneDeepWith=WC,A.cloneWith=ZC,A.conformsTo=qC,A.deburr=Th,A.defaultTo=tE,A.divide=nT,A.endsWith=NS,A.eq=_r,A.escape=MS,A.escapeRegExp=PS,A.every=yC,A.find=cA,A.findIndex=sh,A.findKey=pS,A.findLast=pA,A.findLastIndex=lh,A.findLastKey=dS,A.floor=rT,A.forEach=hh,A.forEachRight=mh,A.forIn=fS,A.forInRight=hS,A.forOwn=mS,A.forOwnRight=gS,A.get=Lu,A.gt=_A,A.gte=wA,A.has=bS,A.hasIn=Bu,A.head=ch,A.identity=Nn,A.includes=kC,A.indexOf=$k,A.inRange=OS,A.invoke=zA,A.isArguments=ji,A.isArray=nt,A.isArrayBuffer=kA,A.isArrayLike=On,A.isArrayLikeObject=rn,A.isBoolean=VC,A.isBuffer=li,A.isDate=CA,A.isElement=GC,A.isEmpty=JC,A.isEqual=KC,A.isEqualWith=YC,A.isError=Fu,A.isFinite=XC,A.isFunction=Vr,A.isInteger=_h,A.isLength=fs,A.isMap=Jh,A.isMatch=QC,A.isMatchWith=eS,A.isNaN=tS,A.isNative=nS,A.isNil=iS,A.isNull=rS,A.isNumber=wh,A.isObject=Gt,A.isObjectLike=en,A.isPlainObject=Ka,A.isRegExp=ic,A.isSafeInteger=aS,A.isSet=Kh,A.isString=hs,A.isSymbol=qn,A.isTypedArray=ua,A.isUndefined=oS,A.isWeakMap=sS,A.isWeakSet=lS,A.join=Fk,A.kebabCase=DA,A.last=ar,A.lastIndexOf=Lk,A.lowerCase=FA,A.lowerFirst=LA,A.lt=SA,A.lte=EA,A.max=fE,A.maxBy=hE,A.mean=mE,A.meanBy=gE,A.min=vE,A.minBy=yE,A.stubArray=qu,A.stubFalse=Vu,A.stubObject=sE,A.stubString=lE,A.stubTrue=uE,A.multiply=iT,A.nth=Bk,A.noConflict=iE,A.noop=Wu,A.now=js,A.pad=$S,A.padEnd=DS,A.padStart=FS,A.parseInt=LS,A.random=zS,A.reduce=SC,A.reduceRight=EC,A.repeat=BS,A.replace=US,A.result=kS,A.round=aT,A.runInContext=K,A.sample=TC,A.size=RC,A.snakeCase=BA,A.some=OC,A.sortedIndex=qk,A.sortedIndexBy=Vk,A.sortedIndexOf=Gk,A.sortedLastIndex=Jk,A.sortedLastIndexBy=Kk,A.sortedLastIndexOf=Yk,A.startCase=UA,A.startsWith=HS,A.subtract=oT,A.sum=bE,A.sumBy=xE,A.template=WS,A.times=cE,A.toFinite=Gr,A.toInteger=at,A.toLength=Ch,A.toLower=qS,A.toNumber=or,A.toSafeInteger=uS,A.toString=kt,A.toUpper=VS,A.trim=GS,A.trimEnd=JS,A.trimStart=KS,A.truncate=YS,A.unescape=XS,A.uniqueId=dE,A.upperCase=ZA,A.upperFirst=oc,A.each=hh,A.eachRight=mh,A.first=ch,Hu(A,function(){var a={};return jr(A,function(u,f){Ct.call(A.prototype,f)||(a[f]=u)}),a}(),{chain:!1}),A.VERSION=J,i(["bind","bindKey","curry","curryRight","partial","partialRight"],function(a){A[a].placeholder=A}),i(["drop","take"],function(a,u){De.prototype[a]=function(f){f=f===C?1:dn(at(f),0);var b=this.__filtered__&&!u?new De(this):this.clone();return b.__filtered__?b.__takeCount__=vn(f,b.__takeCount__):b.__views__.push({size:vn(f,tr),type:a+(b.__dir__<0?"Right":"")}),b},De.prototype[a+"Right"]=function(f){return this.reverse()[a](f).reverse()}}),i(["filter","map","takeWhile"],function(a,u){var f=u+1,b=f==$a||f==Ul;De.prototype[a]=function(j){var P=this.clone();return P.__iteratees__.push({iteratee:Ye(j,3),type:f}),P.__filtered__=P.__filtered__||b,P}}),i(["head","last"],function(a,u){var f="take"+(u?"Right":"");De.prototype[a]=function(){return this[f](1).value()[0]}}),i(["initial","tail"],function(a,u){var f="drop"+(u?"":"Right");De.prototype[a]=function(){return this.__filtered__?new De(this):this[f](1)}}),De.prototype.compact=function(){return this.filter(Nn)},De.prototype.find=function(a){return this.filter(a).head()},De.prototype.findLast=function(a){return this.reverse().find(a)},De.prototype.invokeMap=st(function(a,u){return typeof a=="function"?new De(this):this.map(function(f){return Wa(f,a,u)})}),De.prototype.reject=function(a){return this.filter(ds(Ye(a)))},De.prototype.slice=function(a,u){a=at(a);var f=this;return f.__filtered__&&(a>0||u<0)?new De(f):(a<0?f=f.takeRight(-a):a&&(f=f.drop(a)),u!==C&&(u=at(u),f=u<0?f.dropRight(-u):f.take(u-a)),f)},De.prototype.takeRightWhile=function(a){return this.reverse().takeWhile(a).reverse()},De.prototype.toArray=function(){return this.take(tr)},jr(De.prototype,function(a,u){var f=/^(?:filter|find|map|reject)|While$/.test(u),b=/^(?:head|last)$/.test(u),j=A[b?"take"+(u=="last"?"Right":""):u],P=b||/^find/.test(u);j&&(A.prototype[u]=function(){var Z=this.__wrapped__,G=b?[1]:arguments,te=Z instanceof De,ye=G[0],me=te||nt(Z),we=function(ut){var ct=j.apply(A,h([ut],G));return b&&Me?ct[0]:ct};me&&f&&typeof ye=="function"&&ye.length!=1&&(te=me=!1);var Me=this.__chain__,Le=!!this.__actions__.length,We=P&&!Me,rt=te&&!Le;if(!P&&me){Z=rt?Z:new De(this);var He=a.apply(Z,G);return He.__actions__.push({func:us,args:[we],thisArg:C}),new Ve(He,Me)}return We&&rt?a.apply(this,G):(He=this.thru(we),We?b?He.value()[0]:He.value():He)})}),i(["pop","push","shift","sort","splice","unshift"],function(a){var u=vs[a],f=/^(?:push|sort|unshift)$/.test(a)?"tap":"thru",b=/^(?:pop|shift)$/.test(a);A.prototype[a]=function(){var j=arguments;if(b&&!this.__chain__){var P=this.value();return u.apply(nt(P)?P:[],j)}return this[f](function(Z){return u.apply(nt(Z)?Z:[],j)})}}),jr(De.prototype,function(a,u){var f=A[u];if(f){var b=f.name+"";Ct.call(sa,b)||(sa[b]=[]),sa[b].push({name:u,func:f})}}),sa[ns(C,Vt).name]=[{name:"wrapper",func:C}],De.prototype.clone=jn,De.prototype.reverse=pu,De.prototype.value=r1,A.prototype.at=lA,A.prototype.chain=pC,A.prototype.commit=dC,A.prototype.next=fC,A.prototype.plant=mC,A.prototype.reverse=gC,A.prototype.toJSON=A.prototype.valueOf=A.prototype.value=vC,A.prototype.first=A.prototype.head,Ya&&(A.prototype[Ya]=hC),A},Qi=n1();wi?((wi.exports=Qi)._=Qi,uu._=Qi):mn._=Qi}).call(Jn)})(xl,xl.exports);var QW=xl.exports,ly=QW.runInContext(),gt=uR(ly,ly);const q_=/^[A-Za-z][_0-9A-Za-z]*$/,V_=e=>({name:"attributeNameAlreadyUsed",message:Xt.unique.id,test(t){if(!t)return!1;const n=gt.snakeCase(t);return!e.some(r=>gt.snakeCase(r)===n)}}),zp=e=>({name:"forbiddenAttributeName",message:Q("error.attributeName.reserved-name"),test(t){if(!t)return!1;const n=gt.snakeCase(t);return!e.some(r=>gt.snakeCase(r)===n)}}),Te={default:()=>Nt().nullable(),max:()=>cr().integer().nullable(),min:()=>cr().integer().when("max",(e,t)=>e?t.max(e,Q("error.validation.minSupMax")):t).nullable(),maxLength:()=>cr().integer().positive(Q("error.validation.positive")).nullable(),maxLengthString:()=>cr().integer().positive(Q("error.validation.positive")).max(255,"Maximum length for short text fields is 255 characters").nullable(),minLength:()=>cr().integer().min(1).when("maxLength",(e,t)=>e?t.max(e,Q("error.validation.minSupMax")):t).nullable(),name(e,t){return Nt().test(V_(e)).test(zp(t)).matches(q_,Xt.regex.id).required(Xt.required.id)},required:()=>wo(),type:()=>Nt().required(Xt.required.id),unique:()=>wo().nullable()},uy=(e,t)=>({name:Te.name(e,t),type:Te.type(),default:Te.default(),unique:Te.unique(),required:Te.required(),maxLength:Te.maxLength(),minLength:Te.minLength(),regex:Nt().test({name:"isValidRegExpPattern",message:Q("error.validation.regex"),test(r){try{return new RegExp(r||"")!==null}catch{return!1}}}).nullable()}),eq=(e,t)=>({name:Te.name(e,t),type:Te.type(),default:Te.default(),unique:Te.unique(),required:Te.required(),maxLength:Te.maxLengthString(),minLength:Te.minLength(),regex:Nt().test({name:"isValidRegExpPattern",message:Q("error.validation.regex"),test(r){try{return new RegExp(r||"")!==null}catch{return!1}}}).nullable()}),Wc=()=>({name:"isMinSuperiorThanMax",message:Q("error.validation.minSupMax"),test(e){if(!e)return!0;const{max:t}=this.parent;return!t||Number.isNaN(uc(e))?!0:uc(t)>=uc(e)}}),Zs={date(e,t){const n={name:Te.name(e,t),type:Te.type()};return Wt(n)},datetime(e,t){const n={name:Te.name(e,t),type:Te.type()};return Wt(n)},time(e,t){const n={name:Te.name(e,t),type:Te.type()};return Wt(n)},default(e,t){const n={name:Te.name(e,t),type:Te.type()};return Wt(n)},biginteger(e,t){const n={name:Te.name(e,t),type:Te.type(),default:Nt().nullable().matches(/^-?\d*$/),unique:Te.unique(),required:Te.required(),max:Nt().nullable().matches(/^-?\d*$/,Xt.regex.id),min:Nt().nullable().test(Wc()).matches(/^-?\d*$/,Xt.regex.id)};return Wt(n)},boolean(e,t){const n={name:Te.name(e,t),default:wo().nullable(),required:Te.required(),unique:Te.unique()};return Wt(n)},component(e,t){const n={name:Te.name(e,t),type:Te.type(),required:Te.required(),max:Te.max(),min:Te.min(),component:Nt().required(Xt.required.id)};return Wt(n)},decimal(e,t){const n={name:Te.name(e,t),type:Te.type(),default:cr(),required:Te.required(),max:cr(),min:cr().test(Wc())};return Wt(n)},dynamiczone(e,t){const n={name:Te.name(e,t),type:Te.type(),required:Te.required(),max:Te.max(),min:Te.min()};return Wt(n)},email(e,t){const n={name:Te.name(e,t),type:Te.type(),default:Nt().email().nullable(),unique:Te.unique(),required:Te.required(),maxLength:Te.maxLength(),minLength:Te.minLength()};return Wt(n)},enumeration(e,t){const n=/^[_A-Za-z][_0-9A-Za-z]*$/,r={name:Nt().test(V_(e)).test(zp(t)).matches(n,Xt.regex.id).required(Xt.required.id),type:Te.type(),default:Te.default(),unique:Te.unique(),required:Te.required(),enum:cm().of(Nt()).min(1,Xt.min.id).test({name:"areEnumValuesUnique",message:Q("error.validation.enum-duplicate"),test(i){return i?!XW(i.map(Hc).filter((o,l,c)=>c.indexOf(o)!==l)).length:!1}}).test({name:"doesNotHaveEmptyValues",message:Q("error.validation.enum-empty-string"),test:i=>i?!i.map(Hc).some(s=>s===""):!1}).test({name:"doesMatchRegex",message:Q("error.validation.enum-regex"),test:i=>i?i.map(Hc).every(s=>n.test(s)):!1}),enumName:Nt().nullable()};return Wt(r)},float(e,t){const n={name:Te.name(e,t),type:Te.type(),required:Te.required(),default:cr(),max:cr(),min:cr().test(Wc())};return Wt(n)},integer(e,t){const n={name:Te.name(e,t),type:Te.type(),default:cr().integer(),unique:Te.unique(),required:Te.required(),max:Te.max(),min:Te.min()};return Wt(n)},json(e,t){const n={name:Te.name(e,t),type:Te.type(),required:Te.required(),unique:Te.unique()};return Wt(n)},media(e,t){const n={name:Te.name(e,t),type:Te.type(),multiple:wo(),required:Te.required(),allowedTypes:cm().of(Nt().oneOf(["images","videos","files","audios"])).min(1).nullable()};return Wt(n)},password(e,t){const n={name:Te.name(e,t),type:Te.type(),default:Te.default(),unique:Te.unique(),required:Te.required(),maxLength:Te.maxLength(),minLength:Te.minLength()};return Wt(n)},relation(e,t,n,{initialData:r,modifiedData:i}){const s={name:Te.name(e,t),target:Nt().required(Xt.required.id),relation:Nt().required(),type:Nt().required(),targetAttribute:cR(()=>{const o=Zp(i.relation,i.targetAttribute);if(o==="oneWay"||o==="manyWay")return Nt().nullable();const l=Nt().test(zp(t)),p=[...n.map(({name:d})=>d),i.name].filter(d=>d!==r.targetAttribute);return l.matches(q_,Xt.regex.id).test({name:"forbiddenTargetAttributeName",message:Q("error.validation.relation.targetAttribute-taken"),test(d){return d?!p.includes(d):!1}}).required(Xt.required.id)})};return Wt(s)},richtext(e,t){const n={name:Te.name(e,t),type:Te.type(),default:Te.default(),unique:Te.unique(),required:Te.required(),maxLength:Te.maxLength(),minLength:Te.minLength()};return Wt(n)},blocks(e,t){const n={name:Te.name(e,t),type:Te.type(),default:Te.default(),unique:Te.unique(),required:Te.required(),maxLength:Te.maxLength(),minLength:Te.minLength()};return Wt(n)},string(e,t){const n=eq(e,t);return Wt(n)},text(e,t){const n=uy(e,t);return Wt(n)},uid(e,t){const n=uy(e,t);return Wt(n)}},tq=/^[A-Za-z][-_0-9A-Za-z]*$/,nq=(e,t,n,r,i)=>{const s={displayName:Nt().test({name:"nameAlreadyUsed",message:Xt.unique.id,test(o){if(!o)return!1;const l=uo(o,n),c=gt.snakeCase(l),p=gt.snakeCase(i);return e.every(d=>gt.snakeCase(d)!==c)&&r.every(d=>gt.snakeCase(d)!==p)}}).test({name:"nameNotAllowed",message:Q("error.contentTypeName.reserved-name"),test(o){if(!o)return!1;const l=gt.snakeCase(o);return t.every(c=>gt.snakeCase(c)!==l)}}).required(Xt.required.id),category:Nt().matches(tq,Xt.regex.id).required(Xt.required.id),icon:Nt()};return Wt(s)},cy={name:"displayName",type:"text",intlLabel:{id:Q("contentType.displayName.label"),defaultMessage:"Display name"}},qc={advanced:{default(){return{sections:[{items:[{intlLabel:{id:Q("contentType.draftAndPublish.label"),defaultMessage:"Draft & publish"},description:{id:Q("contentType.draftAndPublish.description"),defaultMessage:"Allows writing a draft version of an entry, before it is published"},name:"draftAndPublish",type:"toggle-draft-publish",validations:{}}]}]}}},base:{create(){return{sections:[{sectionTitle:null,items:[cy,{description:{id:Q("contentType.apiId-singular.description"),defaultMessage:"Used to generate the API routes and databases tables/collections"},intlLabel:{id:Q("contentType.apiId-singular.label"),defaultMessage:"API ID (Singular)"},name:"singularName",type:"text-singular"},{type:"pushRight",size:6,intlLabel:{id:"",defaultMessage:""},name:"pushRight"},{description:{id:Q("contentType.apiId-plural.description"),defaultMessage:"Pluralized API ID"},intlLabel:{id:Q("contentType.apiId-plural.label"),defaultMessage:"API ID (Plural)"},name:"pluralName",type:"text-plural"}]}]}},edit(){return{sections:[{sectionTitle:null,items:[cy,{disabled:!0,description:{id:Q("contentType.apiId-singular.description"),defaultMessage:"Used to generate the API routes and databases tables/collections"},intlLabel:{id:Q("contentType.apiId-singular.label"),defaultMessage:"API ID (Singular)"},name:"singularName",type:"text"},{type:"pushRight",size:6,intlLabel:{id:"",defaultMessage:""},name:"pushRight"},{disabled:!0,description:{id:Q("contentType.apiId-plural.description"),defaultMessage:"Pluralized API ID"},intlLabel:{id:Q("contentType.apiId-plural.label"),defaultMessage:"API ID (Plural)"},name:"pluralName",type:"text"},{intlLabel:{id:"global.type",defaultMessage:"Type"},name:"kind",type:"content-type-radio-group",size:12,radios:[{title:{id:Q("form.button.collection-type.name"),defaultMessage:"Collection Type"},description:{id:Q("form.button.collection-type.description"),defaultMessage:"Best for multiple instances like articles, products, comments, etc."},value:"collectionType"},{title:{id:Q("form.button.single-type.name"),defaultMessage:"Single Type"},description:{id:Q("form.button.single-type.description"),defaultMessage:"Best for single instance like about us, homepage, etc."},value:"singleType"}]}]}]}}}},rq=({usedContentTypeNames:e=[],reservedModels:t=[],singularNames:n=[],pluralNames:r=[],collectionNames:i=[]})=>{const s={displayName:Nt().test({name:"nameAlreadyUsed",message:Xt.unique.id,test(o){if(!o)return!1;const l=Gy(o),c=gt.snakeCase(l);return!e.some(p=>gt.snakeCase(p)===c)}}).test({name:"nameNotAllowed",message:Q("error.contentTypeName.reserved-name"),test(o){if(!o)return!1;const l=gt.snakeCase(o);return!t.some(c=>gt.snakeCase(c)===l)}}).required(Xt.required.id),pluralName:Nt().test({name:"pluralNameAlreadyUsed",message:Xt.unique.id,test(o){if(!o)return!1;const l=gt.snakeCase(o);return!r.some(c=>gt.snakeCase(c)===l)}}).test({name:"pluralNameAlreadyUsedAsSingular",message:Q("error.contentType.pluralName-equals-singularName"),test(o){if(!o)return!1;const l=gt.snakeCase(o);return!n.some(c=>gt.snakeCase(c)===l)}}).test({name:"pluralAndSingularAreUnique",message:Q("error.contentType.pluralName-used"),test(o,l){return o?gt.snakeCase(l.parent.singularName)!==gt.snakeCase(o):!1}}).test({name:"pluralNameNotAllowed",message:Q("error.contentTypeName.reserved-name"),test(o){if(!o)return!1;const l=gt.snakeCase(o);return!t.some(c=>gt.snakeCase(c)===l)}}).test({name:"pluralNameNotAlreadyUsedInCollectionName",message:Q("error.contentType.pluralName-equals-collectionName"),test(o){if(!o)return!1;const l=gt.snakeCase(o);return!i.some(c=>gt.snakeCase(c)===l)}}).required(Xt.required.id),singularName:Nt().test({name:"singularNameAlreadyUsed",message:Xt.unique.id,test(o){if(!o)return!1;const l=gt.snakeCase(o);return!n.some(c=>gt.snakeCase(c)===l)}}).test({name:"singularNameAlreadyUsedAsPlural",message:Q("error.contentType.singularName-equals-pluralName"),test(o){if(!o)return!1;const l=gt.snakeCase(o);return!r.some(c=>gt.snakeCase(c)===l)}}).test({name:"pluralAndSingularAreUnique",message:Q("error.contentType.singularName-used"),test(o,l){return o?gt.snakeCase(l.parent.pluralName)!==gt.snakeCase(o):!1}}).test({name:"singularNameNotAllowed",message:Q("error.contentTypeName.reserved-name"),test(o){if(!o)return!1;const l=gt.snakeCase(o);return!t.some(c=>gt.snakeCase(c)===l)}}).required(Xt.required.id),draftAndPublish:wo(),kind:Nt().oneOf(["singleType","collectionType"])};return Wt(s)},Vc={advanced:{default(){return{sections:ja.advanced()}}},base:{createComponent(){return{sections:[{sectionTitle:null,items:[Op]},...ja.base("componentToCreate.")]}},default(){return{sections:[{sectionTitle:null,items:[Op]},{sectionTitle:null,items:[{type:"pushRight",size:6,intlLabel:{id:"",defaultMessage:""},name:"pushRight"},{name:"components",type:"select-components",intlLabel:{id:Q("modalForm.attributes.select-components"),defaultMessage:"Select the components"},isMultiple:!0}]}]}}}},py=(e,t)=>{e.forEach(n=>{if(!("sectionTitle"in n)){t[0].items?.push(n);return}t.push(n)})},iq=(e,t)=>`components_${gt.snakeCase(t)}_${Ca(gt.snakeCase(e))}`,dy=(e,t)=>e.filter(({name:n})=>n!==t.initialData.name).map(({name:n})=>n),Oi={customField:{schema({schemaAttributes:e,attributeType:t,customFieldValidator:n,reservedNames:r,schemaData:i,ctbFormsAPI:s}){const o=dy(e,i);let l;return t==="relation"?l=Zs[t](o,r.attributes,[],{initialData:{},modifiedData:{}}):l=Zs[t](o,r.attributes),s.makeCustomFieldValidator(l,n,o,r.attributes,i)},form:{base({customField:e}){const t=[{sectionTitle:null,items:[Pr]}];return e.options?.base&&py(e.options.base,t),{sections:t}},advanced({customField:e,data:t,step:n,extensions:r,...i}){const s=[{sectionTitle:null,items:[]},{sectionTitle:{id:"form.attribute.condition.section",defaultMessage:"Conditions"},items:[{name:"conditions",type:"condition-form",intlLabel:{id:"form.attribute.condition.label",defaultMessage:"Visibility condition"},description:{id:"form.attribute.condition.desc",defaultMessage:"Show this field only when a boolean/enum condition matches."}}]}],o=r.getAdvancedForm(["attribute",e.type],{data:t,type:e.type,step:n,customField:e,...i});if(e.options?.advanced&&py(e.options.advanced,s),o){const l={sectionTitle:{id:Q("modalForm.custom-fields.advanced.settings.extended"),defaultMessage:"Extended settings"},items:o};s.push(l)}return{sections:s}}}},attribute:{schema(e,t,n,r,i,s){const o=e?.attributes??[],l=dy(o,i);try{const c=Zs[t](l,n.attributes,r,i);return s.makeValidator(["attribute",t],c,l,n.attributes,r,i)}catch(c){return console.error("Error yup build schema",c),Zs.default(l,n.attributes)}},form:{advanced({data:e,type:t,step:n,extensions:r,...i}){try{const s=sy.advanced[t](e,n).sections,o=r.getAdvancedForm(["attribute",t],{data:e,type:t,step:n,customField:null,...i});let l=!1;return{sections:s.reduce((p,d)=>(d.sectionTitle===null||l?p.push(d):(p.push({...d,items:[...d.items,...o]}),l=!0),p),[])}}catch(s){return console.error(s),{sections:[]}}},base({data:e,type:t,step:n,attributes:r}){try{return sy.base[t](e,n,r)}catch{return qW}}}},contentType:{schema(e,t,n,r,i,s){const o=Object.values(s).map(g=>g.info.singularName),l=Object.values(s).map(g=>g?.info?.pluralName??""),c=t?e.filter(g=>g!==n):e,p=t?o.filter(g=>{const{info:k}=s[n];return k.singularName!==g}):o,d=t?l.filter(g=>{const{info:k}=s[n];return k.pluralName!==g}):l,h=Object.values(s).map(g=>g?.collectionName??""),v=t?h.filter(g=>{const{collectionName:k}=s[n];return g!==k}):h,y=rq({usedContentTypeNames:c,reservedModels:r.models,singularNames:p,pluralNames:d,collectionNames:v});return i.makeValidator(["contentType"],y,c,r.models,p,d)},form:{base({actionType:e}){return e==="create"?qc.base.create():qc.base.edit()},advanced({extensions:e}){const t=qc.advanced.default().sections.map(r=>r.items).flat(),n=e.getAdvancedForm(["contentType"]);return{sections:[{items:[...t,...n]}]}}}},component:{schema(e,t,n,r=!1,i,s,o=null){const l=r?e.filter(h=>h!==o):e,c=Object.values(i).map(h=>h?.collectionName),p=iq(s,t),d=r?c.filter(h=>h!==p):c;return nq(l,n.models,t,d,p)},form:{advanced(){return{sections:ja.advanced()}},base(){return{sections:ja.base()}}}},addComponentToDynamicZone:{form:{advanced(){return Vc.advanced.default()},base({data:e}){return e?.createComponent??!1?Vc.base.createComponent():Vc.base.default()}}}},aq=(e,t)=>{const n=e.kind;return n==="singleType"||n===t.kind?!0:(e?.attributes??[]).filter(s=>{if(s.type!=="relation")return!1;const{relation:o,targetAttribute:l}=s,c=Zp(o,l);return!["oneWay","manyWay"].includes(c||"")}).length===0},oq=(e="",t,n)=>{const r=["text","boolean","blocks","json","number","email","date","password","media","enumeration","relation","richtext"],i=e==="contentType";if(i)return[[...r.slice(0,-1),"uid",...r.slice(-1)],["component","dynamiczone"]];if(e){const o=W_(t,n)>=qy;if(!i&&!o)return[r,["component"]]}return[r]},fy=e=>e.reduce((t,n)=>{const r=n.items.reduce((i,s)=>(s.name&&i.push(s.name),i),[]);return[...t,...r]},[]),sq=ht.form`
  overflow: auto;
`,lq=e=>e["content-type-builder_formModal"]||pR,uq=()=>{const{onCloseModal:e,onNavigateToChooseAttributeModal:t,onNavigateToAddCompoToDZModal:n,onNavigateToCreateComponentStep2:r,actionType:i,attributeName:s,attributeType:o,customFieldUid:l,dynamicZoneTarget:c,forTarget:p,modalType:d,isOpen:h,kind:v,step:y,targetUid:g,showBackLink:k,activeTab:_,setActiveTab:x}=Pa(),S=_o("FormModal",qe=>qe.getPlugin),I=_o("FormModal",qe=>qe.customFields.get)(l),O=Sl(),{toggleNotification:R}=Ra(),B=Iy(lq,dR),L=fR(),{trackUsage:V}=Oa(),{formatMessage:q}=pt(),X=S(hi)?.apis.forms,M=X.components.inputs,Y=Ui("FormModal",qe=>qe.dispatch),{addAttribute:w,editAttribute:F,addCustomFieldAttribute:_e,addCreatedComponentToDynamicZone:se,changeDynamicZoneComponents:pe,contentTypes:N,components:Ee,createSchema:ie,createComponentSchema:z,deleteComponent:je,deleteContentType:le,editCustomFieldAttribute:ne,updateSchema:Je,nestedComponents:Ke,sortedContentTypesList:ce,updateComponentSchema:Oe,updateComponentUid:ve,reservedNames:Re}=er(),{componentToCreate:Ge,formErrors:Ze,initialData:E,isCreatingComponentWhileAddingAField:ue,modifiedData:H}=B,$=p==="component"?Ee[g]:N[g],[C,J]=W.useState(!1),[ge,be]=W.useState(null),ee=()=>{if(i!=="edit"||d!=="attribute")return!1;const qe=E.name,Tt=E.enum,Zt=H.enum,ln=($?.attributes||[]).filter(Ht=>{if(!Ht.conditions)return!1;const nn=Ht.conditions.visible;if(!nn)return!1;const[[,Wl]]=Object.entries(nn),[Ji,Ki]=Wl;return Ji.var!==qe?!1:Tt&&Zt?Tt.filter(Hn=>!Zt.includes(Hn)).includes(Ki):!0});return ln.length>0?ln:!1};W.useEffect(()=>{if(h){const qe=ce.filter(M_);i==="edit"&&d==="attribute"&&p==="contentType"&&V("willEditFieldOfContentType");const Tt=Ap(Kt($,"schema.attributes",[]),c)||null;if(d==="contentType"&&i==="create"&&O(an.setDataToEdit({data:{draftAndPublish:!0}})),d==="contentType"&&i==="edit"&&O(an.setDataToEdit({data:{displayName:$.info.displayName,draftAndPublish:$.options?.draftAndPublish,kind:"kind"in $&&$.kind,pluginOptions:$.pluginOptions,pluralName:"pluralName"in $.info&&$.info.pluralName,singularName:"singularName"in $.info&&$.info.singularName}})),d==="component"&&i==="edit"&&O(an.setDataToEdit({data:{displayName:$.info.displayName,category:"category"in $&&$.category,icon:$.info.icon}})),d==="addComponentToDynamicZone"&&i==="edit"){const Zt={...Tt,components:[],name:c,createComponent:!1,componentToCreate:{type:"component"}};O(an.setDynamicZoneDataSchema({attributeToEdit:Zt}))}if(o){const it={...Ap(Kt($,["attributes"],[]),s),name:s};o==="component"&&i==="edit"&&(!("repeatable"in it)||!it.repeatable)&&hR(it,"repeatable",!1),O(d==="customField"?i==="edit"?an.setCustomFieldDataSchema({isEditing:!0,modifiedDataToSetForEditing:it,uid:$.uid}):an.setCustomFieldDataSchema({customField:mR(I,["type","options"]),isEditing:!1,modifiedDataToSetForEditing:it,uid:$.uid}):an.setAttributeDataSchema({attributeType:o,nameToSetForRelation:Kt(qe,["0","title"],"error"),targetUid:Kt(qe,["0","uid"],"error"),isEditing:i==="edit",modifiedDataToSetForEditing:it,step:y,uid:$.uid}))}}else O(an.resetProps())},[i,s,o,c,p,h,d]);const re=d==="contentType",he=d==="component",U=d==="attribute",oe=d==="customField",Ce=o==="component"&&U,Se=i==="create",Ue=Kt(H,"createComponent",!1)||ue,dt=y==="1",xt=d==="chooseAttribute",It=Gy(H.singularName||""),Xe=Kt($,["attributes"],null),Vt=async()=>{let qe;const Tt=Ue&&y==="1"?Kt(H,"componentToCreate",{}):H;if(re)qe=Oi.contentType.schema(Object.keys(N),i==="edit",$?.uid??null,Re,X,N);else if(he)qe=Oi.component.schema(Object.keys(Ee),H.category||"",Re,i==="edit",Ee,H.displayName||"",$?.uid??null);else if(oe)qe=Oi.customField.schema({schemaAttributes:Kt($,["attributes"],[]),attributeType:I.type,reservedNames:Re,schemaData:{modifiedData:H,initialData:E},ctbFormsAPI:X,customFieldValidator:I.options?.validator});else if(Ce&&Ue&&dt)qe=Oi.component.schema(Object.keys(Ee),Kt(H,"componentToCreate.category",""),Re,i==="edit",Ee,H.componentToCreate.displayName||"");else if(U&&!dt){const Zt=o==="relation"?"relation":H.type;let it=[];if(Zt==="relation"){const ln=Kt(H,["target"],null);it=Kt(N,[ln,"attributes"],[]).filter(({name:nn})=>i!=="edit"?!0:nn!==E.targetAttribute)}qe=Oi.attribute.schema($,Zt,Re,it,{modifiedData:H,initialData:E},X)}else if(dt&&Ue)qe=Oi.component.schema(Object.keys(Ee),Kt(H,"componentToCreate.category",""),Re,i==="edit",Ee,H.componentToCreate.displayName||"");else return;await qe.validate(Tt,{abortEarly:!1})},jt=W.useCallback(({target:{name:qe,value:Tt,type:Zt,...it}})=>{const ln=["enumName","max","min","maxLength","minLength","regex","default"];let Ht;ln.includes(qe)&&Tt===""?Ht=null:qe==="enum"?Ht=Array.isArray(Tt)?Tt:[Tt]:Ht=Tt;const nn=Object.assign({},Ze);qe==="max"&&delete nn.min,qe==="maxLength"&&delete nn.minLength,delete nn[qe],O(an.setErrors({errors:nn})),O(an.onChange({keys:qe.split("."),value:Ht}))},[O,Ze]),yt=async(qe,Tt=Se)=>{try{await Vt(),O(an.setErrors({errors:{}})),Ar(Tt);const Zt=g;if(re)if(Se)ie({data:{kind:v,displayName:H.displayName,draftAndPublish:H.draftAndPublish,pluginOptions:H.pluginOptions,singularName:H.singularName,pluralName:H.pluralName},uid:It}),L({pathname:`/plugins/${hi}/content-types/${It}`}),e();else{const it=$;aq(it,H)?(e(),await Je({uid:it.uid,data:{displayName:H.displayName,kind:H.kind,draftAndPublish:H.draftAndPublish,pluginOptions:H.pluginOptions}})):R({type:"danger",message:q({id:"notification.contentType.relations.conflict"})});return}else if(d==="component")if(Se){const it=uo(H.displayName,H.category),{category:ln,...Ht}=H;z({data:{displayName:Ht.displayName,icon:Ht.icon},uid:it,componentCategory:ln}),L({pathname:`/plugins/${hi}/component-categories/${ln}/${it}`}),e();return}else{if(Oe({data:{icon:H.icon,displayName:H.displayName},componentUID:g}),$.status==="NEW"){const it=uo(H.displayName,H.category);ve({componentUID:g,newComponentUID:it}),L({pathname:`/plugins/${hi}/component-categories/${H.category}/${it}`})}e();return}else if(oe){const it={attributeToSet:{...H,customField:l},forTarget:p,targetUid:g,name:E.name};i==="edit"?ne(it):_e(it),Tt?t({forTarget:p,targetUid:Zt}):e();return}else if(U&&!Ue){if(o==="dynamiczone"){i==="create"?w({attributeToSet:H,forTarget:p,targetUid:g}):F({attributeToSet:H,forTarget:p,targetUid:g,name:E.name}),Se?(O(an.resetPropsAndSetTheFormForAddingACompoToADz()),x("basic"),n({dynamicZoneTarget:H.name})):e();return}if(!Ce){i==="create"?w({attributeToSet:H,forTarget:p,targetUid:g}):F({attributeToSet:H,forTarget:p,targetUid:g,name:E.name}),Tt?t({forTarget:p,targetUid:Zt}):e();return}if(dt){r(),O(an.resetPropsAndSetFormForAddingAnExistingCompo({uid:$.uid}));return}if(i==="create")w({attributeToSet:H,forTarget:p,targetUid:g});else{const ln={...H};(!("conditions"in H)||H.conditions===void 0)&&(ln.conditions=void 0),F({attributeToSet:ln,forTarget:p,targetUid:g,name:E.name})}Tt?t({forTarget:p,targetUid:g}):e()}else if(U&&Ue){if(dt){V("willCreateComponentFromAttributesModal"),O(an.resetPropsAndSaveCurrentData({uid:$.uid})),r();return}const{category:it,...ln}=Ge,Ht=uo(Ge.displayName,it);z({data:{icon:ln.icon,displayName:ln.displayName},uid:Ht,componentCategory:it}),w({attributeToSet:H,forTarget:p,targetUid:g}),O(an.resetProps()),Tt?t({forTarget:"component",targetUid:Ht}):e();return}else{if(dt)if(Ue){const{category:it,type:ln,...Ht}=H.componentToCreate,nn=uo(H.componentToCreate.displayName,it);z({data:Ht,uid:nn,componentCategory:it}),se({forTarget:p,targetUid:g,dynamicZoneTarget:c,componentsToAdd:[nn]}),t({forTarget:"component",targetUid:nn})}else pe({forTarget:p,targetUid:g,dynamicZoneTarget:c,newComponents:H.components}),e();else console.error("This case is not handled");return}O(an.resetProps())}catch(Zt){if(gR.isError(Zt)){const it=Y8(Zt);O(an.setErrors({errors:it}))}}},mt=async(qe,Tt=Se)=>{if(qe.preventDefault(),ee()){be({e:qe,shouldContinue:Tt}),J(!0);return}await yt(qe,Tt)},kn=()=>{window.confirm(q({id:"window.confirm.close-modal.file",defaultMessage:"Are you sure? Your changes will be lost."}))&&(e(),O(an.resetProps()))},Er=()=>{xo(H,E)?(e(),O(an.resetProps())):kn()},Zn=qe=>{if(qe==="advanced"){if(re){V("didSelectContentTypeSettings");return}p==="contentType"&&V("didSelectContentTypeFieldSettings")}},Ar=qe=>{d==="attribute"&&p==="contentType"&&o!=="dynamiczone"&&qe&&V("willAddMoreFieldToContentType")},vr=()=>!!(d==="component"||vR(H,"createComponent")),ni=oq(p,g,Ke);if(!d)return null;const Uo=Kt(Oi,[d,"form"],{advanced:()=>({sections:[]}),base:()=>({sections:[]})}),Bl=p==="component",Zo={customInputs:{"allowed-types-select":Q8,"boolean-radio-group":fH,"checkbox-with-number-field":hH,"icon-picker":kH,"content-type-radio-group":mH,"radio-group":zd,relation:RW,"select-category":OW,"select-component":zW,"select-components":NW,"select-default-boolean":pH,"select-number":PW,"select-date":MW,"toggle-draft-publish":gH,"text-plural":CH,"text-singular":$W,"textarea-enum":LW,"condition-form":WW,...M},componentToCreate:Ge,dynamicZoneTarget:c,formErrors:Ze,isAddingAComponentToAnotherComponent:Bl,isCreatingComponentWhileAddingAField:ue,mainBoxHeader:Kt($,["info","displayName"],""),modifiedData:H,naturePickerType:p,isCreating:Se,targetUid:g,forTarget:p,contentTypeSchema:$},$a=Uo.advanced({data:H,type:o,step:y,actionType:i,attributes:Xe,extensions:X,forTarget:p,contentTypeSchema:$||{},customField:I}).sections,Ho=Uo.base({data:H,type:o,step:y,actionType:i,attributes:Xe,extensions:X,forTarget:p,contentTypeSchema:$||{},customField:I}).sections,Ul=fy(Ho),Lr=fy($a),Tr=Object.keys(Ze).some(qe=>Ul.includes(qe)),Zl=Object.keys(Ze).some(qe=>Lr.includes(qe)),Gi=Kt(N,[g,"kind"]),tr=()=>i==="edit"&&Xe.every(({name:qe})=>qe!==H?.name),Hl=()=>{tr()&&V("didEditFieldNameOnContentType"),Y({type:"set_completed_actions",payload:[Xs.contentTypeBuilder.addField]})};return m.jsx(fn.Root,{open:h,onOpenChange:Er,children:m.jsxs(fn.Content,{children:[m.jsxs(Zi.Root,{open:C,onOpenChange:J,children:[m.jsx(Zi.Trigger,{}),m.jsx(zo,{onConfirm:()=>{if(ge){const{e:qe,shouldContinue:Tt}=ge;J(!1),be(null),yt(qe,Tt)}},onCancel:()=>{J(!1),be(null)},children:(()=>{const qe=ee();if(!qe)return null;const Tt=qe.map(it=>it.name).join(", ");if(E.enum&&H.enum){const it=E.enum,ln=H.enum,Ht=it.filter(nn=>!ln.includes(nn));return m.jsx(Ne,{children:m.jsxs(ze,{children:[q({id:"form.attribute.condition.enum-change-warning",defaultMessage:"The following fields have conditions that depend on this field: "}),m.jsx(ze,{fontWeight:"bold",children:Tt}),q({id:"form.attribute.condition.enum-change-warning-values",defaultMessage:". Changing or removing the enum values "}),m.jsx(ze,{fontWeight:"bold",children:Ht.join(", ")}),q({id:"form.attribute.condition.enum-change-warning-end",defaultMessage:" will break these conditions. Do you want to proceed?"})]})})}return m.jsx(Ne,{children:m.jsxs(ze,{children:[q({id:"form.attribute.condition.field-change-warning",defaultMessage:"The following fields have conditions that depend on this field: "}),m.jsx(ze,{fontWeight:"bold",children:Tt}),q({id:"form.attribute.condition.field-change-warning-end",defaultMessage:". Renaming it will break these conditions. Do you want to proceed?"})]})})})()})]}),m.jsx(yH,{actionType:i,attributeName:s,contentTypeKind:v,dynamicZoneTarget:c,modalType:d,forTarget:p,targetUid:g,attributeType:o,customFieldUid:l,showBackLink:k}),xt&&m.jsx(cH,{attributes:ni,forTarget:p,kind:Gi||"collectionType"}),!xt&&m.jsxs(sq,{onSubmit:mt,children:[m.jsx(fn.Body,{children:m.jsxs(pr.Root,{variant:"simple",value:_,onValueChange:qe=>{x(qe),Zn(qe)},hasError:Tr?"basic":Zl?"advanced":void 0,children:[m.jsxs(ke,{justifyContent:"space-between",children:[m.jsx(xH,{actionType:i,forTarget:p,kind:v,step:y,modalType:d,attributeType:o,attributeName:s,customField:I}),m.jsxs(pr.List,{children:[m.jsx(pr.Trigger,{value:"basic",children:q({id:Q("popUpForm.navContainer.base"),defaultMessage:"Basic settings"})}),m.jsx(pr.Trigger,{value:"advanced",disabled:vr(),children:q({id:Q("popUpForm.navContainer.advanced"),defaultMessage:"Advanced settings"})})]})]}),m.jsx(Cl,{marginBottom:6}),m.jsx(pr.Content,{value:"basic",children:m.jsx(ke,{direction:"column",alignItems:"stretch",gap:6,children:m.jsx(oy,{form:Ho,formErrors:Ze,genericInputProps:Zo,modifiedData:H,onChange:jt})})}),m.jsx(pr.Content,{value:"advanced",children:m.jsx(ke,{direction:"column",alignItems:"stretch",gap:6,children:m.jsx(oy,{form:$a,formErrors:Ze,genericInputProps:Zo,modifiedData:H,onChange:jt})})})]})}),m.jsxs(fn.Footer,{children:[m.jsx(ft,{type:"button",variant:"tertiary",onClick:qe=>{qe.preventDefault(),Er()},children:q({id:"app.components.Button.cancel",defaultMessage:"Cancel"})}),m.jsx(vH,{deleteContentType:()=>le(g),deleteComponent:()=>je(g),isAttributeModal:d==="attribute",isCustomFieldModal:d==="customField",isComponentToDzModal:d==="addComponentToDynamicZone",isComponentAttribute:o==="component",isComponentModal:d==="component",isContentTypeModal:d==="contentType",isCreatingComponent:i==="create",isCreatingDz:i==="create",isCreatingComponentAttribute:H.createComponent||!1,isCreatingComponentInDz:H.createComponent||!1,isCreatingComponentWhileAddingAField:ue,isCreatingContentType:i==="create",isEditingAttribute:i==="edit",isDzAttribute:o==="dynamiczone",isInFirstComponentStep:y==="1",onSubmitAddComponentAttribute:mt,onSubmitAddComponentToDz:mt,onSubmitCreateComponent:mt,onSubmitCreateContentType:mt,onSubmitCreateDz:mt,onSubmitEditAttribute:mt,onSubmitEditComponent:mt,onSubmitEditContentType:mt,onSubmitEditCustomFieldAttribute:mt,onSubmitEditDz:mt,onClickFinish:Hl})]})]})]})})},hy={actionType:null,attributeName:null,attributeType:null,dynamicZoneTarget:null,forTarget:null,modalType:null,isOpen:!0,showBackLink:!1,kind:null,step:null,targetUid:null,customFieldUid:null,activeTab:"basic"},cq=({children:e})=>{const[t,n]=W.useState(hy),{trackUsage:r}=my(),{sessionId:i}=Hp(),s=W.useCallback((I,O)=>{const R={...O,ctbSessionId:i};return r(I,R)},[r,i]),o=W.useCallback(({attributeType:I,customFieldUid:O})=>{n(R=>({...R,actionType:"create",modalType:"customField",attributeType:I,customFieldUid:O,activeTab:"basic"}))},[]),l=W.useCallback(({attributeType:I,step:O})=>{t.forTarget==="contentType"&&s("didSelectContentTypeFieldType",{type:I}),n(R=>({...R,actionType:"create",modalType:"attribute",step:O,attributeType:I,showBackLink:!0,activeTab:"basic"}))},[t.forTarget,s]),c=W.useCallback(({dynamicZoneTarget:I,targetUid:O})=>{n(R=>({...R,dynamicZoneTarget:I,targetUid:O,modalType:"addComponentToDynamicZone",forTarget:"contentType",step:"1",actionType:"edit",isOpen:!0}))},[]),p=W.useCallback(({forTarget:I,targetUid:O})=>{n(R=>({...R,actionType:"create",forTarget:I,targetUid:O,modalType:"chooseAttribute",isOpen:!0,showBackLink:!1,activeTab:"basic"}))},[]),d=W.useCallback(I=>{n(O=>({...O,...I,isOpen:!0,activeTab:"basic"}))},[]),h=W.useCallback(({forTarget:I,targetUid:O,attributeName:R,attributeType:B,customFieldUid:L})=>{n(V=>({...V,modalType:"customField",customFieldUid:L,actionType:"edit",forTarget:I,targetUid:O,attributeName:R,attributeType:B,isOpen:!0,activeTab:"basic"}))},[]),v=W.useCallback(({forTarget:I,targetUid:O,attributeName:R,attributeType:B,step:L})=>{n(V=>({...V,modalType:"attribute",actionType:"edit",forTarget:I,targetUid:O,attributeName:R,attributeType:B,step:L,isOpen:!0}))},[]),y=W.useCallback(({modalType:I,forTarget:O,targetUid:R,kind:B})=>{n(L=>({...L,modalType:I,actionType:"edit",forTarget:O,targetUid:R,kind:B,isOpen:!0,activeTab:"basic"}))},[]),g=W.useCallback(()=>{n(hy)},[]),k=W.useCallback(({forTarget:I,targetUid:O})=>{n(R=>({...R,forTarget:I,targetUid:O,modalType:"chooseAttribute",activeTab:"basic"}))},[]),_=W.useCallback(()=>{n(I=>({...I,attributeType:"component",modalType:"attribute",step:"2",activeTab:"basic"}))},[]),x=W.useCallback(({dynamicZoneTarget:I})=>{n(O=>({...O,dynamicZoneTarget:I,modalType:"addComponentToDynamicZone",actionType:"create",step:"1",attributeType:null,attributeName:null,activeTab:"basic"}))},[]),S=W.useCallback(I=>{n(O=>({...O,activeTab:I}))},[]),T=W.useMemo(()=>({...t,onClickSelectField:l,onClickSelectCustomField:o,onCloseModal:g,onNavigateToChooseAttributeModal:k,onNavigateToAddCompoToDZModal:x,onOpenModalAddComponentsToDZ:c,onNavigateToCreateComponentStep2:_,onOpenModalAddField:p,onOpenModalCreateSchema:d,onOpenModalEditField:v,onOpenModalEditCustomField:h,onOpenModalEditSchema:y,setFormModalNavigationState:n,setActiveTab:S}),[t,l,o,g,k,x,c,_,p,d,v,h,y,S]);return m.jsx(N_.Provider,{value:T,children:e})},pq=ht(ke)`
  @container (max-width: 200px) {
    .hide-on-small {
      display: none;
    }
  }
  container-type: inline-size;
`,dq=()=>{const{formatMessage:e}=pt(),t=e({id:Q("table.content.create-first-content-type.title"),defaultMessage:"No content types"}),{isChatEnabled:n,openChat:r}=gr(),{openCodeUpload:i}=jd(),{openFigmaUpload:s}=Od();return m.jsxs(pq,{justifyContent:"center",height:"100%",width:"400px",maxWidth:"90%",margin:"auto",direction:"column",gap:6,children:[m.jsx(Oy,{width:"160px",height:"88px"}),m.jsx(Fp.contentTypeBuilder.Introduction,{children:m.jsx(Ne,{})}),m.jsxs(ke,{gap:2,alignItems:"center",direction:"column",children:[m.jsx(ze,{variant:"beta",textAlign:"center",children:t}),m.jsx(ze,{variant:"omega",textAlign:"center",textColor:"neutral600",children:e({id:Q("table.content.create-first-content-type.description"),defaultMessage:"Create collection types, single types and components in order to build your schema."})})]}),n&&m.jsxs(ke,{gap:2,direction:"column",className:"hide-on-small",children:[m.jsx(ft,{startIcon:m.jsx(mb,{}),variant:"tertiary",onClick:()=>s(!0),children:e({id:Q("table.content.create-first-content-type.import-figma"),defaultMessage:"Import from Figma"})}),m.jsx(ft,{startIcon:m.jsx(Lp,{}),variant:"tertiary",onClick:()=>i(!0),children:e({id:Q("table.content.create-first-content-type.import-code"),defaultMessage:"Import from computer"})}),m.jsx(ft,{startIcon:m.jsx(kl,{}),variant:"tertiary",onClick:r,children:e({id:Q("table.content.create-first-content-type.start-with-prompt"),defaultMessage:"Start with a prompt"})})]})]})},Gc=W.lazy(()=>wR(()=>import("./ListView-BOCHrncQ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]))),fq=()=>{const{formatMessage:e}=pt(),t=e({id:`${hi}.plugin.name`,defaultMessage:"Content Types Builder"}),n=Qr("DataManagerProvider",o=>o.autoReload),r=by(),i=Ui("ContentTypeBuilderApp",o=>o.state),s=Ui("ContentTypeBuilderApp",o=>o.dispatch);return W.useEffect(()=>{xZ()},[]),W.useEffect(()=>{const o=r?"ContentTypeBuilderAI":"ContentTypeBuilderNoAI";i.tours.contentTypeBuilder.tourType!==o&&s({type:"set_tour_type",payload:{tourName:"contentTypeBuilder",tourType:o}})},[r,i.tours.contentTypeBuilder.tourType,s]),m.jsxs(cc.Protect,{permissions:yR.main,children:[m.jsx(cc.Title,{children:t}),m.jsx(bR,{children:m.jsx(R8,{children:m.jsx(cq,{children:m.jsxs(G8,{children:[m.jsx(J8,{}),m.jsx(H9,{children:m.jsxs(m.Fragment,{children:[n&&m.jsx(uq,{}),m.jsx(xR.Root,{sideNav:m.jsx(j8,{}),children:m.jsx(W.Suspense,{fallback:m.jsx(cc.Loading,{}),children:m.jsxs(_R,{children:[m.jsx(Ns,{path:"content-types/create-content-type",element:m.jsx(dq,{})}),m.jsx(Ns,{path:"content-types/:contentTypeUid",element:m.jsx(Gc,{})}),m.jsx(Ns,{path:"component-categories/:categoryUid/:componentUid",element:m.jsx(Gc,{})}),m.jsx(Ns,{path:"*",element:m.jsx(Gc,{})})]})})}),m.jsx(E8,{})]})})]})})})})]})},Aq=Object.freeze(Object.defineProperty({__proto__:null,default:fq},Symbol.toStringTag,{value:"Module"}));export{Ro as A,$_ as C,Sq as S,er as a,Pa as b,Eq as c,Q as g,Aq as i,Oa as u};
