nemar-cli 0.10.28-PR2082.7be2913 → 0.10.28-PR2082.cb8109a

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.
@@ -23,7 +23,7 @@ ${t}`,HM,BM,WM=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,s=KM.bind(null,n,
23
23
  `)}var Fl=!1;var{spawn:JF}=globalThis.Bun;function Vl(e,t=[]){let r=e.replace(QF,'("$1","<redacted>")');for(let n of t)if(n.length>=ZF)r=r.split(n).join("<redacted>");return r}function tV(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=JF({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??eV)};if(u(),t.timeout)o=setTimeout(()=>{s=!0,c(),n.kill()},t.timeout);let l=ic()?[...tV(r),...t.redact??[]]:[];if(ic()){let y=t.cwd?` (cwd=${t.cwd})`:"";Ms(It.dim(Vl(`$ ${e.join(" ")}${y}`,l)))}let d=()=>{a=performance.now(),u()},h,f,p,m=n.exited.then((y)=>(c(),y));try{[h,f,p]=await Promise.all([hw(n.stdout,d),hw(n.stderr,d),m])}finally{if(c(),o)clearTimeout(o)}if(ic()){if(t.sensitiveOutput)Ms(It.dim("[sensitive subprocess output suppressed]"));else{if(h.trim())Ms(It.dim(Vl(h.trimEnd(),l)));if(f.trim())Ms(It.yellow(Vl(f.trimEnd(),l)))}Ms(It.dim(`(exit ${p})`))}if(s)return{stdout:h,stderr:f||`Command timed out after ${Math.round(t.timeout/1000)}s`,exitCode:p??1,timedOut:!0};return{stdout:h,stderr:f,exitCode:p,timedOut:!1}}var QF,ZF=8,eV=120000;var gw=F(()=>{Ul();QF=/\(\s*"((?:x-amz-)[^"]*|authorization|proxy-authorization)"\s*,\s*"[^"]*"\s*\)/gi});function nV(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function _w(e,t=nV()){return e.installInstructions[t]}function sV(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function iV(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:oV}async function vw(e){try{let{exitCode:t,stdout:r,timedOut:n}=await mw(e.cmd,{timeout:iV()});if(n)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:sV(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 oB(){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 iB(e){let r=rV[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,rV,oV=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)"}}},rV={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 Ew;var bw=F(()=>{Ew={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.28-PR2082.7be2913",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",jose:"6.2.12","lint-staged":"^16.3.2",oauth4webapi:"3.8.8","openid-client":"6.8.9",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var ac;var Gl=F(()=>{bw();ac=Ew.version});import{mkdirSync as cV,readdirSync as uV,unlinkSync as lV,writeFileSync as dV}from"fs";import{join as Kl}from"path";function yB(){Ls=!0}function lc(){return Ls}function _B(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function vB(e){Tw=e,mr(`Step: ${e}`)}function $B(){xw=!0}function bB(){return xw}function EB(){if(Rw)return;Bl=!0}function wB(){Bl=!1,Rw=!0}function SB(){return Bl}function mr(e){if(Ls)process.stderr.write(`[debug] ${e}
26
+ `))}var yw,rV,oV=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)"}}},rV={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 Ew;var bw=F(()=>{Ew={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.28-PR2082.cb8109a",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",jose:"6.2.12","lint-staged":"^16.3.2",oauth4webapi:"3.8.8","openid-client":"6.8.9",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var ac;var Gl=F(()=>{bw();ac=Ew.version});import{mkdirSync as cV,readdirSync as uV,unlinkSync as lV,writeFileSync as dV}from"fs";import{join as Kl}from"path";function yB(){Ls=!0}function lc(){return Ls}function _B(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function vB(e){Tw=e,mr(`Step: ${e}`)}function $B(){xw=!0}function bB(){return xw}function EB(){if(Rw)return;Bl=!0}function wB(){Bl=!1,Rw=!0}function SB(){return Bl}function mr(e){if(Ls)process.stderr.write(`[debug] ${e}
27
27
  `)}function mV(e){let t={};for(let[r,n]of Object.entries(e))t[r]=hV.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>yV)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(gV.test(e))return"[REDACTED]";return t.replace(kw,Ow)}return t}function Wl(e){return e.replace(_V,"Bearer [REDACTED]").replace(vV,"[REDACTED_AWS_KEY]").replace($V,"$1[REDACTED]").replace(bV,"$1$2=[REDACTED]").replace(kw,Ow)}function EV(e){return Wl(e)}function ww(e,t=pV){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(!Ls)return;let t=EV(e.url);try{let r={...e,url:t,requestHeaders:e.requestHeaders?mV(e.requestHeaders):void 0,requestBody:ww(e.requestBody),responseBody:ww(e.responseBody)};uc.push(r),mr(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(r){let n=pr(r);uc.push({method:e.method,url:t,status:e.status,durationMs:e.durationMs,note:`redaction failed: ${n}`}),mr(`redaction failed for ${e.method} ${t}: ${n}`)}}async function wV(){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: ${pr(t)})`)}e.push(""),e.push("Active account:");try{let t=vn();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: ${pr(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: ${pr(t)})`)}return e}async function SV(){return(await wV()).join(`
28
28
  `)}async function xB(){if(!Ls||cc!==void 0)return;try{cc=await SV()}catch(e){let t=pr(e);cc=`(could not build environment report: ${t})`,mr(`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 xV(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 RV(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 TV(e){let t=[];for(let n of RV(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 kV(e,t){let r=[];if(r.push("NEMAR CLI Debug Log"),r.push(`Generated: ${new Date().toISOString()}`),r.push(`Command: nemar ${Wl(xV(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 @@ ${Ps.cursorShow}`)}releaseCursor(){if(this.extraLinesUnderPrompt>0)gP(this.rl,th
81
81
  ${t}`,bet,wet,_et=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,o=yet.bind(null,r,t.toString());Object.defineProperty(o,"name",wet);let{writable:s,enumerable:i,configurable:a}=bet;Object.defineProperty(e,"toString",{value:o,writable:s,enumerable:i,configurable:a})};var yI=H(()=>{bet=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),wet=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name")});var wS,Ite=(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(wS.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 q0(s,e),wS.set(s,r),s},Nte;var Fte=H(()=>{yI();wS=new WeakMap;Ite.callCount=(e)=>{if(!wS.has(e))throw Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return wS.get(e)};Nte=Ite});var op;var Mte=H(()=>{op=[];op.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")op.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")op.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT")});class jte{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(wI[bI])return wI[bI];xet(wI,bI,{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 xI{}var _S=(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",bI,wI,xet,vet=(e)=>({onExit(t,n){return e.onExit(t,n)},load(){return e.load()},unload(){return e.unload()}}),Lte,qte,_I,Ute,HJt,zJt;var Bte=H(()=>{Mte();bI=Symbol.for("signal-exit emitter"),wI=globalThis,xet=Object.defineProperty.bind(Object);Lte=class Lte extends xI{onExit(){return()=>{}}load(){}unload(){}};qte=class qte extends xI{#n=_I.platform==="win32"?"SIGINT":"SIGHUP";#t=new jte;#e;#o;#f;#r={};#i=!1;constructor(e){super();this.#e=e,this.#r={};for(let t of op)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(!_S(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 op)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,op.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(!_S(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"&&_S(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)}};_I=globalThis.process,{onExit:Ute,load:HJt,unload:zJt}=vet(_S(_I)?new qte(_I):new Lte)});import xS from"process";var Hte,Eet,zte;var Gte=H(()=>{Fte();Bte();Hte=xS.stderr.isTTY?xS.stderr:xS.stdout.isTTY?xS.stdout:void 0,Eet=Hte?Nte(()=>{Ute(()=>{Hte.write("\x1B[?25h")},{alwaysLast:!0})}):()=>{},zte=Eet});import Vte from"process";var vS=!1,Bh,vI;var Wte=H(()=>{Gte();Bh={};Bh.show=(e=Vte.stderr)=>{if(!e.isTTY)return;vS=!1,e.write("\x1B[?25h")};Bh.hide=(e=Vte.stderr)=>{if(!e.isTTY)return;zte(),vS=!0,e.write("\x1B[?25l")};Bh.toggle=(e,t)=>{if(e!==void 0)vS=e;if(vS)Bh.show(t);else Bh.hide(t)};vI=Bh});import Yi from"process";function EI(){if(Yi.platform!=="win32")return Yi.env.TERM!=="linux";return Boolean(Yi.env.CI)||Boolean(Yi.env.WT_SESSION)||Boolean(Yi.env.TERMINUS_SUBLIME)||Yi.env.ConEmuTask==="{cmd::Cmder}"||Yi.env.TERM_PROGRAM==="Terminus-Sublime"||Yi.env.TERM_PROGRAM==="vscode"||Yi.env.TERM==="xterm-256color"||Yi.env.TERM==="alacritty"||Yi.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Kte=()=>{};var ket,Ret,$et,U0;var Jte=H(()=>{Ue();Kte();ket={info:u.blue("\u2139"),success:u.green("\u2714"),warning:u.yellow("\u26A0"),error:u.red("\u2716")},Ret={info:u.blue("i"),success:u.green("\u221A"),warning:u.yellow("\u203C"),error:u.red("\xD7")},$et=EI()?ket:Ret,U0=$et});function SI({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 B0(e){if(typeof e!=="string")throw TypeError(`Expected a \`string\`, got \`${typeof e}\``);return e.replace(Det,"")}var Det;var kI=H(()=>{Det=SI()});function Yte(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 Xte(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Qte(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 Zte=()=>{};function Cet(e){if(!Number.isSafeInteger(e))throw TypeError(`Expected a code point, got \`${typeof e}\`.`)}function ene(e,{ambiguousAsWide:t=!1}={}){if(Cet(e),Xte(e)||Qte(e)||t&&Yte(e))return 2;return 1}var tne=H(()=>{Zte()});var nne=()=>/[#*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 RI(e,t={}){if(typeof e!=="string"||e.length===0)return 0;let{ambiguousIsNarrow:n=!0,countAnsiEscapeCodes:r=!1}=t;if(!r)e=B0(e);if(e.length===0)return 0;let o=0,s={ambiguousAsWide:!n};for(let{segment:i}of Aet.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(Oet.test(i))continue;if(nne().test(i)){o+=2;continue}o+=ene(a,s)}return o}var Aet,Oet;var rne=H(()=>{kI();tne();Aet=new Intl.Segmenter,Oet=/^\p{Default_Ignorable_Code_Point}$/u});function $I({stream:e=process.stdout}={}){return Boolean(e&&e.isTTY&&process.env.TERM!=="dumb"&&!("CI"in process.env))}import one from"process";function DI(){let{env:e}=one,{TERM:t,TERM_PROGRAM:n}=e;if(one.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 sne=()=>{};import Ua from"process";class ine{#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(Ua.platform==="win32"||!Ua.stdin.isTTY)return;Ua.stdin.setRawMode(!0),Ua.stdin.on("data",this.#o),Ua.stdin.resume()}#e(){if(!Ua.stdin.isTTY)return;Ua.stdin.off("data",this.#o),Ua.stdin.pause(),Ua.stdin.setRawMode(!1)}#o(e){if(e[0]===Tet)Ua.emit("SIGINT")}}var Tet=3,Pet,CI;var ane=H(()=>{Pet=new ine,CI=Pet});import ES from"process";class cne{#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:ES.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:$I({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,ES.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(!DI())this.#i=H0.default.line;else if(e===void 0)this.#i=H0.default.dots;else if(e!=="default"&&H0.default[e])this.#i=H0.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 B0(r).split(`
82
82
  `))this.#e+=Math.max(1,Math.ceil(RI(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)vI.hide(this.#s);if(this.#r.discardStdin&&ES.stdin.isTTY)this.#t=!0,CI.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)vI.show(this.#s);if(this.#r.discardStdin&&ES.stdin.isTTY&&this.#t)CI.stop(),this.#t=!1;return this}succeed(e){return this.stopAndPersist({symbol:U0.success,text:e})}fail(e){return this.stopAndPersist({symbol:U0.error,text:e})}warn(e){return this.stopAndPersist({symbol:U0.warning,text:e})}info(e){return this.stopAndPersist({symbol:U0.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 D(e){return new cne(e)}var H0,Iet;var ko=H(()=>{Ue();Wte();Jte();kI();rne();sne();ane();H0=ct(bE(),1),Iet=ct(bE(),1)});var Tt,dne,he,Sl=(e)=>{switch(typeof e){case"undefined":return he.undefined;case"string":return he.string;case"number":return Number.isNaN(e)?he.nan:he.number;case"boolean":return he.boolean;case"function":return he.function;case"bigint":return he.bigint;case"symbol":return he.symbol;case"object":if(Array.isArray(e))return he.array;if(e===null)return he.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return he.promise;if(typeof Map<"u"&&e instanceof Map)return he.map;if(typeof Set<"u"&&e instanceof Set)return he.set;if(typeof Date<"u"&&e instanceof Date)return he.date;return he.object;default:return he.unknown}};var z0=H(()=>{(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}})(Tt||(Tt={}));(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(dne||(dne={}));he=Tt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var ee,js;var SS=H(()=>{z0();ee=Tt.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"]);js=class js 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 js))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Tt.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()}};js.create=(e)=>new js(e)});var Net=(e,t)=>{let n;switch(e.code){case ee.invalid_type:if(e.received===he.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,Tt.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${Tt.joinValues(e.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Tt.joinValues(e.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${Tt.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 Tt.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,Tt.assertNever(e)}return{message:n}},od;var AI=H(()=>{SS();z0();od=Net});function G0(){return Fet}var Fet;var kS=H(()=>{AI();Fet=od});function fe(e,t){let n=G0(),r=RS({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===od?void 0:od].filter((o)=>!!o)});e.common.issues.push(r)}class Ro{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 We;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 Ro.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 We;if(s.status==="aborted")return We;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 RS=(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}},We,Hh=(e)=>({status:"dirty",value:e}),Ho=(e)=>({status:"valid",value:e}),OI=(e)=>e.status==="aborted",TI=(e)=>e.status==="dirty",sp=(e)=>e.status==="valid",V0=(e)=>typeof Promise<"u"&&e instanceof Promise;var PI=H(()=>{kS();AI();We=Object.freeze({status:"aborted"})});var fne=()=>{};var Te;var pne=H(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(Te||(Te={}))});class Xi{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 bt(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 Dt{get description(){return this._def.description}_getType(e){return Sl(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Sl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ro,ctx:{common:e.parent.common,data:e.data,parsedType:Sl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(V0(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:Sl(e)},r=this._parseSync({data:e,path:n.path,parent:n});return mne(n,r)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sl(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return sp(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)=>sp(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:Sl(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(V0(r)?r:Promise.resolve(r));return mne(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 za({schema:this,typeName:Je.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 Ha.create(this,this._def)}nullable(){return sd.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ba.create(this)}promise(){return Kh.create(this,this._def)}or(e){return X0.create([this,e],this._def)}and(e){return Q0.create(this,e,this._def)}transform(e){return new za({...bt(this._def),schema:this,typeName:Je.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new nw({...bt(this._def),innerType:this,defaultValue:t,typeName:Je.ZodDefault})}brand(){return new MI({typeName:Je.ZodBranded,type:this,...bt(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new rw({...bt(this._def),innerType:this,catchValue:t,typeName:Je.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return IS.create(this,e)}readonly(){return ow.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function gne(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 Zet(e){return new RegExp(`^${gne(e)}$`)}function ett(e){let t=`${hne}T${gne(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 ttt(e,t){if((t==="v4"||!t)&&Vet.test(e))return!0;if((t==="v6"||!t)&&Ket.test(e))return!0;return!1}function ntt(e,t){if(!Bet.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 rtt(e,t){if((t==="v4"||!t)&&Wet.test(e))return!0;if((t==="v6"||!t)&&Jet.test(e))return!0;return!1}function ott(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 zh(e){if(e instanceof Jn){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Ha.create(zh(r))}return new Jn({...e._def,shape:()=>t})}else if(e instanceof Ba)return new Ba({...e._def,type:zh(e.element)});else if(e instanceof Ha)return Ha.create(zh(e.unwrap()));else if(e instanceof sd)return sd.create(zh(e.unwrap()));else if(e instanceof Dl)return Dl.create(e.items.map((t)=>zh(t)));else return e}function NI(e,t){let n=Sl(e),r=Sl(t);if(e===t)return{valid:!0,data:e};else if(n===he.object&&r===he.object){let o=Tt.objectKeys(t),s=Tt.objectKeys(e).filter((a)=>o.indexOf(a)!==-1),i={...e,...t};for(let a of s){let c=NI(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===he.array&&r===he.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=NI(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else if(n===he.date&&r===he.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function yne(e,t){return new ap({values:e,typeName:Je.ZodEnum,...bt(t)})}var mne=(e,t)=>{if(sp(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 js(e.common.issues);return this._error=n,this._error}}}},Met,jet,Let,qet,Uet,Bet,Het,zet,Get="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",II,Vet,Wet,Ket,Jet,Yet,Xet,hne="((\\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])))",Qet,Rl,Gh,Vh,$S,K0,DS,J0,Y0,CS,ip,$l,AS,Ba,Jn,X0,kl=(e)=>{if(e instanceof Z0)return kl(e.schema);else if(e instanceof za)return kl(e.innerType());else if(e instanceof ew)return[e.value];else if(e instanceof ap)return e.options;else if(e instanceof tw)return Tt.objectValues(e.enum);else if(e instanceof nw)return kl(e._def.innerType);else if(e instanceof J0)return[void 0];else if(e instanceof Y0)return[null];else if(e instanceof Ha)return[void 0,...kl(e.unwrap())];else if(e instanceof sd)return[null,...kl(e.unwrap())];else if(e instanceof MI)return kl(e.unwrap());else if(e instanceof ow)return kl(e.unwrap());else if(e instanceof rw)return kl(e._def.innerType);else return[]},FI,Q0,Dl,OS,TS,Wh,W0,Z0,ew,ap,tw,Kh,za,Ha,sd,nw,rw,PS,JYt,MI,IS,ow,YYt,Je,w,C,XYt,QYt,re,ZYt,eXt,tXt,nXt,rXt,fi,oXt,sXt,J,I,iXt,Jh,jI,aXt,cXt,Yn,lXt,uXt,dXt,fXt,Ke,Xe,pXt,mXt,hXt,gXt,yXt,bXt,wXt;var bne=H(()=>{SS();kS();pne();PI();z0();Met=/^c[^\s-]{8,}$/i,jet=/^[0-9a-z]+$/,Let=/^[0-9A-HJKMNP-TV-Z]{26}$/i,qet=/^[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,Uet=/^[a-z0-9_-]{21}$/i,Bet=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Het=/^[-+]?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)?)??$/,zet=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Vet=/^(?:(?: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])$/,Wet=/^(?:(?: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])$/,Ket=/^(([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]))$/,Jet=/^(([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])$/,Yet=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Xet=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Qet=new RegExp(`^${hne}$`);Rl=class Rl extends Dt{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==he.string){let o=this._getOrReturnCtx(e);return fe(o,{code:ee.invalid_type,expected:he.string,received:o.parsedType}),We}let n=new Ro,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),fe(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),fe(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)fe(r,{code:ee.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});else if(i)fe(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(!zet.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"email",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="emoji"){if(!II)II=new RegExp(Get,"u");if(!II.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"emoji",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="uuid"){if(!qet.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"uuid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="nanoid"){if(!Uet.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"nanoid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid"){if(!Met.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"cuid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid2"){if(!jet.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"cuid2",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ulid"){if(!Let.test(e.data))r=this._getOrReturnCtx(e,r),fe(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),fe(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),fe(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),fe(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),fe(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),fe(r,{code:ee.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()}else if(o.kind==="datetime"){if(!ett(o).test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{code:ee.invalid_string,validation:"datetime",message:o.message}),n.dirty()}else if(o.kind==="date"){if(!Qet.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{code:ee.invalid_string,validation:"date",message:o.message}),n.dirty()}else if(o.kind==="time"){if(!Zet(o).test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{code:ee.invalid_string,validation:"time",message:o.message}),n.dirty()}else if(o.kind==="duration"){if(!Het.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"duration",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ip"){if(!ttt(e.data,o.version))r=this._getOrReturnCtx(e,r),fe(r,{validation:"ip",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="jwt"){if(!ntt(e.data,o.alg))r=this._getOrReturnCtx(e,r),fe(r,{validation:"jwt",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cidr"){if(!rtt(e.data,o.version))r=this._getOrReturnCtx(e,r),fe(r,{validation:"cidr",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64"){if(!Yet.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"base64",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64url"){if(!Xet.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"base64url",code:ee.invalid_string,message:o.message}),n.dirty()}else Tt.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,...Te.errToObj(n)})}_addCheck(e){return new Rl({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Te.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Te.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Te.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Te.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Te.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Te.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Te.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Te.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Te.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Te.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Te.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Te.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Te.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,...Te.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,...Te.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Te.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Te.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...Te.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Te.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Te.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Te.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Te.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Te.errToObj(t)})}nonempty(e){return this.min(1,Te.errToObj(e))}trim(){return new Rl({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Rl({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Rl({...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}};Rl.create=(e)=>new Rl({checks:[],typeName:Je.ZodString,coerce:e?.coerce??!1,...bt(e)});Gh=class Gh extends Dt{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)!==he.number){let o=this._getOrReturnCtx(e);return fe(o,{code:ee.invalid_type,expected:he.number,received:o.parsedType}),We}let n=void 0,r=new Ro;for(let o of this._def.checks)if(o.kind==="int"){if(!Tt.isInteger(e.data))n=this._getOrReturnCtx(e,n),fe(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),fe(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),fe(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(ott(e.data,o.value)!==0)n=this._getOrReturnCtx(e,n),fe(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),fe(n,{code:ee.not_finite,message:o.message}),r.dirty()}else Tt.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Te.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Te.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Te.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Te.toString(t))}setLimit(e,t,n,r){return new Gh({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Te.toString(r)}]})}_addCheck(e){return new Gh({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Te.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Te.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Te.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Te.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Te.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Te.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Te.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Te.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Te.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"&&Tt.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)}};Gh.create=(e)=>new Gh({checks:[],typeName:Je.ZodNumber,coerce:e?.coerce||!1,...bt(e)});Vh=class Vh extends Dt{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)!==he.bigint)return this._getInvalidInput(e);let n=void 0,r=new Ro;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),fe(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),fe(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),fe(n,{code:ee.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()}else Tt.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return fe(t,{code:ee.invalid_type,expected:he.bigint,received:t.parsedType}),We}gte(e,t){return this.setLimit("min",e,!0,Te.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Te.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Te.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Te.toString(t))}setLimit(e,t,n,r){return new Vh({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Te.toString(r)}]})}_addCheck(e){return new Vh({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Te.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Te.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Te.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Te.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Te.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}};Vh.create=(e)=>new Vh({checks:[],typeName:Je.ZodBigInt,coerce:e?.coerce??!1,...bt(e)});$S=class $S extends Dt{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==he.boolean){let n=this._getOrReturnCtx(e);return fe(n,{code:ee.invalid_type,expected:he.boolean,received:n.parsedType}),We}return Ho(e.data)}};$S.create=(e)=>new $S({typeName:Je.ZodBoolean,coerce:e?.coerce||!1,...bt(e)});K0=class K0 extends Dt{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==he.date){let o=this._getOrReturnCtx(e);return fe(o,{code:ee.invalid_type,expected:he.date,received:o.parsedType}),We}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return fe(o,{code:ee.invalid_date}),We}let n=new Ro,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),fe(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),fe(r,{code:ee.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()}else Tt.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new K0({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Te.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Te.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}};K0.create=(e)=>new K0({checks:[],coerce:e?.coerce||!1,typeName:Je.ZodDate,...bt(e)});DS=class DS extends Dt{_parse(e){if(this._getType(e)!==he.symbol){let n=this._getOrReturnCtx(e);return fe(n,{code:ee.invalid_type,expected:he.symbol,received:n.parsedType}),We}return Ho(e.data)}};DS.create=(e)=>new DS({typeName:Je.ZodSymbol,...bt(e)});J0=class J0 extends Dt{_parse(e){if(this._getType(e)!==he.undefined){let n=this._getOrReturnCtx(e);return fe(n,{code:ee.invalid_type,expected:he.undefined,received:n.parsedType}),We}return Ho(e.data)}};J0.create=(e)=>new J0({typeName:Je.ZodUndefined,...bt(e)});Y0=class Y0 extends Dt{_parse(e){if(this._getType(e)!==he.null){let n=this._getOrReturnCtx(e);return fe(n,{code:ee.invalid_type,expected:he.null,received:n.parsedType}),We}return Ho(e.data)}};Y0.create=(e)=>new Y0({typeName:Je.ZodNull,...bt(e)});CS=class CS extends Dt{constructor(){super(...arguments);this._any=!0}_parse(e){return Ho(e.data)}};CS.create=(e)=>new CS({typeName:Je.ZodAny,...bt(e)});ip=class ip extends Dt{constructor(){super(...arguments);this._unknown=!0}_parse(e){return Ho(e.data)}};ip.create=(e)=>new ip({typeName:Je.ZodUnknown,...bt(e)});$l=class $l extends Dt{_parse(e){let t=this._getOrReturnCtx(e);return fe(t,{code:ee.invalid_type,expected:he.never,received:t.parsedType}),We}};$l.create=(e)=>new $l({typeName:Je.ZodNever,...bt(e)});AS=class AS extends Dt{_parse(e){if(this._getType(e)!==he.undefined){let n=this._getOrReturnCtx(e);return fe(n,{code:ee.invalid_type,expected:he.void,received:n.parsedType}),We}return Ho(e.data)}};AS.create=(e)=>new AS({typeName:Je.ZodVoid,...bt(e)});Ba=class Ba extends Dt{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==he.array)return fe(t,{code:ee.invalid_type,expected:he.array,received:t.parsedType}),We;if(r.exactLength!==null){let s=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;if(s||i)fe(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)fe(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)fe(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 Xi(t,s,t.path,i)))).then((s)=>Ro.mergeArray(n,s));let o=[...t.data].map((s,i)=>r.type._parseSync(new Xi(t,s,t.path,i)));return Ro.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new Ba({...this._def,minLength:{value:e,message:Te.toString(t)}})}max(e,t){return new Ba({...this._def,maxLength:{value:e,message:Te.toString(t)}})}length(e,t){return new Ba({...this._def,exactLength:{value:e,message:Te.toString(t)}})}nonempty(e){return this.min(1,e)}};Ba.create=(e,t)=>new Ba({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Je.ZodArray,...bt(t)});Jn=class Jn extends Dt{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=Tt.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==he.object){let c=this._getOrReturnCtx(e);return fe(c,{code:ee.invalid_type,expected:he.object,received:c.parsedType}),We}let{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof $l&&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 Xi(r,d,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof $l){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)fe(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 Xi(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)=>Ro.mergeObjectSync(n,c));else return Ro.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(e){return Te.errToObj,new Jn({...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:Te.errToObj(e).message??r};return{message:r}}}:{}})}strip(){return new Jn({...this._def,unknownKeys:"strip"})}passthrough(){return new Jn({...this._def,unknownKeys:"passthrough"})}extend(e){return new Jn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Jn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Je.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Jn({...this._def,catchall:e})}pick(e){let t={};for(let n of Tt.objectKeys(e))if(e[n]&&this.shape[n])t[n]=this.shape[n];return new Jn({...this._def,shape:()=>t})}omit(e){let t={};for(let n of Tt.objectKeys(this.shape))if(!e[n])t[n]=this.shape[n];return new Jn({...this._def,shape:()=>t})}deepPartial(){return zh(this)}partial(e){let t={};for(let n of Tt.objectKeys(this.shape)){let r=this.shape[n];if(e&&!e[n])t[n]=r;else t[n]=r.optional()}return new Jn({...this._def,shape:()=>t})}required(e){let t={};for(let n of Tt.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];while(o instanceof Ha)o=o._def.innerType;t[n]=o}return new Jn({...this._def,shape:()=>t})}keyof(){return yne(Tt.objectKeys(this.shape))}};Jn.create=(e,t)=>new Jn({shape:()=>e,unknownKeys:"strip",catchall:$l.create(),typeName:Je.ZodObject,...bt(t)});Jn.strictCreate=(e,t)=>new Jn({shape:()=>e,unknownKeys:"strict",catchall:$l.create(),typeName:Je.ZodObject,...bt(t)});Jn.lazycreate=(e,t)=>new Jn({shape:e,unknownKeys:"strip",catchall:$l.create(),typeName:Je.ZodObject,...bt(t)});X0=class X0 extends Dt{_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 js(i.ctx.common.issues));return fe(t,{code:ee.invalid_union,unionErrors:s}),We}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 js(a));return fe(t,{code:ee.invalid_union,unionErrors:i}),We}}get options(){return this._def.options}};X0.create=(e,t)=>new X0({options:e,typeName:Je.ZodUnion,...bt(t)});FI=class FI extends Dt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==he.object)return fe(t,{code:ee.invalid_type,expected:he.object,received:t.parsedType}),We;let n=this.discriminator,r=t.data[n],o=this.optionsMap.get(r);if(!o)return fe(t,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),We;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=kl(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 FI({typeName:Je.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...bt(n)})}};Q0=class Q0 extends Dt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(o,s)=>{if(OI(o)||OI(s))return We;let i=NI(o.value,s.value);if(!i.valid)return fe(n,{code:ee.invalid_intersection_types}),We;if(TI(o)||TI(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}))}};Q0.create=(e,t,n)=>new Q0({left:e,right:t,typeName:Je.ZodIntersection,...bt(n)});Dl=class Dl extends Dt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==he.array)return fe(n,{code:ee.invalid_type,expected:he.array,received:n.parsedType}),We;if(n.data.length<this._def.items.length)return fe(n,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),We;if(!this._def.rest&&n.data.length>this._def.items.length)fe(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 Xi(n,s,n.path,i))}).filter((s)=>!!s);if(n.common.async)return Promise.all(o).then((s)=>Ro.mergeArray(t,s));else return Ro.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new Dl({...this._def,rest:e})}};Dl.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Dl({items:e,typeName:Je.ZodTuple,rest:null,...bt(t)})};OS=class OS extends Dt{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!==he.object)return fe(n,{code:ee.invalid_type,expected:he.object,received:n.parsedType}),We;let r=[],o=this._def.keyType,s=this._def.valueType;for(let i in n.data)r.push({key:o._parse(new Xi(n,i,n.path,i)),value:s._parse(new Xi(n,n.data[i],n.path,i)),alwaysSet:i in n.data});if(n.common.async)return Ro.mergeObjectAsync(t,r);else return Ro.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){if(t instanceof Dt)return new OS({keyType:e,valueType:t,typeName:Je.ZodRecord,...bt(n)});return new OS({keyType:Rl.create(),valueType:e,typeName:Je.ZodRecord,...bt(t)})}};TS=class TS extends Dt{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!==he.map)return fe(n,{code:ee.invalid_type,expected:he.map,received:n.parsedType}),We;let r=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([i,a],c)=>({key:r._parse(new Xi(n,i,n.path,[c,"key"])),value:o._parse(new Xi(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 We;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 We;if(c.status==="dirty"||l.status==="dirty")t.dirty();i.set(c.value,l.value)}return{status:t.value,value:i}}}};TS.create=(e,t,n)=>new TS({valueType:t,keyType:e,typeName:Je.ZodMap,...bt(n)});Wh=class Wh extends Dt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==he.set)return fe(n,{code:ee.invalid_type,expected:he.set,received:n.parsedType}),We;let r=this._def;if(r.minSize!==null){if(n.data.size<r.minSize.value)fe(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)fe(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 We;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 Xi(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 Wh({...this._def,minSize:{value:e,message:Te.toString(t)}})}max(e,t){return new Wh({...this._def,maxSize:{value:e,message:Te.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Wh.create=(e,t)=>new Wh({valueType:e,minSize:null,maxSize:null,typeName:Je.ZodSet,...bt(t)});W0=class W0 extends Dt{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==he.function)return fe(t,{code:ee.invalid_type,expected:he.function,received:t.parsedType}),We;function n(i,a){return RS({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,G0(),od].filter((c)=>!!c),issueData:{code:ee.invalid_arguments,argumentsError:a}})}function r(i,a){return RS({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,G0(),od].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 Kh){let i=this;return Ho(async function(...a){let c=new js([]),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 Ho(function(...a){let c=i._def.args.safeParse(a,o);if(!c.success)throw new js([n(a,c.error)]);let l=Reflect.apply(s,this,c.data),d=i._def.returns.safeParse(l,o);if(!d.success)throw new js([r(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new W0({...this._def,args:Dl.create(e).rest(ip.create())})}returns(e){return new W0({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new W0({args:e?e:Dl.create([]).rest(ip.create()),returns:t||ip.create(),typeName:Je.ZodFunction,...bt(n)})}};Z0=class Z0 extends Dt{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})}};Z0.create=(e,t)=>new Z0({getter:e,typeName:Je.ZodLazy,...bt(t)});ew=class ew extends Dt{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return fe(t,{received:t.data,code:ee.invalid_literal,expected:this._def.value}),We}return{status:"valid",value:e.data}}get value(){return this._def.value}};ew.create=(e,t)=>new ew({value:e,typeName:Je.ZodLiteral,...bt(t)});ap=class ap extends Dt{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return fe(t,{expected:Tt.joinValues(n),received:t.parsedType,code:ee.invalid_type}),We}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 fe(t,{received:t.data,code:ee.invalid_enum_value,options:n}),We}return Ho(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 ap.create(e,{...this._def,...t})}exclude(e,t=this._def){return ap.create(this.options.filter((n)=>!e.includes(n)),{...this._def,...t})}};ap.create=yne;tw=class tw extends Dt{_parse(e){let t=Tt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==he.string&&n.parsedType!==he.number){let r=Tt.objectValues(t);return fe(n,{expected:Tt.joinValues(r),received:n.parsedType,code:ee.invalid_type}),We}if(!this._cache)this._cache=new Set(Tt.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let r=Tt.objectValues(t);return fe(n,{received:n.data,code:ee.invalid_enum_value,options:r}),We}return Ho(e.data)}get enum(){return this._def.values}};tw.create=(e,t)=>new tw({values:e,typeName:Je.ZodNativeEnum,...bt(t)});Kh=class Kh extends Dt{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==he.promise&&t.common.async===!1)return fe(t,{code:ee.invalid_type,expected:he.promise,received:t.parsedType}),We;let n=t.parsedType===he.promise?t.data:Promise.resolve(t.data);return Ho(n.then((r)=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Kh.create=(e,t)=>new Kh({type:e,typeName:Je.ZodPromise,...bt(t)});za=class za extends Dt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Je.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(fe(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 We;let a=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});if(a.status==="aborted")return We;if(a.status==="dirty")return Hh(a.value);if(t.value==="dirty")return Hh(a.value);return a});else{if(t.value==="aborted")return We;let i=this._def.schema._parseSync({data:s,path:n.path,parent:n});if(i.status==="aborted")return We;if(i.status==="dirty")return Hh(i.value);if(t.value==="dirty")return Hh(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 We;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 We;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(!sp(s))return We;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(!sp(s))return We;return Promise.resolve(r.transform(s.value,o)).then((i)=>({status:t.value,value:i}))});Tt.assertNever(r)}};za.create=(e,t,n)=>new za({schema:e,typeName:Je.ZodEffects,effect:t,...bt(n)});za.createWithPreprocess=(e,t,n)=>new za({schema:t,effect:{type:"preprocess",transform:e},typeName:Je.ZodEffects,...bt(n)});Ha=class Ha extends Dt{_parse(e){if(this._getType(e)===he.undefined)return Ho(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ha.create=(e,t)=>new Ha({innerType:e,typeName:Je.ZodOptional,...bt(t)});sd=class sd extends Dt{_parse(e){if(this._getType(e)===he.null)return Ho(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};sd.create=(e,t)=>new sd({innerType:e,typeName:Je.ZodNullable,...bt(t)});nw=class nw extends Dt{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;if(t.parsedType===he.undefined)n=this._def.defaultValue();return this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};nw.create=(e,t)=>new nw({innerType:e,typeName:Je.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...bt(t)});rw=class rw extends Dt{_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(V0(r))return r.then((o)=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new js(n.common.issues)},input:n.data})}));else return{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new js(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};rw.create=(e,t)=>new rw({innerType:e,typeName:Je.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...bt(t)});PS=class PS extends Dt{_parse(e){if(this._getType(e)!==he.nan){let n=this._getOrReturnCtx(e);return fe(n,{code:ee.invalid_type,expected:he.nan,received:n.parsedType}),We}return{status:"valid",value:e.data}}};PS.create=(e)=>new PS({typeName:Je.ZodNaN,...bt(e)});JYt=Symbol("zod_brand");MI=class MI extends Dt{_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}};IS=class IS extends Dt{_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 We;if(o.status==="dirty")return t.dirty(),Hh(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 We;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 IS({in:e,out:t,typeName:Je.ZodPipeline})}};ow=class ow extends Dt{_parse(e){let t=this._def.innerType._parse(e),n=(r)=>{if(sp(r))r.value=Object.freeze(r.value);return r};return V0(t)?t.then((r)=>n(r)):n(t)}unwrap(){return this._def.innerType}};ow.create=(e,t)=>new ow({innerType:e,typeName:Je.ZodReadonly,...bt(t)});YYt={object:Jn.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"})(Je||(Je={}));w=Rl.create,C=Gh.create,XYt=PS.create,QYt=Vh.create,re=$S.create,ZYt=K0.create,eXt=DS.create,tXt=J0.create,nXt=Y0.create,rXt=CS.create,fi=ip.create,oXt=$l.create,sXt=AS.create,J=Ba.create,I=Jn.create,iXt=Jn.strictCreate,Jh=X0.create,jI=FI.create,aXt=Q0.create,cXt=Dl.create,Yn=OS.create,lXt=TS.create,uXt=Wh.create,dXt=W0.create,fXt=Z0.create,Ke=ew.create,Xe=ap.create,pXt=tw.create,mXt=Kh.create,hXt=za.create,gXt=Ha.create,yXt=sd.create,bXt=za.createWithPreprocess,wXt=IS.create});var LI=H(()=>{kS();PI();fne();z0();bne();SS()});var kn=H(()=>{LI();LI()});function qI(e){return NS.includes(e)}var stt,cp,NS,wne,itt,_ne,att,xne,ctt,ltt,vne,utt,Ene,AXt,OXt,Sne,dtt,kne,ftt,Rne,UI=20,BI=500,ptt,TXt;var Yh=H(()=>{kn();stt=Xe(["pending","verified","approved","revoked"]),cp=Xe(["person","service","test"]),NS=cp.options;wne={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"},itt=Xe(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),_ne=itt.options,att=Xe(["active","pending","revoked"]),xne=I({field:w(),blocks:J(w()).optional(),set_on:J(w()).optional()}).passthrough(),ctt=I({id:C().int(),username:w().nullable(),email:w(),github_username:w().nullable(),role:w(),orcid:w().nullable().optional(),created_at:w().optional(),approved_at:w().nullable().optional(),dataset_count:C().int().optional(),sandbox_completed:re().optional(),sandbox_completed_at:w().nullable().optional(),sandbox_dataset_id:w().nullable().optional(),service_access:re().optional(),status:stt.optional(),email_verified:re().optional(),orcid_verified:re().optional(),given_name:w().nullable().optional(),family_name:w().nullable().optional(),profile_gaps:J(xne).optional(),username_auto_assigned:re().optional(),account_kind:cp.optional(),compute_access:w().optional(),compute_access_requested_at:w().nullable().optional(),compute_access_granted_at:w().nullable().optional()}).passthrough(),ltt=I({prefix:w(),created_at:w(),last_used_at:w().nullable()}).passthrough().nullable(),vne=I({user:ctt,token:ltt.optional()}).passthrough(),utt=I({id:C().int(),username:w().nullable(),email:w(),github_username:w().nullable(),status:w(),email_verified:C().int().nullable().optional(),role:w().nullable(),created_at:w(),approved_at:w().nullable().optional(),revoked_at:w().nullable().optional(),signup_source:w().nullable().optional(),service_access:C().int().nullable().optional(),service_access_granted_at:w().nullable().optional(),given_name:w().nullable().optional(),family_name:w().nullable().optional(),orcid:w().nullable().optional(),upload_access_requested_at:w().nullable().optional(),account_kind:cp.optional(),matched_in:J(w()).optional(),match_kind:w().optional()}).passthrough(),Ene=I({users:J(utt),count:C().int()}).passthrough(),AXt=Xe(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),OXt=Xe(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),Sne=I({suggestion:w().nullable(),based_on:Xe(["name","unavailable","exhausted"])}).passthrough(),dtt=Xe(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),kne=dtt.options,ftt=Xe(["invalid_github_username","city_required","country_required","empty_patch","username_too_short","username_too_long","username_charset","username_reserved","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"]),Rne=ftt.options,ptt=I({id:C().int(),email:w(),username:w().nullable(),role:w(),status:att,email_verified:re(),given_name:w().nullable(),family_name:w().nullable(),orcid:w().nullable(),orcid_verified:re(),github_username:w().nullable(),city:w().nullable(),country:w().nullable(),affiliation:w().nullable(),service_access:re(),service_access_granted_at:w().nullable(),upload_access_requested_at:w().nullable(),profile_gaps:J(xne),username_auto_assigned:re(),compute_access:w().optional(),compute_access_requested_at:w().nullable().optional(),compute_access_granted_at:w().nullable().optional()}).passthrough(),TXt=I({user:ptt.nullable()}).passthrough()});var HI,zI,FXt,mtt,MXt,htt,$ne,Dne,GI=8,VI=100,Cne,Ane,gtt,One;var sw=H(()=>{kn();Yh();HI=["given_name","family_name","affiliation","city","country"],zI=["username","github_username","email","orcid"],FXt=[...HI,...zI],mtt={given_name:w().max(200).optional(),family_name:w().max(200).optional(),affiliation:w().max(500).optional(),city:w().max(200).optional(),country:w().max(200).optional(),username:w().max(100).optional(),github_username:w().max(100).optional(),email:w().max(320).optional(),orcid:w().max(40).optional()},MXt=I(mtt),htt=Xe(["field_not_editable","owner_only_field","edit_own_account","owner_account","system_account","invalid_edit","orcid_already_proven","invalid_search","invalid_user_id"]),$ne=htt.options,Dne=["exact","name","prefix","substring","fuzzy"],Cne=I({id:C().int(),username:w().nullable(),email:w(),github_username:w().nullable(),status:w(),role:w().nullable(),account_kind:cp.optional(),email_verified:C().int().nullable().optional(),orcid:w().nullable().optional(),orcid_verified:C().int().nullable().optional(),given_name:w().nullable().optional(),family_name:w().nullable().optional(),affiliation:w().nullable().optional(),city:w().nullable().optional(),country:w().nullable().optional(),description:w().nullable().optional(),signup_source:w().nullable().optional(),created_at:w(),updated_at:w().nullable().optional(),approved_at:w().nullable().optional(),revoked_at:w().nullable().optional(),deleted_at:w().nullable().optional(),service_access:C().int().nullable().optional(),service_access_granted_at:w().nullable().optional(),service_access_granted_by:C().int().nullable().optional(),upload_access_requested_at:w().nullable().optional(),upload_access_notified_at:w().nullable().optional(),compute_access:w().optional(),compute_access_requested_at:w().nullable().optional(),compute_access_notified_at:w().nullable().optional(),compute_access_granted_at:w().nullable().optional(),compute_access_granted_by:C().int().nullable().optional(),compute_terms_version:w().nullable().optional(),compute_terms_accepted_at:w().nullable().optional(),identity_conflict:C().int().nullable().optional(),username_auto_assigned:C().int().nullable().optional(),sandbox_completed:C().int().nullable().optional(),sandbox_completed_at:w().nullable().optional(),sandbox_dataset_id:w().nullable().optional(),aws_iam_username:w().nullable().optional(),dataset_count:C().int().optional(),active_tokens:C().int().optional(),linked_identities:J(w()).optional()}).passthrough(),Ane=I({user:Cne}).passthrough(),gtt=I({from:w().nullable(),to:w().nullable()}),One=I({message:w(),changed:Yn(w(),gtt),notes:J(w()).optional(),old_address_notified:re().optional(),user:Cne}).passthrough()});function wtt(e){return e.startsWith("v")?e:`v${e}`}var ytt,btt,Tne,qXt;var WI=H(()=>{kn();ytt=/^v?\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/,btt=/^v\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/;Tne=w().regex(ytt,"must be a semver version, optionally v-prefixed").transform(wtt),qXt=w().regex(btt,"must be the canonical v-prefixed tag (vX.Y.Z)")});function Ine(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 Nne(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 _tt="0.4.1",KI,Xh,Pne,xtt,vtt,Ett,Fne,zXt,Mne,GXt,Cl,Stt,FS,VXt,ktt,Rtt,WXt;var JI=H(()=>{kn();WI();KI=Xe(["openneuro","nemar","gin","other"]),Xh=Jh([Ke(0),Ke(1)]).nullable(),Pne=I({dataset_id:w(),id:w().optional(),name:w(),description:w().nullable().optional(),status:w(),visibility:w(),anonymous:C().int().nullable().optional(),concept_doi:w().nullable().optional(),doi:w().nullable().optional(),created_at:w(),updated_at:w().optional(),first_published_at:w().nullable().optional(),owner_username:w().nullable().optional(),source:w().nullable().optional(),modalities:w().optional(),participants:C().int().nonnegative(),tasks:w().optional(),authors:w().optional(),license:w().optional(),file_size:C().nonnegative(),file_size_formatted:w().optional(),total_files:C().nonnegative().nullable().optional(),num_citations:C().int().nonnegative().optional(),n_channels:C().int().nullable().optional(),electrode_system:w().nullable().optional(),has_hed:Xh.optional(),hed_version:w().nullable().optional(),data_complete:Xh.optional(),bytes_present:C().nonnegative().nullable().optional(),latest_version:Tne.nullable().optional(),latest_version_at:w().nullable().optional(),subject_count:C().int().nullable().optional(),file_size_bytes:C().nullable().optional(),sessions_count:C().int().nullable().optional(),age_min:C().nullable().optional(),age_max:C().nullable().optional(),bids_version:w().nullable().optional(),zarr_status:Xe(["pending","ready","failed"]).nullable().optional(),zarr_store_count:C().int().nullable().optional(),zarr_converted_at:w().nullable().optional(),zarr_source_commit:w().nullable().optional(),zarr_errors:C().int().nullable().optional(),zarr_failure_count:C().int().nullable().optional(),zarr_deterministic:Xh.optional(),zarr_failed_at:w().nullable().optional(),zarr_index_url:w().nullable().optional(),zarr_verify_status:Xe(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:w().nullable().optional(),zarr_requeue_at:w().nullable().optional(),anonymity_status:Xe(["verified","findings","unverifiable"]).nullable().optional(),anonymity_checked_at:w().nullable().optional(),anonymity_findings:w().nullable().optional(),anonymity_unchecked:w().nullable().optional(),total_recording_duration:C().nullable().optional(),recording_duration_min:C().nullable().optional(),recording_duration_max:C().nullable().optional(),recording_count:C().int().nullable().optional(),recordings_unavailable:C().int().nullable().optional(),channel_count_min:C().int().nullable().optional(),channel_count_max:C().int().nullable().optional(),sampling_frequency:C().nullable().optional(),power_line_frequency:C().nullable().optional(),eeg_reference:w().nullable().optional(),placement_scheme:w().nullable().optional()}).passthrough();xtt=Pne.superRefine((e,t)=>{Ine(e,t),Nne(e,t)}),vtt=Pne.extend({file_size:C().nonnegative().nullable(),file_size_formatted:w().nullable().optional(),modalities:w().nullable().optional(),tasks:w().nullable().optional(),authors:w().nullable().optional(),license:w().nullable().optional(),owner_github:w().nullable().optional(),attestation_deposit_type:Xe(["owner","redistribution"]).nullable().optional(),attestation_key_status:Xe(["destroyed","retained"]).nullable().optional(),attestation_deidentified:Xh.optional(),attestation_no_duplicate:Xh.optional(),attestation_upstream_source:w().nullable().optional(),attestation_accepted_at:w().nullable().optional(),zarr_data_failures:I({count:C().int().nonnegative(),detail_ref:w(),compacted_by:w().optional(),pending:C().int().nonnegative().optional(),discovered:C().int().nonnegative().optional(),events_upload_failed:Ke(!0).optional(),manifest_upload_failed:Ke(!0).optional()}).passthrough().nullable().optional()}).passthrough().superRefine((e,t)=>{Ine(e,t),Nne(e,t)}),Ett=I({id:w(),name:w(),modalities:w().nullable().optional(),participants:C().int().nullable().optional(),doi:w().nullable().optional(),tasks:w().nullable().optional(),authors:w().nullable().optional(),has_hed:Xh.optional(),score:C().optional(),snippet:w().optional()}).passthrough(),Fne=Yn(w(),C().int().nonnegative()),zXt=I({datasets:J(xtt),count:C().int().nonnegative(),total_count:C().int().nonnegative().optional(),limit:C().int().optional(),offset:C().int().optional(),excluded_unknown:C().int().nonnegative().optional(),excluded_unknown_by_facet:Fne.optional()}).passthrough(),Mne=I({results:J(Ett),count:C().int().nonnegative(),returned:C().int().nonnegative().optional(),offset:C().int().nonnegative().optional(),limit:C().int().optional(),candidate_ceiling:C().int().optional(),truncated:re().optional(),method:Xe(["exact_id","text","text_fallback","semantic","unavailable"]).optional(),min_score:C().optional(),reranked:Ke(!0).optional(),corrected_query:w().optional(),modality_boost:J(w()).optional(),warning:w().optional(),excluded_unknown:C().int().nonnegative().optional(),excluded_unknown_by_facet:Fne.optional()}).passthrough(),GXt=I({dataset:vtt}).passthrough(),Cl=I({value:w(),count:C().int().nonnegative()}),Stt=I({values:J(Cl),distinct_total:C().int().nonnegative(),truncated:re()}),FS=I({"electrode-system":J(Cl).optional(),source:J(Cl).optional(),zarr:J(Cl).optional(),powerline:J(Cl).optional(),"bids-version":J(Cl).optional(),"hed-version":J(Cl).optional(),license:J(Cl).optional(),modality:J(Cl).optional(),task:Stt.optional(),warning:w().optional()}).passthrough(),VXt=I({schema_version:Ke(_tt),doc_type:Ke("dataset"),dataset_id:w().regex(/^[a-z]{2}\d+$/,"neuroschema dataset_id pattern"),name:w(),source:KI,recording_modality:J(w()).min(1),description:w().nullable().optional(),bids_version:w().nullable().optional(),license:w().nullable().optional()}).passthrough(),ktt=I({tasks:Yn(I({runs:J(w())}).passthrough())}).passthrough(),Rtt=I({sessions:J(w()),modalities:Yn(ktt),session_modalities:Yn(J(w())).optional()}).passthrough(),WXt=I({version:w(),subjects:Yn(Rtt)}).passthrough()});function MS(e){return typeof e==="string"&&jne.includes(e)}var $tt,YXt,XXt,QXt,jne,Dtt="ci_check_unavailable",Lne,qne,Une,Bne="X-Approval-Dispatch-Token",ZXt;var iw=H(()=>{kn();$tt=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,YXt=w().regex($tt,"ORCID must be in format 0000-0000-0000-000X"),XXt=Xe(["found","no_public_name","lookup_failed"]),QXt=Xe(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing","identifier_screen_findings"]),jne=["bids_validation_pending","bids_validation_in_progress"];Lne=[Dtt],qne=["identifier_screen_pending","identifier_screen_not_clear","identifier_screen_not_applicable"],Une=["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"],ZXt=Xe(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});var Ctt,Hne,aw="https://nemar.org/settings",nQt,Att,Ott,Ttt,zne,Gne;var YI=H(()=>{kn();Ctt=Xe(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),Hne=Ctt.options,nQt={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, ${aw}).`,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, ${aw}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${aw}), 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, ${aw}).`,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, ${aw}).`,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."},Att=Xe(["orcid","email","github"]),Ott=I({id:C().int(),username:w().nullable(),email:w(),created_at:w(),has_oauth_identity:re(),dataset_count:C().int(),identity_conflict:C().int(),canonical:re()}).passthrough(),Ttt=I({kind:Att,value:w(),canonical_user_id:C().int(),accounts:J(Ott)}).passthrough(),zne=I({groups:J(Ttt),group_count:C().int(),flagged_count:C().int()}).passthrough(),Gne=I({ok:Ke(!0),id:C().int(),cleared:re()}).passthrough()});var XI=120,Vne=64,QI="unnamed machine",Ptt=25,jS,Wne,Qh,Kne,sQt,iQt,Jne,Itt,Ntt,Yne,ZI,Xne,aQt,cQt,LS,qS;var US=H(()=>{kn();jS=Xe(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),Wne={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."},Qh=Xe(["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"]),Kne=Qh.options,sQt={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 ${Ptt} 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."},iQt=I({error:Qh,message:w()}).passthrough(),Jne=I({device_code:w(),user_code:w(),verification_uri:w(),verification_uri_complete:w(),expires_in:C().int(),interval:C().int()}).passthrough(),Itt=jI("error",[I({error:Ke("authorization_pending"),message:w()}).passthrough(),I({error:Ke("slow_down"),message:w()}).passthrough()]),Ntt=jI("error",[I({error:Ke("expired_token"),reason:Qh,message:w()}).passthrough(),I({error:Ke("access_denied"),reason:Qh,message:w()}).passthrough(),I({error:Ke("invalid_grant"),reason:Qh,message:w()}).passthrough()]),Yne=Jh([Itt,Ntt]),ZI=I({id:C().int(),name:w().nullable(),prefix:w(),created_at:w(),last_used_at:w().nullable(),current:re()}).passthrough(),Xne=I({api_key:w(),key:ZI,user:I({username:w().nullable(),email:w(),github_username:w().nullable(),role:w(),sandbox_completed:re(),sandbox_dataset_id:w().nullable()}).passthrough()}).passthrough(),aQt=I({user_code:w(),machine_name:w(),requested_at:w(),expires_in:C().int(),account:I({username:w().nullable(),email_masked:w()}).passthrough(),refusal:I({code:Qh,message:w()}).passthrough().nullable()}).passthrough(),cQt=I({ok:Ke(!0),machine_name:w()}).passthrough(),LS=I({keys:J(ZI)}).passthrough(),qS=I({api_key:w(),key:ZI}).passthrough()});function br(e){return rt[e]}function Al(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>Object.hasOwn(t,r)?t[r]:n)}var rt;var Ol=H(()=>{rt={"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","compute_access.section.title":"Compute access","compute_access.section.lede":"A separate grant from upload access. An admin reviews each request against export-control and local-jurisdiction rules and the purpose you state, and a grant lets you use compute within the limits an administrator sets.","compute_access.state.none":"Not requested","compute_access.state.requested":"Requested","compute_access.state.active":"Active","compute_access.state.suspended":"Suspended","compute_access.state.denied":"Not granted","compute_access.state.revoked":"Ended","compute_access.request.cta":"Request compute access","compute_access.request.form_body":"Tell us what you plan to compute. An admin reviews this alongside your name, affiliation and location, then answers once. You also accept the compute terms.","compute_access.request.purpose_label":"What do you intend to compute?","compute_access.request.purpose_hint":"Describe what you intend to compute in 20-1000 characters","compute_access.request.terms_label":"I accept the compute terms","compute_access.requested.title":"Your compute request is with an admin","compute_access.requested.lede":"An admin is reviewing your request.","compute_access.requested.lede_dated":"An admin is reviewing your request from {date}.","compute_access.requested.body":"We\u2019ll email you when there\u2019s a decision. Everything else on your account keeps working in the meantime.","compute_access.granted.body":"Compute access is active. Your balances are on your compute page, and you submit jobs with the `nemar compute` command line.","compute_access.granted.link":"Open your compute page","compute_access.closed.body":"This request has been answered and cannot be asked again. If you think that is a mistake, contact support and an admin will take another look.","compute_access.suspended.body":"Your compute access is paused. Contact support to find out why or to ask for it to be lifted.","compute_access.terms_unpublished.body":"Compute access is not open yet: the compute terms are not published. Please check back later.","compute_access.docs_link":"How compute access works","compute_page.frozen.body":"Your pools are frozen, so new jobs are refused. Contact support to find out why.","compute_page.units_note":"Amounts are service units (SU).","compute_page.available_note":"Available is granted minus held minus charged and can be negative after an overrun.","compute_page.queue_note":"It describes the queue of the whole platform, not yours, and it is a recent average, not a promise.","compute_page.usage_note":"Net charge by UTC day of the charge, not the day a job was created. A day with no charge has no bar.","compute_page.unreported_note":"NEMAR has not heard from the cluster about this job for a while. It may still finish.","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.compute_access":"to request compute 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.compute_access":"compute 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.affiliation.label":"Affiliation","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.affiliation.set_on.web":"Settings","gap.field.affiliation.set_on.cli":"nemar auth profile set-affiliation","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.","oidc.consent.title":"{client} wants to use your NEMAR account","oidc.consent.acts_as_you":"If you allow it, {client} can act as you on NEMAR in the ways listed below.","oidc.consent.compute_spend":"If you sign in and run compute with this app, it counts against your NEMAR compute allocation.","oidc.consent.scopes_title":"It is asking to:","oidc.consent.scope.openid":"Know which NEMAR account is yours","oidc.consent.scope.profile":"See your name","oidc.consent.scope.email":"See your email address","oidc.consent.scope.orcid":"See your ORCID iD, and whether you proved it by signing in with ORCID","oidc.consent.scope.nemar.account":"See your account type, status and access level","oidc.consent.scope.offline_access":"Keep this access when you are not using it","oidc.consent.scope.compute.read":"See your compute access, balances, usage and jobs","oidc.consent.scope.compute.reserve":"Reserve compute time, report jobs and release reservations for you","oidc.consent.scope.compute.submit":"Submit compute jobs that NEMAR runs for you","oidc.consent.redirect_host":"Either answer sends you to {redirect_host}.","oidc.consent.allow":"Allow","oidc.consent.deny":"Deny","oidc.rule.title":"You can\u2019t sign in to {client} with this account","oidc.rule.account_inactive":"Your NEMAR account is not active.","oidc.rule.account_not_person":"{client} is only for personal accounts, and this account is not one.","oidc.rule.orcid_not_proven":"{client} needs an ORCID iD you proved by signing in to NEMAR with ORCID. Link your ORCID iD in Settings, then try again.","oidc.rule.return":"Return to {client}","oidc.error.title":"This sign-in can\u2019t continue","oidc.error.invalid_client":"The site that sent you here is not one NEMAR signs people in to.","oidc.error.invalid_redirect_uri":"The site that sent you here asked NEMAR to send you to an address it has not registered, so NEMAR will not send you there.","oidc.error.invalid_request":"The sign-in request is incomplete or malformed. Go back to the site you came from and start again.","oidc.error.consent_invalid":"This page has expired. Go back to the site you came from and start again.","oidc.error.unavailable":"NEMAR could not complete this sign-in right now. Try again in a moment.","oidc.error.rate_limited":"Too many sign-in attempts. Try again in a minute.","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.compute_access.cta":"Ask for it with `nemar compute request-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 Mtt(e){return e==="verified"||e==="upload_access"||e==="compute_access"||e==="publication"}function lp(e){return(e??"").trim().length===0}function jtt(e){return e==="service"||e==="test"}function ere(e,t={}){let n=t.orcidVerified===!0,r=Object.hasOwn(BS,e)?BS[e]:void 0;if(!r)return{field:e,label:e,blocks:t.blocks??[],setOnWeb:rt["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:rt[r.labelKey],setOnWeb:rt[o?r.orcidWebKey:r.webKey],setOnCli:o||r.cliKey===null?null:rt[r.cliKey],known:!0}}function Qne(e){let t=eN.indexOf(e);return t===-1?eN.length:t}function tre(e,t={}){return e.map((n)=>ere(n,{orcidVerified:t.orcidVerified}))}function Zh(e,t={}){return e.filter((n)=>!!n&&typeof n.field==="string").map((n)=>{let r=Array.isArray(n.blocks)?n.blocks.filter(Mtt):[];return ere(n.field,{orcidVerified:t.orcidVerified,blocks:r.length>0?r:void 0})}).sort((n,r)=>Qne(n.field)-Qne(r.field))}function tN(e){let t=e.blocks[0],n=t?rt[Ftt[t]]:rt["gap.blocks.unknown"],r=Al(rt["gap.sentence"],{label:"",blocks:n}).trimStart(),o=e.setOnCli?Al(rt["gap.set_on.both"],{web:e.setOnWeb,cli:e.setOnCli}):Al(rt["gap.set_on.web"],{web:e.setOnWeb});return`${r} ${o}`}function HS(e){return`${e.label} ${tN(e)}`}function zS(){let e=Al(rt["gap.sentence"],{label:Zne.label,blocks:rt["cli.gap.blocks.sandbox"]}),t=Al(rt["cli.gap.set_on.cli_only"],{cli:Zne.command});return`${e} ${t}`}function nre(){return rt["cli.gaps.sandbox_unchecked"]}var BS,eN,fQt,Ftt,Zne;var up=H(()=>{Ol();BS={email_verified:{blocks:["verified","upload_access","compute_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&&lp(e.username)},given_name:{blocks:["upload_access","compute_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)=>lp(e.given_name)},family_name:{blocks:["upload_access","compute_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)=>lp(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&&!jtt(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)=>lp(e.github_username)},city:{blocks:["upload_access","compute_access"],labelKey:"gap.field.city.label",webKey:"gap.field.city.set_on.web",cliKey:"gap.field.city.set_on.cli",isMissing:(e)=>lp(e.city)},country:{blocks:["upload_access","compute_access"],labelKey:"gap.field.country.label",webKey:"gap.field.country.set_on.web",cliKey:"gap.field.country.set_on.cli",isMissing:(e)=>lp(e.country)},affiliation:{blocks:["compute_access"],labelKey:"gap.field.affiliation.label",webKey:"gap.field.affiliation.set_on.web",cliKey:"gap.field.affiliation.set_on.cli",isMissing:(e)=>lp(e.affiliation)},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}},eN=Object.keys(BS),fQt=eN.filter((e)=>BS[e].isMissing!==null),Ftt={verified:"gap.blocks.verified",upload_access:"gap.blocks.upload_access",compute_access:"gap.blocks.compute_access",publication:"gap.blocks.publication"};Zne={field:"sandbox",label:rt["cli.gap.field.sandbox.label"],command:rt["cli.gap.field.sandbox.set_on.cli"]}});function KS(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 zo,GS,rre,VS,Ltt,WS,qtt,Utt,Btt,Htt,ztt,hQt,Gtt,gQt,Vtt,yQt;var nN=H(()=>{kn();zo=/^[a-z]{2}[0-9]{6}$/,GS=/^[0-9a-f]{40}$/,rre=I({name:w(),modality:w().nullable().optional(),rate:C().nullable().optional(),n_channels:C().int().nonnegative().nullable().optional(),n_samples:C().int().nonnegative().nullable().optional(),duration_s:C().nonnegative().nullable().optional(),source_rate_hz:C().nullable().optional(),n_view_levels:C().int().nonnegative().optional(),view_chunk_columns:C().int().positive().optional(),chunk_samples:C().int().positive().optional(),shard_samples:C().int().positive().optional()}).passthrough(),VS=I({converted:C().int().nonnegative().optional(),relabelled:C().int().nonnegative().optional(),kept_importer_unit:C().int().nonnegative().optional(),units_column_present:re().optional(),sidecar:w().optional(),sidecar_supplied:re().optional(),unmatched_channels:C().int().nonnegative().optional(),unmatched_case_only:C().int().positive().optional(),matched_case_only:C().int().positive().optional(),matched_case_only_examples:J(w()).max(5).optional(),unmatched_raw_label:C().int().positive().optional(),unmatched_examples:J(w()).max(5).optional()}).passthrough(),Ltt=I({channels_tsv:C().int().positive(),in_file:C().int().nonnegative(),in_store:C().int().nonnegative()}).passthrough(),WS=I({applied:re().optional(),method:w().optional(),calibration:w().optional(),cross_talk:w().optional(),mne_version:w().optional()}).passthrough();qtt=I({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),updated_utc:w().optional(),source_tree:Ke("raw"),derived:re(),modalities:J(w()).optional(),groups:J(rre).optional(),power_line_frequency:C().nullable().optional(),event_description_count:C().int().nonnegative().optional(),n_events:C().int().nonnegative().optional(),trial_types:Yn(w(),C().int().nonnegative()).optional(),units_report:VS.optional(),channels_tsv_read_error:re().optional(),channels_tsv_count_mismatch:Ltt.optional(),split_members:J(w()).optional(),sss:WS.optional()}).passthrough().superRefine(KS),Utt=I({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr").optional(),code:w(),reason:w(),detail:w().nullable().optional(),attempts:C().int().nonnegative().optional()}).passthrough(),Btt=Xe(["infra_failure","memory_budget","not_attempted"]),Htt=I({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),reason:Btt,attempts:C().int().nonnegative(),last_error:w().nullable().optional(),last_attempt_utc:w().nullable().optional()}).passthrough(),ztt=I({level0:Ke("<zarr>/<group>/0"),view:Ke("<zarr>/<group>/view/<L>"),view_levels:Ke("1..n_view_levels from the group attrs"),scale_offset:Ke("level-0 array attrs scale[] and offset[]; physical = digital * scale + offset"),events:Ke("<data_base>events.parquet").optional()}).passthrough(),hQt=I({format:Ke("nemar-zarr-index"),format_version:Ke(3),dataset_id:w().regex(zo,"NEMAR dataset id (nm/on/xx band)"),contract_base:w().regex(/^https:\/\//,"must be https"),data_base:w().regex(/^https:\/\//,"must be https"),data_base_kind:Ke("s3-public"),s3_uri:w().regex(/^s3:\/\//,"must be an s3:// URI"),s3_region:w().min(1),s3_anonymous:re(),source_commit:w().regex(GS,"must be a full 40-hex SHA"),engine_version:w().min(1),biosigio_version:w().nullable().optional(),updated_utc:w(),discovered_count:C().int().nonnegative(),store_count:C().int().nonnegative(),n_recordings:C().int().nonnegative(),errors:C().int().nonnegative(),failure_count:C().int().nonnegative(),pending_count:C().int().nonnegative(),stores:J(qtt),failures:J(Utt),pending:J(Htt),doi:w().nullable().optional(),license:w().nullable().optional(),citation:w().nullable().optional(),hed_version:w().nullable().optional(),events_parquet:w().regex(/^https:\/\//,"must be https").optional(),events_row_count:C().int().nonnegative().optional(),layout:ztt}).passthrough(),Gtt=I({name:w(),configuration:Yn(w(),fi()).optional()}).passthrough(),gQt=I({zarr_format:Ke(3),node_type:Ke("array"),shape:J(C().int().nonnegative()),data_type:w(),chunk_grid:I({name:w(),configuration:Yn(w(),fi()).optional()}).passthrough(),codecs:J(Gtt),fill_value:fi().optional(),attributes:Yn(w(),fi()).optional(),dimension_names:J(w().nullable()).optional()}).passthrough(),Vtt=I({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),groups:J(rre).optional(),modalities:J(w()).optional()}).passthrough(),yQt=I({format:Ke("nemar-zarr-index"),format_version:C().int(),dataset_id:w().regex(zo,"NEMAR dataset id (nm/on/xx band)"),source_commit:w(),stores:J(Vtt)}).passthrough()});function ore(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 Wtt,Ktt,Jtt,Ytt,Ga,_Qt;var JS=H(()=>{JI();Wtt=["10-05","10-10","10-20","biosemi","egi-geodesic","other"],Ktt=["50","60"],Jtt=["ready","pending","failed"],Ytt=KI.options,Ga=[{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:Ktt},{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:Wtt},{key:"source",flag:"--source",queryParam:"source",valueKind:"enum",label:"Source archive",enumValues:Ytt},{key:"zarr",flag:"--zarr",queryParam:"zarr",valueKind:"enum",label:"Zarr conversion status",enumValues:Jtt},{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"}],_Qt=new Map(Ga.map((e)=>[e.key,e]))});var Xtt,kQt,Qtt,lre,cw,sre,Ztt,ure,ent=20,tnt=100,nnt,dre,rnt,RQt,$Qt,ont,DQt,CQt,snt,int,ant,AQt,cnt=50,lnt=500,OQt,unt,dnt,TQt,fnt=1000,pnt=5000,ire=8,mnt=100,hnt=32,are,PQt,gnt,ynt,bnt,IQt,wnt=800,_nt=4000,NQt,FQt,rN=60,oN=64,cre,xnt=86400,vnt=4096,MQt,Ent,Snt,jQt;var fre=H(()=>{kn();JS();nN();Xtt=I({dataset_id:w().regex(zo),name:w(),doi:w().nullable().optional(),license:w().nullable().optional(),modalities:J(w()).optional(),tasks:J(w()).optional(),subject_count:C().int().nonnegative().nullable().optional(),has_hed:Jh([Ke(0),Ke(1)]).nullable().optional(),hed_version:w().nullable().optional(),store_count:C().int().nonnegative().nullable().optional(),recording_count:C().int().nonnegative().nullable().optional(),recordings_unavailable:C().int().nonnegative().nullable().optional(),total_recording_duration:C().nullable().optional(),zarr_converted_at:w().nullable().optional(),zarr_source_commit:w().nullable().optional(),zarr_errors:C().int().nonnegative().nullable().optional(),zarr_verify_status:Xe(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:w().nullable().optional(),index_url:w().nullable().optional()}).passthrough(),kQt=I({format:Ke("nemar-zarr-catalog"),format_version:C().int(),generated_utc:w(),contract_base:w(),count:C().int().nonnegative(),datasets:J(Xtt)}).passthrough(),Qtt=["verified","failed","unverifiable"],lre=Xe(Qtt).nullable(),cw=I({dataset_id:w().regex(zo),doi:w().nullable(),license:w().nullable(),citation:w().nullable(),source_commit:w().regex(GS),index_etag:w().nullable(),engine_version:w(),source_tree:Ke("raw"),derived:re(),sss:WS.optional(),lossy:re(),dtype:w().nullable(),effective_rate_hz:C().nullable(),source_rate_hz:C().nullable(),units_report:VS.nullable().optional(),zarr_verify_status:lre,note:w().nullable().optional()}).passthrough().superRefine(KS),sre=I({start:C().int().nonnegative(),end:C().int().nonnegative()}).passthrough().refine((e)=>e.end>=e.start,{message:"end must be >= start",path:["end"]}),Ztt=I({python_zarr:w(),zarrita:w(),python_browser:w()}).passthrough(),ure=I({contract_base:w(),data_base:w(),s3_uri:w(),s3_region:w(),s3_anonymous:re(),zarr:w(),group:w(),level:Jh([Ke("0"),C().int().positive()]),array_path:w(),dtype:w().nullable(),codecs:J(fi()).optional(),chunk_samples:C().int().positive().nullable(),shard_samples:C().int().positive().nullable(),n_channels:C().int().nonnegative().nullable(),sample_slice:sre.optional(),channel_slice:sre.optional(),scale_offset:w(),how_to:Ztt}).passthrough(),nnt=Object.fromEntries(Ga.map((e)=>[e.queryParam,w().optional()])),dre={modality:w().optional(),task:w().optional(),has_hed:re().optional(),has_zarr:re().optional(),author:w().optional(),has_doi:re().optional(),has_zarr_verified:re().optional(),data_complete:re().optional(),recent:C().int().positive().optional(),license:w().optional()},rnt=Object.keys(dre),RQt=[...rnt,...Ga.map((e)=>e.queryParam)],$Qt=I({query:w().optional(),...dre,include_unknown:re().optional(),...nnt,limit:C().int().positive().max(tnt).default(ent)}).passthrough(),ont=I({dataset_id:w().regex(zo),name:w(),doi:w().nullable().optional(),license:w().nullable().optional(),modalities:J(w()).optional(),tasks:J(w()).optional(),subject_count:C().int().nullable().optional(),has_hed:re().nullable().optional(),has_zarr:re()}).passthrough(),DQt=I({results:J(ont),count:C().int().nonnegative(),limit:C().int(),note:w().nullable().optional(),truncated:re().optional()}).passthrough(),CQt=I({dataset_id:w().regex(zo)}).passthrough(),snt=["list_recordings","get_events","render_overview","read_window"],int=I({next_cheapest_tool:Xe(snt),reason:w()}).passthrough(),ant=["pending","ready","failed"],AQt=I({dataset_id:w().regex(zo),name:w(),doi:w().nullable(),license:w().nullable(),citation:w().nullable(),modalities:J(w()).optional(),tasks:J(w()).optional(),subject_count:C().int().nullable().optional(),has_hed:re().nullable().optional(),hed_version:w().nullable().optional(),recording_count:C().int().nullable().optional(),total_recording_duration_s:C().nullable().optional(),zarr_status:Xe(ant).nullable().optional(),zarr_verify_status:lre.optional(),zarr_source_commit:w().nullable().optional(),zarr_store_count:C().int().nullable().optional(),cost_hint:int}).passthrough(),OQt=I({dataset_id:w().regex(zo),modality:w().optional(),min_duration_s:C().nonnegative().optional(),include_derived:re().default(!1),limit:C().int().positive().max(lnt).default(cnt),offset:C().int().nonnegative().default(0)}).passthrough(),unt=I({name:w(),modality:w().nullable().optional(),rate:C().nullable().optional(),n_channels:C().int().nullable().optional(),duration_s:C().nullable().optional(),n_view_levels:C().int().nonnegative().nullable().optional(),n_samples:C().int().nonnegative().nullable().optional(),view_chunk_columns:C().int().positive().nullable().optional()}).passthrough(),dnt=I({path:w(),zarr:w(),source_tree:Ke("raw"),derived:re(),groups:J(unt).optional(),n_events:C().int().nonnegative().optional(),sss:WS.optional(),units_report:VS.optional()}).passthrough().superRefine(KS),TQt=I({dataset_id:w().regex(zo),source_commit:w().regex(GS).nullable(),recordings:J(dnt),total_count:C().int().nonnegative(),excluded_derived_count:C().int().nonnegative(),limit:C().int(),offset:C().int(),index_format_version:C().int(),discovered_count:C().int().nonnegative().nullable(),failure_count:C().int().nonnegative().nullable(),pending_count:C().int().nonnegative().nullable(),excluded_legacy_non_raw_count:C().int().nonnegative(),note:w().nullable().optional(),envelope:cw.optional()}).passthrough(),are=w().min(1).max(64),PQt=I({dataset_id:w().regex(zo),recording:w(),group:w().optional(),limit:C().int().positive().max(pnt).default(fnt),offset:C().int().nonnegative().default(0),where:Yn(are,J(Jh([w(),C()])).min(1).max(mnt)).refine((e)=>{let t=Object.keys(e).length;return t>=1&&t<=ire},{message:`where names 1 to ${ire} columns`}).optional(),columns:J(are).min(1).max(hnt).optional()}).passthrough(),gnt=I({store_path:w(),group_name:w(),onset_s:C(),duration_s:C().nullable().optional(),sample_index:C().int().nonnegative(),trial_type:w().nullable().optional(),value:Jh([w(),C()]).nullable().optional(),hed:w().nullable().optional()}).passthrough(),ynt=gnt.partial().required({onset_s:!0,sample_index:!0}),bnt=I({name:w(),distinct_count:C().int().nonnegative(),null_count:C().int().nonnegative(),values:J(I({value:w(),count:C().int().positive()}).passthrough()).nullable()}).passthrough(),IQt=I({dataset_id:w().regex(zo),recording:w(),events:J(ynt),source:Xe(["events_parquet","events_tsv_fallback"]),estimated:re(),total_count:C().int().nonnegative(),limit:C().int(),offset:C().int(),truncated:re(),note:w().nullable().optional(),columns_summary:J(bnt).optional(),envelope:cw.optional()}).passthrough(),NQt=I({dataset_id:w().regex(zo),recording:w(),group:w().optional(),width_px:C().int().positive().max(_nt).default(wnt)}).passthrough(),FQt=I({dataset_id:w().regex(zo),recording:w(),group:w(),level:C().int().positive(),width_px:C().int().positive(),height_px:C().int().positive(),mime_type:Ke("image/png"),columns_read:C().int().nonnegative(),chunks_read:C().int().nonnegative(),bytes_read:C().int().nonnegative(),envelope:cw.optional()}).passthrough(),cre=rN*oN,MQt=I({dataset_id:w().regex(zo),recording:w(),group:w().optional(),start_s:C().nonnegative().default(0),duration_s:C().positive().max(xnt).default(10),channels:J(C().int().nonnegative()).max(vnt).optional(),taste:re().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>rN)t.addIssue({code:ee.custom,message:`taste duration_s (${e.duration_s}) exceeds the ${rN} s cap; omit taste for a recipe instead`,path:["duration_s"]});if(e.channels.length>oN)t.addIssue({code:ee.custom,message:`taste channels (${e.channels.length}) exceeds the ${oN}-channel cap; omit taste for a recipe instead`,path:["channels"]});let n=e.duration_s*e.channels.length;if(n>cre)t.addIssue({code:ee.custom,message:`taste exceeds the cap of ${cre} channel-seconds (duration_s x channels = ${n}); omit taste for a recipe instead`,path:["duration_s"]})}),Ent=I({mode:Ke("recipe"),recipe:ure,envelope:cw}).passthrough(),Snt=I({mode:Ke("taste"),start_s:C(),duration_s:C(),channels:J(C().int()),sample_rate_hz:C(),values:J(J(C())),recipe:ure,chunks_read:C().int().nonnegative(),bytes_read:C().int().nonnegative(),filled_ranges:J(I({start_sample:C().int().nonnegative(),end_sample:C().int().nonnegative(),start_s:C(),end_s:C()}).passthrough()),note:w().nullable().optional(),envelope:cw}).passthrough(),jQt=jI("mode",[Ent,Snt])});function hre(e){let t=lw.indexOf(e);if(t<0)throw RangeError("not a launcher failure code");return Rnt+t}var dp,id,pre,knt,UQt,lw,mre=0,Rnt=10,$nt,Dnt,Cnt,BQt,HQt,sN,gre,yre,YS,XS,bre;var Tl=H(()=>{dp=/^[a-z0-9_]{1,64}$/,id=["created","uploading","submitted","queued","running","archiving","finished","failed","cancelled","unreported"],pre=["finished","failed","cancelled"],knt=["created","uploading","submitted","queued","running","archiving","unreported"],UQt=knt.filter((e)=>e!=="created"&&e!=="uploading"&&e!=="unreported"),lw=["code_fetch_failed","dataset_fetch_failed","entry_not_found","runtime_error","out_of_memory","time_limit","result_upload_failed"];$nt=["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","tapis_record_lost"],Dnt=["upload_expired"],Cnt=["results_too_large","results_quota_exceeded","too_many_outputs"],BQt={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:[...Cnt,"outputs_unreadable","bad_response","fetch_failed","incomplete_plan","upload_failed","outputs_refused","complete_refused","internal_error"]},HQt=[...lw,...$nt.filter((e)=>!lw.includes(e)),...Dnt],sN={no_compute_access:403,suspended:403,insufficient_balance:409,over_job_limit:422,over_concurrency:409,platform_budget_exhausted:409,client_cap_reached:409,invalid_spec:400,partition_not_offered:422,runtime_unavailable:422,registry_not_allowed:422,compute_disabled:503,dataset_not_eligible:422,recipe_unknown:422,pipelines_account_missing:503,live_attempt_exists:409,bundle_too_large:413,bundle_too_many_files:413,results_too_large:413,results_quota_exceeded:409,too_many_outputs:413,results_expired:410,job_not_found:404,bad_state:409,guard_refused:409,results_incomplete:409,policy_unavailable:503,version_not_found:404,version_untagged:422,too_many_files:422,entry_not_in_bundle:422,bundle_incomplete:409,idempotency_conflict:422,logs_not_available:404,upload_expired:409,storage_unavailable:503},gre={job_not_found:"No such job.",bad_state:"The job is not in a state that accepts this.",results_expired:"The results of this job have expired.",compute_disabled:"Compute storage is not configured.",invalid_spec:"The request is not valid.",too_many_outputs:"The job declared more output files than the owner's limit allows.",results_too_large:"The job's results are over the size limit.",results_quota_exceeded:"There is no room left in the results budget for this job.",results_incomplete:"An object the job declared is missing or short; upload it and ask again.",policy_unavailable:"The platform could not read its limits just now; ask again shortly."},yre=["batch","interactive"],YS=["unreserved","unattributed","mismatch","overrun"],XS=["pending","attempting","sent","failed"],bre=["job","account"]});function fp(e,t=512){return typeof e==="string"&&e.length>=1&&e.length<=t&&xre.test(e)&&!rg.test(e)}function dN(e){if(typeof e!=="string")return null;let t=/^[0-9]/.test(e)?`v${e}`:e;return t.length<=uN&&lN.test(t)?t:null}function vre(e){let t=e.findIndex((n)=>dN(n.version)===null);return t<0?null:`datasets.${t}.version`}function mN(e){return w().max(e).regex(xre).refine((t)=>!rg.test(t),{message:"a path may not hold . or .. segments"})}function gN(e){if(e!==null&&typeof e==="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))gN(t)}return e}function tg(e,t,n){if(typeof t!=="number"||!Number.isSafeInteger(t)||t<n)throw RangeError(`${e} must be a whole number of at least ${n}`);return BigInt(t)}function iN(e,t){return(e+t-1n)/t}function Int(e,t,n){if(!Object.hasOwn(ng,e))throw RangeError("not a partition");let r=ng[e],o=tg("nodes",t.nodes,1),s=tg("cores",t.cores??0,0),i=tg("memory_mb",t.memory_mb??0,0),a=tg("gpus",t.gpus??0,0),c=tg("seconds",n,0),l=Pnt,d=BigInt(l.milliPerSu),f;switch(r.rate){case"core_or_memory":{if(s===0n&&i===0n)throw RangeError("a rate needs cores or memory");let x=s*d,v=iN(i*d,BigInt(l.memoryMbPerCoreUnit));f=x>v?x:v;break}case"whole_cpu_node":f=BigInt(l.cpuNodeCores)*d;break;case"gpu_or_memory":{if(a===0n&&i===0n)throw RangeError("a rate needs GPUs or memory");let x=a*d,v=iN(i*d,BigInt(l.memoryMbPerGpuUnit));f=x>v?x:v;break}case"whole_gpu_node":f=BigInt(l.gpuNodeGpus)*d;break}let p=f*o,m=r.preempt?BigInt(l.preemptNumerator):1n,h=r.preempt?BigInt(l.preemptDenominator):1n,g=iN(p*c*m,3600n*h),y=BigInt(l.minChargeMilli),b=g<y?y:g;if(b>BigInt(fN))throw RangeError("amount too large to hold exactly");return Number(b)}function kre(e){let t=tg("minutes",e.minutes,0);return Int(e.partition,e,Number(t*60n))}function Rre(e){if(typeof e!=="string")return null;let t=Nnt.exec(e);if(!t)return null;let n=BigInt(t[1])*1000n+BigInt((t[2]??"").padEnd(3,"0"));if(n>BigInt(fN))return null;return Number(n)}function fr(e){if(!Number.isSafeInteger(e))throw RangeError("an amount is a whole number of milli-SU");let t=Math.abs(e),n=Math.floor(t/1000),r=t%1000,o=r===0?"":`.${String(r).padStart(3,"0").replace(/0+$/,"")}`;return`${e<0?"-":""}${n}${o}`}function jnt(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 Bnt(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 Hnt(e,t){let n=jnt(e);if(n!==null)t.addIssue({code:ee.custom,message:`an include pattern the dialect refuses: ${n}`})}function eg(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 Wnt(e){let t=0;if(e.entry!==void 0)t+=eg(e.entry)+1;for(let n of e.command??[])t+=eg(n)+1;for(let n of e.args??[])t+=eg(n)+1;for(let n of e.datasets??[])for(let r of n.include??[])t+=eg(r)+1;for(let[n,r]of Object.entries(e.env??{}))if(r!==void 0)t+=eg(n)+eg(r)+2;return t}var cN="\\u0000-\\u001f\\u007f",tk,wre,xre,rg,Ant,Ont,uw=1e5,Qi,Va,nk,pp,rk,lN,uN=64,fN,Pl=(e,t=fN)=>C().int().min(e).max(t),It,pN,ZS,Ere,hN,Sre,dw,Tnt,QS=2880,ng,Pnt,Nnt,og,fw,Fnt,yN,Mnt,bN="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.",wN="An argument vector, run as given, with args appended.",_N="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.",xN="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).",Lnt,qnt,Unt,sg,ek=(e)=>e.refine(Bnt,{message:"a lone surrogate is not text a process argument can carry"}),znt,Gnt,Vnt,Knt=49152,ig,Jnt,Ynt,Xnt,Qnt,$re,aN=1073741824,_re=1048576,WQt,Znt,KQt,Dre,JQt,ert,YQt;var ao=H(()=>{kn();Tl();tk=`[^/\\\\${cN}]+`,wre=tk,xre=new RegExp(`^(?:${wre}/)*${wre}$`),rg=/(?:^|\/)\.\.?(?:\/|$)/,Ant=new RegExp(`^[^\\\\${cN}]+$`),Ont=/^\/|(?:^|\/)\.\.(?:\/|$)/;Qi=/^job_[0-9a-f]{24}$/,Va=/^[0-9a-f]{64}$/,nk=/^sha256:[0-9a-f]{64}$/,pp=/^[a-z]{2}[0-9]{6}$/,rk=/^[0-9A-Za-z][0-9A-Za-z._+-]{0,63}$/,lN=/^(?:latest|v[0-9]+\.[0-9]+\.[0-9]+)$/;fN=Number.MAX_SAFE_INTEGER,It=Pl,pN=w().regex(Qi),ZS=w().regex(Va);Ere=mN,hN=w().max(256).regex(Ant).refine((e)=>!Ont.test(e),{message:"a pattern may not leave the dataset"});Sre=["cpu","gpu"],dw=["shared","compute","debug","large-shared","preempt","gpu-shared","gpu","gpu-debug","gpu-preempt"],Tnt=I({maxNodes:It(1,64),maxCoresPerNode:It(0,256),maxGpusPerNode:It(0,8),maxMinutes:It(1,10080)}).strict(),ng=gN({shared:{pool:"cpu",rate:"core_or_memory",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:64,maxGpusPerNode:0,maxMinutes:QS}},compute:{pool:"cpu",rate:"whole_cpu_node",preempt:!1,ceiling:{maxNodes:2,maxCoresPerNode:128,maxGpusPerNode:0,maxMinutes:QS}},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:QS}},gpu:{pool:"gpu",rate:"whole_gpu_node",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:40,maxGpusPerNode:4,maxMinutes:QS}},"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}}),Pnt={version:1,milliPerSu:1000,cpuNodeCores:128,gpuNodeGpus:4,memoryMbPerCoreUnit:2048,memoryMbPerGpuUnit:94208,preemptNumerator:800,preemptDenominator:1000,minChargeMilli:1000};Nnt=/^([0-9]+)(?:\.([0-9]{1,3}))?$/;og=["result.json","provenance.json","manifest.json","launcher.log"],fw=["OMP_NUM_THREADS","MKL_NUM_THREADS","OPENBLAS_NUM_THREADS","NUMEXPR_NUM_THREADS","PYTHONHASHSEED","MPLBACKEND"],Fnt=/^[ -~]*$/,yN=w().max(256).regex(Fnt),Mnt=Yn(Xe(fw),yN);Lnt=["python","matlab","image"],qnt=/^[A-Za-z0-9][A-Za-z0-9 ._-]{0,79}$/,Unt=/^[a-z][a-z0-9-]{0,63}$/,sg=/^(?:docker:\/\/)?[a-z0-9]+(?:[._-][a-z0-9]+)*(?::[0-9]{1,5})?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)+@sha256:[0-9a-f]{64}$/;znt=I({size:It(1),sha256:ZS}).strict(),Gnt=I({id:w().regex(pp),version:w().regex(rk),include:J(ek(hN).superRefine(Hnt)).max(64).optional().describe(xN)}).strict(),Vnt=ek(w().max(1024));ig=I({name:w().regex(qnt),runtime:Xe(Lnt),entry:ek(Ere(240)).optional().describe(bN),command:J(ek(w().min(1).max(1024))).min(1).max(64).optional().describe(wN),args:J(Vnt).max(64).default([]).describe(_N),bundle:znt.optional(),datasets:J(Gnt).max(20).default([]),partition:Xe(dw),nodes:It(1,64).default(1),cores:It(1,256).default(1),memory_mb:It(1,16777216).optional(),gpus:It(0,8).default(0),minutes:It(1,10080),output_dir:Ke("outputs").default("outputs"),env:Mnt.default({}),recipe:w().regex(Unt).optional(),image:w().max(512).regex(sg).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(Wnt(e)>Knt)t.addIssue({code:ee.custom,path:[],message:"the entry, command, arguments, patterns and environment are too large to launch"});let r=ng[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")}),Jnt=/^[A-Za-z0-9_.-]{1,64}$/,Ynt=/^[a-z0-9]+(?:[.-][a-z0-9]+)*(?::[0-9]{1,5})?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)*$/,Xnt=Object.fromEntries(dw.map((e)=>[e,Tnt.optional()])),Qnt=I({maxOpenReservations:It(0,1e5),maxReservedMilliPerDay:It(0)}).strict(),$re=I({defaultGrantMilli:I({cpu:It(0),gpu:It(0)}).strict(),renewal:I({enabled:re(),everyDays:It(1,366).nullable()}).strict().refine((e)=>!e.enabled||e.everyDays!==null,{message:"renewal that is on says how often",path:["everyDays"]}),ceilings:I(Xnt).strict(),maxLiveJobsPerPerson:It(0,1000),pipelines:I({dailyJobCap:It(0,1e5),maxLiveJobs:I({cpu:It(0,1000),gpu:It(0,1000)}).strict()}).strict(),clients:Yn(w().regex(Jnt),Qnt),reservationWaitMinutes:It(1,1440),retention:I({recordsYears:It(1,30),logsDays:It(1,3650),resultsDays:It(14,365)}).strict(),resultLimits:I({maxJobBytes:It(1),maxFiles:It(1,uw),maxStoredBytesPerPerson:It(1),maxStoredBytesTotal:It(1)}).strict(),settle:I({toleranceMilli:It(0),tolerancePercent:It(0,100)}).strict(),registries:J(w().max(255).regex(Ynt)).max(64),bundleLimits:I({maxTotalBytes:It(1),maxFiles:It(1,1e5),maxFileBytes:It(1)}).strict(),partner:I({tapisVisibilityConfirmed:re(),execSystemId:w().regex(/^[A-Za-z0-9._-]{1,80}$/).optional(),allowedSchedulerArgs:J(w().regex(/^[-A-Za-z0-9=_.:,@/]{1,100}$/).refine((e)=>!e.startsWith("--gpus")&&!e.startsWith("--gres"),{message:"GPUs are bounded by the hold, never allowed by name"})).max(20).optional()}).strict().refine((e)=>!e.tapisVisibilityConfirmed||e.execSystemId!==void 0,{message:"a confirmed partner names the execution system",path:["execSystemId"]}).optional()}).strict(),WQt=gN({defaultGrantMilli:{cpu:0,gpu:0},renewal:{enabled:!1,everyDays:null},ceilings:Object.fromEntries(dw.flatMap((e)=>{let t=ng[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*aN,maxFiles:5000,maxStoredBytesPerPerson:50*aN,maxStoredBytesTotal:1024*aN},settle:{toleranceMilli:1000,tolerancePercent:5},registries:[],bundleLimits:{maxTotalBytes:100*_re,maxFiles:2000,maxFileBytes:25*_re}}),Znt=I({path:Ere(512),size:It(0),sha256:ZS}).strict(),KQt=I({job_id:pN,files:J(Znt).max(uw)}).strict(),Dre=C().int().min(-255).max(255).nullable(),JQt=I({job_id:pN,failure_code:Xe(lw).nullable(),detail:w().regex(dp).nullable(),exit_number:C().int(),entry_exit_code:Dre}).strict().superRefine((e,t)=>{let n=e.failure_code===null?mre:hre(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"})}),ert=I({id:w().regex(pp),version:w().regex(rk),mode:Xe(["bind","download"]),files:It(0),bytes:It(0)}).strict(),YQt=I({job_id:pN,launch_spec_digest:ZS,bundle_digest:ZS.nullable(),image:I({uri:w().regex(/^[^\s]{1,512}$/),digest:w().regex(nk)}).strict(),runtime_version:w().regex(new RegExp(`^[^${cN}]{1,128}$`)),staging:J(ert).max(20),timings:Yn(w().regex(dp),C().finite().min(0)).refine((e)=>Object.keys(e).length<=16,{message:"at most 16 phases"}),slurm_job_id:w().regex(/^[0-9A-Za-z_+.-]{1,64}$/).nullable(),entry_exit_code:Dre}).strict()});var Cre,QQt;var Are=H(()=>{Cre=["dispatched","succeeded","failed","refused"],QQt=Object.freeze([Object.freeze({name:"nemar-floor",version:"1.0.0",appId:"nemar-launch",appVersion:"1.0.0",engine:"eegprep@0.5.0",partition:"shared",nodes:1,cores:4,memoryMb:16384,gpus:0,minutes:360,autoDispatch:!0,eligibility:"eeg"}),Object.freeze({name:"nemar-ica",version:"1.0.0",appId:"nemar-launch",appVersion:"1.0.0",engine:"eegprep@0.5.0",partition:"gpu-shared",nodes:1,cores:10,gpus:1,minutes:720,autoDispatch:!1,placeholder:!0,eligibility:"eeg"})])});function Tre(e){return vN.includes(e)}var trt="pipelines",nrt="people",vN,ok,pw=200,Zi,EN,rrt,Pre,Ire,Nre,SN,Fre,pi,kN,RN,$N=100,Mre=10,sk,DN=200,ort,rZt,srt,jre,irt,Lre,ik=8,ak=200,qre,Ure,Ore,Bre,Hre,zre,Gre,Vre,Wre,CN,Kre,Jre,Yre,Xre;var ag=H(()=>{kn();Are();Tl();vN=[trt,nrt];ok=["granted","charged"],Zi=C().int(),EN=I({id:C().int(),holder_kind:w(),holder_ref:w(),pool:w(),granted_milli:Zi,held_milli:Zi,charged_milli:Zi,available_milli:Zi,frozen:re(),created_at:w(),updated_at:w()}).passthrough(),rrt=I({id:C().int(),kind:w(),pool_id:C().int(),budget_pool_id:C().int().nullable(),granted_delta_milli:Zi,held_delta_milli:Zi,charged_delta_milli:Zi,job_id:w().nullable(),hold_ref:C().int().nullable(),reason:w().nullable(),actor_user_id:C().int().nullable(),created_at:w()}).passthrough(),Pre=I({pools:J(EN),next_after:C().int().nullable()}).passthrough(),Ire=I({account_id:C().int(),pools:J(EN)}).passthrough(),Nre=I({pool:EN,entry:rrt,replayed:re()}).passthrough(),SN=I({version:C().int().nullable(),is_default:re(),policy:I({}).passthrough(),set_by:C().int().nullable(),note:w().nullable(),created_at:w().nullable()}).passthrough(),Fre=I({switches:I({environment:w(),compute_enabled:re(),pipelines_dispatch_enabled:re()}).passthrough(),tapis:I({configured:re(),strategy:w().nullable(),problems:J(w()),token:w(),health:w()}).passthrough(),storage:I({records_binding:re(),results_binding:re(),signing_configured:re()}).passthrough(),access:I({key_configured:re(),resource_name_configured:re().optional()}).passthrough(),runtime_image:I({set:re(),valid:re(),digest:w().nullable()}).passthrough().optional(),prerequisites:I({callback_secret:re(),api_base_url:re(),pipelines_account:re(),policy_set:re(),people_pool_granted:re(),pipelines_pool_granted:re()}).passthrough().optional(),reconciliation:I({paused:re()}).passthrough().optional(),attention:Yn(fi()).optional()}).passthrough(),pi=w().nullable(),kN=I({id:w(),account_id:C().int().nullable(),source:w(),kind:w(),state:w(),tapis_status:pi,failure_code:pi,failure_detail:pi,platform_failure:re(),cancel_requested:re(),cancel_reason:pi,partition:w(),pool:w(),held_milli:Zi,charged_milli:Zi,settled:re(),flags:J(w()),created_at:w(),submitted_at:pi,started_at:pi,ended_at:pi,tapis_synced_at:pi,outputs_completed:re(),results_verified:re(),results_bytes:C().int().nullable(),records_copied:re(),partner_state:pi.optional(),partner_flag:pi.optional()}).passthrough(),RN=I({ok:re(),outcome:w(),submit:w().optional(),job:kN.nullable()}).passthrough(),sk=Cre,ort={recipe_not_automatic:422,recipe_placeholder:422,registry_drift:409,create_failed:502,run_failed:500},rZt={...sN,...ort},srt=I({dataset_id:w(),ok:re(),version:w().optional(),job_id:w().optional(),stamp_id:C().int().optional(),attempt:C().int().optional(),submit:w().optional(),code:w().optional(),blocked_by:J(w()).optional()}).passthrough(),jre=I({ok:re(),dry_run:re(),recipe:w(),results:J(srt).optional(),dispatched:C().int().optional(),stopped_by:w().nullable().optional(),audit_pending:re().optional(),estimate_milli_per_job:Zi.optional(),estimate_milli_total:Zi.optional(),config:I({compute_enabled:re(),runtime_image:re(),pipelines_account:re()}).passthrough().optional(),would_dispatch:J(I({dataset_id:w(),version:w()}).passthrough()).optional(),blocked:I({code:w(),blocked_by:J(w()),version:w().optional()}).passthrough().optional(),blocked_by_term:Yn(fi()).optional()}).passthrough(),irt=I({id:C().int(),dataset_id:w(),version:w(),recipe:w(),recipe_version:w(),engine:w(),attempt:C().int(),state:w(),job_id:pi,refusal_code:pi,created_at:w(),updated_at:w()}).passthrough(),Lre=I({stamps:J(irt),next_before:C().int().nullable()}).passthrough(),qre=I({jobs:J(kN),next_after:C().int().nullable()}).passthrough(),Ure=I({rows:J(I({slurm_job_id:w(),partition:w(),state:w(),elapsed_seconds:C().int(),alloc_nodes:C().int(),alloc_cpus:C().int(),alloc_gpus:C().int(),charged_milli:C().int().nullable(),ingested_at:w()}).passthrough()),total:C().int()}).passthrough(),Ore=["ok","missing","unreadable"],Bre=I({job:kN,identifiers:I({}).passthrough(),ledger:J(I({}).passthrough()),provenance:I({}).passthrough().nullable(),provenance_status:Xe(Ore).optional(),manifest:I({files:C().int(),bytes:C().int()}).passthrough().nullable(),manifest_status:Xe(Ore).optional(),legal_hold:re(),retention_until:w().nullable().optional(),launcher_files:J(w()).optional()}).passthrough(),Hre=I({job_id:w(),name:w(),kind:w(),content:fi().optional(),url:w().optional(),expires_at:w().optional()}).passthrough(),zre=I({account_id:C().int(),from:w(),to:w(),totals:I({jobs:C().int(),charged_milli:C().int(),unsettled:C().int().optional(),open_hold_milli:C().int().optional()}).passthrough(),by_pool:Yn(I({}).passthrough()),jobs:J(I({}).passthrough()),truncated:re()}).passthrough(),Gre=I({quarter:w(),rows:J(I({partition:w(),source:w(),distinct_users:C().int(),jobs:C().int()}).passthrough()),totals:I({distinct_users:C().int(),jobs:C().int()}).passthrough()}).passthrough(),Vre=I({id:C().int(),scope:w(),ref:w(),reason:w(),placed_by:C().int(),placed_at:w(),released_at:w().nullable()}).passthrough(),Wre=I({holds:J(Vre),truncated:re().optional()}).passthrough(),CN=I({hold:Vre}).passthrough(),Kre=I({rows:J(I({job_id:w(),state:w(),attempts:C().int(),last_error_code:w().nullable(),next_attempt_at:w(),sent_at:w().nullable(),created_at:w()}).passthrough()),failed_by_word:Yn(fi()),next_after:w().nullable()}).passthrough(),Jre=I({ok:re(),job_id:w(),previous:w().nullable()}).passthrough(),Yre=I({run_id:w(),token:w(),expires_in_minutes:C().int()}).passthrough(),Xre=I({job_id:w(),to_account_id:C().int(),pool:w(),moved_milli:C().int(),replayed:re(),attributed_account_id:C().int().nullable().optional(),owner_proven:re().optional()}).passthrough()});function Qre(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32&&n!==9&&n!==10||n===127)return!0}return!1}var ck=20,mw=1000,iZt,art,Zre,eoe,hw=500,lk=200,toe,noe,crt,roe;var mp=H(()=>{kn();iZt=I({purpose:w().max(mw*4).optional().default(""),accept_terms_version:w().max(64).optional().default("")}),art=Xe(["purpose_required","terms_not_accepted","email_not_verified","orcid_not_proven","profile_incomplete","access_closed","already_active","terms_unpublished"]),Zre=art.options,eoe=I({ok:Ke(!0),already_requested:re(),requested_at:w().nullable().optional(),email_sent:re().optional(),admins_notified:C().int().nullable().optional()}).passthrough(),toe=I({id:C().int(),username:w().nullable(),email:w(),given_name:w().nullable().optional(),family_name:w().nullable().optional(),affiliation:w().nullable().optional(),city:w().nullable().optional(),country:w().nullable().optional(),orcid:w().nullable().optional(),account_kind:w().optional(),compute_access:w(),compute_access_requested_at:w().nullable().optional(),compute_access_notified_at:w().nullable().optional(),compute_access_granted_at:w().nullable().optional(),compute_access_granted_by:C().int().nullable().optional(),compute_purpose:w().nullable().optional(),compute_terms_version:w().nullable().optional(),compute_terms_accepted_at:w().nullable().optional()}).passthrough(),noe=I({accounts:J(toe),next_after:C().int().nullable().optional()}).passthrough(),crt=I({granted:re(),cpu_milli:C().int(),gpu_milli:C().int(),reason:w().nullable().optional(),policy_version:C().int().nullable().optional()}).passthrough(),roe=I({decision:w(),from:w(),to:w(),account:toe,allocation:crt.optional(),email_sent:re().optional()}).passthrough()});var cg="2026-11-draft";var AN=()=>{};var gw=100,ON=25,lrt,uZt,Wa,pr,ooe,urt,drt,soe,frt,prt,ioe,aoe,coe,dZt;var uk=H(()=>{kn();lrt={forbidden_credential:403,insufficient_scope:403,invalid_token:401,missing_credential:401,invalid_range:400,invalid_group:400,invalid_state:400,invalid_limit:400,invalid_cursor:400,job_not_found:404,policy_unavailable:503},uZt=Object.keys(lrt),Wa=w().nullable(),pr=C().int().nonnegative(),ooe=I({granted_milli:pr,held_milli:pr,charged_milli:pr,available_milli:C().int()}).passthrough(),urt=I({name:w(),pool:w(),max_nodes:pr,max_cores_per_node:pr,max_gpus_per_node:pr,max_minutes:pr}).passthrough(),drt=I({partition:w(),median_seconds:C().int().nonnegative().nullable(),p90_seconds:C().int().nonnegative().nullable(),count:pr,window_days:pr}).passthrough(),soe=I({access:I({state:w(),requested_at:Wa,granted_at:Wa,terms_version:Wa,current_terms_version:w(),terms_published:re(),requests_open:re().optional()}).passthrough(),pools:I({cpu:ooe,gpu:ooe}).passthrough(),frozen:re(),limits:I({partitions:J(urt),max_live_jobs:pr,results_days:pr}).passthrough(),queue:J(drt)}).passthrough(),frt=I({day:w().optional(),app:Wa.optional(),partition:Wa.optional(),source:Wa.optional(),charged_milli:C().int(),jobs:pr}).passthrough(),prt=I({from:w(),to:w(),group:J(w()),rows:J(frt)}).passthrough(),ioe=I({id:w(),kind:w(),source:w(),state:w(),app_id:w(),app_version:w(),partition:w(),pool:w(),resources:I({nodes:pr,cores_per_node:pr,memory_mb:C().int().nonnegative().nullable(),gpus:pr,minutes:pr}).passthrough(),created_at:w(),started_at:Wa,ended_at:Wa,charged_milli:C().int().nonnegative(),failure_code:Wa,cancel_requested:re()}).passthrough(),aoe=I({jobs:J(ioe),next_after:Wa}).passthrough(),coe=I({job:ioe,stale:re().optional()}).passthrough(),dZt=I({from:w(),to:w(),by_day_partition_source:J(I({day:w(),partition:w(),source:w(),charged_milli:C().int(),jobs:pr}).passthrough()),active_people:pr,jobs_by_outcome:I({finished:pr,failed:pr,cancelled:pr}).passthrough()}).passthrough()});function TN(e,t=lg,n){if(!Array.isArray(e)||e.length===0)return{ok:!1,code:"invalid_spec",field:"files"};if(e.length>t.maxFiles)return{ok:!1,code:"bundle_too_many_files"};let r=new Set,o=0;for(let s=0;s<e.length;s++){let i=e[s];if(typeof i!=="object"||i===null||Array.isArray(i))return{ok:!1,code:"invalid_spec",field:`files.${s}`};let a=i;if(Object.keys(a).some((c)=>c!=="path"&&c!=="size"&&c!=="sha256"))return{ok:!1,code:"invalid_spec",field:`files.${s}`};if(typeof a.path!=="string"||!fp(a.path,yw))return{ok:!1,code:"invalid_spec",field:`files.${s}.path`};if(r.has(a.path))return{ok:!1,code:"invalid_spec",field:`files.${s}.path`};if(r.add(a.path),typeof a.size!=="number"||!Number.isSafeInteger(a.size)||a.size<0)return{ok:!1,code:"invalid_spec",field:`files.${s}.size`};if(typeof a.sha256!=="string"||!Va.test(a.sha256))return{ok:!1,code:"invalid_spec",field:`files.${s}.sha256`};if(a.size>t.maxFileBytes)return{ok:!1,code:"bundle_too_large"};if(o+=a.size,o>t.maxTotalBytes)return{ok:!1,code:"bundle_too_large"}}if(n!==void 0&&!r.has(n))return{ok:!1,code:"entry_not_in_bundle"};return{ok:!0}}var loe=1048576,mrt,uoe=2000,hrt,yw=240,mZt,lg;var dk=H(()=>{ao();mrt=100*loe,hrt=25*loe,mZt=uoe*1200+65536,lg=Object.freeze({maxTotalBytes:mrt,maxFiles:uoe,maxFileBytes:hrt})});var doe="Idempotency-Key",foe="X-Nemar-Truncated",grt,poe,moe,yrt,PN,bZt,IN;var fk=H(()=>{kn();Tl();grt=I({url:w(),method:Ke("PUT"),headers:Yn(w()),expires_at:w(),size:C().int().nonnegative()}).passthrough(),poe=I({job_id:w(),state:w(),tag:w(),name:w(),upload:grt.optional(),replayed:Ke(!0).optional()}).passthrough(),moe=I({job_id:w(),state:w(),name:w().optional(),submitted:re(),replayed:re()}).passthrough(),yrt=I({path:w(),size:C().int().nonnegative(),sha256:w(),url:w()}).passthrough(),PN=I({expires_at:w(),files:J(yrt),total:C().int().nonnegative(),truncated:re(),next_after:w().nullable(),bearer_links:Ke(!0),notice:w()}).passthrough(),bZt=I({error:w(),code:w(),field:w().optional(),job_id:w().optional(),note:w().optional()}).passthrough(),IN={...gre,no_compute_access:"Your account does not have compute access.",suspended:"Compute is paused for your account.",insufficient_balance:"Your compute balance is used up. Contact an administrator to ask for more; a way to add more yourself is planned.",over_job_limit:"The job asks for more than one job may have on that partition.",over_concurrency:"You already have as many jobs running or waiting as you may.",platform_budget_exhausted:"The shared compute budget has no room for this job right now.",partition_not_offered:"That partition is not offered to people.",runtime_unavailable:"That runtime is not available.",registry_not_allowed:"The container image is not from a registry that is allowed.",dataset_not_eligible:"A dataset the job names is not available to compute.",version_not_found:"A dataset version the job names does not exist.",version_untagged:"A dataset version the job names cannot be read by a job.",too_many_files:"A dataset the job names has too many files for a job to read.",bundle_too_large:"The code bundle is over the size limit.",bundle_too_many_files:"The code bundle holds more files than the limit allows.",entry_not_in_bundle:"The job's entry is not one of the files in the bundle.",bundle_incomplete:"The bundle has not been uploaded in full; upload it to the address and ask again.",idempotency_conflict:"That Idempotency-Key was already used for a different request.",logs_not_available:"The job has no log yet.",upload_expired:"The upload window closed and the job was ended; submit it again.",storage_unavailable:"Compute storage could not be reached just now; ask again shortly."}});var brt,wrt,hoe;var NN=H(()=>{kn();dk();ao();brt=I({path:w().min(1).max(yw),size:C().int().min(0).max(Number.MAX_SAFE_INTEGER),sha256:w().regex(Va)}).strict(),wrt=I({files:J(brt).min(1)}).strict(),hoe=I({spec:ig,manifest:wrt.optional()}).strict()});var kZt,_rt,xrt,RZt,$Zt,DZt;var goe=H(()=>{kn();kZt=I({job_id:w(),hold_id:w(),tag:w(),expires_at:w(),state:w().optional(),replayed:Ke(!0).optional()}).passthrough(),_rt=I({path:w(),url:w(),method:Ke("PUT"),headers:Yn(w())}).passthrough(),xrt=I({state:Xe(["awaiting_upload","recorded"]),uploads:J(_rt).optional(),expires_at:w().optional()}).passthrough(),RZt=I({job_id:w(),verification:Xe(["verified","pending"]),state:w(),files:xrt.optional(),replayed:Ke(!0).optional()}).passthrough(),$Zt=I({job_id:w(),hold_id:w(),released:Ke(!0),state:w(),replayed:Ke(!0).optional()}).passthrough(),DZt=I({error:w(),code:w(),field:w().optional(),mismatch:w().optional(),job_id:w().optional()}).passthrough()});var PZt,yoe=500,vrt=512,Ert,Srt,IZt,NZt;var boe=H(()=>{kn();Tl();ao();PZt=I({app_id:w().regex(/^[A-Za-z0-9._-]{1,80}$/),app_version:w().regex(/^[A-Za-z0-9._+-]{1,64}$/),kind:Xe(yre),partition:Xe(dw),nodes:Pl(1,64),cores:Pl(0,256),memory_mb:Pl(1,16777216).nullish(),gpus:Pl(0,8),minutes:Pl(1,10080)}).strict().superRefine((e,t)=>{let n=ng[e.partition].pool==="gpu";if(n&&e.gpus<1)t.addIssue({code:ee.custom,path:["gpus"],message:"a GPU partition needs a GPU"});if(!n&&e.gpus!==0)t.addIssue({code:ee.custom,path:["gpus"],message:"a CPU partition takes no GPU"})}),Ert=I({path:w().min(1).max(vrt),size:C().int().min(0).max(Number.MAX_SAFE_INTEGER),sha256:w().regex(Va)}).strict(),Srt=/^[A-Za-z0-9][A-Za-z0-9-]{0,63}$/,IZt=I({tapis_job_id:w().regex(Srt),files:J(Ert).min(1).max(yoe).optional()}).strict(),NZt=yoe*2400+4096});var ug=H(()=>{WI();Yh();JI();iw();YI();US();Ol();up();nN();fre();ao();ag();mp();AN();uk();dk();fk();NN();goe();boe()});function qr(e){return typeof e==="string"&&$rt.test(e)&&!e.includes("..")}function Il(e){return/^v\d/.test(e)?e.slice(1):e}function Ur(e,t){return Il(e)===Il(t)}var $rt;var ea=H(()=>{$rt=/^[0-9A-Za-z][0-9A-Za-z._-]{0,63}$/});function W(e){if(e instanceof Error)return e.message;return String(e)}function fg(e){if(!(e instanceof j)||e.statusCode!==404)return!1;let t=e.rawBody;return typeof t==="object"&&t!==null&&t.error==="Not Found"&&typeof t.message==="string"}var j,Ka;var je=H(()=>{j=class j extends Error{statusCode;details;step;blockReason;missing;code;reason;rawBody;retryAfterSeconds;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"}};Ka=class Ka extends j{mode;eta;constructor(e,t,n,r){super(503,t,r);this.mode=e;this.eta=n;this.name="MaintenanceError"}}});var Drt,Crt,Art,uen,xoe="override_publication_review",voe="publication_review_not_clear",jN=2000;var mk=H(()=>{Drt=["dispatched","redispatched","dispatch_claimed"],Crt=["review_disabled","not_applicable","not_owned_here","request_not_requested","screen_not_ready","running","has_result","platform_limit"],Art=["dispatch_failed","dispatch_unconfigured"],uen=[...Drt,...Crt,...Art]});var hk=1e4;function gk(e){return e?Trt:Ja}var Ja,pen,Ort,Trt,LN;var yk=H(()=>{Ja=["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"],pen=Ja.slice(0,Ja.indexOf("s3_public_read")),Ort=["update_metadata","update_readme","upload_to_zenodo","publish_doi"],Trt=Ja.filter((e)=>!Ort.includes(e));LN={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 Prt(e){return`%${e.replace(/[\\%_]/g,"\\$&")}%`}function Irt(e){return new TextEncoder().encode(Prt(e)).length}function Eoe(e){if(Irt(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 bk(e){return e.replace(/[A-Z]/g,(t)=>t.toLowerCase())}function Soe(e,t){if(e==="")return!0;let n=bk(e);return t.some((r)=>typeof r==="string"&&bk(r).includes(n))}function koe(e,t){return bk(e)===bk(t)}function wk(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(qN.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(qN.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"&&!Nrt.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(qN.has(n))return[];t.push(n);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function UN(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 Roe(e,t){if(UN(e,t))throw Error("Cannot use string index")}function $oe(e,t,n){if(!hp(e)||typeof t!=="string")return n===void 0?e:n;let r=wk(t);if(r.length===0)return n;for(let o=0;o<r.length;o++){let s=r[o];if(UN(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 BN(e,t,n){if(!hp(e)||typeof t!=="string")return e;let r=e,o=wk(t);for(let s=0;s<o.length;s++){let i=o[s];if(Roe(e,i),s===o.length-1)e[i]=n;else if(!hp(e[i]))e[i]=typeof o[s+1]==="number"?[]:{};e=e[i]}return r}function Doe(e,t){if(!hp(e)||typeof t!=="string")return!1;let n=wk(t);for(let r=0;r<n.length;r++){let o=n[r];if(Roe(e,o),r===n.length-1)return delete e[o],!0;if(e=e[o],!hp(e))return!1}}function Coe(e,t){if(!hp(e)||typeof t!=="string")return!1;let n=wk(t);if(n.length===0)return!1;for(let r of n){if(!hp(e)||!(r in e)||UN(e,r))return!1;e=e[r]}return!0}var hp=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},qN,Nrt;var Aoe=H(()=>{qN=new Set(["__proto__","prototype","constructor"]),Nrt=new Set("0123456789")});import Un from"path";import Ooe from"os";import HN from"process";function GN(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(HN.platform==="darwin")return Frt(e);if(HN.platform==="win32")return Mrt(e);return jrt(e)}var cd,zN,pg,Frt=(e)=>{let t=Un.join(cd,"Library");return{data:Un.join(t,"Application Support",e),config:Un.join(t,"Preferences",e),cache:Un.join(t,"Caches",e),log:Un.join(t,"Logs",e),temp:Un.join(zN,e)}},Mrt=(e)=>{let t=pg.APPDATA||Un.join(cd,"AppData","Roaming"),n=pg.LOCALAPPDATA||Un.join(cd,"AppData","Local");return{data:Un.join(n,e,"Data"),config:Un.join(t,e,"Config"),cache:Un.join(n,e,"Cache"),log:Un.join(n,e,"Log"),temp:Un.join(zN,e)}},jrt=(e)=>{let t=Un.basename(cd);return{data:Un.join(pg.XDG_DATA_HOME||Un.join(cd,".local","share"),e),config:Un.join(pg.XDG_CONFIG_HOME||Un.join(cd,".config"),e),cache:Un.join(pg.XDG_CACHE_HOME||Un.join(cd,".cache"),e),log:Un.join(pg.XDG_STATE_HOME||Un.join(cd,".local","state"),e),temp:Un.join(zN,t,e)}};var Toe=H(()=>{cd=Ooe.homedir(),zN=Ooe.tmpdir(),{env:pg}=HN});var Lrt=(e,t)=>{let{onError:n}=t;return function(...o){return e.apply(void 0,o).catch(n)}},Ya;var Poe=H(()=>{Ya=Lrt});var qrt=(e,t)=>{let{onError:n}=t;return function(...o){try{return e.apply(void 0,o)}catch(s){return n(s)}}},ta;var Ioe=H(()=>{ta=qrt});var Noe=250;var Foe=()=>{};var Urt=(e,t)=>{let{isRetriable:n}=t;return function(o){let{timeout:s}=o,i=o.interval??Noe,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)})}}},Xa;var Moe=H(()=>{Foe();Xa=Urt});var Brt=(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}}}},Qa;var joe=H(()=>{Qa=Brt});var VN=H(()=>{Poe();Ioe();Moe();joe()});var bw,WN;var Loe=H(()=>{KN();bw={isChangeErrorOk:(e)=>{if(!bw.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!qoe&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!bw.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(!bw.isNodeError(e))throw e;if(bw.isChangeErrorOk(e))return;throw e}},WN=bw});import Uoe from"process";var ww,hs,qoe,co;var KN=H(()=>{Loe();ww={onError:WN.onChangeError},hs={onError:()=>{return}},qoe=Uoe.getuid?!Uoe.getuid():!1,co={isRetriable:WN.isRetriableError}});import Ut from"fs";import{promisify as $o}from"util";var Hrt,Br;var JN=H(()=>{VN();VN();KN();Hrt={attempt:{chmod:Ya($o(Ut.chmod),ww),chown:Ya($o(Ut.chown),ww),close:Ya($o(Ut.close),hs),fsync:Ya($o(Ut.fsync),hs),mkdir:Ya($o(Ut.mkdir),hs),realpath:Ya($o(Ut.realpath),hs),stat:Ya($o(Ut.stat),hs),unlink:Ya($o(Ut.unlink),hs),chmodSync:ta(Ut.chmodSync,ww),chownSync:ta(Ut.chownSync,ww),closeSync:ta(Ut.closeSync,hs),existsSync:ta(Ut.existsSync,hs),fsyncSync:ta(Ut.fsync,hs),mkdirSync:ta(Ut.mkdirSync,hs),realpathSync:ta(Ut.realpathSync,hs),statSync:ta(Ut.statSync,hs),unlinkSync:ta(Ut.unlinkSync,hs)},retry:{close:Xa($o(Ut.close),co),fsync:Xa($o(Ut.fsync),co),open:Xa($o(Ut.open),co),readFile:Xa($o(Ut.readFile),co),rename:Xa($o(Ut.rename),co),stat:Xa($o(Ut.stat),co),write:Xa($o(Ut.write),co),writeFile:Xa($o(Ut.writeFile),co),closeSync:Qa(Ut.closeSync,co),fsyncSync:Qa(Ut.fsyncSync,co),openSync:Qa(Ut.openSync,co),readFileSync:Qa(Ut.readFileSync,co),renameSync:Qa(Ut.renameSync,co),statSync:Qa(Ut.statSync,co),writeSync:Qa(Ut.writeSync,co),writeFileSync:Qa(Ut.writeFileSync,co)}},Br=Hrt});import gp from"process";var Boe="utf8",YN=438,Hoe=511,zoe,Goe,Voe,Woe=1000,Koe,zen,XN=128;var QN=H(()=>{zoe={},Goe=gp.geteuid?gp.geteuid():-1,Voe=gp.getegid?gp.getegid():-1,Koe=!!gp.getuid,zen=gp.getuid?!gp.getuid():!1});var Joe=(e)=>e instanceof Error&&("code"in e),ZN=(e)=>typeof e==="string",_k=(e)=>e===void 0;var Yoe=()=>{};var Xoe=()=>{};import Qoe from"process";var Zoe,xk;var eF=H(()=>{Zoe=Qoe.platform==="linux",xk=Qoe.platform==="win32"});var tF,ese;var tse=H(()=>{eF();tF=["SIGHUP","SIGINT","SIGTERM"];if(!xk)tF.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(Zoe)tF.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");ese=tF});import mg from"process";class nse{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(xk&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))mg.kill(mg.pid,"SIGTERM");else mg.kill(mg.pid,e)},this.hook=()=>{mg.once("exit",()=>this.exit());for(let e of ese)try{mg.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var rse;var ose=H(()=>{eF();tse();rse=new nse});var zrt,sse;var ise=H(()=>{ose();zrt=rse.register,sse=zrt});import Grt from"path";var Ls,_w;var ase=H(()=>{JN();ise();QN();Ls={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=Ls.truncate(t(e));if(r in Ls.store)return Ls.get(e,t,n);return Ls.store[r]=n,[r,()=>delete Ls.store[r]]},purge:(e)=>{if(!Ls.store[e])return;delete Ls.store[e],Br.attempt.unlink(e)},purgeSync:(e)=>{if(!Ls.store[e])return;delete Ls.store[e],Br.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in Ls.store)Ls.purgeSync(e)},truncate:(e)=>{let t=Grt.basename(e);if(t.length<=XN)return e;let n=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!n)return e;let r=t.length-XN;return`${e.slice(0,-t.length)}${n[1]}${n[2].slice(0,-r)}${n[3]}`}};sse(Ls.purgeSyncAll);_w=Ls});import Vrt from"path";function nF(e,t,n=zoe){if(ZN(n))return nF(e,t,{encoding:n});let o={timeout:n.timeout??Woe},s=null,i=null,a=null;try{let c=Br.attempt.realpathSync(e),l=!!c;e=c||e,[i,s]=_w.get(e,n.tmpCreate||_w.create,n.tmpPurge!==!1);let d=Koe&&_k(n.chown),f=_k(n.mode);if(l&&(d||f)){let p=Br.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=Vrt.dirname(e);Br.attempt.mkdirSync(p,{mode:Hoe,recursive:!0})}if(a=Br.retry.openSync(o)(i,"w",n.mode||YN),n.tmpCreated)n.tmpCreated(i);if(ZN(t))Br.retry.writeSync(o)(a,t,0,n.encoding||Boe);else if(!_k(t))Br.retry.writeSync(o)(a,t,0,t.length,0);if(n.fsync!==!1)if(n.fsyncWait!==!1)Br.retry.fsyncSync(o)(a);else Br.attempt.fsync(a);if(Br.retry.closeSync(o)(a),a=null,n.chown&&(n.chown.uid!==Goe||n.chown.gid!==Voe))Br.attempt.chownSync(i,n.chown.uid,n.chown.gid);if(n.mode&&n.mode!==YN)Br.attempt.chmodSync(i,n.mode);try{Br.retry.renameSync(o)(i,e)}catch(p){if(!Joe(p))throw p;if(p.code!=="ENAMETOOLONG")throw p;Br.retry.renameSync(o)(i,_w.truncate(e))}s(),i=null}finally{if(a)Br.attempt.closeSync(a);if(i)_w.purge(i)}}var cse=H(()=>{JN();QN();Yoe();Xoe();ase()});var vw=_(function(dse){Object.defineProperty(dse,"__esModule",{value:!0});dse.regexpCode=dse.getEsmExportName=dse.getProperty=dse.safeStringify=dse.stringify=dse.strConcat=dse.addCodeArg=dse.str=dse._=dse.nil=dse._Code=dse.Name=dse.IDENTIFIER=dse._CodeOrName=void 0;class vk{}dse._CodeOrName=vk;dse.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class hg extends vk{constructor(e){super();if(!dse.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}}}dse.Name=hg;class na extends vk{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 hg)t[n.str]=(t[n.str]||0)+1;return t},{})}}dse._Code=na;dse.nil=new na("");function lse(e,...t){let n=[e[0]],r=0;while(r<t.length)oF(n,t[r]),n.push(e[++r]);return new na(n)}dse._=lse;var rF=new na("+");function use(e,...t){let n=[xw(e[0])],r=0;while(r<t.length)n.push(rF),oF(n,t[r]),n.push(rF,xw(e[++r]));return Wrt(n),new na(n)}dse.str=use;function oF(e,t){if(t instanceof na)e.push(...t._items);else if(t instanceof hg)e.push(t);else e.push(Yrt(t))}dse.addCodeArg=oF;function Wrt(e){let t=1;while(t<e.length-1){if(e[t]===rF){let n=Krt(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}function Krt(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof hg||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 hg))return`"${e}${t.slice(1)}`;return}function Jrt(e,t){return t.emptyStr()?e:e.emptyStr()?t:use`${e}${t}`}dse.strConcat=Jrt;function Yrt(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:xw(Array.isArray(e)?e.join(","):e)}function Xrt(e){return new na(xw(e))}dse.stringify=Xrt;function xw(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}dse.safeStringify=xw;function Qrt(e){return typeof e=="string"&&dse.IDENTIFIER.test(e)?new na(`.${e}`):lse`[${e}]`}dse.getProperty=Qrt;function Zrt(e){if(typeof e=="string"&&dse.IDENTIFIER.test(e))return new na(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}dse.getEsmExportName=Zrt;function eot(e){return new na(e.toString())}dse.regexpCode=eot});var cF=_(function(hse){Object.defineProperty(hse,"__esModule",{value:!0});hse.ValueScope=hse.ValueScopeName=hse.Scope=hse.varKinds=hse.UsedValueState=void 0;var un=vw();class pse extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Sk;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Sk||(hse.UsedValueState=Sk={}));hse.varKinds={const:new un.Name("const"),let:new un.Name("let"),var:new un.Name("var")};class iF{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof un.Name?e:this.name(e)}name(e){return new un.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}}}hse.Scope=iF;class aF extends un.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=un._`.${new un.Name(t)}[${n}]`}}hse.ValueScopeName=aF;var pot=un._`\n`;class mse extends iF{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?pot:un.nil}}get(){return this._scope}name(e){return new aF(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 un._`${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=un.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,Sk.Started);let l=t(c);if(l){let d=this.opts.es5?hse.varKinds.var:hse.varKinds.const;o=un._`${o}${d} ${c} = ${l};${this.opts._n}`}else if(l=r===null||r===void 0?void 0:r(c))o=un._`${o}${l}${this.opts._n}`;else throw new pse(c);a.set(c,Sk.Completed)})}return o}}hse.ValueScope=mse});var wt=_(function(gs){Object.defineProperty(gs,"__esModule",{value:!0});gs.or=gs.and=gs.not=gs.CodeGen=gs.operators=gs.varKinds=gs.ValueScopeName=gs.ValueScope=gs.Scope=gs.Name=gs.regexpCode=gs.stringify=gs.getProperty=gs.nil=gs.strConcat=gs.str=gs._=void 0;var ge=vw(),Xn=cF(),ld=vw();Object.defineProperty(gs,"_",{enumerable:!0,get:function(){return ld._}});Object.defineProperty(gs,"str",{enumerable:!0,get:function(){return ld.str}});Object.defineProperty(gs,"strConcat",{enumerable:!0,get:function(){return ld.strConcat}});Object.defineProperty(gs,"nil",{enumerable:!0,get:function(){return ld.nil}});Object.defineProperty(gs,"getProperty",{enumerable:!0,get:function(){return ld.getProperty}});Object.defineProperty(gs,"stringify",{enumerable:!0,get:function(){return ld.stringify}});Object.defineProperty(gs,"regexpCode",{enumerable:!0,get:function(){return ld.regexpCode}});Object.defineProperty(gs,"Name",{enumerable:!0,get:function(){return ld.Name}});var Ak=cF();Object.defineProperty(gs,"Scope",{enumerable:!0,get:function(){return Ak.Scope}});Object.defineProperty(gs,"ValueScope",{enumerable:!0,get:function(){return Ak.ValueScope}});Object.defineProperty(gs,"ValueScopeName",{enumerable:!0,get:function(){return Ak.ValueScopeName}});Object.defineProperty(gs,"varKinds",{enumerable:!0,get:function(){return Ak.varKinds}});gs.operators={GT:new ge._Code(">"),GTE:new ge._Code(">="),LT:new ge._Code("<"),LTE:new ge._Code("<="),EQ:new ge._Code("==="),NEQ:new ge._Code("!=="),NOT:new ge._Code("!"),OR:new ge._Code("||"),AND:new ge._Code("&&"),ADD:new ge._Code("+")};class ud{optimizeNodes(){return this}optimizeNames(e,t){return this}}class yse extends ud{constructor(e,t,n){super();this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?Xn.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=yg(this.rhs,e,t);return this}get names(){return this.rhs instanceof ge._CodeOrName?this.rhs.names:{}}}class dF extends ud{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 ge.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=yg(this.rhs,e,t),this}get names(){let e=this.lhs instanceof ge.Name?{}:{...this.lhs.names};return Ck(e,this.rhs)}}class bse extends dF{constructor(e,t,n,r){super(e,n,r);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class wse extends ud{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class _se extends ud{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class xse extends ud{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class vse extends ud{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=yg(this.code,e,t),this}get names(){return this.code instanceof ge._CodeOrName?this.code.names:{}}}class Ok extends ud{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;yot(e,o.names),n.splice(r,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>yp(e,t.names),{})}}class dd extends Ok{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Ese extends Ok{}class Ew extends dd{}Ew.kind="else";class Nl extends dd{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 Ew(n):n}if(t){if(e===!1)return t instanceof Nl?t:t.nodes;if(this.nodes.length)return this;return new Nl(Dse(e),t instanceof Nl?[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=yg(this.condition,e,t),this}get names(){let e=super.names;if(Ck(e,this.condition),this.else)yp(e,this.else.names);return e}}Nl.kind="if";class gg extends dd{}gg.kind="for";class Sse extends gg{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=yg(this.iteration,e,t),this}get names(){return yp(super.names,this.iteration.names)}}class kse extends gg{constructor(e,t,n,r){super();this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?Xn.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=Ck(super.names,this.from);return Ck(e,this.to)}}class lF extends gg{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=yg(this.iterable,e,t),this}get names(){return yp(super.names,this.iterable.names)}}class kk extends dd{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)}}kk.kind="func";class Rk extends Ok{render(e){return"return "+super.render(e)}}Rk.kind="return";class Rse extends dd{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)yp(e,this.catch.names);if(this.finally)yp(e,this.finally.names);return e}}class $k extends dd{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}$k.kind="catch";class Dk extends dd{render(e){return"finally"+super.render(e)}}Dk.kind="finally";class $se{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 D(e){return new cne(e)}var H0,Iet;var ko=H(()=>{Ue();Wte();Jte();kI();rne();sne();ane();H0=ct(bE(),1),Iet=ct(bE(),1)});var Tt,dne,he,Sl=(e)=>{switch(typeof e){case"undefined":return he.undefined;case"string":return he.string;case"number":return Number.isNaN(e)?he.nan:he.number;case"boolean":return he.boolean;case"function":return he.function;case"bigint":return he.bigint;case"symbol":return he.symbol;case"object":if(Array.isArray(e))return he.array;if(e===null)return he.null;if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return he.promise;if(typeof Map<"u"&&e instanceof Map)return he.map;if(typeof Set<"u"&&e instanceof Set)return he.set;if(typeof Date<"u"&&e instanceof Date)return he.date;return he.object;default:return he.unknown}};var z0=H(()=>{(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}})(Tt||(Tt={}));(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(dne||(dne={}));he=Tt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var ee,js;var SS=H(()=>{z0();ee=Tt.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"]);js=class js 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 js))throw Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Tt.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()}};js.create=(e)=>new js(e)});var Net=(e,t)=>{let n;switch(e.code){case ee.invalid_type:if(e.received===he.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,Tt.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:n=`Unrecognized key(s) in object: ${Tt.joinValues(e.keys,", ")}`;break;case ee.invalid_union:n="Invalid input";break;case ee.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Tt.joinValues(e.options)}`;break;case ee.invalid_enum_value:n=`Invalid enum value. Expected ${Tt.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 Tt.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,Tt.assertNever(e)}return{message:n}},od;var AI=H(()=>{SS();z0();od=Net});function G0(){return Fet}var Fet;var kS=H(()=>{AI();Fet=od});function fe(e,t){let n=G0(),r=RS({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===od?void 0:od].filter((o)=>!!o)});e.common.issues.push(r)}class Ro{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 We;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 Ro.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 We;if(s.status==="aborted")return We;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 RS=(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}},We,Hh=(e)=>({status:"dirty",value:e}),Ho=(e)=>({status:"valid",value:e}),OI=(e)=>e.status==="aborted",TI=(e)=>e.status==="dirty",sp=(e)=>e.status==="valid",V0=(e)=>typeof Promise<"u"&&e instanceof Promise;var PI=H(()=>{kS();AI();We=Object.freeze({status:"aborted"})});var fne=()=>{};var Te;var pne=H(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(Te||(Te={}))});class Xi{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 bt(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 Dt{get description(){return this._def.description}_getType(e){return Sl(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:Sl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ro,ctx:{common:e.parent.common,data:e.data,parsedType:Sl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(V0(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:Sl(e)},r=this._parseSync({data:e,path:n.path,parent:n});return mne(n,r)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Sl(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return sp(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)=>sp(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:Sl(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(V0(r)?r:Promise.resolve(r));return mne(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 za({schema:this,typeName:Je.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 Ha.create(this,this._def)}nullable(){return sd.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Ba.create(this)}promise(){return Kh.create(this,this._def)}or(e){return X0.create([this,e],this._def)}and(e){return Q0.create(this,e,this._def)}transform(e){return new za({...bt(this._def),schema:this,typeName:Je.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new nw({...bt(this._def),innerType:this,defaultValue:t,typeName:Je.ZodDefault})}brand(){return new MI({typeName:Je.ZodBranded,type:this,...bt(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new rw({...bt(this._def),innerType:this,catchValue:t,typeName:Je.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return IS.create(this,e)}readonly(){return ow.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function gne(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 Zet(e){return new RegExp(`^${gne(e)}$`)}function ett(e){let t=`${hne}T${gne(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 ttt(e,t){if((t==="v4"||!t)&&Vet.test(e))return!0;if((t==="v6"||!t)&&Ket.test(e))return!0;return!1}function ntt(e,t){if(!Bet.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 rtt(e,t){if((t==="v4"||!t)&&Wet.test(e))return!0;if((t==="v6"||!t)&&Jet.test(e))return!0;return!1}function ott(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 zh(e){if(e instanceof Jn){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Ha.create(zh(r))}return new Jn({...e._def,shape:()=>t})}else if(e instanceof Ba)return new Ba({...e._def,type:zh(e.element)});else if(e instanceof Ha)return Ha.create(zh(e.unwrap()));else if(e instanceof sd)return sd.create(zh(e.unwrap()));else if(e instanceof Dl)return Dl.create(e.items.map((t)=>zh(t)));else return e}function NI(e,t){let n=Sl(e),r=Sl(t);if(e===t)return{valid:!0,data:e};else if(n===he.object&&r===he.object){let o=Tt.objectKeys(t),s=Tt.objectKeys(e).filter((a)=>o.indexOf(a)!==-1),i={...e,...t};for(let a of s){let c=NI(e[a],t[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===he.array&&r===he.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=NI(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else if(n===he.date&&r===he.date&&+e===+t)return{valid:!0,data:e};else return{valid:!1}}function yne(e,t){return new ap({values:e,typeName:Je.ZodEnum,...bt(t)})}var mne=(e,t)=>{if(sp(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 js(e.common.issues);return this._error=n,this._error}}}},Met,jet,Let,qet,Uet,Bet,Het,zet,Get="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",II,Vet,Wet,Ket,Jet,Yet,Xet,hne="((\\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])))",Qet,Rl,Gh,Vh,$S,K0,DS,J0,Y0,CS,ip,$l,AS,Ba,Jn,X0,kl=(e)=>{if(e instanceof Z0)return kl(e.schema);else if(e instanceof za)return kl(e.innerType());else if(e instanceof ew)return[e.value];else if(e instanceof ap)return e.options;else if(e instanceof tw)return Tt.objectValues(e.enum);else if(e instanceof nw)return kl(e._def.innerType);else if(e instanceof J0)return[void 0];else if(e instanceof Y0)return[null];else if(e instanceof Ha)return[void 0,...kl(e.unwrap())];else if(e instanceof sd)return[null,...kl(e.unwrap())];else if(e instanceof MI)return kl(e.unwrap());else if(e instanceof ow)return kl(e.unwrap());else if(e instanceof rw)return kl(e._def.innerType);else return[]},FI,Q0,Dl,OS,TS,Wh,W0,Z0,ew,ap,tw,Kh,za,Ha,sd,nw,rw,PS,JYt,MI,IS,ow,YYt,Je,w,C,XYt,QYt,re,ZYt,eXt,tXt,nXt,rXt,fi,oXt,sXt,J,I,iXt,Jh,jI,aXt,cXt,Yn,lXt,uXt,dXt,fXt,Ke,Xe,pXt,mXt,hXt,gXt,yXt,bXt,wXt;var bne=H(()=>{SS();kS();pne();PI();z0();Met=/^c[^\s-]{8,}$/i,jet=/^[0-9a-z]+$/,Let=/^[0-9A-HJKMNP-TV-Z]{26}$/i,qet=/^[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,Uet=/^[a-z0-9_-]{21}$/i,Bet=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Het=/^[-+]?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)?)??$/,zet=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Vet=/^(?:(?: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])$/,Wet=/^(?:(?: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])$/,Ket=/^(([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]))$/,Jet=/^(([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])$/,Yet=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Xet=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Qet=new RegExp(`^${hne}$`);Rl=class Rl extends Dt{_parse(e){if(this._def.coerce)e.data=String(e.data);if(this._getType(e)!==he.string){let o=this._getOrReturnCtx(e);return fe(o,{code:ee.invalid_type,expected:he.string,received:o.parsedType}),We}let n=new Ro,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),fe(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),fe(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)fe(r,{code:ee.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});else if(i)fe(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(!zet.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"email",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="emoji"){if(!II)II=new RegExp(Get,"u");if(!II.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"emoji",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="uuid"){if(!qet.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"uuid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="nanoid"){if(!Uet.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"nanoid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid"){if(!Met.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"cuid",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid2"){if(!jet.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"cuid2",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ulid"){if(!Let.test(e.data))r=this._getOrReturnCtx(e,r),fe(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),fe(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),fe(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),fe(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),fe(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),fe(r,{code:ee.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()}else if(o.kind==="datetime"){if(!ett(o).test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{code:ee.invalid_string,validation:"datetime",message:o.message}),n.dirty()}else if(o.kind==="date"){if(!Qet.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{code:ee.invalid_string,validation:"date",message:o.message}),n.dirty()}else if(o.kind==="time"){if(!Zet(o).test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{code:ee.invalid_string,validation:"time",message:o.message}),n.dirty()}else if(o.kind==="duration"){if(!Het.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"duration",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ip"){if(!ttt(e.data,o.version))r=this._getOrReturnCtx(e,r),fe(r,{validation:"ip",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="jwt"){if(!ntt(e.data,o.alg))r=this._getOrReturnCtx(e,r),fe(r,{validation:"jwt",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cidr"){if(!rtt(e.data,o.version))r=this._getOrReturnCtx(e,r),fe(r,{validation:"cidr",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64"){if(!Yet.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"base64",code:ee.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64url"){if(!Xet.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"base64url",code:ee.invalid_string,message:o.message}),n.dirty()}else Tt.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,...Te.errToObj(n)})}_addCheck(e){return new Rl({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Te.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Te.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Te.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Te.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Te.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Te.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Te.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Te.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Te.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Te.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Te.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Te.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Te.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,...Te.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,...Te.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Te.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Te.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...Te.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Te.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Te.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Te.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Te.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Te.errToObj(t)})}nonempty(e){return this.min(1,Te.errToObj(e))}trim(){return new Rl({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Rl({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Rl({...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}};Rl.create=(e)=>new Rl({checks:[],typeName:Je.ZodString,coerce:e?.coerce??!1,...bt(e)});Gh=class Gh extends Dt{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)!==he.number){let o=this._getOrReturnCtx(e);return fe(o,{code:ee.invalid_type,expected:he.number,received:o.parsedType}),We}let n=void 0,r=new Ro;for(let o of this._def.checks)if(o.kind==="int"){if(!Tt.isInteger(e.data))n=this._getOrReturnCtx(e,n),fe(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),fe(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),fe(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(ott(e.data,o.value)!==0)n=this._getOrReturnCtx(e,n),fe(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),fe(n,{code:ee.not_finite,message:o.message}),r.dirty()}else Tt.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Te.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Te.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Te.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Te.toString(t))}setLimit(e,t,n,r){return new Gh({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Te.toString(r)}]})}_addCheck(e){return new Gh({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Te.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Te.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Te.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Te.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Te.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Te.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Te.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Te.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Te.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"&&Tt.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)}};Gh.create=(e)=>new Gh({checks:[],typeName:Je.ZodNumber,coerce:e?.coerce||!1,...bt(e)});Vh=class Vh extends Dt{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)!==he.bigint)return this._getInvalidInput(e);let n=void 0,r=new Ro;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),fe(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),fe(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),fe(n,{code:ee.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()}else Tt.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return fe(t,{code:ee.invalid_type,expected:he.bigint,received:t.parsedType}),We}gte(e,t){return this.setLimit("min",e,!0,Te.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Te.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Te.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Te.toString(t))}setLimit(e,t,n,r){return new Vh({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Te.toString(r)}]})}_addCheck(e){return new Vh({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Te.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Te.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Te.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Te.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Te.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}};Vh.create=(e)=>new Vh({checks:[],typeName:Je.ZodBigInt,coerce:e?.coerce??!1,...bt(e)});$S=class $S extends Dt{_parse(e){if(this._def.coerce)e.data=Boolean(e.data);if(this._getType(e)!==he.boolean){let n=this._getOrReturnCtx(e);return fe(n,{code:ee.invalid_type,expected:he.boolean,received:n.parsedType}),We}return Ho(e.data)}};$S.create=(e)=>new $S({typeName:Je.ZodBoolean,coerce:e?.coerce||!1,...bt(e)});K0=class K0 extends Dt{_parse(e){if(this._def.coerce)e.data=new Date(e.data);if(this._getType(e)!==he.date){let o=this._getOrReturnCtx(e);return fe(o,{code:ee.invalid_type,expected:he.date,received:o.parsedType}),We}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return fe(o,{code:ee.invalid_date}),We}let n=new Ro,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),fe(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),fe(r,{code:ee.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()}else Tt.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new K0({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Te.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Te.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}};K0.create=(e)=>new K0({checks:[],coerce:e?.coerce||!1,typeName:Je.ZodDate,...bt(e)});DS=class DS extends Dt{_parse(e){if(this._getType(e)!==he.symbol){let n=this._getOrReturnCtx(e);return fe(n,{code:ee.invalid_type,expected:he.symbol,received:n.parsedType}),We}return Ho(e.data)}};DS.create=(e)=>new DS({typeName:Je.ZodSymbol,...bt(e)});J0=class J0 extends Dt{_parse(e){if(this._getType(e)!==he.undefined){let n=this._getOrReturnCtx(e);return fe(n,{code:ee.invalid_type,expected:he.undefined,received:n.parsedType}),We}return Ho(e.data)}};J0.create=(e)=>new J0({typeName:Je.ZodUndefined,...bt(e)});Y0=class Y0 extends Dt{_parse(e){if(this._getType(e)!==he.null){let n=this._getOrReturnCtx(e);return fe(n,{code:ee.invalid_type,expected:he.null,received:n.parsedType}),We}return Ho(e.data)}};Y0.create=(e)=>new Y0({typeName:Je.ZodNull,...bt(e)});CS=class CS extends Dt{constructor(){super(...arguments);this._any=!0}_parse(e){return Ho(e.data)}};CS.create=(e)=>new CS({typeName:Je.ZodAny,...bt(e)});ip=class ip extends Dt{constructor(){super(...arguments);this._unknown=!0}_parse(e){return Ho(e.data)}};ip.create=(e)=>new ip({typeName:Je.ZodUnknown,...bt(e)});$l=class $l extends Dt{_parse(e){let t=this._getOrReturnCtx(e);return fe(t,{code:ee.invalid_type,expected:he.never,received:t.parsedType}),We}};$l.create=(e)=>new $l({typeName:Je.ZodNever,...bt(e)});AS=class AS extends Dt{_parse(e){if(this._getType(e)!==he.undefined){let n=this._getOrReturnCtx(e);return fe(n,{code:ee.invalid_type,expected:he.void,received:n.parsedType}),We}return Ho(e.data)}};AS.create=(e)=>new AS({typeName:Je.ZodVoid,...bt(e)});Ba=class Ba extends Dt{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==he.array)return fe(t,{code:ee.invalid_type,expected:he.array,received:t.parsedType}),We;if(r.exactLength!==null){let s=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;if(s||i)fe(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)fe(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)fe(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 Xi(t,s,t.path,i)))).then((s)=>Ro.mergeArray(n,s));let o=[...t.data].map((s,i)=>r.type._parseSync(new Xi(t,s,t.path,i)));return Ro.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new Ba({...this._def,minLength:{value:e,message:Te.toString(t)}})}max(e,t){return new Ba({...this._def,maxLength:{value:e,message:Te.toString(t)}})}length(e,t){return new Ba({...this._def,exactLength:{value:e,message:Te.toString(t)}})}nonempty(e){return this.min(1,e)}};Ba.create=(e,t)=>new Ba({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Je.ZodArray,...bt(t)});Jn=class Jn extends Dt{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=Tt.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==he.object){let c=this._getOrReturnCtx(e);return fe(c,{code:ee.invalid_type,expected:he.object,received:c.parsedType}),We}let{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof $l&&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 Xi(r,d,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof $l){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)fe(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 Xi(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)=>Ro.mergeObjectSync(n,c));else return Ro.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(e){return Te.errToObj,new Jn({...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:Te.errToObj(e).message??r};return{message:r}}}:{}})}strip(){return new Jn({...this._def,unknownKeys:"strip"})}passthrough(){return new Jn({...this._def,unknownKeys:"passthrough"})}extend(e){return new Jn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Jn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Je.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Jn({...this._def,catchall:e})}pick(e){let t={};for(let n of Tt.objectKeys(e))if(e[n]&&this.shape[n])t[n]=this.shape[n];return new Jn({...this._def,shape:()=>t})}omit(e){let t={};for(let n of Tt.objectKeys(this.shape))if(!e[n])t[n]=this.shape[n];return new Jn({...this._def,shape:()=>t})}deepPartial(){return zh(this)}partial(e){let t={};for(let n of Tt.objectKeys(this.shape)){let r=this.shape[n];if(e&&!e[n])t[n]=r;else t[n]=r.optional()}return new Jn({...this._def,shape:()=>t})}required(e){let t={};for(let n of Tt.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];while(o instanceof Ha)o=o._def.innerType;t[n]=o}return new Jn({...this._def,shape:()=>t})}keyof(){return yne(Tt.objectKeys(this.shape))}};Jn.create=(e,t)=>new Jn({shape:()=>e,unknownKeys:"strip",catchall:$l.create(),typeName:Je.ZodObject,...bt(t)});Jn.strictCreate=(e,t)=>new Jn({shape:()=>e,unknownKeys:"strict",catchall:$l.create(),typeName:Je.ZodObject,...bt(t)});Jn.lazycreate=(e,t)=>new Jn({shape:e,unknownKeys:"strip",catchall:$l.create(),typeName:Je.ZodObject,...bt(t)});X0=class X0 extends Dt{_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 js(i.ctx.common.issues));return fe(t,{code:ee.invalid_union,unionErrors:s}),We}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 js(a));return fe(t,{code:ee.invalid_union,unionErrors:i}),We}}get options(){return this._def.options}};X0.create=(e,t)=>new X0({options:e,typeName:Je.ZodUnion,...bt(t)});FI=class FI extends Dt{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==he.object)return fe(t,{code:ee.invalid_type,expected:he.object,received:t.parsedType}),We;let n=this.discriminator,r=t.data[n],o=this.optionsMap.get(r);if(!o)return fe(t,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),We;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=kl(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 FI({typeName:Je.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...bt(n)})}};Q0=class Q0 extends Dt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(o,s)=>{if(OI(o)||OI(s))return We;let i=NI(o.value,s.value);if(!i.valid)return fe(n,{code:ee.invalid_intersection_types}),We;if(TI(o)||TI(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}))}};Q0.create=(e,t,n)=>new Q0({left:e,right:t,typeName:Je.ZodIntersection,...bt(n)});Dl=class Dl extends Dt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==he.array)return fe(n,{code:ee.invalid_type,expected:he.array,received:n.parsedType}),We;if(n.data.length<this._def.items.length)return fe(n,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),We;if(!this._def.rest&&n.data.length>this._def.items.length)fe(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 Xi(n,s,n.path,i))}).filter((s)=>!!s);if(n.common.async)return Promise.all(o).then((s)=>Ro.mergeArray(t,s));else return Ro.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new Dl({...this._def,rest:e})}};Dl.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Dl({items:e,typeName:Je.ZodTuple,rest:null,...bt(t)})};OS=class OS extends Dt{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!==he.object)return fe(n,{code:ee.invalid_type,expected:he.object,received:n.parsedType}),We;let r=[],o=this._def.keyType,s=this._def.valueType;for(let i in n.data)r.push({key:o._parse(new Xi(n,i,n.path,i)),value:s._parse(new Xi(n,n.data[i],n.path,i)),alwaysSet:i in n.data});if(n.common.async)return Ro.mergeObjectAsync(t,r);else return Ro.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){if(t instanceof Dt)return new OS({keyType:e,valueType:t,typeName:Je.ZodRecord,...bt(n)});return new OS({keyType:Rl.create(),valueType:e,typeName:Je.ZodRecord,...bt(t)})}};TS=class TS extends Dt{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!==he.map)return fe(n,{code:ee.invalid_type,expected:he.map,received:n.parsedType}),We;let r=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([i,a],c)=>({key:r._parse(new Xi(n,i,n.path,[c,"key"])),value:o._parse(new Xi(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 We;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 We;if(c.status==="dirty"||l.status==="dirty")t.dirty();i.set(c.value,l.value)}return{status:t.value,value:i}}}};TS.create=(e,t,n)=>new TS({valueType:t,keyType:e,typeName:Je.ZodMap,...bt(n)});Wh=class Wh extends Dt{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==he.set)return fe(n,{code:ee.invalid_type,expected:he.set,received:n.parsedType}),We;let r=this._def;if(r.minSize!==null){if(n.data.size<r.minSize.value)fe(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)fe(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 We;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 Xi(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 Wh({...this._def,minSize:{value:e,message:Te.toString(t)}})}max(e,t){return new Wh({...this._def,maxSize:{value:e,message:Te.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Wh.create=(e,t)=>new Wh({valueType:e,minSize:null,maxSize:null,typeName:Je.ZodSet,...bt(t)});W0=class W0 extends Dt{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==he.function)return fe(t,{code:ee.invalid_type,expected:he.function,received:t.parsedType}),We;function n(i,a){return RS({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,G0(),od].filter((c)=>!!c),issueData:{code:ee.invalid_arguments,argumentsError:a}})}function r(i,a){return RS({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,G0(),od].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 Kh){let i=this;return Ho(async function(...a){let c=new js([]),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 Ho(function(...a){let c=i._def.args.safeParse(a,o);if(!c.success)throw new js([n(a,c.error)]);let l=Reflect.apply(s,this,c.data),d=i._def.returns.safeParse(l,o);if(!d.success)throw new js([r(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new W0({...this._def,args:Dl.create(e).rest(ip.create())})}returns(e){return new W0({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new W0({args:e?e:Dl.create([]).rest(ip.create()),returns:t||ip.create(),typeName:Je.ZodFunction,...bt(n)})}};Z0=class Z0 extends Dt{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})}};Z0.create=(e,t)=>new Z0({getter:e,typeName:Je.ZodLazy,...bt(t)});ew=class ew extends Dt{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return fe(t,{received:t.data,code:ee.invalid_literal,expected:this._def.value}),We}return{status:"valid",value:e.data}}get value(){return this._def.value}};ew.create=(e,t)=>new ew({value:e,typeName:Je.ZodLiteral,...bt(t)});ap=class ap extends Dt{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return fe(t,{expected:Tt.joinValues(n),received:t.parsedType,code:ee.invalid_type}),We}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 fe(t,{received:t.data,code:ee.invalid_enum_value,options:n}),We}return Ho(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 ap.create(e,{...this._def,...t})}exclude(e,t=this._def){return ap.create(this.options.filter((n)=>!e.includes(n)),{...this._def,...t})}};ap.create=yne;tw=class tw extends Dt{_parse(e){let t=Tt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==he.string&&n.parsedType!==he.number){let r=Tt.objectValues(t);return fe(n,{expected:Tt.joinValues(r),received:n.parsedType,code:ee.invalid_type}),We}if(!this._cache)this._cache=new Set(Tt.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let r=Tt.objectValues(t);return fe(n,{received:n.data,code:ee.invalid_enum_value,options:r}),We}return Ho(e.data)}get enum(){return this._def.values}};tw.create=(e,t)=>new tw({values:e,typeName:Je.ZodNativeEnum,...bt(t)});Kh=class Kh extends Dt{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==he.promise&&t.common.async===!1)return fe(t,{code:ee.invalid_type,expected:he.promise,received:t.parsedType}),We;let n=t.parsedType===he.promise?t.data:Promise.resolve(t.data);return Ho(n.then((r)=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Kh.create=(e,t)=>new Kh({type:e,typeName:Je.ZodPromise,...bt(t)});za=class za extends Dt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Je.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(fe(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 We;let a=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});if(a.status==="aborted")return We;if(a.status==="dirty")return Hh(a.value);if(t.value==="dirty")return Hh(a.value);return a});else{if(t.value==="aborted")return We;let i=this._def.schema._parseSync({data:s,path:n.path,parent:n});if(i.status==="aborted")return We;if(i.status==="dirty")return Hh(i.value);if(t.value==="dirty")return Hh(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 We;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 We;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(!sp(s))return We;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(!sp(s))return We;return Promise.resolve(r.transform(s.value,o)).then((i)=>({status:t.value,value:i}))});Tt.assertNever(r)}};za.create=(e,t,n)=>new za({schema:e,typeName:Je.ZodEffects,effect:t,...bt(n)});za.createWithPreprocess=(e,t,n)=>new za({schema:t,effect:{type:"preprocess",transform:e},typeName:Je.ZodEffects,...bt(n)});Ha=class Ha extends Dt{_parse(e){if(this._getType(e)===he.undefined)return Ho(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ha.create=(e,t)=>new Ha({innerType:e,typeName:Je.ZodOptional,...bt(t)});sd=class sd extends Dt{_parse(e){if(this._getType(e)===he.null)return Ho(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};sd.create=(e,t)=>new sd({innerType:e,typeName:Je.ZodNullable,...bt(t)});nw=class nw extends Dt{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;if(t.parsedType===he.undefined)n=this._def.defaultValue();return this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};nw.create=(e,t)=>new nw({innerType:e,typeName:Je.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...bt(t)});rw=class rw extends Dt{_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(V0(r))return r.then((o)=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new js(n.common.issues)},input:n.data})}));else return{status:"valid",value:r.status==="valid"?r.value:this._def.catchValue({get error(){return new js(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};rw.create=(e,t)=>new rw({innerType:e,typeName:Je.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...bt(t)});PS=class PS extends Dt{_parse(e){if(this._getType(e)!==he.nan){let n=this._getOrReturnCtx(e);return fe(n,{code:ee.invalid_type,expected:he.nan,received:n.parsedType}),We}return{status:"valid",value:e.data}}};PS.create=(e)=>new PS({typeName:Je.ZodNaN,...bt(e)});JYt=Symbol("zod_brand");MI=class MI extends Dt{_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}};IS=class IS extends Dt{_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 We;if(o.status==="dirty")return t.dirty(),Hh(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 We;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 IS({in:e,out:t,typeName:Je.ZodPipeline})}};ow=class ow extends Dt{_parse(e){let t=this._def.innerType._parse(e),n=(r)=>{if(sp(r))r.value=Object.freeze(r.value);return r};return V0(t)?t.then((r)=>n(r)):n(t)}unwrap(){return this._def.innerType}};ow.create=(e,t)=>new ow({innerType:e,typeName:Je.ZodReadonly,...bt(t)});YYt={object:Jn.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"})(Je||(Je={}));w=Rl.create,C=Gh.create,XYt=PS.create,QYt=Vh.create,re=$S.create,ZYt=K0.create,eXt=DS.create,tXt=J0.create,nXt=Y0.create,rXt=CS.create,fi=ip.create,oXt=$l.create,sXt=AS.create,J=Ba.create,I=Jn.create,iXt=Jn.strictCreate,Jh=X0.create,jI=FI.create,aXt=Q0.create,cXt=Dl.create,Yn=OS.create,lXt=TS.create,uXt=Wh.create,dXt=W0.create,fXt=Z0.create,Ke=ew.create,Xe=ap.create,pXt=tw.create,mXt=Kh.create,hXt=za.create,gXt=Ha.create,yXt=sd.create,bXt=za.createWithPreprocess,wXt=IS.create});var LI=H(()=>{kS();PI();fne();z0();bne();SS()});var kn=H(()=>{LI();LI()});function qI(e){return NS.includes(e)}var stt,cp,NS,wne,itt,_ne,att,xne,ctt,ltt,vne,utt,Ene,AXt,OXt,Sne,dtt,kne,ftt,Rne,UI=20,BI=500,ptt,TXt;var Yh=H(()=>{kn();stt=Xe(["pending","verified","approved","revoked"]),cp=Xe(["person","service","test"]),NS=cp.options;wne={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"},itt=Xe(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),_ne=itt.options,att=Xe(["active","pending","revoked"]),xne=I({field:w(),blocks:J(w()).optional(),set_on:J(w()).optional()}).passthrough(),ctt=I({id:C().int(),username:w().nullable(),email:w(),github_username:w().nullable(),role:w(),orcid:w().nullable().optional(),created_at:w().optional(),approved_at:w().nullable().optional(),dataset_count:C().int().optional(),sandbox_completed:re().optional(),sandbox_completed_at:w().nullable().optional(),sandbox_dataset_id:w().nullable().optional(),service_access:re().optional(),status:stt.optional(),email_verified:re().optional(),orcid_verified:re().optional(),given_name:w().nullable().optional(),family_name:w().nullable().optional(),profile_gaps:J(xne).optional(),username_auto_assigned:re().optional(),account_kind:cp.optional(),compute_access:w().optional(),compute_access_requested_at:w().nullable().optional(),compute_access_granted_at:w().nullable().optional()}).passthrough(),ltt=I({prefix:w(),created_at:w(),last_used_at:w().nullable()}).passthrough().nullable(),vne=I({user:ctt,token:ltt.optional()}).passthrough(),utt=I({id:C().int(),username:w().nullable(),email:w(),github_username:w().nullable(),status:w(),email_verified:C().int().nullable().optional(),role:w().nullable(),created_at:w(),approved_at:w().nullable().optional(),revoked_at:w().nullable().optional(),signup_source:w().nullable().optional(),service_access:C().int().nullable().optional(),service_access_granted_at:w().nullable().optional(),given_name:w().nullable().optional(),family_name:w().nullable().optional(),orcid:w().nullable().optional(),upload_access_requested_at:w().nullable().optional(),account_kind:cp.optional(),matched_in:J(w()).optional(),match_kind:w().optional()}).passthrough(),Ene=I({users:J(utt),count:C().int()}).passthrough(),AXt=Xe(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),OXt=Xe(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),Sne=I({suggestion:w().nullable(),based_on:Xe(["name","unavailable","exhausted"])}).passthrough(),dtt=Xe(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),kne=dtt.options,ftt=Xe(["invalid_github_username","city_required","country_required","empty_patch","username_too_short","username_too_long","username_charset","username_reserved","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"]),Rne=ftt.options,ptt=I({id:C().int(),email:w(),username:w().nullable(),role:w(),status:att,email_verified:re(),given_name:w().nullable(),family_name:w().nullable(),orcid:w().nullable(),orcid_verified:re(),github_username:w().nullable(),city:w().nullable(),country:w().nullable(),affiliation:w().nullable(),service_access:re(),service_access_granted_at:w().nullable(),upload_access_requested_at:w().nullable(),profile_gaps:J(xne),username_auto_assigned:re(),compute_access:w().optional(),compute_access_requested_at:w().nullable().optional(),compute_access_granted_at:w().nullable().optional()}).passthrough(),TXt=I({user:ptt.nullable()}).passthrough()});var HI,zI,FXt,mtt,MXt,htt,$ne,Dne,GI=8,VI=100,Cne,Ane,gtt,One;var sw=H(()=>{kn();Yh();HI=["given_name","family_name","affiliation","city","country"],zI=["username","github_username","email","orcid"],FXt=[...HI,...zI],mtt={given_name:w().max(200).optional(),family_name:w().max(200).optional(),affiliation:w().max(500).optional(),city:w().max(200).optional(),country:w().max(200).optional(),username:w().max(100).optional(),github_username:w().max(100).optional(),email:w().max(320).optional(),orcid:w().max(40).optional()},MXt=I(mtt),htt=Xe(["field_not_editable","owner_only_field","edit_own_account","owner_account","system_account","invalid_edit","orcid_already_proven","invalid_search","invalid_user_id"]),$ne=htt.options,Dne=["exact","name","prefix","substring","fuzzy"],Cne=I({id:C().int(),username:w().nullable(),email:w(),github_username:w().nullable(),status:w(),role:w().nullable(),account_kind:cp.optional(),email_verified:C().int().nullable().optional(),orcid:w().nullable().optional(),orcid_verified:C().int().nullable().optional(),given_name:w().nullable().optional(),family_name:w().nullable().optional(),affiliation:w().nullable().optional(),city:w().nullable().optional(),country:w().nullable().optional(),description:w().nullable().optional(),signup_source:w().nullable().optional(),created_at:w(),updated_at:w().nullable().optional(),approved_at:w().nullable().optional(),revoked_at:w().nullable().optional(),deleted_at:w().nullable().optional(),service_access:C().int().nullable().optional(),service_access_granted_at:w().nullable().optional(),service_access_granted_by:C().int().nullable().optional(),upload_access_requested_at:w().nullable().optional(),upload_access_notified_at:w().nullable().optional(),compute_access:w().optional(),compute_access_requested_at:w().nullable().optional(),compute_access_notified_at:w().nullable().optional(),compute_access_granted_at:w().nullable().optional(),compute_access_granted_by:C().int().nullable().optional(),compute_terms_version:w().nullable().optional(),compute_terms_accepted_at:w().nullable().optional(),identity_conflict:C().int().nullable().optional(),username_auto_assigned:C().int().nullable().optional(),sandbox_completed:C().int().nullable().optional(),sandbox_completed_at:w().nullable().optional(),sandbox_dataset_id:w().nullable().optional(),aws_iam_username:w().nullable().optional(),dataset_count:C().int().optional(),active_tokens:C().int().optional(),linked_identities:J(w()).optional()}).passthrough(),Ane=I({user:Cne}).passthrough(),gtt=I({from:w().nullable(),to:w().nullable()}),One=I({message:w(),changed:Yn(w(),gtt),notes:J(w()).optional(),old_address_notified:re().optional(),user:Cne}).passthrough()});function wtt(e){return e.startsWith("v")?e:`v${e}`}var ytt,btt,Tne,qXt;var WI=H(()=>{kn();ytt=/^v?\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/,btt=/^v\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/;Tne=w().regex(ytt,"must be a semver version, optionally v-prefixed").transform(wtt),qXt=w().regex(btt,"must be the canonical v-prefixed tag (vX.Y.Z)")});function Ine(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 Nne(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 _tt="0.4.1",KI,Xh,Pne,xtt,vtt,Ett,Fne,zXt,Mne,GXt,Cl,Stt,FS,VXt,ktt,Rtt,WXt;var JI=H(()=>{kn();WI();KI=Xe(["openneuro","nemar","gin","other"]),Xh=Jh([Ke(0),Ke(1)]).nullable(),Pne=I({dataset_id:w(),id:w().optional(),name:w(),description:w().nullable().optional(),status:w(),visibility:w(),anonymous:C().int().nullable().optional(),concept_doi:w().nullable().optional(),doi:w().nullable().optional(),created_at:w(),updated_at:w().optional(),first_published_at:w().nullable().optional(),owner_username:w().nullable().optional(),source:w().nullable().optional(),modalities:w().optional(),participants:C().int().nonnegative(),tasks:w().optional(),authors:w().optional(),license:w().optional(),file_size:C().nonnegative(),file_size_formatted:w().optional(),total_files:C().nonnegative().nullable().optional(),num_citations:C().int().nonnegative().optional(),n_channels:C().int().nullable().optional(),electrode_system:w().nullable().optional(),has_hed:Xh.optional(),hed_version:w().nullable().optional(),data_complete:Xh.optional(),bytes_present:C().nonnegative().nullable().optional(),latest_version:Tne.nullable().optional(),latest_version_at:w().nullable().optional(),subject_count:C().int().nullable().optional(),file_size_bytes:C().nullable().optional(),sessions_count:C().int().nullable().optional(),age_min:C().nullable().optional(),age_max:C().nullable().optional(),bids_version:w().nullable().optional(),zarr_status:Xe(["pending","ready","failed"]).nullable().optional(),zarr_store_count:C().int().nullable().optional(),zarr_converted_at:w().nullable().optional(),zarr_source_commit:w().nullable().optional(),zarr_errors:C().int().nullable().optional(),zarr_failure_count:C().int().nullable().optional(),zarr_deterministic:Xh.optional(),zarr_failed_at:w().nullable().optional(),zarr_index_url:w().nullable().optional(),zarr_verify_status:Xe(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:w().nullable().optional(),zarr_requeue_at:w().nullable().optional(),anonymity_status:Xe(["verified","findings","unverifiable"]).nullable().optional(),anonymity_checked_at:w().nullable().optional(),anonymity_findings:w().nullable().optional(),anonymity_unchecked:w().nullable().optional(),total_recording_duration:C().nullable().optional(),recording_duration_min:C().nullable().optional(),recording_duration_max:C().nullable().optional(),recording_count:C().int().nullable().optional(),recordings_unavailable:C().int().nullable().optional(),channel_count_min:C().int().nullable().optional(),channel_count_max:C().int().nullable().optional(),sampling_frequency:C().nullable().optional(),power_line_frequency:C().nullable().optional(),eeg_reference:w().nullable().optional(),placement_scheme:w().nullable().optional()}).passthrough();xtt=Pne.superRefine((e,t)=>{Ine(e,t),Nne(e,t)}),vtt=Pne.extend({file_size:C().nonnegative().nullable(),file_size_formatted:w().nullable().optional(),modalities:w().nullable().optional(),tasks:w().nullable().optional(),authors:w().nullable().optional(),license:w().nullable().optional(),owner_github:w().nullable().optional(),attestation_deposit_type:Xe(["owner","redistribution"]).nullable().optional(),attestation_key_status:Xe(["destroyed","retained"]).nullable().optional(),attestation_deidentified:Xh.optional(),attestation_no_duplicate:Xh.optional(),attestation_upstream_source:w().nullable().optional(),attestation_accepted_at:w().nullable().optional(),zarr_data_failures:I({count:C().int().nonnegative(),detail_ref:w(),compacted_by:w().optional(),pending:C().int().nonnegative().optional(),discovered:C().int().nonnegative().optional(),events_upload_failed:Ke(!0).optional(),manifest_upload_failed:Ke(!0).optional()}).passthrough().nullable().optional()}).passthrough().superRefine((e,t)=>{Ine(e,t),Nne(e,t)}),Ett=I({id:w(),name:w(),modalities:w().nullable().optional(),participants:C().int().nullable().optional(),doi:w().nullable().optional(),tasks:w().nullable().optional(),authors:w().nullable().optional(),has_hed:Xh.optional(),score:C().optional(),snippet:w().optional()}).passthrough(),Fne=Yn(w(),C().int().nonnegative()),zXt=I({datasets:J(xtt),count:C().int().nonnegative(),total_count:C().int().nonnegative().optional(),limit:C().int().optional(),offset:C().int().optional(),excluded_unknown:C().int().nonnegative().optional(),excluded_unknown_by_facet:Fne.optional()}).passthrough(),Mne=I({results:J(Ett),count:C().int().nonnegative(),returned:C().int().nonnegative().optional(),offset:C().int().nonnegative().optional(),limit:C().int().optional(),candidate_ceiling:C().int().optional(),truncated:re().optional(),method:Xe(["exact_id","text","text_fallback","semantic","unavailable"]).optional(),min_score:C().optional(),reranked:Ke(!0).optional(),corrected_query:w().optional(),modality_boost:J(w()).optional(),warning:w().optional(),excluded_unknown:C().int().nonnegative().optional(),excluded_unknown_by_facet:Fne.optional()}).passthrough(),GXt=I({dataset:vtt}).passthrough(),Cl=I({value:w(),count:C().int().nonnegative()}),Stt=I({values:J(Cl),distinct_total:C().int().nonnegative(),truncated:re()}),FS=I({"electrode-system":J(Cl).optional(),source:J(Cl).optional(),zarr:J(Cl).optional(),powerline:J(Cl).optional(),"bids-version":J(Cl).optional(),"hed-version":J(Cl).optional(),license:J(Cl).optional(),modality:J(Cl).optional(),task:Stt.optional(),warning:w().optional()}).passthrough(),VXt=I({schema_version:Ke(_tt),doc_type:Ke("dataset"),dataset_id:w().regex(/^[a-z]{2}\d+$/,"neuroschema dataset_id pattern"),name:w(),source:KI,recording_modality:J(w()).min(1),description:w().nullable().optional(),bids_version:w().nullable().optional(),license:w().nullable().optional()}).passthrough(),ktt=I({tasks:Yn(I({runs:J(w())}).passthrough())}).passthrough(),Rtt=I({sessions:J(w()),modalities:Yn(ktt),session_modalities:Yn(J(w())).optional()}).passthrough(),WXt=I({version:w(),subjects:Yn(Rtt)}).passthrough()});function MS(e){return typeof e==="string"&&jne.includes(e)}var $tt,YXt,XXt,QXt,jne,Dtt="ci_check_unavailable",Lne,qne,Une,Bne="X-Approval-Dispatch-Token",ZXt;var iw=H(()=>{kn();$tt=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,YXt=w().regex($tt,"ORCID must be in format 0000-0000-0000-000X"),XXt=Xe(["found","no_public_name","lookup_failed"]),QXt=Xe(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing","identifier_screen_findings"]),jne=["bids_validation_pending","bids_validation_in_progress"];Lne=[Dtt],qne=["identifier_screen_pending","identifier_screen_not_clear","identifier_screen_not_applicable"],Une=["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"],ZXt=Xe(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});var Ctt,Hne,aw="https://nemar.org/settings",nQt,Att,Ott,Ttt,zne,Gne;var YI=H(()=>{kn();Ctt=Xe(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),Hne=Ctt.options,nQt={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, ${aw}).`,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, ${aw}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${aw}), 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, ${aw}).`,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, ${aw}).`,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."},Att=Xe(["orcid","email","github"]),Ott=I({id:C().int(),username:w().nullable(),email:w(),created_at:w(),has_oauth_identity:re(),dataset_count:C().int(),identity_conflict:C().int(),canonical:re()}).passthrough(),Ttt=I({kind:Att,value:w(),canonical_user_id:C().int(),accounts:J(Ott)}).passthrough(),zne=I({groups:J(Ttt),group_count:C().int(),flagged_count:C().int()}).passthrough(),Gne=I({ok:Ke(!0),id:C().int(),cleared:re()}).passthrough()});var XI=120,Vne=64,QI="unnamed machine",Ptt=25,jS,Wne,Qh,Kne,sQt,iQt,Jne,Itt,Ntt,Yne,ZI,Xne,aQt,cQt,LS,qS;var US=H(()=>{kn();jS=Xe(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),Wne={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."},Qh=Xe(["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"]),Kne=Qh.options,sQt={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 ${Ptt} 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."},iQt=I({error:Qh,message:w()}).passthrough(),Jne=I({device_code:w(),user_code:w(),verification_uri:w(),verification_uri_complete:w(),expires_in:C().int(),interval:C().int()}).passthrough(),Itt=jI("error",[I({error:Ke("authorization_pending"),message:w()}).passthrough(),I({error:Ke("slow_down"),message:w()}).passthrough()]),Ntt=jI("error",[I({error:Ke("expired_token"),reason:Qh,message:w()}).passthrough(),I({error:Ke("access_denied"),reason:Qh,message:w()}).passthrough(),I({error:Ke("invalid_grant"),reason:Qh,message:w()}).passthrough()]),Yne=Jh([Itt,Ntt]),ZI=I({id:C().int(),name:w().nullable(),prefix:w(),created_at:w(),last_used_at:w().nullable(),current:re()}).passthrough(),Xne=I({api_key:w(),key:ZI,user:I({username:w().nullable(),email:w(),github_username:w().nullable(),role:w(),sandbox_completed:re(),sandbox_dataset_id:w().nullable()}).passthrough()}).passthrough(),aQt=I({user_code:w(),machine_name:w(),requested_at:w(),expires_in:C().int(),account:I({username:w().nullable(),email_masked:w()}).passthrough(),refusal:I({code:Qh,message:w()}).passthrough().nullable()}).passthrough(),cQt=I({ok:Ke(!0),machine_name:w()}).passthrough(),LS=I({keys:J(ZI)}).passthrough(),qS=I({api_key:w(),key:ZI}).passthrough()});function br(e){return rt[e]}function Al(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>Object.hasOwn(t,r)?t[r]:n)}var rt;var Ol=H(()=>{rt={"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","compute_access.section.title":"Compute access","compute_access.section.lede":"A separate grant from upload access. An admin reviews each request against export-control and local-jurisdiction rules and the purpose you state, and a grant opens a starting allocation of service units.","compute_access.state.none":"Not requested","compute_access.state.requested":"Requested","compute_access.state.active":"Active","compute_access.state.suspended":"Suspended","compute_access.state.denied":"Not granted","compute_access.state.revoked":"Ended","compute_access.request.cta":"Request compute access","compute_access.request.form_body":"Tell us what you plan to compute. An admin reviews this alongside your name, affiliation and location, then answers once. You also accept the compute terms.","compute_access.request.purpose_label":"What do you intend to compute?","compute_access.request.purpose_hint":"Describe what you intend to compute in 20-1000 characters","compute_access.request.terms_label":"I accept the compute terms","compute_access.requested.title":"Your compute request is with an admin","compute_access.requested.lede":"An admin is reviewing your request.","compute_access.requested.lede_dated":"An admin is reviewing your request from {date}.","compute_access.requested.body":"We\u2019ll email you when there\u2019s a decision. Everything else on your account keeps working in the meantime.","compute_access.granted.body":"Compute access is active. Your balances are on your compute page, and you submit jobs with the `nemar compute` command line.","compute_access.granted.link":"Open your compute page","compute_access.closed.body":"This request has been answered and cannot be asked again. If you think that is a mistake, contact support and an admin will take another look.","compute_access.suspended.body":"Your compute access is paused. Contact support to find out why or to ask for it to be lifted.","compute_access.terms_unpublished.body":"Compute access is not open yet: the compute terms are not published. Please check back later.","compute_access.docs_link":"How compute access works","compute_page.frozen.body":"Your pools are frozen, so new jobs are refused. Contact support to find out why.","compute_page.units_note":"Amounts are service units (SU).","compute_page.available_note":"Available is granted minus held minus charged and can be negative after an overrun.","compute_page.queue_note":"It describes the queue of the whole platform, not yours, and it is a recent average, not a promise.","compute_page.usage_note":"Net charge by UTC day of the charge, not the day a job was created. A day with no charge has no bar.","compute_page.unreported_note":"NEMAR has not heard from the cluster about this job for a while. It may still finish.","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.compute_access":"to request compute 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.compute_access":"compute 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.affiliation.label":"Affiliation","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.affiliation.set_on.web":"Settings","gap.field.affiliation.set_on.cli":"nemar auth profile set-affiliation","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.","oidc.consent.title":"{client} wants to use your NEMAR account","oidc.consent.acts_as_you":"If you allow it, {client} can act as you on NEMAR in the ways listed below.","oidc.consent.compute_spend":"If you sign in and run compute with this app, it counts against your NEMAR compute allocation.","oidc.consent.scopes_title":"It is asking to:","oidc.consent.scope.openid":"Know which NEMAR account is yours","oidc.consent.scope.profile":"See your name","oidc.consent.scope.email":"See your email address","oidc.consent.scope.orcid":"See your ORCID iD, and whether you proved it by signing in with ORCID","oidc.consent.scope.nemar.account":"See your account type, status and access level","oidc.consent.scope.offline_access":"Keep this access when you are not using it","oidc.consent.scope.compute.read":"See your compute access, balances, usage and jobs","oidc.consent.scope.compute.reserve":"Reserve compute time, report jobs and release reservations for you","oidc.consent.scope.compute.submit":"Submit compute jobs that NEMAR runs for you","oidc.consent.redirect_host":"Either answer sends you to {redirect_host}.","oidc.consent.allow":"Allow","oidc.consent.deny":"Deny","oidc.rule.title":"You can\u2019t sign in to {client} with this account","oidc.rule.account_inactive":"Your NEMAR account is not active.","oidc.rule.account_not_person":"{client} is only for personal accounts, and this account is not one.","oidc.rule.orcid_not_proven":"{client} needs an ORCID iD you proved by signing in to NEMAR with ORCID. Link your ORCID iD in Settings, then try again.","oidc.rule.return":"Return to {client}","oidc.error.title":"This sign-in can\u2019t continue","oidc.error.invalid_client":"The site that sent you here is not one NEMAR signs people in to.","oidc.error.invalid_redirect_uri":"The site that sent you here asked NEMAR to send you to an address it has not registered, so NEMAR will not send you there.","oidc.error.invalid_request":"The sign-in request is incomplete or malformed. Go back to the site you came from and start again.","oidc.error.consent_invalid":"This page has expired. Go back to the site you came from and start again.","oidc.error.unavailable":"NEMAR could not complete this sign-in right now. Try again in a moment.","oidc.error.rate_limited":"Too many sign-in attempts. Try again in a minute.","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.compute_access.cta":"Ask for it with `nemar compute request-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 Mtt(e){return e==="verified"||e==="upload_access"||e==="compute_access"||e==="publication"}function lp(e){return(e??"").trim().length===0}function jtt(e){return e==="service"||e==="test"}function ere(e,t={}){let n=t.orcidVerified===!0,r=Object.hasOwn(BS,e)?BS[e]:void 0;if(!r)return{field:e,label:e,blocks:t.blocks??[],setOnWeb:rt["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:rt[r.labelKey],setOnWeb:rt[o?r.orcidWebKey:r.webKey],setOnCli:o||r.cliKey===null?null:rt[r.cliKey],known:!0}}function Qne(e){let t=eN.indexOf(e);return t===-1?eN.length:t}function tre(e,t={}){return e.map((n)=>ere(n,{orcidVerified:t.orcidVerified}))}function Zh(e,t={}){return e.filter((n)=>!!n&&typeof n.field==="string").map((n)=>{let r=Array.isArray(n.blocks)?n.blocks.filter(Mtt):[];return ere(n.field,{orcidVerified:t.orcidVerified,blocks:r.length>0?r:void 0})}).sort((n,r)=>Qne(n.field)-Qne(r.field))}function tN(e){let t=e.blocks[0],n=t?rt[Ftt[t]]:rt["gap.blocks.unknown"],r=Al(rt["gap.sentence"],{label:"",blocks:n}).trimStart(),o=e.setOnCli?Al(rt["gap.set_on.both"],{web:e.setOnWeb,cli:e.setOnCli}):Al(rt["gap.set_on.web"],{web:e.setOnWeb});return`${r} ${o}`}function HS(e){return`${e.label} ${tN(e)}`}function zS(){let e=Al(rt["gap.sentence"],{label:Zne.label,blocks:rt["cli.gap.blocks.sandbox"]}),t=Al(rt["cli.gap.set_on.cli_only"],{cli:Zne.command});return`${e} ${t}`}function nre(){return rt["cli.gaps.sandbox_unchecked"]}var BS,eN,fQt,Ftt,Zne;var up=H(()=>{Ol();BS={email_verified:{blocks:["verified","upload_access","compute_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&&lp(e.username)},given_name:{blocks:["upload_access","compute_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)=>lp(e.given_name)},family_name:{blocks:["upload_access","compute_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)=>lp(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&&!jtt(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)=>lp(e.github_username)},city:{blocks:["upload_access","compute_access"],labelKey:"gap.field.city.label",webKey:"gap.field.city.set_on.web",cliKey:"gap.field.city.set_on.cli",isMissing:(e)=>lp(e.city)},country:{blocks:["upload_access","compute_access"],labelKey:"gap.field.country.label",webKey:"gap.field.country.set_on.web",cliKey:"gap.field.country.set_on.cli",isMissing:(e)=>lp(e.country)},affiliation:{blocks:["compute_access"],labelKey:"gap.field.affiliation.label",webKey:"gap.field.affiliation.set_on.web",cliKey:"gap.field.affiliation.set_on.cli",isMissing:(e)=>lp(e.affiliation)},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}},eN=Object.keys(BS),fQt=eN.filter((e)=>BS[e].isMissing!==null),Ftt={verified:"gap.blocks.verified",upload_access:"gap.blocks.upload_access",compute_access:"gap.blocks.compute_access",publication:"gap.blocks.publication"};Zne={field:"sandbox",label:rt["cli.gap.field.sandbox.label"],command:rt["cli.gap.field.sandbox.set_on.cli"]}});function KS(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 zo,GS,rre,VS,Ltt,WS,qtt,Utt,Btt,Htt,ztt,hQt,Gtt,gQt,Vtt,yQt;var nN=H(()=>{kn();zo=/^[a-z]{2}[0-9]{6}$/,GS=/^[0-9a-f]{40}$/,rre=I({name:w(),modality:w().nullable().optional(),rate:C().nullable().optional(),n_channels:C().int().nonnegative().nullable().optional(),n_samples:C().int().nonnegative().nullable().optional(),duration_s:C().nonnegative().nullable().optional(),source_rate_hz:C().nullable().optional(),n_view_levels:C().int().nonnegative().optional(),view_chunk_columns:C().int().positive().optional(),chunk_samples:C().int().positive().optional(),shard_samples:C().int().positive().optional()}).passthrough(),VS=I({converted:C().int().nonnegative().optional(),relabelled:C().int().nonnegative().optional(),kept_importer_unit:C().int().nonnegative().optional(),units_column_present:re().optional(),sidecar:w().optional(),sidecar_supplied:re().optional(),unmatched_channels:C().int().nonnegative().optional(),unmatched_case_only:C().int().positive().optional(),matched_case_only:C().int().positive().optional(),matched_case_only_examples:J(w()).max(5).optional(),unmatched_raw_label:C().int().positive().optional(),unmatched_examples:J(w()).max(5).optional()}).passthrough(),Ltt=I({channels_tsv:C().int().positive(),in_file:C().int().nonnegative(),in_store:C().int().nonnegative()}).passthrough(),WS=I({applied:re().optional(),method:w().optional(),calibration:w().optional(),cross_talk:w().optional(),mne_version:w().optional()}).passthrough();qtt=I({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),updated_utc:w().optional(),source_tree:Ke("raw"),derived:re(),modalities:J(w()).optional(),groups:J(rre).optional(),power_line_frequency:C().nullable().optional(),event_description_count:C().int().nonnegative().optional(),n_events:C().int().nonnegative().optional(),trial_types:Yn(w(),C().int().nonnegative()).optional(),units_report:VS.optional(),channels_tsv_read_error:re().optional(),channels_tsv_count_mismatch:Ltt.optional(),split_members:J(w()).optional(),sss:WS.optional()}).passthrough().superRefine(KS),Utt=I({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr").optional(),code:w(),reason:w(),detail:w().nullable().optional(),attempts:C().int().nonnegative().optional()}).passthrough(),Btt=Xe(["infra_failure","memory_budget","not_attempted"]),Htt=I({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),reason:Btt,attempts:C().int().nonnegative(),last_error:w().nullable().optional(),last_attempt_utc:w().nullable().optional()}).passthrough(),ztt=I({level0:Ke("<zarr>/<group>/0"),view:Ke("<zarr>/<group>/view/<L>"),view_levels:Ke("1..n_view_levels from the group attrs"),scale_offset:Ke("level-0 array attrs scale[] and offset[]; physical = digital * scale + offset"),events:Ke("<data_base>events.parquet").optional()}).passthrough(),hQt=I({format:Ke("nemar-zarr-index"),format_version:Ke(3),dataset_id:w().regex(zo,"NEMAR dataset id (nm/on/xx band)"),contract_base:w().regex(/^https:\/\//,"must be https"),data_base:w().regex(/^https:\/\//,"must be https"),data_base_kind:Ke("s3-public"),s3_uri:w().regex(/^s3:\/\//,"must be an s3:// URI"),s3_region:w().min(1),s3_anonymous:re(),source_commit:w().regex(GS,"must be a full 40-hex SHA"),engine_version:w().min(1),biosigio_version:w().nullable().optional(),updated_utc:w(),discovered_count:C().int().nonnegative(),store_count:C().int().nonnegative(),n_recordings:C().int().nonnegative(),errors:C().int().nonnegative(),failure_count:C().int().nonnegative(),pending_count:C().int().nonnegative(),stores:J(qtt),failures:J(Utt),pending:J(Htt),doi:w().nullable().optional(),license:w().nullable().optional(),citation:w().nullable().optional(),hed_version:w().nullable().optional(),events_parquet:w().regex(/^https:\/\//,"must be https").optional(),events_row_count:C().int().nonnegative().optional(),layout:ztt}).passthrough(),Gtt=I({name:w(),configuration:Yn(w(),fi()).optional()}).passthrough(),gQt=I({zarr_format:Ke(3),node_type:Ke("array"),shape:J(C().int().nonnegative()),data_type:w(),chunk_grid:I({name:w(),configuration:Yn(w(),fi()).optional()}).passthrough(),codecs:J(Gtt),fill_value:fi().optional(),attributes:Yn(w(),fi()).optional(),dimension_names:J(w().nullable()).optional()}).passthrough(),Vtt=I({path:w(),zarr:w().regex(/\.zarr$/,"must end in .zarr"),groups:J(rre).optional(),modalities:J(w()).optional()}).passthrough(),yQt=I({format:Ke("nemar-zarr-index"),format_version:C().int(),dataset_id:w().regex(zo,"NEMAR dataset id (nm/on/xx band)"),source_commit:w(),stores:J(Vtt)}).passthrough()});function ore(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 Wtt,Ktt,Jtt,Ytt,Ga,_Qt;var JS=H(()=>{JI();Wtt=["10-05","10-10","10-20","biosemi","egi-geodesic","other"],Ktt=["50","60"],Jtt=["ready","pending","failed"],Ytt=KI.options,Ga=[{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:Ktt},{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:Wtt},{key:"source",flag:"--source",queryParam:"source",valueKind:"enum",label:"Source archive",enumValues:Ytt},{key:"zarr",flag:"--zarr",queryParam:"zarr",valueKind:"enum",label:"Zarr conversion status",enumValues:Jtt},{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"}],_Qt=new Map(Ga.map((e)=>[e.key,e]))});var Xtt,kQt,Qtt,lre,cw,sre,Ztt,ure,ent=20,tnt=100,nnt,dre,rnt,RQt,$Qt,ont,DQt,CQt,snt,int,ant,AQt,cnt=50,lnt=500,OQt,unt,dnt,TQt,fnt=1000,pnt=5000,ire=8,mnt=100,hnt=32,are,PQt,gnt,ynt,bnt,IQt,wnt=800,_nt=4000,NQt,FQt,rN=60,oN=64,cre,xnt=86400,vnt=4096,MQt,Ent,Snt,jQt;var fre=H(()=>{kn();JS();nN();Xtt=I({dataset_id:w().regex(zo),name:w(),doi:w().nullable().optional(),license:w().nullable().optional(),modalities:J(w()).optional(),tasks:J(w()).optional(),subject_count:C().int().nonnegative().nullable().optional(),has_hed:Jh([Ke(0),Ke(1)]).nullable().optional(),hed_version:w().nullable().optional(),store_count:C().int().nonnegative().nullable().optional(),recording_count:C().int().nonnegative().nullable().optional(),recordings_unavailable:C().int().nonnegative().nullable().optional(),total_recording_duration:C().nullable().optional(),zarr_converted_at:w().nullable().optional(),zarr_source_commit:w().nullable().optional(),zarr_errors:C().int().nonnegative().nullable().optional(),zarr_verify_status:Xe(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:w().nullable().optional(),index_url:w().nullable().optional()}).passthrough(),kQt=I({format:Ke("nemar-zarr-catalog"),format_version:C().int(),generated_utc:w(),contract_base:w(),count:C().int().nonnegative(),datasets:J(Xtt)}).passthrough(),Qtt=["verified","failed","unverifiable"],lre=Xe(Qtt).nullable(),cw=I({dataset_id:w().regex(zo),doi:w().nullable(),license:w().nullable(),citation:w().nullable(),source_commit:w().regex(GS),index_etag:w().nullable(),engine_version:w(),source_tree:Ke("raw"),derived:re(),sss:WS.optional(),lossy:re(),dtype:w().nullable(),effective_rate_hz:C().nullable(),source_rate_hz:C().nullable(),units_report:VS.nullable().optional(),zarr_verify_status:lre,note:w().nullable().optional()}).passthrough().superRefine(KS),sre=I({start:C().int().nonnegative(),end:C().int().nonnegative()}).passthrough().refine((e)=>e.end>=e.start,{message:"end must be >= start",path:["end"]}),Ztt=I({python_zarr:w(),zarrita:w(),python_browser:w()}).passthrough(),ure=I({contract_base:w(),data_base:w(),s3_uri:w(),s3_region:w(),s3_anonymous:re(),zarr:w(),group:w(),level:Jh([Ke("0"),C().int().positive()]),array_path:w(),dtype:w().nullable(),codecs:J(fi()).optional(),chunk_samples:C().int().positive().nullable(),shard_samples:C().int().positive().nullable(),n_channels:C().int().nonnegative().nullable(),sample_slice:sre.optional(),channel_slice:sre.optional(),scale_offset:w(),how_to:Ztt}).passthrough(),nnt=Object.fromEntries(Ga.map((e)=>[e.queryParam,w().optional()])),dre={modality:w().optional(),task:w().optional(),has_hed:re().optional(),has_zarr:re().optional(),author:w().optional(),has_doi:re().optional(),has_zarr_verified:re().optional(),data_complete:re().optional(),recent:C().int().positive().optional(),license:w().optional()},rnt=Object.keys(dre),RQt=[...rnt,...Ga.map((e)=>e.queryParam)],$Qt=I({query:w().optional(),...dre,include_unknown:re().optional(),...nnt,limit:C().int().positive().max(tnt).default(ent)}).passthrough(),ont=I({dataset_id:w().regex(zo),name:w(),doi:w().nullable().optional(),license:w().nullable().optional(),modalities:J(w()).optional(),tasks:J(w()).optional(),subject_count:C().int().nullable().optional(),has_hed:re().nullable().optional(),has_zarr:re()}).passthrough(),DQt=I({results:J(ont),count:C().int().nonnegative(),limit:C().int(),note:w().nullable().optional(),truncated:re().optional()}).passthrough(),CQt=I({dataset_id:w().regex(zo)}).passthrough(),snt=["list_recordings","get_events","render_overview","read_window"],int=I({next_cheapest_tool:Xe(snt),reason:w()}).passthrough(),ant=["pending","ready","failed"],AQt=I({dataset_id:w().regex(zo),name:w(),doi:w().nullable(),license:w().nullable(),citation:w().nullable(),modalities:J(w()).optional(),tasks:J(w()).optional(),subject_count:C().int().nullable().optional(),has_hed:re().nullable().optional(),hed_version:w().nullable().optional(),recording_count:C().int().nullable().optional(),total_recording_duration_s:C().nullable().optional(),zarr_status:Xe(ant).nullable().optional(),zarr_verify_status:lre.optional(),zarr_source_commit:w().nullable().optional(),zarr_store_count:C().int().nullable().optional(),cost_hint:int}).passthrough(),OQt=I({dataset_id:w().regex(zo),modality:w().optional(),min_duration_s:C().nonnegative().optional(),include_derived:re().default(!1),limit:C().int().positive().max(lnt).default(cnt),offset:C().int().nonnegative().default(0)}).passthrough(),unt=I({name:w(),modality:w().nullable().optional(),rate:C().nullable().optional(),n_channels:C().int().nullable().optional(),duration_s:C().nullable().optional(),n_view_levels:C().int().nonnegative().nullable().optional(),n_samples:C().int().nonnegative().nullable().optional(),view_chunk_columns:C().int().positive().nullable().optional()}).passthrough(),dnt=I({path:w(),zarr:w(),source_tree:Ke("raw"),derived:re(),groups:J(unt).optional(),n_events:C().int().nonnegative().optional(),sss:WS.optional(),units_report:VS.optional()}).passthrough().superRefine(KS),TQt=I({dataset_id:w().regex(zo),source_commit:w().regex(GS).nullable(),recordings:J(dnt),total_count:C().int().nonnegative(),excluded_derived_count:C().int().nonnegative(),limit:C().int(),offset:C().int(),index_format_version:C().int(),discovered_count:C().int().nonnegative().nullable(),failure_count:C().int().nonnegative().nullable(),pending_count:C().int().nonnegative().nullable(),excluded_legacy_non_raw_count:C().int().nonnegative(),note:w().nullable().optional(),envelope:cw.optional()}).passthrough(),are=w().min(1).max(64),PQt=I({dataset_id:w().regex(zo),recording:w(),group:w().optional(),limit:C().int().positive().max(pnt).default(fnt),offset:C().int().nonnegative().default(0),where:Yn(are,J(Jh([w(),C()])).min(1).max(mnt)).refine((e)=>{let t=Object.keys(e).length;return t>=1&&t<=ire},{message:`where names 1 to ${ire} columns`}).optional(),columns:J(are).min(1).max(hnt).optional()}).passthrough(),gnt=I({store_path:w(),group_name:w(),onset_s:C(),duration_s:C().nullable().optional(),sample_index:C().int().nonnegative(),trial_type:w().nullable().optional(),value:Jh([w(),C()]).nullable().optional(),hed:w().nullable().optional()}).passthrough(),ynt=gnt.partial().required({onset_s:!0,sample_index:!0}),bnt=I({name:w(),distinct_count:C().int().nonnegative(),null_count:C().int().nonnegative(),values:J(I({value:w(),count:C().int().positive()}).passthrough()).nullable()}).passthrough(),IQt=I({dataset_id:w().regex(zo),recording:w(),events:J(ynt),source:Xe(["events_parquet","events_tsv_fallback"]),estimated:re(),total_count:C().int().nonnegative(),limit:C().int(),offset:C().int(),truncated:re(),note:w().nullable().optional(),columns_summary:J(bnt).optional(),envelope:cw.optional()}).passthrough(),NQt=I({dataset_id:w().regex(zo),recording:w(),group:w().optional(),width_px:C().int().positive().max(_nt).default(wnt)}).passthrough(),FQt=I({dataset_id:w().regex(zo),recording:w(),group:w(),level:C().int().positive(),width_px:C().int().positive(),height_px:C().int().positive(),mime_type:Ke("image/png"),columns_read:C().int().nonnegative(),chunks_read:C().int().nonnegative(),bytes_read:C().int().nonnegative(),envelope:cw.optional()}).passthrough(),cre=rN*oN,MQt=I({dataset_id:w().regex(zo),recording:w(),group:w().optional(),start_s:C().nonnegative().default(0),duration_s:C().positive().max(xnt).default(10),channels:J(C().int().nonnegative()).max(vnt).optional(),taste:re().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>rN)t.addIssue({code:ee.custom,message:`taste duration_s (${e.duration_s}) exceeds the ${rN} s cap; omit taste for a recipe instead`,path:["duration_s"]});if(e.channels.length>oN)t.addIssue({code:ee.custom,message:`taste channels (${e.channels.length}) exceeds the ${oN}-channel cap; omit taste for a recipe instead`,path:["channels"]});let n=e.duration_s*e.channels.length;if(n>cre)t.addIssue({code:ee.custom,message:`taste exceeds the cap of ${cre} channel-seconds (duration_s x channels = ${n}); omit taste for a recipe instead`,path:["duration_s"]})}),Ent=I({mode:Ke("recipe"),recipe:ure,envelope:cw}).passthrough(),Snt=I({mode:Ke("taste"),start_s:C(),duration_s:C(),channels:J(C().int()),sample_rate_hz:C(),values:J(J(C())),recipe:ure,chunks_read:C().int().nonnegative(),bytes_read:C().int().nonnegative(),filled_ranges:J(I({start_sample:C().int().nonnegative(),end_sample:C().int().nonnegative(),start_s:C(),end_s:C()}).passthrough()),note:w().nullable().optional(),envelope:cw}).passthrough(),jQt=jI("mode",[Ent,Snt])});function hre(e){let t=lw.indexOf(e);if(t<0)throw RangeError("not a launcher failure code");return Rnt+t}var dp,id,pre,knt,UQt,lw,mre=0,Rnt=10,$nt,Dnt,Cnt,BQt,HQt,sN,gre,yre,YS,XS,bre;var Tl=H(()=>{dp=/^[a-z0-9_]{1,64}$/,id=["created","uploading","submitted","queued","running","archiving","finished","failed","cancelled","unreported"],pre=["finished","failed","cancelled"],knt=["created","uploading","submitted","queued","running","archiving","unreported"],UQt=knt.filter((e)=>e!=="created"&&e!=="uploading"&&e!=="unreported"),lw=["code_fetch_failed","dataset_fetch_failed","entry_not_found","runtime_error","out_of_memory","time_limit","result_upload_failed"];$nt=["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","tapis_record_lost"],Dnt=["upload_expired"],Cnt=["results_too_large","results_quota_exceeded","too_many_outputs"],BQt={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:[...Cnt,"outputs_unreadable","bad_response","fetch_failed","incomplete_plan","upload_failed","outputs_refused","complete_refused","internal_error"]},HQt=[...lw,...$nt.filter((e)=>!lw.includes(e)),...Dnt],sN={no_compute_access:403,suspended:403,insufficient_balance:409,over_job_limit:422,over_concurrency:409,platform_budget_exhausted:409,client_cap_reached:409,invalid_spec:400,partition_not_offered:422,runtime_unavailable:422,registry_not_allowed:422,compute_disabled:503,dataset_not_eligible:422,recipe_unknown:422,pipelines_account_missing:503,live_attempt_exists:409,bundle_too_large:413,bundle_too_many_files:413,results_too_large:413,results_quota_exceeded:409,too_many_outputs:413,results_expired:410,job_not_found:404,bad_state:409,guard_refused:409,results_incomplete:409,policy_unavailable:503,version_not_found:404,version_untagged:422,too_many_files:422,entry_not_in_bundle:422,bundle_incomplete:409,idempotency_conflict:422,logs_not_available:404,upload_expired:409,storage_unavailable:503},gre={job_not_found:"No such job.",bad_state:"The job is not in a state that accepts this.",results_expired:"The results of this job have expired.",compute_disabled:"Compute storage is not configured.",invalid_spec:"The request is not valid.",too_many_outputs:"The job declared more output files than the owner's limit allows.",results_too_large:"The job's results are over the size limit.",results_quota_exceeded:"There is no room left in the results budget for this job.",results_incomplete:"An object the job declared is missing or short; upload it and ask again.",policy_unavailable:"The platform could not read its limits just now; ask again shortly."},yre=["batch","interactive"],YS=["unreserved","unattributed","mismatch","overrun"],XS=["pending","attempting","sent","failed"],bre=["job","account"]});function fp(e,t=512){return typeof e==="string"&&e.length>=1&&e.length<=t&&xre.test(e)&&!rg.test(e)}function dN(e){if(typeof e!=="string")return null;let t=/^[0-9]/.test(e)?`v${e}`:e;return t.length<=uN&&lN.test(t)?t:null}function vre(e){let t=e.findIndex((n)=>dN(n.version)===null);return t<0?null:`datasets.${t}.version`}function mN(e){return w().max(e).regex(xre).refine((t)=>!rg.test(t),{message:"a path may not hold . or .. segments"})}function gN(e){if(e!==null&&typeof e==="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))gN(t)}return e}function tg(e,t,n){if(typeof t!=="number"||!Number.isSafeInteger(t)||t<n)throw RangeError(`${e} must be a whole number of at least ${n}`);return BigInt(t)}function iN(e,t){return(e+t-1n)/t}function Int(e,t,n){if(!Object.hasOwn(ng,e))throw RangeError("not a partition");let r=ng[e],o=tg("nodes",t.nodes,1),s=tg("cores",t.cores??0,0),i=tg("memory_mb",t.memory_mb??0,0),a=tg("gpus",t.gpus??0,0),c=tg("seconds",n,0),l=Pnt,d=BigInt(l.milliPerSu),f;switch(r.rate){case"core_or_memory":{if(s===0n&&i===0n)throw RangeError("a rate needs cores or memory");let x=s*d,v=iN(i*d,BigInt(l.memoryMbPerCoreUnit));f=x>v?x:v;break}case"whole_cpu_node":f=BigInt(l.cpuNodeCores)*d;break;case"gpu_or_memory":{if(a===0n&&i===0n)throw RangeError("a rate needs GPUs or memory");let x=a*d,v=iN(i*d,BigInt(l.memoryMbPerGpuUnit));f=x>v?x:v;break}case"whole_gpu_node":f=BigInt(l.gpuNodeGpus)*d;break}let p=f*o,m=r.preempt?BigInt(l.preemptNumerator):1n,h=r.preempt?BigInt(l.preemptDenominator):1n,g=iN(p*c*m,3600n*h),y=BigInt(l.minChargeMilli),b=g<y?y:g;if(b>BigInt(fN))throw RangeError("amount too large to hold exactly");return Number(b)}function kre(e){let t=tg("minutes",e.minutes,0);return Int(e.partition,e,Number(t*60n))}function Rre(e){if(typeof e!=="string")return null;let t=Nnt.exec(e);if(!t)return null;let n=BigInt(t[1])*1000n+BigInt((t[2]??"").padEnd(3,"0"));if(n>BigInt(fN))return null;return Number(n)}function fr(e){if(!Number.isSafeInteger(e))throw RangeError("an amount is a whole number of milli-SU");let t=Math.abs(e),n=Math.floor(t/1000),r=t%1000,o=r===0?"":`.${String(r).padStart(3,"0").replace(/0+$/,"")}`;return`${e<0?"-":""}${n}${o}`}function jnt(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 Bnt(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 Hnt(e,t){let n=jnt(e);if(n!==null)t.addIssue({code:ee.custom,message:`an include pattern the dialect refuses: ${n}`})}function eg(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 Wnt(e){let t=0;if(e.entry!==void 0)t+=eg(e.entry)+1;for(let n of e.command??[])t+=eg(n)+1;for(let n of e.args??[])t+=eg(n)+1;for(let n of e.datasets??[])for(let r of n.include??[])t+=eg(r)+1;for(let[n,r]of Object.entries(e.env??{}))if(r!==void 0)t+=eg(n)+eg(r)+2;return t}var cN="\\u0000-\\u001f\\u007f",tk,wre,xre,rg,Ant,Ont,uw=1e5,Qi,Va,nk,pp,rk,lN,uN=64,fN,Pl=(e,t=fN)=>C().int().min(e).max(t),It,pN,ZS,Ere,hN,Sre,dw,Tnt,QS=2880,ng,Pnt,Nnt,og,fw,Fnt,yN,Mnt,bN="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.",wN="An argument vector, run as given, with args appended.",_N="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.",xN="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).",Lnt,qnt,Unt,sg,ek=(e)=>e.refine(Bnt,{message:"a lone surrogate is not text a process argument can carry"}),znt,Gnt,Vnt,Knt=49152,ig,Jnt,Ynt,Xnt,Qnt,$re,aN=1073741824,_re=1048576,WQt,Znt,KQt,Dre,JQt,ert,YQt;var ao=H(()=>{kn();Tl();tk=`[^/\\\\${cN}]+`,wre=tk,xre=new RegExp(`^(?:${wre}/)*${wre}$`),rg=/(?:^|\/)\.\.?(?:\/|$)/,Ant=new RegExp(`^[^\\\\${cN}]+$`),Ont=/^\/|(?:^|\/)\.\.(?:\/|$)/;Qi=/^job_[0-9a-f]{24}$/,Va=/^[0-9a-f]{64}$/,nk=/^sha256:[0-9a-f]{64}$/,pp=/^[a-z]{2}[0-9]{6}$/,rk=/^[0-9A-Za-z][0-9A-Za-z._+-]{0,63}$/,lN=/^(?:latest|v[0-9]+\.[0-9]+\.[0-9]+)$/;fN=Number.MAX_SAFE_INTEGER,It=Pl,pN=w().regex(Qi),ZS=w().regex(Va);Ere=mN,hN=w().max(256).regex(Ant).refine((e)=>!Ont.test(e),{message:"a pattern may not leave the dataset"});Sre=["cpu","gpu"],dw=["shared","compute","debug","large-shared","preempt","gpu-shared","gpu","gpu-debug","gpu-preempt"],Tnt=I({maxNodes:It(1,64),maxCoresPerNode:It(0,256),maxGpusPerNode:It(0,8),maxMinutes:It(1,10080)}).strict(),ng=gN({shared:{pool:"cpu",rate:"core_or_memory",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:64,maxGpusPerNode:0,maxMinutes:QS}},compute:{pool:"cpu",rate:"whole_cpu_node",preempt:!1,ceiling:{maxNodes:2,maxCoresPerNode:128,maxGpusPerNode:0,maxMinutes:QS}},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:QS}},gpu:{pool:"gpu",rate:"whole_gpu_node",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:40,maxGpusPerNode:4,maxMinutes:QS}},"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}}),Pnt={version:1,milliPerSu:1000,cpuNodeCores:128,gpuNodeGpus:4,memoryMbPerCoreUnit:2048,memoryMbPerGpuUnit:94208,preemptNumerator:800,preemptDenominator:1000,minChargeMilli:1000};Nnt=/^([0-9]+)(?:\.([0-9]{1,3}))?$/;og=["result.json","provenance.json","manifest.json","launcher.log"],fw=["OMP_NUM_THREADS","MKL_NUM_THREADS","OPENBLAS_NUM_THREADS","NUMEXPR_NUM_THREADS","PYTHONHASHSEED","MPLBACKEND"],Fnt=/^[ -~]*$/,yN=w().max(256).regex(Fnt),Mnt=Yn(Xe(fw),yN);Lnt=["python","matlab","image"],qnt=/^[A-Za-z0-9][A-Za-z0-9 ._-]{0,79}$/,Unt=/^[a-z][a-z0-9-]{0,63}$/,sg=/^(?:docker:\/\/)?[a-z0-9]+(?:[._-][a-z0-9]+)*(?::[0-9]{1,5})?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)+@sha256:[0-9a-f]{64}$/;znt=I({size:It(1),sha256:ZS}).strict(),Gnt=I({id:w().regex(pp),version:w().regex(rk),include:J(ek(hN).superRefine(Hnt)).max(64).optional().describe(xN)}).strict(),Vnt=ek(w().max(1024));ig=I({name:w().regex(qnt),runtime:Xe(Lnt),entry:ek(Ere(240)).optional().describe(bN),command:J(ek(w().min(1).max(1024))).min(1).max(64).optional().describe(wN),args:J(Vnt).max(64).default([]).describe(_N),bundle:znt.optional(),datasets:J(Gnt).max(20).default([]),partition:Xe(dw),nodes:It(1,64).default(1),cores:It(1,256).default(1),memory_mb:It(1,16777216).optional(),gpus:It(0,8).default(0),minutes:It(1,10080),output_dir:Ke("outputs").default("outputs"),env:Mnt.default({}),recipe:w().regex(Unt).optional(),image:w().max(512).regex(sg).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(Wnt(e)>Knt)t.addIssue({code:ee.custom,path:[],message:"the entry, command, arguments, patterns and environment are too large to launch"});let r=ng[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")}),Jnt=/^[A-Za-z0-9_.-]{1,64}$/,Ynt=/^[a-z0-9]+(?:[.-][a-z0-9]+)*(?::[0-9]{1,5})?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)*$/,Xnt=Object.fromEntries(dw.map((e)=>[e,Tnt.optional()])),Qnt=I({maxOpenReservations:It(0,1e5),maxReservedMilliPerDay:It(0)}).strict(),$re=I({defaultGrantMilli:I({cpu:It(0),gpu:It(0)}).strict(),renewal:I({enabled:re(),everyDays:It(1,366).nullable()}).strict().refine((e)=>!e.enabled||e.everyDays!==null,{message:"renewal that is on says how often",path:["everyDays"]}),ceilings:I(Xnt).strict(),maxLiveJobsPerPerson:It(0,1000),pipelines:I({dailyJobCap:It(0,1e5),maxLiveJobs:I({cpu:It(0,1000),gpu:It(0,1000)}).strict()}).strict(),clients:Yn(w().regex(Jnt),Qnt),reservationWaitMinutes:It(1,1440),retention:I({recordsYears:It(1,30),logsDays:It(1,3650),resultsDays:It(14,365)}).strict(),resultLimits:I({maxJobBytes:It(1),maxFiles:It(1,uw),maxStoredBytesPerPerson:It(1),maxStoredBytesTotal:It(1)}).strict(),settle:I({toleranceMilli:It(0),tolerancePercent:It(0,100)}).strict(),registries:J(w().max(255).regex(Ynt)).max(64),bundleLimits:I({maxTotalBytes:It(1),maxFiles:It(1,1e5),maxFileBytes:It(1)}).strict(),partner:I({tapisVisibilityConfirmed:re(),execSystemId:w().regex(/^[A-Za-z0-9._-]{1,80}$/).optional(),allowedSchedulerArgs:J(w().regex(/^[-A-Za-z0-9=_.:,@/]{1,100}$/).refine((e)=>!e.startsWith("--gpus")&&!e.startsWith("--gres"),{message:"GPUs are bounded by the hold, never allowed by name"})).max(20).optional()}).strict().refine((e)=>!e.tapisVisibilityConfirmed||e.execSystemId!==void 0,{message:"a confirmed partner names the execution system",path:["execSystemId"]}).optional()}).strict(),WQt=gN({defaultGrantMilli:{cpu:0,gpu:0},renewal:{enabled:!1,everyDays:null},ceilings:Object.fromEntries(dw.flatMap((e)=>{let t=ng[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*aN,maxFiles:5000,maxStoredBytesPerPerson:50*aN,maxStoredBytesTotal:1024*aN},settle:{toleranceMilli:1000,tolerancePercent:5},registries:[],bundleLimits:{maxTotalBytes:100*_re,maxFiles:2000,maxFileBytes:25*_re}}),Znt=I({path:Ere(512),size:It(0),sha256:ZS}).strict(),KQt=I({job_id:pN,files:J(Znt).max(uw)}).strict(),Dre=C().int().min(-255).max(255).nullable(),JQt=I({job_id:pN,failure_code:Xe(lw).nullable(),detail:w().regex(dp).nullable(),exit_number:C().int(),entry_exit_code:Dre}).strict().superRefine((e,t)=>{let n=e.failure_code===null?mre:hre(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"})}),ert=I({id:w().regex(pp),version:w().regex(rk),mode:Xe(["bind","download"]),files:It(0),bytes:It(0)}).strict(),YQt=I({job_id:pN,launch_spec_digest:ZS,bundle_digest:ZS.nullable(),image:I({uri:w().regex(/^[^\s]{1,512}$/),digest:w().regex(nk)}).strict(),runtime_version:w().regex(new RegExp(`^[^${cN}]{1,128}$`)),staging:J(ert).max(20),timings:Yn(w().regex(dp),C().finite().min(0)).refine((e)=>Object.keys(e).length<=16,{message:"at most 16 phases"}),slurm_job_id:w().regex(/^[0-9A-Za-z_+.-]{1,64}$/).nullable(),entry_exit_code:Dre}).strict()});var Cre,QQt;var Are=H(()=>{Cre=["dispatched","succeeded","failed","refused"],QQt=Object.freeze([Object.freeze({name:"nemar-floor",version:"1.0.0",appId:"nemar-launch",appVersion:"1.0.0",engine:"eegprep@0.5.0",partition:"shared",nodes:1,cores:4,memoryMb:16384,gpus:0,minutes:360,autoDispatch:!0,eligibility:"eeg"}),Object.freeze({name:"nemar-ica",version:"1.0.0",appId:"nemar-launch",appVersion:"1.0.0",engine:"eegprep@0.5.0",partition:"gpu-shared",nodes:1,cores:10,gpus:1,minutes:720,autoDispatch:!1,placeholder:!0,eligibility:"eeg"})])});function Tre(e){return vN.includes(e)}var trt="pipelines",nrt="people",vN,ok,pw=200,Zi,EN,rrt,Pre,Ire,Nre,SN,Fre,pi,kN,RN,$N=100,Mre=10,sk,DN=200,ort,rZt,srt,jre,irt,Lre,ik=8,ak=200,qre,Ure,Ore,Bre,Hre,zre,Gre,Vre,Wre,CN,Kre,Jre,Yre,Xre;var ag=H(()=>{kn();Are();Tl();vN=[trt,nrt];ok=["granted","charged"],Zi=C().int(),EN=I({id:C().int(),holder_kind:w(),holder_ref:w(),pool:w(),granted_milli:Zi,held_milli:Zi,charged_milli:Zi,available_milli:Zi,frozen:re(),created_at:w(),updated_at:w()}).passthrough(),rrt=I({id:C().int(),kind:w(),pool_id:C().int(),budget_pool_id:C().int().nullable(),granted_delta_milli:Zi,held_delta_milli:Zi,charged_delta_milli:Zi,job_id:w().nullable(),hold_ref:C().int().nullable(),reason:w().nullable(),actor_user_id:C().int().nullable(),created_at:w()}).passthrough(),Pre=I({pools:J(EN),next_after:C().int().nullable()}).passthrough(),Ire=I({account_id:C().int(),pools:J(EN)}).passthrough(),Nre=I({pool:EN,entry:rrt,replayed:re()}).passthrough(),SN=I({version:C().int().nullable(),is_default:re(),policy:I({}).passthrough(),set_by:C().int().nullable(),note:w().nullable(),created_at:w().nullable()}).passthrough(),Fre=I({switches:I({environment:w(),compute_enabled:re(),pipelines_dispatch_enabled:re()}).passthrough(),tapis:I({configured:re(),strategy:w().nullable(),problems:J(w()),token:w(),health:w()}).passthrough(),storage:I({records_binding:re(),results_binding:re(),signing_configured:re()}).passthrough(),access:I({key_configured:re(),resource_name_configured:re().optional()}).passthrough(),runtime_image:I({set:re(),valid:re(),digest:w().nullable()}).passthrough().optional(),prerequisites:I({callback_secret:re(),api_base_url:re(),pipelines_account:re(),policy_set:re(),people_pool_granted:re(),pipelines_pool_granted:re()}).passthrough().optional(),reconciliation:I({paused:re()}).passthrough().optional(),attention:Yn(fi()).optional()}).passthrough(),pi=w().nullable(),kN=I({id:w(),account_id:C().int().nullable(),source:w(),kind:w(),state:w(),tapis_status:pi,failure_code:pi,failure_detail:pi,platform_failure:re(),cancel_requested:re(),cancel_reason:pi,partition:w(),pool:w(),held_milli:Zi,charged_milli:Zi,settled:re(),flags:J(w()),created_at:w(),submitted_at:pi,started_at:pi,ended_at:pi,tapis_synced_at:pi,outputs_completed:re(),results_verified:re(),results_bytes:C().int().nullable(),records_copied:re(),partner_state:pi.optional(),partner_flag:pi.optional()}).passthrough(),RN=I({ok:re(),outcome:w(),submit:w().optional(),job:kN.nullable()}).passthrough(),sk=Cre,ort={recipe_not_automatic:422,recipe_placeholder:422,registry_drift:409,create_failed:502,run_failed:500},rZt={...sN,...ort},srt=I({dataset_id:w(),ok:re(),version:w().optional(),job_id:w().optional(),stamp_id:C().int().optional(),attempt:C().int().optional(),submit:w().optional(),code:w().optional(),blocked_by:J(w()).optional()}).passthrough(),jre=I({ok:re(),dry_run:re(),recipe:w(),results:J(srt).optional(),dispatched:C().int().optional(),stopped_by:w().nullable().optional(),audit_pending:re().optional(),estimate_milli_per_job:Zi.optional(),estimate_milli_total:Zi.optional(),config:I({compute_enabled:re(),runtime_image:re(),pipelines_account:re()}).passthrough().optional(),would_dispatch:J(I({dataset_id:w(),version:w()}).passthrough()).optional(),blocked:I({code:w(),blocked_by:J(w()),version:w().optional()}).passthrough().optional(),blocked_by_term:Yn(fi()).optional()}).passthrough(),irt=I({id:C().int(),dataset_id:w(),version:w(),recipe:w(),recipe_version:w(),engine:w(),attempt:C().int(),state:w(),job_id:pi,refusal_code:pi,created_at:w(),updated_at:w()}).passthrough(),Lre=I({stamps:J(irt),next_before:C().int().nullable()}).passthrough(),qre=I({jobs:J(kN),next_after:C().int().nullable()}).passthrough(),Ure=I({rows:J(I({slurm_job_id:w(),partition:w(),state:w(),elapsed_seconds:C().int(),alloc_nodes:C().int(),alloc_cpus:C().int(),alloc_gpus:C().int(),charged_milli:C().int().nullable(),ingested_at:w()}).passthrough()),total:C().int()}).passthrough(),Ore=["ok","missing","unreadable"],Bre=I({job:kN,identifiers:I({}).passthrough(),ledger:J(I({}).passthrough()),provenance:I({}).passthrough().nullable(),provenance_status:Xe(Ore).optional(),manifest:I({files:C().int(),bytes:C().int()}).passthrough().nullable(),manifest_status:Xe(Ore).optional(),legal_hold:re(),retention_until:w().nullable().optional(),launcher_files:J(w()).optional()}).passthrough(),Hre=I({job_id:w(),name:w(),kind:w(),content:fi().optional(),url:w().optional(),expires_at:w().optional()}).passthrough(),zre=I({account_id:C().int(),from:w(),to:w(),totals:I({jobs:C().int(),charged_milli:C().int(),unsettled:C().int().optional(),open_hold_milli:C().int().optional()}).passthrough(),by_pool:Yn(I({}).passthrough()),jobs:J(I({}).passthrough()),truncated:re()}).passthrough(),Gre=I({quarter:w(),rows:J(I({partition:w(),source:w(),distinct_users:C().int(),jobs:C().int()}).passthrough()),totals:I({distinct_users:C().int(),jobs:C().int()}).passthrough()}).passthrough(),Vre=I({id:C().int(),scope:w(),ref:w(),reason:w(),placed_by:C().int(),placed_at:w(),released_at:w().nullable()}).passthrough(),Wre=I({holds:J(Vre),truncated:re().optional()}).passthrough(),CN=I({hold:Vre}).passthrough(),Kre=I({rows:J(I({job_id:w(),state:w(),attempts:C().int(),last_error_code:w().nullable(),next_attempt_at:w(),sent_at:w().nullable(),created_at:w()}).passthrough()),failed_by_word:Yn(fi()),next_after:w().nullable()}).passthrough(),Jre=I({ok:re(),job_id:w(),previous:w().nullable()}).passthrough(),Yre=I({run_id:w(),token:w(),expires_in_minutes:C().int()}).passthrough(),Xre=I({job_id:w(),to_account_id:C().int(),pool:w(),moved_milli:C().int(),replayed:re(),attributed_account_id:C().int().nullable().optional(),owner_proven:re().optional()}).passthrough()});function Qre(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<32&&n!==9&&n!==10||n===127)return!0}return!1}var ck=20,mw=1000,iZt,art,Zre,eoe,hw=500,lk=200,toe,noe,crt,roe;var mp=H(()=>{kn();iZt=I({purpose:w().max(mw*4).optional().default(""),accept_terms_version:w().max(64).optional().default("")}),art=Xe(["purpose_required","terms_not_accepted","email_not_verified","orcid_not_proven","profile_incomplete","access_closed","already_active","terms_unpublished"]),Zre=art.options,eoe=I({ok:Ke(!0),already_requested:re(),requested_at:w().nullable().optional(),email_sent:re().optional(),admins_notified:C().int().nullable().optional()}).passthrough(),toe=I({id:C().int(),username:w().nullable(),email:w(),given_name:w().nullable().optional(),family_name:w().nullable().optional(),affiliation:w().nullable().optional(),city:w().nullable().optional(),country:w().nullable().optional(),orcid:w().nullable().optional(),account_kind:w().optional(),compute_access:w(),compute_access_requested_at:w().nullable().optional(),compute_access_notified_at:w().nullable().optional(),compute_access_granted_at:w().nullable().optional(),compute_access_granted_by:C().int().nullable().optional(),compute_purpose:w().nullable().optional(),compute_terms_version:w().nullable().optional(),compute_terms_accepted_at:w().nullable().optional()}).passthrough(),noe=I({accounts:J(toe),next_after:C().int().nullable().optional()}).passthrough(),crt=I({granted:re(),cpu_milli:C().int(),gpu_milli:C().int(),reason:w().nullable().optional(),policy_version:C().int().nullable().optional()}).passthrough(),roe=I({decision:w(),from:w(),to:w(),account:toe,allocation:crt.optional(),email_sent:re().optional()}).passthrough()});var cg="2026-11-draft";var AN=()=>{};var gw=100,ON=25,lrt,uZt,Wa,pr,ooe,urt,drt,soe,frt,prt,ioe,aoe,coe,dZt;var uk=H(()=>{kn();lrt={forbidden_credential:403,insufficient_scope:403,invalid_token:401,missing_credential:401,invalid_range:400,invalid_group:400,invalid_state:400,invalid_limit:400,invalid_cursor:400,job_not_found:404,policy_unavailable:503},uZt=Object.keys(lrt),Wa=w().nullable(),pr=C().int().nonnegative(),ooe=I({granted_milli:pr,held_milli:pr,charged_milli:pr,available_milli:C().int()}).passthrough(),urt=I({name:w(),pool:w(),max_nodes:pr,max_cores_per_node:pr,max_gpus_per_node:pr,max_minutes:pr}).passthrough(),drt=I({partition:w(),median_seconds:C().int().nonnegative().nullable(),p90_seconds:C().int().nonnegative().nullable(),count:pr,window_days:pr}).passthrough(),soe=I({access:I({state:w(),requested_at:Wa,granted_at:Wa,terms_version:Wa,current_terms_version:w(),terms_published:re(),requests_open:re().optional()}).passthrough(),pools:I({cpu:ooe,gpu:ooe}).passthrough(),frozen:re(),limits:I({partitions:J(urt),max_live_jobs:pr,results_days:pr}).passthrough(),queue:J(drt)}).passthrough(),frt=I({day:w().optional(),app:Wa.optional(),partition:Wa.optional(),source:Wa.optional(),charged_milli:C().int(),jobs:pr}).passthrough(),prt=I({from:w(),to:w(),group:J(w()),rows:J(frt)}).passthrough(),ioe=I({id:w(),kind:w(),source:w(),state:w(),app_id:w(),app_version:w(),partition:w(),pool:w(),resources:I({nodes:pr,cores_per_node:pr,memory_mb:C().int().nonnegative().nullable(),gpus:pr,minutes:pr}).passthrough(),created_at:w(),started_at:Wa,ended_at:Wa,charged_milli:C().int().nonnegative(),failure_code:Wa,cancel_requested:re()}).passthrough(),aoe=I({jobs:J(ioe),next_after:Wa}).passthrough(),coe=I({job:ioe,stale:re().optional()}).passthrough(),dZt=I({from:w(),to:w(),by_day_partition_source:J(I({day:w(),partition:w(),source:w(),charged_milli:C().int(),jobs:pr}).passthrough()),active_people:pr,jobs_by_outcome:I({finished:pr,failed:pr,cancelled:pr}).passthrough()}).passthrough()});function TN(e,t=lg,n){if(!Array.isArray(e)||e.length===0)return{ok:!1,code:"invalid_spec",field:"files"};if(e.length>t.maxFiles)return{ok:!1,code:"bundle_too_many_files"};let r=new Set,o=0;for(let s=0;s<e.length;s++){let i=e[s];if(typeof i!=="object"||i===null||Array.isArray(i))return{ok:!1,code:"invalid_spec",field:`files.${s}`};let a=i;if(Object.keys(a).some((c)=>c!=="path"&&c!=="size"&&c!=="sha256"))return{ok:!1,code:"invalid_spec",field:`files.${s}`};if(typeof a.path!=="string"||!fp(a.path,yw))return{ok:!1,code:"invalid_spec",field:`files.${s}.path`};if(r.has(a.path))return{ok:!1,code:"invalid_spec",field:`files.${s}.path`};if(r.add(a.path),typeof a.size!=="number"||!Number.isSafeInteger(a.size)||a.size<0)return{ok:!1,code:"invalid_spec",field:`files.${s}.size`};if(typeof a.sha256!=="string"||!Va.test(a.sha256))return{ok:!1,code:"invalid_spec",field:`files.${s}.sha256`};if(a.size>t.maxFileBytes)return{ok:!1,code:"bundle_too_large"};if(o+=a.size,o>t.maxTotalBytes)return{ok:!1,code:"bundle_too_large"}}if(n!==void 0&&!r.has(n))return{ok:!1,code:"entry_not_in_bundle"};return{ok:!0}}var loe=1048576,mrt,uoe=2000,hrt,yw=240,mZt,lg;var dk=H(()=>{ao();mrt=100*loe,hrt=25*loe,mZt=uoe*1200+65536,lg=Object.freeze({maxTotalBytes:mrt,maxFiles:uoe,maxFileBytes:hrt})});var doe="Idempotency-Key",foe="X-Nemar-Truncated",grt,poe,moe,yrt,PN,bZt,IN;var fk=H(()=>{kn();Tl();grt=I({url:w(),method:Ke("PUT"),headers:Yn(w()),expires_at:w(),size:C().int().nonnegative()}).passthrough(),poe=I({job_id:w(),state:w(),tag:w(),name:w(),upload:grt.optional(),replayed:Ke(!0).optional()}).passthrough(),moe=I({job_id:w(),state:w(),name:w().optional(),submitted:re(),replayed:re()}).passthrough(),yrt=I({path:w(),size:C().int().nonnegative(),sha256:w(),url:w()}).passthrough(),PN=I({expires_at:w(),files:J(yrt),total:C().int().nonnegative(),truncated:re(),next_after:w().nullable(),bearer_links:Ke(!0),notice:w()}).passthrough(),bZt=I({error:w(),code:w(),field:w().optional(),job_id:w().optional(),note:w().optional()}).passthrough(),IN={...gre,no_compute_access:"Your account does not have compute access.",suspended:"Compute is paused for your account.",insufficient_balance:"Your compute balance is used up. Contact an administrator to ask for more; a way to add more yourself is planned.",over_job_limit:"The job asks for more than one job may have on that partition.",over_concurrency:"You already have as many jobs running or waiting as you may.",platform_budget_exhausted:"The shared compute budget has no room for this job right now.",partition_not_offered:"That partition is not offered to people.",runtime_unavailable:"That runtime is not available.",registry_not_allowed:"The container image is not from a registry that is allowed.",dataset_not_eligible:"A dataset the job names is not available to compute.",version_not_found:"A dataset version the job names does not exist.",version_untagged:"A dataset version the job names cannot be read by a job.",too_many_files:"A dataset the job names has too many files for a job to read.",bundle_too_large:"The code bundle is over the size limit.",bundle_too_many_files:"The code bundle holds more files than the limit allows.",entry_not_in_bundle:"The job's entry is not one of the files in the bundle.",bundle_incomplete:"The bundle has not been uploaded in full; upload it to the address and ask again.",idempotency_conflict:"That Idempotency-Key was already used for a different request.",logs_not_available:"The job has no log yet.",upload_expired:"The upload window closed and the job was ended; submit it again.",storage_unavailable:"Compute storage could not be reached just now; ask again shortly."}});var brt,wrt,hoe;var NN=H(()=>{kn();dk();ao();brt=I({path:w().min(1).max(yw),size:C().int().min(0).max(Number.MAX_SAFE_INTEGER),sha256:w().regex(Va)}).strict(),wrt=I({files:J(brt).min(1)}).strict(),hoe=I({spec:ig,manifest:wrt.optional()}).strict()});var kZt,_rt,xrt,RZt,$Zt,DZt;var goe=H(()=>{kn();kZt=I({job_id:w(),hold_id:w(),tag:w(),expires_at:w(),state:w().optional(),replayed:Ke(!0).optional()}).passthrough(),_rt=I({path:w(),url:w(),method:Ke("PUT"),headers:Yn(w())}).passthrough(),xrt=I({state:Xe(["awaiting_upload","recorded"]),uploads:J(_rt).optional(),expires_at:w().optional()}).passthrough(),RZt=I({job_id:w(),verification:Xe(["verified","pending"]),state:w(),files:xrt.optional(),replayed:Ke(!0).optional()}).passthrough(),$Zt=I({job_id:w(),hold_id:w(),released:Ke(!0),state:w(),replayed:Ke(!0).optional()}).passthrough(),DZt=I({error:w(),code:w(),field:w().optional(),mismatch:w().optional(),job_id:w().optional()}).passthrough()});var PZt,yoe=500,vrt=512,Ert,Srt,IZt,NZt;var boe=H(()=>{kn();Tl();ao();PZt=I({app_id:w().regex(/^[A-Za-z0-9._-]{1,80}$/),app_version:w().regex(/^[A-Za-z0-9._+-]{1,64}$/),kind:Xe(yre),partition:Xe(dw),nodes:Pl(1,64),cores:Pl(0,256),memory_mb:Pl(1,16777216).nullish(),gpus:Pl(0,8),minutes:Pl(1,10080)}).strict().superRefine((e,t)=>{let n=ng[e.partition].pool==="gpu";if(n&&e.gpus<1)t.addIssue({code:ee.custom,path:["gpus"],message:"a GPU partition needs a GPU"});if(!n&&e.gpus!==0)t.addIssue({code:ee.custom,path:["gpus"],message:"a CPU partition takes no GPU"})}),Ert=I({path:w().min(1).max(vrt),size:C().int().min(0).max(Number.MAX_SAFE_INTEGER),sha256:w().regex(Va)}).strict(),Srt=/^[A-Za-z0-9][A-Za-z0-9-]{0,63}$/,IZt=I({tapis_job_id:w().regex(Srt),files:J(Ert).min(1).max(yoe).optional()}).strict(),NZt=yoe*2400+4096});var ug=H(()=>{WI();Yh();JI();iw();YI();US();Ol();up();nN();fre();ao();ag();mp();AN();uk();dk();fk();NN();goe();boe()});function qr(e){return typeof e==="string"&&$rt.test(e)&&!e.includes("..")}function Il(e){return/^v\d/.test(e)?e.slice(1):e}function Ur(e,t){return Il(e)===Il(t)}var $rt;var ea=H(()=>{$rt=/^[0-9A-Za-z][0-9A-Za-z._-]{0,63}$/});function W(e){if(e instanceof Error)return e.message;return String(e)}function fg(e){if(!(e instanceof j)||e.statusCode!==404)return!1;let t=e.rawBody;return typeof t==="object"&&t!==null&&t.error==="Not Found"&&typeof t.message==="string"}var j,Ka;var je=H(()=>{j=class j extends Error{statusCode;details;step;blockReason;missing;code;reason;rawBody;retryAfterSeconds;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"}};Ka=class Ka extends j{mode;eta;constructor(e,t,n,r){super(503,t,r);this.mode=e;this.eta=n;this.name="MaintenanceError"}}});var Drt,Crt,Art,uen,xoe="override_publication_review",voe="publication_review_not_clear",jN=2000;var mk=H(()=>{Drt=["dispatched","redispatched","dispatch_claimed"],Crt=["review_disabled","not_applicable","not_owned_here","request_not_requested","screen_not_ready","running","has_result","platform_limit"],Art=["dispatch_failed","dispatch_unconfigured"],uen=[...Drt,...Crt,...Art]});var hk=1e4;function gk(e){return e?Trt:Ja}var Ja,pen,Ort,Trt,LN;var yk=H(()=>{Ja=["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"],pen=Ja.slice(0,Ja.indexOf("s3_public_read")),Ort=["update_metadata","update_readme","upload_to_zenodo","publish_doi"],Trt=Ja.filter((e)=>!Ort.includes(e));LN={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 Prt(e){return`%${e.replace(/[\\%_]/g,"\\$&")}%`}function Irt(e){return new TextEncoder().encode(Prt(e)).length}function Eoe(e){if(Irt(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 bk(e){return e.replace(/[A-Z]/g,(t)=>t.toLowerCase())}function Soe(e,t){if(e==="")return!0;let n=bk(e);return t.some((r)=>typeof r==="string"&&bk(r).includes(n))}function koe(e,t){return bk(e)===bk(t)}function wk(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(qN.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(qN.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"&&!Nrt.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(qN.has(n))return[];t.push(n);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function UN(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 Roe(e,t){if(UN(e,t))throw Error("Cannot use string index")}function $oe(e,t,n){if(!hp(e)||typeof t!=="string")return n===void 0?e:n;let r=wk(t);if(r.length===0)return n;for(let o=0;o<r.length;o++){let s=r[o];if(UN(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 BN(e,t,n){if(!hp(e)||typeof t!=="string")return e;let r=e,o=wk(t);for(let s=0;s<o.length;s++){let i=o[s];if(Roe(e,i),s===o.length-1)e[i]=n;else if(!hp(e[i]))e[i]=typeof o[s+1]==="number"?[]:{};e=e[i]}return r}function Doe(e,t){if(!hp(e)||typeof t!=="string")return!1;let n=wk(t);for(let r=0;r<n.length;r++){let o=n[r];if(Roe(e,o),r===n.length-1)return delete e[o],!0;if(e=e[o],!hp(e))return!1}}function Coe(e,t){if(!hp(e)||typeof t!=="string")return!1;let n=wk(t);if(n.length===0)return!1;for(let r of n){if(!hp(e)||!(r in e)||UN(e,r))return!1;e=e[r]}return!0}var hp=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},qN,Nrt;var Aoe=H(()=>{qN=new Set(["__proto__","prototype","constructor"]),Nrt=new Set("0123456789")});import Un from"path";import Ooe from"os";import HN from"process";function GN(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(HN.platform==="darwin")return Frt(e);if(HN.platform==="win32")return Mrt(e);return jrt(e)}var cd,zN,pg,Frt=(e)=>{let t=Un.join(cd,"Library");return{data:Un.join(t,"Application Support",e),config:Un.join(t,"Preferences",e),cache:Un.join(t,"Caches",e),log:Un.join(t,"Logs",e),temp:Un.join(zN,e)}},Mrt=(e)=>{let t=pg.APPDATA||Un.join(cd,"AppData","Roaming"),n=pg.LOCALAPPDATA||Un.join(cd,"AppData","Local");return{data:Un.join(n,e,"Data"),config:Un.join(t,e,"Config"),cache:Un.join(n,e,"Cache"),log:Un.join(n,e,"Log"),temp:Un.join(zN,e)}},jrt=(e)=>{let t=Un.basename(cd);return{data:Un.join(pg.XDG_DATA_HOME||Un.join(cd,".local","share"),e),config:Un.join(pg.XDG_CONFIG_HOME||Un.join(cd,".config"),e),cache:Un.join(pg.XDG_CACHE_HOME||Un.join(cd,".cache"),e),log:Un.join(pg.XDG_STATE_HOME||Un.join(cd,".local","state"),e),temp:Un.join(zN,t,e)}};var Toe=H(()=>{cd=Ooe.homedir(),zN=Ooe.tmpdir(),{env:pg}=HN});var Lrt=(e,t)=>{let{onError:n}=t;return function(...o){return e.apply(void 0,o).catch(n)}},Ya;var Poe=H(()=>{Ya=Lrt});var qrt=(e,t)=>{let{onError:n}=t;return function(...o){try{return e.apply(void 0,o)}catch(s){return n(s)}}},ta;var Ioe=H(()=>{ta=qrt});var Noe=250;var Foe=()=>{};var Urt=(e,t)=>{let{isRetriable:n}=t;return function(o){let{timeout:s}=o,i=o.interval??Noe,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)})}}},Xa;var Moe=H(()=>{Foe();Xa=Urt});var Brt=(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}}}},Qa;var joe=H(()=>{Qa=Brt});var VN=H(()=>{Poe();Ioe();Moe();joe()});var bw,WN;var Loe=H(()=>{KN();bw={isChangeErrorOk:(e)=>{if(!bw.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!qoe&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!bw.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(!bw.isNodeError(e))throw e;if(bw.isChangeErrorOk(e))return;throw e}},WN=bw});import Uoe from"process";var ww,hs,qoe,co;var KN=H(()=>{Loe();ww={onError:WN.onChangeError},hs={onError:()=>{return}},qoe=Uoe.getuid?!Uoe.getuid():!1,co={isRetriable:WN.isRetriableError}});import Ut from"fs";import{promisify as $o}from"util";var Hrt,Br;var JN=H(()=>{VN();VN();KN();Hrt={attempt:{chmod:Ya($o(Ut.chmod),ww),chown:Ya($o(Ut.chown),ww),close:Ya($o(Ut.close),hs),fsync:Ya($o(Ut.fsync),hs),mkdir:Ya($o(Ut.mkdir),hs),realpath:Ya($o(Ut.realpath),hs),stat:Ya($o(Ut.stat),hs),unlink:Ya($o(Ut.unlink),hs),chmodSync:ta(Ut.chmodSync,ww),chownSync:ta(Ut.chownSync,ww),closeSync:ta(Ut.closeSync,hs),existsSync:ta(Ut.existsSync,hs),fsyncSync:ta(Ut.fsync,hs),mkdirSync:ta(Ut.mkdirSync,hs),realpathSync:ta(Ut.realpathSync,hs),statSync:ta(Ut.statSync,hs),unlinkSync:ta(Ut.unlinkSync,hs)},retry:{close:Xa($o(Ut.close),co),fsync:Xa($o(Ut.fsync),co),open:Xa($o(Ut.open),co),readFile:Xa($o(Ut.readFile),co),rename:Xa($o(Ut.rename),co),stat:Xa($o(Ut.stat),co),write:Xa($o(Ut.write),co),writeFile:Xa($o(Ut.writeFile),co),closeSync:Qa(Ut.closeSync,co),fsyncSync:Qa(Ut.fsyncSync,co),openSync:Qa(Ut.openSync,co),readFileSync:Qa(Ut.readFileSync,co),renameSync:Qa(Ut.renameSync,co),statSync:Qa(Ut.statSync,co),writeSync:Qa(Ut.writeSync,co),writeFileSync:Qa(Ut.writeFileSync,co)}},Br=Hrt});import gp from"process";var Boe="utf8",YN=438,Hoe=511,zoe,Goe,Voe,Woe=1000,Koe,zen,XN=128;var QN=H(()=>{zoe={},Goe=gp.geteuid?gp.geteuid():-1,Voe=gp.getegid?gp.getegid():-1,Koe=!!gp.getuid,zen=gp.getuid?!gp.getuid():!1});var Joe=(e)=>e instanceof Error&&("code"in e),ZN=(e)=>typeof e==="string",_k=(e)=>e===void 0;var Yoe=()=>{};var Xoe=()=>{};import Qoe from"process";var Zoe,xk;var eF=H(()=>{Zoe=Qoe.platform==="linux",xk=Qoe.platform==="win32"});var tF,ese;var tse=H(()=>{eF();tF=["SIGHUP","SIGINT","SIGTERM"];if(!xk)tF.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(Zoe)tF.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");ese=tF});import mg from"process";class nse{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(xk&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))mg.kill(mg.pid,"SIGTERM");else mg.kill(mg.pid,e)},this.hook=()=>{mg.once("exit",()=>this.exit());for(let e of ese)try{mg.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var rse;var ose=H(()=>{eF();tse();rse=new nse});var zrt,sse;var ise=H(()=>{ose();zrt=rse.register,sse=zrt});import Grt from"path";var Ls,_w;var ase=H(()=>{JN();ise();QN();Ls={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=Ls.truncate(t(e));if(r in Ls.store)return Ls.get(e,t,n);return Ls.store[r]=n,[r,()=>delete Ls.store[r]]},purge:(e)=>{if(!Ls.store[e])return;delete Ls.store[e],Br.attempt.unlink(e)},purgeSync:(e)=>{if(!Ls.store[e])return;delete Ls.store[e],Br.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in Ls.store)Ls.purgeSync(e)},truncate:(e)=>{let t=Grt.basename(e);if(t.length<=XN)return e;let n=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!n)return e;let r=t.length-XN;return`${e.slice(0,-t.length)}${n[1]}${n[2].slice(0,-r)}${n[3]}`}};sse(Ls.purgeSyncAll);_w=Ls});import Vrt from"path";function nF(e,t,n=zoe){if(ZN(n))return nF(e,t,{encoding:n});let o={timeout:n.timeout??Woe},s=null,i=null,a=null;try{let c=Br.attempt.realpathSync(e),l=!!c;e=c||e,[i,s]=_w.get(e,n.tmpCreate||_w.create,n.tmpPurge!==!1);let d=Koe&&_k(n.chown),f=_k(n.mode);if(l&&(d||f)){let p=Br.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=Vrt.dirname(e);Br.attempt.mkdirSync(p,{mode:Hoe,recursive:!0})}if(a=Br.retry.openSync(o)(i,"w",n.mode||YN),n.tmpCreated)n.tmpCreated(i);if(ZN(t))Br.retry.writeSync(o)(a,t,0,n.encoding||Boe);else if(!_k(t))Br.retry.writeSync(o)(a,t,0,t.length,0);if(n.fsync!==!1)if(n.fsyncWait!==!1)Br.retry.fsyncSync(o)(a);else Br.attempt.fsync(a);if(Br.retry.closeSync(o)(a),a=null,n.chown&&(n.chown.uid!==Goe||n.chown.gid!==Voe))Br.attempt.chownSync(i,n.chown.uid,n.chown.gid);if(n.mode&&n.mode!==YN)Br.attempt.chmodSync(i,n.mode);try{Br.retry.renameSync(o)(i,e)}catch(p){if(!Joe(p))throw p;if(p.code!=="ENAMETOOLONG")throw p;Br.retry.renameSync(o)(i,_w.truncate(e))}s(),i=null}finally{if(a)Br.attempt.closeSync(a);if(i)_w.purge(i)}}var cse=H(()=>{JN();QN();Yoe();Xoe();ase()});var vw=_(function(dse){Object.defineProperty(dse,"__esModule",{value:!0});dse.regexpCode=dse.getEsmExportName=dse.getProperty=dse.safeStringify=dse.stringify=dse.strConcat=dse.addCodeArg=dse.str=dse._=dse.nil=dse._Code=dse.Name=dse.IDENTIFIER=dse._CodeOrName=void 0;class vk{}dse._CodeOrName=vk;dse.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class hg extends vk{constructor(e){super();if(!dse.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}}}dse.Name=hg;class na extends vk{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 hg)t[n.str]=(t[n.str]||0)+1;return t},{})}}dse._Code=na;dse.nil=new na("");function lse(e,...t){let n=[e[0]],r=0;while(r<t.length)oF(n,t[r]),n.push(e[++r]);return new na(n)}dse._=lse;var rF=new na("+");function use(e,...t){let n=[xw(e[0])],r=0;while(r<t.length)n.push(rF),oF(n,t[r]),n.push(rF,xw(e[++r]));return Wrt(n),new na(n)}dse.str=use;function oF(e,t){if(t instanceof na)e.push(...t._items);else if(t instanceof hg)e.push(t);else e.push(Yrt(t))}dse.addCodeArg=oF;function Wrt(e){let t=1;while(t<e.length-1){if(e[t]===rF){let n=Krt(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}function Krt(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof hg||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 hg))return`"${e}${t.slice(1)}`;return}function Jrt(e,t){return t.emptyStr()?e:e.emptyStr()?t:use`${e}${t}`}dse.strConcat=Jrt;function Yrt(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:xw(Array.isArray(e)?e.join(","):e)}function Xrt(e){return new na(xw(e))}dse.stringify=Xrt;function xw(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}dse.safeStringify=xw;function Qrt(e){return typeof e=="string"&&dse.IDENTIFIER.test(e)?new na(`.${e}`):lse`[${e}]`}dse.getProperty=Qrt;function Zrt(e){if(typeof e=="string"&&dse.IDENTIFIER.test(e))return new na(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}dse.getEsmExportName=Zrt;function eot(e){return new na(e.toString())}dse.regexpCode=eot});var cF=_(function(hse){Object.defineProperty(hse,"__esModule",{value:!0});hse.ValueScope=hse.ValueScopeName=hse.Scope=hse.varKinds=hse.UsedValueState=void 0;var un=vw();class pse extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var Sk;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Sk||(hse.UsedValueState=Sk={}));hse.varKinds={const:new un.Name("const"),let:new un.Name("let"),var:new un.Name("var")};class iF{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof un.Name?e:this.name(e)}name(e){return new un.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}}}hse.Scope=iF;class aF extends un.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=un._`.${new un.Name(t)}[${n}]`}}hse.ValueScopeName=aF;var pot=un._`\n`;class mse extends iF{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?pot:un.nil}}get(){return this._scope}name(e){return new aF(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 un._`${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=un.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,Sk.Started);let l=t(c);if(l){let d=this.opts.es5?hse.varKinds.var:hse.varKinds.const;o=un._`${o}${d} ${c} = ${l};${this.opts._n}`}else if(l=r===null||r===void 0?void 0:r(c))o=un._`${o}${l}${this.opts._n}`;else throw new pse(c);a.set(c,Sk.Completed)})}return o}}hse.ValueScope=mse});var wt=_(function(gs){Object.defineProperty(gs,"__esModule",{value:!0});gs.or=gs.and=gs.not=gs.CodeGen=gs.operators=gs.varKinds=gs.ValueScopeName=gs.ValueScope=gs.Scope=gs.Name=gs.regexpCode=gs.stringify=gs.getProperty=gs.nil=gs.strConcat=gs.str=gs._=void 0;var ge=vw(),Xn=cF(),ld=vw();Object.defineProperty(gs,"_",{enumerable:!0,get:function(){return ld._}});Object.defineProperty(gs,"str",{enumerable:!0,get:function(){return ld.str}});Object.defineProperty(gs,"strConcat",{enumerable:!0,get:function(){return ld.strConcat}});Object.defineProperty(gs,"nil",{enumerable:!0,get:function(){return ld.nil}});Object.defineProperty(gs,"getProperty",{enumerable:!0,get:function(){return ld.getProperty}});Object.defineProperty(gs,"stringify",{enumerable:!0,get:function(){return ld.stringify}});Object.defineProperty(gs,"regexpCode",{enumerable:!0,get:function(){return ld.regexpCode}});Object.defineProperty(gs,"Name",{enumerable:!0,get:function(){return ld.Name}});var Ak=cF();Object.defineProperty(gs,"Scope",{enumerable:!0,get:function(){return Ak.Scope}});Object.defineProperty(gs,"ValueScope",{enumerable:!0,get:function(){return Ak.ValueScope}});Object.defineProperty(gs,"ValueScopeName",{enumerable:!0,get:function(){return Ak.ValueScopeName}});Object.defineProperty(gs,"varKinds",{enumerable:!0,get:function(){return Ak.varKinds}});gs.operators={GT:new ge._Code(">"),GTE:new ge._Code(">="),LT:new ge._Code("<"),LTE:new ge._Code("<="),EQ:new ge._Code("==="),NEQ:new ge._Code("!=="),NOT:new ge._Code("!"),OR:new ge._Code("||"),AND:new ge._Code("&&"),ADD:new ge._Code("+")};class ud{optimizeNodes(){return this}optimizeNames(e,t){return this}}class yse extends ud{constructor(e,t,n){super();this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?Xn.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=yg(this.rhs,e,t);return this}get names(){return this.rhs instanceof ge._CodeOrName?this.rhs.names:{}}}class dF extends ud{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 ge.Name&&!e[this.lhs.str]&&!this.sideEffects)return;return this.rhs=yg(this.rhs,e,t),this}get names(){let e=this.lhs instanceof ge.Name?{}:{...this.lhs.names};return Ck(e,this.rhs)}}class bse extends dF{constructor(e,t,n,r){super(e,n,r);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class wse extends ud{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class _se extends ud{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class xse extends ud{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class vse extends ud{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=yg(this.code,e,t),this}get names(){return this.code instanceof ge._CodeOrName?this.code.names:{}}}class Ok extends ud{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;yot(e,o.names),n.splice(r,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>yp(e,t.names),{})}}class dd extends Ok{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class Ese extends Ok{}class Ew extends dd{}Ew.kind="else";class Nl extends dd{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 Ew(n):n}if(t){if(e===!1)return t instanceof Nl?t:t.nodes;if(this.nodes.length)return this;return new Nl(Dse(e),t instanceof Nl?[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=yg(this.condition,e,t),this}get names(){let e=super.names;if(Ck(e,this.condition),this.else)yp(e,this.else.names);return e}}Nl.kind="if";class gg extends dd{}gg.kind="for";class Sse extends gg{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=yg(this.iteration,e,t),this}get names(){return yp(super.names,this.iteration.names)}}class kse extends gg{constructor(e,t,n,r){super();this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?Xn.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=Ck(super.names,this.from);return Ck(e,this.to)}}class lF extends gg{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=yg(this.iterable,e,t),this}get names(){return yp(super.names,this.iterable.names)}}class kk extends dd{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)}}kk.kind="func";class Rk extends Ok{render(e){return"return "+super.render(e)}}Rk.kind="return";class Rse extends dd{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)yp(e,this.catch.names);if(this.finally)yp(e,this.finally.names);return e}}class $k extends dd{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}$k.kind="catch";class Dk extends dd{render(e){return"finally"+super.render(e)}}Dk.kind="finally";class $se{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
85
85
  `:""},this._extScope=e,this._scope=new Xn.Scope({parent:e}),this._nodes=[new Ese]}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 yse(e,o,n)),o}const(e,t,n){return this._def(Xn.varKinds.const,e,t,n)}let(e,t,n){return this._def(Xn.varKinds.let,e,t,n)}var(e,t,n){return this._def(Xn.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new dF(e,t,n))}add(e,t){return this._leafNode(new bse(e,gs.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==ge.nil)this._leafNode(new vse(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(":"),ge.addCodeArg(t,r)}return t.push("}"),new ge._Code(t)}if(e,t,n){if(this._blockNode(new Nl(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 Nl(e))}else(){return this._elseNode(new Ew)}endIf(){return this._endBlockNode(Nl,Ew)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new Sse(e),t)}forRange(e,t,n,r,o=this.opts.es5?Xn.varKinds.var:Xn.varKinds.let){let s=this._scope.toName(e);return this._for(new kse(o,s,t,n),()=>r(s))}forOf(e,t,n,r=Xn.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=t instanceof ge.Name?t:this.var("_arr",t);return this.forRange("_i",0,ge._`${s}.length`,(i)=>{this.var(o,ge._`${s}[${i}]`),n(o)})}return this._for(new lF("of",r,o,t),()=>n(o))}forIn(e,t,n,r=this.opts.es5?Xn.varKinds.var:Xn.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,ge._`Object.keys(${t})`,n);let o=this._scope.toName(e);return this._for(new lF("in",r,o,t),()=>n(o))}endFor(){return this._endBlockNode(gg)}label(e){return this._leafNode(new wse(e))}break(e){return this._leafNode(new _se(e))}return(e){let t=new Rk;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(Rk)}try(e,t,n){if(!t&&!n)throw Error('CodeGen: "try" without "catch" and "finally"');let r=new Rse;if(this._blockNode(r),this.code(e),t){let o=this.name("e");this._currNode=r.catch=new $k(o),t(o)}if(n)this._currNode=r.finally=new Dk,this.code(n);return this._endBlockNode($k,Dk)}throw(e){return this._leafNode(new xse(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=ge.nil,n,r){if(this._blockNode(new kk(e,t,n)),r)this.code(r).endFunc();return this}endFunc(){return this._endBlockNode(kk)}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 Nl))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}}gs.CodeGen=$se;function yp(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function Ck(e,t){return t instanceof ge._CodeOrName?yp(e,t.names):e}function yg(e,t,n){if(e instanceof ge.Name)return r(e);if(!o(e))return e;return new ge._Code(e._items.reduce((s,i)=>{if(i instanceof ge.Name)i=r(i);if(i instanceof ge._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 ge._Code&&s._items.some((i)=>i instanceof ge.Name&&t[i.str]===1&&n[i.str]!==void 0)}}function yot(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function Dse(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:ge._`!${uF(e)}`}gs.not=Dse;var bot=Cse(gs.operators.AND);function wot(...e){return e.reduce(bot)}gs.and=wot;var _ot=Cse(gs.operators.OR);function xot(...e){return e.reduce(_ot)}gs.or=xot;function Cse(e){return(t,n)=>t===ge.nil?n:n===ge.nil?t:ge._`${uF(t)} ${e} ${uF(n)}`}function uF(e){return e instanceof ge.Name?e:ge._`(${e})`}});var At=_(function(Lse){Object.defineProperty(Lse,"__esModule",{value:!0});Lse.checkStrictMode=Lse.getErrorPath=Lse.Type=Lse.useFunc=Lse.setEvaluated=Lse.evaluatedPropsToName=Lse.mergeEvaluated=Lse.eachItem=Lse.unescapeJsonPointer=Lse.escapeJsonPointer=Lse.escapeFragment=Lse.unescapeFragment=Lse.schemaRefOrVal=Lse.schemaHasRulesButRef=Lse.schemaHasRules=Lse.checkUnknownRules=Lse.alwaysValidSchema=Lse.toHash=void 0;var Le=wt(),Pse=vw();function kot(e){let t={};for(let n of e)t[n]=!0;return t}Lse.toHash=kot;function Rot(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return Ise(e,t),!Nse(t,e.self.RULES.all)}Lse.alwaysValidSchema=Rot;function Ise(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])jse(e,`unknown keyword: "${s}"`)}Lse.checkUnknownRules=Ise;function Nse(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(t[n])return!0;return!1}Lse.schemaHasRules=Nse;function $ot(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}Lse.schemaHasRulesButRef=$ot;function Dot({topSchemaRef:e,schemaPath:t},n,r,o){if(!o){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return Le._`${n}`}return Le._`${e}${t}${Le.getProperty(r)}`}Lse.schemaRefOrVal=Dot;function Cot(e){return Fse(decodeURIComponent(e))}Lse.unescapeFragment=Cot;function Aot(e){return encodeURIComponent(pF(e))}Lse.escapeFragment=Aot;function pF(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}Lse.escapeJsonPointer=pF;function Fse(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}Lse.unescapeJsonPointer=Fse;function Oot(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}Lse.eachItem=Oot;function Ose({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:r}){return(o,s,i,a)=>{let c=i===void 0?s:i instanceof Le.Name?(s instanceof Le.Name?e(o,s,i):t(o,s,i),i):s instanceof Le.Name?(t(o,i,s),s):n(s,i);return a===Le.Name&&!(c instanceof Le.Name)?r(o,c):c}}Lse.mergeEvaluated={props:Ose({mergeNames:(e,t,n)=>e.if(Le._`${n} !== true && ${t} !== undefined`,()=>{e.if(Le._`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,Le._`${n} || {}`).code(Le._`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if(Le._`${n} !== true`,()=>{if(t===!0)e.assign(n,!0);else e.assign(n,Le._`${n} || {}`),mF(e,n,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Mse}),items:Ose({mergeNames:(e,t,n)=>e.if(Le._`${n} !== true && ${t} !== undefined`,()=>e.assign(n,Le._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if(Le._`${n} !== true`,()=>e.assign(n,t===!0?!0:Le._`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Mse(e,t){if(t===!0)return e.var("props",!0);let n=e.var("props",Le._`{}`);if(t!==void 0)mF(e,n,t);return n}Lse.evaluatedPropsToName=Mse;function mF(e,t,n){Object.keys(n).forEach((r)=>e.assign(Le._`${t}${Le.getProperty(r)}`,!0))}Lse.setEvaluated=mF;var Tse={};function Tot(e,t){return e.scopeValue("func",{ref:t,code:Tse[t.code]||(Tse[t.code]=new Pse._Code(t.code))})}Lse.useFunc=Tot;var fF;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(fF||(Lse.Type=fF={}));function Pot(e,t,n){if(e instanceof Le.Name){let r=t===fF.Num;return n?r?Le._`"[" + ${e} + "]"`:Le._`"['" + ${e} + "']"`:r?Le._`"/" + ${e}`:Le._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?Le.getProperty(e).toString():"/"+pF(e)}Lse.getErrorPath=Pot;function jse(e,t,n=e.opts.strictSchema){if(!n)return;if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}Lse.checkStrictMode=jse});var mi=_(function(Use){Object.defineProperty(Use,"__esModule",{value:!0});var Gt=wt(),Xot={data:new Gt.Name("data"),valCxt:new Gt.Name("valCxt"),instancePath:new Gt.Name("instancePath"),parentData:new Gt.Name("parentData"),parentDataProperty:new Gt.Name("parentDataProperty"),rootData:new Gt.Name("rootData"),dynamicAnchors:new Gt.Name("dynamicAnchors"),vErrors:new Gt.Name("vErrors"),errors:new Gt.Name("errors"),this:new Gt.Name("this"),self:new Gt.Name("self"),scope:new Gt.Name("scope"),json:new Gt.Name("json"),jsonPos:new Gt.Name("jsonPos"),jsonLen:new Gt.Name("jsonLen"),jsonPart:new Gt.Name("jsonPart")};Use.default=Xot});var Sw=_(function(Gse){Object.defineProperty(Gse,"__esModule",{value:!0});Gse.extendErrors=Gse.resetErrorsCount=Gse.reportExtraError=Gse.reportError=Gse.keyword$DataError=Gse.keywordError=void 0;var be=wt(),fd=At(),Go=mi();Gse.keywordError={message:({keyword:e})=>be.str`must pass "${e}" keyword validation`};Gse.keyword$DataError={message:({keyword:e,schemaType:t})=>t?be.str`"${e}" keyword must be ${t} ($data)`:be.str`"${e}" keyword is invalid ($data)`};function Zot(e,t=Gse.keywordError,n,r){let{it:o}=e,{gen:s,compositeRule:i,allErrors:a}=o,c=zse(e,t,n);if(r!==null&&r!==void 0?r:i||a)Bse(s,c);else Hse(o,be._`[${c}]`)}Gse.reportError=Zot;function est(e,t=Gse.keywordError,n){let{it:r}=e,{gen:o,compositeRule:s,allErrors:i}=r,a=zse(e,t,n);if(Bse(o,a),!(s||i))Hse(r,Go.default.vErrors)}Gse.reportExtraError=est;function tst(e,t){e.assign(Go.default.errors,t),e.if(be._`${Go.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(be._`${Go.default.vErrors}.length`,t),()=>e.assign(Go.default.vErrors,null)))}Gse.resetErrorsCount=tst;function nst({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,Go.default.errors,(a)=>{if(e.const(i,be._`${Go.default.vErrors}[${a}]`),e.if(be._`${i}.instancePath === undefined`,()=>e.assign(be._`${i}.instancePath`,be.strConcat(Go.default.instancePath,s.errorPath))),e.assign(be._`${i}.schemaPath`,be.str`${s.errSchemaPath}/${t}`),s.opts.verbose)e.assign(be._`${i}.schema`,n),e.assign(be._`${i}.data`,r)})}Gse.extendErrors=nst;function Bse(e,t){let n=e.const("err",t);e.if(be._`${Go.default.vErrors} === null`,()=>e.assign(Go.default.vErrors,be._`[${n}]`),be._`${Go.default.vErrors}.push(${n})`),e.code(be._`${Go.default.errors}++`)}function Hse(e,t){let{gen:n,validateName:r,schemaEnv:o}=e;if(o.$async)n.throw(be._`new ${e.ValidationError}(${t})`);else n.assign(be._`${r}.errors`,t),n.return(!1)}var bp={keyword:new be.Name("keyword"),schemaPath:new be.Name("schemaPath"),params:new be.Name("params"),propertyName:new be.Name("propertyName"),message:new be.Name("message"),schema:new be.Name("schema"),parentSchema:new be.Name("parentSchema")};function zse(e,t,n){let{createErrors:r}=e.it;if(r===!1)return be._`{}`;return rst(e,t,n)}function rst(e,t,n={}){let{gen:r,it:o}=e,s=[ost(o,n),sst(e,n)];return ist(e,t,s),r.object(...s)}function ost({errorPath:e},{instancePath:t}){let n=t?be.str`${e}${fd.getErrorPath(t,fd.Type.Str)}`:e;return[Go.default.instancePath,be.strConcat(Go.default.instancePath,n)]}function sst({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:r}){let o=r?t:be.str`${t}/${e}`;if(n)o=be.str`${o}${fd.getErrorPath(n,fd.Type.Str)}`;return[bp.schemaPath,o]}function ist(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([bp.keyword,o],[bp.params,typeof t=="function"?t(e):t||be._`{}`]),c.messages)r.push([bp.message,typeof n=="function"?n(e):n]);if(c.verbose)r.push([bp.schema,i],[bp.parentSchema,be._`${d}${f}`],[Go.default.data,s]);if(l)r.push([bp.propertyName,l])}});var Qse=_(function(Yse){Object.defineProperty(Yse,"__esModule",{value:!0});Yse.boolOrEmptySchema=Yse.topBoolOrEmptySchema=void 0;var Wse=Sw(),Kse=wt(),dst=mi(),fst={message:"boolean schema is false"};function pst(e){let{gen:t,schema:n,validateName:r}=e;if(n===!1)Jse(e,!1);else if(typeof n=="object"&&n.$async===!0)t.return(dst.default.data);else t.assign(Kse._`${r}.errors`,null),t.return(!0)}Yse.topBoolOrEmptySchema=pst;function mst(e,t){let{gen:n,schema:r}=e;if(r===!1)n.var(t,!1),Jse(e);else n.var(t,!0)}Yse.boolOrEmptySchema=mst;function Jse(e,t){let{gen:n,data:r}=e;Wse.reportError({gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},fst,void 0,t)}});var gF=_(function(Zse){Object.defineProperty(Zse,"__esModule",{value:!0});Zse.getRules=Zse.isJSONType=void 0;var gst=["string","number","integer","boolean","null","object","array"],yst=new Set(gst);function bst(e){return typeof e=="string"&&yst.has(e)}Zse.isJSONType=bst;function wst(){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:{}}}Zse.getRules=wst});var yF=_(function(rie){Object.defineProperty(rie,"__esModule",{value:!0});rie.shouldUseRule=rie.shouldUseGroup=rie.schemaHasRulesForType=void 0;function xst({schema:e,self:t},n){let r=t.RULES.types[n];return r&&r!==!0&&tie(e,r)}rie.schemaHasRulesForType=xst;function tie(e,t){return t.rules.some((n)=>nie(e,n))}rie.shouldUseGroup=tie;function nie(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))}rie.shouldUseRule=nie});var kw=_(function(uie){Object.defineProperty(uie,"__esModule",{value:!0});uie.reportTypeError=uie.checkDataTypes=uie.checkDataType=uie.coerceAndCheckDataType=uie.getJSONTypes=uie.getSchemaTypes=uie.DataType=void 0;var sie=gF(),iie=yF(),aie=Sw(),le=wt(),Pk=At(),bg;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(bg||(uie.DataType=bg={}));function Sst(e){let t=cie(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}uie.getSchemaTypes=Sst;function cie(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(sie.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}uie.getJSONTypes=cie;function kst(e,t){let{gen:n,data:r,opts:o}=e,s=Rst(t,o.coerceTypes),i=t.length>0&&!(s.length===0&&t.length===1&&iie.schemaHasRulesForType(e,t[0]));if(i){let a=wF(t,r,o.strictNumbers,bg.Wrong);n.if(a,()=>{if(s.length)$st(e,t,s);else _F(e)})}return i}uie.coerceAndCheckDataType=kst;var lie=new Set(["string","number","integer","boolean","null"]);function Rst(e,t){return t?e.filter((n)=>lie.has(n)||t==="array"&&n==="array"):[]}function $st(e,t,n){let{gen:r,data:o,opts:s}=e,i=r.let("dataType",le._`typeof ${o}`),a=r.let("coerced",le._`undefined`);if(s.coerceTypes==="array")r.if(le._`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>r.assign(o,le._`${o}[0]`).assign(i,le._`typeof ${o}`).if(wF(t,o,s.strictNumbers),()=>r.assign(a,o)));r.if(le._`${a} !== undefined`);for(let l of n)if(lie.has(l)||l==="array"&&s.coerceTypes==="array")c(l);r.else(),_F(e),r.endIf(),r.if(le._`${a} !== undefined`,()=>{r.assign(o,a),Dst(e,a)});function c(l){switch(l){case"string":r.elseIf(le._`${i} == "number" || ${i} == "boolean"`).assign(a,le._`"" + ${o}`).elseIf(le._`${o} === null`).assign(a,le._`""`);return;case"number":r.elseIf(le._`${i} == "boolean" || ${o} === null
86
86
  || (${i} == "string" && ${o} && ${o} == +${o})`).assign(a,le._`+${o}`);return;case"integer":r.elseIf(le._`${i} === "boolean" || ${o} === null
87
87
  || (${i} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,le._`+${o}`);return;case"boolean":r.elseIf(le._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf(le._`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":r.elseIf(le._`${o} === "" || ${o} === 0 || ${o} === false`),r.assign(a,null);return;case"array":r.elseIf(le._`${i} === "string" || ${i} === "number"
@@ -99,7 +99,7 @@ ${t}`,bet,wet,_et=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,o=yet.bind(nul
99
99
  `)}var zM=!1;var{spawn:rxt}=globalThis.Bun;function Dp(e,t=[]){let n=e.replace(oxt,'("$1","<redacted>")');for(let r of t)if(r.length>=sxt)n=n.split(r).join("<redacted>");return n}function y$(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 aye(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 O(e,t={}){let n={...process.env,GIT_TERMINAL_PROMPT:"0",...t.env};for(let y of t.unsetEnv??[])delete n[y];let r=rxt({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??ixt)};if(l(),t.timeout)s=setTimeout(()=>{o=!0,c(),r.kill()},t.timeout);let d=oy()?[...y$(n),...t.redact??[]]:[];if(oy()){let y=t.cwd?` (cwd=${t.cwd})`:"";Wd(u.dim(Dp(`$ ${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([aye(r.stdout,f),aye(r.stderr,f),g])}finally{if(c(),s)clearTimeout(s)}if(oy()){if(t.sensitiveOutput)Wd(u.dim("[sensitive subprocess output suppressed]"));else{if(p.trim())Wd(u.dim(Dp(p.trimEnd(),d)));if(m.trim())Wd(u.yellow(Dp(m.trimEnd(),d)))}Wd(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 oxt,sxt=8,ixt=120000;var Jt=H(()=>{Ue();oxt=/\(\s*"((?:x-amz-)[^"]*|authorization|proxy-authorization)"\s*,\s*"[^"]*"\s*\)/gi});function cxt(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function lye(e,t=cxt()){return e.installInstructions[t]}function lxt(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function dxt(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:uxt}async function uye(e){try{let{exitCode:t,stdout:n,timedOut:r}=await O(e.cmd,{timeout:dxt()});if(r)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:lxt(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 e_(){let e=Object.entries(cye);return Promise.all(e.map(async([t,n])=>{let{available:r,version:o,timedOut:s}=await uye(n);return{key:t,name:n.name,purpose:n.purpose,required:n.required,available:r,version:o,timedOut:s,installInstruction:lye(n)}}))}async function dye(){let t=(await e_()).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 Cp(e){let n=axt[e].map((i)=>cye[i]).filter(Boolean),r=await Promise.all(n.map(async(i)=>{let a=await uye(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:lye(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 cye,axt,uxt=4000;var t_=H(()=>{Jt();cye={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)"}}},axt={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 pye;var fye=H(()=>{pye={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.28-PR2082.7be2913",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",jose:"6.2.12","lint-staged":"^16.3.2",oauth4webapi:"3.8.8","openid-client":"6.8.9",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var qs;var Ap=H(()=>{fye();qs=pye.version});import{mkdirSync as pxt,readdirSync as mxt,unlinkSync as hxt,writeFileSync as gxt}from"fs";import{join as GM}from"path";function wye(){sy=!0}function Ul(){return sy}function _ye(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function r_(e){bye=e,Fn(`Step: ${e}`)}function Jo(){gye=!0}function xye(){return gye}function de(){if(yye)return;WM=!0}function Kd(){WM=!1,yye=!0}function vye(){return WM}function Fn(e){if(sy)process.stderr.write(`[debug] ${e}
102
+ `))}var cye,axt,uxt=4000;var t_=H(()=>{Jt();cye={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)"}}},axt={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 pye;var fye=H(()=>{pye={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.28-PR2082.cb8109a",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",jose:"6.2.12","lint-staged":"^16.3.2",oauth4webapi:"3.8.8","openid-client":"6.8.9",typescript:"^5.5.4",wrangler:"^4.70.0",yaml:"^2.8.4"}}});var qs;var Ap=H(()=>{fye();qs=pye.version});import{mkdirSync as pxt,readdirSync as mxt,unlinkSync as hxt,writeFileSync as gxt}from"fs";import{join as GM}from"path";function wye(){sy=!0}function Ul(){return sy}function _ye(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function r_(e){bye=e,Fn(`Step: ${e}`)}function Jo(){gye=!0}function xye(){return gye}function de(){if(yye)return;WM=!0}function Kd(){WM=!1,yye=!0}function vye(){return WM}function Fn(e){if(sy)process.stderr.write(`[debug] ${e}
103
103
  `)}function _xt(e){let t={};for(let[n,r]of Object.entries(e))t[n]=wxt.has(n.toLowerCase())?"[REDACTED]":r;return t}function Sye(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function VM(e,t,n=0){if(n>vxt)return"[REDACTED: depth]";if(Array.isArray(t))return t.map((r)=>VM(e,r,n+1));if(t&&typeof t==="object"){let r={};for(let[o,s]of Object.entries(t))r[o]=VM(o,s,n+1);return r}if(typeof t==="string"){if(xxt.test(e))return"[REDACTED]";return t.replace(Eye,Sye)}return t}function KM(e){return e.replace(Ext,"Bearer [REDACTED]").replace(Sxt,"[REDACTED_AWS_KEY]").replace(kxt,"$1[REDACTED]").replace(Rxt,"$1$2=[REDACTED]").replace(Eye,Sye)}function $xt(e){return KM(e)}function mye(e,t=bxt){if(e===void 0)return;let n=e;try{let r=JSON.parse(e);n=JSON.stringify(VM("",r))}catch{}if(n=KM(n),Buffer.byteLength(n,"utf8")>t)n=`${Buffer.from(n,"utf8").subarray(0,t).toString("utf8")}... [truncated]`;return n}function _$(e){if(!sy)return;let t=$xt(e.url);try{let n={...e,url:t,requestHeaders:e.requestHeaders?_xt(e.requestHeaders):void 0,requestBody:mye(e.requestBody),responseBody:mye(e.responseBody)};w$.push(n),Fn(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(n){let r=W(n);w$.push({method:e.method,url:t,status:e.status,durationMs:e.durationMs,note:`redaction failed: ${r}`}),Fn(`redaction failed for ${e.method} ${t}: ${r}`)}}async function Dxt(){let e=[];try{let t=process.versions.bun?`Bun ${process.versions.bun}`:`Node ${process.version}`;e.push(`CLI version: ${qs}`),e.push(`OS/Arch: ${process.platform}/${process.arch}`),e.push(`Runtime: ${t}`)}catch(t){e.push(`(could not read CLI/OS/runtime info: ${W(t)})`)}e.push(""),e.push("Active account:");try{let t=Wt();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: ${W(t)})`)}e.push(""),e.push("External tools:");try{let t=await e_();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: ${W(t)})`)}return e}async function JM(){return(await Dxt()).join(`
104
104
  `)}async function kye(){if(!sy||b$!==void 0)return;try{b$=await JM()}catch(e){let t=W(e);b$=`(could not build environment report: ${t})`,Fn(`environment snapshot failed: ${t}`)}}function Rye(e){if(hye.has(e))return{flag:e};for(let t of hye){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 Cxt(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],o=Rye(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 Axt(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],o=Rye(r);if(!o){t.push(r);continue}if(!o.kind&&n+1<e.length)n++}return t}function Oxt(e){let t=[];for(let r of Axt(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 Txt(e,t){let n=[];if(n.push("NEMAR CLI Debug Log"),n.push(`Generated: ${new Date().toISOString()}`),n.push(`Command: nemar ${KM(Cxt(e).join(" "))}`),n.push(""),n.push(b$??"(environment snapshot unavailable)"),n.push(""),n.push("HTTP requests:"),w$.length===0)n.push(" (none)");else w$.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: ${bye??"(none recorded)"}`),n.push(`Exit code: ${t}`),`${n.join(`
105
105
  `)}
@@ -2459,7 +2459,7 @@ Examples:
2459
2459
  Description:
2460
2460
  Compute access is a grant of its own, separate from upload access: an administrator reviews each
2461
2461
  request against export-control and local-jurisdiction rules and the purpose you state, and answers
2462
- once. A grant lets you use compute within the limits an administrator sets. You ask once; asking again while the
2462
+ once. A grant opens a starting allocation of service units. You ask once; asking again while the
2463
2463
  request is open does nothing, and a request that was answered cannot be made again.
2464
2464
 
2465
2465
  Before asking, your account needs a verified email address, an ORCID iD proven by signing in with
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-PR2082.7be2913",
4
+ "version": "0.10.28-PR2082.cb8109a",
5
5
  "description": "CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",