nemar-cli 0.10.28-PR2034.392feb0 → 0.10.28-PR2034.87fba58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/git-annex-remote-nemar.js +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ ${t}`,zM,GM,KM=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,s=VM.bind(null,n,
|
|
|
23
23
|
`)}var Fl=!1;var{spawn:WF}=globalThis.Bun;function Vl(e,t=[]){let r=e.replace(YF,'("$1","<redacted>")');for(let n of t)if(n.length>=XF)r=r.split(n).join("<redacted>");return r}function QF(e){let t=["AWS_SESSION_TOKEN","AWS_SECRET_ACCESS_KEY","AWS_ACCESS_KEY_ID"],r=new Set;for(let n of[process.env,e??{}])for(let s of t){let o=n[s];if(typeof o==="string"&&o.length>0)r.add(o)}return[...r]}async function hw(e,t){let r=e.getReader(),n=new TextDecoder,s="";while(!0){let{done:o,value:i}=await r.read();if(o)break;if(i.byteLength===0)continue;t(),s+=n.decode(i,{stream:!0})}return s+n.decode()}async function mw(e,t={}){let r={...process.env,GIT_TERMINAL_PROMPT:"0",...t.env};for(let y of t.unsetEnv??[])delete r[y];let n=WF({cmd:e,cwd:t.cwd,...t.stdin===void 0?{}:{stdin:new TextEncoder().encode(t.stdin)},stdout:"pipe",stderr:"pipe",env:r}),s=!1,o,i,a=performance.now(),c=()=>{if(i!==void 0)clearTimeout(i),i=void 0},u=()=>{if(!t.onInactivityWarning)return;c(),i=setTimeout(()=>{i=void 0;try{t.onInactivityWarning?.(performance.now()-a)}catch{console.error("Could not display subprocess inactivity warning; the child result is unaffected.")}},t.inactivityWarningAfterMs??JF)};if(u(),t.timeout)o=setTimeout(()=>{s=!0,c(),n.kill()},t.timeout);let d=ic()?[...QF(r),...t.redact??[]]:[];if(ic()){let y=t.cwd?` (cwd=${t.cwd})`:"";qs(Nt.dim(Vl(`$ ${e.join(" ")}${y}`,d)))}let l=()=>{a=performance.now(),u()},p,f,h,m=n.exited.then((y)=>(c(),y));try{[p,f,h]=await Promise.all([hw(n.stdout,l),hw(n.stderr,l),m])}finally{if(c(),o)clearTimeout(o)}if(ic()){if(t.sensitiveOutput)qs(Nt.dim("[sensitive subprocess output suppressed]"));else{if(p.trim())qs(Nt.dim(Vl(p.trimEnd(),d)));if(f.trim())qs(Nt.yellow(Vl(f.trimEnd(),d)))}qs(Nt.dim(`(exit ${h})`))}if(s)return{stdout:p,stderr:f||`Command timed out after ${Math.round(t.timeout/1000)}s`,exitCode:h??1,timedOut:!0};return{stdout:p,stderr:f,exitCode:h,timedOut:!1}}var YF,XF=8,JF=120000;var gw=F(()=>{Ul();YF=/\(\s*"((?:x-amz-)[^"]*|authorization|proxy-authorization)"\s*,\s*"[^"]*"\s*\)/gi});function eV(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function _w(e,t=eV()){return e.installInstructions[t]}function tV(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function nV(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:rV}async function vw(e){try{let{exitCode:t,stdout:r,timedOut:n}=await mw(e.cmd,{timeout:nV()});if(n)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:tV(r)}}catch(t){let r=t instanceof Error?t.message:String(t);if(!r.includes("ENOENT")&&!r.includes("not found"))console.error(` Warning: ${e.name} check failed unexpectedly: ${r}`);return{available:!1}}}async function zl(){let e=Object.entries(yw);return Promise.all(e.map(async([t,r])=>{let{available:n,version:s,timedOut:o}=await vw(r);return{key:t,name:r.name,purpose:r.purpose,required:r.required,available:n,version:s,timedOut:o,installInstruction:_w(r)}}))}async function Z3(){let t=(await zl()).filter((r)=>r.required&&!r.available);if(t.length===0)return[];console.warn(`
|
|
24
24
|
Heads up: some tools NEMAR needs for uploading/validating aren't installed yet:`);for(let r of t)console.warn(` - ${r.name} (${r.purpose})`),console.warn(` Install: ${r.installInstruction}`);return console.warn("Run `nemar doctor` anytime to re-check. You can finish signup without them.\n"),t}async function eB(e){let r=ZF[e].map((i)=>yw[i]).filter(Boolean),n=await Promise.all(r.map(async(i)=>{let a=await vw(i);return{check:i,available:a.available,timedOut:a.timedOut}}));for(let i of n)if(i.timedOut&&i.check.required)console.warn(`Warning: ${i.check.name} did not respond to a version check in time; continuing anyway.`);let s=n.filter((i)=>!i.available&&!i.timedOut&&i.check.required).map((i)=>({tool:i.check.name,installInstruction:_w(i.check)}));if(s.length===0)return;let o=[`
|
|
25
25
|
Missing required tools:`];for(let i of s)o.push(` ${i.tool} not installed`),o.push(` Install: ${i.installInstruction}`);throw Error(o.join(`
|
|
26
|
-
`))}var yw,ZF,rV=4000;var $w=F(()=>{gw();yw={git:{name:"git",purpose:"version control for dataset metadata",cmd:["git","--version"],required:!0,installInstructions:{macos:"brew install git (or install Xcode Command Line Tools)",linux:"sudo apt-get install git OR sudo dnf install git",windows:"winget install Git.Git (or https://git-scm.com/download/win)"}},"git-annex":{name:"git-annex",purpose:"large-file data transfer (upload/download)",cmd:["git-annex","version"],required:!0,installInstructions:{macos:"brew install git-annex",linux:"sudo apt-get install git-annex OR sudo dnf install git-annex",windows:"Download the installer from https://git-annex.branchable.com/install/Windows/"}},gh:{name:"GitHub CLI (gh)",purpose:"GitHub authentication + repository operations",cmd:["gh","--version"],required:!0,installInstructions:{macos:"brew install gh",linux:"See https://cli.github.com/manual/installation",windows:"winget install GitHub.cli (or: scoop install gh)"}},aws:{name:"AWS CLI",purpose:"S3 data upload/download",cmd:["aws","--version"],required:!0,installInstructions:{macos:"brew install awscli",linux:"pip install awscli OR sudo snap install aws-cli --classic",windows:"winget install Amazon.AWSCLI (or the MSI from https://aws.amazon.com/cli/)"}},deno:{name:"Deno",purpose:"BIDS validation",cmd:["deno","--version"],required:!0,installInstructions:{macos:"brew install deno (or: curl -fsSL https://deno.land/install.sh | sh)",linux:"curl -fsSL https://deno.land/install.sh | sh",windows:"winget install DenoLand.Deno (or: irm https://deno.land/install.ps1 | iex)"}}},ZF={upload:["git-annex","gh","aws","deno"],download:["gh"],clone:["git","gh"],push:["git-annex","gh"],publish:["gh","aws"],update:["git","gh"],release:["git","gh"]}});var bw;var Ew=F(()=>{bw={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.28-PR2034.
|
|
26
|
+
`))}var yw,ZF,rV=4000;var $w=F(()=>{gw();yw={git:{name:"git",purpose:"version control for dataset metadata",cmd:["git","--version"],required:!0,installInstructions:{macos:"brew install git (or install Xcode Command Line Tools)",linux:"sudo apt-get install git OR sudo dnf install git",windows:"winget install Git.Git (or https://git-scm.com/download/win)"}},"git-annex":{name:"git-annex",purpose:"large-file data transfer (upload/download)",cmd:["git-annex","version"],required:!0,installInstructions:{macos:"brew install git-annex",linux:"sudo apt-get install git-annex OR sudo dnf install git-annex",windows:"Download the installer from https://git-annex.branchable.com/install/Windows/"}},gh:{name:"GitHub CLI (gh)",purpose:"GitHub authentication + repository operations",cmd:["gh","--version"],required:!0,installInstructions:{macos:"brew install gh",linux:"See https://cli.github.com/manual/installation",windows:"winget install GitHub.cli (or: scoop install gh)"}},aws:{name:"AWS CLI",purpose:"S3 data upload/download",cmd:["aws","--version"],required:!0,installInstructions:{macos:"brew install awscli",linux:"pip install awscli OR sudo snap install aws-cli --classic",windows:"winget install Amazon.AWSCLI (or the MSI from https://aws.amazon.com/cli/)"}},deno:{name:"Deno",purpose:"BIDS validation",cmd:["deno","--version"],required:!0,installInstructions:{macos:"brew install deno (or: curl -fsSL https://deno.land/install.sh | sh)",linux:"curl -fsSL https://deno.land/install.sh | sh",windows:"winget install DenoLand.Deno (or: irm https://deno.land/install.ps1 | iex)"}}},ZF={upload:["git-annex","gh","aws","deno"],download:["gh"],clone:["git","gh"],push:["git-annex","gh"],publish:["gh","aws"],update:["git","gh"],release:["git","gh"]}});var bw;var Ew=F(()=>{bw={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.28-PR2034.87fba58",description:"CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",type:"module",main:"dist/index.js",bin:{nemar:"dist/index.js","git-annex-remote-nemar":"dist/git-annex-remote-nemar.js"},scripts:{dev:"bun run src/index.ts",build:"bun build src/index.ts src/git-annex-remote-nemar.ts --outdir dist --target bun --minify && sed '1s|#!/usr/bin/env node|#!/usr/bin/env bun|' dist/index.js > dist/index.js.tmp && mv dist/index.js.tmp dist/index.js",test:"bun test",lint:"biome check src/","lint:scrub":"biome check scripts/scrub shared/identifier-scrub.ts test/scrub","test:scrub":"bun test --preload ./test/scrub/helpers/temp-dirs-preload.ts --path-ignore-patterns='__run_every_scrub_suite__' test/scrub test/identifier-scan.test.ts test/identifier-scrub.test.ts test/identifier-dates.test.ts test/identifier-fleet.test.ts","migrations:d1-check":"bun run scripts/d1-migration-check.ts","zarr:geometry-check":"bun run backend/scripts/zarr-geometry-conformance.ts","lint:fix":"biome check --fix src/",format:"biome format --write src/",typecheck:"tsc --noEmit && tsc --noEmit -p backend","generate-openapi":"bun run scripts/generate-openapi.ts",prepublishOnly:"bun run build",prepare:"husky",postinstall:"bun scripts/postinstall-check.mjs",deploy:"wrangler deploy",preview:"wrangler dev"},keywords:["nemar","bids","neuroimaging","eeg","emg","datalad","cli"],author:"NEMAR Team",license:"CC-BY-NC-ND-4.0",repository:{type:"git",url:"git+https://github.com/nemarOrg/nemar-cli.git"},bugs:{url:"https://github.com/nemarOrg/nemar-cli/issues"},homepage:"https://docs.nemar.org",engines:{bun:">=1.0.0"},files:["dist","scripts/postinstall-check.mjs","scripts/recover-datasets.json","scripts/withdrawn-datasets.json","README.md","LICENSE"],dependencies:{chalk:"^5.3.0",commander:"^12.1.0",conf:"^13.0.1",inquirer:"^9.2.15",ora:"^8.0.1",semver:"^7.8.5",zod:"^3.23.8"},"lint-staged":{"src/**/*.{ts,tsx}":["biome check --fix"],"backend/src/**/*.{ts,tsx}":["biome check --fix"]},trustedDependencies:["@biomejs/biome"],devDependencies:{"@anthropic-ai/sdk":"^0.132.1","@asteasolutions/zod-to-openapi":"^7.3.4","@biomejs/biome":"1.9.4","@types/bun":"latest","@types/inquirer":"^9.0.7","@types/semver":"^7.8.0",ajv:"^8.20.0","ajv-formats":"^3.0.1",husky:"^9.1.7","lint-staged":"^16.3.2",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var ac;var Gl=F(()=>{Ew();ac=bw.version});import{mkdirSync as oV,readdirSync as iV,unlinkSync as aV,writeFileSync as cV}from"fs";import{join as Kl}from"path";function dB(){Ds=!0}function lc(){return Ds}function fB(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function pB(e){Tw=e,pr(`Step: ${e}`)}function hB(){xw=!0}function mB(){return xw}function gB(){if(Rw)return;Bl=!0}function yB(){Bl=!1,Rw=!0}function _B(){return Bl}function pr(e){if(Ds)process.stderr.write(`[debug] ${e}
|
|
27
27
|
`)}function fV(e){let t={};for(let[r,n]of Object.entries(e))t[r]=dV.has(r.toLowerCase())?"[REDACTED]":n;return t}function Ow(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function Hl(e,t,r=0){if(r>hV)return"[REDACTED: depth]";if(Array.isArray(t))return t.map((n)=>Hl(e,n,r+1));if(t&&typeof t==="object"){let n={};for(let[s,o]of Object.entries(t))n[s]=Hl(s,o,r+1);return n}if(typeof t==="string"){if(pV.test(e))return"[REDACTED]";return t.replace(kw,Ow)}return t}function Wl(e){return e.replace(mV,"Bearer [REDACTED]").replace(gV,"[REDACTED_AWS_KEY]").replace(yV,"$1[REDACTED]").replace(_V,"$1$2=[REDACTED]").replace(kw,Ow)}function vV(e){return Wl(e)}function ww(e,t=lV){if(e===void 0)return;let r=e;try{let n=JSON.parse(e);r=JSON.stringify(Hl("",n))}catch{}if(r=Wl(r),Buffer.byteLength(r,"utf8")>t)r=`${Buffer.from(r,"utf8").subarray(0,t).toString("utf8")}... [truncated]`;return r}function dc(e){if(!Ds)return;let t=vV(e.url);try{let r={...e,url:t,requestHeaders:e.requestHeaders?fV(e.requestHeaders):void 0,requestBody:ww(e.requestBody),responseBody:ww(e.responseBody)};uc.push(r),pr(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(r){let n=dr(r);uc.push({method:e.method,url:t,status:e.status,durationMs:e.durationMs,note:`redaction failed: ${n}`}),pr(`redaction failed for ${e.method} ${t}: ${n}`)}}async function $V(){let e=[];try{let t=process.versions.bun?`Bun ${process.versions.bun}`:`Node ${process.version}`;e.push(`CLI version: ${ac}`),e.push(`OS/Arch: ${process.platform}/${process.arch}`),e.push(`Runtime: ${t}`)}catch(t){e.push(`(could not read CLI/OS/runtime info: ${dr(t)})`)}e.push(""),e.push("Active account:");try{let t=hn();if(t.apiKey){if(t.username)e.push(` Username: ${t.username}`);if(e.push(` API URL: ${t.apiUrl}`),t.role)e.push(` Role: ${t.role}`);e.push(` Sandbox completed: ${!!t.sandboxCompleted}`)}else e.push(" (not authenticated)")}catch(t){e.push(` (could not read account config: ${dr(t)})`)}e.push(""),e.push("External tools:");try{let t=await zl();for(let r of t){let n=r.available?r.version??"installed":r.timedOut?"(timed out)":"not installed";e.push(` ${r.name}: ${n}`)}}catch(t){e.push(` (could not probe external tools: ${dr(t)})`)}return e}async function EV(){return(await $V()).join(`
|
|
28
28
|
`)}async function vB(){if(!Ds||cc!==void 0)return;try{cc=await EV()}catch(e){let t=dr(e);cc=`(could not build environment report: ${t})`,pr(`environment snapshot failed: ${t}`)}}function Aw(e){if(Sw.has(e))return{flag:e};for(let t of Sw){if(!e.startsWith(t)||e.length<=t.length)continue;if(t.length===2)return{flag:t,kind:"short-attached"};if(e[t.length]==="=")return{flag:t,kind:"long-eq"}}return null}function bV(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],s=Aw(n);if(!s){t.push(n);continue}if(s.kind==="long-eq")t.push(`${s.flag}=[REDACTED]`);else if(s.kind==="short-attached")t.push(`${s.flag}[REDACTED]`);else if(t.push(n),r+1<e.length)t.push("[REDACTED]"),r++}return t}function wV(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],s=Aw(n);if(!s){t.push(n);continue}if(!s.kind&&r+1<e.length)r++}return t}function SV(e){let t=[];for(let n of wV(e)){if(n.startsWith("-"))continue;if(t.push(n),t.length===2)break}return(t.length>0?t.join("-"):"nemar").replace(/[^a-zA-Z0-9_-]/g,"_")}function xV(e,t){let r=[];if(r.push("NEMAR CLI Debug Log"),r.push(`Generated: ${new Date().toISOString()}`),r.push(`Command: nemar ${Wl(bV(e).join(" "))}`),r.push(""),r.push(cc??"(environment snapshot unavailable)"),r.push(""),r.push("HTTP requests:"),uc.length===0)r.push(" (none)");else uc.forEach((n,s)=>{if(r.push(` [${s+1}] ${n.method} ${n.url} -> ${n.status??"ERROR"} (${n.durationMs}ms)`),n.error)r.push(` Error: ${n.error}`);if(n.note)r.push(` Note: ${n.note}`);if(n.requestHeaders)r.push(` Request headers: ${JSON.stringify(n.requestHeaders)}`);if(n.requestBody)r.push(` Request body: ${n.requestBody}`);if(n.responseBody)r.push(` Response body: ${n.responseBody}`)});return r.push(""),r.push(`Failing step: ${Tw??"(none recorded)"}`),r.push(`Exit code: ${t}`),`${r.join(`
|
|
29
29
|
`)}
|
package/dist/index.js
CHANGED
|
@@ -81,7 +81,7 @@ ${vs.cursorShow}`)}releaseCursor(){if(this.extraLinesUnderPrompt>0)dO(this.rl,th
|
|
|
81
81
|
${t}`,iWe,aWe,cWe=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,o=sWe.bind(null,r,t.toString());Object.defineProperty(o,"name",aWe);let{writable:s,enumerable:i,configurable:a}=iWe;Object.defineProperty(e,"toString",{value:o,writable:s,enumerable:i,configurable:a})};var fT=G(()=>{iWe=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),aWe=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var Yv,OQ=(e,t={})=>{if(typeof e!=="function")throw TypeError("Expected a function");let n,r=0,o=e.displayName||e.name||"<anonymous>",s=function(...i){if(Yv.set(s,++r),r===1)n=e.apply(this,i),e=void 0;else if(t.throw===!0)throw Error(`Function \`${o}\` can only be called once`);return n};return N0(s,e),Yv.set(s,r),s},TQ;var PQ=G(()=>{fT();Yv=new WeakMap;OQ.callCount=(e)=>{if(!Yv.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Yv.get(e)};TQ=OQ});var Ef;var IQ=G(()=>{Ef=[];Ef.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")Ef.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")Ef.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class NQ{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(mT[pT])return mT[pT];lWe(mT,pT,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,t){this.listeners[e].push(t)}removeListener(e,t){let n=this.listeners[e],r=n.indexOf(t);if(r===-1)return;if(r===0&&n.length===1)n.length=0;else n.splice(r,1)}emit(e,t,n){if(this.emitted[e])return!1;this.emitted[e]=!0;let r=!1;for(let o of this.listeners[e])r=o(t,n)===!0||r;if(e==="exit")r=this.emit("afterExit",t,n)||r;return r}}class gT{}var Xv=(e)=>!!e&&typeof e==="object"&&typeof e.removeListener==="function"&&typeof e.emit==="function"&&typeof e.reallyExit==="function"&&typeof e.listeners==="function"&&typeof e.kill==="function"&&typeof e.pid==="number"&&typeof e.on==="function",pT,mT,lWe,uWe=(e)=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}}),FQ,MQ,hT,jQ,GBt,VBt;var LQ=G(()=>{IQ();pT=Symbol.for("signal-exit emitter"),mT=globalThis,lWe=Object.defineProperty.bind(Object);FQ=class FQ extends gT{onExit(){return()=>{}}load(){}unload(){}};MQ=class MQ extends gT{#n=hT.platform==="win32"?"SIGINT":"SIGHUP";#t=new NQ;#e;#o;#f;#r={};#i=!1;constructor(e){super();this.#e=e,this.#r={};for(let t of Ef)this.#r[t]=()=>{let n=this.#e.listeners(t),{count:r}=this.#t,o=e;if(typeof o.__signal_exit_emitter__==="object"&&typeof o.__signal_exit_emitter__.count==="number")r+=o.__signal_exit_emitter__.count;if(n.length===r){this.unload();let s=this.#t.emit("exit",null,t),i=t==="SIGHUP"?this.#n:t;if(!s)e.kill(e.pid,i)}};this.#f=e.reallyExit,this.#o=e.emit}onExit(e,t){if(!Xv(this.#e))return()=>{};if(this.#i===!1)this.load();let n=t?.alwaysLast?"afterExit":"exit";return this.#t.on(n,e),()=>{if(this.#t.removeListener(n,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0)this.unload()}}load(){if(this.#i)return;this.#i=!0,this.#t.count+=1;for(let e of Ef)try{let t=this.#r[e];if(t)this.#e.on(e,t)}catch(t){}this.#e.emit=(e,...t)=>this.#p(e,...t),this.#e.reallyExit=(e)=>this.#s(e)}unload(){if(!this.#i)return;this.#i=!1,Ef.forEach((e)=>{let t=this.#r[e];if(!t)throw Error("Listener not defined for signal: "+e);try{this.#e.removeListener(e,t)}catch(n){}}),this.#e.emit=this.#o,this.#e.reallyExit=this.#f,this.#t.count-=1}#s(e){if(!Xv(this.#e))return 0;return this.#e.exitCode=e||0,this.#t.emit("exit",this.#e.exitCode,null),this.#f.call(this.#e,this.#e.exitCode)}#p(e,...t){let n=this.#o;if(e==="exit"&&Xv(this.#e)){if(typeof t[0]==="number")this.#e.exitCode=t[0];let r=n.call(this.#e,e,...t);return this.#t.emit("exit",this.#e.exitCode,null),r}else return n.call(this.#e,e,...t)}};hT=globalThis.process,{onExit:jQ,load:GBt,unload:VBt}=uWe(Xv(hT)?new MQ(hT):new FQ)});import Qv from"process";var qQ,dWe,BQ;var UQ=G(()=>{PQ();LQ();qQ=Qv.stderr.isTTY?Qv.stderr:Qv.stdout.isTTY?Qv.stdout:void 0,dWe=qQ?TQ(()=>{jQ(()=>{qQ.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},BQ=dWe});import HQ from"process";var Zv=!1,eh,yT;var zQ=G(()=>{UQ();eh={};eh.show=(e=HQ.stderr)=>{if(!e.isTTY)return;Zv=!1,e.write("\x1B[?25h")};eh.hide=(e=HQ.stderr)=>{if(!e.isTTY)return;BQ(),Zv=!0,e.write("\x1B[?25l")};eh.toggle=(e,t)=>{if(e!==void 0)Zv=e;if(Zv)eh.show(t);else eh.hide(t)};yT=eh});import Ni from"process";function bT(){if(Ni.platform!=="win32")return Ni.env.TERM!=="linux";return Boolean(Ni.env.CI)||Boolean(Ni.env.WT_SESSION)||Boolean(Ni.env.TERMINUS_SUBLIME)||Ni.env.ConEmuTask==="{cmd::Cmder}"||Ni.env.TERM_PROGRAM==="Terminus-Sublime"||Ni.env.TERM_PROGRAM==="vscode"||Ni.env.TERM==="xterm-256color"||Ni.env.TERM==="alacritty"||Ni.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var GQ=()=>{};var fWe,pWe,mWe,F0;var VQ=G(()=>{He();GQ();fWe={info:u.blue("\u2139"),success:u.green("\u2714"),warning:u.yellow("\u26A0"),error:u.red("\u2716")},pWe={info:u.blue("i"),success:u.green("\u221A"),warning:u.yellow("\u203C"),error:u.red("\xD7")},mWe=bT()?fWe:pWe,F0=mWe});function wT({onlyFirst:e=!1}={}){return new RegExp("(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]",e?void 0:"g")}function M0(e){if(typeof e!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(hWe,"")}var hWe;var _T=G(()=>{hWe=wT()});function WQ(e){return e===161||e===164||e===167||e===168||e===170||e===173||e===174||e>=176&&e<=180||e>=182&&e<=186||e>=188&&e<=191||e===198||e===208||e===215||e===216||e>=222&&e<=225||e===230||e>=232&&e<=234||e===236||e===237||e===240||e===242||e===243||e>=247&&e<=250||e===252||e===254||e===257||e===273||e===275||e===283||e===294||e===295||e===299||e>=305&&e<=307||e===312||e>=319&&e<=322||e===324||e>=328&&e<=331||e===333||e===338||e===339||e===358||e===359||e===363||e===462||e===464||e===466||e===468||e===470||e===472||e===474||e===476||e===593||e===609||e===708||e===711||e>=713&&e<=715||e===717||e===720||e>=728&&e<=731||e===733||e===735||e>=768&&e<=879||e>=913&&e<=929||e>=931&&e<=937||e>=945&&e<=961||e>=963&&e<=969||e===1025||e>=1040&&e<=1103||e===1105||e===8208||e>=8211&&e<=8214||e===8216||e===8217||e===8220||e===8221||e>=8224&&e<=8226||e>=8228&&e<=8231||e===8240||e===8242||e===8243||e===8245||e===8251||e===8254||e===8308||e===8319||e>=8321&&e<=8324||e===8364||e===8451||e===8453||e===8457||e===8467||e===8470||e===8481||e===8482||e===8486||e===8491||e===8531||e===8532||e>=8539&&e<=8542||e>=8544&&e<=8555||e>=8560&&e<=8569||e===8585||e>=8592&&e<=8601||e===8632||e===8633||e===8658||e===8660||e===8679||e===8704||e===8706||e===8707||e===8711||e===8712||e===8715||e===8719||e===8721||e===8725||e===8730||e>=8733&&e<=8736||e===8739||e===8741||e>=8743&&e<=8748||e===8750||e>=8756&&e<=8759||e===8764||e===8765||e===8776||e===8780||e===8786||e===8800||e===8801||e>=8804&&e<=8807||e===8810||e===8811||e===8814||e===8815||e===8834||e===8835||e===8838||e===8839||e===8853||e===8857||e===8869||e===8895||e===8978||e>=9312&&e<=9449||e>=9451&&e<=9547||e>=9552&&e<=9587||e>=9600&&e<=9615||e>=9618&&e<=9621||e===9632||e===9633||e>=9635&&e<=9641||e===9650||e===9651||e===9654||e===9655||e===9660||e===9661||e===9664||e===9665||e>=9670&&e<=9672||e===9675||e>=9678&&e<=9681||e>=9698&&e<=9701||e===9711||e===9733||e===9734||e===9737||e===9742||e===9743||e===9756||e===9758||e===9792||e===9794||e===9824||e===9825||e>=9827&&e<=9829||e>=9831&&e<=9834||e===9836||e===9837||e===9839||e===9886||e===9887||e===9919||e>=9926&&e<=9933||e>=9935&&e<=9939||e>=9941&&e<=9953||e===9955||e===9960||e===9961||e>=9963&&e<=9969||e===9972||e>=9974&&e<=9977||e===9979||e===9980||e===9982||e===9983||e===10045||e>=10102&&e<=10111||e>=11094&&e<=11097||e>=12872&&e<=12879||e>=57344&&e<=63743||e>=65024&&e<=65039||e===65533||e>=127232&&e<=127242||e>=127248&&e<=127277||e>=127280&&e<=127337||e>=127344&&e<=127373||e===127375||e===127376||e>=127387&&e<=127404||e>=917760&&e<=917999||e>=983040&&e<=1048573||e>=1048576&&e<=1114109}function KQ(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function JQ(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}var YQ=()=>{};function gWe(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function XQ(e,{ambiguousAsWide:t=!1}={}){if(gWe(e),KQ(e)||JQ(e)||t&&WQ(e))return 2;return 1}var QQ=G(()=>{YQ()});var ZQ=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDF44(?:\u200D\uD83D\uDFEB)?|\uDF4B(?:\u200D\uD83D\uDFE9)?|\uDFC3(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E-\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED8\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDD1D\uDEEF]\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE]|[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE]|\uDEEF\u200D\uD83D\uDC69\uD83C[\uDFFB-\uDFFE])))?))?|\uDD75(?:\uD83C[\uDFFB-\uDFFF]|\uFE0F)?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3C-\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE8A\uDE8E-\uDEC2\uDEC6\uDEC8\uDECD-\uDEDC\uDEDF-\uDEEA\uDEEF]|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC30\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3\uDE70]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF]|\uDEEF\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function xT(e,t={}){if(typeof e!=="string"||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(!r)e=M0(e);if(e.length===0)return 0;let o=0,s={ambiguousAsWide:!n};for(let{segment:i}of yWe.segment(e)){let a=i.codePointAt(0);if(a<=31||a>=127&&a<=159)continue;if(a>=8203&&a<=8207||a===65279)continue;if(a>=768&&a<=879||a>=6832&&a<=6911||a>=7616&&a<=7679||a>=8400&&a<=8447||a>=65056&&a<=65071)continue;if(a>=55296&&a<=57343)continue;if(a>=65024&&a<=65039)continue;if(bWe.test(i))continue;if(ZQ().test(i)){o+=2;continue}o+=XQ(a,s)}return o}var yWe,bWe;var eZ=G(()=>{_T();QQ();yWe=new Intl.Segmenter,bWe=/^\p{Default_Ignorable_Code_Point}$/u});function vT({stream:e=process.stdout}={}){return Boolean(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import tZ from"process";function kT(){let{env:e}=tZ,{TERM:t,TERM_PROGRAM:n}=e;if(tZ.platform!=="win32")return t!=="linux";return Boolean(e.WT_SESSION)||Boolean(e.TERMINUS_SUBLIME)||e.ConEmuTask==="{cmd::Cmder}"||n==="Terminus-Sublime"||n==="vscode"||t==="xterm-256color"||t==="alacritty"||t==="rxvt-unicode"||t==="rxvt-unicode-256color"||e.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var nZ=()=>{};import ka from"process";class rZ{#n=0;start(){if(this.#n++,this.#n===1)this.#t()}stop(){if(this.#n<=0)throw Error("`stop` called more times than `start`");if(this.#n--,this.#n===0)this.#e()}#t(){if(ka.platform==="win32"||!ka.stdin.isTTY)return;ka.stdin.setRawMode(!0),ka.stdin.on("data",this.#o),ka.stdin.resume()}#e(){if(!ka.stdin.isTTY)return;ka.stdin.off("data",this.#o),ka.stdin.pause(),ka.stdin.setRawMode(!1)}#o(e){if(e[0]===wWe)ka.emit("SIGINT")}}var wWe=3,_We,ET;var oZ=G(()=>{_We=new rZ,ET=_We});import ek from"process";class sZ{#n=0;#t=!1;#e=0;#o=-1;#f=0;#r;#i;#s;#p;#h;#l;#u;#d;#g;#a;#c;color;constructor(e){if(typeof e==="string")e={text:e};if(this.#r={color:"cyan",stream:ek.stderr,discardStdin:!0,hideCursor:!0,...e},this.color=this.#r.color,this.spinner=this.#r.spinner,this.#h=this.#r.interval,this.#s=this.#r.stream,this.#l=typeof this.#r.isEnabled==="boolean"?this.#r.isEnabled:vT({stream:this.#s}),this.#u=typeof this.#r.isSilent==="boolean"?this.#r.isSilent:!1,this.text=this.#r.text,this.prefixText=this.#r.prefixText,this.suffixText=this.#r.suffixText,this.indent=this.#r.indent,ek.env.NODE_ENV==="test")this._stream=this.#s,this._isEnabled=this.#l,Object.defineProperty(this,"_linesToClear",{get(){return this.#n},set(t){this.#n=t}}),Object.defineProperty(this,"_frameIndex",{get(){return this.#o}}),Object.defineProperty(this,"_lineCount",{get(){return this.#e}})}get indent(){return this.#d}set indent(e=0){if(!(e>=0&&Number.isInteger(e)))throw Error("The `indent` option must be an integer from 0 and up");this.#d=e,this.#m()}get interval(){return this.#h??this.#i.interval??100}get spinner(){return this.#i}set spinner(e){if(this.#o=-1,this.#h=void 0,typeof e==="object"){if(e.frames===void 0)throw Error("The given spinner must have a `frames` property");this.#i=e}else if(!kT())this.#i=j0.default.line;else if(e===void 0)this.#i=j0.default.dots;else if(e!=="default"&&j0.default[e])this.#i=j0.default[e];else throw Error(`There is no built-in spinner named '${e}'. See https://github.com/sindresorhus/cli-spinners/blob/main/spinners.json for a full list.`)}get text(){return this.#g}set text(e=""){this.#g=e,this.#m()}get prefixText(){return this.#a}set prefixText(e=""){this.#a=e,this.#m()}get suffixText(){return this.#c}set suffixText(e=""){this.#c=e,this.#m()}get isSpinning(){return this.#p!==void 0}#y(e=this.#a,t=" "){if(typeof e==="string"&&e!=="")return e+t;if(typeof e==="function")return e()+t;return""}#b(e=this.#c,t=" "){if(typeof e==="string"&&e!=="")return t+e;if(typeof e==="function")return t+e();return""}#m(){let e=this.#s.columns??80,t=this.#y(this.#a,"-"),n=this.#b(this.#c,"-"),r=" ".repeat(this.#d)+t+"--"+this.#g+"--"+n;this.#e=0;for(let o of M0(r).split(`
|
|
82
82
|
`))this.#e+=Math.max(1,Math.ceil(xT(o,{countAnsiEscapeCodes:!0})/e))}get isEnabled(){return this.#l&&!this.#u}set isEnabled(e){if(typeof e!=="boolean")throw TypeError("The `isEnabled` option must be a boolean");this.#l=e}get isSilent(){return this.#u}set isSilent(e){if(typeof e!=="boolean")throw TypeError("The `isSilent` option must be a boolean");this.#u=e}frame(){let e=Date.now();if(this.#o===-1||e-this.#f>=this.interval)this.#o=++this.#o%this.#i.frames.length,this.#f=e;let{frames:t}=this.#i,n=t[this.#o];if(this.color)n=u[this.color](n);let r=typeof this.#a==="string"&&this.#a!==""?this.#a+" ":"",o=typeof this.text==="string"?" "+this.text:"",s=typeof this.#c==="string"&&this.#c!==""?" "+this.#c:"";return r+n+o+s}clear(){if(!this.#l||!this.#s.isTTY)return this;this.#s.cursorTo(0);for(let e=0;e<this.#n;e++){if(e>0)this.#s.moveCursor(0,-1);this.#s.clearLine(1)}if(this.#d||this.lastIndent!==this.#d)this.#s.cursorTo(this.#d);return this.lastIndent=this.#d,this.#n=0,this}render(){if(this.#u)return this;return this.clear(),this.#s.write(this.frame()),this.#n=this.#e,this}start(e){if(e)this.text=e;if(this.#u)return this;if(!this.#l){if(this.text)this.#s.write(`- ${this.text}
|
|
83
83
|
`);return this}if(this.isSpinning)return this;if(this.#r.hideCursor)yT.hide(this.#s);if(this.#r.discardStdin&&ek.stdin.isTTY)this.#t=!0,ET.start();return this.render(),this.#p=setInterval(this.render.bind(this),this.interval),this}stop(){if(!this.#l)return this;if(clearInterval(this.#p),this.#p=void 0,this.#o=0,this.clear(),this.#r.hideCursor)yT.show(this.#s);if(this.#r.discardStdin&&ek.stdin.isTTY&&this.#t)ET.stop(),this.#t=!1;return this}succeed(e){return this.stopAndPersist({symbol:F0.success,text:e})}fail(e){return this.stopAndPersist({symbol:F0.error,text:e})}warn(e){return this.stopAndPersist({symbol:F0.warning,text:e})}info(e){return this.stopAndPersist({symbol:F0.info,text:e})}stopAndPersist(e={}){if(this.#u)return this;let t=e.prefixText??this.#a,n=this.#y(t," "),r=e.symbol??" ",o=e.text??this.text,i=typeof o==="string"?(r?" ":"")+o:"",a=e.suffixText??this.#c,c=this.#b(a," "),l=n+r+i+c+`
|
|
84
|
-
`;return this.stop(),this.#s.write(l),this}}function R(e){return new sZ(e)}var j0,xWe;var fo=G(()=>{He();zQ();VQ();_T();eZ();nZ();oZ();j0=et(Jx(),1),xWe=et(Jx(),1)});var St,cZ,pe,Xc=(e)=>{switch(typeof e){case"undefined":return pe.undefined;case"string":return pe.string;case"number":return Number.isNaN(e)?pe.nan:pe.number;case"boolean":return pe.boolean;case"function":return pe.function;case"bigint":return pe.bigint;case"symbol":return pe.symbol;case"object":if(Array.isArray(e))return pe.array;if(e===null)return pe.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return pe.promise;if(typeof Map<"u"&&e instanceof Map)return pe.map;if(typeof Set<"u"&&e instanceof Set)return pe.set;if(typeof Date<"u"&&e instanceof Date)return pe.date;return pe.object;default:return pe.unknown}};var L0=G(()=>{(function(e){e.assertEqual=(o)=>{};function t(o){}e.assertIs=t;function n(o){throw Error()}e.assertNever=n,e.arrayToEnum=(o)=>{let s={};for(let i of o)s[i]=i;return s},e.getValidEnumValues=(o)=>{let s=e.objectKeys(o).filter((a)=>typeof o[o[a]]!=="number"),i={};for(let a of s)i[a]=o[a];return e.objectValues(i)},e.objectValues=(o)=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys==="function"?(o)=>Object.keys(o):(o)=>{let s=[];for(let i in o)if(Object.prototype.hasOwnProperty.call(o,i))s.push(i);return s},e.find=(o,s)=>{for(let i of o)if(s(i))return i;return},e.isInteger=typeof Number.isInteger==="function"?(o)=>Number.isInteger(o):(o)=>typeof o==="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map((i)=>typeof i==="string"?`'${i}'`:i).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>{if(typeof s==="bigint")return s.toString();return s}})(St||(St={}));(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(cZ||(cZ={}));pe=St.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var ee,Rs;var tk=G(()=>{L0();ee=St.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);Rs=class Rs extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(n)=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,t);else this.__proto__=t;this.name="ZodError",this.issues=e}format(e){let t=e||function(o){return o.message},n={_errors:[]},r=(o)=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)n._errors.push(t(s));else{let i=n,a=0;while(a<s.path.length){let c=s.path[a];if(a!==s.path.length-1)i[c]=i[c]||{_errors:[]};else i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(s));i=i[c],a++}}};return r(this),n}static assert(e){if(!(e instanceof Rs))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,St.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];t[o]=t[o]||[],t[o].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};Rs.create=(e)=>new Rs(e)});var vWe=(e,t)=>{let n;switch(e.code){case ee.invalid_type:if(e.received===pe.undefined)n="Required";else n=`Expected ${e.expected}, received ${e.received}`;break;case ee.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,St.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${St.joinValues(e.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${St.joinValues(e.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${St.joinValues(e.options)}, received '${e.received}'`;break;case ee.invalid_arguments:n="Invalid function arguments";break;case ee.invalid_return_type:n="Invalid function return type";break;case ee.invalid_date:n="Invalid date";break;case ee.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")n=`${n} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)n=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)n=`Invalid input: must end with "${e.validation.endsWith}"`;else St.assertNever(e.validation);else if(e.validation!=="regex")n=`Invalid ${e.validation}`;else n="Invalid";break;case ee.too_small:if(e.type==="array")n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else n="Invalid input";break;case ee.too_big:if(e.type==="array")n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else n="Invalid input";break;case ee.custom:n="Invalid input";break;case ee.invalid_intersection_types:n="Intersection results could not be merged";break;case ee.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ee.not_finite:n="Number must be finite";break;default:n=t.defaultError,St.assertNever(e)}return{message:n}},$u;var ST=G(()=>{tk();L0();$u=vWe});function q0(){return kWe}var kWe;var nk=G(()=>{ST();kWe=$u});function ce(e,t){let n=q0(),r=rk({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===$u?void 0:$u].filter((o)=>!!o)});e.common.issues.push(r)}class po{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let n=[];for(let r of t){if(r.status==="aborted")return qe;if(r.status==="dirty")e.dirty();n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let r of t){let o=await r.key,s=await r.value;n.push({key:o,value:s})}return po.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:o,value:s}=r;if(o.status==="aborted")return qe;if(s.status==="aborted")return qe;if(o.status==="dirty")e.dirty();if(s.status==="dirty")e.dirty();if(o.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet))n[o.value]=s.value}return{status:e.value,value:n}}}var rk=(e)=>{let{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=r.filter((l)=>!!l).slice().reverse();for(let l of c)a=l(i,{data:t,defaultError:a}).message;return{...o,path:s,message:a}},qe,th=(e)=>({status:"dirty",value:e}),Co=(e)=>({status:"valid",value:e}),$T=(e)=>e.status==="aborted",RT=(e)=>e.status==="dirty",Sf=(e)=>e.status==="valid",B0=(e)=>typeof Promise<"u"&&e instanceof Promise;var DT=G(()=>{nk();ST();qe=Object.freeze({status:"aborted"})});var lZ=()=>{};var $e;var uZ=G(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})($e||($e={}))});class Fi{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function ct(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:o};return{errorMap:(i,a)=>{let{message:c}=e;if(i.code==="invalid_enum_value")return{message:c??a.defaultError};if(typeof a.data>"u")return{message:c??r??a.defaultError};if(i.code!=="invalid_type")return{message:a.defaultError};return{message:c??n??a.defaultError}},description:o}}class _t{get description(){return this._def.description}_getType(e){return Xc(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Xc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new po,ctx:{common:e.parent.common,data:e.data,parsedType:Xc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(B0(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xc(e)},r=this._parseSync({data:e,path:n.path,parent:n});return dZ(n,r)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xc(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Sf(n)?{value:n.value}:{issues:t.common.issues}}catch(n){if(n?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((n)=>Sf(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xc(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(B0(r)?r:Promise.resolve(r));return dZ(n,o)}refine(e,t){let n=(r)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(r);else return t};return this._refinement((r,o)=>{let s=e(r),i=()=>o.addIssue({code:ee.custom,...n(r)});if(typeof Promise<"u"&&s instanceof Promise)return s.then((a)=>{if(!a)return i(),!1;else return!0});if(!s)return i(),!1;else return!0})}refinement(e,t){return this._refinement((n,r)=>{if(!e(n))return r.addIssue(typeof t==="function"?t(n,r):t),!1;else return!0})}_refinement(e){return new $a({schema:this,typeName:Be.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(t)=>this["~validate"](t)}}optional(){return Sa.create(this,this._def)}nullable(){return Ru.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ea.create(this)}promise(){return ih.create(this,this._def)}or(e){return V0.create([this,e],this._def)}and(e){return W0.create(this,e,this._def)}transform(e){return new $a({...ct(this._def),schema:this,typeName:Be.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new X0({...ct(this._def),innerType:this,defaultValue:t,typeName:Be.ZodDefault})}brand(){return new TT({typeName:Be.ZodBranded,type:this,...ct(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new Q0({...ct(this._def),innerType:this,catchValue:t,typeName:Be.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return dk.create(this,e)}readonly(){return Z0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function pZ(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function qWe(e){return new RegExp(`^${pZ(e)}$`)}function BWe(e){let t=`${fZ}T${pZ(e)}`,n=[];if(n.push(e.local?"Z?":"Z"),e.offset)n.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function UWe(e,t){if((t==="v4"||!t)&&PWe.test(e))return!0;if((t==="v6"||!t)&&NWe.test(e))return!0;return!1}function HWe(e,t){if(!CWe.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));if(typeof o!=="object"||o===null)return!1;if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&o.alg!==t)return!1;return!0}catch{return!1}}function zWe(e,t){if((t==="v4"||!t)&&IWe.test(e))return!0;if((t==="v6"||!t)&&FWe.test(e))return!0;return!1}function GWe(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return s%i/10**o}function nh(e){if(e instanceof Ln){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Sa.create(nh(r))}return new Ln({...e._def,shape:()=>t})}else if(e instanceof Ea)return new Ea({...e._def,type:nh(e.element)});else if(e instanceof Sa)return Sa.create(nh(e.unwrap()));else if(e instanceof Ru)return Ru.create(nh(e.unwrap()));else if(e instanceof tl)return tl.create(e.items.map((t)=>nh(t)));else return e}function AT(e,t){let n=Xc(e),r=Xc(t);if(e===t)return{valid:!0,data:e};else if(n===pe.object&&r===pe.object){let o=St.objectKeys(t),s=St.objectKeys(e).filter((a)=>o.indexOf(a)!==-1),i={...e,...t};for(let a of s){let c=AT(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===pe.array&&r===pe.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let s=0;s<e.length;s++){let i=e[s],a=t[s],c=AT(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else if(n===pe.date&&r===pe.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function mZ(e,t){return new Rf({values:e,typeName:Be.ZodEnum,...ct(t)})}var dZ=(e,t)=>{if(Sf(t))return{success:!0,data:t.value};else{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Rs(e.common.issues);return this._error=n,this._error}}}},EWe,SWe,$We,RWe,DWe,CWe,AWe,OWe,TWe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",CT,PWe,IWe,NWe,FWe,MWe,jWe,fZ="((\\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])))",LWe,Zc,rh,oh,ok,H0,sk,z0,G0,ik,$f,el,ak,Ea,Ln,V0,Qc=(e)=>{if(e instanceof K0)return Qc(e.schema);else if(e instanceof $a)return Qc(e.innerType());else if(e instanceof J0)return[e.value];else if(e instanceof Rf)return e.options;else if(e instanceof Y0)return St.objectValues(e.enum);else if(e instanceof X0)return Qc(e._def.innerType);else if(e instanceof z0)return[void 0];else if(e instanceof G0)return[null];else if(e instanceof Sa)return[void 0,...Qc(e.unwrap())];else if(e instanceof Ru)return[null,...Qc(e.unwrap())];else if(e instanceof TT)return Qc(e.unwrap());else if(e instanceof Z0)return Qc(e.unwrap());else if(e instanceof Q0)return Qc(e._def.innerType);else return[]},OT,W0,tl,ck,lk,sh,U0,K0,J0,Rf,Y0,ih,$a,Sa,Ru,X0,Q0,uk,XUt,TT,dk,Z0,QUt,Be,E,F,ZUt,e5t,Ge,t5t,n5t,r5t,o5t,s5t,Du,i5t,a5t,ae,Y,c5t,ah,PT,l5t,u5t,Ao,d5t,f5t,p5t,m5t,$t,vt,h5t,g5t,y5t,b5t,w5t,_5t,x5t;var hZ=G(()=>{tk();nk();uZ();DT();L0();EWe=/^c[^\s-]{8,}$/i,SWe=/^[0-9a-z]+$/,$We=/^[0-9A-HJKMNP-TV-Z]{26}$/i,RWe=/^[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}$/i,DWe=/^[a-z0-9_-]{21}$/i,CWe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,AWe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,OWe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,PWe=/^(?:(?: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])$/,IWe=/^(?:(?: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])$/,NWe=/^(([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]))$/,FWe=/^(([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])$/,MWe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,jWe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,LWe=new RegExp(`^${fZ}$`);Zc=class Zc extends _t{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==pe.string){let o=this._getOrReturnCtx(e);return ce(o,{code:ee.invalid_type,expected:pe.string,received:o.parsedType}),qe}let n=new po,r=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.length<o.value)r=this._getOrReturnCtx(e,r),ce(r,{code:ee.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="max"){if(e.data.length>o.value)r=this._getOrReturnCtx(e,r),ce(r,{code:ee.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="length"){let s=e.data.length>o.value,i=e.data.length<o.value;if(s||i){if(r=this._getOrReturnCtx(e,r),s)ce(r,{code:ee.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});else if(i)ce(r,{code:ee.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});n.dirty()}}else if(o.kind==="email"){if(!OWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"email",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="emoji"){if(!CT)CT=new RegExp(TWe,"u");if(!CT.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"emoji",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="uuid"){if(!RWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"uuid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="nanoid"){if(!DWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"nanoid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid"){if(!EWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"cuid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid2"){if(!SWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"cuid2",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ulid"){if(!$We.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"ulid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),ce(r,{validation:"url",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="regex"){if(o.regex.lastIndex=0,!o.regex.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"regex",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="trim")e.data=e.data.trim();else if(o.kind==="includes"){if(!e.data.includes(o.value,o.position))r=this._getOrReturnCtx(e,r),ce(r,{code:ee.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()}else if(o.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(o.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(o.kind==="startsWith"){if(!e.data.startsWith(o.value))r=this._getOrReturnCtx(e,r),ce(r,{code:ee.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()}else if(o.kind==="endsWith"){if(!e.data.endsWith(o.value))r=this._getOrReturnCtx(e,r),ce(r,{code:ee.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()}else if(o.kind==="datetime"){if(!BWe(o).test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{code:ee.invalid_string,validation:"datetime",message:o.message}),n.dirty()}else if(o.kind==="date"){if(!LWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{code:ee.invalid_string,validation:"date",message:o.message}),n.dirty()}else if(o.kind==="time"){if(!qWe(o).test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{code:ee.invalid_string,validation:"time",message:o.message}),n.dirty()}else if(o.kind==="duration"){if(!AWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"duration",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ip"){if(!UWe(e.data,o.version))r=this._getOrReturnCtx(e,r),ce(r,{validation:"ip",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="jwt"){if(!HWe(e.data,o.alg))r=this._getOrReturnCtx(e,r),ce(r,{validation:"jwt",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cidr"){if(!zWe(e.data,o.version))r=this._getOrReturnCtx(e,r),ce(r,{validation:"cidr",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64"){if(!MWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"base64",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64url"){if(!jWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"base64url",code:ee.invalid_string,message:o.message}),n.dirty()}else St.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement((r)=>e.test(r),{validation:t,code:ee.invalid_string,...$e.errToObj(n)})}_addCheck(e){return new Zc({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...$e.errToObj(e)})}url(e){return this._addCheck({kind:"url",...$e.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...$e.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...$e.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...$e.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...$e.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...$e.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...$e.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...$e.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...$e.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...$e.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...$e.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...$e.errToObj(e)})}datetime(e){if(typeof e==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e});return this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...$e.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){if(typeof e==="string")return this._addCheck({kind:"time",precision:null,message:e});return this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...$e.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...$e.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...$e.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...$e.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...$e.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...$e.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...$e.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...$e.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...$e.errToObj(t)})}nonempty(e){return this.min(1,$e.errToObj(e))}trim(){return new Zc({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Zc({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Zc({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e)=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find((e)=>e.kind==="date")}get isTime(){return!!this._def.checks.find((e)=>e.kind==="time")}get isDuration(){return!!this._def.checks.find((e)=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find((e)=>e.kind==="email")}get isURL(){return!!this._def.checks.find((e)=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find((e)=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find((e)=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((e)=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((e)=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((e)=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find((e)=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find((e)=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find((e)=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find((e)=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find((e)=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxLength(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};Zc.create=(e)=>new Zc({checks:[],typeName:Be.ZodString,coerce:e?.coerce??!1,...ct(e)});rh=class rh extends _t{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce)e.data=Number(e.data);if(this._getType(e)!==pe.number){let o=this._getOrReturnCtx(e);return ce(o,{code:ee.invalid_type,expected:pe.number,received:o.parsedType}),qe}let n=void 0,r=new po;for(let o of this._def.checks)if(o.kind==="int"){if(!St.isInteger(e.data))n=this._getOrReturnCtx(e,n),ce(n,{code:ee.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()}else if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)n=this._getOrReturnCtx(e,n),ce(n,{code:ee.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)n=this._getOrReturnCtx(e,n),ce(n,{code:ee.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="multipleOf"){if(GWe(e.data,o.value)!==0)n=this._getOrReturnCtx(e,n),ce(n,{code:ee.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()}else if(o.kind==="finite"){if(!Number.isFinite(e.data))n=this._getOrReturnCtx(e,n),ce(n,{code:ee.not_finite,message:o.message}),r.dirty()}else St.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,$e.toString(t))}gt(e,t){return this.setLimit("min",e,!1,$e.toString(t))}lte(e,t){return this.setLimit("max",e,!0,$e.toString(t))}lt(e,t){return this.setLimit("max",e,!1,$e.toString(t))}setLimit(e,t,n,r){return new rh({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:$e.toString(r)}]})}_addCheck(e){return new rh({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:$e.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$e.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$e.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$e.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$e.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:$e.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:$e.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$e.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$e.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}get isInt(){return!!this._def.checks.find((e)=>e.kind==="int"||e.kind==="multipleOf"&&St.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;else if(n.kind==="min"){if(t===null||n.value>t)t=n.value}else if(n.kind==="max"){if(e===null||n.value<e)e=n.value}return Number.isFinite(t)&&Number.isFinite(e)}};rh.create=(e)=>new rh({checks:[],typeName:Be.ZodNumber,coerce:e?.coerce||!1,...ct(e)});oh=class oh extends _t{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==pe.bigint)return this._getInvalidInput(e);let n=void 0,r=new po;for(let o of this._def.checks)if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)n=this._getOrReturnCtx(e,n),ce(n,{code:ee.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)n=this._getOrReturnCtx(e,n),ce(n,{code:ee.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()}else if(o.kind==="multipleOf"){if(e.data%o.value!==BigInt(0))n=this._getOrReturnCtx(e,n),ce(n,{code:ee.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()}else St.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return ce(t,{code:ee.invalid_type,expected:pe.bigint,received:t.parsedType}),qe}gte(e,t){return this.setLimit("min",e,!0,$e.toString(t))}gt(e,t){return this.setLimit("min",e,!1,$e.toString(t))}lte(e,t){return this.setLimit("max",e,!0,$e.toString(t))}lt(e,t){return this.setLimit("max",e,!1,$e.toString(t))}setLimit(e,t,n,r){return new oh({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:$e.toString(r)}]})}_addCheck(e){return new oh({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:$e.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$e.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$e.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$e.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:$e.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};oh.create=(e)=>new oh({checks:[],typeName:Be.ZodBigInt,coerce:e?.coerce??!1,...ct(e)});ok=class ok extends _t{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==pe.boolean){let n=this._getOrReturnCtx(e);return ce(n,{code:ee.invalid_type,expected:pe.boolean,received:n.parsedType}),qe}return Co(e.data)}};ok.create=(e)=>new ok({typeName:Be.ZodBoolean,coerce:e?.coerce||!1,...ct(e)});H0=class H0 extends _t{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==pe.date){let o=this._getOrReturnCtx(e);return ce(o,{code:ee.invalid_type,expected:pe.date,received:o.parsedType}),qe}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return ce(o,{code:ee.invalid_date}),qe}let n=new po,r=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.getTime()<o.value)r=this._getOrReturnCtx(e,r),ce(r,{code:ee.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()}else if(o.kind==="max"){if(e.data.getTime()>o.value)r=this._getOrReturnCtx(e,r),ce(r,{code:ee.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()}else St.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new H0({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:$e.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:$e.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e!=null?new Date(e):null}};H0.create=(e)=>new H0({checks:[],coerce:e?.coerce||!1,typeName:Be.ZodDate,...ct(e)});sk=class sk extends _t{_parse(e){if(this._getType(e)!==pe.symbol){let n=this._getOrReturnCtx(e);return ce(n,{code:ee.invalid_type,expected:pe.symbol,received:n.parsedType}),qe}return Co(e.data)}};sk.create=(e)=>new sk({typeName:Be.ZodSymbol,...ct(e)});z0=class z0 extends _t{_parse(e){if(this._getType(e)!==pe.undefined){let n=this._getOrReturnCtx(e);return ce(n,{code:ee.invalid_type,expected:pe.undefined,received:n.parsedType}),qe}return Co(e.data)}};z0.create=(e)=>new z0({typeName:Be.ZodUndefined,...ct(e)});G0=class G0 extends _t{_parse(e){if(this._getType(e)!==pe.null){let n=this._getOrReturnCtx(e);return ce(n,{code:ee.invalid_type,expected:pe.null,received:n.parsedType}),qe}return Co(e.data)}};G0.create=(e)=>new G0({typeName:Be.ZodNull,...ct(e)});ik=class ik extends _t{constructor(){super(...arguments);this._any=!0}_parse(e){return Co(e.data)}};ik.create=(e)=>new ik({typeName:Be.ZodAny,...ct(e)});$f=class $f extends _t{constructor(){super(...arguments);this._unknown=!0}_parse(e){return Co(e.data)}};$f.create=(e)=>new $f({typeName:Be.ZodUnknown,...ct(e)});el=class el extends _t{_parse(e){let t=this._getOrReturnCtx(e);return ce(t,{code:ee.invalid_type,expected:pe.never,received:t.parsedType}),qe}};el.create=(e)=>new el({typeName:Be.ZodNever,...ct(e)});ak=class ak extends _t{_parse(e){if(this._getType(e)!==pe.undefined){let n=this._getOrReturnCtx(e);return ce(n,{code:ee.invalid_type,expected:pe.void,received:n.parsedType}),qe}return Co(e.data)}};ak.create=(e)=>new ak({typeName:Be.ZodVoid,...ct(e)});Ea=class Ea extends _t{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==pe.array)return ce(t,{code:ee.invalid_type,expected:pe.array,received:t.parsedType}),qe;if(r.exactLength!==null){let s=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;if(s||i)ce(t,{code:s?ee.too_big:ee.too_small,minimum:i?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty()}if(r.minLength!==null){if(t.data.length<r.minLength.value)ce(t,{code:ee.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()}if(r.maxLength!==null){if(t.data.length>r.maxLength.value)ce(t,{code:ee.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()}if(t.common.async)return Promise.all([...t.data].map((s,i)=>r.type._parseAsync(new Fi(t,s,t.path,i)))).then((s)=>po.mergeArray(n,s));let o=[...t.data].map((s,i)=>r.type._parseSync(new Fi(t,s,t.path,i)));return po.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new Ea({...this._def,minLength:{value:e,message:$e.toString(t)}})}max(e,t){return new Ea({...this._def,maxLength:{value:e,message:$e.toString(t)}})}length(e,t){return new Ea({...this._def,exactLength:{value:e,message:$e.toString(t)}})}nonempty(e){return this.min(1,e)}};Ea.create=(e,t)=>new Ea({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Be.ZodArray,...ct(t)});Ln=class Ln extends _t{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=St.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==pe.object){let c=this._getOrReturnCtx(e);return ce(c,{code:ee.invalid_type,expected:pe.object,received:c.parsedType}),qe}let{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof el&&this._def.unknownKeys==="strip")){for(let c in r.data)if(!s.includes(c))i.push(c)}let a=[];for(let c of s){let l=o[c],d=r.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new Fi(r,d,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof el){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of i)a.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(c==="strict"){if(i.length>0)ce(r,{code:ee.unrecognized_keys,keys:i}),n.dirty()}else if(c==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of i){let d=r.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new Fi(r,d,r.path,l)),alwaysSet:l in r.data})}}if(r.common.async)return Promise.resolve().then(async()=>{let c=[];for(let l of a){let d=await l.key,f=await l.value;c.push({key:d,value:f,alwaysSet:l.alwaysSet})}return c}).then((c)=>po.mergeObjectSync(n,c));else return po.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(e){return $e.errToObj,new Ln({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{let r=this._def.errorMap?.(t,n).message??n.defaultError;if(t.code==="unrecognized_keys")return{message:$e.errToObj(e).message??r};return{message:r}}}:{}})}strip(){return new Ln({...this._def,unknownKeys:"strip"})}passthrough(){return new Ln({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ln({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ln({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Be.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ln({...this._def,catchall:e})}pick(e){let t={};for(let n of St.objectKeys(e))if(e[n]&&this.shape[n])t[n]=this.shape[n];return new Ln({...this._def,shape:()=>t})}omit(e){let t={};for(let n of St.objectKeys(this.shape))if(!e[n])t[n]=this.shape[n];return new Ln({...this._def,shape:()=>t})}deepPartial(){return nh(this)}partial(e){let t={};for(let n of St.objectKeys(this.shape)){let r=this.shape[n];if(e&&!e[n])t[n]=r;else t[n]=r.optional()}return new Ln({...this._def,shape:()=>t})}required(e){let t={};for(let n of St.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];while(o instanceof Sa)o=o._def.innerType;t[n]=o}return new Ln({...this._def,shape:()=>t})}keyof(){return mZ(St.objectKeys(this.shape))}};Ln.create=(e,t)=>new Ln({shape:()=>e,unknownKeys:"strip",catchall:el.create(),typeName:Be.ZodObject,...ct(t)});Ln.strictCreate=(e,t)=>new Ln({shape:()=>e,unknownKeys:"strict",catchall:el.create(),typeName:Be.ZodObject,...ct(t)});Ln.lazycreate=(e,t)=>new Ln({shape:e,unknownKeys:"strip",catchall:el.create(),typeName:Be.ZodObject,...ct(t)});V0=class V0 extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(o){for(let i of o)if(i.result.status==="valid")return i.result;for(let i of o)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let s=o.map((i)=>new Rs(i.ctx.common.issues));return ce(t,{code:ee.invalid_union,unionErrors:s}),qe}if(t.common.async)return Promise.all(n.map(async(o)=>{let s={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(r);else{let o=void 0,s=[];for(let a of n){let c={...t,common:{...t.common,issues:[]},parent:null},l=a._parseSync({data:t.data,path:t.path,parent:c});if(l.status==="valid")return l;else if(l.status==="dirty"&&!o)o={result:l,ctx:c};if(c.common.issues.length)s.push(c.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let i=s.map((a)=>new Rs(a));return ce(t,{code:ee.invalid_union,unionErrors:i}),qe}}get options(){return this._def.options}};V0.create=(e,t)=>new V0({options:e,typeName:Be.ZodUnion,...ct(t)});OT=class OT extends _t{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==pe.object)return ce(t,{code:ee.invalid_type,expected:pe.object,received:t.parsedType}),qe;let n=this.discriminator,r=t.data[n],o=this.optionsMap.get(r);if(!o)return ce(t,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),qe;if(t.common.async)return o._parseAsync({data:t.data,path:t.path,parent:t});else return o._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let r=new Map;for(let o of t){let s=Qc(o.shape[e]);if(!s.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of s){if(r.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,o)}}return new OT({typeName:Be.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...ct(n)})}};W0=class W0 extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(o,s)=>{if($T(o)||$T(s))return qe;let i=AT(o.value,s.value);if(!i.valid)return ce(n,{code:ee.invalid_intersection_types}),qe;if(RT(o)||RT(s))t.dirty();return{status:t.value,value:i.data}};if(n.common.async)return Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>r(o,s));else return r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};W0.create=(e,t,n)=>new W0({left:e,right:t,typeName:Be.ZodIntersection,...ct(n)});tl=class tl extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==pe.array)return ce(n,{code:ee.invalid_type,expected:pe.array,received:n.parsedType}),qe;if(n.data.length<this._def.items.length)return ce(n,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),qe;if(!this._def.rest&&n.data.length>this._def.items.length)ce(n,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let o=[...n.data].map((s,i)=>{let a=this._def.items[i]||this._def.rest;if(!a)return null;return a._parse(new Fi(n,s,n.path,i))}).filter((s)=>!!s);if(n.common.async)return Promise.all(o).then((s)=>po.mergeArray(t,s));else return po.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new tl({...this._def,rest:e})}};tl.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new tl({items:e,typeName:Be.ZodTuple,rest:null,...ct(t)})};ck=class ck extends _t{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==pe.object)return ce(n,{code:ee.invalid_type,expected:pe.object,received:n.parsedType}),qe;let r=[],o=this._def.keyType,s=this._def.valueType;for(let i in n.data)r.push({key:o._parse(new Fi(n,i,n.path,i)),value:s._parse(new Fi(n,n.data[i],n.path,i)),alwaysSet:i in n.data});if(n.common.async)return po.mergeObjectAsync(t,r);else return po.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){if(t instanceof _t)return new ck({keyType:e,valueType:t,typeName:Be.ZodRecord,...ct(n)});return new ck({keyType:Zc.create(),valueType:e,typeName:Be.ZodRecord,...ct(t)})}};lk=class lk extends _t{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==pe.map)return ce(n,{code:ee.invalid_type,expected:pe.map,received:n.parsedType}),qe;let r=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([i,a],c)=>({key:r._parse(new Fi(n,i,n.path,[c,"key"])),value:o._parse(new Fi(n,a,n.path,[c,"value"]))}));if(n.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let a of s){let c=await a.key,l=await a.value;if(c.status==="aborted"||l.status==="aborted")return qe;if(c.status==="dirty"||l.status==="dirty")t.dirty();i.set(c.value,l.value)}return{status:t.value,value:i}})}else{let i=new Map;for(let a of s){let{key:c,value:l}=a;if(c.status==="aborted"||l.status==="aborted")return qe;if(c.status==="dirty"||l.status==="dirty")t.dirty();i.set(c.value,l.value)}return{status:t.value,value:i}}}};lk.create=(e,t,n)=>new lk({valueType:t,keyType:e,typeName:Be.ZodMap,...ct(n)});sh=class sh extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==pe.set)return ce(n,{code:ee.invalid_type,expected:pe.set,received:n.parsedType}),qe;let r=this._def;if(r.minSize!==null){if(n.data.size<r.minSize.value)ce(n,{code:ee.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()}if(r.maxSize!==null){if(n.data.size>r.maxSize.value)ce(n,{code:ee.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty()}let o=this._def.valueType;function s(a){let c=new Set;for(let l of a){if(l.status==="aborted")return qe;if(l.status==="dirty")t.dirty();c.add(l.value)}return{status:t.value,value:c}}let i=[...n.data.values()].map((a,c)=>o._parse(new Fi(n,a,n.path,c)));if(n.common.async)return Promise.all(i).then((a)=>s(a));else return s(i)}min(e,t){return new sh({...this._def,minSize:{value:e,message:$e.toString(t)}})}max(e,t){return new sh({...this._def,maxSize:{value:e,message:$e.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};sh.create=(e,t)=>new sh({valueType:e,minSize:null,maxSize:null,typeName:Be.ZodSet,...ct(t)});U0=class U0 extends _t{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==pe.function)return ce(t,{code:ee.invalid_type,expected:pe.function,received:t.parsedType}),qe;function n(i,a){return rk({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,q0(),$u].filter((c)=>!!c),issueData:{code:ee.invalid_arguments,argumentsError:a}})}function r(i,a){return rk({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,q0(),$u].filter((c)=>!!c),issueData:{code:ee.invalid_return_type,returnTypeError:a}})}let o={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof ih){let i=this;return Co(async function(...a){let c=new Rs([]),l=await i._def.args.parseAsync(a,o).catch((p)=>{throw c.addIssue(n(a,p)),c}),d=await Reflect.apply(s,this,l);return await i._def.returns._def.type.parseAsync(d,o).catch((p)=>{throw c.addIssue(r(d,p)),c})})}else{let i=this;return Co(function(...a){let c=i._def.args.safeParse(a,o);if(!c.success)throw new Rs([n(a,c.error)]);let l=Reflect.apply(s,this,c.data),d=i._def.returns.safeParse(l,o);if(!d.success)throw new Rs([r(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new U0({...this._def,args:tl.create(e).rest($f.create())})}returns(e){return new U0({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new U0({args:e?e:tl.create([]).rest($f.create()),returns:t||$f.create(),typeName:Be.ZodFunction,...ct(n)})}};K0=class K0 extends _t{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};K0.create=(e,t)=>new K0({getter:e,typeName:Be.ZodLazy,...ct(t)});J0=class J0 extends _t{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return ce(t,{received:t.data,code:ee.invalid_literal,expected:this._def.value}),qe}return{status:"valid",value:e.data}}get value(){return this._def.value}};J0.create=(e,t)=>new J0({value:e,typeName:Be.ZodLiteral,...ct(t)});Rf=class Rf extends _t{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return ce(t,{expected:St.joinValues(n),received:t.parsedType,code:ee.invalid_type}),qe}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return ce(t,{received:t.data,code:ee.invalid_enum_value,options:n}),qe}return Co(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Rf.create(e,{...this._def,...t})}exclude(e,t=this._def){return Rf.create(this.options.filter((n)=>!e.includes(n)),{...this._def,...t})}};Rf.create=mZ;Y0=class Y0 extends _t{_parse(e){let t=St.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==pe.string&&n.parsedType!==pe.number){let r=St.objectValues(t);return ce(n,{expected:St.joinValues(r),received:n.parsedType,code:ee.invalid_type}),qe}if(!this._cache)this._cache=new Set(St.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let r=St.objectValues(t);return ce(n,{received:n.data,code:ee.invalid_enum_value,options:r}),qe}return Co(e.data)}get enum(){return this._def.values}};Y0.create=(e,t)=>new Y0({values:e,typeName:Be.ZodNativeEnum,...ct(t)});ih=class ih extends _t{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==pe.promise&&t.common.async===!1)return ce(t,{code:ee.invalid_type,expected:pe.promise,received:t.parsedType}),qe;let n=t.parsedType===pe.promise?t.data:Promise.resolve(t.data);return Co(n.then((r)=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};ih.create=(e,t)=>new ih({type:e,typeName:Be.ZodPromise,...ct(t)});$a=class $a extends _t{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Be.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:(s)=>{if(ce(n,s),s.fatal)t.abort();else t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let s=r.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async(i)=>{if(t.value==="aborted")return qe;let a=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});if(a.status==="aborted")return qe;if(a.status==="dirty")return th(a.value);if(t.value==="dirty")return th(a.value);return a});else{if(t.value==="aborted")return qe;let i=this._def.schema._parseSync({data:s,path:n.path,parent:n});if(i.status==="aborted")return qe;if(i.status==="dirty")return th(i.value);if(t.value==="dirty")return th(i.value);return i}}if(r.type==="refinement"){let s=(i)=>{let a=r.refinement(i,o);if(n.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(i.status==="aborted")return qe;if(i.status==="dirty")t.dirty();return s(i.value),{status:t.value,value:i.value}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((i)=>{if(i.status==="aborted")return qe;if(i.status==="dirty")t.dirty();return s(i.value).then(()=>({status:t.value,value:i.value}))})}if(r.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Sf(s))return qe;let i=r.transform(s.value,o);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((s)=>{if(!Sf(s))return qe;return Promise.resolve(r.transform(s.value,o)).then((i)=>({status:t.value,value:i}))});St.assertNever(r)}};$a.create=(e,t,n)=>new $a({schema:e,typeName:Be.ZodEffects,effect:t,...ct(n)});$a.createWithPreprocess=(e,t,n)=>new $a({schema:t,effect:{type:"preprocess",transform:e},typeName:Be.ZodEffects,...ct(n)});Sa=class Sa extends _t{_parse(e){if(this._getType(e)===pe.undefined)return Co(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Sa.create=(e,t)=>new Sa({innerType:e,typeName:Be.ZodOptional,...ct(t)});Ru=class Ru extends _t{_parse(e){if(this._getType(e)===pe.null)return Co(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ru.create=(e,t)=>new Ru({innerType:e,typeName:Be.ZodNullable,...ct(t)});X0=class X0 extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;if(t.parsedType===pe.undefined)n=this._def.defaultValue();return this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};X0.create=(e,t)=>new X0({innerType:e,typeName:Be.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...ct(t)});Q0=class Q0 extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});if(B0(r))return r.then((o)=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Rs(n.common.issues)},input:n.data})}));else return{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Rs(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Q0.create=(e,t)=>new Q0({innerType:e,typeName:Be.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...ct(t)});uk=class uk extends _t{_parse(e){if(this._getType(e)!==pe.nan){let n=this._getOrReturnCtx(e);return ce(n,{code:ee.invalid_type,expected:pe.nan,received:n.parsedType}),qe}return{status:"valid",value:e.data}}};uk.create=(e)=>new uk({typeName:Be.ZodNaN,...ct(e)});XUt=Symbol("zod_brand");TT=class TT extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}};dk=class dk extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});if(o.status==="aborted")return qe;if(o.status==="dirty")return t.dirty(),th(o.value);else return this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();else{let r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});if(r.status==="aborted")return qe;if(r.status==="dirty")return t.dirty(),{status:"dirty",value:r.value};else return this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,t){return new dk({in:e,out:t,typeName:Be.ZodPipeline})}};Z0=class Z0 extends _t{_parse(e){let t=this._def.innerType._parse(e),n=(r)=>{if(Sf(r))r.value=Object.freeze(r.value);return r};return B0(t)?t.then((r)=>n(r)):n(t)}unwrap(){return this._def.innerType}};Z0.create=(e,t)=>new Z0({innerType:e,typeName:Be.ZodReadonly,...ct(t)});QUt={object:Ln.lazycreate};(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"})(Be||(Be={}));E=Zc.create,F=rh.create,ZUt=uk.create,e5t=oh.create,Ge=ok.create,t5t=H0.create,n5t=sk.create,r5t=z0.create,o5t=G0.create,s5t=ik.create,Du=$f.create,i5t=el.create,a5t=ak.create,ae=Ea.create,Y=Ln.create,c5t=Ln.strictCreate,ah=V0.create,PT=OT.create,l5t=W0.create,u5t=tl.create,Ao=ck.create,d5t=lk.create,f5t=sh.create,p5t=U0.create,m5t=K0.create,$t=J0.create,vt=Rf.create,h5t=Y0.create,g5t=ih.create,y5t=$a.create,b5t=Sa.create,w5t=Ru.create,_5t=$a.createWithPreprocess,x5t=dk.create});var IT=G(()=>{nk();DT();lZ();L0();hZ();tk()});var To=G(()=>{IT();IT()});function NT(e){return fk.includes(e)}var VWe,Df,fk,gZ,WWe,yZ,KWe,bZ,JWe,YWe,wZ,XWe,_Z,T5t,P5t,xZ,QWe,vZ,ZWe,kZ,FT=20,MT=500,eKe,I5t;var ch=G(()=>{To();VWe=vt(["pending","verified","approved","revoked"]),Df=vt(["person","service","test"]),fk=Df.options;gZ={nemarOwner:"service",nemarAdmin:"service","test-admin":"service","test-owner":"service","cool-vibers":"test","test-user":"test","test-pending":"test","test-verified":"test","test-revoked":"test"},WWe=vt(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),yZ=WWe.options,KWe=vt(["active","pending","revoked"]),bZ=Y({field:E(),blocks:ae(E()).optional(),set_on:ae(E()).optional()}).passthrough(),JWe=Y({id:F().int(),username:E().nullable(),email:E(),github_username:E().nullable(),role:E(),orcid:E().nullable().optional(),created_at:E().optional(),approved_at:E().nullable().optional(),dataset_count:F().int().optional(),sandbox_completed:Ge().optional(),sandbox_completed_at:E().nullable().optional(),sandbox_dataset_id:E().nullable().optional(),service_access:Ge().optional(),status:VWe.optional(),email_verified:Ge().optional(),orcid_verified:Ge().optional(),given_name:E().nullable().optional(),family_name:E().nullable().optional(),profile_gaps:ae(bZ).optional(),username_auto_assigned:Ge().optional(),account_kind:Df.optional()}).passthrough(),YWe=Y({prefix:E(),created_at:E(),last_used_at:E().nullable()}).passthrough().nullable(),wZ=Y({user:JWe,token:YWe.optional()}).passthrough(),XWe=Y({id:F().int(),username:E().nullable(),email:E(),github_username:E().nullable(),status:E(),email_verified:F().int().nullable().optional(),role:E().nullable(),created_at:E(),approved_at:E().nullable().optional(),revoked_at:E().nullable().optional(),signup_source:E().nullable().optional(),service_access:F().int().nullable().optional(),service_access_granted_at:E().nullable().optional(),given_name:E().nullable().optional(),family_name:E().nullable().optional(),orcid:E().nullable().optional(),upload_access_requested_at:E().nullable().optional(),account_kind:Df.optional(),matched_in:ae(E()).optional(),match_kind:E().optional()}).passthrough(),_Z=Y({users:ae(XWe),count:F().int()}).passthrough(),T5t=vt(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),P5t=vt(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),xZ=Y({suggestion:E().nullable(),based_on:vt(["name","unavailable","exhausted"])}).passthrough(),QWe=vt(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),vZ=QWe.options,ZWe=vt(["invalid_github_username","city_required","country_required","empty_patch","username_too_short","username_too_long","username_charset","given_name_required","family_name_required","username_taken","username_locked","name_is_orcid_canonical","account_revoked","github_unavailable","same_email","code_expired","code_incorrect","orcid_already_have","orcid_unavailable"]),kZ=ZWe.options,eKe=Y({id:F().int(),email:E(),username:E().nullable(),role:E(),status:KWe,email_verified:Ge(),given_name:E().nullable(),family_name:E().nullable(),orcid:E().nullable(),orcid_verified:Ge(),github_username:E().nullable(),city:E().nullable(),country:E().nullable(),affiliation:E().nullable(),service_access:Ge(),service_access_granted_at:E().nullable(),upload_access_requested_at:E().nullable(),profile_gaps:ae(bZ),username_auto_assigned:Ge()}).passthrough(),I5t=Y({user:eKe.nullable()}).passthrough()});var jT,LT,j5t,tKe,L5t,nKe,EZ,SZ,qT=8,BT=100,$Z,RZ,rKe,DZ;var eb=G(()=>{To();ch();jT=["given_name","family_name","affiliation","city","country"],LT=["username","github_username","email","orcid"],j5t=[...jT,...LT],tKe={given_name:E().max(200).optional(),family_name:E().max(200).optional(),affiliation:E().max(500).optional(),city:E().max(200).optional(),country:E().max(200).optional(),username:E().max(100).optional(),github_username:E().max(100).optional(),email:E().max(320).optional(),orcid:E().max(40).optional()},L5t=Y(tKe),nKe=vt(["field_not_editable","owner_only_field","edit_own_account","owner_account","system_account","invalid_edit","orcid_already_proven","invalid_search","invalid_user_id"]),EZ=nKe.options,SZ=["exact","name","prefix","substring","fuzzy"],$Z=Y({id:F().int(),username:E().nullable(),email:E(),github_username:E().nullable(),status:E(),role:E().nullable(),account_kind:Df.optional(),email_verified:F().int().nullable().optional(),orcid:E().nullable().optional(),orcid_verified:F().int().nullable().optional(),given_name:E().nullable().optional(),family_name:E().nullable().optional(),affiliation:E().nullable().optional(),city:E().nullable().optional(),country:E().nullable().optional(),description:E().nullable().optional(),signup_source:E().nullable().optional(),created_at:E(),updated_at:E().nullable().optional(),approved_at:E().nullable().optional(),revoked_at:E().nullable().optional(),deleted_at:E().nullable().optional(),service_access:F().int().nullable().optional(),service_access_granted_at:E().nullable().optional(),service_access_granted_by:F().int().nullable().optional(),upload_access_requested_at:E().nullable().optional(),upload_access_notified_at:E().nullable().optional(),identity_conflict:F().int().nullable().optional(),username_auto_assigned:F().int().nullable().optional(),sandbox_completed:F().int().nullable().optional(),sandbox_completed_at:E().nullable().optional(),sandbox_dataset_id:E().nullable().optional(),aws_iam_username:E().nullable().optional(),dataset_count:F().int().optional(),active_tokens:F().int().optional(),linked_identities:ae(E()).optional()}).passthrough(),RZ=Y({user:$Z}).passthrough(),rKe=Y({from:E().nullable(),to:E().nullable()}),DZ=Y({message:E(),changed:Ao(E(),rKe),notes:ae(E()).optional(),old_address_notified:Ge().optional(),user:$Z}).passthrough()});function iKe(e){return e.startsWith("v")?e:`v${e}`}var oKe,sKe,CZ,U5t;var UT=G(()=>{To();oKe=/^v?\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/,sKe=/^v\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/;CZ=E().regex(oKe,"must be a semver version, optionally v-prefixed").transform(iKe),U5t=E().regex(sKe,"must be the canonical v-prefixed tag (vX.Y.Z)")});function OZ(e,t){if(e.zarr_index_url!=null&&e.zarr_status!=="ready")t.addIssue({code:ee.custom,message:"zarr_index_url must be null/absent unless zarr_status is 'ready'",path:["zarr_index_url"]})}function TZ(e,t){if(e.zarr_verified_at!=null&&e.zarr_verify_status==null)t.addIssue({code:ee.custom,message:"zarr_verified_at must be null/absent unless zarr_verify_status is non-null",path:["zarr_verified_at"]})}var aKe="0.4.1",HT,lh,AZ,cKe,lKe,uKe,PZ,V5t,IZ,W5t,nl,dKe,pk,K5t,fKe,pKe,J5t;var zT=G(()=>{To();UT();HT=vt(["openneuro","nemar","gin","other"]),lh=ah([$t(0),$t(1)]).nullable(),AZ=Y({dataset_id:E(),id:E().optional(),name:E(),description:E().nullable().optional(),status:E(),visibility:E(),anonymous:F().int().nullable().optional(),concept_doi:E().nullable().optional(),doi:E().nullable().optional(),created_at:E(),updated_at:E().optional(),first_published_at:E().nullable().optional(),owner_username:E().nullable().optional(),source:E().nullable().optional(),modalities:E().optional(),participants:F().int().nonnegative(),tasks:E().optional(),authors:E().optional(),license:E().optional(),file_size:F().nonnegative(),file_size_formatted:E().optional(),total_files:F().nonnegative().nullable().optional(),num_citations:F().int().nonnegative().optional(),n_channels:F().int().nullable().optional(),electrode_system:E().nullable().optional(),has_hed:lh.optional(),hed_version:E().nullable().optional(),data_complete:lh.optional(),bytes_present:F().nonnegative().nullable().optional(),latest_version:CZ.nullable().optional(),latest_version_at:E().nullable().optional(),subject_count:F().int().nullable().optional(),file_size_bytes:F().nullable().optional(),sessions_count:F().int().nullable().optional(),age_min:F().nullable().optional(),age_max:F().nullable().optional(),bids_version:E().nullable().optional(),zarr_status:vt(["pending","ready","failed"]).nullable().optional(),zarr_store_count:F().int().nullable().optional(),zarr_converted_at:E().nullable().optional(),zarr_source_commit:E().nullable().optional(),zarr_errors:F().int().nullable().optional(),zarr_failure_count:F().int().nullable().optional(),zarr_deterministic:lh.optional(),zarr_failed_at:E().nullable().optional(),zarr_index_url:E().nullable().optional(),zarr_verify_status:vt(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:E().nullable().optional(),zarr_requeue_at:E().nullable().optional(),anonymity_status:vt(["verified","findings","unverifiable"]).nullable().optional(),anonymity_checked_at:E().nullable().optional(),anonymity_findings:E().nullable().optional(),anonymity_unchecked:E().nullable().optional(),total_recording_duration:F().nullable().optional(),recording_duration_min:F().nullable().optional(),recording_duration_max:F().nullable().optional(),recording_count:F().int().nullable().optional(),recordings_unavailable:F().int().nullable().optional(),channel_count_min:F().int().nullable().optional(),channel_count_max:F().int().nullable().optional(),sampling_frequency:F().nullable().optional(),power_line_frequency:F().nullable().optional(),eeg_reference:E().nullable().optional(),placement_scheme:E().nullable().optional()}).passthrough();cKe=AZ.superRefine((e,t)=>{OZ(e,t),TZ(e,t)}),lKe=AZ.extend({file_size:F().nonnegative().nullable(),file_size_formatted:E().nullable().optional(),modalities:E().nullable().optional(),tasks:E().nullable().optional(),authors:E().nullable().optional(),license:E().nullable().optional(),owner_github:E().nullable().optional(),attestation_deposit_type:vt(["owner","redistribution"]).nullable().optional(),attestation_key_status:vt(["destroyed","retained"]).nullable().optional(),attestation_deidentified:lh.optional(),attestation_no_duplicate:lh.optional(),attestation_upstream_source:E().nullable().optional(),attestation_accepted_at:E().nullable().optional(),zarr_data_failures:Y({count:F().int().nonnegative(),detail_ref:E(),compacted_by:E().optional(),pending:F().int().nonnegative().optional(),discovered:F().int().nonnegative().optional(),events_upload_failed:$t(!0).optional(),manifest_upload_failed:$t(!0).optional()}).passthrough().nullable().optional()}).passthrough().superRefine((e,t)=>{OZ(e,t),TZ(e,t)}),uKe=Y({id:E(),name:E(),modalities:E().nullable().optional(),participants:F().int().nullable().optional(),doi:E().nullable().optional(),tasks:E().nullable().optional(),authors:E().nullable().optional(),has_hed:lh.optional(),score:F().optional(),snippet:E().optional()}).passthrough(),PZ=Ao(E(),F().int().nonnegative()),V5t=Y({datasets:ae(cKe),count:F().int().nonnegative(),total_count:F().int().nonnegative().optional(),limit:F().int().optional(),offset:F().int().optional(),excluded_unknown:F().int().nonnegative().optional(),excluded_unknown_by_facet:PZ.optional()}).passthrough(),IZ=Y({results:ae(uKe),count:F().int().nonnegative(),returned:F().int().nonnegative().optional(),offset:F().int().nonnegative().optional(),limit:F().int().optional(),candidate_ceiling:F().int().optional(),truncated:Ge().optional(),method:vt(["exact_id","text","text_fallback","semantic","unavailable"]).optional(),min_score:F().optional(),reranked:$t(!0).optional(),corrected_query:E().optional(),modality_boost:ae(E()).optional(),warning:E().optional(),excluded_unknown:F().int().nonnegative().optional(),excluded_unknown_by_facet:PZ.optional()}).passthrough(),W5t=Y({dataset:lKe}).passthrough(),nl=Y({value:E(),count:F().int().nonnegative()}),dKe=Y({values:ae(nl),distinct_total:F().int().nonnegative(),truncated:Ge()}),pk=Y({"electrode-system":ae(nl).optional(),source:ae(nl).optional(),zarr:ae(nl).optional(),powerline:ae(nl).optional(),"bids-version":ae(nl).optional(),"hed-version":ae(nl).optional(),license:ae(nl).optional(),modality:ae(nl).optional(),task:dKe.optional(),warning:E().optional()}).passthrough(),K5t=Y({schema_version:$t(aKe),doc_type:$t("dataset"),dataset_id:E().regex(/^[a-z]{2}\d+$/,"neuroschema dataset_id pattern"),name:E(),source:HT,recording_modality:ae(E()).min(1),description:E().nullable().optional(),bids_version:E().nullable().optional(),license:E().nullable().optional()}).passthrough(),fKe=Y({tasks:Ao(Y({runs:ae(E())}).passthrough())}).passthrough(),pKe=Y({sessions:ae(E()),modalities:Ao(fKe),session_modalities:Ao(ae(E())).optional()}).passthrough(),J5t=Y({version:E(),subjects:Ao(pKe)}).passthrough()});function mk(e){return typeof e==="string"&&NZ.includes(e)}var mKe,Q5t,Z5t,e9t,NZ,hKe="ci_check_unavailable",FZ,MZ,jZ,LZ="X-Approval-Dispatch-Token",t9t;var tb=G(()=>{To();mKe=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,Q5t=E().regex(mKe,"ORCID must be in format 0000-0000-0000-000X"),Z5t=vt(["found","no_public_name","lookup_failed"]),e9t=vt(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing","identifier_screen_findings"]),NZ=["bids_validation_pending","bids_validation_in_progress"];FZ=[hKe],MZ=["identifier_screen_pending","identifier_screen_not_clear","identifier_screen_not_applicable"],jZ=["publication_review_not_clear","request_blocked","request_changed","request_mismatch","dispatch_superseded","dispatch_expired","decision_with_dispatch_token","approval_in_flight","deny_after_publishing","invalid_dataset_id","approval_closed_during_run"],t9t=vt(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});var gKe,qZ,nb="https://nemar.org/settings",o9t,yKe,bKe,wKe,BZ,UZ;var GT=G(()=>{To();gKe=vt(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),qZ=gKe.options,o9t={orcid_in_use:`That ORCID iD already belongs to a NEMAR account. Sign in to that account instead; if you want the iD on a different account, unlink it there first (Settings, ${nb}).`,orcid_already_linked:`That ORCID iD already belongs to a NEMAR account. Sign in to that account instead; if you want the iD on a different account, unlink it there first (Settings, ${nb}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${nb}), then link it here.`,email_in_use:`That email address already belongs to a NEMAR account. Sign in to that account instead, or change its address first (Settings, ${nb}).`,github_in_use:`That GitHub account is already linked to a NEMAR account. Sign in to that account instead, or change its GitHub username first (Settings, ${nb}).`,identity_conflict_remains:"The collision that flagged this account is still there. Resolve it on the other account first (change its email or GitHub username, or unlink its ORCID iD), or delete that account, then clear the flag."},yKe=vt(["orcid","email","github"]),bKe=Y({id:F().int(),username:E().nullable(),email:E(),created_at:E(),has_oauth_identity:Ge(),dataset_count:F().int(),identity_conflict:F().int(),canonical:Ge()}).passthrough(),wKe=Y({kind:yKe,value:E(),canonical_user_id:F().int(),accounts:ae(bKe)}).passthrough(),BZ=Y({groups:ae(wKe),group_count:F().int(),flagged_count:F().int()}).passthrough(),UZ=Y({ok:$t(!0),id:F().int(),cleared:Ge()}).passthrough()});var VT=120,HZ=64,WT="unnamed machine",_Ke=25,hk,zZ,uh,GZ,a9t,c9t,VZ,xKe,vKe,WZ,KT,KZ,l9t,u9t,gk,yk;var bk=G(()=>{To();hk=vt(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),zZ={authorization_pending:"Waiting for you to authorize this machine in the browser.",slow_down:"Polling too quickly; the CLI will slow down automatically.",expired_token:"The code expired. Run `nemar auth login` again for a new one.",access_denied:"This sign-in was declined in the browser. Run `nemar auth login` again if that was a mistake.",invalid_grant:"That code is no longer valid. Run `nemar auth login` again for a new one."},uh=vt(["device_code_unknown","device_code_expired","device_code_used","device_code_denied","account_pending","account_revoked","identity_conflict","service_account","person_account","too_many_keys","key_not_found"]),GZ=uh.options,a9t={device_code_unknown:"That code was not found. Check the code shown in your terminal, or run `nemar auth login` again for a new one.",device_code_expired:"The code expired. Run `nemar auth login` again for a new one.",device_code_used:"That code has already been used. Run `nemar auth login` again for a new one.",device_code_denied:"This sign-in was declined in the browser. Run `nemar auth login` again if that was a mistake.",account_pending:"Verify your email address first. Check your inbox for the NEMAR verification code, then authorize again.",account_revoked:"Your NEMAR account access has been revoked. Contact the NEMAR team if you think this is a mistake.",identity_conflict:"This account shares an identifier with another NEMAR account and cannot sign in until that is resolved. Fix it in Settings on nemar.org or contact the NEMAR team.",service_account:"This is a service or test account, and it cannot sign in this way. Ask an owner to create a key for it with `nemar admin keys create`.",person_account:"This account belongs to a person. A person creates their own keys with `nemar auth login` or in Settings on nemar.org.",too_many_keys:`This account already has ${_Ke} active keys. Revoke one in Settings on nemar.org or with \`nemar auth keys\`, then try again.`,key_not_found:"That key was not found on this account, or it is already revoked. Run `nemar auth keys` to see the active ones."},c9t=Y({error:uh,message:E()}).passthrough(),VZ=Y({device_code:E(),user_code:E(),verification_uri:E(),verification_uri_complete:E(),expires_in:F().int(),interval:F().int()}).passthrough(),xKe=PT("error",[Y({error:$t("authorization_pending"),message:E()}).passthrough(),Y({error:$t("slow_down"),message:E()}).passthrough()]),vKe=PT("error",[Y({error:$t("expired_token"),reason:uh,message:E()}).passthrough(),Y({error:$t("access_denied"),reason:uh,message:E()}).passthrough(),Y({error:$t("invalid_grant"),reason:uh,message:E()}).passthrough()]),WZ=ah([xKe,vKe]),KT=Y({id:F().int(),name:E().nullable(),prefix:E(),created_at:E(),last_used_at:E().nullable(),current:Ge()}).passthrough(),KZ=Y({api_key:E(),key:KT,user:Y({username:E().nullable(),email:E(),github_username:E().nullable(),role:E(),sandbox_completed:Ge(),sandbox_dataset_id:E().nullable()}).passthrough()}).passthrough(),l9t=Y({user_code:E(),machine_name:E(),requested_at:E(),expires_in:F().int(),account:Y({username:E().nullable(),email_masked:E()}).passthrough(),refusal:Y({code:uh,message:E()}).passthrough().nullable()}).passthrough(),u9t=Y({ok:$t(!0),machine_name:E()}).passthrough(),gk=Y({keys:ae(KT)}).passthrough(),yk=Y({api_key:E(),key:KT}).passthrough()});function cr(e){return qn[e]}function rl(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>Object.hasOwn(t,r)?t[r]:n)}var qn;var dh=G(()=>{qn={"tier.unverified.label":"Email not verified","tier.base.label":"Base access","tier.upload.label":"Upload access","tier.unverified.lede":"Verify your email address to activate your account.","upload_access.section.title":"Upload access","upload_access.section.lede":"A one-time admin grant. Reviewed against export-control and local-jurisdiction rules.","upload_access.state.granted":"Granted","upload_access.state.requested":"Requested","upload_access.state.not_requested":"Not requested","upload_access.invite.title":"Want to contribute a dataset?","upload_access.invite.body":"Browsing, searching and downloading are open to your account already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once. Your email address must be verified first.","upload_access.gate.title":"Ask for upload access first","upload_access.gate.body":"Your account can browse, search and download everything public already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant, and your email address must be verified first: an admin checks your GitHub handle and where you\u2019re based against export-control and local-jurisdiction rules. You ask once, and it is answered by email.","upload_access.request.cta":"Request upload access","upload_access.request.form_body":"Tell us what you plan to deposit, or which dataset you want to collaborate on. An admin reviews this alongside your name, username, GitHub handle and location, then grants access once.","upload_access.request.why_label":"What do you intend to upload?","upload_access.request.why_hint":"Describe what you intend to upload in 20-500 characters","upload_access.requested.title":"Your request is with an admin","upload_access.requested.lede":"An admin is reviewing your request.","upload_access.requested.lede_dated":"An admin is reviewing your request from {date}.","upload_access.requested.body.upload":"We\u2019ll email you when there\u2019s a decision, and this page will let you upload as soon as it\u2019s granted.","upload_access.requested.body":"We\u2019ll email you when there\u2019s a decision. Everything else on your account keeps working in the meantime.","upload_access.requested.cta":"See the request","upload_access.granted.body":"You can upload datasets from the upload page. Publishing one is a separate, per-dataset review you start from your dashboard.","upload_access.unverified.body":"Verify your email address first \u2014 the review happens over email.","upload_access.docs_link":"How upload access works","gap.sentence":"{label} is missing: needed {blocks}.","gap.set_on.both":"Set it in {web} or run `{cli}`.","gap.set_on.web":"Set it in {web}.","gap.blocks.verified":"to activate your account","gap.blocks.upload_access":"to request upload access","gap.blocks.publication":"to publish a dataset","gap.blocks.unknown":"to finish setting up your account","gap.blocks.noun.verified":"account activation","gap.blocks.noun.upload_access":"upload access","gap.blocks.noun.publication":"publication","gap.set_on.default_web":"Settings","gap.field.email_verified.label":"A verified email address","gap.field.username.label":"Username","gap.field.given_name.label":"Given name","gap.field.family_name.label":"Family name","gap.field.orcid_verified.label":"Verified ORCID iD","gap.field.github_username.label":"GitHub handle","gap.field.city.label":"City","gap.field.country.label":"Country","gap.field.why.label":"A description of what you intend to upload","gap.field.email_verified.set_on.web":"the verify step on your dashboard","gap.field.email_verified.set_on.cli":"nemar auth resend-verification","gap.field.username.set_on.web":"Settings","gap.field.username.set_on.cli":"nemar auth profile set-username","gap.field.given_name.set_on.web":"Settings","gap.field.given_name.set_on.cli":"nemar auth profile set-name","gap.field.family_name.set_on.web":"Settings","gap.field.family_name.set_on.cli":"nemar auth profile set-name","gap.field.given_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.family_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.orcid_verified.set_on.web":"Settings","gap.field.orcid_verified.set_on.cli":"nemar auth profile orcid link","gap.field.github_username.set_on.web":"Settings","gap.field.github_username.set_on.cli":"nemar auth profile set-github","gap.field.city.set_on.web":"Settings","gap.field.city.set_on.cli":"nemar auth profile set-location","gap.field.country.set_on.web":"Settings","gap.field.country.set_on.cli":"nemar auth profile set-location","gap.field.why.set_on.web":"the request form in Settings","gap.field.why.set_on.cli":"nemar auth request-upload-access","gaps.title":"What is still missing","gaps.none":"Nothing outstanding \u2014 every field NEMAR needs is filled in.","gaps.nudge.title":"Your profile isn\u2019t finished yet","gaps.nudge.cta":"Complete your profile","gaps.upload.title":"Before you can ask, your account still needs:","gaps.request.title":"Finish these first:","gaps.admin.title":"Still missing","gaps.admin.item":"{label} \u2014 blocks {blocks}","gaps.admin.none":"Nothing missing \u2014 every field the request needs is filled in.","gaps.admin.not_loaded":"Not loaded \u2014 open the user page to see what is still missing.","onboarding.username.auto_assigned.title":"We chose your username from your name","onboarding.username.auto_assigned.body":"Your account needed a username to be listed as a dataset owner, so one was made from your name when you signed in. You can change it once, here, until an admin grants you upload access.","welcome.unverified.title":"Verify your email address","welcome.unverified.body":"Authorizing with ORCID created your NEMAR account and signed you in. One step left: enter the 6-digit code we emailed you. That activates the account \u2014 no admin approval is involved.","welcome.active.title":"Your account is active","welcome.active.body":"Authorizing with ORCID created your NEMAR account and signed you in. There is no separate sign-up step and no approval queue: browse, search, and your dashboard all work right now.","welcome.upload_access.title":"Ask for upload access when you\u2019re ready to contribute","welcome.upload_access.body":"Reading is open to every verified account. Uploading and compute need one extra grant, because an admin has to check your GitHub handle and location against export-control and local-jurisdiction rules first. You ask once, from Settings.","cli.gaps.section.title":"Profile","cli.gaps.unknown":"not checked: run 'nemar auth status --refresh'","cli.gaps.unreported":"not reported by this backend","cli.gap.set_on.cli_only":"Run `{cli}`.","cli.gap.field.sandbox.label":"Sandbox training","cli.gap.blocks.sandbox":"to upload a dataset from the CLI","cli.gap.field.sandbox.set_on.cli":"nemar sandbox","cli.gaps.sandbox_unchecked":"Sandbox training could not be confirmed with the server. Run `nemar sandbox status --refresh`, then `nemar sandbox` if it is still outstanding.","cli.upload.preflight.title":"Upload access is not granted yet","cli.upload.preflight.body":"Browsing, searching and downloading are open to your account already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once. Your email address must be verified first.","cli.upload_access.cta":"Ask for it with `nemar auth request-upload-access`.","cli.upload.preflight.unchecked":"Upload access could not be checked ({reason}); continuing.","cli.upload.preflight.gaps_unknown":"Could not determine what is still missing; run `nemar auth profile` for the list.","cli.upload.preflight.dry_run":"Continuing anyway: --dry-run uploads nothing."}});function EKe(e){return e==="verified"||e==="upload_access"||e==="publication"}function fh(e){return(e??"").trim().length===0}function SKe(e){return e==="service"||e==="test"}function XZ(e,t={}){let n=t.orcidVerified===!0,r=Object.hasOwn(wk,e)?wk[e]:void 0;if(!r)return{field:e,label:e,blocks:t.blocks??[],setOnWeb:qn["gap.set_on.default_web"],setOnCli:null,known:!1};let o=n&&r.orcidWebKey!==void 0;return{field:e,blocks:t.blocks??r.blocks,label:qn[r.labelKey],setOnWeb:qn[o?r.orcidWebKey:r.webKey],setOnCli:o||r.cliKey===null?null:qn[r.cliKey],known:!0}}function JZ(e){let t=JT.indexOf(e);return t===-1?JT.length:t}function QZ(e,t={}){return e.map((n)=>XZ(n,{orcidVerified:t.orcidVerified}))}function _k(e,t={}){return e.filter((n)=>!!n&&typeof n.field==="string").map((n)=>{let r=Array.isArray(n.blocks)?n.blocks.filter(EKe):[];return XZ(n.field,{orcidVerified:t.orcidVerified,blocks:r.length>0?r:void 0})}).sort((n,r)=>JZ(n.field)-JZ(r.field))}function YT(e){let t=e.blocks[0],n=t?qn[kKe[t]]:qn["gap.blocks.unknown"],r=rl(qn["gap.sentence"],{label:"",blocks:n}).trimStart(),o=e.setOnCli?rl(qn["gap.set_on.both"],{web:e.setOnWeb,cli:e.setOnCli}):rl(qn["gap.set_on.web"],{web:e.setOnWeb});return`${r} ${o}`}function ZZ(e){return`${e.label} ${YT(e)}`}function xk(){let e=rl(qn["gap.sentence"],{label:YZ.label,blocks:qn["cli.gap.blocks.sandbox"]}),t=rl(qn["cli.gap.set_on.cli_only"],{cli:YZ.command});return`${e} ${t}`}function eee(){return qn["cli.gaps.sandbox_unchecked"]}var wk,JT,m9t,kKe,YZ;var ph=G(()=>{dh();wk={email_verified:{blocks:["verified","upload_access"],labelKey:"gap.field.email_verified.label",webKey:"gap.field.email_verified.set_on.web",cliKey:"gap.field.email_verified.set_on.cli",isMissing:(e)=>e.status==="pending"||e.email_verified===!1},username:{blocks:["upload_access"],labelKey:"gap.field.username.label",webKey:"gap.field.username.set_on.web",cliKey:"gap.field.username.set_on.cli",isMissing:(e)=>e.username!==void 0&&fh(e.username)},given_name:{blocks:["upload_access","publication"],labelKey:"gap.field.given_name.label",webKey:"gap.field.given_name.set_on.web",cliKey:"gap.field.given_name.set_on.cli",orcidWebKey:"gap.field.given_name.set_on.web.orcid",isMissing:(e)=>fh(e.given_name)},family_name:{blocks:["upload_access","publication"],labelKey:"gap.field.family_name.label",webKey:"gap.field.family_name.set_on.web",cliKey:"gap.field.family_name.set_on.cli",orcidWebKey:"gap.field.family_name.set_on.web.orcid",isMissing:(e)=>fh(e.family_name)},orcid_verified:{blocks:["upload_access"],labelKey:"gap.field.orcid_verified.label",webKey:"gap.field.orcid_verified.set_on.web",cliKey:"gap.field.orcid_verified.set_on.cli",isMissing:(e)=>e.orcid_verified!==!0&&!SKe(e.account_kind)},github_username:{blocks:["upload_access","publication"],labelKey:"gap.field.github_username.label",webKey:"gap.field.github_username.set_on.web",cliKey:"gap.field.github_username.set_on.cli",isMissing:(e)=>fh(e.github_username)},city:{blocks:["upload_access"],labelKey:"gap.field.city.label",webKey:"gap.field.city.set_on.web",cliKey:"gap.field.city.set_on.cli",isMissing:(e)=>fh(e.city)},country:{blocks:["upload_access"],labelKey:"gap.field.country.label",webKey:"gap.field.country.set_on.web",cliKey:"gap.field.country.set_on.cli",isMissing:(e)=>fh(e.country)},why:{blocks:["upload_access"],labelKey:"gap.field.why.label",webKey:"gap.field.why.set_on.web",cliKey:"gap.field.why.set_on.cli",isMissing:null}},JT=Object.keys(wk),m9t=JT.filter((e)=>wk[e].isMissing!==null),kKe={verified:"gap.blocks.verified",upload_access:"gap.blocks.upload_access",publication:"gap.blocks.publication"};YZ={field:"sandbox",label:qn["cli.gap.field.sandbox.label"],command:qn["cli.gap.field.sandbox.set_on.cli"]}});function Sk(e,t){let n=e.sss!==void 0;if(e.derived!==n)t.addIssue({code:ee.custom,path:["sss"],message:e.derived?"derived is true but sss is absent (ADR 0028: the two travel together)":"sss is present but derived is false (ADR 0028: the two travel together)"})}var Po,vk,tee,kk,$Ke,Ek,RKe,DKe,CKe,AKe,OKe,y9t,TKe,b9t,PKe,w9t;var XT=G(()=>{To();Po=/^[a-z]{2}[0-9]{6}$/,vk=/^[0-9a-f]{40}$/,tee=Y({name:E(),modality:E().nullable().optional(),rate:F().nullable().optional(),n_channels:F().int().nonnegative().nullable().optional(),n_samples:F().int().nonnegative().nullable().optional(),duration_s:F().nonnegative().nullable().optional(),source_rate_hz:F().nullable().optional(),n_view_levels:F().int().nonnegative().optional(),view_chunk_columns:F().int().positive().optional(),chunk_samples:F().int().positive().optional(),shard_samples:F().int().positive().optional()}).passthrough(),kk=Y({converted:F().int().nonnegative().optional(),relabelled:F().int().nonnegative().optional(),kept_importer_unit:F().int().nonnegative().optional(),units_column_present:Ge().optional(),sidecar:E().optional(),sidecar_supplied:Ge().optional(),unmatched_channels:F().int().nonnegative().optional(),unmatched_case_only:F().int().positive().optional(),matched_case_only:F().int().positive().optional(),matched_case_only_examples:ae(E()).max(5).optional(),unmatched_raw_label:F().int().positive().optional(),unmatched_examples:ae(E()).max(5).optional()}).passthrough(),$Ke=Y({channels_tsv:F().int().positive(),in_file:F().int().nonnegative(),in_store:F().int().nonnegative()}).passthrough(),Ek=Y({applied:Ge().optional(),method:E().optional(),calibration:E().optional(),cross_talk:E().optional(),mne_version:E().optional()}).passthrough();RKe=Y({path:E(),zarr:E().regex(/\.zarr$/,"must end in .zarr"),updated_utc:E().optional(),source_tree:$t("raw"),derived:Ge(),modalities:ae(E()).optional(),groups:ae(tee).optional(),power_line_frequency:F().nullable().optional(),event_description_count:F().int().nonnegative().optional(),n_events:F().int().nonnegative().optional(),trial_types:Ao(E(),F().int().nonnegative()).optional(),units_report:kk.optional(),channels_tsv_read_error:Ge().optional(),channels_tsv_count_mismatch:$Ke.optional(),split_members:ae(E()).optional(),sss:Ek.optional()}).passthrough().superRefine(Sk),DKe=Y({path:E(),zarr:E().regex(/\.zarr$/,"must end in .zarr").optional(),code:E(),reason:E(),detail:E().nullable().optional(),attempts:F().int().nonnegative().optional()}).passthrough(),CKe=vt(["infra_failure","memory_budget","not_attempted"]),AKe=Y({path:E(),zarr:E().regex(/\.zarr$/,"must end in .zarr"),reason:CKe,attempts:F().int().nonnegative(),last_error:E().nullable().optional(),last_attempt_utc:E().nullable().optional()}).passthrough(),OKe=Y({level0:$t("<zarr>/<group>/0"),view:$t("<zarr>/<group>/view/<L>"),view_levels:$t("1..n_view_levels from the group attrs"),scale_offset:$t("level-0 array attrs scale[] and offset[]; physical = digital * scale + offset"),events:$t("<data_base>events.parquet").optional()}).passthrough(),y9t=Y({format:$t("nemar-zarr-index"),format_version:$t(3),dataset_id:E().regex(Po,"NEMAR dataset id (nm/on/xx band)"),contract_base:E().regex(/^https:\/\//,"must be https"),data_base:E().regex(/^https:\/\//,"must be https"),data_base_kind:$t("s3-public"),s3_uri:E().regex(/^s3:\/\//,"must be an s3:// URI"),s3_region:E().min(1),s3_anonymous:Ge(),source_commit:E().regex(vk,"must be a full 40-hex SHA"),engine_version:E().min(1),biosigio_version:E().nullable().optional(),updated_utc:E(),discovered_count:F().int().nonnegative(),store_count:F().int().nonnegative(),n_recordings:F().int().nonnegative(),errors:F().int().nonnegative(),failure_count:F().int().nonnegative(),pending_count:F().int().nonnegative(),stores:ae(RKe),failures:ae(DKe),pending:ae(AKe),doi:E().nullable().optional(),license:E().nullable().optional(),citation:E().nullable().optional(),hed_version:E().nullable().optional(),events_parquet:E().regex(/^https:\/\//,"must be https").optional(),events_row_count:F().int().nonnegative().optional(),layout:OKe}).passthrough(),TKe=Y({name:E(),configuration:Ao(E(),Du()).optional()}).passthrough(),b9t=Y({zarr_format:$t(3),node_type:$t("array"),shape:ae(F().int().nonnegative()),data_type:E(),chunk_grid:Y({name:E(),configuration:Ao(E(),Du()).optional()}).passthrough(),codecs:ae(TKe),fill_value:Du().optional(),attributes:Ao(E(),Du()).optional(),dimension_names:ae(E().nullable()).optional()}).passthrough(),PKe=Y({path:E(),zarr:E().regex(/\.zarr$/,"must end in .zarr"),groups:ae(tee).optional(),modalities:ae(E()).optional()}).passthrough(),w9t=Y({format:$t("nemar-zarr-index"),format_version:F().int(),dataset_id:E().regex(Po,"NEMAR dataset id (nm/on/xx band)"),source_commit:E(),stores:ae(PKe)}).passthrough()});function nee(e){let t=e.unit?` (${e.unit})`:"";switch(e.valueKind){case"enum":return`${e.label} -- comma-separated, one or more of: ${(e.enumValues??[]).join(", ")}`;case"number":return`${e.label}${t} -- range (e.g. 10..50, 10.., ..50, or 10)`;case"bytes":return`${e.label}${t} -- range with optional units (e.g. 10gb..2tb, 500mb.., ..1gb; bare = bytes)`;case"duration":return`${e.label}${t} -- range with optional units (e.g. 30m..2h, 100h.., ..90s; bare = seconds)`;case"text":return`${e.label} -- substring match`;case"version":return`${e.label} -- exact or prefix match`}}var IKe,NKe,FKe,MKe,Ra,v9t;var $k=G(()=>{zT();IKe=["10-05","10-10","10-20","biosemi","egi-geodesic","other"],NKe=["50","60"],FKe=["ready","pending","failed"],MKe=HT.options,Ra=[{key:"subjects",flag:"--subjects",queryParam:"subjects",valueKind:"number",label:"Subject count",unit:"subjects"},{key:"channels",flag:"--channels",queryParam:"channels",valueKind:"number",label:"Channel count",unit:"channels"},{key:"sessions",flag:"--sessions",queryParam:"sessions",valueKind:"number",label:"Session count",unit:"sessions"},{key:"size",flag:"--size",queryParam:"size",valueKind:"bytes",label:"Dataset size"},{key:"files",flag:"--files",queryParam:"files",valueKind:"number",label:"File count",unit:"files"},{key:"citations",flag:"--citations",queryParam:"citations",valueKind:"number",label:"Citation count",unit:"citations"},{key:"duration",flag:"--duration",queryParam:"duration",valueKind:"duration",label:"Total recording duration"},{key:"recording-length",flag:"--recording-length",queryParam:"recording_length",valueKind:"duration",label:"Per-recording duration"},{key:"recordings",flag:"--recordings",queryParam:"recordings",valueKind:"number",label:"Recording count",unit:"recordings"},{key:"unavailable",flag:"--unavailable",queryParam:"unavailable",valueKind:"number",label:"Unavailable recording count",unit:"recordings"},{key:"age",flag:"--age",queryParam:"age",valueKind:"number",label:"Participant age",unit:"years"},{key:"rate",flag:"--rate",queryParam:"rate",valueKind:"number",label:"Sampling rate",unit:"Hz"},{key:"powerline",flag:"--powerline",queryParam:"powerline",valueKind:"enum",label:"Power line frequency",enumValues:NKe},{key:"reference",flag:"--reference",queryParam:"reference",valueKind:"text",label:"EEG reference"},{key:"placement",flag:"--placement",queryParam:"placement",valueKind:"text",label:"Electrode placement scheme"},{key:"electrode-system",flag:"--electrode-system",queryParam:"electrode_system",valueKind:"enum",label:"Electrode system",enumValues:IKe},{key:"source",flag:"--source",queryParam:"source",valueKind:"enum",label:"Source archive",enumValues:MKe},{key:"zarr",flag:"--zarr",queryParam:"zarr",valueKind:"enum",label:"Zarr conversion status",enumValues:FKe},{key:"bids-version",flag:"--bids-version",queryParam:"bids_version",valueKind:"version",label:"BIDS version"},{key:"hed-version",flag:"--hed-version",queryParam:"hed_version",valueKind:"version",label:"HED version"}],v9t=new Map(Ra.map((e)=>[e.key,e]))});var jKe,R9t,LKe,aee,rb,ree,qKe,cee,BKe=20,UKe=100,HKe,lee,zKe,D9t,C9t,GKe,A9t,O9t,VKe,WKe,KKe,T9t,JKe=50,YKe=500,P9t,XKe,QKe,I9t,ZKe=1000,eJe=5000,oee=8,tJe=100,nJe=32,see,N9t,rJe,oJe,sJe,F9t,iJe=800,aJe=4000,M9t,j9t,QT=60,ZT=64,iee,cJe=86400,lJe=4096,L9t,uJe,dJe,q9t;var uee=G(()=>{To();$k();XT();jKe=Y({dataset_id:E().regex(Po),name:E(),doi:E().nullable().optional(),license:E().nullable().optional(),modalities:ae(E()).optional(),tasks:ae(E()).optional(),subject_count:F().int().nonnegative().nullable().optional(),has_hed:ah([$t(0),$t(1)]).nullable().optional(),hed_version:E().nullable().optional(),store_count:F().int().nonnegative().nullable().optional(),recording_count:F().int().nonnegative().nullable().optional(),recordings_unavailable:F().int().nonnegative().nullable().optional(),total_recording_duration:F().nullable().optional(),zarr_converted_at:E().nullable().optional(),zarr_source_commit:E().nullable().optional(),zarr_errors:F().int().nonnegative().nullable().optional(),zarr_verify_status:vt(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:E().nullable().optional(),index_url:E().nullable().optional()}).passthrough(),R9t=Y({format:$t("nemar-zarr-catalog"),format_version:F().int(),generated_utc:E(),contract_base:E(),count:F().int().nonnegative(),datasets:ae(jKe)}).passthrough(),LKe=["verified","failed","unverifiable"],aee=vt(LKe).nullable(),rb=Y({dataset_id:E().regex(Po),doi:E().nullable(),license:E().nullable(),citation:E().nullable(),source_commit:E().regex(vk),index_etag:E().nullable(),engine_version:E(),source_tree:$t("raw"),derived:Ge(),sss:Ek.optional(),lossy:Ge(),dtype:E().nullable(),effective_rate_hz:F().nullable(),source_rate_hz:F().nullable(),units_report:kk.nullable().optional(),zarr_verify_status:aee,note:E().nullable().optional()}).passthrough().superRefine(Sk),ree=Y({start:F().int().nonnegative(),end:F().int().nonnegative()}).passthrough().refine((e)=>e.end>=e.start,{message:"end must be >= start",path:["end"]}),qKe=Y({python_zarr:E(),zarrita:E(),python_browser:E()}).passthrough(),cee=Y({contract_base:E(),data_base:E(),s3_uri:E(),s3_region:E(),s3_anonymous:Ge(),zarr:E(),group:E(),level:ah([$t("0"),F().int().positive()]),array_path:E(),dtype:E().nullable(),codecs:ae(Du()).optional(),chunk_samples:F().int().positive().nullable(),shard_samples:F().int().positive().nullable(),n_channels:F().int().nonnegative().nullable(),sample_slice:ree.optional(),channel_slice:ree.optional(),scale_offset:E(),how_to:qKe}).passthrough(),HKe=Object.fromEntries(Ra.map((e)=>[e.queryParam,E().optional()])),lee={modality:E().optional(),task:E().optional(),has_hed:Ge().optional(),has_zarr:Ge().optional(),author:E().optional(),has_doi:Ge().optional(),has_zarr_verified:Ge().optional(),data_complete:Ge().optional(),recent:F().int().positive().optional(),license:E().optional()},zKe=Object.keys(lee),D9t=[...zKe,...Ra.map((e)=>e.queryParam)],C9t=Y({query:E().optional(),...lee,include_unknown:Ge().optional(),...HKe,limit:F().int().positive().max(UKe).default(BKe)}).passthrough(),GKe=Y({dataset_id:E().regex(Po),name:E(),doi:E().nullable().optional(),license:E().nullable().optional(),modalities:ae(E()).optional(),tasks:ae(E()).optional(),subject_count:F().int().nullable().optional(),has_hed:Ge().nullable().optional(),has_zarr:Ge()}).passthrough(),A9t=Y({results:ae(GKe),count:F().int().nonnegative(),limit:F().int(),note:E().nullable().optional(),truncated:Ge().optional()}).passthrough(),O9t=Y({dataset_id:E().regex(Po)}).passthrough(),VKe=["list_recordings","get_events","render_overview","read_window"],WKe=Y({next_cheapest_tool:vt(VKe),reason:E()}).passthrough(),KKe=["pending","ready","failed"],T9t=Y({dataset_id:E().regex(Po),name:E(),doi:E().nullable(),license:E().nullable(),citation:E().nullable(),modalities:ae(E()).optional(),tasks:ae(E()).optional(),subject_count:F().int().nullable().optional(),has_hed:Ge().nullable().optional(),hed_version:E().nullable().optional(),recording_count:F().int().nullable().optional(),total_recording_duration_s:F().nullable().optional(),zarr_status:vt(KKe).nullable().optional(),zarr_verify_status:aee.optional(),zarr_source_commit:E().nullable().optional(),zarr_store_count:F().int().nullable().optional(),cost_hint:WKe}).passthrough(),P9t=Y({dataset_id:E().regex(Po),modality:E().optional(),min_duration_s:F().nonnegative().optional(),include_derived:Ge().default(!1),limit:F().int().positive().max(YKe).default(JKe),offset:F().int().nonnegative().default(0)}).passthrough(),XKe=Y({name:E(),modality:E().nullable().optional(),rate:F().nullable().optional(),n_channels:F().int().nullable().optional(),duration_s:F().nullable().optional(),n_view_levels:F().int().nonnegative().nullable().optional(),n_samples:F().int().nonnegative().nullable().optional(),view_chunk_columns:F().int().positive().nullable().optional()}).passthrough(),QKe=Y({path:E(),zarr:E(),source_tree:$t("raw"),derived:Ge(),groups:ae(XKe).optional(),n_events:F().int().nonnegative().optional(),sss:Ek.optional(),units_report:kk.optional()}).passthrough().superRefine(Sk),I9t=Y({dataset_id:E().regex(Po),source_commit:E().regex(vk).nullable(),recordings:ae(QKe),total_count:F().int().nonnegative(),excluded_derived_count:F().int().nonnegative(),limit:F().int(),offset:F().int(),index_format_version:F().int(),discovered_count:F().int().nonnegative().nullable(),failure_count:F().int().nonnegative().nullable(),pending_count:F().int().nonnegative().nullable(),excluded_legacy_non_raw_count:F().int().nonnegative(),note:E().nullable().optional(),envelope:rb.optional()}).passthrough(),see=E().min(1).max(64),N9t=Y({dataset_id:E().regex(Po),recording:E(),group:E().optional(),limit:F().int().positive().max(eJe).default(ZKe),offset:F().int().nonnegative().default(0),where:Ao(see,ae(ah([E(),F()])).min(1).max(tJe)).refine((e)=>{let t=Object.keys(e).length;return t>=1&&t<=oee},{message:`where names 1 to ${oee} columns`}).optional(),columns:ae(see).min(1).max(nJe).optional()}).passthrough(),rJe=Y({store_path:E(),group_name:E(),onset_s:F(),duration_s:F().nullable().optional(),sample_index:F().int().nonnegative(),trial_type:E().nullable().optional(),value:ah([E(),F()]).nullable().optional(),hed:E().nullable().optional()}).passthrough(),oJe=rJe.partial().required({onset_s:!0,sample_index:!0}),sJe=Y({name:E(),distinct_count:F().int().nonnegative(),null_count:F().int().nonnegative(),values:ae(Y({value:E(),count:F().int().positive()}).passthrough()).nullable()}).passthrough(),F9t=Y({dataset_id:E().regex(Po),recording:E(),events:ae(oJe),source:vt(["events_parquet","events_tsv_fallback"]),estimated:Ge(),total_count:F().int().nonnegative(),limit:F().int(),offset:F().int(),truncated:Ge(),note:E().nullable().optional(),columns_summary:ae(sJe).optional(),envelope:rb.optional()}).passthrough(),M9t=Y({dataset_id:E().regex(Po),recording:E(),group:E().optional(),width_px:F().int().positive().max(aJe).default(iJe)}).passthrough(),j9t=Y({dataset_id:E().regex(Po),recording:E(),group:E(),level:F().int().positive(),width_px:F().int().positive(),height_px:F().int().positive(),mime_type:$t("image/png"),columns_read:F().int().nonnegative(),chunks_read:F().int().nonnegative(),bytes_read:F().int().nonnegative(),envelope:rb.optional()}).passthrough(),iee=QT*ZT,L9t=Y({dataset_id:E().regex(Po),recording:E(),group:E().optional(),start_s:F().nonnegative().default(0),duration_s:F().positive().max(cJe).default(10),channels:ae(F().int().nonnegative()).max(lJe).optional(),taste:Ge().default(!1)}).passthrough().superRefine((e,t)=>{if(!e.taste)return;if(!e.channels||e.channels.length===0){t.addIssue({code:ee.custom,message:"taste requires channels: name the channel indices you want (list_recordings reports each group's n_channels), or omit taste for a recipe",path:["channels"]});return}if(e.duration_s>QT)t.addIssue({code:ee.custom,message:`taste duration_s (${e.duration_s}) exceeds the ${QT} s cap; omit taste for a recipe instead`,path:["duration_s"]});if(e.channels.length>ZT)t.addIssue({code:ee.custom,message:`taste channels (${e.channels.length}) exceeds the ${ZT}-channel cap; omit taste for a recipe instead`,path:["channels"]});let n=e.duration_s*e.channels.length;if(n>iee)t.addIssue({code:ee.custom,message:`taste exceeds the cap of ${iee} channel-seconds (duration_s x channels = ${n}); omit taste for a recipe instead`,path:["duration_s"]})}),uJe=Y({mode:$t("recipe"),recipe:cee,envelope:rb}).passthrough(),dJe=Y({mode:$t("taste"),start_s:F(),duration_s:F(),channels:ae(F().int()),sample_rate_hz:F(),values:ae(ae(F())),recipe:cee,chunks_read:F().int().nonnegative(),bytes_read:F().int().nonnegative(),filled_ranges:ae(Y({start_sample:F().int().nonnegative(),end_sample:F().int().nonnegative(),start_s:F(),end_s:F()}).passthrough()),note:E().nullable().optional(),envelope:rb}).passthrough(),q9t=PT("mode",[uJe,dJe])});function fee(e){let t=ob.indexOf(e);if(t<0)throw RangeError("not a launcher failure code");return fJe+t}var eP,ob,dee=0,fJe=10,pJe,mJe,H9t,z9t;var pee=G(()=>{eP=/^[a-z0-9_]{1,64}$/,ob=["code_fetch_failed","dataset_fetch_failed","entry_not_found","runtime_error","out_of_memory","time_limit","result_upload_failed"];pJe=["code_fetch_failed","dataset_fetch_failed","tapis_submit_failed","submit_timeout","staging_failed","launch_failed","archive_failed","tapis_error","result_verification_failed","records_unavailable","result_upload_failed"],mJe=["results_too_large","results_quota_exceeded","too_many_outputs"],H9t={code_fetch_failed:["unsafe_archive","archive_too_large","bad_response","fetch_failed","checksum_mismatch","digest_mismatch","size_mismatch","content_missing","disk_error"],dataset_fetch_failed:["bad_include","too_many_files","too_many_bytes","dataset_not_found","bad_manifest","manifest_too_large","unsafe_path","bad_response","fetch_failed","checksum_mismatch","size_mismatch","content_missing","file_not_found","disk_error"],entry_not_found:[],runtime_error:["entry_failed","terminated","outputs_unreadable","invalid_spec","unsupported_runtime","scratch_in_output","scratch_unavailable","no_container_runtime","image_missing","runtime_unusable","internal_error","output_dir_not_empty","bind_source_unsafe","pid_namespace_unavailable"],out_of_memory:[],time_limit:[],result_upload_failed:[...mJe,"outputs_unreadable","bad_response","fetch_failed","incomplete_plan","upload_failed","outputs_refused","complete_refused","internal_error"]},z9t=[...ob,...pJe.filter((e)=>!ob.includes(e))]});function SJe(e){return E().max(e).regex(gJe).refine((t)=>!yJe.test(t),{message:"a path may not hold . or .. segments"})}function oP(e){if(e!==null&&typeof e==="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))oP(t)}return e}function FJe(e){let t=0;while(t<e.length){if(e[t]!=="["){t++;continue}let n=e[t+1]==="!"?t+2:t+1,r=e.indexOf("]",n);if(r===-1)return null;if(r===n)return"empty_class";let o=Array.from(e.slice(n,r),(s)=>s.codePointAt(0));for(let s=0;s<o.length;)if(s+2<o.length&&o[s+1]===45){if(o[s]>o[s+2])return"inverted_range";s+=3}else s++;t=r+1}return null}function BJe(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=55296&&n<=56319){let r=e.charCodeAt(t+1);if(!(r>=56320&&r<=57343))return!1;t++}else if(n>=56320&&n<=57343)return!1}return!0}function UJe(e,t){let n=FJe(e);if(n!==null)t.addIssue({code:ee.custom,message:`an include pattern the dialect refuses: ${n}`})}function mh(e){let t=2;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r===34||r===92)t+=2;else if(r===8||r===9||r===10||r===12||r===13)t+=2;else if(r<32||r>=127)t+=6;else t+=1}return t}function VJe(e){let t=0;if(e.entry!==void 0)t+=mh(e.entry)+1;for(let n of e.command??[])t+=mh(n)+1;for(let n of e.args??[])t+=mh(n)+1;for(let n of e.datasets??[])for(let r of n.include??[])t+=mh(r)+1;for(let[n,r]of Object.entries(e.env??{}))if(r!==void 0)t+=mh(n)+mh(r)+2;return t}var nP="\\u0000-\\u001f\\u007f",hJe,mee,gJe,yJe,bJe,wJe,gee=1e5,_Je,xJe,vJe,yee,bee,kJe,EJe=(e,t=kJe)=>F().int().min(e).max(t),Dt,rP,Dk,wee,$Je,sP,RJe,Rk=2880,_ee,DJe,CJe,AJe,OJe,TJe="A path inside the bundle. With runtime python the launcher runs python /code/<entry> followed by args; with runtime image and an entry it runs /code/<entry> directly, followed by args, which needs the executable bit that the bundle packer must preserve. The runtime image must provide python on its PATH for the python runtime. A bundle archive's member names may carry a leading ./; absolute names, .. segments, links, devices and FIFOs are refused by the launcher.",PJe="An argument vector, run as given, with args appended.",IJe="Arguments, each as one argument: after python /code/<entry> (runtime python with an entry), after /code/<entry> (runtime image with an entry) or after the command.",NJe="Patterns that select the dataset's files, matched against manifest paths relative to the dataset root; every file when there are none. The dialect: **/ matches zero or more directories (so a/**/b matches a/b); ** elsewhere matches any run of characters including /; * and ? stay inside one path segment; [abc], [a-c] and [!abc] are character classes; an unterminated [ is a literal [; an empty class [] and an inverted range such as [z-a] are refused, and bad_include is exactly the set of patterns this dialect refuses; matching is case-sensitive; there are no escapes. A matcher MUST run in time linear in the pattern's length times the path's length (no backtracking).",MJe,jJe,LJe,qJe,Ck=(e)=>e.refine(BJe,{message:"a lone surrogate is not text a process argument can carry"}),HJe,zJe,GJe,WJe=49152,K9t,KJe,JJe,YJe,XJe,J9t,tP=1073741824,hee=1048576,Y9t,QJe,X9t,xee,Q9t,ZJe,Z9t;var vee=G(()=>{To();pee();hJe=`[^/\\\\${nP}]+`,mee=hJe,gJe=new RegExp(`^(?:${mee}/)*${mee}$`),yJe=/(?:^|\/)\.\.?(?:\/|$)/,bJe=new RegExp(`^[^\\\\${nP}]+$`),wJe=/^\/|(?:^|\/)\.\.(?:\/|$)/,_Je=/^job_[0-9a-f]{24}$/,xJe=/^[0-9a-f]{64}$/,vJe=/^sha256:[0-9a-f]{64}$/,yee=/^[a-z]{2}[0-9]{6}$/,bee=/^[0-9A-Za-z][0-9A-Za-z._+-]{0,63}$/,kJe=Number.MAX_SAFE_INTEGER,Dt=EJe,rP=E().regex(_Je),Dk=E().regex(xJe);wee=SJe,$Je=E().max(256).regex(bJe).refine((e)=>!wJe.test(e),{message:"a pattern may not leave the dataset"});sP=["shared","compute","debug","large-shared","preempt","gpu-shared","gpu","gpu-debug","gpu-preempt"],RJe=Y({maxNodes:Dt(1,64),maxCoresPerNode:Dt(0,256),maxGpusPerNode:Dt(0,8),maxMinutes:Dt(1,10080)}).strict(),_ee=oP({shared:{pool:"cpu",rate:"core_or_memory",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:64,maxGpusPerNode:0,maxMinutes:Rk}},compute:{pool:"cpu",rate:"whole_cpu_node",preempt:!1,ceiling:{maxNodes:2,maxCoresPerNode:128,maxGpusPerNode:0,maxMinutes:Rk}},debug:{pool:"cpu",rate:"core_or_memory",preempt:!1,ceiling:{maxNodes:2,maxCoresPerNode:128,maxGpusPerNode:0,maxMinutes:30}},"large-shared":{pool:"cpu",rate:"core_or_memory",preempt:!1,ceiling:null},preempt:{pool:"cpu",rate:"core_or_memory",preempt:!0,ceiling:null},"gpu-shared":{pool:"gpu",rate:"gpu_or_memory",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:40,maxGpusPerNode:3,maxMinutes:Rk}},gpu:{pool:"gpu",rate:"whole_gpu_node",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:40,maxGpusPerNode:4,maxMinutes:Rk}},"gpu-debug":{pool:"gpu",rate:"gpu_or_memory",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:40,maxGpusPerNode:4,maxMinutes:30}},"gpu-preempt":{pool:"gpu",rate:"gpu_or_memory",preempt:!0,ceiling:null}}),DJe=["OMP_NUM_THREADS","MKL_NUM_THREADS","OPENBLAS_NUM_THREADS","NUMEXPR_NUM_THREADS","PYTHONHASHSEED","MPLBACKEND"],CJe=/^[ -~]*$/,AJe=E().max(256).regex(CJe),OJe=Ao(vt(DJe),AJe);MJe=["python","matlab","image"],jJe=/^[A-Za-z0-9][A-Za-z0-9 ._-]{0,79}$/,LJe=/^[a-z][a-z0-9-]{0,63}$/,qJe=/^(?:docker:\/\/)?[a-z0-9]+(?:[._-][a-z0-9]+)*(?::[0-9]{1,5})?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)+@sha256:[0-9a-f]{64}$/;HJe=Y({size:Dt(1),sha256:Dk}).strict(),zJe=Y({id:E().regex(yee),version:E().regex(bee),include:ae(Ck($Je).superRefine(UJe)).max(64).optional().describe(NJe)}).strict(),GJe=Ck(E().max(1024));K9t=Y({name:E().regex(jJe),runtime:vt(MJe),entry:Ck(wee(240)).optional().describe(TJe),command:ae(Ck(E().min(1).max(1024))).min(1).max(64).optional().describe(PJe),args:ae(GJe).max(64).default([]).describe(IJe),bundle:HJe.optional(),datasets:ae(zJe).max(20).default([]),partition:vt(sP),nodes:Dt(1,64).default(1),cores:Dt(1,256).default(1),memory_mb:Dt(1,16777216).optional(),gpus:Dt(0,8).default(0),minutes:Dt(1,10080),output_dir:$t("outputs").default("outputs"),env:OJe.default({}),recipe:E().regex(LJe).optional(),image:E().max(512).regex(qJe).optional()}).strict().superRefine((e,t)=>{let n=(o,s)=>t.addIssue({code:ee.custom,path:[o],message:s});if(e.entry!==void 0&&e.command!==void 0)n("command","an entry and a command are one or the other");if(e.runtime==="image"&&e.image===void 0)n("image","an image job names a digest-pinned image");if(e.runtime!=="image"&&e.image!==void 0)n("image","only an image job names an image");if(e.recipe===void 0&&e.entry===void 0&&e.command===void 0)n("entry","a job with no recipe names an entry or a command");if(e.entry!==void 0&&e.bundle===void 0)n("bundle","an entry needs the bundle that holds it");if(VJe(e)>WJe)t.addIssue({code:ee.custom,path:[],message:"the entry, command, arguments, patterns and environment are too large to launch"});let r=_ee[e.partition].pool;if(r==="gpu"&&e.gpus<1)n("gpus","a GPU partition needs at least one GPU");if(r==="cpu"&&e.gpus!==0)n("gpus","a CPU partition takes no GPU")}),KJe=/^[A-Za-z0-9_.-]{1,64}$/,JJe=/^[a-z0-9]+(?:[.-][a-z0-9]+)*(?::[0-9]{1,5})?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)*$/,YJe=Object.fromEntries(sP.map((e)=>[e,RJe.optional()])),XJe=Y({maxOpenReservations:Dt(0,1e5),maxReservedMilliPerDay:Dt(0)}).strict(),J9t=Y({defaultGrantMilli:Y({cpu:Dt(0),gpu:Dt(0)}).strict(),renewal:Y({enabled:Ge(),everyDays:Dt(1,366).nullable()}).strict().refine((e)=>!e.enabled||e.everyDays!==null,{message:"renewal that is on says how often",path:["everyDays"]}),ceilings:Y(YJe).strict(),maxLiveJobsPerPerson:Dt(0,1000),pipelines:Y({dailyJobCap:Dt(0,1e5),maxLiveJobs:Y({cpu:Dt(0,1000),gpu:Dt(0,1000)}).strict()}).strict(),clients:Ao(E().regex(KJe),XJe),reservationWaitMinutes:Dt(1,1440),retention:Y({recordsYears:Dt(1,30),logsDays:Dt(1,3650),resultsDays:Dt(14,365)}).strict(),resultLimits:Y({maxJobBytes:Dt(1),maxFiles:Dt(1,gee),maxStoredBytesPerPerson:Dt(1),maxStoredBytesTotal:Dt(1)}).strict(),settle:Y({toleranceMilli:Dt(0),tolerancePercent:Dt(0,100)}).strict(),registries:ae(E().max(255).regex(JJe)).max(64),bundleLimits:Y({maxTotalBytes:Dt(1),maxFiles:Dt(1,1e5),maxFileBytes:Dt(1)}).strict()}).strict(),Y9t=oP({defaultGrantMilli:{cpu:0,gpu:0},renewal:{enabled:!1,everyDays:null},ceilings:Object.fromEntries(sP.flatMap((e)=>{let t=_ee[e].ceiling;return t?[[e,{...t}]]:[]})),maxLiveJobsPerPerson:4,pipelines:{dailyJobCap:50,maxLiveJobs:{cpu:8,gpu:4}},clients:{},reservationWaitMinutes:30,retention:{recordsYears:7,logsDays:365,resultsDays:30},resultLimits:{maxJobBytes:20*tP,maxFiles:5000,maxStoredBytesPerPerson:50*tP,maxStoredBytesTotal:1024*tP},settle:{toleranceMilli:1000,tolerancePercent:5},registries:[],bundleLimits:{maxTotalBytes:100*hee,maxFiles:2000,maxFileBytes:25*hee}}),QJe=Y({path:wee(512),size:Dt(0),sha256:Dk}).strict(),X9t=Y({job_id:rP,files:ae(QJe).max(gee)}).strict(),xee=F().int().min(-255).max(255).nullable(),Q9t=Y({job_id:rP,failure_code:vt(ob).nullable(),detail:E().regex(eP).nullable(),exit_number:F().int(),entry_exit_code:xee}).strict().superRefine((e,t)=>{let n=e.failure_code===null?dee:fee(e.failure_code);if(e.exit_number!==n)t.addIssue({code:ee.custom,path:["exit_number"],message:"the exit number is the one the failure code gives"})}),ZJe=Y({id:E().regex(yee),version:E().regex(bee),mode:vt(["bind","download"]),files:Dt(0),bytes:Dt(0)}).strict(),Z9t=Y({job_id:rP,launch_spec_digest:Dk,bundle_digest:Dk.nullable(),image:Y({uri:E().regex(/^[^\s]{1,512}$/),digest:E().regex(vJe)}).strict(),runtime_version:E().regex(new RegExp(`^[^${nP}]{1,128}$`)),staging:ae(ZJe).max(20),timings:Ao(E().regex(eP),F().finite().min(0)).refine((e)=>Object.keys(e).length<=16,{message:"at most 16 phases"}),slurm_job_id:E().regex(/^[0-9A-Za-z_+.-]{1,64}$/).nullable(),entry_exit_code:xee}).strict()});var hh=G(()=>{UT();ch();zT();tb();GT();bk();dh();ph();XT();uee();vee()});function Ar(e){return typeof e==="string"&&nYe.test(e)&&!e.includes("..")}function ol(e){return/^v\d/.test(e)?e.slice(1):e}function Or(e,t){return ol(e)===ol(t)}var nYe;var Mi=G(()=>{nYe=/^[0-9A-Za-z][0-9A-Za-z._-]{0,63}$/});function V(e){if(e instanceof Error)return e.message;return String(e)}function Ok(e){if(!(e instanceof L)||e.statusCode!==404)return!1;let t=e.rawBody;return typeof t==="object"&&t!==null&&t.error==="Not Found"&&typeof t.message==="string"}var L,Au;var Ve=G(()=>{L=class L extends Error{statusCode;details;step;blockReason;missing;code;reason;rawBody;constructor(e,t,n,r,o,s){super(t);this.statusCode=e;this.details=n;this.step=r;this.blockReason=o;this.missing=s;this.name="ApiError"}};Au=class Au extends L{mode;eta;constructor(e,t,n,r){super(503,t,r);this.mode=e;this.eta=n;this.name="MaintenanceError"}}});var rYe,oYe,sYe,w7t,See="override_publication_review",$ee="publication_review_not_clear",cP=2000;var Tk=G(()=>{rYe=["dispatched","redispatched","dispatch_claimed"],oYe=["review_disabled","not_applicable","not_owned_here","request_not_requested","screen_not_ready","running","has_result","platform_limit"],sYe=["dispatch_failed","dispatch_unconfigured"],w7t=[...rYe,...oYe,...sYe]});var Pk=1e4;function Ik(e){return e?aYe:Da}var Da,v7t,iYe,aYe,lP;var Nk=G(()=>{Da=["ci_check","enrichment_check","s3_public_read","repo_public","tag_protect","doi_create","update_metadata","update_readme","create_tag","create_release","upload_to_zenodo","publish_doi","version_doi","s3_lock","sync_nemar","notify_user"],v7t=Da.slice(0,Da.indexOf("s3_public_read")),iYe=["update_metadata","update_readme","upload_to_zenodo","publish_doi"],aYe=Da.filter((e)=>!iYe.includes(e));lP={ci_check:"Check CI",enrichment_check:"Enrichment check",s3_public_read:"S3 public read",repo_public:"Make catalog row public",tag_protect:"Tag protection",doi_create:"Create DOI",update_metadata:"Update metadata",update_readme:"Update README",create_tag:"Create version tag",create_release:"Create GitHub release",upload_to_zenodo:"Upload to Zenodo (no-op)",publish_doi:"Publish DOI (irreversible)",version_doi:"Version DOI + manifest",s3_lock:"S3 Object Lock",sync_nemar:"Sync NEMAR (no-op)",notify_user:"Notify user"}});function cYe(e){return`%${e.replace(/[\\%_]/g,"\\$&")}%`}function lYe(e){return new TextEncoder().encode(cYe(e)).length}function Ree(e){if(lYe(e)<=50)return null;return["search is too long: its match pattern may be at most 50 bytes,","which is about 48 plain characters (each of _ % \\ counts twice and a non-ASCII","character counts by its UTF-8 length)"].join(" ")}function Fk(e){return e.replace(/[A-Z]/g,(t)=>t.toLowerCase())}function Dee(e,t){if(e==="")return!0;let n=Fk(e);return t.some((r)=>typeof r==="string"&&Fk(r).includes(n))}function Cee(e,t){return Fk(e)===Fk(t)}function Mk(e){let t=[],n="",r="start",o=!1;for(let s of e)switch(s){case"\\":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(o)n+=s;r="property",o=!o;break}case".":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="property";break}if(o){o=!1,n+=s;break}if(uP.has(n))return[];t.push(n),n="",r="property";break}case"[":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="index";break}if(o){o=!1,n+=s;break}if(r==="property"){if(uP.has(n))return[];t.push(n),n=""}r="index";break}case"]":{if(r==="index"){t.push(Number.parseInt(n,10)),n="",r="indexEnd";break}if(r==="indexEnd")throw Error("Invalid character after an index")}default:{if(r==="index"&&!uYe.has(s))throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(r==="start")r="property";if(o)o=!1,n+="\\";n+=s}}if(o)n+="\\";switch(r){case"property":{if(uP.has(n))return[];t.push(n);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function dP(e,t){if(typeof t!=="number"&&Array.isArray(e)){let n=Number.parseInt(t,10);return Number.isInteger(n)&&e[n]===e[t]}return!1}function Aee(e,t){if(dP(e,t))throw Error("Cannot use string index")}function Oee(e,t,n){if(!Cf(e)||typeof t!=="string")return n===void 0?e:n;let r=Mk(t);if(r.length===0)return n;for(let o=0;o<r.length;o++){let s=r[o];if(dP(e,s))e=o===r.length-1?void 0:null;else e=e[s];if(e===void 0||e===null){if(o!==r.length-1)return n;break}}return e===void 0?n:e}function fP(e,t,n){if(!Cf(e)||typeof t!=="string")return e;let r=e,o=Mk(t);for(let s=0;s<o.length;s++){let i=o[s];if(Aee(e,i),s===o.length-1)e[i]=n;else if(!Cf(e[i]))e[i]=typeof o[s+1]==="number"?[]:{};e=e[i]}return r}function Tee(e,t){if(!Cf(e)||typeof t!=="string")return!1;let n=Mk(t);for(let r=0;r<n.length;r++){let o=n[r];if(Aee(e,o),r===n.length-1)return delete e[o],!0;if(e=e[o],!Cf(e))return!1}}function Pee(e,t){if(!Cf(e)||typeof t!=="string")return!1;let n=Mk(t);if(n.length===0)return!1;for(let r of n){if(!Cf(e)||!(r in e)||dP(e,r))return!1;e=e[r]}return!0}var Cf=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},uP,uYe;var Iee=G(()=>{uP=new Set(["__proto__","prototype","constructor"]),uYe=new Set("0123456789")});import Tn from"path";import Nee from"os";import pP from"process";function hP(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(pP.platform==="darwin")return dYe(e);if(pP.platform==="win32")return fYe(e);return pYe(e)}var Ou,mP,yh,dYe=(e)=>{let t=Tn.join(Ou,"Library");return{data:Tn.join(t,"Application Support",e),config:Tn.join(t,"Preferences",e),cache:Tn.join(t,"Caches",e),log:Tn.join(t,"Logs",e),temp:Tn.join(mP,e)}},fYe=(e)=>{let t=yh.APPDATA||Tn.join(Ou,"AppData","Roaming"),n=yh.LOCALAPPDATA||Tn.join(Ou,"AppData","Local");return{data:Tn.join(n,e,"Data"),config:Tn.join(t,e,"Config"),cache:Tn.join(n,e,"Cache"),log:Tn.join(n,e,"Log"),temp:Tn.join(mP,e)}},pYe=(e)=>{let t=Tn.basename(Ou);return{data:Tn.join(yh.XDG_DATA_HOME||Tn.join(Ou,".local","share"),e),config:Tn.join(yh.XDG_CONFIG_HOME||Tn.join(Ou,".config"),e),cache:Tn.join(yh.XDG_CACHE_HOME||Tn.join(Ou,".cache"),e),log:Tn.join(yh.XDG_STATE_HOME||Tn.join(Ou,".local","state"),e),temp:Tn.join(mP,t,e)}};var Fee=G(()=>{Ou=Nee.homedir(),mP=Nee.tmpdir(),{env:yh}=pP});var mYe=(e,t)=>{let{onError:n}=t;return function(...o){return e.apply(void 0,o).catch(n)}},Ca;var Mee=G(()=>{Ca=mYe});var hYe=(e,t)=>{let{onError:n}=t;return function(...o){try{return e.apply(void 0,o)}catch(s){return n(s)}}},ji;var jee=G(()=>{ji=hYe});var Lee=250;var qee=()=>{};var gYe=(e,t)=>{let{isRetriable:n}=t;return function(o){let{timeout:s}=o,i=o.interval??Lee,a=Date.now()+s;return function c(...l){return e.apply(void 0,l).catch((d)=>{if(!n(d))throw d;if(Date.now()>=a)throw d;let f=Math.round(i*Math.random());if(f>0)return new Promise((m)=>setTimeout(m,f)).then(()=>c.apply(void 0,l));else return c.apply(void 0,l)})}}},Aa;var Bee=G(()=>{qee();Aa=gYe});var yYe=(e,t)=>{let{isRetriable:n}=t;return function(o){let{timeout:s}=o,i=Date.now()+s;return function(...c){while(!0)try{return e.apply(void 0,c)}catch(l){if(!n(l))throw l;if(Date.now()>=i)throw l;continue}}}},Oa;var Uee=G(()=>{Oa=yYe});var gP=G(()=>{Mee();jee();Bee();Uee()});var sb,yP;var Hee=G(()=>{bP();sb={isChangeErrorOk:(e)=>{if(!sb.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!zee&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!sb.isNodeError(e))return!1;let{code:t}=e;if(t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM")return!0;return!1},onChangeError:(e)=>{if(!sb.isNodeError(e))throw e;if(sb.isChangeErrorOk(e))return;throw e}},yP=sb});import Gee from"process";var ib,os,zee,Xr;var bP=G(()=>{Hee();ib={onError:yP.onChangeError},os={onError:()=>{return}},zee=Gee.getuid?!Gee.getuid():!1,Xr={isRetriable:yP.isRetriableError}});import It from"fs";import{promisify as mo}from"util";var bYe,Tr;var wP=G(()=>{gP();gP();bP();bYe={attempt:{chmod:Ca(mo(It.chmod),ib),chown:Ca(mo(It.chown),ib),close:Ca(mo(It.close),os),fsync:Ca(mo(It.fsync),os),mkdir:Ca(mo(It.mkdir),os),realpath:Ca(mo(It.realpath),os),stat:Ca(mo(It.stat),os),unlink:Ca(mo(It.unlink),os),chmodSync:ji(It.chmodSync,ib),chownSync:ji(It.chownSync,ib),closeSync:ji(It.closeSync,os),existsSync:ji(It.existsSync,os),fsyncSync:ji(It.fsync,os),mkdirSync:ji(It.mkdirSync,os),realpathSync:ji(It.realpathSync,os),statSync:ji(It.statSync,os),unlinkSync:ji(It.unlinkSync,os)},retry:{close:Aa(mo(It.close),Xr),fsync:Aa(mo(It.fsync),Xr),open:Aa(mo(It.open),Xr),readFile:Aa(mo(It.readFile),Xr),rename:Aa(mo(It.rename),Xr),stat:Aa(mo(It.stat),Xr),write:Aa(mo(It.write),Xr),writeFile:Aa(mo(It.writeFile),Xr),closeSync:Oa(It.closeSync,Xr),fsyncSync:Oa(It.fsyncSync,Xr),openSync:Oa(It.openSync,Xr),readFileSync:Oa(It.readFileSync,Xr),renameSync:Oa(It.renameSync,Xr),statSync:Oa(It.statSync,Xr),writeSync:Oa(It.writeSync,Xr),writeFileSync:Oa(It.writeFileSync,Xr)}},Tr=bYe});import Af from"process";var Vee="utf8",_P=438,Wee=511,Kee,Jee,Yee,Xee=1000,Qee,Z7t,xP=128;var vP=G(()=>{Kee={},Jee=Af.geteuid?Af.geteuid():-1,Yee=Af.getegid?Af.getegid():-1,Qee=!!Af.getuid,Z7t=Af.getuid?!Af.getuid():!1});var Zee=(e)=>e instanceof Error&&("code"in e),kP=(e)=>typeof e==="string",jk=(e)=>e===void 0;var ete=()=>{};var tte=()=>{};import nte from"process";var rte,Lk;var EP=G(()=>{rte=nte.platform==="linux",Lk=nte.platform==="win32"});var SP,ote;var ste=G(()=>{EP();SP=["SIGHUP","SIGINT","SIGTERM"];if(!Lk)SP.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(rte)SP.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");ote=SP});import bh from"process";class ite{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(e)=>{if(this.exited)return;this.exited=!0;for(let t of this.callbacks)t();if(e)if(Lk&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))bh.kill(bh.pid,"SIGTERM");else bh.kill(bh.pid,e)},this.hook=()=>{bh.once("exit",()=>this.exit());for(let e of ote)try{bh.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var ate;var cte=G(()=>{EP();ste();ate=new ite});var wYe,lte;var ute=G(()=>{cte();wYe=ate.register,lte=wYe});import _Ye from"path";var Ds,ab;var dte=G(()=>{wP();ute();vP();Ds={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),n=Date.now().toString().slice(-10),r="tmp-",o=`.tmp-${n}${t}`;return`${e}${o}`},get:(e,t,n=!0)=>{let r=Ds.truncate(t(e));if(r in Ds.store)return Ds.get(e,t,n);return Ds.store[r]=n,[r,()=>delete Ds.store[r]]},purge:(e)=>{if(!Ds.store[e])return;delete Ds.store[e],Tr.attempt.unlink(e)},purgeSync:(e)=>{if(!Ds.store[e])return;delete Ds.store[e],Tr.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in Ds.store)Ds.purgeSync(e)},truncate:(e)=>{let t=_Ye.basename(e);if(t.length<=xP)return e;let n=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!n)return e;let r=t.length-xP;return`${e.slice(0,-t.length)}${n[1]}${n[2].slice(0,-r)}${n[3]}`}};lte(Ds.purgeSyncAll);ab=Ds});import xYe from"path";function $P(e,t,n=Kee){if(kP(n))return $P(e,t,{encoding:n});let o={timeout:n.timeout??Xee},s=null,i=null,a=null;try{let c=Tr.attempt.realpathSync(e),l=!!c;e=c||e,[i,s]=ab.get(e,n.tmpCreate||ab.create,n.tmpPurge!==!1);let d=Qee&&jk(n.chown),f=jk(n.mode);if(l&&(d||f)){let p=Tr.attempt.statSync(e);if(p){if(n={...n},d)n.chown={uid:p.uid,gid:p.gid};if(f)n.mode=p.mode}}if(!l){let p=xYe.dirname(e);Tr.attempt.mkdirSync(p,{mode:Wee,recursive:!0})}if(a=Tr.retry.openSync(o)(i,"w",n.mode||_P),n.tmpCreated)n.tmpCreated(i);if(kP(t))Tr.retry.writeSync(o)(a,t,0,n.encoding||Vee);else if(!jk(t))Tr.retry.writeSync(o)(a,t,0,t.length,0);if(n.fsync!==!1)if(n.fsyncWait!==!1)Tr.retry.fsyncSync(o)(a);else Tr.attempt.fsync(a);if(Tr.retry.closeSync(o)(a),a=null,n.chown&&(n.chown.uid!==Jee||n.chown.gid!==Yee))Tr.attempt.chownSync(i,n.chown.uid,n.chown.gid);if(n.mode&&n.mode!==_P)Tr.attempt.chmodSync(i,n.mode);try{Tr.retry.renameSync(o)(i,e)}catch(p){if(!Zee(p))throw p;if(p.code!=="ENAMETOOLONG")throw p;Tr.retry.renameSync(o)(i,ab.truncate(e))}s(),i=null}finally{if(a)Tr.attempt.closeSync(a);if(i)ab.purge(i)}}var fte=G(()=>{wP();vP();ete();tte();dte()});var lb=w(function(hte){Object.defineProperty(hte,"__esModule",{value:!0});hte.regexpCode=hte.getEsmExportName=hte.getProperty=hte.safeStringify=hte.stringify=hte.strConcat=hte.addCodeArg=hte.str=hte._=hte.nil=hte._Code=hte.Name=hte.IDENTIFIER=hte._CodeOrName=void 0;class qk{}hte._CodeOrName=qk;hte.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class wh extends qk{constructor(e){super();if(!hte.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}hte.Name=wh;class Li extends qk{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,n)=>`${t}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,n)=>{if(n instanceof wh)t[n.str]=(t[n.str]||0)+1;return t},{})}}hte._Code=Li;hte.nil=new Li("");function pte(e,...t){let n=[e[0]],r=0;while(r<t.length)DP(n,t[r]),n.push(e[++r]);return new Li(n)}hte._=pte;var RP=new Li("+");function mte(e,...t){let n=[cb(e[0])],r=0;while(r<t.length)n.push(RP),DP(n,t[r]),n.push(RP,cb(e[++r]));return vYe(n),new Li(n)}hte.str=mte;function DP(e,t){if(t instanceof Li)e.push(...t._items);else if(t instanceof wh)e.push(t);else e.push(SYe(t))}hte.addCodeArg=DP;function vYe(e){let t=1;while(t<e.length-1){if(e[t]===RP){let n=kYe(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}function kYe(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof wh||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof wh))return`"${e}${t.slice(1)}`;return}function EYe(e,t){return t.emptyStr()?e:e.emptyStr()?t:mte`${e}${t}`}hte.strConcat=EYe;function SYe(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:cb(Array.isArray(e)?e.join(","):e)}function $Ye(e){return new Li(cb(e))}hte.stringify=$Ye;function cb(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}hte.safeStringify=cb;function RYe(e){return typeof e=="string"&&hte.IDENTIFIER.test(e)?new Li(`.${e}`):pte`[${e}]`}hte.getProperty=RYe;function DYe(e){if(typeof e=="string"&&hte.IDENTIFIER.test(e))return new Li(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}hte.getEsmExportName=DYe;function CYe(e){return new Li(e.toString())}hte.regexpCode=CYe});var TP=w(function(wte){Object.defineProperty(wte,"__esModule",{value:!0});wte.ValueScope=wte.ValueScopeName=wte.Scope=wte.varKinds=wte.UsedValueState=void 0;var nn=lb();class yte extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Uk;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Uk||(wte.UsedValueState=Uk={}));wte.varKinds={const:new nn.Name("const"),let:new nn.Name("let"),var:new nn.Name("var")};class AP{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof nn.Name?e:this.name(e)}name(e){return new nn.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,n;if(((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}wte.Scope=AP;class OP extends nn.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=nn._`.${new nn.Name(t)}[${n}]`}}wte.ValueScopeName=OP;var UYe=nn._`\n`;class bte extends AP{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?UYe:nn.nil}}get(){return this._scope}name(e){return new OP(e,this._newName(e))}value(e,t){var n;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let r=this.toName(e),{prefix:o}=r,s=(n=t.key)!==null&&n!==void 0?n:t.ref,i=this._values[o];if(i){let l=i.get(s);if(l)return l}else i=this._values[o]=new Map;i.set(s,r);let a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,r.setValue(t,{property:o,itemIndex:c}),r}getValue(e,t){let n=this._values[e];if(!n)return;return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(n)=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return nn._`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,(r)=>{if(r.value===void 0)throw Error(`CodeGen: name "${r}" has no value`);return r.value.code},t,n)}_reduceValues(e,t,n={},r){let o=nn.nil;for(let s in e){let i=e[s];if(!i)continue;let a=n[s]=n[s]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,Uk.Started);let l=t(c);if(l){let d=this.opts.es5?wte.varKinds.var:wte.varKinds.const;o=nn._`${o}${d} ${c} = ${l};${this.opts._n}`}else if(l=r===null||r===void 0?void 0:r(c))o=nn._`${o}${l}${this.opts._n}`;else throw new yte(c);a.set(c,Uk.Completed)})}return o}}wte.ValueScope=bte});var lt=w(function(ss){Object.defineProperty(ss,"__esModule",{value:!0});ss.or=ss.and=ss.not=ss.CodeGen=ss.operators=ss.varKinds=ss.ValueScopeName=ss.ValueScope=ss.Scope=ss.Name=ss.regexpCode=ss.stringify=ss.getProperty=ss.nil=ss.strConcat=ss.str=ss._=void 0;var me=lb(),Bn=TP(),Tu=lb();Object.defineProperty(ss,"_",{enumerable:!0,get:function(){return Tu._}});Object.defineProperty(ss,"str",{enumerable:!0,get:function(){return Tu.str}});Object.defineProperty(ss,"strConcat",{enumerable:!0,get:function(){return Tu.strConcat}});Object.defineProperty(ss,"nil",{enumerable:!0,get:function(){return Tu.nil}});Object.defineProperty(ss,"getProperty",{enumerable:!0,get:function(){return Tu.getProperty}});Object.defineProperty(ss,"stringify",{enumerable:!0,get:function(){return Tu.stringify}});Object.defineProperty(ss,"regexpCode",{enumerable:!0,get:function(){return Tu.regexpCode}});Object.defineProperty(ss,"Name",{enumerable:!0,get:function(){return Tu.Name}});var Kk=TP();Object.defineProperty(ss,"Scope",{enumerable:!0,get:function(){return Kk.Scope}});Object.defineProperty(ss,"ValueScope",{enumerable:!0,get:function(){return Kk.ValueScope}});Object.defineProperty(ss,"ValueScopeName",{enumerable:!0,get:function(){return Kk.ValueScopeName}});Object.defineProperty(ss,"varKinds",{enumerable:!0,get:function(){return Kk.varKinds}});ss.operators={GT:new me._Code(">"),GTE:new me._Code(">="),LT:new me._Code("<"),LTE:new me._Code("<="),EQ:new me._Code("==="),NEQ:new me._Code("!=="),NOT:new me._Code("!"),OR:new me._Code("||"),AND:new me._Code("&&"),ADD:new me._Code("+")};class Pu{optimizeNodes(){return this}optimizeNames(e,t){return this}}class xte extends Pu{constructor(e,t,n){super();this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?Bn.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=xh(this.rhs,e,t);return this}get names(){return this.rhs instanceof me._CodeOrName?this.rhs.names:{}}}class NP extends Pu{constructor(e,t,n){super();this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof me.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=xh(this.rhs,e,t),this}get names(){let e=this.lhs instanceof me.Name?{}:{...this.lhs.names};return Wk(e,this.rhs)}}class vte extends NP{constructor(e,t,n,r){super(e,n,r);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class kte extends Pu{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Ete extends Pu{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Ste extends Pu{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class $te extends Pu{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=xh(this.code,e,t),this}get names(){return this.code instanceof me._CodeOrName?this.code.names:{}}}class Jk extends Pu{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let n=e[t].optimizeNodes();if(Array.isArray(n))e.splice(t,1,...n);else if(n)e[t]=n;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;while(r--){let o=n[r];if(o.optimizeNames(e,t))continue;VYe(e,o.names),n.splice(r,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Of(e,t.names),{})}}class Iu extends Jk{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Rte extends Jk{}class ub extends Iu{}ub.kind="else";class sl extends Iu{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let n=t.optimizeNodes();t=this.else=Array.isArray(n)?new ub(n):n}if(t){if(e===!1)return t instanceof sl?t:t.nodes;if(this.nodes.length)return this;return new sl(Tte(e),t instanceof sl?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=xh(this.condition,e,t),this}get names(){let e=super.names;if(Wk(e,this.condition),this.else)Of(e,this.else.names);return e}}sl.kind="if";class _h extends Iu{}_h.kind="for";class Dte extends _h{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=xh(this.iteration,e,t),this}get names(){return Of(super.names,this.iteration.names)}}class Cte extends _h{constructor(e,t,n,r){super();this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?Bn.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${t} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=Wk(super.names,this.from);return Wk(e,this.to)}}class PP extends _h{constructor(e,t,n,r){super();this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=xh(this.iterable,e,t),this}get names(){return Of(super.names,this.iterable.names)}}class Hk extends Iu{constructor(e,t,n){super();this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}Hk.kind="func";class zk extends Jk{render(e){return"return "+super.render(e)}}zk.kind="return";class Ate extends Iu{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)===null||n===void 0||n.optimizeNames(e,t),(r=this.finally)===null||r===void 0||r.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)Of(e,this.catch.names);if(this.finally)Of(e,this.finally.names);return e}}class Gk extends Iu{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Gk.kind="catch";class Vk extends Iu{render(e){return"finally"+super.render(e)}}Vk.kind="finally";class Ote{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
84
|
+
`;return this.stop(),this.#s.write(l),this}}function R(e){return new sZ(e)}var j0,xWe;var fo=G(()=>{He();zQ();VQ();_T();eZ();nZ();oZ();j0=et(Jx(),1),xWe=et(Jx(),1)});var St,cZ,pe,Xc=(e)=>{switch(typeof e){case"undefined":return pe.undefined;case"string":return pe.string;case"number":return Number.isNaN(e)?pe.nan:pe.number;case"boolean":return pe.boolean;case"function":return pe.function;case"bigint":return pe.bigint;case"symbol":return pe.symbol;case"object":if(Array.isArray(e))return pe.array;if(e===null)return pe.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return pe.promise;if(typeof Map<"u"&&e instanceof Map)return pe.map;if(typeof Set<"u"&&e instanceof Set)return pe.set;if(typeof Date<"u"&&e instanceof Date)return pe.date;return pe.object;default:return pe.unknown}};var L0=G(()=>{(function(e){e.assertEqual=(o)=>{};function t(o){}e.assertIs=t;function n(o){throw Error()}e.assertNever=n,e.arrayToEnum=(o)=>{let s={};for(let i of o)s[i]=i;return s},e.getValidEnumValues=(o)=>{let s=e.objectKeys(o).filter((a)=>typeof o[o[a]]!=="number"),i={};for(let a of s)i[a]=o[a];return e.objectValues(i)},e.objectValues=(o)=>e.objectKeys(o).map(function(s){return o[s]}),e.objectKeys=typeof Object.keys==="function"?(o)=>Object.keys(o):(o)=>{let s=[];for(let i in o)if(Object.prototype.hasOwnProperty.call(o,i))s.push(i);return s},e.find=(o,s)=>{for(let i of o)if(s(i))return i;return},e.isInteger=typeof Number.isInteger==="function"?(o)=>Number.isInteger(o):(o)=>typeof o==="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map((i)=>typeof i==="string"?`'${i}'`:i).join(s)}e.joinValues=r,e.jsonStringifyReplacer=(o,s)=>{if(typeof s==="bigint")return s.toString();return s}})(St||(St={}));(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(cZ||(cZ={}));pe=St.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var ee,Rs;var tk=G(()=>{L0();ee=St.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);Rs=class Rs extends Error{get errors(){return this.issues}constructor(e){super();this.issues=[],this.addIssue=(n)=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let t=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,t);else this.__proto__=t;this.name="ZodError",this.issues=e}format(e){let t=e||function(o){return o.message},n={_errors:[]},r=(o)=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(r);else if(s.code==="invalid_return_type")r(s.returnTypeError);else if(s.code==="invalid_arguments")r(s.argumentsError);else if(s.path.length===0)n._errors.push(t(s));else{let i=n,a=0;while(a<s.path.length){let c=s.path[a];if(a!==s.path.length-1)i[c]=i[c]||{_errors:[]};else i[c]=i[c]||{_errors:[]},i[c]._errors.push(t(s));i=i[c],a++}}};return r(this),n}static assert(e){if(!(e instanceof Rs))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,St.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=(t)=>t.message){let t={},n=[];for(let r of this.issues)if(r.path.length>0){let o=r.path[0];t[o]=t[o]||[],t[o].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};Rs.create=(e)=>new Rs(e)});var vWe=(e,t)=>{let n;switch(e.code){case ee.invalid_type:if(e.received===pe.undefined)n="Required";else n=`Expected ${e.expected}, received ${e.received}`;break;case ee.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,St.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${St.joinValues(e.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${St.joinValues(e.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${St.joinValues(e.options)}, received '${e.received}'`;break;case ee.invalid_arguments:n="Invalid function arguments";break;case ee.invalid_return_type:n="Invalid function return type";break;case ee.invalid_date:n="Invalid date";break;case ee.invalid_string:if(typeof e.validation==="object")if("includes"in e.validation){if(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==="number")n=`${n} at one or more positions greater than or equal to ${e.validation.position}`}else if("startsWith"in e.validation)n=`Invalid input: must start with "${e.validation.startsWith}"`;else if("endsWith"in e.validation)n=`Invalid input: must end with "${e.validation.endsWith}"`;else St.assertNever(e.validation);else if(e.validation!=="regex")n=`Invalid ${e.validation}`;else n="Invalid";break;case ee.too_small:if(e.type==="array")n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`;else if(e.type==="string")n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`;else if(e.type==="number")n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="bigint")n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`;else if(e.type==="date")n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`;else n="Invalid input";break;case ee.too_big:if(e.type==="array")n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`;else if(e.type==="string")n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`;else if(e.type==="number")n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="bigint")n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`;else if(e.type==="date")n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`;else n="Invalid input";break;case ee.custom:n="Invalid input";break;case ee.invalid_intersection_types:n="Intersection results could not be merged";break;case ee.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ee.not_finite:n="Number must be finite";break;default:n=t.defaultError,St.assertNever(e)}return{message:n}},$u;var ST=G(()=>{tk();L0();$u=vWe});function q0(){return kWe}var kWe;var nk=G(()=>{ST();kWe=$u});function ce(e,t){let n=q0(),r=rk({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===$u?void 0:$u].filter((o)=>!!o)});e.common.issues.push(r)}class po{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let n=[];for(let r of t){if(r.status==="aborted")return qe;if(r.status==="dirty")e.dirty();n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let r of t){let o=await r.key,s=await r.value;n.push({key:o,value:s})}return po.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:o,value:s}=r;if(o.status==="aborted")return qe;if(s.status==="aborted")return qe;if(o.status==="dirty")e.dirty();if(s.status==="dirty")e.dirty();if(o.value!=="__proto__"&&(typeof s.value<"u"||r.alwaysSet))n[o.value]=s.value}return{status:e.value,value:n}}}var rk=(e)=>{let{data:t,path:n,errorMaps:r,issueData:o}=e,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=r.filter((l)=>!!l).slice().reverse();for(let l of c)a=l(i,{data:t,defaultError:a}).message;return{...o,path:s,message:a}},qe,th=(e)=>({status:"dirty",value:e}),Co=(e)=>({status:"valid",value:e}),$T=(e)=>e.status==="aborted",RT=(e)=>e.status==="dirty",Sf=(e)=>e.status==="valid",B0=(e)=>typeof Promise<"u"&&e instanceof Promise;var DT=G(()=>{nk();ST();qe=Object.freeze({status:"aborted"})});var lZ=()=>{};var $e;var uZ=G(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})($e||($e={}))});class Fi{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}function ct(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if(t)return{errorMap:t,description:o};return{errorMap:(i,a)=>{let{message:c}=e;if(i.code==="invalid_enum_value")return{message:c??a.defaultError};if(typeof a.data>"u")return{message:c??r??a.defaultError};if(i.code!=="invalid_type")return{message:a.defaultError};return{message:c??n??a.defaultError}},description:o}}class _t{get description(){return this._def.description}_getType(e){return Xc(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Xc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new po,ctx:{common:e.parent.common,data:e.data,parsedType:Xc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(B0(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xc(e)},r=this._parseSync({data:e,path:n.path,parent:n});return dZ(n,r)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xc(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Sf(n)?{value:n.value}:{issues:t.common.issues}}catch(n){if(n?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then((n)=>Sf(n)?{value:n.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Xc(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(B0(r)?r:Promise.resolve(r));return dZ(n,o)}refine(e,t){let n=(r)=>{if(typeof t==="string"||typeof t>"u")return{message:t};else if(typeof t==="function")return t(r);else return t};return this._refinement((r,o)=>{let s=e(r),i=()=>o.addIssue({code:ee.custom,...n(r)});if(typeof Promise<"u"&&s instanceof Promise)return s.then((a)=>{if(!a)return i(),!1;else return!0});if(!s)return i(),!1;else return!0})}refinement(e,t){return this._refinement((n,r)=>{if(!e(n))return r.addIssue(typeof t==="function"?t(n,r):t),!1;else return!0})}_refinement(e){return new $a({schema:this,typeName:Be.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:(t)=>this["~validate"](t)}}optional(){return Sa.create(this,this._def)}nullable(){return Ru.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ea.create(this)}promise(){return ih.create(this,this._def)}or(e){return V0.create([this,e],this._def)}and(e){return W0.create(this,e,this._def)}transform(e){return new $a({...ct(this._def),schema:this,typeName:Be.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new X0({...ct(this._def),innerType:this,defaultValue:t,typeName:Be.ZodDefault})}brand(){return new TT({typeName:Be.ZodBranded,type:this,...ct(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new Q0({...ct(this._def),innerType:this,catchValue:t,typeName:Be.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return dk.create(this,e)}readonly(){return Z0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function pZ(e){let t="[0-5]\\d";if(e.precision)t=`${t}\\.\\d{${e.precision}}`;else if(e.precision==null)t=`${t}(\\.\\d+)?`;let n=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function qWe(e){return new RegExp(`^${pZ(e)}$`)}function BWe(e){let t=`${fZ}T${pZ(e)}`,n=[];if(n.push(e.local?"Z?":"Z"),e.offset)n.push("([+-]\\d{2}:?\\d{2})");return t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function UWe(e,t){if((t==="v4"||!t)&&PWe.test(e))return!0;if((t==="v6"||!t)&&NWe.test(e))return!0;return!1}function HWe(e,t){if(!CWe.test(e))return!1;try{let[n]=e.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));if(typeof o!=="object"||o===null)return!1;if("typ"in o&&o?.typ!=="JWT")return!1;if(!o.alg)return!1;if(t&&o.alg!==t)return!1;return!0}catch{return!1}}function zWe(e,t){if((t==="v4"||!t)&&IWe.test(e))return!0;if((t==="v6"||!t)&&FWe.test(e))return!0;return!1}function GWe(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return s%i/10**o}function nh(e){if(e instanceof Ln){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Sa.create(nh(r))}return new Ln({...e._def,shape:()=>t})}else if(e instanceof Ea)return new Ea({...e._def,type:nh(e.element)});else if(e instanceof Sa)return Sa.create(nh(e.unwrap()));else if(e instanceof Ru)return Ru.create(nh(e.unwrap()));else if(e instanceof tl)return tl.create(e.items.map((t)=>nh(t)));else return e}function AT(e,t){let n=Xc(e),r=Xc(t);if(e===t)return{valid:!0,data:e};else if(n===pe.object&&r===pe.object){let o=St.objectKeys(t),s=St.objectKeys(e).filter((a)=>o.indexOf(a)!==-1),i={...e,...t};for(let a of s){let c=AT(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===pe.array&&r===pe.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let s=0;s<e.length;s++){let i=e[s],a=t[s],c=AT(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else if(n===pe.date&&r===pe.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function mZ(e,t){return new Rf({values:e,typeName:Be.ZodEnum,...ct(t)})}var dZ=(e,t)=>{if(Sf(t))return{success:!0,data:t.value};else{if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Rs(e.common.issues);return this._error=n,this._error}}}},EWe,SWe,$We,RWe,DWe,CWe,AWe,OWe,TWe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",CT,PWe,IWe,NWe,FWe,MWe,jWe,fZ="((\\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])))",LWe,Zc,rh,oh,ok,H0,sk,z0,G0,ik,$f,el,ak,Ea,Ln,V0,Qc=(e)=>{if(e instanceof K0)return Qc(e.schema);else if(e instanceof $a)return Qc(e.innerType());else if(e instanceof J0)return[e.value];else if(e instanceof Rf)return e.options;else if(e instanceof Y0)return St.objectValues(e.enum);else if(e instanceof X0)return Qc(e._def.innerType);else if(e instanceof z0)return[void 0];else if(e instanceof G0)return[null];else if(e instanceof Sa)return[void 0,...Qc(e.unwrap())];else if(e instanceof Ru)return[null,...Qc(e.unwrap())];else if(e instanceof TT)return Qc(e.unwrap());else if(e instanceof Z0)return Qc(e.unwrap());else if(e instanceof Q0)return Qc(e._def.innerType);else return[]},OT,W0,tl,ck,lk,sh,U0,K0,J0,Rf,Y0,ih,$a,Sa,Ru,X0,Q0,uk,XUt,TT,dk,Z0,QUt,Be,E,F,ZUt,e5t,Ge,t5t,n5t,r5t,o5t,s5t,Du,i5t,a5t,ae,Y,c5t,ah,PT,l5t,u5t,Ao,d5t,f5t,p5t,m5t,$t,vt,h5t,g5t,y5t,b5t,w5t,_5t,x5t;var hZ=G(()=>{tk();nk();uZ();DT();L0();EWe=/^c[^\s-]{8,}$/i,SWe=/^[0-9a-z]+$/,$We=/^[0-9A-HJKMNP-TV-Z]{26}$/i,RWe=/^[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}$/i,DWe=/^[a-z0-9_-]{21}$/i,CWe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,AWe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,OWe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,PWe=/^(?:(?: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])$/,IWe=/^(?:(?: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])$/,NWe=/^(([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]))$/,FWe=/^(([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])$/,MWe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,jWe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,LWe=new RegExp(`^${fZ}$`);Zc=class Zc extends _t{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==pe.string){let o=this._getOrReturnCtx(e);return ce(o,{code:ee.invalid_type,expected:pe.string,received:o.parsedType}),qe}let n=new po,r=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.length<o.value)r=this._getOrReturnCtx(e,r),ce(r,{code:ee.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="max"){if(e.data.length>o.value)r=this._getOrReturnCtx(e,r),ce(r,{code:ee.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty()}else if(o.kind==="length"){let s=e.data.length>o.value,i=e.data.length<o.value;if(s||i){if(r=this._getOrReturnCtx(e,r),s)ce(r,{code:ee.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});else if(i)ce(r,{code:ee.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});n.dirty()}}else if(o.kind==="email"){if(!OWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"email",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="emoji"){if(!CT)CT=new RegExp(TWe,"u");if(!CT.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"emoji",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="uuid"){if(!RWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"uuid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="nanoid"){if(!DWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"nanoid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid"){if(!EWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"cuid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid2"){if(!SWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"cuid2",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ulid"){if(!$We.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"ulid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="url")try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),ce(r,{validation:"url",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="regex"){if(o.regex.lastIndex=0,!o.regex.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"regex",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="trim")e.data=e.data.trim();else if(o.kind==="includes"){if(!e.data.includes(o.value,o.position))r=this._getOrReturnCtx(e,r),ce(r,{code:ee.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()}else if(o.kind==="toLowerCase")e.data=e.data.toLowerCase();else if(o.kind==="toUpperCase")e.data=e.data.toUpperCase();else if(o.kind==="startsWith"){if(!e.data.startsWith(o.value))r=this._getOrReturnCtx(e,r),ce(r,{code:ee.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()}else if(o.kind==="endsWith"){if(!e.data.endsWith(o.value))r=this._getOrReturnCtx(e,r),ce(r,{code:ee.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()}else if(o.kind==="datetime"){if(!BWe(o).test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{code:ee.invalid_string,validation:"datetime",message:o.message}),n.dirty()}else if(o.kind==="date"){if(!LWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{code:ee.invalid_string,validation:"date",message:o.message}),n.dirty()}else if(o.kind==="time"){if(!qWe(o).test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{code:ee.invalid_string,validation:"time",message:o.message}),n.dirty()}else if(o.kind==="duration"){if(!AWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"duration",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ip"){if(!UWe(e.data,o.version))r=this._getOrReturnCtx(e,r),ce(r,{validation:"ip",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="jwt"){if(!HWe(e.data,o.alg))r=this._getOrReturnCtx(e,r),ce(r,{validation:"jwt",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cidr"){if(!zWe(e.data,o.version))r=this._getOrReturnCtx(e,r),ce(r,{validation:"cidr",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64"){if(!MWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"base64",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64url"){if(!jWe.test(e.data))r=this._getOrReturnCtx(e,r),ce(r,{validation:"base64url",code:ee.invalid_string,message:o.message}),n.dirty()}else St.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement((r)=>e.test(r),{validation:t,code:ee.invalid_string,...$e.errToObj(n)})}_addCheck(e){return new Zc({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...$e.errToObj(e)})}url(e){return this._addCheck({kind:"url",...$e.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...$e.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...$e.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...$e.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...$e.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...$e.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...$e.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...$e.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...$e.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...$e.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...$e.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...$e.errToObj(e)})}datetime(e){if(typeof e==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e});return this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...$e.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){if(typeof e==="string")return this._addCheck({kind:"time",precision:null,message:e});return this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...$e.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...$e.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...$e.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...$e.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...$e.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...$e.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...$e.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...$e.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...$e.errToObj(t)})}nonempty(e){return this.min(1,$e.errToObj(e))}trim(){return new Zc({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Zc({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Zc({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e)=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find((e)=>e.kind==="date")}get isTime(){return!!this._def.checks.find((e)=>e.kind==="time")}get isDuration(){return!!this._def.checks.find((e)=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find((e)=>e.kind==="email")}get isURL(){return!!this._def.checks.find((e)=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find((e)=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find((e)=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((e)=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((e)=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((e)=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find((e)=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find((e)=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find((e)=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find((e)=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find((e)=>e.kind==="base64url")}get minLength(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxLength(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};Zc.create=(e)=>new Zc({checks:[],typeName:Be.ZodString,coerce:e?.coerce??!1,...ct(e)});rh=class rh extends _t{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce)e.data=Number(e.data);if(this._getType(e)!==pe.number){let o=this._getOrReturnCtx(e);return ce(o,{code:ee.invalid_type,expected:pe.number,received:o.parsedType}),qe}let n=void 0,r=new po;for(let o of this._def.checks)if(o.kind==="int"){if(!St.isInteger(e.data))n=this._getOrReturnCtx(e,n),ce(n,{code:ee.invalid_type,expected:"integer",received:"float",message:o.message}),r.dirty()}else if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)n=this._getOrReturnCtx(e,n),ce(n,{code:ee.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)n=this._getOrReturnCtx(e,n),ce(n,{code:ee.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="multipleOf"){if(GWe(e.data,o.value)!==0)n=this._getOrReturnCtx(e,n),ce(n,{code:ee.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()}else if(o.kind==="finite"){if(!Number.isFinite(e.data))n=this._getOrReturnCtx(e,n),ce(n,{code:ee.not_finite,message:o.message}),r.dirty()}else St.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,$e.toString(t))}gt(e,t){return this.setLimit("min",e,!1,$e.toString(t))}lte(e,t){return this.setLimit("max",e,!0,$e.toString(t))}lt(e,t){return this.setLimit("max",e,!1,$e.toString(t))}setLimit(e,t,n,r){return new rh({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:$e.toString(r)}]})}_addCheck(e){return new rh({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:$e.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$e.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$e.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$e.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$e.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:$e.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:$e.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$e.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$e.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}get isInt(){return!!this._def.checks.find((e)=>e.kind==="int"||e.kind==="multipleOf"&&St.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;else if(n.kind==="min"){if(t===null||n.value>t)t=n.value}else if(n.kind==="max"){if(e===null||n.value<e)e=n.value}return Number.isFinite(t)&&Number.isFinite(e)}};rh.create=(e)=>new rh({checks:[],typeName:Be.ZodNumber,coerce:e?.coerce||!1,...ct(e)});oh=class oh extends _t{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==pe.bigint)return this._getInvalidInput(e);let n=void 0,r=new po;for(let o of this._def.checks)if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)n=this._getOrReturnCtx(e,n),ce(n,{code:ee.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()}else if(o.kind==="max"){if(o.inclusive?e.data>o.value:e.data>=o.value)n=this._getOrReturnCtx(e,n),ce(n,{code:ee.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),r.dirty()}else if(o.kind==="multipleOf"){if(e.data%o.value!==BigInt(0))n=this._getOrReturnCtx(e,n),ce(n,{code:ee.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()}else St.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return ce(t,{code:ee.invalid_type,expected:pe.bigint,received:t.parsedType}),qe}gte(e,t){return this.setLimit("min",e,!0,$e.toString(t))}gt(e,t){return this.setLimit("min",e,!1,$e.toString(t))}lte(e,t){return this.setLimit("max",e,!0,$e.toString(t))}lt(e,t){return this.setLimit("max",e,!1,$e.toString(t))}setLimit(e,t,n,r){return new oh({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:$e.toString(r)}]})}_addCheck(e){return new oh({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:$e.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$e.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$e.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$e.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:$e.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e}get maxValue(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e}};oh.create=(e)=>new oh({checks:[],typeName:Be.ZodBigInt,coerce:e?.coerce??!1,...ct(e)});ok=class ok extends _t{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==pe.boolean){let n=this._getOrReturnCtx(e);return ce(n,{code:ee.invalid_type,expected:pe.boolean,received:n.parsedType}),qe}return Co(e.data)}};ok.create=(e)=>new ok({typeName:Be.ZodBoolean,coerce:e?.coerce||!1,...ct(e)});H0=class H0 extends _t{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==pe.date){let o=this._getOrReturnCtx(e);return ce(o,{code:ee.invalid_type,expected:pe.date,received:o.parsedType}),qe}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return ce(o,{code:ee.invalid_date}),qe}let n=new po,r=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.getTime()<o.value)r=this._getOrReturnCtx(e,r),ce(r,{code:ee.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()}else if(o.kind==="max"){if(e.data.getTime()>o.value)r=this._getOrReturnCtx(e,r),ce(r,{code:ee.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()}else St.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new H0({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:$e.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:$e.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)if(t.kind==="min"){if(e===null||t.value>e)e=t.value}return e!=null?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)if(t.kind==="max"){if(e===null||t.value<e)e=t.value}return e!=null?new Date(e):null}};H0.create=(e)=>new H0({checks:[],coerce:e?.coerce||!1,typeName:Be.ZodDate,...ct(e)});sk=class sk extends _t{_parse(e){if(this._getType(e)!==pe.symbol){let n=this._getOrReturnCtx(e);return ce(n,{code:ee.invalid_type,expected:pe.symbol,received:n.parsedType}),qe}return Co(e.data)}};sk.create=(e)=>new sk({typeName:Be.ZodSymbol,...ct(e)});z0=class z0 extends _t{_parse(e){if(this._getType(e)!==pe.undefined){let n=this._getOrReturnCtx(e);return ce(n,{code:ee.invalid_type,expected:pe.undefined,received:n.parsedType}),qe}return Co(e.data)}};z0.create=(e)=>new z0({typeName:Be.ZodUndefined,...ct(e)});G0=class G0 extends _t{_parse(e){if(this._getType(e)!==pe.null){let n=this._getOrReturnCtx(e);return ce(n,{code:ee.invalid_type,expected:pe.null,received:n.parsedType}),qe}return Co(e.data)}};G0.create=(e)=>new G0({typeName:Be.ZodNull,...ct(e)});ik=class ik extends _t{constructor(){super(...arguments);this._any=!0}_parse(e){return Co(e.data)}};ik.create=(e)=>new ik({typeName:Be.ZodAny,...ct(e)});$f=class $f extends _t{constructor(){super(...arguments);this._unknown=!0}_parse(e){return Co(e.data)}};$f.create=(e)=>new $f({typeName:Be.ZodUnknown,...ct(e)});el=class el extends _t{_parse(e){let t=this._getOrReturnCtx(e);return ce(t,{code:ee.invalid_type,expected:pe.never,received:t.parsedType}),qe}};el.create=(e)=>new el({typeName:Be.ZodNever,...ct(e)});ak=class ak extends _t{_parse(e){if(this._getType(e)!==pe.undefined){let n=this._getOrReturnCtx(e);return ce(n,{code:ee.invalid_type,expected:pe.void,received:n.parsedType}),qe}return Co(e.data)}};ak.create=(e)=>new ak({typeName:Be.ZodVoid,...ct(e)});Ea=class Ea extends _t{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==pe.array)return ce(t,{code:ee.invalid_type,expected:pe.array,received:t.parsedType}),qe;if(r.exactLength!==null){let s=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;if(s||i)ce(t,{code:s?ee.too_big:ee.too_small,minimum:i?r.exactLength.value:void 0,maximum:s?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty()}if(r.minLength!==null){if(t.data.length<r.minLength.value)ce(t,{code:ee.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()}if(r.maxLength!==null){if(t.data.length>r.maxLength.value)ce(t,{code:ee.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()}if(t.common.async)return Promise.all([...t.data].map((s,i)=>r.type._parseAsync(new Fi(t,s,t.path,i)))).then((s)=>po.mergeArray(n,s));let o=[...t.data].map((s,i)=>r.type._parseSync(new Fi(t,s,t.path,i)));return po.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new Ea({...this._def,minLength:{value:e,message:$e.toString(t)}})}max(e,t){return new Ea({...this._def,maxLength:{value:e,message:$e.toString(t)}})}length(e,t){return new Ea({...this._def,exactLength:{value:e,message:$e.toString(t)}})}nonempty(e){return this.min(1,e)}};Ea.create=(e,t)=>new Ea({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Be.ZodArray,...ct(t)});Ln=class Ln extends _t{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=St.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==pe.object){let c=this._getOrReturnCtx(e);return ce(c,{code:ee.invalid_type,expected:pe.object,received:c.parsedType}),qe}let{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof el&&this._def.unknownKeys==="strip")){for(let c in r.data)if(!s.includes(c))i.push(c)}let a=[];for(let c of s){let l=o[c],d=r.data[c];a.push({key:{status:"valid",value:c},value:l._parse(new Fi(r,d,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof el){let c=this._def.unknownKeys;if(c==="passthrough")for(let l of i)a.push({key:{status:"valid",value:l},value:{status:"valid",value:r.data[l]}});else if(c==="strict"){if(i.length>0)ce(r,{code:ee.unrecognized_keys,keys:i}),n.dirty()}else if(c==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let c=this._def.catchall;for(let l of i){let d=r.data[l];a.push({key:{status:"valid",value:l},value:c._parse(new Fi(r,d,r.path,l)),alwaysSet:l in r.data})}}if(r.common.async)return Promise.resolve().then(async()=>{let c=[];for(let l of a){let d=await l.key,f=await l.value;c.push({key:d,value:f,alwaysSet:l.alwaysSet})}return c}).then((c)=>po.mergeObjectSync(n,c));else return po.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(e){return $e.errToObj,new Ln({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(t,n)=>{let r=this._def.errorMap?.(t,n).message??n.defaultError;if(t.code==="unrecognized_keys")return{message:$e.errToObj(e).message??r};return{message:r}}}:{}})}strip(){return new Ln({...this._def,unknownKeys:"strip"})}passthrough(){return new Ln({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ln({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ln({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Be.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Ln({...this._def,catchall:e})}pick(e){let t={};for(let n of St.objectKeys(e))if(e[n]&&this.shape[n])t[n]=this.shape[n];return new Ln({...this._def,shape:()=>t})}omit(e){let t={};for(let n of St.objectKeys(this.shape))if(!e[n])t[n]=this.shape[n];return new Ln({...this._def,shape:()=>t})}deepPartial(){return nh(this)}partial(e){let t={};for(let n of St.objectKeys(this.shape)){let r=this.shape[n];if(e&&!e[n])t[n]=r;else t[n]=r.optional()}return new Ln({...this._def,shape:()=>t})}required(e){let t={};for(let n of St.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];while(o instanceof Sa)o=o._def.innerType;t[n]=o}return new Ln({...this._def,shape:()=>t})}keyof(){return mZ(St.objectKeys(this.shape))}};Ln.create=(e,t)=>new Ln({shape:()=>e,unknownKeys:"strip",catchall:el.create(),typeName:Be.ZodObject,...ct(t)});Ln.strictCreate=(e,t)=>new Ln({shape:()=>e,unknownKeys:"strict",catchall:el.create(),typeName:Be.ZodObject,...ct(t)});Ln.lazycreate=(e,t)=>new Ln({shape:e,unknownKeys:"strip",catchall:el.create(),typeName:Be.ZodObject,...ct(t)});V0=class V0 extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(o){for(let i of o)if(i.result.status==="valid")return i.result;for(let i of o)if(i.result.status==="dirty")return t.common.issues.push(...i.ctx.common.issues),i.result;let s=o.map((i)=>new Rs(i.ctx.common.issues));return ce(t,{code:ee.invalid_union,unionErrors:s}),qe}if(t.common.async)return Promise.all(n.map(async(o)=>{let s={...t,common:{...t.common,issues:[]},parent:null};return{result:await o._parseAsync({data:t.data,path:t.path,parent:s}),ctx:s}})).then(r);else{let o=void 0,s=[];for(let a of n){let c={...t,common:{...t.common,issues:[]},parent:null},l=a._parseSync({data:t.data,path:t.path,parent:c});if(l.status==="valid")return l;else if(l.status==="dirty"&&!o)o={result:l,ctx:c};if(c.common.issues.length)s.push(c.common.issues)}if(o)return t.common.issues.push(...o.ctx.common.issues),o.result;let i=s.map((a)=>new Rs(a));return ce(t,{code:ee.invalid_union,unionErrors:i}),qe}}get options(){return this._def.options}};V0.create=(e,t)=>new V0({options:e,typeName:Be.ZodUnion,...ct(t)});OT=class OT extends _t{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==pe.object)return ce(t,{code:ee.invalid_type,expected:pe.object,received:t.parsedType}),qe;let n=this.discriminator,r=t.data[n],o=this.optionsMap.get(r);if(!o)return ce(t,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),qe;if(t.common.async)return o._parseAsync({data:t.data,path:t.path,parent:t});else return o._parseSync({data:t.data,path:t.path,parent:t})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){let r=new Map;for(let o of t){let s=Qc(o.shape[e]);if(!s.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let i of s){if(r.has(i))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(i)}`);r.set(i,o)}}return new OT({typeName:Be.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...ct(n)})}};W0=class W0 extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(o,s)=>{if($T(o)||$T(s))return qe;let i=AT(o.value,s.value);if(!i.valid)return ce(n,{code:ee.invalid_intersection_types}),qe;if(RT(o)||RT(s))t.dirty();return{status:t.value,value:i.data}};if(n.common.async)return Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>r(o,s));else return r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};W0.create=(e,t,n)=>new W0({left:e,right:t,typeName:Be.ZodIntersection,...ct(n)});tl=class tl extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==pe.array)return ce(n,{code:ee.invalid_type,expected:pe.array,received:n.parsedType}),qe;if(n.data.length<this._def.items.length)return ce(n,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),qe;if(!this._def.rest&&n.data.length>this._def.items.length)ce(n,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty();let o=[...n.data].map((s,i)=>{let a=this._def.items[i]||this._def.rest;if(!a)return null;return a._parse(new Fi(n,s,n.path,i))}).filter((s)=>!!s);if(n.common.async)return Promise.all(o).then((s)=>po.mergeArray(t,s));else return po.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new tl({...this._def,rest:e})}};tl.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new tl({items:e,typeName:Be.ZodTuple,rest:null,...ct(t)})};ck=class ck extends _t{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==pe.object)return ce(n,{code:ee.invalid_type,expected:pe.object,received:n.parsedType}),qe;let r=[],o=this._def.keyType,s=this._def.valueType;for(let i in n.data)r.push({key:o._parse(new Fi(n,i,n.path,i)),value:s._parse(new Fi(n,n.data[i],n.path,i)),alwaysSet:i in n.data});if(n.common.async)return po.mergeObjectAsync(t,r);else return po.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){if(t instanceof _t)return new ck({keyType:e,valueType:t,typeName:Be.ZodRecord,...ct(n)});return new ck({keyType:Zc.create(),valueType:e,typeName:Be.ZodRecord,...ct(t)})}};lk=class lk extends _t{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==pe.map)return ce(n,{code:ee.invalid_type,expected:pe.map,received:n.parsedType}),qe;let r=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([i,a],c)=>({key:r._parse(new Fi(n,i,n.path,[c,"key"])),value:o._parse(new Fi(n,a,n.path,[c,"value"]))}));if(n.common.async){let i=new Map;return Promise.resolve().then(async()=>{for(let a of s){let c=await a.key,l=await a.value;if(c.status==="aborted"||l.status==="aborted")return qe;if(c.status==="dirty"||l.status==="dirty")t.dirty();i.set(c.value,l.value)}return{status:t.value,value:i}})}else{let i=new Map;for(let a of s){let{key:c,value:l}=a;if(c.status==="aborted"||l.status==="aborted")return qe;if(c.status==="dirty"||l.status==="dirty")t.dirty();i.set(c.value,l.value)}return{status:t.value,value:i}}}};lk.create=(e,t,n)=>new lk({valueType:t,keyType:e,typeName:Be.ZodMap,...ct(n)});sh=class sh extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==pe.set)return ce(n,{code:ee.invalid_type,expected:pe.set,received:n.parsedType}),qe;let r=this._def;if(r.minSize!==null){if(n.data.size<r.minSize.value)ce(n,{code:ee.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()}if(r.maxSize!==null){if(n.data.size>r.maxSize.value)ce(n,{code:ee.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty()}let o=this._def.valueType;function s(a){let c=new Set;for(let l of a){if(l.status==="aborted")return qe;if(l.status==="dirty")t.dirty();c.add(l.value)}return{status:t.value,value:c}}let i=[...n.data.values()].map((a,c)=>o._parse(new Fi(n,a,n.path,c)));if(n.common.async)return Promise.all(i).then((a)=>s(a));else return s(i)}min(e,t){return new sh({...this._def,minSize:{value:e,message:$e.toString(t)}})}max(e,t){return new sh({...this._def,maxSize:{value:e,message:$e.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};sh.create=(e,t)=>new sh({valueType:e,minSize:null,maxSize:null,typeName:Be.ZodSet,...ct(t)});U0=class U0 extends _t{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==pe.function)return ce(t,{code:ee.invalid_type,expected:pe.function,received:t.parsedType}),qe;function n(i,a){return rk({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,q0(),$u].filter((c)=>!!c),issueData:{code:ee.invalid_arguments,argumentsError:a}})}function r(i,a){return rk({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,q0(),$u].filter((c)=>!!c),issueData:{code:ee.invalid_return_type,returnTypeError:a}})}let o={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof ih){let i=this;return Co(async function(...a){let c=new Rs([]),l=await i._def.args.parseAsync(a,o).catch((p)=>{throw c.addIssue(n(a,p)),c}),d=await Reflect.apply(s,this,l);return await i._def.returns._def.type.parseAsync(d,o).catch((p)=>{throw c.addIssue(r(d,p)),c})})}else{let i=this;return Co(function(...a){let c=i._def.args.safeParse(a,o);if(!c.success)throw new Rs([n(a,c.error)]);let l=Reflect.apply(s,this,c.data),d=i._def.returns.safeParse(l,o);if(!d.success)throw new Rs([r(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new U0({...this._def,args:tl.create(e).rest($f.create())})}returns(e){return new U0({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new U0({args:e?e:tl.create([]).rest($f.create()),returns:t||$f.create(),typeName:Be.ZodFunction,...ct(n)})}};K0=class K0 extends _t{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};K0.create=(e,t)=>new K0({getter:e,typeName:Be.ZodLazy,...ct(t)});J0=class J0 extends _t{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return ce(t,{received:t.data,code:ee.invalid_literal,expected:this._def.value}),qe}return{status:"valid",value:e.data}}get value(){return this._def.value}};J0.create=(e,t)=>new J0({value:e,typeName:Be.ZodLiteral,...ct(t)});Rf=class Rf extends _t{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return ce(t,{expected:St.joinValues(n),received:t.parsedType,code:ee.invalid_type}),qe}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return ce(t,{received:t.data,code:ee.invalid_enum_value,options:n}),qe}return Co(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Rf.create(e,{...this._def,...t})}exclude(e,t=this._def){return Rf.create(this.options.filter((n)=>!e.includes(n)),{...this._def,...t})}};Rf.create=mZ;Y0=class Y0 extends _t{_parse(e){let t=St.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==pe.string&&n.parsedType!==pe.number){let r=St.objectValues(t);return ce(n,{expected:St.joinValues(r),received:n.parsedType,code:ee.invalid_type}),qe}if(!this._cache)this._cache=new Set(St.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let r=St.objectValues(t);return ce(n,{received:n.data,code:ee.invalid_enum_value,options:r}),qe}return Co(e.data)}get enum(){return this._def.values}};Y0.create=(e,t)=>new Y0({values:e,typeName:Be.ZodNativeEnum,...ct(t)});ih=class ih extends _t{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==pe.promise&&t.common.async===!1)return ce(t,{code:ee.invalid_type,expected:pe.promise,received:t.parsedType}),qe;let n=t.parsedType===pe.promise?t.data:Promise.resolve(t.data);return Co(n.then((r)=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};ih.create=(e,t)=>new ih({type:e,typeName:Be.ZodPromise,...ct(t)});$a=class $a extends _t{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Be.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,o={addIssue:(s)=>{if(ce(n,s),s.fatal)t.abort();else t.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),r.type==="preprocess"){let s=r.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async(i)=>{if(t.value==="aborted")return qe;let a=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});if(a.status==="aborted")return qe;if(a.status==="dirty")return th(a.value);if(t.value==="dirty")return th(a.value);return a});else{if(t.value==="aborted")return qe;let i=this._def.schema._parseSync({data:s,path:n.path,parent:n});if(i.status==="aborted")return qe;if(i.status==="dirty")return th(i.value);if(t.value==="dirty")return th(i.value);return i}}if(r.type==="refinement"){let s=(i)=>{let a=r.refinement(i,o);if(n.common.async)return Promise.resolve(a);if(a instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return i};if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(i.status==="aborted")return qe;if(i.status==="dirty")t.dirty();return s(i.value),{status:t.value,value:i.value}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((i)=>{if(i.status==="aborted")return qe;if(i.status==="dirty")t.dirty();return s(i.value).then(()=>({status:t.value,value:i.value}))})}if(r.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Sf(s))return qe;let i=r.transform(s.value,o);if(i instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:i}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((s)=>{if(!Sf(s))return qe;return Promise.resolve(r.transform(s.value,o)).then((i)=>({status:t.value,value:i}))});St.assertNever(r)}};$a.create=(e,t,n)=>new $a({schema:e,typeName:Be.ZodEffects,effect:t,...ct(n)});$a.createWithPreprocess=(e,t,n)=>new $a({schema:t,effect:{type:"preprocess",transform:e},typeName:Be.ZodEffects,...ct(n)});Sa=class Sa extends _t{_parse(e){if(this._getType(e)===pe.undefined)return Co(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Sa.create=(e,t)=>new Sa({innerType:e,typeName:Be.ZodOptional,...ct(t)});Ru=class Ru extends _t{_parse(e){if(this._getType(e)===pe.null)return Co(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ru.create=(e,t)=>new Ru({innerType:e,typeName:Be.ZodNullable,...ct(t)});X0=class X0 extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;if(t.parsedType===pe.undefined)n=this._def.defaultValue();return this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};X0.create=(e,t)=>new X0({innerType:e,typeName:Be.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...ct(t)});Q0=class Q0 extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});if(B0(r))return r.then((o)=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Rs(n.common.issues)},input:n.data})}));else return{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new Rs(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Q0.create=(e,t)=>new Q0({innerType:e,typeName:Be.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...ct(t)});uk=class uk extends _t{_parse(e){if(this._getType(e)!==pe.nan){let n=this._getOrReturnCtx(e);return ce(n,{code:ee.invalid_type,expected:pe.nan,received:n.parsedType}),qe}return{status:"valid",value:e.data}}};uk.create=(e)=>new uk({typeName:Be.ZodNaN,...ct(e)});XUt=Symbol("zod_brand");TT=class TT extends _t{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}};dk=class dk extends _t{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});if(o.status==="aborted")return qe;if(o.status==="dirty")return t.dirty(),th(o.value);else return this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();else{let r=this._def.in._parseSync({data:n.data,path:n.path,parent:n});if(r.status==="aborted")return qe;if(r.status==="dirty")return t.dirty(),{status:"dirty",value:r.value};else return this._def.out._parseSync({data:r.value,path:n.path,parent:n})}}static create(e,t){return new dk({in:e,out:t,typeName:Be.ZodPipeline})}};Z0=class Z0 extends _t{_parse(e){let t=this._def.innerType._parse(e),n=(r)=>{if(Sf(r))r.value=Object.freeze(r.value);return r};return B0(t)?t.then((r)=>n(r)):n(t)}unwrap(){return this._def.innerType}};Z0.create=(e,t)=>new Z0({innerType:e,typeName:Be.ZodReadonly,...ct(t)});QUt={object:Ln.lazycreate};(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"})(Be||(Be={}));E=Zc.create,F=rh.create,ZUt=uk.create,e5t=oh.create,Ge=ok.create,t5t=H0.create,n5t=sk.create,r5t=z0.create,o5t=G0.create,s5t=ik.create,Du=$f.create,i5t=el.create,a5t=ak.create,ae=Ea.create,Y=Ln.create,c5t=Ln.strictCreate,ah=V0.create,PT=OT.create,l5t=W0.create,u5t=tl.create,Ao=ck.create,d5t=lk.create,f5t=sh.create,p5t=U0.create,m5t=K0.create,$t=J0.create,vt=Rf.create,h5t=Y0.create,g5t=ih.create,y5t=$a.create,b5t=Sa.create,w5t=Ru.create,_5t=$a.createWithPreprocess,x5t=dk.create});var IT=G(()=>{nk();DT();lZ();L0();hZ();tk()});var To=G(()=>{IT();IT()});function NT(e){return fk.includes(e)}var VWe,Df,fk,gZ,WWe,yZ,KWe,bZ,JWe,YWe,wZ,XWe,_Z,T5t,P5t,xZ,QWe,vZ,ZWe,kZ,FT=20,MT=500,eKe,I5t;var ch=G(()=>{To();VWe=vt(["pending","verified","approved","revoked"]),Df=vt(["person","service","test"]),fk=Df.options;gZ={nemarOwner:"service",nemarAdmin:"service","test-admin":"service","test-owner":"service","cool-vibers":"test","test-user":"test","test-pending":"test","test-verified":"test","test-revoked":"test"},WWe=vt(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),yZ=WWe.options,KWe=vt(["active","pending","revoked"]),bZ=Y({field:E(),blocks:ae(E()).optional(),set_on:ae(E()).optional()}).passthrough(),JWe=Y({id:F().int(),username:E().nullable(),email:E(),github_username:E().nullable(),role:E(),orcid:E().nullable().optional(),created_at:E().optional(),approved_at:E().nullable().optional(),dataset_count:F().int().optional(),sandbox_completed:Ge().optional(),sandbox_completed_at:E().nullable().optional(),sandbox_dataset_id:E().nullable().optional(),service_access:Ge().optional(),status:VWe.optional(),email_verified:Ge().optional(),orcid_verified:Ge().optional(),given_name:E().nullable().optional(),family_name:E().nullable().optional(),profile_gaps:ae(bZ).optional(),username_auto_assigned:Ge().optional(),account_kind:Df.optional()}).passthrough(),YWe=Y({prefix:E(),created_at:E(),last_used_at:E().nullable()}).passthrough().nullable(),wZ=Y({user:JWe,token:YWe.optional()}).passthrough(),XWe=Y({id:F().int(),username:E().nullable(),email:E(),github_username:E().nullable(),status:E(),email_verified:F().int().nullable().optional(),role:E().nullable(),created_at:E(),approved_at:E().nullable().optional(),revoked_at:E().nullable().optional(),signup_source:E().nullable().optional(),service_access:F().int().nullable().optional(),service_access_granted_at:E().nullable().optional(),given_name:E().nullable().optional(),family_name:E().nullable().optional(),orcid:E().nullable().optional(),upload_access_requested_at:E().nullable().optional(),account_kind:Df.optional(),matched_in:ae(E()).optional(),match_kind:E().optional()}).passthrough(),_Z=Y({users:ae(XWe),count:F().int()}).passthrough(),T5t=vt(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),P5t=vt(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),xZ=Y({suggestion:E().nullable(),based_on:vt(["name","unavailable","exhausted"])}).passthrough(),QWe=vt(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),vZ=QWe.options,ZWe=vt(["invalid_github_username","city_required","country_required","empty_patch","username_too_short","username_too_long","username_charset","given_name_required","family_name_required","username_taken","username_locked","name_is_orcid_canonical","account_revoked","github_unavailable","same_email","code_expired","code_incorrect","orcid_already_have","orcid_unavailable"]),kZ=ZWe.options,eKe=Y({id:F().int(),email:E(),username:E().nullable(),role:E(),status:KWe,email_verified:Ge(),given_name:E().nullable(),family_name:E().nullable(),orcid:E().nullable(),orcid_verified:Ge(),github_username:E().nullable(),city:E().nullable(),country:E().nullable(),affiliation:E().nullable(),service_access:Ge(),service_access_granted_at:E().nullable(),upload_access_requested_at:E().nullable(),profile_gaps:ae(bZ),username_auto_assigned:Ge()}).passthrough(),I5t=Y({user:eKe.nullable()}).passthrough()});var jT,LT,j5t,tKe,L5t,nKe,EZ,SZ,qT=8,BT=100,$Z,RZ,rKe,DZ;var eb=G(()=>{To();ch();jT=["given_name","family_name","affiliation","city","country"],LT=["username","github_username","email","orcid"],j5t=[...jT,...LT],tKe={given_name:E().max(200).optional(),family_name:E().max(200).optional(),affiliation:E().max(500).optional(),city:E().max(200).optional(),country:E().max(200).optional(),username:E().max(100).optional(),github_username:E().max(100).optional(),email:E().max(320).optional(),orcid:E().max(40).optional()},L5t=Y(tKe),nKe=vt(["field_not_editable","owner_only_field","edit_own_account","owner_account","system_account","invalid_edit","orcid_already_proven","invalid_search","invalid_user_id"]),EZ=nKe.options,SZ=["exact","name","prefix","substring","fuzzy"],$Z=Y({id:F().int(),username:E().nullable(),email:E(),github_username:E().nullable(),status:E(),role:E().nullable(),account_kind:Df.optional(),email_verified:F().int().nullable().optional(),orcid:E().nullable().optional(),orcid_verified:F().int().nullable().optional(),given_name:E().nullable().optional(),family_name:E().nullable().optional(),affiliation:E().nullable().optional(),city:E().nullable().optional(),country:E().nullable().optional(),description:E().nullable().optional(),signup_source:E().nullable().optional(),created_at:E(),updated_at:E().nullable().optional(),approved_at:E().nullable().optional(),revoked_at:E().nullable().optional(),deleted_at:E().nullable().optional(),service_access:F().int().nullable().optional(),service_access_granted_at:E().nullable().optional(),service_access_granted_by:F().int().nullable().optional(),upload_access_requested_at:E().nullable().optional(),upload_access_notified_at:E().nullable().optional(),identity_conflict:F().int().nullable().optional(),username_auto_assigned:F().int().nullable().optional(),sandbox_completed:F().int().nullable().optional(),sandbox_completed_at:E().nullable().optional(),sandbox_dataset_id:E().nullable().optional(),aws_iam_username:E().nullable().optional(),dataset_count:F().int().optional(),active_tokens:F().int().optional(),linked_identities:ae(E()).optional()}).passthrough(),RZ=Y({user:$Z}).passthrough(),rKe=Y({from:E().nullable(),to:E().nullable()}),DZ=Y({message:E(),changed:Ao(E(),rKe),notes:ae(E()).optional(),old_address_notified:Ge().optional(),user:$Z}).passthrough()});function iKe(e){return e.startsWith("v")?e:`v${e}`}var oKe,sKe,CZ,U5t;var UT=G(()=>{To();oKe=/^v?\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/,sKe=/^v\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/;CZ=E().regex(oKe,"must be a semver version, optionally v-prefixed").transform(iKe),U5t=E().regex(sKe,"must be the canonical v-prefixed tag (vX.Y.Z)")});function OZ(e,t){if(e.zarr_index_url!=null&&e.zarr_status!=="ready")t.addIssue({code:ee.custom,message:"zarr_index_url must be null/absent unless zarr_status is 'ready'",path:["zarr_index_url"]})}function TZ(e,t){if(e.zarr_verified_at!=null&&e.zarr_verify_status==null)t.addIssue({code:ee.custom,message:"zarr_verified_at must be null/absent unless zarr_verify_status is non-null",path:["zarr_verified_at"]})}var aKe="0.4.1",HT,lh,AZ,cKe,lKe,uKe,PZ,V5t,IZ,W5t,nl,dKe,pk,K5t,fKe,pKe,J5t;var zT=G(()=>{To();UT();HT=vt(["openneuro","nemar","gin","other"]),lh=ah([$t(0),$t(1)]).nullable(),AZ=Y({dataset_id:E(),id:E().optional(),name:E(),description:E().nullable().optional(),status:E(),visibility:E(),anonymous:F().int().nullable().optional(),concept_doi:E().nullable().optional(),doi:E().nullable().optional(),created_at:E(),updated_at:E().optional(),first_published_at:E().nullable().optional(),owner_username:E().nullable().optional(),source:E().nullable().optional(),modalities:E().optional(),participants:F().int().nonnegative(),tasks:E().optional(),authors:E().optional(),license:E().optional(),file_size:F().nonnegative(),file_size_formatted:E().optional(),total_files:F().nonnegative().nullable().optional(),num_citations:F().int().nonnegative().optional(),n_channels:F().int().nullable().optional(),electrode_system:E().nullable().optional(),has_hed:lh.optional(),hed_version:E().nullable().optional(),data_complete:lh.optional(),bytes_present:F().nonnegative().nullable().optional(),latest_version:CZ.nullable().optional(),latest_version_at:E().nullable().optional(),subject_count:F().int().nullable().optional(),file_size_bytes:F().nullable().optional(),sessions_count:F().int().nullable().optional(),age_min:F().nullable().optional(),age_max:F().nullable().optional(),bids_version:E().nullable().optional(),zarr_status:vt(["pending","ready","failed"]).nullable().optional(),zarr_store_count:F().int().nullable().optional(),zarr_converted_at:E().nullable().optional(),zarr_source_commit:E().nullable().optional(),zarr_errors:F().int().nullable().optional(),zarr_failure_count:F().int().nullable().optional(),zarr_deterministic:lh.optional(),zarr_failed_at:E().nullable().optional(),zarr_index_url:E().nullable().optional(),zarr_verify_status:vt(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:E().nullable().optional(),zarr_requeue_at:E().nullable().optional(),anonymity_status:vt(["verified","findings","unverifiable"]).nullable().optional(),anonymity_checked_at:E().nullable().optional(),anonymity_findings:E().nullable().optional(),anonymity_unchecked:E().nullable().optional(),total_recording_duration:F().nullable().optional(),recording_duration_min:F().nullable().optional(),recording_duration_max:F().nullable().optional(),recording_count:F().int().nullable().optional(),recordings_unavailable:F().int().nullable().optional(),channel_count_min:F().int().nullable().optional(),channel_count_max:F().int().nullable().optional(),sampling_frequency:F().nullable().optional(),power_line_frequency:F().nullable().optional(),eeg_reference:E().nullable().optional(),placement_scheme:E().nullable().optional()}).passthrough();cKe=AZ.superRefine((e,t)=>{OZ(e,t),TZ(e,t)}),lKe=AZ.extend({file_size:F().nonnegative().nullable(),file_size_formatted:E().nullable().optional(),modalities:E().nullable().optional(),tasks:E().nullable().optional(),authors:E().nullable().optional(),license:E().nullable().optional(),owner_github:E().nullable().optional(),attestation_deposit_type:vt(["owner","redistribution"]).nullable().optional(),attestation_key_status:vt(["destroyed","retained"]).nullable().optional(),attestation_deidentified:lh.optional(),attestation_no_duplicate:lh.optional(),attestation_upstream_source:E().nullable().optional(),attestation_accepted_at:E().nullable().optional(),zarr_data_failures:Y({count:F().int().nonnegative(),detail_ref:E(),compacted_by:E().optional(),pending:F().int().nonnegative().optional(),discovered:F().int().nonnegative().optional(),events_upload_failed:$t(!0).optional(),manifest_upload_failed:$t(!0).optional()}).passthrough().nullable().optional()}).passthrough().superRefine((e,t)=>{OZ(e,t),TZ(e,t)}),uKe=Y({id:E(),name:E(),modalities:E().nullable().optional(),participants:F().int().nullable().optional(),doi:E().nullable().optional(),tasks:E().nullable().optional(),authors:E().nullable().optional(),has_hed:lh.optional(),score:F().optional(),snippet:E().optional()}).passthrough(),PZ=Ao(E(),F().int().nonnegative()),V5t=Y({datasets:ae(cKe),count:F().int().nonnegative(),total_count:F().int().nonnegative().optional(),limit:F().int().optional(),offset:F().int().optional(),excluded_unknown:F().int().nonnegative().optional(),excluded_unknown_by_facet:PZ.optional()}).passthrough(),IZ=Y({results:ae(uKe),count:F().int().nonnegative(),returned:F().int().nonnegative().optional(),offset:F().int().nonnegative().optional(),limit:F().int().optional(),candidate_ceiling:F().int().optional(),truncated:Ge().optional(),method:vt(["exact_id","text","text_fallback","semantic","unavailable"]).optional(),min_score:F().optional(),reranked:$t(!0).optional(),corrected_query:E().optional(),modality_boost:ae(E()).optional(),warning:E().optional(),excluded_unknown:F().int().nonnegative().optional(),excluded_unknown_by_facet:PZ.optional()}).passthrough(),W5t=Y({dataset:lKe}).passthrough(),nl=Y({value:E(),count:F().int().nonnegative()}),dKe=Y({values:ae(nl),distinct_total:F().int().nonnegative(),truncated:Ge()}),pk=Y({"electrode-system":ae(nl).optional(),source:ae(nl).optional(),zarr:ae(nl).optional(),powerline:ae(nl).optional(),"bids-version":ae(nl).optional(),"hed-version":ae(nl).optional(),license:ae(nl).optional(),modality:ae(nl).optional(),task:dKe.optional(),warning:E().optional()}).passthrough(),K5t=Y({schema_version:$t(aKe),doc_type:$t("dataset"),dataset_id:E().regex(/^[a-z]{2}\d+$/,"neuroschema dataset_id pattern"),name:E(),source:HT,recording_modality:ae(E()).min(1),description:E().nullable().optional(),bids_version:E().nullable().optional(),license:E().nullable().optional()}).passthrough(),fKe=Y({tasks:Ao(Y({runs:ae(E())}).passthrough())}).passthrough(),pKe=Y({sessions:ae(E()),modalities:Ao(fKe),session_modalities:Ao(ae(E())).optional()}).passthrough(),J5t=Y({version:E(),subjects:Ao(pKe)}).passthrough()});function mk(e){return typeof e==="string"&&NZ.includes(e)}var mKe,Q5t,Z5t,e9t,NZ,hKe="ci_check_unavailable",FZ,MZ,jZ,LZ="X-Approval-Dispatch-Token",t9t;var tb=G(()=>{To();mKe=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,Q5t=E().regex(mKe,"ORCID must be in format 0000-0000-0000-000X"),Z5t=vt(["found","no_public_name","lookup_failed"]),e9t=vt(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing","identifier_screen_findings"]),NZ=["bids_validation_pending","bids_validation_in_progress"];FZ=[hKe],MZ=["identifier_screen_pending","identifier_screen_not_clear","identifier_screen_not_applicable"],jZ=["publication_review_not_clear","request_blocked","request_changed","request_mismatch","dispatch_superseded","dispatch_expired","decision_with_dispatch_token","approval_in_flight","deny_after_publishing","invalid_dataset_id","approval_closed_during_run"],t9t=vt(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});var gKe,qZ,nb="https://nemar.org/settings",o9t,yKe,bKe,wKe,BZ,UZ;var GT=G(()=>{To();gKe=vt(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),qZ=gKe.options,o9t={orcid_in_use:`That ORCID iD already belongs to a NEMAR account. Sign in to that account instead; if you want the iD on a different account, unlink it there first (Settings, ${nb}).`,orcid_already_linked:`That ORCID iD already belongs to a NEMAR account. Sign in to that account instead; if you want the iD on a different account, unlink it there first (Settings, ${nb}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${nb}), then link it here.`,email_in_use:`That email address already belongs to a NEMAR account. Sign in to that account instead, or change its address first (Settings, ${nb}).`,github_in_use:`That GitHub account is already linked to a NEMAR account. Sign in to that account instead, or change its GitHub username first (Settings, ${nb}).`,identity_conflict_remains:"The collision that flagged this account is still there. Resolve it on the other account first (change its email or GitHub username, or unlink its ORCID iD), or delete that account, then clear the flag."},yKe=vt(["orcid","email","github"]),bKe=Y({id:F().int(),username:E().nullable(),email:E(),created_at:E(),has_oauth_identity:Ge(),dataset_count:F().int(),identity_conflict:F().int(),canonical:Ge()}).passthrough(),wKe=Y({kind:yKe,value:E(),canonical_user_id:F().int(),accounts:ae(bKe)}).passthrough(),BZ=Y({groups:ae(wKe),group_count:F().int(),flagged_count:F().int()}).passthrough(),UZ=Y({ok:$t(!0),id:F().int(),cleared:Ge()}).passthrough()});var VT=120,HZ=64,WT="unnamed machine",_Ke=25,hk,zZ,uh,GZ,a9t,c9t,VZ,xKe,vKe,WZ,KT,KZ,l9t,u9t,gk,yk;var bk=G(()=>{To();hk=vt(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),zZ={authorization_pending:"Waiting for you to authorize this machine in the browser.",slow_down:"Polling too quickly; the CLI will slow down automatically.",expired_token:"The code expired. Run `nemar auth login` again for a new one.",access_denied:"This sign-in was declined in the browser. Run `nemar auth login` again if that was a mistake.",invalid_grant:"That code is no longer valid. Run `nemar auth login` again for a new one."},uh=vt(["device_code_unknown","device_code_expired","device_code_used","device_code_denied","account_pending","account_revoked","identity_conflict","service_account","person_account","too_many_keys","key_not_found"]),GZ=uh.options,a9t={device_code_unknown:"That code was not found. Check the code shown in your terminal, or run `nemar auth login` again for a new one.",device_code_expired:"The code expired. Run `nemar auth login` again for a new one.",device_code_used:"That code has already been used. Run `nemar auth login` again for a new one.",device_code_denied:"This sign-in was declined in the browser. Run `nemar auth login` again if that was a mistake.",account_pending:"Verify your email address first. Check your inbox for the NEMAR verification code, then authorize again.",account_revoked:"Your NEMAR account access has been revoked. Contact the NEMAR team if you think this is a mistake.",identity_conflict:"This account shares an identifier with another NEMAR account and cannot sign in until that is resolved. Fix it in Settings on nemar.org or contact the NEMAR team.",service_account:"This is a service or test account, and it cannot sign in this way. Ask an owner to create a key for it with `nemar admin keys create`.",person_account:"This account belongs to a person. A person creates their own keys with `nemar auth login` or in Settings on nemar.org.",too_many_keys:`This account already has ${_Ke} active keys. Revoke one in Settings on nemar.org or with \`nemar auth keys\`, then try again.`,key_not_found:"That key was not found on this account, or it is already revoked. Run `nemar auth keys` to see the active ones."},c9t=Y({error:uh,message:E()}).passthrough(),VZ=Y({device_code:E(),user_code:E(),verification_uri:E(),verification_uri_complete:E(),expires_in:F().int(),interval:F().int()}).passthrough(),xKe=PT("error",[Y({error:$t("authorization_pending"),message:E()}).passthrough(),Y({error:$t("slow_down"),message:E()}).passthrough()]),vKe=PT("error",[Y({error:$t("expired_token"),reason:uh,message:E()}).passthrough(),Y({error:$t("access_denied"),reason:uh,message:E()}).passthrough(),Y({error:$t("invalid_grant"),reason:uh,message:E()}).passthrough()]),WZ=ah([xKe,vKe]),KT=Y({id:F().int(),name:E().nullable(),prefix:E(),created_at:E(),last_used_at:E().nullable(),current:Ge()}).passthrough(),KZ=Y({api_key:E(),key:KT,user:Y({username:E().nullable(),email:E(),github_username:E().nullable(),role:E(),sandbox_completed:Ge(),sandbox_dataset_id:E().nullable()}).passthrough()}).passthrough(),l9t=Y({user_code:E(),machine_name:E(),requested_at:E(),expires_in:F().int(),account:Y({username:E().nullable(),email_masked:E()}).passthrough(),refusal:Y({code:uh,message:E()}).passthrough().nullable()}).passthrough(),u9t=Y({ok:$t(!0),machine_name:E()}).passthrough(),gk=Y({keys:ae(KT)}).passthrough(),yk=Y({api_key:E(),key:KT}).passthrough()});function cr(e){return qn[e]}function rl(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>Object.hasOwn(t,r)?t[r]:n)}var qn;var dh=G(()=>{qn={"tier.unverified.label":"Email not verified","tier.base.label":"Base access","tier.upload.label":"Upload access","tier.unverified.lede":"Verify your email address to activate your account.","upload_access.section.title":"Upload access","upload_access.section.lede":"A one-time admin grant. Reviewed against export-control and local-jurisdiction rules.","upload_access.state.granted":"Granted","upload_access.state.requested":"Requested","upload_access.state.not_requested":"Not requested","upload_access.invite.title":"Want to contribute a dataset?","upload_access.invite.body":"Browsing, searching and downloading are open to your account already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once. Your email address must be verified first.","upload_access.gate.title":"Ask for upload access first","upload_access.gate.body":"Your account can browse, search and download everything public already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant, and your email address must be verified first: an admin checks your GitHub handle and where you\u2019re based against export-control and local-jurisdiction rules. You ask once, and it is answered by email.","upload_access.request.cta":"Request upload access","upload_access.request.form_body":"Tell us what you plan to deposit, or which dataset you want to collaborate on. An admin reviews this alongside your name, username, GitHub handle and location, then grants access once.","upload_access.request.why_label":"What do you intend to upload?","upload_access.request.why_hint":"Describe what you intend to upload in 20-500 characters","upload_access.requested.title":"Your request is with an admin","upload_access.requested.lede":"An admin is reviewing your request.","upload_access.requested.lede_dated":"An admin is reviewing your request from {date}.","upload_access.requested.body.upload":"We\u2019ll email you when there\u2019s a decision, and this page will let you upload as soon as it\u2019s granted.","upload_access.requested.body":"We\u2019ll email you when there\u2019s a decision. Everything else on your account keeps working in the meantime.","upload_access.requested.cta":"See the request","upload_access.granted.body":"You can upload datasets from the upload page. Publishing one is a separate, per-dataset review you start from your dashboard.","upload_access.unverified.body":"Verify your email address first \u2014 the review happens over email.","upload_access.docs_link":"How upload access works","gap.sentence":"{label} is missing: needed {blocks}.","gap.set_on.both":"Set it in {web} or run `{cli}`.","gap.set_on.web":"Set it in {web}.","gap.blocks.verified":"to activate your account","gap.blocks.upload_access":"to request upload access","gap.blocks.publication":"to publish a dataset","gap.blocks.unknown":"to finish setting up your account","gap.blocks.noun.verified":"account activation","gap.blocks.noun.upload_access":"upload access","gap.blocks.noun.publication":"publication","gap.set_on.default_web":"Settings","gap.field.email_verified.label":"A verified email address","gap.field.username.label":"Username","gap.field.given_name.label":"Given name","gap.field.family_name.label":"Family name","gap.field.orcid_verified.label":"Verified ORCID iD","gap.field.github_username.label":"GitHub handle","gap.field.city.label":"City","gap.field.country.label":"Country","gap.field.why.label":"A description of what you intend to upload","gap.field.email_verified.set_on.web":"the verify step on your dashboard","gap.field.email_verified.set_on.cli":"nemar auth resend-verification","gap.field.username.set_on.web":"Settings","gap.field.username.set_on.cli":"nemar auth profile set-username","gap.field.given_name.set_on.web":"Settings","gap.field.given_name.set_on.cli":"nemar auth profile set-name","gap.field.family_name.set_on.web":"Settings","gap.field.family_name.set_on.cli":"nemar auth profile set-name","gap.field.given_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.family_name.set_on.web.orcid":"your ORCID record at orcid.org, then sign in again","gap.field.orcid_verified.set_on.web":"Settings","gap.field.orcid_verified.set_on.cli":"nemar auth profile orcid link","gap.field.github_username.set_on.web":"Settings","gap.field.github_username.set_on.cli":"nemar auth profile set-github","gap.field.city.set_on.web":"Settings","gap.field.city.set_on.cli":"nemar auth profile set-location","gap.field.country.set_on.web":"Settings","gap.field.country.set_on.cli":"nemar auth profile set-location","gap.field.why.set_on.web":"the request form in Settings","gap.field.why.set_on.cli":"nemar auth request-upload-access","gaps.title":"What is still missing","gaps.none":"Nothing outstanding \u2014 every field NEMAR needs is filled in.","gaps.nudge.title":"Your profile isn\u2019t finished yet","gaps.nudge.cta":"Complete your profile","gaps.upload.title":"Before you can ask, your account still needs:","gaps.request.title":"Finish these first:","gaps.admin.title":"Still missing","gaps.admin.item":"{label} \u2014 blocks {blocks}","gaps.admin.none":"Nothing missing \u2014 every field the request needs is filled in.","gaps.admin.not_loaded":"Not loaded \u2014 open the user page to see what is still missing.","onboarding.username.auto_assigned.title":"We chose your username from your name","onboarding.username.auto_assigned.body":"Your account needed a username to be listed as a dataset owner, so one was made from your name when you signed in. You can change it once, here, until an admin grants you upload access.","welcome.unverified.title":"Verify your email address","welcome.unverified.body":"Authorizing with ORCID created your NEMAR account and signed you in. One step left: enter the 6-digit code we emailed you. That activates the account \u2014 no admin approval is involved.","welcome.active.title":"Your account is active","welcome.active.body":"Authorizing with ORCID created your NEMAR account and signed you in. There is no separate sign-up step and no approval queue: browse, search, and your dashboard all work right now.","welcome.upload_access.title":"Ask for upload access when you\u2019re ready to contribute","welcome.upload_access.body":"Reading is open to every verified account. Uploading and compute need one extra grant, because an admin has to check your GitHub handle and location against export-control and local-jurisdiction rules first. You ask once, from Settings.","cli.gaps.section.title":"Profile","cli.gaps.unknown":"not checked: run 'nemar auth status --refresh'","cli.gaps.unreported":"not reported by this backend","cli.gap.set_on.cli_only":"Run `{cli}`.","cli.gap.field.sandbox.label":"Sandbox training","cli.gap.blocks.sandbox":"to upload a dataset from the CLI","cli.gap.field.sandbox.set_on.cli":"nemar sandbox","cli.gaps.sandbox_unchecked":"Sandbox training could not be confirmed with the server. Run `nemar sandbox status --refresh`, then `nemar sandbox` if it is still outstanding.","cli.upload.preflight.title":"Upload access is not granted yet","cli.upload.preflight.body":"Browsing, searching and downloading are open to your account already. Uploading, or being added as a collaborator on someone else\u2019s dataset, needs one extra grant: an admin checks your GitHub handle and location against export-control and local-jurisdiction rules, once. Your email address must be verified first.","cli.upload_access.cta":"Ask for it with `nemar auth request-upload-access`.","cli.upload.preflight.unchecked":"Upload access could not be checked ({reason}); continuing.","cli.upload.preflight.gaps_unknown":"Could not determine what is still missing; run `nemar auth profile` for the list.","cli.upload.preflight.dry_run":"Continuing anyway: --dry-run uploads nothing."}});function EKe(e){return e==="verified"||e==="upload_access"||e==="publication"}function fh(e){return(e??"").trim().length===0}function SKe(e){return e==="service"||e==="test"}function XZ(e,t={}){let n=t.orcidVerified===!0,r=Object.hasOwn(wk,e)?wk[e]:void 0;if(!r)return{field:e,label:e,blocks:t.blocks??[],setOnWeb:qn["gap.set_on.default_web"],setOnCli:null,known:!1};let o=n&&r.orcidWebKey!==void 0;return{field:e,blocks:t.blocks??r.blocks,label:qn[r.labelKey],setOnWeb:qn[o?r.orcidWebKey:r.webKey],setOnCli:o||r.cliKey===null?null:qn[r.cliKey],known:!0}}function JZ(e){let t=JT.indexOf(e);return t===-1?JT.length:t}function QZ(e,t={}){return e.map((n)=>XZ(n,{orcidVerified:t.orcidVerified}))}function _k(e,t={}){return e.filter((n)=>!!n&&typeof n.field==="string").map((n)=>{let r=Array.isArray(n.blocks)?n.blocks.filter(EKe):[];return XZ(n.field,{orcidVerified:t.orcidVerified,blocks:r.length>0?r:void 0})}).sort((n,r)=>JZ(n.field)-JZ(r.field))}function YT(e){let t=e.blocks[0],n=t?qn[kKe[t]]:qn["gap.blocks.unknown"],r=rl(qn["gap.sentence"],{label:"",blocks:n}).trimStart(),o=e.setOnCli?rl(qn["gap.set_on.both"],{web:e.setOnWeb,cli:e.setOnCli}):rl(qn["gap.set_on.web"],{web:e.setOnWeb});return`${r} ${o}`}function ZZ(e){return`${e.label} ${YT(e)}`}function xk(){let e=rl(qn["gap.sentence"],{label:YZ.label,blocks:qn["cli.gap.blocks.sandbox"]}),t=rl(qn["cli.gap.set_on.cli_only"],{cli:YZ.command});return`${e} ${t}`}function eee(){return qn["cli.gaps.sandbox_unchecked"]}var wk,JT,m9t,kKe,YZ;var ph=G(()=>{dh();wk={email_verified:{blocks:["verified","upload_access"],labelKey:"gap.field.email_verified.label",webKey:"gap.field.email_verified.set_on.web",cliKey:"gap.field.email_verified.set_on.cli",isMissing:(e)=>e.status==="pending"||e.email_verified===!1},username:{blocks:["upload_access"],labelKey:"gap.field.username.label",webKey:"gap.field.username.set_on.web",cliKey:"gap.field.username.set_on.cli",isMissing:(e)=>e.username!==void 0&&fh(e.username)},given_name:{blocks:["upload_access","publication"],labelKey:"gap.field.given_name.label",webKey:"gap.field.given_name.set_on.web",cliKey:"gap.field.given_name.set_on.cli",orcidWebKey:"gap.field.given_name.set_on.web.orcid",isMissing:(e)=>fh(e.given_name)},family_name:{blocks:["upload_access","publication"],labelKey:"gap.field.family_name.label",webKey:"gap.field.family_name.set_on.web",cliKey:"gap.field.family_name.set_on.cli",orcidWebKey:"gap.field.family_name.set_on.web.orcid",isMissing:(e)=>fh(e.family_name)},orcid_verified:{blocks:["upload_access"],labelKey:"gap.field.orcid_verified.label",webKey:"gap.field.orcid_verified.set_on.web",cliKey:"gap.field.orcid_verified.set_on.cli",isMissing:(e)=>e.orcid_verified!==!0&&!SKe(e.account_kind)},github_username:{blocks:["upload_access","publication"],labelKey:"gap.field.github_username.label",webKey:"gap.field.github_username.set_on.web",cliKey:"gap.field.github_username.set_on.cli",isMissing:(e)=>fh(e.github_username)},city:{blocks:["upload_access"],labelKey:"gap.field.city.label",webKey:"gap.field.city.set_on.web",cliKey:"gap.field.city.set_on.cli",isMissing:(e)=>fh(e.city)},country:{blocks:["upload_access"],labelKey:"gap.field.country.label",webKey:"gap.field.country.set_on.web",cliKey:"gap.field.country.set_on.cli",isMissing:(e)=>fh(e.country)},why:{blocks:["upload_access"],labelKey:"gap.field.why.label",webKey:"gap.field.why.set_on.web",cliKey:"gap.field.why.set_on.cli",isMissing:null}},JT=Object.keys(wk),m9t=JT.filter((e)=>wk[e].isMissing!==null),kKe={verified:"gap.blocks.verified",upload_access:"gap.blocks.upload_access",publication:"gap.blocks.publication"};YZ={field:"sandbox",label:qn["cli.gap.field.sandbox.label"],command:qn["cli.gap.field.sandbox.set_on.cli"]}});function Sk(e,t){let n=e.sss!==void 0;if(e.derived!==n)t.addIssue({code:ee.custom,path:["sss"],message:e.derived?"derived is true but sss is absent (ADR 0028: the two travel together)":"sss is present but derived is false (ADR 0028: the two travel together)"})}var Po,vk,tee,kk,$Ke,Ek,RKe,DKe,CKe,AKe,OKe,y9t,TKe,b9t,PKe,w9t;var XT=G(()=>{To();Po=/^[a-z]{2}[0-9]{6}$/,vk=/^[0-9a-f]{40}$/,tee=Y({name:E(),modality:E().nullable().optional(),rate:F().nullable().optional(),n_channels:F().int().nonnegative().nullable().optional(),n_samples:F().int().nonnegative().nullable().optional(),duration_s:F().nonnegative().nullable().optional(),source_rate_hz:F().nullable().optional(),n_view_levels:F().int().nonnegative().optional(),view_chunk_columns:F().int().positive().optional(),chunk_samples:F().int().positive().optional(),shard_samples:F().int().positive().optional()}).passthrough(),kk=Y({converted:F().int().nonnegative().optional(),relabelled:F().int().nonnegative().optional(),kept_importer_unit:F().int().nonnegative().optional(),units_column_present:Ge().optional(),sidecar:E().optional(),sidecar_supplied:Ge().optional(),unmatched_channels:F().int().nonnegative().optional(),unmatched_case_only:F().int().positive().optional(),matched_case_only:F().int().positive().optional(),matched_case_only_examples:ae(E()).max(5).optional(),unmatched_raw_label:F().int().positive().optional(),unmatched_examples:ae(E()).max(5).optional()}).passthrough(),$Ke=Y({channels_tsv:F().int().positive(),in_file:F().int().nonnegative(),in_store:F().int().nonnegative()}).passthrough(),Ek=Y({applied:Ge().optional(),method:E().optional(),calibration:E().optional(),cross_talk:E().optional(),mne_version:E().optional()}).passthrough();RKe=Y({path:E(),zarr:E().regex(/\.zarr$/,"must end in .zarr"),updated_utc:E().optional(),source_tree:$t("raw"),derived:Ge(),modalities:ae(E()).optional(),groups:ae(tee).optional(),power_line_frequency:F().nullable().optional(),event_description_count:F().int().nonnegative().optional(),n_events:F().int().nonnegative().optional(),trial_types:Ao(E(),F().int().nonnegative()).optional(),units_report:kk.optional(),channels_tsv_read_error:Ge().optional(),channels_tsv_count_mismatch:$Ke.optional(),split_members:ae(E()).optional(),sss:Ek.optional()}).passthrough().superRefine(Sk),DKe=Y({path:E(),zarr:E().regex(/\.zarr$/,"must end in .zarr").optional(),code:E(),reason:E(),detail:E().nullable().optional(),attempts:F().int().nonnegative().optional()}).passthrough(),CKe=vt(["infra_failure","memory_budget","not_attempted"]),AKe=Y({path:E(),zarr:E().regex(/\.zarr$/,"must end in .zarr"),reason:CKe,attempts:F().int().nonnegative(),last_error:E().nullable().optional(),last_attempt_utc:E().nullable().optional()}).passthrough(),OKe=Y({level0:$t("<zarr>/<group>/0"),view:$t("<zarr>/<group>/view/<L>"),view_levels:$t("1..n_view_levels from the group attrs"),scale_offset:$t("level-0 array attrs scale[] and offset[]; physical = digital * scale + offset"),events:$t("<data_base>events.parquet").optional()}).passthrough(),y9t=Y({format:$t("nemar-zarr-index"),format_version:$t(3),dataset_id:E().regex(Po,"NEMAR dataset id (nm/on/xx band)"),contract_base:E().regex(/^https:\/\//,"must be https"),data_base:E().regex(/^https:\/\//,"must be https"),data_base_kind:$t("s3-public"),s3_uri:E().regex(/^s3:\/\//,"must be an s3:// URI"),s3_region:E().min(1),s3_anonymous:Ge(),source_commit:E().regex(vk,"must be a full 40-hex SHA"),engine_version:E().min(1),biosigio_version:E().nullable().optional(),updated_utc:E(),discovered_count:F().int().nonnegative(),store_count:F().int().nonnegative(),n_recordings:F().int().nonnegative(),errors:F().int().nonnegative(),failure_count:F().int().nonnegative(),pending_count:F().int().nonnegative(),stores:ae(RKe),failures:ae(DKe),pending:ae(AKe),doi:E().nullable().optional(),license:E().nullable().optional(),citation:E().nullable().optional(),hed_version:E().nullable().optional(),events_parquet:E().regex(/^https:\/\//,"must be https").optional(),events_row_count:F().int().nonnegative().optional(),layout:OKe}).passthrough(),TKe=Y({name:E(),configuration:Ao(E(),Du()).optional()}).passthrough(),b9t=Y({zarr_format:$t(3),node_type:$t("array"),shape:ae(F().int().nonnegative()),data_type:E(),chunk_grid:Y({name:E(),configuration:Ao(E(),Du()).optional()}).passthrough(),codecs:ae(TKe),fill_value:Du().optional(),attributes:Ao(E(),Du()).optional(),dimension_names:ae(E().nullable()).optional()}).passthrough(),PKe=Y({path:E(),zarr:E().regex(/\.zarr$/,"must end in .zarr"),groups:ae(tee).optional(),modalities:ae(E()).optional()}).passthrough(),w9t=Y({format:$t("nemar-zarr-index"),format_version:F().int(),dataset_id:E().regex(Po,"NEMAR dataset id (nm/on/xx band)"),source_commit:E(),stores:ae(PKe)}).passthrough()});function nee(e){let t=e.unit?` (${e.unit})`:"";switch(e.valueKind){case"enum":return`${e.label} -- comma-separated, one or more of: ${(e.enumValues??[]).join(", ")}`;case"number":return`${e.label}${t} -- range (e.g. 10..50, 10.., ..50, or 10)`;case"bytes":return`${e.label}${t} -- range with optional units (e.g. 10gb..2tb, 500mb.., ..1gb; bare = bytes)`;case"duration":return`${e.label}${t} -- range with optional units (e.g. 30m..2h, 100h.., ..90s; bare = seconds)`;case"text":return`${e.label} -- substring match`;case"version":return`${e.label} -- exact or prefix match`}}var IKe,NKe,FKe,MKe,Ra,v9t;var $k=G(()=>{zT();IKe=["10-05","10-10","10-20","biosemi","egi-geodesic","other"],NKe=["50","60"],FKe=["ready","pending","failed"],MKe=HT.options,Ra=[{key:"subjects",flag:"--subjects",queryParam:"subjects",valueKind:"number",label:"Subject count",unit:"subjects"},{key:"channels",flag:"--channels",queryParam:"channels",valueKind:"number",label:"Channel count",unit:"channels"},{key:"sessions",flag:"--sessions",queryParam:"sessions",valueKind:"number",label:"Session count",unit:"sessions"},{key:"size",flag:"--size",queryParam:"size",valueKind:"bytes",label:"Dataset size"},{key:"files",flag:"--files",queryParam:"files",valueKind:"number",label:"File count",unit:"files"},{key:"citations",flag:"--citations",queryParam:"citations",valueKind:"number",label:"Citation count",unit:"citations"},{key:"duration",flag:"--duration",queryParam:"duration",valueKind:"duration",label:"Total recording duration"},{key:"recording-length",flag:"--recording-length",queryParam:"recording_length",valueKind:"duration",label:"Per-recording duration"},{key:"recordings",flag:"--recordings",queryParam:"recordings",valueKind:"number",label:"Recording count",unit:"recordings"},{key:"unavailable",flag:"--unavailable",queryParam:"unavailable",valueKind:"number",label:"Unavailable recording count",unit:"recordings"},{key:"age",flag:"--age",queryParam:"age",valueKind:"number",label:"Participant age",unit:"years"},{key:"rate",flag:"--rate",queryParam:"rate",valueKind:"number",label:"Sampling rate",unit:"Hz"},{key:"powerline",flag:"--powerline",queryParam:"powerline",valueKind:"enum",label:"Power line frequency",enumValues:NKe},{key:"reference",flag:"--reference",queryParam:"reference",valueKind:"text",label:"EEG reference"},{key:"placement",flag:"--placement",queryParam:"placement",valueKind:"text",label:"Electrode placement scheme"},{key:"electrode-system",flag:"--electrode-system",queryParam:"electrode_system",valueKind:"enum",label:"Electrode system",enumValues:IKe},{key:"source",flag:"--source",queryParam:"source",valueKind:"enum",label:"Source archive",enumValues:MKe},{key:"zarr",flag:"--zarr",queryParam:"zarr",valueKind:"enum",label:"Zarr conversion status",enumValues:FKe},{key:"bids-version",flag:"--bids-version",queryParam:"bids_version",valueKind:"version",label:"BIDS version"},{key:"hed-version",flag:"--hed-version",queryParam:"hed_version",valueKind:"version",label:"HED version"}],v9t=new Map(Ra.map((e)=>[e.key,e]))});var jKe,R9t,LKe,aee,rb,ree,qKe,cee,BKe=20,UKe=100,HKe,lee,zKe,D9t,C9t,GKe,A9t,O9t,VKe,WKe,KKe,T9t,JKe=50,YKe=500,P9t,XKe,QKe,I9t,ZKe=1000,eJe=5000,oee=8,tJe=100,nJe=32,see,N9t,rJe,oJe,sJe,F9t,iJe=800,aJe=4000,M9t,j9t,QT=60,ZT=64,iee,cJe=86400,lJe=4096,L9t,uJe,dJe,q9t;var uee=G(()=>{To();$k();XT();jKe=Y({dataset_id:E().regex(Po),name:E(),doi:E().nullable().optional(),license:E().nullable().optional(),modalities:ae(E()).optional(),tasks:ae(E()).optional(),subject_count:F().int().nonnegative().nullable().optional(),has_hed:ah([$t(0),$t(1)]).nullable().optional(),hed_version:E().nullable().optional(),store_count:F().int().nonnegative().nullable().optional(),recording_count:F().int().nonnegative().nullable().optional(),recordings_unavailable:F().int().nonnegative().nullable().optional(),total_recording_duration:F().nullable().optional(),zarr_converted_at:E().nullable().optional(),zarr_source_commit:E().nullable().optional(),zarr_errors:F().int().nonnegative().nullable().optional(),zarr_verify_status:vt(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:E().nullable().optional(),index_url:E().nullable().optional()}).passthrough(),R9t=Y({format:$t("nemar-zarr-catalog"),format_version:F().int(),generated_utc:E(),contract_base:E(),count:F().int().nonnegative(),datasets:ae(jKe)}).passthrough(),LKe=["verified","failed","unverifiable"],aee=vt(LKe).nullable(),rb=Y({dataset_id:E().regex(Po),doi:E().nullable(),license:E().nullable(),citation:E().nullable(),source_commit:E().regex(vk),index_etag:E().nullable(),engine_version:E(),source_tree:$t("raw"),derived:Ge(),sss:Ek.optional(),lossy:Ge(),dtype:E().nullable(),effective_rate_hz:F().nullable(),source_rate_hz:F().nullable(),units_report:kk.nullable().optional(),zarr_verify_status:aee,note:E().nullable().optional()}).passthrough().superRefine(Sk),ree=Y({start:F().int().nonnegative(),end:F().int().nonnegative()}).passthrough().refine((e)=>e.end>=e.start,{message:"end must be >= start",path:["end"]}),qKe=Y({python_zarr:E(),zarrita:E(),python_browser:E()}).passthrough(),cee=Y({contract_base:E(),data_base:E(),s3_uri:E(),s3_region:E(),s3_anonymous:Ge(),zarr:E(),group:E(),level:ah([$t("0"),F().int().positive()]),array_path:E(),dtype:E().nullable(),codecs:ae(Du()).optional(),chunk_samples:F().int().positive().nullable(),shard_samples:F().int().positive().nullable(),n_channels:F().int().nonnegative().nullable(),sample_slice:ree.optional(),channel_slice:ree.optional(),scale_offset:E(),how_to:qKe}).passthrough(),HKe=Object.fromEntries(Ra.map((e)=>[e.queryParam,E().optional()])),lee={modality:E().optional(),task:E().optional(),has_hed:Ge().optional(),has_zarr:Ge().optional(),author:E().optional(),has_doi:Ge().optional(),has_zarr_verified:Ge().optional(),data_complete:Ge().optional(),recent:F().int().positive().optional(),license:E().optional()},zKe=Object.keys(lee),D9t=[...zKe,...Ra.map((e)=>e.queryParam)],C9t=Y({query:E().optional(),...lee,include_unknown:Ge().optional(),...HKe,limit:F().int().positive().max(UKe).default(BKe)}).passthrough(),GKe=Y({dataset_id:E().regex(Po),name:E(),doi:E().nullable().optional(),license:E().nullable().optional(),modalities:ae(E()).optional(),tasks:ae(E()).optional(),subject_count:F().int().nullable().optional(),has_hed:Ge().nullable().optional(),has_zarr:Ge()}).passthrough(),A9t=Y({results:ae(GKe),count:F().int().nonnegative(),limit:F().int(),note:E().nullable().optional(),truncated:Ge().optional()}).passthrough(),O9t=Y({dataset_id:E().regex(Po)}).passthrough(),VKe=["list_recordings","get_events","render_overview","read_window"],WKe=Y({next_cheapest_tool:vt(VKe),reason:E()}).passthrough(),KKe=["pending","ready","failed"],T9t=Y({dataset_id:E().regex(Po),name:E(),doi:E().nullable(),license:E().nullable(),citation:E().nullable(),modalities:ae(E()).optional(),tasks:ae(E()).optional(),subject_count:F().int().nullable().optional(),has_hed:Ge().nullable().optional(),hed_version:E().nullable().optional(),recording_count:F().int().nullable().optional(),total_recording_duration_s:F().nullable().optional(),zarr_status:vt(KKe).nullable().optional(),zarr_verify_status:aee.optional(),zarr_source_commit:E().nullable().optional(),zarr_store_count:F().int().nullable().optional(),cost_hint:WKe}).passthrough(),P9t=Y({dataset_id:E().regex(Po),modality:E().optional(),min_duration_s:F().nonnegative().optional(),include_derived:Ge().default(!1),limit:F().int().positive().max(YKe).default(JKe),offset:F().int().nonnegative().default(0)}).passthrough(),XKe=Y({name:E(),modality:E().nullable().optional(),rate:F().nullable().optional(),n_channels:F().int().nullable().optional(),duration_s:F().nullable().optional(),n_view_levels:F().int().nonnegative().nullable().optional(),n_samples:F().int().nonnegative().nullable().optional(),view_chunk_columns:F().int().positive().nullable().optional()}).passthrough(),QKe=Y({path:E(),zarr:E(),source_tree:$t("raw"),derived:Ge(),groups:ae(XKe).optional(),n_events:F().int().nonnegative().optional(),sss:Ek.optional(),units_report:kk.optional()}).passthrough().superRefine(Sk),I9t=Y({dataset_id:E().regex(Po),source_commit:E().regex(vk).nullable(),recordings:ae(QKe),total_count:F().int().nonnegative(),excluded_derived_count:F().int().nonnegative(),limit:F().int(),offset:F().int(),index_format_version:F().int(),discovered_count:F().int().nonnegative().nullable(),failure_count:F().int().nonnegative().nullable(),pending_count:F().int().nonnegative().nullable(),excluded_legacy_non_raw_count:F().int().nonnegative(),note:E().nullable().optional(),envelope:rb.optional()}).passthrough(),see=E().min(1).max(64),N9t=Y({dataset_id:E().regex(Po),recording:E(),group:E().optional(),limit:F().int().positive().max(eJe).default(ZKe),offset:F().int().nonnegative().default(0),where:Ao(see,ae(ah([E(),F()])).min(1).max(tJe)).refine((e)=>{let t=Object.keys(e).length;return t>=1&&t<=oee},{message:`where names 1 to ${oee} columns`}).optional(),columns:ae(see).min(1).max(nJe).optional()}).passthrough(),rJe=Y({store_path:E(),group_name:E(),onset_s:F(),duration_s:F().nullable().optional(),sample_index:F().int().nonnegative(),trial_type:E().nullable().optional(),value:ah([E(),F()]).nullable().optional(),hed:E().nullable().optional()}).passthrough(),oJe=rJe.partial().required({onset_s:!0,sample_index:!0}),sJe=Y({name:E(),distinct_count:F().int().nonnegative(),null_count:F().int().nonnegative(),values:ae(Y({value:E(),count:F().int().positive()}).passthrough()).nullable()}).passthrough(),F9t=Y({dataset_id:E().regex(Po),recording:E(),events:ae(oJe),source:vt(["events_parquet","events_tsv_fallback"]),estimated:Ge(),total_count:F().int().nonnegative(),limit:F().int(),offset:F().int(),truncated:Ge(),note:E().nullable().optional(),columns_summary:ae(sJe).optional(),envelope:rb.optional()}).passthrough(),M9t=Y({dataset_id:E().regex(Po),recording:E(),group:E().optional(),width_px:F().int().positive().max(aJe).default(iJe)}).passthrough(),j9t=Y({dataset_id:E().regex(Po),recording:E(),group:E(),level:F().int().positive(),width_px:F().int().positive(),height_px:F().int().positive(),mime_type:$t("image/png"),columns_read:F().int().nonnegative(),chunks_read:F().int().nonnegative(),bytes_read:F().int().nonnegative(),envelope:rb.optional()}).passthrough(),iee=QT*ZT,L9t=Y({dataset_id:E().regex(Po),recording:E(),group:E().optional(),start_s:F().nonnegative().default(0),duration_s:F().positive().max(cJe).default(10),channels:ae(F().int().nonnegative()).max(lJe).optional(),taste:Ge().default(!1)}).passthrough().superRefine((e,t)=>{if(!e.taste)return;if(!e.channels||e.channels.length===0){t.addIssue({code:ee.custom,message:"taste requires channels: name the channel indices you want (list_recordings reports each group's n_channels), or omit taste for a recipe",path:["channels"]});return}if(e.duration_s>QT)t.addIssue({code:ee.custom,message:`taste duration_s (${e.duration_s}) exceeds the ${QT} s cap; omit taste for a recipe instead`,path:["duration_s"]});if(e.channels.length>ZT)t.addIssue({code:ee.custom,message:`taste channels (${e.channels.length}) exceeds the ${ZT}-channel cap; omit taste for a recipe instead`,path:["channels"]});let n=e.duration_s*e.channels.length;if(n>iee)t.addIssue({code:ee.custom,message:`taste exceeds the cap of ${iee} channel-seconds (duration_s x channels = ${n}); omit taste for a recipe instead`,path:["duration_s"]})}),uJe=Y({mode:$t("recipe"),recipe:cee,envelope:rb}).passthrough(),dJe=Y({mode:$t("taste"),start_s:F(),duration_s:F(),channels:ae(F().int()),sample_rate_hz:F(),values:ae(ae(F())),recipe:cee,chunks_read:F().int().nonnegative(),bytes_read:F().int().nonnegative(),filled_ranges:ae(Y({start_sample:F().int().nonnegative(),end_sample:F().int().nonnegative(),start_s:F(),end_s:F()}).passthrough()),note:E().nullable().optional(),envelope:rb}).passthrough(),q9t=PT("mode",[uJe,dJe])});function fee(e){let t=ob.indexOf(e);if(t<0)throw RangeError("not a launcher failure code");return fJe+t}var eP,ob,dee=0,fJe=10,pJe,mJe,H9t,z9t;var pee=G(()=>{eP=/^[a-z0-9_]{1,64}$/,ob=["code_fetch_failed","dataset_fetch_failed","entry_not_found","runtime_error","out_of_memory","time_limit","result_upload_failed"];pJe=["code_fetch_failed","dataset_fetch_failed","tapis_submit_failed","submit_timeout","staging_failed","launch_failed","archive_failed","tapis_error","result_verification_failed","records_unavailable","result_upload_failed"],mJe=["results_too_large","results_quota_exceeded","too_many_outputs"],H9t={code_fetch_failed:["unsafe_archive","archive_too_large","bad_response","fetch_failed","checksum_mismatch","digest_mismatch","size_mismatch","content_missing","disk_error"],dataset_fetch_failed:["bad_include","too_many_files","too_many_bytes","dataset_not_found","bad_manifest","manifest_too_large","unsafe_path","bad_response","fetch_failed","checksum_mismatch","size_mismatch","content_missing","file_not_found","disk_error"],entry_not_found:[],runtime_error:["entry_failed","terminated","outputs_unreadable","invalid_spec","unsupported_runtime","scratch_in_output","scratch_unavailable","no_container_runtime","image_missing","runtime_unusable","internal_error","output_dir_not_empty","bind_source_unsafe","pid_namespace_unavailable"],out_of_memory:[],time_limit:[],result_upload_failed:[...mJe,"outputs_unreadable","bad_response","fetch_failed","incomplete_plan","upload_failed","outputs_refused","complete_refused","internal_error"]},z9t=[...ob,...pJe.filter((e)=>!ob.includes(e))]});function SJe(e){return E().max(e).regex(gJe).refine((t)=>!yJe.test(t),{message:"a path may not hold . or .. segments"})}function oP(e){if(e!==null&&typeof e==="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))oP(t)}return e}function FJe(e){let t=0;while(t<e.length){if(e[t]!=="["){t++;continue}let n=e[t+1]==="!"?t+2:t+1,r=e.indexOf("]",n);if(r===-1)return null;if(r===n)return"empty_class";let o=Array.from(e.slice(n,r),(s)=>s.codePointAt(0));for(let s=0;s<o.length;)if(s+2<o.length&&o[s+1]===45){if(o[s]>o[s+2])return"inverted_range";s+=3}else s++;t=r+1}return null}function BJe(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n>=55296&&n<=56319){let r=e.charCodeAt(t+1);if(!(r>=56320&&r<=57343))return!1;t++}else if(n>=56320&&n<=57343)return!1}return!0}function UJe(e,t){let n=FJe(e);if(n!==null)t.addIssue({code:ee.custom,message:`an include pattern the dialect refuses: ${n}`})}function mh(e){let t=2;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r===34||r===92)t+=2;else if(r===8||r===9||r===10||r===12||r===13)t+=2;else if(r<32||r>=127)t+=6;else t+=1}return t}function VJe(e){let t=0;if(e.entry!==void 0)t+=mh(e.entry)+1;for(let n of e.command??[])t+=mh(n)+1;for(let n of e.args??[])t+=mh(n)+1;for(let n of e.datasets??[])for(let r of n.include??[])t+=mh(r)+1;for(let[n,r]of Object.entries(e.env??{}))if(r!==void 0)t+=mh(n)+mh(r)+2;return t}var nP="\\u0000-\\u001f\\u007f",hJe,mee,gJe,yJe,bJe,wJe,gee=1e5,_Je,xJe,vJe,yee,bee,kJe,EJe=(e,t=kJe)=>F().int().min(e).max(t),Dt,rP,Dk,wee,$Je,sP,RJe,Rk=2880,_ee,DJe,CJe,AJe,OJe,TJe="A path inside the bundle. With runtime python the launcher runs python /code/<entry> followed by args; with runtime image and an entry it runs /code/<entry> directly, followed by args, which needs the executable bit that the bundle packer must preserve. The runtime image must provide python on its PATH for the python runtime. A bundle archive's member names may carry a leading ./; absolute names, .. segments, links, devices and FIFOs are refused by the launcher.",PJe="An argument vector, run as given, with args appended.",IJe="Arguments, each as one argument: after python /code/<entry> (runtime python with an entry), after /code/<entry> (runtime image with an entry) or after the command.",NJe="Patterns that select the dataset's files, matched against manifest paths relative to the dataset root; every file when there are none. The dialect: **/ matches zero or more directories (so a/**/b matches a/b); ** elsewhere matches any run of characters including /; * and ? stay inside one path segment; [abc], [a-c] and [!abc] are character classes; a character class never matches /, so like * and ? it stays inside one path segment, and a negated class [!a] matches any single character except a and /; an unterminated [ is a literal [; an empty class [] and an inverted range such as [z-a] are refused, and bad_include is exactly the set of patterns this dialect refuses; matching is case-sensitive; there are no escapes. A matcher MUST run in time linear in the pattern's length times the path's length (no backtracking).",MJe,jJe,LJe,qJe,Ck=(e)=>e.refine(BJe,{message:"a lone surrogate is not text a process argument can carry"}),HJe,zJe,GJe,WJe=49152,K9t,KJe,JJe,YJe,XJe,J9t,tP=1073741824,hee=1048576,Y9t,QJe,X9t,xee,Q9t,ZJe,Z9t;var vee=G(()=>{To();pee();hJe=`[^/\\\\${nP}]+`,mee=hJe,gJe=new RegExp(`^(?:${mee}/)*${mee}$`),yJe=/(?:^|\/)\.\.?(?:\/|$)/,bJe=new RegExp(`^[^\\\\${nP}]+$`),wJe=/^\/|(?:^|\/)\.\.(?:\/|$)/,_Je=/^job_[0-9a-f]{24}$/,xJe=/^[0-9a-f]{64}$/,vJe=/^sha256:[0-9a-f]{64}$/,yee=/^[a-z]{2}[0-9]{6}$/,bee=/^[0-9A-Za-z][0-9A-Za-z._+-]{0,63}$/,kJe=Number.MAX_SAFE_INTEGER,Dt=EJe,rP=E().regex(_Je),Dk=E().regex(xJe);wee=SJe,$Je=E().max(256).regex(bJe).refine((e)=>!wJe.test(e),{message:"a pattern may not leave the dataset"});sP=["shared","compute","debug","large-shared","preempt","gpu-shared","gpu","gpu-debug","gpu-preempt"],RJe=Y({maxNodes:Dt(1,64),maxCoresPerNode:Dt(0,256),maxGpusPerNode:Dt(0,8),maxMinutes:Dt(1,10080)}).strict(),_ee=oP({shared:{pool:"cpu",rate:"core_or_memory",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:64,maxGpusPerNode:0,maxMinutes:Rk}},compute:{pool:"cpu",rate:"whole_cpu_node",preempt:!1,ceiling:{maxNodes:2,maxCoresPerNode:128,maxGpusPerNode:0,maxMinutes:Rk}},debug:{pool:"cpu",rate:"core_or_memory",preempt:!1,ceiling:{maxNodes:2,maxCoresPerNode:128,maxGpusPerNode:0,maxMinutes:30}},"large-shared":{pool:"cpu",rate:"core_or_memory",preempt:!1,ceiling:null},preempt:{pool:"cpu",rate:"core_or_memory",preempt:!0,ceiling:null},"gpu-shared":{pool:"gpu",rate:"gpu_or_memory",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:40,maxGpusPerNode:3,maxMinutes:Rk}},gpu:{pool:"gpu",rate:"whole_gpu_node",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:40,maxGpusPerNode:4,maxMinutes:Rk}},"gpu-debug":{pool:"gpu",rate:"gpu_or_memory",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:40,maxGpusPerNode:4,maxMinutes:30}},"gpu-preempt":{pool:"gpu",rate:"gpu_or_memory",preempt:!0,ceiling:null}}),DJe=["OMP_NUM_THREADS","MKL_NUM_THREADS","OPENBLAS_NUM_THREADS","NUMEXPR_NUM_THREADS","PYTHONHASHSEED","MPLBACKEND"],CJe=/^[ -~]*$/,AJe=E().max(256).regex(CJe),OJe=Ao(vt(DJe),AJe);MJe=["python","matlab","image"],jJe=/^[A-Za-z0-9][A-Za-z0-9 ._-]{0,79}$/,LJe=/^[a-z][a-z0-9-]{0,63}$/,qJe=/^(?:docker:\/\/)?[a-z0-9]+(?:[._-][a-z0-9]+)*(?::[0-9]{1,5})?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)+@sha256:[0-9a-f]{64}$/;HJe=Y({size:Dt(1),sha256:Dk}).strict(),zJe=Y({id:E().regex(yee),version:E().regex(bee),include:ae(Ck($Je).superRefine(UJe)).max(64).optional().describe(NJe)}).strict(),GJe=Ck(E().max(1024));K9t=Y({name:E().regex(jJe),runtime:vt(MJe),entry:Ck(wee(240)).optional().describe(TJe),command:ae(Ck(E().min(1).max(1024))).min(1).max(64).optional().describe(PJe),args:ae(GJe).max(64).default([]).describe(IJe),bundle:HJe.optional(),datasets:ae(zJe).max(20).default([]),partition:vt(sP),nodes:Dt(1,64).default(1),cores:Dt(1,256).default(1),memory_mb:Dt(1,16777216).optional(),gpus:Dt(0,8).default(0),minutes:Dt(1,10080),output_dir:$t("outputs").default("outputs"),env:OJe.default({}),recipe:E().regex(LJe).optional(),image:E().max(512).regex(qJe).optional()}).strict().superRefine((e,t)=>{let n=(o,s)=>t.addIssue({code:ee.custom,path:[o],message:s});if(e.entry!==void 0&&e.command!==void 0)n("command","an entry and a command are one or the other");if(e.runtime==="image"&&e.image===void 0)n("image","an image job names a digest-pinned image");if(e.runtime!=="image"&&e.image!==void 0)n("image","only an image job names an image");if(e.recipe===void 0&&e.entry===void 0&&e.command===void 0)n("entry","a job with no recipe names an entry or a command");if(e.entry!==void 0&&e.bundle===void 0)n("bundle","an entry needs the bundle that holds it");if(VJe(e)>WJe)t.addIssue({code:ee.custom,path:[],message:"the entry, command, arguments, patterns and environment are too large to launch"});let r=_ee[e.partition].pool;if(r==="gpu"&&e.gpus<1)n("gpus","a GPU partition needs at least one GPU");if(r==="cpu"&&e.gpus!==0)n("gpus","a CPU partition takes no GPU")}),KJe=/^[A-Za-z0-9_.-]{1,64}$/,JJe=/^[a-z0-9]+(?:[.-][a-z0-9]+)*(?::[0-9]{1,5})?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)*$/,YJe=Object.fromEntries(sP.map((e)=>[e,RJe.optional()])),XJe=Y({maxOpenReservations:Dt(0,1e5),maxReservedMilliPerDay:Dt(0)}).strict(),J9t=Y({defaultGrantMilli:Y({cpu:Dt(0),gpu:Dt(0)}).strict(),renewal:Y({enabled:Ge(),everyDays:Dt(1,366).nullable()}).strict().refine((e)=>!e.enabled||e.everyDays!==null,{message:"renewal that is on says how often",path:["everyDays"]}),ceilings:Y(YJe).strict(),maxLiveJobsPerPerson:Dt(0,1000),pipelines:Y({dailyJobCap:Dt(0,1e5),maxLiveJobs:Y({cpu:Dt(0,1000),gpu:Dt(0,1000)}).strict()}).strict(),clients:Ao(E().regex(KJe),XJe),reservationWaitMinutes:Dt(1,1440),retention:Y({recordsYears:Dt(1,30),logsDays:Dt(1,3650),resultsDays:Dt(14,365)}).strict(),resultLimits:Y({maxJobBytes:Dt(1),maxFiles:Dt(1,gee),maxStoredBytesPerPerson:Dt(1),maxStoredBytesTotal:Dt(1)}).strict(),settle:Y({toleranceMilli:Dt(0),tolerancePercent:Dt(0,100)}).strict(),registries:ae(E().max(255).regex(JJe)).max(64),bundleLimits:Y({maxTotalBytes:Dt(1),maxFiles:Dt(1,1e5),maxFileBytes:Dt(1)}).strict()}).strict(),Y9t=oP({defaultGrantMilli:{cpu:0,gpu:0},renewal:{enabled:!1,everyDays:null},ceilings:Object.fromEntries(sP.flatMap((e)=>{let t=_ee[e].ceiling;return t?[[e,{...t}]]:[]})),maxLiveJobsPerPerson:4,pipelines:{dailyJobCap:50,maxLiveJobs:{cpu:8,gpu:4}},clients:{},reservationWaitMinutes:30,retention:{recordsYears:7,logsDays:365,resultsDays:30},resultLimits:{maxJobBytes:20*tP,maxFiles:5000,maxStoredBytesPerPerson:50*tP,maxStoredBytesTotal:1024*tP},settle:{toleranceMilli:1000,tolerancePercent:5},registries:[],bundleLimits:{maxTotalBytes:100*hee,maxFiles:2000,maxFileBytes:25*hee}}),QJe=Y({path:wee(512),size:Dt(0),sha256:Dk}).strict(),X9t=Y({job_id:rP,files:ae(QJe).max(gee)}).strict(),xee=F().int().min(-255).max(255).nullable(),Q9t=Y({job_id:rP,failure_code:vt(ob).nullable(),detail:E().regex(eP).nullable(),exit_number:F().int(),entry_exit_code:xee}).strict().superRefine((e,t)=>{let n=e.failure_code===null?dee:fee(e.failure_code);if(e.exit_number!==n)t.addIssue({code:ee.custom,path:["exit_number"],message:"the exit number is the one the failure code gives"})}),ZJe=Y({id:E().regex(yee),version:E().regex(bee),mode:vt(["bind","download"]),files:Dt(0),bytes:Dt(0)}).strict(),Z9t=Y({job_id:rP,launch_spec_digest:Dk,bundle_digest:Dk.nullable(),image:Y({uri:E().regex(/^[^\s]{1,512}$/),digest:E().regex(vJe)}).strict(),runtime_version:E().regex(new RegExp(`^[^${nP}]{1,128}$`)),staging:ae(ZJe).max(20),timings:Ao(E().regex(eP),F().finite().min(0)).refine((e)=>Object.keys(e).length<=16,{message:"at most 16 phases"}),slurm_job_id:E().regex(/^[0-9A-Za-z_+.-]{1,64}$/).nullable(),entry_exit_code:xee}).strict()});var hh=G(()=>{UT();ch();zT();tb();GT();bk();dh();ph();XT();uee();vee()});function Ar(e){return typeof e==="string"&&nYe.test(e)&&!e.includes("..")}function ol(e){return/^v\d/.test(e)?e.slice(1):e}function Or(e,t){return ol(e)===ol(t)}var nYe;var Mi=G(()=>{nYe=/^[0-9A-Za-z][0-9A-Za-z._-]{0,63}$/});function V(e){if(e instanceof Error)return e.message;return String(e)}function Ok(e){if(!(e instanceof L)||e.statusCode!==404)return!1;let t=e.rawBody;return typeof t==="object"&&t!==null&&t.error==="Not Found"&&typeof t.message==="string"}var L,Au;var Ve=G(()=>{L=class L extends Error{statusCode;details;step;blockReason;missing;code;reason;rawBody;constructor(e,t,n,r,o,s){super(t);this.statusCode=e;this.details=n;this.step=r;this.blockReason=o;this.missing=s;this.name="ApiError"}};Au=class Au extends L{mode;eta;constructor(e,t,n,r){super(503,t,r);this.mode=e;this.eta=n;this.name="MaintenanceError"}}});var rYe,oYe,sYe,w7t,See="override_publication_review",$ee="publication_review_not_clear",cP=2000;var Tk=G(()=>{rYe=["dispatched","redispatched","dispatch_claimed"],oYe=["review_disabled","not_applicable","not_owned_here","request_not_requested","screen_not_ready","running","has_result","platform_limit"],sYe=["dispatch_failed","dispatch_unconfigured"],w7t=[...rYe,...oYe,...sYe]});var Pk=1e4;function Ik(e){return e?aYe:Da}var Da,v7t,iYe,aYe,lP;var Nk=G(()=>{Da=["ci_check","enrichment_check","s3_public_read","repo_public","tag_protect","doi_create","update_metadata","update_readme","create_tag","create_release","upload_to_zenodo","publish_doi","version_doi","s3_lock","sync_nemar","notify_user"],v7t=Da.slice(0,Da.indexOf("s3_public_read")),iYe=["update_metadata","update_readme","upload_to_zenodo","publish_doi"],aYe=Da.filter((e)=>!iYe.includes(e));lP={ci_check:"Check CI",enrichment_check:"Enrichment check",s3_public_read:"S3 public read",repo_public:"Make catalog row public",tag_protect:"Tag protection",doi_create:"Create DOI",update_metadata:"Update metadata",update_readme:"Update README",create_tag:"Create version tag",create_release:"Create GitHub release",upload_to_zenodo:"Upload to Zenodo (no-op)",publish_doi:"Publish DOI (irreversible)",version_doi:"Version DOI + manifest",s3_lock:"S3 Object Lock",sync_nemar:"Sync NEMAR (no-op)",notify_user:"Notify user"}});function cYe(e){return`%${e.replace(/[\\%_]/g,"\\$&")}%`}function lYe(e){return new TextEncoder().encode(cYe(e)).length}function Ree(e){if(lYe(e)<=50)return null;return["search is too long: its match pattern may be at most 50 bytes,","which is about 48 plain characters (each of _ % \\ counts twice and a non-ASCII","character counts by its UTF-8 length)"].join(" ")}function Fk(e){return e.replace(/[A-Z]/g,(t)=>t.toLowerCase())}function Dee(e,t){if(e==="")return!0;let n=Fk(e);return t.some((r)=>typeof r==="string"&&Fk(r).includes(n))}function Cee(e,t){return Fk(e)===Fk(t)}function Mk(e){let t=[],n="",r="start",o=!1;for(let s of e)switch(s){case"\\":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(o)n+=s;r="property",o=!o;break}case".":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="property";break}if(o){o=!1,n+=s;break}if(uP.has(n))return[];t.push(n),n="",r="property";break}case"[":{if(r==="index")throw Error("Invalid character in an index");if(r==="indexEnd"){r="index";break}if(o){o=!1,n+=s;break}if(r==="property"){if(uP.has(n))return[];t.push(n),n=""}r="index";break}case"]":{if(r==="index"){t.push(Number.parseInt(n,10)),n="",r="indexEnd";break}if(r==="indexEnd")throw Error("Invalid character after an index")}default:{if(r==="index"&&!uYe.has(s))throw Error("Invalid character in an index");if(r==="indexEnd")throw Error("Invalid character after an index");if(r==="start")r="property";if(o)o=!1,n+="\\";n+=s}}if(o)n+="\\";switch(r){case"property":{if(uP.has(n))return[];t.push(n);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function dP(e,t){if(typeof t!=="number"&&Array.isArray(e)){let n=Number.parseInt(t,10);return Number.isInteger(n)&&e[n]===e[t]}return!1}function Aee(e,t){if(dP(e,t))throw Error("Cannot use string index")}function Oee(e,t,n){if(!Cf(e)||typeof t!=="string")return n===void 0?e:n;let r=Mk(t);if(r.length===0)return n;for(let o=0;o<r.length;o++){let s=r[o];if(dP(e,s))e=o===r.length-1?void 0:null;else e=e[s];if(e===void 0||e===null){if(o!==r.length-1)return n;break}}return e===void 0?n:e}function fP(e,t,n){if(!Cf(e)||typeof t!=="string")return e;let r=e,o=Mk(t);for(let s=0;s<o.length;s++){let i=o[s];if(Aee(e,i),s===o.length-1)e[i]=n;else if(!Cf(e[i]))e[i]=typeof o[s+1]==="number"?[]:{};e=e[i]}return r}function Tee(e,t){if(!Cf(e)||typeof t!=="string")return!1;let n=Mk(t);for(let r=0;r<n.length;r++){let o=n[r];if(Aee(e,o),r===n.length-1)return delete e[o],!0;if(e=e[o],!Cf(e))return!1}}function Pee(e,t){if(!Cf(e)||typeof t!=="string")return!1;let n=Mk(t);if(n.length===0)return!1;for(let r of n){if(!Cf(e)||!(r in e)||dP(e,r))return!1;e=e[r]}return!0}var Cf=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},uP,uYe;var Iee=G(()=>{uP=new Set(["__proto__","prototype","constructor"]),uYe=new Set("0123456789")});import Tn from"path";import Nee from"os";import pP from"process";function hP(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(pP.platform==="darwin")return dYe(e);if(pP.platform==="win32")return fYe(e);return pYe(e)}var Ou,mP,yh,dYe=(e)=>{let t=Tn.join(Ou,"Library");return{data:Tn.join(t,"Application Support",e),config:Tn.join(t,"Preferences",e),cache:Tn.join(t,"Caches",e),log:Tn.join(t,"Logs",e),temp:Tn.join(mP,e)}},fYe=(e)=>{let t=yh.APPDATA||Tn.join(Ou,"AppData","Roaming"),n=yh.LOCALAPPDATA||Tn.join(Ou,"AppData","Local");return{data:Tn.join(n,e,"Data"),config:Tn.join(t,e,"Config"),cache:Tn.join(n,e,"Cache"),log:Tn.join(n,e,"Log"),temp:Tn.join(mP,e)}},pYe=(e)=>{let t=Tn.basename(Ou);return{data:Tn.join(yh.XDG_DATA_HOME||Tn.join(Ou,".local","share"),e),config:Tn.join(yh.XDG_CONFIG_HOME||Tn.join(Ou,".config"),e),cache:Tn.join(yh.XDG_CACHE_HOME||Tn.join(Ou,".cache"),e),log:Tn.join(yh.XDG_STATE_HOME||Tn.join(Ou,".local","state"),e),temp:Tn.join(mP,t,e)}};var Fee=G(()=>{Ou=Nee.homedir(),mP=Nee.tmpdir(),{env:yh}=pP});var mYe=(e,t)=>{let{onError:n}=t;return function(...o){return e.apply(void 0,o).catch(n)}},Ca;var Mee=G(()=>{Ca=mYe});var hYe=(e,t)=>{let{onError:n}=t;return function(...o){try{return e.apply(void 0,o)}catch(s){return n(s)}}},ji;var jee=G(()=>{ji=hYe});var Lee=250;var qee=()=>{};var gYe=(e,t)=>{let{isRetriable:n}=t;return function(o){let{timeout:s}=o,i=o.interval??Lee,a=Date.now()+s;return function c(...l){return e.apply(void 0,l).catch((d)=>{if(!n(d))throw d;if(Date.now()>=a)throw d;let f=Math.round(i*Math.random());if(f>0)return new Promise((m)=>setTimeout(m,f)).then(()=>c.apply(void 0,l));else return c.apply(void 0,l)})}}},Aa;var Bee=G(()=>{qee();Aa=gYe});var yYe=(e,t)=>{let{isRetriable:n}=t;return function(o){let{timeout:s}=o,i=Date.now()+s;return function(...c){while(!0)try{return e.apply(void 0,c)}catch(l){if(!n(l))throw l;if(Date.now()>=i)throw l;continue}}}},Oa;var Uee=G(()=>{Oa=yYe});var gP=G(()=>{Mee();jee();Bee();Uee()});var sb,yP;var Hee=G(()=>{bP();sb={isChangeErrorOk:(e)=>{if(!sb.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!zee&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!sb.isNodeError(e))return!1;let{code:t}=e;if(t==="EMFILE"||t==="ENFILE"||t==="EAGAIN"||t==="EBUSY"||t==="EACCESS"||t==="EACCES"||t==="EACCS"||t==="EPERM")return!0;return!1},onChangeError:(e)=>{if(!sb.isNodeError(e))throw e;if(sb.isChangeErrorOk(e))return;throw e}},yP=sb});import Gee from"process";var ib,os,zee,Xr;var bP=G(()=>{Hee();ib={onError:yP.onChangeError},os={onError:()=>{return}},zee=Gee.getuid?!Gee.getuid():!1,Xr={isRetriable:yP.isRetriableError}});import It from"fs";import{promisify as mo}from"util";var bYe,Tr;var wP=G(()=>{gP();gP();bP();bYe={attempt:{chmod:Ca(mo(It.chmod),ib),chown:Ca(mo(It.chown),ib),close:Ca(mo(It.close),os),fsync:Ca(mo(It.fsync),os),mkdir:Ca(mo(It.mkdir),os),realpath:Ca(mo(It.realpath),os),stat:Ca(mo(It.stat),os),unlink:Ca(mo(It.unlink),os),chmodSync:ji(It.chmodSync,ib),chownSync:ji(It.chownSync,ib),closeSync:ji(It.closeSync,os),existsSync:ji(It.existsSync,os),fsyncSync:ji(It.fsync,os),mkdirSync:ji(It.mkdirSync,os),realpathSync:ji(It.realpathSync,os),statSync:ji(It.statSync,os),unlinkSync:ji(It.unlinkSync,os)},retry:{close:Aa(mo(It.close),Xr),fsync:Aa(mo(It.fsync),Xr),open:Aa(mo(It.open),Xr),readFile:Aa(mo(It.readFile),Xr),rename:Aa(mo(It.rename),Xr),stat:Aa(mo(It.stat),Xr),write:Aa(mo(It.write),Xr),writeFile:Aa(mo(It.writeFile),Xr),closeSync:Oa(It.closeSync,Xr),fsyncSync:Oa(It.fsyncSync,Xr),openSync:Oa(It.openSync,Xr),readFileSync:Oa(It.readFileSync,Xr),renameSync:Oa(It.renameSync,Xr),statSync:Oa(It.statSync,Xr),writeSync:Oa(It.writeSync,Xr),writeFileSync:Oa(It.writeFileSync,Xr)}},Tr=bYe});import Af from"process";var Vee="utf8",_P=438,Wee=511,Kee,Jee,Yee,Xee=1000,Qee,Z7t,xP=128;var vP=G(()=>{Kee={},Jee=Af.geteuid?Af.geteuid():-1,Yee=Af.getegid?Af.getegid():-1,Qee=!!Af.getuid,Z7t=Af.getuid?!Af.getuid():!1});var Zee=(e)=>e instanceof Error&&("code"in e),kP=(e)=>typeof e==="string",jk=(e)=>e===void 0;var ete=()=>{};var tte=()=>{};import nte from"process";var rte,Lk;var EP=G(()=>{rte=nte.platform==="linux",Lk=nte.platform==="win32"});var SP,ote;var ste=G(()=>{EP();SP=["SIGHUP","SIGINT","SIGTERM"];if(!Lk)SP.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(rte)SP.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");ote=SP});import bh from"process";class ite{constructor(){this.callbacks=new Set,this.exited=!1,this.exit=(e)=>{if(this.exited)return;this.exited=!0;for(let t of this.callbacks)t();if(e)if(Lk&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))bh.kill(bh.pid,"SIGTERM");else bh.kill(bh.pid,e)},this.hook=()=>{bh.once("exit",()=>this.exit());for(let e of ote)try{bh.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var ate;var cte=G(()=>{EP();ste();ate=new ite});var wYe,lte;var ute=G(()=>{cte();wYe=ate.register,lte=wYe});import _Ye from"path";var Ds,ab;var dte=G(()=>{wP();ute();vP();Ds={store:{},create:(e)=>{let t=`000000${Math.floor(Math.random()*16777215).toString(16)}`.slice(-6),n=Date.now().toString().slice(-10),r="tmp-",o=`.tmp-${n}${t}`;return`${e}${o}`},get:(e,t,n=!0)=>{let r=Ds.truncate(t(e));if(r in Ds.store)return Ds.get(e,t,n);return Ds.store[r]=n,[r,()=>delete Ds.store[r]]},purge:(e)=>{if(!Ds.store[e])return;delete Ds.store[e],Tr.attempt.unlink(e)},purgeSync:(e)=>{if(!Ds.store[e])return;delete Ds.store[e],Tr.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in Ds.store)Ds.purgeSync(e)},truncate:(e)=>{let t=_Ye.basename(e);if(t.length<=xP)return e;let n=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!n)return e;let r=t.length-xP;return`${e.slice(0,-t.length)}${n[1]}${n[2].slice(0,-r)}${n[3]}`}};lte(Ds.purgeSyncAll);ab=Ds});import xYe from"path";function $P(e,t,n=Kee){if(kP(n))return $P(e,t,{encoding:n});let o={timeout:n.timeout??Xee},s=null,i=null,a=null;try{let c=Tr.attempt.realpathSync(e),l=!!c;e=c||e,[i,s]=ab.get(e,n.tmpCreate||ab.create,n.tmpPurge!==!1);let d=Qee&&jk(n.chown),f=jk(n.mode);if(l&&(d||f)){let p=Tr.attempt.statSync(e);if(p){if(n={...n},d)n.chown={uid:p.uid,gid:p.gid};if(f)n.mode=p.mode}}if(!l){let p=xYe.dirname(e);Tr.attempt.mkdirSync(p,{mode:Wee,recursive:!0})}if(a=Tr.retry.openSync(o)(i,"w",n.mode||_P),n.tmpCreated)n.tmpCreated(i);if(kP(t))Tr.retry.writeSync(o)(a,t,0,n.encoding||Vee);else if(!jk(t))Tr.retry.writeSync(o)(a,t,0,t.length,0);if(n.fsync!==!1)if(n.fsyncWait!==!1)Tr.retry.fsyncSync(o)(a);else Tr.attempt.fsync(a);if(Tr.retry.closeSync(o)(a),a=null,n.chown&&(n.chown.uid!==Jee||n.chown.gid!==Yee))Tr.attempt.chownSync(i,n.chown.uid,n.chown.gid);if(n.mode&&n.mode!==_P)Tr.attempt.chmodSync(i,n.mode);try{Tr.retry.renameSync(o)(i,e)}catch(p){if(!Zee(p))throw p;if(p.code!=="ENAMETOOLONG")throw p;Tr.retry.renameSync(o)(i,ab.truncate(e))}s(),i=null}finally{if(a)Tr.attempt.closeSync(a);if(i)ab.purge(i)}}var fte=G(()=>{wP();vP();ete();tte();dte()});var lb=w(function(hte){Object.defineProperty(hte,"__esModule",{value:!0});hte.regexpCode=hte.getEsmExportName=hte.getProperty=hte.safeStringify=hte.stringify=hte.strConcat=hte.addCodeArg=hte.str=hte._=hte.nil=hte._Code=hte.Name=hte.IDENTIFIER=hte._CodeOrName=void 0;class qk{}hte._CodeOrName=qk;hte.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class wh extends qk{constructor(e){super();if(!hte.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}hte.Name=wh;class Li extends qk{constructor(e){super();this._items=typeof e==="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((t,n)=>`${t}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((t,n)=>{if(n instanceof wh)t[n.str]=(t[n.str]||0)+1;return t},{})}}hte._Code=Li;hte.nil=new Li("");function pte(e,...t){let n=[e[0]],r=0;while(r<t.length)DP(n,t[r]),n.push(e[++r]);return new Li(n)}hte._=pte;var RP=new Li("+");function mte(e,...t){let n=[cb(e[0])],r=0;while(r<t.length)n.push(RP),DP(n,t[r]),n.push(RP,cb(e[++r]));return vYe(n),new Li(n)}hte.str=mte;function DP(e,t){if(t instanceof Li)e.push(...t._items);else if(t instanceof wh)e.push(t);else e.push(SYe(t))}hte.addCodeArg=DP;function vYe(e){let t=1;while(t<e.length-1){if(e[t]===RP){let n=kYe(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}function kYe(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof wh||e[e.length-1]!=='"')return;if(typeof t!="string")return`${e.slice(0,-1)}${t}"`;if(t[0]==='"')return e.slice(0,-1)+t.slice(1);return}if(typeof t=="string"&&t[0]==='"'&&!(e instanceof wh))return`"${e}${t.slice(1)}`;return}function EYe(e,t){return t.emptyStr()?e:e.emptyStr()?t:mte`${e}${t}`}hte.strConcat=EYe;function SYe(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:cb(Array.isArray(e)?e.join(","):e)}function $Ye(e){return new Li(cb(e))}hte.stringify=$Ye;function cb(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}hte.safeStringify=cb;function RYe(e){return typeof e=="string"&&hte.IDENTIFIER.test(e)?new Li(`.${e}`):pte`[${e}]`}hte.getProperty=RYe;function DYe(e){if(typeof e=="string"&&hte.IDENTIFIER.test(e))return new Li(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}hte.getEsmExportName=DYe;function CYe(e){return new Li(e.toString())}hte.regexpCode=CYe});var TP=w(function(wte){Object.defineProperty(wte,"__esModule",{value:!0});wte.ValueScope=wte.ValueScopeName=wte.Scope=wte.varKinds=wte.UsedValueState=void 0;var nn=lb();class yte extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Uk;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Uk||(wte.UsedValueState=Uk={}));wte.varKinds={const:new nn.Name("const"),let:new nn.Name("let"),var:new nn.Name("var")};class AP{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof nn.Name?e:this.name(e)}name(e){return new nn.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,n;if(((n=(t=this._parent)===null||t===void 0?void 0:t._prefixes)===null||n===void 0?void 0:n.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}wte.Scope=AP;class OP extends nn.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=nn._`.${new nn.Name(t)}[${n}]`}}wte.ValueScopeName=OP;var UYe=nn._`\n`;class bte extends AP{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?UYe:nn.nil}}get(){return this._scope}name(e){return new OP(e,this._newName(e))}value(e,t){var n;if(t.ref===void 0)throw Error("CodeGen: ref must be passed in value");let r=this.toName(e),{prefix:o}=r,s=(n=t.key)!==null&&n!==void 0?n:t.ref,i=this._values[o];if(i){let l=i.get(s);if(l)return l}else i=this._values[o]=new Map;i.set(s,r);let a=this._scope[o]||(this._scope[o]=[]),c=a.length;return a[c]=t.ref,r.setValue(t,{property:o,itemIndex:c}),r}getValue(e,t){let n=this._values[e];if(!n)return;return n.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,(n)=>{if(n.scopePath===void 0)throw Error(`CodeGen: name "${n}" has no value`);return nn._`${e}${n.scopePath}`})}scopeCode(e=this._values,t,n){return this._reduceValues(e,(r)=>{if(r.value===void 0)throw Error(`CodeGen: name "${r}" has no value`);return r.value.code},t,n)}_reduceValues(e,t,n={},r){let o=nn.nil;for(let s in e){let i=e[s];if(!i)continue;let a=n[s]=n[s]||new Map;i.forEach((c)=>{if(a.has(c))return;a.set(c,Uk.Started);let l=t(c);if(l){let d=this.opts.es5?wte.varKinds.var:wte.varKinds.const;o=nn._`${o}${d} ${c} = ${l};${this.opts._n}`}else if(l=r===null||r===void 0?void 0:r(c))o=nn._`${o}${l}${this.opts._n}`;else throw new yte(c);a.set(c,Uk.Completed)})}return o}}wte.ValueScope=bte});var lt=w(function(ss){Object.defineProperty(ss,"__esModule",{value:!0});ss.or=ss.and=ss.not=ss.CodeGen=ss.operators=ss.varKinds=ss.ValueScopeName=ss.ValueScope=ss.Scope=ss.Name=ss.regexpCode=ss.stringify=ss.getProperty=ss.nil=ss.strConcat=ss.str=ss._=void 0;var me=lb(),Bn=TP(),Tu=lb();Object.defineProperty(ss,"_",{enumerable:!0,get:function(){return Tu._}});Object.defineProperty(ss,"str",{enumerable:!0,get:function(){return Tu.str}});Object.defineProperty(ss,"strConcat",{enumerable:!0,get:function(){return Tu.strConcat}});Object.defineProperty(ss,"nil",{enumerable:!0,get:function(){return Tu.nil}});Object.defineProperty(ss,"getProperty",{enumerable:!0,get:function(){return Tu.getProperty}});Object.defineProperty(ss,"stringify",{enumerable:!0,get:function(){return Tu.stringify}});Object.defineProperty(ss,"regexpCode",{enumerable:!0,get:function(){return Tu.regexpCode}});Object.defineProperty(ss,"Name",{enumerable:!0,get:function(){return Tu.Name}});var Kk=TP();Object.defineProperty(ss,"Scope",{enumerable:!0,get:function(){return Kk.Scope}});Object.defineProperty(ss,"ValueScope",{enumerable:!0,get:function(){return Kk.ValueScope}});Object.defineProperty(ss,"ValueScopeName",{enumerable:!0,get:function(){return Kk.ValueScopeName}});Object.defineProperty(ss,"varKinds",{enumerable:!0,get:function(){return Kk.varKinds}});ss.operators={GT:new me._Code(">"),GTE:new me._Code(">="),LT:new me._Code("<"),LTE:new me._Code("<="),EQ:new me._Code("==="),NEQ:new me._Code("!=="),NOT:new me._Code("!"),OR:new me._Code("||"),AND:new me._Code("&&"),ADD:new me._Code("+")};class Pu{optimizeNodes(){return this}optimizeNames(e,t){return this}}class xte extends Pu{constructor(e,t,n){super();this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?Bn.varKinds.var:this.varKind,r=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${r};`+t}optimizeNames(e,t){if(!e[this.name.str])return;if(this.rhs)this.rhs=xh(this.rhs,e,t);return this}get names(){return this.rhs instanceof me._CodeOrName?this.rhs.names:{}}}class NP extends Pu{constructor(e,t,n){super();this.lhs=e,this.rhs=t,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(this.lhs instanceof me.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=xh(this.rhs,e,t),this}get names(){let e=this.lhs instanceof me.Name?{}:{...this.lhs.names};return Wk(e,this.rhs)}}class vte extends NP{constructor(e,t,n,r){super(e,n,r);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class kte extends Pu{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class Ete extends Pu{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class Ste extends Pu{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class $te extends Pu{constructor(e){super();this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=xh(this.code,e,t),this}get names(){return this.code instanceof me._CodeOrName?this.code.names:{}}}class Jk extends Pu{constructor(e=[]){super();this.nodes=e}render(e){return this.nodes.reduce((t,n)=>t+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;while(t--){let n=e[t].optimizeNodes();if(Array.isArray(n))e.splice(t,1,...n);else if(n)e[t]=n;else e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:n}=this,r=n.length;while(r--){let o=n[r];if(o.optimizeNames(e,t))continue;VYe(e,o.names),n.splice(r,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>Of(e,t.names),{})}}class Iu extends Jk{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Rte extends Jk{}class ub extends Iu{}ub.kind="else";class sl extends Iu{constructor(e,t){super(t);this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);if(this.else)t+="else "+this.else.render(e);return t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let t=this.else;if(t){let n=t.optimizeNodes();t=this.else=Array.isArray(n)?new ub(n):n}if(t){if(e===!1)return t instanceof sl?t:t.nodes;if(this.nodes.length)return this;return new sl(Tte(e),t instanceof sl?[t]:t.nodes)}if(e===!1||!this.nodes.length)return;return this}optimizeNames(e,t){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,t),!(super.optimizeNames(e,t)||this.else))return;return this.condition=xh(this.condition,e,t),this}get names(){let e=super.names;if(Wk(e,this.condition),this.else)Of(e,this.else.names);return e}}sl.kind="if";class _h extends Iu{}_h.kind="for";class Dte extends _h{constructor(e){super();this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iteration=xh(this.iteration,e,t),this}get names(){return Of(super.names,this.iteration.names)}}class Cte extends _h{constructor(e,t,n,r){super();this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?Bn.varKinds.var:this.varKind,{name:n,from:r,to:o}=this;return`for(${t} ${n}=${r}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=Wk(super.names,this.from);return Wk(e,this.to)}}class PP extends _h{constructor(e,t,n,r){super();this.loop=e,this.varKind=t,this.name=n,this.iterable=r}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(!super.optimizeNames(e,t))return;return this.iterable=xh(this.iterable,e,t),this}get names(){return Of(super.names,this.iterable.names)}}class Hk extends Iu{constructor(e,t,n){super();this.name=e,this.args=t,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}}Hk.kind="func";class zk extends Jk{render(e){return"return "+super.render(e)}}zk.kind="return";class Ate extends Iu{render(e){let t="try"+super.render(e);if(this.catch)t+=this.catch.render(e);if(this.finally)t+=this.finally.render(e);return t}optimizeNodes(){var e,t;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(t=this.finally)===null||t===void 0||t.optimizeNodes(),this}optimizeNames(e,t){var n,r;return super.optimizeNames(e,t),(n=this.catch)===null||n===void 0||n.optimizeNames(e,t),(r=this.finally)===null||r===void 0||r.optimizeNames(e,t),this}get names(){let e=super.names;if(this.catch)Of(e,this.catch.names);if(this.finally)Of(e,this.finally.names);return e}}class Gk extends Iu{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}Gk.kind="catch";class Vk extends Iu{render(e){return"finally"+super.render(e)}}Vk.kind="finally";class Ote{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
|
|
85
85
|
`:""},this._extScope=e,this._scope=new Bn.Scope({parent:e}),this._nodes=[new Rte]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let n=this._extScope.value(e,t);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,n,r){let o=this._scope.toName(t);if(n!==void 0&&r)this._constants[o.str]=n;return this._leafNode(new xte(e,o,n)),o}const(e,t,n){return this._def(Bn.varKinds.const,e,t,n)}let(e,t,n){return this._def(Bn.varKinds.let,e,t,n)}var(e,t,n){return this._def(Bn.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new NP(e,t,n))}add(e,t){return this._leafNode(new vte(e,ss.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==me.nil)this._leafNode(new $te(e));return this}object(...e){let t=["{"];for(let[n,r]of e){if(t.length>1)t.push(",");if(t.push(n),n!==r||this.opts.es5)t.push(":"),me.addCodeArg(t,r)}return t.push("}"),new me._Code(t)}if(e,t,n){if(this._blockNode(new sl(e)),t&&n)this.code(t).else().code(n).endIf();else if(t)this.code(t).endIf();else if(n)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new sl(e))}else(){return this._elseNode(new ub)}endIf(){return this._endBlockNode(sl,ub)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new Dte(e),t)}forRange(e,t,n,r,o=this.opts.es5?Bn.varKinds.var:Bn.varKinds.let){let s=this._scope.toName(e);return this._for(new Cte(o,s,t,n),()=>r(s))}forOf(e,t,n,r=Bn.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=t instanceof me.Name?t:this.var("_arr",t);return this.forRange("_i",0,me._`${s}.length`,(i)=>{this.var(o,me._`${s}[${i}]`),n(o)})}return this._for(new PP("of",r,o,t),()=>n(o))}forIn(e,t,n,r=this.opts.es5?Bn.varKinds.var:Bn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,me._`Object.keys(${t})`,n);let o=this._scope.toName(e);return this._for(new PP("in",r,o,t),()=>n(o))}endFor(){return this._endBlockNode(_h)}label(e){return this._leafNode(new kte(e))}break(e){return this._leafNode(new Ete(e))}return(e){let t=new zk;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(zk)}try(e,t,n){if(!t&&!n)throw Error('CodeGen: "try" without "catch" and "finally"');let r=new Ate;if(this._blockNode(r),this.code(e),t){let o=this.name("e");this._currNode=r.catch=new Gk(o),t(o)}if(n)this._currNode=r.finally=new Vk,this.code(n);return this._endBlockNode(Gk,Vk)}throw(e){return this._leafNode(new Ste(e))}block(e,t){if(this._blockStarts.push(this._nodes.length),e)this.code(e).endBlock(t);return this}endBlock(e){let t=this._blockStarts.pop();if(t===void 0)throw Error("CodeGen: not in self-balancing block");let n=this._nodes.length-t;if(n<0||e!==void 0&&n!==e)throw Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=me.nil,n,r){if(this._blockNode(new Hk(e,t,n)),r)this.code(r).endFunc();return this}endFunc(){return this._endBlockNode(Hk)}optimize(e=1){while(e-- >0)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let n=this._currNode;if(n instanceof e||t&&n instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof sl))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}ss.CodeGen=Ote;function Of(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function Wk(e,t){return t instanceof me._CodeOrName?Of(e,t.names):e}function xh(e,t,n){if(e instanceof me.Name)return r(e);if(!o(e))return e;return new me._Code(e._items.reduce((s,i)=>{if(i instanceof me.Name)i=r(i);if(i instanceof me._Code)s.push(...i._items);else s.push(i);return s},[]));function r(s){let i=n[s.str];if(i===void 0||t[s.str]!==1)return s;return delete t[s.str],i}function o(s){return s instanceof me._Code&&s._items.some((i)=>i instanceof me.Name&&t[i.str]===1&&n[i.str]!==void 0)}}function VYe(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function Tte(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:me._`!${IP(e)}`}ss.not=Tte;var WYe=Pte(ss.operators.AND);function KYe(...e){return e.reduce(WYe)}ss.and=KYe;var JYe=Pte(ss.operators.OR);function YYe(...e){return e.reduce(JYe)}ss.or=YYe;function Pte(e){return(t,n)=>t===me.nil?n:n===me.nil?t:me._`${IP(t)} ${e} ${IP(n)}`}function IP(e){return e instanceof me.Name?e:me._`(${e})`}});var kt=w(function(Hte){Object.defineProperty(Hte,"__esModule",{value:!0});Hte.checkStrictMode=Hte.getErrorPath=Hte.Type=Hte.useFunc=Hte.setEvaluated=Hte.evaluatedPropsToName=Hte.mergeEvaluated=Hte.eachItem=Hte.unescapeJsonPointer=Hte.escapeJsonPointer=Hte.escapeFragment=Hte.unescapeFragment=Hte.schemaRefOrVal=Hte.schemaHasRulesButRef=Hte.schemaHasRules=Hte.checkUnknownRules=Hte.alwaysValidSchema=Hte.toHash=void 0;var Te=lt(),Mte=lb();function eXe(e){let t={};for(let n of e)t[n]=!0;return t}Hte.toHash=eXe;function tXe(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return jte(e,t),!Lte(t,e.self.RULES.all)}Hte.alwaysValidSchema=tXe;function jte(e,t=e.schema){let{opts:n,self:r}=e;if(!n.strictSchema)return;if(typeof t==="boolean")return;let o=r.RULES.keywords;for(let s in t)if(!o[s])Ute(e,`unknown keyword: "${s}"`)}Hte.checkUnknownRules=jte;function Lte(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(t[n])return!0;return!1}Hte.schemaHasRules=Lte;function nXe(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}Hte.schemaHasRulesButRef=nXe;function rXe({topSchemaRef:e,schemaPath:t},n,r,o){if(!o){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return Te._`${n}`}return Te._`${e}${t}${Te.getProperty(r)}`}Hte.schemaRefOrVal=rXe;function oXe(e){return qte(decodeURIComponent(e))}Hte.unescapeFragment=oXe;function sXe(e){return encodeURIComponent(MP(e))}Hte.escapeFragment=sXe;function MP(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}Hte.escapeJsonPointer=MP;function qte(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}Hte.unescapeJsonPointer=qte;function iXe(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}Hte.eachItem=iXe;function Nte({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:r}){return(o,s,i,a)=>{let c=i===void 0?s:i instanceof Te.Name?(s instanceof Te.Name?e(o,s,i):t(o,s,i),i):s instanceof Te.Name?(t(o,i,s),s):n(s,i);return a===Te.Name&&!(c instanceof Te.Name)?r(o,c):c}}Hte.mergeEvaluated={props:Nte({mergeNames:(e,t,n)=>e.if(Te._`${n} !== true && ${t} !== undefined`,()=>{e.if(Te._`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,Te._`${n} || {}`).code(Te._`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if(Te._`${n} !== true`,()=>{if(t===!0)e.assign(n,!0);else e.assign(n,Te._`${n} || {}`),jP(e,n,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Bte}),items:Nte({mergeNames:(e,t,n)=>e.if(Te._`${n} !== true && ${t} !== undefined`,()=>e.assign(n,Te._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if(Te._`${n} !== true`,()=>e.assign(n,t===!0?!0:Te._`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Bte(e,t){if(t===!0)return e.var("props",!0);let n=e.var("props",Te._`{}`);if(t!==void 0)jP(e,n,t);return n}Hte.evaluatedPropsToName=Bte;function jP(e,t,n){Object.keys(n).forEach((r)=>e.assign(Te._`${t}${Te.getProperty(r)}`,!0))}Hte.setEvaluated=jP;var Fte={};function aXe(e,t){return e.scopeValue("func",{ref:t,code:Fte[t.code]||(Fte[t.code]=new Mte._Code(t.code))})}Hte.useFunc=aXe;var FP;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(FP||(Hte.Type=FP={}));function cXe(e,t,n){if(e instanceof Te.Name){let r=t===FP.Num;return n?r?Te._`"[" + ${e} + "]"`:Te._`"['" + ${e} + "']"`:r?Te._`"/" + ${e}`:Te._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?Te.getProperty(e).toString():"/"+MP(e)}Hte.getErrorPath=cXe;function Ute(e,t,n=e.opts.strictSchema){if(!n)return;if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}Hte.checkStrictMode=Ute});var ti=w(function(Gte){Object.defineProperty(Gte,"__esModule",{value:!0});var jt=lt(),$Xe={data:new jt.Name("data"),valCxt:new jt.Name("valCxt"),instancePath:new jt.Name("instancePath"),parentData:new jt.Name("parentData"),parentDataProperty:new jt.Name("parentDataProperty"),rootData:new jt.Name("rootData"),dynamicAnchors:new jt.Name("dynamicAnchors"),vErrors:new jt.Name("vErrors"),errors:new jt.Name("errors"),this:new jt.Name("this"),self:new jt.Name("self"),scope:new jt.Name("scope"),json:new jt.Name("json"),jsonPos:new jt.Name("jsonPos"),jsonLen:new jt.Name("jsonLen"),jsonPart:new jt.Name("jsonPart")};Gte.default=$Xe});var db=w(function(Jte){Object.defineProperty(Jte,"__esModule",{value:!0});Jte.extendErrors=Jte.resetErrorsCount=Jte.reportExtraError=Jte.reportError=Jte.keyword$DataError=Jte.keywordError=void 0;var ge=lt(),Nu=kt(),Io=ti();Jte.keywordError={message:({keyword:e})=>ge.str`must pass "${e}" keyword validation`};Jte.keyword$DataError={message:({keyword:e,schemaType:t})=>t?ge.str`"${e}" keyword must be ${t} ($data)`:ge.str`"${e}" keyword is invalid ($data)`};function DXe(e,t=Jte.keywordError,n,r){let{it:o}=e,{gen:s,compositeRule:i,allErrors:a}=o,c=Kte(e,t,n);if(r!==null&&r!==void 0?r:i||a)Vte(s,c);else Wte(o,ge._`[${c}]`)}Jte.reportError=DXe;function CXe(e,t=Jte.keywordError,n){let{it:r}=e,{gen:o,compositeRule:s,allErrors:i}=r,a=Kte(e,t,n);if(Vte(o,a),!(s||i))Wte(r,Io.default.vErrors)}Jte.reportExtraError=CXe;function AXe(e,t){e.assign(Io.default.errors,t),e.if(ge._`${Io.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(ge._`${Io.default.vErrors}.length`,t),()=>e.assign(Io.default.vErrors,null)))}Jte.resetErrorsCount=AXe;function OXe({gen:e,keyword:t,schemaValue:n,data:r,errsCount:o,it:s}){if(o===void 0)throw Error("ajv implementation error");let i=e.name("err");e.forRange("i",o,Io.default.errors,(a)=>{if(e.const(i,ge._`${Io.default.vErrors}[${a}]`),e.if(ge._`${i}.instancePath === undefined`,()=>e.assign(ge._`${i}.instancePath`,ge.strConcat(Io.default.instancePath,s.errorPath))),e.assign(ge._`${i}.schemaPath`,ge.str`${s.errSchemaPath}/${t}`),s.opts.verbose)e.assign(ge._`${i}.schema`,n),e.assign(ge._`${i}.data`,r)})}Jte.extendErrors=OXe;function Vte(e,t){let n=e.const("err",t);e.if(ge._`${Io.default.vErrors} === null`,()=>e.assign(Io.default.vErrors,ge._`[${n}]`),ge._`${Io.default.vErrors}.push(${n})`),e.code(ge._`${Io.default.errors}++`)}function Wte(e,t){let{gen:n,validateName:r,schemaEnv:o}=e;if(o.$async)n.throw(ge._`new ${e.ValidationError}(${t})`);else n.assign(ge._`${r}.errors`,t),n.return(!1)}var Tf={keyword:new ge.Name("keyword"),schemaPath:new ge.Name("schemaPath"),params:new ge.Name("params"),propertyName:new ge.Name("propertyName"),message:new ge.Name("message"),schema:new ge.Name("schema"),parentSchema:new ge.Name("parentSchema")};function Kte(e,t,n){let{createErrors:r}=e.it;if(r===!1)return ge._`{}`;return TXe(e,t,n)}function TXe(e,t,n={}){let{gen:r,it:o}=e,s=[PXe(o,n),IXe(e,n)];return NXe(e,t,s),r.object(...s)}function PXe({errorPath:e},{instancePath:t}){let n=t?ge.str`${e}${Nu.getErrorPath(t,Nu.Type.Str)}`:e;return[Io.default.instancePath,ge.strConcat(Io.default.instancePath,n)]}function IXe({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:r}){let o=r?t:ge.str`${t}/${e}`;if(n)o=ge.str`${o}${Nu.getErrorPath(n,Nu.Type.Str)}`;return[Tf.schemaPath,o]}function NXe(e,{params:t,message:n},r){let{keyword:o,data:s,schemaValue:i,it:a}=e,{opts:c,propertyName:l,topSchemaRef:d,schemaPath:f}=a;if(r.push([Tf.keyword,o],[Tf.params,typeof t=="function"?t(e):t||ge._`{}`]),c.messages)r.push([Tf.message,typeof n=="function"?n(e):n]);if(c.verbose)r.push([Tf.schema,i],[Tf.parentSchema,ge._`${d}${f}`],[Io.default.data,s]);if(l)r.push([Tf.propertyName,l])}});var nne=w(function(ene){Object.defineProperty(ene,"__esModule",{value:!0});ene.boolOrEmptySchema=ene.topBoolOrEmptySchema=void 0;var Xte=db(),Qte=lt(),qXe=ti(),BXe={message:"boolean schema is false"};function UXe(e){let{gen:t,schema:n,validateName:r}=e;if(n===!1)Zte(e,!1);else if(typeof n=="object"&&n.$async===!0)t.return(qXe.default.data);else t.assign(Qte._`${r}.errors`,null),t.return(!0)}ene.topBoolOrEmptySchema=UXe;function HXe(e,t){let{gen:n,schema:r}=e;if(r===!1)n.var(t,!1),Zte(e);else n.var(t,!0)}ene.boolOrEmptySchema=HXe;function Zte(e,t){let{gen:n,data:r}=e;Xte.reportError({gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},BXe,void 0,t)}});var qP=w(function(rne){Object.defineProperty(rne,"__esModule",{value:!0});rne.getRules=rne.isJSONType=void 0;var GXe=["string","number","integer","boolean","null","object","array"],VXe=new Set(GXe);function WXe(e){return typeof e=="string"&&VXe.has(e)}rne.isJSONType=WXe;function KXe(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}rne.getRules=KXe});var BP=w(function(ane){Object.defineProperty(ane,"__esModule",{value:!0});ane.shouldUseRule=ane.shouldUseGroup=ane.schemaHasRulesForType=void 0;function YXe({schema:e,self:t},n){let r=t.RULES.types[n];return r&&r!==!0&&sne(e,r)}ane.schemaHasRulesForType=YXe;function sne(e,t){return t.rules.some((n)=>ine(e,n))}ane.shouldUseGroup=sne;function ine(e,t){var n;return e[t.keyword]!==void 0||((n=t.definition.implements)===null||n===void 0?void 0:n.some((r)=>e[r]!==void 0))}ane.shouldUseRule=ine});var fb=w(function(mne){Object.defineProperty(mne,"__esModule",{value:!0});mne.reportTypeError=mne.checkDataTypes=mne.checkDataType=mne.coerceAndCheckDataType=mne.getJSONTypes=mne.getSchemaTypes=mne.DataType=void 0;var lne=qP(),une=BP(),dne=db(),se=lt(),Xk=kt(),vh;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(vh||(mne.DataType=vh={}));function ZXe(e){let t=fne(e.type);if(t.includes("null")){if(e.nullable===!1)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw Error('"nullable" cannot be used without "type"');if(e.nullable===!0)t.push("null")}return t}mne.getSchemaTypes=ZXe;function fne(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(lne.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}mne.getJSONTypes=fne;function eQe(e,t){let{gen:n,data:r,opts:o}=e,s=tQe(t,o.coerceTypes),i=t.length>0&&!(s.length===0&&t.length===1&&une.schemaHasRulesForType(e,t[0]));if(i){let a=HP(t,r,o.strictNumbers,vh.Wrong);n.if(a,()=>{if(s.length)nQe(e,t,s);else zP(e)})}return i}mne.coerceAndCheckDataType=eQe;var pne=new Set(["string","number","integer","boolean","null"]);function tQe(e,t){return t?e.filter((n)=>pne.has(n)||t==="array"&&n==="array"):[]}function nQe(e,t,n){let{gen:r,data:o,opts:s}=e,i=r.let("dataType",se._`typeof ${o}`),a=r.let("coerced",se._`undefined`);if(s.coerceTypes==="array")r.if(se._`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>r.assign(o,se._`${o}[0]`).assign(i,se._`typeof ${o}`).if(HP(t,o,s.strictNumbers),()=>r.assign(a,o)));r.if(se._`${a} !== undefined`);for(let l of n)if(pne.has(l)||l==="array"&&s.coerceTypes==="array")c(l);r.else(),zP(e),r.endIf(),r.if(se._`${a} !== undefined`,()=>{r.assign(o,a),rQe(e,a)});function c(l){switch(l){case"string":r.elseIf(se._`${i} == "number" || ${i} == "boolean"`).assign(a,se._`"" + ${o}`).elseIf(se._`${o} === null`).assign(a,se._`""`);return;case"number":r.elseIf(se._`${i} == "boolean" || ${o} === null
|
|
86
86
|
|| (${i} == "string" && ${o} && ${o} == +${o})`).assign(a,se._`+${o}`);return;case"integer":r.elseIf(se._`${i} === "boolean" || ${o} === null
|
|
87
87
|
|| (${i} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,se._`+${o}`);return;case"boolean":r.elseIf(se._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf(se._`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":r.elseIf(se._`${o} === "" || ${o} === 0 || ${o} === false`),r.assign(a,null);return;case"array":r.elseIf(se._`${i} === "string" || ${i} === "number"
|
|
@@ -99,7 +99,7 @@ ${t}`,iWe,aWe,cWe=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,o=sWe.bind(nul
|
|
|
99
99
|
`)}var mN=!1;var{spawn:Imt}=globalThis.Bun;function Uf(e,t=[]){let n=e.replace(Nmt,'("$1","<redacted>")');for(let r of t)if(r.length>=Fmt)n=n.split(r).join("<redacted>");return n}function NS(e){let t=["AWS_SESSION_TOKEN","AWS_SECRET_ACCESS_KEY","AWS_ACCESS_KEY_ID"],n=new Set;for(let r of[process.env,e??{}])for(let o of t){let s=r[o];if(typeof s==="string"&&s.length>0)n.add(s)}return[...n]}async function dpe(e,t){let n=e.getReader(),r=new TextDecoder,o="";while(!0){let{done:s,value:i}=await n.read();if(s)break;if(i.byteLength===0)continue;t(),o+=r.decode(i,{stream:!0})}return o+r.decode()}async function D(e,t={}){let n={...process.env,GIT_TERMINAL_PROMPT:"0",...t.env};for(let y of t.unsetEnv??[])delete n[y];let r=Imt({cmd:e,cwd:t.cwd,...t.stdin===void 0?{}:{stdin:new TextEncoder().encode(t.stdin)},stdout:"pipe",stderr:"pipe",env:n}),o=!1,s,i,a=performance.now(),c=()=>{if(i!==void 0)clearTimeout(i),i=void 0},l=()=>{if(!t.onInactivityWarning)return;c(),i=setTimeout(()=>{i=void 0;try{t.onInactivityWarning?.(performance.now()-a)}catch{console.error("Could not display subprocess inactivity warning; the child result is unaffected.")}},t.inactivityWarningAfterMs??Mmt)};if(l(),t.timeout)s=setTimeout(()=>{o=!0,c(),r.kill()},t.timeout);let d=cg()?[...NS(n),...t.redact??[]]:[];if(cg()){let y=t.cwd?` (cwd=${t.cwd})`:"";gd(u.dim(Uf(`$ ${e.join(" ")}${y}`,d)))}let f=()=>{a=performance.now(),l()},p,m,h,g=r.exited.then((y)=>(c(),y));try{[p,m,h]=await Promise.all([dpe(r.stdout,f),dpe(r.stderr,f),g])}finally{if(c(),s)clearTimeout(s)}if(cg()){if(t.sensitiveOutput)gd(u.dim("[sensitive subprocess output suppressed]"));else{if(p.trim())gd(u.dim(Uf(p.trimEnd(),d)));if(m.trim())gd(u.yellow(Uf(m.trimEnd(),d)))}gd(u.dim(`(exit ${h})`))}if(o)return{stdout:p,stderr:m||`Command timed out after ${Math.round(t.timeout/1000)}s`,exitCode:h??1,timedOut:!0};return{stdout:p,stderr:m,exitCode:h,timedOut:!1}}var Nmt,Fmt=8,Mmt=120000;var Bt=G(()=>{He();Nmt=/\(\s*"((?:x-amz-)[^"]*|authorization|proxy-authorization)"\s*,\s*"[^"]*"\s*\)/gi});function Lmt(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function ppe(e,t=Lmt()){return e.installInstructions[t]}function qmt(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function Umt(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:Bmt}async function mpe(e){try{let{exitCode:t,stdout:n,timedOut:r}=await D(e.cmd,{timeout:Umt()});if(r)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:qmt(n)}}catch(t){let n=t instanceof Error?t.message:String(t);if(!n.includes("ENOENT")&&!n.includes("not found"))console.error(` Warning: ${e.name} check failed unexpectedly: ${n}`);return{available:!1}}}async function Bb(){let e=Object.entries(fpe);return Promise.all(e.map(async([t,n])=>{let{available:r,version:o,timedOut:s}=await mpe(n);return{key:t,name:n.name,purpose:n.purpose,required:n.required,available:r,version:o,timedOut:s,installInstruction:ppe(n)}}))}async function hpe(){let t=(await Bb()).filter((n)=>n.required&&!n.available);if(t.length===0)return[];console.warn(`
|
|
100
100
|
Heads up: some tools NEMAR needs for uploading/validating aren't installed yet:`);for(let n of t)console.warn(` - ${n.name} (${n.purpose})`),console.warn(` Install: ${n.installInstruction}`);return console.warn("Run `nemar doctor` anytime to re-check. You can finish signup without them.\n"),t}async function Hf(e){let n=jmt[e].map((i)=>fpe[i]).filter(Boolean),r=await Promise.all(n.map(async(i)=>{let a=await mpe(i);return{check:i,available:a.available,timedOut:a.timedOut}}));for(let i of r)if(i.timedOut&&i.check.required)console.warn(`Warning: ${i.check.name} did not respond to a version check in time; continuing anyway.`);let o=r.filter((i)=>!i.available&&!i.timedOut&&i.check.required).map((i)=>({tool:i.check.name,installInstruction:ppe(i.check)}));if(o.length===0)return;let s=[`
|
|
101
101
|
Missing required tools:`];for(let i of o)s.push(` ${i.tool} not installed`),s.push(` Install: ${i.installInstruction}`);throw Error(s.join(`
|
|
102
|
-
`))}var fpe,jmt,Bmt=4000;var Ub=G(()=>{Bt();fpe={git:{name:"git",purpose:"version control for dataset metadata",cmd:["git","--version"],required:!0,installInstructions:{macos:"brew install git (or install Xcode Command Line Tools)",linux:"sudo apt-get install git OR sudo dnf install git",windows:"winget install Git.Git (or https://git-scm.com/download/win)"}},"git-annex":{name:"git-annex",purpose:"large-file data transfer (upload/download)",cmd:["git-annex","version"],required:!0,installInstructions:{macos:"brew install git-annex",linux:"sudo apt-get install git-annex OR sudo dnf install git-annex",windows:"Download the installer from https://git-annex.branchable.com/install/Windows/"}},gh:{name:"GitHub CLI (gh)",purpose:"GitHub authentication + repository operations",cmd:["gh","--version"],required:!0,installInstructions:{macos:"brew install gh",linux:"See https://cli.github.com/manual/installation",windows:"winget install GitHub.cli (or: scoop install gh)"}},aws:{name:"AWS CLI",purpose:"S3 data upload/download",cmd:["aws","--version"],required:!0,installInstructions:{macos:"brew install awscli",linux:"pip install awscli OR sudo snap install aws-cli --classic",windows:"winget install Amazon.AWSCLI (or the MSI from https://aws.amazon.com/cli/)"}},deno:{name:"Deno",purpose:"BIDS validation",cmd:["deno","--version"],required:!0,installInstructions:{macos:"brew install deno (or: curl -fsSL https://deno.land/install.sh | sh)",linux:"curl -fsSL https://deno.land/install.sh | sh",windows:"winget install DenoLand.Deno (or: irm https://deno.land/install.ps1 | iex)"}}},jmt={upload:["git-annex","gh","aws","deno"],download:["gh"],clone:["git","gh"],push:["git-annex","gh"],publish:["gh","aws"],update:["git","gh"],release:["git","gh"]}});var ype;var gpe=G(()=>{ype={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.28-PR2034.
|
|
102
|
+
`))}var fpe,jmt,Bmt=4000;var Ub=G(()=>{Bt();fpe={git:{name:"git",purpose:"version control for dataset metadata",cmd:["git","--version"],required:!0,installInstructions:{macos:"brew install git (or install Xcode Command Line Tools)",linux:"sudo apt-get install git OR sudo dnf install git",windows:"winget install Git.Git (or https://git-scm.com/download/win)"}},"git-annex":{name:"git-annex",purpose:"large-file data transfer (upload/download)",cmd:["git-annex","version"],required:!0,installInstructions:{macos:"brew install git-annex",linux:"sudo apt-get install git-annex OR sudo dnf install git-annex",windows:"Download the installer from https://git-annex.branchable.com/install/Windows/"}},gh:{name:"GitHub CLI (gh)",purpose:"GitHub authentication + repository operations",cmd:["gh","--version"],required:!0,installInstructions:{macos:"brew install gh",linux:"See https://cli.github.com/manual/installation",windows:"winget install GitHub.cli (or: scoop install gh)"}},aws:{name:"AWS CLI",purpose:"S3 data upload/download",cmd:["aws","--version"],required:!0,installInstructions:{macos:"brew install awscli",linux:"pip install awscli OR sudo snap install aws-cli --classic",windows:"winget install Amazon.AWSCLI (or the MSI from https://aws.amazon.com/cli/)"}},deno:{name:"Deno",purpose:"BIDS validation",cmd:["deno","--version"],required:!0,installInstructions:{macos:"brew install deno (or: curl -fsSL https://deno.land/install.sh | sh)",linux:"curl -fsSL https://deno.land/install.sh | sh",windows:"winget install DenoLand.Deno (or: irm https://deno.land/install.ps1 | iex)"}}},jmt={upload:["git-annex","gh","aws","deno"],download:["gh"],clone:["git","gh"],push:["git-annex","gh"],publish:["gh","aws"],update:["git","gh"],release:["git","gh"]}});var ype;var gpe=G(()=>{ype={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.28-PR2034.87fba58",description:"CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",type:"module",main:"dist/index.js",bin:{nemar:"dist/index.js","git-annex-remote-nemar":"dist/git-annex-remote-nemar.js"},scripts:{dev:"bun run src/index.ts",build:"bun build src/index.ts src/git-annex-remote-nemar.ts --outdir dist --target bun --minify && sed '1s|#!/usr/bin/env node|#!/usr/bin/env bun|' dist/index.js > dist/index.js.tmp && mv dist/index.js.tmp dist/index.js",test:"bun test",lint:"biome check src/","lint:scrub":"biome check scripts/scrub shared/identifier-scrub.ts test/scrub","test:scrub":"bun test --preload ./test/scrub/helpers/temp-dirs-preload.ts --path-ignore-patterns='__run_every_scrub_suite__' test/scrub test/identifier-scan.test.ts test/identifier-scrub.test.ts test/identifier-dates.test.ts test/identifier-fleet.test.ts","migrations:d1-check":"bun run scripts/d1-migration-check.ts","zarr:geometry-check":"bun run backend/scripts/zarr-geometry-conformance.ts","lint:fix":"biome check --fix src/",format:"biome format --write src/",typecheck:"tsc --noEmit && tsc --noEmit -p backend","generate-openapi":"bun run scripts/generate-openapi.ts",prepublishOnly:"bun run build",prepare:"husky",postinstall:"bun scripts/postinstall-check.mjs",deploy:"wrangler deploy",preview:"wrangler dev"},keywords:["nemar","bids","neuroimaging","eeg","emg","datalad","cli"],author:"NEMAR Team",license:"CC-BY-NC-ND-4.0",repository:{type:"git",url:"git+https://github.com/nemarOrg/nemar-cli.git"},bugs:{url:"https://github.com/nemarOrg/nemar-cli/issues"},homepage:"https://docs.nemar.org",engines:{bun:">=1.0.0"},files:["dist","scripts/postinstall-check.mjs","scripts/recover-datasets.json","scripts/withdrawn-datasets.json","README.md","LICENSE"],dependencies:{chalk:"^5.3.0",commander:"^12.1.0",conf:"^13.0.1",inquirer:"^9.2.15",ora:"^8.0.1",semver:"^7.8.5",zod:"^3.23.8"},"lint-staged":{"src/**/*.{ts,tsx}":["biome check --fix"],"backend/src/**/*.{ts,tsx}":["biome check --fix"]},trustedDependencies:["@biomejs/biome"],devDependencies:{"@anthropic-ai/sdk":"^0.132.1","@asteasolutions/zod-to-openapi":"^7.3.4","@biomejs/biome":"1.9.4","@types/bun":"latest","@types/inquirer":"^9.0.7","@types/semver":"^7.8.0",ajv:"^8.20.0","ajv-formats":"^3.0.1",husky:"^9.1.7","lint-staged":"^16.3.2",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var Cs;var zf=G(()=>{gpe();Cs=ype.version});import{mkdirSync as zmt,readdirSync as Gmt,unlinkSync as Vmt,writeFileSync as Wmt}from"fs";import{join as hN}from"path";function kpe(){lg=!0}function dl(){return lg}function Epe(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function zb(e){vpe=e,Rn(`Step: ${e}`)}function jo(){_pe=!0}function Spe(){return _pe}function le(){if(xpe)return;yN=!0}function Gb(){yN=!1,xpe=!0}function $pe(){return yN}function Rn(e){if(lg)process.stderr.write(`[debug] ${e}
|
|
103
103
|
`)}function Xmt(e){let t={};for(let[n,r]of Object.entries(e))t[n]=Ymt.has(n.toLowerCase())?"[REDACTED]":r;return t}function Dpe(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function gN(e,t,n=0){if(n>Zmt)return"[REDACTED: depth]";if(Array.isArray(t))return t.map((r)=>gN(e,r,n+1));if(t&&typeof t==="object"){let r={};for(let[o,s]of Object.entries(t))r[o]=gN(o,s,n+1);return r}if(typeof t==="string"){if(Qmt.test(e))return"[REDACTED]";return t.replace(Rpe,Dpe)}return t}function bN(e){return e.replace(eht,"Bearer [REDACTED]").replace(tht,"[REDACTED_AWS_KEY]").replace(nht,"$1[REDACTED]").replace(rht,"$1$2=[REDACTED]").replace(Rpe,Dpe)}function oht(e){return bN(e)}function bpe(e,t=Jmt){if(e===void 0)return;let n=e;try{let r=JSON.parse(e);n=JSON.stringify(gN("",r))}catch{}if(n=bN(n),Buffer.byteLength(n,"utf8")>t)n=`${Buffer.from(n,"utf8").subarray(0,t).toString("utf8")}... [truncated]`;return n}function jS(e){if(!lg)return;let t=oht(e.url);try{let n={...e,url:t,requestHeaders:e.requestHeaders?Xmt(e.requestHeaders):void 0,requestBody:bpe(e.requestBody),responseBody:bpe(e.responseBody)};MS.push(n),Rn(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(n){let r=V(n);MS.push({method:e.method,url:t,status:e.status,durationMs:e.durationMs,note:`redaction failed: ${r}`}),Rn(`redaction failed for ${e.method} ${t}: ${r}`)}}async function sht(){let e=[];try{let t=process.versions.bun?`Bun ${process.versions.bun}`:`Node ${process.version}`;e.push(`CLI version: ${Cs}`),e.push(`OS/Arch: ${process.platform}/${process.arch}`),e.push(`Runtime: ${t}`)}catch(t){e.push(`(could not read CLI/OS/runtime info: ${V(t)})`)}e.push(""),e.push("Active account:");try{let t=Vt();if(t.apiKey){if(t.username)e.push(` Username: ${t.username}`);if(e.push(` API URL: ${t.apiUrl}`),t.role)e.push(` Role: ${t.role}`);e.push(` Sandbox completed: ${!!t.sandboxCompleted}`)}else e.push(" (not authenticated)")}catch(t){e.push(` (could not read account config: ${V(t)})`)}e.push(""),e.push("External tools:");try{let t=await Bb();for(let n of t){let r=n.available?n.version??"installed":n.timedOut?"(timed out)":"not installed";e.push(` ${n.name}: ${r}`)}}catch(t){e.push(` (could not probe external tools: ${V(t)})`)}return e}async function wN(){return(await sht()).join(`
|
|
104
104
|
`)}async function Cpe(){if(!lg||FS!==void 0)return;try{FS=await wN()}catch(e){let t=V(e);FS=`(could not build environment report: ${t})`,Rn(`environment snapshot failed: ${t}`)}}function Ape(e){if(wpe.has(e))return{flag:e};for(let t of wpe){if(!e.startsWith(t)||e.length<=t.length)continue;if(t.length===2)return{flag:t,kind:"short-attached"};if(e[t.length]==="=")return{flag:t,kind:"long-eq"}}return null}function iht(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],o=Ape(r);if(!o){t.push(r);continue}if(o.kind==="long-eq")t.push(`${o.flag}=[REDACTED]`);else if(o.kind==="short-attached")t.push(`${o.flag}[REDACTED]`);else if(t.push(r),n+1<e.length)t.push("[REDACTED]"),n++}return t}function aht(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],o=Ape(r);if(!o){t.push(r);continue}if(!o.kind&&n+1<e.length)n++}return t}function cht(e){let t=[];for(let r of aht(e)){if(r.startsWith("-"))continue;if(t.push(r),t.length===2)break}return(t.length>0?t.join("-"):"nemar").replace(/[^a-zA-Z0-9_-]/g,"_")}function lht(e,t){let n=[];if(n.push("NEMAR CLI Debug Log"),n.push(`Generated: ${new Date().toISOString()}`),n.push(`Command: nemar ${bN(iht(e).join(" "))}`),n.push(""),n.push(FS??"(environment snapshot unavailable)"),n.push(""),n.push("HTTP requests:"),MS.length===0)n.push(" (none)");else MS.forEach((r,o)=>{if(n.push(` [${o+1}] ${r.method} ${r.url} -> ${r.status??"ERROR"} (${r.durationMs}ms)`),r.error)n.push(` Error: ${r.error}`);if(r.note)n.push(` Note: ${r.note}`);if(r.requestHeaders)n.push(` Request headers: ${JSON.stringify(r.requestHeaders)}`);if(r.requestBody)n.push(` Request body: ${r.requestBody}`);if(r.responseBody)n.push(` Response body: ${r.responseBody}`)});return n.push(""),n.push(`Failing step: ${vpe??"(none recorded)"}`),n.push(`Exit code: ${t}`),`${n.join(`
|
|
105
105
|
`)}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nemar-cli",
|
|
3
3
|
"packageManager": "bun@1.4.3",
|
|
4
|
-
"version": "0.10.28-PR2034.
|
|
4
|
+
"version": "0.10.28-PR2034.87fba58",
|
|
5
5
|
"description": "CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "dist/index.js",
|