@tonyclaw/agent-inspector 4.0.25 → 4.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/backend/nitro.json +1 -1
- package/.output/cli.js +1 -1
- package/.output/server/_libs/jszip.mjs +1 -1
- package/.output/server/_ssr/index.mjs +1 -1
- package/.output/server/_ssr/router-Cj54mKkM.mjs +341 -0
- package/.output/server/index.mjs +1 -1
- package/.output/ui/assets/{CompareDrawer-9Cpcwsg0.js → CompareDrawer-C3pX9Alw.js} +1 -1
- package/.output/ui/assets/{InspectorPet-CpyIvvKG.js → InspectorPet-DDjbATO9.js} +1 -1
- package/.output/ui/assets/{ProxyViewerContainer-DtqmCtP9.js → ProxyViewerContainer-F-_Sn2nR.js} +4 -4
- package/.output/ui/assets/{ReplayDialog-_Ltl0tnt.js → ReplayDialog-BpfUq9ZE.js} +1 -1
- package/.output/ui/assets/{RequestAnatomy-POXhrI88.js → RequestAnatomy-BTIiz-a0.js} +1 -1
- package/.output/ui/assets/{ResponseView-Dg7yAYE4.js → ResponseView-lwANKxHp.js} +1 -1
- package/.output/ui/assets/{StreamingChunkSequence-CaGzz2eo.js → StreamingChunkSequence-BXmaSuMq.js} +1 -1
- package/.output/ui/assets/{_sessionId-DIAo5jSy.js → _sessionId-B-ToaYEp.js} +1 -1
- package/.output/ui/assets/{_sessionId-B-VxTZ8G.js → _sessionId-Lxmp9FN4.js} +1 -1
- package/.output/ui/assets/{index-D1-Rqzqq.js → index-BqO4ZvDF.js} +1 -1
- package/.output/ui/assets/{index-CsTaujb3.js → index-D2HlVHsv.js} +1 -1
- package/.output/ui/assets/{index-BKXI2zIh.js → index-LumyLw_r.js} +1 -1
- package/.output/ui/assets/{index-BReAg1ik.js → index-y8_T6bJh.js} +2 -2
- package/.output/ui/assets/{json-viewer-CAmZWwqq.js → json-viewer-BgrOIILY.js} +1 -1
- package/.output/ui/assets/{jszip.min-Dxpvfn6i.js → jszip.min-07C_WUEA.js} +1 -1
- package/.output/ui/index.html +1 -1
- package/.output/workers/logFinalizer.worker.js +10 -10
- package/.output/workers/sessionWorkerEntry.js +10 -10
- package/README.md +2 -0
- package/package.json +4 -4
- package/.output/server/_ssr/router-B0O86LL2.mjs +0 -341
package/.output/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var ix=Object.defineProperty;var y=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(o){throw r=[o],o}};var we=(e,t)=>{for(var r in t)ix(e,r,{get:t[r],enumerable:!0})};var ot,ps=y(()=>{ot={name:"@tonyclaw/agent-inspector",version:"4.0.25",type:"module",description:"Agent observability and knowledge capture layer for AI coding tools.",license:"MIT",engines:{node:">=22.0.0"},author:"TonyClaw",repository:{type:"git",url:"git+https://gitcode.com/TonyClaw/OpenInspector.git"},homepage:"https://gitcode.com/TonyClaw/OpenInspector#readme",workspaces:["packages/*"],bugs:{url:"https://gitcode.com/TonyClaw/OpenInspector/issues"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},keywords:["claude","anthropic","openai","proxy","api-inspector","agent-observability","agent-memory","debugging","llm","ai-coding-tools"],bin:{"agent-inspector":"bin/agent-inspector.js"},files:["bin","src/assets/agent-inspector.ico","scripts/setup-windows-runtime.mjs","scripts/setup-agent-skills.mjs","scripts/generate-theme-scales.mjs","docs/instance-control.openapi.yaml","styles",".output","!.output/*.exe"],scripts:{dev:"node scripts/dev-decoupled.mjs","dev:ui":"vite dev --config vite.ui.config.ts","dev:backend":"node scripts/dev-backend.mjs","test:smoke":"node scripts/run-local-bun.mjs scripts/run-test-suite.mjs smoke","test:fast":"node scripts/run-local-bun.mjs scripts/run-test-suite.mjs smoke","test:unit":"node scripts/run-local-bun.mjs scripts/run-test-suite.mjs unit","test:integration":"node scripts/run-local-bun.mjs scripts/run-test-suite.mjs integration","test:changed":"node scripts/run-local-bun.mjs scripts/run-test-suite.mjs changed","test:all":"node scripts/run-local-bun.mjs scripts/run-test-suite.mjs all","test:hostile-inputs":"bun test src/proxy/identityProxy.test.ts src/proxy/handler.cancellationCompatibility.test.ts src/proxy/logImporter.test.ts src/backend/routes/api/-logs.stream.test.ts src/proxy/handler.admission.test.ts src/proxy/runtimeHealth.test.ts src/proxy/storageLifecycle.test.ts","test:compatibility-tooling":"node scripts/run-compatibility-tests.mjs ultra","test:compatibility-tooling:extended":"node scripts/run-compatibility-tests.mjs extended","test:compatibility-conformance":"node scripts/run-compatibility-tests.mjs conformance",start:"node .output/cli.js","start:backend":"node .output/cli.js --backend-only --no-open","preview:ui":"vite preview --config vite.ui.config.ts","clean:output":"node scripts/clean-output.mjs",build:"bun clean:output && bun build:backend && bun build:ui && bun smoke:ui-preview && bun build:workers && bun build:cli && bun build:mcp && bun check:bundle && bun check:boundaries","build:backend":"vite build --config vite.backend.config.ts","build:ui":"vite build --config vite.ui.config.ts","build:workers":"npx esbuild src/proxy/logFinalizer.worker.ts src/proxy/sessionWorkerEntry.ts --bundle --minify --legal-comments=none --platform=node --target=node22 --format=esm --outdir=.output/workers --external:better-sqlite3","smoke:workers":"node scripts/smoke-production-workers.mjs","smoke:packed-workers":"node scripts/smoke-packed-workers.mjs","smoke:instances":"node scripts/smoke-windows-instances.mjs","smoke:coding-agent-instances":"node scripts/smoke-coding-agent-instances.mjs","smoke:ui-preview":"node scripts/smoke-decoupled-ui-preview.mjs","check:bundle":"node scripts/check-client-bundle.mjs","check:boundaries":"node scripts/check-runtime-boundaries.mjs","check:commercial-performance":"node scripts/check-commercial-performance-budgets.mjs","check:hostile-inputs":"node scripts/check-hostile-input-coverage.mjs","check:supply-chain":"node scripts/check-commercial-supply-chain.mjs","compatibility:bdd":"node scripts/lint-bdd-catalog.mjs","compatibility:compare":"node scripts/compatibility/cli.mjs compare","compatibility:drift":"node scripts/check-backend-compatibility.mjs","compatibility:fixtures":"bun scripts/validate-compatibility-fixtures.ts","compatibility:freeze":"node scripts/freeze-backend-baseline.mjs","compatibility:run":"node scripts/compatibility/cli.mjs run","compatibility:performance":"node scripts/compatibility/performance-cli.mjs","compatibility:performance:verify":"node scripts/compatibility/performance-cli.mjs verify","build:cli":"npx esbuild src/cli.ts --bundle --minify --legal-comments=none --platform=node --target=node22 --format=esm --outfile=.output/cli.js","build:mcp":"npx esbuild packages/agent-inspector-mcp/src/cli.ts --bundle --minify --legal-comments=none --platform=node --target=node22 --format=esm --outfile=packages/agent-inspector-mcp/dist/cli.js","rust:build-package":"node scripts/rust/build-platform.mjs","rust:stage-package":"node scripts/rust/stage-platform.mjs","rust:verify-package":"node scripts/rust/verify-platform.mjs","rust:pack-package":"node scripts/rust/pack-platform.mjs","rust:native-artifact":"node scripts/rust/create-native-artifact.mjs","rust:native:aggregate":"node scripts/rust/aggregate-native-artifacts.mjs","rust:release-gate:preflight":"node scripts/rust/release-gate-preflight.mjs","rust:release-evidence:plan":"node scripts/rust/release-evidence-plan.mjs","commercial:release-gate:preflight":"node scripts/commercial-release-preflight.mjs","test:commercial-release-gate":"bun test scripts/commercialReleasePreflight.test.ts","test:rust-packaging":"bun test scripts/rust/npmPackaging.test.ts scripts/rust/nativeReleaseContract.test.ts scripts/rust/nativeStartupSmoke.test.ts scripts/rust/releaseGatePreflight.test.ts scripts/releaseCore.test.ts","rust:packages:check":"node scripts/rust/sync-package-versions.mjs","rust:packages:sync":"node scripts/rust/sync-package-versions.mjs --write","themes:generate":"node scripts/generate-theme-scales.mjs",postinstall:"node scripts/setup-windows-runtime.mjs && node scripts/setup-agent-skills.mjs",prepublishOnly:"node scripts/rust/require-release-orchestrator.mjs",typecheck:"tsc --noEmit --incremental --tsBuildInfoFile .cache/tsconfig.tsbuildinfo",lint:"eslint . --cache --cache-location .cache/eslintcache",format:"biome format --write .","format:check":"biome format .","verify:ultra":"node scripts/compatibility/ultra-gate.mjs","verify:ultra:fresh":"node scripts/compatibility/ultra-gate.mjs --no-cache","verify:ultra:smoke":"npm run verify:ultra && npm run test:smoke","verify:fast":"bun scripts/run-static-checks.mjs --format && bun test:changed","extension:zip":"node scripts/pack-chrome-extension.mjs","extension:release":"node scripts/release-chrome-extension.mjs",release:"node scripts/release.mjs",knip:"knip",check:"bun scripts/run-static-checks.mjs --format && bun check:boundaries && bun check:commercial-performance && bun check:hostile-inputs && bun compatibility:bdd && bun rust:packages:check",prepare:"husky",ladle:"ladle serve","ladle:build":"ladle build"},dependencies:{"@mariozechner/pi-agent-core":"^0.73.1","@mariozechner/pi-ai":"^0.73.1","@modelcontextprotocol/server":"^2.0.0-beta.4","@tailwindcss/typography":"^0.5.20","@tanstack/react-router":"^1.170.18","@tanstack/react-start":"^1.168.28","@tanstack/react-virtual":"^3.14.6","class-variance-authority":"^0.7.1",clsx:"^2.1.1",conf:"^15.1.0",diff:"^9.0.0",jszip:"^3.10.1","lucide-react":"^0.563.0","radix-ui":"1.6.2",react:"^19.2.7","react-dom":"^19.2.7","react-markdown":"^10.1.0",swr:"^2.4.2","tailwind-merge":"^3.6.0",three:"0.185.1","tw-animate-css":"^1.4.0",zod:"^4.4.3"},optionalDependencies:{"@tonyclaw/agent-inspector-backend-darwin-arm64":"4.0.25","@tonyclaw/agent-inspector-backend-linux-x64-gnu":"4.0.25","@tonyclaw/agent-inspector-backend-win32-x64-msvc":"4.0.25","better-sqlite3":"^12.11.1",rcedit:"4.0.1"},devDependencies:{"@biomejs/biome":"^2.5.3","@eslint/js":"^10.0.1","@ladle/react":"^5.1.1","@radix-ui/colors":"^3.0.0","@tailwindcss/vite":"^4.3.2","@tanstack/router-plugin":"^1.168.20","@types/bun":"^1.3.14","@types/react":"^19.2.17","@types/react-dom":"^19.2.3","@types/three":"0.185.1","@typescript-eslint/eslint-plugin":"^8.64.0","@typescript-eslint/parser":"^8.64.0","@vitejs/plugin-react":"^5.2.0",ajv:"8.20.0","ajv-formats":"3.0.1","colorjs.io":"^0.7.0",esbuild:"^0.28.1",eslint:"^9.39.5","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-functional":"^9.0.5","eslint-plugin-unicorn":"^63.0.0",husky:"^9.1.7",knip:"^5.88.1",nitro:"^3.0.260610-beta",playwright:"^1.61.1",tailwindcss:"^4.3.2",typescript:"^5.9.3",vite:"^7.3.6","vite-tsconfig-paths":"^6.1.1"},overrides:{undici:">=7.24.0 <8.0.0",rollup:">=4.59.0 <5.0.0",postcss:">=8.5.10 <9.0.0","js-yaml":">=4.1.2 <5.0.0",flatted:">=3.4.0 <4.0.0","smol-toml":">=1.6.1 <2.0.0",koa:">=2.16.4 <3.0.0","@babel/core":">=7.29.1 <8.0.0","@typescript-eslint/typescript-estree":"^8.63.0",vite:"^7.3.6"}}});function m(e,t,r){function o(s,u){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,u);let l=a.prototype,d=Object.keys(l);for(let p=0;p<d.length;p++){let f=d[p];f in s||(s[f]=l[f].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var u;let l=r?.Parent?new i:this;o(l,s),(u=l._zod).deferred??(u.deferred=[]);for(let d of l._zod.deferred)d();return l}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}function Y(e){return e&&Object.assign(zt,e),zt}var Bf,ms,fs,Be,ft,zt,Dt=y(()=>{ms=Object.freeze({status:"aborted"});fs=Symbol("zod_brand"),Be=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ft=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Bf=globalThis).__zod_globalConfig??(Bf.__zod_globalConfig={});zt=globalThis.__zod_globalConfig});var k={};we(k,{BIGINT_FORMAT_RANGES:()=>Is,Class:()=>hs,NUMBER_FORMAT_RANGES:()=>xs,aborted:()=>yt,allowsEval:()=>bs,assert:()=>dx,assertEqual:()=>sx,assertIs:()=>ux,assertNever:()=>lx,assertNotEqual:()=>cx,assignProp:()=>ht,base64ToUint8Array:()=>Zf,base64urlToUint8Array:()=>Rx,cached:()=>cn,captureStackTrace:()=>Po,cleanEnum:()=>wx,cleanRegex:()=>ar,clone:()=>he,cloneDef:()=>mx,createTransparentProxy:()=>bx,defineLazy:()=>A,esc:()=>So,escapeRegex:()=>je,explicitlyAborted:()=>Ss,extend:()=>$x,finalizeIssue:()=>ve,floatSafeRemainder:()=>vs,getElementAtPath:()=>fx,getEnumValues:()=>ir,getLengthableOrigin:()=>ur,getParsedType:()=>yx,getSizableOrigin:()=>cr,hexToUint8Array:()=>Ex,isObject:()=>Ut,isPlainObject:()=>vt,issue:()=>un,joinValues:()=>h,jsonStringifyReplacer:()=>sn,merge:()=>Ix,mergeDefs:()=>it,normalizeParams:()=>$,nullish:()=>gt,numKeys:()=>vx,objectClone:()=>px,omit:()=>kx,optionalKeys:()=>$s,parsedType:()=>_,partial:()=>Sx,pick:()=>_x,prefixIssues:()=>ke,primitiveTypes:()=>ks,promiseAllObject:()=>gx,propertyKeyTypes:()=>sr,randomString:()=>hx,required:()=>Px,safeExtend:()=>xx,shallowClone:()=>_s,slugify:()=>ys,stringifyPrimitive:()=>b,uint8ArrayToBase64:()=>Gf,uint8ArrayToBase64url:()=>Tx,uint8ArrayToHex:()=>Ox,unwrapMessage:()=>or});function sx(e){return e}function cx(e){return e}function ux(e){}function lx(e){throw new Error("Unexpected value in exhaustive check")}function dx(e){}function ir(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function h(e,t="|"){return e.map(r=>b(r)).join(t)}function sn(e,t){return typeof t=="bigint"?t.toString():t}function cn(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function gt(e){return e==null}function ar(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function vs(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}function A(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Ff)return o===void 0&&(o=Ff,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function px(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function ht(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function it(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function mx(e){return it(e._zod.def)}function fx(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function gx(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function hx(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function So(e){return JSON.stringify(e)}function ys(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Ut(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vt(e){if(Ut(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Ut(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function _s(e){return vt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function vx(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function he(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function $(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function bx(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function b(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function $s(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function _x(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=it(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return ht(this,"shape",a),a},checks:[]});return he(e,i)}function kx(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=it(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return ht(this,"shape",a),a},checks:[]});return he(e,i)}function $x(e,t){if(!vt(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=it(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return ht(this,"shape",i),i}});return he(e,n)}function xx(e,t){if(!vt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=it(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return ht(this,"shape",o),o}});return he(e,r)}function Ix(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=it(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return ht(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return he(e,r)}function Sx(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=it(t._zod.def,{get shape(){let s=t._zod.def.shape,u={...s};if(r)for(let l in r){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(u[l]=e?new e({type:"optional",innerType:s[l]}):s[l])}else for(let l in s)u[l]=e?new e({type:"optional",innerType:s[l]}):s[l];return ht(this,"shape",u),u},checks:[]});return he(t,a)}function Px(e,t,r){let o=it(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return ht(this,"shape",i),i}});return he(t,o)}function yt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Ss(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function ke(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function or(e){return typeof e=="string"?e:e?.message}function ve(e,t,r){let o=e.message?e.message:or(e.inst?._zod.def?.error?.(e))??or(t?.error?.(e))??or(r.customError?.(e))??or(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=a),s}function cr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ur(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function _(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function un(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function wx(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Zf(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Gf(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Rx(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Zf(t+r)}function Tx(e){return Gf(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ex(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function Ox(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Ff,Po,bs,yx,sr,ks,xs,Is,hs,S=y(()=>{Dt();Ff=Symbol("evaluating");Po="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};bs=cn(()=>{if(zt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});yx=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},sr=new Set(["string","number","symbol"]),ks=new Set(["string","number","bigint","boolean","symbol","undefined"]);xs={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Is={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};hs=class{constructor(...t){}}});function dr(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function pr(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let u=r,l=0;for(;l<s.length;){let d=s[l];l===s.length-1?(u[d]=u[d]||{_errors:[]},u[d]._errors.push(t(a))):u[d]=u[d]||{_errors:[]},u=u[d],l++}}}};return o(e),r}function Ps(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let u of n.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>o({issues:l},[...i,...u.path]));else if(u.code==="invalid_key")o({issues:u.issues},[...i,...u.path]);else if(u.code==="invalid_element")o({issues:u.issues},[...i,...u.path]);else{let l=[...i,...u.path];if(l.length===0){r.errors.push(t(u));continue}let d=r,p=0;for(;p<l.length;){let f=l[p],v=p===l.length-1;typeof f=="string"?(d.properties??(d.properties={}),(a=d.properties)[f]??(a[f]={errors:[]}),d=d.properties[f]):(d.items??(d.items=[]),(s=d.items)[f]??(s[f]={errors:[]}),d=d.items[f]),v&&d.errors.push(t(u)),p++}}};return o(e),r}function Jf(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function ws(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${Jf(o.path)}`);return t.join(`
|
|
2
|
+
var ix=Object.defineProperty;var y=(e,t,r)=>()=>{if(r)throw r[0];try{return e&&(t=e(e=0)),t}catch(o){throw r=[o],o}};var we=(e,t)=>{for(var r in t)ix(e,r,{get:t[r],enumerable:!0})};var ot,ps=y(()=>{ot={name:"@tonyclaw/agent-inspector",version:"4.0.26",type:"module",description:"Agent observability and knowledge capture layer for AI coding tools.",license:"MIT",engines:{node:">=22.0.0"},author:"TonyClaw",repository:{type:"git",url:"git+https://gitcode.com/TonyClaw/OpenInspector.git"},homepage:"https://gitcode.com/TonyClaw/OpenInspector#readme",workspaces:["packages/*"],bugs:{url:"https://gitcode.com/TonyClaw/OpenInspector/issues"},publishConfig:{access:"public",registry:"https://registry.npmjs.org/"},keywords:["claude","anthropic","openai","proxy","api-inspector","agent-observability","agent-memory","debugging","llm","ai-coding-tools"],bin:{"agent-inspector":"bin/agent-inspector.js"},files:["bin","src/assets/agent-inspector.ico","scripts/setup-windows-runtime.mjs","scripts/setup-agent-skills.mjs","scripts/generate-theme-scales.mjs","docs/instance-control.openapi.yaml","styles",".output","!.output/*.exe"],scripts:{dev:"node scripts/dev-decoupled.mjs","dev:ui":"vite dev --config vite.ui.config.ts","dev:backend":"node scripts/dev-backend.mjs","test:smoke":"node scripts/run-local-bun.mjs scripts/run-test-suite.mjs smoke","test:fast":"node scripts/run-local-bun.mjs scripts/run-test-suite.mjs smoke","test:unit":"node scripts/run-local-bun.mjs scripts/run-test-suite.mjs unit","test:integration":"node scripts/run-local-bun.mjs scripts/run-test-suite.mjs integration","test:changed":"node scripts/run-local-bun.mjs scripts/run-test-suite.mjs changed","test:all":"node scripts/run-local-bun.mjs scripts/run-test-suite.mjs all","test:hostile-inputs":"bun test src/proxy/identityProxy.test.ts src/proxy/handler.cancellationCompatibility.test.ts src/proxy/logImporter.test.ts src/backend/routes/api/-logs.stream.test.ts src/proxy/handler.admission.test.ts src/proxy/runtimeHealth.test.ts src/proxy/storageLifecycle.test.ts","test:compatibility-tooling":"node scripts/run-compatibility-tests.mjs ultra","test:compatibility-tooling:extended":"node scripts/run-compatibility-tests.mjs extended","test:compatibility-conformance":"node scripts/run-compatibility-tests.mjs conformance",start:"node .output/cli.js","start:backend":"node .output/cli.js --backend-only --no-open","preview:ui":"vite preview --config vite.ui.config.ts","clean:output":"node scripts/clean-output.mjs",build:"bun clean:output && bun build:backend && bun build:ui && bun smoke:ui-preview && bun build:workers && bun build:cli && bun build:mcp && bun check:bundle && bun check:boundaries","build:backend":"vite build --config vite.backend.config.ts","build:ui":"vite build --config vite.ui.config.ts","build:workers":"npx esbuild src/proxy/logFinalizer.worker.ts src/proxy/sessionWorkerEntry.ts --bundle --minify --legal-comments=none --platform=node --target=node22 --format=esm --outdir=.output/workers --external:better-sqlite3","smoke:workers":"node scripts/smoke-production-workers.mjs","smoke:packed-workers":"node scripts/smoke-packed-workers.mjs","smoke:instances":"node scripts/smoke-windows-instances.mjs","smoke:coding-agent-instances":"node scripts/smoke-coding-agent-instances.mjs","smoke:ui-preview":"node scripts/smoke-decoupled-ui-preview.mjs","check:bundle":"node scripts/check-client-bundle.mjs","check:boundaries":"node scripts/check-runtime-boundaries.mjs","check:commercial-performance":"node scripts/check-commercial-performance-budgets.mjs","check:hostile-inputs":"node scripts/check-hostile-input-coverage.mjs","check:supply-chain":"node scripts/check-commercial-supply-chain.mjs","compatibility:bdd":"node scripts/lint-bdd-catalog.mjs","compatibility:compare":"node scripts/compatibility/cli.mjs compare","compatibility:drift":"node scripts/check-backend-compatibility.mjs","compatibility:fixtures":"bun scripts/validate-compatibility-fixtures.ts","compatibility:freeze":"node scripts/freeze-backend-baseline.mjs","compatibility:run":"node scripts/compatibility/cli.mjs run","compatibility:performance":"node scripts/compatibility/performance-cli.mjs","compatibility:performance:verify":"node scripts/compatibility/performance-cli.mjs verify","build:cli":"npx esbuild src/cli.ts --bundle --minify --legal-comments=none --platform=node --target=node22 --format=esm --outfile=.output/cli.js","build:mcp":"npx esbuild packages/agent-inspector-mcp/src/cli.ts --bundle --minify --legal-comments=none --platform=node --target=node22 --format=esm --outfile=packages/agent-inspector-mcp/dist/cli.js","rust:build-package":"node scripts/rust/build-platform.mjs","rust:stage-package":"node scripts/rust/stage-platform.mjs","rust:verify-package":"node scripts/rust/verify-platform.mjs","rust:pack-package":"node scripts/rust/pack-platform.mjs","rust:native-artifact":"node scripts/rust/create-native-artifact.mjs","rust:native:aggregate":"node scripts/rust/aggregate-native-artifacts.mjs","rust:release-gate:preflight":"node scripts/rust/release-gate-preflight.mjs","rust:release-evidence:plan":"node scripts/rust/release-evidence-plan.mjs","commercial:release-gate:preflight":"node scripts/commercial-release-preflight.mjs","test:commercial-release-gate":"bun test scripts/commercialReleasePreflight.test.ts","test:rust-packaging":"bun test scripts/rust/npmPackaging.test.ts scripts/rust/nativeReleaseContract.test.ts scripts/rust/nativeStartupSmoke.test.ts scripts/rust/releaseGatePreflight.test.ts scripts/releaseCore.test.ts","rust:packages:check":"node scripts/rust/sync-package-versions.mjs","rust:packages:sync":"node scripts/rust/sync-package-versions.mjs --write","themes:generate":"node scripts/generate-theme-scales.mjs",postinstall:"node scripts/setup-windows-runtime.mjs && node scripts/setup-agent-skills.mjs",prepublishOnly:"node scripts/rust/require-release-orchestrator.mjs",typecheck:"tsc --noEmit --incremental --tsBuildInfoFile .cache/tsconfig.tsbuildinfo",lint:"eslint . --cache --cache-location .cache/eslintcache",format:"biome format --write .","format:check":"biome format .","verify:ultra":"node scripts/compatibility/ultra-gate.mjs","verify:ultra:fresh":"node scripts/compatibility/ultra-gate.mjs --no-cache","verify:ultra:smoke":"npm run verify:ultra && npm run test:smoke","verify:fast":"bun scripts/run-static-checks.mjs --format && bun test:changed","extension:zip":"node scripts/pack-chrome-extension.mjs","extension:release":"node scripts/release-chrome-extension.mjs",release:"node scripts/release.mjs",knip:"knip",check:"bun scripts/run-static-checks.mjs --format && bun check:boundaries && bun check:commercial-performance && bun check:hostile-inputs && bun compatibility:bdd && bun rust:packages:check",prepare:"husky",ladle:"ladle serve","ladle:build":"ladle build"},dependencies:{"@mariozechner/pi-agent-core":"^0.73.1","@mariozechner/pi-ai":"^0.73.1","@modelcontextprotocol/server":"^2.0.0-beta.4","@tailwindcss/typography":"^0.5.20","@tanstack/react-router":"^1.170.18","@tanstack/react-start":"^1.168.28","@tanstack/react-virtual":"^3.14.6","class-variance-authority":"^0.7.1",clsx:"^2.1.1",conf:"^15.1.0",diff:"^9.0.0",jszip:"^3.10.1","lucide-react":"^0.563.0","radix-ui":"1.6.2",react:"^19.2.7","react-dom":"^19.2.7","react-markdown":"^10.1.0",swr:"^2.4.2","tailwind-merge":"^3.6.0",three:"0.185.1","tw-animate-css":"^1.4.0",zod:"^4.4.3"},optionalDependencies:{"@tonyclaw/agent-inspector-backend-darwin-arm64":"4.0.26","@tonyclaw/agent-inspector-backend-linux-x64-gnu":"4.0.26","@tonyclaw/agent-inspector-backend-win32-x64-msvc":"4.0.26","better-sqlite3":"^12.11.1",rcedit:"4.0.1"},devDependencies:{"@biomejs/biome":"^2.5.3","@eslint/js":"^10.0.1","@ladle/react":"^5.1.1","@radix-ui/colors":"^3.0.0","@tailwindcss/vite":"^4.3.2","@tanstack/router-plugin":"^1.168.20","@types/bun":"^1.3.14","@types/react":"^19.2.17","@types/react-dom":"^19.2.3","@types/three":"0.185.1","@typescript-eslint/eslint-plugin":"^8.64.0","@typescript-eslint/parser":"^8.64.0","@vitejs/plugin-react":"^5.2.0",ajv:"8.20.0","ajv-formats":"3.0.1","colorjs.io":"^0.7.0",esbuild:"^0.28.1",eslint:"^9.39.5","eslint-plugin-eslint-comments":"^3.2.0","eslint-plugin-functional":"^9.0.5","eslint-plugin-unicorn":"^63.0.0",husky:"^9.1.7",knip:"^5.88.1",nitro:"^3.0.260610-beta",playwright:"^1.61.1",tailwindcss:"^4.3.2",typescript:"^5.9.3",vite:"^7.3.6","vite-tsconfig-paths":"^6.1.1"},overrides:{undici:">=7.24.0 <8.0.0",rollup:">=4.59.0 <5.0.0",postcss:">=8.5.10 <9.0.0","js-yaml":">=4.1.2 <5.0.0",flatted:">=3.4.0 <4.0.0","smol-toml":">=1.6.1 <2.0.0",koa:">=2.16.4 <3.0.0","@babel/core":">=7.29.1 <8.0.0","@typescript-eslint/typescript-estree":"^8.63.0",vite:"^7.3.6"}}});function m(e,t,r){function o(s,u){if(s._zod||Object.defineProperty(s,"_zod",{value:{def:u,constr:a,traits:new Set},enumerable:!1}),s._zod.traits.has(e))return;s._zod.traits.add(e),t(s,u);let l=a.prototype,d=Object.keys(l);for(let p=0;p<d.length;p++){let f=d[p];f in s||(s[f]=l[f].bind(s))}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function a(s){var u;let l=r?.Parent?new i:this;o(l,s),(u=l._zod).deferred??(u.deferred=[]);for(let d of l._zod.deferred)d();return l}return Object.defineProperty(a,"init",{value:o}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}function Y(e){return e&&Object.assign(zt,e),zt}var Bf,ms,fs,Be,ft,zt,Dt=y(()=>{ms=Object.freeze({status:"aborted"});fs=Symbol("zod_brand"),Be=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},ft=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(Bf=globalThis).__zod_globalConfig??(Bf.__zod_globalConfig={});zt=globalThis.__zod_globalConfig});var k={};we(k,{BIGINT_FORMAT_RANGES:()=>Is,Class:()=>hs,NUMBER_FORMAT_RANGES:()=>xs,aborted:()=>yt,allowsEval:()=>bs,assert:()=>dx,assertEqual:()=>sx,assertIs:()=>ux,assertNever:()=>lx,assertNotEqual:()=>cx,assignProp:()=>ht,base64ToUint8Array:()=>Zf,base64urlToUint8Array:()=>Rx,cached:()=>cn,captureStackTrace:()=>Po,cleanEnum:()=>wx,cleanRegex:()=>ar,clone:()=>he,cloneDef:()=>mx,createTransparentProxy:()=>bx,defineLazy:()=>A,esc:()=>So,escapeRegex:()=>je,explicitlyAborted:()=>Ss,extend:()=>$x,finalizeIssue:()=>ve,floatSafeRemainder:()=>vs,getElementAtPath:()=>fx,getEnumValues:()=>ir,getLengthableOrigin:()=>ur,getParsedType:()=>yx,getSizableOrigin:()=>cr,hexToUint8Array:()=>Ex,isObject:()=>Ut,isPlainObject:()=>vt,issue:()=>un,joinValues:()=>h,jsonStringifyReplacer:()=>sn,merge:()=>Ix,mergeDefs:()=>it,normalizeParams:()=>$,nullish:()=>gt,numKeys:()=>vx,objectClone:()=>px,omit:()=>kx,optionalKeys:()=>$s,parsedType:()=>_,partial:()=>Sx,pick:()=>_x,prefixIssues:()=>ke,primitiveTypes:()=>ks,promiseAllObject:()=>gx,propertyKeyTypes:()=>sr,randomString:()=>hx,required:()=>Px,safeExtend:()=>xx,shallowClone:()=>_s,slugify:()=>ys,stringifyPrimitive:()=>b,uint8ArrayToBase64:()=>Gf,uint8ArrayToBase64url:()=>Tx,uint8ArrayToHex:()=>Ox,unwrapMessage:()=>or});function sx(e){return e}function cx(e){return e}function ux(e){}function lx(e){throw new Error("Unexpected value in exhaustive check")}function dx(e){}function ir(e){let t=Object.values(e).filter(o=>typeof o=="number");return Object.entries(e).filter(([o,n])=>t.indexOf(+o)===-1).map(([o,n])=>n)}function h(e,t="|"){return e.map(r=>b(r)).join(t)}function sn(e,t){return typeof t=="bigint"?t.toString():t}function cn(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function gt(e){return e==null}function ar(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function vs(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);return Math.abs(r-o)<n?0:r-o}function A(e,t,r){let o;Object.defineProperty(e,t,{get(){if(o!==Ff)return o===void 0&&(o=Ff,o=r()),o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function px(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function ht(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function it(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function mx(e){return it(e._zod.def)}function fx(e,t){return t?t.reduce((r,o)=>r?.[o],e):e}function gx(e){let t=Object.keys(e),r=t.map(o=>e[o]);return Promise.all(r).then(o=>{let n={};for(let i=0;i<t.length;i++)n[t[i]]=o[i];return n})}function hx(e=10){let t="abcdefghijklmnopqrstuvwxyz",r="";for(let o=0;o<e;o++)r+=t[Math.floor(Math.random()*t.length)];return r}function So(e){return JSON.stringify(e)}function ys(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Ut(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function vt(e){if(Ut(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Ut(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function _s(e){return vt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function vx(e){let t=0;for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t++;return t}function je(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function he(e,t,r){let o=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(o._zod.parent=e),o}function $(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function bx(e){let t;return new Proxy({},{get(r,o,n){return t??(t=e()),Reflect.get(t,o,n)},set(r,o,n,i){return t??(t=e()),Reflect.set(t,o,n,i)},has(r,o){return t??(t=e()),Reflect.has(t,o)},deleteProperty(r,o){return t??(t=e()),Reflect.deleteProperty(t,o)},ownKeys(r){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(r,o){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,o)},defineProperty(r,o,n){return t??(t=e()),Reflect.defineProperty(t,o,n)}})}function b(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function $s(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function _x(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=it(e._zod.def,{get shape(){let a={};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&(a[s]=r.shape[s])}return ht(this,"shape",a),a},checks:[]});return he(e,i)}function kx(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=it(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let s in t){if(!(s in r.shape))throw new Error(`Unrecognized key: "${s}"`);t[s]&&delete a[s]}return ht(this,"shape",a),a},checks:[]});return he(e,i)}function $x(e,t){if(!vt(t))throw new Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=it(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return ht(this,"shape",i),i}});return he(e,n)}function xx(e,t){if(!vt(t))throw new Error("Invalid input to safeExtend: expected a plain object");let r=it(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return ht(this,"shape",o),o}});return he(e,r)}function Ix(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=it(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return ht(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return he(e,r)}function Sx(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=it(t._zod.def,{get shape(){let s=t._zod.def.shape,u={...s};if(r)for(let l in r){if(!(l in s))throw new Error(`Unrecognized key: "${l}"`);r[l]&&(u[l]=e?new e({type:"optional",innerType:s[l]}):s[l])}else for(let l in s)u[l]=e?new e({type:"optional",innerType:s[l]}):s[l];return ht(this,"shape",u),u},checks:[]});return he(t,a)}function Px(e,t,r){let o=it(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let a in r){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(i[a]=new e({type:"nonoptional",innerType:n[a]}))}else for(let a in n)i[a]=new e({type:"nonoptional",innerType:n[a]});return ht(this,"shape",i),i}});return he(t,o)}function yt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Ss(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function ke(e,t){return t.map(r=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function or(e){return typeof e=="string"?e:e?.message}function ve(e,t,r){let o=e.message?e.message:or(e.inst?._zod.def?.error?.(e))??or(t?.error?.(e))??or(r.customError?.(e))??or(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:a,...s}=e;return s.path??(s.path=[]),s.message=o,t?.reportInput&&(s.input=a),s}function cr(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function ur(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function _(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function un(...e){let[t,r,o]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:o}:{...t}}function wx(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function Zf(e){let t=atob(e),r=new Uint8Array(t.length);for(let o=0;o<t.length;o++)r[o]=t.charCodeAt(o);return r}function Gf(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function Rx(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return Zf(t+r)}function Tx(e){return Gf(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ex(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let r=new Uint8Array(t.length/2);for(let o=0;o<t.length;o+=2)r[o/2]=Number.parseInt(t.slice(o,o+2),16);return r}function Ox(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var Ff,Po,bs,yx,sr,ks,xs,Is,hs,S=y(()=>{Dt();Ff=Symbol("evaluating");Po="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};bs=cn(()=>{if(zt.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});yx=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},sr=new Set(["string","number","symbol"]),ks=new Set(["string","number","bigint","boolean","symbol","undefined"]);xs={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Is={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};hs=class{constructor(...t){}}});function dr(e,t=r=>r.message){let r={},o=[];for(let n of e.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n))):o.push(t(n));return{formErrors:o,fieldErrors:r}}function pr(e,t=r=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let a of n.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s},[...i,...a.path]));else if(a.code==="invalid_key")o({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")o({issues:a.issues},[...i,...a.path]);else{let s=[...i,...a.path];if(s.length===0)r._errors.push(t(a));else{let u=r,l=0;for(;l<s.length;){let d=s[l];l===s.length-1?(u[d]=u[d]||{_errors:[]},u[d]._errors.push(t(a))):u[d]=u[d]||{_errors:[]},u=u[d],l++}}}};return o(e),r}function Ps(e,t=r=>r.message){let r={errors:[]},o=(n,i=[])=>{var a,s;for(let u of n.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(l=>o({issues:l},[...i,...u.path]));else if(u.code==="invalid_key")o({issues:u.issues},[...i,...u.path]);else if(u.code==="invalid_element")o({issues:u.issues},[...i,...u.path]);else{let l=[...i,...u.path];if(l.length===0){r.errors.push(t(u));continue}let d=r,p=0;for(;p<l.length;){let f=l[p],v=p===l.length-1;typeof f=="string"?(d.properties??(d.properties={}),(a=d.properties)[f]??(a[f]={errors:[]}),d=d.properties[f]):(d.items??(d.items=[]),(s=d.items)[f]??(s[f]={errors:[]}),d=d.items[f]),v&&d.errors.push(t(u)),p++}}};return o(e),r}function Jf(e){let t=[],r=e.map(o=>typeof o=="object"?o.key:o);for(let o of r)typeof o=="number"?t.push(`[${o}]`):typeof o=="symbol"?t.push(`[${JSON.stringify(String(o))}]`):/[^\w$]/.test(o)?t.push(`[${JSON.stringify(o)}]`):(t.length&&t.push("."),t.push(o));return t.join("")}function ws(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)t.push(`\u2716 ${o.message}`),o.path?.length&&t.push(` \u2192 at ${Jf(o.path)}`);return t.join(`
|
|
3
3
|
`)}var Hf,lr,$e,Rs=y(()=>{Dt();S();Hf=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,sn,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},lr=m("$ZodError",Hf),$e=m("$ZodError",Hf,{Parent:Error})});var ln,wo,dn,Ro,pn,Ts,mn,Es,To,Cx,Eo,Nx,Oo,zx,Ao,Dx,Co,Ux,No,jx,zo,Lx,Do,Mx,Os=y(()=>{Dt();Rs();S();ln=e=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new Be;if(a.issues.length){let s=new(n?.Err??e)(a.issues.map(u=>ve(u,i,Y())));throw Po(s,n?.callee),s}return a.value},wo=ln($e),dn=e=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},a=t._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??e)(a.issues.map(u=>ve(u,i,Y())));throw Po(s,n?.callee),s}return a.value},Ro=dn($e),pn=e=>(t,r,o)=>{let n=o?{...o,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)throw new Be;return i.issues.length?{success:!1,error:new(e??lr)(i.issues.map(a=>ve(a,n,Y())))}:{success:!0,data:i.value}},Ts=pn($e),mn=e=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>ve(a,n,Y())))}:{success:!0,data:i.value}},Es=mn($e),To=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return ln(e)(t,r,n)},Cx=To($e),Eo=e=>(t,r,o)=>ln(e)(t,r,o),Nx=Eo($e),Oo=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return dn(e)(t,r,n)},zx=Oo($e),Ao=e=>async(t,r,o)=>dn(e)(t,r,o),Dx=Ao($e),Co=e=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return pn(e)(t,r,n)},Ux=Co($e),No=e=>(t,r,o)=>pn(e)(t,r,o),jx=No($e),zo=e=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return mn(e)(t,r,n)},Lx=zo($e),Do=e=>async(t,r,o)=>mn(e)(t,r,o),Mx=Do($e)});var Re={};we(Re,{base64:()=>Vs,base64url:()=>Uo,bigint:()=>ec,boolean:()=>nc,browserEmail:()=>Wx,cidrv4:()=>Hs,cidrv6:()=>Js,cuid:()=>As,cuid2:()=>Cs,date:()=>Ks,datetime:()=>Ys,domain:()=>Xx,duration:()=>js,e164:()=>qs,email:()=>Ms,emoji:()=>Bs,extendedDuration:()=>Bx,guid:()=>Ls,hex:()=>Yx,hostname:()=>Kx,html5Email:()=>Hx,httpProtocol:()=>Ws,idnEmail:()=>Vx,integer:()=>tc,ipv4:()=>Fs,ipv6:()=>Zs,ksuid:()=>Ds,lowercase:()=>ic,mac:()=>Gs,md5_base64:()=>eI,md5_base64url:()=>tI,md5_hex:()=>Qx,nanoid:()=>Us,null:()=>rc,number:()=>jo,rfc5322Email:()=>Jx,sha1_base64:()=>rI,sha1_base64url:()=>oI,sha1_hex:()=>nI,sha256_base64:()=>aI,sha256_base64url:()=>sI,sha256_hex:()=>iI,sha384_base64:()=>uI,sha384_base64url:()=>lI,sha384_hex:()=>cI,sha512_base64:()=>pI,sha512_base64url:()=>mI,sha512_hex:()=>dI,string:()=>Qs,time:()=>Xs,ulid:()=>Ns,undefined:()=>oc,unicodeEmail:()=>Vf,uppercase:()=>ac,uuid:()=>jt,uuid4:()=>Fx,uuid6:()=>Zx,uuid7:()=>Gx,xid:()=>zs});function Bs(){return new RegExp(qx,"u")}function qf(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Xs(e){return new RegExp(`^${qf(e)}$`)}function Ys(e){let t=qf({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${Wf}T(?:${o})$`)}function mr(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function fr(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var As,Cs,Ns,zs,Ds,Us,js,Bx,Ls,jt,Fx,Zx,Gx,Ms,Hx,Jx,Vf,Vx,Wx,qx,Fs,Zs,Gs,Hs,Js,Vs,Uo,Kx,Xx,Ws,qs,Wf,Ks,Qs,ec,tc,jo,nc,rc,oc,ic,ac,Yx,Qx,eI,tI,nI,rI,oI,iI,aI,sI,cI,uI,lI,dI,pI,mI,Lo=y(()=>{S();As=/^[cC][0-9a-z]{6,}$/,Cs=/^[0-9a-z]+$/,Ns=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,zs=/^[0-9a-vA-V]{20}$/,Ds=/^[A-Za-z0-9]{27}$/,Us=/^[a-zA-Z0-9_-]{21}$/,js=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Bx=/^[-+]?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)?)??$/,Ls=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,jt=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Fx=jt(4),Zx=jt(6),Gx=jt(7),Ms=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Hx=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Jx=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,Vf=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Vx=Vf,Wx=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,qx="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";Fs=/^(?:(?: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])$/,Zs=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Gs=e=>{let t=je(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},Hs=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Js=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Vs=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Uo=/^[A-Za-z0-9_-]*$/,Kx=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,Xx=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,Ws=/^https?$/,qs=/^\+[1-9]\d{6,14}$/,Wf="(?:(?:\\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])))",Ks=new RegExp(`^${Wf}$`);Qs=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},ec=/^-?\d+n?$/,tc=/^-?\d+$/,jo=/^-?\d+(?:\.\d+)?$/,nc=/^(?:true|false)$/i,rc=/^null$/i,oc=/^undefined$/i,ic=/^[^A-Z]*$/,ac=/^[^a-z]*$/,Yx=/^[0-9a-fA-F]*$/;Qx=/^[0-9a-fA-F]{32}$/,eI=mr(22,"=="),tI=fr(22),nI=/^[0-9a-fA-F]{40}$/,rI=mr(27,"="),oI=fr(27),iI=/^[0-9a-fA-F]{64}$/,aI=mr(43,"="),sI=fr(43),cI=/^[0-9a-fA-F]{96}$/,uI=mr(64,""),lI=fr(64),dI=/^[0-9a-fA-F]{128}$/,pI=mr(86,"=="),mI=fr(86)});function Kf(e,t,r){e.issues.length&&t.issues.push(...ke(r,e.issues))}var V,Xf,Mo,Bo,sc,cc,uc,lc,dc,pc,mc,fc,gc,fn,hc,vc,yc,bc,_c,kc,$c,xc,Ic,Fo=y(()=>{Dt();Lo();S();V=m("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Xf={number:"number",bigint:"bigint",object:"date"},Mo=m("$ZodCheckLessThan",(e,t)=>{V.init(e,t);let r=Xf[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value<=t.value:o.value<t.value)||o.issues.push({origin:r,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Bo=m("$ZodCheckGreaterThan",(e,t)=>{V.init(e,t);let r=Xf[typeof t.value];e._zod.onattach.push(o=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=o=>{(t.inclusive?o.value>=t.value:o.value>t.value)||o.issues.push({origin:r,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:o.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),sc=m("$ZodCheckMultipleOf",(e,t)=>{V.init(e,t),e._zod.onattach.push(r=>{var o;(o=r._zod.bag).multipleOf??(o.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%t.value===BigInt(0):vs(r.value,t.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),cc=m("$ZodCheckNumberFormat",(e,t)=>{V.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=xs[t.format];e._zod.onattach.push(a=>{let s=a._zod.bag;s.format=t.format,s.minimum=n,s.maximum=i,r&&(s.pattern=tc)}),e._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:o,inclusive:!0,continue:!t.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),s>i&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),uc=m("$ZodCheckBigIntFormat",(e,t)=>{V.init(e,t);let[r,o]=Is[t.format];e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,i.minimum=r,i.maximum=o}),e._zod.check=n=>{let i=n.value;i<r&&n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),i>o&&n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),lc=m("$ZodCheckMaxSize",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!gt(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;n.size<=t.maximum||o.issues.push({origin:cr(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),dc=m("$ZodCheckMinSize",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!gt(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;n.size>=t.minimum||o.issues.push({origin:cr(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),pc=m("$ZodCheckSizeEquals",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!gt(n)&&n.size!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.size,n.maximum=t.size,n.size=t.size}),e._zod.check=o=>{let n=o.value,i=n.size;if(i===t.size)return;let a=i>t.size;o.issues.push({origin:cr(n),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),mc=m("$ZodCheckMaxLength",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!gt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<n&&(o._zod.bag.maximum=t.maximum)}),e._zod.check=o=>{let n=o.value;if(n.length<=t.maximum)return;let a=ur(n);o.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),fc=m("$ZodCheckMinLength",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!gt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>n&&(o._zod.bag.minimum=t.minimum)}),e._zod.check=o=>{let n=o.value;if(n.length>=t.minimum)return;let a=ur(n);o.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),gc=m("$ZodCheckLengthEquals",(e,t)=>{var r;V.init(e,t),(r=e._zod.def).when??(r.when=o=>{let n=o.value;return!gt(n)&&n.length!==void 0}),e._zod.onattach.push(o=>{let n=o._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=o=>{let n=o.value,i=n.length;if(i===t.length)return;let a=ur(n),s=i>t.length;o.issues.push({origin:a,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),fn=m("$ZodCheckStringFormat",(e,t)=>{var r,o;V.init(e,t),e._zod.onattach.push(n=>{let i=n._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(o=e._zod).check??(o.check=()=>{})}),hc=m("$ZodCheckRegex",(e,t)=>{fn.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),vc=m("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ic),fn.init(e,t)}),yc=m("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=ac),fn.init(e,t)}),bc=m("$ZodCheckIncludes",(e,t)=>{V.init(e,t);let r=je(t.includes),o=new RegExp(typeof t.position=="number"?`^.{${t.position}}${r}`:r);t.pattern=o,e._zod.onattach.push(n=>{let i=n._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(o)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),_c=m("$ZodCheckStartsWith",(e,t)=>{V.init(e,t);let r=new RegExp(`^${je(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.startsWith(t.prefix)||o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),kc=m("$ZodCheckEndsWith",(e,t)=>{V.init(e,t);let r=new RegExp(`.*${je(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(o=>{let n=o._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),e._zod.check=o=>{o.value.endsWith(t.suffix)||o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});$c=m("$ZodCheckProperty",(e,t)=>{V.init(e,t),e._zod.check=r=>{let o=t.schema._zod.run({value:r.value[t.property],issues:[]},{});if(o instanceof Promise)return o.then(n=>Kf(n,r,t.property));Kf(o,r,t.property)}}),xc=m("$ZodCheckMimeType",(e,t)=>{V.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(o=>{o._zod.bag.mime=t.mime}),e._zod.check=o=>{r.has(o.value.type)||o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),Ic=m("$ZodCheckOverwrite",(e,t)=>{V.init(e,t),e._zod.check=r=>{r.value=t.tx(r.value)}})});var gr,Sc=y(()=>{gr=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let o=t.split(`
|
|
4
4
|
`).filter(a=>a),n=Math.min(...o.map(a=>a.length-a.trimStart().length)),i=o.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let t=Function,r=this?.args,n=[...(this?.content??[""]).map(i=>` ${i}`)];return new t(...r,n.join(`
|
|
5
5
|
`))}}});var Pc,wc=y(()=>{Pc={major:4,minor:4,patch:3}});function qc(e){if(e==="")return!0;if(/\s/.test(e)||e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function mg(e){if(!Uo.test(e))return!1;let t=e.replace(/[-_]/g,o=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return qc(r)}function fg(e,t=null){try{let r=e.split(".");if(r.length!==3)return!1;let[o]=r;if(!o)return!1;let n=JSON.parse(atob(o));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||t&&(!("alg"in n)||n.alg!==t))}catch{return!1}}function Qf(e,t,r){e.issues.length&&t.issues.push(...ke(r,e.issues)),t.value[r]=e.value}function Jo(e,t,r,o,n,i){let a=r in o;if(e.issues.length){if(n&&i&&!a)return;t.issues.push(...ke(r,e.issues))}if(!a&&!n){e.issues.length||t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}e.value===void 0?a&&(t.value[r]=void 0):t.value[r]=e.value}function gg(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${o}": expected a Zod schema`);let r=$s(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function hg(e,t,r,o,n,i){let a=[],s=n.keySet,u=n.catchall._zod,l=u.def.type,d=u.optin==="optional",p=u.optout==="optional";for(let f in t){if(f==="__proto__"||s.has(f))continue;if(l==="never"){a.push(f);continue}let v=u.run({value:t[f],issues:[]},o);v instanceof Promise?e.push(v.then(g=>Jo(g,r,f,t,d,p))):Jo(v,r,f,t,d,p)}return a.length&&r.issues.push({code:"unrecognized_keys",keys:a,input:t,inst:i}),e.length?Promise.all(e).then(()=>r):r}function eg(e,t,r,o){for(let i of e)if(i.issues.length===0)return t.value=i.value,t;let n=e.filter(i=>!yt(i));return n.length===1?(t.value=n[0].value,n[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>ve(a,o,Y())))}),t)}function tg(e,t,r,o){let n=e.filter(i=>i.issues.length===0);return n.length===1?(t.value=n[0].value,t):(n.length===0?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(i=>i.issues.map(a=>ve(a,o,Y())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t)}function Rc(e,t){if(e===t)return{valid:!0,data:e};if(e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(vt(e)&&vt(t)){let r=Object.keys(t),o=Object.keys(e).filter(i=>r.indexOf(i)!==-1),n={...e,...t};for(let i of o){let a=Rc(e[i],t[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};n[i]=a.data}return{valid:!0,data:n}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let o=0;o<e.length;o++){let n=e[o],i=t[o],a=Rc(n,i);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function ng(e,t,r){let o=new Map,n;for(let s of t.issues)if(s.code==="unrecognized_keys"){n??(n=s);for(let u of s.keys)o.has(u)||o.set(u,{}),o.get(u).l=!0}else e.issues.push(s);for(let s of r.issues)if(s.code==="unrecognized_keys")for(let u of s.keys)o.has(u)||o.set(u,{}),o.get(u).r=!0;else e.issues.push(s);let i=[...o].filter(([,s])=>s.l&&s.r).map(([s])=>s);if(i.length&&n&&e.issues.push({...n,keys:i}),yt(e))return e;let a=Rc(t.value,r.value);if(!a.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(a.mergeErrorPath)}`);return e.value=a.data,e}function rg(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function og(e,t,r){e.issues.length&&t.issues.push(...ke(r,e.issues)),t.value[r]=e.value}function ig(e,t,r,o,n){for(let i=0;i<r.length;i++){let a=e[i],s=i<o.length;if(a.issues.length){if(!s&&i>=n){t.value.length=i;break}t.issues.push(...ke(i,a.issues))}t.value[i]=a.value}for(let i=t.value.length-1;i>=o.length&&(r[i]._zod.optout==="optional"&&t.value[i]===void 0);i--)t.value.length=i;return t}function ag(e,t,r,o,n,i,a){e.issues.length&&(sr.has(typeof o)?r.issues.push(...ke(o,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map(s=>ve(s,a,Y()))})),t.issues.length&&(sr.has(typeof o)?r.issues.push(...ke(o,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map(s=>ve(s,a,Y()))})),r.value.set(e.value,t.value)}function sg(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}function cg(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}function ug(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}function lg(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}function Zo(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}function Go(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);return n instanceof Promise?n.then(i=>Ho(e,i,t.out,r)):Ho(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(i=>Ho(e,i,t.in,r)):Ho(e,n,t.in,r)}}function Ho(e,t,r,o){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},o)}function dg(e){return e.value=Object.freeze(e.value),e}function pg(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};o._zod.def.params&&(n.params=o._zod.def.params),t.issues.push(un(n))}}var T,Lt,H,Tc,Ec,Oc,Ac,Cc,Nc,zc,Dc,Uc,jc,Lc,Mc,Bc,Fc,Zc,Gc,Hc,Jc,Vc,Wc,Kc,Xc,Yc,Qc,eu,Vo,tu,hr,Wo,nu,ru,ou,iu,au,su,cu,uu,lu,du,vg,pu,vr,mu,fu,gu,qo,hu,vu,yu,bu,_u,ku,$u,Ko,xu,Iu,Su,Pu,wu,Ru,Tu,Eu,Xo,yr,Ou,Au,Cu,Nu,zu,Du,Uu,ju=y(()=>{Fo();Dt();Sc();Os();Lo();S();wc();S();T=m("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Pc;let o=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&o.unshift(e);for(let n of o)for(let i of n._zod.onattach)i(e);if(o.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let n=(a,s,u)=>{let l=yt(a),d;for(let p of s){if(p._zod.def.when){if(Ss(a)||!p._zod.def.when(a))continue}else if(l)continue;let f=a.issues.length,v=p._zod.check(a);if(v instanceof Promise&&u?.async===!1)throw new Be;if(d||v instanceof Promise)d=(d??Promise.resolve()).then(async()=>{await v,a.issues.length!==f&&(l||(l=yt(a,f)))});else{if(a.issues.length===f)continue;l||(l=yt(a,f))}}return d?d.then(()=>a):a},i=(a,s,u)=>{if(yt(a))return a.aborted=!0,a;let l=n(s,o,u);if(l instanceof Promise){if(u.async===!1)throw new Be;return l.then(d=>e._zod.parse(d,u))}return e._zod.parse(l,u)};e._zod.run=(a,s)=>{if(s.skipChecks)return e._zod.parse(a,s);if(s.direction==="backward"){let l=e._zod.parse({value:a.value,issues:[]},{...s,skipChecks:!0});return l instanceof Promise?l.then(d=>i(d,a,s)):i(l,a,s)}let u=e._zod.parse(a,s);if(u instanceof Promise){if(s.async===!1)throw new Be;return u.then(l=>n(l,o,s))}return n(u,o,s)}}A(e,"~standard",()=>({validate:n=>{try{let i=Ts(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Es(e,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}))}),Lt=m("$ZodString",(e,t)=>{T.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??Qs(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),H=m("$ZodStringFormat",(e,t)=>{fn.init(e,t),Lt.init(e,t)}),Tc=m("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=Ls),H.init(e,t)}),Ec=m("$ZodUUID",(e,t)=>{if(t.version){let o={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(o===void 0)throw new Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=jt(o))}else t.pattern??(t.pattern=jt());H.init(e,t)}),Oc=m("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=Ms),H.init(e,t)}),Ac=m("$ZodURL",(e,t)=>{H.init(e,t),e._zod.check=r=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===Ws.source&&!/^https?:\/\//i.test(o)){r.issues.push({code:"invalid_format",format:"url",note:"Invalid URL format",input:r.value,inst:e,continue:!t.abort});return}let n=new URL(o);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=n.href:r.value=o;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Cc=m("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=Bs()),H.init(e,t)}),Nc=m("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Us),H.init(e,t)}),zc=m("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=As),H.init(e,t)}),Dc=m("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Cs),H.init(e,t)}),Uc=m("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Ns),H.init(e,t)}),jc=m("$ZodXID",(e,t)=>{t.pattern??(t.pattern=zs),H.init(e,t)}),Lc=m("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Ds),H.init(e,t)}),Mc=m("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=Ys(t)),H.init(e,t)}),Bc=m("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=Ks),H.init(e,t)}),Fc=m("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=Xs(t)),H.init(e,t)}),Zc=m("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=js),H.init(e,t)}),Gc=m("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=Fs),H.init(e,t),e._zod.bag.format="ipv4"}),Hc=m("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=Zs),H.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),Jc=m("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=Gs(t.delimiter)),H.init(e,t),e._zod.bag.format="mac"}),Vc=m("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=Hs),H.init(e,t)}),Wc=m("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=Js),H.init(e,t),e._zod.check=r=>{let o=r.value.split("/");try{if(o.length!==2)throw new Error;let[n,i]=o;if(!i)throw new Error;let a=Number(i);if(`${a}`!==i)throw new Error;if(a<0||a>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});Kc=m("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=Vs),H.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{qc(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});Xc=m("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=Uo),H.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{mg(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),Yc=m("$ZodE164",(e,t)=>{t.pattern??(t.pattern=qs),H.init(e,t)});Qc=m("$ZodJWT",(e,t)=>{H.init(e,t),e._zod.check=r=>{fg(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),eu=m("$ZodCustomStringFormat",(e,t)=>{H.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),Vo=m("$ZodNumber",(e,t)=>{T.init(e,t),e._zod.pattern=e._zod.bag.pattern??jo,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let i=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),tu=m("$ZodNumberFormat",(e,t)=>{cc.init(e,t),Vo.init(e,t)}),hr=m("$ZodBoolean",(e,t)=>{T.init(e,t),e._zod.pattern=nc,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Wo=m("$ZodBigInt",(e,t)=>{T.init(e,t),e._zod.pattern=ec,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),nu=m("$ZodBigIntFormat",(e,t)=>{uc.init(e,t),Wo.init(e,t)}),ru=m("$ZodSymbol",(e,t)=>{T.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),ou=m("$ZodUndefined",(e,t)=>{T.init(e,t),e._zod.pattern=oc,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),iu=m("$ZodNull",(e,t)=>{T.init(e,t),e._zod.pattern=rc,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),au=m("$ZodAny",(e,t)=>{T.init(e,t),e._zod.parse=r=>r}),su=m("$ZodUnknown",(e,t)=>{T.init(e,t),e._zod.parse=r=>r}),cu=m("$ZodNever",(e,t)=>{T.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),uu=m("$ZodVoid",(e,t)=>{T.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),lu=m("$ZodDate",(e,t)=>{T.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,i=n instanceof Date;return i&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});du=m("$ZodArray",(e,t)=>{T.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:e}),r;r.value=Array(n.length);let i=[];for(let a=0;a<n.length;a++){let s=n[a],u=t.element._zod.run({value:s,issues:[]},o);u instanceof Promise?i.push(u.then(l=>Qf(l,r,a))):Qf(u,r,a)}return i.length?Promise.all(i).then(()=>r):r}});vg=m("$ZodObject",(e,t)=>{if(T.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let s=t.shape;Object.defineProperty(t,"shape",{get:()=>{let u={...s};return Object.defineProperty(t,"shape",{value:u}),u}})}let o=cn(()=>gg(t));A(e._zod,"propValues",()=>{let s=t.shape,u={};for(let l in s){let d=s[l]._zod;if(d.values){u[l]??(u[l]=new Set);for(let p of d.values)u[l].add(p)}}return u});let n=Ut,i=t.catchall,a;e._zod.parse=(s,u)=>{a??(a=o.value);let l=s.value;if(!n(l))return s.issues.push({expected:"object",code:"invalid_type",input:l,inst:e}),s;s.value={};let d=[],p=a.shape;for(let f of a.keys){let v=p[f],g=v._zod.optin==="optional",P=v._zod.optout==="optional",w=v._zod.run({value:l[f],issues:[]},u);w instanceof Promise?d.push(w.then(F=>Jo(F,s,f,l,g,P))):Jo(w,s,f,l,g,P)}return i?hg(d,l,s,u,o.value,e):d.length?Promise.all(d).then(()=>s):s}}),pu=m("$ZodObjectJIT",(e,t)=>{vg.init(e,t);let r=e._zod.parse,o=cn(()=>gg(t)),n=f=>{let v=new gr(["shape","payload","ctx"]),g=o.value,P=Z=>{let R=So(Z);return`shape[${R}]._zod.run({ value: input[${R}], issues: [] }, ctx)`};v.write("const input = payload.value;");let w=Object.create(null),F=0;for(let Z of g.keys)w[Z]=`key_${F++}`;v.write("const newResult = {};");for(let Z of g.keys){let R=w[Z],C=So(Z),B=f[Z],N=B?._zod?.optin==="optional",De=B?._zod?.optout==="optional";v.write(`const ${R} = ${P(Z)};`),N&&De?v.write(`
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{g as br}from"./react.mjs";import{r as ur}from"./readable-stream.mjs";import{r as Er}from"./lie.mjs";import{r as Ar}from"./setimmediate.mjs";import{r as wr}from"./pako.mjs";var V={},K={},E={},Re;function D(){if(Re)return E;if(Re=1,E.base64=!0,E.array=!0,E.string=!0,E.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",E.nodebuffer=typeof Buffer<"u",E.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")E.blob=!1;else{var o=new ArrayBuffer(0);try{E.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var s=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,a=new s;a.append(o),E.blob=a.getBlob("application/zip").size===0}catch{E.blob=!1}}}try{E.nodestream=!!ur().Readable}catch{E.nodestream=!1}return E}var j={},Oe;function fr(){if(Oe)return j;Oe=1;var o=S(),s=D(),a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";return j.encode=function(i){for(var l=[],f,u,m,v,y,g,n,e=0,r=i.length,t=r,c=o.getTypeOf(i)!=="string";e<i.length;)t=r-e,c?(f=i[e++],u=e<r?i[e++]:0,m=e<r?i[e++]:0):(f=i.charCodeAt(e++),u=e<r?i.charCodeAt(e++):0,m=e<r?i.charCodeAt(e++):0),v=f>>2,y=(f&3)<<4|u>>4,g=t>1?(u&15)<<2|m>>6:64,n=t>2?m&63:64,l.push(a.charAt(v)+a.charAt(y)+a.charAt(g)+a.charAt(n));return l.join("")},j.decode=function(i){var l,f,u,m,v,y,g,n=0,e=0,r="data:";if(i.substr(0,r.length)===r)throw new Error("Invalid base64 input, it looks like a data url.");i=i.replace(/[^A-Za-z0-9+/=]/g,"");var t=i.length*3/4;if(i.charAt(i.length-1)===a.charAt(64)&&t--,i.charAt(i.length-2)===a.charAt(64)&&t--,t%1!==0)throw new Error("Invalid base64 input, bad content length.");var c;for(s.uint8array?c=new Uint8Array(t|0):c=new Array(t|0);n<i.length;)m=a.indexOf(i.charAt(n++)),v=a.indexOf(i.charAt(n++)),y=a.indexOf(i.charAt(n++)),g=a.indexOf(i.charAt(n++)),l=m<<2|v>>4,f=(v&15)<<4|y>>2,u=(y&3)<<6|g,c[e++]=l,y!==64&&(c[e++]=f),g!==64&&(c[e++]=u);return c},j}var J,Ie;function M(){return Ie||(Ie=1,J={isNode:typeof Buffer<"u",newBufferFrom:function(o,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(o,s);if(typeof o=="number")throw new Error('The "data" argument must not be a number');return new Buffer(o,s)},allocBuffer:function(o){if(Buffer.alloc)return Buffer.alloc(o);var s=new Buffer(o);return s.fill(0),s},isBuffer:function(o){return Buffer.isBuffer(o)},isStream:function(o){return o&&typeof o.on=="function"&&typeof o.pause=="function"&&typeof o.resume=="function"}}),J}var Q,Fe;function L(){if(Fe)return Q;Fe=1;var o=null;return typeof Promise<"u"?o=Promise:o=Er(),Q={Promise:o},Q}var Te;function S(){return Te||(Te=1,(function(o){var s=D(),a=fr(),i=M(),l=L();Ar();function f(e){var r=null;return s.uint8array?r=new Uint8Array(e.length):r=new Array(e.length),m(e,r)}o.newBlob=function(e,r){o.checkSupport("blob");try{return new Blob([e],{type:r})}catch{try{var t=self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder,c=new t;return c.append(e),c.getBlob(r)}catch{throw new Error("Bug : can't construct the Blob.")}}};function u(e){return e}function m(e,r){for(var t=0;t<e.length;++t)r[t]=e.charCodeAt(t)&255;return r}var v={stringifyByChunk:function(e,r,t){var c=[],h=0,d=e.length;if(d<=t)return String.fromCharCode.apply(null,e);for(;h<d;)r==="array"||r==="nodebuffer"?c.push(String.fromCharCode.apply(null,e.slice(h,Math.min(h+t,d)))):c.push(String.fromCharCode.apply(null,e.subarray(h,Math.min(h+t,d)))),h+=t;return c.join("")},stringifyByChar:function(e){for(var r="",t=0;t<e.length;t++)r+=String.fromCharCode(e[t]);return r},applyCanBeUsed:{uint8array:(function(){try{return s.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return s.nodebuffer&&String.fromCharCode.apply(null,i.allocBuffer(1)).length===1}catch{return!1}})()}};function y(e){var r=65536,t=o.getTypeOf(e),c=!0;if(t==="uint8array"?c=v.applyCanBeUsed.uint8array:t==="nodebuffer"&&(c=v.applyCanBeUsed.nodebuffer),c)for(;r>1;)try{return v.stringifyByChunk(e,t,r)}catch{r=Math.floor(r/2)}return v.stringifyByChar(e)}o.applyFromCharCode=y;function g(e,r){for(var t=0;t<e.length;t++)r[t]=e[t];return r}var n={};n.string={string:u,array:function(e){return m(e,new Array(e.length))},arraybuffer:function(e){return n.string.uint8array(e).buffer},uint8array:function(e){return m(e,new Uint8Array(e.length))},nodebuffer:function(e){return m(e,i.allocBuffer(e.length))}},n.array={string:y,array:u,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return i.newBufferFrom(e)}},n.arraybuffer={string:function(e){return y(new Uint8Array(e))},array:function(e){return g(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:u,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return i.newBufferFrom(new Uint8Array(e))}},n.uint8array={string:y,array:function(e){return g(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:u,nodebuffer:function(e){return i.newBufferFrom(e)}},n.nodebuffer={string:y,array:function(e){return g(e,new Array(e.length))},arraybuffer:function(e){return n.nodebuffer.uint8array(e).buffer},uint8array:function(e){return g(e,new Uint8Array(e.length))},nodebuffer:u},o.transformTo=function(e,r){if(r||(r=""),!e)return r;o.checkSupport(e);var t=o.getTypeOf(r),c=n[t][e](r);return c},o.resolve=function(e){for(var r=e.split("/"),t=[],c=0;c<r.length;c++){var h=r[c];h==="."||h===""&&c!==0&&c!==r.length-1||(h===".."?t.pop():t.push(h))}return t.join("/")},o.getTypeOf=function(e){if(typeof e=="string")return"string";if(Object.prototype.toString.call(e)==="[object Array]")return"array";if(s.nodebuffer&&i.isBuffer(e))return"nodebuffer";if(s.uint8array&&e instanceof Uint8Array)return"uint8array";if(s.arraybuffer&&e instanceof ArrayBuffer)return"arraybuffer"},o.checkSupport=function(e){var r=s[e.toLowerCase()];if(!r)throw new Error(e+" is not supported by this platform")},o.MAX_VALUE_16BITS=65535,o.MAX_VALUE_32BITS=-1,o.pretty=function(e){var r="",t,c;for(c=0;c<(e||"").length;c++)t=e.charCodeAt(c),r+="\\x"+(t<16?"0":"")+t.toString(16).toUpperCase();return r},o.delay=function(e,r,t){setImmediate(function(){e.apply(t||null,r||[])})},o.inherits=function(e,r){var t=function(){};t.prototype=r.prototype,e.prototype=new t},o.extend=function(){var e={},r,t;for(r=0;r<arguments.length;r++)for(t in arguments[r])Object.prototype.hasOwnProperty.call(arguments[r],t)&&typeof e[t]>"u"&&(e[t]=arguments[r][t]);return e},o.prepareContent=function(e,r,t,c,h){var d=l.Promise.resolve(r).then(function(p){var C=s.blob&&(p instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(p))!==-1);return C&&typeof FileReader<"u"?new l.Promise(function(b,x){var k=new FileReader;k.onload=function(I){b(I.target.result)},k.onerror=function(I){x(I.target.error)},k.readAsArrayBuffer(p)}):p});return d.then(function(p){var C=o.getTypeOf(p);return C?(C==="arraybuffer"?p=o.transformTo("uint8array",p):C==="string"&&(h?p=a.decode(p):t&&c!==!0&&(p=f(p))),p):l.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}})(K)),K}var $,De;function _(){if(De)return $;De=1;function o(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}return o.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return this.isFinished?!1:(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,a){return this._listeners[s].push(a),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,a){if(this._listeners[s])for(var i=0;i<this._listeners[s].length;i++)this._listeners[s][i].call(this,a)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var a=this;return s.on("data",function(i){a.processChunk(i)}),s.on("end",function(){a.end()}),s.on("error",function(i){a.error(i)}),this},pause:function(){return this.isPaused||this.isFinished?!1:(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;this.isPaused=!1;var s=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,a){return this.extraStreamInfo[s]=a,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},$=o,$}var Be;function N(){return Be||(Be=1,(function(o){for(var s=S(),a=D(),i=M(),l=_(),f=new Array(256),u=0;u<256;u++)f[u]=u>=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;f[254]=f[254]=1;var m=function(e){var r,t,c,h,d,p=e.length,C=0;for(h=0;h<p;h++)t=e.charCodeAt(h),(t&64512)===55296&&h+1<p&&(c=e.charCodeAt(h+1),(c&64512)===56320&&(t=65536+(t-55296<<10)+(c-56320),h++)),C+=t<128?1:t<2048?2:t<65536?3:4;for(a.uint8array?r=new Uint8Array(C):r=new Array(C),d=0,h=0;d<C;h++)t=e.charCodeAt(h),(t&64512)===55296&&h+1<p&&(c=e.charCodeAt(h+1),(c&64512)===56320&&(t=65536+(t-55296<<10)+(c-56320),h++)),t<128?r[d++]=t:t<2048?(r[d++]=192|t>>>6,r[d++]=128|t&63):t<65536?(r[d++]=224|t>>>12,r[d++]=128|t>>>6&63,r[d++]=128|t&63):(r[d++]=240|t>>>18,r[d++]=128|t>>>12&63,r[d++]=128|t>>>6&63,r[d++]=128|t&63);return r},v=function(e,r){var t;for(r=r||e.length,r>e.length&&(r=e.length),t=r-1;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?r:t+f[e[t]]>r?t:r},y=function(e){var r,t,c,h,d=e.length,p=new Array(d*2);for(t=0,r=0;r<d;){if(c=e[r++],c<128){p[t++]=c;continue}if(h=f[c],h>4){p[t++]=65533,r+=h-1;continue}for(c&=h===2?31:h===3?15:7;h>1&&r<d;)c=c<<6|e[r++]&63,h--;if(h>1){p[t++]=65533;continue}c<65536?p[t++]=c:(c-=65536,p[t++]=55296|c>>10&1023,p[t++]=56320|c&1023)}return p.length!==t&&(p.subarray?p=p.subarray(0,t):p.length=t),s.applyFromCharCode(p)};o.utf8encode=function(r){return a.nodebuffer?i.newBufferFrom(r,"utf-8"):m(r)},o.utf8decode=function(r){return a.nodebuffer?s.transformTo("nodebuffer",r).toString("utf-8"):(r=s.transformTo(a.uint8array?"uint8array":"array",r),y(r))};function g(){l.call(this,"utf-8 decode"),this.leftOver=null}s.inherits(g,l),g.prototype.processChunk=function(e){var r=s.transformTo(a.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(a.uint8array){var t=r;r=new Uint8Array(t.length+this.leftOver.length),r.set(this.leftOver,0),r.set(t,this.leftOver.length)}else r=this.leftOver.concat(r);this.leftOver=null}var c=v(r),h=r;c!==r.length&&(a.uint8array?(h=r.subarray(0,c),this.leftOver=r.subarray(c,r.length)):(h=r.slice(0,c),this.leftOver=r.slice(c,r.length))),this.push({data:o.utf8decode(h),meta:e.meta})},g.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:o.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},o.Utf8DecodeWorker=g;function n(){l.call(this,"utf-8 encode")}s.inherits(n,l),n.prototype.processChunk=function(e){this.push({data:o.utf8encode(e.data),meta:e.meta})},o.Utf8EncodeWorker=n})(V)),V}var ee,Pe;function _r(){if(Pe)return ee;Pe=1;var o=_(),s=S();function a(i){o.call(this,"ConvertWorker to "+i),this.destType=i}return s.inherits(a,o),a.prototype.processChunk=function(i){this.push({data:s.transformTo(this.destType,i.data),meta:i.meta})},ee=a,ee}var re,ze;function kr(){if(ze)return re;ze=1;var o=ur().Readable,s=S();s.inherits(a,o);function a(i,l,f){o.call(this,l),this._helper=i;var u=this;i.on("data",function(m,v){u.push(m)||u._helper.pause(),f&&f(v)}).on("error",function(m){u.emit("error",m)}).on("end",function(){u.push(null)})}return a.prototype._read=function(){this._helper.resume()},re=a,re}var te,Ue;function hr(){if(Ue)return te;Ue=1;var o=S(),s=_r(),a=_(),i=fr(),l=D(),f=L(),u=null;if(l.nodestream)try{u=kr()}catch{}function m(n,e,r){switch(n){case"blob":return o.newBlob(o.transformTo("arraybuffer",e),r);case"base64":return i.encode(e);default:return o.transformTo(n,e)}}function v(n,e){var r,t=0,c=null,h=0;for(r=0;r<e.length;r++)h+=e[r].length;switch(n){case"string":return e.join("");case"array":return Array.prototype.concat.apply([],e);case"uint8array":for(c=new Uint8Array(h),r=0;r<e.length;r++)c.set(e[r],t),t+=e[r].length;return c;case"nodebuffer":return Buffer.concat(e);default:throw new Error("concat : unsupported type '"+n+"'")}}function y(n,e){return new f.Promise(function(r,t){var c=[],h=n._internalType,d=n._outputType,p=n._mimeType;n.on("data",function(C,b){c.push(C),e&&e(b)}).on("error",function(C){c=[],t(C)}).on("end",function(){try{var C=m(d,v(h,c),p);r(C)}catch(b){t(b)}c=[]}).resume()})}function g(n,e,r){var t=e;switch(e){case"blob":case"arraybuffer":t="uint8array";break;case"base64":t="string";break}try{this._internalType=t,this._outputType=e,this._mimeType=r,o.checkSupport(t),this._worker=n.pipe(new s(t)),n.lock()}catch(c){this._worker=new a("error"),this._worker.error(c)}}return g.prototype={accumulate:function(n){return y(this,n)},on:function(n,e){var r=this;return n==="data"?this._worker.on(n,function(t){e.call(r,t.data,t.meta)}):this._worker.on(n,function(){o.delay(e,arguments,r)}),this},resume:function(){return o.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(n){if(o.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new u(this,{objectMode:this._outputType!=="nodebuffer"},n)}},te=g,te}var w={},Le;function cr(){return Le||(Le=1,w.base64=!1,w.binary=!1,w.dir=!1,w.createFolders=!0,w.date=null,w.compression=null,w.compressionOptions=null,w.comment=null,w.unixPermissions=null,w.dosPermissions=null),w}var ie,Ne;function lr(){if(Ne)return ie;Ne=1;var o=S(),s=_(),a=16*1024;function i(l){s.call(this,"DataWorker");var f=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,l.then(function(u){f.dataIsReady=!0,f.data=u,f.max=u&&u.length||0,f.type=o.getTypeOf(u),f.isPaused||f._tickAndRepeat()},function(u){f.error(u)})}return o.inherits(i,s),i.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},i.prototype.resume=function(){return s.prototype.resume.call(this)?(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0):!1},i.prototype._tickAndRepeat=function(){this._tickScheduled=!1,!(this.isPaused||this.isFinished)&&(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},i.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var l=a,f=null,u=Math.min(this.max,this.index+l);if(this.index>=this.max)return this.end();switch(this.type){case"string":f=this.data.substring(this.index,u);break;case"uint8array":f=this.data.subarray(this.index,u);break;case"array":case"nodebuffer":f=this.data.slice(this.index,u);break}return this.index=u,this.push({data:f,meta:{percent:this.max?this.index/this.max*100:0}})},ie=i,ie}var ne,We;function Ee(){if(We)return ne;We=1;var o=S();function s(){for(var f,u=[],m=0;m<256;m++){f=m;for(var v=0;v<8;v++)f=f&1?3988292384^f>>>1:f>>>1;u[m]=f}return u}var a=s();function i(f,u,m,v){var y=a,g=v+m;f=f^-1;for(var n=v;n<g;n++)f=f>>>8^y[(f^u[n])&255];return f^-1}function l(f,u,m,v){var y=a,g=v+m;f=f^-1;for(var n=v;n<g;n++)f=f>>>8^y[(f^u.charCodeAt(n))&255];return f^-1}return ne=function(u,m){if(typeof u>"u"||!u.length)return 0;var v=o.getTypeOf(u)!=="string";return v?i(m|0,u,u.length,0):l(m|0,u,u.length,0)},ne}var se,qe;function dr(){if(qe)return se;qe=1;var o=_(),s=Ee(),a=S();function i(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}return a.inherits(i,o),i.prototype.processChunk=function(l){this.streamInfo.crc32=s(l.data,this.streamInfo.crc32||0),this.push(l)},se=i,se}var ae,je;function Rr(){if(je)return ae;je=1;var o=S(),s=_();function a(i){s.call(this,"DataLengthProbe for "+i),this.propName=i,this.withStreamInfo(i,0)}return o.inherits(a,s),a.prototype.processChunk=function(i){if(i){var l=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=l+i.data.length}s.prototype.processChunk.call(this,i)},ae=a,ae}var oe,Ze;function Ae(){if(Ze)return oe;Ze=1;var o=L(),s=lr(),a=dr(),i=Rr();function l(f,u,m,v,y){this.compressedSize=f,this.uncompressedSize=u,this.crc32=m,this.compression=v,this.compressedContent=y}return l.prototype={getContentWorker:function(){var f=new s(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new i("data_length")),u=this;return f.on("end",function(){if(this.streamInfo.data_length!==u.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),f},getCompressedWorker:function(){return new s(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},l.createWorkerFrom=function(f,u,m){return f.pipe(new a).pipe(new i("uncompressedSize")).pipe(u.compressWorker(m)).pipe(new i("compressedSize")).withStreamInfo("compression",u)},oe=l,oe}var ue,Me;function Or(){if(Me)return ue;Me=1;var o=hr(),s=lr(),a=N(),i=Ae(),l=_(),f=function(y,g,n){this.name=y,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=g,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}};f.prototype={internalStream:function(y){var g=null,n="string";try{if(!y)throw new Error("No output type specified.");n=y.toLowerCase();var e=n==="string"||n==="text";(n==="binarystring"||n==="text")&&(n="string"),g=this._decompressWorker();var r=!this._dataBinary;r&&!e&&(g=g.pipe(new a.Utf8EncodeWorker)),!r&&e&&(g=g.pipe(new a.Utf8DecodeWorker))}catch(t){g=new l("error"),g.error(t)}return new o(g,n,"")},async:function(y,g){return this.internalStream(y).accumulate(g)},nodeStream:function(y,g){return this.internalStream(y||"nodebuffer").toNodejsStream(g)},_compressWorker:function(y,g){if(this._data instanceof i&&this._data.compression.magic===y.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new a.Utf8EncodeWorker)),i.createWorkerFrom(n,y,g)},_decompressWorker:function(){return this._data instanceof i?this._data.getContentWorker():this._data instanceof l?this._data:new s(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],m=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},v=0;v<u.length;v++)f.prototype[u[v]]=m;return ue=f,ue}var fe={},Z={},U={},He;function Ir(){if(He)return U;He=1;var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=wr(),a=S(),i=_(),l=o?"uint8array":"array";U.magic="\b\0";function f(u,m){i.call(this,"FlateWorker/"+u),this._pako=null,this._pakoAction=u,this._pakoOptions=m,this.meta={}}return a.inherits(f,i),f.prototype.processChunk=function(u){this.meta=u.meta,this._pako===null&&this._createPako(),this._pako.push(a.transformTo(l,u.data),!1)},f.prototype.flush=function(){i.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},f.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this._pako=null},f.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var u=this;this._pako.onData=function(m){u.push({data:m,meta:u.meta})}},U.compressWorker=function(u){return new f("Deflate",u)},U.uncompressWorker=function(){return new f("Inflate",{})},U}var Ge;function pr(){if(Ge)return Z;Ge=1;var o=_();return Z.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},Z.DEFLATE=Ir(),Z}var T={},Ye;function mr(){return Ye||(Ye=1,T.LOCAL_FILE_HEADER="PK",T.CENTRAL_FILE_HEADER="PK",T.CENTRAL_DIRECTORY_END="PK",T.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",T.ZIP64_CENTRAL_DIRECTORY_END="PK",T.DATA_DESCRIPTOR="PK\x07\b"),T}var he,Xe;function Fr(){if(Xe)return he;Xe=1;var o=S(),s=_(),a=N(),i=Ee(),l=mr(),f=function(e,r){var t="",c;for(c=0;c<r;c++)t+=String.fromCharCode(e&255),e=e>>>8;return t},u=function(e,r){var t=e;return e||(t=r?16893:33204),(t&65535)<<16},m=function(e){return(e||0)&63},v=function(e,r,t,c,h,d){var p=e.file,C=e.compression,b=d!==a.utf8encode,x=o.transformTo("string",d(p.name)),k=o.transformTo("string",a.utf8encode(p.name)),I=p.comment,F=o.transformTo("string",d(I)),W=o.transformTo("string",a.utf8encode(I)),we=k.length!==p.name.length,_e=W.length!==I.length,R,O,z="",H="",G="",ke=p.dir,B=p.date,P={crc32:0,compressedSize:0,uncompressedSize:0};(!r||t)&&(P.crc32=e.crc32,P.compressedSize=e.compressedSize,P.uncompressedSize=e.uncompressedSize);var Y=0;r&&(Y|=8),!b&&(we||_e)&&(Y|=2048);var q=0,X=0;ke&&(q|=16),h==="UNIX"?(X=798,q|=u(p.unixPermissions,ke)):(X=20,q|=m(p.dosPermissions)),R=B.getUTCHours(),R=R<<6,R=R|B.getUTCMinutes(),R=R<<5,R=R|B.getUTCSeconds()/2,O=B.getUTCFullYear()-1980,O=O<<4,O=O|B.getUTCMonth()+1,O=O<<5,O=O|B.getUTCDate(),we&&(H=f(1,1)+f(i(x),4)+k,z+="up"+f(H.length,2)+H),_e&&(G=f(1,1)+f(i(F),4)+W,z+="uc"+f(G.length,2)+G);var A="";A+=`
|
|
2
|
-
\0`,A+=f(Y,2),A+=C.magic,A+=f(R,2),A+=f(O,2),A+=f(P.crc32,4),A+=f(P.compressedSize,4),A+=f(P.uncompressedSize,4),A+=f(x.length,2),A+=f(z.length,2);var Cr=l.LOCAL_FILE_HEADER+A+x+z,Sr=l.CENTRAL_FILE_HEADER+f(X,2)+A+f(F.length,2)+"\0\0\0\0"+f(q,4)+f(c,4)+x+z+F;return{fileRecord:Cr,dirRecord:Sr}},y=function(e,r,t,c,h){var d="",p=o.transformTo("string",h(c));return d=l.CENTRAL_DIRECTORY_END+"\0\0\0\0"+f(e,2)+f(e,2)+f(r,4)+f(t,4)+f(p.length,2)+p,d},g=function(e){var r="";return r=l.DATA_DESCRIPTOR+f(e.crc32,4)+f(e.compressedSize,4)+f(e.uncompressedSize,4),r};function n(e,r,t,c){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=r,this.zipPlatform=t,this.encodeFileName=c,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}return o.inherits(n,s),n.prototype.push=function(e){var r=e.meta.percent||0,t=this.entriesCount,c=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,s.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:t?(r+100*(t-c-1))/t:100}}))},n.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var r=this.streamFiles&&!e.file.dir;if(r){var t=v(e,r,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:t.fileRecord,meta:{percent:0}})}else this.accumulate=!0},n.prototype.closedSource=function(e){this.accumulate=!1;var r=this.streamFiles&&!e.file.dir,t=v(e,r,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(t.dirRecord),r)this.push({data:g(e),meta:{percent:100}});else for(this.push({data:t.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},n.prototype.flush=function(){for(var e=this.bytesWritten,r=0;r<this.dirRecords.length;r++)this.push({data:this.dirRecords[r],meta:{percent:100}});var t=this.bytesWritten-e,c=y(this.dirRecords.length,t,e,this.zipComment,this.encodeFileName);this.push({data:c,meta:{percent:100}})},n.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},n.prototype.registerPrevious=function(e){this._sources.push(e);var r=this;return e.on("data",function(t){r.processChunk(t)}),e.on("end",function(){r.closedSource(r.previous.streamInfo),r._sources.length?r.prepareNextSource():r.end()}),e.on("error",function(t){r.error(t)}),this},n.prototype.resume=function(){if(!s.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0},n.prototype.error=function(e){var r=this._sources;if(!s.prototype.error.call(this,e))return!1;for(var t=0;t<r.length;t++)try{r[t].error(e)}catch{}return!0},n.prototype.lock=function(){s.prototype.lock.call(this);for(var e=this._sources,r=0;r<e.length;r++)e[r].lock()},he=n,he}var Ve;function Tr(){if(Ve)return fe;Ve=1;var o=pr(),s=Fr(),a=function(i,l){var f=i||l,u=o[f];if(!u)throw new Error(f+" is not a valid compression method !");return u};return fe.generateWorker=function(i,l,f){var u=new s(l.streamFiles,f,l.platform,l.encodeFileName),m=0;try{i.forEach(function(v,y){m++;var g=a(y.options.compression,l.compression),n=y.options.compressionOptions||l.compressionOptions||{},e=y.dir,r=y.date;y._compressWorker(g,n).withStreamInfo("file",{name:v,dir:e,date:r,comment:y.comment||"",unixPermissions:y.unixPermissions,dosPermissions:y.dosPermissions}).pipe(u)}),u.entriesCount=m}catch(v){u.error(v)}return u},fe}var ce,Ke;function Dr(){if(Ke)return ce;Ke=1;var o=S(),s=_();function a(i,l){s.call(this,"Nodejs stream input adapter for "+i),this._upstreamEnded=!1,this._bindStream(l)}return o.inherits(a,s),a.prototype._bindStream=function(i){var l=this;this._stream=i,i.pause(),i.on("data",function(f){l.push({data:f,meta:{percent:0}})}).on("error",function(f){l.isPaused?this.generatedError=f:l.error(f)}).on("end",function(){l.isPaused?l._upstreamEnded=!0:l.end()})},a.prototype.pause=function(){return s.prototype.pause.call(this)?(this._stream.pause(),!0):!1},a.prototype.resume=function(){return s.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1},ce=a,ce}var le,Je;function Br(){if(Je)return le;Je=1;var o=N(),s=S(),a=_(),i=hr(),l=cr(),f=Ae(),u=Or(),m=Tr(),v=M(),y=Dr(),g=function(h,d,p){var C=s.getTypeOf(d),b,x=s.extend(p||{},l);x.date=x.date||new Date,x.compression!==null&&(x.compression=x.compression.toUpperCase()),typeof x.unixPermissions=="string"&&(x.unixPermissions=parseInt(x.unixPermissions,8)),x.unixPermissions&&x.unixPermissions&16384&&(x.dir=!0),x.dosPermissions&&x.dosPermissions&16&&(x.dir=!0),x.dir&&(h=e(h)),x.createFolders&&(b=n(h))&&r.call(this,b,!0);var k=C==="string"&&x.binary===!1&&x.base64===!1;(!p||typeof p.binary>"u")&&(x.binary=!k);var I=d instanceof f&&d.uncompressedSize===0;(I||x.dir||!d||d.length===0)&&(x.base64=!1,x.binary=!0,d="",x.compression="STORE",C="string");var F=null;d instanceof f||d instanceof a?F=d:v.isNode&&v.isStream(d)?F=new y(h,d):F=s.prepareContent(h,d,x.binary,x.optimizedBinaryString,x.base64);var W=new u(h,F,x);this.files[h]=W},n=function(h){h.slice(-1)==="/"&&(h=h.substring(0,h.length-1));var d=h.lastIndexOf("/");return d>0?h.substring(0,d):""},e=function(h){return h.slice(-1)!=="/"&&(h+="/"),h},r=function(h,d){return d=typeof d<"u"?d:l.createFolders,h=e(h),this.files[h]||g.call(this,h,null,{dir:!0,createFolders:d}),this.files[h]};function t(h){return Object.prototype.toString.call(h)==="[object RegExp]"}var c={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(h){var d,p,C;for(d in this.files)C=this.files[d],p=d.slice(this.root.length,d.length),p&&d.slice(0,this.root.length)===this.root&&h(p,C)},filter:function(h){var d=[];return this.forEach(function(p,C){h(p,C)&&d.push(C)}),d},file:function(h,d,p){if(arguments.length===1)if(t(h)){var C=h;return this.filter(function(x,k){return!k.dir&&C.test(x)})}else{var b=this.files[this.root+h];return b&&!b.dir?b:null}else h=this.root+h,g.call(this,h,d,p);return this},folder:function(h){if(!h)return this;if(t(h))return this.filter(function(b,x){return x.dir&&h.test(b)});var d=this.root+h,p=r.call(this,d),C=this.clone();return C.root=p.name,C},remove:function(h){h=this.root+h;var d=this.files[h];if(d||(h.slice(-1)!=="/"&&(h+="/"),d=this.files[h]),d&&!d.dir)delete this.files[h];else for(var p=this.filter(function(b,x){return x.name.slice(0,h.length)===h}),C=0;C<p.length;C++)delete this.files[p[C].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(h){var d,p={};try{if(p=s.extend(h||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:o.utf8encode}),p.type=p.type.toLowerCase(),p.compression=p.compression.toUpperCase(),p.type==="binarystring"&&(p.type="string"),!p.type)throw new Error("No output type specified.");s.checkSupport(p.type),(p.platform==="darwin"||p.platform==="freebsd"||p.platform==="linux"||p.platform==="sunos")&&(p.platform="UNIX"),p.platform==="win32"&&(p.platform="DOS");var C=p.comment||this.comment||"";d=m.generateWorker(this,p,C)}catch(b){d=new a("error"),d.error(b)}return new i(d,p.type||"string",p.mimeType)},generateAsync:function(h,d){return this.generateInternalStream(h).accumulate(d)},generateNodeStream:function(h,d){return h=h||{},h.type||(h.type="nodebuffer"),this.generateInternalStream(h).toNodejsStream(d)}};return le=c,le}var de,Qe;function vr(){if(Qe)return de;Qe=1;var o=S();function s(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}return s.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var i=0,l;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)i=(i<<8)+this.byteAt(l);return this.index+=a,i},readString:function(a){return o.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(a&31)<<1))}},de=s,de}var pe,$e;function yr(){if($e)return pe;$e=1;var o=vr(),s=S();function a(i){o.call(this,i);for(var l=0;l<this.data.length;l++)i[l]=i[l]&255}return s.inherits(a,o),a.prototype.byteAt=function(i){return this.data[this.zero+i]},a.prototype.lastIndexOfSignature=function(i){for(var l=i.charCodeAt(0),f=i.charCodeAt(1),u=i.charCodeAt(2),m=i.charCodeAt(3),v=this.length-4;v>=0;--v)if(this.data[v]===l&&this.data[v+1]===f&&this.data[v+2]===u&&this.data[v+3]===m)return v-this.zero;return-1},a.prototype.readAndCheckSignature=function(i){var l=i.charCodeAt(0),f=i.charCodeAt(1),u=i.charCodeAt(2),m=i.charCodeAt(3),v=this.readData(4);return l===v[0]&&f===v[1]&&u===v[2]&&m===v[3]},a.prototype.readData=function(i){if(this.checkOffset(i),i===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+i);return this.index+=i,l},pe=a,pe}var me,er;function Pr(){if(er)return me;er=1;var o=vr(),s=S();function a(i){o.call(this,i)}return s.inherits(a,o),a.prototype.byteAt=function(i){return this.data.charCodeAt(this.zero+i)},a.prototype.lastIndexOfSignature=function(i){return this.data.lastIndexOf(i)-this.zero},a.prototype.readAndCheckSignature=function(i){var l=this.readData(4);return i===l},a.prototype.readData=function(i){this.checkOffset(i);var l=this.data.slice(this.zero+this.index,this.zero+this.index+i);return this.index+=i,l},me=a,me}var ve,rr;function gr(){if(rr)return ve;rr=1;var o=yr(),s=S();function a(i){o.call(this,i)}return s.inherits(a,o),a.prototype.readData=function(i){if(this.checkOffset(i),i===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+i);return this.index+=i,l},ve=a,ve}var ye,tr;function zr(){if(tr)return ye;tr=1;var o=gr(),s=S();function a(i){o.call(this,i)}return s.inherits(a,o),a.prototype.readData=function(i){this.checkOffset(i);var l=this.data.slice(this.zero+this.index,this.zero+this.index+i);return this.index+=i,l},ye=a,ye}var ge,ir;function xr(){if(ir)return ge;ir=1;var o=S(),s=D(),a=yr(),i=Pr(),l=zr(),f=gr();return ge=function(u){var m=o.getTypeOf(u);return o.checkSupport(m),m==="string"&&!s.uint8array?new i(u):m==="nodebuffer"?new l(u):s.uint8array?new f(o.transformTo("uint8array",u)):new a(o.transformTo("array",u))},ge}var xe,nr;function Ur(){if(nr)return xe;nr=1;var o=xr(),s=S(),a=Ae(),i=Ee(),l=N(),f=pr(),u=D(),m=0,v=3,y=function(n){for(var e in f)if(Object.prototype.hasOwnProperty.call(f,e)&&f[e].magic===n)return f[e];return null};function g(n,e){this.options=n,this.loadOptions=e}return g.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function(n){var e,r;if(n.skip(22),this.fileNameLength=n.readInt(2),r=n.readInt(2),this.fileName=n.readData(this.fileNameLength),n.skip(r),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(e=y(this.compressionMethod),e===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,e,n.readData(this.compressedSize))},readCentralPart:function(n){this.versionMadeBy=n.readInt(2),n.skip(2),this.bitFlag=n.readInt(2),this.compressionMethod=n.readString(2),this.date=n.readDate(),this.crc32=n.readInt(4),this.compressedSize=n.readInt(4),this.uncompressedSize=n.readInt(4);var e=n.readInt(2);if(this.extraFieldsLength=n.readInt(2),this.fileCommentLength=n.readInt(2),this.diskNumberStart=n.readInt(2),this.internalFileAttributes=n.readInt(2),this.externalFileAttributes=n.readInt(4),this.localHeaderOffset=n.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");n.skip(e),this.readExtraFields(n),this.parseZIP64ExtraField(n),this.fileComment=n.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var n=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),n===m&&(this.dosPermissions=this.externalFileAttributes&63),n===v&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var n=o(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=n.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=n.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=n.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=n.readInt(4))}},readExtraFields:function(n){var e=n.index+this.extraFieldsLength,r,t,c;for(this.extraFields||(this.extraFields={});n.index+4<e;)r=n.readInt(2),t=n.readInt(2),c=n.readData(t),this.extraFields[r]={id:r,length:t,value:c};n.setIndex(e)},handleUTF8:function(){var n=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=l.utf8decode(this.fileName),this.fileCommentStr=l.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(e!==null)this.fileNameStr=e;else{var r=s.transformTo(n,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var t=this.findExtraFieldUnicodeComment();if(t!==null)this.fileCommentStr=t;else{var c=s.transformTo(n,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(c)}}},findExtraFieldUnicodePath:function(){var n=this.extraFields[28789];if(n){var e=o(n.value);return e.readInt(1)!==1||i(this.fileName)!==e.readInt(4)?null:l.utf8decode(e.readData(n.length-5))}return null},findExtraFieldUnicodeComment:function(){var n=this.extraFields[25461];if(n){var e=o(n.value);return e.readInt(1)!==1||i(this.fileComment)!==e.readInt(4)?null:l.utf8decode(e.readData(n.length-5))}return null}},xe=g,xe}var Ce,sr;function Lr(){if(sr)return Ce;sr=1;var o=xr(),s=S(),a=mr(),i=Ur(),l=D();function f(u){this.files=[],this.loadOptions=u}return f.prototype={checkSignature:function(u){if(!this.reader.readAndCheckSignature(u)){this.reader.index-=4;var m=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(m)+", expected "+s.pretty(u)+")")}},isSignature:function(u,m){var v=this.reader.index;this.reader.setIndex(u);var y=this.reader.readString(4),g=y===m;return this.reader.setIndex(v),g},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var u=this.reader.readData(this.zipCommentLength),m=l.uint8array?"uint8array":"array",v=s.transformTo(m,u);this.zipComment=this.loadOptions.decodeFileName(v)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var u=this.zip64EndOfCentralSize-44,m=0,v,y,g;m<u;)v=this.reader.readInt(2),y=this.reader.readInt(4),g=this.reader.readData(y),this.zip64ExtensibleData[v]={id:v,length:y,value:g}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var u,m;for(u=0;u<this.files.length;u++)m=this.files[u],this.reader.setIndex(m.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),m.readLocalPart(this.reader),m.handleUTF8(),m.processAttributes()},readCentralDir:function(){var u;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)u=new i({zip64:this.zip64},this.loadOptions),u.readCentralPart(this.reader),this.files.push(u);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var u=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(u<0){var m=!this.isSignature(0,a.LOCAL_FILE_HEADER);throw m?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex(u);var v=u;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,u=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),u<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(u),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var y=this.centralDirOffset+this.centralDirSize;this.zip64&&(y+=20,y+=12+this.zip64EndOfCentralSize);var g=v-y;if(g>0)this.isSignature(v,a.CENTRAL_FILE_HEADER)||(this.reader.zero=g);else if(g<0)throw new Error("Corrupted zip: missing "+Math.abs(g)+" bytes.")},prepareReader:function(u){this.reader=o(u)},load:function(u){this.prepareReader(u),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},Ce=f,Ce}var Se,ar;function Nr(){if(ar)return Se;ar=1;var o=S(),s=L(),a=N(),i=Lr(),l=dr(),f=M();function u(m){return new s.Promise(function(v,y){var g=m.decompressed.getContentWorker().pipe(new l);g.on("error",function(n){y(n)}).on("end",function(){g.streamInfo.crc32!==m.decompressed.crc32?y(new Error("Corrupted zip : CRC32 mismatch")):v()}).resume()})}return Se=function(m,v){var y=this;return v=o.extend(v||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),f.isNode&&f.isStream(m)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):o.prepareContent("the loaded zip file",m,!0,v.optimizedBinaryString,v.base64).then(function(g){var n=new i(v);return n.load(g),n}).then(function(n){var e=[s.Promise.resolve(n)],r=n.files;if(v.checkCRC32)for(var t=0;t<r.length;t++)e.push(u(r[t]));return s.Promise.all(e)}).then(function(n){for(var e=n.shift(),r=e.files,t=0;t<r.length;t++){var c=r[t],h=c.fileNameStr,d=o.resolve(c.fileNameStr);y.file(d,c.decompressed,{binary:!0,optimizedBinaryString:!0,date:c.date,dir:c.dir,comment:c.fileCommentStr.length?c.fileCommentStr:null,unixPermissions:c.unixPermissions,dosPermissions:c.dosPermissions,createFolders:v.createFolders}),c.dir||(y.file(d).unsafeOriginalName=h)}return e.zipComment.length&&(y.comment=e.zipComment),y})},Se}var be,or;function Wr(){if(or)return be;or=1;function o(){if(!(this instanceof o))return new o;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new o;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}return o.prototype=Br(),o.prototype.loadAsync=Nr(),o.support=D(),o.defaults=cr(),o.version="3.10.1",o.loadAsync=function(s,a){return new o().loadAsync(s,a)},o.external=L(),be=o,be}var qr=Wr();const Yr=br(qr);export{Yr as e};
|
|
2
|
+
\0`,A+=f(Y,2),A+=C.magic,A+=f(R,2),A+=f(O,2),A+=f(P.crc32,4),A+=f(P.compressedSize,4),A+=f(P.uncompressedSize,4),A+=f(x.length,2),A+=f(z.length,2);var Cr=l.LOCAL_FILE_HEADER+A+x+z,Sr=l.CENTRAL_FILE_HEADER+f(X,2)+A+f(F.length,2)+"\0\0\0\0"+f(q,4)+f(c,4)+x+z+F;return{fileRecord:Cr,dirRecord:Sr}},y=function(e,r,t,c,h){var d="",p=o.transformTo("string",h(c));return d=l.CENTRAL_DIRECTORY_END+"\0\0\0\0"+f(e,2)+f(e,2)+f(r,4)+f(t,4)+f(p.length,2)+p,d},g=function(e){var r="";return r=l.DATA_DESCRIPTOR+f(e.crc32,4)+f(e.compressedSize,4)+f(e.uncompressedSize,4),r};function n(e,r,t,c){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=r,this.zipPlatform=t,this.encodeFileName=c,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}return o.inherits(n,s),n.prototype.push=function(e){var r=e.meta.percent||0,t=this.entriesCount,c=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,s.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:t?(r+100*(t-c-1))/t:100}}))},n.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var r=this.streamFiles&&!e.file.dir;if(r){var t=v(e,r,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:t.fileRecord,meta:{percent:0}})}else this.accumulate=!0},n.prototype.closedSource=function(e){this.accumulate=!1;var r=this.streamFiles&&!e.file.dir,t=v(e,r,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(t.dirRecord),r)this.push({data:g(e),meta:{percent:100}});else for(this.push({data:t.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},n.prototype.flush=function(){for(var e=this.bytesWritten,r=0;r<this.dirRecords.length;r++)this.push({data:this.dirRecords[r],meta:{percent:100}});var t=this.bytesWritten-e,c=y(this.dirRecords.length,t,e,this.zipComment,this.encodeFileName);this.push({data:c,meta:{percent:100}})},n.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},n.prototype.registerPrevious=function(e){this._sources.push(e);var r=this;return e.on("data",function(t){r.processChunk(t)}),e.on("end",function(){r.closedSource(r.previous.streamInfo),r._sources.length?r.prepareNextSource():r.end()}),e.on("error",function(t){r.error(t)}),this},n.prototype.resume=function(){if(!s.prototype.resume.call(this))return!1;if(!this.previous&&this._sources.length)return this.prepareNextSource(),!0;if(!this.previous&&!this._sources.length&&!this.generatedError)return this.end(),!0},n.prototype.error=function(e){var r=this._sources;if(!s.prototype.error.call(this,e))return!1;for(var t=0;t<r.length;t++)try{r[t].error(e)}catch{}return!0},n.prototype.lock=function(){s.prototype.lock.call(this);for(var e=this._sources,r=0;r<e.length;r++)e[r].lock()},he=n,he}var Ve;function Tr(){if(Ve)return fe;Ve=1;var o=pr(),s=Fr(),a=function(i,l){var f=i||l,u=o[f];if(!u)throw new Error(f+" is not a valid compression method !");return u};return fe.generateWorker=function(i,l,f){var u=new s(l.streamFiles,f,l.platform,l.encodeFileName),m=0;try{i.forEach(function(v,y){m++;var g=a(y.options.compression,l.compression),n=y.options.compressionOptions||l.compressionOptions||{},e=y.dir,r=y.date;y._compressWorker(g,n).withStreamInfo("file",{name:v,dir:e,date:r,comment:y.comment||"",unixPermissions:y.unixPermissions,dosPermissions:y.dosPermissions}).pipe(u)}),u.entriesCount=m}catch(v){u.error(v)}return u},fe}var ce,Ke;function Dr(){if(Ke)return ce;Ke=1;var o=S(),s=_();function a(i,l){s.call(this,"Nodejs stream input adapter for "+i),this._upstreamEnded=!1,this._bindStream(l)}return o.inherits(a,s),a.prototype._bindStream=function(i){var l=this;this._stream=i,i.pause(),i.on("data",function(f){l.push({data:f,meta:{percent:0}})}).on("error",function(f){l.isPaused?this.generatedError=f:l.error(f)}).on("end",function(){l.isPaused?l._upstreamEnded=!0:l.end()})},a.prototype.pause=function(){return s.prototype.pause.call(this)?(this._stream.pause(),!0):!1},a.prototype.resume=function(){return s.prototype.resume.call(this)?(this._upstreamEnded?this.end():this._stream.resume(),!0):!1},ce=a,ce}var le,Je;function Br(){if(Je)return le;Je=1;var o=N(),s=S(),a=_(),i=hr(),l=cr(),f=Ae(),u=Or(),m=Tr(),v=M(),y=Dr(),g=function(h,d,p){var C=s.getTypeOf(d),b,x=s.extend(p||{},l);x.date=x.date||new Date,x.compression!==null&&(x.compression=x.compression.toUpperCase()),typeof x.unixPermissions=="string"&&(x.unixPermissions=parseInt(x.unixPermissions,8)),x.unixPermissions&&x.unixPermissions&16384&&(x.dir=!0),x.dosPermissions&&x.dosPermissions&16&&(x.dir=!0),x.dir&&(h=e(h)),x.createFolders&&(b=n(h))&&r.call(this,b,!0);var k=C==="string"&&x.binary===!1&&x.base64===!1;(!p||typeof p.binary>"u")&&(x.binary=!k);var I=d instanceof f&&d.uncompressedSize===0;(I||x.dir||!d||d.length===0)&&(x.base64=!1,x.binary=!0,d="",x.compression="STORE",C="string");var F=null;d instanceof f||d instanceof a?F=d:v.isNode&&v.isStream(d)?F=new y(h,d):F=s.prepareContent(h,d,x.binary,x.optimizedBinaryString,x.base64);var W=new u(h,F,x);this.files[h]=W},n=function(h){h.slice(-1)==="/"&&(h=h.substring(0,h.length-1));var d=h.lastIndexOf("/");return d>0?h.substring(0,d):""},e=function(h){return h.slice(-1)!=="/"&&(h+="/"),h},r=function(h,d){return d=typeof d<"u"?d:l.createFolders,h=e(h),this.files[h]||g.call(this,h,null,{dir:!0,createFolders:d}),this.files[h]};function t(h){return Object.prototype.toString.call(h)==="[object RegExp]"}var c={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(h){var d,p,C;for(d in this.files)C=this.files[d],p=d.slice(this.root.length,d.length),p&&d.slice(0,this.root.length)===this.root&&h(p,C)},filter:function(h){var d=[];return this.forEach(function(p,C){h(p,C)&&d.push(C)}),d},file:function(h,d,p){if(arguments.length===1)if(t(h)){var C=h;return this.filter(function(x,k){return!k.dir&&C.test(x)})}else{var b=this.files[this.root+h];return b&&!b.dir?b:null}else h=this.root+h,g.call(this,h,d,p);return this},folder:function(h){if(!h)return this;if(t(h))return this.filter(function(b,x){return x.dir&&h.test(b)});var d=this.root+h,p=r.call(this,d),C=this.clone();return C.root=p.name,C},remove:function(h){h=this.root+h;var d=this.files[h];if(d||(h.slice(-1)!=="/"&&(h+="/"),d=this.files[h]),d&&!d.dir)delete this.files[h];else for(var p=this.filter(function(b,x){return x.name.slice(0,h.length)===h}),C=0;C<p.length;C++)delete this.files[p[C].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(h){var d,p={};try{if(p=s.extend(h||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:o.utf8encode}),p.type=p.type.toLowerCase(),p.compression=p.compression.toUpperCase(),p.type==="binarystring"&&(p.type="string"),!p.type)throw new Error("No output type specified.");s.checkSupport(p.type),(p.platform==="darwin"||p.platform==="freebsd"||p.platform==="linux"||p.platform==="sunos")&&(p.platform="UNIX"),p.platform==="win32"&&(p.platform="DOS");var C=p.comment||this.comment||"";d=m.generateWorker(this,p,C)}catch(b){d=new a("error"),d.error(b)}return new i(d,p.type||"string",p.mimeType)},generateAsync:function(h,d){return this.generateInternalStream(h).accumulate(d)},generateNodeStream:function(h,d){return h=h||{},h.type||(h.type="nodebuffer"),this.generateInternalStream(h).toNodejsStream(d)}};return le=c,le}var de,Qe;function vr(){if(Qe)return de;Qe=1;var o=S();function s(a){this.data=a,this.length=a.length,this.index=0,this.zero=0}return s.prototype={checkOffset:function(a){this.checkIndex(this.index+a)},checkIndex:function(a){if(this.length<this.zero+a||a<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+a+"). Corrupted zip ?")},setIndex:function(a){this.checkIndex(a),this.index=a},skip:function(a){this.setIndex(this.index+a)},byteAt:function(){},readInt:function(a){var i=0,l;for(this.checkOffset(a),l=this.index+a-1;l>=this.index;l--)i=(i<<8)+this.byteAt(l);return this.index+=a,i},readString:function(a){return o.transformTo("string",this.readData(a))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var a=this.readInt(4);return new Date(Date.UTC((a>>25&127)+1980,(a>>21&15)-1,a>>16&31,a>>11&31,a>>5&63,(a&31)<<1))}},de=s,de}var pe,$e;function yr(){if($e)return pe;$e=1;var o=vr(),s=S();function a(i){o.call(this,i);for(var l=0;l<this.data.length;l++)i[l]=i[l]&255}return s.inherits(a,o),a.prototype.byteAt=function(i){return this.data[this.zero+i]},a.prototype.lastIndexOfSignature=function(i){for(var l=i.charCodeAt(0),f=i.charCodeAt(1),u=i.charCodeAt(2),m=i.charCodeAt(3),v=this.length-4;v>=0;--v)if(this.data[v]===l&&this.data[v+1]===f&&this.data[v+2]===u&&this.data[v+3]===m)return v-this.zero;return-1},a.prototype.readAndCheckSignature=function(i){var l=i.charCodeAt(0),f=i.charCodeAt(1),u=i.charCodeAt(2),m=i.charCodeAt(3),v=this.readData(4);return l===v[0]&&f===v[1]&&u===v[2]&&m===v[3]},a.prototype.readData=function(i){if(this.checkOffset(i),i===0)return[];var l=this.data.slice(this.zero+this.index,this.zero+this.index+i);return this.index+=i,l},pe=a,pe}var me,er;function Pr(){if(er)return me;er=1;var o=vr(),s=S();function a(i){o.call(this,i)}return s.inherits(a,o),a.prototype.byteAt=function(i){return this.data.charCodeAt(this.zero+i)},a.prototype.lastIndexOfSignature=function(i){return this.data.lastIndexOf(i)-this.zero},a.prototype.readAndCheckSignature=function(i){var l=this.readData(4);return i===l},a.prototype.readData=function(i){this.checkOffset(i);var l=this.data.slice(this.zero+this.index,this.zero+this.index+i);return this.index+=i,l},me=a,me}var ve,rr;function gr(){if(rr)return ve;rr=1;var o=yr(),s=S();function a(i){o.call(this,i)}return s.inherits(a,o),a.prototype.readData=function(i){if(this.checkOffset(i),i===0)return new Uint8Array(0);var l=this.data.subarray(this.zero+this.index,this.zero+this.index+i);return this.index+=i,l},ve=a,ve}var ye,tr;function zr(){if(tr)return ye;tr=1;var o=gr(),s=S();function a(i){o.call(this,i)}return s.inherits(a,o),a.prototype.readData=function(i){this.checkOffset(i);var l=this.data.slice(this.zero+this.index,this.zero+this.index+i);return this.index+=i,l},ye=a,ye}var ge,ir;function xr(){if(ir)return ge;ir=1;var o=S(),s=D(),a=yr(),i=Pr(),l=zr(),f=gr();return ge=function(u){var m=o.getTypeOf(u);return o.checkSupport(m),m==="string"&&!s.uint8array?new i(u):m==="nodebuffer"?new l(u):s.uint8array?new f(o.transformTo("uint8array",u)):new a(o.transformTo("array",u))},ge}var xe,nr;function Ur(){if(nr)return xe;nr=1;var o=xr(),s=S(),a=Ae(),i=Ee(),l=N(),f=pr(),u=D(),m=0,v=3,y=function(n){for(var e in f)if(Object.prototype.hasOwnProperty.call(f,e)&&f[e].magic===n)return f[e];return null};function g(n,e){this.options=n,this.loadOptions=e}return g.prototype={isEncrypted:function(){return(this.bitFlag&1)===1},useUTF8:function(){return(this.bitFlag&2048)===2048},readLocalPart:function(n){var e,r;if(n.skip(22),this.fileNameLength=n.readInt(2),r=n.readInt(2),this.fileName=n.readData(this.fileNameLength),n.skip(r),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(e=y(this.compressionMethod),e===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new a(this.compressedSize,this.uncompressedSize,this.crc32,e,n.readData(this.compressedSize))},readCentralPart:function(n){this.versionMadeBy=n.readInt(2),n.skip(2),this.bitFlag=n.readInt(2),this.compressionMethod=n.readString(2),this.date=n.readDate(),this.crc32=n.readInt(4),this.compressedSize=n.readInt(4),this.uncompressedSize=n.readInt(4);var e=n.readInt(2);if(this.extraFieldsLength=n.readInt(2),this.fileCommentLength=n.readInt(2),this.diskNumberStart=n.readInt(2),this.internalFileAttributes=n.readInt(2),this.externalFileAttributes=n.readInt(4),this.localHeaderOffset=n.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");n.skip(e),this.readExtraFields(n),this.parseZIP64ExtraField(n),this.fileComment=n.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var n=this.versionMadeBy>>8;this.dir=!!(this.externalFileAttributes&16),n===m&&(this.dosPermissions=this.externalFileAttributes&63),n===v&&(this.unixPermissions=this.externalFileAttributes>>16&65535),!this.dir&&this.fileNameStr.slice(-1)==="/"&&(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var n=o(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=n.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=n.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=n.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=n.readInt(4))}},readExtraFields:function(n){var e=n.index+this.extraFieldsLength,r,t,c;for(this.extraFields||(this.extraFields={});n.index+4<e;)r=n.readInt(2),t=n.readInt(2),c=n.readData(t),this.extraFields[r]={id:r,length:t,value:c};n.setIndex(e)},handleUTF8:function(){var n=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=l.utf8decode(this.fileName),this.fileCommentStr=l.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(e!==null)this.fileNameStr=e;else{var r=s.transformTo(n,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var t=this.findExtraFieldUnicodeComment();if(t!==null)this.fileCommentStr=t;else{var c=s.transformTo(n,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(c)}}},findExtraFieldUnicodePath:function(){var n=this.extraFields[28789];if(n){var e=o(n.value);return e.readInt(1)!==1||i(this.fileName)!==e.readInt(4)?null:l.utf8decode(e.readData(n.length-5))}return null},findExtraFieldUnicodeComment:function(){var n=this.extraFields[25461];if(n){var e=o(n.value);return e.readInt(1)!==1||i(this.fileComment)!==e.readInt(4)?null:l.utf8decode(e.readData(n.length-5))}return null}},xe=g,xe}var Ce,sr;function Lr(){if(sr)return Ce;sr=1;var o=xr(),s=S(),a=mr(),i=Ur(),l=D();function f(u){this.files=[],this.loadOptions=u}return f.prototype={checkSignature:function(u){if(!this.reader.readAndCheckSignature(u)){this.reader.index-=4;var m=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(m)+", expected "+s.pretty(u)+")")}},isSignature:function(u,m){var v=this.reader.index;this.reader.setIndex(u);var y=this.reader.readString(4),g=y===m;return this.reader.setIndex(v),g},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var u=this.reader.readData(this.zipCommentLength),m=l.uint8array?"uint8array":"array",v=s.transformTo(m,u);this.zipComment=this.loadOptions.decodeFileName(v)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var u=this.zip64EndOfCentralSize-44,m=0,v,y,g;m<u;)v=this.reader.readInt(2),y=this.reader.readInt(4),g=this.reader.readData(y),this.zip64ExtensibleData[v]={id:v,length:y,value:g}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var u,m;for(u=0;u<this.files.length;u++)m=this.files[u],this.reader.setIndex(m.localHeaderOffset),this.checkSignature(a.LOCAL_FILE_HEADER),m.readLocalPart(this.reader),m.handleUTF8(),m.processAttributes()},readCentralDir:function(){var u;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(a.CENTRAL_FILE_HEADER);)u=new i({zip64:this.zip64},this.loadOptions),u.readCentralPart(this.reader),this.files.push(u);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var u=this.reader.lastIndexOfSignature(a.CENTRAL_DIRECTORY_END);if(u<0){var m=!this.isSignature(0,a.LOCAL_FILE_HEADER);throw m?new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html"):new Error("Corrupted zip: can't find end of central directory")}this.reader.setIndex(u);var v=u;if(this.checkSignature(a.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,u=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),u<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(u),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,a.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(a.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var y=this.centralDirOffset+this.centralDirSize;this.zip64&&(y+=20,y+=12+this.zip64EndOfCentralSize);var g=v-y;if(g>0)this.isSignature(v,a.CENTRAL_FILE_HEADER)||(this.reader.zero=g);else if(g<0)throw new Error("Corrupted zip: missing "+Math.abs(g)+" bytes.")},prepareReader:function(u){this.reader=o(u)},load:function(u){this.prepareReader(u),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},Ce=f,Ce}var Se,ar;function Nr(){if(ar)return Se;ar=1;var o=S(),s=L(),a=N(),i=Lr(),l=dr(),f=M();function u(m){return new s.Promise(function(v,y){var g=m.decompressed.getContentWorker().pipe(new l);g.on("error",function(n){y(n)}).on("end",function(){g.streamInfo.crc32!==m.decompressed.crc32?y(new Error("Corrupted zip : CRC32 mismatch")):v()}).resume()})}return Se=function(m,v){var y=this;return v=o.extend(v||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:a.utf8decode}),f.isNode&&f.isStream(m)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):o.prepareContent("the loaded zip file",m,!0,v.optimizedBinaryString,v.base64).then(function(g){var n=new i(v);return n.load(g),n}).then(function(n){var e=[s.Promise.resolve(n)],r=n.files;if(v.checkCRC32)for(var t=0;t<r.length;t++)e.push(u(r[t]));return s.Promise.all(e)}).then(function(n){for(var e=n.shift(),r=e.files,t=0;t<r.length;t++){var c=r[t],h=c.fileNameStr,d=o.resolve(c.fileNameStr);y.file(d,c.decompressed,{binary:!0,optimizedBinaryString:!0,date:c.date,dir:c.dir,comment:c.fileCommentStr.length?c.fileCommentStr:null,unixPermissions:c.unixPermissions,dosPermissions:c.dosPermissions,createFolders:v.createFolders}),c.dir||(y.file(d).unsafeOriginalName=h)}return e.zipComment.length&&(y.comment=e.zipComment),y})},Se}var be,or;function Wr(){if(or)return be;or=1;function o(){if(!(this instanceof o))return new o;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new o;for(var a in this)typeof this[a]!="function"&&(s[a]=this[a]);return s}}return o.prototype=Br(),o.prototype.loadAsync=Nr(),o.support=D(),o.defaults=cr(),o.version="3.10.1",o.loadAsync=function(s,a){return new o().loadAsync(s,a)},o.external=L(),be=o,be}var qr=Wr();const Yr=br(qr);export{Yr as t};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import{AsyncLocalStorage as Re}from"node:async_hooks";import{H as Ie,t as Ne}from"../_libs/h3-v2.mjs";import{q as $e,s as Ee,u as De,v as ze,w as A,x as Ue,y as re,z as _e,A as z,C as Je,D as Be,E as Ge,F as We,G as Ke,H as Ve,I as oe,J as Xe,K as Ye,L as Ze,M as Qe,N as et,O as tt,P as Ce}from"../_libs/tanstack__router-core.mjs";import{i as rt,P as ie,s as nt}from"../_libs/seroval.mjs";import{c as st}from"../_libs/tanstack__history.mjs";import{j as xe}from"../_libs/react.mjs";import{r as ot,R as it}from"../_libs/tanstack__react-router.mjs";import"../_libs/rou3.mjs";import"../_libs/srvx.mjs";import"node:http";import"node:stream";import"node:stream/promises";import"node:https";import"node:http2";import"../_libs/cookie-es.mjs";import"../_libs/seroval-plugins.mjs";import"node:stream/web";import"../_libs/react-dom.mjs";import"util";import"crypto";import"async_hooks";import"stream";import"../_libs/isbot.mjs";function at(e){return xe.jsx(it,{router:e.router})}var ct=Ye(({request:e,router:t,responseHeaders:r})=>ot({request:e,router:t,responseHeaders:r,children:xe.jsx(at,{router:t})})),G=Symbol.for("tanstack-start:event-storage"),W=globalThis;W[G]||(W[G]=new Re);var ke=W[G];function ut(e){return typeof e.then=="function"}function ae(e){const t=e;if(typeof t.getSetCookie=="function")return t.getSetCookie();const r=e.get("set-cookie");return r?[r]:[]}function ce(e,t){if(e.ok)return;const r=ae(t.res.headers);if(r.length===0)return;const n=ae(e.headers);e.headers.delete("set-cookie");for(const s of n)e.headers.append("set-cookie",s);for(const s of r)e.headers.append("set-cookie",s)}function ft(e,t){return ut(e)?e.then(r=>(r instanceof Response&&ce(r,t),r)):(e instanceof Response&&ce(e,t),e)}function lt(e){return(t,r)=>{let n;try{n=new Ie(t)}catch(s){if(s instanceof URIError)return new Response(null,{status:400,statusText:"Bad Request"});throw s}return Ne(ft(ke.run({h3Event:n},()=>e(t,r)),n),n)}}function pt(){const e=ke.getStore();if(!e)throw new Error("No StartEvent found in AsyncLocalStorage. Make sure you are using the function within the server runtime.");return e.h3Event}function ue(){return pt().res}var dt={TSS_SHELL:"X-TSS_SHELL"};async function ht(e){const{tsrStartManifest:t}=await import("../_tanstack-start-manifest_v-D7cKwKzM.mjs"),r=t();let n=r.routes;n[Ge];const s={};for(const o in n){const i=n[o],a={};i.preloads&&i.preloads.length>0&&(a.preloads=i.preloads),i.scripts&&i.scripts.length>0&&(a.scripts=i.scripts),i.css?.length&&(a.css=i.css),(a.preloads||a.scripts||a.css)&&(s[o]=a)}return{...r.scriptFormat?{scriptFormat:r.scriptFormat}:{},...r.inlineCss?{inlineCss:r.inlineCss}:{},routes:s}}const yt={};async function Oe(e,t){const r=yt[e];if(!r)throw new Error("Server function info not found for "+e);const n=r.module??await r.importer();if(!n)throw new Error("Server function module not resolved for "+e);const s=n[r.functionName];if(!s)throw new Error("Server function module export not resolved for serverFn ID: "+e);return s}var fe="__TSS_CONTEXT",le=Symbol.for("TSS_SERVER_FUNCTION"),U="x-tss-serialized",mt="x-tss-raw",gt="application/x-tss-framed",P={JSON:0,CHUNK:1,END:2,ERROR:3},pe=9,wt=`${gt}; v=1`;function K(e){return e!=="__proto__"&&e!=="constructor"&&e!=="prototype"}function M(e,t){const r=Object.create(null);if(e)for(const n of Object.keys(e))K(n)&&(r[n]=e[n]);if(t&&typeof t=="object")for(const n of Object.keys(t))K(n)&&(r[n]=t[n]);return r}function de(e){if(!e)return Object.create(null);const t=Object.create(null);for(const r of Object.keys(e))K(r)&&(t[r]=e[r]);return t}var V=Symbol.for("tanstack-start:start-storage-context"),X=globalThis;X[V]||(X[V]=new Re);var He=X[V];async function he(e,t){return He.run(e,t)}function Y(e){const t=He.getStore();if(!t&&e?.throwIfNotFound!==!1)throw new Error("No Start context found in AsyncLocalStorage. Make sure you are using the function within the server runtime.");return t}var vt=()=>Y().startOptions;function Z(e,t=100){const r=new Set,n=[],s=(o,i)=>{if(i>t)throw new Error(`Middleware nesting depth exceeded maximum of ${t}. Check for circular references.`);o.forEach(a=>{a.options.middleware&&s(a.options.middleware,i+1),r.has(a)||(r.add(a),n.push(a))})};return s(e,0),n}var q=(e,t)=>{const r={type:"request",...t||e},n=s=>q({},Object.assign(r,{validator:s,inputValidator:s}));return{options:r,middleware:s=>q({},Object.assign(r,{middleware:s})),validator:n,inputValidator:n,client:s=>q({},Object.assign(r,{client:s})),server:s=>q({},Object.assign(r,{server:s}))}},St=(e={})=>q().server(async t=>{const r=t;return e.filter&&!await e.filter(r)||await Et(e,r)?t.next():Ot(e,r)}),Rt=St;async function Et(e,t){const r=await Ct(e,t);return r===!0||r===void 0&&e.allowRequestsWithoutOriginCheck===!0}async function Ct(e,t){const r=t.request.headers.get("Sec-Fetch-Site");if(r!==null)return _(e.secFetchSite??"same-origin",r,t);const n=t.request.headers.get("Origin");if(n!==null)return e.origin?_(e.origin,n,t):n===new URL(t.request.url).origin;const s=t.request.headers.get("Referer");if(!(s===null||e.referer===!1)){if(typeof e.referer=="function")return e.referer(s,t);if(e.origin){const o=xt(s);return o!==void 0&&_(e.origin,o,t)}return kt(s,new URL(t.request.url).origin)}}async function _(e,t,r){return typeof e=="function"?e(t,r):Array.isArray(e)?e.includes(t):t===e}function xt(e){try{return new URL(e).origin}catch{return}}function kt(e,t){if(e===t)return!0;if(!e.startsWith(t))return!1;if(e.length===t.length)return!0;const r=e.charCodeAt(t.length);return r===47||r===63||r===35}async function Ot(e,t){return typeof e.failureResponse=="function"?e.failureResponse(t):e.failureResponse?.clone()??new Response("Forbidden",{status:403})}function Ht(){return[...vt()?.serializationAdapters?.map(Qe)??[],...Ze]}var Te=new TextEncoder,Tt=new Uint8Array(0);function j(e,t,r){const n=new Uint8Array(pe+r.length);return n[0]=e,n[1]=t>>>24&255,n[2]=t>>>16&255,n[3]=t>>>8&255,n[4]=t&255,n[5]=r.length>>>24&255,n[6]=r.length>>>16&255,n[7]=r.length>>>8&255,n[8]=r.length&255,n.set(r,pe),n}function bt(e){return j(P.JSON,0,Te.encode(e))}function Lt(e,t){return j(P.CHUNK,e,t)}function Ft(e){return j(P.END,e,Tt)}function qt(e,t){const r=t instanceof Error?t.message:String(t??"Unknown error");return j(P.ERROR,e,Te.encode(r))}function At(e,t,r){let n,s=!1;const o=[],i=l=>{if(s)return!1;try{return n.enqueue(l),!0}catch{return!1}},a=l=>{if(!s){s=!0;try{n.error(l)}catch{}for(const f of o)f.cancel().catch(()=>{})}};async function c(l,f){const p=f.getReader();o.push(p);try{for(;!s;){const{done:d,value:v}=await p.read();if(d){i(Ft(l));return}if(!i(Lt(l,v)))return}}catch(d){i(qt(l,d))}finally{p.releaseLock()}}async function u(){const l=e.getReader();o.push(l);try{for(;!s;){const{done:f,value:p}=await l.read();if(f||!i(bt(p)))return}}catch(f){throw a(f),f}finally{l.releaseLock()}}async function y(){if(!r)return[];const l=[],f=r.getReader();o.push(f);try{for(;!s;){const{done:p,value:d}=await f.read();if(p)break;l.push(c(d.id,d.stream))}}finally{f.releaseLock()}return l}return new ReadableStream({async start(l){n=l;const f=[u()];for(const[p,d]of t)f.push(c(p,d));r&&f.push(y());try{const p=(await Promise.all(f)).find(Array.isArray);if(p&&p.length>0&&await Promise.all(p),!s)try{n.close()}catch{}}catch{}},cancel(){s=!0;for(const l of o)l.cancel().catch(()=>{});o.length=0}})}var L=void 0,Mt=["multipart/form-data","application/x-www-form-urlencoded"],Pt=1e6,jt=async({request:e,context:t,serverFnId:r})=>{const n=e.method.toUpperCase(),s=new URL(e.url),o=await Oe(r);if(o.method&&n!==o.method)return new Response(`expected ${o.method} method. Got ${n}`,{status:405,headers:{Allow:o.method}});const i=e.headers.get("x-tsr-serverFn")==="true";L||(L=Ht());const a=e.headers.get("Content-Type");function c(u){return ie(u,{plugins:L})}return await(async()=>{try{let u=function(f){let p;const d=ue();if(f!==void 0){const v=new Map;let C=!0,h,E;const g=[],R=[Ke((w,m)=>{if(C){v.set(w,m);return}if(h){h.write({id:w,stream:m}).catch(()=>{});return}g.push({id:w,stream:m})}),...L||[]];let k=!1;const S={onParse:w=>{p=w},onDone:()=>{k=!0},onError:w=>{throw w}};if(rt(f,{refs:new Map,plugins:R,onParse(w){S.onParse(w)},onDone(){S.onDone()},onError:w=>{S.onError(w)}}),C=!1,k&&v.size===0)return new Response(p?JSON.stringify(p):void 0,{status:d.status,statusText:d.statusText,headers:{"Content-Type":"application/json",[U]:"true"}});const{readable:I,writable:N}=new TransformStream;E=I,h=N.getWriter();for(const w of g)h.write(w).catch(()=>{});g.length=0;const $=At(new ReadableStream({start(w){S.onParse=m=>{w.enqueue(JSON.stringify(m)+`
|
|
2
|
-
`)},S.onDone=()=>{try{w.close()}catch{}h?.close().catch(()=>{}).finally(()=>{h=void 0})},S.onError=m=>{w.error(m),h?.abort(m).catch(()=>{}).finally(()=>{h=void 0})},p!==void 0&&S.onParse(p),k&&S.onDone()},cancel(){h?.abort().catch(()=>{}),h=void 0}}),v,E);return new Response($,{status:d.status,statusText:d.statusText,headers:{"Content-Type":wt,[U]:"true"}})}return new Response(void 0,{status:d.status,statusText:d.statusText})},y=await(async()=>{if(Mt.some(d=>a&&a.includes(d))){n==="GET"&&Ve();const d=await e.formData(),v=d.get(fe);d.delete(fe);const C={context:t,data:d,method:n};if(typeof v=="string")try{const h=ie(JSON.parse(v),{plugins:L});typeof h=="object"&&h&&(C.context=M(h,t))}catch{}return await o(C)}if(n==="GET"){const d=s.searchParams.get("payload");if(d&&d.length>Pt)throw new Error("Payload too large");const v=d?c(JSON.parse(d)):{};return v.context=M(v.context,t),v.method=n,await o(v)}let f;a?.includes("application/json")&&(f=await e.json());const p=f?c(f):{};return p.context=M(p.context,t),p.method=n,await o(p)})();const l=y.result||y.error;return oe(y)&&(y=ye(y)),i?l instanceof Response?(re(l)||l.headers.set(mt,"true"),l):u(y):l}catch(u){if(u instanceof Response)return u;if(oe(u))return ye(u);console.info(),console.info("Server Fn Error!"),console.info(),console.error(u),console.info();const y=JSON.stringify(await Promise.resolve(nt(u,{refs:new Map,plugins:L}))),l=ue();return new Response(y,{status:l.status??500,statusText:l.statusText,headers:{"Content-Type":"application/json",[U]:"true"}})}})()};function ye(e){const{headers:t,...r}=e;return new Response(JSON.stringify(r),{status:404,headers:{"Content-Type":"application/json",...t||{}}})}var It=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Nt=new Set(["fetch","font","image","script","style","track"]);function b(e,t){return t===void 0?e:It.test(t)?`${e}=${t}`:`${e}=${JSON.stringify(t)}`}function be(e){const t=[`<${e.href}>`,b("rel",e.rel)];return e.as&&t.push(b("as",e.as)),e.crossOrigin!==void 0&&t.push(b("crossorigin",e.crossOrigin||void 0)),e.type&&t.push(b("type",e.type)),e.integrity&&t.push(b("integrity",e.integrity)),e.referrerPolicy&&t.push(b("referrerpolicy",e.referrerPolicy)),e.fetchPriority&&t.push(b("fetchpriority",e.fetchPriority)),t.join("; ")}function H(e,t,r){const n=e?.[t]??(r?e?.[r]:void 0);return typeof n=="string"?n:void 0}function $t(e){const t=H(e,"as");return t&&Nt.has(t)?t:void 0}function Dt(e,t){const r=H(t,"crossOrigin","crossorigin"),n=H(t,"type"),s=H(t,"integrity"),o=H(t,"referrerPolicy","referrerpolicy"),i=H(t,"fetchPriority","fetchpriority");r!==void 0&&(e.crossOrigin=r),n&&(e.type=n),s&&(e.integrity=s),o&&(e.referrerPolicy=o),i&&(e.fetchPriority=i)}function zt(e){const t=H(e,"href"),r=H(e,"rel");if(!t||!r)return;const n=r.split(/\s+/);let s,o;if(n.includes("modulepreload"))s="modulepreload",o="script";else if(n.includes("stylesheet"))s="preload",o="style";else if(n.includes("preload")){if(o=$t(e),!o)return;s="preload"}else n.includes("preconnect")?(s="preconnect",o=void 0):n.includes("dns-prefetch")&&(s="dns-prefetch",o=void 0);if(!s)return;const i={href:t,rel:s};return o&&(i.as=o),Dt(i,e),i}function Ut(e,t){const r=[];for(const n of t){const s=e.routes[n.id];if(s){for(const o of s.preloads??[]){const i=et(e,o),a={href:i.href,rel:i.rel,as:"script"};i.crossOrigin!==void 0&&(a.crossOrigin=i.crossOrigin),r.push(a)}for(const o of s.css??[]){const i=tt(o);if(e.inlineCss?.styles[i]!==void 0)continue;const a=Ee(o),c={href:i,rel:"preload",as:"style"};a.crossOrigin!==void 0&&(c.crossOrigin=a.crossOrigin),r.push(c)}}}return r}function _t(e){const t=[];for(const r of e){const n=r.links;if(Array.isArray(n))for(const s of n){const o=zt(s);o&&t.push(o)}}return t}function Jt(e){const t=[],r=[];for(const n of e.hints){const s=be(n);e.sentLinks.has(s)||(e.sentLinks.add(s),e.sentHints.push(n),t.push(n),r.push(s))}if(!(!t.length&&e.phase!=="dynamic"))return{phase:e.phase,hints:t,links:r,allHints:e.sentHints.slice(),allLinks:Array.from(e.sentLinks)}}function Bt(e){for(const t of e.hints){const r=be(t);e.sentLinks.has(r)||(e.sentLinks.add(r),e.entries.push({phase:e.phase,hint:t,link:r}))}}function Gt(e){if(!e.filter)return e.entries.map(t=>t.link);try{const t=[];for(const r of e.entries)e.filter(r)&&t.push(r.link);return t}catch(t){return console.error("Error filtering response Link headers:",t),[]}}function Wt(e,t,r){try{const n=r(t);n&&Promise.resolve(n).catch(s=>{console.error(`Error sending ${e} early hints:`,s)})}catch(n){console.error(`Error sending ${e} early hints:`,n)}}function Kt(e){if(typeof e=="object")return e.filter}function Vt(e){for(const t of Gt(e))e.responseHeaders.append("Link",t)}function Xt(e){for(let t=0;t<e.event.hints.length;t++)e.entries.push({phase:e.phase,hint:e.event.hints[t],link:e.event.links[t]})}function me(e){const t=e.onEarlyHints?Jt({phase:e.phase,hints:e.hints,sentLinks:e.sentLinks,sentHints:e.sentHints}):void 0;if(t&&Wt(e.phase,t,e.onEarlyHints),!!e.responseLinkHeaderEntries){if(t){Xt({phase:e.phase,event:t,entries:e.responseLinkHeaderEntries});return}Bt({phase:e.phase,hints:e.hints,sentLinks:e.sentLinks,entries:e.responseLinkHeaderEntries})}}function Yt(e){if(!e?.onEarlyHints&&!e?.responseLinkHeader)return;const t=new Set,r=e.onEarlyHints?new Array:void 0,n=e.responseLinkHeader?new Array:void 0,s=Kt(e.responseLinkHeader);return{collectStatic:({manifest:o,matchedRoutes:i})=>{i?.length&&me({phase:"static",hints:Ut(o,i),sentLinks:t,sentHints:r,onEarlyHints:e.onEarlyHints,responseLinkHeaderEntries:n})},collectDynamic:o=>{me({phase:"dynamic",hints:_t(o),sentLinks:t,sentHints:r,onEarlyHints:e.onEarlyHints,responseLinkHeaderEntries:n})},appendResponseHeaders:o=>{n?.length&&Vt({responseHeaders:o,entries:n,filter:s})}}}function Q(e){return typeof e=="string"?{href:e}:e}function Zt(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\a ").replace(/\r/g,"\\d ").replace(/\f/g,"\\c ")}async function Qt(e){const{strings:t,urls:r}=e.template;if(t.length!==r.length+1)throw new Error(`TanStack Start inlineCss template for ${e.stylesheetHref} is invalid`);let n=t[0];for(let s=0;s<r.length;s++){const o=Q(await e.transformFn({kind:"css-url",url:r[s],stylesheetHref:e.stylesheetHref}));n+=Zt(o.href)+t[s+1]}return n}async function er(e,t){const r={},n=await Promise.all(Object.entries(e.styles).map(async([s,o])=>{const i=e.templates?.[s];return[s,i?await Qt({stylesheetHref:s,template:i,transformFn:t}):o]}));for(const[s,o]of n)r[s]=o;return{styles:r,...e.templates?{templates:e.templates}:{}}}function tr(e,t){if(e)return typeof e=="string"?e:e[t]}function rr(e){return"prefix"in e}function nr(e){if(typeof e=="string"){const t=e;return{type:"transform",transformFn:({url:r})=>({href:`${t}${r}`}),cache:!0}}if(typeof e=="function")return{type:"transform",transformFn:e,cache:!0};if(rr(e)){const{prefix:t,crossOrigin:r}=e;return{type:"transform",transformFn:({url:n,kind:s})=>{const o=`${t}${n}`;if(s==="css-url")return{href:o};const i=tr(r,s);return i?{href:o,crossOrigin:i}:{href:o}},cache:!0}}return"createTransform"in e&&e.createTransform?{type:"createTransform",createTransform:e.createTransform,cache:e.cache!==!1}:{type:"transform",transformFn:typeof e.transform=="string"?(({url:t})=>({href:`${e.transform}${t}`})):e.transform,cache:e.cache!==!1}}function ge(e,t){if(typeof e=="string")return t.crossOrigin?t:t.href;const r={...e,href:t.href};return t.crossOrigin?r.crossOrigin=t.crossOrigin:delete r.crossOrigin,r}async function sr(e,t,r){const n=structuredClone(e),s=r?.inlineCss!==!1,o=new Map,i=a=>{const c=o.get(a);if(c)return c;const u=Promise.resolve(t({url:a,kind:"script"})).then(Q);return o.set(a,u),u};s?n.inlineCss&&(n.inlineCss=await er(n.inlineCss,t)):delete n.inlineCss;for(const a of Object.values(n.routes))if(a.preloads?.length&&(a.preloads=await Promise.all(a.preloads.map(async c=>{const u=await i($e(c).href);return ge(c,{href:u.href,crossOrigin:u.crossOrigin})}))),a.css?.length&&!n.inlineCss&&(a.css=await Promise.all(a.css.map(async c=>{const u=Q(await t({url:Ee(c).href,kind:"stylesheet"}));return ge(c,{href:u.href,crossOrigin:u.crossOrigin})}))),a.scripts?.length)for(const c of a.scripts){const u=c.attrs?.src;if(typeof u!="string")continue;const y=await i(u);c.attrs={...c.attrs,src:y.href},y.crossOrigin?c.attrs.crossOrigin=y.crossOrigin:delete c.attrs.crossOrigin}return n}function or(e,t){return{...e.scriptFormat?{scriptFormat:e.scriptFormat}:{},...t?.inlineCss!==!1&&e.inlineCss?{inlineCss:structuredClone(e.inlineCss)}:{},routes:{...e.routes}}}function ir(e){if(typeof e!="function")return e??!0}async function ar(e){return e.requestInlineCss!==void 0?e.requestInlineCss:typeof e.handlerInlineCss=="function"?await e.handlerInlineCss({request:e.request}):e.handlerInlineCss??!0}function cr(e){let t;return()=>(t||(t=e().catch(r=>{throw t=void 0,r})),t)}function ur(e,t){const r=e!==void 0?nr(e):void 0,n=r?r.cache:!0,s=!!e&&typeof e=="object"&&"warmup"in e&&e.warmup===!0;let o;const i=()=>{o=void 0};return{cache:n,warmup:s,clearCachedCreateTransform:i,getTransformFn:async a=>{if(r)return r.type!=="createTransform"?r.transformFn:n?(o||(o=Promise.resolve(r.createTransform(a)).catch(c=>{throw i(),c})),o):r.createTransform(a)}}}function fr(e){const t=new Map,r=ur(e.transformAssets),n=ir(e.inlineCss),s=async i=>{const a=await r.getTransformFn({warmup:!1,request:i.request}),c=await ar({request:i.request,handlerInlineCss:e.inlineCss,requestInlineCss:i.requestInlineCss});return{getBaseManifest:i.getBaseManifest,transformFn:a,cache:r.cache,inlineCss:c}},o=async(i,a)=>pr({...await s(i),finalManifestCache:a});return{warmup:({getBaseManifest:i})=>dr({enabled:r.warmup,handlerDefaultInlineCss:n,cache:r.cache,finalManifestCache:t,getBaseManifest:i,getTransformFn:()=>r.getTransformFn({warmup:!0}),onError:r.clearCachedCreateTransform}),resolveCached:i=>o(i,t),resolveUncached:i=>o(i,void 0)}}function Le(e){return e?"inline-css":"linked-css"}function lr(e,t,r){const n=r.catch(s=>{throw e.get(t)===n&&e.delete(t),s});return e.set(t,n),n}function Fe(e,t,r){return e.get(t)||lr(e,t,Promise.resolve().then(r))}async function qe(e){return e.transformFn?await sr(e.base,e.transformFn,{inlineCss:e.inlineCss}):or(e.base,{inlineCss:e.inlineCss})}async function pr(e){const t=async()=>qe({base:await e.getBaseManifest(),transformFn:e.transformFn,inlineCss:e.inlineCss});return e.finalManifestCache&&(!e.transformFn||e.cache)?Fe(e.finalManifestCache,Le(e.inlineCss),t):t()}function dr(e){if(!e.enabled||e.handlerDefaultInlineCss===void 0||!e.cache)return;const t=e.handlerDefaultInlineCss,r=Fe(e.finalManifestCache,Le(t),async()=>{const[n,s]=await Promise.all([e.getBaseManifest(),e.getTransformFn()]);return qe({base:n,transformFn:s,inlineCss:t})});return e.onError&&r.catch(e.onError),r}var hr=We({key:"$TSS/serverfn",test:e=>typeof e!="function"||!(le in e)?!1:!!e[le],toSerializable:({serverFnMeta:e})=>({functionId:e.id}),fromSerializable:({functionId:e})=>async(t,r)=>(await(await Oe(e))(t??{},r)).result});function yr(e){return Xe({"Content-Type":"text/html; charset=utf-8"},...e.router.stores.matches.get().map(t=>t.headers))}var J,mr=Rt({filter:e=>e.handlerType==="serverFn"}),gr=cr(()=>ht()),wr=()=>gr(),we=wr,vr=Yt;async function Sr(){const[e,t,r]=await Promise.all([import("./router-B0O86LL2.mjs"),import("./start-CbEonH-m.mjs"),import("./empty-plugin-adapters-C3Q1xu4u.mjs")]);return{routerEntry:e,startEntry:t,pluginAdapters:r}}function Rr(){return J||(J=Sr()),J}var Er="/",B="/_serverFn/",ve=process.env.TSS_PRERENDERING==="true",Cr=process.env.TSS_SHELL==="true",xr="Internal Server Error",kr="Internal Server Error";function ne(){throw new Error(xr)}function Or(){throw new Error(kr)}function Ae(e){return e instanceof Response||re(e)}function Hr(e){return Ce(e)||Ae(e)?{response:e}:e}async function ee(e,t){let r=-1,n;const s=c=>{if(Ce(c)){c.serverSsrCleanup==="stream"&&(n=c),t.response=c.response;return}t.response=c},o=async c=>{const u=n;if(!u)return;n=void 0;const y=t.response;(y===u.response||y instanceof Response&&u.response.body!==null&&y.body===u.response.body)&&(t.response=void 0),await u.dispose(c)},i=async()=>{const c=t.response;return c||ne(),n?c===n.response?n:n.response.body!==null&&c.body===n.response.body?{...n,response:c}:(await o("middleware response replaced"),c):c},a=async c=>{if(c){c.context&&(t.context=M(t.context,c.context));for(const f of Object.keys(c))f==="response"?s(c.response):f!=="context"&&(t[f]=c[f])}r++;const u=e[r];if(!u)return t;let y;try{y=await u({...t,next:a})}catch(f){if(Ae(f))return s(f),t;throw await o("middleware error"),f}const l=Hr(y);return l&&(l.response!==void 0&&s(l.response),l.context&&(t.context=M(t.context,l.context))),t};return await a(),{ctx:t,response:await i()}}function Se(e,t=!1){return t?e:async r=>{const n=await e({...r,next:Or});return n||ne(),n}}function Tr(e){const t=typeof e=="function"?{}:e,r=typeof e=="function"?e:e.handler,n=fr({...t}),s=n.resolveCached;return n.warmup({getBaseManifest:()=>we()}),lt(async(o,i)=>{let a=null,c=!1;try{const{url:u,handledProtocolRelativeURL:y}=De(o.url),l=u.pathname+u.search+u.hash,f=ze(o);if(y)return Response.redirect(u,308);const p=await Rr(),d=!!p.startEntry.startInstance,v=await p.startEntry.startInstance?.getOptions()||{},{hasPluginAdapters:C,pluginSerializationAdapters:h}=p.pluginAdapters,E=[...v.serializationAdapters||[],...C?h:[],hr],g={...v,requestMiddleware:d?v.requestMiddleware:[mr],serializationAdapters:E},R=g.requestMiddleware?Z(g.requestMiddleware):[],k=new Set(R),S=async()=>{if(a)return a;a=await p.routerEntry.getRouter();let m=Cr;ve&&!m&&(m=o.headers.get(dt.TSS_SHELL)==="true");const x=st({initialEntries:[l]});return a.update({history:x,isShell:m,isPrerendering:ve,origin:a.options.origin??f,defaultSsr:g.defaultSsr,serializationAdapters:[...g.serializationAdapters,...a.options.serializationAdapters||[]],basepath:Er}),a};if(B&&u.pathname.startsWith(B)){const m=u.pathname.slice(B.length).split("/")[0];if(!m)throw new Error("Invalid server action param for serverFnId");const x=async({context:T})=>he({getRouter:S,startOptions:g,contextAfterGlobalMiddlewares:T,request:o,executedRequestMiddlewares:k,handlerType:"serverFn"},()=>jt({request:o,context:i?.context,serverFnId:m})),{response:D}=await ee([...R.map(T=>T.options.server),x],{request:o,pathname:u.pathname,handlerType:"serverFn",context:de(i?.context)}),F=await te(D,o,S);return c=F.serverSsrCleanup==="stream",F.response}const I=async(m,x)=>{const D=(o.headers.get("Accept")||"*/*").split(",");if(!["*/*","text/html"].some(Pe=>D.some(je=>je.trim().startsWith(Pe))))return A(Response.json({error:"Only HTML requests are supported here"},{status:500}));const F=await s({request:o,requestInlineCss:i?.inlineCss,getBaseManifest:()=>we(x)}),T=vr({onEarlyHints:i?.onEarlyHints,responseLinkHeader:i?.responseLinkHeader});T?.collectStatic({manifest:F,matchedRoutes:x});const O=await S();if(Ue({router:O,manifest:F,getRequestAssets:()=>Y({throwIfNotFound:!1})?.requestAssets}),O.options.additionalContext={serverContext:m},await O.load(),O.state.redirect)return A(O.state.redirect);T?.collectDynamic(O.stores.matches.get());const Me=Y({throwIfNotFound:!1});await O.serverSsr.dehydrate({requestAssets:Me?.requestAssets});const se=yr({router:O});return T?.appendResponseHeaders(se),A(await r({request:o,router:O,responseHeaders:se}))},N=async({context:m})=>he({getRouter:S,startOptions:g,contextAfterGlobalMiddlewares:m,request:o,executedRequestMiddlewares:k,handlerType:"router"},async()=>{try{return await br({getRouter:S,request:o,url:u,executeRouter:I,context:m,executedRequestMiddlewares:k})}catch(x){if(x instanceof Response)return x;throw x}}),{response:$}=await ee([...R.map(m=>m.options.server),N],{request:o,pathname:u.pathname,handlerType:"router",context:de(i?.context)}),w=await te($,o,S);return c=w.serverSsrCleanup==="stream",w.response}finally{a?.serverSsr&&!c&&a.serverSsr.cleanup(),a=null}})}async function te(e,t,r){const n=A(e);if(!re(n.response))return n;if(_e(n.response))return t.headers.get("x-tsr-serverFn")==="true"?z(n,Response.json({...n.response.options,isSerializedRedirect:!0},{headers:n.response.headers}),"redirect response replaced"):n;const s=n.response.options;if(s.to&&typeof s.to=="string"&&!s.to.startsWith("/"))throw new Error(`Server side redirects must use absolute paths via the 'href' or 'to' options. The redirect() method's "to" property accepts an internal path only. Use the "href" property to provide an external URL. Received: ${JSON.stringify(s)}`);if(["params","search","hash"].some(i=>typeof s[i]=="function"))throw new Error(`Server side redirects must use static search, params, and hash values and do not support functional values. Received functional values for: ${Object.keys(s).filter(i=>typeof s[i]=="function").map(i=>`"${i}"`).join(", ")}`);const o=(await r()).resolveRedirect(n.response);return t.headers.get("x-tsr-serverFn")==="true"?z(n,Response.json({...n.response.options,isSerializedRedirect:!0},{headers:n.response.headers}),"redirect response replaced"):z(n,o,"redirect response replaced")}async function br({getRouter:e,request:t,url:r,executeRouter:n,context:s,executedRequestMiddlewares:o}){const i=await e(),a=Je(i.rewrite,r).pathname,{matchedRoutes:c,foundRoute:u,routeParams:y}=i.getMatchedRoutes(a),l=u&&y["**"]===void 0,f=[];for(const h of c){const E=h.options.server?.middleware;if(E){const g=Z(E);for(const R of g)o.has(R)||f.push(R.options.server)}}const p=u?.options.server;let d=!1;if(p?.handlers&&l){const h=typeof p.handlers=="function"?p.handlers({createHandlers:R=>R}):p.handlers,E=t.method.toUpperCase(),g=E==="HEAD"?h.HEAD??h.GET??h.ANY:h[E]??h.ANY;if(d=E==="HEAD"&&g!==void 0&&!h.HEAD,g){const R=!!u.options.component;if(typeof g=="function")f.push(Se(g,R));else{if(g.middleware?.length){const k=Z(g.middleware);for(const S of k)f.push(S.options.server)}g.handler&&f.push(Se(g.handler,R))}}}f.push((h=>n(h.context,c)));const{ctx:v,response:C}=await ee(f,{request:t,context:s,params:y,pathname:a,handlerType:"router"});return d?(v.response||ne(),Be(await te(C,t,e),"HEAD body stripped")):A(C)}const Lr=Tr(ct);function Fr(e){return{async fetch(...t){return await e.fetch(...t)}}}const tn=Fr({fetch:Lr});export{q as c,Fr as createServerEntry,tn as default};
|
|
2
|
+
`)},S.onDone=()=>{try{w.close()}catch{}h?.close().catch(()=>{}).finally(()=>{h=void 0})},S.onError=m=>{w.error(m),h?.abort(m).catch(()=>{}).finally(()=>{h=void 0})},p!==void 0&&S.onParse(p),k&&S.onDone()},cancel(){h?.abort().catch(()=>{}),h=void 0}}),v,E);return new Response($,{status:d.status,statusText:d.statusText,headers:{"Content-Type":wt,[U]:"true"}})}return new Response(void 0,{status:d.status,statusText:d.statusText})},y=await(async()=>{if(Mt.some(d=>a&&a.includes(d))){n==="GET"&&Ve();const d=await e.formData(),v=d.get(fe);d.delete(fe);const C={context:t,data:d,method:n};if(typeof v=="string")try{const h=ie(JSON.parse(v),{plugins:L});typeof h=="object"&&h&&(C.context=M(h,t))}catch{}return await o(C)}if(n==="GET"){const d=s.searchParams.get("payload");if(d&&d.length>Pt)throw new Error("Payload too large");const v=d?c(JSON.parse(d)):{};return v.context=M(v.context,t),v.method=n,await o(v)}let f;a?.includes("application/json")&&(f=await e.json());const p=f?c(f):{};return p.context=M(p.context,t),p.method=n,await o(p)})();const l=y.result||y.error;return oe(y)&&(y=ye(y)),i?l instanceof Response?(re(l)||l.headers.set(mt,"true"),l):u(y):l}catch(u){if(u instanceof Response)return u;if(oe(u))return ye(u);console.info(),console.info("Server Fn Error!"),console.info(),console.error(u),console.info();const y=JSON.stringify(await Promise.resolve(nt(u,{refs:new Map,plugins:L}))),l=ue();return new Response(y,{status:l.status??500,statusText:l.statusText,headers:{"Content-Type":"application/json",[U]:"true"}})}})()};function ye(e){const{headers:t,...r}=e;return new Response(JSON.stringify(r),{status:404,headers:{"Content-Type":"application/json",...t||{}}})}var It=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,Nt=new Set(["fetch","font","image","script","style","track"]);function b(e,t){return t===void 0?e:It.test(t)?`${e}=${t}`:`${e}=${JSON.stringify(t)}`}function be(e){const t=[`<${e.href}>`,b("rel",e.rel)];return e.as&&t.push(b("as",e.as)),e.crossOrigin!==void 0&&t.push(b("crossorigin",e.crossOrigin||void 0)),e.type&&t.push(b("type",e.type)),e.integrity&&t.push(b("integrity",e.integrity)),e.referrerPolicy&&t.push(b("referrerpolicy",e.referrerPolicy)),e.fetchPriority&&t.push(b("fetchpriority",e.fetchPriority)),t.join("; ")}function H(e,t,r){const n=e?.[t]??(r?e?.[r]:void 0);return typeof n=="string"?n:void 0}function $t(e){const t=H(e,"as");return t&&Nt.has(t)?t:void 0}function Dt(e,t){const r=H(t,"crossOrigin","crossorigin"),n=H(t,"type"),s=H(t,"integrity"),o=H(t,"referrerPolicy","referrerpolicy"),i=H(t,"fetchPriority","fetchpriority");r!==void 0&&(e.crossOrigin=r),n&&(e.type=n),s&&(e.integrity=s),o&&(e.referrerPolicy=o),i&&(e.fetchPriority=i)}function zt(e){const t=H(e,"href"),r=H(e,"rel");if(!t||!r)return;const n=r.split(/\s+/);let s,o;if(n.includes("modulepreload"))s="modulepreload",o="script";else if(n.includes("stylesheet"))s="preload",o="style";else if(n.includes("preload")){if(o=$t(e),!o)return;s="preload"}else n.includes("preconnect")?(s="preconnect",o=void 0):n.includes("dns-prefetch")&&(s="dns-prefetch",o=void 0);if(!s)return;const i={href:t,rel:s};return o&&(i.as=o),Dt(i,e),i}function Ut(e,t){const r=[];for(const n of t){const s=e.routes[n.id];if(s){for(const o of s.preloads??[]){const i=et(e,o),a={href:i.href,rel:i.rel,as:"script"};i.crossOrigin!==void 0&&(a.crossOrigin=i.crossOrigin),r.push(a)}for(const o of s.css??[]){const i=tt(o);if(e.inlineCss?.styles[i]!==void 0)continue;const a=Ee(o),c={href:i,rel:"preload",as:"style"};a.crossOrigin!==void 0&&(c.crossOrigin=a.crossOrigin),r.push(c)}}}return r}function _t(e){const t=[];for(const r of e){const n=r.links;if(Array.isArray(n))for(const s of n){const o=zt(s);o&&t.push(o)}}return t}function Jt(e){const t=[],r=[];for(const n of e.hints){const s=be(n);e.sentLinks.has(s)||(e.sentLinks.add(s),e.sentHints.push(n),t.push(n),r.push(s))}if(!(!t.length&&e.phase!=="dynamic"))return{phase:e.phase,hints:t,links:r,allHints:e.sentHints.slice(),allLinks:Array.from(e.sentLinks)}}function Bt(e){for(const t of e.hints){const r=be(t);e.sentLinks.has(r)||(e.sentLinks.add(r),e.entries.push({phase:e.phase,hint:t,link:r}))}}function Gt(e){if(!e.filter)return e.entries.map(t=>t.link);try{const t=[];for(const r of e.entries)e.filter(r)&&t.push(r.link);return t}catch(t){return console.error("Error filtering response Link headers:",t),[]}}function Wt(e,t,r){try{const n=r(t);n&&Promise.resolve(n).catch(s=>{console.error(`Error sending ${e} early hints:`,s)})}catch(n){console.error(`Error sending ${e} early hints:`,n)}}function Kt(e){if(typeof e=="object")return e.filter}function Vt(e){for(const t of Gt(e))e.responseHeaders.append("Link",t)}function Xt(e){for(let t=0;t<e.event.hints.length;t++)e.entries.push({phase:e.phase,hint:e.event.hints[t],link:e.event.links[t]})}function me(e){const t=e.onEarlyHints?Jt({phase:e.phase,hints:e.hints,sentLinks:e.sentLinks,sentHints:e.sentHints}):void 0;if(t&&Wt(e.phase,t,e.onEarlyHints),!!e.responseLinkHeaderEntries){if(t){Xt({phase:e.phase,event:t,entries:e.responseLinkHeaderEntries});return}Bt({phase:e.phase,hints:e.hints,sentLinks:e.sentLinks,entries:e.responseLinkHeaderEntries})}}function Yt(e){if(!e?.onEarlyHints&&!e?.responseLinkHeader)return;const t=new Set,r=e.onEarlyHints?new Array:void 0,n=e.responseLinkHeader?new Array:void 0,s=Kt(e.responseLinkHeader);return{collectStatic:({manifest:o,matchedRoutes:i})=>{i?.length&&me({phase:"static",hints:Ut(o,i),sentLinks:t,sentHints:r,onEarlyHints:e.onEarlyHints,responseLinkHeaderEntries:n})},collectDynamic:o=>{me({phase:"dynamic",hints:_t(o),sentLinks:t,sentHints:r,onEarlyHints:e.onEarlyHints,responseLinkHeaderEntries:n})},appendResponseHeaders:o=>{n?.length&&Vt({responseHeaders:o,entries:n,filter:s})}}}function Q(e){return typeof e=="string"?{href:e}:e}function Zt(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\a ").replace(/\r/g,"\\d ").replace(/\f/g,"\\c ")}async function Qt(e){const{strings:t,urls:r}=e.template;if(t.length!==r.length+1)throw new Error(`TanStack Start inlineCss template for ${e.stylesheetHref} is invalid`);let n=t[0];for(let s=0;s<r.length;s++){const o=Q(await e.transformFn({kind:"css-url",url:r[s],stylesheetHref:e.stylesheetHref}));n+=Zt(o.href)+t[s+1]}return n}async function er(e,t){const r={},n=await Promise.all(Object.entries(e.styles).map(async([s,o])=>{const i=e.templates?.[s];return[s,i?await Qt({stylesheetHref:s,template:i,transformFn:t}):o]}));for(const[s,o]of n)r[s]=o;return{styles:r,...e.templates?{templates:e.templates}:{}}}function tr(e,t){if(e)return typeof e=="string"?e:e[t]}function rr(e){return"prefix"in e}function nr(e){if(typeof e=="string"){const t=e;return{type:"transform",transformFn:({url:r})=>({href:`${t}${r}`}),cache:!0}}if(typeof e=="function")return{type:"transform",transformFn:e,cache:!0};if(rr(e)){const{prefix:t,crossOrigin:r}=e;return{type:"transform",transformFn:({url:n,kind:s})=>{const o=`${t}${n}`;if(s==="css-url")return{href:o};const i=tr(r,s);return i?{href:o,crossOrigin:i}:{href:o}},cache:!0}}return"createTransform"in e&&e.createTransform?{type:"createTransform",createTransform:e.createTransform,cache:e.cache!==!1}:{type:"transform",transformFn:typeof e.transform=="string"?(({url:t})=>({href:`${e.transform}${t}`})):e.transform,cache:e.cache!==!1}}function ge(e,t){if(typeof e=="string")return t.crossOrigin?t:t.href;const r={...e,href:t.href};return t.crossOrigin?r.crossOrigin=t.crossOrigin:delete r.crossOrigin,r}async function sr(e,t,r){const n=structuredClone(e),s=r?.inlineCss!==!1,o=new Map,i=a=>{const c=o.get(a);if(c)return c;const u=Promise.resolve(t({url:a,kind:"script"})).then(Q);return o.set(a,u),u};s?n.inlineCss&&(n.inlineCss=await er(n.inlineCss,t)):delete n.inlineCss;for(const a of Object.values(n.routes))if(a.preloads?.length&&(a.preloads=await Promise.all(a.preloads.map(async c=>{const u=await i($e(c).href);return ge(c,{href:u.href,crossOrigin:u.crossOrigin})}))),a.css?.length&&!n.inlineCss&&(a.css=await Promise.all(a.css.map(async c=>{const u=Q(await t({url:Ee(c).href,kind:"stylesheet"}));return ge(c,{href:u.href,crossOrigin:u.crossOrigin})}))),a.scripts?.length)for(const c of a.scripts){const u=c.attrs?.src;if(typeof u!="string")continue;const y=await i(u);c.attrs={...c.attrs,src:y.href},y.crossOrigin?c.attrs.crossOrigin=y.crossOrigin:delete c.attrs.crossOrigin}return n}function or(e,t){return{...e.scriptFormat?{scriptFormat:e.scriptFormat}:{},...t?.inlineCss!==!1&&e.inlineCss?{inlineCss:structuredClone(e.inlineCss)}:{},routes:{...e.routes}}}function ir(e){if(typeof e!="function")return e??!0}async function ar(e){return e.requestInlineCss!==void 0?e.requestInlineCss:typeof e.handlerInlineCss=="function"?await e.handlerInlineCss({request:e.request}):e.handlerInlineCss??!0}function cr(e){let t;return()=>(t||(t=e().catch(r=>{throw t=void 0,r})),t)}function ur(e,t){const r=e!==void 0?nr(e):void 0,n=r?r.cache:!0,s=!!e&&typeof e=="object"&&"warmup"in e&&e.warmup===!0;let o;const i=()=>{o=void 0};return{cache:n,warmup:s,clearCachedCreateTransform:i,getTransformFn:async a=>{if(r)return r.type!=="createTransform"?r.transformFn:n?(o||(o=Promise.resolve(r.createTransform(a)).catch(c=>{throw i(),c})),o):r.createTransform(a)}}}function fr(e){const t=new Map,r=ur(e.transformAssets),n=ir(e.inlineCss),s=async i=>{const a=await r.getTransformFn({warmup:!1,request:i.request}),c=await ar({request:i.request,handlerInlineCss:e.inlineCss,requestInlineCss:i.requestInlineCss});return{getBaseManifest:i.getBaseManifest,transformFn:a,cache:r.cache,inlineCss:c}},o=async(i,a)=>pr({...await s(i),finalManifestCache:a});return{warmup:({getBaseManifest:i})=>dr({enabled:r.warmup,handlerDefaultInlineCss:n,cache:r.cache,finalManifestCache:t,getBaseManifest:i,getTransformFn:()=>r.getTransformFn({warmup:!0}),onError:r.clearCachedCreateTransform}),resolveCached:i=>o(i,t),resolveUncached:i=>o(i,void 0)}}function Le(e){return e?"inline-css":"linked-css"}function lr(e,t,r){const n=r.catch(s=>{throw e.get(t)===n&&e.delete(t),s});return e.set(t,n),n}function Fe(e,t,r){return e.get(t)||lr(e,t,Promise.resolve().then(r))}async function qe(e){return e.transformFn?await sr(e.base,e.transformFn,{inlineCss:e.inlineCss}):or(e.base,{inlineCss:e.inlineCss})}async function pr(e){const t=async()=>qe({base:await e.getBaseManifest(),transformFn:e.transformFn,inlineCss:e.inlineCss});return e.finalManifestCache&&(!e.transformFn||e.cache)?Fe(e.finalManifestCache,Le(e.inlineCss),t):t()}function dr(e){if(!e.enabled||e.handlerDefaultInlineCss===void 0||!e.cache)return;const t=e.handlerDefaultInlineCss,r=Fe(e.finalManifestCache,Le(t),async()=>{const[n,s]=await Promise.all([e.getBaseManifest(),e.getTransformFn()]);return qe({base:n,transformFn:s,inlineCss:t})});return e.onError&&r.catch(e.onError),r}var hr=We({key:"$TSS/serverfn",test:e=>typeof e!="function"||!(le in e)?!1:!!e[le],toSerializable:({serverFnMeta:e})=>({functionId:e.id}),fromSerializable:({functionId:e})=>async(t,r)=>(await(await Oe(e))(t??{},r)).result});function yr(e){return Xe({"Content-Type":"text/html; charset=utf-8"},...e.router.stores.matches.get().map(t=>t.headers))}var J,mr=Rt({filter:e=>e.handlerType==="serverFn"}),gr=cr(()=>ht()),wr=()=>gr(),we=wr,vr=Yt;async function Sr(){const[e,t,r]=await Promise.all([import("./router-Cj54mKkM.mjs"),import("./start-CbEonH-m.mjs"),import("./empty-plugin-adapters-C3Q1xu4u.mjs")]);return{routerEntry:e,startEntry:t,pluginAdapters:r}}function Rr(){return J||(J=Sr()),J}var Er="/",B="/_serverFn/",ve=process.env.TSS_PRERENDERING==="true",Cr=process.env.TSS_SHELL==="true",xr="Internal Server Error",kr="Internal Server Error";function ne(){throw new Error(xr)}function Or(){throw new Error(kr)}function Ae(e){return e instanceof Response||re(e)}function Hr(e){return Ce(e)||Ae(e)?{response:e}:e}async function ee(e,t){let r=-1,n;const s=c=>{if(Ce(c)){c.serverSsrCleanup==="stream"&&(n=c),t.response=c.response;return}t.response=c},o=async c=>{const u=n;if(!u)return;n=void 0;const y=t.response;(y===u.response||y instanceof Response&&u.response.body!==null&&y.body===u.response.body)&&(t.response=void 0),await u.dispose(c)},i=async()=>{const c=t.response;return c||ne(),n?c===n.response?n:n.response.body!==null&&c.body===n.response.body?{...n,response:c}:(await o("middleware response replaced"),c):c},a=async c=>{if(c){c.context&&(t.context=M(t.context,c.context));for(const f of Object.keys(c))f==="response"?s(c.response):f!=="context"&&(t[f]=c[f])}r++;const u=e[r];if(!u)return t;let y;try{y=await u({...t,next:a})}catch(f){if(Ae(f))return s(f),t;throw await o("middleware error"),f}const l=Hr(y);return l&&(l.response!==void 0&&s(l.response),l.context&&(t.context=M(t.context,l.context))),t};return await a(),{ctx:t,response:await i()}}function Se(e,t=!1){return t?e:async r=>{const n=await e({...r,next:Or});return n||ne(),n}}function Tr(e){const t=typeof e=="function"?{}:e,r=typeof e=="function"?e:e.handler,n=fr({...t}),s=n.resolveCached;return n.warmup({getBaseManifest:()=>we()}),lt(async(o,i)=>{let a=null,c=!1;try{const{url:u,handledProtocolRelativeURL:y}=De(o.url),l=u.pathname+u.search+u.hash,f=ze(o);if(y)return Response.redirect(u,308);const p=await Rr(),d=!!p.startEntry.startInstance,v=await p.startEntry.startInstance?.getOptions()||{},{hasPluginAdapters:C,pluginSerializationAdapters:h}=p.pluginAdapters,E=[...v.serializationAdapters||[],...C?h:[],hr],g={...v,requestMiddleware:d?v.requestMiddleware:[mr],serializationAdapters:E},R=g.requestMiddleware?Z(g.requestMiddleware):[],k=new Set(R),S=async()=>{if(a)return a;a=await p.routerEntry.getRouter();let m=Cr;ve&&!m&&(m=o.headers.get(dt.TSS_SHELL)==="true");const x=st({initialEntries:[l]});return a.update({history:x,isShell:m,isPrerendering:ve,origin:a.options.origin??f,defaultSsr:g.defaultSsr,serializationAdapters:[...g.serializationAdapters,...a.options.serializationAdapters||[]],basepath:Er}),a};if(B&&u.pathname.startsWith(B)){const m=u.pathname.slice(B.length).split("/")[0];if(!m)throw new Error("Invalid server action param for serverFnId");const x=async({context:T})=>he({getRouter:S,startOptions:g,contextAfterGlobalMiddlewares:T,request:o,executedRequestMiddlewares:k,handlerType:"serverFn"},()=>jt({request:o,context:i?.context,serverFnId:m})),{response:D}=await ee([...R.map(T=>T.options.server),x],{request:o,pathname:u.pathname,handlerType:"serverFn",context:de(i?.context)}),F=await te(D,o,S);return c=F.serverSsrCleanup==="stream",F.response}const I=async(m,x)=>{const D=(o.headers.get("Accept")||"*/*").split(",");if(!["*/*","text/html"].some(Pe=>D.some(je=>je.trim().startsWith(Pe))))return A(Response.json({error:"Only HTML requests are supported here"},{status:500}));const F=await s({request:o,requestInlineCss:i?.inlineCss,getBaseManifest:()=>we(x)}),T=vr({onEarlyHints:i?.onEarlyHints,responseLinkHeader:i?.responseLinkHeader});T?.collectStatic({manifest:F,matchedRoutes:x});const O=await S();if(Ue({router:O,manifest:F,getRequestAssets:()=>Y({throwIfNotFound:!1})?.requestAssets}),O.options.additionalContext={serverContext:m},await O.load(),O.state.redirect)return A(O.state.redirect);T?.collectDynamic(O.stores.matches.get());const Me=Y({throwIfNotFound:!1});await O.serverSsr.dehydrate({requestAssets:Me?.requestAssets});const se=yr({router:O});return T?.appendResponseHeaders(se),A(await r({request:o,router:O,responseHeaders:se}))},N=async({context:m})=>he({getRouter:S,startOptions:g,contextAfterGlobalMiddlewares:m,request:o,executedRequestMiddlewares:k,handlerType:"router"},async()=>{try{return await br({getRouter:S,request:o,url:u,executeRouter:I,context:m,executedRequestMiddlewares:k})}catch(x){if(x instanceof Response)return x;throw x}}),{response:$}=await ee([...R.map(m=>m.options.server),N],{request:o,pathname:u.pathname,handlerType:"router",context:de(i?.context)}),w=await te($,o,S);return c=w.serverSsrCleanup==="stream",w.response}finally{a?.serverSsr&&!c&&a.serverSsr.cleanup(),a=null}})}async function te(e,t,r){const n=A(e);if(!re(n.response))return n;if(_e(n.response))return t.headers.get("x-tsr-serverFn")==="true"?z(n,Response.json({...n.response.options,isSerializedRedirect:!0},{headers:n.response.headers}),"redirect response replaced"):n;const s=n.response.options;if(s.to&&typeof s.to=="string"&&!s.to.startsWith("/"))throw new Error(`Server side redirects must use absolute paths via the 'href' or 'to' options. The redirect() method's "to" property accepts an internal path only. Use the "href" property to provide an external URL. Received: ${JSON.stringify(s)}`);if(["params","search","hash"].some(i=>typeof s[i]=="function"))throw new Error(`Server side redirects must use static search, params, and hash values and do not support functional values. Received functional values for: ${Object.keys(s).filter(i=>typeof s[i]=="function").map(i=>`"${i}"`).join(", ")}`);const o=(await r()).resolveRedirect(n.response);return t.headers.get("x-tsr-serverFn")==="true"?z(n,Response.json({...n.response.options,isSerializedRedirect:!0},{headers:n.response.headers}),"redirect response replaced"):z(n,o,"redirect response replaced")}async function br({getRouter:e,request:t,url:r,executeRouter:n,context:s,executedRequestMiddlewares:o}){const i=await e(),a=Je(i.rewrite,r).pathname,{matchedRoutes:c,foundRoute:u,routeParams:y}=i.getMatchedRoutes(a),l=u&&y["**"]===void 0,f=[];for(const h of c){const E=h.options.server?.middleware;if(E){const g=Z(E);for(const R of g)o.has(R)||f.push(R.options.server)}}const p=u?.options.server;let d=!1;if(p?.handlers&&l){const h=typeof p.handlers=="function"?p.handlers({createHandlers:R=>R}):p.handlers,E=t.method.toUpperCase(),g=E==="HEAD"?h.HEAD??h.GET??h.ANY:h[E]??h.ANY;if(d=E==="HEAD"&&g!==void 0&&!h.HEAD,g){const R=!!u.options.component;if(typeof g=="function")f.push(Se(g,R));else{if(g.middleware?.length){const k=Z(g.middleware);for(const S of k)f.push(S.options.server)}g.handler&&f.push(Se(g.handler,R))}}}f.push((h=>n(h.context,c)));const{ctx:v,response:C}=await ee(f,{request:t,context:s,params:y,pathname:a,handlerType:"router"});return d?(v.response||ne(),Be(await te(C,t,e),"HEAD body stripped")):A(C)}const Lr=Tr(ct);function Fr(e){return{async fetch(...t){return await e.fetch(...t)}}}const tn=Fr({fetch:Lr});export{q as c,Fr as createServerEntry,tn as default};
|