nemar-cli 0.10.39-dev.4760 → 0.10.39-dev.4761

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}`,QM,ZM,eL=(e,t,r)=>{let n=r===""?"":`with ${r.trim()}() `,s=JM.bind(null,n,
23
23
  `)}var Vl=!1;var{spawn:nV}=globalThis.Bun;function zl(e,t=[]){let r=e.replace(sV,'("$1","<redacted>")');for(let n of t)if(n.length>=oV)r=r.split(n).join("<redacted>");return r}function iV(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 hE(e,t){let r=e.getReader(),n=new TextDecoder,s="";while(!0){let{done:o,value:a}=await r.read();if(o)break;if(a.byteLength===0)continue;t(),s+=n.decode(a,{stream:!0})}return s+n.decode()}async function gE(e,t={}){let r={...process.env,GIT_TERMINAL_PROMPT:"0",...t.env};for(let y of t.unsetEnv??[])delete r[y];let n=nV({cmd:e,cwd:t.cwd,...t.stdin===void 0?{}:{stdin:new TextEncoder().encode(t.stdin)},stdout:"pipe",stderr:"pipe",env:r}),s=!1,o,a,i=performance.now(),c=()=>{if(a!==void 0)clearTimeout(a),a=void 0},u=()=>{if(!t.onInactivityWarning)return;c(),a=setTimeout(()=>{a=void 0;try{t.onInactivityWarning?.(performance.now()-i)}catch{console.error("Could not display subprocess inactivity warning; the child result is unaffected.")}},t.inactivityWarningAfterMs??aV)};if(u(),t.timeout)o=setTimeout(()=>{s=!0,c(),n.kill()},t.timeout);let l=cc()?[...iV(r),...t.redact??[]]:[];if(cc()){let y=t.cwd?` (cwd=${t.cwd})`:"";Ls(Pt.dim(zl(`$ ${e.join(" ")}${y}`,l)))}let d=()=>{i=performance.now(),u()},m,f,p,h=n.exited.then((y)=>(c(),y));try{[m,f,p]=await Promise.all([hE(n.stdout,d),hE(n.stderr,d),h])}finally{if(c(),o)clearTimeout(o)}if(cc()){if(t.sensitiveOutput)Ls(Pt.dim("[sensitive subprocess output suppressed]"));else{if(m.trim())Ls(Pt.dim(zl(m.trimEnd(),l)));if(f.trim())Ls(Pt.yellow(zl(f.trimEnd(),l)))}Ls(Pt.dim(`(exit ${p})`))}if(s)return{stdout:m,stderr:f||`Command timed out after ${Math.round(t.timeout/1000)}s`,exitCode:p??1,timedOut:!0};return{stdout:m,stderr:f,exitCode:p,timedOut:!1}}var sV,oV=8,aV=120000;var yE=L(()=>{Fl();sV=/\(\s*"((?:x-amz-)[^"]*|authorization|proxy-authorization)"\s*,\s*"[^"]*"\s*\)/gi});function uV(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function vE(e,t=uV()){return e.installInstructions[t]}function lV(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function fV(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:dV}async function bE(e){try{let{exitCode:t,stdout:r,timedOut:n}=await gE(e.cmd,{timeout:fV()});if(n)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:lV(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 Gl(){let e=Object.entries(_E);return Promise.all(e.map(async([t,r])=>{let{available:n,version:s,timedOut:o}=await bE(r);return{key:t,name:r.name,purpose:r.purpose,required:r.required,available:n,version:s,timedOut:o,installInstruction:vE(r)}}))}async function bB(){let t=(await Gl()).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 wB(e){let r=cV[e].map((a)=>_E[a]).filter(Boolean),n=await Promise.all(r.map(async(a)=>{let i=await bE(a);return{check:a,available:i.available,timedOut:i.timedOut}}));for(let a of n)if(a.timedOut&&a.check.required)console.warn(`Warning: ${a.check.name} did not respond to a version check in time; continuing anyway.`);let s=n.filter((a)=>!a.available&&!a.timedOut&&a.check.required).map((a)=>({tool:a.check.name,installInstruction:vE(a.check)}));if(s.length===0)return;let o=[`
25
25
  Missing required tools:`];for(let a of s)o.push(` ${a.tool} not installed`),o.push(` Install: ${a.installInstruction}`);throw Error(o.join(`
26
- `))}var _E,cV,dV=4000;var wE=L(()=>{yE();_E={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)"}}},cV={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 EE;var $E=L(()=>{EE={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.39-dev.4760",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 uc;var Kl=L(()=>{$E();uc=EE.version});import{mkdirSync as mV,readdirSync as hV,unlinkSync as gV,writeFileSync as yV}from"fs";import{join as Hl}from"path";function PB(){Us=!0}function fc(){return Us}function CB(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function IB(e){TE=e,mr(`Step: ${e}`)}function jB(){RE=!0}function qB(){return RE}function DB(){if(kE)return;Wl=!0}function MB(){Wl=!1,kE=!0}function LB(){return Wl}function mr(e){if(Us)process.stderr.write(`[debug] ${e}
26
+ `))}var _E,cV,dV=4000;var wE=L(()=>{yE();_E={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)"}}},cV={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 EE;var $E=L(()=>{EE={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.39-dev.4761",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 uc;var Kl=L(()=>{$E();uc=EE.version});import{mkdirSync as mV,readdirSync as hV,unlinkSync as gV,writeFileSync as yV}from"fs";import{join as Hl}from"path";function PB(){Us=!0}function fc(){return Us}function CB(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function IB(e){TE=e,mr(`Step: ${e}`)}function jB(){RE=!0}function qB(){return RE}function DB(){if(kE)return;Wl=!0}function MB(){Wl=!1,kE=!0}function LB(){return Wl}function mr(e){if(Us)process.stderr.write(`[debug] ${e}
27
27
  `)}function wV(e){let t={};for(let[r,n]of Object.entries(e))t[r]=bV.has(r.toLowerCase())?"[REDACTED]":n;return t}function OE(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function Bl(e,t,r=0){if(r>EV)return"[REDACTED: depth]";if(Array.isArray(t))return t.map((n)=>Bl(e,n,r+1));if(t&&typeof t==="object"){let n={};for(let[s,o]of Object.entries(t))n[s]=Bl(s,o,r+1);return n}if(typeof t==="string"){if($V.test(e))return"[REDACTED]";return t.replace(AE,OE)}return t}function Yl(e){return e.replace(SV,"Bearer [REDACTED]").replace(xV,"[REDACTED_AWS_KEY]").replace(RV,"$1[REDACTED]").replace(kV,"$1$2=[REDACTED]").replace(AE,OE)}function TV(e){return Yl(e)}function SE(e,t=vV){if(e===void 0)return;let r=e;try{let n=JSON.parse(e);r=JSON.stringify(Bl("",n))}catch{}if(r=Yl(r),Buffer.byteLength(r,"utf8")>t)r=`${Buffer.from(r,"utf8").subarray(0,t).toString("utf8")}... [truncated]`;return r}function pc(e){if(!Us)return;let t=TV(e.url);try{let r={...e,url:t,requestHeaders:e.requestHeaders?wV(e.requestHeaders):void 0,requestBody:SE(e.requestBody),responseBody:SE(e.responseBody)};dc.push(r),mr(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(r){let n=fr(r);dc.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 AV(){let e=[];try{let t=process.versions.bun?`Bun ${process.versions.bun}`:`Node ${process.version}`;e.push(`CLI version: ${uc}`),e.push(`OS/Arch: ${process.platform}/${process.arch}`),e.push(`Runtime: ${t}`)}catch(t){e.push(`(could not read CLI/OS/runtime info: ${fr(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: ${fr(t)})`)}e.push(""),e.push("External tools:");try{let t=await Gl();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: ${fr(t)})`)}return e}async function OV(){return(await AV()).join(`
28
28
  `)}async function UB(){if(!Us||lc!==void 0)return;try{lc=await OV()}catch(e){let t=fr(e);lc=`(could not build environment report: ${t})`,mr(`environment snapshot failed: ${t}`)}}function NE(e){if(xE.has(e))return{flag:e};for(let t of xE){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 NV(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],s=NE(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 PV(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],s=NE(n);if(!s){t.push(n);continue}if(!s.kind&&r+1<e.length)r++}return t}function CV(e){let t=[];for(let n of PV(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 IV(e,t){let r=[];if(r.push("NEMAR CLI Debug Log"),r.push(`Generated: ${new Date().toISOString()}`),r.push(`Command: nemar ${Yl(NV(e).join(" "))}`),r.push(""),r.push(lc??"(environment snapshot unavailable)"),r.push(""),r.push("HTTP requests:"),dc.length===0)r.push(" (none)");else dc.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: ${TE??"(none recorded)"}`),r.push(`Exit code: ${t}`),`${r.join(`
29
29
  `)}
package/dist/index.js CHANGED
@@ -82,7 +82,7 @@ ${t}`,Pnt,Nnt,Int=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,o=Tnt.bind(nul
82
82
  `))this.#e+=Math.max(1,Math.ceil(pI(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.#p>=this.interval)this.#o=++this.#o%this.#i.frames.length,this.#p=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)cI.hide(this.#s);if(this.#r.discardStdin&&ok.stdin.isTTY)this.#t=!0,hI.start();return this.render(),this.#f=setInterval(this.render.bind(this),this.interval),this}stop(){if(!this.#l)return this;if(clearInterval(this.#f),this.#f=void 0,this.#o=0,this.clear(),this.#r.hideCursor)cI.show(this.#s);if(this.#r.discardStdin&&ok.stdin.isTTY&&this.#t)hI.stop(),this.#t=!1;return this}succeed(e){return this.stopAndPersist({symbol:mw.success,text:e})}fail(e){return this.stopAndPersist({symbol:mw.error,text:e})}warn(e){return this.stopAndPersist({symbol:mw.warning,text:e})}info(e){return this.stopAndPersist({symbol:mw.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
84
  `;return this.stop(),this.#s.write(l),this}}function A(e){return new _re(e)}var gw,Knt;var To=z(()=>{He();sre();are();dI();hre();yre();wre();gw=mt(QE(),1),Knt=mt(QE(),1)});var Pt,Ere,he,jl=(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 yw=z(()=>{(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}})(Pt||(Pt={}));(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(Ere||(Ere={}));he=Pt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"])});var ne,Js;var sk=z(()=>{yw();ne=Pt.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,Pt.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 Jnt=(e,t)=>{let n;switch(e.code){case ne.invalid_type:if(e.received===he.undefined)n="Required";else n=`Expected ${e.expected}, received ${e.received}`;break;case ne.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Pt.jsonStringifyReplacer)}`;break;case ne.unrecognized_keys:n=`Unrecognized key(s) in object: ${Pt.joinValues(e.keys,", ")}`;break;case ne.invalid_union:n="Invalid input";break;case ne.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Pt.joinValues(e.options)}`;break;case ne.invalid_enum_value:n=`Invalid enum value. Expected ${Pt.joinValues(e.options)}, received '${e.received}'`;break;case ne.invalid_arguments:n="Invalid function arguments";break;case ne.invalid_return_type:n="Invalid function return type";break;case ne.invalid_date:n="Invalid date";break;case ne.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 Pt.assertNever(e.validation);else if(e.validation!=="regex")n=`Invalid ${e.validation}`;else n="Invalid";break;case ne.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 ne.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 ne.custom:n="Invalid input";break;case ne.invalid_intersection_types:n="Intersection results could not be merged";break;case ne.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ne.not_finite:n="Number must be finite";break;default:n=t.defaultError,Pt.assertNever(e)}return{message:n}},yd;var gI=z(()=>{sk();yw();yd=Jnt});function bw(){return Ynt}var Ynt;var ik=z(()=>{gI();Ynt=yd});function fe(e,t){let n=bw(),r=ak({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===yd?void 0:yd].filter((o)=>!!o)});e.common.issues.push(r)}class Po{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(e,t){let n=[];for(let r of t){if(r.status==="aborted")return Ye;if(r.status==="dirty")e.dirty();n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){let n=[];for(let r of t){let o=await r.key,s=await r.value;n.push({key:o,value:s})}return Po.mergeObjectSync(e,n)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:o,value:s}=r;if(o.status==="aborted")return Ye;if(s.status==="aborted")return Ye;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 ak=(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}},Ye,sg=(e)=>({status:"dirty",value:e}),Jo=(e)=>({status:"valid",value:e}),yI=(e)=>e.status==="aborted",bI=(e)=>e.status==="dirty",vf=(e)=>e.status==="valid",ww=(e)=>typeof Promise<"u"&&e instanceof Promise;var wI=z(()=>{ik();gI();Ye=Object.freeze({status:"aborted"})});var Sre=()=>{};var Ne;var kre=z(()=>{(function(e){e.errToObj=(t)=>typeof t==="string"?{message:t}:t||{},e.toString=(t)=>typeof t==="string"?t:t?.message})(Ne||(Ne={}))});class ca{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 wt(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 At{get description(){return this._def.description}_getType(e){return jl(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:jl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Po,ctx:{common:e.parent.common,data:e.data,parsedType:jl(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(ww(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:jl(e)},r=this._parseSync({data:e,path:n.path,parent:n});return Rre(n,r)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:jl(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:t});return vf(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)=>vf(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:jl(e)},r=this._parse({data:e,path:n.path,parent:n}),o=await(ww(r)?r:Promise.resolve(r));return Rre(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:ne.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 nc({schema:this,typeName:Ze.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 tc.create(this,this._def)}nullable(){return bd.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ec.create(this)}promise(){return ug.create(this,this._def)}or(e){return Sw.create([this,e],this._def)}and(e){return kw.create(this,e,this._def)}transform(e){return new nc({...wt(this._def),schema:this,typeName:Ze.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let t=typeof e==="function"?e:()=>e;return new Cw({...wt(this._def),innerType:this,defaultValue:t,typeName:Ze.ZodDefault})}brand(){return new EI({typeName:Ze.ZodBranded,type:this,...wt(this._def)})}catch(e){let t=typeof e==="function"?e:()=>e;return new Aw({...wt(this._def),innerType:this,catchValue:t,typeName:Ze.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return hk.create(this,e)}readonly(){return Ow.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}function Dre(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 frt(e){return new RegExp(`^${Dre(e)}$`)}function mrt(e){let t=`${$re}T${Dre(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 hrt(e,t){if((t==="v4"||!t)&&irt.test(e))return!0;if((t==="v6"||!t)&&crt.test(e))return!0;return!1}function grt(e,t){if(!nrt.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 yrt(e,t){if((t==="v4"||!t)&&art.test(e))return!0;if((t==="v6"||!t)&&lrt.test(e))return!0;return!1}function brt(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 ig(e){if(e instanceof Qn){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=tc.create(ig(r))}return new Qn({...e._def,shape:()=>t})}else if(e instanceof ec)return new ec({...e._def,type:ig(e.element)});else if(e instanceof tc)return tc.create(ig(e.unwrap()));else if(e instanceof bd)return bd.create(ig(e.unwrap()));else if(e instanceof Bl)return Bl.create(e.items.map((t)=>ig(t)));else return e}function xI(e,t){let n=jl(e),r=jl(t);if(e===t)return{valid:!0,data:e};else if(n===he.object&&r===he.object){let o=Pt.objectKeys(t),s=Pt.objectKeys(e).filter((a)=>o.indexOf(a)!==-1),i={...e,...t};for(let a of s){let c=xI(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=xI(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 Cre(e,t){return new Sf({values:e,typeName:Ze.ZodEnum,...wt(t)})}var Rre=(e,t)=>{if(vf(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}}}},Xnt,Znt,Qnt,ert,trt,nrt,rrt,ort,srt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",_I,irt,art,crt,lrt,urt,drt,$re="((\\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])))",prt,Ul,ag,cg,ck,xw,lk,vw,Ew,uk,Ef,ql,dk,ec,Qn,Sw,Ll=(e)=>{if(e instanceof Rw)return Ll(e.schema);else if(e instanceof nc)return Ll(e.innerType());else if(e instanceof $w)return[e.value];else if(e instanceof Sf)return e.options;else if(e instanceof Dw)return Pt.objectValues(e.enum);else if(e instanceof Cw)return Ll(e._def.innerType);else if(e instanceof vw)return[void 0];else if(e instanceof Ew)return[null];else if(e instanceof tc)return[void 0,...Ll(e.unwrap())];else if(e instanceof bd)return[null,...Ll(e.unwrap())];else if(e instanceof EI)return Ll(e.unwrap());else if(e instanceof Ow)return Ll(e.unwrap());else if(e instanceof Aw)return Ll(e._def.innerType);else return[]},vI,kw,Bl,pk,fk,lg,_w,Rw,$w,Sf,Dw,ug,nc,tc,bd,Cw,Aw,mk,Len,EI,hk,Ow,Uen,Ze,b,D,qen,Ben,Q,Hen,zen,Gen,Ven,Wen,xs,Ken,Jen,Y,O,Yen,dg,SI,Xen,Zen,Fn,Qen,etn,ttn,ntn,ze,je,rtn,otn,stn,itn,atn,ctn,ltn;var Are=z(()=>{sk();ik();kre();wI();yw();Xnt=/^c[^\s-]{8,}$/i,Znt=/^[0-9a-z]+$/,Qnt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ert=/^[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,trt=/^[a-z0-9_-]{21}$/i,nrt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,rrt=/^[-+]?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)?)??$/,ort=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,irt=/^(?:(?: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])$/,art=/^(?:(?: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])$/,crt=/^(([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]))$/,lrt=/^(([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])$/,urt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,drt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,prt=new RegExp(`^${$re}$`);Ul=class Ul extends At{_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:ne.invalid_type,expected:he.string,received:o.parsedType}),Ye}let n=new Po,r=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.length<o.value)r=this._getOrReturnCtx(e,r),fe(r,{code:ne.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:ne.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:ne.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});else if(i)fe(r,{code:ne.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message});n.dirty()}}else if(o.kind==="email"){if(!ort.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"email",code:ne.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="emoji"){if(!_I)_I=new RegExp(srt,"u");if(!_I.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"emoji",code:ne.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="uuid"){if(!ert.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"uuid",code:ne.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="nanoid"){if(!trt.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"nanoid",code:ne.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid"){if(!Xnt.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"cuid",code:ne.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cuid2"){if(!Znt.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"cuid2",code:ne.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ulid"){if(!Qnt.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"ulid",code:ne.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:ne.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:ne.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:ne.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:ne.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:ne.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()}else if(o.kind==="datetime"){if(!mrt(o).test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{code:ne.invalid_string,validation:"datetime",message:o.message}),n.dirty()}else if(o.kind==="date"){if(!prt.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{code:ne.invalid_string,validation:"date",message:o.message}),n.dirty()}else if(o.kind==="time"){if(!frt(o).test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{code:ne.invalid_string,validation:"time",message:o.message}),n.dirty()}else if(o.kind==="duration"){if(!rrt.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"duration",code:ne.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="ip"){if(!hrt(e.data,o.version))r=this._getOrReturnCtx(e,r),fe(r,{validation:"ip",code:ne.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="jwt"){if(!grt(e.data,o.alg))r=this._getOrReturnCtx(e,r),fe(r,{validation:"jwt",code:ne.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="cidr"){if(!yrt(e.data,o.version))r=this._getOrReturnCtx(e,r),fe(r,{validation:"cidr",code:ne.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64"){if(!urt.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"base64",code:ne.invalid_string,message:o.message}),n.dirty()}else if(o.kind==="base64url"){if(!drt.test(e.data))r=this._getOrReturnCtx(e,r),fe(r,{validation:"base64url",code:ne.invalid_string,message:o.message}),n.dirty()}else Pt.assertNever(o);return{status:n.value,value:e.data}}_regex(e,t,n){return this.refinement((r)=>e.test(r),{validation:t,code:ne.invalid_string,...Ne.errToObj(n)})}_addCheck(e){return new Ul({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Ne.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Ne.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Ne.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Ne.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Ne.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Ne.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Ne.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Ne.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Ne.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Ne.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Ne.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Ne.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Ne.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,...Ne.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,...Ne.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Ne.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Ne.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...Ne.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Ne.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Ne.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Ne.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Ne.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Ne.errToObj(t)})}nonempty(e){return this.min(1,Ne.errToObj(e))}trim(){return new Ul({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ul({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ul({...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}};Ul.create=(e)=>new Ul({checks:[],typeName:Ze.ZodString,coerce:e?.coerce??!1,...wt(e)});ag=class ag extends At{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:ne.invalid_type,expected:he.number,received:o.parsedType}),Ye}let n=void 0,r=new Po;for(let o of this._def.checks)if(o.kind==="int"){if(!Pt.isInteger(e.data))n=this._getOrReturnCtx(e,n),fe(n,{code:ne.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:ne.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:ne.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),r.dirty()}else if(o.kind==="multipleOf"){if(brt(e.data,o.value)!==0)n=this._getOrReturnCtx(e,n),fe(n,{code:ne.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:ne.not_finite,message:o.message}),r.dirty()}else Pt.assertNever(o);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Ne.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ne.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ne.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ne.toString(t))}setLimit(e,t,n,r){return new ag({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ne.toString(r)}]})}_addCheck(e){return new ag({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Ne.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Ne.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Ne.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Ne.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Ne.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ne.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Ne.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Ne.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Ne.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"&&Pt.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)}};ag.create=(e)=>new ag({checks:[],typeName:Ze.ZodNumber,coerce:e?.coerce||!1,...wt(e)});cg=class cg extends At{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 Po;for(let o of this._def.checks)if(o.kind==="min"){if(o.inclusive?e.data<o.value:e.data<=o.value)n=this._getOrReturnCtx(e,n),fe(n,{code:ne.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:ne.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:ne.not_multiple_of,multipleOf:o.value,message:o.message}),r.dirty()}else Pt.assertNever(o);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return fe(t,{code:ne.invalid_type,expected:he.bigint,received:t.parsedType}),Ye}gte(e,t){return this.setLimit("min",e,!0,Ne.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Ne.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Ne.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Ne.toString(t))}setLimit(e,t,n,r){return new cg({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:Ne.toString(r)}]})}_addCheck(e){return new cg({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Ne.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Ne.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Ne.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Ne.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Ne.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}};cg.create=(e)=>new cg({checks:[],typeName:Ze.ZodBigInt,coerce:e?.coerce??!1,...wt(e)});ck=class ck extends At{_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:ne.invalid_type,expected:he.boolean,received:n.parsedType}),Ye}return Jo(e.data)}};ck.create=(e)=>new ck({typeName:Ze.ZodBoolean,coerce:e?.coerce||!1,...wt(e)});xw=class xw extends At{_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:ne.invalid_type,expected:he.date,received:o.parsedType}),Ye}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return fe(o,{code:ne.invalid_date}),Ye}let n=new Po,r=void 0;for(let o of this._def.checks)if(o.kind==="min"){if(e.data.getTime()<o.value)r=this._getOrReturnCtx(e,r),fe(r,{code:ne.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:ne.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()}else Pt.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new xw({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Ne.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Ne.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}};xw.create=(e)=>new xw({checks:[],coerce:e?.coerce||!1,typeName:Ze.ZodDate,...wt(e)});lk=class lk extends At{_parse(e){if(this._getType(e)!==he.symbol){let n=this._getOrReturnCtx(e);return fe(n,{code:ne.invalid_type,expected:he.symbol,received:n.parsedType}),Ye}return Jo(e.data)}};lk.create=(e)=>new lk({typeName:Ze.ZodSymbol,...wt(e)});vw=class vw extends At{_parse(e){if(this._getType(e)!==he.undefined){let n=this._getOrReturnCtx(e);return fe(n,{code:ne.invalid_type,expected:he.undefined,received:n.parsedType}),Ye}return Jo(e.data)}};vw.create=(e)=>new vw({typeName:Ze.ZodUndefined,...wt(e)});Ew=class Ew extends At{_parse(e){if(this._getType(e)!==he.null){let n=this._getOrReturnCtx(e);return fe(n,{code:ne.invalid_type,expected:he.null,received:n.parsedType}),Ye}return Jo(e.data)}};Ew.create=(e)=>new Ew({typeName:Ze.ZodNull,...wt(e)});uk=class uk extends At{constructor(){super(...arguments);this._any=!0}_parse(e){return Jo(e.data)}};uk.create=(e)=>new uk({typeName:Ze.ZodAny,...wt(e)});Ef=class Ef extends At{constructor(){super(...arguments);this._unknown=!0}_parse(e){return Jo(e.data)}};Ef.create=(e)=>new Ef({typeName:Ze.ZodUnknown,...wt(e)});ql=class ql extends At{_parse(e){let t=this._getOrReturnCtx(e);return fe(t,{code:ne.invalid_type,expected:he.never,received:t.parsedType}),Ye}};ql.create=(e)=>new ql({typeName:Ze.ZodNever,...wt(e)});dk=class dk extends At{_parse(e){if(this._getType(e)!==he.undefined){let n=this._getOrReturnCtx(e);return fe(n,{code:ne.invalid_type,expected:he.void,received:n.parsedType}),Ye}return Jo(e.data)}};dk.create=(e)=>new dk({typeName:Ze.ZodVoid,...wt(e)});ec=class ec extends At{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==he.array)return fe(t,{code:ne.invalid_type,expected:he.array,received:t.parsedType}),Ye;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?ne.too_big:ne.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:ne.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:ne.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 ca(t,s,t.path,i)))).then((s)=>Po.mergeArray(n,s));let o=[...t.data].map((s,i)=>r.type._parseSync(new ca(t,s,t.path,i)));return Po.mergeArray(n,o)}get element(){return this._def.type}min(e,t){return new ec({...this._def,minLength:{value:e,message:Ne.toString(t)}})}max(e,t){return new ec({...this._def,maxLength:{value:e,message:Ne.toString(t)}})}length(e,t){return new ec({...this._def,exactLength:{value:e,message:Ne.toString(t)}})}nonempty(e){return this.min(1,e)}};ec.create=(e,t)=>new ec({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ze.ZodArray,...wt(t)});Qn=class Qn extends At{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=Pt.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:ne.invalid_type,expected:he.object,received:c.parsedType}),Ye}let{status:n,ctx:r}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),i=[];if(!(this._def.catchall instanceof ql&&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 ca(r,d,r.path,c)),alwaysSet:c in r.data})}if(this._def.catchall instanceof ql){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:ne.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 ca(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,p=await l.value;c.push({key:d,value:p,alwaysSet:l.alwaysSet})}return c}).then((c)=>Po.mergeObjectSync(n,c));else return Po.mergeObjectSync(n,a)}get shape(){return this._def.shape()}strict(e){return Ne.errToObj,new Qn({...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:Ne.errToObj(e).message??r};return{message:r}}}:{}})}strip(){return new Qn({...this._def,unknownKeys:"strip"})}passthrough(){return new Qn({...this._def,unknownKeys:"passthrough"})}extend(e){return new Qn({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Qn({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ze.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Qn({...this._def,catchall:e})}pick(e){let t={};for(let n of Pt.objectKeys(e))if(e[n]&&this.shape[n])t[n]=this.shape[n];return new Qn({...this._def,shape:()=>t})}omit(e){let t={};for(let n of Pt.objectKeys(this.shape))if(!e[n])t[n]=this.shape[n];return new Qn({...this._def,shape:()=>t})}deepPartial(){return ig(this)}partial(e){let t={};for(let n of Pt.objectKeys(this.shape)){let r=this.shape[n];if(e&&!e[n])t[n]=r;else t[n]=r.optional()}return new Qn({...this._def,shape:()=>t})}required(e){let t={};for(let n of Pt.objectKeys(this.shape))if(e&&!e[n])t[n]=this.shape[n];else{let o=this.shape[n];while(o instanceof tc)o=o._def.innerType;t[n]=o}return new Qn({...this._def,shape:()=>t})}keyof(){return Cre(Pt.objectKeys(this.shape))}};Qn.create=(e,t)=>new Qn({shape:()=>e,unknownKeys:"strip",catchall:ql.create(),typeName:Ze.ZodObject,...wt(t)});Qn.strictCreate=(e,t)=>new Qn({shape:()=>e,unknownKeys:"strict",catchall:ql.create(),typeName:Ze.ZodObject,...wt(t)});Qn.lazycreate=(e,t)=>new Qn({shape:e,unknownKeys:"strip",catchall:ql.create(),typeName:Ze.ZodObject,...wt(t)});Sw=class Sw extends At{_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:ne.invalid_union,unionErrors:s}),Ye}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:ne.invalid_union,unionErrors:i}),Ye}}get options(){return this._def.options}};Sw.create=(e,t)=>new Sw({options:e,typeName:Ze.ZodUnion,...wt(t)});vI=class vI extends At{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==he.object)return fe(t,{code:ne.invalid_type,expected:he.object,received:t.parsedType}),Ye;let n=this.discriminator,r=t.data[n],o=this.optionsMap.get(r);if(!o)return fe(t,{code:ne.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ye;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=Ll(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 vI({typeName:Ze.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...wt(n)})}};kw=class kw extends At{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(o,s)=>{if(yI(o)||yI(s))return Ye;let i=xI(o.value,s.value);if(!i.valid)return fe(n,{code:ne.invalid_intersection_types}),Ye;if(bI(o)||bI(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}))}};kw.create=(e,t,n)=>new kw({left:e,right:t,typeName:Ze.ZodIntersection,...wt(n)});Bl=class Bl extends At{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==he.array)return fe(n,{code:ne.invalid_type,expected:he.array,received:n.parsedType}),Ye;if(n.data.length<this._def.items.length)return fe(n,{code:ne.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ye;if(!this._def.rest&&n.data.length>this._def.items.length)fe(n,{code:ne.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 ca(n,s,n.path,i))}).filter((s)=>!!s);if(n.common.async)return Promise.all(o).then((s)=>Po.mergeArray(t,s));else return Po.mergeArray(t,o)}get items(){return this._def.items}rest(e){return new Bl({...this._def,rest:e})}};Bl.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new Bl({items:e,typeName:Ze.ZodTuple,rest:null,...wt(t)})};pk=class pk extends At{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:ne.invalid_type,expected:he.object,received:n.parsedType}),Ye;let r=[],o=this._def.keyType,s=this._def.valueType;for(let i in n.data)r.push({key:o._parse(new ca(n,i,n.path,i)),value:s._parse(new ca(n,n.data[i],n.path,i)),alwaysSet:i in n.data});if(n.common.async)return Po.mergeObjectAsync(t,r);else return Po.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){if(t instanceof At)return new pk({keyType:e,valueType:t,typeName:Ze.ZodRecord,...wt(n)});return new pk({keyType:Ul.create(),valueType:e,typeName:Ze.ZodRecord,...wt(t)})}};fk=class fk extends At{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:ne.invalid_type,expected:he.map,received:n.parsedType}),Ye;let r=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([i,a],c)=>({key:r._parse(new ca(n,i,n.path,[c,"key"])),value:o._parse(new ca(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 Ye;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 Ye;if(c.status==="dirty"||l.status==="dirty")t.dirty();i.set(c.value,l.value)}return{status:t.value,value:i}}}};fk.create=(e,t,n)=>new fk({valueType:t,keyType:e,typeName:Ze.ZodMap,...wt(n)});lg=class lg extends At{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==he.set)return fe(n,{code:ne.invalid_type,expected:he.set,received:n.parsedType}),Ye;let r=this._def;if(r.minSize!==null){if(n.data.size<r.minSize.value)fe(n,{code:ne.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:ne.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 Ye;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 ca(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 lg({...this._def,minSize:{value:e,message:Ne.toString(t)}})}max(e,t){return new lg({...this._def,maxSize:{value:e,message:Ne.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};lg.create=(e,t)=>new lg({valueType:e,minSize:null,maxSize:null,typeName:Ze.ZodSet,...wt(t)});_w=class _w extends At{constructor(){super(...arguments);this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==he.function)return fe(t,{code:ne.invalid_type,expected:he.function,received:t.parsedType}),Ye;function n(i,a){return ak({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,bw(),yd].filter((c)=>!!c),issueData:{code:ne.invalid_arguments,argumentsError:a}})}function r(i,a){return ak({data:i,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,bw(),yd].filter((c)=>!!c),issueData:{code:ne.invalid_return_type,returnTypeError:a}})}let o={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof ug){let i=this;return Jo(async function(...a){let c=new Js([]),l=await i._def.args.parseAsync(a,o).catch((f)=>{throw c.addIssue(n(a,f)),c}),d=await Reflect.apply(s,this,l);return await i._def.returns._def.type.parseAsync(d,o).catch((f)=>{throw c.addIssue(r(d,f)),c})})}else{let i=this;return Jo(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 _w({...this._def,args:Bl.create(e).rest(Ef.create())})}returns(e){return new _w({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new _w({args:e?e:Bl.create([]).rest(Ef.create()),returns:t||Ef.create(),typeName:Ze.ZodFunction,...wt(n)})}};Rw=class Rw extends At{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})}};Rw.create=(e,t)=>new Rw({getter:e,typeName:Ze.ZodLazy,...wt(t)});$w=class $w extends At{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return fe(t,{received:t.data,code:ne.invalid_literal,expected:this._def.value}),Ye}return{status:"valid",value:e.data}}get value(){return this._def.value}};$w.create=(e,t)=>new $w({value:e,typeName:Ze.ZodLiteral,...wt(t)});Sf=class Sf extends At{_parse(e){if(typeof e.data!=="string"){let t=this._getOrReturnCtx(e),n=this._def.values;return fe(t,{expected:Pt.joinValues(n),received:t.parsedType,code:ne.invalid_type}),Ye}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:ne.invalid_enum_value,options:n}),Ye}return Jo(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 Sf.create(e,{...this._def,...t})}exclude(e,t=this._def){return Sf.create(this.options.filter((n)=>!e.includes(n)),{...this._def,...t})}};Sf.create=Cre;Dw=class Dw extends At{_parse(e){let t=Pt.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==he.string&&n.parsedType!==he.number){let r=Pt.objectValues(t);return fe(n,{expected:Pt.joinValues(r),received:n.parsedType,code:ne.invalid_type}),Ye}if(!this._cache)this._cache=new Set(Pt.getValidEnumValues(this._def.values));if(!this._cache.has(e.data)){let r=Pt.objectValues(t);return fe(n,{received:n.data,code:ne.invalid_enum_value,options:r}),Ye}return Jo(e.data)}get enum(){return this._def.values}};Dw.create=(e,t)=>new Dw({values:e,typeName:Ze.ZodNativeEnum,...wt(t)});ug=class ug extends At{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:ne.invalid_type,expected:he.promise,received:t.parsedType}),Ye;let n=t.parsedType===he.promise?t.data:Promise.resolve(t.data);return Jo(n.then((r)=>this._def.type.parseAsync(r,{path:t.path,errorMap:t.common.contextualErrorMap})))}};ug.create=(e,t)=>new ug({type:e,typeName:Ze.ZodPromise,...wt(t)});nc=class nc extends At{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ze.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 Ye;let a=await this._def.schema._parseAsync({data:i,path:n.path,parent:n});if(a.status==="aborted")return Ye;if(a.status==="dirty")return sg(a.value);if(t.value==="dirty")return sg(a.value);return a});else{if(t.value==="aborted")return Ye;let i=this._def.schema._parseSync({data:s,path:n.path,parent:n});if(i.status==="aborted")return Ye;if(i.status==="dirty")return sg(i.value);if(t.value==="dirty")return sg(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 Ye;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 Ye;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(!vf(s))return Ye;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(!vf(s))return Ye;return Promise.resolve(r.transform(s.value,o)).then((i)=>({status:t.value,value:i}))});Pt.assertNever(r)}};nc.create=(e,t,n)=>new nc({schema:e,typeName:Ze.ZodEffects,effect:t,...wt(n)});nc.createWithPreprocess=(e,t,n)=>new nc({schema:t,effect:{type:"preprocess",transform:e},typeName:Ze.ZodEffects,...wt(n)});tc=class tc extends At{_parse(e){if(this._getType(e)===he.undefined)return Jo(void 0);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};tc.create=(e,t)=>new tc({innerType:e,typeName:Ze.ZodOptional,...wt(t)});bd=class bd extends At{_parse(e){if(this._getType(e)===he.null)return Jo(null);return this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};bd.create=(e,t)=>new bd({innerType:e,typeName:Ze.ZodNullable,...wt(t)});Cw=class Cw extends At{_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}};Cw.create=(e,t)=>new Cw({innerType:e,typeName:Ze.ZodDefault,defaultValue:typeof t.default==="function"?t.default:()=>t.default,...wt(t)});Aw=class Aw extends At{_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(ww(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}};Aw.create=(e,t)=>new Aw({innerType:e,typeName:Ze.ZodCatch,catchValue:typeof t.catch==="function"?t.catch:()=>t.catch,...wt(t)});mk=class mk extends At{_parse(e){if(this._getType(e)!==he.nan){let n=this._getOrReturnCtx(e);return fe(n,{code:ne.invalid_type,expected:he.nan,received:n.parsedType}),Ye}return{status:"valid",value:e.data}}};mk.create=(e)=>new mk({typeName:Ze.ZodNaN,...wt(e)});Len=Symbol("zod_brand");EI=class EI extends At{_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}};hk=class hk extends At{_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 Ye;if(o.status==="dirty")return t.dirty(),sg(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 Ye;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 hk({in:e,out:t,typeName:Ze.ZodPipeline})}};Ow=class Ow extends At{_parse(e){let t=this._def.innerType._parse(e),n=(r)=>{if(vf(r))r.value=Object.freeze(r.value);return r};return ww(t)?t.then((r)=>n(r)):n(t)}unwrap(){return this._def.innerType}};Ow.create=(e,t)=>new Ow({innerType:e,typeName:Ze.ZodReadonly,...wt(t)});Uen={object:Qn.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"})(Ze||(Ze={}));b=Ul.create,D=ag.create,qen=mk.create,Ben=cg.create,Q=ck.create,Hen=xw.create,zen=lk.create,Gen=vw.create,Ven=Ew.create,Wen=uk.create,xs=Ef.create,Ken=ql.create,Jen=dk.create,Y=ec.create,O=Qn.create,Yen=Qn.strictCreate,dg=Sw.create,SI=vI.create,Xen=kw.create,Zen=Bl.create,Fn=pk.create,Qen=fk.create,etn=lg.create,ttn=_w.create,ntn=Rw.create,ze=$w.create,je=Sf.create,rtn=Dw.create,otn=ug.create,stn=nc.create,itn=tc.create,atn=bd.create,ctn=nc.createWithPreprocess,ltn=hk.create});var kI=z(()=>{ik();wI();Sre();yw();Are();sk()});var mn=z(()=>{kI();kI()});function RI(e){return gk.includes(e)}var wrt,kf,gk,Ore,_rt,Tre,xrt,Pre,vrt,Ert,Nre,Srt,Ire,_tn,xtn,Fre,krt,Mre,Rrt,jre,$I=20,DI=500,$rt,vtn;var pg=z(()=>{mn();wrt=je(["pending","verified","approved","revoked"]),kf=je(["person","service","test"]),gk=kf.options;Ore={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"},_rt=je(["same_kind","orcid_linked","own_account","kind_changed_concurrently"]),Tre=_rt.options,xrt=je(["active","pending","revoked"]),Pre=O({field:b(),blocks:Y(b()).optional(),set_on:Y(b()).optional()}).passthrough(),vrt=O({id:D().int(),username:b().nullable(),email:b(),github_username:b().nullable(),role:b(),orcid:b().nullable().optional(),created_at:b().optional(),approved_at:b().nullable().optional(),dataset_count:D().int().optional(),sandbox_completed:Q().optional(),sandbox_completed_at:b().nullable().optional(),sandbox_dataset_id:b().nullable().optional(),service_access:Q().optional(),status:wrt.optional(),email_verified:Q().optional(),orcid_verified:Q().optional(),given_name:b().nullable().optional(),family_name:b().nullable().optional(),profile_gaps:Y(Pre).optional(),username_auto_assigned:Q().optional(),account_kind:kf.optional(),compute_access:b().optional(),compute_access_requested_at:b().nullable().optional(),compute_access_granted_at:b().nullable().optional()}).passthrough(),Ert=O({prefix:b(),created_at:b(),last_used_at:b().nullable()}).passthrough().nullable(),Nre=O({user:vrt,token:Ert.optional()}).passthrough(),Srt=O({id:D().int(),username:b().nullable(),email:b(),github_username:b().nullable(),status:b(),email_verified:D().int().nullable().optional(),role:b().nullable(),created_at:b(),approved_at:b().nullable().optional(),revoked_at:b().nullable().optional(),signup_source:b().nullable().optional(),service_access:D().int().nullable().optional(),service_access_granted_at:b().nullable().optional(),given_name:b().nullable().optional(),family_name:b().nullable().optional(),orcid:b().nullable().optional(),upload_access_requested_at:b().nullable().optional(),account_kind:kf.optional(),matched_in:Y(b()).optional(),match_kind:b().optional()}).passthrough(),Ire=O({users:Y(Srt),count:D().int()}).passthrough(),_tn=je(["assigned","would_assign","single_name","no_name","lookup_failed","conflict","exhausted","write_failed"]),xtn=je(["sent","already_verified","skipped_fence","rate_limited","failed","not_attempted"]),Fre=O({suggestion:b().nullable(),based_on:je(["name","unavailable","exhausted"])}).passthrough(),krt=je(["why_required","email_not_verified","profile_incomplete","github_username_unverified","github_unavailable","already_approved"]),Mre=krt.options,Rrt=je(["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"]),jre=Rrt.options,$rt=O({id:D().int(),email:b(),username:b().nullable(),role:b(),status:xrt,email_verified:Q(),given_name:b().nullable(),family_name:b().nullable(),orcid:b().nullable(),orcid_verified:Q(),github_username:b().nullable(),city:b().nullable(),country:b().nullable(),affiliation:b().nullable(),service_access:Q(),service_access_granted_at:b().nullable(),upload_access_requested_at:b().nullable(),profile_gaps:Y(Pre),username_auto_assigned:Q(),compute_access:b().optional(),compute_access_requested_at:b().nullable().optional(),compute_access_granted_at:b().nullable().optional()}).passthrough(),vtn=O({user:$rt.nullable()}).passthrough()});var CI,AI,Rtn,Drt,$tn,Crt,Lre,Ure,OI=8,TI=100,qre,Bre,Art,Hre;var Tw=z(()=>{mn();pg();CI=["given_name","family_name","affiliation","city","country"],AI=["username","github_username","email","orcid"],Rtn=[...CI,...AI],Drt={given_name:b().max(200).optional(),family_name:b().max(200).optional(),affiliation:b().max(500).optional(),city:b().max(200).optional(),country:b().max(200).optional(),username:b().max(100).optional(),github_username:b().max(100).optional(),email:b().max(320).optional(),orcid:b().max(40).optional()},$tn=O(Drt),Crt=je(["field_not_editable","owner_only_field","edit_own_account","owner_account","system_account","invalid_edit","orcid_already_proven","invalid_search","invalid_user_id"]),Lre=Crt.options,Ure=["exact","name","prefix","substring","fuzzy"],qre=O({id:D().int(),username:b().nullable(),email:b(),github_username:b().nullable(),status:b(),role:b().nullable(),account_kind:kf.optional(),email_verified:D().int().nullable().optional(),orcid:b().nullable().optional(),orcid_verified:D().int().nullable().optional(),given_name:b().nullable().optional(),family_name:b().nullable().optional(),affiliation:b().nullable().optional(),city:b().nullable().optional(),country:b().nullable().optional(),description:b().nullable().optional(),signup_source:b().nullable().optional(),created_at:b(),updated_at:b().nullable().optional(),approved_at:b().nullable().optional(),revoked_at:b().nullable().optional(),deleted_at:b().nullable().optional(),service_access:D().int().nullable().optional(),service_access_granted_at:b().nullable().optional(),service_access_granted_by:D().int().nullable().optional(),upload_access_requested_at:b().nullable().optional(),upload_access_notified_at:b().nullable().optional(),compute_access:b().optional(),compute_access_requested_at:b().nullable().optional(),compute_access_notified_at:b().nullable().optional(),compute_access_granted_at:b().nullable().optional(),compute_access_granted_by:D().int().nullable().optional(),compute_terms_version:b().nullable().optional(),compute_terms_accepted_at:b().nullable().optional(),identity_conflict:D().int().nullable().optional(),username_auto_assigned:D().int().nullable().optional(),sandbox_completed:D().int().nullable().optional(),sandbox_completed_at:b().nullable().optional(),sandbox_dataset_id:b().nullable().optional(),aws_iam_username:b().nullable().optional(),dataset_count:D().int().optional(),active_tokens:D().int().optional(),linked_identities:Y(b()).optional()}).passthrough(),Bre=O({user:qre}).passthrough(),Art=O({from:b().nullable(),to:b().nullable()}),Hre=O({message:b(),changed:Fn(b(),Art),notes:Y(b()).optional(),old_address_notified:Q().optional(),user:qre}).passthrough()});function Prt(e){return e.startsWith("v")?e:`v${e}`}var Ort,Trt,zre,Atn;var PI=z(()=>{mn();Ort=/^v?\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/,Trt=/^v\d+\.\d+\.\d+(?:-(?:rc|alpha|beta)\d*)?$/;zre=b().regex(Ort,"must be a semver version, optionally v-prefixed").transform(Prt),Atn=b().regex(Trt,"must be the canonical v-prefixed tag (vX.Y.Z)")});function Vre(e,t){if(e.zarr_index_url!=null&&e.zarr_status!=="ready")t.addIssue({code:ne.custom,message:"zarr_index_url must be null/absent unless zarr_status is 'ready'",path:["zarr_index_url"]})}function Wre(e,t){if(e.zarr_verified_at!=null&&e.zarr_verify_status==null)t.addIssue({code:ne.custom,message:"zarr_verified_at must be null/absent unless zarr_verify_status is non-null",path:["zarr_verified_at"]})}var Nrt="0.4.1",NI,fg,Gre,Irt,Frt,Mrt,Kre,Ntn,Jre,Itn,Hl,jrt,yk,Ftn,Lrt,Urt,Mtn;var II=z(()=>{mn();PI();NI=je(["openneuro","nemar","gin","other"]),fg=dg([ze(0),ze(1)]).nullable(),Gre=O({dataset_id:b(),id:b().optional(),name:b(),description:b().nullable().optional(),status:b(),visibility:b(),anonymous:D().int().nullable().optional(),concept_doi:b().nullable().optional(),doi:b().nullable().optional(),created_at:b(),updated_at:b().optional(),first_published_at:b().nullable().optional(),owner_username:b().nullable().optional(),source:b().nullable().optional(),modalities:b().optional(),participants:D().int().nonnegative(),tasks:b().optional(),authors:b().optional(),license:b().optional(),file_size:D().nonnegative(),file_size_formatted:b().optional(),total_files:D().nonnegative().nullable().optional(),num_citations:D().int().nonnegative().optional(),n_channels:D().int().nullable().optional(),electrode_system:b().nullable().optional(),has_hed:fg.optional(),hed_version:b().nullable().optional(),data_complete:fg.optional(),bytes_present:D().nonnegative().nullable().optional(),latest_version:zre.nullable().optional(),latest_version_at:b().nullable().optional(),subject_count:D().int().nullable().optional(),file_size_bytes:D().nullable().optional(),sessions_count:D().int().nullable().optional(),age_min:D().nullable().optional(),age_max:D().nullable().optional(),bids_version:b().nullable().optional(),zarr_status:je(["pending","ready","failed"]).nullable().optional(),zarr_store_count:D().int().nullable().optional(),zarr_converted_at:b().nullable().optional(),zarr_source_commit:b().nullable().optional(),zarr_errors:D().int().nullable().optional(),zarr_failure_count:D().int().nullable().optional(),zarr_deterministic:fg.optional(),zarr_failed_at:b().nullable().optional(),zarr_index_url:b().nullable().optional(),zarr_verify_status:je(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:b().nullable().optional(),zarr_requeue_at:b().nullable().optional(),anonymity_status:je(["verified","findings","unverifiable"]).nullable().optional(),anonymity_checked_at:b().nullable().optional(),anonymity_findings:b().nullable().optional(),anonymity_unchecked:b().nullable().optional(),total_recording_duration:D().nullable().optional(),recording_duration_min:D().nullable().optional(),recording_duration_max:D().nullable().optional(),recording_count:D().int().nullable().optional(),recordings_unavailable:D().int().nullable().optional(),channel_count_min:D().int().nullable().optional(),channel_count_max:D().int().nullable().optional(),sampling_frequency:D().nullable().optional(),power_line_frequency:D().nullable().optional(),eeg_reference:b().nullable().optional(),placement_scheme:b().nullable().optional()}).passthrough();Irt=Gre.superRefine((e,t)=>{Vre(e,t),Wre(e,t)}),Frt=Gre.extend({file_size:D().nonnegative().nullable(),file_size_formatted:b().nullable().optional(),modalities:b().nullable().optional(),tasks:b().nullable().optional(),authors:b().nullable().optional(),license:b().nullable().optional(),owner_github:b().nullable().optional(),attestation_deposit_type:je(["owner","redistribution"]).nullable().optional(),attestation_key_status:je(["destroyed","retained"]).nullable().optional(),attestation_deidentified:fg.optional(),attestation_no_duplicate:fg.optional(),attestation_upstream_source:b().nullable().optional(),attestation_accepted_at:b().nullable().optional(),zarr_data_failures:O({count:D().int().nonnegative(),detail_ref:b(),compacted_by:b().optional(),pending:D().int().nonnegative().optional(),discovered:D().int().nonnegative().optional(),events_upload_failed:ze(!0).optional(),manifest_upload_failed:ze(!0).optional()}).passthrough().nullable().optional()}).passthrough().superRefine((e,t)=>{Vre(e,t),Wre(e,t)}),Mrt=O({id:b(),name:b(),modalities:b().nullable().optional(),participants:D().int().nullable().optional(),doi:b().nullable().optional(),tasks:b().nullable().optional(),authors:b().nullable().optional(),has_hed:fg.optional(),score:D().optional(),snippet:b().optional()}).passthrough(),Kre=Fn(b(),D().int().nonnegative()),Ntn=O({datasets:Y(Irt),count:D().int().nonnegative(),total_count:D().int().nonnegative().optional(),limit:D().int().optional(),offset:D().int().optional(),excluded_unknown:D().int().nonnegative().optional(),excluded_unknown_by_facet:Kre.optional()}).passthrough(),Jre=O({results:Y(Mrt),count:D().int().nonnegative(),returned:D().int().nonnegative().optional(),offset:D().int().nonnegative().optional(),limit:D().int().optional(),candidate_ceiling:D().int().optional(),truncated:Q().optional(),method:je(["exact_id","text","text_fallback","semantic","unavailable"]).optional(),min_score:D().optional(),reranked:ze(!0).optional(),corrected_query:b().optional(),modality_boost:Y(b()).optional(),warning:b().optional(),excluded_unknown:D().int().nonnegative().optional(),excluded_unknown_by_facet:Kre.optional()}).passthrough(),Itn=O({dataset:Frt}).passthrough(),Hl=O({value:b(),count:D().int().nonnegative()}),jrt=O({values:Y(Hl),distinct_total:D().int().nonnegative(),truncated:Q()}),yk=O({"electrode-system":Y(Hl).optional(),source:Y(Hl).optional(),zarr:Y(Hl).optional(),powerline:Y(Hl).optional(),"bids-version":Y(Hl).optional(),"hed-version":Y(Hl).optional(),license:Y(Hl).optional(),modality:Y(Hl).optional(),task:jrt.optional(),warning:b().optional()}).passthrough(),Ftn=O({schema_version:ze(Nrt),doc_type:ze("dataset"),dataset_id:b().regex(/^[a-z]{2}\d+$/,"neuroschema dataset_id pattern"),name:b(),source:NI,recording_modality:Y(b()).min(1),description:b().nullable().optional(),bids_version:b().nullable().optional(),license:b().nullable().optional()}).passthrough(),Lrt=O({tasks:Fn(O({runs:Y(b())}).passthrough())}).passthrough(),Urt=O({sessions:Y(b()),modalities:Fn(Lrt),session_modalities:Fn(Y(b())).optional()}).passthrough(),Mtn=O({version:b(),subjects:Fn(Urt)}).passthrough()});function bk(e){return typeof e==="string"&&Yre.includes(e)}var qrt,Utn,qtn,Btn,Yre,Brt="ci_check_unavailable",Xre,Zre,Qre,eoe="X-Approval-Dispatch-Token",Htn,toe="Search reflects this at once; the public dataset page and catalog list are cached at the edge and can keep showing the dataset for several minutes.";var mg=z(()=>{mn();qrt=/^\d{4}-\d{4}-\d{4}-\d{3}[\dX]$/,Utn=b().regex(qrt,"ORCID must be in format 0000-0000-0000-000X"),qtn=je(["found","no_public_name","lookup_failed"]),Btn=je(["bids_validation_failed","bids_validation_pending","bids_validation_in_progress","prescreen_failed","min_requirements_failed","owner_name_missing","identifier_screen_findings"]),Yre=["bids_validation_pending","bids_validation_in_progress"];Xre=[Brt],Zre=["identifier_screen_pending","identifier_screen_not_clear","identifier_screen_not_applicable"],Qre=["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"],Htn=je(["filled","would_fill","no_public_name","lookup_failed","write_failed"])});var Hrt,noe,Pw="https://nemar.org/settings",Vtn,zrt,Grt,Vrt,roe,ooe;var FI=z(()=>{mn();Hrt=je(["orcid_in_use","orcid_already_linked","orcid_linked_other","email_in_use","github_in_use","identity_conflict_remains"]),noe=Hrt.options,Vtn={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, ${Pw}).`,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, ${Pw}).`,orcid_linked_other:`That ORCID iD is linked to a different NEMAR account. Unlink it there first (Settings, ${Pw}), 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, ${Pw}).`,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, ${Pw}).`,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."},zrt=je(["orcid","email","github"]),Grt=O({id:D().int(),username:b().nullable(),email:b(),created_at:b(),has_oauth_identity:Q(),dataset_count:D().int(),identity_conflict:D().int(),canonical:Q()}).passthrough(),Vrt=O({kind:zrt,value:b(),canonical_user_id:D().int(),accounts:Y(Grt)}).passthrough(),roe=O({groups:Y(Vrt),group_count:D().int(),flagged_count:D().int()}).passthrough(),ooe=O({ok:ze(!0),id:D().int(),cleared:Q()}).passthrough()});var MI=120,soe=64,jI="unnamed machine",Wrt=25,wk,ioe,hg,aoe,Jtn,Ytn,coe,Krt,Jrt,loe,LI,uoe,Xtn,Ztn,_k,xk;var vk=z(()=>{mn();wk=je(["authorization_pending","slow_down","expired_token","access_denied","invalid_grant"]),ioe={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."},hg=je(["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"]),aoe=hg.options,Jtn={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 ${Wrt} 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."},Ytn=O({error:hg,message:b()}).passthrough(),coe=O({device_code:b(),user_code:b(),verification_uri:b(),verification_uri_complete:b(),expires_in:D().int(),interval:D().int()}).passthrough(),Krt=SI("error",[O({error:ze("authorization_pending"),message:b()}).passthrough(),O({error:ze("slow_down"),message:b()}).passthrough()]),Jrt=SI("error",[O({error:ze("expired_token"),reason:hg,message:b()}).passthrough(),O({error:ze("access_denied"),reason:hg,message:b()}).passthrough(),O({error:ze("invalid_grant"),reason:hg,message:b()}).passthrough()]),loe=dg([Krt,Jrt]),LI=O({id:D().int(),name:b().nullable(),prefix:b(),created_at:b(),last_used_at:b().nullable(),current:Q()}).passthrough(),uoe=O({api_key:b(),key:LI,user:O({username:b().nullable(),email:b(),github_username:b().nullable(),role:b(),sandbox_completed:Q(),sandbox_dataset_id:b().nullable()}).passthrough()}).passthrough(),Xtn=O({user_code:b(),machine_name:b(),requested_at:b(),expires_in:D().int(),account:O({username:b().nullable(),email_masked:b()}).passthrough(),refusal:O({code:hg,message:b()}).passthrough().nullable()}).passthrough(),Ztn=O({ok:ze(!0),machine_name:b()}).passthrough(),_k=O({keys:Y(LI)}).passthrough(),xk=O({api_key:b(),key:LI}).passthrough()});function vr(e){return Xe[e]}function zl(e,t){return e.replace(/\{(\w+)\}/g,(n,r)=>Object.hasOwn(t,r)?t[r]:n)}var Xe;var rc=z(()=>{Xe={"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.","compute_admin.page.title":"Compute","compute_admin.page.lede":"Compute access requests, and a read-only view of pools, usage, flagged jobs and reconciliation. A grant opens an allocation the person can spend, so each request is decided by a person, one at a time.","compute_admin.page.cli_note":"Owner policy, legal holds, record reads, moving a charge, pool grants and adjustments, and canceling a job are done with the nemar admin compute command in the command line, not here.","compute_admin.page.order_note":"Accounts are listed in the order they were created, not the order they asked in.","compute_admin.view.nav":"Compute views","compute_admin.view.requests":"Requests","compute_admin.view.pools":"Pools","compute_admin.view.usage":"Usage","compute_admin.view.flagged":"Flagged jobs","compute_admin.view.drift":"Reconciliation","compute_admin.state.nav":"Filter requests by state","compute_admin.state.requested":"Requested","compute_admin.state.active":"Active","compute_admin.state.suspended":"Suspended","compute_admin.state.denied":"Denied","compute_admin.state.revoked":"Revoked","compute_admin.state.all":"All","compute_admin.requests.none":"No accounts in this view.","compute_admin.pager.next":"Next page","compute_admin.pager.first":"First page","compute_admin.row.not_set":"not set","compute_admin.row.no_username":"no username","compute_admin.row.account_kind":"{kind} account","compute_admin.row.stated_country":"Stated country","compute_admin.row.stated_country_hint":"Check this against the export-control rules before granting. This page does not rule on it.","compute_admin.row.city":"City","compute_admin.row.affiliation":"Affiliation","compute_admin.row.email":"Email","compute_admin.row.orcid":"ORCID iD","compute_admin.row.requested":"Requested","compute_admin.row.terms":"Terms accepted","compute_admin.row.terms_value":"{version}, {date}","compute_admin.row.purpose":"Stated purpose","compute_admin.row.show_full_purpose":"Show full purpose","compute_admin.row.granted":"Granted {date} by account #{id}","compute_admin.row.not_notified":"No administrator has been emailed about this request yet.","compute_admin.row.open_in_users":"Open in Users","compute_admin.action.grant":"Grant","compute_admin.action.grant_again":"Grant again","compute_admin.action.lift_suspension":"Lift suspension","compute_admin.action.deny":"Deny","compute_admin.action.suspend":"Suspend","compute_admin.action.revoke":"Revoke","compute_admin.self_grant.disabled":"You cannot grant your own compute access. Ask another administrator or an owner.","compute_admin.dialog.title.grant":"Grant compute access?","compute_admin.dialog.title.deny":"Deny this request?","compute_admin.dialog.title.suspend":"Suspend compute access?","compute_admin.dialog.title.revoke":"Revoke compute access?","compute_admin.dialog.consequence.grant":"Opens the owner\u2019s default allocation once for this account (a repeat grant adds nothing), unfreezes the account\u2019s pools, and allows the person to use compute when it is available. The person is emailed when they have an email address that can receive it.","compute_admin.dialog.consequence.deny":"Closes this request. The person cannot ask again; only an administrator can grant later. The person is emailed when they have an email address that can receive it.","compute_admin.dialog.consequence.suspend":"Freezes the account\u2019s pools, cancels its live jobs and ends its compute sign-ins. A partner reservation that has no job reported under it is not canceled here: it is released after it expires, and a job reported under it is refused. A grant lifts the suspension. The person is emailed when they have an email address that can receive it.","compute_admin.dialog.consequence.revoke":"Freezes the account\u2019s pools, cancels its live jobs and ends its compute sign-ins. A partner reservation that has no job reported under it is not canceled here: it is released after it expires, and a job reported under it is refused. Only a new grant restores access. The person is emailed when they have an email address that can receive it.","compute_admin.dialog.reason_label":"Reason (optional)","compute_admin.dialog.reason_hint":"Recorded in the audit log. The person is not sent it.","compute_admin.dialog.reason_count":"{count} of {max}","compute_admin.dialog.notice_label":"Notice to the person","compute_admin.dialog.notice_label_optional":"Notice to the person (optional)","compute_admin.dialog.notice_help":"Emailed to the person under a fixed heading, with how to ask for a review. Write it for them. It is not the reason, which stays in the audit log.","compute_admin.dialog.notice_required_hint":"A suspension or a revocation tells the person why. Write the notice to confirm.","compute_admin.dialog.ack_export_review":"Confirm that you have reviewed this person\u2019s name, affiliation and stated country against the export-control rules","compute_admin.dialog.type_word":"Type {word} to confirm","compute_admin.dialog.cancel":"Cancel","compute_admin.result.working":"Working","compute_admin.result.granted":"Granted.","compute_admin.result.granted_opened":"Granted. Opened {cpu} CPU SU and {gpu} GPU SU.","compute_admin.result.granted_zero_default":"Granted. The owner\u2019s default allocation is zero, so nothing was opened.","compute_admin.result.granted_already":"Granted. An earlier grant already opened the default allocation, so nothing more was opened.","compute_admin.result.granted_other":"Granted. The allocation answered: {reason}.","compute_admin.result.denied":"Denied.","compute_admin.result.suspended":"Suspended. The account\u2019s pools are frozen and its live jobs are being canceled. A partner reservation with no job reported under it is left to expire.","compute_admin.result.revoked":"Revoked. The account\u2019s pools are frozen and its live jobs are being canceled. A partner reservation with no job reported under it is left to expire.","compute_admin.result.email_not_sent":"The decision stands, but the person could not be emailed. Tell them.","compute_admin.result.state_changed":"Someone else may have decided this first. The row shows the current state.","compute_admin.result.unconfirmed":"The result is not confirmed. The row shows what the server says now.","compute_admin.result.check_email":"The decision is in place, but the answer was lost, so check that the person was emailed and tell them if not.","compute_admin.result.stale":"This account was not found. Reload the page.","compute_admin.result.reread_failed":"The current state could not be read. Reload the page before deciding again.","compute_admin.result.signed_out":"You are signed out. Sign in again, then retry.","compute_admin.error.malformed":"The server sent an answer this page could not read.","compute_admin.error.unreachable":"The server could not be reached. Check your connection and try again.","compute_admin.error.redirect":"The server answered in a way this page cannot follow. Try again later.","compute_admin.error.origin":"This page was not accepted as the source of the request. Reload and try again.","compute_admin.error.rate_limited":"Too many requests. Wait a moment, then try again.","compute_admin.error.timeout":"The server did not answer in time. Try again.","compute_admin.error.failed":"The request failed ({status}). Try again.","compute_admin.error.generic":"Something went wrong. Try again.","compute_admin.error.bad_id":"That is not an account id.","compute_admin.error.bad_decision":"That is not a decision.","compute_admin.error.reason_too_long":"A reason is at most {max} characters.","compute_admin.error.notice_required":"This decision needs a notice to the person.","compute_admin.error.notice_refused":"A grant does not take a notice to the person.","compute_admin.error.notice_too_long":"A notice is at most {max} characters.","compute_admin.error.notice_control_char":"A notice may not contain control characters other than newline and tab.","compute_admin.error.bad_quarter":"A quarter is written like 2026Q4.","compute_admin.section.failed":"Could not load {what}: {reason}","compute_admin.col.holder":"Holder","compute_admin.col.pool":"Pool","compute_admin.col.granted":"Granted (SU)","compute_admin.col.held":"Held (SU)","compute_admin.col.charged":"Charged (SU)","compute_admin.col.available":"Available (SU)","compute_admin.col.frozen":"Frozen","compute_admin.col.updated":"Updated","compute_admin.col.partition":"Partition","compute_admin.col.source":"Front door","compute_admin.col.users":"Distinct people","compute_admin.col.jobs":"Jobs","compute_admin.col.job":"Job","compute_admin.col.account":"Account","compute_admin.col.state":"State","compute_admin.col.flags":"Flags","compute_admin.col.failure":"Failure","compute_admin.col.created":"Created","compute_admin.col.ended":"Ended","compute_admin.col.slurm":"Scheduler job","compute_admin.col.elapsed":"Elapsed (s)","compute_admin.col.resources":"Nodes, CPUs, GPUs","compute_admin.col.ingested":"Ingested","compute_admin.ref.account":"account #{id}","compute_admin.ref.no_account":"no account","compute_admin.pools.platform":"Platform budgets","compute_admin.pools.partner":"Partner pools","compute_admin.pools.account":"Account pools","compute_admin.pools.none_platform":"No platform budgets are recorded.","compute_admin.pools.none":"No pools are recorded in this group.","compute_admin.pools.truncated":"Showing the first {shown} pools of this group; more exist.","compute_admin.pools.frozen":"Frozen","compute_admin.pools.open":"Open","compute_admin.usage.quarter":"Quarter","compute_admin.usage.counts_note":"These are counts of people and jobs, not service units. A person is counted once however many jobs they ran, and jobs that skipped the reservation or could not be attributed are left out.","compute_admin.usage.totals":"Total","compute_admin.usage.none":"No jobs were recorded in this quarter.","compute_admin.flag.nav":"Filter jobs by flag","compute_admin.flag.unreserved":"Unreserved","compute_admin.flag.unattributed":"Unattributed","compute_admin.flag.mismatch":"Mismatch","compute_admin.flag.overrun":"Overrun","compute_admin.flag.meaning.unreserved":"The job skipped the reservation. Its charge went to a partner pool and not to a person.","compute_admin.flag.meaning.unattributed":"The job skipped the reservation and its owner maps to no active account.","compute_admin.flag.meaning.mismatch":"NEMAR\u2019s record and the scheduler\u2019s accounting disagree for this job, or a partner\u2019s report for it was refused or could not be checked, or a partner job used more than its hold and was capped.","compute_admin.flag.meaning.overrun":"The job used more than its hold, and the excess is recorded as an overrun in the ledger.","compute_admin.flag.followup":"Moving the charge of an unreserved job to a person is an owner action in the command line.","compute_admin.flagged.none":"No jobs carry this flag. That is a fact about this read only.","compute_admin.flagged.platform_failure":"NEMAR\u2019s fault","compute_admin.flagged.partner":"Partner: {state}, {flag}","compute_admin.drift.paused":"Reconciliation is paused while compute is off. An empty list below does not mean nothing is unmatched.","compute_admin.drift.pause_unknown":"Whether reconciliation is running is not known, so an empty list does not mean nothing is unmatched.","compute_admin.drift.status":"Status","compute_admin.drift.compute_on":"Compute is on.","compute_admin.drift.compute_off":"Compute is off.","compute_admin.drift.tapis":"Scheduler gateway: token {token}, health {health}.","compute_admin.drift.attention":"Needs a person to look","compute_admin.drift.attention_none":"No attention count is positive.","compute_admin.drift.unmatched":"Accounting rows no job claims","compute_admin.drift.unmatched_shown":"Showing the newest {shown} of {total}.","compute_admin.drift.unmatched_none":"No accounting rows are waiting for a job.","compute_admin.drift.not_priced":"not priced","compute_admin.drift.mismatch":"Jobs flagged mismatch","compute_admin.drift.mismatch_more":"See the Flagged jobs view for the rest","compute_admin.unavailable.title":"Not available yet","compute_admin.unavailable.usage_by_day":"Service units charged by day, partition and front door across the platform are not served by any admin read yet.","compute_admin.unavailable.drift_difference":"The difference between NEMAR\u2019s ledger and the supercomputer\u2019s accounting, per job or per day, and the tolerance it is measured against are not served by any admin read yet. No row is marked over tolerance because this page has no tolerance to apply.","compute_admin.unavailable.link":"Tracking issue","compute_admin.badge.awaiting_decision":"awaiting decision","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.","mail.category.news.label":"News","mail.category.news.description":"New features, data and events.","mail.category.rfcs.label":"Requests for comments","mail.category.rfcs.description":"A new NEMAR request for comments is open for discussion.","mail.category.maintenance.label":"Maintenance","mail.category.maintenance.description":"Planned downtime and changes to the service.","mail.category.recall.label":"Recalls","mail.category.recall.description":"A dataset, release or credential NEMAR distributed has a problem you need to act on.","mail.recall.why":"Recalls cannot be turned off: they tell you to stop using, delete or replace something NEMAR distributed or issued, because continuing to use it can cause harm.","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."}});var gg="2026-11-draft",Ek=!1;var Nw=()=>{};function Xrt(e){return e==="verified"||e==="upload_access"||e==="compute_access"||e==="publication"}function Rf(e){return(e??"").trim().length===0}function Zrt(e){return e==="service"||e==="test"}function foe(e,t={}){let n=t.orcidVerified===!0,r=Object.hasOwn(Sk,e)?Sk[e]:void 0;if(!r)return{field:e,label:e,blocks:t.blocks??[],setOnWeb:Xe["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:Xe[r.labelKey],setOnWeb:Xe[o?r.orcidWebKey:r.webKey],setOnCli:o||r.cliKey===null?null:Xe[r.cliKey],known:!0}}function doe(e){let t=UI.indexOf(e);return t===-1?UI.length:t}function moe(e,t={}){return e.map((n)=>foe(n,{orcidVerified:t.orcidVerified}))}function yg(e,t={}){return e.filter((n)=>!!n&&typeof n.field==="string").map((n)=>{let r=Array.isArray(n.blocks)?n.blocks.filter(Xrt):[];return foe(n.field,{orcidVerified:t.orcidVerified,blocks:r.length>0?r:void 0})}).sort((n,r)=>doe(n.field)-doe(r.field))}function qI(e){let t=e.blocks[0],n=t?Xe[Yrt[t]]:Xe["gap.blocks.unknown"],r=zl(Xe["gap.sentence"],{label:"",blocks:n}).trimStart(),o=e.setOnCli?zl(Xe["gap.set_on.both"],{web:e.setOnWeb,cli:e.setOnCli}):zl(Xe["gap.set_on.web"],{web:e.setOnWeb});return`${r} ${o}`}function kk(e){return`${e.label} ${qI(e)}`}function Rk(){let e=zl(Xe["gap.sentence"],{label:poe.label,blocks:Xe["cli.gap.blocks.sandbox"]}),t=zl(Xe["cli.gap.set_on.cli_only"],{cli:poe.command});return`${e} ${t}`}function hoe(){return Xe["cli.gaps.sandbox_unchecked"]}var Sk,UI,onn,Yrt,poe;var $f=z(()=>{rc();Nw();Sk={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&&Rf(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)=>Rf(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)=>Rf(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&&!Zrt(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)=>Rf(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)=>Rf(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)=>Rf(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)=>Rf(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}},UI=Object.keys(Sk),onn=UI.filter((e)=>Sk[e].isMissing!==null),Yrt={verified:"gap.blocks.verified",upload_access:"gap.blocks.upload_access",compute_access:"gap.blocks.compute_access",publication:"gap.blocks.publication"};poe={field:"sandbox",label:Xe["cli.gap.field.sandbox.label"],command:Xe["cli.gap.field.sandbox.set_on.cli"]}});function goe(e){return typeof e==="string"&&Iw.includes(e)}function yoe(e){return typeof e==="string"&&vs.includes(e)}function oc(e){return Xe[`mail.category.${e}.label`]}function BI(e){return Xe[`mail.category.${e}.description`]}function bg(){return Xe["mail.recall.why"]}function Qrt(e){return e.replace(/\r\n?/g,`
85
- `).trim().split(/\n{2,}/).map((t)=>t.trim()).filter((t)=>t!=="")}function eot(e){let t=/^(#{1,3})\s+(.+)$/.exec(e);if(!t)return null;return{level:t[1].length,text:t[2]}}function woe(e){let t=new Set(Qrt(e).map((n)=>eot(n)?.text.trim().toLowerCase()).filter((n)=>Boolean(n)));return HI.filter((n)=>!t.has(n.toLowerCase()))}function _oe(e){let t=e.trim(),n=tot.exec(t);if(n)return{kind:"dataset",datasetId:n[1],version:n[2]??null,text:t};if(not.test(t))return{kind:"github",url:t,text:t};return null}var vs,Iw,Df="recall",boe,HI,tot,not,xoe="A recall needs a reference: a dataset id with an optional version (nm000104 or nm000104@v1.2.0), or a nemarOrg or nemarDatasets issue, pull request or security advisory URL.";var Fw=z(()=>{rc();vs=["news","rfcs","maintenance"],Iw=[...vs,"recall"];boe=["recall_cannot_be_turned_off","admin_alert_not_self_service","unknown_mail_preference","invalid_mail_preference"];HI=["What is affected","What to do"];tot=/^([a-z]{2}\d{6})(?:@v?(\d+\.\d+\.\d+))?$/,not=/^https:\/\/github\.com\/(?:nemarOrg|nemarDatasets)\/[A-Za-z0-9._-]+\/(?:(?:issues|pull)\/\d{1,9}|security\/advisories\/GHSA(?:-[a-z0-9]{4}){3})$/});function Ak(e,t){let n=e.sss!==void 0;if(e.derived!==n)t.addIssue({code:ne.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 Yo,$k,voe,Dk,rot,Ck,oot,sot,iot,aot,cot,lnn,lot,unn,uot,dnn;var zI=z(()=>{mn();Yo=/^[a-z]{2}[0-9]{6}$/,$k=/^[0-9a-f]{40}$/,voe=O({name:b(),modality:b().nullable().optional(),rate:D().nullable().optional(),n_channels:D().int().nonnegative().nullable().optional(),n_samples:D().int().nonnegative().nullable().optional(),duration_s:D().nonnegative().nullable().optional(),source_rate_hz:D().nullable().optional(),n_view_levels:D().int().nonnegative().optional(),view_chunk_columns:D().int().positive().optional(),chunk_samples:D().int().positive().optional(),shard_samples:D().int().positive().optional()}).passthrough(),Dk=O({converted:D().int().nonnegative().optional(),relabelled:D().int().nonnegative().optional(),kept_importer_unit:D().int().nonnegative().optional(),units_column_present:Q().optional(),sidecar:b().optional(),sidecar_supplied:Q().optional(),unmatched_channels:D().int().nonnegative().optional(),unmatched_case_only:D().int().positive().optional(),matched_case_only:D().int().positive().optional(),matched_case_only_examples:Y(b()).max(5).optional(),unmatched_raw_label:D().int().positive().optional(),unmatched_examples:Y(b()).max(5).optional()}).passthrough(),rot=O({channels_tsv:D().int().positive(),in_file:D().int().nonnegative(),in_store:D().int().nonnegative()}).passthrough(),Ck=O({applied:Q().optional(),method:b().optional(),calibration:b().optional(),cross_talk:b().optional(),mne_version:b().optional()}).passthrough();oot=O({path:b(),zarr:b().regex(/\.zarr$/,"must end in .zarr"),updated_utc:b().optional(),source_tree:ze("raw"),derived:Q(),modalities:Y(b()).optional(),groups:Y(voe).optional(),power_line_frequency:D().nullable().optional(),event_description_count:D().int().nonnegative().optional(),n_events:D().int().nonnegative().optional(),trial_types:Fn(b(),D().int().nonnegative()).optional(),units_report:Dk.optional(),channels_tsv_read_error:Q().optional(),channels_tsv_count_mismatch:rot.optional(),split_members:Y(b()).optional(),sss:Ck.optional()}).passthrough().superRefine(Ak),sot=O({path:b(),zarr:b().regex(/\.zarr$/,"must end in .zarr").optional(),code:b(),reason:b(),detail:b().nullable().optional(),attempts:D().int().nonnegative().optional()}).passthrough(),iot=je(["infra_failure","memory_budget","not_attempted"]),aot=O({path:b(),zarr:b().regex(/\.zarr$/,"must end in .zarr"),reason:iot,attempts:D().int().nonnegative(),last_error:b().nullable().optional(),last_attempt_utc:b().nullable().optional()}).passthrough(),cot=O({level0:ze("<zarr>/<group>/0"),view:ze("<zarr>/<group>/view/<L>"),view_levels:ze("1..n_view_levels from the group attrs"),scale_offset:ze("level-0 array attrs scale[] and offset[]; physical = digital * scale + offset"),events:ze("<data_base>events.parquet").optional()}).passthrough(),lnn=O({format:ze("nemar-zarr-index"),format_version:ze(3),dataset_id:b().regex(Yo,"NEMAR dataset id (nm/on/xx band)"),contract_base:b().regex(/^https:\/\//,"must be https"),data_base:b().regex(/^https:\/\//,"must be https"),data_base_kind:ze("s3-public"),s3_uri:b().regex(/^s3:\/\//,"must be an s3:// URI"),s3_region:b().min(1),s3_anonymous:Q(),source_commit:b().regex($k,"must be a full 40-hex SHA"),engine_version:b().min(1),biosigio_version:b().nullable().optional(),updated_utc:b(),discovered_count:D().int().nonnegative(),store_count:D().int().nonnegative(),n_recordings:D().int().nonnegative(),errors:D().int().nonnegative(),failure_count:D().int().nonnegative(),pending_count:D().int().nonnegative(),stores:Y(oot),failures:Y(sot),pending:Y(aot),doi:b().nullable().optional(),license:b().nullable().optional(),citation:b().nullable().optional(),hed_version:b().nullable().optional(),events_parquet:b().regex(/^https:\/\//,"must be https").optional(),events_row_count:D().int().nonnegative().optional(),layout:cot}).passthrough(),lot=O({name:b(),configuration:Fn(b(),xs()).optional()}).passthrough(),unn=O({zarr_format:ze(3),node_type:ze("array"),shape:Y(D().int().nonnegative()),data_type:b(),chunk_grid:O({name:b(),configuration:Fn(b(),xs()).optional()}).passthrough(),codecs:Y(lot),fill_value:xs().optional(),attributes:Fn(b(),xs()).optional(),dimension_names:Y(b().nullable()).optional()}).passthrough(),uot=O({path:b(),zarr:b().regex(/\.zarr$/,"must end in .zarr"),groups:Y(voe).optional(),modalities:Y(b()).optional()}).passthrough(),dnn=O({format:ze("nemar-zarr-index"),format_version:D().int(),dataset_id:b().regex(Yo,"NEMAR dataset id (nm/on/xx band)"),source_commit:b(),stores:Y(uot)}).passthrough()});function Eoe(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 dot,pot,fot,mot,sc,mnn;var Ok=z(()=>{II();dot=["10-05","10-10","10-20","biosemi","egi-geodesic","other"],pot=["50","60"],fot=["ready","pending","failed"],mot=NI.options,sc=[{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:pot},{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:dot},{key:"source",flag:"--source",queryParam:"source",valueKind:"enum",label:"Source archive",enumValues:mot},{key:"zarr",flag:"--zarr",queryParam:"zarr",valueKind:"enum",label:"Zarr conversion status",enumValues:fot},{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"}],mnn=new Map(sc.map((e)=>[e.key,e]))});var hot,wnn,got,Doe,Mw,Soe,yot,Coe,bot=20,wot=100,_ot,Aoe,xot,_nn,xnn,vot,vnn,Enn,Eot,Sot,kot,Snn,Rot=50,$ot=500,knn,Dot,Cot,Rnn,Aot=1000,Oot=5000,koe=8,Tot=100,Pot=32,Roe,$nn,Not,Iot,Fot,Dnn,Mot=800,jot=4000,Cnn,Ann,GI=60,VI=64,$oe,Lot=86400,Uot=4096,Onn,qot,Bot,Tnn;var Ooe=z(()=>{mn();Ok();zI();hot=O({dataset_id:b().regex(Yo),name:b(),doi:b().nullable().optional(),license:b().nullable().optional(),modalities:Y(b()).optional(),tasks:Y(b()).optional(),subject_count:D().int().nonnegative().nullable().optional(),has_hed:dg([ze(0),ze(1)]).nullable().optional(),hed_version:b().nullable().optional(),store_count:D().int().nonnegative().nullable().optional(),recording_count:D().int().nonnegative().nullable().optional(),recordings_unavailable:D().int().nonnegative().nullable().optional(),total_recording_duration:D().nullable().optional(),zarr_converted_at:b().nullable().optional(),zarr_source_commit:b().nullable().optional(),zarr_errors:D().int().nonnegative().nullable().optional(),zarr_verify_status:je(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:b().nullable().optional(),index_url:b().nullable().optional()}).passthrough(),wnn=O({format:ze("nemar-zarr-catalog"),format_version:D().int(),generated_utc:b(),contract_base:b(),count:D().int().nonnegative(),datasets:Y(hot)}).passthrough(),got=["verified","failed","unverifiable"],Doe=je(got).nullable(),Mw=O({dataset_id:b().regex(Yo),doi:b().nullable(),license:b().nullable(),citation:b().nullable(),source_commit:b().regex($k),index_etag:b().nullable(),engine_version:b(),source_tree:ze("raw"),derived:Q(),sss:Ck.optional(),lossy:Q(),dtype:b().nullable(),effective_rate_hz:D().nullable(),source_rate_hz:D().nullable(),units_report:Dk.nullable().optional(),zarr_verify_status:Doe,note:b().nullable().optional()}).passthrough().superRefine(Ak),Soe=O({start:D().int().nonnegative(),end:D().int().nonnegative()}).passthrough().refine((e)=>e.end>=e.start,{message:"end must be >= start",path:["end"]}),yot=O({python_zarr:b(),zarrita:b(),python_browser:b()}).passthrough(),Coe=O({contract_base:b(),data_base:b(),s3_uri:b(),s3_region:b(),s3_anonymous:Q(),zarr:b(),group:b(),level:dg([ze("0"),D().int().positive()]),array_path:b(),dtype:b().nullable(),codecs:Y(xs()).optional(),chunk_samples:D().int().positive().nullable(),shard_samples:D().int().positive().nullable(),n_channels:D().int().nonnegative().nullable(),sample_slice:Soe.optional(),channel_slice:Soe.optional(),scale_offset:b(),how_to:yot}).passthrough(),_ot=Object.fromEntries(sc.map((e)=>[e.queryParam,b().optional()])),Aoe={modality:b().optional(),task:b().optional(),has_hed:Q().optional(),has_zarr:Q().optional(),author:b().optional(),has_doi:Q().optional(),has_zarr_verified:Q().optional(),data_complete:Q().optional(),recent:D().int().positive().optional(),license:b().optional()},xot=Object.keys(Aoe),_nn=[...xot,...sc.map((e)=>e.queryParam)],xnn=O({query:b().optional(),...Aoe,include_unknown:Q().optional(),..._ot,limit:D().int().positive().max(wot).default(bot)}).passthrough(),vot=O({dataset_id:b().regex(Yo),name:b(),doi:b().nullable().optional(),license:b().nullable().optional(),modalities:Y(b()).optional(),tasks:Y(b()).optional(),subject_count:D().int().nullable().optional(),has_hed:Q().nullable().optional(),has_zarr:Q()}).passthrough(),vnn=O({results:Y(vot),count:D().int().nonnegative(),limit:D().int(),note:b().nullable().optional(),truncated:Q().optional()}).passthrough(),Enn=O({dataset_id:b().regex(Yo)}).passthrough(),Eot=["list_recordings","get_events","render_overview","read_window"],Sot=O({next_cheapest_tool:je(Eot),reason:b()}).passthrough(),kot=["pending","ready","failed"],Snn=O({dataset_id:b().regex(Yo),name:b(),doi:b().nullable(),license:b().nullable(),citation:b().nullable(),modalities:Y(b()).optional(),tasks:Y(b()).optional(),subject_count:D().int().nullable().optional(),has_hed:Q().nullable().optional(),hed_version:b().nullable().optional(),recording_count:D().int().nullable().optional(),total_recording_duration_s:D().nullable().optional(),zarr_status:je(kot).nullable().optional(),zarr_verify_status:Doe.optional(),zarr_source_commit:b().nullable().optional(),zarr_store_count:D().int().nullable().optional(),cost_hint:Sot}).passthrough(),knn=O({dataset_id:b().regex(Yo),modality:b().optional(),min_duration_s:D().nonnegative().optional(),include_derived:Q().default(!1),limit:D().int().positive().max($ot).default(Rot),offset:D().int().nonnegative().default(0)}).passthrough(),Dot=O({name:b(),modality:b().nullable().optional(),rate:D().nullable().optional(),n_channels:D().int().nullable().optional(),duration_s:D().nullable().optional(),n_view_levels:D().int().nonnegative().nullable().optional(),n_samples:D().int().nonnegative().nullable().optional(),view_chunk_columns:D().int().positive().nullable().optional()}).passthrough(),Cot=O({path:b(),zarr:b(),source_tree:ze("raw"),derived:Q(),groups:Y(Dot).optional(),n_events:D().int().nonnegative().optional(),sss:Ck.optional(),units_report:Dk.optional()}).passthrough().superRefine(Ak),Rnn=O({dataset_id:b().regex(Yo),source_commit:b().regex($k).nullable(),recordings:Y(Cot),total_count:D().int().nonnegative(),excluded_derived_count:D().int().nonnegative(),limit:D().int(),offset:D().int(),index_format_version:D().int(),discovered_count:D().int().nonnegative().nullable(),failure_count:D().int().nonnegative().nullable(),pending_count:D().int().nonnegative().nullable(),excluded_legacy_non_raw_count:D().int().nonnegative(),note:b().nullable().optional(),envelope:Mw.optional()}).passthrough(),Roe=b().min(1).max(64),$nn=O({dataset_id:b().regex(Yo),recording:b(),group:b().optional(),limit:D().int().positive().max(Oot).default(Aot),offset:D().int().nonnegative().default(0),where:Fn(Roe,Y(dg([b(),D()])).min(1).max(Tot)).refine((e)=>{let t=Object.keys(e).length;return t>=1&&t<=koe},{message:`where names 1 to ${koe} columns`}).optional(),columns:Y(Roe).min(1).max(Pot).optional()}).passthrough(),Not=O({store_path:b(),group_name:b(),onset_s:D(),duration_s:D().nullable().optional(),sample_index:D().int().nonnegative(),trial_type:b().nullable().optional(),value:dg([b(),D()]).nullable().optional(),hed:b().nullable().optional()}).passthrough(),Iot=Not.partial().required({onset_s:!0,sample_index:!0}),Fot=O({name:b(),distinct_count:D().int().nonnegative(),null_count:D().int().nonnegative(),values:Y(O({value:b(),count:D().int().positive()}).passthrough()).nullable()}).passthrough(),Dnn=O({dataset_id:b().regex(Yo),recording:b(),events:Y(Iot),source:je(["events_parquet","events_tsv_fallback"]),estimated:Q(),total_count:D().int().nonnegative(),limit:D().int(),offset:D().int(),truncated:Q(),note:b().nullable().optional(),columns_summary:Y(Fot).optional(),envelope:Mw.optional()}).passthrough(),Cnn=O({dataset_id:b().regex(Yo),recording:b(),group:b().optional(),width_px:D().int().positive().max(jot).default(Mot)}).passthrough(),Ann=O({dataset_id:b().regex(Yo),recording:b(),group:b(),level:D().int().positive(),width_px:D().int().positive(),height_px:D().int().positive(),mime_type:ze("image/png"),columns_read:D().int().nonnegative(),chunks_read:D().int().nonnegative(),bytes_read:D().int().nonnegative(),envelope:Mw.optional()}).passthrough(),$oe=GI*VI,Onn=O({dataset_id:b().regex(Yo),recording:b(),group:b().optional(),start_s:D().nonnegative().default(0),duration_s:D().positive().max(Lot).default(10),channels:Y(D().int().nonnegative()).max(Uot).optional(),taste:Q().default(!1)}).passthrough().superRefine((e,t)=>{if(!e.taste)return;if(!e.channels||e.channels.length===0){t.addIssue({code:ne.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>GI)t.addIssue({code:ne.custom,message:`taste duration_s (${e.duration_s}) exceeds the ${GI} s cap; omit taste for a recipe instead`,path:["duration_s"]});if(e.channels.length>VI)t.addIssue({code:ne.custom,message:`taste channels (${e.channels.length}) exceeds the ${VI}-channel cap; omit taste for a recipe instead`,path:["channels"]});let n=e.duration_s*e.channels.length;if(n>$oe)t.addIssue({code:ne.custom,message:`taste exceeds the cap of ${$oe} channel-seconds (duration_s x channels = ${n}); omit taste for a recipe instead`,path:["duration_s"]})}),qot=O({mode:ze("recipe"),recipe:Coe,envelope:Mw}).passthrough(),Bot=O({mode:ze("taste"),start_s:D(),duration_s:D(),channels:Y(D().int()),sample_rate_hz:D(),values:Y(Y(D())),recipe:Coe,chunks_read:D().int().nonnegative(),bytes_read:D().int().nonnegative(),filled_ranges:Y(O({start_sample:D().int().nonnegative(),end_sample:D().int().nonnegative(),start_s:D(),end_s:D()}).passthrough()),note:b().nullable().optional(),envelope:Mw}).passthrough(),Tnn=SI("mode",[qot,Bot])});function Noe(e){let t=Cf.indexOf(e);if(t<0)throw RangeError("not a launcher failure code");return zot+t}var Gl,wd,Toe,Hot,Inn,Cf,Poe=0,zot=10,Got,Vot,Tk,wg,jw,Ioe,Wot,Fnn,Mnn,WI,Foe,Moe,Pk,Nk,joe;var la=z(()=>{Gl=/^[a-z0-9_]{1,64}$/,wd=["created","uploading","submitted","queued","running","archiving","finished","failed","cancelled","unreported"],Toe=["finished","failed","cancelled"],Hot=["created","uploading","submitted","queued","running","archiving","unreported"],Inn=Hot.filter((e)=>e!=="created"&&e!=="uploading"&&e!=="unreported"),Cf=["code_fetch_failed","dataset_fetch_failed","entry_not_found","runtime_error","out_of_memory","time_limit","result_upload_failed"];Got=["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","runner_lost"],Vot=["upload_expired"],Tk=["tapis","runner"],wg=["su","none"],jw=["local","slurm"],Ioe={runner_credential_not_accepted:401,runner_unknown:401,runner_token_expired:401,runners_disabled:503,lease_lost:409,job_not_claimed:404,runner_outdated:426,protocol_unsupported:426,runner_accounting_unbuilt:409,invalid_body:400},Wot=["results_too_large","results_quota_exceeded","too_many_outputs"],Fnn={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","image_unverified","runtime_unusable","internal_error","output_dir_not_empty","bind_source_unsafe","pid_namespace_unavailable"],out_of_memory:[],time_limit:[],result_upload_failed:[...Wot,"outputs_unreadable","bad_response","fetch_failed","incomplete_plan","upload_failed","outputs_refused","complete_refused","internal_error"]},Mnn=[...Cf,...Got.filter((e)=>!Cf.includes(e)),...Vot],WI={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,platform_busy:409},Foe={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."},Moe=["batch","interactive"],Pk=["unreserved","unattributed","mismatch","overrun"],Nk=["pending","attempting","sent","failed"],joe=["job","account"]});function Af(e,t=512){return typeof e==="string"&&e.length>=1&&e.length<=t&&qoe.test(e)&&!Eg.test(e)}function QI(e){if(typeof e!=="string")return null;let t=/^[0-9]/.test(e)?`v${e}`:e;return t.length<=ZI&&XI.test(t)?t:null}function Boe(e){let t=e.findIndex((n)=>QI(n.version)===null);return t<0?null:`datasets.${t}.version`}function nF(e){return b().max(e).regex(qoe).refine((t)=>!Eg.test(t),{message:"a path may not hold . or .. segments"})}function Uw(e){if(e!==null&&typeof e==="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))Uw(t)}return e}function xg(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 KI(e,t){return(e+t-1n)/t}function Zot(e,t,n){if(!Object.hasOwn(vg,e))throw RangeError("not a partition");let r=vg[e],o=xg("nodes",t.nodes,1),s=xg("cores",t.cores??0,0),i=xg("memory_mb",t.memory_mb??0,0),a=xg("gpus",t.gpus??0,0),c=xg("seconds",n,0),l=Xot,d=BigInt(l.milliPerSu),p;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=KI(i*d,BigInt(l.memoryMbPerCoreUnit));p=x>v?x:v;break}case"whole_cpu_node":p=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=KI(i*d,BigInt(l.memoryMbPerGpuUnit));p=x>v?x:v;break}case"whole_gpu_node":p=BigInt(l.gpuNodeGpus)*d;break}let f=p*o,m=r.preempt?BigInt(l.preemptNumerator):1n,h=r.preempt?BigInt(l.preemptDenominator):1n,g=KI(f*c*m,3600n*h),y=BigInt(l.minChargeMilli),w=g<y?y:g;if(w>BigInt(eF))throw RangeError("amount too large to hold exactly");return Number(w)}function zoe(e){let t=xg("minutes",e.minutes,0);return Zot(e.partition,e,Number(t*60n))}function Goe(e){if(typeof e!=="string")return null;let t=Qot.exec(e);if(!t)return null;let n=BigInt(t[1])*1000n+BigInt((t[2]??"").padEnd(3,"0"));if(n>BigInt(eF))return null;return Number(n)}function mr(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 nst(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 ist(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 ast(e,t){let n=nst(e);if(n!==null)t.addIssue({code:ne.custom,message:`an include pattern the dialect refuses: ${n}`})}function _g(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 dst(e){let t=0;if(e.entry!==void 0)t+=_g(e.entry)+1;for(let n of e.command??[])t+=_g(n)+1;for(let n of e.args??[])t+=_g(n)+1;for(let n of e.datasets??[])for(let r of n.include??[])t+=_g(r)+1;for(let[n,r]of Object.entries(e.env??{}))if(r!==void 0)t+=_g(n)+_g(r)+2;return t}function yst(e){let t=e.split(/[=\s]/)[0]??"";if(t.startsWith("-G"))return!0;let n=t.replace(/^-+/,"").toLowerCase();if(/gpu|gres|tres/.test(n))return!0;return n.length>=1&&["gpus","gres","tres"].some((r)=>r.startsWith(n))}var YI="\\u0000-\\u001f\\u007f",jk,Loe,qoe,Eg,Kot,Jot,Lw=1e5,Ys,ic,Sg,Vl,Lk,XI,ZI=64,eF,ua=(e,t=eF)=>D().int().min(e).max(t),St,tF,Fk,Hoe,rF,kg,qw,Yot,Ik=2880,vg,Xot,Qot,Rg,Voe,Of,est,oF,tst,sF="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.",iF="An argument vector, run as given, with args appended.",aF="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.",cF="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).",rst,ost,sst,_d,Mk=(e)=>e.refine(ist,{message:"a lone surrogate is not text a process argument can carry"}),cst,lst,ust,pst=49152,$g,fst,mst,hst,gst,bst,wst,Woe,JI=1073741824,Uoe=1048576,_st,qnn,Bnn,xst,Hnn,Koe,znn,vst,Gnn;var hr=z(()=>{mn();la();jk=`[^/\\\\${YI}]+`,Loe=jk,qoe=new RegExp(`^(?:${Loe}/)*${Loe}$`),Eg=/(?:^|\/)\.\.?(?:\/|$)/,Kot=new RegExp(`^[^\\\\${YI}]+$`),Jot=/^\/|(?:^|\/)\.\.(?:\/|$)/;Ys=/^job_[0-9a-f]{24}$/,ic=/^[0-9a-f]{64}$/,Sg=/^sha256:[0-9a-f]{64}$/,Vl=/^[a-z]{2}[0-9]{6}$/,Lk=/^[0-9A-Za-z][0-9A-Za-z._+-]{0,63}$/,XI=/^(?:latest|v[0-9]+\.[0-9]+\.[0-9]+)$/;eF=Number.MAX_SAFE_INTEGER,St=ua,tF=b().regex(Ys),Fk=b().regex(ic);Hoe=nF,rF=b().max(256).regex(Kot).refine((e)=>!Jot.test(e),{message:"a pattern may not leave the dataset"});kg=["cpu","gpu"],qw=["shared","compute","debug","large-shared","preempt","gpu-shared","gpu","gpu-debug","gpu-preempt"],Yot=O({maxNodes:St(1,64),maxCoresPerNode:St(0,256),maxGpusPerNode:St(0,8),maxMinutes:St(1,10080)}).strict(),vg=Uw({shared:{pool:"cpu",rate:"core_or_memory",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:64,maxGpusPerNode:0,maxMinutes:Ik}},compute:{pool:"cpu",rate:"whole_cpu_node",preempt:!1,ceiling:{maxNodes:2,maxCoresPerNode:128,maxGpusPerNode:0,maxMinutes:Ik}},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:Ik}},gpu:{pool:"gpu",rate:"whole_gpu_node",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:40,maxGpusPerNode:4,maxMinutes:Ik}},"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}}),Xot={version:1,milliPerSu:1000,cpuNodeCores:128,gpuNodeGpus:4,memoryMbPerCoreUnit:2048,memoryMbPerGpuUnit:94208,preemptNumerator:800,preemptDenominator:1000,minChargeMilli:1000};Qot=/^([0-9]+)(?:\.([0-9]{1,3}))?$/;Rg=["result.json","provenance.json","manifest.json","launcher.log"],Voe={SPEC:"NEMAR_LAUNCH_SPEC",OUT:"NEMAR_OUT",LOCAL_DATASETS_ROOT:"NEMAR_LOCAL_DATASETS_ROOT",HOST_PYTHON:"NEMAR_HOST_PYTHON",SIF_ROOT:"NEMAR_SIF_ROOT"},Of=["OMP_NUM_THREADS","MKL_NUM_THREADS","OPENBLAS_NUM_THREADS","NUMEXPR_NUM_THREADS","PYTHONHASHSEED","MPLBACKEND"],est=/^[ -~]*$/,oF=b().max(256).regex(est),tst=Fn(je(Of),oF);rst=["python","matlab","image"],ost=/^[A-Za-z0-9][A-Za-z0-9 ._-]{0,79}$/,sst=/^[a-z][a-z0-9-]{0,63}$/,_d=/^(?:docker:\/\/)?[a-z0-9]+(?:[._-][a-z0-9]+)*(?::[0-9]{1,5})?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)+@sha256:[0-9a-f]{64}$/;cst=O({size:St(1),sha256:Fk}).strict(),lst=O({id:b().regex(Vl),version:b().regex(Lk),include:Y(Mk(rF).superRefine(ast)).max(64).optional().describe(cF)}).strict(),ust=Mk(b().max(1024));$g=O({name:b().regex(ost),runtime:je(rst),entry:Mk(Hoe(240)).optional().describe(sF),command:Y(Mk(b().min(1).max(1024))).min(1).max(64).optional().describe(iF),args:Y(ust).max(64).default([]).describe(aF),bundle:cst.optional(),datasets:Y(lst).max(20).default([]),partition:je(qw),nodes:St(1,64).default(1),cores:St(1,256).default(1),memory_mb:St(1,16777216).optional(),gpus:St(0,8).default(0),minutes:St(1,10080),output_dir:ze("outputs").default("outputs"),env:tst.default({}),recipe:b().regex(sst).optional(),image:b().max(512).regex(_d).optional()}).strict().superRefine((e,t)=>{let n=(o,s)=>t.addIssue({code:ne.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(dst(e)>pst)t.addIssue({code:ne.custom,path:[],message:"the entry, command, arguments, patterns and environment are too large to launch"});let r=vg[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")}),fst=/^[A-Za-z0-9_.-]{1,64}$/,mst=/^[a-z0-9]+(?:[.-][a-z0-9]+)*(?::[0-9]{1,5})?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)*$/,hst=Object.fromEntries(qw.map((e)=>[e,Yot.optional()])),gst=O({maxOpenReservations:St(0,1e5),maxReservedMilliPerDay:St(0)}).strict();bst=O({maxLiveJobs:St(0,1000),reserved:O({people:St(0,1000),pipelines:St(0,1000),partner:St(0,1000)}).strict()}).strict().refine((e)=>e.reserved.people+e.reserved.pipelines+e.reserved.partner<=e.maxLiveJobs,{message:"the floors reserved for the classes add up to more than the ceiling",path:["reserved"]}),wst=O({maxLiveJobs:O({cpu:St(0,1000),gpu:St(0,1000)}).strict()}).strict(),Woe=O({defaultGrantMilli:O({cpu:St(0),gpu:St(0)}).strict(),renewal:O({enabled:Q(),everyDays:St(1,366).nullable()}).strict().refine((e)=>!e.enabled||e.everyDays!==null,{message:"renewal that is on says how often",path:["everyDays"]}),ceilings:O(hst).strict(),maxLiveJobsPerPerson:St(0,1000),pipelines:O({dailyJobCap:St(0,1e5),maxLiveJobs:O({cpu:St(0,1000),gpu:St(0,1000)}).strict()}).strict(),clients:Fn(b().regex(fst),gst),tenant:bst.optional(),runners:wst.optional(),reservationWaitMinutes:St(1,1440),retention:O({recordsYears:St(1,30),logsDays:St(1,3650),resultsDays:St(14,365)}).strict(),resultLimits:O({maxJobBytes:St(1),maxFiles:St(1,Lw),maxStoredBytesPerPerson:St(1),maxStoredBytesTotal:St(1)}).strict(),settle:O({toleranceMilli:St(0),tolerancePercent:St(0,100)}).strict(),registries:Y(b().max(255).regex(mst)).max(64),bundleLimits:O({maxTotalBytes:St(1),maxFiles:St(1,1e5),maxFileBytes:St(1)}).strict(),partner:O({tapisVisibilityConfirmed:Q(),execSystemId:b().regex(/^[A-Za-z0-9._-]{1,80}$/).optional(),allowedSchedulerArgs:Y(b().regex(/^[-A-Za-z0-9=_.:,@/]{1,100}$/).refine((e)=>!yst(e),{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(),_st=Uw({maxLiveJobs:20,reserved:{people:8,pipelines:2,partner:0}}),qnn=Uw({maxLiveJobs:{cpu:64,gpu:8}}),Bnn=Uw({defaultGrantMilli:{cpu:0,gpu:0},renewal:{enabled:!1,everyDays:null},ceilings:Object.fromEntries(qw.flatMap((e)=>{let t=vg[e].ceiling;return t?[[e,{...t}]]:[]})),maxLiveJobsPerPerson:4,pipelines:{dailyJobCap:50,maxLiveJobs:{cpu:8,gpu:4}},clients:{},tenant:_st,reservationWaitMinutes:30,retention:{recordsYears:7,logsDays:365,resultsDays:30},resultLimits:{maxJobBytes:20*JI,maxFiles:5000,maxStoredBytesPerPerson:50*JI,maxStoredBytesTotal:1024*JI},settle:{toleranceMilli:1000,tolerancePercent:5},registries:[],bundleLimits:{maxTotalBytes:100*Uoe,maxFiles:2000,maxFileBytes:25*Uoe}}),xst=O({path:Hoe(512),size:St(0),sha256:Fk}).strict(),Hnn=O({job_id:tF,files:Y(xst).max(Lw)}).strict(),Koe=D().int().min(-255).max(255).nullable(),znn=O({job_id:tF,failure_code:je(Cf).nullable(),detail:b().regex(Gl).nullable(),exit_number:D().int(),entry_exit_code:Koe}).strict().superRefine((e,t)=>{let n=e.failure_code===null?Poe:Noe(e.failure_code);if(e.exit_number!==n)t.addIssue({code:ne.custom,path:["exit_number"],message:"the exit number is the one the failure code gives"})}),vst=O({id:b().regex(Vl),version:b().regex(Lk),mode:je(["bind","download"]),files:St(0),bytes:St(0)}).strict(),Gnn=O({job_id:tF,launch_spec_digest:Fk,bundle_digest:Fk.nullable(),image:O({uri:b().regex(/^[^\s]{1,512}$/),digest:b().regex(Sg)}).strict(),runtime_version:b().regex(new RegExp(`^[^${YI}]{1,128}$`)),staging:Y(vst).max(20),timings:Fn(b().regex(Gl),D().finite().min(0)).refine((e)=>Object.keys(e).length<=16,{message:"at most 16 phases"}),slurm_job_id:b().regex(/^[0-9A-Za-z_+.-]{1,64}$/).nullable(),entry_exit_code:Koe}).strict()});var Joe,Yoe,Wnn,Knn;var lF=z(()=>{Joe=["dispatched","succeeded","failed","refused"],Yoe=["bids","zarr"],Wnn=Object.freeze({bids:Object.freeze(["tapis"]),zarr:Object.freeze(["runner"])}),Knn=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,inputs:Object.freeze(["bids","zarr"]),executors:Object.freeze(["tapis","runner"]),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,inputs:Object.freeze(["bids"]),executors:Object.freeze(["tapis"]),autoDispatch:!1,placeholder:!0,eligibility:"eeg"})])});function Zoe(e){return uF.includes(e)}function Hw(e){let t=e.partial_jobs>0?`; usage of ${e.partial_jobs} job(s) is a lower bound${bF}`:"",n=(e.unmarked_jobs??0)>0?`; usage of ${e.unmarked_jobs} job(s) has no partial mark${wF}`:"";return t+n}var Est="pipelines",Sst="people",uF,Uk,Bw=200,da,dF,kst,Qoe,ese,tse,pF,nse,Gr,fF,mF,hF=100,gF=10,rse=10,qk,yF=200,Rst,Qnn,$st,Dst,Cst,ose,Ast,sse,Bk=8,Hk=200,ise,ase,Xoe,cse,lse,use,dse=366,bF=" (partial: Docker or Podman)",wF=" (partial: unknown)",pse="Runner-reported usage; never service units.",fse,mse,hse,gse,_F,yse,bse,wse,_se;var xd=z(()=>{mn();lF();la();uF=[Est,Sst];Uk=["granted","charged"],da=D().int(),dF=O({id:D().int(),holder_kind:b(),holder_ref:b(),pool:b(),granted_milli:da,held_milli:da,charged_milli:da,available_milli:da,frozen:Q(),created_at:b(),updated_at:b()}).passthrough(),kst=O({id:D().int(),kind:b(),pool_id:D().int(),budget_pool_id:D().int().nullable(),granted_delta_milli:da,held_delta_milli:da,charged_delta_milli:da,job_id:b().nullable(),hold_ref:D().int().nullable(),reason:b().nullable(),actor_user_id:D().int().nullable(),created_at:b()}).passthrough(),Qoe=O({pools:Y(dF),next_after:D().int().nullable()}).passthrough(),ese=O({account_id:D().int(),pools:Y(dF)}).passthrough(),tse=O({pool:dF,entry:kst,replayed:Q()}).passthrough(),pF=O({version:D().int().nullable(),is_default:Q(),policy:O({}).passthrough(),set_by:D().int().nullable(),note:b().nullable(),created_at:b().nullable()}).passthrough(),nse=O({switches:O({environment:b(),compute_enabled:Q(),pipelines_dispatch_enabled:Q()}).passthrough(),tapis:O({configured:Q(),strategy:b().nullable(),problems:Y(b()),token:b(),health:b()}).passthrough(),storage:O({records_binding:Q(),results_binding:Q(),signing_configured:Q()}).passthrough(),access:O({key_configured:Q(),resource_name_configured:Q().optional()}).passthrough(),runtime_image:O({set:Q(),valid:Q(),digest:b().nullable()}).passthrough().optional(),prerequisites:O({callback_secret:Q(),api_base_url:Q(),pipelines_account:Q(),policy_set:Q(),people_pool_granted:Q(),pipelines_pool_granted:Q()}).passthrough().optional(),reconciliation:O({paused:Q()}).passthrough().optional(),attention:Fn(xs()).optional(),tenant:O({ceiling:D(),occupied:D(),by_class:O({people:D(),pipelines:D(),partner:D(),other:D()}).passthrough(),reserved:O({people:D(),pipelines:D(),partner:D()}).passthrough()}).passthrough().optional()}).passthrough(),Gr=b().nullable(),fF=O({id:b(),account_id:D().int().nullable(),source:b(),kind:b(),state:b(),tapis_status:Gr,failure_code:Gr,failure_detail:Gr,platform_failure:Q(),cancel_requested:Q(),cancel_reason:Gr,partition:b(),pool:b(),held_milli:da,charged_milli:da,settled:Q(),flags:Y(b()),created_at:b(),submitted_at:Gr,started_at:Gr,ended_at:Gr,tapis_synced_at:Gr,outputs_completed:Q(),results_verified:Q(),results_bytes:D().int().nullable(),records_copied:Q(),partner_state:Gr.optional(),partner_flag:Gr.optional(),executor:b().optional(),accounting:b().optional(),runner_backend:Gr.optional(),runner_id:Gr.optional(),runner_claimed_at:Gr.optional(),runner_wall_seconds:D().int().nullable().optional(),runner_cpu_seconds:D().int().nullable().optional(),runner_max_rss_mb:D().int().nullable().optional(),runner_usage_partial:Q().nullable().optional()}).passthrough(),mF=O({ok:Q(),outcome:b(),submit:b().optional(),job:fF.nullable()}).passthrough(),qk=Joe,Rst={recipe_not_automatic:422,recipe_placeholder:422,registry_drift:409,zarr_version_not_newest:422,zarr_copy_not_ready:409,zarr_source_mismatch:409,zarr_source_unverifiable:503,runners_disabled:Ioe.runners_disabled,tapis_unconfigured:503,daily_cap_reached:409,create_failed:502,run_failed:500},Qnn={...WI,...Rst},$st=O({dataset_id:b(),ok:Q(),version:b().optional(),job_id:b().optional(),stamp_id:D().int().optional(),attempt:D().int().optional(),submit:b().optional(),records_written:Q().optional(),code:b().optional(),blocked_by:Y(b()).optional(),reason:b().optional()}).passthrough(),Dst=O({daily_left:D().int(),live_left:D().int(),tenant_left:D().int().optional(),limited_by:b()}).passthrough(),Cst=O({live_left:D().int(),live_cap:D().int()}).passthrough(),ose=O({ok:Q(),dry_run:Q(),recipe:b(),results:Y($st).optional(),dispatched:D().int().optional(),stopped_by:b().nullable().optional(),room:Dst.optional(),executor:b().optional(),input:b().optional(),runner_room:Cst.optional(),audit_pending:Q().optional(),estimate_milli_per_job:da.optional(),estimate_milli_total:da.optional(),config:O({compute_enabled:Q(),runtime_image:Q(),pipelines_account:Q(),runners_enabled:Q().optional(),tapis_configured:Q().optional()}).passthrough().optional(),would_dispatch:Y(O({dataset_id:b(),version:b()}).passthrough()).optional(),blocked:O({code:b(),blocked_by:Y(b()),version:b().optional(),reason:b().optional()}).passthrough().optional(),blocked_by_term:Fn(xs()).optional()}).passthrough(),Ast=O({id:D().int(),dataset_id:b(),version:b(),recipe:b(),recipe_version:b(),engine:b(),input:b().optional(),attempt:D().int(),state:b(),job_id:Gr,refusal_code:Gr,reader:Gr.optional(),input_engine:Gr.optional(),input_digest:Gr.optional(),created_at:b(),updated_at:b()}).passthrough(),sse=O({stamps:Y(Ast),next_before:D().int().nullable()}).passthrough(),ise=O({jobs:Y(fF),next_after:D().int().nullable()}).passthrough(),ase=O({rows:Y(O({slurm_job_id:b(),partition:b(),state:b(),elapsed_seconds:D().int(),alloc_nodes:D().int(),alloc_cpus:D().int(),alloc_gpus:D().int(),charged_milli:D().int().nullable(),ingested_at:b()}).passthrough()),total:D().int()}).passthrough(),Xoe=["ok","missing","unreadable"],cse=O({job:fF,identifiers:O({}).passthrough(),ledger:Y(O({}).passthrough()),provenance:O({}).passthrough().nullable(),provenance_status:je(Xoe).optional(),manifest:O({files:D().int(),bytes:D().int()}).passthrough().nullable(),manifest_status:je(Xoe).optional(),legal_hold:Q(),retention_until:b().nullable().optional(),launcher_files:Y(b()).optional()}).passthrough(),lse=O({job_id:b(),name:b(),kind:b(),content:xs().optional(),url:b().optional(),expires_at:b().optional()}).passthrough(),use=O({account_id:D().int(),from:b(),to:b(),totals:O({jobs:D().int(),charged_milli:D().int(),unsettled:D().int().optional(),open_hold_milli:D().int().optional()}).passthrough(),by_pool:Fn(O({}).passthrough()),runner_totals:O({jobs:D().int(),wall_seconds:D().int(),cpu_seconds:D().int(),core_hours:D(),partial_jobs:D().int(),reported_jobs:D().int().optional(),unmarked_jobs:D().int().optional()}).passthrough().optional(),jobs:Y(O({}).passthrough()),truncated:Q()}).passthrough();fse=O({from:b(),to:b(),runners:Y(O({id:b(),name:b(),site:b(),trust:b(),revoked:Q(),jobs:D().int(),by_state:Fn(xs()),wall_seconds:D().int(),cpu_seconds:D().int(),core_hours:D(),max_rss_mb:D().int().nullable(),partial_jobs:D().int(),reported_jobs:D().int().optional(),unmarked_jobs:D().int().optional()}).passthrough()),totals:O({jobs:D().int(),wall_seconds:D().int(),cpu_seconds:D().int(),core_hours:D(),partial_jobs:D().int(),reported_jobs:D().int().optional(),unmarked_jobs:D().int().optional()}).passthrough()}).passthrough(),mse=O({quarter:b(),rows:Y(O({partition:b(),source:b(),distinct_users:D().int(),jobs:D().int()}).passthrough()),totals:O({distinct_users:D().int(),jobs:D().int()}).passthrough()}).passthrough(),hse=O({id:D().int(),scope:b(),ref:b(),reason:b(),placed_by:D().int(),placed_at:b(),released_at:b().nullable()}).passthrough(),gse=O({holds:Y(hse),truncated:Q().optional()}).passthrough(),_F=O({hold:hse}).passthrough(),yse=O({rows:Y(O({job_id:b(),state:b(),attempts:D().int(),last_error_code:b().nullable(),next_attempt_at:b(),sent_at:b().nullable(),created_at:b()}).passthrough()),failed_by_word:Fn(xs()),next_after:b().nullable()}).passthrough(),bse=O({ok:Q(),job_id:b(),previous:b().nullable()}).passthrough(),wse=O({run_id:b(),token:b(),expires_in_minutes:D().int()}).passthrough(),_se=O({job_id:b(),to_account_id:D().int(),pool:b(),moved_milli:D().int(),replayed:Q(),attributed_account_id:D().int().nullable().optional(),owner_proven:Q().optional()}).passthrough()});function xF(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}function Ese(e,t){let n=vF[e];if(n==="refused")return t===void 0?null:"notice_refused";let r=t?.trim()??"";if(r==="")return n==="required"?"notice_required":null;if([...r].length>vd)return"notice_too_long";if(xF(r))return"notice_control_char";return null}var zk=20,zw=1000,nrn,Ost,xse,vse,Dg=500,Gk=200,vd=1000,vF,rrn,Sse,kse,Tst,Rse;var Tf=z(()=>{mn();nrn=O({purpose:b().max(zw*4).optional().default(""),accept_terms_version:b().max(64).optional().default("")}),Ost=je(["purpose_required","terms_not_accepted","email_not_verified","orcid_not_proven","profile_incomplete","access_closed","already_active","terms_unpublished"]),xse=Ost.options,vse=O({ok:ze(!0),already_requested:Q(),requested_at:b().nullable().optional(),email_sent:Q().optional(),admins_notified:D().int().nullable().optional()}).passthrough(),vF={grant:"refused",deny:"optional",suspend:"required",revoke:"required"};rrn={reason:b().max(Dg).optional(),notice:b().max(vd*4,{message:"notice_too_long"}).optional()},Sse=O({id:D().int(),username:b().nullable(),email:b(),given_name:b().nullable().optional(),family_name:b().nullable().optional(),affiliation:b().nullable().optional(),city:b().nullable().optional(),country:b().nullable().optional(),orcid:b().nullable().optional(),account_kind:b().optional(),compute_access:b(),compute_access_requested_at:b().nullable().optional(),compute_access_notified_at:b().nullable().optional(),compute_access_granted_at:b().nullable().optional(),compute_access_granted_by:D().int().nullable().optional(),compute_purpose:b().nullable().optional(),compute_terms_version:b().nullable().optional(),compute_terms_accepted_at:b().nullable().optional()}).passthrough(),kse=O({accounts:Y(Sse),next_after:D().int().nullable().optional()}).passthrough(),Tst=O({granted:Q(),cpu_milli:D().int(),gpu_milli:D().int(),reason:b().nullable().optional(),policy_version:D().int().nullable().optional()}).passthrough(),Rse=O({decision:b(),from:b(),to:b(),account:Sse,allocation:Tst.optional(),email_sent:Q().optional()}).passthrough()});var Gw=100,EF=25,Pst,irn,ac,gr,$se,Nst,Ist,Dse,Fst,Mst,Cse,Ase,Ose,arn;var Vk=z(()=>{mn();Pst={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},irn=Object.keys(Pst),ac=b().nullable(),gr=D().int().nonnegative(),$se=O({granted_milli:gr,held_milli:gr,charged_milli:gr,available_milli:D().int()}).passthrough(),Nst=O({name:b(),pool:b(),max_nodes:gr,max_cores_per_node:gr,max_gpus_per_node:gr,max_minutes:gr}).passthrough(),Ist=O({partition:b(),median_seconds:D().int().nonnegative().nullable(),p90_seconds:D().int().nonnegative().nullable(),count:gr,window_days:gr}).passthrough(),Dse=O({access:O({state:b(),requested_at:ac,granted_at:ac,terms_version:ac,current_terms_version:b(),terms_published:Q(),requests_open:Q().optional()}).passthrough(),pools:O({cpu:$se,gpu:$se}).passthrough(),frozen:Q(),limits:O({partitions:Y(Nst),max_live_jobs:gr,results_days:gr}).passthrough(),queue:Y(Ist)}).passthrough(),Fst=O({day:b().optional(),app:ac.optional(),partition:ac.optional(),source:ac.optional(),charged_milli:D().int(),jobs:gr}).passthrough(),Mst=O({from:b(),to:b(),group:Y(b()),rows:Y(Fst)}).passthrough(),Cse=O({id:b(),kind:b(),source:b(),state:b(),app_id:b(),app_version:b(),partition:b(),pool:b(),resources:O({nodes:gr,cores_per_node:gr,memory_mb:D().int().nonnegative().nullable(),gpus:gr,minutes:gr}).passthrough(),created_at:b(),started_at:ac,ended_at:ac,charged_milli:D().int().nonnegative(),failure_code:ac,cancel_requested:Q()}).passthrough(),Ase=O({jobs:Y(Cse),next_after:ac}).passthrough(),Ose=O({job:Cse,stale:Q().optional()}).passthrough(),arn=O({from:b(),to:b(),by_day_partition_source:Y(O({day:b(),partition:b(),source:b(),charged_milli:D().int(),jobs:gr}).passthrough()),active_people:gr,jobs_by_outcome:O({finished:gr,failed:gr,cancelled:gr}).passthrough()}).passthrough()});function SF(e,t=Cg,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"||!Af(a.path,Vw))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"||!ic.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 Tse=1048576,jst,Pse=2000,Lst,Vw=240,urn,Cg;var Wk=z(()=>{hr();jst=100*Tse,Lst=25*Tse,urn=Pse*1200+65536,Cg=Object.freeze({maxTotalBytes:jst,maxFiles:Pse,maxFileBytes:Lst})});var Nse="Idempotency-Key",Ise="X-Nemar-Truncated",Ust,Fse,Mse,qst,kF,mrn,RF;var Kk=z(()=>{mn();la();Ust=O({url:b(),method:ze("PUT"),headers:Fn(b()),expires_at:b(),size:D().int().nonnegative()}).passthrough(),Fse=O({job_id:b(),state:b(),tag:b(),name:b(),upload:Ust.optional(),replayed:ze(!0).optional()}).passthrough(),Mse=O({job_id:b(),state:b(),name:b().optional(),submitted:Q(),replayed:Q()}).passthrough(),qst=O({path:b(),size:D().int().nonnegative(),sha256:b(),url:b()}).passthrough(),kF=O({expires_at:b(),files:Y(qst),total:D().int().nonnegative(),truncated:Q(),next_after:b().nullable(),bearer_links:ze(!0),notice:b()}).passthrough(),mrn=O({error:b(),code:b(),field:b().optional(),job_id:b().optional(),note:b().optional()}).passthrough(),RF={...Foe,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.",platform_busy:"NEMAR's share of the cluster is full right now; ask again shortly.",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 Bst,Hst,jse;var $F=z(()=>{mn();Wk();hr();Bst=O({path:b().min(1).max(Vw),size:D().int().min(0).max(Number.MAX_SAFE_INTEGER),sha256:b().regex(ic)}).strict(),Hst=O({files:Y(Bst).min(1)}).strict(),jse=O({spec:$g,manifest:Hst.optional()}).strict()});var xrn,zst,Gst,vrn,Ern,Srn;var Lse=z(()=>{mn();xrn=O({job_id:b(),hold_id:b(),tag:b(),expires_at:b(),state:b().optional(),replayed:ze(!0).optional()}).passthrough(),zst=O({path:b(),url:b(),method:ze("PUT"),headers:Fn(b())}).passthrough(),Gst=O({state:je(["awaiting_upload","recorded"]),uploads:Y(zst).optional(),expires_at:b().optional()}).passthrough(),vrn=O({job_id:b(),verification:je(["verified","pending"]),state:b(),files:Gst.optional(),replayed:ze(!0).optional()}).passthrough(),Ern=O({job_id:b(),hold_id:b(),released:ze(!0),state:b(),replayed:ze(!0).optional()}).passthrough(),Srn=O({error:b(),code:b(),field:b().optional(),mismatch:b().optional(),job_id:b().optional()}).passthrough()});var Crn,Use=500,Vst=512,Wst,Kst,Arn,Orn;var qse=z(()=>{mn();la();hr();Crn=O({app_id:b().regex(/^[A-Za-z0-9._-]{1,80}$/),app_version:b().regex(/^[A-Za-z0-9._+-]{1,64}$/),kind:je(Moe),partition:je(qw),nodes:ua(1,64),cores:ua(0,256),memory_mb:ua(1,16777216).nullish(),gpus:ua(0,8),minutes:ua(1,10080)}).strict().superRefine((e,t)=>{let n=vg[e.partition].pool==="gpu";if(n&&e.gpus<1)t.addIssue({code:ne.custom,path:["gpus"],message:"a GPU partition needs a GPU"});if(!n&&e.gpus!==0)t.addIssue({code:ne.custom,path:["gpus"],message:"a CPU partition takes no GPU"})}),Wst=O({path:b().min(1).max(Vst),size:D().int().min(0).max(Number.MAX_SAFE_INTEGER),sha256:b().regex(ic)}).strict(),Kst=/^[A-Za-z0-9][A-Za-z0-9-]{0,63}$/,Arn=O({tapis_job_id:b().regex(Kst),files:Y(Wst).min(1).max(Use).optional()}).strict(),Orn=Use*2400+4096});function cit(e){if(typeof e!=="string"||!Sg.test(e))return null;return`${e.slice(7)}.sif`}function lit(e){return e.replace(/[\u007f-\uffff]/g,(t)=>`\\u${t.charCodeAt(0).toString(16).padStart(4,"0")}`)}function uit(e){let t=ait.safeParse(e);if(!t.success){let r=[...new Set(t.error.issues.map((o)=>o.path.join(".")||"(document)"))];throw TypeError(`not a valid launch specification: ${r.join(", ")}`)}let n=lit(JSON.stringify(t.data));if(n.length>zse)throw RangeError("the launch specification is over 64 KiB");return n}function Wse(e){let t="f".repeat(64),n=`docker://ghcr.io/${"a".repeat(423)}@sha256:${t}`,r={job_id:`job_${"f".repeat(24)}`,runtime:e.runtime==="image"?"image":"python",args:e.args,bundle:{sha256:t,size:Number.MAX_SAFE_INTEGER},datasets:e.datasets.map((o)=>({id:o.id,version:QI(o.version),include:o.include})),api_base:`https://${"a".repeat(504)}`,image:{uri:n,digest:`sha256:${t}`,sif:`${t}.sif`},env:e.env,resources:{gpus:e.gpus},limits:{max_files:1e6,max_total_bytes:Number.MAX_SAFE_INTEGER},job_token:"t".repeat(256)};if(e.entry!==void 0)r.entry=e.entry;else r.command=e.command??["x"];try{return uit(r),!0}catch{return!1}}var zse=65536,Gse,Jst="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",Irn,Yst,Ag,Vse,Xst,Zst,Qst,Bse,Hse=" Exactly one of entry and command is present.",eit="the image file is not <64 lowercase hex>.sif",tit="the image file is not the one named for the image digest",nit="the image reference is not a digest-pinned reference",rit="the image reference is not pinned to the image digest",oit,sit,iit,ait,Kse,Jse,Frn,Mrn,jrn;var DF=z(()=>{mn();hr();Gse=Math.ceil(zse*4/3),Irn=new Set(Jst),Yst=["python","image"],Ag=ua,Vse=nF,Xst=/^https?:\/\/[^\s/?#][^\s?#]*$/,Zst=/^https?:\/\/[^\s]+$/,Qst=/^[A-Za-z0-9_-]{16,256}$/,Bse=/^[0-9a-f]{64}\.sif$/,oit=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]+)?Z$/,sit=new RegExp(`^(?:outputs/(?:${jk}/)*${jk}|launcher/(?:${Rg.map((e)=>e.replace(".","\\.")).join("|")}))$`),iit=O(Object.fromEntries(Of.map((e)=>[e,oF.optional()]))).strict(),ait=O({job_id:b().regex(Ys),runtime:je(Yst),entry:Vse(240).optional().describe(sF+Hse),command:Y(b().min(1).max(1024)).min(1).max(64).optional().describe(iF+Hse),args:Y(b().max(1024)).max(64).describe(aF),bundle:O({sha256:b().regex(ic),size:Ag(1)}).strict().optional(),datasets:Y(O({id:b().regex(Vl),version:b().max(ZI).regex(XI),include:Y(rF).max(64).optional().describe(cF)}).strict()).max(20),api_base:b().max(512).regex(Xst),image:O({uri:b().max(512).regex(_d,nit),digest:b().regex(Sg),sif:b().regex(Bse,eit)}).strict(),env:iit,resources:O({gpus:Ag(0,8)}).strict(),limits:O({max_files:Ag(1,1e6),max_total_bytes:Ag(1)}).strict(),job_token:b().regex(Qst)}).strict().superRefine((e,t)=>{let n=(o,s)=>t.addIssue({code:ne.custom,path:[o],message:s});if(e.entry===void 0===(e.command===void 0))n("entry","exactly one of entry and command");if(e.entry!==void 0&&e.bundle===void 0)n("bundle","an entry needs the bundle that holds it");let r=cit(e.image.digest);if(r!==null&&Bse.test(e.image.sif)&&e.image.sif!==r)t.addIssue({code:ne.custom,path:["image","sif"],message:tit});if(r!==null&&_d.test(e.image.uri)&&!e.image.uri.endsWith(e.image.digest))t.addIssue({code:ne.custom,path:["image","uri"],message:rit})});Kse=b().max(4096).regex(Zst),Jse=b().regex(oit),Frn=O({url:Kse,expires_at:Jse}).passthrough(),Mrn=O({outputs:Y(O({path:Vse(512),size:Ag(0),sha256:b().regex(ic)}).strict()).max(Lw),launcher:Y(O({name:je(Rg),size:Ag(0)}).strict()).length(Rg.length)}).strict().superRefine((e,t)=>{if(new Set(e.launcher.map((n)=>n.name)).size!==Rg.length)t.addIssue({code:ne.custom,path:["launcher"],message:"each launcher file is named once"})}),jrn=O({uploads:Y(O({path:b().max(600).regex(sit).refine((e)=>!Eg.test(e),{message:"no . or .. segments"}),url:Kse}).passthrough()).max(Lw+Rg.length),expires_at:Jse}).passthrough()});var Yse="nemar.runner.v1",dit,Kw,Ww,CF,pit="nmr_",fit="nmra_",Xse="[0-9a-f]{64}",mit,hit,Jw,git,yit,Zse=32,Xs,bit,wit,_it,xit,vit=32,Eit,AF,OF,TF,PF,NF,Qse,eie,zrn,Grn,Vrn,Sit,Wrn,tie,Krn,kit,Jrn,Yrn,Xrn;var Yw=z(()=>{mn();la();DF();hr();dit=["started","uploading"],Kw=["amd64","arm64"],Ww=["apptainer","docker","podman"],CF=["lab","hpc"],mit=new RegExp(`^${pit}${Xse}$`),hit=new RegExp(`^${fit}${Xse}$`),Jw=/^rnr_[0-9a-f]{24}$/,git=/^[0-9a-f]{32}$/,yit=/^[a-z0-9_]{1,32}$/,Xs=ua,bit=Number.MAX_SAFE_INTEGER,wit=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]+)?Z$/,_it=/^[0-9a-f]{64}\.sif$/,xit=/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,Eit=/^[A-Za-z0-9_-]+$/,AF=b().regex(Gl),OF=b().regex(Ys),TF=b().regex(git),PF=b().max(vit).regex(xit),NF=b().regex(wit),Qse=Y(je(Ww)).min(1).max(Ww.length).refine((e)=>new Set(e).size===e.length,{message:"each runtime is named once"}),eie=O({name:AF,pool:je(kg),cores:Xs(1,256),memory_mb:Xs(1,16777216),gpus:Xs(0,8),scratch_gb:Xs(1,1e5),backend:je(jw),runtimes:Qse,arch:je(Kw),accounting:je(wg),site:b().regex(yit),trust:je(CF)}).strict(),zrn=O({protocol:ze(Yse),runner_version:PF}).strict(),Grn=O({protocol:ze(Yse),free_slots:Xs(1,Zse),runtimes:Qse,arch:je(Kw),runner_version:PF}).strict(),Vrn=O({job_id:OF,lease_id:TF,phase:je(dit)}).strict(),Sit=O({wall_seconds:Xs(0),cpu_seconds:Xs(0),max_rss_mb:Xs(0)}).strict(),Wrn=O({job_id:OF,lease_id:TF,exit_number:Xs(0,255),launcher_failure_code:je(Cf).nullable(),launcher_detail:AF.nullable(),usage:Sit,usage_partial:Q(),scratch_discarded:Q()}).strict(),tie=O({runner_id:b().regex(Jw),secret:b().regex(mit)}).passthrough(),Krn=O({access_token:b().regex(hit),expires_at:NF}).passthrough(),kit=O({id:OF,lease_id:TF,lease_expires_at:NF,launch_spec_env:b().max(Gse).regex(Eit),image:O({uri:b().max(512).regex(_d),digest:b().regex(Sg),sif:b().regex(_it)}).passthrough(),cores:Xs(1,256),memory_mb:Xs(1,16777216).nullable(),gpus:Xs(0,8),minutes:Xs(1,bit)}).passthrough(),Jrn=O({jobs:Y(kit).max(Zse),min_runner_version:PF}).passthrough(),Yrn=O({lease_expires_at:NF,cancel:Q()}).passthrough(),Xrn=O({state:AF}).passthrough()});var Og=z(()=>{PI();pg();II();mg();FI();vk();rc();$f();Fw();zI();Ooe();hr();xd();Tf();Nw();Vk();Wk();Kk();$F();Lse();qse();Yw()});function Vr(e){return typeof e==="string"&&Dit.test(e)&&!e.includes("..")}function Wl(e){return/^v\d/.test(e)?e.slice(1):e}function Wr(e,t){return Wl(e)===Wl(t)}var Dit;var pa=z(()=>{Dit=/^[0-9A-Za-z][0-9A-Za-z._-]{0,63}$/});function W(e){if(e instanceof Error)return e.message;return String(e)}function Pg(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,cc;var Ue=z(()=>{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"}};cc=class cc extends j{mode;eta;constructor(e,t,n,r){super(503,t,r);this.mode=e;this.eta=n;this.name="MaintenanceError"}}});var Cit,Ait,Oit,Don,oie="override_publication_review",sie="publication_review_not_clear",MF=2000;var Yk=z(()=>{Cit=["dispatched","redispatched","dispatch_claimed"],Ait=["review_disabled","not_applicable","not_owned_here","request_not_requested","screen_not_ready","running","has_result","platform_limit"],Oit=["dispatch_failed","dispatch_unconfigured"],Don=[...Cit,...Ait,...Oit]});var Xk=1e4;function Zk(e){return e?Pit:lc}var lc,Oon,Tit,Pit,jF;var Qk=z(()=>{lc=["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"],Oon=lc.slice(0,lc.indexOf("s3_public_read")),Tit=["update_metadata","update_readme","upload_to_zenodo","publish_doi"],Pit=lc.filter((e)=>!Tit.includes(e));jF={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 Nit(e){return`%${e.replace(/[\\%_]/g,"\\$&")}%`}function Iit(e){return new TextEncoder().encode(Nit(e)).length}function iie(e){if(Iit(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 eR(e){return e.replace(/[A-Z]/g,(t)=>t.toLowerCase())}function aie(e,t){if(e==="")return!0;let n=eR(e);return t.some((r)=>typeof r==="string"&&eR(r).includes(n))}function cie(e,t){return eR(e)===eR(t)}function tR(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(LF.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(LF.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"&&!Fit.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(LF.has(n))return[];t.push(n);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function UF(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 lie(e,t){if(UF(e,t))throw Error("Cannot use string index")}function uie(e,t,n){if(!Pf(e)||typeof t!=="string")return n===void 0?e:n;let r=tR(t);if(r.length===0)return n;for(let o=0;o<r.length;o++){let s=r[o];if(UF(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 qF(e,t,n){if(!Pf(e)||typeof t!=="string")return e;let r=e,o=tR(t);for(let s=0;s<o.length;s++){let i=o[s];if(lie(e,i),s===o.length-1)e[i]=n;else if(!Pf(e[i]))e[i]=typeof o[s+1]==="number"?[]:{};e=e[i]}return r}function die(e,t){if(!Pf(e)||typeof t!=="string")return!1;let n=tR(t);for(let r=0;r<n.length;r++){let o=n[r];if(lie(e,o),r===n.length-1)return delete e[o],!0;if(e=e[o],!Pf(e))return!1}}function pie(e,t){if(!Pf(e)||typeof t!=="string")return!1;let n=tR(t);if(n.length===0)return!1;for(let r of n){if(!Pf(e)||!(r in e)||UF(e,r))return!1;e=e[r]}return!0}var Pf=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},LF,Fit;var fie=z(()=>{LF=new Set(["__proto__","prototype","constructor"]),Fit=new Set("0123456789")});import Gn from"path";import mie from"os";import BF from"process";function zF(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(BF.platform==="darwin")return Mit(e);if(BF.platform==="win32")return jit(e);return Lit(e)}var Sd,HF,Ng,Mit=(e)=>{let t=Gn.join(Sd,"Library");return{data:Gn.join(t,"Application Support",e),config:Gn.join(t,"Preferences",e),cache:Gn.join(t,"Caches",e),log:Gn.join(t,"Logs",e),temp:Gn.join(HF,e)}},jit=(e)=>{let t=Ng.APPDATA||Gn.join(Sd,"AppData","Roaming"),n=Ng.LOCALAPPDATA||Gn.join(Sd,"AppData","Local");return{data:Gn.join(n,e,"Data"),config:Gn.join(t,e,"Config"),cache:Gn.join(n,e,"Cache"),log:Gn.join(n,e,"Log"),temp:Gn.join(HF,e)}},Lit=(e)=>{let t=Gn.basename(Sd);return{data:Gn.join(Ng.XDG_DATA_HOME||Gn.join(Sd,".local","share"),e),config:Gn.join(Ng.XDG_CONFIG_HOME||Gn.join(Sd,".config"),e),cache:Gn.join(Ng.XDG_CACHE_HOME||Gn.join(Sd,".cache"),e),log:Gn.join(Ng.XDG_STATE_HOME||Gn.join(Sd,".local","state"),e),temp:Gn.join(HF,t,e)}};var hie=z(()=>{Sd=mie.homedir(),HF=mie.tmpdir(),{env:Ng}=BF});var Uit=(e,t)=>{let{onError:n}=t;return function(...o){return e.apply(void 0,o).catch(n)}},uc;var gie=z(()=>{uc=Uit});var qit=(e,t)=>{let{onError:n}=t;return function(...o){try{return e.apply(void 0,o)}catch(s){return n(s)}}},fa;var yie=z(()=>{fa=qit});var bie=250;var wie=()=>{};var Bit=(e,t)=>{let{isRetriable:n}=t;return function(o){let{timeout:s}=o,i=o.interval??bie,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 p=Math.round(i*Math.random());if(p>0)return new Promise((m)=>setTimeout(m,p)).then(()=>c.apply(void 0,l));else return c.apply(void 0,l)})}}},dc;var _ie=z(()=>{wie();dc=Bit});var Hit=(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}}}},pc;var xie=z(()=>{pc=Hit});var GF=z(()=>{gie();yie();_ie();xie()});var Xw,VF;var vie=z(()=>{WF();Xw={isChangeErrorOk:(e)=>{if(!Xw.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!Eie&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!Xw.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(!Xw.isNodeError(e))throw e;if(Xw.isChangeErrorOk(e))return;throw e}},VF=Xw});import Sie from"process";var Zw,ks,Eie,yo;var WF=z(()=>{vie();Zw={onError:VF.onChangeError},ks={onError:()=>{return}},Eie=Sie.getuid?!Sie.getuid():!1,yo={isRetriable:VF.isRetriableError}});import qt from"fs";import{promisify as No}from"util";var zit,Kr;var KF=z(()=>{GF();GF();WF();zit={attempt:{chmod:uc(No(qt.chmod),Zw),chown:uc(No(qt.chown),Zw),close:uc(No(qt.close),ks),fsync:uc(No(qt.fsync),ks),mkdir:uc(No(qt.mkdir),ks),realpath:uc(No(qt.realpath),ks),stat:uc(No(qt.stat),ks),unlink:uc(No(qt.unlink),ks),chmodSync:fa(qt.chmodSync,Zw),chownSync:fa(qt.chownSync,Zw),closeSync:fa(qt.closeSync,ks),existsSync:fa(qt.existsSync,ks),fsyncSync:fa(qt.fsync,ks),mkdirSync:fa(qt.mkdirSync,ks),realpathSync:fa(qt.realpathSync,ks),statSync:fa(qt.statSync,ks),unlinkSync:fa(qt.unlinkSync,ks)},retry:{close:dc(No(qt.close),yo),fsync:dc(No(qt.fsync),yo),open:dc(No(qt.open),yo),readFile:dc(No(qt.readFile),yo),rename:dc(No(qt.rename),yo),stat:dc(No(qt.stat),yo),write:dc(No(qt.write),yo),writeFile:dc(No(qt.writeFile),yo),closeSync:pc(qt.closeSync,yo),fsyncSync:pc(qt.fsyncSync,yo),openSync:pc(qt.openSync,yo),readFileSync:pc(qt.readFileSync,yo),renameSync:pc(qt.renameSync,yo),statSync:pc(qt.statSync,yo),writeSync:pc(qt.writeSync,yo),writeFileSync:pc(qt.writeFileSync,yo)}},Kr=zit});import Nf from"process";var kie="utf8",JF=438,Rie=511,$ie,Die,Cie,Aie=1000,Oie,csn,YF=128;var XF=z(()=>{$ie={},Die=Nf.geteuid?Nf.geteuid():-1,Cie=Nf.getegid?Nf.getegid():-1,Oie=!!Nf.getuid,csn=Nf.getuid?!Nf.getuid():!1});var Tie=(e)=>e instanceof Error&&("code"in e),ZF=(e)=>typeof e==="string",nR=(e)=>e===void 0;var Pie=()=>{};var Nie=()=>{};import Iie from"process";var Fie,rR;var QF=z(()=>{Fie=Iie.platform==="linux",rR=Iie.platform==="win32"});var eM,Mie;var jie=z(()=>{QF();eM=["SIGHUP","SIGINT","SIGTERM"];if(!rR)eM.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(Fie)eM.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");Mie=eM});import Ig from"process";class Lie{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(rR&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))Ig.kill(Ig.pid,"SIGTERM");else Ig.kill(Ig.pid,e)},this.hook=()=>{Ig.once("exit",()=>this.exit());for(let e of Mie)try{Ig.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var Uie;var qie=z(()=>{QF();jie();Uie=new Lie});var Git,Bie;var Hie=z(()=>{qie();Git=Uie.register,Bie=Git});import Vit from"path";var Zs,Qw;var zie=z(()=>{KF();Hie();XF();Zs={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=Zs.truncate(t(e));if(r in Zs.store)return Zs.get(e,t,n);return Zs.store[r]=n,[r,()=>delete Zs.store[r]]},purge:(e)=>{if(!Zs.store[e])return;delete Zs.store[e],Kr.attempt.unlink(e)},purgeSync:(e)=>{if(!Zs.store[e])return;delete Zs.store[e],Kr.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in Zs.store)Zs.purgeSync(e)},truncate:(e)=>{let t=Vit.basename(e);if(t.length<=YF)return e;let n=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!n)return e;let r=t.length-YF;return`${e.slice(0,-t.length)}${n[1]}${n[2].slice(0,-r)}${n[3]}`}};Bie(Zs.purgeSyncAll);Qw=Zs});import Wit from"path";function tM(e,t,n=$ie){if(ZF(n))return tM(e,t,{encoding:n});let o={timeout:n.timeout??Aie},s=null,i=null,a=null;try{let c=Kr.attempt.realpathSync(e),l=!!c;e=c||e,[i,s]=Qw.get(e,n.tmpCreate||Qw.create,n.tmpPurge!==!1);let d=Oie&&nR(n.chown),p=nR(n.mode);if(l&&(d||p)){let f=Kr.attempt.statSync(e);if(f){if(n={...n},d)n.chown={uid:f.uid,gid:f.gid};if(p)n.mode=f.mode}}if(!l){let f=Wit.dirname(e);Kr.attempt.mkdirSync(f,{mode:Rie,recursive:!0})}if(a=Kr.retry.openSync(o)(i,"w",n.mode||JF),n.tmpCreated)n.tmpCreated(i);if(ZF(t))Kr.retry.writeSync(o)(a,t,0,n.encoding||kie);else if(!nR(t))Kr.retry.writeSync(o)(a,t,0,t.length,0);if(n.fsync!==!1)if(n.fsyncWait!==!1)Kr.retry.fsyncSync(o)(a);else Kr.attempt.fsync(a);if(Kr.retry.closeSync(o)(a),a=null,n.chown&&(n.chown.uid!==Die||n.chown.gid!==Cie))Kr.attempt.chownSync(i,n.chown.uid,n.chown.gid);if(n.mode&&n.mode!==JF)Kr.attempt.chmodSync(i,n.mode);try{Kr.retry.renameSync(o)(i,e)}catch(f){if(!Tie(f))throw f;if(f.code!=="ENAMETOOLONG")throw f;Kr.retry.renameSync(o)(i,Qw.truncate(e))}s(),i=null}finally{if(a)Kr.attempt.closeSync(a);if(i)Qw.purge(i)}}var Gie=z(()=>{KF();XF();Pie();Nie();zie()});var t_=_(function(Kie){Object.defineProperty(Kie,"__esModule",{value:!0});Kie.regexpCode=Kie.getEsmExportName=Kie.getProperty=Kie.safeStringify=Kie.stringify=Kie.strConcat=Kie.addCodeArg=Kie.str=Kie._=Kie.nil=Kie._Code=Kie.Name=Kie.IDENTIFIER=Kie._CodeOrName=void 0;class oR{}Kie._CodeOrName=oR;Kie.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Fg extends oR{constructor(e){super();if(!Kie.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}}}Kie.Name=Fg;class ma extends oR{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 Fg)t[n.str]=(t[n.str]||0)+1;return t},{})}}Kie._Code=ma;Kie.nil=new ma("");function Vie(e,...t){let n=[e[0]],r=0;while(r<t.length)rM(n,t[r]),n.push(e[++r]);return new ma(n)}Kie._=Vie;var nM=new ma("+");function Wie(e,...t){let n=[e_(e[0])],r=0;while(r<t.length)n.push(nM),rM(n,t[r]),n.push(nM,e_(e[++r]));return Kit(n),new ma(n)}Kie.str=Wie;function rM(e,t){if(t instanceof ma)e.push(...t._items);else if(t instanceof Fg)e.push(t);else e.push(Xit(t))}Kie.addCodeArg=rM;function Kit(e){let t=1;while(t<e.length-1){if(e[t]===nM){let n=Jit(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}function Jit(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof Fg||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 Fg))return`"${e}${t.slice(1)}`;return}function Yit(e,t){return t.emptyStr()?e:e.emptyStr()?t:Wie`${e}${t}`}Kie.strConcat=Yit;function Xit(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:e_(Array.isArray(e)?e.join(","):e)}function Zit(e){return new ma(e_(e))}Kie.stringify=Zit;function e_(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Kie.safeStringify=e_;function Qit(e){return typeof e=="string"&&Kie.IDENTIFIER.test(e)?new ma(`.${e}`):Vie`[${e}]`}Kie.getProperty=Qit;function eat(e){if(typeof e=="string"&&Kie.IDENTIFIER.test(e))return new ma(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Kie.getEsmExportName=eat;function tat(e){return new ma(e.toString())}Kie.regexpCode=tat});var aM=_(function(Zie){Object.defineProperty(Zie,"__esModule",{value:!0});Zie.ValueScope=Zie.ValueScopeName=Zie.Scope=Zie.varKinds=Zie.UsedValueState=void 0;var hn=t_();class Yie extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var iR;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(iR||(Zie.UsedValueState=iR={}));Zie.varKinds={const:new hn.Name("const"),let:new hn.Name("let"),var:new hn.Name("var")};class sM{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof hn.Name?e:this.name(e)}name(e){return new hn.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}}}Zie.Scope=sM;class iM extends hn.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=hn._`.${new hn.Name(t)}[${n}]`}}Zie.ValueScopeName=iM;var mat=hn._`\n`;class Xie extends sM{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?mat:hn.nil}}get(){return this._scope}name(e){return new iM(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 hn._`${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=hn.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,iR.Started);let l=t(c);if(l){let d=this.opts.es5?Zie.varKinds.var:Zie.varKinds.const;o=hn._`${o}${d} ${c} = ${l};${this.opts._n}`}else if(l=r===null||r===void 0?void 0:r(c))o=hn._`${o}${l}${this.opts._n}`;else throw new Yie(c);a.set(c,iR.Completed)})}return o}}Zie.ValueScope=Xie});var _t=_(function(Rs){Object.defineProperty(Rs,"__esModule",{value:!0});Rs.or=Rs.and=Rs.not=Rs.CodeGen=Rs.operators=Rs.varKinds=Rs.ValueScopeName=Rs.ValueScope=Rs.Scope=Rs.Name=Rs.regexpCode=Rs.stringify=Rs.getProperty=Rs.nil=Rs.strConcat=Rs.str=Rs._=void 0;var ge=t_(),er=aM(),kd=t_();Object.defineProperty(Rs,"_",{enumerable:!0,get:function(){return kd._}});Object.defineProperty(Rs,"str",{enumerable:!0,get:function(){return kd.str}});Object.defineProperty(Rs,"strConcat",{enumerable:!0,get:function(){return kd.strConcat}});Object.defineProperty(Rs,"nil",{enumerable:!0,get:function(){return kd.nil}});Object.defineProperty(Rs,"getProperty",{enumerable:!0,get:function(){return kd.getProperty}});Object.defineProperty(Rs,"stringify",{enumerable:!0,get:function(){return kd.stringify}});Object.defineProperty(Rs,"regexpCode",{enumerable:!0,get:function(){return kd.regexpCode}});Object.defineProperty(Rs,"Name",{enumerable:!0,get:function(){return kd.Name}});var pR=aM();Object.defineProperty(Rs,"Scope",{enumerable:!0,get:function(){return pR.Scope}});Object.defineProperty(Rs,"ValueScope",{enumerable:!0,get:function(){return pR.ValueScope}});Object.defineProperty(Rs,"ValueScopeName",{enumerable:!0,get:function(){return pR.ValueScopeName}});Object.defineProperty(Rs,"varKinds",{enumerable:!0,get:function(){return pR.varKinds}});Rs.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 Rd{optimizeNodes(){return this}optimizeNames(e,t){return this}}class eae extends Rd{constructor(e,t,n){super();this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?er.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=jg(this.rhs,e,t);return this}get names(){return this.rhs instanceof ge._CodeOrName?this.rhs.names:{}}}class uM extends Rd{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=jg(this.rhs,e,t),this}get names(){let e=this.lhs instanceof ge.Name?{}:{...this.lhs.names};return dR(e,this.rhs)}}class tae extends uM{constructor(e,t,n,r){super(e,n,r);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class nae extends Rd{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class rae extends Rd{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class oae extends Rd{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class sae extends Rd{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=jg(this.code,e,t),this}get names(){return this.code instanceof ge._CodeOrName?this.code.names:{}}}class fR extends Rd{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;bat(e,o.names),n.splice(r,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>If(e,t.names),{})}}class $d extends fR{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class iae extends fR{}class n_ extends $d{}n_.kind="else";class Kl extends $d{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 n_(n):n}if(t){if(e===!1)return t instanceof Kl?t:t.nodes;if(this.nodes.length)return this;return new Kl(dae(e),t instanceof Kl?[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=jg(this.condition,e,t),this}get names(){let e=super.names;if(dR(e,this.condition),this.else)If(e,this.else.names);return e}}Kl.kind="if";class Mg extends $d{}Mg.kind="for";class aae extends Mg{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=jg(this.iteration,e,t),this}get names(){return If(super.names,this.iteration.names)}}class cae extends Mg{constructor(e,t,n,r){super();this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?er.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=dR(super.names,this.from);return dR(e,this.to)}}class cM extends Mg{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=jg(this.iterable,e,t),this}get names(){return If(super.names,this.iterable.names)}}class aR extends $d{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)}}aR.kind="func";class cR extends fR{render(e){return"return "+super.render(e)}}cR.kind="return";class lae extends $d{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)If(e,this.catch.names);if(this.finally)If(e,this.finally.names);return e}}class lR extends $d{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}lR.kind="catch";class uR extends $d{render(e){return"finally"+super.render(e)}}uR.kind="finally";class uae{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
85
+ `).trim().split(/\n{2,}/).map((t)=>t.trim()).filter((t)=>t!=="")}function eot(e){let t=/^(#{1,3})\s+(.+)$/.exec(e);if(!t)return null;return{level:t[1].length,text:t[2]}}function woe(e){let t=new Set(Qrt(e).map((n)=>eot(n)?.text.trim().toLowerCase()).filter((n)=>Boolean(n)));return HI.filter((n)=>!t.has(n.toLowerCase()))}function _oe(e){let t=e.trim(),n=tot.exec(t);if(n)return{kind:"dataset",datasetId:n[1],version:n[2]??null,text:t};if(not.test(t))return{kind:"github",url:t,text:t};return null}var vs,Iw,Df="recall",boe,HI,tot,not,xoe="A recall needs a reference: a dataset id with an optional version (nm000104 or nm000104@v1.2.0), or a nemarOrg or nemarDatasets issue, pull request or security advisory URL.";var Fw=z(()=>{rc();vs=["news","rfcs","maintenance"],Iw=[...vs,"recall"];boe=["recall_cannot_be_turned_off","admin_alert_not_self_service","unknown_mail_preference","invalid_mail_preference"];HI=["What is affected","What to do"];tot=/^([a-z]{2}\d{6})(?:@v?(\d+\.\d+\.\d+))?$/,not=/^https:\/\/github\.com\/(?:nemarOrg|nemarDatasets)\/[A-Za-z0-9._-]+\/(?:(?:issues|pull)\/\d{1,9}|security\/advisories\/GHSA(?:-[a-z0-9]{4}){3})$/});function Ak(e,t){let n=e.sss!==void 0;if(e.derived!==n)t.addIssue({code:ne.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 Yo,$k,voe,Dk,rot,Ck,oot,sot,iot,aot,cot,lnn,lot,unn,uot,dnn;var zI=z(()=>{mn();Yo=/^[a-z]{2}[0-9]{6}$/,$k=/^[0-9a-f]{40}$/,voe=O({name:b(),modality:b().nullable().optional(),rate:D().nullable().optional(),n_channels:D().int().nonnegative().nullable().optional(),n_samples:D().int().nonnegative().nullable().optional(),duration_s:D().nonnegative().nullable().optional(),source_rate_hz:D().nullable().optional(),n_view_levels:D().int().nonnegative().optional(),view_chunk_columns:D().int().positive().optional(),chunk_samples:D().int().positive().optional(),shard_samples:D().int().positive().optional()}).passthrough(),Dk=O({converted:D().int().nonnegative().optional(),relabelled:D().int().nonnegative().optional(),kept_importer_unit:D().int().nonnegative().optional(),units_column_present:Q().optional(),sidecar:b().optional(),sidecar_supplied:Q().optional(),unmatched_channels:D().int().nonnegative().optional(),unmatched_case_only:D().int().positive().optional(),matched_case_only:D().int().positive().optional(),matched_case_only_examples:Y(b()).max(5).optional(),unmatched_raw_label:D().int().positive().optional(),unmatched_examples:Y(b()).max(5).optional()}).passthrough(),rot=O({channels_tsv:D().int().positive(),in_file:D().int().nonnegative(),in_store:D().int().nonnegative()}).passthrough(),Ck=O({applied:Q().optional(),method:b().optional(),calibration:b().optional(),cross_talk:b().optional(),mne_version:b().optional()}).passthrough();oot=O({path:b(),zarr:b().regex(/\.zarr$/,"must end in .zarr"),updated_utc:b().optional(),source_tree:ze("raw"),derived:Q(),modalities:Y(b()).optional(),groups:Y(voe).optional(),power_line_frequency:D().nullable().optional(),event_description_count:D().int().nonnegative().optional(),n_events:D().int().nonnegative().optional(),trial_types:Fn(b(),D().int().nonnegative()).optional(),units_report:Dk.optional(),channels_tsv_read_error:Q().optional(),channels_tsv_count_mismatch:rot.optional(),split_members:Y(b()).optional(),sss:Ck.optional()}).passthrough().superRefine(Ak),sot=O({path:b(),zarr:b().regex(/\.zarr$/,"must end in .zarr").optional(),code:b(),reason:b(),detail:b().nullable().optional(),attempts:D().int().nonnegative().optional()}).passthrough(),iot=je(["infra_failure","memory_budget","not_attempted"]),aot=O({path:b(),zarr:b().regex(/\.zarr$/,"must end in .zarr"),reason:iot,attempts:D().int().nonnegative(),last_error:b().nullable().optional(),last_attempt_utc:b().nullable().optional()}).passthrough(),cot=O({level0:ze("<zarr>/<group>/0"),view:ze("<zarr>/<group>/view/<L>"),view_levels:ze("1..n_view_levels from the group attrs"),scale_offset:ze("level-0 array attrs scale[] and offset[]; physical = digital * scale + offset"),events:ze("<data_base>events.parquet").optional()}).passthrough(),lnn=O({format:ze("nemar-zarr-index"),format_version:ze(3),dataset_id:b().regex(Yo,"NEMAR dataset id (nm/on/xx band)"),contract_base:b().regex(/^https:\/\//,"must be https"),data_base:b().regex(/^https:\/\//,"must be https"),data_base_kind:ze("s3-public"),s3_uri:b().regex(/^s3:\/\//,"must be an s3:// URI"),s3_region:b().min(1),s3_anonymous:Q(),source_commit:b().regex($k,"must be a full 40-hex SHA"),engine_version:b().min(1),biosigio_version:b().nullable().optional(),updated_utc:b(),discovered_count:D().int().nonnegative(),store_count:D().int().nonnegative(),n_recordings:D().int().nonnegative(),errors:D().int().nonnegative(),failure_count:D().int().nonnegative(),pending_count:D().int().nonnegative(),stores:Y(oot),failures:Y(sot),pending:Y(aot),doi:b().nullable().optional(),license:b().nullable().optional(),citation:b().nullable().optional(),hed_version:b().nullable().optional(),events_parquet:b().regex(/^https:\/\//,"must be https").optional(),events_row_count:D().int().nonnegative().optional(),layout:cot}).passthrough(),lot=O({name:b(),configuration:Fn(b(),xs()).optional()}).passthrough(),unn=O({zarr_format:ze(3),node_type:ze("array"),shape:Y(D().int().nonnegative()),data_type:b(),chunk_grid:O({name:b(),configuration:Fn(b(),xs()).optional()}).passthrough(),codecs:Y(lot),fill_value:xs().optional(),attributes:Fn(b(),xs()).optional(),dimension_names:Y(b().nullable()).optional()}).passthrough(),uot=O({path:b(),zarr:b().regex(/\.zarr$/,"must end in .zarr"),groups:Y(voe).optional(),modalities:Y(b()).optional()}).passthrough(),dnn=O({format:ze("nemar-zarr-index"),format_version:D().int(),dataset_id:b().regex(Yo,"NEMAR dataset id (nm/on/xx band)"),source_commit:b(),stores:Y(uot)}).passthrough()});function Eoe(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 dot,pot,fot,mot,sc,mnn;var Ok=z(()=>{II();dot=["10-05","10-10","10-20","biosemi","egi-geodesic","other"],pot=["50","60"],fot=["ready","pending","failed"],mot=NI.options,sc=[{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:pot},{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:dot},{key:"source",flag:"--source",queryParam:"source",valueKind:"enum",label:"Source archive",enumValues:mot},{key:"zarr",flag:"--zarr",queryParam:"zarr",valueKind:"enum",label:"Zarr conversion status",enumValues:fot},{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"}],mnn=new Map(sc.map((e)=>[e.key,e]))});var hot,wnn,got,Doe,Mw,Soe,yot,Coe,bot=20,wot=100,_ot,Aoe,xot,_nn,xnn,vot,vnn,Enn,Eot,Sot,kot,Snn,Rot=50,$ot=500,knn,Dot,Cot,Rnn,Aot=1000,Oot=5000,koe=8,Tot=100,Pot=32,Roe,$nn,Not,Iot,Fot,Dnn,Mot=800,jot=4000,Cnn,Ann,GI=60,VI=64,$oe,Lot=86400,Uot=4096,Onn,qot,Bot,Tnn;var Ooe=z(()=>{mn();Ok();zI();hot=O({dataset_id:b().regex(Yo),name:b(),doi:b().nullable().optional(),license:b().nullable().optional(),modalities:Y(b()).optional(),tasks:Y(b()).optional(),subject_count:D().int().nonnegative().nullable().optional(),has_hed:dg([ze(0),ze(1)]).nullable().optional(),hed_version:b().nullable().optional(),store_count:D().int().nonnegative().nullable().optional(),recording_count:D().int().nonnegative().nullable().optional(),recordings_unavailable:D().int().nonnegative().nullable().optional(),total_recording_duration:D().nullable().optional(),zarr_converted_at:b().nullable().optional(),zarr_source_commit:b().nullable().optional(),zarr_errors:D().int().nonnegative().nullable().optional(),zarr_verify_status:je(["verified","failed","unverifiable"]).nullable().optional(),zarr_verified_at:b().nullable().optional(),index_url:b().nullable().optional()}).passthrough(),wnn=O({format:ze("nemar-zarr-catalog"),format_version:D().int(),generated_utc:b(),contract_base:b(),count:D().int().nonnegative(),datasets:Y(hot)}).passthrough(),got=["verified","failed","unverifiable"],Doe=je(got).nullable(),Mw=O({dataset_id:b().regex(Yo),doi:b().nullable(),license:b().nullable(),citation:b().nullable(),source_commit:b().regex($k),index_etag:b().nullable(),engine_version:b(),source_tree:ze("raw"),derived:Q(),sss:Ck.optional(),lossy:Q(),dtype:b().nullable(),effective_rate_hz:D().nullable(),source_rate_hz:D().nullable(),units_report:Dk.nullable().optional(),zarr_verify_status:Doe,note:b().nullable().optional()}).passthrough().superRefine(Ak),Soe=O({start:D().int().nonnegative(),end:D().int().nonnegative()}).passthrough().refine((e)=>e.end>=e.start,{message:"end must be >= start",path:["end"]}),yot=O({python_zarr:b(),zarrita:b(),python_browser:b()}).passthrough(),Coe=O({contract_base:b(),data_base:b(),s3_uri:b(),s3_region:b(),s3_anonymous:Q(),zarr:b(),group:b(),level:dg([ze("0"),D().int().positive()]),array_path:b(),dtype:b().nullable(),codecs:Y(xs()).optional(),chunk_samples:D().int().positive().nullable(),shard_samples:D().int().positive().nullable(),n_channels:D().int().nonnegative().nullable(),sample_slice:Soe.optional(),channel_slice:Soe.optional(),scale_offset:b(),how_to:yot}).passthrough(),_ot=Object.fromEntries(sc.map((e)=>[e.queryParam,b().optional()])),Aoe={modality:b().optional(),task:b().optional(),has_hed:Q().optional(),has_zarr:Q().optional(),author:b().optional(),has_doi:Q().optional(),has_zarr_verified:Q().optional(),data_complete:Q().optional(),recent:D().int().positive().optional(),license:b().optional()},xot=Object.keys(Aoe),_nn=[...xot,...sc.map((e)=>e.queryParam)],xnn=O({query:b().optional(),...Aoe,include_unknown:Q().optional(),..._ot,limit:D().int().positive().max(wot).default(bot)}).passthrough(),vot=O({dataset_id:b().regex(Yo),name:b(),doi:b().nullable().optional(),license:b().nullable().optional(),modalities:Y(b()).optional(),tasks:Y(b()).optional(),subject_count:D().int().nullable().optional(),has_hed:Q().nullable().optional(),has_zarr:Q()}).passthrough(),vnn=O({results:Y(vot),count:D().int().nonnegative(),limit:D().int(),note:b().nullable().optional(),truncated:Q().optional()}).passthrough(),Enn=O({dataset_id:b().regex(Yo)}).passthrough(),Eot=["list_recordings","get_events","render_overview","read_window"],Sot=O({next_cheapest_tool:je(Eot),reason:b()}).passthrough(),kot=["pending","ready","failed"],Snn=O({dataset_id:b().regex(Yo),name:b(),doi:b().nullable(),license:b().nullable(),citation:b().nullable(),modalities:Y(b()).optional(),tasks:Y(b()).optional(),subject_count:D().int().nullable().optional(),has_hed:Q().nullable().optional(),hed_version:b().nullable().optional(),recording_count:D().int().nullable().optional(),total_recording_duration_s:D().nullable().optional(),zarr_status:je(kot).nullable().optional(),zarr_verify_status:Doe.optional(),zarr_source_commit:b().nullable().optional(),zarr_store_count:D().int().nullable().optional(),cost_hint:Sot}).passthrough(),knn=O({dataset_id:b().regex(Yo),modality:b().optional(),min_duration_s:D().nonnegative().optional(),include_derived:Q().default(!1),limit:D().int().positive().max($ot).default(Rot),offset:D().int().nonnegative().default(0)}).passthrough(),Dot=O({name:b(),modality:b().nullable().optional(),rate:D().nullable().optional(),n_channels:D().int().nullable().optional(),duration_s:D().nullable().optional(),n_view_levels:D().int().nonnegative().nullable().optional(),n_samples:D().int().nonnegative().nullable().optional(),view_chunk_columns:D().int().positive().nullable().optional()}).passthrough(),Cot=O({path:b(),zarr:b(),source_tree:ze("raw"),derived:Q(),groups:Y(Dot).optional(),n_events:D().int().nonnegative().optional(),sss:Ck.optional(),units_report:Dk.optional()}).passthrough().superRefine(Ak),Rnn=O({dataset_id:b().regex(Yo),source_commit:b().regex($k).nullable(),recordings:Y(Cot),total_count:D().int().nonnegative(),excluded_derived_count:D().int().nonnegative(),limit:D().int(),offset:D().int(),index_format_version:D().int(),discovered_count:D().int().nonnegative().nullable(),failure_count:D().int().nonnegative().nullable(),pending_count:D().int().nonnegative().nullable(),excluded_legacy_non_raw_count:D().int().nonnegative(),note:b().nullable().optional(),envelope:Mw.optional()}).passthrough(),Roe=b().min(1).max(64),$nn=O({dataset_id:b().regex(Yo),recording:b(),group:b().optional(),limit:D().int().positive().max(Oot).default(Aot),offset:D().int().nonnegative().default(0),where:Fn(Roe,Y(dg([b(),D()])).min(1).max(Tot)).refine((e)=>{let t=Object.keys(e).length;return t>=1&&t<=koe},{message:`where names 1 to ${koe} columns`}).optional(),columns:Y(Roe).min(1).max(Pot).optional()}).passthrough(),Not=O({store_path:b(),group_name:b(),onset_s:D(),duration_s:D().nullable().optional(),sample_index:D().int().nonnegative(),trial_type:b().nullable().optional(),value:dg([b(),D()]).nullable().optional(),hed:b().nullable().optional()}).passthrough(),Iot=Not.partial().required({onset_s:!0,sample_index:!0}),Fot=O({name:b(),distinct_count:D().int().nonnegative(),null_count:D().int().nonnegative(),values:Y(O({value:b(),count:D().int().positive()}).passthrough()).nullable()}).passthrough(),Dnn=O({dataset_id:b().regex(Yo),recording:b(),events:Y(Iot),source:je(["events_parquet","events_tsv_fallback"]),estimated:Q(),total_count:D().int().nonnegative(),limit:D().int(),offset:D().int(),truncated:Q(),note:b().nullable().optional(),columns_summary:Y(Fot).optional(),envelope:Mw.optional()}).passthrough(),Cnn=O({dataset_id:b().regex(Yo),recording:b(),group:b().optional(),width_px:D().int().positive().max(jot).default(Mot)}).passthrough(),Ann=O({dataset_id:b().regex(Yo),recording:b(),group:b(),level:D().int().positive(),width_px:D().int().positive(),height_px:D().int().positive(),mime_type:ze("image/png"),columns_read:D().int().nonnegative(),chunks_read:D().int().nonnegative(),bytes_read:D().int().nonnegative(),envelope:Mw.optional()}).passthrough(),$oe=GI*VI,Onn=O({dataset_id:b().regex(Yo),recording:b(),group:b().optional(),start_s:D().nonnegative().default(0),duration_s:D().positive().max(Lot).default(10),channels:Y(D().int().nonnegative()).max(Uot).optional(),taste:Q().default(!1)}).passthrough().superRefine((e,t)=>{if(!e.taste)return;if(!e.channels||e.channels.length===0){t.addIssue({code:ne.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>GI)t.addIssue({code:ne.custom,message:`taste duration_s (${e.duration_s}) exceeds the ${GI} s cap; omit taste for a recipe instead`,path:["duration_s"]});if(e.channels.length>VI)t.addIssue({code:ne.custom,message:`taste channels (${e.channels.length}) exceeds the ${VI}-channel cap; omit taste for a recipe instead`,path:["channels"]});let n=e.duration_s*e.channels.length;if(n>$oe)t.addIssue({code:ne.custom,message:`taste exceeds the cap of ${$oe} channel-seconds (duration_s x channels = ${n}); omit taste for a recipe instead`,path:["duration_s"]})}),qot=O({mode:ze("recipe"),recipe:Coe,envelope:Mw}).passthrough(),Bot=O({mode:ze("taste"),start_s:D(),duration_s:D(),channels:Y(D().int()),sample_rate_hz:D(),values:Y(Y(D())),recipe:Coe,chunks_read:D().int().nonnegative(),bytes_read:D().int().nonnegative(),filled_ranges:Y(O({start_sample:D().int().nonnegative(),end_sample:D().int().nonnegative(),start_s:D(),end_s:D()}).passthrough()),note:b().nullable().optional(),envelope:Mw}).passthrough(),Tnn=SI("mode",[qot,Bot])});function Noe(e){let t=Cf.indexOf(e);if(t<0)throw RangeError("not a launcher failure code");return zot+t}var Gl,wd,Toe,Hot,Inn,Cf,Poe=0,zot=10,Got,Vot,Tk,wg,jw,Ioe,Wot,Fnn,Mnn,WI,Foe,Moe,Pk,Nk,joe;var la=z(()=>{Gl=/^[a-z0-9_]{1,64}$/,wd=["created","uploading","submitted","queued","running","archiving","finished","failed","cancelled","unreported"],Toe=["finished","failed","cancelled"],Hot=["created","uploading","submitted","queued","running","archiving","unreported"],Inn=Hot.filter((e)=>e!=="created"&&e!=="uploading"&&e!=="unreported"),Cf=["code_fetch_failed","dataset_fetch_failed","entry_not_found","runtime_error","out_of_memory","time_limit","result_upload_failed"];Got=["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","runner_lost"],Vot=["upload_expired"],Tk=["tapis","runner"],wg=["su","none"],jw=["local","slurm"],Ioe={runner_credential_not_accepted:401,runner_unknown:401,runner_token_expired:401,runners_disabled:503,lease_lost:409,job_not_claimed:404,runner_outdated:426,protocol_unsupported:426,runner_accounting_unbuilt:409,invalid_body:400},Wot=["results_too_large","results_quota_exceeded","too_many_outputs"],Fnn={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","image_unverified","runtime_unusable","internal_error","output_dir_not_empty","bind_source_unsafe","pid_namespace_unavailable"],out_of_memory:[],time_limit:[],result_upload_failed:[...Wot,"outputs_unreadable","bad_response","fetch_failed","incomplete_plan","upload_failed","outputs_refused","complete_refused","internal_error"]},Mnn=[...Cf,...Got.filter((e)=>!Cf.includes(e)),...Vot],WI={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,platform_busy:409},Foe={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 is not available.",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."},Moe=["batch","interactive"],Pk=["unreserved","unattributed","mismatch","overrun"],Nk=["pending","attempting","sent","failed"],joe=["job","account"]});function Af(e,t=512){return typeof e==="string"&&e.length>=1&&e.length<=t&&qoe.test(e)&&!Eg.test(e)}function QI(e){if(typeof e!=="string")return null;let t=/^[0-9]/.test(e)?`v${e}`:e;return t.length<=ZI&&XI.test(t)?t:null}function Boe(e){let t=e.findIndex((n)=>QI(n.version)===null);return t<0?null:`datasets.${t}.version`}function nF(e){return b().max(e).regex(qoe).refine((t)=>!Eg.test(t),{message:"a path may not hold . or .. segments"})}function Uw(e){if(e!==null&&typeof e==="object"&&!Object.isFrozen(e)){Object.freeze(e);for(let t of Object.values(e))Uw(t)}return e}function xg(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 KI(e,t){return(e+t-1n)/t}function Zot(e,t,n){if(!Object.hasOwn(vg,e))throw RangeError("not a partition");let r=vg[e],o=xg("nodes",t.nodes,1),s=xg("cores",t.cores??0,0),i=xg("memory_mb",t.memory_mb??0,0),a=xg("gpus",t.gpus??0,0),c=xg("seconds",n,0),l=Xot,d=BigInt(l.milliPerSu),p;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=KI(i*d,BigInt(l.memoryMbPerCoreUnit));p=x>v?x:v;break}case"whole_cpu_node":p=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=KI(i*d,BigInt(l.memoryMbPerGpuUnit));p=x>v?x:v;break}case"whole_gpu_node":p=BigInt(l.gpuNodeGpus)*d;break}let f=p*o,m=r.preempt?BigInt(l.preemptNumerator):1n,h=r.preempt?BigInt(l.preemptDenominator):1n,g=KI(f*c*m,3600n*h),y=BigInt(l.minChargeMilli),w=g<y?y:g;if(w>BigInt(eF))throw RangeError("amount too large to hold exactly");return Number(w)}function zoe(e){let t=xg("minutes",e.minutes,0);return Zot(e.partition,e,Number(t*60n))}function Goe(e){if(typeof e!=="string")return null;let t=Qot.exec(e);if(!t)return null;let n=BigInt(t[1])*1000n+BigInt((t[2]??"").padEnd(3,"0"));if(n>BigInt(eF))return null;return Number(n)}function mr(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 nst(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 ist(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 ast(e,t){let n=nst(e);if(n!==null)t.addIssue({code:ne.custom,message:`an include pattern the dialect refuses: ${n}`})}function _g(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 dst(e){let t=0;if(e.entry!==void 0)t+=_g(e.entry)+1;for(let n of e.command??[])t+=_g(n)+1;for(let n of e.args??[])t+=_g(n)+1;for(let n of e.datasets??[])for(let r of n.include??[])t+=_g(r)+1;for(let[n,r]of Object.entries(e.env??{}))if(r!==void 0)t+=_g(n)+_g(r)+2;return t}function yst(e){let t=e.split(/[=\s]/)[0]??"";if(t.startsWith("-G"))return!0;let n=t.replace(/^-+/,"").toLowerCase();if(/gpu|gres|tres/.test(n))return!0;return n.length>=1&&["gpus","gres","tres"].some((r)=>r.startsWith(n))}var YI="\\u0000-\\u001f\\u007f",jk,Loe,qoe,Eg,Kot,Jot,Lw=1e5,Ys,ic,Sg,Vl,Lk,XI,ZI=64,eF,ua=(e,t=eF)=>D().int().min(e).max(t),St,tF,Fk,Hoe,rF,kg,qw,Yot,Ik=2880,vg,Xot,Qot,Rg,Voe,Of,est,oF,tst,sF="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.",iF="An argument vector, run as given, with args appended.",aF="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.",cF="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).",rst,ost,sst,_d,Mk=(e)=>e.refine(ist,{message:"a lone surrogate is not text a process argument can carry"}),cst,lst,ust,pst=49152,$g,fst,mst,hst,gst,bst,wst,Woe,JI=1073741824,Uoe=1048576,_st,qnn,Bnn,xst,Hnn,Koe,znn,vst,Gnn;var hr=z(()=>{mn();la();jk=`[^/\\\\${YI}]+`,Loe=jk,qoe=new RegExp(`^(?:${Loe}/)*${Loe}$`),Eg=/(?:^|\/)\.\.?(?:\/|$)/,Kot=new RegExp(`^[^\\\\${YI}]+$`),Jot=/^\/|(?:^|\/)\.\.(?:\/|$)/;Ys=/^job_[0-9a-f]{24}$/,ic=/^[0-9a-f]{64}$/,Sg=/^sha256:[0-9a-f]{64}$/,Vl=/^[a-z]{2}[0-9]{6}$/,Lk=/^[0-9A-Za-z][0-9A-Za-z._+-]{0,63}$/,XI=/^(?:latest|v[0-9]+\.[0-9]+\.[0-9]+)$/;eF=Number.MAX_SAFE_INTEGER,St=ua,tF=b().regex(Ys),Fk=b().regex(ic);Hoe=nF,rF=b().max(256).regex(Kot).refine((e)=>!Jot.test(e),{message:"a pattern may not leave the dataset"});kg=["cpu","gpu"],qw=["shared","compute","debug","large-shared","preempt","gpu-shared","gpu","gpu-debug","gpu-preempt"],Yot=O({maxNodes:St(1,64),maxCoresPerNode:St(0,256),maxGpusPerNode:St(0,8),maxMinutes:St(1,10080)}).strict(),vg=Uw({shared:{pool:"cpu",rate:"core_or_memory",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:64,maxGpusPerNode:0,maxMinutes:Ik}},compute:{pool:"cpu",rate:"whole_cpu_node",preempt:!1,ceiling:{maxNodes:2,maxCoresPerNode:128,maxGpusPerNode:0,maxMinutes:Ik}},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:Ik}},gpu:{pool:"gpu",rate:"whole_gpu_node",preempt:!1,ceiling:{maxNodes:1,maxCoresPerNode:40,maxGpusPerNode:4,maxMinutes:Ik}},"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}}),Xot={version:1,milliPerSu:1000,cpuNodeCores:128,gpuNodeGpus:4,memoryMbPerCoreUnit:2048,memoryMbPerGpuUnit:94208,preemptNumerator:800,preemptDenominator:1000,minChargeMilli:1000};Qot=/^([0-9]+)(?:\.([0-9]{1,3}))?$/;Rg=["result.json","provenance.json","manifest.json","launcher.log"],Voe={SPEC:"NEMAR_LAUNCH_SPEC",OUT:"NEMAR_OUT",LOCAL_DATASETS_ROOT:"NEMAR_LOCAL_DATASETS_ROOT",HOST_PYTHON:"NEMAR_HOST_PYTHON",SIF_ROOT:"NEMAR_SIF_ROOT"},Of=["OMP_NUM_THREADS","MKL_NUM_THREADS","OPENBLAS_NUM_THREADS","NUMEXPR_NUM_THREADS","PYTHONHASHSEED","MPLBACKEND"],est=/^[ -~]*$/,oF=b().max(256).regex(est),tst=Fn(je(Of),oF);rst=["python","matlab","image"],ost=/^[A-Za-z0-9][A-Za-z0-9 ._-]{0,79}$/,sst=/^[a-z][a-z0-9-]{0,63}$/,_d=/^(?:docker:\/\/)?[a-z0-9]+(?:[._-][a-z0-9]+)*(?::[0-9]{1,5})?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)+@sha256:[0-9a-f]{64}$/;cst=O({size:St(1),sha256:Fk}).strict(),lst=O({id:b().regex(Vl),version:b().regex(Lk),include:Y(Mk(rF).superRefine(ast)).max(64).optional().describe(cF)}).strict(),ust=Mk(b().max(1024));$g=O({name:b().regex(ost),runtime:je(rst),entry:Mk(Hoe(240)).optional().describe(sF),command:Y(Mk(b().min(1).max(1024))).min(1).max(64).optional().describe(iF),args:Y(ust).max(64).default([]).describe(aF),bundle:cst.optional(),datasets:Y(lst).max(20).default([]),partition:je(qw),nodes:St(1,64).default(1),cores:St(1,256).default(1),memory_mb:St(1,16777216).optional(),gpus:St(0,8).default(0),minutes:St(1,10080),output_dir:ze("outputs").default("outputs"),env:tst.default({}),recipe:b().regex(sst).optional(),image:b().max(512).regex(_d).optional()}).strict().superRefine((e,t)=>{let n=(o,s)=>t.addIssue({code:ne.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(dst(e)>pst)t.addIssue({code:ne.custom,path:[],message:"the entry, command, arguments, patterns and environment are too large to launch"});let r=vg[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")}),fst=/^[A-Za-z0-9_.-]{1,64}$/,mst=/^[a-z0-9]+(?:[.-][a-z0-9]+)*(?::[0-9]{1,5})?(?:\/[a-z0-9]+(?:[._-][a-z0-9]+)*)*$/,hst=Object.fromEntries(qw.map((e)=>[e,Yot.optional()])),gst=O({maxOpenReservations:St(0,1e5),maxReservedMilliPerDay:St(0)}).strict();bst=O({maxLiveJobs:St(0,1000),reserved:O({people:St(0,1000),pipelines:St(0,1000),partner:St(0,1000)}).strict()}).strict().refine((e)=>e.reserved.people+e.reserved.pipelines+e.reserved.partner<=e.maxLiveJobs,{message:"the floors reserved for the classes add up to more than the ceiling",path:["reserved"]}),wst=O({maxLiveJobs:O({cpu:St(0,1000),gpu:St(0,1000)}).strict()}).strict(),Woe=O({defaultGrantMilli:O({cpu:St(0),gpu:St(0)}).strict(),renewal:O({enabled:Q(),everyDays:St(1,366).nullable()}).strict().refine((e)=>!e.enabled||e.everyDays!==null,{message:"renewal that is on says how often",path:["everyDays"]}),ceilings:O(hst).strict(),maxLiveJobsPerPerson:St(0,1000),pipelines:O({dailyJobCap:St(0,1e5),maxLiveJobs:O({cpu:St(0,1000),gpu:St(0,1000)}).strict()}).strict(),clients:Fn(b().regex(fst),gst),tenant:bst.optional(),runners:wst.optional(),reservationWaitMinutes:St(1,1440),retention:O({recordsYears:St(1,30),logsDays:St(1,3650),resultsDays:St(14,365)}).strict(),resultLimits:O({maxJobBytes:St(1),maxFiles:St(1,Lw),maxStoredBytesPerPerson:St(1),maxStoredBytesTotal:St(1)}).strict(),settle:O({toleranceMilli:St(0),tolerancePercent:St(0,100)}).strict(),registries:Y(b().max(255).regex(mst)).max(64),bundleLimits:O({maxTotalBytes:St(1),maxFiles:St(1,1e5),maxFileBytes:St(1)}).strict(),partner:O({tapisVisibilityConfirmed:Q(),execSystemId:b().regex(/^[A-Za-z0-9._-]{1,80}$/).optional(),allowedSchedulerArgs:Y(b().regex(/^[-A-Za-z0-9=_.:,@/]{1,100}$/).refine((e)=>!yst(e),{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(),_st=Uw({maxLiveJobs:20,reserved:{people:8,pipelines:2,partner:0}}),qnn=Uw({maxLiveJobs:{cpu:64,gpu:8}}),Bnn=Uw({defaultGrantMilli:{cpu:0,gpu:0},renewal:{enabled:!1,everyDays:null},ceilings:Object.fromEntries(qw.flatMap((e)=>{let t=vg[e].ceiling;return t?[[e,{...t}]]:[]})),maxLiveJobsPerPerson:4,pipelines:{dailyJobCap:50,maxLiveJobs:{cpu:8,gpu:4}},clients:{},tenant:_st,reservationWaitMinutes:30,retention:{recordsYears:7,logsDays:365,resultsDays:30},resultLimits:{maxJobBytes:20*JI,maxFiles:5000,maxStoredBytesPerPerson:50*JI,maxStoredBytesTotal:1024*JI},settle:{toleranceMilli:1000,tolerancePercent:5},registries:[],bundleLimits:{maxTotalBytes:100*Uoe,maxFiles:2000,maxFileBytes:25*Uoe}}),xst=O({path:Hoe(512),size:St(0),sha256:Fk}).strict(),Hnn=O({job_id:tF,files:Y(xst).max(Lw)}).strict(),Koe=D().int().min(-255).max(255).nullable(),znn=O({job_id:tF,failure_code:je(Cf).nullable(),detail:b().regex(Gl).nullable(),exit_number:D().int(),entry_exit_code:Koe}).strict().superRefine((e,t)=>{let n=e.failure_code===null?Poe:Noe(e.failure_code);if(e.exit_number!==n)t.addIssue({code:ne.custom,path:["exit_number"],message:"the exit number is the one the failure code gives"})}),vst=O({id:b().regex(Vl),version:b().regex(Lk),mode:je(["bind","download"]),files:St(0),bytes:St(0)}).strict(),Gnn=O({job_id:tF,launch_spec_digest:Fk,bundle_digest:Fk.nullable(),image:O({uri:b().regex(/^[^\s]{1,512}$/),digest:b().regex(Sg)}).strict(),runtime_version:b().regex(new RegExp(`^[^${YI}]{1,128}$`)),staging:Y(vst).max(20),timings:Fn(b().regex(Gl),D().finite().min(0)).refine((e)=>Object.keys(e).length<=16,{message:"at most 16 phases"}),slurm_job_id:b().regex(/^[0-9A-Za-z_+.-]{1,64}$/).nullable(),entry_exit_code:Koe}).strict()});var Joe,Yoe,Wnn,Knn;var lF=z(()=>{Joe=["dispatched","succeeded","failed","refused"],Yoe=["bids","zarr"],Wnn=Object.freeze({bids:Object.freeze(["tapis"]),zarr:Object.freeze(["runner"])}),Knn=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,inputs:Object.freeze(["bids","zarr"]),executors:Object.freeze(["tapis","runner"]),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,inputs:Object.freeze(["bids"]),executors:Object.freeze(["tapis"]),autoDispatch:!1,placeholder:!0,eligibility:"eeg"})])});function Zoe(e){return uF.includes(e)}function Hw(e){let t=e.partial_jobs>0?`; usage of ${e.partial_jobs} job(s) is a lower bound${bF}`:"",n=(e.unmarked_jobs??0)>0?`; usage of ${e.unmarked_jobs} job(s) has no partial mark${wF}`:"";return t+n}var Est="pipelines",Sst="people",uF,Uk,Bw=200,da,dF,kst,Qoe,ese,tse,pF,nse,Gr,fF,mF,hF=100,gF=10,rse=10,qk,yF=200,Rst,Qnn,$st,Dst,Cst,ose,Ast,sse,Bk=8,Hk=200,ise,ase,Xoe,cse,lse,use,dse=366,bF=" (partial: Docker or Podman)",wF=" (partial: unknown)",pse="Runner-reported usage; never service units.",fse,mse,hse,gse,_F,yse,bse,wse,_se;var xd=z(()=>{mn();lF();la();uF=[Est,Sst];Uk=["granted","charged"],da=D().int(),dF=O({id:D().int(),holder_kind:b(),holder_ref:b(),pool:b(),granted_milli:da,held_milli:da,charged_milli:da,available_milli:da,frozen:Q(),created_at:b(),updated_at:b()}).passthrough(),kst=O({id:D().int(),kind:b(),pool_id:D().int(),budget_pool_id:D().int().nullable(),granted_delta_milli:da,held_delta_milli:da,charged_delta_milli:da,job_id:b().nullable(),hold_ref:D().int().nullable(),reason:b().nullable(),actor_user_id:D().int().nullable(),created_at:b()}).passthrough(),Qoe=O({pools:Y(dF),next_after:D().int().nullable()}).passthrough(),ese=O({account_id:D().int(),pools:Y(dF)}).passthrough(),tse=O({pool:dF,entry:kst,replayed:Q()}).passthrough(),pF=O({version:D().int().nullable(),is_default:Q(),policy:O({}).passthrough(),set_by:D().int().nullable(),note:b().nullable(),created_at:b().nullable()}).passthrough(),nse=O({switches:O({environment:b(),compute_enabled:Q(),pipelines_dispatch_enabled:Q()}).passthrough(),tapis:O({configured:Q(),strategy:b().nullable(),problems:Y(b()),token:b(),health:b()}).passthrough(),storage:O({records_binding:Q(),results_binding:Q(),signing_configured:Q()}).passthrough(),access:O({key_configured:Q(),resource_name_configured:Q().optional()}).passthrough(),runtime_image:O({set:Q(),valid:Q(),digest:b().nullable()}).passthrough().optional(),prerequisites:O({callback_secret:Q(),api_base_url:Q(),pipelines_account:Q(),policy_set:Q(),people_pool_granted:Q(),pipelines_pool_granted:Q()}).passthrough().optional(),reconciliation:O({paused:Q()}).passthrough().optional(),attention:Fn(xs()).optional(),tenant:O({ceiling:D(),occupied:D(),by_class:O({people:D(),pipelines:D(),partner:D(),other:D()}).passthrough(),reserved:O({people:D(),pipelines:D(),partner:D()}).passthrough()}).passthrough().optional()}).passthrough(),Gr=b().nullable(),fF=O({id:b(),account_id:D().int().nullable(),source:b(),kind:b(),state:b(),tapis_status:Gr,failure_code:Gr,failure_detail:Gr,platform_failure:Q(),cancel_requested:Q(),cancel_reason:Gr,partition:b(),pool:b(),held_milli:da,charged_milli:da,settled:Q(),flags:Y(b()),created_at:b(),submitted_at:Gr,started_at:Gr,ended_at:Gr,tapis_synced_at:Gr,outputs_completed:Q(),results_verified:Q(),results_bytes:D().int().nullable(),records_copied:Q(),partner_state:Gr.optional(),partner_flag:Gr.optional(),executor:b().optional(),accounting:b().optional(),runner_backend:Gr.optional(),runner_id:Gr.optional(),runner_claimed_at:Gr.optional(),runner_wall_seconds:D().int().nullable().optional(),runner_cpu_seconds:D().int().nullable().optional(),runner_max_rss_mb:D().int().nullable().optional(),runner_usage_partial:Q().nullable().optional()}).passthrough(),mF=O({ok:Q(),outcome:b(),submit:b().optional(),job:fF.nullable()}).passthrough(),qk=Joe,Rst={recipe_not_automatic:422,recipe_placeholder:422,registry_drift:409,zarr_version_not_newest:422,zarr_copy_not_ready:409,zarr_source_mismatch:409,zarr_source_unverifiable:503,runners_disabled:Ioe.runners_disabled,tapis_unconfigured:503,daily_cap_reached:409,create_failed:502,run_failed:500},Qnn={...WI,...Rst},$st=O({dataset_id:b(),ok:Q(),version:b().optional(),job_id:b().optional(),stamp_id:D().int().optional(),attempt:D().int().optional(),submit:b().optional(),records_written:Q().optional(),code:b().optional(),blocked_by:Y(b()).optional(),reason:b().optional()}).passthrough(),Dst=O({daily_left:D().int(),live_left:D().int(),tenant_left:D().int().optional(),limited_by:b()}).passthrough(),Cst=O({live_left:D().int(),live_cap:D().int()}).passthrough(),ose=O({ok:Q(),dry_run:Q(),recipe:b(),results:Y($st).optional(),dispatched:D().int().optional(),stopped_by:b().nullable().optional(),room:Dst.optional(),executor:b().optional(),input:b().optional(),runner_room:Cst.optional(),audit_pending:Q().optional(),estimate_milli_per_job:da.optional(),estimate_milli_total:da.optional(),config:O({compute_enabled:Q(),runtime_image:Q(),pipelines_account:Q(),runners_enabled:Q().optional(),tapis_configured:Q().optional()}).passthrough().optional(),would_dispatch:Y(O({dataset_id:b(),version:b()}).passthrough()).optional(),blocked:O({code:b(),blocked_by:Y(b()),version:b().optional(),reason:b().optional()}).passthrough().optional(),blocked_by_term:Fn(xs()).optional()}).passthrough(),Ast=O({id:D().int(),dataset_id:b(),version:b(),recipe:b(),recipe_version:b(),engine:b(),input:b().optional(),attempt:D().int(),state:b(),job_id:Gr,refusal_code:Gr,reader:Gr.optional(),input_engine:Gr.optional(),input_digest:Gr.optional(),created_at:b(),updated_at:b()}).passthrough(),sse=O({stamps:Y(Ast),next_before:D().int().nullable()}).passthrough(),ise=O({jobs:Y(fF),next_after:D().int().nullable()}).passthrough(),ase=O({rows:Y(O({slurm_job_id:b(),partition:b(),state:b(),elapsed_seconds:D().int(),alloc_nodes:D().int(),alloc_cpus:D().int(),alloc_gpus:D().int(),charged_milli:D().int().nullable(),ingested_at:b()}).passthrough()),total:D().int()}).passthrough(),Xoe=["ok","missing","unreadable"],cse=O({job:fF,identifiers:O({}).passthrough(),ledger:Y(O({}).passthrough()),provenance:O({}).passthrough().nullable(),provenance_status:je(Xoe).optional(),manifest:O({files:D().int(),bytes:D().int()}).passthrough().nullable(),manifest_status:je(Xoe).optional(),legal_hold:Q(),retention_until:b().nullable().optional(),launcher_files:Y(b()).optional()}).passthrough(),lse=O({job_id:b(),name:b(),kind:b(),content:xs().optional(),url:b().optional(),expires_at:b().optional()}).passthrough(),use=O({account_id:D().int(),from:b(),to:b(),totals:O({jobs:D().int(),charged_milli:D().int(),unsettled:D().int().optional(),open_hold_milli:D().int().optional()}).passthrough(),by_pool:Fn(O({}).passthrough()),runner_totals:O({jobs:D().int(),wall_seconds:D().int(),cpu_seconds:D().int(),core_hours:D(),partial_jobs:D().int(),reported_jobs:D().int().optional(),unmarked_jobs:D().int().optional()}).passthrough().optional(),jobs:Y(O({}).passthrough()),truncated:Q()}).passthrough();fse=O({from:b(),to:b(),runners:Y(O({id:b(),name:b(),site:b(),trust:b(),revoked:Q(),jobs:D().int(),by_state:Fn(xs()),wall_seconds:D().int(),cpu_seconds:D().int(),core_hours:D(),max_rss_mb:D().int().nullable(),partial_jobs:D().int(),reported_jobs:D().int().optional(),unmarked_jobs:D().int().optional()}).passthrough()),totals:O({jobs:D().int(),wall_seconds:D().int(),cpu_seconds:D().int(),core_hours:D(),partial_jobs:D().int(),reported_jobs:D().int().optional(),unmarked_jobs:D().int().optional()}).passthrough()}).passthrough(),mse=O({quarter:b(),rows:Y(O({partition:b(),source:b(),distinct_users:D().int(),jobs:D().int()}).passthrough()),totals:O({distinct_users:D().int(),jobs:D().int()}).passthrough()}).passthrough(),hse=O({id:D().int(),scope:b(),ref:b(),reason:b(),placed_by:D().int(),placed_at:b(),released_at:b().nullable()}).passthrough(),gse=O({holds:Y(hse),truncated:Q().optional()}).passthrough(),_F=O({hold:hse}).passthrough(),yse=O({rows:Y(O({job_id:b(),state:b(),attempts:D().int(),last_error_code:b().nullable(),next_attempt_at:b(),sent_at:b().nullable(),created_at:b()}).passthrough()),failed_by_word:Fn(xs()),next_after:b().nullable()}).passthrough(),bse=O({ok:Q(),job_id:b(),previous:b().nullable()}).passthrough(),wse=O({run_id:b(),token:b(),expires_in_minutes:D().int()}).passthrough(),_se=O({job_id:b(),to_account_id:D().int(),pool:b(),moved_milli:D().int(),replayed:Q(),attributed_account_id:D().int().nullable().optional(),owner_proven:Q().optional()}).passthrough()});function xF(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}function Ese(e,t){let n=vF[e];if(n==="refused")return t===void 0?null:"notice_refused";let r=t?.trim()??"";if(r==="")return n==="required"?"notice_required":null;if([...r].length>vd)return"notice_too_long";if(xF(r))return"notice_control_char";return null}var zk=20,zw=1000,nrn,Ost,xse,vse,Dg=500,Gk=200,vd=1000,vF,rrn,Sse,kse,Tst,Rse;var Tf=z(()=>{mn();nrn=O({purpose:b().max(zw*4).optional().default(""),accept_terms_version:b().max(64).optional().default("")}),Ost=je(["purpose_required","terms_not_accepted","email_not_verified","orcid_not_proven","profile_incomplete","access_closed","already_active","terms_unpublished"]),xse=Ost.options,vse=O({ok:ze(!0),already_requested:Q(),requested_at:b().nullable().optional(),email_sent:Q().optional(),admins_notified:D().int().nullable().optional()}).passthrough(),vF={grant:"refused",deny:"optional",suspend:"required",revoke:"required"};rrn={reason:b().max(Dg).optional(),notice:b().max(vd*4,{message:"notice_too_long"}).optional()},Sse=O({id:D().int(),username:b().nullable(),email:b(),given_name:b().nullable().optional(),family_name:b().nullable().optional(),affiliation:b().nullable().optional(),city:b().nullable().optional(),country:b().nullable().optional(),orcid:b().nullable().optional(),account_kind:b().optional(),compute_access:b(),compute_access_requested_at:b().nullable().optional(),compute_access_notified_at:b().nullable().optional(),compute_access_granted_at:b().nullable().optional(),compute_access_granted_by:D().int().nullable().optional(),compute_purpose:b().nullable().optional(),compute_terms_version:b().nullable().optional(),compute_terms_accepted_at:b().nullable().optional()}).passthrough(),kse=O({accounts:Y(Sse),next_after:D().int().nullable().optional()}).passthrough(),Tst=O({granted:Q(),cpu_milli:D().int(),gpu_milli:D().int(),reason:b().nullable().optional(),policy_version:D().int().nullable().optional()}).passthrough(),Rse=O({decision:b(),from:b(),to:b(),account:Sse,allocation:Tst.optional(),email_sent:Q().optional()}).passthrough()});var Gw=100,EF=25,Pst,irn,ac,gr,$se,Nst,Ist,Dse,Fst,Mst,Cse,Ase,Ose,arn;var Vk=z(()=>{mn();Pst={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},irn=Object.keys(Pst),ac=b().nullable(),gr=D().int().nonnegative(),$se=O({granted_milli:gr,held_milli:gr,charged_milli:gr,available_milli:D().int()}).passthrough(),Nst=O({name:b(),pool:b(),max_nodes:gr,max_cores_per_node:gr,max_gpus_per_node:gr,max_minutes:gr}).passthrough(),Ist=O({partition:b(),median_seconds:D().int().nonnegative().nullable(),p90_seconds:D().int().nonnegative().nullable(),count:gr,window_days:gr}).passthrough(),Dse=O({access:O({state:b(),requested_at:ac,granted_at:ac,terms_version:ac,current_terms_version:b(),terms_published:Q(),requests_open:Q().optional()}).passthrough(),pools:O({cpu:$se,gpu:$se}).passthrough(),frozen:Q(),limits:O({partitions:Y(Nst),max_live_jobs:gr,results_days:gr}).passthrough(),queue:Y(Ist)}).passthrough(),Fst=O({day:b().optional(),app:ac.optional(),partition:ac.optional(),source:ac.optional(),charged_milli:D().int(),jobs:gr}).passthrough(),Mst=O({from:b(),to:b(),group:Y(b()),rows:Y(Fst)}).passthrough(),Cse=O({id:b(),kind:b(),source:b(),state:b(),app_id:b(),app_version:b(),partition:b(),pool:b(),resources:O({nodes:gr,cores_per_node:gr,memory_mb:D().int().nonnegative().nullable(),gpus:gr,minutes:gr}).passthrough(),created_at:b(),started_at:ac,ended_at:ac,charged_milli:D().int().nonnegative(),failure_code:ac,cancel_requested:Q()}).passthrough(),Ase=O({jobs:Y(Cse),next_after:ac}).passthrough(),Ose=O({job:Cse,stale:Q().optional()}).passthrough(),arn=O({from:b(),to:b(),by_day_partition_source:Y(O({day:b(),partition:b(),source:b(),charged_milli:D().int(),jobs:gr}).passthrough()),active_people:gr,jobs_by_outcome:O({finished:gr,failed:gr,cancelled:gr}).passthrough()}).passthrough()});function SF(e,t=Cg,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"||!Af(a.path,Vw))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"||!ic.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 Tse=1048576,jst,Pse=2000,Lst,Vw=240,urn,Cg;var Wk=z(()=>{hr();jst=100*Tse,Lst=25*Tse,urn=Pse*1200+65536,Cg=Object.freeze({maxTotalBytes:jst,maxFiles:Pse,maxFileBytes:Lst})});var Nse="Idempotency-Key",Ise="X-Nemar-Truncated",Ust,Fse,Mse,qst,kF,mrn,RF;var Kk=z(()=>{mn();la();Ust=O({url:b(),method:ze("PUT"),headers:Fn(b()),expires_at:b(),size:D().int().nonnegative()}).passthrough(),Fse=O({job_id:b(),state:b(),tag:b(),name:b(),upload:Ust.optional(),replayed:ze(!0).optional()}).passthrough(),Mse=O({job_id:b(),state:b(),name:b().optional(),submitted:Q(),replayed:Q()}).passthrough(),qst=O({path:b(),size:D().int().nonnegative(),sha256:b(),url:b()}).passthrough(),kF=O({expires_at:b(),files:Y(qst),total:D().int().nonnegative(),truncated:Q(),next_after:b().nullable(),bearer_links:ze(!0),notice:b()}).passthrough(),mrn=O({error:b(),code:b(),field:b().optional(),job_id:b().optional(),note:b().optional()}).passthrough(),RF={...Foe,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.",platform_busy:"NEMAR's share of the cluster is full right now; ask again shortly.",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 Bst,Hst,jse;var $F=z(()=>{mn();Wk();hr();Bst=O({path:b().min(1).max(Vw),size:D().int().min(0).max(Number.MAX_SAFE_INTEGER),sha256:b().regex(ic)}).strict(),Hst=O({files:Y(Bst).min(1)}).strict(),jse=O({spec:$g,manifest:Hst.optional()}).strict()});var xrn,zst,Gst,vrn,Ern,Srn;var Lse=z(()=>{mn();xrn=O({job_id:b(),hold_id:b(),tag:b(),expires_at:b(),state:b().optional(),replayed:ze(!0).optional()}).passthrough(),zst=O({path:b(),url:b(),method:ze("PUT"),headers:Fn(b())}).passthrough(),Gst=O({state:je(["awaiting_upload","recorded"]),uploads:Y(zst).optional(),expires_at:b().optional()}).passthrough(),vrn=O({job_id:b(),verification:je(["verified","pending"]),state:b(),files:Gst.optional(),replayed:ze(!0).optional()}).passthrough(),Ern=O({job_id:b(),hold_id:b(),released:ze(!0),state:b(),replayed:ze(!0).optional()}).passthrough(),Srn=O({error:b(),code:b(),field:b().optional(),mismatch:b().optional(),job_id:b().optional()}).passthrough()});var Crn,Use=500,Vst=512,Wst,Kst,Arn,Orn;var qse=z(()=>{mn();la();hr();Crn=O({app_id:b().regex(/^[A-Za-z0-9._-]{1,80}$/),app_version:b().regex(/^[A-Za-z0-9._+-]{1,64}$/),kind:je(Moe),partition:je(qw),nodes:ua(1,64),cores:ua(0,256),memory_mb:ua(1,16777216).nullish(),gpus:ua(0,8),minutes:ua(1,10080)}).strict().superRefine((e,t)=>{let n=vg[e.partition].pool==="gpu";if(n&&e.gpus<1)t.addIssue({code:ne.custom,path:["gpus"],message:"a GPU partition needs a GPU"});if(!n&&e.gpus!==0)t.addIssue({code:ne.custom,path:["gpus"],message:"a CPU partition takes no GPU"})}),Wst=O({path:b().min(1).max(Vst),size:D().int().min(0).max(Number.MAX_SAFE_INTEGER),sha256:b().regex(ic)}).strict(),Kst=/^[A-Za-z0-9][A-Za-z0-9-]{0,63}$/,Arn=O({tapis_job_id:b().regex(Kst),files:Y(Wst).min(1).max(Use).optional()}).strict(),Orn=Use*2400+4096});function cit(e){if(typeof e!=="string"||!Sg.test(e))return null;return`${e.slice(7)}.sif`}function lit(e){return e.replace(/[\u007f-\uffff]/g,(t)=>`\\u${t.charCodeAt(0).toString(16).padStart(4,"0")}`)}function uit(e){let t=ait.safeParse(e);if(!t.success){let r=[...new Set(t.error.issues.map((o)=>o.path.join(".")||"(document)"))];throw TypeError(`not a valid launch specification: ${r.join(", ")}`)}let n=lit(JSON.stringify(t.data));if(n.length>zse)throw RangeError("the launch specification is over 64 KiB");return n}function Wse(e){let t="f".repeat(64),n=`docker://ghcr.io/${"a".repeat(423)}@sha256:${t}`,r={job_id:`job_${"f".repeat(24)}`,runtime:e.runtime==="image"?"image":"python",args:e.args,bundle:{sha256:t,size:Number.MAX_SAFE_INTEGER},datasets:e.datasets.map((o)=>({id:o.id,version:QI(o.version),include:o.include})),api_base:`https://${"a".repeat(504)}`,image:{uri:n,digest:`sha256:${t}`,sif:`${t}.sif`},env:e.env,resources:{gpus:e.gpus},limits:{max_files:1e6,max_total_bytes:Number.MAX_SAFE_INTEGER},job_token:"t".repeat(256)};if(e.entry!==void 0)r.entry=e.entry;else r.command=e.command??["x"];try{return uit(r),!0}catch{return!1}}var zse=65536,Gse,Jst="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",Irn,Yst,Ag,Vse,Xst,Zst,Qst,Bse,Hse=" Exactly one of entry and command is present.",eit="the image file is not <64 lowercase hex>.sif",tit="the image file is not the one named for the image digest",nit="the image reference is not a digest-pinned reference",rit="the image reference is not pinned to the image digest",oit,sit,iit,ait,Kse,Jse,Frn,Mrn,jrn;var DF=z(()=>{mn();hr();Gse=Math.ceil(zse*4/3),Irn=new Set(Jst),Yst=["python","image"],Ag=ua,Vse=nF,Xst=/^https?:\/\/[^\s/?#][^\s?#]*$/,Zst=/^https?:\/\/[^\s]+$/,Qst=/^[A-Za-z0-9_-]{16,256}$/,Bse=/^[0-9a-f]{64}\.sif$/,oit=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]+)?Z$/,sit=new RegExp(`^(?:outputs/(?:${jk}/)*${jk}|launcher/(?:${Rg.map((e)=>e.replace(".","\\.")).join("|")}))$`),iit=O(Object.fromEntries(Of.map((e)=>[e,oF.optional()]))).strict(),ait=O({job_id:b().regex(Ys),runtime:je(Yst),entry:Vse(240).optional().describe(sF+Hse),command:Y(b().min(1).max(1024)).min(1).max(64).optional().describe(iF+Hse),args:Y(b().max(1024)).max(64).describe(aF),bundle:O({sha256:b().regex(ic),size:Ag(1)}).strict().optional(),datasets:Y(O({id:b().regex(Vl),version:b().max(ZI).regex(XI),include:Y(rF).max(64).optional().describe(cF)}).strict()).max(20),api_base:b().max(512).regex(Xst),image:O({uri:b().max(512).regex(_d,nit),digest:b().regex(Sg),sif:b().regex(Bse,eit)}).strict(),env:iit,resources:O({gpus:Ag(0,8)}).strict(),limits:O({max_files:Ag(1,1e6),max_total_bytes:Ag(1)}).strict(),job_token:b().regex(Qst)}).strict().superRefine((e,t)=>{let n=(o,s)=>t.addIssue({code:ne.custom,path:[o],message:s});if(e.entry===void 0===(e.command===void 0))n("entry","exactly one of entry and command");if(e.entry!==void 0&&e.bundle===void 0)n("bundle","an entry needs the bundle that holds it");let r=cit(e.image.digest);if(r!==null&&Bse.test(e.image.sif)&&e.image.sif!==r)t.addIssue({code:ne.custom,path:["image","sif"],message:tit});if(r!==null&&_d.test(e.image.uri)&&!e.image.uri.endsWith(e.image.digest))t.addIssue({code:ne.custom,path:["image","uri"],message:rit})});Kse=b().max(4096).regex(Zst),Jse=b().regex(oit),Frn=O({url:Kse,expires_at:Jse}).passthrough(),Mrn=O({outputs:Y(O({path:Vse(512),size:Ag(0),sha256:b().regex(ic)}).strict()).max(Lw),launcher:Y(O({name:je(Rg),size:Ag(0)}).strict()).length(Rg.length)}).strict().superRefine((e,t)=>{if(new Set(e.launcher.map((n)=>n.name)).size!==Rg.length)t.addIssue({code:ne.custom,path:["launcher"],message:"each launcher file is named once"})}),jrn=O({uploads:Y(O({path:b().max(600).regex(sit).refine((e)=>!Eg.test(e),{message:"no . or .. segments"}),url:Kse}).passthrough()).max(Lw+Rg.length),expires_at:Jse}).passthrough()});var Yse="nemar.runner.v1",dit,Kw,Ww,CF,pit="nmr_",fit="nmra_",Xse="[0-9a-f]{64}",mit,hit,Jw,git,yit,Zse=32,Xs,bit,wit,_it,xit,vit=32,Eit,AF,OF,TF,PF,NF,Qse,eie,zrn,Grn,Vrn,Sit,Wrn,tie,Krn,kit,Jrn,Yrn,Xrn;var Yw=z(()=>{mn();la();DF();hr();dit=["started","uploading"],Kw=["amd64","arm64"],Ww=["apptainer","docker","podman"],CF=["lab","hpc"],mit=new RegExp(`^${pit}${Xse}$`),hit=new RegExp(`^${fit}${Xse}$`),Jw=/^rnr_[0-9a-f]{24}$/,git=/^[0-9a-f]{32}$/,yit=/^[a-z0-9_]{1,32}$/,Xs=ua,bit=Number.MAX_SAFE_INTEGER,wit=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(?:\.[0-9]+)?Z$/,_it=/^[0-9a-f]{64}\.sif$/,xit=/^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/,Eit=/^[A-Za-z0-9_-]+$/,AF=b().regex(Gl),OF=b().regex(Ys),TF=b().regex(git),PF=b().max(vit).regex(xit),NF=b().regex(wit),Qse=Y(je(Ww)).min(1).max(Ww.length).refine((e)=>new Set(e).size===e.length,{message:"each runtime is named once"}),eie=O({name:AF,pool:je(kg),cores:Xs(1,256),memory_mb:Xs(1,16777216),gpus:Xs(0,8),scratch_gb:Xs(1,1e5),backend:je(jw),runtimes:Qse,arch:je(Kw),accounting:je(wg),site:b().regex(yit),trust:je(CF)}).strict(),zrn=O({protocol:ze(Yse),runner_version:PF}).strict(),Grn=O({protocol:ze(Yse),free_slots:Xs(1,Zse),runtimes:Qse,arch:je(Kw),runner_version:PF}).strict(),Vrn=O({job_id:OF,lease_id:TF,phase:je(dit)}).strict(),Sit=O({wall_seconds:Xs(0),cpu_seconds:Xs(0),max_rss_mb:Xs(0)}).strict(),Wrn=O({job_id:OF,lease_id:TF,exit_number:Xs(0,255),launcher_failure_code:je(Cf).nullable(),launcher_detail:AF.nullable(),usage:Sit,usage_partial:Q(),scratch_discarded:Q()}).strict(),tie=O({runner_id:b().regex(Jw),secret:b().regex(mit)}).passthrough(),Krn=O({access_token:b().regex(hit),expires_at:NF}).passthrough(),kit=O({id:OF,lease_id:TF,lease_expires_at:NF,launch_spec_env:b().max(Gse).regex(Eit),image:O({uri:b().max(512).regex(_d),digest:b().regex(Sg),sif:b().regex(_it)}).passthrough(),cores:Xs(1,256),memory_mb:Xs(1,16777216).nullable(),gpus:Xs(0,8),minutes:Xs(1,bit)}).passthrough(),Jrn=O({jobs:Y(kit).max(Zse),min_runner_version:PF}).passthrough(),Yrn=O({lease_expires_at:NF,cancel:Q()}).passthrough(),Xrn=O({state:AF}).passthrough()});var Og=z(()=>{PI();pg();II();mg();FI();vk();rc();$f();Fw();zI();Ooe();hr();xd();Tf();Nw();Vk();Wk();Kk();$F();Lse();qse();Yw()});function Vr(e){return typeof e==="string"&&Dit.test(e)&&!e.includes("..")}function Wl(e){return/^v\d/.test(e)?e.slice(1):e}function Wr(e,t){return Wl(e)===Wl(t)}var Dit;var pa=z(()=>{Dit=/^[0-9A-Za-z][0-9A-Za-z._-]{0,63}$/});function W(e){if(e instanceof Error)return e.message;return String(e)}function Pg(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,cc;var Ue=z(()=>{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"}};cc=class cc extends j{mode;eta;constructor(e,t,n,r){super(503,t,r);this.mode=e;this.eta=n;this.name="MaintenanceError"}}});var Cit,Ait,Oit,Don,oie="override_publication_review",sie="publication_review_not_clear",MF=2000;var Yk=z(()=>{Cit=["dispatched","redispatched","dispatch_claimed"],Ait=["review_disabled","not_applicable","not_owned_here","request_not_requested","screen_not_ready","running","has_result","platform_limit"],Oit=["dispatch_failed","dispatch_unconfigured"],Don=[...Cit,...Ait,...Oit]});var Xk=1e4;function Zk(e){return e?Pit:lc}var lc,Oon,Tit,Pit,jF;var Qk=z(()=>{lc=["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"],Oon=lc.slice(0,lc.indexOf("s3_public_read")),Tit=["update_metadata","update_readme","upload_to_zenodo","publish_doi"],Pit=lc.filter((e)=>!Tit.includes(e));jF={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 Nit(e){return`%${e.replace(/[\\%_]/g,"\\$&")}%`}function Iit(e){return new TextEncoder().encode(Nit(e)).length}function iie(e){if(Iit(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 eR(e){return e.replace(/[A-Z]/g,(t)=>t.toLowerCase())}function aie(e,t){if(e==="")return!0;let n=eR(e);return t.some((r)=>typeof r==="string"&&eR(r).includes(n))}function cie(e,t){return eR(e)===eR(t)}function tR(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(LF.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(LF.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"&&!Fit.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(LF.has(n))return[];t.push(n);break}case"index":throw Error("Index was not closed");case"start":{t.push("");break}}return t}function UF(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 lie(e,t){if(UF(e,t))throw Error("Cannot use string index")}function uie(e,t,n){if(!Pf(e)||typeof t!=="string")return n===void 0?e:n;let r=tR(t);if(r.length===0)return n;for(let o=0;o<r.length;o++){let s=r[o];if(UF(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 qF(e,t,n){if(!Pf(e)||typeof t!=="string")return e;let r=e,o=tR(t);for(let s=0;s<o.length;s++){let i=o[s];if(lie(e,i),s===o.length-1)e[i]=n;else if(!Pf(e[i]))e[i]=typeof o[s+1]==="number"?[]:{};e=e[i]}return r}function die(e,t){if(!Pf(e)||typeof t!=="string")return!1;let n=tR(t);for(let r=0;r<n.length;r++){let o=n[r];if(lie(e,o),r===n.length-1)return delete e[o],!0;if(e=e[o],!Pf(e))return!1}}function pie(e,t){if(!Pf(e)||typeof t!=="string")return!1;let n=tR(t);if(n.length===0)return!1;for(let r of n){if(!Pf(e)||!(r in e)||UF(e,r))return!1;e=e[r]}return!0}var Pf=(e)=>{let t=typeof e;return e!==null&&(t==="object"||t==="function")},LF,Fit;var fie=z(()=>{LF=new Set(["__proto__","prototype","constructor"]),Fit=new Set("0123456789")});import Gn from"path";import mie from"os";import BF from"process";function zF(e,{suffix:t="nodejs"}={}){if(typeof e!=="string")throw TypeError(`Expected a string, got ${typeof e}`);if(t)e+=`-${t}`;if(BF.platform==="darwin")return Mit(e);if(BF.platform==="win32")return jit(e);return Lit(e)}var Sd,HF,Ng,Mit=(e)=>{let t=Gn.join(Sd,"Library");return{data:Gn.join(t,"Application Support",e),config:Gn.join(t,"Preferences",e),cache:Gn.join(t,"Caches",e),log:Gn.join(t,"Logs",e),temp:Gn.join(HF,e)}},jit=(e)=>{let t=Ng.APPDATA||Gn.join(Sd,"AppData","Roaming"),n=Ng.LOCALAPPDATA||Gn.join(Sd,"AppData","Local");return{data:Gn.join(n,e,"Data"),config:Gn.join(t,e,"Config"),cache:Gn.join(n,e,"Cache"),log:Gn.join(n,e,"Log"),temp:Gn.join(HF,e)}},Lit=(e)=>{let t=Gn.basename(Sd);return{data:Gn.join(Ng.XDG_DATA_HOME||Gn.join(Sd,".local","share"),e),config:Gn.join(Ng.XDG_CONFIG_HOME||Gn.join(Sd,".config"),e),cache:Gn.join(Ng.XDG_CACHE_HOME||Gn.join(Sd,".cache"),e),log:Gn.join(Ng.XDG_STATE_HOME||Gn.join(Sd,".local","state"),e),temp:Gn.join(HF,t,e)}};var hie=z(()=>{Sd=mie.homedir(),HF=mie.tmpdir(),{env:Ng}=BF});var Uit=(e,t)=>{let{onError:n}=t;return function(...o){return e.apply(void 0,o).catch(n)}},uc;var gie=z(()=>{uc=Uit});var qit=(e,t)=>{let{onError:n}=t;return function(...o){try{return e.apply(void 0,o)}catch(s){return n(s)}}},fa;var yie=z(()=>{fa=qit});var bie=250;var wie=()=>{};var Bit=(e,t)=>{let{isRetriable:n}=t;return function(o){let{timeout:s}=o,i=o.interval??bie,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 p=Math.round(i*Math.random());if(p>0)return new Promise((m)=>setTimeout(m,p)).then(()=>c.apply(void 0,l));else return c.apply(void 0,l)})}}},dc;var _ie=z(()=>{wie();dc=Bit});var Hit=(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}}}},pc;var xie=z(()=>{pc=Hit});var GF=z(()=>{gie();yie();_ie();xie()});var Xw,VF;var vie=z(()=>{WF();Xw={isChangeErrorOk:(e)=>{if(!Xw.isNodeError(e))return!1;let{code:t}=e;if(t==="ENOSYS")return!0;if(!Eie&&(t==="EINVAL"||t==="EPERM"))return!0;return!1},isNodeError:(e)=>e instanceof Error,isRetriableError:(e)=>{if(!Xw.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(!Xw.isNodeError(e))throw e;if(Xw.isChangeErrorOk(e))return;throw e}},VF=Xw});import Sie from"process";var Zw,ks,Eie,yo;var WF=z(()=>{vie();Zw={onError:VF.onChangeError},ks={onError:()=>{return}},Eie=Sie.getuid?!Sie.getuid():!1,yo={isRetriable:VF.isRetriableError}});import qt from"fs";import{promisify as No}from"util";var zit,Kr;var KF=z(()=>{GF();GF();WF();zit={attempt:{chmod:uc(No(qt.chmod),Zw),chown:uc(No(qt.chown),Zw),close:uc(No(qt.close),ks),fsync:uc(No(qt.fsync),ks),mkdir:uc(No(qt.mkdir),ks),realpath:uc(No(qt.realpath),ks),stat:uc(No(qt.stat),ks),unlink:uc(No(qt.unlink),ks),chmodSync:fa(qt.chmodSync,Zw),chownSync:fa(qt.chownSync,Zw),closeSync:fa(qt.closeSync,ks),existsSync:fa(qt.existsSync,ks),fsyncSync:fa(qt.fsync,ks),mkdirSync:fa(qt.mkdirSync,ks),realpathSync:fa(qt.realpathSync,ks),statSync:fa(qt.statSync,ks),unlinkSync:fa(qt.unlinkSync,ks)},retry:{close:dc(No(qt.close),yo),fsync:dc(No(qt.fsync),yo),open:dc(No(qt.open),yo),readFile:dc(No(qt.readFile),yo),rename:dc(No(qt.rename),yo),stat:dc(No(qt.stat),yo),write:dc(No(qt.write),yo),writeFile:dc(No(qt.writeFile),yo),closeSync:pc(qt.closeSync,yo),fsyncSync:pc(qt.fsyncSync,yo),openSync:pc(qt.openSync,yo),readFileSync:pc(qt.readFileSync,yo),renameSync:pc(qt.renameSync,yo),statSync:pc(qt.statSync,yo),writeSync:pc(qt.writeSync,yo),writeFileSync:pc(qt.writeFileSync,yo)}},Kr=zit});import Nf from"process";var kie="utf8",JF=438,Rie=511,$ie,Die,Cie,Aie=1000,Oie,csn,YF=128;var XF=z(()=>{$ie={},Die=Nf.geteuid?Nf.geteuid():-1,Cie=Nf.getegid?Nf.getegid():-1,Oie=!!Nf.getuid,csn=Nf.getuid?!Nf.getuid():!1});var Tie=(e)=>e instanceof Error&&("code"in e),ZF=(e)=>typeof e==="string",nR=(e)=>e===void 0;var Pie=()=>{};var Nie=()=>{};import Iie from"process";var Fie,rR;var QF=z(()=>{Fie=Iie.platform==="linux",rR=Iie.platform==="win32"});var eM,Mie;var jie=z(()=>{QF();eM=["SIGHUP","SIGINT","SIGTERM"];if(!rR)eM.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(Fie)eM.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");Mie=eM});import Ig from"process";class Lie{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(rR&&(e!=="SIGINT"&&e!=="SIGTERM"&&e!=="SIGKILL"))Ig.kill(Ig.pid,"SIGTERM");else Ig.kill(Ig.pid,e)},this.hook=()=>{Ig.once("exit",()=>this.exit());for(let e of Mie)try{Ig.once(e,()=>this.exit(e))}catch{}},this.register=(e)=>(this.callbacks.add(e),()=>{this.callbacks.delete(e)}),this.hook()}}var Uie;var qie=z(()=>{QF();jie();Uie=new Lie});var Git,Bie;var Hie=z(()=>{qie();Git=Uie.register,Bie=Git});import Vit from"path";var Zs,Qw;var zie=z(()=>{KF();Hie();XF();Zs={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=Zs.truncate(t(e));if(r in Zs.store)return Zs.get(e,t,n);return Zs.store[r]=n,[r,()=>delete Zs.store[r]]},purge:(e)=>{if(!Zs.store[e])return;delete Zs.store[e],Kr.attempt.unlink(e)},purgeSync:(e)=>{if(!Zs.store[e])return;delete Zs.store[e],Kr.attempt.unlinkSync(e)},purgeSyncAll:()=>{for(let e in Zs.store)Zs.purgeSync(e)},truncate:(e)=>{let t=Vit.basename(e);if(t.length<=YF)return e;let n=/^(\.?)(.*?)((?:\.[^.]+)?(?:\.tmp-\d{10}[a-f0-9]{6})?)$/.exec(t);if(!n)return e;let r=t.length-YF;return`${e.slice(0,-t.length)}${n[1]}${n[2].slice(0,-r)}${n[3]}`}};Bie(Zs.purgeSyncAll);Qw=Zs});import Wit from"path";function tM(e,t,n=$ie){if(ZF(n))return tM(e,t,{encoding:n});let o={timeout:n.timeout??Aie},s=null,i=null,a=null;try{let c=Kr.attempt.realpathSync(e),l=!!c;e=c||e,[i,s]=Qw.get(e,n.tmpCreate||Qw.create,n.tmpPurge!==!1);let d=Oie&&nR(n.chown),p=nR(n.mode);if(l&&(d||p)){let f=Kr.attempt.statSync(e);if(f){if(n={...n},d)n.chown={uid:f.uid,gid:f.gid};if(p)n.mode=f.mode}}if(!l){let f=Wit.dirname(e);Kr.attempt.mkdirSync(f,{mode:Rie,recursive:!0})}if(a=Kr.retry.openSync(o)(i,"w",n.mode||JF),n.tmpCreated)n.tmpCreated(i);if(ZF(t))Kr.retry.writeSync(o)(a,t,0,n.encoding||kie);else if(!nR(t))Kr.retry.writeSync(o)(a,t,0,t.length,0);if(n.fsync!==!1)if(n.fsyncWait!==!1)Kr.retry.fsyncSync(o)(a);else Kr.attempt.fsync(a);if(Kr.retry.closeSync(o)(a),a=null,n.chown&&(n.chown.uid!==Die||n.chown.gid!==Cie))Kr.attempt.chownSync(i,n.chown.uid,n.chown.gid);if(n.mode&&n.mode!==JF)Kr.attempt.chmodSync(i,n.mode);try{Kr.retry.renameSync(o)(i,e)}catch(f){if(!Tie(f))throw f;if(f.code!=="ENAMETOOLONG")throw f;Kr.retry.renameSync(o)(i,Qw.truncate(e))}s(),i=null}finally{if(a)Kr.attempt.closeSync(a);if(i)Qw.purge(i)}}var Gie=z(()=>{KF();XF();Pie();Nie();zie()});var t_=_(function(Kie){Object.defineProperty(Kie,"__esModule",{value:!0});Kie.regexpCode=Kie.getEsmExportName=Kie.getProperty=Kie.safeStringify=Kie.stringify=Kie.strConcat=Kie.addCodeArg=Kie.str=Kie._=Kie.nil=Kie._Code=Kie.Name=Kie.IDENTIFIER=Kie._CodeOrName=void 0;class oR{}Kie._CodeOrName=oR;Kie.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class Fg extends oR{constructor(e){super();if(!Kie.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}}}Kie.Name=Fg;class ma extends oR{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 Fg)t[n.str]=(t[n.str]||0)+1;return t},{})}}Kie._Code=ma;Kie.nil=new ma("");function Vie(e,...t){let n=[e[0]],r=0;while(r<t.length)rM(n,t[r]),n.push(e[++r]);return new ma(n)}Kie._=Vie;var nM=new ma("+");function Wie(e,...t){let n=[e_(e[0])],r=0;while(r<t.length)n.push(nM),rM(n,t[r]),n.push(nM,e_(e[++r]));return Kit(n),new ma(n)}Kie.str=Wie;function rM(e,t){if(t instanceof ma)e.push(...t._items);else if(t instanceof Fg)e.push(t);else e.push(Xit(t))}Kie.addCodeArg=rM;function Kit(e){let t=1;while(t<e.length-1){if(e[t]===nM){let n=Jit(e[t-1],e[t+1]);if(n!==void 0){e.splice(t-1,3,n);continue}e[t++]="+"}t++}}function Jit(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string"){if(t instanceof Fg||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 Fg))return`"${e}${t.slice(1)}`;return}function Yit(e,t){return t.emptyStr()?e:e.emptyStr()?t:Wie`${e}${t}`}Kie.strConcat=Yit;function Xit(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:e_(Array.isArray(e)?e.join(","):e)}function Zit(e){return new ma(e_(e))}Kie.stringify=Zit;function e_(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Kie.safeStringify=e_;function Qit(e){return typeof e=="string"&&Kie.IDENTIFIER.test(e)?new ma(`.${e}`):Vie`[${e}]`}Kie.getProperty=Qit;function eat(e){if(typeof e=="string"&&Kie.IDENTIFIER.test(e))return new ma(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Kie.getEsmExportName=eat;function tat(e){return new ma(e.toString())}Kie.regexpCode=tat});var aM=_(function(Zie){Object.defineProperty(Zie,"__esModule",{value:!0});Zie.ValueScope=Zie.ValueScopeName=Zie.Scope=Zie.varKinds=Zie.UsedValueState=void 0;var hn=t_();class Yie extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`);this.value=e.value}}var iR;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(iR||(Zie.UsedValueState=iR={}));Zie.varKinds={const:new hn.Name("const"),let:new hn.Name("let"),var:new hn.Name("var")};class sM{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof hn.Name?e:this.name(e)}name(e){return new hn.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}}}Zie.Scope=sM;class iM extends hn.Name{constructor(e,t){super(t);this.prefix=e}setValue(e,{property:t,itemIndex:n}){this.value=e,this.scopePath=hn._`.${new hn.Name(t)}[${n}]`}}Zie.ValueScopeName=iM;var mat=hn._`\n`;class Xie extends sM{constructor(e){super(e);this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?mat:hn.nil}}get(){return this._scope}name(e){return new iM(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 hn._`${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=hn.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,iR.Started);let l=t(c);if(l){let d=this.opts.es5?Zie.varKinds.var:Zie.varKinds.const;o=hn._`${o}${d} ${c} = ${l};${this.opts._n}`}else if(l=r===null||r===void 0?void 0:r(c))o=hn._`${o}${l}${this.opts._n}`;else throw new Yie(c);a.set(c,iR.Completed)})}return o}}Zie.ValueScope=Xie});var _t=_(function(Rs){Object.defineProperty(Rs,"__esModule",{value:!0});Rs.or=Rs.and=Rs.not=Rs.CodeGen=Rs.operators=Rs.varKinds=Rs.ValueScopeName=Rs.ValueScope=Rs.Scope=Rs.Name=Rs.regexpCode=Rs.stringify=Rs.getProperty=Rs.nil=Rs.strConcat=Rs.str=Rs._=void 0;var ge=t_(),er=aM(),kd=t_();Object.defineProperty(Rs,"_",{enumerable:!0,get:function(){return kd._}});Object.defineProperty(Rs,"str",{enumerable:!0,get:function(){return kd.str}});Object.defineProperty(Rs,"strConcat",{enumerable:!0,get:function(){return kd.strConcat}});Object.defineProperty(Rs,"nil",{enumerable:!0,get:function(){return kd.nil}});Object.defineProperty(Rs,"getProperty",{enumerable:!0,get:function(){return kd.getProperty}});Object.defineProperty(Rs,"stringify",{enumerable:!0,get:function(){return kd.stringify}});Object.defineProperty(Rs,"regexpCode",{enumerable:!0,get:function(){return kd.regexpCode}});Object.defineProperty(Rs,"Name",{enumerable:!0,get:function(){return kd.Name}});var pR=aM();Object.defineProperty(Rs,"Scope",{enumerable:!0,get:function(){return pR.Scope}});Object.defineProperty(Rs,"ValueScope",{enumerable:!0,get:function(){return pR.ValueScope}});Object.defineProperty(Rs,"ValueScopeName",{enumerable:!0,get:function(){return pR.ValueScopeName}});Object.defineProperty(Rs,"varKinds",{enumerable:!0,get:function(){return pR.varKinds}});Rs.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 Rd{optimizeNodes(){return this}optimizeNames(e,t){return this}}class eae extends Rd{constructor(e,t,n){super();this.varKind=e,this.name=t,this.rhs=n}render({es5:e,_n:t}){let n=e?er.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=jg(this.rhs,e,t);return this}get names(){return this.rhs instanceof ge._CodeOrName?this.rhs.names:{}}}class uM extends Rd{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=jg(this.rhs,e,t),this}get names(){let e=this.lhs instanceof ge.Name?{}:{...this.lhs.names};return dR(e,this.rhs)}}class tae extends uM{constructor(e,t,n,r){super(e,n,r);this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class nae extends Rd{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class rae extends Rd{constructor(e){super();this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}}class oae extends Rd{constructor(e){super();this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class sae extends Rd{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=jg(this.code,e,t),this}get names(){return this.code instanceof ge._CodeOrName?this.code.names:{}}}class fR extends Rd{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;bat(e,o.names),n.splice(r,1)}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>If(e,t.names),{})}}class $d extends fR{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class iae extends fR{}class n_ extends $d{}n_.kind="else";class Kl extends $d{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 n_(n):n}if(t){if(e===!1)return t instanceof Kl?t:t.nodes;if(this.nodes.length)return this;return new Kl(dae(e),t instanceof Kl?[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=jg(this.condition,e,t),this}get names(){let e=super.names;if(dR(e,this.condition),this.else)If(e,this.else.names);return e}}Kl.kind="if";class Mg extends $d{}Mg.kind="for";class aae extends Mg{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=jg(this.iteration,e,t),this}get names(){return If(super.names,this.iteration.names)}}class cae extends Mg{constructor(e,t,n,r){super();this.varKind=e,this.name=t,this.from=n,this.to=r}render(e){let t=e.es5?er.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=dR(super.names,this.from);return dR(e,this.to)}}class cM extends Mg{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=jg(this.iterable,e,t),this}get names(){return If(super.names,this.iterable.names)}}class aR extends $d{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)}}aR.kind="func";class cR extends fR{render(e){return"return "+super.render(e)}}cR.kind="return";class lae extends $d{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)If(e,this.catch.names);if(this.finally)If(e,this.finally.names);return e}}class lR extends $d{constructor(e){super();this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}lR.kind="catch";class uR extends $d{render(e){return"finally"+super.render(e)}}uR.kind="finally";class uae{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?`
86
86
  `:""},this._extScope=e,this._scope=new er.Scope({parent:e}),this._nodes=[new iae]}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 eae(e,o,n)),o}const(e,t,n){return this._def(er.varKinds.const,e,t,n)}let(e,t,n){return this._def(er.varKinds.let,e,t,n)}var(e,t,n){return this._def(er.varKinds.var,e,t,n)}assign(e,t,n){return this._leafNode(new uM(e,t,n))}add(e,t){return this._leafNode(new tae(e,Rs.operators.ADD,t))}code(e){if(typeof e=="function")e();else if(e!==ge.nil)this._leafNode(new sae(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 Kl(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 Kl(e))}else(){return this._elseNode(new n_)}endIf(){return this._endBlockNode(Kl,n_)}_for(e,t){if(this._blockNode(e),t)this.code(t).endFor();return this}for(e,t){return this._for(new aae(e),t)}forRange(e,t,n,r,o=this.opts.es5?er.varKinds.var:er.varKinds.let){let s=this._scope.toName(e);return this._for(new cae(o,s,t,n),()=>r(s))}forOf(e,t,n,r=er.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 cM("of",r,o,t),()=>n(o))}forIn(e,t,n,r=this.opts.es5?er.varKinds.var:er.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 cM("in",r,o,t),()=>n(o))}endFor(){return this._endBlockNode(Mg)}label(e){return this._leafNode(new nae(e))}break(e){return this._leafNode(new rae(e))}return(e){let t=new cR;if(this._blockNode(t),this.code(e),t.nodes.length!==1)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(cR)}try(e,t,n){if(!t&&!n)throw Error('CodeGen: "try" without "catch" and "finally"');let r=new lae;if(this._blockNode(r),this.code(e),t){let o=this.name("e");this._currNode=r.catch=new lR(o),t(o)}if(n)this._currNode=r.finally=new uR,this.code(n);return this._endBlockNode(lR,uR)}throw(e){return this._leafNode(new oae(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 aR(e,t,n)),r)this.code(r).endFunc();return this}endFunc(){return this._endBlockNode(aR)}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 Kl))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}}Rs.CodeGen=uae;function If(e,t){for(let n in t)e[n]=(e[n]||0)+(t[n]||0);return e}function dR(e,t){return t instanceof ge._CodeOrName?If(e,t.names):e}function jg(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 bat(e,t){for(let n in t)e[n]=(e[n]||0)-(t[n]||0)}function dae(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:ge._`!${lM(e)}`}Rs.not=dae;var wat=pae(Rs.operators.AND);function _at(...e){return e.reduce(wat)}Rs.and=_at;var xat=pae(Rs.operators.OR);function vat(...e){return e.reduce(xat)}Rs.or=vat;function pae(e){return(t,n)=>t===ge.nil?n:n===ge.nil?t:ge._`${lM(t)} ${e} ${lM(n)}`}function lM(e){return e instanceof ge.Name?e:ge._`(${e})`}});var Ot=_(function(vae){Object.defineProperty(vae,"__esModule",{value:!0});vae.checkStrictMode=vae.getErrorPath=vae.Type=vae.useFunc=vae.setEvaluated=vae.evaluatedPropsToName=vae.mergeEvaluated=vae.eachItem=vae.unescapeJsonPointer=vae.escapeJsonPointer=vae.escapeFragment=vae.unescapeFragment=vae.schemaRefOrVal=vae.schemaHasRulesButRef=vae.schemaHasRules=vae.checkUnknownRules=vae.alwaysValidSchema=vae.toHash=void 0;var qe=_t(),gae=t_();function Rat(e){let t={};for(let n of e)t[n]=!0;return t}vae.toHash=Rat;function $at(e,t){if(typeof t=="boolean")return t;if(Object.keys(t).length===0)return!0;return yae(e,t),!bae(t,e.self.RULES.all)}vae.alwaysValidSchema=$at;function yae(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])xae(e,`unknown keyword: "${s}"`)}vae.checkUnknownRules=yae;function bae(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(t[n])return!0;return!1}vae.schemaHasRules=bae;function Dat(e,t){if(typeof e=="boolean")return!e;for(let n in e)if(n!=="$ref"&&t.all[n])return!0;return!1}vae.schemaHasRulesButRef=Dat;function Cat({topSchemaRef:e,schemaPath:t},n,r,o){if(!o){if(typeof n=="number"||typeof n=="boolean")return n;if(typeof n=="string")return qe._`${n}`}return qe._`${e}${t}${qe.getProperty(r)}`}vae.schemaRefOrVal=Cat;function Aat(e){return wae(decodeURIComponent(e))}vae.unescapeFragment=Aat;function Oat(e){return encodeURIComponent(pM(e))}vae.escapeFragment=Oat;function pM(e){if(typeof e=="number")return`${e}`;return e.replace(/~/g,"~0").replace(/\//g,"~1")}vae.escapeJsonPointer=pM;function wae(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}vae.unescapeJsonPointer=wae;function Tat(e,t){if(Array.isArray(e))for(let n of e)t(n);else t(e)}vae.eachItem=Tat;function mae({mergeNames:e,mergeToName:t,mergeValues:n,resultToName:r}){return(o,s,i,a)=>{let c=i===void 0?s:i instanceof qe.Name?(s instanceof qe.Name?e(o,s,i):t(o,s,i),i):s instanceof qe.Name?(t(o,i,s),s):n(s,i);return a===qe.Name&&!(c instanceof qe.Name)?r(o,c):c}}vae.mergeEvaluated={props:mae({mergeNames:(e,t,n)=>e.if(qe._`${n} !== true && ${t} !== undefined`,()=>{e.if(qe._`${t} === true`,()=>e.assign(n,!0),()=>e.assign(n,qe._`${n} || {}`).code(qe._`Object.assign(${n}, ${t})`))}),mergeToName:(e,t,n)=>e.if(qe._`${n} !== true`,()=>{if(t===!0)e.assign(n,!0);else e.assign(n,qe._`${n} || {}`),fM(e,n,t)}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:_ae}),items:mae({mergeNames:(e,t,n)=>e.if(qe._`${n} !== true && ${t} !== undefined`,()=>e.assign(n,qe._`${t} === true ? true : ${n} > ${t} ? ${n} : ${t}`)),mergeToName:(e,t,n)=>e.if(qe._`${n} !== true`,()=>e.assign(n,t===!0?!0:qe._`${n} > ${t} ? ${n} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function _ae(e,t){if(t===!0)return e.var("props",!0);let n=e.var("props",qe._`{}`);if(t!==void 0)fM(e,n,t);return n}vae.evaluatedPropsToName=_ae;function fM(e,t,n){Object.keys(n).forEach((r)=>e.assign(qe._`${t}${qe.getProperty(r)}`,!0))}vae.setEvaluated=fM;var hae={};function Pat(e,t){return e.scopeValue("func",{ref:t,code:hae[t.code]||(hae[t.code]=new gae._Code(t.code))})}vae.useFunc=Pat;var dM;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(dM||(vae.Type=dM={}));function Nat(e,t,n){if(e instanceof qe.Name){let r=t===dM.Num;return n?r?qe._`"[" + ${e} + "]"`:qe._`"['" + ${e} + "']"`:r?qe._`"/" + ${e}`:qe._`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return n?qe.getProperty(e).toString():"/"+pM(e)}vae.getErrorPath=Nat;function xae(e,t,n=e.opts.strictSchema){if(!n)return;if(t=`strict mode: ${t}`,n===!0)throw Error(t);e.self.logger.warn(t)}vae.checkStrictMode=xae});var Si=_(function(Sae){Object.defineProperty(Sae,"__esModule",{value:!0});var Gt=_t(),Zat={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")};Sae.default=Zat});var r_=_(function(Dae){Object.defineProperty(Dae,"__esModule",{value:!0});Dae.extendErrors=Dae.resetErrorsCount=Dae.reportExtraError=Dae.reportError=Dae.keyword$DataError=Dae.keywordError=void 0;var we=_t(),Dd=Ot(),Xo=Si();Dae.keywordError={message:({keyword:e})=>we.str`must pass "${e}" keyword validation`};Dae.keyword$DataError={message:({keyword:e,schemaType:t})=>t?we.str`"${e}" keyword must be ${t} ($data)`:we.str`"${e}" keyword is invalid ($data)`};function ect(e,t=Dae.keywordError,n,r){let{it:o}=e,{gen:s,compositeRule:i,allErrors:a}=o,c=$ae(e,t,n);if(r!==null&&r!==void 0?r:i||a)kae(s,c);else Rae(o,we._`[${c}]`)}Dae.reportError=ect;function tct(e,t=Dae.keywordError,n){let{it:r}=e,{gen:o,compositeRule:s,allErrors:i}=r,a=$ae(e,t,n);if(kae(o,a),!(s||i))Rae(r,Xo.default.vErrors)}Dae.reportExtraError=tct;function nct(e,t){e.assign(Xo.default.errors,t),e.if(we._`${Xo.default.vErrors} !== null`,()=>e.if(t,()=>e.assign(we._`${Xo.default.vErrors}.length`,t),()=>e.assign(Xo.default.vErrors,null)))}Dae.resetErrorsCount=nct;function rct({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,Xo.default.errors,(a)=>{if(e.const(i,we._`${Xo.default.vErrors}[${a}]`),e.if(we._`${i}.instancePath === undefined`,()=>e.assign(we._`${i}.instancePath`,we.strConcat(Xo.default.instancePath,s.errorPath))),e.assign(we._`${i}.schemaPath`,we.str`${s.errSchemaPath}/${t}`),s.opts.verbose)e.assign(we._`${i}.schema`,n),e.assign(we._`${i}.data`,r)})}Dae.extendErrors=rct;function kae(e,t){let n=e.const("err",t);e.if(we._`${Xo.default.vErrors} === null`,()=>e.assign(Xo.default.vErrors,we._`[${n}]`),we._`${Xo.default.vErrors}.push(${n})`),e.code(we._`${Xo.default.errors}++`)}function Rae(e,t){let{gen:n,validateName:r,schemaEnv:o}=e;if(o.$async)n.throw(we._`new ${e.ValidationError}(${t})`);else n.assign(we._`${r}.errors`,t),n.return(!1)}var Ff={keyword:new we.Name("keyword"),schemaPath:new we.Name("schemaPath"),params:new we.Name("params"),propertyName:new we.Name("propertyName"),message:new we.Name("message"),schema:new we.Name("schema"),parentSchema:new we.Name("parentSchema")};function $ae(e,t,n){let{createErrors:r}=e.it;if(r===!1)return we._`{}`;return oct(e,t,n)}function oct(e,t,n={}){let{gen:r,it:o}=e,s=[sct(o,n),ict(e,n)];return act(e,t,s),r.object(...s)}function sct({errorPath:e},{instancePath:t}){let n=t?we.str`${e}${Dd.getErrorPath(t,Dd.Type.Str)}`:e;return[Xo.default.instancePath,we.strConcat(Xo.default.instancePath,n)]}function ict({keyword:e,it:{errSchemaPath:t}},{schemaPath:n,parentSchema:r}){let o=r?t:we.str`${t}/${e}`;if(n)o=we.str`${o}${Dd.getErrorPath(n,Dd.Type.Str)}`;return[Ff.schemaPath,o]}function act(e,{params:t,message:n},r){let{keyword:o,data:s,schemaValue:i,it:a}=e,{opts:c,propertyName:l,topSchemaRef:d,schemaPath:p}=a;if(r.push([Ff.keyword,o],[Ff.params,typeof t=="function"?t(e):t||we._`{}`]),c.messages)r.push([Ff.message,typeof n=="function"?n(e):n]);if(c.verbose)r.push([Ff.schema,i],[Ff.parentSchema,we._`${d}${p}`],[Xo.default.data,s]);if(l)r.push([Ff.propertyName,l])}});var Iae=_(function(Pae){Object.defineProperty(Pae,"__esModule",{value:!0});Pae.boolOrEmptySchema=Pae.topBoolOrEmptySchema=void 0;var Aae=r_(),Oae=_t(),pct=Si(),fct={message:"boolean schema is false"};function mct(e){let{gen:t,schema:n,validateName:r}=e;if(n===!1)Tae(e,!1);else if(typeof n=="object"&&n.$async===!0)t.return(pct.default.data);else t.assign(Oae._`${r}.errors`,null),t.return(!0)}Pae.topBoolOrEmptySchema=mct;function hct(e,t){let{gen:n,schema:r}=e;if(r===!1)n.var(t,!1),Tae(e);else n.var(t,!0)}Pae.boolOrEmptySchema=hct;function Tae(e,t){let{gen:n,data:r}=e;Aae.reportError({gen:n,keyword:"false schema",data:r,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},fct,void 0,t)}});var hM=_(function(Fae){Object.defineProperty(Fae,"__esModule",{value:!0});Fae.getRules=Fae.isJSONType=void 0;var yct=["string","number","integer","boolean","null","object","array"],bct=new Set(yct);function wct(e){return typeof e=="string"&&bct.has(e)}Fae.isJSONType=wct;function _ct(){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:{}}}Fae.getRules=_ct});var gM=_(function(Uae){Object.defineProperty(Uae,"__esModule",{value:!0});Uae.shouldUseRule=Uae.shouldUseGroup=Uae.schemaHasRulesForType=void 0;function vct({schema:e,self:t},n){let r=t.RULES.types[n];return r&&r!==!0&&jae(e,r)}Uae.schemaHasRulesForType=vct;function jae(e,t){return t.rules.some((n)=>Lae(e,n))}Uae.shouldUseGroup=jae;function Lae(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))}Uae.shouldUseRule=Lae});var o_=_(function(Wae){Object.defineProperty(Wae,"__esModule",{value:!0});Wae.reportTypeError=Wae.checkDataTypes=Wae.checkDataType=Wae.coerceAndCheckDataType=Wae.getJSONTypes=Wae.getSchemaTypes=Wae.DataType=void 0;var Bae=hM(),Hae=gM(),zae=r_(),ce=_t(),hR=Ot(),Lg;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(Lg||(Wae.DataType=Lg={}));function kct(e){let t=Gae(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}Wae.getSchemaTypes=kct;function Gae(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(Bae.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}Wae.getJSONTypes=Gae;function Rct(e,t){let{gen:n,data:r,opts:o}=e,s=$ct(t,o.coerceTypes),i=t.length>0&&!(s.length===0&&t.length===1&&Hae.schemaHasRulesForType(e,t[0]));if(i){let a=bM(t,r,o.strictNumbers,Lg.Wrong);n.if(a,()=>{if(s.length)Dct(e,t,s);else wM(e)})}return i}Wae.coerceAndCheckDataType=Rct;var Vae=new Set(["string","number","integer","boolean","null"]);function $ct(e,t){return t?e.filter((n)=>Vae.has(n)||t==="array"&&n==="array"):[]}function Dct(e,t,n){let{gen:r,data:o,opts:s}=e,i=r.let("dataType",ce._`typeof ${o}`),a=r.let("coerced",ce._`undefined`);if(s.coerceTypes==="array")r.if(ce._`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>r.assign(o,ce._`${o}[0]`).assign(i,ce._`typeof ${o}`).if(bM(t,o,s.strictNumbers),()=>r.assign(a,o)));r.if(ce._`${a} !== undefined`);for(let l of n)if(Vae.has(l)||l==="array"&&s.coerceTypes==="array")c(l);r.else(),wM(e),r.endIf(),r.if(ce._`${a} !== undefined`,()=>{r.assign(o,a),Cct(e,a)});function c(l){switch(l){case"string":r.elseIf(ce._`${i} == "number" || ${i} == "boolean"`).assign(a,ce._`"" + ${o}`).elseIf(ce._`${o} === null`).assign(a,ce._`""`);return;case"number":r.elseIf(ce._`${i} == "boolean" || ${o} === null
87
87
  || (${i} == "string" && ${o} && ${o} == +${o})`).assign(a,ce._`+${o}`);return;case"integer":r.elseIf(ce._`${i} === "boolean" || ${o} === null
88
88
  || (${i} === "string" && ${o} && ${o} == +${o} && !(${o} % 1))`).assign(a,ce._`+${o}`);return;case"boolean":r.elseIf(ce._`${o} === "false" || ${o} === 0 || ${o} === null`).assign(a,!1).elseIf(ce._`${o} === "true" || ${o} === 1`).assign(a,!0);return;case"null":r.elseIf(ce._`${o} === "" || ${o} === 0 || ${o} === false`),r.assign(a,null);return;case"array":r.elseIf(ce._`${i} === "string" || ${i} === "number"
@@ -100,7 +100,7 @@ ${t}`,Pnt,Nnt,Int=(e,t,n)=>{let r=n===""?"":`with ${n.trim()}() `,o=Tnt.bind(nul
100
100
  `)}var Hj=!1;var{spawn:oSt}=globalThis.Bun;function Vf(e,t=[]){let n=e.replace(sSt,'("$1","<redacted>")');for(let r of t)if(r.length>=iSt)n=n.split(r).join("<redacted>");return n}function Q$(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 zbe(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 T(e,t={}){let n={...process.env,GIT_TERMINAL_PROMPT:"0",...t.env};for(let y of t.unsetEnv??[])delete n[y];let r=oSt({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??aSt)};if(l(),t.timeout)s=setTimeout(()=>{o=!0,c(),r.kill()},t.timeout);let d=ky()?[...Q$(n),...t.redact??[]]:[];if(ky()){let y=t.cwd?` (cwd=${t.cwd})`:"";lp(u.dim(Vf(`$ ${e.join(" ")}${y}`,d)))}let p=()=>{a=performance.now(),l()},f,m,h,g=r.exited.then((y)=>(c(),y));try{[f,m,h]=await Promise.all([zbe(r.stdout,p),zbe(r.stderr,p),g])}finally{if(c(),s)clearTimeout(s)}if(ky()){if(t.sensitiveOutput)lp(u.dim("[sensitive subprocess output suppressed]"));else{if(f.trim())lp(u.dim(Vf(f.trimEnd(),d)));if(m.trim())lp(u.yellow(Vf(m.trimEnd(),d)))}lp(u.dim(`(exit ${h})`))}if(o)return{stdout:f,stderr:m||`Command timed out after ${Math.round(t.timeout/1000)}s`,exitCode:h??1,timedOut:!0};return{stdout:f,stderr:m,exitCode:h,timedOut:!1}}var sSt,iSt=8,aSt=120000;var Wt=z(()=>{He();sSt=/\(\s*"((?:x-amz-)[^"]*|authorization|proxy-authorization)"\s*,\s*"[^"]*"\s*\)/gi});function lSt(){if(process.platform==="darwin")return"macos";if(process.platform==="win32")return"windows";return"linux"}function Vbe(e,t=lSt()){return e.installInstructions[t]}function uSt(e){let t=e.match(/(\d+\.\d+(?:\.\d+)?)/);return t?t[1]:void 0}function pSt(){let e=Number(process.env.TEST_PROBE_TIMEOUT_MS);return Number.isFinite(e)&&e>0?e:dSt}async function Wbe(e){try{let{exitCode:t,stdout:n,timedOut:r}=await T(e.cmd,{timeout:pSt()});if(r)return{available:!1,timedOut:!0};if(t!==0)return{available:!1};return{available:!0,version:uSt(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 P_(){let e=Object.entries(Gbe);return Promise.all(e.map(async([t,n])=>{let{available:r,version:o,timedOut:s}=await Wbe(n);return{key:t,name:n.name,purpose:n.purpose,required:n.required,available:r,version:o,timedOut:s,installInstruction:Vbe(n)}}))}async function Kbe(){let t=(await P_()).filter((n)=>n.required&&!n.available);if(t.length===0)return[];console.warn(`
101
101
  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 Wf(e){let n=cSt[e].map((i)=>Gbe[i]).filter(Boolean),r=await Promise.all(n.map(async(i)=>{let a=await Wbe(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:Vbe(i.check)}));if(o.length===0)return;let s=[`
102
102
  Missing required tools:`];for(let i of o)s.push(` ${i.tool} not installed`),s.push(` Install: ${i.installInstruction}`);throw Error(s.join(`
103
- `))}var Gbe,cSt,dSt=4000;var N_=z(()=>{Wt();Gbe={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)"}}},cSt={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 Ybe;var Jbe=z(()=>{Ybe={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.39-dev.4760",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 Kf=z(()=>{Jbe();Qs=Ybe.version});import{mkdirSync as mSt,readdirSync as hSt,unlinkSync as gSt,writeFileSync as ySt}from"fs";import{join as zj}from"path";function n0e(){Ry=!0}function eu(){return Ry}function r0e(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function F_(e){t0e=e,Ln(`Step: ${e}`)}function ts(){Qbe=!0}function o0e(){return Qbe}function ue(){if(e0e)return;Vj=!0}function up(){Vj=!1,e0e=!0}function s0e(){return Vj}function Ln(e){if(Ry)process.stderr.write(`[debug] ${e}
103
+ `))}var Gbe,cSt,dSt=4000;var N_=z(()=>{Wt();Gbe={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)"}}},cSt={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 Ybe;var Jbe=z(()=>{Ybe={name:"nemar-cli",packageManager:"bun@1.4.3",version:"0.10.39-dev.4761",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 Kf=z(()=>{Jbe();Qs=Ybe.version});import{mkdirSync as mSt,readdirSync as hSt,unlinkSync as gSt,writeFileSync as ySt}from"fs";import{join as zj}from"path";function n0e(){Ry=!0}function eu(){return Ry}function r0e(e,t=process.env){return e.includes("--debug")||t.NEMAR_DEBUG==="1"}function F_(e){t0e=e,Ln(`Step: ${e}`)}function ts(){Qbe=!0}function o0e(){return Qbe}function ue(){if(e0e)return;Vj=!0}function up(){Vj=!1,e0e=!0}function s0e(){return Vj}function Ln(e){if(Ry)process.stderr.write(`[debug] ${e}
104
104
  `)}function xSt(e){let t={};for(let[n,r]of Object.entries(e))t[n]=_St.has(n.toLowerCase())?"[REDACTED]":r;return t}function a0e(e){let t=e.indexOf("@");if(t<=0)return"***";return`${e[0]}***${e.slice(t)}`}function Gj(e,t,n=0){if(n>ESt)return"[REDACTED: depth]";if(Array.isArray(t))return t.map((r)=>Gj(e,r,n+1));if(t&&typeof t==="object"){let r={};for(let[o,s]of Object.entries(t))r[o]=Gj(o,s,n+1);return r}if(typeof t==="string"){if(vSt.test(e))return"[REDACTED]";return t.replace(i0e,a0e)}return t}function Wj(e){return e.replace(SSt,"Bearer [REDACTED]").replace(kSt,"[REDACTED_AWS_KEY]").replace(RSt,"$1[REDACTED]").replace($St,"$1$2=[REDACTED]").replace(i0e,a0e)}function DSt(e){return Wj(e)}function Xbe(e,t=wSt){if(e===void 0)return;let n=e;try{let r=JSON.parse(e);n=JSON.stringify(Gj("",r))}catch{}if(n=Wj(n),Buffer.byteLength(n,"utf8")>t)n=`${Buffer.from(n,"utf8").subarray(0,t).toString("utf8")}... [truncated]`;return n}function nD(e){if(!Ry)return;let t=DSt(e.url);try{let n={...e,url:t,requestHeaders:e.requestHeaders?xSt(e.requestHeaders):void 0,requestBody:Xbe(e.requestBody),responseBody:Xbe(e.responseBody)};tD.push(n),Ln(`${e.method} ${t} -> ${e.status??"ERROR"} (${e.durationMs}ms)`)}catch(n){let r=W(n);tD.push({method:e.method,url:t,status:e.status,durationMs:e.durationMs,note:`redaction failed: ${r}`}),Ln(`redaction failed for ${e.method} ${t}: ${r}`)}}async function CSt(){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=Kt();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 P_();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 Kj(){return(await CSt()).join(`
105
105
  `)}async function c0e(){if(!Ry||eD!==void 0)return;try{eD=await Kj()}catch(e){let t=W(e);eD=`(could not build environment report: ${t})`,Ln(`environment snapshot failed: ${t}`)}}function l0e(e){if(Zbe.has(e))return{flag:e};for(let t of Zbe){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 ASt(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],o=l0e(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 OSt(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n],o=l0e(r);if(!o){t.push(r);continue}if(!o.kind&&n+1<e.length)n++}return t}function TSt(e){let t=[];for(let r of OSt(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 PSt(e,t){let n=[];if(n.push("NEMAR CLI Debug Log"),n.push(`Generated: ${new Date().toISOString()}`),n.push(`Command: nemar ${Wj(ASt(e).join(" "))}`),n.push(""),n.push(eD??"(environment snapshot unavailable)"),n.push(""),n.push("HTTP requests:"),tD.length===0)n.push(" (none)");else tD.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: ${t0e??"(none recorded)"}`),n.push(`Exit code: ${t}`),`${n.join(`
106
106
  `)}
@@ -359,8 +359,9 @@ lost answer did), a submitted one is read back from Tapis and brought to the sta
359
359
  finished one gets what it is still owed (its settlement, the copy of its files). The way a job moves in
360
360
  development, where no compute cron runs. It does what the webhook and the 30-minute tick do, and no more.
361
361
 
362
- The submit is refused while compute is switched off: a created job stays created (the answer is
363
- "waiting", with submit compute_disabled), and everything else, a read-back, a settlement, a copy, still
362
+ The submit is refused while compute is switched off: a created job (one held while compute was on;
363
+ no new job is held while it is off) stays created (the answer is "waiting", with submit
364
+ compute_disabled), and everything else, a read-back, a settlement, a copy, still
364
365
  happens, because a job that is already on a cluster is never stranded by the switch.
365
366
 
366
367
  Admin or owner. --json prints the Worker's answer as it is.
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.39-dev.4760",
4
+ "version": "0.10.39-dev.4761",
5
5
  "description": "CLI for NEMAR (Neuroelectromagnetic Data Archive and Tools Resource) dataset management",
6
6
  "type": "module",
7
7
  "main": "dist/index.js",