@rizom/ops 0.2.0-alpha.7 → 0.2.0-alpha.700
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/README.md +89 -4
- package/dist/age-key-bootstrap.d.ts +17 -0
- package/dist/brains-ops.js +763 -177
- package/dist/capability-bundle-migration.d.ts +26 -0
- package/dist/cert-bootstrap.d.ts +6 -4
- package/dist/content-repo-ref.d.ts +10 -0
- package/dist/content-repo.d.ts +13 -0
- package/dist/default-user-runner.d.ts +1 -1
- package/dist/deploy.js +110 -166
- package/dist/directory-sync-stress-system.d.ts +75 -0
- package/dist/directory-sync-stress.d.ts +117 -0
- package/dist/entries/deploy.d.ts +4 -2
- package/dist/health-watchdog-smoke.d.ts +54 -0
- package/dist/image-inventory.d.ts +4 -0
- package/dist/image-types.d.ts +7 -0
- package/dist/images.d.ts +89 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +775 -177
- package/dist/legacy-pilot-migration.d.ts +11 -0
- package/dist/legacy-projection-job-recovery.d.ts +29 -0
- package/dist/load-registry.d.ts +92 -8
- package/dist/observed-status.d.ts +1 -1
- package/dist/onboard-user.d.ts +2 -2
- package/dist/parse-args.d.ts +2 -10
- package/dist/preview-domain.d.ts +9 -0
- package/dist/provider-key-migration.d.ts +20 -0
- package/dist/reconcile-all.d.ts +2 -2
- package/dist/reconcile-cohort.d.ts +2 -2
- package/dist/reconcile-dry-run.d.ts +9 -0
- package/dist/reconcile-lib.d.ts +4 -2
- package/dist/run-command.d.ts +22 -6
- package/dist/runtime-image-lock.d.ts +12 -0
- package/dist/schema.d.ts +145 -71
- package/dist/secrets-encrypt.d.ts +27 -0
- package/dist/secrets-push.d.ts +2 -2
- package/dist/ssh-key-bootstrap.d.ts +1 -26
- package/dist/stage-legacy-crossover.d.ts +25 -0
- package/dist/stress-command.d.ts +14 -0
- package/dist/stress-git-checkout.d.ts +21 -0
- package/dist/stress-health-monitor.d.ts +56 -0
- package/dist/upgrade.d.ts +10 -0
- package/dist/user-add.d.ts +16 -0
- package/dist/user-offboard.d.ts +61 -0
- package/dist/user-runner.d.ts +5 -0
- package/dist/verify-user.d.ts +22 -0
- package/package.json +51 -40
- package/templates/rover-pilot/.env.schema +38 -4
- package/templates/rover-pilot/.github/actions/varlock-env/action.yml +47 -0
- package/templates/rover-pilot/.github/workflows/build.yml +71 -17
- package/templates/rover-pilot/.github/workflows/deploy.yml +127 -49
- package/templates/rover-pilot/.github/workflows/directory-sync-stress.yml +119 -0
- package/templates/rover-pilot/.github/workflows/health-watchdog-smoke.yml +95 -0
- package/templates/rover-pilot/.github/workflows/offboard.yml +107 -0
- package/templates/rover-pilot/.github/workflows/reconcile.yml +23 -3
- package/templates/rover-pilot/.github/workflows/upgrade.yml +104 -0
- package/templates/rover-pilot/README.md +19 -8
- package/templates/rover-pilot/deploy/scripts/create-predeploy-backup.ts +962 -0
- package/templates/rover-pilot/deploy/scripts/decrypt-user-secrets.ts +139 -0
- package/templates/rover-pilot/deploy/scripts/helpers.ts +3 -0
- package/templates/rover-pilot/deploy/scripts/install-health-watchdog.ts +144 -0
- package/templates/rover-pilot/deploy/scripts/provision-server.ts +52 -22
- package/templates/rover-pilot/deploy/scripts/pull-local-models.ts +69 -0
- package/templates/rover-pilot/deploy/scripts/resolve-deploy-handles.ts +19 -4
- package/templates/rover-pilot/deploy/scripts/resolve-missing-images.ts +13 -0
- package/templates/rover-pilot/deploy/scripts/resolve-user-config.ts +71 -14
- package/templates/rover-pilot/deploy/scripts/sync-content-repo.ts +183 -0
- package/templates/rover-pilot/deploy/scripts/update-dns.ts +72 -16
- package/templates/rover-pilot/deploy/scripts/validate-secrets.ts +12 -1
- package/templates/rover-pilot/deploy/scripts/verify-runtime-image.ts +18 -0
- package/templates/rover-pilot/docs/canonical-crossover-record.md +107 -0
- package/templates/rover-pilot/docs/onboarding-checklist.md +39 -14
- package/templates/rover-pilot/docs/operator-playbook.md +421 -22
- package/templates/rover-pilot/docs/user-onboarding.md +49 -271
- package/templates/rover-pilot/package.json +4 -0
- package/templates/rover-pilot/pilot.yaml +10 -4
- package/templates/rover-pilot/users/alice.yaml +5 -1
- package/dist/origin-ca.d.ts +0 -1
- package/dist/push-secrets.d.ts +0 -9
- package/dist/push-target.d.ts +0 -2
- package/dist/run-subprocess.d.ts +0 -5
- package/dist/user-secret-names.d.ts +0 -6
- package/templates/rover-pilot/.kamal/hooks/pre-deploy +0 -9
- package/templates/rover-pilot/deploy/Caddyfile +0 -66
- package/templates/rover-pilot/deploy/Dockerfile +0 -38
- package/templates/rover-pilot/deploy/kamal/deploy.yml +0 -39
package/dist/brains-ops.js
CHANGED
|
@@ -1,180 +1,766 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var jG=Object.create;var{getPrototypeOf:PG,defineProperty:t5,getOwnPropertyNames:LG}=Object;var ZG=Object.prototype.hasOwnProperty;function CG(q){return this[q]}var EG,TG,e5=(q,$,J)=>{var G=q!=null&&typeof q==="object";if(G){var X=$?EG??=new WeakMap:TG??=new WeakMap,Y=X.get(q);if(Y)return Y}J=q!=null?jG(PG(q)):{};let U=$||!q||!q.__esModule?t5(J,"default",{value:q,enumerable:!0}):J;for(let Q of LG(q))if(!ZG.call(U,Q))t5(U,Q,{get:CG.bind(q,Q),enumerable:!0});if(G)X.set(q,U);return U};var m=(q,$)=>()=>($||q(($={exports:{}}).exports,$),$.exports);var _G=(q)=>q;function bG(q,$){this[q]=_G.bind(null,$)}var eJ=(q,$)=>{for(var J in $)t5(q,J,{get:$[J],enumerable:!0,configurable:!0,set:bG.bind($,J)})};var W1=import.meta.require;var W$=m((Uw,M3)=>{var aX=Object.prototype.toString;M3.exports=function($){if($===void 0)return"undefined";if($===null)return"null";var J=typeof $;if(J==="boolean")return"boolean";if(J==="string")return"string";if(J==="number")return"number";if(J==="symbol")return"symbol";if(J==="function")return $Y($)?"generatorfunction":"function";if(sX($))return"array";if(XY($))return"buffer";if(GY($))return"arguments";if(eX($))return"date";if(tX($))return"error";if(qY($))return"regexp";switch(z3($)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(JY($))return"generator";switch(J=aX.call($),J){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return J.slice(8,-1).toLowerCase().replace(/\s/g,"")};function z3(q){return typeof q.constructor==="function"?q.constructor.name:null}function sX(q){if(Array.isArray)return Array.isArray(q);return q instanceof Array}function tX(q){return q instanceof Error||typeof q.message==="string"&&q.constructor&&typeof q.constructor.stackTraceLimit==="number"}function eX(q){if(q instanceof Date)return!0;return typeof q.toDateString==="function"&&typeof q.getDate==="function"&&typeof q.setDate==="function"}function qY(q){if(q instanceof RegExp)return!0;return typeof q.flags==="string"&&typeof q.ignoreCase==="boolean"&&typeof q.multiline==="boolean"&&typeof q.global==="boolean"}function $Y(q,$){return z3(q)==="GeneratorFunction"}function JY(q){return typeof q.throw==="function"&&typeof q.return==="function"&&typeof q.next==="function"}function GY(q){try{if(typeof q.length==="number"&&typeof q.callee==="function")return!0}catch($){if($.message.indexOf("callee")!==-1)return!0}return!1}function XY(q){if(q.constructor&&typeof q.constructor.isBuffer==="function")return q.constructor.isBuffer(q);return!1}});var B3=m((Qw,R3)=>{/*!
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
`)
|
|
10
|
-
`)
|
|
11
|
-
`)
|
|
12
|
-
|
|
13
|
-
`)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
`).map(($)=>$.trim()).join(" ")};P8.O=function(q){return this.inspectOpts.colors=this.useColors,P5.inspect(q,this.inspectOpts)}});var E8=m((BS,o2)=>{if(typeof process>"u"||process.type==="renderer"||!1||process.__nwjs)o2.exports=F8();else o2.exports=C8()});var Z6=m((pL,L6)=>{var y5=Object.prototype.hasOwnProperty,P6=Object.prototype.toString,F6=Object.defineProperty,O6=Object.getOwnPropertyDescriptor,A6=function($){if(typeof Array.isArray==="function")return Array.isArray($);return P6.call($)==="[object Array]"},N6=function($){if(!$||P6.call($)!=="[object Object]")return!1;var J=y5.call($,"constructor"),G=$.constructor&&$.constructor.prototype&&y5.call($.constructor.prototype,"isPrototypeOf");if($.constructor&&!J&&!G)return!1;var X;for(X in $);return typeof X>"u"||y5.call($,X)},S6=function($,J){if(F6&&J.name==="__proto__")F6($,J.name,{enumerable:!0,configurable:!0,value:J.newValue,writable:!0});else $[J.name]=J.newValue},j6=function($,J){if(J==="__proto__"){if(!y5.call($,J))return;else if(O6)return O6($,J).value}return $[J]};L6.exports=function q(){var $,J,G,X,Y,U,Q=arguments[0],V=1,W=arguments.length,H=!1;if(typeof Q==="boolean")H=Q,Q=arguments[1]||{},V=2;if(Q==null||typeof Q!=="object"&&typeof Q!=="function")Q={};for(;V<W;++V)if($=arguments[V],$!=null){for(J in $)if(G=j6(Q,J),X=j6($,J),Q!==X){if(H&&X&&(N6(X)||(Y=A6(X)))){if(Y)Y=!1,U=G&&A6(G)?G:[];else U=G&&N6(G)?G:{};S6(Q,{name:J,newValue:q(H,U,X)})}else if(typeof X<"u")S6(Q,{name:J,newValue:X})}}return Q}});import{parseArgs as IG}from"util";var gG={help:{type:"boolean",short:"h"},version:{type:"boolean",short:"v"},"dry-run":{type:"boolean"},"push-to":{type:"string"}};function q2(q,$){let J=q[$];return typeof J==="boolean"?J:void 0}function vG(q,$){let J=q[$];return typeof J==="string"?J:void 0}function q3(q){let{values:$,positionals:J}=IG({args:q,options:gG,allowPositionals:!0});if($.help)return{command:"help",args:[],flags:{help:!0}};if($.version)return{command:"version",args:[],flags:{version:!0}};return{command:J[0]??"help",args:J.slice(1),flags:{help:q2($,"help"),version:q2($,"version"),dryRun:q2($,"dry-run"),pushTo:vG($,"push-to")}}}var l$={name:"@rizom/ops",description:"Operator CLI for managing private brain fleet registry repos",publishConfig:{access:"public"},version:"0.2.0-alpha.7",type:"module",exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./deploy":{bun:"./dist/deploy.js",types:"./dist/deploy.d.ts",import:"./dist/deploy.js"}},main:"./dist/index.js",types:"./dist/index.d.ts",bin:{"brains-ops":"./dist/brains-ops.js"},files:["dist","templates"],scripts:{build:"bun scripts/build.ts",prepublishOnly:"bun scripts/build.ts",typecheck:"tsc --noEmit",lint:"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix",test:"bun test"},dependencies:{},devDependencies:{"@brains/eslint-config":"workspace:*","@brains/typescript-config":"workspace:*","@brains/utils":"workspace:*","@types/bun":"latest",typescript:"^5.3.3"},repository:{type:"git",url:"https://github.com/rizom-ai/brains.git",directory:"packages/brains-ops"},license:"Apache-2.0",author:"Yeehaa <yeehaa@rizom.ai> (https://rizom.ai)",homepage:"https://github.com/rizom-ai/brains/tree/main/packages/brains-ops#readme",bugs:"https://github.com/rizom-ai/brains/issues",engines:{bun:">=1.3.3"},keywords:["brains","ops","cli","deploy","fleet","operator"]};import{mkdir as iB,writeFile as t7}from"fs/promises";import{dirname as dB,join as e7}from"path";var E={};eJ(E,{void:()=>OX,util:()=>o,unknown:()=>wX,union:()=>jX,undefined:()=>RX,tuple:()=>ZX,transformer:()=>hX,symbol:()=>MX,string:()=>W3,strictObject:()=>SX,setErrorMap:()=>mG,set:()=>TX,record:()=>CX,quotelessJson:()=>hG,promise:()=>yX,preprocess:()=>kX,pipeline:()=>fX,ostring:()=>uX,optional:()=>xX,onumber:()=>pX,oboolean:()=>lX,objectUtil:()=>$2,object:()=>NX,number:()=>H3,nullable:()=>mX,null:()=>BX,never:()=>FX,nativeEnum:()=>vX,nan:()=>HX,map:()=>EX,makeIssue:()=>J$,literal:()=>IX,lazy:()=>bX,late:()=>VX,isValid:()=>D1,isDirty:()=>i$,isAsync:()=>K0,isAborted:()=>r$,intersection:()=>LX,instanceof:()=>WX,getParsedType:()=>tq,getErrorMap:()=>H0,function:()=>_X,enum:()=>gX,effect:()=>hX,discriminatedUnion:()=>PX,defaultErrorMap:()=>H1,datetimeRegex:()=>U3,date:()=>zX,custom:()=>V3,coerce:()=>rX,boolean:()=>K3,bigint:()=>KX,array:()=>AX,any:()=>DX,addIssueToContext:()=>b,ZodVoid:()=>X$,ZodUnknown:()=>w1,ZodUnion:()=>w0,ZodUndefined:()=>B0,ZodType:()=>c,ZodTuple:()=>q1,ZodTransformer:()=>cq,ZodSymbol:()=>G$,ZodString:()=>lq,ZodSet:()=>k1,ZodSchema:()=>c,ZodRecord:()=>Y$,ZodReadonly:()=>P0,ZodPromise:()=>f1,ZodPipeline:()=>V$,ZodParsedType:()=>T,ZodOptional:()=>iq,ZodObject:()=>Uq,ZodNumber:()=>F1,ZodNullable:()=>z1,ZodNull:()=>D0,ZodNever:()=>eq,ZodNativeEnum:()=>N0,ZodNaN:()=>Q$,ZodMap:()=>U$,ZodLiteral:()=>A0,ZodLazy:()=>O0,ZodIssueCode:()=>Z,ZodIntersection:()=>F0,ZodFunction:()=>M0,ZodFirstPartyTypeKind:()=>u,ZodError:()=>Aq,ZodEnum:()=>A1,ZodEffects:()=>cq,ZodDiscriminatedUnion:()=>d$,ZodDefault:()=>S0,ZodDate:()=>x1,ZodCatch:()=>j0,ZodBranded:()=>c$,ZodBoolean:()=>R0,ZodBigInt:()=>O1,ZodArray:()=>rq,ZodAny:()=>m1,Schema:()=>c,ParseStatus:()=>wq,OK:()=>Nq,NEVER:()=>iX,INVALID:()=>k,EMPTY_PATH:()=>kG,DIRTY:()=>h1,BRAND:()=>QX});var o;(function(q){q.assertEqual=(X)=>{};function $(X){}q.assertIs=$;function J(X){throw Error()}q.assertNever=J,q.arrayToEnum=(X)=>{let Y={};for(let U of X)Y[U]=U;return Y},q.getValidEnumValues=(X)=>{let Y=q.objectKeys(X).filter((Q)=>typeof X[X[Q]]!=="number"),U={};for(let Q of Y)U[Q]=X[Q];return q.objectValues(U)},q.objectValues=(X)=>{return q.objectKeys(X).map(function(Y){return X[Y]})},q.objectKeys=typeof Object.keys==="function"?(X)=>Object.keys(X):(X)=>{let Y=[];for(let U in X)if(Object.prototype.hasOwnProperty.call(X,U))Y.push(U);return Y},q.find=(X,Y)=>{for(let U of X)if(Y(U))return U;return},q.isInteger=typeof Number.isInteger==="function"?(X)=>Number.isInteger(X):(X)=>typeof X==="number"&&Number.isFinite(X)&&Math.floor(X)===X;function G(X,Y=" | "){return X.map((U)=>typeof U==="string"?`'${U}'`:U).join(Y)}q.joinValues=G,q.jsonStringifyReplacer=(X,Y)=>{if(typeof Y==="bigint")return Y.toString();return Y}})(o||(o={}));var $2;(function(q){q.mergeShapes=($,J)=>{return{...$,...J}}})($2||($2={}));var T=o.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),tq=(q)=>{switch(typeof q){case"undefined":return T.undefined;case"string":return T.string;case"number":return Number.isNaN(q)?T.nan:T.number;case"boolean":return T.boolean;case"function":return T.function;case"bigint":return T.bigint;case"symbol":return T.symbol;case"object":if(Array.isArray(q))return T.array;if(q===null)return T.null;if(q.then&&typeof q.then==="function"&&q.catch&&typeof q.catch==="function")return T.promise;if(typeof Map<"u"&&q instanceof Map)return T.map;if(typeof Set<"u"&&q instanceof Set)return T.set;if(typeof Date<"u"&&q instanceof Date)return T.date;return T.object;default:return T.unknown}};var Z=o.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),hG=(q)=>{return JSON.stringify(q,null,2).replace(/"([^"]+)":/g,"$1:")};class Aq extends Error{get errors(){return this.issues}constructor(q){super();this.issues=[],this.addIssue=(J)=>{this.issues=[...this.issues,J]},this.addIssues=(J=[])=>{this.issues=[...this.issues,...J]};let $=new.target.prototype;if(Object.setPrototypeOf)Object.setPrototypeOf(this,$);else this.__proto__=$;this.name="ZodError",this.issues=q}format(q){let $=q||function(X){return X.message},J={_errors:[]},G=(X)=>{for(let Y of X.issues)if(Y.code==="invalid_union")Y.unionErrors.map(G);else if(Y.code==="invalid_return_type")G(Y.returnTypeError);else if(Y.code==="invalid_arguments")G(Y.argumentsError);else if(Y.path.length===0)J._errors.push($(Y));else{let U=J,Q=0;while(Q<Y.path.length){let V=Y.path[Q];if(Q!==Y.path.length-1)U[V]=U[V]||{_errors:[]};else U[V]=U[V]||{_errors:[]},U[V]._errors.push($(Y));U=U[V],Q++}}};return G(this),J}static assert(q){if(!(q instanceof Aq))throw Error(`Not a ZodError: ${q}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,o.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(q=($)=>$.message){let $={},J=[];for(let G of this.issues)if(G.path.length>0){let X=G.path[0];$[X]=$[X]||[],$[X].push(q(G))}else J.push(q(G));return{formErrors:J,fieldErrors:$}}get formErrors(){return this.flatten()}}Aq.create=(q)=>{return new Aq(q)};var xG=(q,$)=>{let J;switch(q.code){case Z.invalid_type:if(q.received===T.undefined)J="Required";else J=`Expected ${q.expected}, received ${q.received}`;break;case Z.invalid_literal:J=`Invalid literal value, expected ${JSON.stringify(q.expected,o.jsonStringifyReplacer)}`;break;case Z.unrecognized_keys:J=`Unrecognized key(s) in object: ${o.joinValues(q.keys,", ")}`;break;case Z.invalid_union:J="Invalid input";break;case Z.invalid_union_discriminator:J=`Invalid discriminator value. Expected ${o.joinValues(q.options)}`;break;case Z.invalid_enum_value:J=`Invalid enum value. Expected ${o.joinValues(q.options)}, received '${q.received}'`;break;case Z.invalid_arguments:J="Invalid function arguments";break;case Z.invalid_return_type:J="Invalid function return type";break;case Z.invalid_date:J="Invalid date";break;case Z.invalid_string:if(typeof q.validation==="object")if("includes"in q.validation){if(J=`Invalid input: must include "${q.validation.includes}"`,typeof q.validation.position==="number")J=`${J} at one or more positions greater than or equal to ${q.validation.position}`}else if("startsWith"in q.validation)J=`Invalid input: must start with "${q.validation.startsWith}"`;else if("endsWith"in q.validation)J=`Invalid input: must end with "${q.validation.endsWith}"`;else o.assertNever(q.validation);else if(q.validation!=="regex")J=`Invalid ${q.validation}`;else J="Invalid";break;case Z.too_small:if(q.type==="array")J=`Array must contain ${q.exact?"exactly":q.inclusive?"at least":"more than"} ${q.minimum} element(s)`;else if(q.type==="string")J=`String must contain ${q.exact?"exactly":q.inclusive?"at least":"over"} ${q.minimum} character(s)`;else if(q.type==="number")J=`Number must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${q.minimum}`;else if(q.type==="bigint")J=`Number must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${q.minimum}`;else if(q.type==="date")J=`Date must be ${q.exact?"exactly equal to ":q.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(q.minimum))}`;else J="Invalid input";break;case Z.too_big:if(q.type==="array")J=`Array must contain ${q.exact?"exactly":q.inclusive?"at most":"less than"} ${q.maximum} element(s)`;else if(q.type==="string")J=`String must contain ${q.exact?"exactly":q.inclusive?"at most":"under"} ${q.maximum} character(s)`;else if(q.type==="number")J=`Number must be ${q.exact?"exactly":q.inclusive?"less than or equal to":"less than"} ${q.maximum}`;else if(q.type==="bigint")J=`BigInt must be ${q.exact?"exactly":q.inclusive?"less than or equal to":"less than"} ${q.maximum}`;else if(q.type==="date")J=`Date must be ${q.exact?"exactly":q.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(q.maximum))}`;else J="Invalid input";break;case Z.custom:J="Invalid input";break;case Z.invalid_intersection_types:J="Intersection results could not be merged";break;case Z.not_multiple_of:J=`Number must be a multiple of ${q.multipleOf}`;break;case Z.not_finite:J="Number must be finite";break;default:J=$.defaultError,o.assertNever(q)}return{message:J}},H1=xG;var $3=H1;function mG(q){$3=q}function H0(){return $3}var J$=(q)=>{let{data:$,path:J,errorMaps:G,issueData:X}=q,Y=[...J,...X.path||[]],U={...X,path:Y};if(X.message!==void 0)return{...X,path:Y,message:X.message};let Q="",V=G.filter((W)=>!!W).slice().reverse();for(let W of V)Q=W(U,{data:$,defaultError:Q}).message;return{...X,path:Y,message:Q}},kG=[];function b(q,$){let J=H0(),G=J$({issueData:$,data:q.data,path:q.path,errorMaps:[q.common.contextualErrorMap,q.schemaErrorMap,J,J===H1?void 0:H1].filter((X)=>!!X)});q.common.issues.push(G)}class wq{constructor(){this.value="valid"}dirty(){if(this.value==="valid")this.value="dirty"}abort(){if(this.value!=="aborted")this.value="aborted"}static mergeArray(q,$){let J=[];for(let G of $){if(G.status==="aborted")return k;if(G.status==="dirty")q.dirty();J.push(G.value)}return{status:q.value,value:J}}static async mergeObjectAsync(q,$){let J=[];for(let G of $){let X=await G.key,Y=await G.value;J.push({key:X,value:Y})}return wq.mergeObjectSync(q,J)}static mergeObjectSync(q,$){let J={};for(let G of $){let{key:X,value:Y}=G;if(X.status==="aborted")return k;if(Y.status==="aborted")return k;if(X.status==="dirty")q.dirty();if(Y.status==="dirty")q.dirty();if(X.value!=="__proto__"&&(typeof Y.value<"u"||G.alwaysSet))J[X.value]=Y.value}return{status:q.value,value:J}}}var k=Object.freeze({status:"aborted"}),h1=(q)=>({status:"dirty",value:q}),Nq=(q)=>({status:"valid",value:q}),r$=(q)=>q.status==="aborted",i$=(q)=>q.status==="dirty",D1=(q)=>q.status==="valid",K0=(q)=>typeof Promise<"u"&&q instanceof Promise;var y;(function(q){q.errToObj=($)=>typeof $==="string"?{message:$}:$||{},q.toString=($)=>typeof $==="string"?$:$?.message})(y||(y={}));class dq{constructor(q,$,J,G){this._cachedPath=[],this.parent=q,this.data=$,this._path=J,this._key=G}get path(){if(!this._cachedPath.length)if(Array.isArray(this._key))this._cachedPath.push(...this._path,...this._key);else this._cachedPath.push(...this._path,this._key);return this._cachedPath}}var J3=(q,$)=>{if(D1($))return{success:!0,data:$.value};else{if(!q.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let J=new Aq(q.common.issues);return this._error=J,this._error}}}};function i(q){if(!q)return{};let{errorMap:$,invalid_type_error:J,required_error:G,description:X}=q;if($&&(J||G))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);if($)return{errorMap:$,description:X};return{errorMap:(U,Q)=>{let{message:V}=q;if(U.code==="invalid_enum_value")return{message:V??Q.defaultError};if(typeof Q.data>"u")return{message:V??G??Q.defaultError};if(U.code!=="invalid_type")return{message:Q.defaultError};return{message:V??J??Q.defaultError}},description:X}}class c{get description(){return this._def.description}_getType(q){return tq(q.data)}_getOrReturnCtx(q,$){return $||{common:q.parent.common,data:q.data,parsedType:tq(q.data),schemaErrorMap:this._def.errorMap,path:q.path,parent:q.parent}}_processInputParams(q){return{status:new wq,ctx:{common:q.parent.common,data:q.data,parsedType:tq(q.data),schemaErrorMap:this._def.errorMap,path:q.path,parent:q.parent}}}_parseSync(q){let $=this._parse(q);if(K0($))throw Error("Synchronous parse encountered promise.");return $}_parseAsync(q){let $=this._parse(q);return Promise.resolve($)}parse(q,$){let J=this.safeParse(q,$);if(J.success)return J.data;throw J.error}safeParse(q,$){let J={common:{issues:[],async:$?.async??!1,contextualErrorMap:$?.errorMap},path:$?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:tq(q)},G=this._parseSync({data:q,path:J.path,parent:J});return J3(J,G)}"~validate"(q){let $={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:tq(q)};if(!this["~standard"].async)try{let J=this._parseSync({data:q,path:[],parent:$});return D1(J)?{value:J.value}:{issues:$.common.issues}}catch(J){if(J?.message?.toLowerCase()?.includes("encountered"))this["~standard"].async=!0;$.common={issues:[],async:!0}}return this._parseAsync({data:q,path:[],parent:$}).then((J)=>D1(J)?{value:J.value}:{issues:$.common.issues})}async parseAsync(q,$){let J=await this.safeParseAsync(q,$);if(J.success)return J.data;throw J.error}async safeParseAsync(q,$){let J={common:{issues:[],contextualErrorMap:$?.errorMap,async:!0},path:$?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:q,parsedType:tq(q)},G=this._parse({data:q,path:J.path,parent:J}),X=await(K0(G)?G:Promise.resolve(G));return J3(J,X)}refine(q,$){let J=(G)=>{if(typeof $==="string"||typeof $>"u")return{message:$};else if(typeof $==="function")return $(G);else return $};return this._refinement((G,X)=>{let Y=q(G),U=()=>X.addIssue({code:Z.custom,...J(G)});if(typeof Promise<"u"&&Y instanceof Promise)return Y.then((Q)=>{if(!Q)return U(),!1;else return!0});if(!Y)return U(),!1;else return!0})}refinement(q,$){return this._refinement((J,G)=>{if(!q(J))return G.addIssue(typeof $==="function"?$(J,G):$),!1;else return!0})}_refinement(q){return new cq({schema:this,typeName:u.ZodEffects,effect:{type:"refinement",refinement:q}})}superRefine(q){return this._refinement(q)}constructor(q){this.spa=this.safeParseAsync,this._def=q,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:($)=>this["~validate"]($)}}optional(){return iq.create(this,this._def)}nullable(){return z1.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return rq.create(this)}promise(){return f1.create(this,this._def)}or(q){return w0.create([this,q],this._def)}and(q){return F0.create(this,q,this._def)}transform(q){return new cq({...i(this._def),schema:this,typeName:u.ZodEffects,effect:{type:"transform",transform:q}})}default(q){let $=typeof q==="function"?q:()=>q;return new S0({...i(this._def),innerType:this,defaultValue:$,typeName:u.ZodDefault})}brand(){return new c$({typeName:u.ZodBranded,type:this,...i(this._def)})}catch(q){let $=typeof q==="function"?q:()=>q;return new j0({...i(this._def),innerType:this,catchValue:$,typeName:u.ZodCatch})}describe(q){return new this.constructor({...this._def,description:q})}pipe(q){return V$.create(this,q)}readonly(){return P0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var fG=/^c[^\s-]{8,}$/i,uG=/^[0-9a-z]+$/,pG=/^[0-9A-HJKMNP-TV-Z]{26}$/i,lG=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,rG=/^[a-z0-9_-]{21}$/i,iG=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,dG=/^[-+]?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)?)??$/,cG=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,nG="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",J2,oG=/^(?:(?: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])$/,aG=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,sG=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,tG=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,eG=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,qX=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,X3="((\\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])))",$X=new RegExp(`^${X3}$`);function Y3(q){let $="[0-5]\\d";if(q.precision)$=`${$}\\.\\d{${q.precision}}`;else if(q.precision==null)$=`${$}(\\.\\d+)?`;let J=q.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${$})${J}`}function JX(q){return new RegExp(`^${Y3(q)}$`)}function U3(q){let $=`${X3}T${Y3(q)}`,J=[];if(J.push(q.local?"Z?":"Z"),q.offset)J.push("([+-]\\d{2}:?\\d{2})");return $=`${$}(${J.join("|")})`,new RegExp(`^${$}$`)}function GX(q,$){if(($==="v4"||!$)&&oG.test(q))return!0;if(($==="v6"||!$)&&sG.test(q))return!0;return!1}function XX(q,$){if(!iG.test(q))return!1;try{let[J]=q.split(".");if(!J)return!1;let G=J.replace(/-/g,"+").replace(/_/g,"/").padEnd(J.length+(4-J.length%4)%4,"="),X=JSON.parse(atob(G));if(typeof X!=="object"||X===null)return!1;if("typ"in X&&X?.typ!=="JWT")return!1;if(!X.alg)return!1;if($&&X.alg!==$)return!1;return!0}catch{return!1}}function YX(q,$){if(($==="v4"||!$)&&aG.test(q))return!0;if(($==="v6"||!$)&&tG.test(q))return!0;return!1}class lq extends c{_parse(q){if(this._def.coerce)q.data=String(q.data);if(this._getType(q)!==T.string){let X=this._getOrReturnCtx(q);return b(X,{code:Z.invalid_type,expected:T.string,received:X.parsedType}),k}let J=new wq,G=void 0;for(let X of this._def.checks)if(X.kind==="min"){if(q.data.length<X.value)G=this._getOrReturnCtx(q,G),b(G,{code:Z.too_small,minimum:X.value,type:"string",inclusive:!0,exact:!1,message:X.message}),J.dirty()}else if(X.kind==="max"){if(q.data.length>X.value)G=this._getOrReturnCtx(q,G),b(G,{code:Z.too_big,maximum:X.value,type:"string",inclusive:!0,exact:!1,message:X.message}),J.dirty()}else if(X.kind==="length"){let Y=q.data.length>X.value,U=q.data.length<X.value;if(Y||U){if(G=this._getOrReturnCtx(q,G),Y)b(G,{code:Z.too_big,maximum:X.value,type:"string",inclusive:!0,exact:!0,message:X.message});else if(U)b(G,{code:Z.too_small,minimum:X.value,type:"string",inclusive:!0,exact:!0,message:X.message});J.dirty()}}else if(X.kind==="email"){if(!cG.test(q.data))G=this._getOrReturnCtx(q,G),b(G,{validation:"email",code:Z.invalid_string,message:X.message}),J.dirty()}else if(X.kind==="emoji"){if(!J2)J2=new RegExp(nG,"u");if(!J2.test(q.data))G=this._getOrReturnCtx(q,G),b(G,{validation:"emoji",code:Z.invalid_string,message:X.message}),J.dirty()}else if(X.kind==="uuid"){if(!lG.test(q.data))G=this._getOrReturnCtx(q,G),b(G,{validation:"uuid",code:Z.invalid_string,message:X.message}),J.dirty()}else if(X.kind==="nanoid"){if(!rG.test(q.data))G=this._getOrReturnCtx(q,G),b(G,{validation:"nanoid",code:Z.invalid_string,message:X.message}),J.dirty()}else if(X.kind==="cuid"){if(!fG.test(q.data))G=this._getOrReturnCtx(q,G),b(G,{validation:"cuid",code:Z.invalid_string,message:X.message}),J.dirty()}else if(X.kind==="cuid2"){if(!uG.test(q.data))G=this._getOrReturnCtx(q,G),b(G,{validation:"cuid2",code:Z.invalid_string,message:X.message}),J.dirty()}else if(X.kind==="ulid"){if(!pG.test(q.data))G=this._getOrReturnCtx(q,G),b(G,{validation:"ulid",code:Z.invalid_string,message:X.message}),J.dirty()}else if(X.kind==="url")try{new URL(q.data)}catch{G=this._getOrReturnCtx(q,G),b(G,{validation:"url",code:Z.invalid_string,message:X.message}),J.dirty()}else if(X.kind==="regex"){if(X.regex.lastIndex=0,!X.regex.test(q.data))G=this._getOrReturnCtx(q,G),b(G,{validation:"regex",code:Z.invalid_string,message:X.message}),J.dirty()}else if(X.kind==="trim")q.data=q.data.trim();else if(X.kind==="includes"){if(!q.data.includes(X.value,X.position))G=this._getOrReturnCtx(q,G),b(G,{code:Z.invalid_string,validation:{includes:X.value,position:X.position},message:X.message}),J.dirty()}else if(X.kind==="toLowerCase")q.data=q.data.toLowerCase();else if(X.kind==="toUpperCase")q.data=q.data.toUpperCase();else if(X.kind==="startsWith"){if(!q.data.startsWith(X.value))G=this._getOrReturnCtx(q,G),b(G,{code:Z.invalid_string,validation:{startsWith:X.value},message:X.message}),J.dirty()}else if(X.kind==="endsWith"){if(!q.data.endsWith(X.value))G=this._getOrReturnCtx(q,G),b(G,{code:Z.invalid_string,validation:{endsWith:X.value},message:X.message}),J.dirty()}else if(X.kind==="datetime"){if(!U3(X).test(q.data))G=this._getOrReturnCtx(q,G),b(G,{code:Z.invalid_string,validation:"datetime",message:X.message}),J.dirty()}else if(X.kind==="date"){if(!$X.test(q.data))G=this._getOrReturnCtx(q,G),b(G,{code:Z.invalid_string,validation:"date",message:X.message}),J.dirty()}else if(X.kind==="time"){if(!JX(X).test(q.data))G=this._getOrReturnCtx(q,G),b(G,{code:Z.invalid_string,validation:"time",message:X.message}),J.dirty()}else if(X.kind==="duration"){if(!dG.test(q.data))G=this._getOrReturnCtx(q,G),b(G,{validation:"duration",code:Z.invalid_string,message:X.message}),J.dirty()}else if(X.kind==="ip"){if(!GX(q.data,X.version))G=this._getOrReturnCtx(q,G),b(G,{validation:"ip",code:Z.invalid_string,message:X.message}),J.dirty()}else if(X.kind==="jwt"){if(!XX(q.data,X.alg))G=this._getOrReturnCtx(q,G),b(G,{validation:"jwt",code:Z.invalid_string,message:X.message}),J.dirty()}else if(X.kind==="cidr"){if(!YX(q.data,X.version))G=this._getOrReturnCtx(q,G),b(G,{validation:"cidr",code:Z.invalid_string,message:X.message}),J.dirty()}else if(X.kind==="base64"){if(!eG.test(q.data))G=this._getOrReturnCtx(q,G),b(G,{validation:"base64",code:Z.invalid_string,message:X.message}),J.dirty()}else if(X.kind==="base64url"){if(!qX.test(q.data))G=this._getOrReturnCtx(q,G),b(G,{validation:"base64url",code:Z.invalid_string,message:X.message}),J.dirty()}else o.assertNever(X);return{status:J.value,value:q.data}}_regex(q,$,J){return this.refinement((G)=>q.test(G),{validation:$,code:Z.invalid_string,...y.errToObj(J)})}_addCheck(q){return new lq({...this._def,checks:[...this._def.checks,q]})}email(q){return this._addCheck({kind:"email",...y.errToObj(q)})}url(q){return this._addCheck({kind:"url",...y.errToObj(q)})}emoji(q){return this._addCheck({kind:"emoji",...y.errToObj(q)})}uuid(q){return this._addCheck({kind:"uuid",...y.errToObj(q)})}nanoid(q){return this._addCheck({kind:"nanoid",...y.errToObj(q)})}cuid(q){return this._addCheck({kind:"cuid",...y.errToObj(q)})}cuid2(q){return this._addCheck({kind:"cuid2",...y.errToObj(q)})}ulid(q){return this._addCheck({kind:"ulid",...y.errToObj(q)})}base64(q){return this._addCheck({kind:"base64",...y.errToObj(q)})}base64url(q){return this._addCheck({kind:"base64url",...y.errToObj(q)})}jwt(q){return this._addCheck({kind:"jwt",...y.errToObj(q)})}ip(q){return this._addCheck({kind:"ip",...y.errToObj(q)})}cidr(q){return this._addCheck({kind:"cidr",...y.errToObj(q)})}datetime(q){if(typeof q==="string")return this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:q});return this._addCheck({kind:"datetime",precision:typeof q?.precision>"u"?null:q?.precision,offset:q?.offset??!1,local:q?.local??!1,...y.errToObj(q?.message)})}date(q){return this._addCheck({kind:"date",message:q})}time(q){if(typeof q==="string")return this._addCheck({kind:"time",precision:null,message:q});return this._addCheck({kind:"time",precision:typeof q?.precision>"u"?null:q?.precision,...y.errToObj(q?.message)})}duration(q){return this._addCheck({kind:"duration",...y.errToObj(q)})}regex(q,$){return this._addCheck({kind:"regex",regex:q,...y.errToObj($)})}includes(q,$){return this._addCheck({kind:"includes",value:q,position:$?.position,...y.errToObj($?.message)})}startsWith(q,$){return this._addCheck({kind:"startsWith",value:q,...y.errToObj($)})}endsWith(q,$){return this._addCheck({kind:"endsWith",value:q,...y.errToObj($)})}min(q,$){return this._addCheck({kind:"min",value:q,...y.errToObj($)})}max(q,$){return this._addCheck({kind:"max",value:q,...y.errToObj($)})}length(q,$){return this._addCheck({kind:"length",value:q,...y.errToObj($)})}nonempty(q){return this.min(1,y.errToObj(q))}trim(){return new lq({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new lq({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new lq({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((q)=>q.kind==="datetime")}get isDate(){return!!this._def.checks.find((q)=>q.kind==="date")}get isTime(){return!!this._def.checks.find((q)=>q.kind==="time")}get isDuration(){return!!this._def.checks.find((q)=>q.kind==="duration")}get isEmail(){return!!this._def.checks.find((q)=>q.kind==="email")}get isURL(){return!!this._def.checks.find((q)=>q.kind==="url")}get isEmoji(){return!!this._def.checks.find((q)=>q.kind==="emoji")}get isUUID(){return!!this._def.checks.find((q)=>q.kind==="uuid")}get isNANOID(){return!!this._def.checks.find((q)=>q.kind==="nanoid")}get isCUID(){return!!this._def.checks.find((q)=>q.kind==="cuid")}get isCUID2(){return!!this._def.checks.find((q)=>q.kind==="cuid2")}get isULID(){return!!this._def.checks.find((q)=>q.kind==="ulid")}get isIP(){return!!this._def.checks.find((q)=>q.kind==="ip")}get isCIDR(){return!!this._def.checks.find((q)=>q.kind==="cidr")}get isBase64(){return!!this._def.checks.find((q)=>q.kind==="base64")}get isBase64url(){return!!this._def.checks.find((q)=>q.kind==="base64url")}get minLength(){let q=null;for(let $ of this._def.checks)if($.kind==="min"){if(q===null||$.value>q)q=$.value}return q}get maxLength(){let q=null;for(let $ of this._def.checks)if($.kind==="max"){if(q===null||$.value<q)q=$.value}return q}}lq.create=(q)=>{return new lq({checks:[],typeName:u.ZodString,coerce:q?.coerce??!1,...i(q)})};function UX(q,$){let J=(q.toString().split(".")[1]||"").length,G=($.toString().split(".")[1]||"").length,X=J>G?J:G,Y=Number.parseInt(q.toFixed(X).replace(".","")),U=Number.parseInt($.toFixed(X).replace(".",""));return Y%U/10**X}class F1 extends c{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(q){if(this._def.coerce)q.data=Number(q.data);if(this._getType(q)!==T.number){let X=this._getOrReturnCtx(q);return b(X,{code:Z.invalid_type,expected:T.number,received:X.parsedType}),k}let J=void 0,G=new wq;for(let X of this._def.checks)if(X.kind==="int"){if(!o.isInteger(q.data))J=this._getOrReturnCtx(q,J),b(J,{code:Z.invalid_type,expected:"integer",received:"float",message:X.message}),G.dirty()}else if(X.kind==="min"){if(X.inclusive?q.data<X.value:q.data<=X.value)J=this._getOrReturnCtx(q,J),b(J,{code:Z.too_small,minimum:X.value,type:"number",inclusive:X.inclusive,exact:!1,message:X.message}),G.dirty()}else if(X.kind==="max"){if(X.inclusive?q.data>X.value:q.data>=X.value)J=this._getOrReturnCtx(q,J),b(J,{code:Z.too_big,maximum:X.value,type:"number",inclusive:X.inclusive,exact:!1,message:X.message}),G.dirty()}else if(X.kind==="multipleOf"){if(UX(q.data,X.value)!==0)J=this._getOrReturnCtx(q,J),b(J,{code:Z.not_multiple_of,multipleOf:X.value,message:X.message}),G.dirty()}else if(X.kind==="finite"){if(!Number.isFinite(q.data))J=this._getOrReturnCtx(q,J),b(J,{code:Z.not_finite,message:X.message}),G.dirty()}else o.assertNever(X);return{status:G.value,value:q.data}}gte(q,$){return this.setLimit("min",q,!0,y.toString($))}gt(q,$){return this.setLimit("min",q,!1,y.toString($))}lte(q,$){return this.setLimit("max",q,!0,y.toString($))}lt(q,$){return this.setLimit("max",q,!1,y.toString($))}setLimit(q,$,J,G){return new F1({...this._def,checks:[...this._def.checks,{kind:q,value:$,inclusive:J,message:y.toString(G)}]})}_addCheck(q){return new F1({...this._def,checks:[...this._def.checks,q]})}int(q){return this._addCheck({kind:"int",message:y.toString(q)})}positive(q){return this._addCheck({kind:"min",value:0,inclusive:!1,message:y.toString(q)})}negative(q){return this._addCheck({kind:"max",value:0,inclusive:!1,message:y.toString(q)})}nonpositive(q){return this._addCheck({kind:"max",value:0,inclusive:!0,message:y.toString(q)})}nonnegative(q){return this._addCheck({kind:"min",value:0,inclusive:!0,message:y.toString(q)})}multipleOf(q,$){return this._addCheck({kind:"multipleOf",value:q,message:y.toString($)})}finite(q){return this._addCheck({kind:"finite",message:y.toString(q)})}safe(q){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:y.toString(q)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:y.toString(q)})}get minValue(){let q=null;for(let $ of this._def.checks)if($.kind==="min"){if(q===null||$.value>q)q=$.value}return q}get maxValue(){let q=null;for(let $ of this._def.checks)if($.kind==="max"){if(q===null||$.value<q)q=$.value}return q}get isInt(){return!!this._def.checks.find((q)=>q.kind==="int"||q.kind==="multipleOf"&&o.isInteger(q.value))}get isFinite(){let q=null,$=null;for(let J of this._def.checks)if(J.kind==="finite"||J.kind==="int"||J.kind==="multipleOf")return!0;else if(J.kind==="min"){if($===null||J.value>$)$=J.value}else if(J.kind==="max"){if(q===null||J.value<q)q=J.value}return Number.isFinite($)&&Number.isFinite(q)}}F1.create=(q)=>{return new F1({checks:[],typeName:u.ZodNumber,coerce:q?.coerce||!1,...i(q)})};class O1 extends c{constructor(){super(...arguments);this.min=this.gte,this.max=this.lte}_parse(q){if(this._def.coerce)try{q.data=BigInt(q.data)}catch{return this._getInvalidInput(q)}if(this._getType(q)!==T.bigint)return this._getInvalidInput(q);let J=void 0,G=new wq;for(let X of this._def.checks)if(X.kind==="min"){if(X.inclusive?q.data<X.value:q.data<=X.value)J=this._getOrReturnCtx(q,J),b(J,{code:Z.too_small,type:"bigint",minimum:X.value,inclusive:X.inclusive,message:X.message}),G.dirty()}else if(X.kind==="max"){if(X.inclusive?q.data>X.value:q.data>=X.value)J=this._getOrReturnCtx(q,J),b(J,{code:Z.too_big,type:"bigint",maximum:X.value,inclusive:X.inclusive,message:X.message}),G.dirty()}else if(X.kind==="multipleOf"){if(q.data%X.value!==BigInt(0))J=this._getOrReturnCtx(q,J),b(J,{code:Z.not_multiple_of,multipleOf:X.value,message:X.message}),G.dirty()}else o.assertNever(X);return{status:G.value,value:q.data}}_getInvalidInput(q){let $=this._getOrReturnCtx(q);return b($,{code:Z.invalid_type,expected:T.bigint,received:$.parsedType}),k}gte(q,$){return this.setLimit("min",q,!0,y.toString($))}gt(q,$){return this.setLimit("min",q,!1,y.toString($))}lte(q,$){return this.setLimit("max",q,!0,y.toString($))}lt(q,$){return this.setLimit("max",q,!1,y.toString($))}setLimit(q,$,J,G){return new O1({...this._def,checks:[...this._def.checks,{kind:q,value:$,inclusive:J,message:y.toString(G)}]})}_addCheck(q){return new O1({...this._def,checks:[...this._def.checks,q]})}positive(q){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:y.toString(q)})}negative(q){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:y.toString(q)})}nonpositive(q){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:y.toString(q)})}nonnegative(q){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:y.toString(q)})}multipleOf(q,$){return this._addCheck({kind:"multipleOf",value:q,message:y.toString($)})}get minValue(){let q=null;for(let $ of this._def.checks)if($.kind==="min"){if(q===null||$.value>q)q=$.value}return q}get maxValue(){let q=null;for(let $ of this._def.checks)if($.kind==="max"){if(q===null||$.value<q)q=$.value}return q}}O1.create=(q)=>{return new O1({checks:[],typeName:u.ZodBigInt,coerce:q?.coerce??!1,...i(q)})};class R0 extends c{_parse(q){if(this._def.coerce)q.data=Boolean(q.data);if(this._getType(q)!==T.boolean){let J=this._getOrReturnCtx(q);return b(J,{code:Z.invalid_type,expected:T.boolean,received:J.parsedType}),k}return Nq(q.data)}}R0.create=(q)=>{return new R0({typeName:u.ZodBoolean,coerce:q?.coerce||!1,...i(q)})};class x1 extends c{_parse(q){if(this._def.coerce)q.data=new Date(q.data);if(this._getType(q)!==T.date){let X=this._getOrReturnCtx(q);return b(X,{code:Z.invalid_type,expected:T.date,received:X.parsedType}),k}if(Number.isNaN(q.data.getTime())){let X=this._getOrReturnCtx(q);return b(X,{code:Z.invalid_date}),k}let J=new wq,G=void 0;for(let X of this._def.checks)if(X.kind==="min"){if(q.data.getTime()<X.value)G=this._getOrReturnCtx(q,G),b(G,{code:Z.too_small,message:X.message,inclusive:!0,exact:!1,minimum:X.value,type:"date"}),J.dirty()}else if(X.kind==="max"){if(q.data.getTime()>X.value)G=this._getOrReturnCtx(q,G),b(G,{code:Z.too_big,message:X.message,inclusive:!0,exact:!1,maximum:X.value,type:"date"}),J.dirty()}else o.assertNever(X);return{status:J.value,value:new Date(q.data.getTime())}}_addCheck(q){return new x1({...this._def,checks:[...this._def.checks,q]})}min(q,$){return this._addCheck({kind:"min",value:q.getTime(),message:y.toString($)})}max(q,$){return this._addCheck({kind:"max",value:q.getTime(),message:y.toString($)})}get minDate(){let q=null;for(let $ of this._def.checks)if($.kind==="min"){if(q===null||$.value>q)q=$.value}return q!=null?new Date(q):null}get maxDate(){let q=null;for(let $ of this._def.checks)if($.kind==="max"){if(q===null||$.value<q)q=$.value}return q!=null?new Date(q):null}}x1.create=(q)=>{return new x1({checks:[],coerce:q?.coerce||!1,typeName:u.ZodDate,...i(q)})};class G$ extends c{_parse(q){if(this._getType(q)!==T.symbol){let J=this._getOrReturnCtx(q);return b(J,{code:Z.invalid_type,expected:T.symbol,received:J.parsedType}),k}return Nq(q.data)}}G$.create=(q)=>{return new G$({typeName:u.ZodSymbol,...i(q)})};class B0 extends c{_parse(q){if(this._getType(q)!==T.undefined){let J=this._getOrReturnCtx(q);return b(J,{code:Z.invalid_type,expected:T.undefined,received:J.parsedType}),k}return Nq(q.data)}}B0.create=(q)=>{return new B0({typeName:u.ZodUndefined,...i(q)})};class D0 extends c{_parse(q){if(this._getType(q)!==T.null){let J=this._getOrReturnCtx(q);return b(J,{code:Z.invalid_type,expected:T.null,received:J.parsedType}),k}return Nq(q.data)}}D0.create=(q)=>{return new D0({typeName:u.ZodNull,...i(q)})};class m1 extends c{constructor(){super(...arguments);this._any=!0}_parse(q){return Nq(q.data)}}m1.create=(q)=>{return new m1({typeName:u.ZodAny,...i(q)})};class w1 extends c{constructor(){super(...arguments);this._unknown=!0}_parse(q){return Nq(q.data)}}w1.create=(q)=>{return new w1({typeName:u.ZodUnknown,...i(q)})};class eq extends c{_parse(q){let $=this._getOrReturnCtx(q);return b($,{code:Z.invalid_type,expected:T.never,received:$.parsedType}),k}}eq.create=(q)=>{return new eq({typeName:u.ZodNever,...i(q)})};class X$ extends c{_parse(q){if(this._getType(q)!==T.undefined){let J=this._getOrReturnCtx(q);return b(J,{code:Z.invalid_type,expected:T.void,received:J.parsedType}),k}return Nq(q.data)}}X$.create=(q)=>{return new X$({typeName:u.ZodVoid,...i(q)})};class rq extends c{_parse(q){let{ctx:$,status:J}=this._processInputParams(q),G=this._def;if($.parsedType!==T.array)return b($,{code:Z.invalid_type,expected:T.array,received:$.parsedType}),k;if(G.exactLength!==null){let Y=$.data.length>G.exactLength.value,U=$.data.length<G.exactLength.value;if(Y||U)b($,{code:Y?Z.too_big:Z.too_small,minimum:U?G.exactLength.value:void 0,maximum:Y?G.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:G.exactLength.message}),J.dirty()}if(G.minLength!==null){if($.data.length<G.minLength.value)b($,{code:Z.too_small,minimum:G.minLength.value,type:"array",inclusive:!0,exact:!1,message:G.minLength.message}),J.dirty()}if(G.maxLength!==null){if($.data.length>G.maxLength.value)b($,{code:Z.too_big,maximum:G.maxLength.value,type:"array",inclusive:!0,exact:!1,message:G.maxLength.message}),J.dirty()}if($.common.async)return Promise.all([...$.data].map((Y,U)=>{return G.type._parseAsync(new dq($,Y,$.path,U))})).then((Y)=>{return wq.mergeArray(J,Y)});let X=[...$.data].map((Y,U)=>{return G.type._parseSync(new dq($,Y,$.path,U))});return wq.mergeArray(J,X)}get element(){return this._def.type}min(q,$){return new rq({...this._def,minLength:{value:q,message:y.toString($)}})}max(q,$){return new rq({...this._def,maxLength:{value:q,message:y.toString($)}})}length(q,$){return new rq({...this._def,exactLength:{value:q,message:y.toString($)}})}nonempty(q){return this.min(1,q)}}rq.create=(q,$)=>{return new rq({type:q,minLength:null,maxLength:null,exactLength:null,typeName:u.ZodArray,...i($)})};function z0(q){if(q instanceof Uq){let $={};for(let J in q.shape){let G=q.shape[J];$[J]=iq.create(z0(G))}return new Uq({...q._def,shape:()=>$})}else if(q instanceof rq)return new rq({...q._def,type:z0(q.element)});else if(q instanceof iq)return iq.create(z0(q.unwrap()));else if(q instanceof z1)return z1.create(z0(q.unwrap()));else if(q instanceof q1)return q1.create(q.items.map(($)=>z0($)));else return q}class Uq extends c{constructor(){super(...arguments);this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let q=this._def.shape(),$=o.objectKeys(q);return this._cached={shape:q,keys:$},this._cached}_parse(q){if(this._getType(q)!==T.object){let V=this._getOrReturnCtx(q);return b(V,{code:Z.invalid_type,expected:T.object,received:V.parsedType}),k}let{status:J,ctx:G}=this._processInputParams(q),{shape:X,keys:Y}=this._getCached(),U=[];if(!(this._def.catchall instanceof eq&&this._def.unknownKeys==="strip")){for(let V in G.data)if(!Y.includes(V))U.push(V)}let Q=[];for(let V of Y){let W=X[V],H=G.data[V];Q.push({key:{status:"valid",value:V},value:W._parse(new dq(G,H,G.path,V)),alwaysSet:V in G.data})}if(this._def.catchall instanceof eq){let V=this._def.unknownKeys;if(V==="passthrough")for(let W of U)Q.push({key:{status:"valid",value:W},value:{status:"valid",value:G.data[W]}});else if(V==="strict"){if(U.length>0)b(G,{code:Z.unrecognized_keys,keys:U}),J.dirty()}else if(V==="strip");else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let V=this._def.catchall;for(let W of U){let H=G.data[W];Q.push({key:{status:"valid",value:W},value:V._parse(new dq(G,H,G.path,W)),alwaysSet:W in G.data})}}if(G.common.async)return Promise.resolve().then(async()=>{let V=[];for(let W of Q){let H=await W.key,K=await W.value;V.push({key:H,value:K,alwaysSet:W.alwaysSet})}return V}).then((V)=>{return wq.mergeObjectSync(J,V)});else return wq.mergeObjectSync(J,Q)}get shape(){return this._def.shape()}strict(q){return y.errToObj,new Uq({...this._def,unknownKeys:"strict",...q!==void 0?{errorMap:($,J)=>{let G=this._def.errorMap?.($,J).message??J.defaultError;if($.code==="unrecognized_keys")return{message:y.errToObj(q).message??G};return{message:G}}}:{}})}strip(){return new Uq({...this._def,unknownKeys:"strip"})}passthrough(){return new Uq({...this._def,unknownKeys:"passthrough"})}extend(q){return new Uq({...this._def,shape:()=>({...this._def.shape(),...q})})}merge(q){return new Uq({unknownKeys:q._def.unknownKeys,catchall:q._def.catchall,shape:()=>({...this._def.shape(),...q._def.shape()}),typeName:u.ZodObject})}setKey(q,$){return this.augment({[q]:$})}catchall(q){return new Uq({...this._def,catchall:q})}pick(q){let $={};for(let J of o.objectKeys(q))if(q[J]&&this.shape[J])$[J]=this.shape[J];return new Uq({...this._def,shape:()=>$})}omit(q){let $={};for(let J of o.objectKeys(this.shape))if(!q[J])$[J]=this.shape[J];return new Uq({...this._def,shape:()=>$})}deepPartial(){return z0(this)}partial(q){let $={};for(let J of o.objectKeys(this.shape)){let G=this.shape[J];if(q&&!q[J])$[J]=G;else $[J]=G.optional()}return new Uq({...this._def,shape:()=>$})}required(q){let $={};for(let J of o.objectKeys(this.shape))if(q&&!q[J])$[J]=this.shape[J];else{let X=this.shape[J];while(X instanceof iq)X=X._def.innerType;$[J]=X}return new Uq({...this._def,shape:()=>$})}keyof(){return Q3(o.objectKeys(this.shape))}}Uq.create=(q,$)=>{return new Uq({shape:()=>q,unknownKeys:"strip",catchall:eq.create(),typeName:u.ZodObject,...i($)})};Uq.strictCreate=(q,$)=>{return new Uq({shape:()=>q,unknownKeys:"strict",catchall:eq.create(),typeName:u.ZodObject,...i($)})};Uq.lazycreate=(q,$)=>{return new Uq({shape:q,unknownKeys:"strip",catchall:eq.create(),typeName:u.ZodObject,...i($)})};class w0 extends c{_parse(q){let{ctx:$}=this._processInputParams(q),J=this._def.options;function G(X){for(let U of X)if(U.result.status==="valid")return U.result;for(let U of X)if(U.result.status==="dirty")return $.common.issues.push(...U.ctx.common.issues),U.result;let Y=X.map((U)=>new Aq(U.ctx.common.issues));return b($,{code:Z.invalid_union,unionErrors:Y}),k}if($.common.async)return Promise.all(J.map(async(X)=>{let Y={...$,common:{...$.common,issues:[]},parent:null};return{result:await X._parseAsync({data:$.data,path:$.path,parent:Y}),ctx:Y}})).then(G);else{let X=void 0,Y=[];for(let Q of J){let V={...$,common:{...$.common,issues:[]},parent:null},W=Q._parseSync({data:$.data,path:$.path,parent:V});if(W.status==="valid")return W;else if(W.status==="dirty"&&!X)X={result:W,ctx:V};if(V.common.issues.length)Y.push(V.common.issues)}if(X)return $.common.issues.push(...X.ctx.common.issues),X.result;let U=Y.map((Q)=>new Aq(Q));return b($,{code:Z.invalid_union,unionErrors:U}),k}}get options(){return this._def.options}}w0.create=(q,$)=>{return new w0({options:q,typeName:u.ZodUnion,...i($)})};var K1=(q)=>{if(q instanceof O0)return K1(q.schema);else if(q instanceof cq)return K1(q.innerType());else if(q instanceof A0)return[q.value];else if(q instanceof A1)return q.options;else if(q instanceof N0)return o.objectValues(q.enum);else if(q instanceof S0)return K1(q._def.innerType);else if(q instanceof B0)return[void 0];else if(q instanceof D0)return[null];else if(q instanceof iq)return[void 0,...K1(q.unwrap())];else if(q instanceof z1)return[null,...K1(q.unwrap())];else if(q instanceof c$)return K1(q.unwrap());else if(q instanceof P0)return K1(q.unwrap());else if(q instanceof j0)return K1(q._def.innerType);else return[]};class d$ extends c{_parse(q){let{ctx:$}=this._processInputParams(q);if($.parsedType!==T.object)return b($,{code:Z.invalid_type,expected:T.object,received:$.parsedType}),k;let J=this.discriminator,G=$.data[J],X=this.optionsMap.get(G);if(!X)return b($,{code:Z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[J]}),k;if($.common.async)return X._parseAsync({data:$.data,path:$.path,parent:$});else return X._parseSync({data:$.data,path:$.path,parent:$})}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(q,$,J){let G=new Map;for(let X of $){let Y=K1(X.shape[q]);if(!Y.length)throw Error(`A discriminator value for key \`${q}\` could not be extracted from all schema options`);for(let U of Y){if(G.has(U))throw Error(`Discriminator property ${String(q)} has duplicate value ${String(U)}`);G.set(U,X)}}return new d$({typeName:u.ZodDiscriminatedUnion,discriminator:q,options:$,optionsMap:G,...i(J)})}}function G2(q,$){let J=tq(q),G=tq($);if(q===$)return{valid:!0,data:q};else if(J===T.object&&G===T.object){let X=o.objectKeys($),Y=o.objectKeys(q).filter((Q)=>X.indexOf(Q)!==-1),U={...q,...$};for(let Q of Y){let V=G2(q[Q],$[Q]);if(!V.valid)return{valid:!1};U[Q]=V.data}return{valid:!0,data:U}}else if(J===T.array&&G===T.array){if(q.length!==$.length)return{valid:!1};let X=[];for(let Y=0;Y<q.length;Y++){let U=q[Y],Q=$[Y],V=G2(U,Q);if(!V.valid)return{valid:!1};X.push(V.data)}return{valid:!0,data:X}}else if(J===T.date&&G===T.date&&+q===+$)return{valid:!0,data:q};else return{valid:!1}}class F0 extends c{_parse(q){let{status:$,ctx:J}=this._processInputParams(q),G=(X,Y)=>{if(r$(X)||r$(Y))return k;let U=G2(X.value,Y.value);if(!U.valid)return b(J,{code:Z.invalid_intersection_types}),k;if(i$(X)||i$(Y))$.dirty();return{status:$.value,value:U.data}};if(J.common.async)return Promise.all([this._def.left._parseAsync({data:J.data,path:J.path,parent:J}),this._def.right._parseAsync({data:J.data,path:J.path,parent:J})]).then(([X,Y])=>G(X,Y));else return G(this._def.left._parseSync({data:J.data,path:J.path,parent:J}),this._def.right._parseSync({data:J.data,path:J.path,parent:J}))}}F0.create=(q,$,J)=>{return new F0({left:q,right:$,typeName:u.ZodIntersection,...i(J)})};class q1 extends c{_parse(q){let{status:$,ctx:J}=this._processInputParams(q);if(J.parsedType!==T.array)return b(J,{code:Z.invalid_type,expected:T.array,received:J.parsedType}),k;if(J.data.length<this._def.items.length)return b(J,{code:Z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),k;if(!this._def.rest&&J.data.length>this._def.items.length)b(J,{code:Z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$.dirty();let X=[...J.data].map((Y,U)=>{let Q=this._def.items[U]||this._def.rest;if(!Q)return null;return Q._parse(new dq(J,Y,J.path,U))}).filter((Y)=>!!Y);if(J.common.async)return Promise.all(X).then((Y)=>{return wq.mergeArray($,Y)});else return wq.mergeArray($,X)}get items(){return this._def.items}rest(q){return new q1({...this._def,rest:q})}}q1.create=(q,$)=>{if(!Array.isArray(q))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new q1({items:q,typeName:u.ZodTuple,rest:null,...i($)})};class Y$ extends c{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(q){let{status:$,ctx:J}=this._processInputParams(q);if(J.parsedType!==T.object)return b(J,{code:Z.invalid_type,expected:T.object,received:J.parsedType}),k;let G=[],X=this._def.keyType,Y=this._def.valueType;for(let U in J.data)G.push({key:X._parse(new dq(J,U,J.path,U)),value:Y._parse(new dq(J,J.data[U],J.path,U)),alwaysSet:U in J.data});if(J.common.async)return wq.mergeObjectAsync($,G);else return wq.mergeObjectSync($,G)}get element(){return this._def.valueType}static create(q,$,J){if($ instanceof c)return new Y$({keyType:q,valueType:$,typeName:u.ZodRecord,...i(J)});return new Y$({keyType:lq.create(),valueType:q,typeName:u.ZodRecord,...i($)})}}class U$ extends c{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(q){let{status:$,ctx:J}=this._processInputParams(q);if(J.parsedType!==T.map)return b(J,{code:Z.invalid_type,expected:T.map,received:J.parsedType}),k;let G=this._def.keyType,X=this._def.valueType,Y=[...J.data.entries()].map(([U,Q],V)=>{return{key:G._parse(new dq(J,U,J.path,[V,"key"])),value:X._parse(new dq(J,Q,J.path,[V,"value"]))}});if(J.common.async){let U=new Map;return Promise.resolve().then(async()=>{for(let Q of Y){let V=await Q.key,W=await Q.value;if(V.status==="aborted"||W.status==="aborted")return k;if(V.status==="dirty"||W.status==="dirty")$.dirty();U.set(V.value,W.value)}return{status:$.value,value:U}})}else{let U=new Map;for(let Q of Y){let{key:V,value:W}=Q;if(V.status==="aborted"||W.status==="aborted")return k;if(V.status==="dirty"||W.status==="dirty")$.dirty();U.set(V.value,W.value)}return{status:$.value,value:U}}}}U$.create=(q,$,J)=>{return new U$({valueType:$,keyType:q,typeName:u.ZodMap,...i(J)})};class k1 extends c{_parse(q){let{status:$,ctx:J}=this._processInputParams(q);if(J.parsedType!==T.set)return b(J,{code:Z.invalid_type,expected:T.set,received:J.parsedType}),k;let G=this._def;if(G.minSize!==null){if(J.data.size<G.minSize.value)b(J,{code:Z.too_small,minimum:G.minSize.value,type:"set",inclusive:!0,exact:!1,message:G.minSize.message}),$.dirty()}if(G.maxSize!==null){if(J.data.size>G.maxSize.value)b(J,{code:Z.too_big,maximum:G.maxSize.value,type:"set",inclusive:!0,exact:!1,message:G.maxSize.message}),$.dirty()}let X=this._def.valueType;function Y(Q){let V=new Set;for(let W of Q){if(W.status==="aborted")return k;if(W.status==="dirty")$.dirty();V.add(W.value)}return{status:$.value,value:V}}let U=[...J.data.values()].map((Q,V)=>X._parse(new dq(J,Q,J.path,V)));if(J.common.async)return Promise.all(U).then((Q)=>Y(Q));else return Y(U)}min(q,$){return new k1({...this._def,minSize:{value:q,message:y.toString($)}})}max(q,$){return new k1({...this._def,maxSize:{value:q,message:y.toString($)}})}size(q,$){return this.min(q,$).max(q,$)}nonempty(q){return this.min(1,q)}}k1.create=(q,$)=>{return new k1({valueType:q,minSize:null,maxSize:null,typeName:u.ZodSet,...i($)})};class M0 extends c{constructor(){super(...arguments);this.validate=this.implement}_parse(q){let{ctx:$}=this._processInputParams(q);if($.parsedType!==T.function)return b($,{code:Z.invalid_type,expected:T.function,received:$.parsedType}),k;function J(U,Q){return J$({data:U,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,H0(),H1].filter((V)=>!!V),issueData:{code:Z.invalid_arguments,argumentsError:Q}})}function G(U,Q){return J$({data:U,path:$.path,errorMaps:[$.common.contextualErrorMap,$.schemaErrorMap,H0(),H1].filter((V)=>!!V),issueData:{code:Z.invalid_return_type,returnTypeError:Q}})}let X={errorMap:$.common.contextualErrorMap},Y=$.data;if(this._def.returns instanceof f1){let U=this;return Nq(async function(...Q){let V=new Aq([]),W=await U._def.args.parseAsync(Q,X).catch((B)=>{throw V.addIssue(J(Q,B)),V}),H=await Reflect.apply(Y,this,W);return await U._def.returns._def.type.parseAsync(H,X).catch((B)=>{throw V.addIssue(G(H,B)),V})})}else{let U=this;return Nq(function(...Q){let V=U._def.args.safeParse(Q,X);if(!V.success)throw new Aq([J(Q,V.error)]);let W=Reflect.apply(Y,this,V.data),H=U._def.returns.safeParse(W,X);if(!H.success)throw new Aq([G(W,H.error)]);return H.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...q){return new M0({...this._def,args:q1.create(q).rest(w1.create())})}returns(q){return new M0({...this._def,returns:q})}implement(q){return this.parse(q)}strictImplement(q){return this.parse(q)}static create(q,$,J){return new M0({args:q?q:q1.create([]).rest(w1.create()),returns:$||w1.create(),typeName:u.ZodFunction,...i(J)})}}class O0 extends c{get schema(){return this._def.getter()}_parse(q){let{ctx:$}=this._processInputParams(q);return this._def.getter()._parse({data:$.data,path:$.path,parent:$})}}O0.create=(q,$)=>{return new O0({getter:q,typeName:u.ZodLazy,...i($)})};class A0 extends c{_parse(q){if(q.data!==this._def.value){let $=this._getOrReturnCtx(q);return b($,{received:$.data,code:Z.invalid_literal,expected:this._def.value}),k}return{status:"valid",value:q.data}}get value(){return this._def.value}}A0.create=(q,$)=>{return new A0({value:q,typeName:u.ZodLiteral,...i($)})};function Q3(q,$){return new A1({values:q,typeName:u.ZodEnum,...i($)})}class A1 extends c{_parse(q){if(typeof q.data!=="string"){let $=this._getOrReturnCtx(q),J=this._def.values;return b($,{expected:o.joinValues(J),received:$.parsedType,code:Z.invalid_type}),k}if(!this._cache)this._cache=new Set(this._def.values);if(!this._cache.has(q.data)){let $=this._getOrReturnCtx(q),J=this._def.values;return b($,{received:$.data,code:Z.invalid_enum_value,options:J}),k}return Nq(q.data)}get options(){return this._def.values}get enum(){let q={};for(let $ of this._def.values)q[$]=$;return q}get Values(){let q={};for(let $ of this._def.values)q[$]=$;return q}get Enum(){let q={};for(let $ of this._def.values)q[$]=$;return q}extract(q,$=this._def){return A1.create(q,{...this._def,...$})}exclude(q,$=this._def){return A1.create(this.options.filter((J)=>!q.includes(J)),{...this._def,...$})}}A1.create=Q3;class N0 extends c{_parse(q){let $=o.getValidEnumValues(this._def.values),J=this._getOrReturnCtx(q);if(J.parsedType!==T.string&&J.parsedType!==T.number){let G=o.objectValues($);return b(J,{expected:o.joinValues(G),received:J.parsedType,code:Z.invalid_type}),k}if(!this._cache)this._cache=new Set(o.getValidEnumValues(this._def.values));if(!this._cache.has(q.data)){let G=o.objectValues($);return b(J,{received:J.data,code:Z.invalid_enum_value,options:G}),k}return Nq(q.data)}get enum(){return this._def.values}}N0.create=(q,$)=>{return new N0({values:q,typeName:u.ZodNativeEnum,...i($)})};class f1 extends c{unwrap(){return this._def.type}_parse(q){let{ctx:$}=this._processInputParams(q);if($.parsedType!==T.promise&&$.common.async===!1)return b($,{code:Z.invalid_type,expected:T.promise,received:$.parsedType}),k;let J=$.parsedType===T.promise?$.data:Promise.resolve($.data);return Nq(J.then((G)=>{return this._def.type.parseAsync(G,{path:$.path,errorMap:$.common.contextualErrorMap})}))}}f1.create=(q,$)=>{return new f1({type:q,typeName:u.ZodPromise,...i($)})};class cq extends c{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===u.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(q){let{status:$,ctx:J}=this._processInputParams(q),G=this._def.effect||null,X={addIssue:(Y)=>{if(b(J,Y),Y.fatal)$.abort();else $.dirty()},get path(){return J.path}};if(X.addIssue=X.addIssue.bind(X),G.type==="preprocess"){let Y=G.transform(J.data,X);if(J.common.async)return Promise.resolve(Y).then(async(U)=>{if($.value==="aborted")return k;let Q=await this._def.schema._parseAsync({data:U,path:J.path,parent:J});if(Q.status==="aborted")return k;if(Q.status==="dirty")return h1(Q.value);if($.value==="dirty")return h1(Q.value);return Q});else{if($.value==="aborted")return k;let U=this._def.schema._parseSync({data:Y,path:J.path,parent:J});if(U.status==="aborted")return k;if(U.status==="dirty")return h1(U.value);if($.value==="dirty")return h1(U.value);return U}}if(G.type==="refinement"){let Y=(U)=>{let Q=G.refinement(U,X);if(J.common.async)return Promise.resolve(Q);if(Q instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return U};if(J.common.async===!1){let U=this._def.schema._parseSync({data:J.data,path:J.path,parent:J});if(U.status==="aborted")return k;if(U.status==="dirty")$.dirty();return Y(U.value),{status:$.value,value:U.value}}else return this._def.schema._parseAsync({data:J.data,path:J.path,parent:J}).then((U)=>{if(U.status==="aborted")return k;if(U.status==="dirty")$.dirty();return Y(U.value).then(()=>{return{status:$.value,value:U.value}})})}if(G.type==="transform")if(J.common.async===!1){let Y=this._def.schema._parseSync({data:J.data,path:J.path,parent:J});if(!D1(Y))return k;let U=G.transform(Y.value,X);if(U instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:$.value,value:U}}else return this._def.schema._parseAsync({data:J.data,path:J.path,parent:J}).then((Y)=>{if(!D1(Y))return k;return Promise.resolve(G.transform(Y.value,X)).then((U)=>({status:$.value,value:U}))});o.assertNever(G)}}cq.create=(q,$,J)=>{return new cq({schema:q,typeName:u.ZodEffects,effect:$,...i(J)})};cq.createWithPreprocess=(q,$,J)=>{return new cq({schema:$,effect:{type:"preprocess",transform:q},typeName:u.ZodEffects,...i(J)})};class iq extends c{_parse(q){if(this._getType(q)===T.undefined)return Nq(void 0);return this._def.innerType._parse(q)}unwrap(){return this._def.innerType}}iq.create=(q,$)=>{return new iq({innerType:q,typeName:u.ZodOptional,...i($)})};class z1 extends c{_parse(q){if(this._getType(q)===T.null)return Nq(null);return this._def.innerType._parse(q)}unwrap(){return this._def.innerType}}z1.create=(q,$)=>{return new z1({innerType:q,typeName:u.ZodNullable,...i($)})};class S0 extends c{_parse(q){let{ctx:$}=this._processInputParams(q),J=$.data;if($.parsedType===T.undefined)J=this._def.defaultValue();return this._def.innerType._parse({data:J,path:$.path,parent:$})}removeDefault(){return this._def.innerType}}S0.create=(q,$)=>{return new S0({innerType:q,typeName:u.ZodDefault,defaultValue:typeof $.default==="function"?$.default:()=>$.default,...i($)})};class j0 extends c{_parse(q){let{ctx:$}=this._processInputParams(q),J={...$,common:{...$.common,issues:[]}},G=this._def.innerType._parse({data:J.data,path:J.path,parent:{...J}});if(K0(G))return G.then((X)=>{return{status:"valid",value:X.status==="valid"?X.value:this._def.catchValue({get error(){return new Aq(J.common.issues)},input:J.data})}});else return{status:"valid",value:G.status==="valid"?G.value:this._def.catchValue({get error(){return new Aq(J.common.issues)},input:J.data})}}removeCatch(){return this._def.innerType}}j0.create=(q,$)=>{return new j0({innerType:q,typeName:u.ZodCatch,catchValue:typeof $.catch==="function"?$.catch:()=>$.catch,...i($)})};class Q$ extends c{_parse(q){if(this._getType(q)!==T.nan){let J=this._getOrReturnCtx(q);return b(J,{code:Z.invalid_type,expected:T.nan,received:J.parsedType}),k}return{status:"valid",value:q.data}}}Q$.create=(q)=>{return new Q$({typeName:u.ZodNaN,...i(q)})};var QX=Symbol("zod_brand");class c$ extends c{_parse(q){let{ctx:$}=this._processInputParams(q),J=$.data;return this._def.type._parse({data:J,path:$.path,parent:$})}unwrap(){return this._def.type}}class V$ extends c{_parse(q){let{status:$,ctx:J}=this._processInputParams(q);if(J.common.async)return(async()=>{let X=await this._def.in._parseAsync({data:J.data,path:J.path,parent:J});if(X.status==="aborted")return k;if(X.status==="dirty")return $.dirty(),h1(X.value);else return this._def.out._parseAsync({data:X.value,path:J.path,parent:J})})();else{let G=this._def.in._parseSync({data:J.data,path:J.path,parent:J});if(G.status==="aborted")return k;if(G.status==="dirty")return $.dirty(),{status:"dirty",value:G.value};else return this._def.out._parseSync({data:G.value,path:J.path,parent:J})}}static create(q,$){return new V$({in:q,out:$,typeName:u.ZodPipeline})}}class P0 extends c{_parse(q){let $=this._def.innerType._parse(q),J=(G)=>{if(D1(G))G.value=Object.freeze(G.value);return G};return K0($)?$.then((G)=>J(G)):J($)}unwrap(){return this._def.innerType}}P0.create=(q,$)=>{return new P0({innerType:q,typeName:u.ZodReadonly,...i($)})};function G3(q,$){let J=typeof q==="function"?q($):typeof q==="string"?{message:q}:q;return typeof J==="string"?{message:J}:J}function V3(q,$={},J){if(q)return m1.create().superRefine((G,X)=>{let Y=q(G);if(Y instanceof Promise)return Y.then((U)=>{if(!U){let Q=G3($,G),V=Q.fatal??J??!0;X.addIssue({code:"custom",...Q,fatal:V})}});if(!Y){let U=G3($,G),Q=U.fatal??J??!0;X.addIssue({code:"custom",...U,fatal:Q})}return});return m1.create()}var VX={object:Uq.lazycreate},u;(function(q){q.ZodString="ZodString",q.ZodNumber="ZodNumber",q.ZodNaN="ZodNaN",q.ZodBigInt="ZodBigInt",q.ZodBoolean="ZodBoolean",q.ZodDate="ZodDate",q.ZodSymbol="ZodSymbol",q.ZodUndefined="ZodUndefined",q.ZodNull="ZodNull",q.ZodAny="ZodAny",q.ZodUnknown="ZodUnknown",q.ZodNever="ZodNever",q.ZodVoid="ZodVoid",q.ZodArray="ZodArray",q.ZodObject="ZodObject",q.ZodUnion="ZodUnion",q.ZodDiscriminatedUnion="ZodDiscriminatedUnion",q.ZodIntersection="ZodIntersection",q.ZodTuple="ZodTuple",q.ZodRecord="ZodRecord",q.ZodMap="ZodMap",q.ZodSet="ZodSet",q.ZodFunction="ZodFunction",q.ZodLazy="ZodLazy",q.ZodLiteral="ZodLiteral",q.ZodEnum="ZodEnum",q.ZodEffects="ZodEffects",q.ZodNativeEnum="ZodNativeEnum",q.ZodOptional="ZodOptional",q.ZodNullable="ZodNullable",q.ZodDefault="ZodDefault",q.ZodCatch="ZodCatch",q.ZodPromise="ZodPromise",q.ZodBranded="ZodBranded",q.ZodPipeline="ZodPipeline",q.ZodReadonly="ZodReadonly"})(u||(u={}));var WX=(q,$={message:`Input not instance of ${q.name}`})=>V3((J)=>J instanceof q,$),W3=lq.create,H3=F1.create,HX=Q$.create,KX=O1.create,K3=R0.create,zX=x1.create,MX=G$.create,RX=B0.create,BX=D0.create,DX=m1.create,wX=w1.create,FX=eq.create,OX=X$.create,AX=rq.create,NX=Uq.create,SX=Uq.strictCreate,jX=w0.create,PX=d$.create,LX=F0.create,ZX=q1.create,CX=Y$.create,EX=U$.create,TX=k1.create,_X=M0.create,bX=O0.create,IX=A0.create,gX=A1.create,vX=N0.create,yX=f1.create,hX=cq.create,xX=iq.create,mX=z1.create,kX=cq.createWithPreprocess,fX=V$.create,uX=()=>W3().optional(),pX=()=>H3().optional(),lX=()=>K3().optional(),rX={string:(q)=>lq.create({...q,coerce:!0}),number:(q)=>F1.create({...q,coerce:!0}),boolean:(q)=>R0.create({...q,coerce:!0}),bigint:(q)=>O1.create({...q,coerce:!0}),date:(q)=>x1.create({...q,coerce:!0})};var iX=k;var dX=E.object({url:E.string(),authToken:E.string().optional()});import{openSync as cX,writeSync as nX}from"fs";class nq{static instance=null;level;context;useStderr;format;logFile;fileHandle;constructor(q={},$){if(this.level=q.level??3,this.context=q.context??void 0,this.useStderr=q.useStderr??!1,this.format=q.format??"text",this.logFile=q.logFile,$!==void 0)this.fileHandle=$;else if(this.logFile)try{this.fileHandle=cX(this.logFile,"a")}catch{}}static getInstance(q){if(!nq.instance)nq.instance=new nq(q);else if(q?.useStderr!==void 0)nq.instance.useStderr=q.useStderr;return nq.instance}static resetInstance(){nq.instance=null}static createFresh(q){return new nq(q)}formatEntry(q,$,J){let G=new Date().toISOString();if(this.format==="json"){let X={ts:G,level:q,msg:$};if(this.context)X.ctx=this.context;if(J.length>0)X.data=J;return JSON.stringify(X)}return this.context?`[${G}] [${this.context}] ${$}`:`[${G}] ${$}`}write(q,$,J,G){if(this.format==="json")q(this.formatEntry($,J,G));else if(G.length>0)q(this.formatEntry($,J,[]),...G);else q(this.formatEntry($,J,[]));if(this.fileHandle!==void 0){let X=this.formatJsonEntry($,J,G);try{nX(this.fileHandle,X+`
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
`,Nfr:"\uD835\uDD11",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",Not:"\u2AEC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",Nscr:"\uD835\uDCA9",Ntilde:"\xD1",Nu:"\u039D",OElig:"\u0152",Oacute:"\xD3",Ocirc:"\xD4",Ocy:"\u041E",Odblac:"\u0150",Ofr:"\uD835\uDD12",Ograve:"\xD2",Omacr:"\u014C",Omega:"\u03A9",Omicron:"\u039F",Oopf:"\uD835\uDD46",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",Or:"\u2A54",Oscr:"\uD835\uDCAA",Oslash:"\xD8",Otilde:"\xD5",Otimes:"\u2A37",Ouml:"\xD6",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",PartialD:"\u2202",Pcy:"\u041F",Pfr:"\uD835\uDD13",Phi:"\u03A6",Pi:"\u03A0",PlusMinus:"\xB1",Poincareplane:"\u210C",Popf:"\u2119",Pr:"\u2ABB",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",Prime:"\u2033",Product:"\u220F",Proportion:"\u2237",Proportional:"\u221D",Pscr:"\uD835\uDCAB",Psi:"\u03A8",QUOT:'"',Qfr:"\uD835\uDD14",Qopf:"\u211A",Qscr:"\uD835\uDCAC",RBarr:"\u2910",REG:"\xAE",Racute:"\u0154",Rang:"\u27EB",Rarr:"\u21A0",Rarrtl:"\u2916",Rcaron:"\u0158",Rcedil:"\u0156",Rcy:"\u0420",Re:"\u211C",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",Rfr:"\u211C",Rho:"\u03A1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",Rightarrow:"\u21D2",Ropf:"\u211D",RoundImplies:"\u2970",Rrightarrow:"\u21DB",Rscr:"\u211B",Rsh:"\u21B1",RuleDelayed:"\u29F4",SHCHcy:"\u0429",SHcy:"\u0428",SOFTcy:"\u042C",Sacute:"\u015A",Sc:"\u2ABC",Scaron:"\u0160",Scedil:"\u015E",Scirc:"\u015C",Scy:"\u0421",Sfr:"\uD835\uDD16",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",Sigma:"\u03A3",SmallCircle:"\u2218",Sopf:"\uD835\uDD4A",Sqrt:"\u221A",Square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",Sscr:"\uD835\uDCAE",Star:"\u22C6",Sub:"\u22D0",Subset:"\u22D0",SubsetEqual:"\u2286",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",SuchThat:"\u220B",Sum:"\u2211",Sup:"\u22D1",Superset:"\u2283",SupersetEqual:"\u2287",Supset:"\u22D1",THORN:"\xDE",TRADE:"\u2122",TSHcy:"\u040B",TScy:"\u0426",Tab:"\t",Tau:"\u03A4",Tcaron:"\u0164",Tcedil:"\u0162",Tcy:"\u0422",Tfr:"\uD835\uDD17",Therefore:"\u2234",Theta:"\u0398",ThickSpace:"\u205F\u200A",ThinSpace:"\u2009",Tilde:"\u223C",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",Topf:"\uD835\uDD4B",TripleDot:"\u20DB",Tscr:"\uD835\uDCAF",Tstrok:"\u0166",Uacute:"\xDA",Uarr:"\u219F",Uarrocir:"\u2949",Ubrcy:"\u040E",Ubreve:"\u016C",Ucirc:"\xDB",Ucy:"\u0423",Udblac:"\u0170",Ufr:"\uD835\uDD18",Ugrave:"\xD9",Umacr:"\u016A",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",Uopf:"\uD835\uDD4C",UpArrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",UpEquilibrium:"\u296E",UpTee:"\u22A5",UpTeeArrow:"\u21A5",Uparrow:"\u21D1",Updownarrow:"\u21D5",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",Upsilon:"\u03A5",Uring:"\u016E",Uscr:"\uD835\uDCB0",Utilde:"\u0168",Uuml:"\xDC",VDash:"\u22AB",Vbar:"\u2AEB",Vcy:"\u0412",Vdash:"\u22A9",Vdashl:"\u2AE6",Vee:"\u22C1",Verbar:"\u2016",Vert:"\u2016",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\uD835\uDD19",Vopf:"\uD835\uDD4D",Vscr:"\uD835\uDCB1",Vvdash:"\u22AA",Wcirc:"\u0174",Wedge:"\u22C0",Wfr:"\uD835\uDD1A",Wopf:"\uD835\uDD4E",Wscr:"\uD835\uDCB2",Xfr:"\uD835\uDD1B",Xi:"\u039E",Xopf:"\uD835\uDD4F",Xscr:"\uD835\uDCB3",YAcy:"\u042F",YIcy:"\u0407",YUcy:"\u042E",Yacute:"\xDD",Ycirc:"\u0176",Ycy:"\u042B",Yfr:"\uD835\uDD1C",Yopf:"\uD835\uDD50",Yscr:"\uD835\uDCB4",Yuml:"\u0178",ZHcy:"\u0416",Zacute:"\u0179",Zcaron:"\u017D",Zcy:"\u0417",Zdot:"\u017B",ZeroWidthSpace:"\u200B",Zeta:"\u0396",Zfr:"\u2128",Zopf:"\u2124",Zscr:"\uD835\uDCB5",aacute:"\xE1",abreve:"\u0103",ac:"\u223E",acE:"\u223E\u0333",acd:"\u223F",acirc:"\xE2",acute:"\xB4",acy:"\u0430",aelig:"\xE6",af:"\u2061",afr:"\uD835\uDD1E",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",alpha:"\u03B1",amacr:"\u0101",amalg:"\u2A3F",amp:"&",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",aogon:"\u0105",aopf:"\uD835\uDD52",ap:"\u2248",apE:"\u2A70",apacir:"\u2A6F",ape:"\u224A",apid:"\u224B",apos:"'",approx:"\u2248",approxeq:"\u224A",aring:"\xE5",ascr:"\uD835\uDCB6",ast:"*",asymp:"\u2248",asympeq:"\u224D",atilde:"\xE3",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",bNot:"\u2AED",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",barvee:"\u22BD",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",beta:"\u03B2",beth:"\u2136",between:"\u226C",bfr:"\uD835\uDD1F",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bnot:"\u2310",bopf:"\uD835\uDD53",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxDL:"\u2557",boxDR:"\u2554",boxDl:"\u2556",boxDr:"\u2553",boxH:"\u2550",boxHD:"\u2566",boxHU:"\u2569",boxHd:"\u2564",boxHu:"\u2567",boxUL:"\u255D",boxUR:"\u255A",boxUl:"\u255C",boxUr:"\u2559",boxV:"\u2551",boxVH:"\u256C",boxVL:"\u2563",boxVR:"\u2560",boxVh:"\u256B",boxVl:"\u2562",boxVr:"\u255F",boxbox:"\u29C9",boxdL:"\u2555",boxdR:"\u2552",boxdl:"\u2510",boxdr:"\u250C",boxh:"\u2500",boxhD:"\u2565",boxhU:"\u2568",boxhd:"\u252C",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxuL:"\u255B",boxuR:"\u2558",boxul:"\u2518",boxur:"\u2514",boxv:"\u2502",boxvH:"\u256A",boxvL:"\u2561",boxvR:"\u255E",boxvh:"\u253C",boxvl:"\u2524",boxvr:"\u251C",bprime:"\u2035",breve:"\u02D8",brvbar:"\xA6",bscr:"\uD835\uDCB7",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",bumpeq:"\u224F",cacute:"\u0107",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",ccaps:"\u2A4D",ccaron:"\u010D",ccedil:"\xE7",ccirc:"\u0109",ccups:"\u2A4C",ccupssm:"\u2A50",cdot:"\u010B",cedil:"\xB8",cemptyv:"\u29B2",cent:"\xA2",centerdot:"\xB7",cfr:"\uD835\uDD20",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",chi:"\u03C7",cir:"\u25CB",cirE:"\u29C3",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledR:"\xAE",circledS:"\u24C8",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",clubs:"\u2663",clubsuit:"\u2663",colon:":",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",conint:"\u222E",copf:"\uD835\uDD54",coprod:"\u2210",copy:"\xA9",copysr:"\u2117",crarr:"\u21B5",cross:"\u2717",cscr:"\uD835\uDCB8",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",cup:"\u222A",cupbrcap:"\u2A48",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",dArr:"\u21D3",dHar:"\u2965",dagger:"\u2020",daleth:"\u2138",darr:"\u2193",dash:"\u2010",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",dcaron:"\u010F",dcy:"\u0434",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",ddotseq:"\u2A77",deg:"\xB0",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",dfr:"\uD835\uDD21",dharl:"\u21C3",dharr:"\u21C2",diam:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",dopf:"\uD835\uDD55",dot:"\u02D9",doteq:"\u2250",doteqdot:"\u2251",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",downarrow:"\u2193",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",dscr:"\uD835\uDCB9",dscy:"\u0455",dsol:"\u29F6",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",dzcy:"\u045F",dzigrarr:"\u27FF",eDDot:"\u2A77",eDot:"\u2251",eacute:"\xE9",easter:"\u2A6E",ecaron:"\u011B",ecir:"\u2256",ecirc:"\xEA",ecolon:"\u2255",ecy:"\u044D",edot:"\u0117",ee:"\u2147",efDot:"\u2252",efr:"\uD835\uDD22",eg:"\u2A9A",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",emptyv:"\u2205",emsp13:"\u2004",emsp14:"\u2005",emsp:"\u2003",eng:"\u014B",ensp:"\u2002",eogon:"\u0119",eopf:"\uD835\uDD56",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",equals:"=",equest:"\u225F",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erDot:"\u2253",erarr:"\u2971",escr:"\u212F",esdot:"\u2250",esim:"\u2242",eta:"\u03B7",eth:"\xF0",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",expectation:"\u2130",exponentiale:"\u2147",fallingdotseq:"\u2252",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",ffr:"\uD835\uDD23",filig:"\uFB01",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",fopf:"\uD835\uDD57",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",fscr:"\uD835\uDCBB",gE:"\u2267",gEl:"\u2A8C",gacute:"\u01F5",gamma:"\u03B3",gammad:"\u03DD",gap:"\u2A86",gbreve:"\u011F",gcirc:"\u011D",gcy:"\u0433",gdot:"\u0121",ge:"\u2265",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",gfr:"\uD835\uDD24",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",gjcy:"\u0453",gl:"\u2277",glE:"\u2A92",gla:"\u2AA5",glj:"\u2AA4",gnE:"\u2269",gnap:"\u2A8A",gnapprox:"\u2A8A",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",gopf:"\uD835\uDD58",grave:"`",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",hArr:"\u21D4",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",hardcy:"\u044A",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",hbar:"\u210F",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",hfr:"\uD835\uDD25",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",hopf:"\uD835\uDD59",horbar:"\u2015",hscr:"\uD835\uDCBD",hslash:"\u210F",hstrok:"\u0127",hybull:"\u2043",hyphen:"\u2010",iacute:"\xED",ic:"\u2063",icirc:"\xEE",icy:"\u0438",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",ifr:"\uD835\uDD26",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",ijlig:"\u0133",imacr:"\u012B",image:"\u2111",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",int:"\u222B",intcal:"\u22BA",integers:"\u2124",intercal:"\u22BA",intlarhk:"\u2A17",intprod:"\u2A3C",iocy:"\u0451",iogon:"\u012F",iopf:"\uD835\uDD5A",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",iscr:"\uD835\uDCBE",isin:"\u2208",isinE:"\u22F9",isindot:"\u22F5",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",itilde:"\u0129",iukcy:"\u0456",iuml:"\xEF",jcirc:"\u0135",jcy:"\u0439",jfr:"\uD835\uDD27",jmath:"\u0237",jopf:"\uD835\uDD5B",jscr:"\uD835\uDCBF",jsercy:"\u0458",jukcy:"\u0454",kappa:"\u03BA",kappav:"\u03F0",kcedil:"\u0137",kcy:"\u043A",kfr:"\uD835\uDD28",kgreen:"\u0138",khcy:"\u0445",kjcy:"\u045C",kopf:"\uD835\uDD5C",kscr:"\uD835\uDCC0",lAarr:"\u21DA",lArr:"\u21D0",lAtail:"\u291B",lBarr:"\u290E",lE:"\u2266",lEg:"\u2A8B",lHar:"\u2962",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",lambda:"\u03BB",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",laquo:"\xAB",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",lcaron:"\u013E",lcedil:"\u013C",lceil:"\u2308",lcub:"{",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",le:"\u2264",leftarrow:"\u2190",leftarrowtail:"\u21A2",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",leftthreetimes:"\u22CB",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",lessgtr:"\u2276",lesssim:"\u2272",lfisht:"\u297C",lfloor:"\u230A",lfr:"\uD835\uDD29",lg:"\u2276",lgE:"\u2A91",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",ljcy:"\u0459",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",llhard:"\u296B",lltri:"\u25FA",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnE:"\u2268",lnap:"\u2A89",lnapprox:"\u2A89",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",longleftarrow:"\u27F5",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",lopf:"\uD835\uDD5D",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",lscr:"\uD835\uDCC1",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",lstrok:"\u0142",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltrPar:"\u2996",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",mDDot:"\u223A",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",mcy:"\u043C",mdash:"\u2014",measuredangle:"\u2221",mfr:"\uD835\uDD2A",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",mopf:"\uD835\uDD5E",mp:"\u2213",mscr:"\uD835\uDCC2",mstpos:"\u223E",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nGg:"\u22D9\u0338",nGt:"\u226B\u20D2",nGtv:"\u226B\u0338",nLeftarrow:"\u21CD",nLeftrightarrow:"\u21CE",nLl:"\u22D8\u0338",nLt:"\u226A\u20D2",nLtv:"\u226A\u0338",nRightarrow:"\u21CF",nVDash:"\u22AF",nVdash:"\u22AE",nabla:"\u2207",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",ncaron:"\u0148",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",neArr:"\u21D7",nearhk:"\u2924",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",nexist:"\u2204",nexists:"\u2204",nfr:"\uD835\uDD2B",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",ngsim:"\u2275",ngt:"\u226F",ngtr:"\u226F",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",njcy:"\u045A",nlArr:"\u21CD",nlE:"\u2266\u0338",nlarr:"\u219A",nldr:"\u2025",nle:"\u2270",nleftarrow:"\u219A",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nlsim:"\u2274",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nmid:"\u2224",nopf:"\uD835\uDD5F",not:"\xAC",notin:"\u2209",notinE:"\u22F9\u0338",notindot:"\u22F5\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",nscr:"\uD835\uDCC3",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvDash:"\u22AD",nvHarr:"\u2904",nvap:"\u224D\u20D2",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwArr:"\u21D6",nwarhk:"\u2923",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",oS:"\u24C8",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",ocirc:"\xF4",ocy:"\u043E",odash:"\u229D",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",oelig:"\u0153",ofcir:"\u29BF",ofr:"\uD835\uDD2C",ogon:"\u02DB",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",omacr:"\u014D",omega:"\u03C9",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",oopf:"\uD835\uDD60",opar:"\u29B7",operp:"\u29B9",oplus:"\u2295",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oscr:"\u2134",oslash:"\xF8",osol:"\u2298",otilde:"\xF5",otimes:"\u2297",otimesas:"\u2A36",ouml:"\xF6",ovbar:"\u233D",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",pfr:"\uD835\uDD2D",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",pointint:"\u2A15",popf:"\uD835\uDD61",pound:"\xA3",pr:"\u227A",prE:"\u2AB3",prap:"\u2AB7",prcue:"\u227C",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",prime:"\u2032",primes:"\u2119",prnE:"\u2AB5",prnap:"\u2AB9",prnsim:"\u22E8",prod:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",pscr:"\uD835\uDCC5",psi:"\u03C8",puncsp:"\u2008",qfr:"\uD835\uDD2E",qint:"\u2A0C",qopf:"\uD835\uDD62",qprime:"\u2057",qscr:"\uD835\uDCC6",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",quot:'"',rAarr:"\u21DB",rArr:"\u21D2",rAtail:"\u291C",rBarr:"\u290F",rHar:"\u2964",race:"\u223D\u0331",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",rarrtl:"\u21A3",rarrw:"\u219D",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",rcaron:"\u0159",rcedil:"\u0157",rceil:"\u2309",rcub:"}",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",reg:"\xAE",rfisht:"\u297D",rfloor:"\u230B",rfr:"\uD835\uDD2F",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",rho:"\u03C1",rhov:"\u03F1",rightarrow:"\u2192",rightarrowtail:"\u21A3",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",rightthreetimes:"\u22CC",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",ropf:"\uD835\uDD63",roplus:"\u2A2E",rotimes:"\u2A35",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",rsaquo:"\u203A",rscr:"\uD835\uDCC7",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",ruluhar:"\u2968",rx:"\u211E",sacute:"\u015B",sbquo:"\u201A",sc:"\u227B",scE:"\u2AB4",scap:"\u2AB8",scaron:"\u0161",sccue:"\u227D",sce:"\u2AB0",scedil:"\u015F",scirc:"\u015D",scnE:"\u2AB6",scnap:"\u2ABA",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",seArr:"\u21D8",searhk:"\u2925",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",sfr:"\uD835\uDD30",sfrown:"\u2322",sharp:"\u266F",shchcy:"\u0449",shcy:"\u0448",shortmid:"\u2223",shortparallel:"\u2225",shy:"\xAD",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",sopf:"\uD835\uDD64",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",square:"\u25A1",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",sscr:"\uD835\uDCC8",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",sub:"\u2282",subE:"\u2AC5",subdot:"\u2ABD",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",sum:"\u2211",sung:"\u266A",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",sup:"\u2283",supE:"\u2AC6",supdot:"\u2ABE",supdsub:"\u2AD8",supe:"\u2287",supedot:"\u2AC4",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swArr:"\u21D9",swarhk:"\u2926",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",target:"\u2316",tau:"\u03C4",tbrk:"\u23B4",tcaron:"\u0165",tcedil:"\u0163",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",tfr:"\uD835\uDD31",there4:"\u2234",therefore:"\u2234",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",thinsp:"\u2009",thkap:"\u2248",thksim:"\u223C",thorn:"\xFE",tilde:"\u02DC",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",topf:"\uD835\uDD65",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",tscr:"\uD835\uDCC9",tscy:"\u0446",tshcy:"\u045B",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",uArr:"\u21D1",uHar:"\u2963",uacute:"\xFA",uarr:"\u2191",ubrcy:"\u045E",ubreve:"\u016D",ucirc:"\xFB",ucy:"\u0443",udarr:"\u21C5",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",ufr:"\uD835\uDD32",ugrave:"\xF9",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",umacr:"\u016B",uml:"\xA8",uogon:"\u0173",uopf:"\uD835\uDD66",uparrow:"\u2191",updownarrow:"\u2195",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",upsi:"\u03C5",upsih:"\u03D2",upsilon:"\u03C5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",uring:"\u016F",urtri:"\u25F9",uscr:"\uD835\uDCCA",utdot:"\u22F0",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",uuml:"\xFC",uwangle:"\u29A7",vArr:"\u21D5",vBar:"\u2AE8",vBarv:"\u2AE9",vDash:"\u22A8",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",vcy:"\u0432",vdash:"\u22A2",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",verbar:"|",vert:"|",vfr:"\uD835\uDD33",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",vopf:"\uD835\uDD67",vprop:"\u221D",vrtri:"\u22B3",vscr:"\uD835\uDCCB",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",vzigzag:"\u299A",wcirc:"\u0175",wedbar:"\u2A5F",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",wfr:"\uD835\uDD34",wopf:"\uD835\uDD68",wp:"\u2118",wr:"\u2240",wreath:"\u2240",wscr:"\uD835\uDCCC",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",xfr:"\uD835\uDD35",xhArr:"\u27FA",xharr:"\u27F7",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",xopf:"\uD835\uDD69",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",xscr:"\uD835\uDCCD",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",yacute:"\xFD",yacy:"\u044F",ycirc:"\u0177",ycy:"\u044B",yen:"\xA5",yfr:"\uD835\uDD36",yicy:"\u0457",yopf:"\uD835\uDD6A",yscr:"\uD835\uDCCE",yucy:"\u044E",yuml:"\xFF",zacute:"\u017A",zcaron:"\u017E",zcy:"\u0437",zdot:"\u017C",zeetrf:"\u2128",zeta:"\u03B6",zfr:"\uD835\uDD37",zhcy:"\u0436",zigrarr:"\u21DD",zopf:"\uD835\uDD6B",zscr:"\uD835\uDCCF",zwj:"\u200D",zwnj:"\u200C"};var vW={}.hasOwnProperty;function v0(q){return vW.call(I2,q)?I2[q]:!1}var M={carriageReturn:-5,lineFeed:-4,carriageReturnLineFeed:-3,horizontalTab:-2,virtualSpace:-1,eof:null,nul:0,soh:1,stx:2,etx:3,eot:4,enq:5,ack:6,bel:7,bs:8,ht:9,lf:10,vt:11,ff:12,cr:13,so:14,si:15,dle:16,dc1:17,dc2:18,dc3:19,dc4:20,nak:21,syn:22,etb:23,can:24,em:25,sub:26,esc:27,fs:28,gs:29,rs:30,us:31,space:32,exclamationMark:33,quotationMark:34,numberSign:35,dollarSign:36,percentSign:37,ampersand:38,apostrophe:39,leftParenthesis:40,rightParenthesis:41,asterisk:42,plusSign:43,comma:44,dash:45,dot:46,slash:47,digit0:48,digit1:49,digit2:50,digit3:51,digit4:52,digit5:53,digit6:54,digit7:55,digit8:56,digit9:57,colon:58,semicolon:59,lessThan:60,equalsTo:61,greaterThan:62,questionMark:63,atSign:64,uppercaseA:65,uppercaseB:66,uppercaseC:67,uppercaseD:68,uppercaseE:69,uppercaseF:70,uppercaseG:71,uppercaseH:72,uppercaseI:73,uppercaseJ:74,uppercaseK:75,uppercaseL:76,uppercaseM:77,uppercaseN:78,uppercaseO:79,uppercaseP:80,uppercaseQ:81,uppercaseR:82,uppercaseS:83,uppercaseT:84,uppercaseU:85,uppercaseV:86,uppercaseW:87,uppercaseX:88,uppercaseY:89,uppercaseZ:90,leftSquareBracket:91,backslash:92,rightSquareBracket:93,caret:94,underscore:95,graveAccent:96,lowercaseA:97,lowercaseB:98,lowercaseC:99,lowercaseD:100,lowercaseE:101,lowercaseF:102,lowercaseG:103,lowercaseH:104,lowercaseI:105,lowercaseJ:106,lowercaseK:107,lowercaseL:108,lowercaseM:109,lowercaseN:110,lowercaseO:111,lowercaseP:112,lowercaseQ:113,lowercaseR:114,lowercaseS:115,lowercaseT:116,lowercaseU:117,lowercaseV:118,lowercaseW:119,lowercaseX:120,lowercaseY:121,lowercaseZ:122,leftCurlyBrace:123,verticalBar:124,rightCurlyBrace:125,tilde:126,del:127,byteOrderMarker:65279,replacementCharacter:65533};var C={attentionSideAfter:2,attentionSideBefore:1,atxHeadingOpeningFenceSizeMax:6,autolinkDomainSizeMax:63,autolinkSchemeSizeMax:32,cdataOpeningString:"CDATA[",characterGroupPunctuation:2,characterGroupWhitespace:1,characterReferenceDecimalSizeMax:7,characterReferenceHexadecimalSizeMax:6,characterReferenceNamedSizeMax:31,codeFencedSequenceSizeMin:3,contentTypeContent:"content",contentTypeDocument:"document",contentTypeFlow:"flow",contentTypeString:"string",contentTypeText:"text",hardBreakPrefixSizeMin:2,htmlBasic:6,htmlCdata:5,htmlComment:2,htmlComplete:7,htmlDeclaration:4,htmlInstruction:3,htmlRawSizeMax:8,htmlRaw:1,linkResourceDestinationBalanceMax:32,linkReferenceSizeMax:999,listItemValueSizeMax:10,numericBaseDecimal:10,numericBaseHexadecimal:16,tabSize:4,thematicBreakMarkerCountMin:3,v8MaxSafeChunkSize:1e4};var z={data:"data",whitespace:"whitespace",lineEnding:"lineEnding",lineEndingBlank:"lineEndingBlank",linePrefix:"linePrefix",lineSuffix:"lineSuffix",atxHeading:"atxHeading",atxHeadingSequence:"atxHeadingSequence",atxHeadingText:"atxHeadingText",autolink:"autolink",autolinkEmail:"autolinkEmail",autolinkMarker:"autolinkMarker",autolinkProtocol:"autolinkProtocol",characterEscape:"characterEscape",characterEscapeValue:"characterEscapeValue",characterReference:"characterReference",characterReferenceMarker:"characterReferenceMarker",characterReferenceMarkerNumeric:"characterReferenceMarkerNumeric",characterReferenceMarkerHexadecimal:"characterReferenceMarkerHexadecimal",characterReferenceValue:"characterReferenceValue",codeFenced:"codeFenced",codeFencedFence:"codeFencedFence",codeFencedFenceSequence:"codeFencedFenceSequence",codeFencedFenceInfo:"codeFencedFenceInfo",codeFencedFenceMeta:"codeFencedFenceMeta",codeFlowValue:"codeFlowValue",codeIndented:"codeIndented",codeText:"codeText",codeTextData:"codeTextData",codeTextPadding:"codeTextPadding",codeTextSequence:"codeTextSequence",content:"content",definition:"definition",definitionDestination:"definitionDestination",definitionDestinationLiteral:"definitionDestinationLiteral",definitionDestinationLiteralMarker:"definitionDestinationLiteralMarker",definitionDestinationRaw:"definitionDestinationRaw",definitionDestinationString:"definitionDestinationString",definitionLabel:"definitionLabel",definitionLabelMarker:"definitionLabelMarker",definitionLabelString:"definitionLabelString",definitionMarker:"definitionMarker",definitionTitle:"definitionTitle",definitionTitleMarker:"definitionTitleMarker",definitionTitleString:"definitionTitleString",emphasis:"emphasis",emphasisSequence:"emphasisSequence",emphasisText:"emphasisText",escapeMarker:"escapeMarker",hardBreakEscape:"hardBreakEscape",hardBreakTrailing:"hardBreakTrailing",htmlFlow:"htmlFlow",htmlFlowData:"htmlFlowData",htmlText:"htmlText",htmlTextData:"htmlTextData",image:"image",label:"label",labelText:"labelText",labelLink:"labelLink",labelImage:"labelImage",labelMarker:"labelMarker",labelImageMarker:"labelImageMarker",labelEnd:"labelEnd",link:"link",paragraph:"paragraph",reference:"reference",referenceMarker:"referenceMarker",referenceString:"referenceString",resource:"resource",resourceDestination:"resourceDestination",resourceDestinationLiteral:"resourceDestinationLiteral",resourceDestinationLiteralMarker:"resourceDestinationLiteralMarker",resourceDestinationRaw:"resourceDestinationRaw",resourceDestinationString:"resourceDestinationString",resourceMarker:"resourceMarker",resourceTitle:"resourceTitle",resourceTitleMarker:"resourceTitleMarker",resourceTitleString:"resourceTitleString",setextHeading:"setextHeading",setextHeadingText:"setextHeadingText",setextHeadingLine:"setextHeadingLine",setextHeadingLineSequence:"setextHeadingLineSequence",strong:"strong",strongSequence:"strongSequence",strongText:"strongText",thematicBreak:"thematicBreak",thematicBreakSequence:"thematicBreakSequence",blockQuote:"blockQuote",blockQuotePrefix:"blockQuotePrefix",blockQuoteMarker:"blockQuoteMarker",blockQuotePrefixWhitespace:"blockQuotePrefixWhitespace",listOrdered:"listOrdered",listUnordered:"listUnordered",listItemIndent:"listItemIndent",listItemMarker:"listItemMarker",listItemPrefix:"listItemPrefix",listItemPrefixWhitespace:"listItemPrefixWhitespace",listItemValue:"listItemValue",chunkDocument:"chunkDocument",chunkContent:"chunkContent",chunkFlow:"chunkFlow",chunkText:"chunkText",chunkString:"chunkString"};var hq={ht:"\t",lf:`
|
|
105
|
-
`,cr:"\r",space:" ",exclamationMark:"!",quotationMark:'"',numberSign:"#",dollarSign:"$",percentSign:"%",ampersand:"&",apostrophe:"'",leftParenthesis:"(",rightParenthesis:")",asterisk:"*",plusSign:"+",comma:",",dash:"-",dot:".",slash:"/",digit0:"0",digit1:"1",digit2:"2",digit3:"3",digit4:"4",digit5:"5",digit6:"6",digit7:"7",digit8:"8",digit9:"9",colon:":",semicolon:";",lessThan:"<",equalsTo:"=",greaterThan:">",questionMark:"?",atSign:"@",uppercaseA:"A",uppercaseB:"B",uppercaseC:"C",uppercaseD:"D",uppercaseE:"E",uppercaseF:"F",uppercaseG:"G",uppercaseH:"H",uppercaseI:"I",uppercaseJ:"J",uppercaseK:"K",uppercaseL:"L",uppercaseM:"M",uppercaseN:"N",uppercaseO:"O",uppercaseP:"P",uppercaseQ:"Q",uppercaseR:"R",uppercaseS:"S",uppercaseT:"T",uppercaseU:"U",uppercaseV:"V",uppercaseW:"W",uppercaseX:"X",uppercaseY:"Y",uppercaseZ:"Z",leftSquareBracket:"[",backslash:"\\",rightSquareBracket:"]",caret:"^",underscore:"_",graveAccent:"`",lowercaseA:"a",lowercaseB:"b",lowercaseC:"c",lowercaseD:"d",lowercaseE:"e",lowercaseF:"f",lowercaseG:"g",lowercaseH:"h",lowercaseI:"i",lowercaseJ:"j",lowercaseK:"k",lowercaseL:"l",lowercaseM:"m",lowercaseN:"n",lowercaseO:"o",lowercaseP:"p",lowercaseQ:"q",lowercaseR:"r",lowercaseS:"s",lowercaseT:"t",lowercaseU:"u",lowercaseV:"v",lowercaseW:"w",lowercaseX:"x",lowercaseY:"y",lowercaseZ:"z",leftCurlyBrace:"{",verticalBar:"|",rightCurlyBrace:"}",tilde:"~",replacementCharacter:"\uFFFD"};function Fq(q,$,J,G){let X=q.length,Y=0,U;if($<0)$=-$>X?0:X+$;else $=$>X?X:$;if(J=J>0?J:0,G.length<C.v8MaxSafeChunkSize)U=Array.from(G),U.unshift($,J),q.splice(...U);else{if(J)q.splice($,J);while(Y<G.length)U=G.slice(Y,Y+C.v8MaxSafeChunkSize),U.unshift($,0),q.splice(...U),Y+=C.v8MaxSafeChunkSize,$+=C.v8MaxSafeChunkSize}}function Cq(q,$){if(q.length>0)return Fq(q,q.length,0,$),q;return $}var n4={}.hasOwnProperty;function o4(q){let $={},J=-1;while(++J<q.length)yW($,q[J]);return $}function yW(q,$){let J;for(J in $){let X=(n4.call(q,J)?q[J]:void 0)||(q[J]={}),Y=$[J],U;if(Y)for(U in Y){if(!n4.call(X,U))X[U]=[];let Q=Y[U];hW(X[U],Array.isArray(Q)?Q:Q?[Q]:[])}}}function hW(q,$){let J=-1,G=[];while(++J<$.length)($[J].add==="after"?q:G).push($[J]);Fq(q,0,0,G)}function z5(q,$){let J=Number.parseInt(q,$);if(J<M.ht||J===M.vt||J>M.cr&&J<M.space||J>M.tilde&&J<160||J>55295&&J<57344||J>64975&&J<65008||(J&65535)===65535||(J&65535)===65534||J>1114111)return hq.replacementCharacter;return String.fromCodePoint(J)}function R1(q){return q.replace(/[\t\n\r ]+/g,hq.space).replace(/^ | $/g,"").toLowerCase().toUpperCase()}var xq=P1(/[A-Za-z]/),Eq=P1(/[\dA-Za-z]/),a4=P1(/[#-'*+\--9=?A-Z^-~]/);function P$(q){return q!==null&&(q<M.space||q===M.del)}var L$=P1(/\d/),s4=P1(/[\dA-Fa-f]/),t4=P1(/[!-/:-@[-`{-~]/);function _(q){return q!==null&&q<M.horizontalTab}function Wq(q){return q!==null&&(q<M.nul||q===M.space)}function p(q){return q===M.horizontalTab||q===M.virtualSpace||q===M.space}var e4=P1(/\p{P}|\p{S}/u),q8=P1(/\s/);function P1(q){return $;function $(J){return J!==null&&J>-1&&q.test(String.fromCharCode(J))}}function r(q,$,J,G){let X=G?G-1:Number.POSITIVE_INFINITY,Y=0;return U;function U(V){if(p(V))return q.enter(J),Q(V);return $(V)}function Q(V){if(p(V)&&Y++<X)return q.consume(V),Q;return q.exit(J),$(V)}}var $8={tokenize:xW};function xW(q){let $=q.attempt(this.parser.constructs.contentInitial,G,X),J;return $;function G(Q){if(D(Q===M.eof||_(Q),"expected eol or eof"),Q===M.eof){q.consume(Q);return}return q.enter(z.lineEnding),q.consume(Q),q.exit(z.lineEnding),r(q,$,z.linePrefix)}function X(Q){return D(Q!==M.eof&&!_(Q),"expected anything other than a line ending or EOF"),q.enter(z.paragraph),Y(Q)}function Y(Q){let V=q.enter(z.chunkText,{contentType:C.contentTypeText,previous:J});if(J)J.next=V;return J=V,U(Q)}function U(Q){if(Q===M.eof){q.exit(z.chunkText),q.exit(z.paragraph),q.consume(Q);return}if(_(Q))return q.consume(Q),q.exit(z.chunkText),Y;return q.consume(Q),U}}var G8={tokenize:mW},J8={tokenize:kW};function mW(q){let $=this,J=[],G=0,X,Y,U;return Q;function Q(h){if(G<J.length){let a=J[G];return $.containerState=a[1],D(a[0].continuation,"expected `continuation` to be defined on container construct"),q.attempt(a[0].continuation,V,W)(h)}return W(h)}function V(h){if(D($.containerState,"expected `containerState` to be defined after continuation"),G++,$.containerState._closeFlow){if($.containerState._closeFlow=void 0,X)I();let a=$.events.length,Gq=a,P;while(Gq--)if($.events[Gq][0]==="exit"&&$.events[Gq][1].type===z.chunkFlow){P=$.events[Gq][1].end;break}D(P,"could not find previous flow chunk"),L(G);let e=a;while(e<$.events.length)$.events[e][1].end={...P},e++;return Fq($.events,Gq+1,0,$.events.slice(a)),$.events.length=e,W(h)}return Q(h)}function W(h){if(G===J.length){if(!X)return B(h);if(X.currentConstruct&&X.currentConstruct.concrete)return O(h);$.interrupt=Boolean(X.currentConstruct&&!X._gfmTableDynamicInterruptHack)}return $.containerState={},q.check(J8,H,K)(h)}function H(h){if(X)I();return L(G),B(h)}function K(h){return $.parser.lazy[$.now().line]=G!==J.length,U=$.now().offset,O(h)}function B(h){return $.containerState={},q.attempt(J8,R,O)(h)}function R(h){return D($.currentConstruct,"expected `currentConstruct` to be defined on tokenizer"),D($.containerState,"expected `containerState` to be defined on tokenizer"),G++,J.push([$.currentConstruct,$.containerState]),B(h)}function O(h){if(h===M.eof){if(X)I();L(0),q.consume(h);return}return X=X||$.parser.flow($.now()),q.enter(z.chunkFlow,{_tokenizer:X,contentType:C.contentTypeFlow,previous:Y}),A(h)}function A(h){if(h===M.eof){j(q.exit(z.chunkFlow),!0),L(0),q.consume(h);return}if(_(h))return q.consume(h),j(q.exit(z.chunkFlow)),G=0,$.interrupt=void 0,Q;return q.consume(h),A}function j(h,a){D(X,"expected `childFlow` to be defined when continuing");let Gq=$.sliceStream(h);if(a)Gq.push(null);if(h.previous=Y,Y)Y.next=h;if(Y=h,X.defineSkip(h.start),X.write(Gq),$.parser.lazy[h.start.line]){let P=X.events.length;while(P--)if(X.events[P][1].start.offset<U&&(!X.events[P][1].end||X.events[P][1].end.offset>U))return;let e=$.events.length,Yq=e,s,Xq;while(Yq--)if($.events[Yq][0]==="exit"&&$.events[Yq][1].type===z.chunkFlow){if(s){Xq=$.events[Yq][1].end;break}s=!0}D(Xq,"could not find previous flow chunk"),L(G),P=e;while(P<$.events.length)$.events[P][1].end={...Xq},P++;Fq($.events,Yq+1,0,$.events.slice(e)),$.events.length=P}}function L(h){let a=J.length;while(a-- >h){let Gq=J[a];$.containerState=Gq[1],D(Gq[0].exit,"expected `exit` to be defined on container construct"),Gq[0].exit.call($,q)}J.length=h}function I(){D($.containerState,"expected `containerState` to be defined when closing flow"),D(X,"expected `childFlow` to be defined when closing it"),X.write([M.eof]),Y=void 0,X=void 0,$.containerState._closeFlow=void 0}}function kW(q,$,J){return D(this.parser.constructs.disable.null,"expected `disable.null` to be populated"),r(q,q.attempt(this.parser.constructs.document,$,J),z.linePrefix,this.parser.constructs.disable.null.includes("codeIndented")?void 0:C.tabSize)}function y0(q){if(q===M.eof||Wq(q)||q8(q))return C.characterGroupWhitespace;if(e4(q))return C.characterGroupPunctuation}function h0(q,$,J){let G=[],X=-1;while(++X<q.length){let Y=q[X].resolveAll;if(Y&&!G.includes(Y))$=Y($,J),G.push(Y)}return $}var Z$={name:"attention",resolveAll:fW,tokenize:uW};function fW(q,$){let J=-1,G,X,Y,U,Q,V,W,H;while(++J<q.length)if(q[J][0]==="enter"&&q[J][1].type==="attentionSequence"&&q[J][1]._close){G=J;while(G--)if(q[G][0]==="exit"&&q[G][1].type==="attentionSequence"&&q[G][1]._open&&$.sliceSerialize(q[G][1]).charCodeAt(0)===$.sliceSerialize(q[J][1]).charCodeAt(0)){if((q[G][1]._close||q[J][1]._open)&&(q[J][1].end.offset-q[J][1].start.offset)%3&&!((q[G][1].end.offset-q[G][1].start.offset+q[J][1].end.offset-q[J][1].start.offset)%3))continue;V=q[G][1].end.offset-q[G][1].start.offset>1&&q[J][1].end.offset-q[J][1].start.offset>1?2:1;let K={...q[G][1].end},B={...q[J][1].start};if(X8(K,-V),X8(B,V),U={type:V>1?z.strongSequence:z.emphasisSequence,start:K,end:{...q[G][1].end}},Q={type:V>1?z.strongSequence:z.emphasisSequence,start:{...q[J][1].start},end:B},Y={type:V>1?z.strongText:z.emphasisText,start:{...q[G][1].end},end:{...q[J][1].start}},X={type:V>1?z.strong:z.emphasis,start:{...U.start},end:{...Q.end}},q[G][1].end={...U.start},q[J][1].start={...Q.end},W=[],q[G][1].end.offset-q[G][1].start.offset)W=Cq(W,[["enter",q[G][1],$],["exit",q[G][1],$]]);if(W=Cq(W,[["enter",X,$],["enter",U,$],["exit",U,$],["enter",Y,$]]),D($.parser.constructs.insideSpan.null,"expected `insideSpan` to be populated"),W=Cq(W,h0($.parser.constructs.insideSpan.null,q.slice(G+1,J),$)),W=Cq(W,[["exit",Y,$],["enter",Q,$],["exit",Q,$],["exit",X,$]]),q[J][1].end.offset-q[J][1].start.offset)H=2,W=Cq(W,[["enter",q[J][1],$],["exit",q[J][1],$]]);else H=0;Fq(q,G-1,J-G+3,W),J=G+W.length-H-2;break}}J=-1;while(++J<q.length)if(q[J][1].type==="attentionSequence")q[J][1].type="data";return q}function uW(q,$){let J=this.parser.constructs.attentionMarkers.null,G=this.previous,X=y0(G),Y;return U;function U(V){return D(V===M.asterisk||V===M.underscore,"expected asterisk or underscore"),Y=V,q.enter("attentionSequence"),Q(V)}function Q(V){if(V===Y)return q.consume(V),Q;let W=q.exit("attentionSequence"),H=y0(V);D(J,"expected `attentionMarkers` to be populated");let K=!H||H===C.characterGroupPunctuation&&X||J.includes(V),B=!X||X===C.characterGroupPunctuation&&H||J.includes(G);return W._open=Boolean(Y===M.asterisk?K:K&&(X||!B)),W._close=Boolean(Y===M.asterisk?B:B&&(H||!K)),$(V)}}function X8(q,$){q.column+=$,q.offset+=$,q._bufferIndex+=$}var g2={name:"autolink",tokenize:pW};function pW(q,$,J){let G=0;return X;function X(R){return D(R===M.lessThan,"expected `<`"),q.enter(z.autolink),q.enter(z.autolinkMarker),q.consume(R),q.exit(z.autolinkMarker),q.enter(z.autolinkProtocol),Y}function Y(R){if(xq(R))return q.consume(R),U;if(R===M.atSign)return J(R);return W(R)}function U(R){if(R===M.plusSign||R===M.dash||R===M.dot||Eq(R))return G=1,Q(R);return W(R)}function Q(R){if(R===M.colon)return q.consume(R),G=0,V;if((R===M.plusSign||R===M.dash||R===M.dot||Eq(R))&&G++<C.autolinkSchemeSizeMax)return q.consume(R),Q;return G=0,W(R)}function V(R){if(R===M.greaterThan)return q.exit(z.autolinkProtocol),q.enter(z.autolinkMarker),q.consume(R),q.exit(z.autolinkMarker),q.exit(z.autolink),$;if(R===M.eof||R===M.space||R===M.lessThan||P$(R))return J(R);return q.consume(R),V}function W(R){if(R===M.atSign)return q.consume(R),H;if(a4(R))return q.consume(R),W;return J(R)}function H(R){return Eq(R)?K(R):J(R)}function K(R){if(R===M.dot)return q.consume(R),G=0,H;if(R===M.greaterThan)return q.exit(z.autolinkProtocol).type=z.autolinkEmail,q.enter(z.autolinkMarker),q.consume(R),q.exit(z.autolinkMarker),q.exit(z.autolink),$;return B(R)}function B(R){if((R===M.dash||Eq(R))&&G++<C.autolinkDomainSizeMax){let O=R===M.dash?B:K;return q.consume(R),O}return J(R)}}var L1={partial:!0,tokenize:lW};function lW(q,$,J){return G;function G(Y){return p(Y)?r(q,X,z.linePrefix)(Y):X(Y)}function X(Y){return Y===M.eof||_(Y)?$(Y):J(Y)}}var M5={continuation:{tokenize:iW},exit:dW,name:"blockQuote",tokenize:rW};function rW(q,$,J){let G=this;return X;function X(U){if(U===M.greaterThan){let Q=G.containerState;if(D(Q,"expected `containerState` to be defined in container"),!Q.open)q.enter(z.blockQuote,{_container:!0}),Q.open=!0;return q.enter(z.blockQuotePrefix),q.enter(z.blockQuoteMarker),q.consume(U),q.exit(z.blockQuoteMarker),Y}return J(U)}function Y(U){if(p(U))return q.enter(z.blockQuotePrefixWhitespace),q.consume(U),q.exit(z.blockQuotePrefixWhitespace),q.exit(z.blockQuotePrefix),$;return q.exit(z.blockQuotePrefix),$(U)}}function iW(q,$,J){let G=this;return X;function X(U){if(p(U))return D(G.parser.constructs.disable.null,"expected `disable.null` to be populated"),r(q,Y,z.linePrefix,G.parser.constructs.disable.null.includes("codeIndented")?void 0:C.tabSize)(U);return Y(U)}function Y(U){return q.attempt(M5,$,J)(U)}}function dW(q){q.exit(z.blockQuote)}var R5={name:"characterEscape",tokenize:cW};function cW(q,$,J){return G;function G(Y){return D(Y===M.backslash,"expected `\\`"),q.enter(z.characterEscape),q.enter(z.escapeMarker),q.consume(Y),q.exit(z.escapeMarker),X}function X(Y){if(t4(Y))return q.enter(z.characterEscapeValue),q.consume(Y),q.exit(z.characterEscapeValue),q.exit(z.characterEscape),$;return J(Y)}}var B5={name:"characterReference",tokenize:nW};function nW(q,$,J){let G=this,X=0,Y,U;return Q;function Q(K){return D(K===M.ampersand,"expected `&`"),q.enter(z.characterReference),q.enter(z.characterReferenceMarker),q.consume(K),q.exit(z.characterReferenceMarker),V}function V(K){if(K===M.numberSign)return q.enter(z.characterReferenceMarkerNumeric),q.consume(K),q.exit(z.characterReferenceMarkerNumeric),W;return q.enter(z.characterReferenceValue),Y=C.characterReferenceNamedSizeMax,U=Eq,H(K)}function W(K){if(K===M.uppercaseX||K===M.lowercaseX)return q.enter(z.characterReferenceMarkerHexadecimal),q.consume(K),q.exit(z.characterReferenceMarkerHexadecimal),q.enter(z.characterReferenceValue),Y=C.characterReferenceHexadecimalSizeMax,U=s4,H;return q.enter(z.characterReferenceValue),Y=C.characterReferenceDecimalSizeMax,U=L$,H(K)}function H(K){if(K===M.semicolon&&X){let B=q.exit(z.characterReferenceValue);if(U===Eq&&!v0(G.sliceSerialize(B)))return J(K);return q.enter(z.characterReferenceMarker),q.consume(K),q.exit(z.characterReferenceMarker),q.exit(z.characterReference),$}if(U(K)&&X++<Y)return q.consume(K),H;return J(K)}}var Y8={partial:!0,tokenize:aW},D5={concrete:!0,name:"codeFenced",tokenize:oW};function oW(q,$,J){let G=this,X={partial:!0,tokenize:Gq},Y=0,U=0,Q;return V;function V(P){return W(P)}function W(P){D(P===M.graveAccent||P===M.tilde,"expected `` ` `` or `~`");let e=G.events[G.events.length-1];return Y=e&&e[1].type===z.linePrefix?e[2].sliceSerialize(e[1],!0).length:0,Q=P,q.enter(z.codeFenced),q.enter(z.codeFencedFence),q.enter(z.codeFencedFenceSequence),H(P)}function H(P){if(P===Q)return U++,q.consume(P),H;if(U<C.codeFencedSequenceSizeMin)return J(P);return q.exit(z.codeFencedFenceSequence),p(P)?r(q,K,z.whitespace)(P):K(P)}function K(P){if(P===M.eof||_(P))return q.exit(z.codeFencedFence),G.interrupt?$(P):q.check(Y8,A,a)(P);return q.enter(z.codeFencedFenceInfo),q.enter(z.chunkString,{contentType:C.contentTypeString}),B(P)}function B(P){if(P===M.eof||_(P))return q.exit(z.chunkString),q.exit(z.codeFencedFenceInfo),K(P);if(p(P))return q.exit(z.chunkString),q.exit(z.codeFencedFenceInfo),r(q,R,z.whitespace)(P);if(P===M.graveAccent&&P===Q)return J(P);return q.consume(P),B}function R(P){if(P===M.eof||_(P))return K(P);return q.enter(z.codeFencedFenceMeta),q.enter(z.chunkString,{contentType:C.contentTypeString}),O(P)}function O(P){if(P===M.eof||_(P))return q.exit(z.chunkString),q.exit(z.codeFencedFenceMeta),K(P);if(P===M.graveAccent&&P===Q)return J(P);return q.consume(P),O}function A(P){return D(_(P),"expected eol"),q.attempt(X,a,j)(P)}function j(P){return D(_(P),"expected eol"),q.enter(z.lineEnding),q.consume(P),q.exit(z.lineEnding),L}function L(P){return Y>0&&p(P)?r(q,I,z.linePrefix,Y+1)(P):I(P)}function I(P){if(P===M.eof||_(P))return q.check(Y8,A,a)(P);return q.enter(z.codeFlowValue),h(P)}function h(P){if(P===M.eof||_(P))return q.exit(z.codeFlowValue),I(P);return q.consume(P),h}function a(P){return q.exit(z.codeFenced),$(P)}function Gq(P,e,Yq){let s=0;return Xq;function Xq(d){return D(_(d),"expected eol"),P.enter(z.lineEnding),P.consume(d),P.exit(z.lineEnding),kq}function kq(d){return D(G.parser.constructs.disable.null,"expected `disable.null` to be populated"),P.enter(z.codeFencedFence),p(d)?r(P,Jq,z.linePrefix,G.parser.constructs.disable.null.includes("codeIndented")?void 0:C.tabSize)(d):Jq(d)}function Jq(d){if(d===Q)return P.enter(z.codeFencedFenceSequence),g(d);return Yq(d)}function g(d){if(d===Q)return s++,P.consume(d),g;if(s>=U)return P.exit(z.codeFencedFenceSequence),p(d)?r(P,l,z.whitespace)(d):l(d);return Yq(d)}function l(d){if(d===M.eof||_(d))return P.exit(z.codeFencedFence),e(d);return Yq(d)}}}function aW(q,$,J){let G=this;return X;function X(U){if(U===M.eof)return J(U);return D(_(U),"expected eol"),q.enter(z.lineEnding),q.consume(U),q.exit(z.lineEnding),Y}function Y(U){return G.parser.lazy[G.now().line]?J(U):$(U)}}var C$={name:"codeIndented",tokenize:tW},sW={partial:!0,tokenize:eW};function tW(q,$,J){let G=this;return X;function X(W){return D(p(W)),q.enter(z.codeIndented),r(q,Y,z.linePrefix,C.tabSize+1)(W)}function Y(W){let H=G.events[G.events.length-1];return H&&H[1].type===z.linePrefix&&H[2].sliceSerialize(H[1],!0).length>=C.tabSize?U(W):J(W)}function U(W){if(W===M.eof)return V(W);if(_(W))return q.attempt(sW,U,V)(W);return q.enter(z.codeFlowValue),Q(W)}function Q(W){if(W===M.eof||_(W))return q.exit(z.codeFlowValue),U(W);return q.consume(W),Q}function V(W){return q.exit(z.codeIndented),$(W)}}function eW(q,$,J){let G=this;return X;function X(U){if(G.parser.lazy[G.now().line])return J(U);if(_(U))return q.enter(z.lineEnding),q.consume(U),q.exit(z.lineEnding),X;return r(q,Y,z.linePrefix,C.tabSize+1)(U)}function Y(U){let Q=G.events[G.events.length-1];return Q&&Q[1].type===z.linePrefix&&Q[2].sliceSerialize(Q[1],!0).length>=C.tabSize?$(U):_(U)?X(U):J(U)}}var v2={name:"codeText",previous:U8,resolve:qH,tokenize:$H};function qH(q){let $=q.length-4,J=3,G,X;if((q[J][1].type===z.lineEnding||q[J][1].type==="space")&&(q[$][1].type===z.lineEnding||q[$][1].type==="space")){G=J;while(++G<$)if(q[G][1].type===z.codeTextData){q[J][1].type=z.codeTextPadding,q[$][1].type=z.codeTextPadding,J+=2,$-=2;break}}G=J-1,$++;while(++G<=$)if(X===void 0){if(G!==$&&q[G][1].type!==z.lineEnding)X=G}else if(G===$||q[G][1].type===z.lineEnding){if(q[X][1].type=z.codeTextData,G!==X+2)q[X][1].end=q[G-1][1].end,q.splice(X+2,G-X-2),$-=G-X-2,G=X+2;X=void 0}return q}function U8(q){return q!==M.graveAccent||this.events[this.events.length-1][1].type===z.characterEscape}function $H(q,$,J){let G=this,X=0,Y,U;return Q;function Q(B){return D(B===M.graveAccent,"expected `` ` ``"),D(U8.call(G,G.previous),"expected correct previous"),q.enter(z.codeText),q.enter(z.codeTextSequence),V(B)}function V(B){if(B===M.graveAccent)return q.consume(B),X++,V;return q.exit(z.codeTextSequence),W(B)}function W(B){if(B===M.eof)return J(B);if(B===M.space)return q.enter("space"),q.consume(B),q.exit("space"),W;if(B===M.graveAccent)return U=q.enter(z.codeTextSequence),Y=0,K(B);if(_(B))return q.enter(z.lineEnding),q.consume(B),q.exit(z.lineEnding),W;return q.enter(z.codeTextData),H(B)}function H(B){if(B===M.eof||B===M.space||B===M.graveAccent||_(B))return q.exit(z.codeTextData),W(B);return q.consume(B),H}function K(B){if(B===M.graveAccent)return q.consume(B),Y++,K;if(Y===X)return q.exit(z.codeTextSequence),q.exit(z.codeText),$(B);return U.type=z.codeTextData,H(B)}}class y2{constructor(q){this.left=q?[...q]:[],this.right=[]}get(q){if(q<0||q>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+q+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");if(q<this.left.length)return this.left[q];return this.right[this.right.length-q+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(q,$){let J=$===null||$===void 0?Number.POSITIVE_INFINITY:$;if(J<this.left.length)return this.left.slice(q,J);if(q>this.left.length)return this.right.slice(this.right.length-J+this.left.length,this.right.length-q+this.left.length).reverse();return this.left.slice(q).concat(this.right.slice(this.right.length-J+this.left.length).reverse())}splice(q,$,J){let G=$||0;this.setCursor(Math.trunc(q));let X=this.right.splice(this.right.length-G,Number.POSITIVE_INFINITY);if(J)E$(this.left,J);return X.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(q){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(q)}pushMany(q){this.setCursor(Number.POSITIVE_INFINITY),E$(this.left,q)}unshift(q){this.setCursor(0),this.right.push(q)}unshiftMany(q){this.setCursor(0),E$(this.right,q.reverse())}setCursor(q){if(q===this.left.length||q>this.left.length&&this.right.length===0||q<0&&this.left.length===0)return;if(q<this.left.length){let $=this.left.splice(q,Number.POSITIVE_INFINITY);E$(this.right,$.reverse())}else{let $=this.right.splice(this.left.length+this.right.length-q,Number.POSITIVE_INFINITY);E$(this.left,$.reverse())}}}function E$(q,$){let J=0;if($.length<C.v8MaxSafeChunkSize)q.push(...$);else while(J<$.length)q.push(...$.slice(J,J+C.v8MaxSafeChunkSize)),J+=C.v8MaxSafeChunkSize}function w5(q){let $={},J=-1,G,X,Y,U,Q,V,W,H=new y2(q);while(++J<H.length){while(J in $)J=$[J];if(G=H.get(J),J&&G[1].type===z.chunkFlow&&H.get(J-1)[1].type===z.listItemPrefix){if(D(G[1]._tokenizer,"expected `_tokenizer` on subtokens"),V=G[1]._tokenizer.events,Y=0,Y<V.length&&V[Y][1].type===z.lineEndingBlank)Y+=2;if(Y<V.length&&V[Y][1].type===z.content)while(++Y<V.length){if(V[Y][1].type===z.content)break;if(V[Y][1].type===z.chunkText)V[Y][1]._isInFirstContentOfListItem=!0,Y++}}if(G[0]==="enter"){if(G[1].contentType)Object.assign($,JH(H,J)),J=$[J],W=!0}else if(G[1]._container){Y=J,X=void 0;while(Y--)if(U=H.get(Y),U[1].type===z.lineEnding||U[1].type===z.lineEndingBlank){if(U[0]==="enter"){if(X)H.get(X)[1].type=z.lineEndingBlank;U[1].type=z.lineEnding,X=Y}}else if(U[1].type===z.linePrefix||U[1].type===z.listItemIndent);else break;if(X)G[1].end={...H.get(X)[1].start},Q=H.slice(X,J),Q.unshift(G),H.splice(X,J-X+1,Q)}}return Fq(q,0,Number.POSITIVE_INFINITY,H.slice(0)),!W}function JH(q,$){let J=q.get($)[1],G=q.get($)[2],X=$-1,Y=[];D(J.contentType,"expected `contentType` on subtokens");let U=J._tokenizer;if(!U){if(U=G.parser[J.contentType](J.start),J._contentTypeTextTrailing)U._contentTypeTextTrailing=!0}let Q=U.events,V=[],W={},H,K,B=-1,R=J,O=0,A=0,j=[A];while(R){while(q.get(++X)[1]!==R);if(D(!K||R.previous===K,"expected previous to match"),D(!K||K.next===R,"expected next to match"),Y.push(X),!R._tokenizer){if(H=G.sliceStream(R),!R.next)H.push(M.eof);if(K)U.defineSkip(R.start);if(R._isInFirstContentOfListItem)U._gfmTasklistFirstContentOfListItem=!0;if(U.write(H),R._isInFirstContentOfListItem)U._gfmTasklistFirstContentOfListItem=void 0}K=R,R=R.next}R=J;while(++B<Q.length)if(Q[B][0]==="exit"&&Q[B-1][0]==="enter"&&Q[B][1].type===Q[B-1][1].type&&Q[B][1].start.line!==Q[B][1].end.line)D(R,"expected a current token"),A=B+1,j.push(A),R._tokenizer=void 0,R.previous=void 0,R=R.next;if(U.events=[],R)R._tokenizer=void 0,R.previous=void 0,D(!R.next,"expected no next token");else j.pop();B=j.length;while(B--){let L=Q.slice(j[B],j[B+1]),I=Y.pop();D(I!==void 0,"expected a start position when splicing"),V.push([I,I+L.length-1]),q.splice(I,2,L)}V.reverse(),B=-1;while(++B<V.length)W[O+V[B][0]]=O+V[B][1],O+=V[B][1]-V[B][0]-1;return W}var h2={resolve:XH,tokenize:YH},GH={partial:!0,tokenize:UH};function XH(q){return w5(q),q}function YH(q,$){let J;return G;function G(Q){return D(Q!==M.eof&&!_(Q),"expected no eof or eol"),q.enter(z.content),J=q.enter(z.chunkContent,{contentType:C.contentTypeContent}),X(Q)}function X(Q){if(Q===M.eof)return Y(Q);if(_(Q))return q.check(GH,U,Y)(Q);return q.consume(Q),X}function Y(Q){return q.exit(z.chunkContent),q.exit(z.content),$(Q)}function U(Q){return D(_(Q),"expected eol"),q.consume(Q),q.exit(z.chunkContent),D(J,"expected previous token"),J.next=q.enter(z.chunkContent,{contentType:C.contentTypeContent,previous:J}),J=J.next,X}}function UH(q,$,J){let G=this;return X;function X(U){return D(_(U),"expected a line ending"),q.exit(z.chunkContent),q.enter(z.lineEnding),q.consume(U),q.exit(z.lineEnding),r(q,Y,z.linePrefix)}function Y(U){if(U===M.eof||_(U))return J(U);D(G.parser.constructs.disable.null,"expected `disable.null` to be populated");let Q=G.events[G.events.length-1];if(!G.parser.constructs.disable.null.includes("codeIndented")&&Q&&Q[1].type===z.linePrefix&&Q[2].sliceSerialize(Q[1],!0).length>=C.tabSize)return $(U);return q.interrupt(G.parser.constructs.flow,J,$)(U)}}function F5(q,$,J,G,X,Y,U,Q,V){let W=V||Number.POSITIVE_INFINITY,H=0;return K;function K(L){if(L===M.lessThan)return q.enter(G),q.enter(X),q.enter(Y),q.consume(L),q.exit(Y),B;if(L===M.eof||L===M.space||L===M.rightParenthesis||P$(L))return J(L);return q.enter(G),q.enter(U),q.enter(Q),q.enter(z.chunkString,{contentType:C.contentTypeString}),A(L)}function B(L){if(L===M.greaterThan)return q.enter(Y),q.consume(L),q.exit(Y),q.exit(X),q.exit(G),$;return q.enter(Q),q.enter(z.chunkString,{contentType:C.contentTypeString}),R(L)}function R(L){if(L===M.greaterThan)return q.exit(z.chunkString),q.exit(Q),B(L);if(L===M.eof||L===M.lessThan||_(L))return J(L);return q.consume(L),L===M.backslash?O:R}function O(L){if(L===M.lessThan||L===M.greaterThan||L===M.backslash)return q.consume(L),R;return R(L)}function A(L){if(!H&&(L===M.eof||L===M.rightParenthesis||Wq(L)))return q.exit(z.chunkString),q.exit(Q),q.exit(U),q.exit(G),$(L);if(H<W&&L===M.leftParenthesis)return q.consume(L),H++,A;if(L===M.rightParenthesis)return q.consume(L),H--,A;if(L===M.eof||L===M.space||L===M.leftParenthesis||P$(L))return J(L);return q.consume(L),L===M.backslash?j:A}function j(L){if(L===M.leftParenthesis||L===M.rightParenthesis||L===M.backslash)return q.consume(L),A;return A(L)}}function O5(q,$,J,G,X,Y){let U=this,Q=0,V;return W;function W(R){return D(R===M.leftSquareBracket,"expected `[`"),q.enter(G),q.enter(X),q.consume(R),q.exit(X),q.enter(Y),H}function H(R){if(Q>C.linkReferenceSizeMax||R===M.eof||R===M.leftSquareBracket||R===M.rightSquareBracket&&!V||R===M.caret&&!Q&&"_hiddenFootnoteSupport"in U.parser.constructs)return J(R);if(R===M.rightSquareBracket)return q.exit(Y),q.enter(X),q.consume(R),q.exit(X),q.exit(G),$;if(_(R))return q.enter(z.lineEnding),q.consume(R),q.exit(z.lineEnding),H;return q.enter(z.chunkString,{contentType:C.contentTypeString}),K(R)}function K(R){if(R===M.eof||R===M.leftSquareBracket||R===M.rightSquareBracket||_(R)||Q++>C.linkReferenceSizeMax)return q.exit(z.chunkString),H(R);if(q.consume(R),!V)V=!p(R);return R===M.backslash?B:K}function B(R){if(R===M.leftSquareBracket||R===M.backslash||R===M.rightSquareBracket)return q.consume(R),Q++,K;return K(R)}}function A5(q,$,J,G,X,Y){let U;return Q;function Q(B){if(B===M.quotationMark||B===M.apostrophe||B===M.leftParenthesis)return q.enter(G),q.enter(X),q.consume(B),q.exit(X),U=B===M.leftParenthesis?M.rightParenthesis:B,V;return J(B)}function V(B){if(B===U)return q.enter(X),q.consume(B),q.exit(X),q.exit(G),$;return q.enter(Y),W(B)}function W(B){if(B===U)return q.exit(Y),V(U);if(B===M.eof)return J(B);if(_(B))return q.enter(z.lineEnding),q.consume(B),q.exit(z.lineEnding),r(q,W,z.linePrefix);return q.enter(z.chunkString,{contentType:C.contentTypeString}),H(B)}function H(B){if(B===U||B===M.eof||_(B))return q.exit(z.chunkString),W(B);return q.consume(B),B===M.backslash?K:H}function K(B){if(B===U||B===M.backslash)return q.consume(B),H;return H(B)}}function a1(q,$){let J;return G;function G(X){if(_(X))return q.enter(z.lineEnding),q.consume(X),q.exit(z.lineEnding),J=!0,G;if(p(X))return r(q,G,J?z.linePrefix:z.lineSuffix)(X);return $(X)}}var x2={name:"definition",tokenize:VH},QH={partial:!0,tokenize:WH};function VH(q,$,J){let G=this,X;return Y;function Y(R){return q.enter(z.definition),U(R)}function U(R){return D(R===M.leftSquareBracket,"expected `[`"),O5.call(G,q,Q,J,z.definitionLabel,z.definitionLabelMarker,z.definitionLabelString)(R)}function Q(R){if(X=R1(G.sliceSerialize(G.events[G.events.length-1][1]).slice(1,-1)),R===M.colon)return q.enter(z.definitionMarker),q.consume(R),q.exit(z.definitionMarker),V;return J(R)}function V(R){return Wq(R)?a1(q,W)(R):W(R)}function W(R){return F5(q,H,J,z.definitionDestination,z.definitionDestinationLiteral,z.definitionDestinationLiteralMarker,z.definitionDestinationRaw,z.definitionDestinationString)(R)}function H(R){return q.attempt(QH,K,K)(R)}function K(R){return p(R)?r(q,B,z.whitespace)(R):B(R)}function B(R){if(R===M.eof||_(R))return q.exit(z.definition),G.parser.defined.push(X),$(R);return J(R)}}function WH(q,$,J){return G;function G(Q){return Wq(Q)?a1(q,X)(Q):J(Q)}function X(Q){return A5(q,Y,J,z.definitionTitle,z.definitionTitleMarker,z.definitionTitleString)(Q)}function Y(Q){return p(Q)?r(q,U,z.whitespace)(Q):U(Q)}function U(Q){return Q===M.eof||_(Q)?$(Q):J(Q)}}var m2={name:"hardBreakEscape",tokenize:HH};function HH(q,$,J){return G;function G(Y){return D(Y===M.backslash,"expected `\\`"),q.enter(z.hardBreakEscape),q.consume(Y),X}function X(Y){if(_(Y))return q.exit(z.hardBreakEscape),$(Y);return J(Y)}}var k2={name:"headingAtx",resolve:KH,tokenize:zH};function KH(q,$){let J=q.length-2,G=3,X,Y;if(q[G][1].type===z.whitespace)G+=2;if(J-2>G&&q[J][1].type===z.whitespace)J-=2;if(q[J][1].type===z.atxHeadingSequence&&(G===J-1||J-4>G&&q[J-2][1].type===z.whitespace))J-=G+1===J?2:4;if(J>G)X={type:z.atxHeadingText,start:q[G][1].start,end:q[J][1].end},Y={type:z.chunkText,start:q[G][1].start,end:q[J][1].end,contentType:C.contentTypeText},Fq(q,G,J-G+1,[["enter",X,$],["enter",Y,$],["exit",Y,$],["exit",X,$]]);return q}function zH(q,$,J){let G=0;return X;function X(H){return q.enter(z.atxHeading),Y(H)}function Y(H){return D(H===M.numberSign,"expected `#`"),q.enter(z.atxHeadingSequence),U(H)}function U(H){if(H===M.numberSign&&G++<C.atxHeadingOpeningFenceSizeMax)return q.consume(H),U;if(H===M.eof||Wq(H))return q.exit(z.atxHeadingSequence),Q(H);return J(H)}function Q(H){if(H===M.numberSign)return q.enter(z.atxHeadingSequence),V(H);if(H===M.eof||_(H))return q.exit(z.atxHeading),$(H);if(p(H))return r(q,Q,z.whitespace)(H);return q.enter(z.atxHeadingText),W(H)}function V(H){if(H===M.numberSign)return q.consume(H),V;return q.exit(z.atxHeadingSequence),Q(H)}function W(H){if(H===M.eof||H===M.numberSign||Wq(H))return q.exit(z.atxHeadingText),Q(H);return q.consume(H),W}}var Q8=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],f2=["pre","script","style","textarea"];var u2={concrete:!0,name:"htmlFlow",resolveTo:BH,tokenize:DH},MH={partial:!0,tokenize:FH},RH={partial:!0,tokenize:wH};function BH(q){let $=q.length;while($--)if(q[$][0]==="enter"&&q[$][1].type===z.htmlFlow)break;if($>1&&q[$-2][1].type===z.linePrefix)q[$][1].start=q[$-2][1].start,q[$+1][1].start=q[$-2][1].start,q.splice($-2,2);return q}function DH(q,$,J){let G=this,X,Y,U,Q,V;return W;function W(F){return H(F)}function H(F){return D(F===M.lessThan,"expected `<`"),q.enter(z.htmlFlow),q.enter(z.htmlFlowData),q.consume(F),K}function K(F){if(F===M.exclamationMark)return q.consume(F),B;if(F===M.slash)return q.consume(F),Y=!0,A;if(F===M.questionMark)return q.consume(F),X=C.htmlInstruction,G.interrupt?$:w;if(xq(F))return D(F!==null),q.consume(F),U=String.fromCharCode(F),j;return J(F)}function B(F){if(F===M.dash)return q.consume(F),X=C.htmlComment,R;if(F===M.leftSquareBracket)return q.consume(F),X=C.htmlCdata,Q=0,O;if(xq(F))return q.consume(F),X=C.htmlDeclaration,G.interrupt?$:w;return J(F)}function R(F){if(F===M.dash)return q.consume(F),G.interrupt?$:w;return J(F)}function O(F){let gq=C.cdataOpeningString;if(F===gq.charCodeAt(Q++)){if(q.consume(F),Q===gq.length)return G.interrupt?$:Jq;return O}return J(F)}function A(F){if(xq(F))return D(F!==null),q.consume(F),U=String.fromCharCode(F),j;return J(F)}function j(F){if(F===M.eof||F===M.slash||F===M.greaterThan||Wq(F)){let gq=F===M.slash,g1=U.toLowerCase();if(!gq&&!Y&&f2.includes(g1))return X=C.htmlRaw,G.interrupt?$(F):Jq(F);if(Q8.includes(U.toLowerCase())){if(X=C.htmlBasic,gq)return q.consume(F),L;return G.interrupt?$(F):Jq(F)}return X=C.htmlComplete,G.interrupt&&!G.parser.lazy[G.now().line]?J(F):Y?I(F):h(F)}if(F===M.dash||Eq(F))return q.consume(F),U+=String.fromCharCode(F),j;return J(F)}function L(F){if(F===M.greaterThan)return q.consume(F),G.interrupt?$:Jq;return J(F)}function I(F){if(p(F))return q.consume(F),I;return Xq(F)}function h(F){if(F===M.slash)return q.consume(F),Xq;if(F===M.colon||F===M.underscore||xq(F))return q.consume(F),a;if(p(F))return q.consume(F),h;return Xq(F)}function a(F){if(F===M.dash||F===M.dot||F===M.colon||F===M.underscore||Eq(F))return q.consume(F),a;return Gq(F)}function Gq(F){if(F===M.equalsTo)return q.consume(F),P;if(p(F))return q.consume(F),Gq;return h(F)}function P(F){if(F===M.eof||F===M.lessThan||F===M.equalsTo||F===M.greaterThan||F===M.graveAccent)return J(F);if(F===M.quotationMark||F===M.apostrophe)return q.consume(F),V=F,e;if(p(F))return q.consume(F),P;return Yq(F)}function e(F){if(F===V)return q.consume(F),V=null,s;if(F===M.eof||_(F))return J(F);return q.consume(F),e}function Yq(F){if(F===M.eof||F===M.quotationMark||F===M.apostrophe||F===M.slash||F===M.lessThan||F===M.equalsTo||F===M.greaterThan||F===M.graveAccent||Wq(F))return Gq(F);return q.consume(F),Yq}function s(F){if(F===M.slash||F===M.greaterThan||p(F))return h(F);return J(F)}function Xq(F){if(F===M.greaterThan)return q.consume(F),kq;return J(F)}function kq(F){if(F===M.eof||_(F))return Jq(F);if(p(F))return q.consume(F),kq;return J(F)}function Jq(F){if(F===M.dash&&X===C.htmlComment)return q.consume(F),Qq;if(F===M.lessThan&&X===C.htmlRaw)return q.consume(F),zq;if(F===M.greaterThan&&X===C.htmlDeclaration)return q.consume(F),uq;if(F===M.questionMark&&X===C.htmlInstruction)return q.consume(F),w;if(F===M.rightSquareBracket&&X===C.htmlCdata)return q.consume(F),sq;if(_(F)&&(X===C.htmlBasic||X===C.htmlComplete))return q.exit(z.htmlFlowData),q.check(MH,Y1,g)(F);if(F===M.eof||_(F))return q.exit(z.htmlFlowData),g(F);return q.consume(F),Jq}function g(F){return q.check(RH,l,Y1)(F)}function l(F){return D(_(F)),q.enter(z.lineEnding),q.consume(F),q.exit(z.lineEnding),d}function d(F){if(F===M.eof||_(F))return g(F);return q.enter(z.htmlFlowData),Jq(F)}function Qq(F){if(F===M.dash)return q.consume(F),w;return Jq(F)}function zq(F){if(F===M.slash)return q.consume(F),U="",fq;return Jq(F)}function fq(F){if(F===M.greaterThan){let gq=U.toLowerCase();if(f2.includes(gq))return q.consume(F),uq;return Jq(F)}if(xq(F)&&U.length<C.htmlRawSizeMax)return D(F!==null),q.consume(F),U+=String.fromCharCode(F),fq;return Jq(F)}function sq(F){if(F===M.rightSquareBracket)return q.consume(F),w;return Jq(F)}function w(F){if(F===M.greaterThan)return q.consume(F),uq;if(F===M.dash&&X===C.htmlComment)return q.consume(F),w;return Jq(F)}function uq(F){if(F===M.eof||_(F))return q.exit(z.htmlFlowData),Y1(F);return q.consume(F),uq}function Y1(F){return q.exit(z.htmlFlow),$(F)}}function wH(q,$,J){let G=this;return X;function X(U){if(_(U))return q.enter(z.lineEnding),q.consume(U),q.exit(z.lineEnding),Y;return J(U)}function Y(U){return G.parser.lazy[G.now().line]?J(U):$(U)}}function FH(q,$,J){return G;function G(X){return D(_(X),"expected a line ending"),q.enter(z.lineEnding),q.consume(X),q.exit(z.lineEnding),q.attempt(L1,$,J)}}var p2={name:"htmlText",tokenize:OH};function OH(q,$,J){let G=this,X,Y,U;return Q;function Q(w){return D(w===M.lessThan,"expected `<`"),q.enter(z.htmlText),q.enter(z.htmlTextData),q.consume(w),V}function V(w){if(w===M.exclamationMark)return q.consume(w),W;if(w===M.slash)return q.consume(w),Gq;if(w===M.questionMark)return q.consume(w),h;if(xq(w))return q.consume(w),Yq;return J(w)}function W(w){if(w===M.dash)return q.consume(w),H;if(w===M.leftSquareBracket)return q.consume(w),Y=0,O;if(xq(w))return q.consume(w),I;return J(w)}function H(w){if(w===M.dash)return q.consume(w),R;return J(w)}function K(w){if(w===M.eof)return J(w);if(w===M.dash)return q.consume(w),B;if(_(w))return U=K,zq(w);return q.consume(w),K}function B(w){if(w===M.dash)return q.consume(w),R;return K(w)}function R(w){return w===M.greaterThan?Qq(w):w===M.dash?B(w):K(w)}function O(w){let uq=C.cdataOpeningString;if(w===uq.charCodeAt(Y++))return q.consume(w),Y===uq.length?A:O;return J(w)}function A(w){if(w===M.eof)return J(w);if(w===M.rightSquareBracket)return q.consume(w),j;if(_(w))return U=A,zq(w);return q.consume(w),A}function j(w){if(w===M.rightSquareBracket)return q.consume(w),L;return A(w)}function L(w){if(w===M.greaterThan)return Qq(w);if(w===M.rightSquareBracket)return q.consume(w),L;return A(w)}function I(w){if(w===M.eof||w===M.greaterThan)return Qq(w);if(_(w))return U=I,zq(w);return q.consume(w),I}function h(w){if(w===M.eof)return J(w);if(w===M.questionMark)return q.consume(w),a;if(_(w))return U=h,zq(w);return q.consume(w),h}function a(w){return w===M.greaterThan?Qq(w):h(w)}function Gq(w){if(xq(w))return q.consume(w),P;return J(w)}function P(w){if(w===M.dash||Eq(w))return q.consume(w),P;return e(w)}function e(w){if(_(w))return U=e,zq(w);if(p(w))return q.consume(w),e;return Qq(w)}function Yq(w){if(w===M.dash||Eq(w))return q.consume(w),Yq;if(w===M.slash||w===M.greaterThan||Wq(w))return s(w);return J(w)}function s(w){if(w===M.slash)return q.consume(w),Qq;if(w===M.colon||w===M.underscore||xq(w))return q.consume(w),Xq;if(_(w))return U=s,zq(w);if(p(w))return q.consume(w),s;return Qq(w)}function Xq(w){if(w===M.dash||w===M.dot||w===M.colon||w===M.underscore||Eq(w))return q.consume(w),Xq;return kq(w)}function kq(w){if(w===M.equalsTo)return q.consume(w),Jq;if(_(w))return U=kq,zq(w);if(p(w))return q.consume(w),kq;return s(w)}function Jq(w){if(w===M.eof||w===M.lessThan||w===M.equalsTo||w===M.greaterThan||w===M.graveAccent)return J(w);if(w===M.quotationMark||w===M.apostrophe)return q.consume(w),X=w,g;if(_(w))return U=Jq,zq(w);if(p(w))return q.consume(w),Jq;return q.consume(w),l}function g(w){if(w===X)return q.consume(w),X=void 0,d;if(w===M.eof)return J(w);if(_(w))return U=g,zq(w);return q.consume(w),g}function l(w){if(w===M.eof||w===M.quotationMark||w===M.apostrophe||w===M.lessThan||w===M.equalsTo||w===M.graveAccent)return J(w);if(w===M.slash||w===M.greaterThan||Wq(w))return s(w);return q.consume(w),l}function d(w){if(w===M.slash||w===M.greaterThan||Wq(w))return s(w);return J(w)}function Qq(w){if(w===M.greaterThan)return q.consume(w),q.exit(z.htmlTextData),q.exit(z.htmlText),$;return J(w)}function zq(w){return D(U,"expected return state"),D(_(w),"expected eol"),q.exit(z.htmlTextData),q.enter(z.lineEnding),q.consume(w),q.exit(z.lineEnding),fq}function fq(w){return D(G.parser.constructs.disable.null,"expected `disable.null` to be populated"),p(w)?r(q,sq,z.linePrefix,G.parser.constructs.disable.null.includes("codeIndented")?void 0:C.tabSize)(w):sq(w)}function sq(w){return q.enter(z.htmlTextData),U(w)}}var s1={name:"labelEnd",resolveAll:jH,resolveTo:PH,tokenize:LH},AH={tokenize:ZH},NH={tokenize:CH},SH={tokenize:EH};function jH(q){let $=-1,J=[];while(++$<q.length){let G=q[$][1];if(J.push(q[$]),G.type===z.labelImage||G.type===z.labelLink||G.type===z.labelEnd){let X=G.type===z.labelImage?4:2;G.type=z.data,$+=X}}if(q.length!==J.length)Fq(q,0,q.length,J);return q}function PH(q,$){let J=q.length,G=0,X,Y,U,Q;while(J--)if(X=q[J][1],Y){if(X.type===z.link||X.type===z.labelLink&&X._inactive)break;if(q[J][0]==="enter"&&X.type===z.labelLink)X._inactive=!0}else if(U){if(q[J][0]==="enter"&&(X.type===z.labelImage||X.type===z.labelLink)&&!X._balanced){if(Y=J,X.type!==z.labelLink){G=2;break}}}else if(X.type===z.labelEnd)U=J;D(Y!==void 0,"`open` is supposed to be found"),D(U!==void 0,"`close` is supposed to be found");let V={type:q[Y][1].type===z.labelLink?z.link:z.image,start:{...q[Y][1].start},end:{...q[q.length-1][1].end}},W={type:z.label,start:{...q[Y][1].start},end:{...q[U][1].end}},H={type:z.labelText,start:{...q[Y+G+2][1].end},end:{...q[U-2][1].start}};return Q=[["enter",V,$],["enter",W,$]],Q=Cq(Q,q.slice(Y+1,Y+G+3)),Q=Cq(Q,[["enter",H,$]]),D($.parser.constructs.insideSpan.null,"expected `insideSpan.null` to be populated"),Q=Cq(Q,h0($.parser.constructs.insideSpan.null,q.slice(Y+G+4,U-3),$)),Q=Cq(Q,[["exit",H,$],q[U-2],q[U-1],["exit",W,$]]),Q=Cq(Q,q.slice(U+1)),Q=Cq(Q,[["exit",V,$]]),Fq(q,Y,q.length,Q),q}function LH(q,$,J){let G=this,X=G.events.length,Y,U;while(X--)if((G.events[X][1].type===z.labelImage||G.events[X][1].type===z.labelLink)&&!G.events[X][1]._balanced){Y=G.events[X][1];break}return Q;function Q(B){if(D(B===M.rightSquareBracket,"expected `]`"),!Y)return J(B);if(Y._inactive)return K(B);return U=G.parser.defined.includes(R1(G.sliceSerialize({start:Y.end,end:G.now()}))),q.enter(z.labelEnd),q.enter(z.labelMarker),q.consume(B),q.exit(z.labelMarker),q.exit(z.labelEnd),V}function V(B){if(B===M.leftParenthesis)return q.attempt(AH,H,U?H:K)(B);if(B===M.leftSquareBracket)return q.attempt(NH,H,U?W:K)(B);return U?H(B):K(B)}function W(B){return q.attempt(SH,H,K)(B)}function H(B){return $(B)}function K(B){return Y._balanced=!0,J(B)}}function ZH(q,$,J){return G;function G(K){return D(K===M.leftParenthesis,"expected left paren"),q.enter(z.resource),q.enter(z.resourceMarker),q.consume(K),q.exit(z.resourceMarker),X}function X(K){return Wq(K)?a1(q,Y)(K):Y(K)}function Y(K){if(K===M.rightParenthesis)return H(K);return F5(q,U,Q,z.resourceDestination,z.resourceDestinationLiteral,z.resourceDestinationLiteralMarker,z.resourceDestinationRaw,z.resourceDestinationString,C.linkResourceDestinationBalanceMax)(K)}function U(K){return Wq(K)?a1(q,V)(K):H(K)}function Q(K){return J(K)}function V(K){if(K===M.quotationMark||K===M.apostrophe||K===M.leftParenthesis)return A5(q,W,J,z.resourceTitle,z.resourceTitleMarker,z.resourceTitleString)(K);return H(K)}function W(K){return Wq(K)?a1(q,H)(K):H(K)}function H(K){if(K===M.rightParenthesis)return q.enter(z.resourceMarker),q.consume(K),q.exit(z.resourceMarker),q.exit(z.resource),$;return J(K)}}function CH(q,$,J){let G=this;return X;function X(Q){return D(Q===M.leftSquareBracket,"expected left bracket"),O5.call(G,q,Y,U,z.reference,z.referenceMarker,z.referenceString)(Q)}function Y(Q){return G.parser.defined.includes(R1(G.sliceSerialize(G.events[G.events.length-1][1]).slice(1,-1)))?$(Q):J(Q)}function U(Q){return J(Q)}}function EH(q,$,J){return G;function G(Y){return D(Y===M.leftSquareBracket,"expected left bracket"),q.enter(z.reference),q.enter(z.referenceMarker),q.consume(Y),q.exit(z.referenceMarker),X}function X(Y){if(Y===M.rightSquareBracket)return q.enter(z.referenceMarker),q.consume(Y),q.exit(z.referenceMarker),q.exit(z.reference),$;return J(Y)}}var l2={name:"labelStartImage",resolveAll:s1.resolveAll,tokenize:TH};function TH(q,$,J){let G=this;return X;function X(Q){return D(Q===M.exclamationMark,"expected `!`"),q.enter(z.labelImage),q.enter(z.labelImageMarker),q.consume(Q),q.exit(z.labelImageMarker),Y}function Y(Q){if(Q===M.leftSquareBracket)return q.enter(z.labelMarker),q.consume(Q),q.exit(z.labelMarker),q.exit(z.labelImage),U;return J(Q)}function U(Q){return Q===M.caret&&"_hiddenFootnoteSupport"in G.parser.constructs?J(Q):$(Q)}}var r2={name:"labelStartLink",resolveAll:s1.resolveAll,tokenize:_H};function _H(q,$,J){let G=this;return X;function X(U){return D(U===M.leftSquareBracket,"expected `[`"),q.enter(z.labelLink),q.enter(z.labelMarker),q.consume(U),q.exit(z.labelMarker),q.exit(z.labelLink),Y}function Y(U){return U===M.caret&&"_hiddenFootnoteSupport"in G.parser.constructs?J(U):$(U)}}var T$={name:"lineEnding",tokenize:bH};function bH(q,$){return J;function J(G){return D(_(G),"expected eol"),q.enter(z.lineEnding),q.consume(G),q.exit(z.lineEnding),r(q,$,z.linePrefix)}}var t1={name:"thematicBreak",tokenize:IH};function IH(q,$,J){let G=0,X;return Y;function Y(W){return q.enter(z.thematicBreak),U(W)}function U(W){return D(W===M.asterisk||W===M.dash||W===M.underscore,"expected `*`, `-`, or `_`"),X=W,Q(W)}function Q(W){if(W===X)return q.enter(z.thematicBreakSequence),V(W);if(G>=C.thematicBreakMarkerCountMin&&(W===M.eof||_(W)))return q.exit(z.thematicBreak),$(W);return J(W)}function V(W){if(W===X)return q.consume(W),G++,V;return q.exit(z.thematicBreakSequence),p(W)?r(q,Q,z.whitespace)(W):Q(W)}}var jq={continuation:{tokenize:hH},exit:mH,name:"list",tokenize:yH},gH={partial:!0,tokenize:kH},vH={partial:!0,tokenize:xH};function yH(q,$,J){let G=this,X=G.events[G.events.length-1],Y=X&&X[1].type===z.linePrefix?X[2].sliceSerialize(X[1],!0).length:0,U=0;return Q;function Q(R){D(G.containerState,"expected state");let O=G.containerState.type||(R===M.asterisk||R===M.plusSign||R===M.dash?z.listUnordered:z.listOrdered);if(O===z.listUnordered?!G.containerState.marker||R===G.containerState.marker:L$(R)){if(!G.containerState.type)G.containerState.type=O,q.enter(O,{_container:!0});if(O===z.listUnordered)return q.enter(z.listItemPrefix),R===M.asterisk||R===M.dash?q.check(t1,J,W)(R):W(R);if(!G.interrupt||R===M.digit1)return q.enter(z.listItemPrefix),q.enter(z.listItemValue),V(R)}return J(R)}function V(R){if(D(G.containerState,"expected state"),L$(R)&&++U<C.listItemValueSizeMax)return q.consume(R),V;if((!G.interrupt||U<2)&&(G.containerState.marker?R===G.containerState.marker:R===M.rightParenthesis||R===M.dot))return q.exit(z.listItemValue),W(R);return J(R)}function W(R){return D(G.containerState,"expected state"),D(R!==M.eof,"eof (`null`) is not a marker"),q.enter(z.listItemMarker),q.consume(R),q.exit(z.listItemMarker),G.containerState.marker=G.containerState.marker||R,q.check(L1,G.interrupt?J:H,q.attempt(gH,B,K))}function H(R){return D(G.containerState,"expected state"),G.containerState.initialBlankLine=!0,Y++,B(R)}function K(R){if(p(R))return q.enter(z.listItemPrefixWhitespace),q.consume(R),q.exit(z.listItemPrefixWhitespace),B;return J(R)}function B(R){return D(G.containerState,"expected state"),G.containerState.size=Y+G.sliceSerialize(q.exit(z.listItemPrefix),!0).length,$(R)}}function hH(q,$,J){let G=this;return D(G.containerState,"expected state"),G.containerState._closeFlow=void 0,q.check(L1,X,Y);function X(Q){return D(G.containerState,"expected state"),D(typeof G.containerState.size==="number","expected size"),G.containerState.furtherBlankLines=G.containerState.furtherBlankLines||G.containerState.initialBlankLine,r(q,$,z.listItemIndent,G.containerState.size+1)(Q)}function Y(Q){if(D(G.containerState,"expected state"),G.containerState.furtherBlankLines||!p(Q))return G.containerState.furtherBlankLines=void 0,G.containerState.initialBlankLine=void 0,U(Q);return G.containerState.furtherBlankLines=void 0,G.containerState.initialBlankLine=void 0,q.attempt(vH,$,U)(Q)}function U(Q){return D(G.containerState,"expected state"),G.containerState._closeFlow=!0,G.interrupt=void 0,D(G.parser.constructs.disable.null,"expected `disable.null` to be populated"),r(q,q.attempt(jq,$,J),z.linePrefix,G.parser.constructs.disable.null.includes("codeIndented")?void 0:C.tabSize)(Q)}}function xH(q,$,J){let G=this;return D(G.containerState,"expected state"),D(typeof G.containerState.size==="number","expected size"),r(q,X,z.listItemIndent,G.containerState.size+1);function X(Y){D(G.containerState,"expected state");let U=G.events[G.events.length-1];return U&&U[1].type===z.listItemIndent&&U[2].sliceSerialize(U[1],!0).length===G.containerState.size?$(Y):J(Y)}}function mH(q){D(this.containerState,"expected state"),D(typeof this.containerState.type==="string","expected type"),q.exit(this.containerState.type)}function kH(q,$,J){let G=this;return D(G.parser.constructs.disable.null,"expected `disable.null` to be populated"),r(q,X,z.listItemPrefixWhitespace,G.parser.constructs.disable.null.includes("codeIndented")?void 0:C.tabSize+1);function X(Y){let U=G.events[G.events.length-1];return!p(Y)&&U&&U[1].type===z.listItemPrefixWhitespace?$(Y):J(Y)}}var N5={name:"setextUnderline",resolveTo:fH,tokenize:uH};function fH(q,$){let J=q.length,G,X,Y;while(J--)if(q[J][0]==="enter"){if(q[J][1].type===z.content){G=J;break}if(q[J][1].type===z.paragraph)X=J}else{if(q[J][1].type===z.content)q.splice(J,1);if(!Y&&q[J][1].type===z.definition)Y=J}D(X!==void 0,"expected a `text` index to be found"),D(G!==void 0,"expected a `text` index to be found"),D(q[G][2]===$,"enter context should be same"),D(q[q.length-1][2]===$,"enter context should be same");let U={type:z.setextHeading,start:{...q[G][1].start},end:{...q[q.length-1][1].end}};if(q[X][1].type=z.setextHeadingText,Y)q.splice(X,0,["enter",U,$]),q.splice(Y+1,0,["exit",q[G][1],$]),q[G][1].end={...q[Y][1].end};else q[G][1]=U;return q.push(["exit",U,$]),q}function uH(q,$,J){let G=this,X;return Y;function Y(W){let H=G.events.length,K;D(W===M.dash||W===M.equalsTo,"expected `=` or `-`");while(H--)if(G.events[H][1].type!==z.lineEnding&&G.events[H][1].type!==z.linePrefix&&G.events[H][1].type!==z.content){K=G.events[H][1].type===z.paragraph;break}if(!G.parser.lazy[G.now().line]&&(G.interrupt||K))return q.enter(z.setextHeadingLine),X=W,U(W);return J(W)}function U(W){return q.enter(z.setextHeadingLineSequence),Q(W)}function Q(W){if(W===X)return q.consume(W),Q;return q.exit(z.setextHeadingLineSequence),p(W)?r(q,V,z.lineSuffix)(W):V(W)}function V(W){if(W===M.eof||_(W))return q.exit(z.setextHeadingLine),$(W);return J(W)}}var V8={tokenize:pH};function pH(q){let $=this,J=q.attempt(L1,G,q.attempt(this.parser.constructs.flowInitial,X,r(q,q.attempt(this.parser.constructs.flow,X,q.attempt(h2,X)),z.linePrefix)));return J;function G(Y){if(D(Y===M.eof||_(Y),"expected eol or eof"),Y===M.eof){q.consume(Y);return}return q.enter(z.lineEndingBlank),q.consume(Y),q.exit(z.lineEndingBlank),$.currentConstruct=void 0,J}function X(Y){if(D(Y===M.eof||_(Y),"expected eol or eof"),Y===M.eof){q.consume(Y);return}return q.enter(z.lineEnding),q.consume(Y),q.exit(z.lineEnding),$.currentConstruct=void 0,J}}var W8={resolveAll:M8()},H8=z8("string"),K8=z8("text");function z8(q){return{resolveAll:M8(q==="text"?lH:void 0),tokenize:$};function $(J){let G=this,X=this.parser.constructs[q],Y=J.attempt(X,U,Q);return U;function U(H){return W(H)?Y(H):Q(H)}function Q(H){if(H===M.eof){J.consume(H);return}return J.enter(z.data),J.consume(H),V}function V(H){if(W(H))return J.exit(z.data),Y(H);return J.consume(H),V}function W(H){if(H===M.eof)return!0;let K=X[H],B=-1;if(K){D(Array.isArray(K),"expected `disable.null` to be populated");while(++B<K.length){let R=K[B];if(!R.previous||R.previous.call(G,G.previous))return!0}}return!1}}}function M8(q){return $;function $(J,G){let X=-1,Y;while(++X<=J.length)if(Y===void 0){if(J[X]&&J[X][1].type===z.data)Y=X,X++}else if(!J[X]||J[X][1].type!==z.data){if(X!==Y+2)J[Y][1].end=J[X-1][1].end,J.splice(Y+2,X-Y-2),X=Y+2;Y=void 0}return q?q(J,G):J}}function lH(q,$){let J=0;while(++J<=q.length)if((J===q.length||q[J][1].type===z.lineEnding)&&q[J-1][1].type===z.data){let G=q[J-1][1],X=$.sliceStream(G),Y=X.length,U=-1,Q=0,V;while(Y--){let W=X[Y];if(typeof W==="string"){U=W.length;while(W.charCodeAt(U-1)===M.space)Q++,U--;if(U)break;U=-1}else if(W===M.horizontalTab)V=!0,Q++;else if(W===M.virtualSpace);else{Y++;break}}if($._contentTypeTextTrailing&&J===q.length)Q=0;if(Q){let W={type:J===q.length||V||Q<C.hardBreakPrefixSizeMin?z.lineSuffix:z.hardBreakTrailing,start:{_bufferIndex:Y?U:G.start._bufferIndex+U,_index:G.start._index+Y,line:G.end.line,column:G.end.column-Q,offset:G.end.offset-Q},end:{...G.end}};if(G.end={...W.start},G.start.offset===G.end.offset)Object.assign(G,W);else q.splice(J,0,["enter",W,$],["exit",W,$]),J+=2}J++}return q}var i2={};eJ(i2,{text:()=>oH,string:()=>nH,insideSpan:()=>aH,flowInitial:()=>dH,flow:()=>cH,document:()=>rH,disable:()=>tH,contentInitial:()=>iH,attentionMarkers:()=>sH});var rH={[M.asterisk]:jq,[M.plusSign]:jq,[M.dash]:jq,[M.digit0]:jq,[M.digit1]:jq,[M.digit2]:jq,[M.digit3]:jq,[M.digit4]:jq,[M.digit5]:jq,[M.digit6]:jq,[M.digit7]:jq,[M.digit8]:jq,[M.digit9]:jq,[M.greaterThan]:M5},iH={[M.leftSquareBracket]:x2},dH={[M.horizontalTab]:C$,[M.virtualSpace]:C$,[M.space]:C$},cH={[M.numberSign]:k2,[M.asterisk]:t1,[M.dash]:[N5,t1],[M.lessThan]:u2,[M.equalsTo]:N5,[M.underscore]:t1,[M.graveAccent]:D5,[M.tilde]:D5},nH={[M.ampersand]:B5,[M.backslash]:R5},oH={[M.carriageReturn]:T$,[M.lineFeed]:T$,[M.carriageReturnLineFeed]:T$,[M.exclamationMark]:l2,[M.ampersand]:B5,[M.asterisk]:Z$,[M.lessThan]:[g2,p2],[M.leftSquareBracket]:r2,[M.backslash]:[m2,R5],[M.rightSquareBracket]:s1,[M.underscore]:Z$,[M.graveAccent]:v2},aH={null:[Z$,W8]},sH={null:[M.asterisk,M.underscore]},tH={null:[]};var T8=e5(E8(),1);var $0=T8.default("micromark");function _8(q,$,J){let G={_bufferIndex:-1,_index:0,line:J&&J.line||1,column:J&&J.column||1,offset:J&&J.offset||0},X={},Y=[],U=[],Q=[],V=!0,W={attempt:s(e),check:s(Yq),consume:a,enter:Gq,exit:P,interrupt:s(Yq,{interrupt:!0})},H={code:M.eof,containerState:{},defineSkip:L,events:[],now:j,parser:q,previous:M.eof,sliceSerialize:O,sliceStream:A,write:R},K=$.tokenize.call(H,W),B;if($.resolveAll)Y.push($);return H;function R(g){if(U=Cq(U,g),I(),U[U.length-1]!==M.eof)return[];return Xq($,0),H.events=h0(Y,H.events,H),H.events}function O(g,l){return hK(A(g),l)}function A(g){return yK(U,g)}function j(){let{_bufferIndex:g,_index:l,line:d,column:Qq,offset:zq}=G;return{_bufferIndex:g,_index:l,line:d,column:Qq,offset:zq}}function L(g){X[g.line]=g.column,Jq(),$0("position: define skip: `%j`",G)}function I(){let g;while(G._index<U.length){let l=U[G._index];if(typeof l==="string"){if(g=G._index,G._bufferIndex<0)G._bufferIndex=0;while(G._index===g&&G._bufferIndex<l.length)h(l.charCodeAt(G._bufferIndex))}else h(l)}}function h(g){D(V===!0,"expected character to be consumed"),V=void 0,$0("main: passing `%s` to %s",g,K&&K.name),B=g,D(typeof K==="function","expected state"),K=K(g)}function a(g){if(D(g===B,"expected given code to equal expected code"),$0("consume: `%s`",g),D(V===void 0,"expected code to not have been consumed: this might be because `return x(code)` instead of `return x` was used"),D(g===null?H.events.length===0||H.events[H.events.length-1][0]==="exit":H.events[H.events.length-1][0]==="enter","expected last token to be open"),_(g))G.line++,G.column=1,G.offset+=g===M.carriageReturnLineFeed?2:1,Jq(),$0("position: after eol: `%j`",G);else if(g!==M.virtualSpace)G.column++,G.offset++;if(G._bufferIndex<0)G._index++;else if(G._bufferIndex++,G._bufferIndex===U[G._index].length)G._bufferIndex=-1,G._index++;H.previous=g,V=!0}function Gq(g,l){let d=l||{};return d.type=g,d.start=j(),D(typeof g==="string","expected string type"),D(g.length>0,"expected non-empty string"),$0("enter: `%s`",g),H.events.push(["enter",d,H]),Q.push(d),d}function P(g){D(typeof g==="string","expected string type"),D(g.length>0,"expected non-empty string");let l=Q.pop();return D(l,"cannot close w/o open tokens"),l.end=j(),D(g===l.type,"expected exit token to match current token"),D(!(l.start._index===l.end._index&&l.start._bufferIndex===l.end._bufferIndex),"expected non-empty token (`"+g+"`)"),$0("exit: `%s`",l.type),H.events.push(["exit",l,H]),l}function e(g,l){Xq(g,l.from)}function Yq(g,l){l.restore()}function s(g,l){return d;function d(Qq,zq,fq){let sq,w,uq,Y1;return Array.isArray(Qq)?gq(Qq):("tokenize"in Qq)?gq([Qq]):F(Qq);function F(Mq){return e0;function e0(U1){let v1=U1!==null&&Mq[U1],V0=U1!==null&&Mq.null,s5=[...Array.isArray(v1)?v1:v1?[v1]:[],...Array.isArray(V0)?V0:V0?[V0]:[]];return gq(s5)(U1)}}function gq(Mq){if(sq=Mq,w=0,Mq.length===0)return D(fq,"expected `bogusState` to be given"),fq;return g1(Mq[w])}function g1(Mq){return e0;function e0(U1){if(Y1=kq(),uq=Mq,!Mq.partial)H.currentConstruct=Mq;if(D(H.parser.constructs.disable.null,"expected `disable.null` to be populated"),Mq.name&&H.parser.constructs.disable.null.includes(Mq.name))return p$(U1);return Mq.tokenize.call(l?Object.assign(Object.create(H),l):H,W,a5,p$)(U1)}}function a5(Mq){return D(Mq===B,"expected code"),V=!0,g(uq,Y1),zq}function p$(Mq){if(D(Mq===B,"expected code"),V=!0,Y1.restore(),++w<sq.length)return g1(sq[w]);return fq}}}function Xq(g,l){if(g.resolveAll&&!Y.includes(g))Y.push(g);if(g.resolve)Fq(H.events,l,H.events.length-l,g.resolve(H.events.slice(l),H));if(g.resolveTo)H.events=g.resolveTo(H.events,H);D(g.partial||H.events.length===0||H.events[H.events.length-1][0]==="exit","expected last token to end")}function kq(){let g=j(),l=H.previous,d=H.currentConstruct,Qq=H.events.length,zq=Array.from(Q);return{from:Qq,restore:fq};function fq(){G=g,H.previous=l,H.currentConstruct=d,H.events.length=Qq,Q=zq,Jq(),$0("position: restore: `%j`",G)}}function Jq(){if(G.line in X&&G.column<2)G.column=X[G.line],G.offset+=X[G.line]-1}}function yK(q,$){let J=$.start._index,G=$.start._bufferIndex,X=$.end._index,Y=$.end._bufferIndex,U;if(J===X)D(Y>-1,"expected non-negative end buffer index"),D(G>-1,"expected non-negative start buffer index"),U=[q[J].slice(G,Y)];else{if(U=q.slice(J,X),G>-1){let Q=U[0];if(typeof Q==="string")U[0]=Q.slice(G);else D(G===0,"expected `startBufferIndex` to be `0`"),U.shift()}if(Y>0)U.push(q[X].slice(0,Y))}return U}function hK(q,$){let J=-1,G=[],X;while(++J<q.length){let Y=q[J],U;if(typeof Y==="string")U=Y;else switch(Y){case M.carriageReturn:{U=hq.cr;break}case M.lineFeed:{U=hq.lf;break}case M.carriageReturnLineFeed:{U=hq.cr+hq.lf;break}case M.horizontalTab:{U=$?hq.space:hq.ht;break}case M.virtualSpace:{if(!$&&X)continue;U=hq.space;break}default:D(typeof Y==="number","expected number"),U=String.fromCharCode(Y)}X=Y===M.horizontalTab,G.push(U)}return G.join("")}function a2(q){let G={constructs:o4([i2,...(q||{}).extensions||[]]),content:X($8),defined:[],document:X(G8),flow:X(V8),lazy:{},string:X(H8),text:X(K8)};return G;function X(Y){return U;function U(Q){return _8(G,Y,Q)}}}function s2(q){while(!w5(q));return q}var b8=/[\0\t\n\r]/g;function t2(){let q=1,$="",J=!0,G;return X;function X(Y,U,Q){let V=[],W,H,K,B,R;if(Y=$+(typeof Y==="string"?Y.toString():new TextDecoder(U||void 0).decode(Y)),K=0,$="",J){if(Y.charCodeAt(0)===M.byteOrderMarker)K++;J=void 0}while(K<Y.length){if(b8.lastIndex=K,W=b8.exec(Y),B=W&&W.index!==void 0?W.index:Y.length,R=Y.charCodeAt(B),!W){$=Y.slice(K);break}if(R===M.lf&&K===B&&G)V.push(M.carriageReturnLineFeed),G=void 0;else{if(G)V.push(M.carriageReturn),G=void 0;if(K<B)V.push(Y.slice(K,B)),q+=B-K;switch(R){case M.nul:{V.push(M.replacementCharacter),q++;break}case M.ht:{H=Math.ceil(q/C.tabSize)*C.tabSize,V.push(M.horizontalTab);while(q++<H)V.push(M.virtualSpace);break}case M.lf:{V.push(M.lineFeed),q=1;break}default:G=!0,q=1}}K=B+1}if(Q){if(G)V.push(M.carriageReturn);if($)V.push($);V.push(M.eof)}return V}}var xK=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Z5(q){return q.replace(xK,mK)}function mK(q,$,J){if($)return $;if(J.charCodeAt(0)===M.numberSign){let X=J.charCodeAt(1),Y=X===M.lowercaseX||X===M.uppercaseX;return z5(J.slice(Y?2:1),Y?C.numericBaseHexadecimal:C.numericBaseDecimal)}return v0(J)||q}function C1(q){if(!q||typeof q!=="object")return"";if("position"in q||"type"in q)return I8(q.position);if("start"in q||"end"in q)return I8(q);if("line"in q||"column"in q)return e2(q);return""}function e2(q){return g8(q&&q.line)+":"+g8(q&&q.column)}function I8(q){return e2(q&&q.start)+"-"+e2(q&&q.end)}function g8(q){return q&&typeof q==="number"?q:1}var y8={}.hasOwnProperty;function qJ(q,$,J){if($&&typeof $==="object")J=$,$=void 0;return kK(J)(s2(a2(J).document().write(t2()(q,$,!0))))}function kK(q){let $={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:Y(sJ),autolinkProtocol:s,autolinkEmail:s,atxHeading:Y(nJ),blockQuote:Y(U1),characterEscape:s,characterReference:s,codeFenced:Y(v1),codeFencedFenceInfo:U,codeFencedFenceMeta:U,codeIndented:Y(v1,U),codeText:Y(V0,U),codeTextData:s,data:s,codeFlowValue:s,definition:Y(s5),definitionDestinationString:U,definitionLabelString:U,definitionTitleString:U,emphasis:Y(DG),hardBreakEscape:Y(oJ),hardBreakTrailing:Y(oJ),htmlFlow:Y(aJ,U),htmlFlowData:s,htmlText:Y(aJ,U),htmlTextData:s,image:Y(wG),label:U,link:Y(sJ),listItem:Y(FG),listItemValue:B,listOrdered:Y(tJ,K),listUnordered:Y(tJ),paragraph:Y(OG),reference:F,referenceString:U,resourceDestinationString:U,resourceTitleString:U,setextHeading:Y(nJ),strong:Y(AG),thematicBreak:Y(SG)},exit:{atxHeading:V(),atxHeadingSequence:Gq,autolink:V(),autolinkEmail:e0,autolinkProtocol:Mq,blockQuote:V(),characterEscapeValue:Xq,characterReferenceMarkerHexadecimal:g1,characterReferenceMarkerNumeric:g1,characterReferenceValue:a5,characterReference:p$,codeFenced:V(j),codeFencedFence:A,codeFencedFenceInfo:R,codeFencedFenceMeta:O,codeFlowValue:Xq,codeIndented:V(L),codeText:V(d),codeTextData:Xq,data:Xq,definition:V(),definitionDestinationString:a,definitionLabelString:I,definitionTitleString:h,emphasis:V(),hardBreakEscape:V(Jq),hardBreakTrailing:V(Jq),htmlFlow:V(g),htmlFlowData:Xq,htmlText:V(l),htmlTextData:Xq,image:V(zq),label:sq,labelText:fq,lineEnding:kq,link:V(Qq),listItem:V(),listOrdered:V(),listUnordered:V(),paragraph:V(),referenceString:gq,resourceDestinationString:w,resourceTitleString:uq,resource:Y1,setextHeading:V(Yq),setextHeadingLineSequence:e,setextHeadingText:P,strong:V(),thematicBreak:V()}};h8($,(q||{}).mdastExtensions||[]);let J={};return G;function G(N){let S={type:"root",children:[]},v={stack:[S],tokenStack:[],config:$,enter:Q,exit:W,buffer:U,resume:H,data:J},n=[],t=-1;while(++t<N.length)if(N[t][1].type===z.listOrdered||N[t][1].type===z.listUnordered)if(N[t][0]==="enter")n.push(t);else{let Tq=n.pop();D(typeof Tq==="number","expected list to be open"),t=X(N,Tq,t)}t=-1;while(++t<N.length){let Tq=$[N[t][0]];if(y8.call(Tq,N[t][1].type))Tq[N[t][1].type].call(Object.assign({sliceSerialize:N[t][2].sliceSerialize},v),N[t][1])}if(v.tokenStack.length>0){let Tq=v.tokenStack[v.tokenStack.length-1];(Tq[1]||v8).call(v,void 0,Tq[0])}S.position={start:E1(N.length>0?N[0][1].start:{line:1,column:1,offset:0}),end:E1(N.length>0?N[N.length-2][1].end:{line:1,column:1,offset:0})},t=-1;while(++t<$.transforms.length)S=$.transforms[t](S)||S;return S}function X(N,S,v){let n=S-1,t=-1,Tq=!1,y1,Q1,q$,$$;while(++n<=v){let vq=N[n];switch(vq[1].type){case z.listUnordered:case z.listOrdered:case z.blockQuote:{if(vq[0]==="enter")t++;else t--;$$=void 0;break}case z.lineEndingBlank:{if(vq[0]==="enter"){if(y1&&!$$&&!t&&!q$)q$=n;$$=void 0}break}case z.linePrefix:case z.listItemValue:case z.listItemMarker:case z.listItemPrefix:case z.listItemPrefixWhitespace:break;default:$$=void 0}if(!t&&vq[0]==="enter"&&vq[1].type===z.listItemPrefix||t===-1&&vq[0]==="exit"&&(vq[1].type===z.listUnordered||vq[1].type===z.listOrdered)){if(y1){let W0=n;Q1=void 0;while(W0--){let V1=N[W0];if(V1[1].type===z.lineEnding||V1[1].type===z.lineEndingBlank){if(V1[0]==="exit")continue;if(Q1)N[Q1][1].type=z.lineEndingBlank,Tq=!0;V1[1].type=z.lineEnding,Q1=W0}else if(V1[1].type===z.linePrefix||V1[1].type===z.blockQuotePrefix||V1[1].type===z.blockQuotePrefixWhitespace||V1[1].type===z.blockQuoteMarker||V1[1].type===z.listItemIndent);else break}if(q$&&(!Q1||q$<Q1))y1._spread=!0;y1.end=Object.assign({},Q1?N[Q1][1].start:vq[1].end),N.splice(Q1||n,0,["exit",y1,vq[2]]),n++,v++}if(vq[1].type===z.listItemPrefix){let W0={type:"listItem",_spread:!1,start:Object.assign({},vq[1].start),end:void 0};y1=W0,N.splice(n,0,["enter",W0,vq[2]]),n++,v++,q$=void 0,$$=!0}}}return N[S][1]._spread=Tq,v}function Y(N,S){return v;function v(n){if(Q.call(this,N(n),n),S)S.call(this,n)}}function U(){this.stack.push({type:"fragment",children:[]})}function Q(N,S,v){let n=this.stack[this.stack.length-1];D(n,"expected `parent`"),D("children"in n,"expected `parent`"),n.children.push(N),this.stack.push(N),this.tokenStack.push([S,v||void 0]),N.position={start:E1(S.start),end:void 0}}function V(N){return S;function S(v){if(N)N.call(this,v);W.call(this,v)}}function W(N,S){let v=this.stack.pop();D(v,"expected `node`");let n=this.tokenStack.pop();if(!n)throw Error("Cannot close `"+N.type+"` ("+C1({start:N.start,end:N.end})+"): it\u2019s not open");else if(n[0].type!==N.type)if(S)S.call(this,N,n[0]);else(n[1]||v8).call(this,N,n[0]);D(v.type!=="fragment","unexpected fragment `exit`ed"),D(v.position,"expected `position` to be defined"),v.position.end=E1(N.end)}function H(){return o1(this.stack.pop())}function K(){this.data.expectingFirstListItemValue=!0}function B(N){if(this.data.expectingFirstListItemValue){let S=this.stack[this.stack.length-2];D(S,"expected nodes on stack"),D(S.type==="list","expected list on stack"),S.start=Number.parseInt(this.sliceSerialize(N),C.numericBaseDecimal),this.data.expectingFirstListItemValue=void 0}}function R(){let N=this.resume(),S=this.stack[this.stack.length-1];D(S,"expected node on stack"),D(S.type==="code","expected code on stack"),S.lang=N}function O(){let N=this.resume(),S=this.stack[this.stack.length-1];D(S,"expected node on stack"),D(S.type==="code","expected code on stack"),S.meta=N}function A(){if(this.data.flowCodeInside)return;this.buffer(),this.data.flowCodeInside=!0}function j(){let N=this.resume(),S=this.stack[this.stack.length-1];D(S,"expected node on stack"),D(S.type==="code","expected code on stack"),S.value=N.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function L(){let N=this.resume(),S=this.stack[this.stack.length-1];D(S,"expected node on stack"),D(S.type==="code","expected code on stack"),S.value=N.replace(/(\r?\n|\r)$/g,"")}function I(N){let S=this.resume(),v=this.stack[this.stack.length-1];D(v,"expected node on stack"),D(v.type==="definition","expected definition on stack"),v.label=S,v.identifier=R1(this.sliceSerialize(N)).toLowerCase()}function h(){let N=this.resume(),S=this.stack[this.stack.length-1];D(S,"expected node on stack"),D(S.type==="definition","expected definition on stack"),S.title=N}function a(){let N=this.resume(),S=this.stack[this.stack.length-1];D(S,"expected node on stack"),D(S.type==="definition","expected definition on stack"),S.url=N}function Gq(N){let S=this.stack[this.stack.length-1];if(D(S,"expected node on stack"),D(S.type==="heading","expected heading on stack"),!S.depth){let v=this.sliceSerialize(N).length;D(v===1||v===2||v===3||v===4||v===5||v===6,"expected `depth` between `1` and `6`"),S.depth=v}}function P(){this.data.setextHeadingSlurpLineEnding=!0}function e(N){let S=this.stack[this.stack.length-1];D(S,"expected node on stack"),D(S.type==="heading","expected heading on stack"),S.depth=this.sliceSerialize(N).codePointAt(0)===M.equalsTo?1:2}function Yq(){this.data.setextHeadingSlurpLineEnding=void 0}function s(N){let S=this.stack[this.stack.length-1];D(S,"expected node on stack"),D("children"in S,"expected parent on stack");let v=S.children,n=v[v.length-1];if(!n||n.type!=="text")n=NG(),n.position={start:E1(N.start),end:void 0},v.push(n);this.stack.push(n)}function Xq(N){let S=this.stack.pop();D(S,"expected a `node` to be on the stack"),D("value"in S,"expected a `literal` to be on the stack"),D(S.position,"expected `node` to have an open position"),S.value+=this.sliceSerialize(N),S.position.end=E1(N.end)}function kq(N){let S=this.stack[this.stack.length-1];if(D(S,"expected `node`"),this.data.atHardBreak){D("children"in S,"expected `parent`");let v=S.children[S.children.length-1];D(v.position,"expected tail to have a starting position"),v.position.end=E1(N.end),this.data.atHardBreak=void 0;return}if(!this.data.setextHeadingSlurpLineEnding&&$.canContainEols.includes(S.type))s.call(this,N),Xq.call(this,N)}function Jq(){this.data.atHardBreak=!0}function g(){let N=this.resume(),S=this.stack[this.stack.length-1];D(S,"expected node on stack"),D(S.type==="html","expected html on stack"),S.value=N}function l(){let N=this.resume(),S=this.stack[this.stack.length-1];D(S,"expected node on stack"),D(S.type==="html","expected html on stack"),S.value=N}function d(){let N=this.resume(),S=this.stack[this.stack.length-1];D(S,"expected node on stack"),D(S.type==="inlineCode","expected inline code on stack"),S.value=N}function Qq(){let N=this.stack[this.stack.length-1];if(D(N,"expected node on stack"),D(N.type==="link","expected link on stack"),this.data.inReference){let S=this.data.referenceType||"shortcut";N.type+="Reference",N.referenceType=S,delete N.url,delete N.title}else delete N.identifier,delete N.label;this.data.referenceType=void 0}function zq(){let N=this.stack[this.stack.length-1];if(D(N,"expected node on stack"),D(N.type==="image","expected image on stack"),this.data.inReference){let S=this.data.referenceType||"shortcut";N.type+="Reference",N.referenceType=S,delete N.url,delete N.title}else delete N.identifier,delete N.label;this.data.referenceType=void 0}function fq(N){let S=this.sliceSerialize(N),v=this.stack[this.stack.length-2];D(v,"expected ancestor on stack"),D(v.type==="image"||v.type==="link","expected image or link on stack"),v.label=Z5(S),v.identifier=R1(S).toLowerCase()}function sq(){let N=this.stack[this.stack.length-1];D(N,"expected node on stack"),D(N.type==="fragment","expected fragment on stack");let S=this.resume(),v=this.stack[this.stack.length-1];if(D(v,"expected node on stack"),D(v.type==="image"||v.type==="link","expected image or link on stack"),this.data.inReference=!0,v.type==="link"){let n=N.children;v.children=n}else v.alt=S}function w(){let N=this.resume(),S=this.stack[this.stack.length-1];D(S,"expected node on stack"),D(S.type==="image"||S.type==="link","expected image or link on stack"),S.url=N}function uq(){let N=this.resume(),S=this.stack[this.stack.length-1];D(S,"expected node on stack"),D(S.type==="image"||S.type==="link","expected image or link on stack"),S.title=N}function Y1(){this.data.inReference=void 0}function F(){this.data.referenceType="collapsed"}function gq(N){let S=this.resume(),v=this.stack[this.stack.length-1];D(v,"expected node on stack"),D(v.type==="image"||v.type==="link","expected image reference or link reference on stack"),v.label=S,v.identifier=R1(this.sliceSerialize(N)).toLowerCase(),this.data.referenceType="full"}function g1(N){D(N.type==="characterReferenceMarkerNumeric"||N.type==="characterReferenceMarkerHexadecimal"),this.data.characterReferenceType=N.type}function a5(N){let S=this.sliceSerialize(N),v=this.data.characterReferenceType,n;if(v)n=z5(S,v===z.characterReferenceMarkerNumeric?C.numericBaseDecimal:C.numericBaseHexadecimal),this.data.characterReferenceType=void 0;else{let Tq=v0(S);D(Tq!==!1,"expected reference to decode"),n=Tq}let t=this.stack[this.stack.length-1];D(t,"expected `node`"),D("value"in t,"expected `node.value`"),t.value+=n}function p$(N){let S=this.stack.pop();D(S,"expected `node`"),D(S.position,"expected `node.position`"),S.position.end=E1(N.end)}function Mq(N){Xq.call(this,N);let S=this.stack[this.stack.length-1];D(S,"expected node on stack"),D(S.type==="link","expected link on stack"),S.url=this.sliceSerialize(N)}function e0(N){Xq.call(this,N);let S=this.stack[this.stack.length-1];D(S,"expected node on stack"),D(S.type==="link","expected link on stack"),S.url="mailto:"+this.sliceSerialize(N)}function U1(){return{type:"blockquote",children:[]}}function v1(){return{type:"code",lang:null,meta:null,value:""}}function V0(){return{type:"inlineCode",value:""}}function s5(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function DG(){return{type:"emphasis",children:[]}}function nJ(){return{type:"heading",depth:0,children:[]}}function oJ(){return{type:"break"}}function aJ(){return{type:"html",value:""}}function wG(){return{type:"image",title:null,url:"",alt:null}}function sJ(){return{type:"link",title:null,url:"",children:[]}}function tJ(N){return{type:"list",ordered:N.type==="listOrdered",start:null,spread:N._spread,children:[]}}function FG(N){return{type:"listItem",spread:N._spread,checked:null,children:[]}}function OG(){return{type:"paragraph",children:[]}}function AG(){return{type:"strong",children:[]}}function NG(){return{type:"text",value:""}}function SG(){return{type:"thematicBreak"}}}function E1(q){return{line:q.line,column:q.column,offset:q.offset}}function h8(q,$){let J=-1;while(++J<$.length){let G=$[J];if(Array.isArray(G))h8(q,G);else fK(q,G)}}function fK(q,$){let J;for(J in $)if(y8.call($,J))switch(J){case"canContainEols":{let G=$[J];if(G)q[J].push(...G);break}case"transforms":{let G=$[J];if(G)q[J].push(...G);break}case"enter":case"exit":{let G=$[J];if(G)Object.assign(q[J],G);break}}}function v8(q,$){if(q)throw Error("Cannot close `"+q.type+"` ("+C1({start:q.start,end:q.end})+"): a different token (`"+$.type+"`, "+C1({start:$.start,end:$.end})+") is open");else throw Error("Cannot close document, a token (`"+$.type+"`, "+C1({start:$.start,end:$.end})+") is still open")}function C5(q){let $=this;$.parser=J;function J(G){return qJ(G,{...$.data("settings"),...q,extensions:$.data("micromarkExtensions")||[],mdastExtensions:$.data("fromMarkdownExtensions")||[]})}}var x8={}.hasOwnProperty;function m8(q,$){let J=$||{};function G(X,...Y){let{invalid:U,handlers:Q}=G;if(X&&x8.call(X,q)){let V=String(X[q]);U=x8.call(Q,V)?Q[V]:G.unknown}if(U)return U.call(this,X,...Y)}return G.handlers=J.handlers||{},G.invalid=J.invalid,G.unknown=J.unknown,G}var uK={}.hasOwnProperty;function $J(q,$){let J=-1,G;if($.extensions)while(++J<$.extensions.length)$J(q,$.extensions[J]);for(G in $)if(uK.call($,G))switch(G){case"extensions":break;case"unsafe":{k8(q[G],$[G]);break}case"join":{k8(q[G],$[G]);break}case"handlers":{pK(q[G],$[G]);break}default:q.options[G]=$[G]}return q}function k8(q,$){if($)q.push(...$)}function pK(q,$){if($)Object.assign(q,$)}function f8(q,$,J,G){let X=J.enter("blockquote"),Y=J.createTracker(G);Y.move("> "),Y.shift(2);let U=J.indentLines(J.containerFlow(q,Y.current()),lK);return X(),U}function lK(q,$,J){return">"+(J?"":" ")+q}function E5(q,$){return u8(q,$.inConstruct,!0)&&!u8(q,$.notInConstruct,!1)}function u8(q,$,J){if(typeof $==="string")$=[$];if(!$||$.length===0)return J;let G=-1;while(++G<$.length)if(q.includes($[G]))return!0;return!1}function JJ(q,$,J,G){let X=-1;while(++X<J.unsafe.length)if(J.unsafe[X].character===`
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
`;return X;function Y(U){return G.stack.push(U),Q;function Q(){G.stack.pop()}}}function Wz(q){throw Error("Cannot handle value `"+q+"`, expected node")}function Hz(q){throw Error("Cannot handle unknown node `"+q.type+"`")}function Kz(q,$){if(q.type==="definition"&&q.type===$.type)return 0}function zz(q,$){return z6(q,this,$)}function Mz(q,$){return M6(q,this,$)}function Rz(q,$){return D6(this,q,$)}function v5(q){let $=this;$.compiler=J;function J(G){return BJ(G,{...$.data("settings"),...q,extensions:$.data("toMarkdownExtensions")||[]})}}function DJ(q){if(q)throw q}var k5=e5(Z6(),1);function I$(q){if(typeof q!=="object"||q===null)return!1;let $=Object.getPrototypeOf(q);return($===null||$===Object.prototype||Object.getPrototypeOf($)===null)&&!(Symbol.toStringTag in q)&&!(Symbol.iterator in q)}function wJ(){let q=[],$={run:J,use:G};return $;function J(...X){let Y=-1,U=X.pop();if(typeof U!=="function")throw TypeError("Expected function as last argument, not "+U);Q(null,...X);function Q(V,...W){let H=q[++Y],K=-1;if(V){U(V);return}while(++K<X.length)if(W[K]===null||W[K]===void 0)W[K]=X[K];if(X=W,H)C6(H,Q)(...W);else U(null,...W)}}function G(X){if(typeof X!=="function")throw TypeError("Expected `middelware` to be a function, not "+X);return q.push(X),$}}function C6(q,$){let J;return G;function G(...U){let Q=q.length>U.length,V;if(Q)U.push(X);try{V=q.apply(this,U)}catch(W){let H=W;if(Q&&J)throw H;return X(H)}if(!Q)if(V&&V.then&&typeof V.then==="function")V.then(Y,X);else if(V instanceof Error)X(V);else Y(V)}function X(U,...Q){if(!J)J=!0,$(U,...Q)}function Y(U){X(null,U)}}class Oq extends Error{constructor(q,$,J){super();if(typeof $==="string")J=$,$=void 0;let G="",X={},Y=!1;if($)if("line"in $&&"column"in $)X={place:$};else if("start"in $&&"end"in $)X={place:$};else if("type"in $)X={ancestors:[$],place:$.position};else X={...$};if(typeof q==="string")G=q;else if(!X.cause&&q)Y=!0,G=q.message,X.cause=q;if(!X.ruleId&&!X.source&&typeof J==="string"){let Q=J.indexOf(":");if(Q===-1)X.ruleId=J;else X.source=J.slice(0,Q),X.ruleId=J.slice(Q+1)}if(!X.place&&X.ancestors&&X.ancestors){let Q=X.ancestors[X.ancestors.length-1];if(Q)X.place=Q.position}let U=X.place&&"start"in X.place?X.place.start:X.place;this.ancestors=X.ancestors||void 0,this.cause=X.cause||void 0,this.column=U?U.column:void 0,this.fatal=void 0,this.file="",this.message=G,this.line=U?U.line:void 0,this.name=C1(X.place)||"1:1",this.place=X.place||void 0,this.reason=this.message,this.ruleId=X.ruleId||void 0,this.source=X.source||void 0,this.stack=Y&&X.cause&&typeof X.cause.stack==="string"?X.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Oq.prototype.file="";Oq.prototype.name="";Oq.prototype.reason="";Oq.prototype.message="";Oq.prototype.stack="";Oq.prototype.column=void 0;Oq.prototype.line=void 0;Oq.prototype.ancestors=void 0;Oq.prototype.cause=void 0;Oq.prototype.fatal=void 0;Oq.prototype.place=void 0;Oq.prototype.ruleId=void 0;Oq.prototype.source=void 0;import{default as oq}from"path";import{default as E6}from"process";import{fileURLToPath as T6}from"url";function h5(q){return Boolean(q!==null&&typeof q==="object"&&"href"in q&&q.href&&"protocol"in q&&q.protocol&&q.auth===void 0)}var FJ=["history","path","basename","stem","extname","dirname"];class x5{constructor(q){let $;if(!q)$={};else if(h5(q))$={path:q};else if(typeof q==="string"||Bz(q))$={value:q};else $=q;this.cwd="cwd"in $?"":E6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let J=-1;while(++J<FJ.length){let X=FJ[J];if(X in $&&$[X]!==void 0&&$[X]!==null)this[X]=X==="history"?[...$[X]]:$[X]}let G;for(G in $)if(!FJ.includes(G))this[G]=$[G]}get basename(){return typeof this.path==="string"?oq.basename(this.path):void 0}set basename(q){AJ(q,"basename"),OJ(q,"basename"),this.path=oq.join(this.dirname||"",q)}get dirname(){return typeof this.path==="string"?oq.dirname(this.path):void 0}set dirname(q){_6(this.basename,"dirname"),this.path=oq.join(q||"",this.basename)}get extname(){return typeof this.path==="string"?oq.extname(this.path):void 0}set extname(q){if(OJ(q,"extname"),_6(this.dirname,"extname"),q){if(q.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(q.includes(".",1))throw Error("`extname` cannot contain multiple dots")}this.path=oq.join(this.dirname,this.stem+(q||""))}get path(){return this.history[this.history.length-1]}set path(q){if(h5(q))q=T6(q);if(AJ(q,"path"),this.path!==q)this.history.push(q)}get stem(){return typeof this.path==="string"?oq.basename(this.path,this.extname):void 0}set stem(q){AJ(q,"stem"),OJ(q,"stem"),this.path=oq.join(this.dirname||"",q+(this.extname||""))}fail(q,$,J){let G=this.message(q,$,J);throw G.fatal=!0,G}info(q,$,J){let G=this.message(q,$,J);return G.fatal=void 0,G}message(q,$,J){let G=new Oq(q,$,J);if(this.path)G.name=this.path+":"+G.name,G.file=this.path;return G.fatal=!1,this.messages.push(G),G}toString(q){if(this.value===void 0)return"";if(typeof this.value==="string")return this.value;return new TextDecoder(q||void 0).decode(this.value)}}function OJ(q,$){if(q&&q.includes(oq.sep))throw Error("`"+$+"` cannot be a path: did not expect `"+oq.sep+"`")}function AJ(q,$){if(!q)throw Error("`"+$+"` cannot be empty")}function _6(q,$){if(!q)throw Error("Setting `"+$+"` requires `path` to be set too")}function Bz(q){return Boolean(q&&typeof q==="object"&&"byteLength"in q&&"byteOffset"in q)}var b6=function(q){let G=this.constructor.prototype,X=G[q],Y=function(){return X.apply(Y,arguments)};return Object.setPrototypeOf(Y,G),Y};var Dz={}.hasOwnProperty;class PJ extends b6{constructor(){super("copy");this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=wJ()}copy(){let q=new PJ,$=-1;while(++$<this.attachers.length){let J=this.attachers[$];q.use(...J)}return q.data(k5.default(!0,{},this.namespace)),q}data(q,$){if(typeof q==="string"){if(arguments.length===2)return jJ("data",this.frozen),this.namespace[q]=$,this;return Dz.call(this.namespace,q)&&this.namespace[q]||void 0}if(q)return jJ("data",this.frozen),this.namespace=q,this;return this.namespace}freeze(){if(this.frozen)return this;let q=this;while(++this.freezeIndex<this.attachers.length){let[$,...J]=this.attachers[this.freezeIndex];if(J[0]===!1)continue;if(J[0]===!0)J[0]=void 0;let G=$.call(q,...J);if(typeof G==="function")this.transformers.use(G)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(q){this.freeze();let $=m5(q),J=this.parser||this.Parser;return NJ("parse",J),J(String($),$)}process(q,$){let J=this;return this.freeze(),NJ("process",this.parser||this.Parser),SJ("process",this.compiler||this.Compiler),$?G(void 0,$):new Promise(G);function G(X,Y){let U=m5(q),Q=J.parse(U);J.run(Q,U,function(W,H,K){if(W||!H||!K)return V(W);let B=H,R=J.stringify(B,K);if(Fz(R))K.value=R;else K.result=R;V(W,K)});function V(W,H){if(W||!H)Y(W);else if(X)X(H);else D($,"`done` is defined if `resolve` is not"),$(void 0,H)}}}processSync(q){let $=!1,J;return this.freeze(),NJ("processSync",this.parser||this.Parser),SJ("processSync",this.compiler||this.Compiler),this.process(q,G),g6("processSync","process",$),D(J,"we either bailed on an error or have a tree"),J;function G(X,Y){$=!0,DJ(X),J=Y}}run(q,$,J){I6(q),this.freeze();let G=this.transformers;if(!J&&typeof $==="function")J=$,$=void 0;return J?X(void 0,J):new Promise(X);function X(Y,U){D(typeof $!=="function","`file` can\u2019t be a `done` anymore, we checked");let Q=m5($);G.run(q,Q,V);function V(W,H,K){let B=H||q;if(W)U(W);else if(Y)Y(B);else D(J,"`done` is defined if `resolve` is not"),J(void 0,B,K)}}}runSync(q,$){let J=!1,G;return this.run(q,$,X),g6("runSync","run",J),D(G,"we either bailed on an error or have a tree"),G;function X(Y,U){DJ(Y),G=U,J=!0}}stringify(q,$){this.freeze();let J=m5($),G=this.compiler||this.Compiler;return SJ("stringify",G),I6(q),G(q,J)}use(q,...$){let J=this.attachers,G=this.namespace;if(jJ("use",this.frozen),q===null||q===void 0);else if(typeof q==="function")Q(q,$);else if(typeof q==="object")if(Array.isArray(q))U(q);else Y(q);else throw TypeError("Expected usable value, not `"+q+"`");return this;function X(V){if(typeof V==="function")Q(V,[]);else if(typeof V==="object")if(Array.isArray(V)){let[W,...H]=V;Q(W,H)}else Y(V);else throw TypeError("Expected usable value, not `"+V+"`")}function Y(V){if(!("plugins"in V)&&!("settings"in V))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");if(U(V.plugins),V.settings)G.settings=k5.default(!0,G.settings,V.settings)}function U(V){let W=-1;if(V===null||V===void 0);else if(Array.isArray(V))while(++W<V.length){let H=V[W];X(H)}else throw TypeError("Expected a list of plugins, not `"+V+"`")}function Q(V,W){let H=-1,K=-1;while(++H<J.length)if(J[H][0]===V){K=H;break}if(K===-1)J.push([V,...W]);else if(W.length>0){let[B,...R]=W,O=J[K][1];if(I$(O)&&I$(B))B=k5.default(!0,O,B);J[K]=[V,B,...R]}}}}var LJ=new PJ().freeze();function NJ(q,$){if(typeof $!=="function")throw TypeError("Cannot `"+q+"` without `parser`")}function SJ(q,$){if(typeof $!=="function")throw TypeError("Cannot `"+q+"` without `compiler`")}function jJ(q,$){if($)throw Error("Cannot call `"+q+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function I6(q){if(!I$(q)||typeof q.type!=="string")throw TypeError("Expected node, got `"+q+"`")}function g6(q,$,J){if(!J)throw Error("`"+q+"` finished async. Use `"+$+"` instead")}function m5(q){return wz(q)?q:new x5(q)}function wz(q){return Boolean(q&&typeof q==="object"&&"message"in q&&"messages"in q)}function Fz(q){return typeof q==="string"||Oz(q)}function Oz(q){return Boolean(q&&typeof q==="object"&&"byteLength"in q&&"byteOffset"in q)}var f5=LJ().use(C5).use(v5).freeze();var EZ=f5();var TZ=new K5({gfm:!0,breaks:!0});/*! js-yaml 4.1.1 https://github.com/nodeca/js-yaml @license MIT */function o6(q){return typeof q>"u"||q===null}function Nz(q){return typeof q==="object"&&q!==null}function Sz(q){if(Array.isArray(q))return q;else if(o6(q))return[];return[q]}function jz(q,$){var J,G,X,Y;if($){Y=Object.keys($);for(J=0,G=Y.length;J<G;J+=1)X=Y[J],q[X]=$[X]}return q}function Pz(q,$){var J="",G;for(G=0;G<$;G+=1)J+=q;return J}function Lz(q){return q===0&&Number.NEGATIVE_INFINITY===1/q}var Zz=o6,Cz=Nz,Ez=Sz,Tz=Pz,_z=Lz,bz=jz,Bq={isNothing:Zz,isObject:Cz,toArray:Ez,repeat:Tz,isNegativeZero:_z,extend:bz};function a6(q,$){var J="",G=q.reason||"(unknown reason)";if(!q.mark)return G;if(q.mark.name)J+='in "'+q.mark.name+'" ';if(J+="("+(q.mark.line+1)+":"+(q.mark.column+1)+")",!$&&q.mark.snippet)J+=`
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
`}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
`)
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
`||q===`
|
|
156
|
-
`),Y=X?"+":G?"":"-";return J+Y+`
|
|
157
|
-
`}
|
|
158
|
-
`?q.slice(0,-1):q}function vR(q,$){var J=/(\n+)([^\n]*)/g,G=function(){var W=q.indexOf(`
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
`);
|
|
3
|
+
var aK=Object.create;var{getPrototypeOf:cK,defineProperty:$b,getOwnPropertyNames:lK}=Object;var uK=Object.prototype.hasOwnProperty;function dK(e){return this[e]}var fK,pK,Ul=(e,t,r)=>{var o=e!=null&&typeof e==="object";if(o){var n=t?fK??=new WeakMap:pK??=new WeakMap,i=n.get(e);if(i)return i}r=e!=null?aK(cK(e)):{};let s=t||!e||!e.__esModule?$b(r,"default",{value:e,enumerable:!0}):r;if(e&&typeof e==="object"||typeof e==="function"){for(let a of lK(e))if(!uK.call(s,a))$b(s,a,{get:dK.bind(e,a),enumerable:!0})}if(o)n.set(e,s);return s};var ge=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var mK=(e)=>e;function hK(e,t){this[e]=mK.bind(null,t)}var Lt=(e,t)=>{for(var r in t)$b(e,r,{get:t[r],enumerable:!0,configurable:!0,set:hK.bind(t,r)})};var v=(e,t)=>()=>(e&&(t=e(e=0)),t);var qr=import.meta.require;function Ve(e,t){if(e instanceof Error)return e.message;return t??String(e)}function Ob(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function St(e,t=""){if(typeof e!=="number"){let r=t&&`"${t}" `;throw TypeError(`${r}expected number, got ${typeof e}`)}if(!Number.isSafeInteger(e)||e<0){let r=t&&`"${t}" `;throw RangeError(`${r}expected integer >= 0, got ${e}`)}}function Mt(e,t,r=""){let o=Ob(e),n=e?.length,i=t!==void 0;if(!o||i&&n!==t){let s=r&&`"${r}" `,a=i?` of length ${t}`:"",c=o?`length=${n}`:`type=${typeof e}`,u=s+"expected Uint8Array"+a+", got "+c;if(!o)throw TypeError(u);throw RangeError(u)}return e}function ao(e){if(typeof e!=="function"||typeof e.create!=="function")throw TypeError("Hash must wrapped by utils.createHasher");if(St(e.outputLen),St(e.blockLen),e.outputLen<1)throw Error('"outputLen" must be >= 1');if(e.blockLen<1)throw Error('"blockLen" must be >= 1')}function Ea(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function op(e,t){Mt(e,void 0,"digestInto() output");let r=t.outputLen;if(e.length<r)throw RangeError('"digestInto() output" expected to be of length >='+r)}function ip(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function cr(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function ka(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function cn(e,t){return e<<32-t|e>>>t}function Fe(e,t){return e<<t|e>>>32-t>>>0}function IK(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function AK(e){for(let t=0;t<e.length;t++)e[t]=IK(e[t]);return e}function sp(e){if(Mt(e),tO)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=TK[e[r]];return t}function eO(e){if(e>=so._0&&e<=so._9)return e-so._0;if(e>=so.A&&e<=so.F)return e-(so.A-10);if(e>=so.a&&e<=so.f)return e-(so.a-10);return}function Ml(e){if(typeof e!=="string")throw TypeError("hex string expected, got "+typeof e);if(tO)try{return Uint8Array.fromHex(e)}catch(n){if(n instanceof SyntaxError)throw RangeError(n.message);throw n}let t=e.length,r=t/2;if(t%2)throw RangeError("hex string expected, got unpadded hex of length "+t);let o=new Uint8Array(r);for(let n=0,i=0;n<r;n++,i+=2){let s=eO(e.charCodeAt(i)),a=eO(e.charCodeAt(i+1));if(s===void 0||a===void 0){let c=e[i]+e[i+1];throw RangeError('hex string expected, got non-hex character "'+c+'" at index '+i)}o[n]=s*16+a}return o}function RK(e){if(typeof e!=="string")throw TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Pb(e,t=""){if(typeof e==="string")return RK(e);return Mt(e,void 0,t)}function zb(...e){let t=0;for(let o=0;o<e.length;o++){let n=e[o];Mt(n),t+=n.length}let r=new Uint8Array(t);for(let o=0,n=0;o<e.length;o++){let i=e[o];r.set(i,n),n+=i.length}return r}function ap(e,t){if(t!==void 0&&{}.toString.call(t)!=="[object Object]")throw TypeError("options must be object or undefined");return Object.assign(e,t)}function Nb(e,t={}){let r=(n,i)=>e(i).update(n).digest(),o=e(void 0);return r.outputLen=o.outputLen,r.blockLen=o.blockLen,r.canXOF=o.canXOF,r.create=(n)=>e(n),Object.assign(r,t),Object.freeze(r)}function co(e=32){St(e,"bytesLength");let t=typeof globalThis==="object"?globalThis.crypto:null;if(typeof t?.getRandomValues!=="function")throw Error("crypto.getRandomValues must be defined");if(e>65536)throw RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}var kK,Cb,tO,TK,so,Db=(e)=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});var Fr=v(()=>{kK=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();Cb=kK?(e)=>e:AK,tO=(()=>typeof Uint8Array.from([]).toHex==="function"&&typeof Uint8Array.fromHex==="function")(),TK=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));so={_0:48,_9:57,A:65,F:70,a:97,f:102}});class Lb{oHash;iHash;blockLen;outputLen;canXOF=!1;finished=!1;destroyed=!1;constructor(e,t){if(ao(e),Mt(t,void 0,"key"),this.iHash=e.create(),typeof this.iHash.update!=="function")throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,o=new Uint8Array(r);o.set(t.length>r?e.create().update(t).digest():t);for(let n=0;n<o.length;n++)o[n]^=54;this.iHash.update(o),this.oHash=e.create();for(let n=0;n<o.length;n++)o[n]^=106;this.oHash.update(o),cr(o)}update(e){return Ea(this),this.iHash.update(e),this}digestInto(e){Ea(this),op(e,this),this.finished=!0;let t=e.subarray(0,this.outputLen);this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:r,finished:o,destroyed:n,blockLen:i,outputLen:s}=this;return e=e,e.finished=o,e.destroyed=n,e.blockLen=i,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}var Cn;var ql=v(()=>{Fr();Cn=(()=>{let e=(t,r,o)=>new Lb(t,r).update(o).digest();return e.create=(t,r)=>new Lb(t,r),e})()});function Fl(e,t,r){if(ao(e),r===void 0)r=new Uint8Array(e.outputLen);return Cn(e,r,t)}function jb(e,t,r,o=32){ao(e),St(o,"length"),Mt(t,void 0,"prk");let n=e.outputLen;if(t.length<n)throw Error('"prk" must be at least HashLen octets');if(o>255*n)throw Error("Length must be <= 255*HashLen");let i=Math.ceil(o/n);if(r===void 0)r=rO;else Mt(r,void 0,"info");let s=new Uint8Array(i*n),a=Cn.create(e,t),c=a._cloneInto(),u=new Uint8Array(a.outputLen);for(let d=0;d<i;d++)Bb[0]=d+1,c.update(d===0?rO:u).update(r).update(Bb).digestInto(u),s.set(u,n*d),a._cloneInto(c);return a.destroy(),c.destroy(),cr(u,Bb),s.slice(0,o)}var Bb,rO,Wo=(e,t,r,o,n)=>jb(e,Fl(e,t,r),o,n);var Zb=v(()=>{ql();Fr();Bb=Uint8Array.of(0),rO=Uint8Array.of()});function nO(e,t,r){return e&t^~e&r}function oO(e,t,r){return e&t^e&r^t&r}class cp{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,o){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(e),this.view=ka(this.buffer)}update(e){Ea(this),Mt(e);let{view:t,buffer:r,blockLen:o}=this,n=e.length;for(let i=0;i<n;){let s=Math.min(o-this.pos,n-i);if(s===o){let a=ka(e);for(;o<=n-i;i+=o)this.process(a,i);continue}if(r.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===o)this.process(t,0),this.pos=0}return this.length+=e.length,this.roundClean(),this}digestInto(e){Ea(this),op(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:o,isLE:n}=this,{pos:i}=this;if(t[i++]=128,cr(this.buffer.subarray(i)),this.padOffset>o-i)this.process(r,0),i=0;for(let d=i;d<o;d++)t[d]=0;r.setBigUint64(o-8,BigInt(this.length*8),n),this.process(r,0);let s=ka(e),a=this.outputLen;if(a%4)throw Error("_sha2: outputLen must be aligned to 32bit");let c=a/4,u=this.get();if(c>u.length)throw Error("_sha2: outputLen bigger than state");for(let d=0;d<c;d++)s.setUint32(4*d,u[d],n)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:r,length:o,finished:n,destroyed:i,pos:s}=this;if(e.destroyed=i,e.finished=n,e.length=o,e.pos=s,o%t)e.buffer.set(r);return e}clone(){return this._cloneInto()}}var lo,qt;var iO=v(()=>{Fr();lo=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),qt=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209])});function $K(e,t=!1){if(t)return{h:Number(e&lp),l:Number(e>>sO&lp)};return{h:Number(e>>sO&lp)|0,l:Number(e&lp)|0}}function aO(e,t=!1){let r=e.length,o=new Uint32Array(r),n=new Uint32Array(r);for(let i=0;i<r;i++){let{h:s,l:a}=$K(e[i],t);[o[i],n[i]]=[s,a]}return[o,n]}function Pn(e,t,r,o){let n=(t>>>0)+(o>>>0);return{h:e+r+(n/4294967296|0)|0,l:n|0}}var lp,sO,Ub=(e,t,r)=>e>>>r,Mb=(e,t,r)=>e<<32-r|t>>>r,fs=(e,t,r)=>e>>>r|t<<32-r,ps=(e,t,r)=>e<<32-r|t>>>r,Kl=(e,t,r)=>e<<64-r|t>>>r-32,Jl=(e,t,r)=>e>>>r-32|t<<64-r,cO=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),lO=(e,t,r,o)=>t+r+o+(e/4294967296|0)|0,uO=(e,t,r,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(o>>>0),dO=(e,t,r,o,n)=>t+r+o+n+(e/4294967296|0)|0,fO=(e,t,r,o,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(o>>>0)+(n>>>0),pO=(e,t,r,o,n,i)=>t+r+o+n+i+(e/4294967296|0)|0;var mO=v(()=>{lp=BigInt(4294967295),sO=BigInt(32)});var CK,Go,hO,gO,yO,PK,zK,Qo,Yo,bO,SO,vt,up;var Ia=v(()=>{iO();mO();Fr();CK=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Go=new Uint32Array(64);hO=class hO extends cp{constructor(e){super(64,e,8,!1)}get(){let{A:e,B:t,C:r,D:o,E:n,F:i,G:s,H:a}=this;return[e,t,r,o,n,i,s,a]}set(e,t,r,o,n,i,s,a){this.A=e|0,this.B=t|0,this.C=r|0,this.D=o|0,this.E=n|0,this.F=i|0,this.G=s|0,this.H=a|0}process(e,t){for(let d=0;d<16;d++,t+=4)Go[d]=e.getUint32(t,!1);for(let d=16;d<64;d++){let f=Go[d-15],m=Go[d-2],h=cn(f,7)^cn(f,18)^f>>>3,b=cn(m,17)^cn(m,19)^m>>>10;Go[d]=b+Go[d-7]+h+Go[d-16]|0}let{A:r,B:o,C:n,D:i,E:s,F:a,G:c,H:u}=this;for(let d=0;d<64;d++){let f=cn(s,6)^cn(s,11)^cn(s,25),m=u+f+nO(s,a,c)+CK[d]+Go[d]|0,b=(cn(r,2)^cn(r,13)^cn(r,22))+oO(r,o,n)|0;u=c,c=a,a=s,s=i+m|0,i=n,n=o,o=r,r=m+b|0}r=r+this.A|0,o=o+this.B|0,n=n+this.C|0,i=i+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,o,n,i,s,a,c,u)}roundClean(){cr(Go)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),cr(this.buffer)}};gO=class gO extends hO{A=lo[0]|0;B=lo[1]|0;C=lo[2]|0;D=lo[3]|0;E=lo[4]|0;F=lo[5]|0;G=lo[6]|0;H=lo[7]|0;constructor(){super(32)}};yO=(()=>aO(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e)=>BigInt(e))))(),PK=(()=>yO[0])(),zK=(()=>yO[1])(),Qo=new Uint32Array(80),Yo=new Uint32Array(80);bO=class bO extends cp{constructor(e){super(128,e,16,!1)}get(){let{Ah:e,Al:t,Bh:r,Bl:o,Ch:n,Cl:i,Dh:s,Dl:a,Eh:c,El:u,Fh:d,Fl:f,Gh:m,Gl:h,Hh:b,Hl:y}=this;return[e,t,r,o,n,i,s,a,c,u,d,f,m,h,b,y]}set(e,t,r,o,n,i,s,a,c,u,d,f,m,h,b,y){this.Ah=e|0,this.Al=t|0,this.Bh=r|0,this.Bl=o|0,this.Ch=n|0,this.Cl=i|0,this.Dh=s|0,this.Dl=a|0,this.Eh=c|0,this.El=u|0,this.Fh=d|0,this.Fl=f|0,this.Gh=m|0,this.Gl=h|0,this.Hh=b|0,this.Hl=y|0}process(e,t){for(let _=0;_<16;_++,t+=4)Qo[_]=e.getUint32(t),Yo[_]=e.getUint32(t+=4);for(let _=16;_<80;_++){let A=Qo[_-15]|0,O=Yo[_-15]|0,L=fs(A,O,1)^fs(A,O,8)^Ub(A,O,7),z=ps(A,O,1)^ps(A,O,8)^Mb(A,O,7),J=Qo[_-2]|0,P=Yo[_-2]|0,W=fs(J,P,19)^Kl(J,P,61)^Ub(J,P,6),ee=ps(J,P,19)^Jl(J,P,61)^Mb(J,P,6),j=uO(z,ee,Yo[_-7],Yo[_-16]),R=dO(j,L,W,Qo[_-7],Qo[_-16]);Qo[_]=R|0,Yo[_]=j|0}let{Ah:r,Al:o,Bh:n,Bl:i,Ch:s,Cl:a,Dh:c,Dl:u,Eh:d,El:f,Fh:m,Fl:h,Gh:b,Gl:y,Hh:S,Hl:x}=this;for(let _=0;_<80;_++){let A=fs(d,f,14)^fs(d,f,18)^Kl(d,f,41),O=ps(d,f,14)^ps(d,f,18)^Jl(d,f,41),L=d&m^~d&b,z=f&h^~f&y,J=fO(x,O,z,zK[_],Yo[_]),P=pO(J,S,A,L,PK[_],Qo[_]),W=J|0,ee=fs(r,o,28)^Kl(r,o,34)^Kl(r,o,39),j=ps(r,o,28)^Jl(r,o,34)^Jl(r,o,39),R=r&n^r&s^n&s,B=o&i^o&a^i&a;S=b|0,x=y|0,b=m|0,y=h|0,m=d|0,h=f|0,{h:d,l:f}=Pn(c|0,u|0,P|0,W|0),c=s|0,u=a|0,s=n|0,a=i|0,n=r|0,i=o|0;let k=cO(W,j,B);r=lO(k,P,ee,R),o=k|0}({h:r,l:o}=Pn(this.Ah|0,this.Al|0,r|0,o|0)),{h:n,l:i}=Pn(this.Bh|0,this.Bl|0,n|0,i|0),{h:s,l:a}=Pn(this.Ch|0,this.Cl|0,s|0,a|0),{h:c,l:u}=Pn(this.Dh|0,this.Dl|0,c|0,u|0),{h:d,l:f}=Pn(this.Eh|0,this.El|0,d|0,f|0),{h:m,l:h}=Pn(this.Fh|0,this.Fl|0,m|0,h|0),{h:b,l:y}=Pn(this.Gh|0,this.Gl|0,b|0,y|0),{h:S,l:x}=Pn(this.Hh|0,this.Hl|0,S|0,x|0),this.set(r,o,n,i,s,a,c,u,d,f,m,h,b,y,S,x)}roundClean(){cr(Qo,Yo)}destroy(){this.destroyed=!0,cr(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};SO=class SO extends bO{Ah=qt[0]|0;Al=qt[1]|0;Bh=qt[2]|0;Bl=qt[3]|0;Ch=qt[4]|0;Cl=qt[5]|0;Dh=qt[6]|0;Dl=qt[7]|0;Eh=qt[8]|0;El=qt[9]|0;Fh=qt[10]|0;Fl=qt[11]|0;Gh=qt[12]|0;Gl=qt[13]|0;Hh=qt[14]|0;Hl=qt[15]|0;constructor(){super(64)}};vt=Nb(()=>new gO,Db(1)),up=Nb(()=>new SO,Db(3))});function hp(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function Kb(e){if(!hp(e))throw TypeError("Uint8Array expected")}function EO(e,t){if(!Array.isArray(t))return!1;if(t.length===0)return!0;if(e)return t.every((r)=>typeof r==="string");else return t.every((r)=>Number.isSafeInteger(r))}function kO(e){if(typeof e!=="function")throw TypeError("function expected");return!0}function Xo(e,t){if(typeof t!=="string")throw TypeError(`${e}: string expected`);return!0}function Vl(e){if(typeof e!=="number")throw TypeError(`number expected, got ${typeof e}`);if(!Number.isSafeInteger(e))throw RangeError(`invalid integer: ${e}`)}function fp(e){if(!Array.isArray(e))throw TypeError("array expected")}function pp(e,t){if(!EO(!0,t))throw TypeError(`${e}: array of strings expected`)}function Jb(e,t){if(!EO(!1,t))throw TypeError(`${e}: array of numbers expected`)}function Or(...e){let t=(i)=>i,r=(i,s)=>(a)=>i(s(a)),o=e.map((i)=>i.encode).reduceRight(r,t),n=e.map((i)=>i.decode).reduce(r,t);return{encode:o,decode:n}}function Cr(e){let t=typeof e==="string"?e.split(""):e,r=t.length;pp("alphabet",t);let o=new Map(t.map((n,i)=>[n,i]));return{encode:(n)=>(fp(n),n.map((i)=>{if(!Number.isSafeInteger(i)||i<0||i>=r)throw Error(`alphabet.encode: digit index outside alphabet "${i}". Allowed: ${e}`);return t[i]})),decode:(n)=>(fp(n),n.map((i)=>{Xo("alphabet.decode",i);let s=o.get(i);if(s===void 0)throw Error(`Unknown letter: "${i}". Allowed: ${e}`);return s}))}}function Pr(e=""){return Xo("join",e),{encode:(t)=>(pp("join.decode",t),t.join(e)),decode:(t)=>(Xo("join.decode",t),t.split(e))}}function gp(e,t="="){return Vl(e),Xo("padding",t),{encode(r){pp("padding.encode",r);while(r.length*e%8)r.push(t);return r},decode(r){pp("padding.decode",r);let o=r.length;if(o*e%8)throw Error("padding: invalid, string should have whole number of bytes");for(;o>0&&r[o-1]===t;o--)if((o-1)*e%8===0)throw Error("padding: invalid, string has too much padding");return r.slice(0,o)}}}function IO(e){return kO(e),{encode:(t)=>t,decode:(t)=>e(t)}}function vO(e,t,r){if(t<2)throw RangeError(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw RangeError(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(fp(e),!e.length)return[];let o=0,n=[],i=Array.from(e,(a)=>{if(Vl(a),a<0||a>=t)throw Error(`invalid integer: ${a}`);return a}),s=i.length;while(!0){let a=0,c=!0;for(let u=o;u<s;u++){let d=i[u],f=t*a,m=f+d;if(!Number.isSafeInteger(m)||f/t!==a||m-d!==f)throw Error("convertRadix: carry overflow");let h=m/r;a=m%r;let b=Math.floor(h);if(i[u]=b,!Number.isSafeInteger(b)||b*r+a!==m)throw Error("convertRadix: carry overflow");if(!c)continue;else if(!b)o=u;else c=!1}if(n.push(a),c)break}for(let a=0;a<e.length-1&&e[a]===0;a++)n.push(0);return n.reverse()}function qb(e,t,r,o){if(fp(e),t<=0||t>32)throw RangeError(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw RangeError(`convertRadix2: wrong to=${r}`);if(mp(t,r)>32)throw Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${mp(t,r)}`);let n=0,i=0,s=dp[t],a=dp[r]-1,c=[];for(let u of e){if(Vl(u),u>=s)throw Error(`convertRadix2: invalid data word=${u} from=${t}`);if(n=n<<t|u,i+t>32)throw Error(`convertRadix2: carry overflow pos=${i} from=${t}`);i+=t;for(;i>=r;i-=r)c.push((n>>i-r&a)>>>0);let d=dp[i];if(d===void 0)throw Error("invalid carry");n&=d-1}if(n=n<<r-i&a,!o&&i>=t)throw Error("Excess padding");if(!o&&n>0)throw Error(`Non-zero padding: ${n}`);if(o&&i>0)c.push(n>>>0);return c}function NK(e){Vl(e);let t=256;return{encode:(r)=>{if(!hp(r))throw TypeError("radix.encode input should be Uint8Array");return vO(Array.from(r),t,e)},decode:(r)=>(Jb("radix.decode",r),Uint8Array.from(vO(r,e,t)))}}function Kr(e,t=!1){if(Vl(e),e<=0||e>32)throw RangeError("radix2: bits should be in (0..32]");if(mp(8,e)>32||mp(e,8)>32)throw RangeError("radix2: carry overflow");return{encode:(r)=>{if(!hp(r))throw TypeError("radix2.encode input should be Uint8Array");return qb(Array.from(r),8,e,!t)},decode:(r)=>(Jb("radix2.decode",r),Uint8Array.from(qb(r,e,8,t)))}}function wO(e){return kO(e),function(...t){try{return e.apply(null,t)}catch(r){}}}function Hl(e){let t=e>>25,r=(e&33554431)<<5;for(let o=0;o<xO.length;o++)if((t>>o&1)===1)r^=xO[o];return r}function _O(e,t,r=1){let o=e.length,n=1;for(let i=0;i<o;i++){let s=e.charCodeAt(i);if(s<33||s>126)throw Error(`Invalid prefix (${e})`);n=Hl(n)^s>>5}n=Hl(n);for(let i=0;i<o;i++)n=Hl(n)^e.charCodeAt(i)&31;for(let i of t)n=Hl(n)^i;for(let i=0;i<6;i++)n=Hl(n);return n^=r,Fb.encode(qb([n%dp[30]],30,5,!1))}function $O(e){let t=e==="bech32"?1:734539939,r=Kr(5),o=r.decode,n=r.encode,i=wO(o);function s(f,m,h=90){if(Xo("bech32.encode prefix",f),hp(m))m=Array.from(m);Jb("bech32.encode",m);let b=f.length;if(b===0)throw TypeError(`Invalid prefix length ${b}`);let y=b+7+m.length;if(h!==!1&&y>h)throw TypeError(`Length ${y} exceeds limit ${h}`);let S=f.toLowerCase(),x=_O(S,m,t);return`${S}1${Fb.encode(m)}${x}`}function a(f,m=90){Xo("bech32.decode input",f);let h=f.length;if(h<8||m!==!1&&h>m)throw TypeError(`invalid string length: ${h} (${f}). Expected (8..${m})`);let b=f.toLowerCase();if(f!==b&&f!==f.toUpperCase())throw Error("String must be lowercase or uppercase");let y=b.lastIndexOf("1");if(y===0||y===-1)throw Error('Letter "1" must be present between prefix and data only');let S=b.slice(0,y),x=b.slice(y+1);if(x.length<6)throw Error("Data must be at least 6 characters long");let _=Fb.decode(x).slice(0,-6),A=_O(S,_,t);if(!x.endsWith(A))throw Error(`Invalid checksum in ${f}: expected "${A}"`);return{prefix:S,words:_}}let c=wO(a);function u(f){let{prefix:m,words:h}=a(f,!1);return{prefix:m,words:h,bytes:o(h)}}function d(f,m){return s(f,n(m))}return{encode:s,decode:a,encodeFromBytes:d,decodeToBytes:u,decodeUnsafe:c,fromWords:o,fromWordsUnsafe:i,toWords:n}}var AO=(e,t)=>t===0?e:AO(t,e%t),mp=(e,t)=>e+(t-AO(e,t)),dp,vge,wge,xge,_ge,Ege,kge,TO,DK,RO=(e,t)=>{Xo("base64",e);let r=t?"base64url":"base64";if(e.length>0&&DK.test(e))throw Error("invalid base64");return Uint8Array.fromBase64(e,{alphabet:r,lastChunkHandling:"strict"})},Hb,Yt,Ige,Age,Vb=(e)=>Or(NK(58),Cr(e),Pr("")),Tge,Rge,$ge,Fb,xO,zr,Oge,LK,BK,Cge;var Wl=v(()=>{/*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) */dp=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();vge=Object.freeze(Or(Kr(4),Cr("0123456789ABCDEF"),Pr(""))),wge=Object.freeze(Or(Kr(5),Cr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),gp(5),Pr(""))),xge=Object.freeze(Or(Kr(5),Cr("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),Pr(""))),_ge=Object.freeze(Or(Kr(5),Cr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),gp(5),Pr(""))),Ege=Object.freeze(Or(Kr(5),Cr("0123456789ABCDEFGHIJKLMNOPQRSTUV"),Pr(""))),kge=Object.freeze(Or(Kr(5),Cr("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),Pr(""),IO((e)=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")))),TO=(()=>typeof Uint8Array.from([]).toBase64==="function"&&typeof Uint8Array.fromBase64==="function")(),DK=/[\t\n\f\r ]/,Hb=Object.freeze(TO?{encode(e){return Kb(e),e.toBase64()},decode(e){return RO(e,!1)}}:Or(Kr(6),Cr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),gp(6),Pr(""))),Yt=Object.freeze(Or(Kr(6),Cr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),Pr(""))),Ige=Object.freeze(TO?{encode(e){return Kb(e),e.toBase64({alphabet:"base64url"})},decode(e){return RO(e,!0)}}:Or(Kr(6),Cr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),gp(6),Pr(""))),Age=Object.freeze(Or(Kr(6),Cr("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),Pr(""))),Tge=Object.freeze(Vb("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),Rge=Object.freeze(Vb("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ")),$ge=Object.freeze(Vb("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz")),Fb=Or(Cr("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),Pr("")),xO=[996825010,642813549,513874426,1027748829,705979059];zr=Object.freeze($O("bech32")),Oge=Object.freeze($O("bech32m")),LK=(()=>typeof Uint8Array.from([]).toHex==="function"&&typeof Uint8Array.fromHex==="function")(),BK={encode(e){return Kb(e),e.toHex()},decode(e){return Xo("hex",e),Uint8Array.fromHex(e)}},Cge=Object.freeze(LK?BK:Or(Kr(4),Cr("0123456789abcdef"),Pr(""),IO((e)=>{if(typeof e!=="string"||e.length%2!==0)throw TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()})))});function ZK(e,t,r,o){ao(e);let n=ap({dkLen:32,asyncTick:10},o),{c:i,dkLen:s,asyncTick:a}=n;if(St(i,"c"),St(s,"dkLen"),St(a,"asyncTick"),i<1)throw Error("iterations (c) must be >= 1");if(s<1)throw Error('"dkLen" must be >= 1');if(s>4294967295*e.outputLen)throw Error("derived key too long");let c=Pb(t,"password"),u=Pb(r,"salt"),d=new Uint8Array(s),f=Cn.create(e,c),m=f._cloneInto().update(u);return{c:i,dkLen:s,asyncTick:a,DK:d,PRF:f,PRFSalt:m}}function UK(e,t,r,o,n){if(e.destroy(),t.destroy(),o)o.destroy();return cr(n),r}function Wb(e,t,r,o){let{c:n,dkLen:i,DK:s,PRF:a,PRFSalt:c}=ZK(e,t,r,o),u,d=new Uint8Array(4),f=ka(d),m=new Uint8Array(a.outputLen);for(let h=1,b=0;b<i;h++,b+=a.outputLen){let y=s.subarray(b,b+a.outputLen);f.setInt32(0,h,!1),(u=c._cloneInto(u)).update(d).digestInto(m),y.set(m.subarray(0,y.length));for(let S=1;S<n;S++){a._cloneInto(u).update(m).digestInto(m);for(let x=0;x<y.length;x++)y[x]^=m[x]}}return UK(a,c,s,u,m)}var OO=v(()=>{ql();Fr()});function CO(e,t,r,o,n,i){let s=e[t++]^r[o++],a=e[t++]^r[o++],c=e[t++]^r[o++],u=e[t++]^r[o++],d=e[t++]^r[o++],f=e[t++]^r[o++],m=e[t++]^r[o++],h=e[t++]^r[o++],b=e[t++]^r[o++],y=e[t++]^r[o++],S=e[t++]^r[o++],x=e[t++]^r[o++],_=e[t++]^r[o++],A=e[t++]^r[o++],O=e[t++]^r[o++],L=e[t++]^r[o++],z=s,J=a,P=c,W=u,ee=d,j=f,R=m,B=h,k=b,T=y,I=S,q=x,N=_,H=A,G=O,re=L;for(let ae=0;ae<8;ae+=2)ee^=Fe(z+N|0,7),k^=Fe(ee+z|0,9),N^=Fe(k+ee|0,13),z^=Fe(N+k|0,18),T^=Fe(j+J|0,7),H^=Fe(T+j|0,9),J^=Fe(H+T|0,13),j^=Fe(J+H|0,18),G^=Fe(I+R|0,7),P^=Fe(G+I|0,9),R^=Fe(P+G|0,13),I^=Fe(R+P|0,18),W^=Fe(re+q|0,7),B^=Fe(W+re|0,9),q^=Fe(B+W|0,13),re^=Fe(q+B|0,18),J^=Fe(z+W|0,7),P^=Fe(J+z|0,9),W^=Fe(P+J|0,13),z^=Fe(W+P|0,18),R^=Fe(j+ee|0,7),B^=Fe(R+j|0,9),ee^=Fe(B+R|0,13),j^=Fe(ee+B|0,18),q^=Fe(I+T|0,7),k^=Fe(q+I|0,9),T^=Fe(k+q|0,13),I^=Fe(T+k|0,18),N^=Fe(re+G|0,7),H^=Fe(N+re|0,9),G^=Fe(H+N|0,13),re^=Fe(G+H|0,18);n[i++]=s+z|0,n[i++]=a+J|0,n[i++]=c+P|0,n[i++]=u+W|0,n[i++]=d+ee|0,n[i++]=f+j|0,n[i++]=m+R|0,n[i++]=h+B|0,n[i++]=b+k|0,n[i++]=y+T|0,n[i++]=S+I|0,n[i++]=x+q|0,n[i++]=_+N|0,n[i++]=A+H|0,n[i++]=O+G|0,n[i++]=L+re|0}function Gb(e,t,r,o,n){let i=o+0,s=o+16*n;for(let a=0;a<16;a++)r[s+a]=e[t+(2*n-1)*16+a];for(let a=0;a<n;a++,i+=16,t+=16){if(CO(r,s,e,t,r,i),a>0)s+=16;CO(r,i,e,t+=16,r,s)}}function MK(e,t,r){let o=ap({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:n,r:i,p:s,dkLen:a,asyncTick:c,maxmem:u,onProgress:d}=o;if(St(n,"N"),St(i,"r"),St(s,"p"),St(a,"dkLen"),St(c,"asyncTick"),St(u,"maxmem"),d!==void 0&&typeof d!=="function")throw Error("progressCb must be a function");let f=128*i,m=f/4,h=Math.pow(2,32);if(n<=1||(n&n-1)!==0||n>h)throw Error('"N" expected a power of 2, and 2^1 <= N <= 2^32');if(s<1||s>(h-1)*32/f)throw Error('"p" expected integer 1..((2^32 - 1) * 32) / (128 * r)');if(a<1||a>(h-1)*32)throw Error('"dkLen" expected integer 1..(2^32 - 1) * 32');let b=f*(n+s+1);if(b>u)throw Error('"maxmem" limit was hit: memUsed(128*r*(N+p+1))='+b+", maxmem="+u);let y=Wb(vt,e,t,{c:1,dkLen:f*s}),S=ip(y),x=ip(new Uint8Array(f*n)),_=ip(new Uint8Array(f)),A=()=>{};if(d){let O=2*n*s,L=Math.max(Math.floor(O/1e4),1),z=0;A=()=>{if(z++,d&&(!(z%L)||z===O))d(z/O)}}return{N:n,r:i,p:s,dkLen:a,blockSize32:m,V:x,B32:S,B:y,tmp:_,blockMixCb:A,asyncTick:c}}function qK(e,t,r,o,n){let i=Wb(vt,e,r,{c:1,dkLen:t});return cr(r,o,n),i}function Qb(e,t,r){let{N:o,r:n,p:i,dkLen:s,blockSize32:a,V:c,B32:u,B:d,tmp:f,blockMixCb:m}=MK(e,t,r);Cb(u);for(let h=0;h<i;h++){let b=a*h;for(let y=0;y<a;y++)c[y]=u[b+y];for(let y=0,S=0;y<o-1;y++)Gb(c,S,c,S+=a,n),m();Gb(c,(o-1)*a,u,b,n),m();for(let y=0;y<o;y++){let S=(u[b+a-16]&o-1)>>>0;for(let x=0;x<a;x++)f[x]=u[b+x]^c[S*a+x];Gb(f,0,u,b,n),m()}}return Cb(u),qK(e,s,d,c,f)}var PO=v(()=>{OO();Ia();Fr()});function FK(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function yp(e){if(typeof e!=="boolean")throw TypeError(`boolean expected, not ${e}`)}function Aa(e){if(typeof e!=="number")throw TypeError("number expected, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw RangeError("positive integer expected, got "+e)}function Rt(e,t,r=""){let o=FK(e),n=e?.length,i=t!==void 0;if(!o||i&&n!==t){let s=r&&`"${r}" `,a=i?` of length ${t}`:"",c=o?`length=${n}`:`type=${typeof e}`,u=s+"expected Uint8Array"+a+", got "+c;if(!o)throw TypeError(u);throw RangeError(u)}return e}function Yb(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function zO(e,t,r=!1){Rt(e,void 0,"output");let o=t.outputLen;if(e.length<o)throw RangeError("digestInto() expects output buffer of length at least "+o);if(r&&!Ta(e))throw Error("invalid output, must be aligned")}function zn(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function ln(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function KK(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function NO(e,t){if(t==null||typeof t!=="object")throw Error("options must be defined");return Object.assign(e,t)}function DO(e,t){if(e.length!==t.length)return!1;let r=0;for(let o=0;o<e.length;o++)r|=e[o]^t[o];return r===0}function LO(e,t,r){let o=t,n=r||(()=>[]),i=(a,c)=>o(c,...n(a)).update(a).digest(),s=o(new Uint8Array(e),...n(new Uint8Array(0)));return i.outputLen=s.outputLen,i.blockLen=s.blockLen,i.create=(a,...c)=>o(a,...c),i}function Gl(e,t,r=!0){if(t===void 0)return new Uint8Array(e);if(Rt(t,void 0,"output"),t.length!==e)throw Error('"output" expected Uint8Array of length '+e+", got: "+t.length);if(r&&!Ta(t))throw Error("invalid output, must be aligned");return t}function jO(e,t,r){Aa(e),Aa(t),yp(r);let o=new Uint8Array(16),n=KK(o);return n.setBigUint64(0,BigInt(t),r),n.setBigUint64(8,BigInt(e),r),o}function Ta(e){return e.byteOffset%4===0}function Ra(e){return Uint8Array.from(Rt(e))}var ms,JK=(e)=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,HK=(e)=>{for(let t=0;t<e.length;t++)e[t]=JK(e[t]);return e},uo,BO=(e,t)=>{function r(o,...n){if(Rt(o,void 0,"key"),e.nonceLength!==void 0){let d=n[0];Rt(d,e.varSizeNonce?void 0:e.nonceLength,"nonce")}let i=e.tagLength;if(i&&n[1]!==void 0)Rt(n[1],void 0,"AAD");let s=t(o,...n),a=(d,f)=>{if(f!==void 0){if(d!==2)throw Error("cipher output not supported");Rt(f,void 0,"output")}},c=!1;return{encrypt(d,f){if(c)throw Error("cannot encrypt() twice with same key + nonce");return c=!0,Rt(d),a(s.encrypt.length,f),s.encrypt(d,f)},decrypt(d,f){if(Rt(d),i&&d.length<i)throw Error('"ciphertext" expected length bigger than tagLength='+i);return a(s.decrypt.length,f),s.decrypt(d,f)}}}return Object.assign(r,e),r};var bp=v(()=>{/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */ms=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)(),uo=ms?(e)=>e:HK});function Ke(e,t){return e<<t|e>>>32-t}function QK(e,t,r,o,n,i,s,a){let c=n.length,u=new Uint8Array(Ql),d=zn(u),f=ms&&Ta(n)&&Ta(i),m=f?zn(n):ZO,h=f?zn(i):ZO;if(!ms){for(let b=0;b<c;s++){if(e(t,r,o,d,s,a),uo(d),s>=Xb)throw Error("arx: counter overflow");let y=Math.min(Ql,c-b);for(let S=0,x;S<y;S++)x=b+S,i[x]=n[x]^u[S];b+=y}return}for(let b=0;b<c;s++){if(e(t,r,o,d,s,a),s>=Xb)throw Error("arx: counter overflow");let y=Math.min(Ql,c-b);if(f&&y===Ql){let S=b/4;if(b%4!==0)throw Error("arx: invalid block position");for(let x=0,_;x<GK;x++)_=S+x,h[_]=m[_]^d[x];b+=Ql;continue}for(let S=0,x;S<y;S++)x=b+S,i[x]=n[x]^u[S];b+=y}}function MO(e,t){let{allowShortKeys:r,extendNonceFn:o,counterLength:n,counterRight:i,rounds:s}=NO({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if(typeof e!=="function")throw Error("core must be a function");return Aa(n),Aa(s),yp(i),yp(r),(a,c,u,d,f=0)=>{Rt(a,void 0,"key"),Rt(c,void 0,"nonce"),Rt(u,void 0,"data");let m=u.length;if(d=Gl(m,d,!1),Aa(f),f<0||f>=Xb)throw Error("arx: counter overflow");let h=[],b=a.length,y,S;if(b===32)h.push(y=Ra(a)),S=WK;else if(b===16&&r)y=new Uint8Array(32),y.set(a),y.set(a,16),S=VK,h.push(y);else throw Rt(a,32,"arx key"),Error("invalid key size");if(!ms||!Ta(c))h.push(c=Ra(c));let x=zn(y);if(o){if(c.length!==24)throw Error("arx: extended nonce must be 24 bytes");let O=c.subarray(0,16);if(ms)o(S,x,zn(O),x);else{let L=uo(Uint32Array.from(S));o(L,x,zn(O),x),ln(L),uo(x)}c=c.subarray(16)}else if(!ms)uo(x);let _=16-n;if(_!==c.length)throw Error(`arx: nonce must be ${_} or 16 bytes`);if(_!==12){let O=new Uint8Array(12);O.set(c,i?0:12-c.length),c=O,h.push(c)}let A=uo(zn(c));try{return QK(e,S,x,A,u,d,f,s),d}finally{ln(...h)}}}var UO=(e)=>Uint8Array.from(e.split(""),(t)=>t.charCodeAt(0)),VK,WK,Ql=64,GK=16,Xb,ZO;var qO=v(()=>{bp();VK=(()=>uo(zn(UO("expand 16-byte k"))))(),WK=(()=>uo(zn(UO("expand 32-byte k"))))();Xb=(()=>4294967295)(),ZO=Uint32Array.of()});function Ft(e,t){return e[t++]&255|(e[t++]&255)<<8}class FO{blockLen=16;outputLen=16;buffer=new Uint8Array(16);r=new Uint16Array(10);h=new Uint16Array(10);pad=new Uint16Array(8);pos=0;finished=!1;destroyed=!1;constructor(e){e=Ra(Rt(e,32,"key"));let t=Ft(e,0),r=Ft(e,2),o=Ft(e,4),n=Ft(e,6),i=Ft(e,8),s=Ft(e,10),a=Ft(e,12),c=Ft(e,14);this.r[0]=t&8191,this.r[1]=(t>>>13|r<<3)&8191,this.r[2]=(r>>>10|o<<6)&7939,this.r[3]=(o>>>7|n<<9)&8191,this.r[4]=(n>>>4|i<<12)&255,this.r[5]=i>>>1&8190,this.r[6]=(i>>>14|s<<2)&8191,this.r[7]=(s>>>11|a<<5)&8065,this.r[8]=(a>>>8|c<<8)&8191,this.r[9]=c>>>5&127;for(let u=0;u<8;u++)this.pad[u]=Ft(e,16+2*u)}process(e,t,r=!1){let o=r?0:2048,{h:n,r:i}=this,s=i[0],a=i[1],c=i[2],u=i[3],d=i[4],f=i[5],m=i[6],h=i[7],b=i[8],y=i[9],S=Ft(e,t+0),x=Ft(e,t+2),_=Ft(e,t+4),A=Ft(e,t+6),O=Ft(e,t+8),L=Ft(e,t+10),z=Ft(e,t+12),J=Ft(e,t+14),P=n[0]+(S&8191),W=n[1]+((S>>>13|x<<3)&8191),ee=n[2]+((x>>>10|_<<6)&8191),j=n[3]+((_>>>7|A<<9)&8191),R=n[4]+((A>>>4|O<<12)&8191),B=n[5]+(O>>>1&8191),k=n[6]+((O>>>14|L<<2)&8191),T=n[7]+((L>>>11|z<<5)&8191),I=n[8]+((z>>>8|J<<8)&8191),q=n[9]+(J>>>5|o),N=0,H=N+P*s+W*(5*y)+ee*(5*b)+j*(5*h)+R*(5*m);N=H>>>13,H&=8191,H+=B*(5*f)+k*(5*d)+T*(5*u)+I*(5*c)+q*(5*a),N+=H>>>13,H&=8191;let G=N+P*a+W*s+ee*(5*y)+j*(5*b)+R*(5*h);N=G>>>13,G&=8191,G+=B*(5*m)+k*(5*f)+T*(5*d)+I*(5*u)+q*(5*c),N+=G>>>13,G&=8191;let re=N+P*c+W*a+ee*s+j*(5*y)+R*(5*b);N=re>>>13,re&=8191,re+=B*(5*h)+k*(5*m)+T*(5*f)+I*(5*d)+q*(5*u),N+=re>>>13,re&=8191;let ae=N+P*u+W*c+ee*a+j*s+R*(5*y);N=ae>>>13,ae&=8191,ae+=B*(5*b)+k*(5*h)+T*(5*m)+I*(5*f)+q*(5*d),N+=ae>>>13,ae&=8191;let me=N+P*d+W*u+ee*c+j*a+R*s;N=me>>>13,me&=8191,me+=B*(5*y)+k*(5*b)+T*(5*h)+I*(5*m)+q*(5*f),N+=me>>>13,me&=8191;let be=N+P*f+W*d+ee*u+j*c+R*a;N=be>>>13,be&=8191,be+=B*s+k*(5*y)+T*(5*b)+I*(5*h)+q*(5*m),N+=be>>>13,be&=8191;let ve=N+P*m+W*f+ee*d+j*u+R*c;N=ve>>>13,ve&=8191,ve+=B*a+k*s+T*(5*y)+I*(5*b)+q*(5*h),N+=ve>>>13,ve&=8191;let Ae=N+P*h+W*m+ee*f+j*d+R*u;N=Ae>>>13,Ae&=8191,Ae+=B*c+k*a+T*s+I*(5*y)+q*(5*b),N+=Ae>>>13,Ae&=8191;let Ie=N+P*b+W*h+ee*m+j*f+R*d;N=Ie>>>13,Ie&=8191,Ie+=B*u+k*c+T*a+I*s+q*(5*y),N+=Ie>>>13,Ie&=8191;let we=N+P*y+W*b+ee*h+j*m+R*f;N=we>>>13,we&=8191,we+=B*d+k*u+T*c+I*a+q*s,N+=we>>>13,we&=8191,N=(N<<2)+N|0,N=N+H|0,H=N&8191,N=N>>>13,G+=N,n[0]=H,n[1]=G,n[2]=re,n[3]=ae,n[4]=me,n[5]=be,n[6]=ve,n[7]=Ae,n[8]=Ie,n[9]=we}finalize(){let{h:e,pad:t}=this,r=new Uint16Array(10),o=e[1]>>>13;e[1]&=8191;for(let s=2;s<10;s++)e[s]+=o,o=e[s]>>>13,e[s]&=8191;e[0]+=o*5,o=e[0]>>>13,e[0]&=8191,e[1]+=o,o=e[1]>>>13,e[1]&=8191,e[2]+=o,r[0]=e[0]+5,o=r[0]>>>13,r[0]&=8191;for(let s=1;s<10;s++)r[s]=e[s]+o,o=r[s]>>>13,r[s]&=8191;r[9]-=8192;let n=(o^1)-1;for(let s=0;s<10;s++)r[s]&=n;n=~n;for(let s=0;s<10;s++)e[s]=e[s]&n|r[s];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let i=e[0]+t[0];e[0]=i&65535;for(let s=1;s<8;s++)i=(e[s]+t[s]|0)+(i>>>16)|0,e[s]=i&65535;ln(r)}update(e){Yb(this),Rt(e),e=Ra(e);let{buffer:t,blockLen:r}=this,o=e.length;for(let n=0;n<o;){let i=Math.min(r-this.pos,o-n);if(i===r){for(;r<=o-n;n+=r)this.process(e,n);continue}if(t.set(e.subarray(n,n+i),this.pos),this.pos+=i,n+=i,this.pos===r)this.process(t,0,!1),this.pos=0}return this}destroy(){this.destroyed=!0,ln(this.h,this.r,this.buffer,this.pad)}digestInto(e){Yb(this),zO(e,this),this.finished=!0;let{buffer:t,h:r}=this,{pos:o}=this;if(o){t[o++]=1;for(;o<16;o++)t[o]=0;this.process(t,0,!0)}this.finalize();let n=0;for(let i=0;i<8;i++)e[n++]=r[i]>>>0,e[n++]=r[i]>>>8}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}}var KO;var JO=v(()=>{bp();KO=LO(32,(e)=>new FO(e))});function YK(e,t,r,o,n,i=20){let s=e[0],a=e[1],c=e[2],u=e[3],d=t[0],f=t[1],m=t[2],h=t[3],b=t[4],y=t[5],S=t[6],x=t[7],_=n,A=r[0],O=r[1],L=r[2],z=s,J=a,P=c,W=u,ee=d,j=f,R=m,B=h,k=b,T=y,I=S,q=x,N=_,H=A,G=O,re=L;for(let me=0;me<i;me+=2)z=z+ee|0,N=Ke(N^z,16),k=k+N|0,ee=Ke(ee^k,12),z=z+ee|0,N=Ke(N^z,8),k=k+N|0,ee=Ke(ee^k,7),J=J+j|0,H=Ke(H^J,16),T=T+H|0,j=Ke(j^T,12),J=J+j|0,H=Ke(H^J,8),T=T+H|0,j=Ke(j^T,7),P=P+R|0,G=Ke(G^P,16),I=I+G|0,R=Ke(R^I,12),P=P+R|0,G=Ke(G^P,8),I=I+G|0,R=Ke(R^I,7),W=W+B|0,re=Ke(re^W,16),q=q+re|0,B=Ke(B^q,12),W=W+B|0,re=Ke(re^W,8),q=q+re|0,B=Ke(B^q,7),z=z+j|0,re=Ke(re^z,16),I=I+re|0,j=Ke(j^I,12),z=z+j|0,re=Ke(re^z,8),I=I+re|0,j=Ke(j^I,7),J=J+R|0,N=Ke(N^J,16),q=q+N|0,R=Ke(R^q,12),J=J+R|0,N=Ke(N^J,8),q=q+N|0,R=Ke(R^q,7),P=P+B|0,H=Ke(H^P,16),k=k+H|0,B=Ke(B^k,12),P=P+B|0,H=Ke(H^P,8),k=k+H|0,B=Ke(B^k,7),W=W+ee|0,G=Ke(G^W,16),T=T+G|0,ee=Ke(ee^T,12),W=W+ee|0,G=Ke(G^W,8),T=T+G|0,ee=Ke(ee^T,7);let ae=0;o[ae++]=s+z|0,o[ae++]=a+J|0,o[ae++]=c+P|0,o[ae++]=u+W|0,o[ae++]=d+ee|0,o[ae++]=f+j|0,o[ae++]=m+R|0,o[ae++]=h+B|0,o[ae++]=b+k|0,o[ae++]=y+T|0,o[ae++]=S+I|0,o[ae++]=x+q|0,o[ae++]=_+N|0,o[ae++]=A+H|0,o[ae++]=O+G|0,o[ae++]=L+re|0}function VO(e,t,r,o,n){if(n!==void 0)Rt(n,void 0,"AAD");let i=e(t,r,tJ),s=jO(o.length,n?n.length:0,!0),a=KO.create(i);if(n)HO(a,n);HO(a,o),a.update(s);let c=a.digest();return ln(i,s),c}var XK,eJ,HO=(e,t)=>{e.update(t);let r=t.length%16;if(r)e.update(eJ.subarray(r))},tJ,rJ=(e)=>(t,r,o)=>({encrypt(i,s){let a=i.length;s=Gl(a+16,s,!1),s.set(i);let c=s.subarray(0,-16);e(t,r,c,c,1);let u=VO(e,t,r,c,o);return s.set(u,a),ln(u),s},decrypt(i,s){s=Gl(i.length-16,s,!1);let a=i.subarray(0,-16),c=i.subarray(-16),u=VO(e,t,r,a,o);if(!DO(c,u))throw ln(u),Error("invalid tag");return s.set(i.subarray(0,-16)),e(t,r,s,s,1),ln(u),s}}),Jr;var eS=v(()=>{qO();JO();bp();XK=MO(YK,{counterRight:!1,counterLength:4,allowShortKeys:!1}),eJ=new Uint8Array(16),tJ=new Uint8Array(32);Jr=BO({blockSize:64,nonceLength:12,tagLength:16},rJ(XK))});function $a(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function Bt(e,t=""){if(!Number.isSafeInteger(e)||e<0){let r=t&&`"${t}" `;throw Error(`${r}expected integer >= 0, got ${e}`)}}function Te(e,t,r=""){let o=$a(e),n=e?.length,i=t!==void 0;if(!o||i&&n!==t){let s=r&&`"${r}" `,a=i?` of length ${t}`:"",c=o?`length=${n}`:`type=${typeof e}`;throw Error(s+"expected Uint8Array"+a+", got "+c)}return e}function Hr(e){if(typeof e!=="function"||typeof e.create!=="function")throw Error("Hash must wrapped by utils.createHasher");Bt(e.outputLen),Bt(e.blockLen)}function po(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function Sp(e,t){Te(e,void 0,"digestInto() output");let r=t.outputLen;if(e.length<r)throw Error('"digestInto() output" expected to be of length >='+r)}function vp(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function wr(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function wp(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function un(e,t){return e<<32-t|e>>>t}function oJ(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function iJ(e){for(let t=0;t<e.length;t++)e[t]=oJ(e[t]);return e}function hs(e){if(Te(e),GO)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=sJ[e[r]];return t}function WO(e){if(e>=fo._0&&e<=fo._9)return e-fo._0;if(e>=fo.A&&e<=fo.F)return e-(fo.A-10);if(e>=fo.a&&e<=fo.f)return e-(fo.a-10);return}function gs(e){if(typeof e!=="string")throw Error("hex string expected, got "+typeof e);if(GO)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let o=new Uint8Array(r);for(let n=0,i=0;n<r;n++,i+=2){let s=WO(e.charCodeAt(i)),a=WO(e.charCodeAt(i+1));if(s===void 0||a===void 0){let c=e[i]+e[i+1];throw Error('hex string expected, got non-hex character "'+c+'" at index '+i)}o[n]=s*16+a}return o}function Et(...e){let t=0;for(let o=0;o<e.length;o++){let n=e[o];Te(n),t+=n.length}let r=new Uint8Array(t);for(let o=0,n=0;o<e.length;o++){let i=e[o];r.set(i,n),n+=i.length}return r}function Oa(e,t={}){let r=(n,i)=>e(i).update(n).digest(),o=e(void 0);return r.outputLen=o.outputLen,r.blockLen=o.blockLen,r.create=(n)=>e(n),Object.assign(r,t),Object.freeze(r)}function ei(e=32){let t=typeof globalThis==="object"?globalThis.crypto:null;if(typeof t?.getRandomValues!=="function")throw Error("crypto.getRandomValues must be defined");return t.getRandomValues(new Uint8Array(e))}var nJ,tS,GO,sJ,fo,ti=(e)=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});var Nr=v(()=>{/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */nJ=(()=>new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68)();tS=nJ?(e)=>e:iJ,GO=(()=>typeof Uint8Array.from([]).toHex==="function"&&typeof Uint8Array.fromHex==="function")(),sJ=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));fo={_0:48,_9:57,A:65,F:70,a:97,f:102}});function Yl(e,t=""){if(typeof e!=="boolean"){let r=t&&`"${t}" `;throw Error(r+"expected boolean, got type="+typeof e)}return e}function QO(e){if(typeof e==="bigint"){if(!xp(e))throw Error("positive bigint expected, got "+e)}else Bt(e);return e}function Xl(e){let t=QO(e).toString(16);return t.length&1?"0"+t:t}function YO(e){if(typeof e!=="string")throw Error("hex string expected, got "+typeof e);return e===""?nS:BigInt("0x"+e)}function ri(e){return YO(hs(e))}function ni(e){return YO(hs(_p(Te(e)).reverse()))}function Ca(e,t){Bt(t),e=QO(e);let r=gs(e.toString(16).padStart(t*2,"0"));if(r.length!==t)throw Error("number too large");return r}function eu(e,t){return Ca(e,t).reverse()}function _p(e){return Uint8Array.from(e)}function oi(e){return Uint8Array.from(e,(t,r)=>{let o=t.charCodeAt(0);if(t.length!==1||o>127)throw Error(`string contains non-ASCII character "${e[r]}" with code ${o} at position ${r}`);return o})}function aJ(e,t,r){return xp(e)&&xp(t)&&xp(r)&&t<=e&&e<r}function tu(e,t,r,o){if(!aJ(t,r,o))throw Error("expected valid "+e+": "+r+" <= n < "+o+", got "+t)}function oS(e){let t;for(t=0;e>nS;e>>=rS,t+=1);return t}function XO(e,t,r){if(Bt(e,"hashLen"),Bt(t,"qByteLen"),typeof r!=="function")throw Error("hmacFn must be a function");let o=(S)=>new Uint8Array(S),n=Uint8Array.of(),i=Uint8Array.of(0),s=Uint8Array.of(1),a=1000,c=o(e),u=o(e),d=0,f=()=>{c.fill(1),u.fill(0),d=0},m=(...S)=>r(u,Et(c,...S)),h=(S=n)=>{if(u=m(i,S),c=m(),S.length===0)return;u=m(s,S),c=m()},b=()=>{if(d++>=a)throw Error("drbg: tried max amount of iterations");let S=0,x=[];while(S<t){c=m();let _=c.slice();x.push(_),S+=c.length}return Et(...x)};return(S,x)=>{f(),h(S);let _=void 0;while(!(_=x(b())))h();return f(),_}}function ys(e,t={},r={}){if(!e||typeof e!=="object")throw Error("expected valid options object");function o(i,s,a){let c=e[i];if(a&&c===void 0)return;let u=typeof c;if(u!==s||c===null)throw Error(`param "${i}" is invalid: expected ${s}, got ${u}`)}let n=(i,s)=>Object.entries(i).forEach(([a,c])=>o(a,c,s));n(t,!1),n(r,!0)}function iS(e){let t=new WeakMap;return(r,...o)=>{let n=t.get(r);if(n!==void 0)return n;let i=e(r,...o);return t.set(r,i),i}}var nS,rS,xp=(e)=>typeof e==="bigint"&&nS<=e,ru=(e)=>(rS<<BigInt(e))-rS;var Pa=v(()=>{Nr();Nr();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */nS=BigInt(0),rS=BigInt(1)});function lr(e,t){let r=e%t;return r>=ur?r:t+r}function Vr(e,t,r){let o=e;while(t-- >ur)o*=o,o%=r;return o}function eC(e,t){if(e===ur)throw Error("invert: expected non-zero number");if(t<=ur)throw Error("invert: expected positive modulus, got "+t);let r=lr(e,t),o=t,n=ur,i=Xt,s=Xt,a=ur;while(r!==ur){let u=o/r,d=o%r,f=n-s*u,m=i-a*u;o=r,r=d,n=s,i=a,s=f,a=m}if(o!==Xt)throw Error("invert: does not exist");return lr(n,t)}function sS(e,t,r){if(!e.eql(e.sqr(t),r))throw Error("Cannot find square root")}function aC(e,t){let r=(e.ORDER+Xt)/nC,o=e.pow(t,r);return sS(e,o,t),o}function uJ(e,t){let r=(e.ORDER-oC)/iC,o=e.mul(t,bs),n=e.pow(o,r),i=e.mul(t,n),s=e.mul(e.mul(i,bs),n),a=e.mul(i,e.sub(s,e.ONE));return sS(e,a,t),a}function dJ(e){let t=Ep(e),r=cC(e),o=r(t,t.neg(t.ONE)),n=r(t,o),i=r(t,t.neg(o)),s=(e+cJ)/sC;return(a,c)=>{let u=a.pow(c,s),d=a.mul(u,o),f=a.mul(u,n),m=a.mul(u,i),h=a.eql(a.sqr(d),c),b=a.eql(a.sqr(f),c);u=a.cmov(u,d,h),d=a.cmov(m,f,b);let y=a.eql(a.sqr(d),c),S=a.cmov(u,d,y);return sS(a,S,c),S}}function cC(e){if(e<rC)throw Error("sqrt is not defined for small field");let t=e-Xt,r=0;while(t%bs===ur)t/=bs,r++;let o=bs,n=Ep(e);while(tC(n,o)===1)if(o++>1000)throw Error("Cannot find square root: probably non-prime P");if(r===1)return aC;let i=n.pow(o,t),s=(t+Xt)/bs;return function(c,u){if(c.is0(u))return u;if(tC(c,u)!==1)throw Error("Cannot find square root");let d=r,f=c.mul(c.ONE,i),m=c.pow(u,t),h=c.pow(u,s);while(!c.eql(m,c.ONE)){if(c.is0(m))return c.ZERO;let b=1,y=c.sqr(m);while(!c.eql(y,c.ONE))if(b++,y=c.sqr(y),b===d)throw Error("Cannot find square root");let S=Xt<<BigInt(d-b-1),x=c.pow(f,S);d=b,f=c.sqr(x),m=c.mul(m,f),h=c.mul(h,x)}return h}}function fJ(e){if(e%nC===rC)return aC;if(e%iC===oC)return uJ;if(e%sC===lJ)return dJ(e);return cC(e)}function aS(e){let t={ORDER:"bigint",BYTES:"number",BITS:"number"},r=pJ.reduce((o,n)=>(o[n]="function",o),t);return ys(e,r),e}function mJ(e,t,r){if(r<ur)throw Error("invalid exponent, negatives unsupported");if(r===ur)return e.ONE;if(r===Xt)return t;let o=e.ONE,n=t;while(r>ur){if(r&Xt)o=e.mul(o,n);n=e.sqr(n),r>>=Xt}return o}function nu(e,t,r=!1){let o=Array(t.length).fill(r?e.ZERO:void 0),n=t.reduce((s,a,c)=>{if(e.is0(a))return s;return o[c]=s,e.mul(s,a)},e.ONE),i=e.inv(n);return t.reduceRight((s,a,c)=>{if(e.is0(a))return s;return o[c]=e.mul(s,o[c]),e.mul(s,a)},i),o}function tC(e,t){let r=(e.ORDER-Xt)/bs,o=e.pow(t,r),n=e.eql(o,e.ONE),i=e.eql(o,e.ZERO),s=e.eql(o,e.neg(e.ONE));if(!n&&!i&&!s)throw Error("invalid Legendre symbol result");return n?1:i?0:-1}function hJ(e,t){if(t!==void 0)Bt(t);let r=t!==void 0?t:e.toString(2).length,o=Math.ceil(r/8);return{nBitLength:r,nByteLength:o}}class lC{ORDER;BITS;BYTES;isLE;ZERO=ur;ONE=Xt;_lengths;_sqrt;_mod;constructor(e,t={}){if(e<=ur)throw Error("invalid field: expected ORDER > 0, got "+e);let r=void 0;if(this.isLE=!1,t!=null&&typeof t==="object"){if(typeof t.BITS==="number")r=t.BITS;if(typeof t.sqrt==="function")this.sqrt=t.sqrt;if(typeof t.isLE==="boolean")this.isLE=t.isLE;if(t.allowedLengths)this._lengths=t.allowedLengths?.slice();if(typeof t.modFromBytes==="boolean")this._mod=t.modFromBytes}let{nBitLength:o,nByteLength:n}=hJ(e,r);if(n>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=e,this.BITS=o,this.BYTES=n,this._sqrt=void 0,Object.preventExtensions(this)}create(e){return lr(e,this.ORDER)}isValid(e){if(typeof e!=="bigint")throw Error("invalid field element: expected bigint, got "+typeof e);return ur<=e&&e<this.ORDER}is0(e){return e===ur}isValidNot0(e){return!this.is0(e)&&this.isValid(e)}isOdd(e){return(e&Xt)===Xt}neg(e){return lr(-e,this.ORDER)}eql(e,t){return e===t}sqr(e){return lr(e*e,this.ORDER)}add(e,t){return lr(e+t,this.ORDER)}sub(e,t){return lr(e-t,this.ORDER)}mul(e,t){return lr(e*t,this.ORDER)}pow(e,t){return mJ(this,e,t)}div(e,t){return lr(e*eC(t,this.ORDER),this.ORDER)}sqrN(e){return e*e}addN(e,t){return e+t}subN(e,t){return e-t}mulN(e,t){return e*t}inv(e){return eC(e,this.ORDER)}sqrt(e){if(!this._sqrt)this._sqrt=fJ(this.ORDER);return this._sqrt(this,e)}toBytes(e){return this.isLE?eu(e,this.BYTES):Ca(e,this.BYTES)}fromBytes(e,t=!1){Te(e);let{_lengths:r,BYTES:o,isLE:n,ORDER:i,_mod:s}=this;if(r){if(!r.includes(e.length)||e.length>o)throw Error("Field.fromBytes: expected "+r+" bytes, got "+e.length);let c=new Uint8Array(o);c.set(e,n?0:c.length-e.length),e=c}if(e.length!==o)throw Error("Field.fromBytes: expected "+o+" bytes, got "+e.length);let a=n?ni(e):ri(e);if(s)a=lr(a,i);if(!t){if(!this.isValid(a))throw Error("invalid field element: outside of range 0..ORDER")}return a}invertBatch(e){return nu(this,e)}cmov(e,t,r){return r?t:e}}function Ep(e,t={}){return new lC(e,t)}function uC(e){if(typeof e!=="bigint")throw Error("field order must be bigint");let t=e.toString(2).length;return Math.ceil(t/8)}function cS(e){let t=uC(e);return t+Math.ceil(t/2)}function dC(e,t,r=!1){Te(e);let o=e.length,n=uC(t),i=cS(t);if(o<16||o<i||o>1024)throw Error("expected "+i+"-1024 bytes of input, got "+o);let s=r?ni(e):ri(e),a=lr(s,t-Xt)+Xt;return r?eu(a,n):Ca(a,n)}var ur,Xt,bs,rC,nC,oC,cJ,iC,lJ,sC,pJ;var ou=v(()=>{Pa();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */ur=BigInt(0),Xt=BigInt(1),bs=BigInt(2),rC=BigInt(3),nC=BigInt(4),oC=BigInt(5),cJ=BigInt(7),iC=BigInt(8),lJ=BigInt(9),sC=BigInt(16);pJ=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"]});function iu(e,t){let r=t.negate();return e?r:t}function fS(e,t){let r=nu(e.Fp,t.map((o)=>o.Z));return t.map((o,n)=>e.fromAffine(o.toAffine(r[n])))}function hC(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function lS(e,t){hC(e,t);let r=Math.ceil(t/e)+1,o=2**(e-1),n=2**e,i=ru(e),s=BigInt(e);return{windows:r,windowSize:o,mask:i,maxNumber:n,shiftBy:s}}function fC(e,t,r){let{windowSize:o,mask:n,maxNumber:i,shiftBy:s}=r,a=Number(e&n),c=e>>s;if(a>o)a-=i,c+=Ss;let u=t*o,d=u+Math.abs(a)-1,f=a===0,m=a<0,h=t%2!==0;return{nextN:c,offset:d,isZero:f,isNeg:m,isNegF:h,offsetF:u}}function dS(e){return gC.get(e)||1}function pC(e){if(e!==za)throw Error("invalid wNAF")}class pS{BASE;ZERO;Fn;bits;constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,r=this.ZERO){let o=e;while(t>za){if(t&Ss)r=r.add(o);o=o.double(),t>>=Ss}return r}precomputeWindow(e,t){let{windows:r,windowSize:o}=lS(t,this.bits),n=[],i=e,s=i;for(let a=0;a<r;a++){s=i,n.push(s);for(let c=1;c<o;c++)s=s.add(i),n.push(s);i=s.double()}return n}wNAF(e,t,r){if(!this.Fn.isValid(r))throw Error("invalid scalar");let o=this.ZERO,n=this.BASE,i=lS(e,this.bits);for(let s=0;s<i.windows;s++){let{nextN:a,offset:c,isZero:u,isNeg:d,isNegF:f,offsetF:m}=fC(r,s,i);if(r=a,u)n=n.add(iu(f,t[m]));else o=o.add(iu(d,t[c]))}return pC(r),{p:o,f:n}}wNAFUnsafe(e,t,r,o=this.ZERO){let n=lS(e,this.bits);for(let i=0;i<n.windows;i++){if(r===za)break;let{nextN:s,offset:a,isZero:c,isNeg:u}=fC(r,i,n);if(r=s,c)continue;else{let d=t[a];o=o.add(u?d.negate():d)}}return pC(r),o}getPrecomputes(e,t,r){let o=uS.get(t);if(!o){if(o=this.precomputeWindow(t,e),e!==1){if(typeof r==="function")o=r(o);uS.set(t,o)}}return o}cached(e,t,r){let o=dS(e);return this.wNAF(o,this.getPrecomputes(o,e,r),t)}unsafe(e,t,r,o){let n=dS(e);if(n===1)return this._unsafeLadder(e,t,o);return this.wNAFUnsafe(n,this.getPrecomputes(n,e,r),t,o)}createCache(e,t){hC(t,this.bits),gC.set(e,t),uS.delete(e)}hasCache(e){return dS(e)!==1}}function yC(e,t,r,o){let n=t,i=e.ZERO,s=e.ZERO;while(r>za||o>za){if(r&Ss)i=i.add(n);if(o&Ss)s=s.add(n);n=n.double(),r>>=Ss,o>>=Ss}return{p1:i,p2:s}}function mC(e,t,r){if(t){if(t.ORDER!==e)throw Error("Field.ORDER must match order: Fp == p, Fn == n");return aS(t),t}else return Ep(e,{isLE:r})}function bC(e,t,r={},o){if(o===void 0)o=e==="edwards";if(!t||typeof t!=="object")throw Error(`expected valid ${e} CURVE object`);for(let c of["p","n","h"]){let u=t[c];if(!(typeof u==="bigint"&&u>za))throw Error(`CURVE.${c} must be positive bigint`)}let n=mC(t.p,r.Fp,o),i=mC(t.n,r.Fn,o),a=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(let c of a)if(!n.isValid(t[c]))throw Error(`CURVE.${c} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:n,Fn:i}}function kp(e,t){return function(o){let n=e(o);return{secretKey:n,publicKey:t(n)}}}var za,Ss,uS,gC;var mS=v(()=>{Pa();ou();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */za=BigInt(0),Ss=BigInt(1);uS=new WeakMap,gC=new WeakMap});function gJ(e){return ys(e,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...e})}function SC(e){let t=gJ(e),{P:r,type:o,adjustScalarBytes:n,powPminus2:i,randomBytes:s}=t,a=o==="x25519";if(!a&&o!=="x448")throw Error("invalid type");let c=s||ei,u=a?255:448,d=a?32:56,f=a?BigInt(9):BigInt(5),m=a?BigInt(121665):BigInt(39081),h=a?Ip**BigInt(254):Ip**BigInt(447),b=a?BigInt(8)*Ip**BigInt(251)-Na:BigInt(4)*Ip**BigInt(445)-Na,y=h+b+Na,S=(k)=>lr(k,r),x=_(f);function _(k){return eu(S(k),d)}function A(k){let T=_p(Te(k,d,"uCoordinate"));if(a)T[31]&=127;return S(ni(T))}function O(k){return ni(n(_p(Te(k,d,"scalar"))))}function L(k,T){let I=ee(A(T),O(k));if(I===su)throw Error("invalid private or public key received");return _(I)}function z(k){return L(k,x)}let J=z,P=L;function W(k,T,I){let q=S(k*(T-I));return T=S(T-q),I=S(I+q),{x_2:T,x_3:I}}function ee(k,T){tu("u",k,su,r),tu("scalar",T,h,y);let I=T,q=k,N=Na,H=su,G=k,re=Na,ae=su;for(let be=BigInt(u-1);be>=su;be--){let ve=I>>be&Na;ae^=ve,{x_2:N,x_3:G}=W(ae,N,G),{x_2:H,x_3:re}=W(ae,H,re),ae=ve;let Ae=N+H,Ie=S(Ae*Ae),we=N-H,Ue=S(we*we),De=Ie-Ue,Qe=G+re,bt=G-re,Tt=S(bt*Ae),Dt=S(Qe*we),lt=Tt+Dt,$r=Tt-Dt;G=S(lt*lt),re=S(q*S($r*$r)),N=S(Ie*Ue),H=S(De*(Ie+S(m*De)))}({x_2:N,x_3:G}=W(ae,N,G)),{x_2:H,x_3:re}=W(ae,H,re);let me=i(H);return S(N*me)}let j={secretKey:d,publicKey:d,seed:d},R=(k=c(d))=>(Te(k,j.seed,"seed"),k),B={randomSecretKey:R};return Object.freeze({keygen:kp(R,J),getSharedSecret:P,getPublicKey:J,scalarMult:L,scalarMultBase:z,utils:B,GuBytes:x.slice(),lengths:j})}var su,Na,Ip;var vC=v(()=>{Pa();mS();ou();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */su=BigInt(0),Na=BigInt(1),Ip=BigInt(2)});class hS{oHash;iHash;blockLen;outputLen;finished=!1;destroyed=!1;constructor(e,t){if(Hr(e),Te(t,void 0,"key"),this.iHash=e.create(),typeof this.iHash.update!=="function")throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let r=this.blockLen,o=new Uint8Array(r);o.set(t.length>r?e.create().update(t).digest():t);for(let n=0;n<o.length;n++)o[n]^=54;this.iHash.update(o),this.oHash=e.create();for(let n=0;n<o.length;n++)o[n]^=106;this.oHash.update(o),wr(o)}update(e){return po(this),this.iHash.update(e),this}digestInto(e){po(this),Te(e,this.outputLen,"output"),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||=Object.create(Object.getPrototypeOf(this),{});let{oHash:t,iHash:r,finished:o,destroyed:n,blockLen:i,outputLen:s}=this;return e=e,e.finished=o,e.destroyed=n,e.blockLen=i,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}var Da=(e,t,r)=>new hS(e,t).update(r).digest();var gS=v(()=>{Nr();Da.create=(e,t)=>new hS(e,t)});function yJ(e,t,r){let[[o,n],[i,s]]=t,a=wC(s*e,r),c=wC(-n*e,r),u=e-a*o-c*i,d=-a*n-c*s,f=u<mo,m=d<mo;if(f)u=-u;if(m)d=-d;let h=ru(Math.ceil(oS(r)/2))+La;if(u<mo||u>=h||d<mo||d>=h)throw Error("splitScalar (endomorphism): failed, k="+e);return{k1neg:f,k1:u,k2neg:m,k2:d}}function bS(e){if(!["compact","recovered","der"].includes(e))throw Error('Signature format must be "compact", "recovered", or "der"');return e}function yS(e,t){let r={};for(let o of Object.keys(t))r[o]=e[o]===void 0?t[o]:e[o];if(Yl(r.lowS,"lowS"),Yl(r.prehash,"prehash"),r.format!==void 0)bS(r.format);return r}function SS(e,t={}){let r=bC("weierstrass",e,t),{Fp:o,Fn:n}=r,i=r.CURVE,{h:s,n:a}=i;ys(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object"});let{endo:c}=t;if(c){if(!o.is0(i.a)||typeof c.beta!=="bigint"||!Array.isArray(c.basises))throw Error('invalid endo: expected "beta": bigint and "basises": array')}let u=kC(o,n);function d(){if(!o.isOdd)throw Error("compression is not supported: Field does not have .isOdd()")}function f(R,B,k){let{x:T,y:I}=B.toAffine(),q=o.toBytes(T);if(Yl(k,"isCompressed"),k){d();let N=!o.isOdd(I);return Et(EC(N),q)}else return Et(Uint8Array.of(4),q,o.toBytes(I))}function m(R){Te(R,void 0,"Point");let{publicKey:B,publicKeyUncompressed:k}=u,T=R.length,I=R[0],q=R.subarray(1);if(T===B&&(I===2||I===3)){let N=o.fromBytes(q);if(!o.isValid(N))throw Error("bad point: is not on curve, wrong x");let H=y(N),G;try{G=o.sqrt(H)}catch(me){let be=me instanceof Error?": "+me.message:"";throw Error("bad point: is not on curve, sqrt error"+be)}d();let re=o.isOdd(G);if((I&1)===1!==re)G=o.neg(G);return{x:N,y:G}}else if(T===k&&I===4){let N=o.BYTES,H=o.fromBytes(q.subarray(0,N)),G=o.fromBytes(q.subarray(N,N*2));if(!S(H,G))throw Error("bad point: is not on curve");return{x:H,y:G}}else throw Error(`bad point: got length ${T}, expected compressed=${B} or uncompressed=${k}`)}let h=t.toBytes||f,b=t.fromBytes||m;function y(R){let B=o.sqr(R),k=o.mul(B,R);return o.add(o.add(k,o.mul(R,i.a)),i.b)}function S(R,B){let k=o.sqr(B),T=y(R);return o.eql(k,T)}if(!S(i.Gx,i.Gy))throw Error("bad curve params: generator point");let x=o.mul(o.pow(i.a,Ap),bJ),_=o.mul(o.sqr(i.b),BigInt(27));if(o.is0(o.add(x,_)))throw Error("bad curve params: a or b");function A(R,B,k=!1){if(!o.isValid(B)||k&&o.is0(B))throw Error(`bad point coordinate ${R}`);return B}function O(R){if(!(R instanceof W))throw Error("Weierstrass Point expected")}function L(R){if(!c||!c.basises)throw Error("no endo");return yJ(R,c.basises,n.ORDER)}let z=iS((R,B)=>{let{X:k,Y:T,Z:I}=R;if(o.eql(I,o.ONE))return{x:k,y:T};let q=R.is0();if(B==null)B=q?o.ONE:o.inv(I);let N=o.mul(k,B),H=o.mul(T,B),G=o.mul(I,B);if(q)return{x:o.ZERO,y:o.ZERO};if(!o.eql(G,o.ONE))throw Error("invZ was invalid");return{x:N,y:H}}),J=iS((R)=>{if(R.is0()){if(t.allowInfinityPoint&&!o.is0(R.Y))return;throw Error("bad point: ZERO")}let{x:B,y:k}=R.toAffine();if(!o.isValid(B)||!o.isValid(k))throw Error("bad point: x or y not field elements");if(!S(B,k))throw Error("bad point: equation left != right");if(!R.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});function P(R,B,k,T,I){return k=new W(o.mul(k.X,R),k.Y,k.Z),B=iu(T,B),k=iu(I,k),B.add(k)}class W{static BASE=new W(i.Gx,i.Gy,o.ONE);static ZERO=new W(o.ZERO,o.ONE,o.ZERO);static Fp=o;static Fn=n;X;Y;Z;constructor(R,B,k){this.X=A("x",R),this.Y=A("y",B,!0),this.Z=A("z",k),Object.freeze(this)}static CURVE(){return i}static fromAffine(R){let{x:B,y:k}=R||{};if(!R||!o.isValid(B)||!o.isValid(k))throw Error("invalid affine point");if(R instanceof W)throw Error("projective point not allowed");if(o.is0(B)&&o.is0(k))return W.ZERO;return new W(B,k,o.ONE)}static fromBytes(R){let B=W.fromAffine(b(Te(R,void 0,"point")));return B.assertValidity(),B}static fromHex(R){return W.fromBytes(gs(R))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(R=8,B=!0){if(j.createCache(this,R),!B)this.multiply(Ap);return this}assertValidity(){J(this)}hasEvenY(){let{y:R}=this.toAffine();if(!o.isOdd)throw Error("Field doesn't support isOdd");return!o.isOdd(R)}equals(R){O(R);let{X:B,Y:k,Z:T}=this,{X:I,Y:q,Z:N}=R,H=o.eql(o.mul(B,N),o.mul(I,T)),G=o.eql(o.mul(k,N),o.mul(q,T));return H&&G}negate(){return new W(this.X,o.neg(this.Y),this.Z)}double(){let{a:R,b:B}=i,k=o.mul(B,Ap),{X:T,Y:I,Z:q}=this,N=o.ZERO,H=o.ZERO,G=o.ZERO,re=o.mul(T,T),ae=o.mul(I,I),me=o.mul(q,q),be=o.mul(T,I);return be=o.add(be,be),G=o.mul(T,q),G=o.add(G,G),N=o.mul(R,G),H=o.mul(k,me),H=o.add(N,H),N=o.sub(ae,H),H=o.add(ae,H),H=o.mul(N,H),N=o.mul(be,N),G=o.mul(k,G),me=o.mul(R,me),be=o.sub(re,me),be=o.mul(R,be),be=o.add(be,G),G=o.add(re,re),re=o.add(G,re),re=o.add(re,me),re=o.mul(re,be),H=o.add(H,re),me=o.mul(I,q),me=o.add(me,me),re=o.mul(me,be),N=o.sub(N,re),G=o.mul(me,ae),G=o.add(G,G),G=o.add(G,G),new W(N,H,G)}add(R){O(R);let{X:B,Y:k,Z:T}=this,{X:I,Y:q,Z:N}=R,H=o.ZERO,G=o.ZERO,re=o.ZERO,ae=i.a,me=o.mul(i.b,Ap),be=o.mul(B,I),ve=o.mul(k,q),Ae=o.mul(T,N),Ie=o.add(B,k),we=o.add(I,q);Ie=o.mul(Ie,we),we=o.add(be,ve),Ie=o.sub(Ie,we),we=o.add(B,T);let Ue=o.add(I,N);return we=o.mul(we,Ue),Ue=o.add(be,Ae),we=o.sub(we,Ue),Ue=o.add(k,T),H=o.add(q,N),Ue=o.mul(Ue,H),H=o.add(ve,Ae),Ue=o.sub(Ue,H),re=o.mul(ae,we),H=o.mul(me,Ae),re=o.add(H,re),H=o.sub(ve,re),re=o.add(ve,re),G=o.mul(H,re),ve=o.add(be,be),ve=o.add(ve,be),Ae=o.mul(ae,Ae),we=o.mul(me,we),ve=o.add(ve,Ae),Ae=o.sub(be,Ae),Ae=o.mul(ae,Ae),we=o.add(we,Ae),be=o.mul(ve,we),G=o.add(G,be),be=o.mul(Ue,we),H=o.mul(Ie,H),H=o.sub(H,be),be=o.mul(Ie,ve),re=o.mul(Ue,re),re=o.add(re,be),new W(H,G,re)}subtract(R){return this.add(R.negate())}is0(){return this.equals(W.ZERO)}multiply(R){let{endo:B}=t;if(!n.isValidNot0(R))throw Error("invalid scalar: out of range");let k,T,I=(q)=>j.cached(this,q,(N)=>fS(W,N));if(B){let{k1neg:q,k1:N,k2neg:H,k2:G}=L(R),{p:re,f:ae}=I(N),{p:me,f:be}=I(G);T=ae.add(be),k=P(B.beta,re,me,q,H)}else{let{p:q,f:N}=I(R);k=q,T=N}return fS(W,[k,T])[0]}multiplyUnsafe(R){let{endo:B}=t,k=this;if(!n.isValid(R))throw Error("invalid scalar: out of range");if(R===mo||k.is0())return W.ZERO;if(R===La)return k;if(j.hasCache(this))return this.multiply(R);if(B){let{k1neg:T,k1:I,k2neg:q,k2:N}=L(R),{p1:H,p2:G}=yC(W,k,I,N);return P(B.beta,H,G,T,q)}else return j.unsafe(k,R)}toAffine(R){return z(this,R)}isTorsionFree(){let{isTorsionFree:R}=t;if(s===La)return!0;if(R)return R(W,this);return j.unsafe(this,a).is0()}clearCofactor(){let{clearCofactor:R}=t;if(s===La)return this;if(R)return R(W,this);return this.multiplyUnsafe(s)}isSmallOrder(){return this.multiplyUnsafe(s).is0()}toBytes(R=!0){return Yl(R,"isCompressed"),this.assertValidity(),h(W,this,R)}toHex(R=!0){return hs(this.toBytes(R))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}let ee=n.BITS,j=new pS(W,t.endo?Math.ceil(ee/2):ee);return W.BASE.precompute(8),W}function EC(e){return Uint8Array.of(e?2:3)}function kC(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function SJ(e,t={}){let{Fn:r}=e,o=t.randomBytes||ei,n=Object.assign(kC(e.Fp,r),{seed:cS(r.ORDER)});function i(h){try{let b=r.fromBytes(h);return r.isValidNot0(b)}catch(b){return!1}}function s(h,b){let{publicKey:y,publicKeyUncompressed:S}=n;try{let x=h.length;if(b===!0&&x!==y)return!1;if(b===!1&&x!==S)return!1;return!!e.fromBytes(h)}catch(x){return!1}}function a(h=o(n.seed)){return dC(Te(h,n.seed,"seed"),r.ORDER)}function c(h,b=!0){return e.BASE.multiply(r.fromBytes(h)).toBytes(b)}function u(h){let{secretKey:b,publicKey:y,publicKeyUncompressed:S}=n;if(!$a(h))return;if("_lengths"in r&&r._lengths||b===y)return;let x=Te(h,void 0,"key").length;return x===y||x===S}function d(h,b,y=!0){if(u(h)===!0)throw Error("first arg must be private key");if(u(b)===!1)throw Error("second arg must be public key");let S=r.fromBytes(h);return e.fromBytes(b).multiply(S).toBytes(y)}let f={isValidSecretKey:i,isValidPublicKey:s,randomSecretKey:a},m=kp(a,c);return Object.freeze({getPublicKey:c,getSharedSecret:d,keygen:m,Point:e,utils:f,lengths:n})}function vS(e,t,r={}){Hr(t),ys(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"}),r=Object.assign({},r);let o=r.randomBytes||ei,n=r.hmac||((k,T)=>Da(t,k,T)),{Fp:i,Fn:s}=e,{ORDER:a,BITS:c}=s,{keygen:u,getPublicKey:d,getSharedSecret:f,utils:m,lengths:h}=SJ(e,r),b={prehash:!0,lowS:typeof r.lowS==="boolean"?r.lowS:!0,format:"compact",extraEntropy:!1},y=a*_C<i.ORDER;function S(k){let T=a>>La;return k>T}function x(k,T){if(!s.isValidNot0(T))throw Error(`invalid signature ${k}: out of range 1..Point.Fn.ORDER`);return T}function _(){if(y)throw Error('"recovered" sig type is not supported for cofactor >2 curves')}function A(k,T){bS(T);let I=h.signature,q=T==="compact"?I:T==="recovered"?I+1:void 0;return Te(k,q)}class O{r;s;recovery;constructor(k,T,I){if(this.r=x("r",k),this.s=x("s",T),I!=null){if(_(),![0,1,2,3].includes(I))throw Error("invalid recovery id");this.recovery=I}Object.freeze(this)}static fromBytes(k,T=b.format){A(k,T);let I;if(T==="der"){let{r:G,s:re}=ii.toSig(Te(k));return new O(G,re)}if(T==="recovered")I=k[0],T="compact",k=k.subarray(1);let q=h.signature/2,N=k.subarray(0,q),H=k.subarray(q,q*2);return new O(s.fromBytes(N),s.fromBytes(H),I)}static fromHex(k,T){return this.fromBytes(gs(k),T)}assertRecovery(){let{recovery:k}=this;if(k==null)throw Error("invalid recovery id: must be present");return k}addRecoveryBit(k){return new O(this.r,this.s,k)}recoverPublicKey(k){let{r:T,s:I}=this,q=this.assertRecovery(),N=q===2||q===3?T+a:T;if(!i.isValid(N))throw Error("invalid recovery id: sig.r+curve.n != R.x");let H=i.toBytes(N),G=e.fromBytes(Et(EC((q&1)===0),H)),re=s.inv(N),ae=z(Te(k,void 0,"msgHash")),me=s.create(-ae*re),be=s.create(I*re),ve=e.BASE.multiplyUnsafe(me).add(G.multiplyUnsafe(be));if(ve.is0())throw Error("invalid recovery: point at infinify");return ve.assertValidity(),ve}hasHighS(){return S(this.s)}toBytes(k=b.format){if(bS(k),k==="der")return gs(ii.hexFromSig(this));let{r:T,s:I}=this,q=s.toBytes(T),N=s.toBytes(I);if(k==="recovered")return _(),Et(Uint8Array.of(this.assertRecovery()),q,N);return Et(q,N)}toHex(k){return hs(this.toBytes(k))}}let L=r.bits2int||function(T){if(T.length>8192)throw Error("input is too large");let I=ri(T),q=T.length*8-c;return q>0?I>>BigInt(q):I},z=r.bits2int_modN||function(T){return s.create(L(T))},J=ru(c);function P(k){return tu("num < 2^"+c,k,mo,J),s.toBytes(k)}function W(k,T){return Te(k,void 0,"message"),T?Te(t(k),void 0,"prehashed message"):k}function ee(k,T,I){let{lowS:q,prehash:N,extraEntropy:H}=yS(I,b);k=W(k,N);let G=z(k),re=s.fromBytes(T);if(!s.isValidNot0(re))throw Error("invalid private key");let ae=[P(re),P(G)];if(H!=null&&H!==!1){let Ae=H===!0?o(h.secretKey):H;ae.push(Te(Ae,void 0,"extraEntropy"))}let me=Et(...ae),be=G;function ve(Ae){let Ie=L(Ae);if(!s.isValidNot0(Ie))return;let we=s.inv(Ie),Ue=e.BASE.multiply(Ie).toAffine(),De=s.create(Ue.x);if(De===mo)return;let Qe=s.create(we*s.create(be+De*re));if(Qe===mo)return;let bt=(Ue.x===De?0:2)|Number(Ue.y&La),Tt=Qe;if(q&&S(Qe))Tt=s.neg(Qe),bt^=1;return new O(De,Tt,y?void 0:bt)}return{seed:me,k2sig:ve}}function j(k,T,I={}){let{seed:q,k2sig:N}=ee(k,T,I);return XO(t.outputLen,s.BYTES,n)(q,N).toBytes(I.format)}function R(k,T,I,q={}){let{lowS:N,prehash:H,format:G}=yS(q,b);if(I=Te(I,void 0,"publicKey"),T=W(T,H),!$a(k)){let re=k instanceof O?", use sig.toBytes()":"";throw Error("verify expects Uint8Array signature"+re)}A(k,G);try{let re=O.fromBytes(k,G),ae=e.fromBytes(I);if(N&&re.hasHighS())return!1;let{r:me,s:be}=re,ve=z(T),Ae=s.inv(be),Ie=s.create(ve*Ae),we=s.create(me*Ae),Ue=e.BASE.multiplyUnsafe(Ie).add(ae.multiplyUnsafe(we));if(Ue.is0())return!1;return s.create(Ue.x)===me}catch(re){return!1}}function B(k,T,I={}){let{prehash:q}=yS(I,b);return T=W(T,q),O.fromBytes(k,"recovered").recoverPublicKey(T).toBytes()}return Object.freeze({keygen:u,getPublicKey:d,getSharedSecret:f,utils:m,lengths:h,Point:e,sign:j,verify:R,recoverPublicKey:B,Signature:O,hash:t})}var wC=(e,t)=>(e+(e>=0?t:-t)/_C)/t,xC,ii,mo,La,_C,Ap,bJ;var IC=v(()=>{gS();Nr();Pa();mS();ou();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */xC=class xC extends Error{constructor(e=""){super(e)}};ii={Err:xC,_tlv:{encode:(e,t)=>{let{Err:r}=ii;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length&1)throw new r("tlv.encode: unpadded data");let o=t.length/2,n=Xl(o);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let i=o>127?Xl(n.length/2|128):"";return Xl(e)+i+n+t},decode(e,t){let{Err:r}=ii,o=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[o++]!==e)throw new r("tlv.decode: wrong tlv");let n=t[o++],i=!!(n&128),s=0;if(!i)s=n;else{let c=n&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");let u=t.subarray(o,o+c);if(u.length!==c)throw new r("tlv.decode: length bytes not complete");if(u[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let d of u)s=s<<8|d;if(o+=c,s<128)throw new r("tlv.decode(long): not minimal encoding")}let a=t.subarray(o,o+s);if(a.length!==s)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(o+s)}}},_int:{encode(e){let{Err:t}=ii;if(e<mo)throw new t("integer: negative integers are not allowed");let r=Xl(e);if(Number.parseInt(r[0],16)&8)r="00"+r;if(r.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=ii;if(e[0]&128)throw new t("invalid signature integer: negative");if(e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return ri(e)}},toSig(e){let{Err:t,_int:r,_tlv:o}=ii,n=Te(e,void 0,"signature"),{v:i,l:s}=o.decode(48,n);if(s.length)throw new t("invalid signature: left bytes after parsing");let{v:a,l:c}=o.decode(2,i),{v:u,l:d}=o.decode(2,c);if(d.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(u)}},hexFromSig(e){let{_tlv:t,_int:r}=ii,o=t.encode(2,r.encode(e.r)),n=t.encode(2,r.encode(e.s)),i=o+n;return t.encode(48,i)}},mo=BigInt(0),La=BigInt(1),_C=BigInt(2),Ap=BigInt(3),bJ=BigInt(4)});function AC(e,t,r){return e&t^~e&r}function TC(e,t,r){return e&t^e&r^t&r}class Tp{blockLen;outputLen;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(e,t,r,o){this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=o,this.buffer=new Uint8Array(e),this.view=wp(this.buffer)}update(e){po(this),Te(e);let{view:t,buffer:r,blockLen:o}=this,n=e.length;for(let i=0;i<n;){let s=Math.min(o-this.pos,n-i);if(s===o){let a=wp(e);for(;o<=n-i;i+=o)this.process(a,i);continue}if(r.set(e.subarray(i,i+s),this.pos),this.pos+=s,i+=s,this.pos===o)this.process(t,0),this.pos=0}return this.length+=e.length,this.roundClean(),this}digestInto(e){po(this),Sp(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:o,isLE:n}=this,{pos:i}=this;if(t[i++]=128,wr(this.buffer.subarray(i)),this.padOffset>o-i)this.process(r,0),i=0;for(let d=i;d<o;d++)t[d]=0;r.setBigUint64(o-8,BigInt(this.length*8),n),this.process(r,0);let s=wp(e),a=this.outputLen;if(a%4)throw Error("_sha2: outputLen must be aligned to 32bit");let c=a/4,u=this.get();if(c>u.length)throw Error("_sha2: outputLen bigger than state");for(let d=0;d<c;d++)s.setUint32(4*d,u[d],n)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||=new this.constructor,e.set(...this.get());let{blockLen:t,buffer:r,length:o,finished:n,destroyed:i,pos:s}=this;if(e.destroyed=i,e.finished=n,e.length=o,e.pos=s,o%t)e.buffer.set(r);return e}clone(){return this._cloneInto()}}var ho,Kt;var RC=v(()=>{Nr();ho=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Kt=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428])});function vJ(e,t=!1){if(t)return{h:Number(e&Rp),l:Number(e>>$C&Rp)};return{h:Number(e>>$C&Rp)|0,l:Number(e&Rp)|0}}function $p(e,t=!1){let r=e.length,o=new Uint32Array(r),n=new Uint32Array(r);for(let i=0;i<r;i++){let{h:s,l:a}=vJ(e[i],t);[o[i],n[i]]=[s,a]}return[o,n]}function Nn(e,t,r,o){let n=(t>>>0)+(o>>>0);return{h:e+r+(n/4294967296|0)|0,l:n|0}}var Rp,$C,wS=(e,t,r)=>e>>>r,xS=(e,t,r)=>e<<32-r|t>>>r,vs=(e,t,r)=>e>>>r|t<<32-r,ws=(e,t,r)=>e<<32-r|t>>>r,au=(e,t,r)=>e<<64-r|t>>>r-32,cu=(e,t,r)=>e>>>r-32|t<<64-r,OC=(e,t,r)=>e<<r|t>>>32-r,CC=(e,t,r)=>t<<r|e>>>32-r,PC=(e,t,r)=>t<<r-32|e>>>64-r,zC=(e,t,r)=>e<<r-32|t>>>64-r,NC=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),DC=(e,t,r,o)=>t+r+o+(e/4294967296|0)|0,LC=(e,t,r,o)=>(e>>>0)+(t>>>0)+(r>>>0)+(o>>>0),BC=(e,t,r,o,n)=>t+r+o+n+(e/4294967296|0)|0,jC=(e,t,r,o,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(o>>>0)+(n>>>0),ZC=(e,t,r,o,n,i)=>t+r+o+n+i+(e/4294967296|0)|0;var _S=v(()=>{Rp=BigInt(4294967295),$C=BigInt(32)});var xJ,si,UC,MC,qC,_J,EJ,ai,ci,FC,KC,Op,JC;var ES=v(()=>{RC();_S();Nr();xJ=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),si=new Uint32Array(64);UC=class UC extends Tp{constructor(e){super(64,e,8,!1)}get(){let{A:e,B:t,C:r,D:o,E:n,F:i,G:s,H:a}=this;return[e,t,r,o,n,i,s,a]}set(e,t,r,o,n,i,s,a){this.A=e|0,this.B=t|0,this.C=r|0,this.D=o|0,this.E=n|0,this.F=i|0,this.G=s|0,this.H=a|0}process(e,t){for(let d=0;d<16;d++,t+=4)si[d]=e.getUint32(t,!1);for(let d=16;d<64;d++){let f=si[d-15],m=si[d-2],h=un(f,7)^un(f,18)^f>>>3,b=un(m,17)^un(m,19)^m>>>10;si[d]=b+si[d-7]+h+si[d-16]|0}let{A:r,B:o,C:n,D:i,E:s,F:a,G:c,H:u}=this;for(let d=0;d<64;d++){let f=un(s,6)^un(s,11)^un(s,25),m=u+f+AC(s,a,c)+xJ[d]+si[d]|0,b=(un(r,2)^un(r,13)^un(r,22))+TC(r,o,n)|0;u=c,c=a,a=s,s=i+m|0,i=n,n=o,o=r,r=m+b|0}r=r+this.A|0,o=o+this.B|0,n=n+this.C|0,i=i+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,o,n,i,s,a,c,u)}roundClean(){wr(si)}destroy(){this.set(0,0,0,0,0,0,0,0),wr(this.buffer)}};MC=class MC extends UC{A=ho[0]|0;B=ho[1]|0;C=ho[2]|0;D=ho[3]|0;E=ho[4]|0;F=ho[5]|0;G=ho[6]|0;H=ho[7]|0;constructor(){super(32)}};qC=(()=>$p(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e)=>BigInt(e))))(),_J=(()=>qC[0])(),EJ=(()=>qC[1])(),ai=new Uint32Array(80),ci=new Uint32Array(80);FC=class FC extends Tp{constructor(e){super(128,e,16,!1)}get(){let{Ah:e,Al:t,Bh:r,Bl:o,Ch:n,Cl:i,Dh:s,Dl:a,Eh:c,El:u,Fh:d,Fl:f,Gh:m,Gl:h,Hh:b,Hl:y}=this;return[e,t,r,o,n,i,s,a,c,u,d,f,m,h,b,y]}set(e,t,r,o,n,i,s,a,c,u,d,f,m,h,b,y){this.Ah=e|0,this.Al=t|0,this.Bh=r|0,this.Bl=o|0,this.Ch=n|0,this.Cl=i|0,this.Dh=s|0,this.Dl=a|0,this.Eh=c|0,this.El=u|0,this.Fh=d|0,this.Fl=f|0,this.Gh=m|0,this.Gl=h|0,this.Hh=b|0,this.Hl=y|0}process(e,t){for(let _=0;_<16;_++,t+=4)ai[_]=e.getUint32(t),ci[_]=e.getUint32(t+=4);for(let _=16;_<80;_++){let A=ai[_-15]|0,O=ci[_-15]|0,L=vs(A,O,1)^vs(A,O,8)^wS(A,O,7),z=ws(A,O,1)^ws(A,O,8)^xS(A,O,7),J=ai[_-2]|0,P=ci[_-2]|0,W=vs(J,P,19)^au(J,P,61)^wS(J,P,6),ee=ws(J,P,19)^cu(J,P,61)^xS(J,P,6),j=LC(z,ee,ci[_-7],ci[_-16]),R=BC(j,L,W,ai[_-7],ai[_-16]);ai[_]=R|0,ci[_]=j|0}let{Ah:r,Al:o,Bh:n,Bl:i,Ch:s,Cl:a,Dh:c,Dl:u,Eh:d,El:f,Fh:m,Fl:h,Gh:b,Gl:y,Hh:S,Hl:x}=this;for(let _=0;_<80;_++){let A=vs(d,f,14)^vs(d,f,18)^au(d,f,41),O=ws(d,f,14)^ws(d,f,18)^cu(d,f,41),L=d&m^~d&b,z=f&h^~f&y,J=jC(x,O,z,EJ[_],ci[_]),P=ZC(J,S,A,L,_J[_],ai[_]),W=J|0,ee=vs(r,o,28)^au(r,o,34)^au(r,o,39),j=ws(r,o,28)^cu(r,o,34)^cu(r,o,39),R=r&n^r&s^n&s,B=o&i^o&a^i&a;S=b|0,x=y|0,b=m|0,y=h|0,m=d|0,h=f|0,{h:d,l:f}=Nn(c|0,u|0,P|0,W|0),c=s|0,u=a|0,s=n|0,a=i|0,n=r|0,i=o|0;let k=NC(W,j,B);r=DC(k,P,ee,R),o=k|0}({h:r,l:o}=Nn(this.Ah|0,this.Al|0,r|0,o|0)),{h:n,l:i}=Nn(this.Bh|0,this.Bl|0,n|0,i|0),{h:s,l:a}=Nn(this.Ch|0,this.Cl|0,s|0,a|0),{h:c,l:u}=Nn(this.Dh|0,this.Dl|0,c|0,u|0),{h:d,l:f}=Nn(this.Eh|0,this.El|0,d|0,f|0),{h:m,l:h}=Nn(this.Fh|0,this.Fl|0,m|0,h|0),{h:b,l:y}=Nn(this.Gh|0,this.Gl|0,b|0,y|0),{h:S,l:x}=Nn(this.Hh|0,this.Hl|0,S|0,x|0),this.set(r,o,n,i,s,a,c,u,d,f,m,h,b,y,S,x)}roundClean(){wr(ai,ci)}destroy(){wr(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}};KC=class KC extends FC{Ah=Kt[0]|0;Al=Kt[1]|0;Bh=Kt[2]|0;Bl=Kt[3]|0;Ch=Kt[4]|0;Cl=Kt[5]|0;Dh=Kt[6]|0;Dl=Kt[7]|0;Eh=Kt[8]|0;El=Kt[9]|0;Fh=Kt[10]|0;Fl=Kt[11]|0;Gh=Kt[12]|0;Gl=Kt[13]|0;Hh=Kt[14]|0;Hl=Kt[15]|0;constructor(){super(48)}};Op=Oa(()=>new MC,ti(1)),JC=Oa(()=>new KC,ti(2))});function TJ(e){let t=BigInt(10),r=BigInt(20),o=BigInt(40),n=BigInt(80),i=VC,a=e*e%i*e%i,c=Vr(a,HC,i)*a%i,u=Vr(c,kJ,i)*e%i,d=Vr(u,AJ,i)*u%i,f=Vr(d,t,i)*d%i,m=Vr(f,r,i)*f%i,h=Vr(m,o,i)*m%i,b=Vr(h,n,i)*h%i,y=Vr(b,n,i)*h%i,S=Vr(y,t,i)*d%i;return{pow_p_5_8:Vr(S,HC,i)*e%i,b2:a}}function RJ(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}var kJ,HC,IJ,AJ,Nye,VC,WC;var GC=v(()=>{ou();vC();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */kJ=BigInt(1),HC=BigInt(2),IJ=BigInt(3),AJ=BigInt(5),Nye=BigInt(8),VC=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed");WC=(()=>{let e=VC;return SC({P:e,type:"x25519",powPminus2:(t)=>{let{pow_p_5_8:r,b2:o}=TJ(t);return lr(Vr(r,IJ,e)*o,e)},adjustScalarBytes:RJ})})()});var $J,OJ,CJ,kS,PJ,QC;var YC=v(()=>{ES();IC();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */$J=(()=>({p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")}))(),OJ=(()=>({p:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"),n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),h:BigInt(1),a:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000fffffffc"),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f")}))(),CJ=SS($J),kS=vS(CJ,Op),PJ=SS(OJ),QC=vS(PJ,JC)});function e1(e,t,r){if(Hr(e),r===void 0)r=new Uint8Array(e.outputLen);return Da(e,r,t)}function t1(e,t,r,o=32){Hr(e),Bt(o,"length");let n=e.outputLen;if(o>255*n)throw Error("Length must be <= 255*HashLen");let i=Math.ceil(o/n);if(r===void 0)r=XC;else Te(r,void 0,"info");let s=new Uint8Array(i*n),a=Da.create(e,t),c=a._cloneInto(),u=new Uint8Array(a.outputLen);for(let d=0;d<i;d++)IS[0]=d+1,c.update(d===0?XC:u).update(r).update(IS).digestInto(u),s.set(u,n*d),a._cloneInto(c);return a.destroy(),c.destroy(),wr(u,IS),s.slice(0,o)}var IS,XC;var r1=v(()=>{gS();Nr();IS=Uint8Array.of(0),XC=Uint8Array.of()});function UJ(e,t=24){let r=new Uint32Array(10);for(let o=24-t;o<24;o++){for(let s=0;s<10;s++)r[s]=e[s]^e[s+10]^e[s+20]^e[s+30]^e[s+40];for(let s=0;s<10;s+=2){let a=(s+8)%10,c=(s+2)%10,u=r[c],d=r[c+1],f=n1(u,d,1)^r[a],m=o1(u,d,1)^r[a+1];for(let h=0;h<50;h+=10)e[s+h]^=f,e[s+h+1]^=m}let n=e[2],i=e[3];for(let s=0;s<24;s++){let a=s1[s],c=n1(n,i,a),u=o1(n,i,a),d=i1[s];n=e[d],i=e[d+1],e[d]=c,e[d+1]=u}for(let s=0;s<50;s+=10){for(let a=0;a<10;a++)r[a]=e[s+a];for(let a=0;a<10;a++)e[s+a]^=~r[(a+2)%10]&r[(a+4)%10]}e[0]^=jJ[o],e[1]^=ZJ[o]}wr(r)}class Cp{state;pos=0;posOut=0;finished=!1;state32;destroyed=!1;blockLen;suffix;outputLen;enableXOF=!1;rounds;constructor(e,t,r,o=!1,n=24){if(this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=o,this.rounds=n,Bt(r,"outputLen"),!(0<e&&e<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=vp(this.state)}clone(){return this._cloneInto()}keccak(){tS(this.state32),UJ(this.state32,this.rounds),tS(this.state32),this.posOut=0,this.pos=0}update(e){po(this),Te(e);let{blockLen:t,state:r}=this,o=e.length;for(let n=0;n<o;){let i=Math.min(t-this.pos,o-n);for(let s=0;s<i;s++)r[this.pos++]^=e[n++];if(this.pos===t)this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:r,blockLen:o}=this;if(e[r]^=t,(t&128)!==0&&r===o-1)this.keccak();e[o-1]^=128,this.keccak()}writeInto(e){po(this,!1),Te(e),this.finish();let t=this.state,{blockLen:r}=this;for(let o=0,n=e.length;o<n;){if(this.posOut>=r)this.keccak();let i=Math.min(r-this.posOut,n-o);e.set(t.subarray(this.posOut,this.posOut+i),o),this.posOut+=i,o+=i}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return Bt(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(Sp(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,wr(this.state)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:o,rounds:n,enableXOF:i}=this;return e||=new Cp(t,r,o,i,n),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=n,e.suffix=r,e.outputLen=o,e.enableXOF=i,e.destroyed=this.destroyed,e}}var zJ,lu,NJ,DJ,LJ,BJ,i1,s1,a1,c1,jJ,ZJ,n1=(e,t,r)=>r>32?PC(e,t,r):OC(e,t,r),o1=(e,t,r)=>r>32?zC(e,t,r):CC(e,t,r),l1=(e,t,r,o={})=>Oa(()=>new Cp(t,e,r),o),xs,u1,d1=(e,t,r,o={})=>Oa((n={})=>new Cp(t,e,n.dkLen===void 0?r:n.dkLen,!0),o),f1,Dn;var Pp=v(()=>{_S();Nr();zJ=BigInt(0),lu=BigInt(1),NJ=BigInt(2),DJ=BigInt(7),LJ=BigInt(256),BJ=BigInt(113),i1=[],s1=[],a1=[];for(let e=0,t=lu,r=1,o=0;e<24;e++){[r,o]=[o,(2*r+3*o)%5],i1.push(2*(5*o+r)),s1.push((e+1)*(e+2)/2%64);let n=zJ;for(let i=0;i<7;i++)if(t=(t<<lu^(t>>DJ)*BJ)%LJ,t&NJ)n^=lu<<(lu<<BigInt(i))-lu;a1.push(n)}c1=$p(a1,!0),jJ=c1[0],ZJ=c1[1];xs=l1(6,136,32,ti(8)),u1=l1(6,72,64,ti(10)),f1=d1(31,168,16,ti(11)),Dn=d1(31,136,32,ti(12))});function AS(e){if(!Number.isSafeInteger(e)||e<0||e>4294967295)throw Error("wrong u32 integer:"+e);return e}function m1(e){return AS(e),(e&e-1)===0&&e!==0}function TS(e,t){AS(e);let r=0;for(let o=0;o<t;o++,e>>>=1)r=r<<1|e&1;return r}function h1(e){return AS(e),31-Math.clz32(e)}function p1(e){let t=e.length;if(t<2||!m1(t))throw Error("n must be a power of 2 and greater than 1. Got "+t);let r=h1(t);for(let o=0;o<t;o++){let n=TS(o,r);if(o<n){let i=e[o];e[o]=e[n],e[n]=i}}return e}var RS=(e,t)=>{let{N:r,roots:o,dit:n,invertButterflies:i=!1,skipStages:s=0,brp:a=!0}=t,c=h1(r);if(!m1(r))throw Error("FFT: Polynomial size should be power of two");let u=n!==i;return(d)=>{if(d.length!==r)throw Error("FFT: wrong Polynomial length");if(n&&a)p1(d);for(let f=0,m=1;f<c-s;f++){let h=n?f+1+s:c-f,b=1<<h,y=b>>1,S=r>>h;for(let x=0;x<r;x+=b)for(let _=0,A=m++;_<y;_++){let O=i?n?r-A:A:_*S,L=x+_,z=x+_+y,J=o[O],P=d[z],W=d[L];if(u){let ee=e.mul(P,J);d[L]=e.add(W,ee),d[z]=e.sub(W,ee)}else if(i)d[L]=e.add(P,W),d[z]=e.mul(e.sub(P,W),J);else d[L]=e.add(W,P),d[z]=e.mul(e.sub(W,P),J)}}if(!n&&a)p1(d);return d}};var g1=()=>{};function zp(e,t){if(e.length!==t.length)return!1;let r=0;for(let o=0;o<e.length;o++)r|=e[o]^t[o];return r===0}function y1(e){return Uint8Array.from(e)}function _s(e,...t){let r=(n)=>typeof n==="number"?n:n.bytesLen,o=t.reduce((n,i)=>n+r(i),0);return{bytesLen:o,encode:(n)=>{let i=new Uint8Array(o);for(let s=0,a=0;s<t.length;s++){let c=t[s],u=r(c),d=typeof c==="number"?n[s]:c.encode(n[s]);if(Te(d,u,e),i.set(d,a),typeof c!=="number")d.fill(0);a+=u}return i},decode:(n)=>{Te(n,o,e);let i=[];for(let s of t){let a=r(s),c=n.subarray(0,a);i.push(typeof s==="number"?c:s.decode(c)),n=n.subarray(a)}return i}}}function Np(e,t){let r=t*e.bytesLen;return{bytesLen:r,encode:(o)=>{if(o.length!==t)throw Error(`vecCoder.encode: wrong length=${o.length}. Expected: ${t}`);let n=new Uint8Array(r);for(let i=0,s=0;i<o.length;i++){let a=e.encode(o[i]);n.set(a,s),a.fill(0),s+=a.length}return n},decode:(o)=>{Te(o,r);let n=[];for(let i=0;i<o.length;i+=e.bytesLen)n.push(e.decode(o.subarray(i,i+e.bytesLen)));return n}}}function $t(...e){for(let t of e)if(Array.isArray(t))for(let r of t)r.fill(0);else t.fill(0)}function $S(e){return(1<<e)-1}var Ln,Gye;var Dp=v(()=>{Nr();Nr();/*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */Ln=ei;Gye=Uint8Array.of()});var b1=(e)=>{let{newPoly:t,N:r,Q:o,F:n,ROOT_OF_UNITY:i,brvBits:s,isKyber:a}=e,c=(_,A=o)=>{let O=_%A|0;return(O>=0?O|0:A+O|0)|0},u=(_,A=o)=>{let O=c(_,A)|0;return(O>A>>1?O-A|0:O)|0};function d(){let _=t(r);for(let A=0;A<r;A++){let O=TS(A,s),L=BigInt(i)**BigInt(O)%BigInt(o);_[A]=Number(L)|0}return _}let f=d(),m={add:(_,A)=>c((_|0)+(A|0))|0,sub:(_,A)=>c((_|0)-(A|0))|0,mul:(_,A)=>c((_|0)*(A|0))|0,inv:(_)=>{throw Error("not implemented")}},h={N:r,roots:f,invertButterflies:!0,skipStages:a?1:0,brp:!1},b=RS(m,{dit:!1,...h}),y=RS(m,{dit:!0,...h});return{mod:c,smod:u,nttZetas:f,NTT:{encode:(_)=>b(_),decode:(_)=>{y(_);for(let A=0;A<_.length;A++)_[A]=c(n*_[A]);return _}},bitsCoder:(_,A)=>{let O=$S(_),L=_*(r/8);return{bytesLen:L,encode:(z)=>{let J=new Uint8Array(L);for(let P=0,W=0,ee=0,j=0;P<z.length;P++){W|=(A.encode(z[P])&O)<<ee,ee+=_;for(;ee>=8;ee-=8,W>>=8)J[j++]=W&$S(ee)}return J},decode:(z)=>{let J=t(r);for(let P=0,W=0,ee=0,j=0;P<z.length;P++){W|=z[P]<<ee,ee+=8;for(;ee>=_;ee-=_,W>>=_)J[j++]=A.decode(W&O)}return J}}}}},MJ=(e)=>(t,r)=>{if(!r)r=e.blockLen;let o=new Uint8Array(t.length+2);o.set(t);let n=t.length,i=new Uint8Array(r),s=e.create({}),a=0,c=0;return{stats:()=>({calls:a,xofs:c}),get:(u,d)=>(o[n+0]=u,o[n+1]=d,s.destroy(),s=e.create({}).update(o),a++,()=>(c++,s.xofInto(i))),clean:()=>{s.destroy(),$t(i,o)}}},S1;var v1=v(()=>{g1();Pp();Dp();/*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */S1=MJ(f1)});function ks(e,t){for(let r=0;r<er;r++)e[r]=fu(e[r]+t[r])}function VJ(e,t){for(let r=0;r<er;r++)e[r]=fu(e[r]-t[r])}function WJ(e,t,r,o,n){let i=fu(t*o*n+e*r),s=fu(e*o+t*r);return{c0:i,c1:s}}function Lp(e,t){for(let r=0;r<er/2;r++){let o=KJ[64+(r>>1)];if(r&1)o=-o;let{c0:n,c1:i}=WJ(e[2*r+0],e[2*r+1],t[2*r+0],t[2*r+1],o);e[2*r+0]=n,e[2*r+1]=i}return e}function w1(e){let t=new Uint16Array(er);for(let r=0;r<er;){let o=e();if(o.length%3)throw Error("SampleNTT: unaligned block");for(let n=0;r<er&&n+3<=o.length;n+=3){let i=(o[n+0]>>0|o[n+1]<<8)&4095,s=(o[n+1]>>4|o[n+2]<<4)&4095;if(i<go)t[r++]=i;if(r<er&&s<go)t[r++]=s}}return t}function du(e,t,r,o){let n=e(o*er/4,t,r),i=new Uint16Array(er),s=vp(n),a=0;for(let c=0,u=0,d=0,f=0;c<s.length;c++){let m=s[c];for(let h=0;h<32;h++)if(d+=m&1,m>>=1,a+=1,a===o)f=d,d=0;else if(a===2*o)i[u++]=fu(f-d),d=0,a=0}if(a)throw Error(`sampleCBD: leftover bits: ${a}`);return i}function CS(e){let t=GJ(e),{HASH256:r,HASH512:o,KDF:n}=e,{secretCoder:i,lengths:s}=t,a=_s("secretKey",s.secretKey,s.publicKey,32,32),c=32,u=64;return{info:{type:"ml-kem"},lengths:{...s,seed:64,msg:32,msgRand:32,secretKey:a.bytesLen},keygen:(d=Ln(64))=>{Te(d,64,"seed");let{publicKey:f,secretKey:m}=t.keygen(d.subarray(0,32)),h=r(f),b=a.encode([m,f,h,d.subarray(32)]);return $t(m,h),{publicKey:f,secretKey:b}},getPublicKey:(d)=>{let[f,m,h,b]=a.decode(d);return Uint8Array.from(m)},encapsulate:(d,f=Ln(32))=>{Te(d,s.publicKey,"publicKey"),Te(f,32,"message");let m=d.subarray(0,384*e.K),h=i.encode(i.decode(y1(m)));if(!zp(h,m))throw $t(h),Error("ML-KEM.encapsulate: wrong publicKey modulus");$t(h);let b=o.create().update(f).update(r(d)).digest(),y=t.encrypt(d,f,b.subarray(32,64));return $t(b.subarray(32)),{cipherText:y,sharedSecret:b.subarray(0,32)}},decapsulate:(d,f)=>{Te(f,a.bytesLen,"secretKey"),Te(d,s.cipherText,"cipherText");let m=a.bytesLen-96,h=m+32,b=r(f.subarray(m/2,h));if(!zp(b,f.subarray(h,h+32)))throw Error("invalid secretKey: hash check failed");let[y,S,x,_]=a.decode(f),A=t.decrypt(d,y),O=o.create().update(A).update(x).digest(),L=O.subarray(0,32),z=t.encrypt(S,A,O.subarray(32,64)),J=zp(d,z),P=n.create({dkLen:32}).update(_).update(d).digest();return $t(A,z,!J?L:P),J?L:P}}}function QJ(e,t,r){return Dn.create({dkLen:e}).update(t).update(new Uint8Array([r])).digest()}var er=256,go=3329,qJ=3303,FJ=17,fu,KJ,Es,JJ,OS,HJ=(e)=>{if(e>=12)return{encode:(r)=>r,decode:(r)=>r};let t=2**(e-1);return{encode:(r)=>((r<<e)+go/2)/go,decode:(r)=>r*go+t>>>e}},uu=(e)=>JJ(e,HJ(e)),GJ=(e)=>{let{K:t,PRF:r,XOF:o,HASH512:n,ETA1:i,ETA2:s,du:a,dv:c}=e,u=uu(1),d=uu(c),f=uu(a),m=_s("publicKey",Np(uu(12),t),32),h=Np(uu(12),t),b=_s("ciphertext",Np(f,t),d),y=_s("seed",32,32);return{secretCoder:h,lengths:{secretKey:h.bytesLen,publicKey:m.bytesLen,cipherText:b.bytesLen},keygen:(S)=>{Te(S,32,"seed");let x=new Uint8Array(33);x.set(S),x[32]=t;let _=n(x),[A,O]=y.decode(_),L=[],z=[];for(let W=0;W<t;W++)L.push(Es.encode(du(r,O,W,i)));let J=o(A);for(let W=0;W<t;W++){let ee=Es.encode(du(r,O,t+W,i));for(let j=0;j<t;j++){let R=w1(J.get(j,W));ks(ee,Lp(R,L[j]))}z.push(ee)}J.clean();let P={publicKey:m.encode([z,A]),secretKey:h.encode(L)};return $t(A,O,L,z,x,_),P},encrypt:(S,x,_)=>{let[A,O]=m.decode(S),L=[];for(let j=0;j<t;j++)L.push(Es.encode(du(r,_,j,i)));let z=o(O),J=new Uint16Array(er),P=[];for(let j=0;j<t;j++){let R=du(r,_,t+j,s),B=new Uint16Array(er);for(let k=0;k<t;k++){let T=w1(z.get(j,k));ks(B,Lp(T,L[k]))}ks(R,Es.decode(B)),P.push(R),ks(J,Lp(A[j],L[j])),$t(B)}z.clean();let W=du(r,_,2*t,s);ks(W,Es.decode(J));let ee=u.decode(x);return ks(ee,W),$t(A,L,J,W),b.encode([P,ee])},decrypt:(S,x)=>{let[_,A]=b.decode(S),O=h.decode(x),L=new Uint16Array(er);for(let z=0;z<t;z++)ks(L,Lp(O[z],Es.encode(_[z])));return VJ(A,Es.decode(L)),$t(L,O,_),u.encode(A)}}},PS,abe,pu,x1;var _1=v(()=>{Pp();Nr();v1();Dp();/*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */({mod:fu,nttZetas:KJ,NTT:Es,bitsCoder:JJ}=b1({N:er,Q:go,F:qJ,ROOT_OF_UNITY:FJ,newPoly:(e)=>new Uint16Array(e),brvBits:7,isKyber:!0})),OS={512:{N:er,Q:go,K:2,ETA1:3,ETA2:2,du:10,dv:4,RBGstrength:128},768:{N:er,Q:go,K:3,ETA1:2,ETA2:2,du:10,dv:4,RBGstrength:192},1024:{N:er,Q:go,K:4,ETA1:2,ETA2:2,du:11,dv:5,RBGstrength:256}};PS={HASH256:xs,HASH512:u1,KDF:Dn,XOF:S1,PRF:QJ},abe=CS({...PS,...OS[512]}),pu=CS({...PS,...OS[768]}),x1=CS({...PS,...OS[1024]})});function YJ(e,t=!1){let{lengths:r,keygen:o}=e;if(t){let i=e.Point.Fn;if(!i)throw Error("No Point.Fn");o=(s=Ln(r.seed))=>{Te(s,r.seed,"seed");let a=i.isLE?ni(s):ri(s),c=i.toBytes(i.create(a));return{secretKey:c,publicKey:e.getPublicKey(c)}}}return{lengths:{secretKey:r.secretKey,publicKey:r.publicKey,seed:r.seed},keygen:o,getPublicKey:(n)=>e.getPublicKey(n)}}function zS(e,t=!1){let r=YJ(e,t);if(!e.getSharedSecret)throw Error("wrong curve");return{lengths:{...r.lengths,msg:r.lengths.seed,cipherText:r.lengths.publicKey},keygen:r.keygen,getPublicKey:r.getPublicKey,encapsulate(o,n=Ln(e.lengths.seed)){let i=this.keygen(n).secretKey,s=this.decapsulate(o,i),a=e.getPublicKey(i);return $t(i),{sharedSecret:s,cipherText:a}},decapsulate(o,n){let i=e.getSharedSecret(n,o);return e.lengths.publicKeyHasPrefix?i.subarray(1):i}}}function mu(e,t){return _s(t,...e.map((r)=>{if(typeof r.lengths[t]!=="number")throw Error("wrong length: "+t);return r.lengths[t]}))}function NS(e){return(t,r)=>e(t,{dkLen:r})}function XJ(e,t,...r){let o=mu(r,"seed"),n=mu(r,"publicKey");if(e===void 0)e=o.bytesLen;Bt(e);function i(s){Te(s,e);let a=o.decode(t(s,o.bytesLen)),c=r.map((f,m)=>f.keygen(a[m])),u=c.map((f)=>f.secretKey),d=c.map((f)=>f.publicKey);return{secretKey:u,publicKey:d}}return{info:{lengths:{seed:e,publicKey:n.bytesLen,secretKey:e}},getPublicKey(s){return this.keygen(s).publicKey},keygen(s=Ln(e)){let{publicKey:a,secretKey:c}=i(s),u=n.encode(a);return $t(a),$t(c),{secretKey:s,publicKey:u}},expandDecapsulationKey:i,realSeedLen:e}}function Bp(e,t,r,o,...n){let i=XJ(e,r,...n),s=mu(n,"cipherText"),a=mu(n,"publicKey"),c=mu(n,"msg");if(t===void 0)t=c.bytesLen;return Bt(t),{lengths:{...i.info.lengths,msg:t,msgRand:c.bytesLen,cipherText:s.bytesLen},getPublicKey:i.getPublicKey,keygen:i.keygen,encapsulate(u,d=Ln(c.bytesLen)){let f=a.decode(u),m=c.decode(d),h=n.map((x,_)=>x.encapsulate(f[_],m[_])),b=h.map((x)=>x.sharedSecret),y=h.map((x)=>x.cipherText),S={sharedSecret:o(f,y,b),cipherText:s.encode(y)};return $t(b,y),S},decapsulate(u,d){let f=s.decode(u),{publicKey:m,secretKey:h}=i.expandDecapsulationKey(d),b=n.map((y,S)=>y.decapsulate(f[S],h[S]));return o(m,f,b)}}}function E1(e,t,r,o,n){return Hr(o),Hr(n),Bp(32,32,NS(o),(i,s,a)=>n(Et(a[0],a[1],s[1],i[1],oi(e))),t,r)}function eH(e,t,r,o,n){return Hr(o),Hr(n),Bp(32,32,NS(o),(i,s,a)=>{let c=Et(a[0],a[1],s[0],i[0],s[1],i[1],oi(e)),u=32,d=Et(oi("hybrid_prk"),c),f=e1(n,d),m=Et(Ca(32,2),oi("shared_secret"),oi("")),h=t1(n,f,m,32);return $t(f,m,d,c),h},t,r)}function rH(e,t,r,o){let n=e.Point.Fn;if(!n)throw Error("no Point.Fn");function i(s){let a;for(let d=0,f=t;;d=f,f+=t){if(f>s.length)throw Error("rejection sampling failed");if(a=n.fromBytes(s.subarray(d,f),!0),n.isValidNot0(a))break}let c=n.toBytes(n.create(a)),u=e.getPublicKey(c,!1);return{secretKey:c,publicKey:u}}return{lengths:{secretKey:t,publicKey:r,seed:o,msg:o,cipherText:r},keygen(s=Ln(o)){return Te(s,o,"seed"),i(s)},getPublicKey(s){return e.getPublicKey(s,!1)},encapsulate(s,a=Ln(o)){Te(a,o,"rand");let{secretKey:c}=i(a),u=this.decapsulate(s,c),d=e.getPublicKey(c,!1);return $t(c),{sharedSecret:u,cipherText:d}},decapsulate(s,a){return e.getSharedSecret(a,s).subarray(1)}}}function nH(e,t,r,o){let{secretKey:n,publicKeyUncompressed:i}=r.lengths;if(!n||!i)throw Error("wrong curve");let s=rH(r,n,i,o),a=64,c=a+o;return Bp(32,32,(u)=>{Te(u,32);let d=Dn(u,{dkLen:c}),f=d.subarray(0,a),m=d.subarray(a,c);return Et(f,m)},(u,d,f)=>xs(Et(f[0],f[1],d[1],u[1],oi(e))),t,s)}var bbe,Sbe,k1,vbe,tH,oH,jp,I1;var A1=v(()=>{GC();YC();Pa();r1();ES();Pp();Nr();_1();Dp();/*! noble-post-quantum - MIT License (c) 2024 Paul Miller (paulmillr.com) */bbe=E1("QSF-KEM(ML-KEM-768,P-256)-XOF(SHAKE256)-KDF(SHA3-256)",pu,zS(kS,!0),Dn,xs),Sbe=E1("QSF-KEM(ML-KEM-1024,P-384)-XOF(SHAKE256)-KDF(SHA3-256)",x1,zS(QC,!0),Dn,xs);k1=zS(WC),vbe=eH("KitchenSink-KEM(ML-KEM-768,X25519)-XOF(SHAKE256)-KDF(HKDF-SHA-256)",pu,k1,Dn,Op),tH=(()=>Bp(32,32,NS(Dn),(e,t,r)=>xs(Et(r[0],r[1],t[1],e[1],oi("\\.//^\\"))),pu,k1))();oH=(()=>nH("MLKEM768-P256",pu,kS,128))(),jp=tH,I1=oH});function yo(e,t=""){if(typeof e!=="boolean"){let r=t&&`"${t}" `;throw TypeError(r+"expected boolean, got type="+typeof e)}return e}function Mp(e){if(typeof e==="bigint"){if(!Zp(e))throw RangeError("positive bigint expected, got "+e)}else LS(e);return e}function Bn(e,t=""){if(typeof e!=="number"){let r=t&&`"${t}" `;throw TypeError(r+"expected number, got type="+typeof e)}if(!Number.isSafeInteger(e)){let r=t&&`"${t}" `;throw RangeError(r+"expected safe integer, got "+e)}}function hu(e){let t=Mp(e).toString(16);return t.length&1?"0"+t:t}function T1(e){if(typeof e!=="string")throw TypeError("hex string expected, got "+typeof e);return e===""?Up:BigInt("0x"+e)}function Is(e){return T1(sp(e))}function dn(e){return T1(sp(li(Mt(e)).reverse()))}function qp(e,t){if(St(t),t===0)throw RangeError("zero length");e=Mp(e);let r=e.toString(16);if(r.length>t*2)throw RangeError("number too large");return Ml(r.padStart(t*2,"0"))}function gu(e,t){return qp(e,t).reverse()}function R1(e,t){if(e=Ye(e),t=Ye(t),e.length!==t.length)return!1;let r=0;for(let o=0;o<e.length;o++)r|=e[o]^t[o];return r===0}function li(e){return Uint8Array.from(Ye(e))}function Fp(e){if(typeof e!=="string")throw TypeError("ascii string expected, got "+typeof e);return Uint8Array.from(e,(t,r)=>{let o=t.charCodeAt(0);if(t.length!==1||o>127)throw RangeError(`string contains non-ASCII character "${e[r]}" with code ${o} at position ${r}`);return o})}function iH(e,t,r){return Zp(e)&&Zp(t)&&Zp(r)&&t<=e&&e<r}function bo(e,t,r,o){if(!iH(t,r,o))throw RangeError("expected valid "+e+": "+r+" <= n < "+o+", got "+t)}function Ma(e){if(e<Up)throw Error("expected non-negative bigint, got "+e);let t;for(t=0;e>Up;e>>=DS,t+=1);return t}function $1(e,t,r){if(St(e,"hashLen"),St(t,"qByteLen"),typeof r!=="function")throw TypeError("hmacFn must be a function");let o=(S)=>new Uint8Array(S),n=Uint8Array.of(),i=Uint8Array.of(0),s=Uint8Array.of(1),a=1000,c=o(e),u=o(e),d=0,f=()=>{c.fill(1),u.fill(0),d=0},m=(...S)=>r(u,Jt(c,...S)),h=(S=n)=>{if(u=m(i,S),c=m(),S.length===0)return;u=m(s,S),c=m()},b=()=>{if(d++>=a)throw Error("drbg: tried max amount of iterations");let S=0,x=[];while(S<t){c=m();let _=c.slice();x.push(_),S+=c.length}return Jt(...x)};return(S,x)=>{f(),h(S);let _=void 0;while((_=x(b()))===void 0)h();return f(),_}}function Wr(e,t={},r={}){if(Object.prototype.toString.call(e)!=="[object Object]")throw TypeError("expected valid options object");function o(i,s,a){if(!a&&s!=="function"&&!Object.hasOwn(e,i))throw TypeError(`param "${i}" is invalid: expected own property`);let c=e[i];if(a&&c===void 0)return;let u=typeof c;if(u!==s||c===null)throw TypeError(`param "${i}" is invalid: expected ${s}, got ${u}`)}let n=(i,s)=>Object.entries(i).forEach(([a,c])=>o(a,c,s));n(t,!1),n(r,!0)}var Ye=(e,t,r)=>Mt(e,t,r),LS,Ba,Jt=(...e)=>zb(...e),ja=(e)=>Ml(e),Za,Ua=(e)=>co(e),Up,DS,Zp=(e)=>typeof e==="bigint"&&Up<=e,yu=(e)=>(DS<<BigInt(e))-DS,BS=()=>{throw Error("not implemented")};var ui=v(()=>{Fr();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */LS=St,Ba=sp,Za=Ob,Up=BigInt(0),DS=BigInt(1)});function it(e,t){if(t<=Ht)throw Error("mod: expected positive modulus, got "+t);let r=e%t;return r>=Ht?r:t+r}function Gr(e,t,r){if(t<Ht)throw Error("pow2: expected non-negative exponent, got "+t);let o=e;while(t-- >Ht)o*=o,o%=r;return o}function O1(e,t){if(e===Ht)throw Error("invert: expected non-zero number");if(t<=Ht)throw Error("invert: expected positive modulus, got "+t);let r=it(e,t),o=t,n=Ht,i=ht,s=ht,a=Ht;while(r!==Ht){let u=o/r,d=o-r*u,f=n-s*u,m=i-a*u;o=r,r=d,n=s,i=a,s=f,a=m}if(o!==ht)throw Error("invert: does not exist");return it(n,t)}function jS(e,t,r){let o=e;if(!o.eql(o.sqr(t),r))throw Error("Cannot find square root")}function j1(e,t){let r=e,o=(r.ORDER+ht)/N1,n=r.pow(t,o);return jS(r,n,t),n}function cH(e,t){let r=e,o=(r.ORDER-D1)/L1,n=r.mul(t,As),i=r.pow(n,o),s=r.mul(t,i),a=r.mul(r.mul(s,As),i),c=r.mul(s,r.sub(a,r.ONE));return jS(r,c,t),c}function lH(e){let t=Kp(e),r=Z1(e),o=r(t,t.neg(t.ONE)),n=r(t,o),i=r(t,t.neg(o)),s=(e+sH)/B1;return(a,c)=>{let u=a,d=u.pow(c,s),f=u.mul(d,o),m=u.mul(d,n),h=u.mul(d,i),b=u.eql(u.sqr(f),c),y=u.eql(u.sqr(m),c);d=u.cmov(d,f,b),f=u.cmov(h,m,y);let S=u.eql(u.sqr(f),c),x=u.cmov(d,f,S);return jS(u,x,c),x}}function Z1(e){if(e<z1)throw Error("sqrt is not defined for small field");let t=e-ht,r=0;while(t%As===Ht)t/=As,r++;let o=As,n=Kp(e);while(C1(n,o)===1)if(o++>1000)throw Error("Cannot find square root: probably non-prime P");if(r===1)return j1;let i=n.pow(o,t),s=(t+ht)/As;return function(c,u){let d=c;if(d.is0(u))return u;if(C1(d,u)!==1)throw Error("Cannot find square root");let f=r,m=d.mul(d.ONE,i),h=d.pow(u,t),b=d.pow(u,s);while(!d.eql(h,d.ONE)){if(d.is0(h))return d.ZERO;let y=1,S=d.sqr(h);while(!d.eql(S,d.ONE))if(y++,S=d.sqr(S),y===f)throw Error("Cannot find square root");let x=ht<<BigInt(f-y-1),_=d.pow(m,x);f=y,m=d.sqr(_),h=d.mul(h,m),b=d.mul(b,_)}return b}}function uH(e){if(e%N1===z1)return j1;if(e%L1===D1)return cH;if(e%B1===aH)return lH(e);return Z1(e)}function ZS(e){let t={ORDER:"bigint",BYTES:"number",BITS:"number"},r=dH.reduce((o,n)=>(o[n]="function",o),t);if(Wr(e,r),Bn(e.BYTES,"BYTES"),Bn(e.BITS,"BITS"),e.BYTES<1||e.BITS<1)throw Error("invalid field: expected BYTES/BITS > 0");if(e.ORDER<=ht)throw Error("invalid field: expected ORDER > 1, got "+e.ORDER);return e}function fH(e,t,r){let o=e;if(r<Ht)throw Error("invalid exponent, negatives unsupported");if(r===Ht)return o.ONE;if(r===ht)return t;let n=o.ONE,i=t;while(r>Ht){if(r&ht)n=o.mul(n,i);i=o.sqr(i),r>>=ht}return n}function bu(e,t,r=!1){let o=e,n=Array(t.length).fill(r?o.ZERO:void 0),i=t.reduce((a,c,u)=>{if(o.is0(c))return a;return n[u]=a,o.mul(a,c)},o.ONE),s=o.inv(i);return t.reduceRight((a,c,u)=>{if(o.is0(c))return a;return n[u]=o.mul(a,n[u]),o.mul(a,c)},s),n}function C1(e,t){let r=e,o=(r.ORDER-ht)/As,n=r.pow(t,o),i=r.eql(n,r.ONE),s=r.eql(n,r.ZERO),a=r.eql(n,r.neg(r.ONE));if(!i&&!s&&!a)throw Error("invalid Legendre symbol result");return i?1:s?0:-1}function pH(e,t){if(t!==void 0)LS(t);if(e<=Ht)throw Error("invalid n length: expected positive n, got "+e);if(t!==void 0&&t<1)throw Error("invalid n length: expected positive bit length, got "+t);let r=Ma(e);if(t!==void 0&&t<r)throw Error(`invalid n length: expected bit length (${r}) >= n.length (${t})`);let o=t!==void 0?t:r,n=Math.ceil(o/8);return{nBitLength:o,nByteLength:n}}class US{ORDER;BITS;BYTES;isLE;ZERO=Ht;ONE=ht;_lengths;_mod;constructor(e,t={}){if(e<=ht)throw Error("invalid field: expected ORDER > 1, got "+e);let r=void 0;if(this.isLE=!1,t!=null&&typeof t==="object"){if(typeof t.BITS==="number")r=t.BITS;if(typeof t.sqrt==="function")Object.defineProperty(this,"sqrt",{value:t.sqrt,enumerable:!0});if(typeof t.isLE==="boolean")this.isLE=t.isLE;if(t.allowedLengths)this._lengths=Object.freeze(t.allowedLengths.slice());if(typeof t.modFromBytes==="boolean")this._mod=t.modFromBytes}let{nBitLength:o,nByteLength:n}=pH(e,r);if(n>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");this.ORDER=e,this.BITS=o,this.BYTES=n,Object.freeze(this)}create(e){return it(e,this.ORDER)}isValid(e){if(typeof e!=="bigint")throw TypeError("invalid field element: expected bigint, got "+typeof e);return Ht<=e&&e<this.ORDER}is0(e){return e===Ht}isValidNot0(e){return!this.is0(e)&&this.isValid(e)}isOdd(e){return(e&ht)===ht}neg(e){return it(-e,this.ORDER)}eql(e,t){return e===t}sqr(e){return it(e*e,this.ORDER)}add(e,t){return it(e+t,this.ORDER)}sub(e,t){return it(e-t,this.ORDER)}mul(e,t){return it(e*t,this.ORDER)}pow(e,t){return fH(this,e,t)}div(e,t){return it(e*O1(t,this.ORDER),this.ORDER)}sqrN(e){return e*e}addN(e,t){return e+t}subN(e,t){return e-t}mulN(e,t){return e*t}inv(e){return O1(e,this.ORDER)}sqrt(e){let t=P1.get(this);if(!t)P1.set(this,t=uH(this.ORDER));return t(this,e)}toBytes(e){return this.isLE?gu(e,this.BYTES):qp(e,this.BYTES)}fromBytes(e,t=!1){Ye(e);let{_lengths:r,BYTES:o,isLE:n,ORDER:i,_mod:s}=this;if(r){if(e.length<1||!r.includes(e.length)||e.length>o)throw Error("Field.fromBytes: expected "+r+" bytes, got "+e.length);let c=new Uint8Array(o);c.set(e,n?0:c.length-e.length),e=c}if(e.length!==o)throw Error("Field.fromBytes: expected "+o+" bytes, got "+e.length);let a=n?dn(e):Is(e);if(s)a=it(a,i);if(!t){if(!this.isValid(a))throw Error("invalid field element: outside of range 0..ORDER")}return a}invertBatch(e){return bu(this,e)}cmov(e,t,r){return yo(r,"condition"),r?t:e}}function Kp(e,t={}){return new US(e,t)}function U1(e){if(typeof e!=="bigint")throw Error("field order must be bigint");if(e<=ht)throw Error("field order must be greater than 1");let t=Ma(e-ht);return Math.ceil(t/8)}function MS(e){let t=U1(e);return t+Math.ceil(t/2)}function M1(e,t,r=!1){Ye(e);let o=e.length,n=U1(t),i=Math.max(MS(t),16);if(o<i||o>1024)throw Error("expected "+i+"-1024 bytes of input, got "+o);let s=r?dn(e):Is(e),a=it(s,t-ht)+ht;return r?gu(a,n):qp(a,n)}var Ht,ht,As,z1,N1,D1,sH,L1,aH,B1,So=(e,t)=>(it(e,t)&ht)===ht,dH,P1;var Su=v(()=>{ui();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */Ht=BigInt(0),ht=BigInt(1),As=BigInt(2),z1=BigInt(3),N1=BigInt(4),D1=BigInt(5),sH=BigInt(7),L1=BigInt(8),aH=BigInt(9),B1=BigInt(16);dH=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];P1=new WeakMap;Object.freeze(US.prototype)});function vu(e,t){let r=t.negate();return e?r:t}function Rs(e,t){let r=bu(e.Fp,t.map((o)=>o.Z));return t.map((o,n)=>e.fromAffine(o.toAffine(r[n])))}function J1(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function qS(e,t){J1(e,t);let r=Math.ceil(t/e)+1,o=2**(e-1),n=2**e,i=yu(e),s=BigInt(e);return{windows:r,windowSize:o,mask:i,maxNumber:n,shiftBy:s}}function q1(e,t,r){let{windowSize:o,mask:n,maxNumber:i,shiftBy:s}=r,a=Number(e&n),c=e>>s;if(a>o)a-=i,c+=Ts;let u=t*o,d=u+Math.abs(a)-1,f=a===0,m=a<0,h=t%2!==0;return{nextN:c,offset:d,isZero:f,isNeg:m,isNegF:h,offsetF:u}}function KS(e){return H1.get(e)||1}function F1(e){if(e!==qa)throw Error("invalid wNAF")}class wu{BASE;ZERO;Fn;bits;constructor(e,t){this.BASE=e.BASE,this.ZERO=e.ZERO,this.Fn=e.Fn,this.bits=t}_unsafeLadder(e,t,r=this.ZERO){let o=e;while(t>qa){if(t&Ts)r=r.add(o);o=o.double(),t>>=Ts}return r}precomputeWindow(e,t){let{windows:r,windowSize:o}=qS(t,this.bits),n=[],i=e,s=i;for(let a=0;a<r;a++){s=i,n.push(s);for(let c=1;c<o;c++)s=s.add(i),n.push(s);i=s.double()}return n}wNAF(e,t,r){if(!this.Fn.isValid(r))throw Error("invalid scalar");let o=this.ZERO,n=this.BASE,i=qS(e,this.bits);for(let s=0;s<i.windows;s++){let{nextN:a,offset:c,isZero:u,isNeg:d,isNegF:f,offsetF:m}=q1(r,s,i);if(r=a,u)n=n.add(vu(f,t[m]));else o=o.add(vu(d,t[c]))}return F1(r),{p:o,f:n}}wNAFUnsafe(e,t,r,o=this.ZERO){let n=qS(e,this.bits);for(let i=0;i<n.windows;i++){if(r===qa)break;let{nextN:s,offset:a,isZero:c,isNeg:u}=q1(r,i,n);if(r=s,c)continue;else{let d=t[a];o=o.add(u?d.negate():d)}}return F1(r),o}getPrecomputes(e,t,r){let o=FS.get(t);if(!o){if(o=this.precomputeWindow(t,e),e!==1){if(typeof r==="function")o=r(o);FS.set(t,o)}}return o}cached(e,t,r){let o=KS(e);return this.wNAF(o,this.getPrecomputes(o,e,r),t)}unsafe(e,t,r,o){let n=KS(e);if(n===1)return this._unsafeLadder(e,t,o);return this.wNAFUnsafe(n,this.getPrecomputes(n,e,r),t,o)}createCache(e,t){J1(t,this.bits),H1.set(e,t),FS.delete(e)}hasCache(e){return KS(e)!==1}}function V1(e,t,r,o){let n=t,i=e.ZERO,s=e.ZERO;while(r>qa||o>qa){if(r&Ts)i=i.add(n);if(o&Ts)s=s.add(n);n=n.double(),r>>=Ts,o>>=Ts}return{p1:i,p2:s}}function K1(e,t,r){if(t){if(t.ORDER!==e)throw Error("Field.ORDER must match order: Fp == p, Fn == n");return ZS(t),t}else return Kp(e,{isLE:r})}function Jp(e,t,r={},o){if(o===void 0)o=e==="edwards";if(!t||typeof t!=="object")throw Error(`expected valid ${e} CURVE object`);for(let c of["p","n","h"]){let u=t[c];if(!(typeof u==="bigint"&&u>qa))throw Error(`CURVE.${c} must be positive bigint`)}let n=K1(t.p,r.Fp,o),i=K1(t.n,r.Fn,o),a=["Gx","Gy","a",e==="weierstrass"?"b":"d"];for(let c of a)if(!n.isValid(t[c]))throw Error(`CURVE.${c} must be valid field element of CURVE.Fp`);return t=Object.freeze(Object.assign({},t)),{CURVE:t,Fp:n,Fn:i}}function xu(e,t){return function(o){let n=e(o);return{secretKey:n,publicKey:t(n)}}}var qa,Ts,FS,H1;var Hp=v(()=>{ui();Su();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */qa=BigInt(0),Ts=BigInt(1);FS=new WeakMap,H1=new WeakMap});function _u(e,t){if(Bn(e),Bn(t),t<0||t>4)throw Error("invalid I2OSP length: "+t);if(e<0||e>2**(8*t)-1)throw Error("invalid I2OSP input: "+e);let r=Array.from({length:t}).fill(0);for(let o=t-1;o>=0;o--)r[o]=e&255,e>>>=8;return new Uint8Array(r)}function mH(e,t){let r=new Uint8Array(e.length);for(let o=0;o<e.length;o++)r[o]=e[o]^t[o];return r}function hH(e){if(!Za(e)&&typeof e!=="string")throw Error("DST must be Uint8Array or ascii string");let t=typeof e==="string"?Fp(e):e;if(t.length===0)throw Error("DST must be non-empty");return t}function JS(e,t,r,o){if(Ye(e),Bn(r),t=hH(t),t.length>255)t=o(Jt(Fp("H2C-OVERSIZE-DST-"),t));let{outputLen:n,blockLen:i}=o,s=Math.ceil(r/n);if(r>65535||s>255)throw Error("expand_message_xmd: invalid lenInBytes");let a=Jt(t,_u(t.length,1)),c=new Uint8Array(i),u=_u(r,2),d=Array(s),f=o(Jt(c,e,u,_u(0,1),a));d[0]=o(Jt(f,_u(1,1),a));for(let h=1;h<s;h++){let b=[mH(f,d[h-1]),_u(h+1,1),a];d[h]=o(Jt(...b))}return Jt(...d).slice(0,r)}var W1="HashToScalar-";var G1=v(()=>{ui()});function gH(e,t,r){bo("scalar",e,jn,r);let[[o,n],[i,s]]=t,a=Q1(s*e,r),c=Q1(-n*e,r),u=e-a*o-c*i,d=-a*n-c*s,f=u<jn,m=d<jn;if(f)u=-u;if(m)d=-d;let h=yu(Math.ceil(Ma(r)/2))+di;if(u<jn||u>=h||d<jn||d>=h)throw Error("splitScalar (endomorphism): failed for k");return{k1neg:f,k1:u,k2neg:m,k2:d}}function VS(e){if(!["compact","recovered","der"].includes(e))throw Error('Signature format must be "compact", "recovered", or "der"');return e}function HS(e,t){Wr(e);let r={};for(let o of Object.keys(t))r[o]=e[o]===void 0?t[o]:e[o];if(yo(r.lowS,"lowS"),yo(r.prehash,"prehash"),r.format!==void 0)VS(r.format);return r}function eP(e,t={}){let r=Jp("weierstrass",e,t),o=r.Fp,n=r.Fn,i=r.CURVE,{h:s,n:a}=i;Wr(t,{},{allowInfinityPoint:"boolean",clearCofactor:"function",isTorsionFree:"function",fromBytes:"function",toBytes:"function",endo:"object"});let{endo:c,allowInfinityPoint:u}=t;if(c){if(!o.is0(i.a)||typeof c.beta!=="bigint"||!Array.isArray(c.basises))throw Error('invalid endo: expected "beta": bigint and "basises": array')}let d=rP(o,n);function f(){if(!o.isOdd)throw Error("compression is not supported: Field does not have .isOdd()")}function m(j,R,B){if(u&&R.is0())return Uint8Array.of(0);let{x:k,y:T}=R.toAffine(),I=o.toBytes(k);if(yo(B,"isCompressed"),B){f();let q=!o.isOdd(T);return Jt(tP(q),I)}else return Jt(Uint8Array.of(4),I,o.toBytes(T))}function h(j){Ye(j,void 0,"Point");let{publicKey:R,publicKeyUncompressed:B}=d,k=j.length,T=j[0],I=j.subarray(1);if(u&&k===1&&T===0)return{x:o.ZERO,y:o.ZERO};if(k===R&&(T===2||T===3)){let q=o.fromBytes(I);if(!o.isValid(q))throw Error("bad point: is not on curve, wrong x");let N=S(q),H;try{H=o.sqrt(N)}catch(ae){let me=ae instanceof Error?": "+ae.message:"";throw Error("bad point: is not on curve, sqrt error"+me)}f();let G=o.isOdd(H);if((T&1)===1!==G)H=o.neg(H);return{x:q,y:H}}else if(k===B&&T===4){let q=o.BYTES,N=o.fromBytes(I.subarray(0,q)),H=o.fromBytes(I.subarray(q,q*2));if(!x(N,H))throw Error("bad point: is not on curve");return{x:N,y:H}}else throw Error(`bad point: got length ${k}, expected compressed=${R} or uncompressed=${B}`)}let b=t.toBytes===void 0?m:t.toBytes,y=t.fromBytes===void 0?h:t.fromBytes;function S(j){let R=o.sqr(j),B=o.mul(R,j);return o.add(o.add(B,o.mul(j,i.a)),i.b)}function x(j,R){let B=o.sqr(R),k=S(j);return o.eql(B,k)}if(!x(i.Gx,i.Gy))throw Error("bad curve params: generator point");let _=o.mul(o.pow(i.a,Vp),yH),A=o.mul(o.sqr(i.b),BigInt(27));if(o.is0(o.add(_,A)))throw Error("bad curve params: a or b");function O(j,R,B=!1){if(!o.isValid(R)||B&&o.is0(R))throw Error(`bad point coordinate ${j}`);return R}function L(j){if(!(j instanceof P))throw Error("Weierstrass Point expected")}function z(j){if(!c||!c.basises)throw Error("no endo");return gH(j,c.basises,n.ORDER)}function J(j,R,B,k,T){return B=new P(o.mul(B.X,j),B.Y,B.Z),R=vu(k,R),B=vu(T,B),R.add(B)}class P{static BASE=new P(i.Gx,i.Gy,o.ONE);static ZERO=new P(o.ZERO,o.ONE,o.ZERO);static Fp=o;static Fn=n;X;Y;Z;constructor(j,R,B){this.X=O("x",j),this.Y=O("y",R,!0),this.Z=O("z",B),Object.freeze(this)}static CURVE(){return i}static fromAffine(j){let{x:R,y:B}=j||{};if(!j||!o.isValid(R)||!o.isValid(B))throw Error("invalid affine point");if(j instanceof P)throw Error("projective point not allowed");if(o.is0(R)&&o.is0(B))return P.ZERO;return new P(R,B,o.ONE)}static fromBytes(j){let R=P.fromAffine(y(Ye(j,void 0,"point")));return R.assertValidity(),R}static fromHex(j){return P.fromBytes(ja(j))}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(j=8,R=!0){if(ee.createCache(this,j),!R)this.multiply(Vp);return this}assertValidity(){let j=this;if(j.is0()){if(t.allowInfinityPoint&&o.is0(j.X)&&o.eql(j.Y,o.ONE)&&o.is0(j.Z))return;throw Error("bad point: ZERO")}let{x:R,y:B}=j.toAffine();if(!o.isValid(R)||!o.isValid(B))throw Error("bad point: x or y not field elements");if(!x(R,B))throw Error("bad point: equation left != right");if(!j.isTorsionFree())throw Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:j}=this.toAffine();if(!o.isOdd)throw Error("Field doesn't support isOdd");return!o.isOdd(j)}equals(j){L(j);let{X:R,Y:B,Z:k}=this,{X:T,Y:I,Z:q}=j,N=o.eql(o.mul(R,q),o.mul(T,k)),H=o.eql(o.mul(B,q),o.mul(I,k));return N&&H}negate(){return new P(this.X,o.neg(this.Y),this.Z)}double(){let{a:j,b:R}=i,B=o.mul(R,Vp),{X:k,Y:T,Z:I}=this,q=o.ZERO,N=o.ZERO,H=o.ZERO,G=o.mul(k,k),re=o.mul(T,T),ae=o.mul(I,I),me=o.mul(k,T);return me=o.add(me,me),H=o.mul(k,I),H=o.add(H,H),q=o.mul(j,H),N=o.mul(B,ae),N=o.add(q,N),q=o.sub(re,N),N=o.add(re,N),N=o.mul(q,N),q=o.mul(me,q),H=o.mul(B,H),ae=o.mul(j,ae),me=o.sub(G,ae),me=o.mul(j,me),me=o.add(me,H),H=o.add(G,G),G=o.add(H,G),G=o.add(G,ae),G=o.mul(G,me),N=o.add(N,G),ae=o.mul(T,I),ae=o.add(ae,ae),G=o.mul(ae,me),q=o.sub(q,G),H=o.mul(ae,re),H=o.add(H,H),H=o.add(H,H),new P(q,N,H)}add(j){L(j);let{X:R,Y:B,Z:k}=this,{X:T,Y:I,Z:q}=j,N=o.ZERO,H=o.ZERO,G=o.ZERO,re=i.a,ae=o.mul(i.b,Vp),me=o.mul(R,T),be=o.mul(B,I),ve=o.mul(k,q),Ae=o.add(R,B),Ie=o.add(T,I);Ae=o.mul(Ae,Ie),Ie=o.add(me,be),Ae=o.sub(Ae,Ie),Ie=o.add(R,k);let we=o.add(T,q);return Ie=o.mul(Ie,we),we=o.add(me,ve),Ie=o.sub(Ie,we),we=o.add(B,k),N=o.add(I,q),we=o.mul(we,N),N=o.add(be,ve),we=o.sub(we,N),G=o.mul(re,Ie),N=o.mul(ae,ve),G=o.add(N,G),N=o.sub(be,G),G=o.add(be,G),H=o.mul(N,G),be=o.add(me,me),be=o.add(be,me),ve=o.mul(re,ve),Ie=o.mul(ae,Ie),be=o.add(be,ve),ve=o.sub(me,ve),ve=o.mul(re,ve),Ie=o.add(Ie,ve),me=o.mul(be,Ie),H=o.add(H,me),me=o.mul(we,Ie),N=o.mul(Ae,N),N=o.sub(N,me),me=o.mul(Ae,be),G=o.mul(we,G),G=o.add(G,me),new P(N,H,G)}subtract(j){return L(j),this.add(j.negate())}is0(){return this.equals(P.ZERO)}multiply(j){let{endo:R}=t;if(!n.isValidNot0(j))throw RangeError("invalid scalar: out of range");let B,k,T=(I)=>ee.cached(this,I,(q)=>Rs(P,q));if(R){let{k1neg:I,k1:q,k2neg:N,k2:H}=z(j),{p:G,f:re}=T(q),{p:ae,f:me}=T(H);k=re.add(me),B=J(R.beta,G,ae,I,N)}else{let{p:I,f:q}=T(j);B=I,k=q}return Rs(P,[B,k])[0]}multiplyUnsafe(j){let{endo:R}=t,B=this,k=j;if(!n.isValid(k))throw RangeError("invalid scalar: out of range");if(k===jn||B.is0())return P.ZERO;if(k===di)return B;if(ee.hasCache(this))return this.multiply(k);if(R){let{k1neg:T,k1:I,k2neg:q,k2:N}=z(k),{p1:H,p2:G}=V1(P,B,I,N);return J(R.beta,H,G,T,q)}else return ee.unsafe(B,k)}toAffine(j){let R=this,B=j,{X:k,Y:T,Z:I}=R;if(o.eql(I,o.ONE))return{x:k,y:T};let q=R.is0();if(B==null)B=q?o.ONE:o.inv(I);let N=o.mul(k,B),H=o.mul(T,B),G=o.mul(I,B);if(q)return{x:o.ZERO,y:o.ZERO};if(!o.eql(G,o.ONE))throw Error("invZ was invalid");return{x:N,y:H}}isTorsionFree(){let{isTorsionFree:j}=t;if(s===di)return!0;if(j)return j(P,this);return ee.unsafe(this,a).is0()}clearCofactor(){let{clearCofactor:j}=t;if(s===di)return this;if(j)return j(P,this);return this.multiplyUnsafe(s)}isSmallOrder(){if(s===di)return this.is0();return this.clearCofactor().is0()}toBytes(j=!0){return yo(j,"isCompressed"),this.assertValidity(),b(P,this,j)}toHex(j=!0){return Ba(this.toBytes(j))}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}let W=n.BITS,ee=new wu(P,t.endo?Math.ceil(W/2):W);if(W>=8)P.BASE.precompute(8);return Object.freeze(P.prototype),Object.freeze(P),P}function tP(e){return Uint8Array.of(e?2:3)}function rP(e,t){return{secretKey:t.BYTES,publicKey:1+e.BYTES,publicKeyUncompressed:1+2*e.BYTES,publicKeyHasPrefix:!0,signature:2*t.BYTES}}function bH(e,t={}){let{Fn:r}=e,o=t.randomBytes===void 0?Ua:t.randomBytes,n=Object.assign(rP(e.Fp,r),{seed:Math.max(MS(r.ORDER),16)});function i(h){try{let b=r.fromBytes(h);return r.isValidNot0(b)}catch(b){return!1}}function s(h,b){let{publicKey:y,publicKeyUncompressed:S}=n;try{let x=h.length;if(b===!0&&x!==y)return!1;if(b===!1&&x!==S)return!1;return!!e.fromBytes(h)}catch(x){return!1}}function a(h){return h=h===void 0?o(n.seed):h,M1(Ye(h,n.seed,"seed"),r.ORDER)}function c(h,b=!0){return e.BASE.multiply(r.fromBytes(h)).toBytes(b)}function u(h){let{secretKey:b,publicKey:y,publicKeyUncompressed:S}=n,x=r._lengths;if(!Za(h))return;let _=Ye(h,void 0,"key").length,A=_===y||_===S,O=_===b||!!x?.includes(_);if(A&&O)return;return A}function d(h,b,y=!0){if(u(h)===!0)throw Error("first arg must be private key");if(u(b)===!1)throw Error("second arg must be public key");let S=r.fromBytes(h);return e.fromBytes(b).multiply(S).toBytes(y)}let f={isValidSecretKey:i,isValidPublicKey:s,randomSecretKey:a},m=xu(a,c);return Object.freeze(f),Object.freeze(n),Object.freeze({getPublicKey:c,getSharedSecret:d,keygen:m,Point:e,utils:f,lengths:n})}function nP(e,t,r={}){let o=t;ao(o),Wr(r,{},{hmac:"function",lowS:"boolean",randomBytes:"function",bits2int:"function",bits2int_modN:"function"}),r=Object.assign({},r);let n=r.randomBytes===void 0?Ua:r.randomBytes,i=r.hmac===void 0?(T,I)=>Cn(o,T,I):r.hmac,{Fp:s,Fn:a}=e,{ORDER:c,BITS:u}=a,{keygen:d,getPublicKey:f,getSharedSecret:m,utils:h,lengths:b}=bH(e,r),y={prehash:!0,lowS:typeof r.lowS==="boolean"?r.lowS:!0,format:"compact",extraEntropy:!1},S=c*X1+di<s.ORDER;function x(T){let I=c>>di;return T>I}function _(T,I){if(!a.isValidNot0(I))throw Error(`invalid signature ${T}: out of range 1..Point.Fn.ORDER`);return I}function A(){if(S)throw Error('"recovered" sig type is not supported for cofactor >2 curves')}function O(T,I){VS(I);let q=b.signature,N=I==="compact"?q:I==="recovered"?q+1:void 0;return Ye(T,N)}class L{r;s;recovery;constructor(T,I,q){if(this.r=_("r",T),this.s=_("s",I),q!=null){if(A(),![0,1,2,3].includes(q))throw Error("invalid recovery id");this.recovery=q}Object.freeze(this)}static fromBytes(T,I=y.format){O(T,I);let q;if(I==="der"){let{r:re,s:ae}=fn.toSig(Ye(T));return new L(re,ae)}if(I==="recovered")q=T[0],I="compact",T=T.subarray(1);let N=b.signature/2,H=T.subarray(0,N),G=T.subarray(N,N*2);return new L(a.fromBytes(H),a.fromBytes(G),q)}static fromHex(T,I){return this.fromBytes(ja(T),I)}assertRecovery(){let{recovery:T}=this;if(T==null)throw Error("invalid recovery id: must be present");return T}addRecoveryBit(T){return new L(this.r,this.s,T)}recoverPublicKey(T){let{r:I,s:q}=this,N=this.assertRecovery(),H=N===2||N===3?I+c:I;if(!s.isValid(H))throw Error("invalid recovery id: sig.r+curve.n != R.x");let G=s.toBytes(H),re=e.fromBytes(Jt(tP((N&1)===0),G)),ae=a.inv(H),me=J(Ye(T,void 0,"msgHash")),be=a.create(-me*ae),ve=a.create(q*ae),Ae=e.BASE.multiplyUnsafe(be).add(re.multiplyUnsafe(ve));if(Ae.is0())throw Error("invalid recovery: point at infinify");return Ae.assertValidity(),Ae}hasHighS(){return x(this.s)}toBytes(T=y.format){if(VS(T),T==="der")return ja(fn.hexFromSig(this));let{r:I,s:q}=this,N=a.toBytes(I),H=a.toBytes(q);if(T==="recovered")return A(),Jt(Uint8Array.of(this.assertRecovery()),N,H);return Jt(N,H)}toHex(T){return Ba(this.toBytes(T))}}Object.freeze(L.prototype),Object.freeze(L);let z=r.bits2int===void 0?function(I){if(I.length>8192)throw Error("input is too large");let q=Is(I),N=I.length*8-u;return N>0?q>>BigInt(N):q}:r.bits2int,J=r.bits2int_modN===void 0?function(I){return a.create(z(I))}:r.bits2int_modN,P=yu(u);function W(T){return bo("num < 2^"+u,T,jn,P),a.toBytes(T)}function ee(T,I){return Ye(T,void 0,"message"),I?Ye(o(T),void 0,"prehashed message"):T}function j(T,I,q){let{lowS:N,prehash:H,extraEntropy:G}=HS(q,y);T=ee(T,H);let re=J(T),ae=a.fromBytes(I);if(!a.isValidNot0(ae))throw Error("invalid private key");let me=[W(ae),W(re)];if(G!=null&&G!==!1){let Ie=G===!0?n(b.secretKey):G;me.push(Ye(Ie,void 0,"extraEntropy"))}let be=Jt(...me),ve=re;function Ae(Ie){let we=z(Ie);if(!a.isValidNot0(we))return;let Ue=a.inv(we),De=e.BASE.multiply(we).toAffine(),Qe=a.create(De.x);if(Qe===jn)return;let bt=a.create(Ue*a.create(ve+Qe*ae));if(bt===jn)return;let Tt=(De.x===Qe?0:2)|Number(De.y&di),Dt=bt;if(N&&x(bt))Dt=a.neg(bt),Tt^=1;return new L(Qe,Dt,S?void 0:Tt)}return{seed:be,k2sig:Ae}}function R(T,I,q={}){let{seed:N,k2sig:H}=j(T,I,q);return $1(o.outputLen,a.BYTES,i)(N,H).toBytes(q.format)}function B(T,I,q,N={}){let{lowS:H,prehash:G,format:re}=HS(N,y);if(q=Ye(q,void 0,"publicKey"),I=ee(I,G),!Za(T)){let ae=T instanceof L?", use sig.toBytes()":"";throw Error("verify expects Uint8Array signature"+ae)}O(T,re);try{let ae=L.fromBytes(T,re),me=e.fromBytes(q);if(H&&ae.hasHighS())return!1;let{r:be,s:ve}=ae,Ae=J(I),Ie=a.inv(ve),we=a.create(Ae*Ie),Ue=a.create(be*Ie),De=e.BASE.multiplyUnsafe(we).add(me.multiplyUnsafe(Ue));if(De.is0())return!1;return a.create(De.x)===be}catch(ae){return!1}}function k(T,I,q={}){let{prehash:N}=HS(q,y);return I=ee(I,N),L.fromBytes(T,"recovered").recoverPublicKey(I).toBytes()}return Object.freeze({keygen:d,getPublicKey:f,getSharedSecret:m,utils:h,lengths:b,Point:e,sign:R,verify:B,recoverPublicKey:k,Signature:L,hash:o})}var Q1=(e,t)=>(e+(e>=0?t:-t)/X1)/t,Y1,fn,jn,di,X1,Vp,yH;var oP=v(()=>{ql();Fr();ui();Hp();Su();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */Y1=class Y1 extends Error{constructor(e=""){super(e)}};fn={Err:Y1,_tlv:{encode:(e,t)=>{let{Err:r}=fn;if(Bn(e,"tag"),e<0||e>255)throw new r("tlv.encode: wrong tag");if(typeof t!=="string")throw TypeError('"data" expected string, got type='+typeof t);if(t.length&1)throw new r("tlv.encode: unpadded data");let o=t.length/2,n=hu(o);if(n.length/2&128)throw new r("tlv.encode: long form length too big");let i=o>127?hu(n.length/2|128):"";return hu(e)+i+n+t},decode(e,t){let{Err:r}=fn;t=Ye(t,void 0,"DER data");let o=0;if(e<0||e>255)throw new r("tlv.encode: wrong tag");if(t.length<2||t[o++]!==e)throw new r("tlv.decode: wrong tlv");let n=t[o++],i=!!(n&128),s=0;if(!i)s=n;else{let c=n&127;if(!c)throw new r("tlv.decode(long): indefinite length not supported");if(c>4)throw new r("tlv.decode(long): byte length is too big");let u=t.subarray(o,o+c);if(u.length!==c)throw new r("tlv.decode: length bytes not complete");if(u[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(let d of u)s=s<<8|d;if(o+=c,s<128)throw new r("tlv.decode(long): not minimal encoding")}let a=t.subarray(o,o+s);if(a.length!==s)throw new r("tlv.decode: wrong value length");return{v:a,l:t.subarray(o+s)}}},_int:{encode(e){let{Err:t}=fn;if(Mp(e),e<jn)throw new t("integer: negative integers are not allowed");let r=hu(e);if(Number.parseInt(r[0],16)&8)r="00"+r;if(r.length&1)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=fn;if(e.length<1)throw new t("invalid signature integer: empty");if(e[0]&128)throw new t("invalid signature integer: negative");if(e.length>1&&e[0]===0&&!(e[1]&128))throw new t("invalid signature integer: unnecessary leading zero");return Is(e)}},toSig(e){let{Err:t,_int:r,_tlv:o}=fn,n=Ye(e,void 0,"signature"),{v:i,l:s}=o.decode(48,n);if(s.length)throw new t("invalid signature: left bytes after parsing");let{v:a,l:c}=o.decode(2,i),{v:u,l:d}=o.decode(2,c);if(d.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(u)}},hexFromSig(e){let{_tlv:t,_int:r}=fn,o=t.encode(2,r.encode(e.r)),n=t.encode(2,r.encode(e.s)),i=o+n;return t.encode(48,i)}};Object.freeze(fn._tlv);Object.freeze(fn._int);Object.freeze(fn);jn=BigInt(0),di=BigInt(1),X1=BigInt(2),Vp=BigInt(3),yH=BigInt(4)});var SH,vH,Fa;var iP=v(()=>{Ia();oP();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */SH=(()=>({p:BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff"),n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),h:BigInt(1),a:BigInt("0xffffffff00000001000000000000000000000000fffffffffffffffffffffffc"),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5")}))(),vH=eP(SH),Fa=nP(vH,vt)});function xH(e,t,r,o){let n=e.sqr(r),i=e.sqr(o),s=e.add(e.mul(t.a,n),i),a=e.add(e.ONE,e.mul(t.d,e.mul(n,i)));return e.eql(s,a)}function sP(e,t={}){let r=t,o=Jp("edwards",e,r,r.FpFnLE),{Fp:n,Fn:i}=o,s=o.CURVE,{h:a}=s;Wr(r,{},{uvRatio:"function"});let c=WS<<BigInt(i.BYTES*8)-xr,u=(y)=>n.create(y),d=r.uvRatio===void 0?(y,S)=>{try{return{isValid:!0,value:n.sqrt(n.div(y,S))}}catch(x){return{isValid:!1,value:fi}}}:r.uvRatio;if(!xH(n,s,s.Gx,s.Gy))throw Error("bad curve params: generator point");function f(y,S,x=!1){let _=x?xr:fi;return bo("coordinate "+y,S,_,c),S}function m(y){if(!(y instanceof h))throw Error("EdwardsPoint expected")}class h{static BASE=new h(s.Gx,s.Gy,xr,u(s.Gx*s.Gy));static ZERO=new h(fi,xr,xr,fi);static Fp=n;static Fn=i;X;Y;Z;T;constructor(y,S,x,_){this.X=f("x",y),this.Y=f("y",S),this.Z=f("z",x,!0),this.T=f("t",_),Object.freeze(this)}static CURVE(){return s}static fromAffine(y){if(y instanceof h)throw Error("extended point not allowed");let{x:S,y:x}=y||{};return f("x",S),f("y",x),new h(S,x,xr,u(S*x))}static fromBytes(y,S=!1){let x=n.BYTES,{a:_,d:A}=s;y=li(Ye(y,x,"point")),yo(S,"zip215");let O=li(y),L=y[x-1];O[x-1]=L&-129;let z=dn(O),J=S?c:n.ORDER;bo("point.y",z,fi,J);let P=u(z*z),W=u(P-xr),ee=u(A*P-_),{isValid:j,value:R}=d(W,ee);if(!j)throw Error("bad point: invalid y coordinate");let B=(R&xr)===xr,k=(L&128)!==0;if(!S&&R===fi&&k)throw Error("bad point: x=0 and x_0=1");if(k!==B)R=u(-R);return h.fromAffine({x:R,y:z})}static fromHex(y,S=!1){return h.fromBytes(ja(y),S)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}precompute(y=8,S=!0){if(b.createCache(this,y),!S)this.multiply(WS);return this}assertValidity(){let y=this,{a:S,d:x}=s;if(y.is0())throw Error("bad point: ZERO");let{X:_,Y:A,Z:O,T:L}=y,z=u(_*_),J=u(A*A),P=u(O*O),W=u(P*P),ee=u(z*S),j=u(P*u(ee+J)),R=u(W+u(x*u(z*J)));if(j!==R)throw Error("bad point: equation left != right (1)");let B=u(_*A),k=u(O*L);if(B!==k)throw Error("bad point: equation left != right (2)")}equals(y){m(y);let{X:S,Y:x,Z:_}=this,{X:A,Y:O,Z:L}=y,z=u(S*L),J=u(A*_),P=u(x*L),W=u(O*_);return z===J&&P===W}is0(){return this.equals(h.ZERO)}negate(){return new h(u(-this.X),this.Y,this.Z,u(-this.T))}double(){let{a:y}=s,{X:S,Y:x,Z:_}=this,A=u(S*S),O=u(x*x),L=u(WS*u(_*_)),z=u(y*A),J=S+x,P=u(u(J*J)-A-O),W=z+O,ee=W-L,j=z-O,R=u(P*ee),B=u(W*j),k=u(P*j),T=u(ee*W);return new h(R,B,T,k)}add(y){m(y);let{a:S,d:x}=s,{X:_,Y:A,Z:O,T:L}=this,{X:z,Y:J,Z:P,T:W}=y,ee=u(_*z),j=u(A*J),R=u(L*x*W),B=u(O*P),k=u((_+A)*(z+J)-ee-j),T=B-R,I=B+R,q=u(j-S*ee),N=u(k*T),H=u(I*q),G=u(k*q),re=u(T*I);return new h(N,H,re,G)}subtract(y){return m(y),this.add(y.negate())}multiply(y){if(!i.isValidNot0(y))throw RangeError("invalid scalar: expected 1 <= sc < curve.n");let{p:S,f:x}=b.cached(this,y,(_)=>Rs(h,_));return Rs(h,[S,x])[0]}multiplyUnsafe(y){if(!i.isValid(y))throw RangeError("invalid scalar: expected 0 <= sc < curve.n");if(y===fi)return h.ZERO;if(this.is0()||y===xr)return this;return b.unsafe(this,y,(S)=>Rs(h,S))}isSmallOrder(){return this.clearCofactor().is0()}isTorsionFree(){return b.unsafe(this,s.n).is0()}toAffine(y){let S=this,x=y,{X:_,Y:A,Z:O}=S,L=S.is0();if(x==null)x=L?wH:n.inv(O);let z=u(_*x),J=u(A*x),P=n.mul(O,x);if(L)return{x:fi,y:xr};if(P!==xr)throw Error("invZ was invalid");return{x:z,y:J}}clearCofactor(){if(a===xr)return this;return this.multiplyUnsafe(a)}toBytes(){let{x:y,y:S}=this.toAffine(),x=n.toBytes(S);return x[x.length-1]|=y&xr?128:0,x}toHex(){return Ba(this.toBytes())}toString(){return`<Point ${this.is0()?"ZERO":this.toHex()}>`}}let b=new wu(h,i.BITS);if(i.BITS>=8)h.BASE.precompute(8);return Object.freeze(h.prototype),Object.freeze(h),h}class GS{static BASE;static ZERO;static Fp;static Fn;ep;constructor(e){this.ep=e}static fromBytes(e){BS()}static fromHex(e){BS()}get x(){return this.toAffine().x}get y(){return this.toAffine().y}clearCofactor(){return this}assertValidity(){this.ep.assertValidity()}toAffine(e){return this.ep.toAffine(e)}toHex(){return Ba(this.toBytes())}toString(){return this.toHex()}isTorsionFree(){return!0}isSmallOrder(){return!1}add(e){return this.assertSame(e),this.init(this.ep.add(e.ep))}subtract(e){return this.assertSame(e),this.init(this.ep.subtract(e.ep))}multiply(e){return this.init(this.ep.multiply(e))}multiplyUnsafe(e){return this.init(this.ep.multiplyUnsafe(e))}double(){return this.init(this.ep.double())}negate(){return this.init(this.ep.negate())}precompute(e,t){return this.ep.precompute(e,t),this}}var fi,xr,WS,wH;var aP=v(()=>{ui();Hp();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */fi=BigInt(0),xr=BigInt(1),WS=BigInt(2),wH=BigInt(8)});function _H(e){return Wr(e,{P:"bigint",type:"string",adjustScalarBytes:"function",powPminus2:"function"},{randomBytes:"function"}),Object.freeze({...e})}function cP(e){let t=_H(e),{P:r,type:o,adjustScalarBytes:n,powPminus2:i,randomBytes:s}=t,a=o==="x25519";if(!a&&o!=="x448")throw Error("invalid type");let c=s===void 0?Ua:s,u=a?255:448,d=a?32:56,f=a?BigInt(9):BigInt(5),m=a?BigInt(121665):BigInt(39081),h=a?Wp**BigInt(254):Wp**BigInt(447),b=a?BigInt(8)*Wp**BigInt(251)-Ka:BigInt(4)*Wp**BigInt(445)-Ka,y=h+b+Ka,S=(k)=>it(k,r),x=_(f);function _(k){return gu(S(k),d)}function A(k){let T=li(Ye(k,d,"uCoordinate"));if(a)T[31]&=127;return S(dn(T))}function O(k){return dn(n(li(Ye(k,d,"scalar"))))}function L(k,T){let I=ee(A(T),O(k));if(I===Eu)throw Error("invalid private or public key received");return _(I)}function z(k){return L(k,x)}let J=z,P=L;function W(k,T,I){let q=S(k*(T-I));return T=S(T-q),I=S(I+q),{x_2:T,x_3:I}}function ee(k,T){bo("u",k,Eu,r),bo("scalar",T,h,y);let I=T,q=k,N=Ka,H=Eu,G=k,re=Ka,ae=Eu;for(let be=BigInt(u-1);be>=Eu;be--){let ve=I>>be&Ka;ae^=ve,{x_2:N,x_3:G}=W(ae,N,G),{x_2:H,x_3:re}=W(ae,H,re),ae=ve;let Ae=N+H,Ie=S(Ae*Ae),we=N-H,Ue=S(we*we),De=Ie-Ue,Qe=G+re,bt=G-re,Tt=S(bt*Ae),Dt=S(Qe*we),lt=Tt+Dt,$r=Tt-Dt;G=S(lt*lt),re=S(q*S($r*$r)),N=S(Ie*Ue),H=S(De*(Ie+S(m*De)))}({x_2:N,x_3:G}=W(ae,N,G)),{x_2:H,x_3:re}=W(ae,H,re);let me=i(H);return S(N*me)}let j={secretKey:d,publicKey:d,seed:d},R=(k)=>(k=k===void 0?c(d):k,Ye(k,j.seed,"seed"),k),B={randomSecretKey:R};return Object.freeze(j),Object.freeze(B),Object.freeze({keygen:xu(R,J),getSharedSecret:P,getPublicKey:J,scalarMult:L,scalarMultBase:z,utils:B,GuBytes:x.slice(),lengths:j})}var Eu,Ka,Wp;var lP=v(()=>{ui();Hp();Su();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */Eu=BigInt(0),Ka=BigInt(1),Wp=BigInt(2)});function pP(e){let t=BigInt(10),r=BigInt(20),o=BigInt(40),n=BigInt(80),i=Os,a=e*e%i*e%i,c=Gr(a,uP,i)*a%i,u=Gr(c,vo,i)*e%i,d=Gr(u,IH,i)*u%i,f=Gr(d,t,i)*d%i,m=Gr(f,r,i)*f%i,h=Gr(m,o,i)*m%i,b=Gr(h,n,i)*h%i,y=Gr(b,n,i)*h%i,S=Gr(y,t,i)*d%i;return{pow_p_5_8:Gr(S,uP,i)*e%i,b2:a}}function TH(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function tv(e,t){let r=Os,o=it(t*t*t,r),n=it(o*o*t,r),i=pP(e*n).pow_p_5_8,s=it(e*o*i,r),a=it(t*s*s,r),c=s,u=it(s*QS,r),d=a===e,f=a===it(-e,r),m=a===it(-e*QS,r);if(d)s=c;if(f||m)s=u;if(So(s,r))s=it(-s,r);return{isValid:d||f,value:s}}function fP(e){let{d:t}=ev,r=Os,o=(x)=>pi.create(x),n=o(YS*e*e),i=o((n+vo)*OH),s=BigInt(-1),a=o((s-t*n)*o(n+t)),{isValid:c,value:u}=tv(i,a),d=o(u*e);if(!So(d,r))d=o(-d);if(!c)u=d;if(!c)s=n;let f=o(s*(n-vo)*CH-a),m=u*u,h=o((u+u)*a),b=o(f*RH),y=o(vo-m),S=o(vo+m);return new $s(o(h*S),o(y*b),o(b*S),o(h*y))}var EH,vo,uP,kH,IH,AH,Os,ev,QS,$s,pi,mP,Gp,YS,RH,$H,OH,CH,dP=(e)=>tv(vo,e),PH,XS=(e)=>pi.create(dn(e)&PH),dr,zH;var hP=v(()=>{Ia();Fr();aP();G1();Su();lP();ui();/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */EH=BigInt(0),vo=BigInt(1),uP=BigInt(2),kH=BigInt(3),IH=BigInt(5),AH=BigInt(8),Os=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffed"),ev=(()=>({p:Os,n:BigInt("0x1000000000000000000000000000000014def9dea2f79cd65812631a5cf5d3ed"),h:AH,a:BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffec"),d:BigInt("0x52036cee2b6ffe738cc740797779e89800700a4d4141d8ab75eb4dca135978a3"),Gx:BigInt("0x216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a"),Gy:BigInt("0x6666666666666666666666666666666666666666666666666666666666666658")}))();QS=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");$s=sP(ev,{uvRatio:tv}),pi=(()=>$s.Fp)(),mP=(()=>$s.Fn)(),Gp=(()=>{let e=Os;return cP({P:e,type:"x25519",powPminus2:(t)=>{let{pow_p_5_8:r,b2:o}=pP(t);return it(Gr(r,kH,e)*o,e)},adjustScalarBytes:TH})})(),YS=QS,RH=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),$H=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),OH=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),CH=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),PH=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");dr=class dr extends GS{static BASE=(()=>new dr($s.BASE))();static ZERO=(()=>new dr($s.ZERO))();static Fp=(()=>pi)();static Fn=(()=>mP)();constructor(e){super(e)}static fromAffine(e){return new dr($s.fromAffine(e))}assertSame(e){if(!(e instanceof dr))throw Error("RistrettoPoint expected")}init(e){return new dr(e)}static fromBytes(e){Mt(e,32);let{a:t,d:r}=ev,o=Os,n=(A)=>pi.create(A),i=XS(e);if(!R1(pi.toBytes(i),e)||So(i,o))throw Error("invalid ristretto255 encoding 1");let s=n(i*i),a=n(vo+t*s),c=n(vo-t*s),u=n(a*a),d=n(c*c),f=n(t*r*u-d),{isValid:m,value:h}=dP(n(f*d)),b=n(h*c),y=n(h*b*f),S=n((i+i)*b);if(So(S,o))S=n(-S);let x=n(a*y),_=n(S*x);if(!m||So(_,o)||x===EH)throw Error("invalid ristretto255 encoding 2");return new dr(new $s(S,x,vo,_))}static fromHex(e){return dr.fromBytes(Ml(e))}toBytes(){let{X:e,Y:t,Z:r,T:o}=this.ep,n=Os,i=(y)=>pi.create(y),s=i(i(r+t)*i(r-t)),a=i(e*t),c=i(a*a),{value:u}=dP(i(s*c)),d=i(u*s),f=i(u*a),m=i(d*f*o),h;if(So(o*m,n)){let y=i(t*YS),S=i(e*YS);e=y,t=S,h=i(d*$H)}else h=f;if(So(e*m,n))t=i(-t);let b=i((r-t)*h);if(So(b,n))b=i(-b);return pi.toBytes(b)}equals(e){this.assertSame(e);let{X:t,Y:r}=this.ep,{X:o,Y:n}=e.ep,i=(c)=>pi.create(c),s=i(t*n)===i(r*o),a=i(r*n)===i(t*o);return s||a}is0(){return this.equals(dr.ZERO)}};Object.freeze(dr.BASE);Object.freeze(dr.ZERO);Object.freeze(dr.prototype);Object.freeze(dr);zH=Object.freeze({Point:dr,hashToCurve(e,t){let r=t?.DST===void 0?"ristretto255_XMD:SHA-512_R255MAP_RO_":t.DST,o=JS(e,r,64,up);return zH.deriveToCurve(o)},hashToScalar(e,t={DST:W1}){let r=JS(e,t.DST,64,up);return mP.create(dn(r))},deriveToCurve(e){Mt(e,64);let t=XS(e.subarray(0,32)),r=fP(t),o=XS(e.subarray(32,64)),n=fP(o);return new dr(r.add(n))}})});async function yP(e,t){if(NH)return await t();try{return await e()}catch(r){if(r instanceof ReferenceError||r instanceof DOMException&&r.name==="NotSupportedError")return await t();else throw r}}async function Qp(e,t){return await yP(async()=>{let r=rv(e)?e:await LH(e),o=await crypto.subtle.importKey("raw",BH(t),{name:"X25519"},gP,[]);return new Uint8Array(await crypto.subtle.deriveBits({name:"X25519",public:o},r,256))},()=>{if(rv(e))throw Error("CryptoKey provided but X25519 WebCrypto is not supported");return Gp.scalarMult(e,t)})}async function ku(e){return await yP(async()=>Qp(e,Gp.GuBytes),()=>{if(rv(e))throw Error("CryptoKey provided but X25519 WebCrypto is not supported");return Gp.scalarMultBase(e)})}async function LH(e){if(e.length!==32)throw Error("X25519 private key must be 32 bytes");let t=new Uint8Array([...DH,...e]);return crypto.subtle.importKey("pkcs8",t,{name:"X25519"},gP,["deriveBits"])}function rv(e){return typeof CryptoKey<"u"&&e instanceof CryptoKey}function BH(e){return e}var gP=!1,NH=!1,DH;var bP=v(()=>{hP();DH=new Uint8Array([48,46,2,1,0,48,5,6,3,43,101,110,4,34,4,32])});class nv{s;transcript=[];buf=new Uint8Array(0);constructor(e){this.s=e.getReader()}async readLine(){let e=[];while(!0){let t=this.buf.indexOf(10);if(t>=0)return e.push(this.buf.subarray(0,t)),this.transcript.push(this.buf.subarray(0,t+1)),this.buf=this.buf.subarray(t+1),ZH(Cs(e));if(this.buf.length>0)e.push(this.buf),this.transcript.push(this.buf);let r=await this.s.read();if(r.done)return this.buf=Cs(e),null;this.buf=r.value}}close(){return this.s.releaseLock(),{rest:this.buf,transcript:Cs(this.transcript)}}}function ZH(e){return e.forEach((t)=>{if(t<32||t>126)throw Error("invalid non-ASCII byte in header")}),new TextDecoder().decode(e)}function Cs(e){let t=e.reduce((n,i)=>n+i.length,0),r=new Uint8Array(t),o=0;for(let n of e)r.set(n,o),o+=n.length;return r}function Ja(e,...t){return e.pipeThrough(new TransformStream({start(r){for(let o of t)r.enqueue(o)}}))}function Yp(e){return new ReadableStream({start(t){t.enqueue(e),t.close()}})}async function ov(e){if(!(e instanceof ReadableStream))throw Error("readAll expects a ReadableStream<Uint8Array>");return new Uint8Array(await new Response(e).arrayBuffer())}async function SP(e){if(!(e instanceof ReadableStream))throw Error("readAllString expects a ReadableStream<Uint8Array>");return await new Response(e).text()}async function vP(e,t){let r=e.getReader(),o=[],n=0;while(n<t){let{done:c,value:u}=await r.read();if(c)throw Error("stream ended before reading "+t.toString()+" bytes");o.push(u),n+=u.length}r.releaseLock();let i=Cs(o),s=i.subarray(0,t),a=Ja(e,i.subarray(t));return{data:s,rest:a}}var iv=()=>{};class Zn{args;body;constructor(e,t){this.args=e,this.body=t}}async function UH(e){let t=await e.readLine();if(t===null)throw Error("invalid stanza");let r=t.split(" ");if(r.length<2||r.shift()!=="->")return{next:t};for(let i of r)if(i.length===0)throw Error("invalid stanza");let o=[];for(;;){let i=await e.readLine();if(i===null)throw Error("invalid stanza");let s=Yt.decode(i);if(s.length>48)throw Error("invalid stanza");if(o.push(s),s.length<48)break}let n=Cs(o);return{s:new Zn(r,n)}}async function wP(e){let t=new nv(e),r=await t.readLine();if(r!=="age-encryption.org/v1")throw Error("invalid version "+(r??"line"));let o=[];for(;;){let{s:n,next:i}=await UH(t);if(n!==void 0){o.push(n);continue}if(!i.startsWith("--- "))throw Error("invalid header");let s=Yt.decode(i.slice(4)),{rest:a,transcript:c}=t.close(),u=c.slice(0,c.length-1-i.length+3);return{stanzas:o,headerNoMAC:u,MAC:s,headerSize:c.length,rest:Ja(e,a)}}}function sv(e){let t=[];t.push(`age-encryption.org/v1
|
|
4
|
+
`);for(let r of e){t.push("-> "+r.args.join(" ")+`
|
|
5
|
+
`);for(let o=0;o<r.body.length;o+=48){let n=o+48;if(n>r.body.length)n=r.body.length;t.push(Yt.encode(r.body.subarray(o,n))+`
|
|
6
|
+
`)}if(r.body.length%48===0)t.push(`
|
|
7
|
+
`)}return t.push("---"),new TextEncoder().encode(t.join(""))}function xP(e,t){return Cs([sv(e),new TextEncoder().encode(" "+Yt.encode(t)+`
|
|
8
|
+
`)])}var Xp=v(()=>{Wl();iv()});function lv(){return _P()}function _P(){let e=co(32),t=zr.encodeFromBytes("AGE-SECRET-KEY-",e).toUpperCase();return Promise.resolve(t)}async function tm(e){let t;if(kP(e))t=e;else if(e.startsWith("AGE-SECRET-KEY-PQ-1")){let o=zr.decodeToBytes(e);if(o.prefix.toUpperCase()!=="AGE-SECRET-KEY-PQ-"||o.bytes.length!==32)throw Error("invalid identity");let n=jp.getPublicKey(o.bytes);return zr.encode("age1pq",zr.toWords(n),!1)}else{let o=zr.decodeToBytes(e);if(!e.startsWith("AGE-SECRET-KEY-1")||o.prefix.toUpperCase()!=="AGE-SECRET-KEY-"||o.bytes.length!==32)throw Error("invalid identity");t=o.bytes}let r=await ku(t);return zr.encodeFromBytes("age",r)}class uv{recipient;constructor(e){let t=zr.decodeToBytes(e);if(!e.startsWith("age1pq1")||t.prefix.toLowerCase()!=="age1pq"||t.bytes.length!==1216)throw Error("invalid recipient");this.recipient=t.bytes}wrapFileKey(e){let{cipherText:t,sharedSecret:r}=jp.encapsulate(this.recipient),o=new TextEncoder().encode("age-encryption.org/mlkem768x25519"),{key:n,nonce:i}=rm(EP,r,o),s=Jr(n,i).encrypt(e);return[new Zn(["mlkem768x25519",Yt.encode(t)],s)]}}class dv{identity;constructor(e){let t=zr.decodeToBytes(e);if(!e.startsWith("AGE-SECRET-KEY-PQ-1")||t.prefix.toUpperCase()!=="AGE-SECRET-KEY-PQ-"||t.bytes.length!==32)throw Error("invalid identity");this.identity=t.bytes}unwrapFileKey(e){for(let t of e){if(t.args.length<1||t.args[0]!=="mlkem768x25519")continue;if(t.args.length!==2)throw Error("invalid mlkem768x25519 stanza");let r=Yt.decode(t.args[1]);if(r.length!==1120)throw Error("invalid mlkem768x25519 stanza");if(t.body.length!==32)throw Error("invalid mlkem768x25519 stanza");let o=jp.decapsulate(r,this.identity),n=new TextEncoder().encode("age-encryption.org/mlkem768x25519"),{key:i,nonce:s}=rm(EP,o,n);try{return Jr(i,s).decrypt(t.body)}catch{continue}}return null}}function rm(e,t,r){let o=qH(e),n=em(o,void 0,"psk_id_hash",new Uint8Array(0)),i=em(o,void 0,"info_hash",r),s=new Uint8Array(1+n.length+i.length);s[0]=0,s.set(n,1),s.set(i,1+n.length);let a=em(o,t,"secret",new Uint8Array(0)),c=cv(o,a,"key",s,32),u=cv(o,a,"base_nonce",s,12);return{key:c,nonce:u}}function qH(e){let t=new Uint8Array(10);return t.set(new TextEncoder().encode("HPKE"),0),t[4]=e>>8&255,t[5]=e&255,t[6]=0,t[7]=1,t[8]=0,t[9]=3,t}function em(e,t,r,o){let n=new Uint8Array(7+e.length+r.length+o.length),i=0;return n.set(new TextEncoder().encode("HPKE-v1"),i),i+=7,n.set(e,i),i+=e.length,n.set(new TextEncoder().encode(r),i),i+=r.length,n.set(o,i),Fl(vt,n,t)}function cv(e,t,r,o,n){let i=new Uint8Array(9+e.length+r.length+o.length),s=0;return i[s]=n>>8&255,i[s+1]=n&255,s+=2,i.set(new TextEncoder().encode("HPKE-v1"),s),s+=7,i.set(e,s),s+=e.length,i.set(new TextEncoder().encode(r),s),s+=r.length,i.set(o,s),jb(vt,t,i,n)}function FH(e){if(e.length!==Fa.lengths.publicKeyUncompressed)e=Fa.Point.fromBytes(e).toBytes(!1);let t=Fa.utils.randomSecretKey(),r=Fa.getPublicKey(t,!1),o=Fa.getSharedSecret(t,e,!0).subarray(1),n=new Uint8Array(r.length+e.length);n.set(r,0),n.set(e,r.length);let i=new Uint8Array(5);i.set(new TextEncoder().encode("KEM"),0),i[3]=av>>8,i[4]=av&255;let s=em(i,void 0,"eae_prk",o),a=cv(i,s,"shared_secret",n,32);return{encapsulatedKey:r,sharedSecret:a}}class fv{recipient;constructor(e){let t=zr.decodeToBytes(e);if(!e.startsWith("age1tag1")||t.prefix.toLowerCase()!=="age1tag"||t.bytes.length!==33)throw Error("invalid recipient");this.recipient=t.bytes}wrapFileKey(e){let{encapsulatedKey:t,sharedSecret:r}=FH(this.recipient),o=new TextEncoder().encode("age-encryption.org/p256tag"),n=(()=>{let c=vt(this.recipient).subarray(0,4),u=new Uint8Array(t.length+c.length);return u.set(t,0),u.set(c,t.length),Fl(vt,u,o).subarray(0,4)})(),{key:i,nonce:s}=rm(av,r,o),a=Jr(i,s).encrypt(e);return[new Zn(["p256tag",Yt.encode(n),Yt.encode(t)],a)]}}class pv{recipient;constructor(e){let t=zr.decodeToBytes(e);if(!e.startsWith("age1tagpq1")||t.prefix.toLowerCase()!=="age1tagpq"||t.bytes.length!==1249)throw Error("invalid recipient");this.recipient=t.bytes}wrapFileKey(e){let{cipherText:t,sharedSecret:r}=I1.encapsulate(this.recipient),o=new TextEncoder().encode("age-encryption.org/mlkem768p256tag"),n=(()=>{let c=vt(this.recipient.subarray(1184)).subarray(0,4),u=new Uint8Array(t.length+c.length);return u.set(t,0),u.set(c,t.length),Fl(vt,u,o).subarray(0,4)})(),{key:i,nonce:s}=rm(MH,r,o),a=Jr(i,s).encrypt(e);return[new Zn(["mlkem768p256tag",Yt.encode(n),Yt.encode(t)],a)]}}class mv{recipient;constructor(e){let t=zr.decodeToBytes(e);if(!e.startsWith("age1")||t.prefix.toLowerCase()!=="age"||t.bytes.length!==32)throw Error("invalid recipient");this.recipient=t.bytes}async wrapFileKey(e){let t=co(32),r=await ku(t),o=await Qp(t,this.recipient),n=new Uint8Array(r.length+this.recipient.length);n.set(r),n.set(this.recipient,r.length);let i=new TextEncoder().encode("age-encryption.org/v1/X25519"),s=Wo(vt,o,n,i,32);return[new Zn(["X25519",Yt.encode(r)],yv(e,s))]}}class nm{identity;recipient;constructor(e){if(kP(e)){this.identity=e,this.recipient=ku(e);return}let t=zr.decodeToBytes(e);if(!e.startsWith("AGE-SECRET-KEY-1")||t.prefix.toUpperCase()!=="AGE-SECRET-KEY-"||t.bytes.length!==32)throw Error("invalid identity");this.identity=t.bytes,this.recipient=ku(t.bytes)}async unwrapFileKey(e){for(let t of e){if(t.args.length<1||t.args[0]!=="X25519")continue;if(t.args.length!==2)throw Error("invalid X25519 stanza");let r=Yt.decode(t.args[1]);if(r.length!==32)throw Error("invalid X25519 stanza");let o=await Qp(this.identity,r),n=await this.recipient,i=new Uint8Array(r.length+n.length);i.set(r),i.set(n,r.length);let s=new TextEncoder().encode("age-encryption.org/v1/X25519"),a=Wo(vt,o,i,s,32),c=bv(t.body,a);if(c!==null)return c}return null}}class hv{passphrase;logN;constructor(e,t){this.passphrase=e,this.logN=t}wrapFileKey(e){let t=co(16),r="age-encryption.org/v1/scrypt",o=new Uint8Array(44);o.set(new TextEncoder().encode("age-encryption.org/v1/scrypt")),o.set(t,28);let n=Qb(this.passphrase,o,{N:2**this.logN,r:8,p:1,dkLen:32});return[new Zn(["scrypt",Yt.encode(t),this.logN.toString()],yv(e,n))]}}class gv{passphrase;constructor(e){this.passphrase=e}unwrapFileKey(e){for(let t of e){if(t.args.length<1||t.args[0]!=="scrypt")continue;if(e.length!==1)throw Error("scrypt recipient is not the only one in the header");if(t.args.length!==3)throw Error("invalid scrypt stanza");if(!/^[1-9][0-9]*$/.test(t.args[2]))throw Error("invalid scrypt stanza");let r=Yt.decode(t.args[1]);if(r.length!==16)throw Error("invalid scrypt stanza");let o=Number(t.args[2]);if(o>20)throw Error("scrypt work factor is too high");let n="age-encryption.org/v1/scrypt",i=new Uint8Array(n.length+16);i.set(new TextEncoder().encode(n)),i.set(r,n.length);let s=Qb(this.passphrase,i,{N:2**o,r:8,p:1,dkLen:32}),a=bv(t.body,s);if(a!==null)return a}return null}}function yv(e,t){let r=new Uint8Array(12);return Jr(t,r).encrypt(e)}function bv(e,t){if(e.length!==32)throw Error("invalid stanza");let r=new Uint8Array(12);try{return Jr(t,r).decrypt(e)}catch{return null}}function kP(e){return typeof CryptoKey<"u"&&e instanceof CryptoKey}var EP=25722,MH=80,av=16;var Ps=v(()=>{Wl();Zb();Ia();PO();eS();A1();iP();Fr();Wl();bP();Xp();mi()});function IP(e){let t=new Uint8Array(12),r=()=>{for(let s=t.length-2;s>=0;s--)if(t[s]++,t[s]!==0)break},o=!0,n=new Uint8Array(Sv),i=0;return new TransformStream({transform(s,a){while(s.length>0){if(i===n.length){let u=Jr(e,t).decrypt(n);a.enqueue(u),r(),i=0,o=!1}let c=Math.min(n.length-i,s.length);n.set(s.subarray(0,c),i),i+=c,s=s.subarray(c)}},flush(s){t[11]=1;let a=Jr(e,t).decrypt(n.subarray(0,i));if(!o&&a.length===0)throw Error("final chunk is empty");s.enqueue(a)}})}function AP(e){if(e<zs)throw Error("ciphertext is too small");if(e===zs)return 0;let t=Math.floor(e/Sv),r=e%Sv;if(0<r&&r<=zs)throw Error("ciphertext size is invalid");let o=e;return o-=t*zs,o-=r>0?zs:0,o}function TP(e){let t=new Uint8Array(12),r=()=>{for(let i=t.length-2;i>=0;i--)if(t[i]++,t[i]!==0)break},o=new Uint8Array(vv),n=0;return new TransformStream({transform(i,s){while(i.length>0){if(n===o.length){let c=Jr(e,t).encrypt(o);s.enqueue(c),r(),n=0}let a=Math.min(o.length-n,i.length);o.set(i.subarray(0,a),n),n+=a,i=i.subarray(a)}},flush(i){t[11]=1;let s=Jr(e,t).encrypt(o.subarray(0,n));i.enqueue(s)}})}function RP(e){let t=Math.max(1,Math.ceil(e/vv));return e+zs*t}var zs=16,vv,Sv;var $P=v(()=>{eS();vv=(()=>65536)(),Sv=(()=>vv+zs)()});var hi={};Lt(hi,{decode:()=>JH,encode:()=>KH});function KH(e){let t=[];t.push(`-----BEGIN AGE ENCRYPTED FILE-----
|
|
9
|
+
`);for(let r=0;r<e.length;r+=48){let o=r+48;if(o>e.length)o=e.length;t.push(Hb.encode(e.subarray(r,o))+`
|
|
10
|
+
`)}return t.push(`-----END AGE ENCRYPTED FILE-----
|
|
11
|
+
`),t.join("")}function JH(e){let t=e.trim().replaceAll(`\r
|
|
12
|
+
`,`
|
|
13
|
+
`).split(`
|
|
14
|
+
`);if(t.shift()!=="-----BEGIN AGE ENCRYPTED FILE-----")throw Error("invalid header");if(t.pop()!=="-----END AGE ENCRYPTED FILE-----")throw Error("invalid footer");function r(o,n){if(o===t.length-1)return n.length>0&&n.length<=64&&n.length%4===0;return n.length===64}if(!t.every((o,n)=>r(n,o)))throw Error("invalid line length");if(!t.every((o)=>/^[A-Za-z0-9+/=]+$/.test(o)))throw Error("invalid base64");return Hb.decode(t.join(""))}var OP=v(()=>{Wl();mi()});var CP=v(()=>{mi();Xp();Ps();mi()});class Iu{passphrase=null;scryptWorkFactor=18;recipients=[];setPassphrase(e){if(this.passphrase!==null)throw Error("can encrypt to at most one passphrase");if(this.recipients.length!==0)throw Error("can't encrypt to both recipients and passphrases");this.passphrase=e}setScryptWorkFactor(e){this.scryptWorkFactor=e}addRecipient(e){if(this.passphrase!==null)throw Error("can't encrypt to both recipients and passphrases");if(typeof e==="string")if(e.startsWith("age1pq1"))this.recipients.push(new uv(e));else if(e.startsWith("age1tag1"))this.recipients.push(new fv(e));else if(e.startsWith("age1tagpq1"))this.recipients.push(new pv(e));else if(e.startsWith("age1"))this.recipients.push(new mv(e));else throw Error("unrecognized recipient type");else this.recipients.push(e)}async encrypt(e){let t=co(16),r=[],o=this.recipients;if(this.passphrase!==null)o=[new hv(this.passphrase,this.scryptWorkFactor)];for(let m of o)r.push(...await m.wrapFileKey(t));let n=new TextEncoder().encode("header"),i=Wo(vt,t,void 0,n,32),s=Cn(vt,i,sv(r)),a=xP(r,s),c=co(16),u=new TextEncoder().encode("payload"),d=Wo(vt,t,c,u,32),f=TP(d);if(!(e instanceof ReadableStream)){if(typeof e==="string")e=new TextEncoder().encode(e);return await ov(Ja(Yp(e).pipeThrough(f),a,c))}return Object.assign(Ja(e.pipeThrough(f),a,c),{size:(m)=>RP(m)+a.length+c.length})}}class Au{identities=[];addPassphrase(e){this.identities.push(new gv(e))}addIdentity(e){if(GH(e))this.identities.push(new nm(e));else if(typeof e==="string")if(e.startsWith("AGE-SECRET-KEY-1"))this.identities.push(new nm(e));else if(e.startsWith("AGE-SECRET-KEY-PQ-1"))this.identities.push(new dv(e));else throw Error("unrecognized identity type");else this.identities.push(e)}async decrypt(e,t){let r=e instanceof ReadableStream?e:Yp(e),{fileKey:o,headerSize:n,rest:i}=await this.decryptHeaderInternal(r),{data:s,rest:a}=await vP(i,16),c=new TextEncoder().encode("payload"),u=Wo(vt,o,s,c,32),d=IP(u),f=a.pipeThrough(d),m=Object.assign(f,{size:(h)=>AP(h-n-s.length)});if(e instanceof ReadableStream)return m;if(t==="text")return await SP(f);return await ov(f)}async decryptHeader(e){return(await this.decryptHeaderInternal(Yp(e))).fileKey}async decryptHeaderInternal(e){let t=await wP(e),r=await this.unwrapFileKey(t.stanzas);if(r===null)throw Error("no identity matched any of the file's recipients");let o=new TextEncoder().encode("header"),n=Wo(vt,r,void 0,o,32),i=Cn(vt,n,t.headerNoMAC);if(!WH(t.MAC,i))throw Error("invalid header HMAC");return{fileKey:r,headerSize:t.headerSize,rest:t.rest}}async unwrapFileKey(e){for(let t of this.identities){let r=await t.unwrapFileKey(e);if(r!==null)return r}return null}}function WH(e,t){if(e.length!==t.length)return!1;let r=0;for(let o=0;o<e.length;o++)r|=e[o]^t[o];return r===0}function GH(e){return typeof CryptoKey<"u"&&e instanceof CryptoKey}var mi=v(()=>{ql();Zb();Ia();Fr();Ps();Ps();Ps();Ps();Xp();$P();iv();OP();CP();Ps()});import{spawn as QH}from"child_process";var tr=async(e,t,r={})=>new Promise((o,n)=>{let i=QH(e,t,{stdio:["pipe","inherit","inherit"],env:r.env?{...process.env,...r.env}:process.env,cwd:r.cwd});if(i.on("error",n),i.on("close",(s)=>{if(s===0){o();return}n(Error(`${e} ${t.join(" ")} exited with code ${s??1}`))}),r.stdin)i.stdin.end(r.stdin);else i.stdin.end()});var Un=()=>{};function PP(e,t,r){if(r.length===0)return;e(`${t} (${r.length}):`);for(let o of r)e(` - ${o}`)}function wv(e,t,r){let o=t.filter((i)=>r(i)),n=t.filter((i)=>!r(i));PP(e,"Required before first deploy",o),PP(e,"Safe to ignore for now",n)}async function gi(e,t={}){let r=t.runCommand??tr;(t.logger??console.log)(`Pushing ${e.length} secrets to GitHub Secrets...`),await Promise.all(e.map(([n,i])=>r("gh",["secret","set",n],{stdin:i})))}var Tu=v(()=>{Un()});function Ha(e){let t=e?.trim().toLowerCase();if(!t)return;if(t==="gh"||t==="github")return"gh";if(t==="bw"||t==="bitwarden")return"bitwarden";throw Error(`Unsupported --push-to value: ${e}`)}import{existsSync as YH,mkdirSync as XH,readFileSync as xv,writeFileSync as _v}from"fs";import{dirname as eV,join as zP}from"path";async function NP(e,t={}){try{let r=await tV(e,t);return{success:!0,message:r.createdLocalKey?`Age key ready at ${r.identityPath}`:`Age key already ready at ${r.identityPath}`}}catch(r){return{success:!1,message:Ve(r,"Age key bootstrap failed")}}}async function tV(e,t={}){let r=t.logger??console.log,o=zP(e,".brains-ops","age","identity.txt"),n=!1,i,s;if(YH(o))i=Ru(xv(o,"utf8")),s=await tm(i);else XH(eV(o),{recursive:!0,mode:448}),i=await lv(),s=await tm(i),_v(o,nV(i,s),{encoding:"utf8",mode:384}),n=!0;rV(zP(e,"pilot.yaml"),s);let a=Ha(t.pushTo);if(a)await gi([["AGE_SECRET_KEY",xv(o,"utf8")]],{logger:r,runCommand:t.runCommand??tr});if(r(n?`Created ${o}`:`Reusing ${o}`),r(`Configured pilot.yaml agePublicKey ${s}`),a)r(`Pushed AGE_SECRET_KEY to ${a}`);return{createdLocalKey:n,identityPath:o,agePublicKey:s}}function rV(e,t){let r=xv(e,"utf8"),o=r.match(/^agePublicKey:\s*(.+)$/m),n=o?.[1]?.trim().replace(/^['"]|['"]$/g,"");if(n===t)return;if(n&&n!=="age1replace-with-your-public-key")throw Error(`pilot.yaml agePublicKey does not match local age identity (${n} !== ${t})`);if(o){_v(e,r.replace(/^agePublicKey:\s*.+$/m,`agePublicKey: ${t}`),"utf8");return}let i=r.endsWith(`
|
|
15
|
+
`)?`${r}agePublicKey: ${t}
|
|
16
|
+
`:`${r}
|
|
17
|
+
agePublicKey: ${t}
|
|
18
|
+
`;_v(e,i,"utf8")}function Ru(e){let t=e.split(/\r?\n/).map((r)=>r.trim()).find((r)=>r.startsWith("AGE-SECRET-KEY-"));if(!t)throw Error("Missing AGE-SECRET-KEY in age identity file");return t}function nV(e,t){return["# generated by brains-ops age-key:bootstrap",`# public key: ${t}`,e,""].join(`
|
|
19
|
+
`)}var Ev=v(()=>{mi();Tu();Un()});var om=`ARG BUN_VERSION=1.4.0
|
|
20
|
+
FROM oven/bun:\${BUN_VERSION}-slim AS runtime
|
|
21
|
+
|
|
22
|
+
LABEL ai.rizom.brain.watchdog="true"
|
|
23
|
+
|
|
24
|
+
WORKDIR /app
|
|
25
|
+
|
|
26
|
+
RUN apt-get update && apt-get install -y --no-install-recommends \\
|
|
27
|
+
curl ca-certificates git tini \\
|
|
28
|
+
chromium-headless-shell fontconfig \\
|
|
29
|
+
fonts-freefont-ttf fonts-ipafont-gothic fonts-liberation \\
|
|
30
|
+
fonts-noto-color-emoji fonts-tlwg-loma-otf fonts-unifont fonts-wqy-zenhei \\
|
|
31
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
32
|
+
|
|
33
|
+
ENV BUN_CHROME_PATH=/usr/bin/chromium-headless-shell
|
|
34
|
+
ENV XDG_DATA_HOME=/data
|
|
35
|
+
ENV XDG_CONFIG_HOME=/config
|
|
36
|
+
RUN mkdir -p /app/data /app/cache /app/brain-data && \\
|
|
37
|
+
chmod -R 777 /app/data /app/cache /app/brain-data
|
|
38
|
+
|
|
39
|
+
EXPOSE 8080
|
|
40
|
+
|
|
41
|
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 \\
|
|
42
|
+
CMD curl --fail --silent --show-error http://127.0.0.1:8080/health/live || exit 1
|
|
43
|
+
|
|
44
|
+
ENTRYPOINT ["/usr/bin/tini", "--"]
|
|
45
|
+
CMD ["bun", "--no-orphans", "./node_modules/@rizom/brain/dist/brain.js", "start"]
|
|
46
|
+
|
|
47
|
+
# --- standalone: bake full project into image (brain-cli deploy) ---
|
|
48
|
+
FROM runtime AS standalone
|
|
49
|
+
COPY package.json ./package.json
|
|
50
|
+
RUN bun install --production --ignore-scripts
|
|
51
|
+
COPY . .
|
|
52
|
+
|
|
53
|
+
# --- fleet: consume reviewed runtime dependencies without resolving updates ---
|
|
54
|
+
FROM runtime AS fleet
|
|
55
|
+
ARG RUNTIME_IMAGE_TAG
|
|
56
|
+
COPY deploy/runtime/\${RUNTIME_IMAGE_TAG}/package.json deploy/runtime/\${RUNTIME_IMAGE_TAG}/bun.lock ./
|
|
57
|
+
RUN bun install --production --frozen-lockfile --ignore-scripts
|
|
58
|
+
`;var DP=()=>{};var BP=`service: __SERVICE_NAME__
|
|
59
|
+
image: <%= ENV['IMAGE_REPOSITORY'] %>
|
|
60
|
+
|
|
61
|
+
servers:
|
|
62
|
+
web:
|
|
63
|
+
hosts:
|
|
64
|
+
- <%= ENV['SERVER_IP'] %>
|
|
65
|
+
|
|
66
|
+
proxy:
|
|
67
|
+
ssl:
|
|
68
|
+
certificate_pem: CERTIFICATE_PEM
|
|
69
|
+
private_key_pem: PRIVATE_KEY_PEM
|
|
70
|
+
hosts:
|
|
71
|
+
- <%= ENV['BRAIN_DOMAIN'] %>
|
|
72
|
+
# <% if ENV['WWW_DOMAIN'] && !ENV['WWW_DOMAIN'].empty? %>
|
|
73
|
+
- <%= ENV['WWW_DOMAIN'] %>
|
|
74
|
+
# <% end %>
|
|
75
|
+
- <%= ENV['PREVIEW_DOMAIN'] %>
|
|
76
|
+
app_port: 8080
|
|
77
|
+
healthcheck:
|
|
78
|
+
path: /health/ready
|
|
79
|
+
|
|
80
|
+
registry:
|
|
81
|
+
server: ghcr.io
|
|
82
|
+
username: <%= ENV['REGISTRY_USERNAME'] %>
|
|
83
|
+
password:
|
|
84
|
+
- KAMAL_REGISTRY_PASSWORD
|
|
85
|
+
|
|
86
|
+
builder:
|
|
87
|
+
arch: amd64
|
|
88
|
+
|
|
89
|
+
env:
|
|
90
|
+
clear:
|
|
91
|
+
NODE_ENV: production
|
|
92
|
+
# <% if ENV['LOCAL_MODELS'] && !ENV['LOCAL_MODELS'].empty? %>
|
|
93
|
+
MODEL_RUNTIME_URL: http://__SERVICE_NAME__-models:11434
|
|
94
|
+
# <% end %>
|
|
95
|
+
secret:
|
|
96
|
+
- OPENAI_API_KEY
|
|
97
|
+
- ANTHROPIC_API_KEY
|
|
98
|
+
- GOOGLE_GENERATIVE_AI_API_KEY
|
|
99
|
+
- GIT_SYNC_TOKEN
|
|
100
|
+
- DISCORD_BOT_TOKEN
|
|
101
|
+
- DISCORD_PUBLIC_KEY
|
|
102
|
+
- DISCORD_APPLICATION_ID
|
|
103
|
+
- ATPROTO_APP_PASSWORD
|
|
104
|
+
- SETUP_EMAIL_TO
|
|
105
|
+
- SETUP_EMAIL_API_KEY
|
|
106
|
+
- SETUP_EMAIL_FROM
|
|
107
|
+
|
|
108
|
+
# <% if ENV['LOCAL_MODELS'] && !ENV['LOCAL_MODELS'].empty? %>
|
|
109
|
+
accessories:
|
|
110
|
+
models:
|
|
111
|
+
image: ollama/ollama:0.40.11
|
|
112
|
+
host: <%= ENV['SERVER_IP'] %>
|
|
113
|
+
env:
|
|
114
|
+
clear:
|
|
115
|
+
# Agent prompts run to ~28k tokens; the default context cuts them.
|
|
116
|
+
OLLAMA_CONTEXT_LENGTH: "32768"
|
|
117
|
+
volumes:
|
|
118
|
+
- /opt/brain-models:/root/.ollama
|
|
119
|
+
options:
|
|
120
|
+
health-cmd: ollama list
|
|
121
|
+
health-interval: 30s
|
|
122
|
+
# <% end %>
|
|
123
|
+
|
|
124
|
+
volumes:
|
|
125
|
+
- /opt/brain-data:/app/brain-data
|
|
126
|
+
- /opt/brain-runtime:/app/data
|
|
127
|
+
- /opt/brain-state:/data
|
|
128
|
+
- /opt/brain-config:/config
|
|
129
|
+
- /opt/brain-dist:/app/dist
|
|
130
|
+
- /opt/brain.yaml:/app/brain.yaml
|
|
131
|
+
`;var LP=()=>{};function kv(e={}){let t=e.deployConfigPath??"config/deploy.yml";return`#!/usr/bin/env bash
|
|
132
|
+
set -euo pipefail
|
|
133
|
+
|
|
134
|
+
BRAIN_FILE="${e.brainYamlPath??"brain.yaml"}"
|
|
135
|
+
SSH_USER="$(ruby -e 'require "yaml"; config = YAML.load_file("${t}") || {}; puts(config.dig("ssh", "user") || "root")')"
|
|
136
|
+
IFS=',' read -ra HOSTS <<< "$KAMAL_HOSTS"
|
|
137
|
+
for host in "\${HOSTS[@]}"; do
|
|
138
|
+
scp -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null "$BRAIN_FILE" "\${SSH_USER}@\${host}:/opt/brain.yaml"
|
|
139
|
+
done
|
|
140
|
+
`}import{appendFileSync as yve,readFileSync as sV}from"fs";function Iv(e,t){let r=[],o=new Set,n=t?.skipSections??new Set,i=!1,s=!1,a=!1;for(let c of e.split(/\r?\n/)){let u=c.trim();if(aV.test(u)){i=n.has(u),s=!1,a=!1;continue}if(i)continue;if(u.startsWith("#")){if(u.includes("@required"))s=!0;if(u.includes("@sensitive"))a=!0;continue}let d=u.match(/^([A-Z][A-Z0-9_]*)=/);if(!d?.[1]){s=!1,a=!1;continue}let f=d[1];if(!o.has(f))o.add(f),r.push({key:f,required:s,sensitive:a});s=!1,a=!1}return r}function Av(e,t){return Iv(sV(e,"utf8"),t)}var aV;var jP=v(()=>{aV=/^# ---- .+ ----$/});import{existsSync as cV,readFileSync as lV}from"fs";import{homedir as uV}from"os";import{isAbsolute as dV,join as Tv,resolve as fV}from"path";function Dr(e){let t={};for(let r of[Tv(e,".env"),Tv(e,".env.local")]){if(!cV(r))continue;let o=pV(lV(r,"utf8"));for(let[n,i]of Object.entries(o))t[n]=i}return t}function jt(e,t,r){return t[e]??r[e]}function yi(e,t){if(e.startsWith("~/"))return Tv(process.env.HOME??uV(),e.slice(2));if(dV(e))return e;return fV(t,e)}function pV(e){let t={};for(let r of e.split(/\r?\n/)){let o=r.trim();if(o.length===0||o.startsWith("#"))continue;let n=r.match(/^\s*(?:export\s+)?([A-Z][A-Z0-9_]*)\s*=\s*(.*)\s*$/),i=n?.[1],s=n?.[2];if(!i||s===void 0)continue;t[i]=mV(s)}return t}function mV(e){if(e.length>=2&&e.startsWith("'")&&e.endsWith("'"))return e.slice(1,-1);if(e.length>=2&&e.startsWith('"')&&e.endsWith('"'))return e.slice(1,-1).replace(/\\n/g,`
|
|
141
|
+
`).replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\"/g,'"').replace(/\\\\/g,"\\");return e}var Rv=()=>{};function MP(e,t,r){if(t===r)return!1;return t.includes(SV[e])}function qP(){return om}function FP(e){if(e.includes('LABEL ai.rizom.brain.watchdog="true"')&&e.includes("http://127.0.0.1:8080/health/live")&&e.includes('ENTRYPOINT ["/usr/bin/tini", "--"]')&&e.includes("BUN_CHROME_PATH=/usr/bin/chromium-headless-shell")&&e.includes('CMD ["bun", "--no-orphans", "./node_modules/@rizom/brain/dist/brain.js", "start"]')){let i=om.indexOf("# --- fleet:");return e===om.slice(0,i)+`# --- fleet: install published brain at pinned version (ops deploy) ---
|
|
142
|
+
FROM runtime AS fleet
|
|
143
|
+
ARG BRAIN_VERSION
|
|
144
|
+
ARG SITE_PACKAGES
|
|
145
|
+
RUN test -n "$BRAIN_VERSION" \\
|
|
146
|
+
&& printf '{"name":"rover-pilot-runtime","private":true}\\n' > package.json \\
|
|
147
|
+
&& if [ -n "$SITE_PACKAGES" ]; then \\
|
|
148
|
+
bun add @rizom/brain@$BRAIN_VERSION $SITE_PACKAGES; \\
|
|
149
|
+
else \\
|
|
150
|
+
bun add @rizom/brain@$BRAIN_VERSION; \\
|
|
151
|
+
fi
|
|
152
|
+
`}let r=['CMD ["./node_modules/.bin/brain", "start"]','CMD ["bun", "./node_modules/@rizom/brain/dist/brain.js", "start"]','CMD ["bun", "--no-orphans", "./node_modules/@rizom/brain/dist/brain.js", "start"]'].some((n)=>e.includes(n)),o=e.includes("chromium-headless-shell");return r&&o&&["ARG BUN_VERSION=","FROM oven/bun:${BUN_VERSION}-slim AS runtime","FROM runtime AS standalone","FROM runtime AS fleet"].every((n)=>e.includes(n))}function am(e){return BP.replaceAll("__SERVICE_NAME__",e.serviceName)}function Va(e){return e.replace(/\nvolumes:\n(?: {2}- .*\n)+$/,`
|
|
153
|
+
volumes:
|
|
154
|
+
- __VOLUMES__
|
|
155
|
+
`)}function im(e){return e.replace(/\n {4}# <% if ENV\['WWW_DOMAIN'\] && !ENV\['WWW_DOMAIN'\]\.empty\? %>\n {4}- <%= ENV\['WWW_DOMAIN'\] %>\n {4}# <% end %>/,"")}function sm(e){return e.replace(/^ *# <% if ENV\['LOCAL_MODELS'\] && !ENV\['LOCAL_MODELS'\]\.empty\? %>\n[\s\S]*?^ *# <% end %>\n\n?/gm,"")}function KP(e,t,r=(o)=>o){let o=am({serviceName:t}),n=im(r(e))===im(r(o)),i=im(r(sm(e))),s=im(r(sm(o)));if(!n&&i===s)return!0;let a=vV.every((d)=>i.includes(d)),c=s.replace("path: /health/ready","path: /health"),u=Va(i);return i===c||!a&&(u===Va(s)||u===Va(c))}var UP,SV,vV;var bi=v(()=>{DP();LP();jP();Rv();UP=["create-predeploy-backup.ts","install-health-watchdog.ts","provision-server.ts","pull-local-models.ts","update-dns.ts","validate-secrets.ts","write-kamal-secrets.ts","write-ssh-key.ts"],SV={"create-predeploy-backup.ts":"brains-predeploy-backup-v1","install-health-watchdog.ts":"/usr/local/sbin/brains-health-watchdog","provision-server.ts":'requireEnv("HCLOUD_TOKEN")',"pull-local-models.ts":"export async function pullLocalModels","update-dns.ts":'requireEnv("CF_API_TOKEN")',"validate-secrets.ts":"const requiredKeys = schema","write-kamal-secrets.ts":".kamal/secrets","write-ssh-key.ts":'requireEnv("KAMAL_SSH_PRIVATE_KEY")'};vV=["/opt/brain-runtime:/app/data","/opt/brain-state:/data","/opt/brain-config:/config","/opt/brain-dist:/app/dist"]});function Z(e,t,r){function o(a,c){if(!a._zod)Object.defineProperty(a,"_zod",{value:{def:c,constr:s,traits:new Set},enumerable:!1});if(a._zod.traits.has(e))return;a._zod.traits.add(e),t(a,c);let u=s.prototype,d=Object.keys(u);for(let f=0;f<d.length;f++){let m=d[f];if(!(m in a))a[m]=u[m].bind(a)}}let n=r?.Parent??Object;class i extends n{}Object.defineProperty(i,"name",{value:e});function s(a){var c;let u=r?.Parent?new i:this;o(u,a),(c=u._zod).deferred??(c.deferred=[]);for(let d of u._zod.deferred)d();return u}return Object.defineProperty(s,"init",{value:o}),Object.defineProperty(s,Symbol.hasInstance,{value:(a)=>{if(r?.Parent&&a instanceof r.Parent)return!0;return a?._zod?.traits?.has(e)}}),Object.defineProperty(s,"name",{value:e}),s}function gt(e){if(e)Object.assign(Ns,e);return Ns}var JP,$v,Ov,Mn,Ds,Ns;var Ls=v(()=>{$v=Object.freeze({status:"aborted"});Ov=Symbol("zod_brand");Mn=class Mn extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};Ds=class Ds extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}};(JP=globalThis).__zod_globalConfig??(JP.__zod_globalConfig={});Ns=globalThis.__zod_globalConfig});var ue={};Lt(ue,{BIGINT_FORMAT_RANGES:()=>Zv,Class:()=>GP,NUMBER_FORMAT_RANGES:()=>jv,aborted:()=>xi,allowsEval:()=>Nv,assert:()=>AV,assertEqual:()=>_V,assertIs:()=>kV,assertNever:()=>IV,assertNotEqual:()=>EV,assignProp:()=>vi,base64ToUint8Array:()=>VP,base64urlToUint8Array:()=>FV,cached:()=>Qa,captureStackTrace:()=>lm,cleanEnum:()=>qV,cleanRegex:()=>Cu,clone:()=>fr,cloneDef:()=>RV,createTransparentProxy:()=>NV,defineLazy:()=>Ze,esc:()=>cm,escapeRegex:()=>Qr,explicitlyAborted:()=>Uv,extend:()=>BV,finalizeIssue:()=>pr,floatSafeRemainder:()=>Pv,getElementAtPath:()=>$V,getEnumValues:()=>Ou,getLengthableOrigin:()=>Nu,getParsedType:()=>zV,getSizableOrigin:()=>zu,hexToUint8Array:()=>JV,isObject:()=>Bs,isPlainObject:()=>wi,issue:()=>Ya,joinValues:()=>Q,jsonStringifyReplacer:()=>Ga,merge:()=>ZV,mergeDefs:()=>wo,normalizeParams:()=>de,nullish:()=>Si,numKeys:()=>PV,objectClone:()=>TV,omit:()=>LV,optionalKeys:()=>Bv,parsedType:()=>le,partial:()=>UV,pick:()=>DV,prefixIssues:()=>_r,primitiveTypes:()=>Lv,promiseAllObject:()=>OV,propertyKeyTypes:()=>Pu,randomString:()=>CV,required:()=>MV,safeExtend:()=>jV,shallowClone:()=>Dv,slugify:()=>zv,stringifyPrimitive:()=>ce,uint8ArrayToBase64:()=>WP,uint8ArrayToBase64url:()=>KV,uint8ArrayToHex:()=>HV,unwrapMessage:()=>$u});function _V(e){return e}function EV(e){return e}function kV(e){}function IV(e){throw Error("Unexpected value in exhaustive check")}function AV(e){}function Ou(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 Q(e,t="|"){return e.map((r)=>ce(r)).join(t)}function Ga(e,t){if(typeof t==="bigint")return t.toString();return t}function Qa(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw Error("cached value already set")}}}function Si(e){return e===null||e===void 0}function Cu(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Pv(e,t){let r=e/t,o=Math.round(r),n=Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-o)<n)return 0;return r-o}function Ze(e,t,r){let o=void 0;Object.defineProperty(e,t,{get(){if(o===HP)return;if(o===void 0)o=HP,o=r();return o},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function TV(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function vi(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function wo(...e){let t={};for(let r of e){let o=Object.getOwnPropertyDescriptors(r);Object.assign(t,o)}return Object.defineProperties({},t)}function RV(e){return wo(e._zod.def)}function $V(e,t){if(!t)return e;return t.reduce((r,o)=>r?.[o],e)}function OV(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 CV(e=10){let r="";for(let o=0;o<e;o++)r+="abcdefghijklmnopqrstuvwxyz"[Math.floor(Math.random()*26)];return r}function cm(e){return JSON.stringify(e)}function zv(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function Bs(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function wi(e){if(Bs(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(Bs(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function Dv(e){if(wi(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}function PV(e){let t=0;for(let r in e)if(Object.prototype.hasOwnProperty.call(e,r))t++;return t}function Qr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function fr(e,t,r){let o=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)o._zod.parent=e;return o}function de(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 Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function NV(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 ce(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function Bv(e){return Object.keys(e).filter((t)=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function DV(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i=wo(e._zod.def,{get shape(){let s={};for(let a in t){if(!(a in r.shape))throw Error(`Unrecognized key: "${a}"`);if(!t[a])continue;s[a]=r.shape[a]}return vi(this,"shape",s),s},checks:[]});return fr(e,i)}function LV(e,t){let r=e._zod.def,o=r.checks;if(o&&o.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=wo(e._zod.def,{get shape(){let s={...e._zod.def.shape};for(let a in t){if(!(a in r.shape))throw Error(`Unrecognized key: "${a}"`);if(!t[a])continue;delete s[a]}return vi(this,"shape",s),s},checks:[]});return fr(e,i)}function BV(e,t){if(!wi(t))throw 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 s in t)if(Object.getOwnPropertyDescriptor(i,s)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=wo(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return vi(this,"shape",i),i}});return fr(e,n)}function jV(e,t){if(!wi(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=wo(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t};return vi(this,"shape",o),o}});return fr(e,r)}function ZV(e,t){if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r=wo(e._zod.def,{get shape(){let o={...e._zod.def.shape,...t._zod.def.shape};return vi(this,"shape",o),o},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return fr(e,r)}function UV(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let s=wo(t._zod.def,{get shape(){let a=t._zod.def.shape,c={...a};if(r)for(let u in r){if(!(u in a))throw Error(`Unrecognized key: "${u}"`);if(!r[u])continue;c[u]=e?new e({type:"optional",innerType:a[u]}):a[u]}else for(let u in a)c[u]=e?new e({type:"optional",innerType:a[u]}):a[u];return vi(this,"shape",c),c},checks:[]});return fr(t,s)}function MV(e,t,r){let o=wo(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let s in r){if(!(s in i))throw Error(`Unrecognized key: "${s}"`);if(!r[s])continue;i[s]=new e({type:"nonoptional",innerType:n[s]})}else for(let s in n)i[s]=new e({type:"nonoptional",innerType:n[s]});return vi(this,"shape",i),i}});return fr(t,o)}function xi(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 Uv(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 _r(e,t){return t.map((r)=>{var o;return(o=r).path??(o.path=[]),r.path.unshift(e),r})}function $u(e){return typeof e==="string"?e:e?.message}function pr(e,t,r){let o=e.message?e.message:$u(e.inst?._zod.def?.error?.(e))??$u(t?.error?.(e))??$u(r.customError?.(e))??$u(r.localeError?.(e))??"Invalid input",{inst:n,continue:i,input:s,...a}=e;if(a.path??(a.path=[]),a.message=o,t?.reportInput)a.input=s;return a}function zu(e){if(e instanceof Set)return"set";if(e instanceof Map)return"map";if(e instanceof File)return"file";return"unknown"}function Nu(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function le(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 Ya(...e){let[t,r,o]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:o};return{...t}}function qV(e){return Object.entries(e).filter(([t,r])=>Number.isNaN(Number.parseInt(t,10))).map((t)=>t[1])}function VP(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 WP(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function FV(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r="=".repeat((4-t.length%4)%4);return VP(t+r)}function KV(e){return WP(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function JV(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw 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 HV(e){return Array.from(e).map((t)=>t.toString(16).padStart(2,"0")).join("")}class GP{constructor(...e){}}var HP,lm,Nv,zV=(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":if(Array.isArray(e))return"array";if(e===null)return"null";if(e.then&&typeof e.then==="function"&&e.catch&&typeof e.catch==="function")return"promise";if(typeof Map<"u"&&e instanceof Map)return"map";if(typeof Set<"u"&&e instanceof Set)return"set";if(typeof Date<"u"&&e instanceof Date)return"date";if(typeof File<"u"&&e instanceof File)return"file";return"object";default:throw Error(`Unknown data type: ${t}`)}},Pu,Lv,jv,Zv;var ke=v(()=>{Ls();HP=Symbol("evaluating");lm="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};Nv=Qa(()=>{if(Ns.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});Pu=new Set(["string","number","symbol"]),Lv=new Set(["string","number","bigint","boolean","symbol","undefined"]);jv={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Zv={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]}});function Lu(e,t=(r)=>r.message){let r={},o=[];for(let n of e.issues)if(n.path.length>0)r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(t(n));else o.push(t(n));return{formErrors:o,fieldErrors:r}}function Bu(e,t=(r)=>r.message){let r={_errors:[]},o=(n,i=[])=>{for(let s of n.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((a)=>o({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")o({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")o({issues:s.issues},[...i,...s.path]);else{let a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else{let c=r,u=0;while(u<a.length){let d=a[u];if(u!==a.length-1)c[d]=c[d]||{_errors:[]};else c[d]=c[d]||{_errors:[]},c[d]._errors.push(t(s));c=c[d],u++}}}};return o(e),r}function Mv(e,t=(r)=>r.message){let r={errors:[]},o=(n,i=[])=>{var s,a;for(let c of n.issues)if(c.code==="invalid_union"&&c.errors.length)c.errors.map((u)=>o({issues:u},[...i,...c.path]));else if(c.code==="invalid_key")o({issues:c.issues},[...i,...c.path]);else if(c.code==="invalid_element")o({issues:c.issues},[...i,...c.path]);else{let u=[...i,...c.path];if(u.length===0){r.errors.push(t(c));continue}let d=r,f=0;while(f<u.length){let m=u[f],h=f===u.length-1;if(typeof m==="string")d.properties??(d.properties={}),(s=d.properties)[m]??(s[m]={errors:[]}),d=d.properties[m];else d.items??(d.items=[]),(a=d.items)[m]??(a[m]={errors:[]}),d=d.items[m];if(h)d.errors.push(t(c));f++}}};return o(e),r}function YP(e){let t=[],r=e.map((o)=>typeof o==="object"?o.key:o);for(let o of r)if(typeof o==="number")t.push(`[${o}]`);else if(typeof o==="symbol")t.push(`[${JSON.stringify(String(o))}]`);else if(/[^\w$]/.test(o))t.push(`[${JSON.stringify(o)}]`);else{if(t.length)t.push(".");t.push(o)}return t.join("")}function qv(e){let t=[],r=[...e.issues].sort((o,n)=>(o.path??[]).length-(n.path??[]).length);for(let o of r)if(t.push(`\u2716 ${o.message}`),o.path?.length)t.push(` \u2192 at ${YP(o.path)}`);return t.join(`
|
|
156
|
+
`)}var QP=(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,Ga,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},Du,Er;var Fv=v(()=>{Ls();ke();Du=Z("$ZodError",QP),Er=Z("$ZodError",QP,{Parent:Error})});var Xa=(e)=>(t,r,o,n)=>{let i=o?{...o,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)throw new Mn;if(s.issues.length){let a=new(n?.Err??e)(s.issues.map((c)=>pr(c,i,gt())));throw lm(a,n?.callee),a}return s.value},um,ec=(e)=>async(t,r,o,n)=>{let i=o?{...o,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},i);if(s instanceof Promise)s=await s;if(s.issues.length){let a=new(n?.Err??e)(s.issues.map((c)=>pr(c,i,gt())));throw lm(a,n?.callee),a}return s.value},dm,tc=(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 Mn;return i.issues.length?{success:!1,error:new(e??Du)(i.issues.map((s)=>pr(s,n,gt())))}:{success:!0,data:i.value}},Kv,rc=(e)=>async(t,r,o)=>{let n=o?{...o,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},n);if(i instanceof Promise)i=await i;return i.issues.length?{success:!1,error:new e(i.issues.map((s)=>pr(s,n,gt())))}:{success:!0,data:i.value}},Jv,fm=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return Xa(e)(t,r,n)},WV,pm=(e)=>(t,r,o)=>Xa(e)(t,r,o),GV,mm=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return ec(e)(t,r,n)},QV,hm=(e)=>async(t,r,o)=>ec(e)(t,r,o),YV,gm=(e)=>(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return tc(e)(t,r,n)},XV,ym=(e)=>(t,r,o)=>tc(e)(t,r,o),e9,bm=(e)=>async(t,r,o)=>{let n=o?{...o,direction:"backward"}:{direction:"backward"};return rc(e)(t,r,n)},t9,Sm=(e)=>async(t,r,o)=>rc(e)(t,r,o),r9;var Hv=v(()=>{Ls();Fv();ke();um=Xa(Er),dm=ec(Er),Kv=tc(Er),Jv=rc(Er),WV=fm(Er),GV=pm(Er),QV=mm(Er),YV=hm(Er),XV=gm(Er),e9=ym(Er),t9=bm(Er),r9=Sm(Er)});var Lr={};Lt(Lr,{base64:()=>lw,base64url:()=>vm,bigint:()=>gw,boolean:()=>bw,browserEmail:()=>u9,cidrv4:()=>aw,cidrv6:()=>cw,cuid:()=>Vv,cuid2:()=>Wv,date:()=>fw,datetime:()=>mw,domain:()=>p9,duration:()=>ew,e164:()=>dw,email:()=>rw,emoji:()=>nw,extendedDuration:()=>n9,guid:()=>tw,hex:()=>m9,hostname:()=>f9,html5Email:()=>a9,httpProtocol:()=>uw,idnEmail:()=>l9,integer:()=>yw,ipv4:()=>ow,ipv6:()=>iw,ksuid:()=>Yv,lowercase:()=>ww,mac:()=>sw,md5_base64:()=>g9,md5_base64url:()=>y9,md5_hex:()=>h9,nanoid:()=>Xv,null:()=>Sw,number:()=>ju,rfc5322Email:()=>c9,sha1_base64:()=>S9,sha1_base64url:()=>v9,sha1_hex:()=>b9,sha256_base64:()=>x9,sha256_base64url:()=>_9,sha256_hex:()=>w9,sha384_base64:()=>k9,sha384_base64url:()=>I9,sha384_hex:()=>E9,sha512_base64:()=>T9,sha512_base64url:()=>R9,sha512_hex:()=>A9,string:()=>hw,time:()=>pw,ulid:()=>Gv,undefined:()=>vw,unicodeEmail:()=>XP,uppercase:()=>xw,uuid:()=>js,uuid4:()=>o9,uuid6:()=>i9,uuid7:()=>s9,xid:()=>Qv});function nw(){return new RegExp(d9,"u")}function tz(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function pw(e){return new RegExp(`^${tz(e)}$`)}function mw(e){let t=tz({precision:e.precision}),r=["Z"];if(e.local)r.push("");if(e.offset)r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let o=`${t}(?:${r.join("|")})`;return new RegExp(`^${ez}T(?:${o})$`)}function Zu(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function Uu(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var Vv,Wv,Gv,Qv,Yv,Xv,ew,n9,tw,js=(e)=>{if(!e)return/^([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)$/;return 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})$`)},o9,i9,s9,rw,a9,c9,XP,l9,u9,d9="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",ow,iw,sw=(e)=>{let t=Qr(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},aw,cw,lw,vm,f9,p9,uw,dw,ez="(?:(?:\\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])))",fw,hw=(e)=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},gw,yw,ju,bw,Sw,vw,ww,xw,m9,h9,g9,y9,b9,S9,v9,w9,x9,_9,E9,k9,I9,A9,T9,R9;var wm=v(()=>{ke();Vv=/^[cC][0-9a-z]{6,}$/,Wv=/^[0-9a-z]+$/,Gv=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,Qv=/^[0-9a-vA-V]{20}$/,Yv=/^[A-Za-z0-9]{27}$/,Xv=/^[a-zA-Z0-9_-]{21}$/,ew=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,n9=/^[-+]?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)?)??$/,tw=/^([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})$/,o9=js(4),i9=js(6),s9=js(7),rw=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,a9=/^[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])?)*$/,c9=/^(([^<>()\[\]\\.,;:\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,}))$/,XP=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,l9=XP,u9=/^[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])?)*$/;ow=/^(?:(?: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])$/,iw=/^(([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}|:))$/,aw=/^((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])$/,cw=/^(([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])$/,lw=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,vm=/^[A-Za-z0-9_-]*$/,f9=/^(?=.{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])?)*\.?$/,p9=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,uw=/^https?$/,dw=/^\+[1-9]\d{6,14}$/,fw=new RegExp(`^${ez}$`);gw=/^-?\d+n?$/,yw=/^-?\d+$/,ju=/^-?\d+(?:\.\d+)?$/,bw=/^(?:true|false)$/i,Sw=/^null$/i,vw=/^undefined$/i,ww=/^[^A-Z]*$/,xw=/^[^a-z]*$/,m9=/^[0-9a-fA-F]*$/;h9=/^[0-9a-fA-F]{32}$/,g9=Zu(22,"=="),y9=Uu(22),b9=/^[0-9a-fA-F]{40}$/,S9=Zu(27,"="),v9=Uu(27),w9=/^[0-9a-fA-F]{64}$/,x9=Zu(43,"="),_9=Uu(43),E9=/^[0-9a-fA-F]{96}$/,k9=Zu(64,""),I9=Uu(64),A9=/^[0-9a-fA-F]{128}$/,T9=Zu(86,"=="),R9=Uu(86)});function rz(e,t,r){if(e.issues.length)t.issues.push(..._r(r,e.issues))}var rt,nz,xm,_m,_w,Ew,kw,Iw,Aw,Tw,Rw,$w,Ow,nc,Cw,Pw,zw,Nw,Dw,Lw,Bw,jw,Zw;var Em=v(()=>{Ls();wm();ke();rt=Z("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),nz={number:"number",bigint:"bigint",object:"date"},xm=Z("$ZodCheckLessThan",(e,t)=>{rt.init(e,t);let r=nz[typeof t.value];e._zod.onattach.push((o)=>{let n=o._zod.bag,i=(t.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;if(t.value<i)if(t.inclusive)n.maximum=t.value;else n.exclusiveMaximum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value<=t.value:o.value<t.value)return;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})}}),_m=Z("$ZodCheckGreaterThan",(e,t)=>{rt.init(e,t);let r=nz[typeof t.value];e._zod.onattach.push((o)=>{let n=o._zod.bag,i=(t.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;if(t.value>i)if(t.inclusive)n.minimum=t.value;else n.exclusiveMinimum=t.value}),e._zod.check=(o)=>{if(t.inclusive?o.value>=t.value:o.value>t.value)return;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})}}),_w=Z("$ZodCheckMultipleOf",(e,t)=>{rt.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 Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?r.value%t.value===BigInt(0):Pv(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Ew=Z("$ZodCheckNumberFormat",(e,t)=>{rt.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),o=r?"int":"number",[n,i]=jv[t.format];e._zod.onattach.push((s)=>{let a=s._zod.bag;if(a.format=t.format,a.minimum=n,a.maximum=i,r)a.pattern=yw}),e._zod.check=(s)=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:o,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)s.issues.push({input:a,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});else s.issues.push({input:a,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}}if(a<n)s.issues.push({origin:"number",input:a,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort});if(a>i)s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),kw=Z("$ZodCheckBigIntFormat",(e,t)=>{rt.init(e,t);let[r,o]=Zv[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;if(i<r)n.issues.push({origin:"bigint",input:i,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort});if(i>o)n.issues.push({origin:"bigint",input:i,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),Iw=Z("$ZodCheckMaxSize",(e,t)=>{var r;rt.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!Si(n)&&n.size!==void 0}),e._zod.onattach.push((o)=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<n)o._zod.bag.maximum=t.maximum}),e._zod.check=(o)=>{let n=o.value;if(n.size<=t.maximum)return;o.issues.push({origin:zu(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Aw=Z("$ZodCheckMinSize",(e,t)=>{var r;rt.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!Si(n)&&n.size!==void 0}),e._zod.onattach.push((o)=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>n)o._zod.bag.minimum=t.minimum}),e._zod.check=(o)=>{let n=o.value;if(n.size>=t.minimum)return;o.issues.push({origin:zu(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Tw=Z("$ZodCheckSizeEquals",(e,t)=>{var r;rt.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!Si(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 s=i>t.size;o.issues.push({origin:zu(n),...s?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),Rw=Z("$ZodCheckMaxLength",(e,t)=>{var r;rt.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!Si(n)&&n.length!==void 0}),e._zod.onattach.push((o)=>{let n=o._zod.bag.maximum??Number.POSITIVE_INFINITY;if(t.maximum<n)o._zod.bag.maximum=t.maximum}),e._zod.check=(o)=>{let n=o.value;if(n.length<=t.maximum)return;let s=Nu(n);o.issues.push({origin:s,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),$w=Z("$ZodCheckMinLength",(e,t)=>{var r;rt.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!Si(n)&&n.length!==void 0}),e._zod.onattach.push((o)=>{let n=o._zod.bag.minimum??Number.NEGATIVE_INFINITY;if(t.minimum>n)o._zod.bag.minimum=t.minimum}),e._zod.check=(o)=>{let n=o.value;if(n.length>=t.minimum)return;let s=Nu(n);o.issues.push({origin:s,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),Ow=Z("$ZodCheckLengthEquals",(e,t)=>{var r;rt.init(e,t),(r=e._zod.def).when??(r.when=(o)=>{let n=o.value;return!Si(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 s=Nu(n),a=i>t.length;o.issues.push({origin:s,...a?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:o.value,inst:e,continue:!t.abort})}}),nc=Z("$ZodCheckStringFormat",(e,t)=>{var r,o;if(rt.init(e,t),e._zod.onattach.push((n)=>{let i=n._zod.bag;if(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)=>{if(t.pattern.lastIndex=0,t.pattern.test(n.value))return;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})});else(o=e._zod).check??(o.check=()=>{})}),Cw=Z("$ZodCheckRegex",(e,t)=>{nc.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Pw=Z("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=ww),nc.init(e,t)}),zw=Z("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=xw),nc.init(e,t)}),Nw=Z("$ZodCheckIncludes",(e,t)=>{rt.init(e,t);let r=Qr(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)=>{if(n.value.includes(t.includes,t.position))return;n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Dw=Z("$ZodCheckStartsWith",(e,t)=>{rt.init(e,t);let r=new RegExp(`^${Qr(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)=>{if(o.value.startsWith(t.prefix))return;o.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:o.value,inst:e,continue:!t.abort})}}),Lw=Z("$ZodCheckEndsWith",(e,t)=>{rt.init(e,t);let r=new RegExp(`.*${Qr(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)=>{if(o.value.endsWith(t.suffix))return;o.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:o.value,inst:e,continue:!t.abort})}});Bw=Z("$ZodCheckProperty",(e,t)=>{rt.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)=>rz(n,r,t.property));rz(o,r,t.property);return}}),jw=Z("$ZodCheckMimeType",(e,t)=>{rt.init(e,t);let r=new Set(t.mime);e._zod.onattach.push((o)=>{o._zod.bag.mime=t.mime}),e._zod.check=(o)=>{if(r.has(o.value.type))return;o.issues.push({code:"invalid_value",values:t.mime,input:o.value.type,inst:e,continue:!t.abort})}}),Zw=Z("$ZodCheckOverwrite",(e,t)=>{rt.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}})});class km{constructor(e=[]){if(this.content=[],this.indent=0,this)this.args=e}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
157
|
+
`).filter((i)=>i),o=Math.min(...r.map((i)=>i.length-i.trimStart().length)),n=r.map((i)=>i.slice(o)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of n)this.content.push(i)}compile(){let e=Function,t=this?.args,o=[...(this?.content??[""]).map((n)=>` ${n}`)];return new e(...t,o.join(`
|
|
158
|
+
`))}}var Uw;var Mw=v(()=>{Uw={major:4,minor:4,patch:3}});function ux(e){if(e==="")return!0;if(/\s/.test(e))return!1;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}function Sz(e){if(!vm.test(e))return!1;let t=e.replace(/[-_]/g,(o)=>o==="-"?"+":"/"),r=t.padEnd(Math.ceil(t.length/4)*4,"=");return ux(r)}function vz(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));if("typ"in n&&n?.typ!=="JWT")return!1;if(!n.alg)return!1;if(t&&(!("alg"in n)||n.alg!==t))return!1;return!0}catch{return!1}}function iz(e,t,r){if(e.issues.length)t.issues.push(..._r(r,e.issues));t.value[r]=e.value}function Rm(e,t,r,o,n,i){let s=r in o;if(e.issues.length){if(n&&i&&!s)return;t.issues.push(..._r(r,e.issues))}if(!s&&!n){if(!e.issues.length)t.issues.push({code:"invalid_type",expected:"nonoptional",input:void 0,path:[r]});return}if(e.value===void 0){if(s)t.value[r]=void 0}else t.value[r]=e.value}function wz(e){let t=Object.keys(e.shape);for(let o of t)if(!e.shape?.[o]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${o}": expected a Zod schema`);let r=Bv(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function xz(e,t,r,o,n,i){let s=[],a=n.keySet,c=n.catchall._zod,u=c.def.type,d=c.optin==="optional",f=c.optout==="optional";for(let m in t){if(m==="__proto__")continue;if(a.has(m))continue;if(u==="never"){s.push(m);continue}let h=c.run({value:t[m],issues:[]},o);if(h instanceof Promise)e.push(h.then((b)=>Rm(b,r,m,t,d,f)));else Rm(h,r,m,t,d,f)}if(s.length)r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:i});if(!e.length)return r;return Promise.all(e).then(()=>r)}function sz(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)=>!xi(i));if(n.length===1)return t.value=n[0].value,n[0];return t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((i)=>i.issues.map((s)=>pr(s,o,gt())))}),t}function az(e,t,r,o){let n=e.filter((i)=>i.issues.length===0);if(n.length===1)return t.value=n[0].value,t;if(n.length===0)t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map((i)=>i.issues.map((s)=>pr(s,o,gt())))});else t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1});return t}function qw(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(wi(e)&&wi(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 s=qw(e[i],t[i]);if(!s.valid)return{valid:!1,mergeErrorPath:[i,...s.mergeErrorPath]};n[i]=s.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],s=qw(n,i);if(!s.valid)return{valid:!1,mergeErrorPath:[o,...s.mergeErrorPath]};r.push(s.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function cz(e,t,r){let o=new Map,n;for(let a of t.issues)if(a.code==="unrecognized_keys"){n??(n=a);for(let c of a.keys){if(!o.has(c))o.set(c,{});o.get(c).l=!0}}else e.issues.push(a);for(let a of r.issues)if(a.code==="unrecognized_keys")for(let c of a.keys){if(!o.has(c))o.set(c,{});o.get(c).r=!0}else e.issues.push(a);let i=[...o].filter(([,a])=>a.l&&a.r).map(([a])=>a);if(i.length&&n)e.issues.push({...n,keys:i});if(xi(e))return e;let s=qw(t.value,r.value);if(!s.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}function lz(e,t){for(let r=e.length-1;r>=0;r--)if(e[r]._zod[t]!=="optional")return r+1;return 0}function uz(e,t,r){if(e.issues.length)t.issues.push(..._r(r,e.issues));t.value[r]=e.value}function dz(e,t,r,o,n){for(let i=0;i<r.length;i++){let s=e[i],a=i<o.length;if(s.issues.length){if(!a&&i>=n){t.value.length=i;break}t.issues.push(..._r(i,s.issues))}t.value[i]=s.value}for(let i=t.value.length-1;i>=o.length;i--)if(r[i]._zod.optout==="optional"&&t.value[i]===void 0)t.value.length=i;else break;return t}function fz(e,t,r,o,n,i,s){if(e.issues.length)if(Pu.has(typeof o))r.issues.push(..._r(o,e.issues));else r.issues.push({code:"invalid_key",origin:"map",input:n,inst:i,issues:e.issues.map((a)=>pr(a,s,gt()))});if(t.issues.length)if(Pu.has(typeof o))r.issues.push(..._r(o,t.issues));else r.issues.push({origin:"map",code:"invalid_element",input:n,inst:i,key:o,issues:t.issues.map((a)=>pr(a,s,gt()))});r.value.set(e.value,t.value)}function pz(e,t){if(e.issues.length)t.issues.push(...e.issues);t.value.add(e.value)}function mz(e,t){if(t===void 0&&(e.issues.length||e.fallback))return{issues:[],value:void 0};return e}function hz(e,t){if(e.value===void 0)e.value=t.defaultValue;return e}function gz(e,t){if(!e.issues.length&&e.value===void 0)e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t});return e}function Im(e,t,r){if(e.issues.length)return e.aborted=!0,e;return t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},r)}function Am(e,t,r){if(e.issues.length)return e.aborted=!0,e;if((r.direction||"forward")==="forward"){let n=t.transform(e.value,e);if(n instanceof Promise)return n.then((i)=>Tm(e,i,t.out,r));return Tm(e,n,t.out,r)}else{let n=t.reverseTransform(e.value,e);if(n instanceof Promise)return n.then((i)=>Tm(e,i,t.in,r));return Tm(e,n,t.in,r)}}function Tm(e,t,r,o){if(e.issues.length)return e.aborted=!0,e;return r._zod.run({value:t,issues:e.issues},o)}function yz(e){return e.value=Object.freeze(e.value),e}function bz(e,t,r,o){if(!e){let n={code:"custom",input:r,inst:o,path:[...o._zod.def.path??[]],continue:!o._zod.def.abort};if(o._zod.def.params)n.params=o._zod.def.params;t.issues.push(Ya(n))}}var Ne,Zs,Xe,Fw,Kw,Jw,Hw,Vw,Ww,Gw,Qw,Yw,Xw,ex,tx,rx,nx,ox,ix,sx,ax,cx,lx,dx,fx,px,mx,hx,$m,gx,Mu,Om,yx,bx,Sx,vx,wx,xx,_x,Ex,kx,Ix,_z,Ax,qu,Tx,Rx,$x,Cm,Ox,Cx,Px,zx,Nx,Dx,Lx,Pm,Bx,jx,Zx,Ux,Mx,qx,Fx,Kx,zm,Fu,Jx,Hx,Vx,Wx,Gx,Qx,Yx;var Xx=v(()=>{Em();Ls();Hv();wm();ke();Mw();ke();Ne=Z("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Uw;let o=[...e._zod.def.checks??[]];if(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=(s,a,c)=>{let u=xi(s),d;for(let f of a){if(f._zod.def.when){if(Uv(s))continue;if(!f._zod.def.when(s))continue}else if(u)continue;let m=s.issues.length,h=f._zod.check(s);if(h instanceof Promise&&c?.async===!1)throw new Mn;if(d||h instanceof Promise)d=(d??Promise.resolve()).then(async()=>{if(await h,s.issues.length===m)return;if(!u)u=xi(s,m)});else{if(s.issues.length===m)continue;if(!u)u=xi(s,m)}}if(d)return d.then(()=>s);return s},i=(s,a,c)=>{if(xi(s))return s.aborted=!0,s;let u=n(a,o,c);if(u instanceof Promise){if(c.async===!1)throw new Mn;return u.then((d)=>e._zod.parse(d,c))}return e._zod.parse(u,c)};e._zod.run=(s,a)=>{if(a.skipChecks)return e._zod.parse(s,a);if(a.direction==="backward"){let u=e._zod.parse({value:s.value,issues:[]},{...a,skipChecks:!0});if(u instanceof Promise)return u.then((d)=>i(d,s,a));return i(u,s,a)}let c=e._zod.parse(s,a);if(c instanceof Promise){if(a.async===!1)throw new Mn;return c.then((u)=>n(u,o,a))}return n(c,o,a)}}Ze(e,"~standard",()=>({validate:(n)=>{try{let i=Kv(e,n);return i.success?{value:i.data}:{issues:i.error?.issues}}catch(i){return Jv(e,n).then((s)=>s.success?{value:s.data}:{issues:s.error?.issues})}},vendor:"zod",version:1}))}),Zs=Z("$ZodString",(e,t)=>{Ne.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??hw(e._zod.bag),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=String(r.value)}catch(n){}if(typeof r.value==="string")return r;return r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),Xe=Z("$ZodStringFormat",(e,t)=>{nc.init(e,t),Zs.init(e,t)}),Fw=Z("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=tw),Xe.init(e,t)}),Kw=Z("$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 Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=js(o))}else t.pattern??(t.pattern=js());Xe.init(e,t)}),Jw=Z("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=rw),Xe.init(e,t)}),Hw=Z("$ZodURL",(e,t)=>{Xe.init(e,t),e._zod.check=(r)=>{try{let o=r.value.trim();if(!t.normalize&&t.protocol?.source===uw.source){if(!/^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);if(t.hostname){if(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})}if(t.protocol){if(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})}if(t.normalize)r.value=n.href;else r.value=o;return}catch(o){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),Vw=Z("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=nw()),Xe.init(e,t)}),Ww=Z("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=Xv),Xe.init(e,t)}),Gw=Z("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=Vv),Xe.init(e,t)}),Qw=Z("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=Wv),Xe.init(e,t)}),Yw=Z("$ZodULID",(e,t)=>{t.pattern??(t.pattern=Gv),Xe.init(e,t)}),Xw=Z("$ZodXID",(e,t)=>{t.pattern??(t.pattern=Qv),Xe.init(e,t)}),ex=Z("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=Yv),Xe.init(e,t)}),tx=Z("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=mw(t)),Xe.init(e,t)}),rx=Z("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=fw),Xe.init(e,t)}),nx=Z("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=pw(t)),Xe.init(e,t)}),ox=Z("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=ew),Xe.init(e,t)}),ix=Z("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=ow),Xe.init(e,t),e._zod.bag.format="ipv4"}),sx=Z("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=iw),Xe.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})}}}),ax=Z("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=sw(t.delimiter)),Xe.init(e,t),e._zod.bag.format="mac"}),cx=Z("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=aw),Xe.init(e,t)}),lx=Z("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=cw),Xe.init(e,t),e._zod.check=(r)=>{let o=r.value.split("/");try{if(o.length!==2)throw Error();let[n,i]=o;if(!i)throw Error();let s=Number(i);if(`${s}`!==i)throw Error();if(s<0||s>128)throw Error();new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});dx=Z("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=lw),Xe.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=(r)=>{if(ux(r.value))return;r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});fx=Z("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=vm),Xe.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=(r)=>{if(Sz(r.value))return;r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),px=Z("$ZodE164",(e,t)=>{t.pattern??(t.pattern=dw),Xe.init(e,t)});mx=Z("$ZodJWT",(e,t)=>{Xe.init(e,t),e._zod.check=(r)=>{if(vz(r.value,t.alg))return;r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),hx=Z("$ZodCustomStringFormat",(e,t)=>{Xe.init(e,t),e._zod.check=(r)=>{if(t.fn(r.value))return;r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),$m=Z("$ZodNumber",(e,t)=>{Ne.init(e,t),e._zod.pattern=e._zod.bag.pattern??ju,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Number(r.value)}catch(s){}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)?"Infinity":void 0:void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:e,...i?{received:i}:{}}),r}}),gx=Z("$ZodNumberFormat",(e,t)=>{Ew.init(e,t),$m.init(e,t)}),Mu=Z("$ZodBoolean",(e,t)=>{Ne.init(e,t),e._zod.pattern=bw,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=Boolean(r.value)}catch(i){}let n=r.value;if(typeof n==="boolean")return r;return r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:e}),r}}),Om=Z("$ZodBigInt",(e,t)=>{Ne.init(e,t),e._zod.pattern=gw,e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch(n){}if(typeof r.value==="bigint")return r;return r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),yx=Z("$ZodBigIntFormat",(e,t)=>{kw.init(e,t),Om.init(e,t)}),bx=Z("$ZodSymbol",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(typeof n==="symbol")return r;return r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),r}}),Sx=Z("$ZodUndefined",(e,t)=>{Ne.init(e,t),e._zod.pattern=vw,e._zod.values=new Set([void 0]),e._zod.parse=(r,o)=>{let n=r.value;if(typeof n>"u")return r;return r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),r}}),vx=Z("$ZodNull",(e,t)=>{Ne.init(e,t),e._zod.pattern=Sw,e._zod.values=new Set([null]),e._zod.parse=(r,o)=>{let n=r.value;if(n===null)return r;return r.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),r}}),wx=Z("$ZodAny",(e,t)=>{Ne.init(e,t),e._zod.parse=(r)=>r}),xx=Z("$ZodUnknown",(e,t)=>{Ne.init(e,t),e._zod.parse=(r)=>r}),_x=Z("$ZodNever",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:e}),r)}),Ex=Z("$ZodVoid",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(typeof n>"u")return r;return r.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),r}}),kx=Z("$ZodDate",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(a){}let n=r.value,i=n instanceof Date;if(i&&!Number.isNaN(n.getTime()))return r;return r.issues.push({expected:"date",code:"invalid_type",input:n,...i?{received:"Invalid Date"}:{},inst:e}),r}});Ix=Z("$ZodArray",(e,t)=>{Ne.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 s=0;s<n.length;s++){let a=n[s],c=t.element._zod.run({value:a,issues:[]},o);if(c instanceof Promise)i.push(c.then((u)=>iz(u,r,s)));else iz(c,r,s)}if(i.length)return Promise.all(i).then(()=>r);return r}});_z=Z("$ZodObject",(e,t)=>{if(Ne.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let a=t.shape;Object.defineProperty(t,"shape",{get:()=>{let c={...a};return Object.defineProperty(t,"shape",{value:c}),c}})}let o=Qa(()=>wz(t));Ze(e._zod,"propValues",()=>{let a=t.shape,c={};for(let u in a){let d=a[u]._zod;if(d.values){c[u]??(c[u]=new Set);for(let f of d.values)c[u].add(f)}}return c});let n=Bs,i=t.catchall,s;e._zod.parse=(a,c)=>{s??(s=o.value);let u=a.value;if(!n(u))return a.issues.push({expected:"object",code:"invalid_type",input:u,inst:e}),a;a.value={};let d=[],f=s.shape;for(let m of s.keys){let h=f[m],b=h._zod.optin==="optional",y=h._zod.optout==="optional",S=h._zod.run({value:u[m],issues:[]},c);if(S instanceof Promise)d.push(S.then((x)=>Rm(x,a,m,u,b,y)));else Rm(S,a,m,u,b,y)}if(!i)return d.length?Promise.all(d).then(()=>a):a;return xz(d,u,a,c,o.value,e)}}),Ax=Z("$ZodObjectJIT",(e,t)=>{_z.init(e,t);let r=e._zod.parse,o=Qa(()=>wz(t)),n=(m)=>{let h=new km(["shape","payload","ctx"]),b=o.value,y=(A)=>{let O=cm(A);return`shape[${O}]._zod.run({ value: input[${O}], issues: [] }, ctx)`};h.write("const input = payload.value;");let S=Object.create(null),x=0;for(let A of b.keys)S[A]=`key_${x++}`;h.write("const newResult = {};");for(let A of b.keys){let O=S[A],L=cm(A),z=m[A],J=z?._zod?.optin==="optional",P=z?._zod?.optout==="optional";if(h.write(`const ${O} = ${y(A)};`),J&&P)h.write(`
|
|
159
|
+
if (${O}.issues.length) {
|
|
160
|
+
if (${L} in input) {
|
|
161
|
+
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
162
|
+
...iss,
|
|
163
|
+
path: iss.path ? [${L}, ...iss.path] : [${L}]
|
|
164
|
+
})));
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (${O}.value === undefined) {
|
|
169
|
+
if (${L} in input) {
|
|
170
|
+
newResult[${L}] = undefined;
|
|
171
|
+
}
|
|
172
|
+
} else {
|
|
173
|
+
newResult[${L}] = ${O}.value;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
`);else if(!J)h.write(`
|
|
177
|
+
const ${O}_present = ${L} in input;
|
|
178
|
+
if (${O}.issues.length) {
|
|
179
|
+
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
180
|
+
...iss,
|
|
181
|
+
path: iss.path ? [${L}, ...iss.path] : [${L}]
|
|
182
|
+
})));
|
|
183
|
+
}
|
|
184
|
+
if (!${O}_present && !${O}.issues.length) {
|
|
185
|
+
payload.issues.push({
|
|
186
|
+
code: "invalid_type",
|
|
187
|
+
expected: "nonoptional",
|
|
188
|
+
input: undefined,
|
|
189
|
+
path: [${L}]
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (${O}_present) {
|
|
194
|
+
if (${O}.value === undefined) {
|
|
195
|
+
newResult[${L}] = undefined;
|
|
196
|
+
} else {
|
|
197
|
+
newResult[${L}] = ${O}.value;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
`);else h.write(`
|
|
202
|
+
if (${O}.issues.length) {
|
|
203
|
+
payload.issues = payload.issues.concat(${O}.issues.map(iss => ({
|
|
204
|
+
...iss,
|
|
205
|
+
path: iss.path ? [${L}, ...iss.path] : [${L}]
|
|
206
|
+
})));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if (${O}.value === undefined) {
|
|
210
|
+
if (${L} in input) {
|
|
211
|
+
newResult[${L}] = undefined;
|
|
212
|
+
}
|
|
213
|
+
} else {
|
|
214
|
+
newResult[${L}] = ${O}.value;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
`)}h.write("payload.value = newResult;"),h.write("return payload;");let _=h.compile();return(A,O)=>_(m,A,O)},i,s=Bs,a=!Ns.jitless,u=a&&Nv.value,d=t.catchall,f;e._zod.parse=(m,h)=>{f??(f=o.value);let b=m.value;if(!s(b))return m.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),m;if(a&&u&&h?.async===!1&&h.jitless!==!0){if(!i)i=n(t.shape);if(m=i(m,h),!d)return m;return xz([],b,m,h,f,e)}return r(m,h)}});qu=Z("$ZodUnion",(e,t)=>{Ne.init(e,t),Ze(e._zod,"optin",()=>t.options.some((o)=>o._zod.optin==="optional")?"optional":void 0),Ze(e._zod,"optout",()=>t.options.some((o)=>o._zod.optout==="optional")?"optional":void 0),Ze(e._zod,"values",()=>{if(t.options.every((o)=>o._zod.values))return new Set(t.options.flatMap((o)=>Array.from(o._zod.values)));return}),Ze(e._zod,"pattern",()=>{if(t.options.every((o)=>o._zod.pattern)){let o=t.options.map((n)=>n._zod.pattern);return new RegExp(`^(${o.map((n)=>Cu(n.source)).join("|")})$`)}return});let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,s=[];for(let a of t.options){let c=a._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)s.push(c),i=!0;else{if(c.issues.length===0)return c;s.push(c)}}if(!i)return sz(s,o,e,n);return Promise.all(s).then((a)=>sz(a,o,e,n))}});Tx=Z("$ZodXor",(e,t)=>{qu.init(e,t),t.inclusive=!1;let r=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(o,n)=>{if(r)return r(o,n);let i=!1,s=[];for(let a of t.options){let c=a._zod.run({value:o.value,issues:[]},n);if(c instanceof Promise)s.push(c),i=!0;else s.push(c)}if(!i)return az(s,o,e,n);return Promise.all(s).then((a)=>az(a,o,e,n))}}),Rx=Z("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,qu.init(e,t);let r=e._zod.parse;Ze(e._zod,"propValues",()=>{let n={};for(let i of t.options){let s=i._zod.propValues;if(!s||Object.keys(s).length===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(i)}"`);for(let[a,c]of Object.entries(s)){if(!n[a])n[a]=new Set;for(let u of c)n[a].add(u)}}return n});let o=Qa(()=>{let n=t.options,i=new Map;for(let s of n){let a=s._zod.propValues?.[t.discriminator];if(!a||a.size===0)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(s)}"`);for(let c of a){if(i.has(c))throw Error(`Duplicate discriminator value "${String(c)}"`);i.set(c,s)}}return i});e._zod.parse=(n,i)=>{let s=n.value;if(!Bs(s))return n.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),n;let a=o.value.get(s?.[t.discriminator]);if(a)return a._zod.run(n,i);if(t.unionFallback||i.direction==="backward")return r(n,i);return n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,options:Array.from(o.value.keys()),input:s,path:[t.discriminator],inst:e}),n}}),$x=Z("$ZodIntersection",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>{let n=r.value,i=t.left._zod.run({value:n,issues:[]},o),s=t.right._zod.run({value:n,issues:[]},o);if(i instanceof Promise||s instanceof Promise)return Promise.all([i,s]).then(([c,u])=>cz(r,c,u));return cz(r,i,s)}});Cm=Z("$ZodTuple",(e,t)=>{Ne.init(e,t);let r=t.items;e._zod.parse=(o,n)=>{let i=o.value;if(!Array.isArray(i))return o.issues.push({input:i,inst:e,expected:"tuple",code:"invalid_type"}),o;o.value=[];let s=[],a=lz(r,"optin"),c=lz(r,"optout");if(!t.rest){if(i.length<a)return o.issues.push({code:"too_small",minimum:a,inclusive:!0,input:i,inst:e,origin:"array"}),o;if(i.length>r.length)o.issues.push({code:"too_big",maximum:r.length,inclusive:!0,input:i,inst:e,origin:"array"})}let u=Array(r.length);for(let d=0;d<r.length;d++){let f=r[d]._zod.run({value:i[d],issues:[]},n);if(f instanceof Promise)s.push(f.then((m)=>{u[d]=m}));else u[d]=f}if(t.rest){let d=r.length-1,f=i.slice(r.length);for(let m of f){d++;let h=t.rest._zod.run({value:m,issues:[]},n);if(h instanceof Promise)s.push(h.then((b)=>uz(b,o,d)));else uz(h,o,d)}}if(s.length)return Promise.all(s).then(()=>dz(u,o,r,i,c));return dz(u,o,r,i,c)}});Ox=Z("$ZodRecord",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!wi(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:e}),r;let i=[],s=t.keyType._zod.values;if(s){r.value={};let a=new Set;for(let u of s)if(typeof u==="string"||typeof u==="number"||typeof u==="symbol"){a.add(typeof u==="number"?u.toString():u);let d=t.keyType._zod.run({value:u,issues:[]},o);if(d instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(d.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:d.issues.map((h)=>pr(h,o,gt())),input:u,path:[u],inst:e});continue}let f=d.value,m=t.valueType._zod.run({value:n[u],issues:[]},o);if(m instanceof Promise)i.push(m.then((h)=>{if(h.issues.length)r.issues.push(..._r(u,h.issues));r.value[f]=h.value}));else{if(m.issues.length)r.issues.push(..._r(u,m.issues));r.value[f]=m.value}}let c;for(let u in n)if(!a.has(u))c=c??[],c.push(u);if(c&&c.length>0)r.issues.push({code:"unrecognized_keys",input:n,inst:e,keys:c})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__")continue;if(!Object.prototype.propertyIsEnumerable.call(n,a))continue;let c=t.keyType._zod.run({value:a,issues:[]},o);if(c instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(typeof a==="string"&&ju.test(a)&&c.issues.length){let f=t.keyType._zod.run({value:Number(a),issues:[]},o);if(f instanceof Promise)throw Error("Async schemas not supported in object keys currently");if(f.issues.length===0)c=f}if(c.issues.length){if(t.mode==="loose")r.value[a]=n[a];else r.issues.push({code:"invalid_key",origin:"record",issues:c.issues.map((f)=>pr(f,o,gt())),input:a,path:[a],inst:e});continue}let d=t.valueType._zod.run({value:n[a],issues:[]},o);if(d instanceof Promise)i.push(d.then((f)=>{if(f.issues.length)r.issues.push(..._r(a,f.issues));r.value[c.value]=f.value}));else{if(d.issues.length)r.issues.push(..._r(a,d.issues));r.value[c.value]=d.value}}}if(i.length)return Promise.all(i).then(()=>r);return r}}),Cx=Z("$ZodMap",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:e}),r;let i=[];r.value=new Map;for(let[s,a]of n){let c=t.keyType._zod.run({value:s,issues:[]},o),u=t.valueType._zod.run({value:a,issues:[]},o);if(c instanceof Promise||u instanceof Promise)i.push(Promise.all([c,u]).then(([d,f])=>{fz(d,f,r,s,n,e,o)}));else fz(c,u,r,s,n,e,o)}if(i.length)return Promise.all(i).then(()=>r);return r}});Px=Z("$ZodSet",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:e,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let s of n){let a=t.valueType._zod.run({value:s,issues:[]},o);if(a instanceof Promise)i.push(a.then((c)=>pz(c,r)));else pz(a,r)}if(i.length)return Promise.all(i).then(()=>r);return r}});zx=Z("$ZodEnum",(e,t)=>{Ne.init(e,t);let r=Ou(t.entries),o=new Set(r);e._zod.values=o,e._zod.pattern=new RegExp(`^(${r.filter((n)=>Pu.has(typeof n)).map((n)=>typeof n==="string"?Qr(n):n.toString()).join("|")})$`),e._zod.parse=(n,i)=>{let s=n.value;if(o.has(s))return n;return n.issues.push({code:"invalid_value",values:r,input:s,inst:e}),n}}),Nx=Z("$ZodLiteral",(e,t)=>{if(Ne.init(e,t),t.values.length===0)throw Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map((o)=>typeof o==="string"?Qr(o):o?Qr(o.toString()):String(o)).join("|")})$`),e._zod.parse=(o,n)=>{let i=o.value;if(r.has(i))return o;return o.issues.push({code:"invalid_value",values:t.values,input:i,inst:e}),o}}),Dx=Z("$ZodFile",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>{let n=r.value;if(n instanceof File)return r;return r.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),r}}),Lx=Z("$ZodTransform",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ds(e.constructor.name);let n=t.transform(r.value,r);if(o.async)return(n instanceof Promise?n:Promise.resolve(n)).then((s)=>(r.value=s,r.fallback=!0,r));if(n instanceof Promise)throw new Mn;return r.value=n,r.fallback=!0,r}});Pm=Z("$ZodOptional",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",e._zod.optout="optional",Ze(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ze(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Cu(r.source)})?$`):void 0}),e._zod.parse=(r,o)=>{if(t.innerType._zod.optin==="optional"){let n=r.value,i=t.innerType._zod.run(r,o);if(i instanceof Promise)return i.then((s)=>mz(s,n));return mz(i,n)}if(r.value===void 0)return r;return t.innerType._zod.run(r,o)}}),Bx=Z("$ZodExactOptional",(e,t)=>{Pm.init(e,t),Ze(e._zod,"values",()=>t.innerType._zod.values),Ze(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(r,o)=>t.innerType._zod.run(r,o)}),jx=Z("$ZodNullable",(e,t)=>{Ne.init(e,t),Ze(e._zod,"optin",()=>t.innerType._zod.optin),Ze(e._zod,"optout",()=>t.innerType._zod.optout),Ze(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Cu(r.source)}|null)$`):void 0}),Ze(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,o)=>{if(r.value===null)return r;return t.innerType._zod.run(r,o)}}),Zx=Z("$ZodDefault",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",Ze(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)return r.value=t.defaultValue,r;let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>hz(i,t));return hz(n,t)}});Ux=Z("$ZodPrefault",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",Ze(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);if(r.value===void 0)r.value=t.defaultValue;return t.innerType._zod.run(r,o)}}),Mx=Z("$ZodNonOptional",(e,t)=>{Ne.init(e,t),Ze(e._zod,"values",()=>{let r=t.innerType._zod.values;return r?new Set([...r].filter((o)=>o!==void 0)):void 0}),e._zod.parse=(r,o)=>{let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>gz(i,e));return gz(n,e)}});qx=Z("$ZodSuccess",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ds("ZodSuccess");let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>(r.value=i.issues.length===0,r));return r.value=n.issues.length===0,r}}),Fx=Z("$ZodCatch",(e,t)=>{Ne.init(e,t),e._zod.optin="optional",Ze(e._zod,"optout",()=>t.innerType._zod.optout),Ze(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>{if(r.value=i.value,i.issues.length)r.value=t.catchValue({...r,error:{issues:i.issues.map((s)=>pr(s,o,gt()))},input:r.value}),r.issues=[],r.fallback=!0;return r});if(r.value=n.value,n.issues.length)r.value=t.catchValue({...r,error:{issues:n.issues.map((i)=>pr(i,o,gt()))},input:r.value}),r.issues=[],r.fallback=!0;return r}}),Kx=Z("$ZodNaN",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>{if(typeof r.value!=="number"||!Number.isNaN(r.value))return r.issues.push({input:r.value,inst:e,expected:"nan",code:"invalid_type"}),r;return r}}),zm=Z("$ZodPipe",(e,t)=>{Ne.init(e,t),Ze(e._zod,"values",()=>t.in._zod.values),Ze(e._zod,"optin",()=>t.in._zod.optin),Ze(e._zod,"optout",()=>t.out._zod.optout),Ze(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if(o.direction==="backward"){let i=t.out._zod.run(r,o);if(i instanceof Promise)return i.then((s)=>Im(s,t.in,o));return Im(i,t.in,o)}let n=t.in._zod.run(r,o);if(n instanceof Promise)return n.then((i)=>Im(i,t.out,o));return Im(n,t.out,o)}});Fu=Z("$ZodCodec",(e,t)=>{Ne.init(e,t),Ze(e._zod,"values",()=>t.in._zod.values),Ze(e._zod,"optin",()=>t.in._zod.optin),Ze(e._zod,"optout",()=>t.out._zod.optout),Ze(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,o)=>{if((o.direction||"forward")==="forward"){let i=t.in._zod.run(r,o);if(i instanceof Promise)return i.then((s)=>Am(s,t,o));return Am(i,t,o)}else{let i=t.out._zod.run(r,o);if(i instanceof Promise)return i.then((s)=>Am(s,t,o));return Am(i,t,o)}}});Jx=Z("$ZodPreprocess",(e,t)=>{zm.init(e,t)}),Hx=Z("$ZodReadonly",(e,t)=>{Ne.init(e,t),Ze(e._zod,"propValues",()=>t.innerType._zod.propValues),Ze(e._zod,"values",()=>t.innerType._zod.values),Ze(e._zod,"optin",()=>t.innerType?._zod?.optin),Ze(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(r,o)=>{if(o.direction==="backward")return t.innerType._zod.run(r,o);let n=t.innerType._zod.run(r,o);if(n instanceof Promise)return n.then(yz);return yz(n)}});Vx=Z("$ZodTemplateLiteral",(e,t)=>{Ne.init(e,t);let r=[];for(let o of t.parts)if(typeof o==="object"&&o!==null){if(!o._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);let n=o._zod.pattern instanceof RegExp?o._zod.pattern.source:o._zod.pattern;if(!n)throw Error(`Invalid template literal part: ${o._zod.traits}`);let i=n.startsWith("^")?1:0,s=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(i,s))}else if(o===null||Lv.has(typeof o))r.push(Qr(`${o}`));else throw Error(`Invalid template literal part: ${o}`);e._zod.pattern=new RegExp(`^${r.join("")}$`),e._zod.parse=(o,n)=>{if(typeof o.value!=="string")return o.issues.push({input:o.value,inst:e,expected:"string",code:"invalid_type"}),o;if(e._zod.pattern.lastIndex=0,!e._zod.pattern.test(o.value))return o.issues.push({input:o.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source}),o;return o}}),Wx=Z("$ZodFunction",(e,t)=>(Ne.init(e,t),e._def=t,e._zod.def=t,e.implement=(r)=>{if(typeof r!=="function")throw Error("implement() must be called with a function");return function(...o){let n=e._def.input?um(e._def.input,o):o,i=Reflect.apply(r,this,n);if(e._def.output)return um(e._def.output,i);return i}},e.implementAsync=(r)=>{if(typeof r!=="function")throw Error("implementAsync() must be called with a function");return async function(...o){let n=e._def.input?await dm(e._def.input,o):o,i=await Reflect.apply(r,this,n);if(e._def.output)return await dm(e._def.output,i);return i}},e._zod.parse=(r,o)=>{if(typeof r.value!=="function")return r.issues.push({code:"invalid_type",expected:"function",input:r.value,inst:e}),r;if(e._def.output&&e._def.output._zod.def.type==="promise")r.value=e.implementAsync(r.value);else r.value=e.implement(r.value);return r},e.input=(...r)=>{let o=e.constructor;if(Array.isArray(r[0]))return new o({type:"function",input:new Cm({type:"tuple",items:r[0],rest:r[1]}),output:e._def.output});return new o({type:"function",input:r[0],output:e._def.output})},e.output=(r)=>new e.constructor({type:"function",input:e._def.input,output:r}),e)),Gx=Z("$ZodPromise",(e,t)=>{Ne.init(e,t),e._zod.parse=(r,o)=>Promise.resolve(r.value).then((n)=>t.innerType._zod.run({value:n,issues:[]},o))}),Qx=Z("$ZodLazy",(e,t)=>{Ne.init(e,t),Ze(e._zod,"innerType",()=>{let r=t;if(!r._cachedInner)r._cachedInner=t.getter();return r._cachedInner}),Ze(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),Ze(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),Ze(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),Ze(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(r,o)=>e._zod.innerType._zod.run(r,o)}),Yx=Z("$ZodCustom",(e,t)=>{rt.init(e,t),Ne.init(e,t),e._zod.parse=(r,o)=>r,e._zod.check=(r)=>{let o=r.value,n=t.fn(o);if(n instanceof Promise)return n.then((i)=>bz(i,r,o,e));bz(n,r,o,e);return}})});function e0(){return{localeError:O9()}}var O9=()=>{let e={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"},o={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 instanceof ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`;return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${i}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${a}`}case"invalid_value":if(n.values.length===1)return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${ce(n.values[0])}`;return`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"}`;return`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()} ${s.unit}`;return`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`;if(i.format==="ends_with")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`;if(i.format==="includes")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`;if(i.format==="regex")return`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`;return`${r[i.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${Q(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};var Ez=v(()=>{ke()});function t0(){return{localeError:C9()}}var C9=()=>{let e={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n instanceof ${n.expected}, daxil olan ${a}`;return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${i}, daxil olan ${a}`}case"invalid_value":if(n.values.length===1)return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${ce(n.values[0])}`;return`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()} ${s.unit??"element"}`;return`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`;return`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`;if(i.format==="ends_with")return`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`;if(i.format==="includes")return`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`;if(i.format==="regex")return`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`;return`Yanl\u0131\u015F ${r[i.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};var kz=v(()=>{ke()});function Iz(e,t,r,o){let n=Math.abs(e),i=n%10,s=n%100;if(s>=11&&s<=19)return o;if(i===1)return t;if(i>=2&&i<=4)return r;return o}function r0(){return{localeError:P9()}}var P9=()=>{let e={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"},o={nan:"NaN",number:"\u043B\u0456\u043A",array:"\u043C\u0430\u0441\u0456\u045E"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F instanceof ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`;return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${i}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${a}`}case"invalid_value":if(n.values.length===1)return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${ce(n.values[0])}`;return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),c=Iz(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.maximum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),c=Iz(a,s.unit.one,s.unit.few,s.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${s.verb} ${i}${n.minimum.toString()} ${c}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`;if(i.format==="regex")return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`;return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};var Az=v(()=>{ke()});function n0(){return{localeError:z9()}}var z9=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},file:{unit:"\u0431\u0430\u0439\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430",verb:"\u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u043E\u0434",email:"\u0438\u043C\u0435\u0439\u043B \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0436\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u043F\u0440\u043E\u0434\u044A\u043B\u0436\u0438\u0442\u0435\u043B\u043D\u043E\u0441\u0442",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"base64-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",base64url:"base64url-\u043A\u043E\u0434\u0438\u0440\u0430\u043D \u043D\u0438\u0437",json_string:"JSON \u043D\u0438\u0437",e164:"E.164 \u043D\u043E\u043C\u0435\u0440",jwt:"JWT",template_literal:"\u0432\u0445\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`;return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D ${a}`}case"invalid_value":if(n.values.length===1)return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434: \u043E\u0447\u0430\u043A\u0432\u0430\u043D ${ce(n.values[0])}`;return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u043E\u043F\u0446\u0438\u044F: \u043E\u0447\u0430\u043A\u0432\u0430\u043D\u043E \u0435\u0434\u043D\u043E \u043E\u0442 ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0430"}`;return`\u0422\u0432\u044A\u0440\u0434\u0435 \u0433\u043E\u043B\u044F\u043C\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin??"\u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442"} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0441\u044A\u0434\u044A\u0440\u0436\u0430 ${i}${n.minimum.toString()} ${s.unit}`;return`\u0422\u0432\u044A\u0440\u0434\u0435 \u043C\u0430\u043B\u043A\u043E: \u043E\u0447\u0430\u043A\u0432\u0430 \u0441\u0435 ${n.origin} \u0434\u0430 \u0431\u044A\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u0432\u0430 \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0437\u0430\u0432\u044A\u0440\u0448\u0432\u0430 \u0441 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0432\u043A\u043B\u044E\u0447\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043D\u0438\u0437: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0441\u044A\u0432\u043F\u0430\u0434\u0430 \u0441 ${i.pattern}`;let s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D";if(i.format==="emoji")s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";if(i.format==="datetime")s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";if(i.format==="date")s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430";if(i.format==="time")s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E";if(i.format==="duration")s="\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430";return`${s} ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u043E \u0447\u0438\u0441\u043B\u043E: \u0442\u0440\u044F\u0431\u0432\u0430 \u0434\u0430 \u0431\u044A\u0434\u0435 \u043A\u0440\u0430\u0442\u043D\u043E \u043D\u0430 ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0437\u043F\u043E\u0437\u043D\u0430\u0442${n.keys.length>1?"\u0438":""} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u043E\u0432\u0435":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434";case"invalid_element":return`\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u043D\u0430 \u0441\u0442\u043E\u0439\u043D\u043E\u0441\u0442 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0430\u043B\u0438\u0434\u0435\u043D \u0432\u0445\u043E\u0434"}}};var Tz=v(()=>{ke()});function o0(){return{localeError:N9()}}var N9=()=>{let e={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Tipus inv\xE0lid: s'esperava instanceof ${n.expected}, s'ha rebut ${a}`;return`Tipus inv\xE0lid: s'esperava ${i}, s'ha rebut ${a}`}case"invalid_value":if(n.values.length===1)return`Valor inv\xE0lid: s'esperava ${ce(n.values[0])}`;return`Opci\xF3 inv\xE0lida: s'esperava una de ${Q(n.values," o ")}`;case"too_big":{let i=n.inclusive?"com a m\xE0xim":"menys de",s=t(n.origin);if(s)return`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${i} ${n.maximum.toString()} ${s.unit??"elements"}`;return`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"com a m\xEDnim":"m\xE9s de",s=t(n.origin);if(s)return`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${i} ${n.minimum.toString()} ${s.unit}`;return`Massa petit: s'esperava que ${n.origin} fos ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`;if(i.format==="ends_with")return`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`;if(i.format==="includes")return`Format inv\xE0lid: ha d'incloure "${i.includes}"`;if(i.format==="regex")return`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`;return`Format inv\xE0lid per a ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};var Rz=v(()=>{ke()});function i0(){return{localeError:D9()}}var D9=()=>{let e={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function t(n){return e[n]??null}let r={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"},o={nan:"NaN",number:"\u010D\xEDslo",string:"\u0159et\u011Bzec",function:"funkce",array:"pole"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no instanceof ${n.expected}, obdr\u017Eeno ${a}`;return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${i}, obdr\u017Eeno ${a}`}case"invalid_value":if(n.values.length===1)return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${ce(n.values[0])}`;return`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.maximum.toString()} ${s.unit??"prvk\u016F"}`;return`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${i}${n.minimum.toString()} ${s.unit??"prvk\u016F"}`;return`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`;if(i.format==="ends_with")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`;if(i.format==="includes")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`;if(i.format==="regex")return`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`;return`Neplatn\xFD form\xE1t ${r[i.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${Q(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};var $z=v(()=>{ke()});function s0(){return{localeError:L9()}}var L9=()=>{let e={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Ugyldigt input: forventede instanceof ${n.expected}, fik ${a}`;return`Ugyldigt input: forventede ${i}, fik ${a}`}case"invalid_value":if(n.values.length===1)return`Ugyldig v\xE6rdi: forventede ${ce(n.values[0])}`;return`Ugyldigt valg: forventede en af f\xF8lgende ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=o[n.origin]??n.origin;if(s)return`For stor: forventede ${a??"value"} ${s.verb} ${i} ${n.maximum.toString()} ${s.unit??"elementer"}`;return`For stor: forventede ${a??"value"} havde ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=o[n.origin]??n.origin;if(s)return`For lille: forventede ${a} ${s.verb} ${i} ${n.minimum.toString()} ${s.unit}`;return`For lille: forventede ${a} havde ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Ugyldig streng: skal starte med "${i.prefix}"`;if(i.format==="ends_with")return`Ugyldig streng: skal ende med "${i.suffix}"`;if(i.format==="includes")return`Ugyldig streng: skal indeholde "${i.includes}"`;if(i.format==="regex")return`Ugyldig streng: skal matche m\xF8nsteret ${i.pattern}`;return`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${n.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${n.origin}`;default:return"Ugyldigt input"}}};var Oz=v(()=>{ke()});function a0(){return{localeError:B9()}}var B9=()=>{let e={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function t(n){return e[n]??null}let r={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"},o={nan:"NaN",number:"Zahl",array:"Array"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Ung\xFCltige Eingabe: erwartet instanceof ${n.expected}, erhalten ${a}`;return`Ung\xFCltige Eingabe: erwartet ${i}, erhalten ${a}`}case"invalid_value":if(n.values.length===1)return`Ung\xFCltige Eingabe: erwartet ${ce(n.values[0])}`;return`Ung\xFCltige Option: erwartet eine von ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ${s.unit??"Elemente"} hat`;return`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${i}${n.maximum.toString()} ist`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ${s.unit} hat`;return`Zu klein: erwartet, dass ${n.origin} ${i}${n.minimum.toString()} ist`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ung\xFCltiger String: muss mit "${i.suffix}" enden`;if(i.format==="includes")return`Ung\xFCltiger String: muss "${i.includes}" enthalten`;if(i.format==="regex")return`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`;return`Ung\xFCltig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};var Cz=v(()=>{ke()});function c0(){return{localeError:j9()}}var j9=()=>{let e={string:{unit:"\u03C7\u03B1\u03C1\u03B1\u03BA\u03C4\u03AE\u03C1\u03B5\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},file:{unit:"bytes",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},array:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},set:{unit:"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"},map:{unit:"\u03BA\u03B1\u03C4\u03B1\u03C7\u03C9\u03C1\u03AE\u03C3\u03B5\u03B9\u03C2",verb:"\u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9"}};function t(n){return e[n]??null}let r={regex:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2",email:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1 \u03BA\u03B1\u03B9 \u03CE\u03C1\u03B1",date:"ISO \u03B7\u03BC\u03B5\u03C1\u03BF\u03BC\u03B7\u03BD\u03AF\u03B1",time:"ISO \u03CE\u03C1\u03B1",duration:"ISO \u03B4\u03B9\u03AC\u03C1\u03BA\u03B5\u03B9\u03B1",ipv4:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv4",ipv6:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 IPv6",mac:"\u03B4\u03B9\u03B5\u03CD\u03B8\u03C5\u03BD\u03C3\u03B7 MAC",cidrv4:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv4",cidrv6:"\u03B5\u03CD\u03C1\u03BF\u03C2 IPv6",base64:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64",base64url:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC \u03BA\u03C9\u03B4\u03B9\u03BA\u03BF\u03C0\u03BF\u03B9\u03B7\u03BC\u03AD\u03BD\u03B7 \u03C3\u03B5 base64url",json_string:"\u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC JSON",e164:"\u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2 E.164",jwt:"JWT",template_literal:"\u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"},o={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(typeof n.expected==="string"&&/^[A-Z]/.test(n.expected))return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD instanceof ${n.expected}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`;return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${i}, \u03BB\u03AE\u03C6\u03B8\u03B7\u03BA\u03B5 ${a}`}case"invalid_value":if(n.values.length===1)return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${ce(n.values[0])}`;return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03C0\u03B9\u03BB\u03BF\u03B3\u03AE: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD \u03AD\u03BD\u03B1 \u03B1\u03C0\u03CC ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.maximum.toString()} ${s.unit??"\u03C3\u03C4\u03BF\u03B9\u03C7\u03B5\u03AF\u03B1"}`;return`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B5\u03B3\u03AC\u03BB\u03BF: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin??"\u03C4\u03B9\u03BC\u03AE"} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03AD\u03C7\u03B5\u03B9 ${i}${n.minimum.toString()} ${s.unit}`;return`\u03A0\u03BF\u03BB\u03CD \u03BC\u03B9\u03BA\u03C1\u03CC: \u03B1\u03BD\u03B1\u03BC\u03B5\u03BD\u03CC\u03C4\u03B1\u03BD ${n.origin} \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03BE\u03B5\u03BA\u03B9\u03BD\u03AC \u03BC\u03B5 "${i.prefix}"`;if(i.format==="ends_with")return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B5\u03BB\u03B5\u03B9\u03CE\u03BD\u03B5\u03B9 \u03BC\u03B5 "${i.suffix}"`;if(i.format==="includes")return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C0\u03B5\u03C1\u03B9\u03AD\u03C7\u03B5\u03B9 "${i.includes}"`;if(i.format==="regex")return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C3\u03C5\u03BC\u03B2\u03BF\u03BB\u03BF\u03C3\u03B5\u03B9\u03C1\u03AC: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03C4\u03B1\u03B9\u03C1\u03B9\u03AC\u03B6\u03B5\u03B9 \u03BC\u03B5 \u03C4\u03BF \u03BC\u03BF\u03C4\u03AF\u03B2\u03BF ${i.pattern}`;return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF\u03C2 \u03B1\u03C1\u03B9\u03B8\u03BC\u03CC\u03C2: \u03C0\u03C1\u03AD\u03C0\u03B5\u03B9 \u03BD\u03B1 \u03B5\u03AF\u03BD\u03B1\u03B9 \u03C0\u03BF\u03BB\u03BB\u03B1\u03C0\u03BB\u03AC\u03C3\u03B9\u03BF \u03C4\u03BF\u03C5 ${n.divisor}`;case"unrecognized_keys":return`\u0386\u03B3\u03BD\u03C9\u03C3\u03C4${n.keys.length>1?"\u03B1":"\u03BF"} \u03BA\u03BB\u03B5\u03B9\u03B4${n.keys.length>1?"\u03B9\u03AC":"\u03AF"}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03BF \u03BA\u03BB\u03B5\u03B9\u03B4\u03AF \u03C3\u03C4\u03BF ${n.origin}`;case"invalid_union":return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2";case"invalid_element":return`\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03C4\u03B9\u03BC\u03AE \u03C3\u03C4\u03BF ${n.origin}`;default:return"\u039C\u03B7 \u03AD\u03B3\u03BA\u03C5\u03C1\u03B7 \u03B5\u03AF\u03C3\u03BF\u03B4\u03BF\u03C2"}}};var Pz=v(()=>{ke()});function Ku(){return{localeError:Z9()}}var Z9=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;return`Invalid input: expected ${i}, received ${a}`}case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${ce(n.values[0])}`;return`Invalid option: expected one of ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Too big: expected ${n.origin??"value"} to have ${i}${n.maximum.toString()} ${s.unit??"elements"}`;return`Too big: expected ${n.origin??"value"} to be ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`Too small: expected ${n.origin} to have ${i}${n.minimum.toString()} ${s.unit}`;return`Too small: expected ${n.origin} to be ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Invalid string: must start with "${i.prefix}"`;if(i.format==="ends_with")return`Invalid string: must end with "${i.suffix}"`;if(i.format==="includes")return`Invalid string: must include "${i.includes}"`;if(i.format==="regex")return`Invalid string: must match pattern ${i.pattern}`;return`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":if(n.options&&Array.isArray(n.options)&&n.options.length>0)return`Invalid discriminator value. Expected ${n.options.map((s)=>`'${s}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}};var l0=v(()=>{ke()});function u0(){return{localeError:U9()}}var U9=()=>{let e={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function t(n){return e[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"},o={nan:"NaN",number:"nombro",array:"tabelo",null:"senvalora"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Nevalida enigo: atendi\u011Dis instanceof ${n.expected}, ricevi\u011Dis ${a}`;return`Nevalida enigo: atendi\u011Dis ${i}, ricevi\u011Dis ${a}`}case"invalid_value":if(n.values.length===1)return`Nevalida enigo: atendi\u011Dis ${ce(n.values[0])}`;return`Nevalida opcio: atendi\u011Dis unu el ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()} ${s.unit??"elementojn"}`;return`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${i}${n.minimum.toString()} ${s.unit}`;return`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Nevalida karaktraro: devas komenci\u011Di per "${i.prefix}"`;if(i.format==="ends_with")return`Nevalida karaktraro: devas fini\u011Di per "${i.suffix}"`;if(i.format==="includes")return`Nevalida karaktraro: devas inkluzivi "${i.includes}"`;if(i.format==="regex")return`Nevalida karaktraro: devas kongrui kun la modelo ${i.pattern}`;return`Nevalida ${r[i.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}};var zz=v(()=>{ke()});function d0(){return{localeError:M9()}}var M9=()=>{let e={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function t(n){return e[n]??null}let r={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",string:"texto",number:"n\xFAmero",boolean:"booleano",array:"arreglo",object:"objeto",set:"conjunto",file:"archivo",date:"fecha",bigint:"n\xFAmero grande",symbol:"s\xEDmbolo",undefined:"indefinido",null:"nulo",function:"funci\xF3n",map:"mapa",record:"registro",tuple:"tupla",enum:"enumeraci\xF3n",union:"uni\xF3n",literal:"literal",promise:"promesa",void:"vac\xEDo",never:"nunca",unknown:"desconocido",any:"cualquiera"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Entrada inv\xE1lida: se esperaba instanceof ${n.expected}, recibido ${a}`;return`Entrada inv\xE1lida: se esperaba ${i}, recibido ${a}`}case"invalid_value":if(n.values.length===1)return`Entrada inv\xE1lida: se esperaba ${ce(n.values[0])}`;return`Opci\xF3n inv\xE1lida: se esperaba una de ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=o[n.origin]??n.origin;if(s)return`Demasiado grande: se esperaba que ${a??"valor"} tuviera ${i}${n.maximum.toString()} ${s.unit??"elementos"}`;return`Demasiado grande: se esperaba que ${a??"valor"} fuera ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=o[n.origin]??n.origin;if(s)return`Demasiado peque\xF1o: se esperaba que ${a} tuviera ${i}${n.minimum.toString()} ${s.unit}`;return`Demasiado peque\xF1o: se esperaba que ${a} fuera ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`;if(i.format==="ends_with")return`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`;if(i.format==="includes")return`Cadena inv\xE1lida: debe incluir "${i.includes}"`;if(i.format==="regex")return`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`;return`Inv\xE1lido ${r[i.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o[n.origin]??n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o[n.origin]??n.origin}`;default:return"Entrada inv\xE1lida"}}};var Nz=v(()=>{ke()});function f0(){return{localeError:q9()}}var q9=()=>{let e={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0622\u0631\u0627\u06CC\u0647"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A instanceof ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${i} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${a} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`}case"invalid_value":if(n.values.length===1)return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${ce(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`;return`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${Q(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`;return`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0628\u0627\u0634\u062F`;return`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`;if(i.format==="ends_with")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`;if(i.format==="includes")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`;if(i.format==="regex")return`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`;return`${r[i.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${Q(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};var Dz=v(()=>{ke()});function p0(){return{localeError:F9()}}var F9=()=>{let e={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function t(n){return e[n]??null}let r={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"},o={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Virheellinen tyyppi: odotettiin instanceof ${n.expected}, oli ${a}`;return`Virheellinen tyyppi: odotettiin ${i}, oli ${a}`}case"invalid_value":if(n.values.length===1)return`Virheellinen sy\xF6te: t\xE4ytyy olla ${ce(n.values[0])}`;return`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Liian suuri: ${s.subject} t\xE4ytyy olla ${i}${n.maximum.toString()} ${s.unit}`.trim();return`Liian suuri: arvon t\xE4ytyy olla ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`Liian pieni: ${s.subject} t\xE4ytyy olla ${i}${n.minimum.toString()} ${s.unit}`.trim();return`Liian pieni: arvon t\xE4ytyy olla ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`;if(i.format==="ends_with")return`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`;if(i.format==="includes")return`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`;if(i.format==="regex")return`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`;return`Virheellinen ${r[i.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${Q(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};var Lz=v(()=>{ke()});function m0(){return{localeError:K9()}}var K9=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={string:"cha\xEEne",number:"nombre",int:"entier",boolean:"bool\xE9en",bigint:"grand entier",symbol:"symbole",undefined:"ind\xE9fini",null:"null",never:"jamais",void:"vide",date:"date",array:"tableau",object:"objet",tuple:"tuple",record:"enregistrement",map:"carte",set:"ensemble",file:"fichier",nonoptional:"non-optionnel",nan:"NaN",function:"fonction"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Entr\xE9e invalide : instanceof ${n.expected} attendu, ${a} re\xE7u`;return`Entr\xE9e invalide : ${i} attendu, ${a} re\xE7u`}case"invalid_value":if(n.values.length===1)return`Entr\xE9e invalide : ${ce(n.values[0])} attendu`;return`Option invalide : une valeur parmi ${Q(n.values,"|")} attendue`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Trop grand : ${o[n.origin]??"valeur"} doit ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\xE9l\xE9ment(s)"}`;return`Trop grand : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`Trop petit : ${o[n.origin]??"valeur"} doit ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`;return`Trop petit : ${o[n.origin]??"valeur"} doit \xEAtre ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Cha\xEEne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Cha\xEEne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`;return`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${Q(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};var Bz=v(()=>{ke()});function h0(){return{localeError:J9()}}var J9=()=>{let e={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function t(n){return e[n]??null}let r={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"},o={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Entr\xE9e invalide : attendu instanceof ${n.expected}, re\xE7u ${a}`;return`Entr\xE9e invalide : attendu ${i}, re\xE7u ${a}`}case"invalid_value":if(n.values.length===1)return`Entr\xE9e invalide : attendu ${ce(n.values[0])}`;return`Option invalide : attendu l'une des valeurs suivantes ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u2264":"<",s=t(n.origin);if(s)return`Trop grand : attendu que ${n.origin??"la valeur"} ait ${i}${n.maximum.toString()} ${s.unit}`;return`Trop grand : attendu que ${n.origin??"la valeur"} soit ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u2265":">",s=t(n.origin);if(s)return`Trop petit : attendu que ${n.origin} ait ${i}${n.minimum.toString()} ${s.unit}`;return`Trop petit : attendu que ${n.origin} soit ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Cha\xEEne invalide : doit commencer par "${i.prefix}"`;if(i.format==="ends_with")return`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`;if(i.format==="includes")return`Cha\xEEne invalide : doit inclure "${i.includes}"`;if(i.format==="regex")return`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`;return`${r[i.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${Q(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};var jz=v(()=>{ke()});function g0(){return{localeError:H9()}}var H9=()=>{let e={string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA",gender:"f"},number:{label:"\u05DE\u05E1\u05E4\u05E8",gender:"m"},boolean:{label:"\u05E2\u05E8\u05DA \u05D1\u05D5\u05DC\u05D9\u05D0\u05E0\u05D9",gender:"m"},bigint:{label:"BigInt",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA",gender:"m"},array:{label:"\u05DE\u05E2\u05E8\u05DA",gender:"m"},object:{label:"\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8",gender:"m"},null:{label:"\u05E2\u05E8\u05DA \u05E8\u05D9\u05E7 (null)",gender:"m"},undefined:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05DE\u05D5\u05D2\u05D3\u05E8 (undefined)",gender:"m"},symbol:{label:"\u05E1\u05D9\u05DE\u05D1\u05D5\u05DC (Symbol)",gender:"m"},function:{label:"\u05E4\u05D5\u05E0\u05E7\u05E6\u05D9\u05D4",gender:"f"},map:{label:"\u05DE\u05E4\u05D4 (Map)",gender:"f"},set:{label:"\u05E7\u05D1\u05D5\u05E6\u05D4 (Set)",gender:"f"},file:{label:"\u05E7\u05D5\u05D1\u05E5",gender:"m"},promise:{label:"Promise",gender:"m"},NaN:{label:"NaN",gender:"m"},unknown:{label:"\u05E2\u05E8\u05DA \u05DC\u05D0 \u05D9\u05D3\u05D5\u05E2",gender:"m"},value:{label:"\u05E2\u05E8\u05DA",gender:"m"}},t={string:{unit:"\u05EA\u05D5\u05D5\u05D9\u05DD",shortLabel:"\u05E7\u05E6\u05E8",longLabel:"\u05D0\u05E8\u05D5\u05DA"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"},number:{unit:"",shortLabel:"\u05E7\u05D8\u05DF",longLabel:"\u05D2\u05D3\u05D5\u05DC"}},r=(u)=>u?e[u]:void 0,o=(u)=>{let d=r(u);if(d)return d.label;return u??e.unknown.label},n=(u)=>`\u05D4${o(u)}`,i=(u)=>(r(u)?.gender??"m")==="f"?"\u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05D9\u05D5\u05EA":"\u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA",s=(u)=>{if(!u)return null;return t[u]??null},a={regex:{label:"\u05E7\u05DC\u05D8",gender:"m"},email:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",gender:"f"},url:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",gender:"f"},emoji:{label:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",gender:"m"},uuid:{label:"UUID",gender:"m"},nanoid:{label:"nanoid",gender:"m"},guid:{label:"GUID",gender:"m"},cuid:{label:"cuid",gender:"m"},cuid2:{label:"cuid2",gender:"m"},ulid:{label:"ULID",gender:"m"},xid:{label:"XID",gender:"m"},ksuid:{label:"KSUID",gender:"m"},datetime:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",gender:"m"},date:{label:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",gender:"m"},time:{label:"\u05D6\u05DE\u05DF ISO",gender:"m"},duration:{label:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",gender:"m"},ipv4:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",gender:"f"},ipv6:{label:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",gender:"f"},cidrv4:{label:"\u05D8\u05D5\u05D5\u05D7 IPv4",gender:"m"},cidrv6:{label:"\u05D8\u05D5\u05D5\u05D7 IPv6",gender:"m"},base64:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",gender:"f"},base64url:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",gender:"f"},json_string:{label:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",gender:"f"},e164:{label:"\u05DE\u05E1\u05E4\u05E8 E.164",gender:"m"},jwt:{label:"JWT",gender:"m"},ends_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},includes:{label:"\u05E7\u05DC\u05D8",gender:"m"},lowercase:{label:"\u05E7\u05DC\u05D8",gender:"m"},starts_with:{label:"\u05E7\u05DC\u05D8",gender:"m"},uppercase:{label:"\u05E7\u05DC\u05D8",gender:"m"}},c={nan:"NaN"};return(u)=>{switch(u.code){case"invalid_type":{let d=u.expected,f=c[d??""]??o(d),m=le(u.input),h=c[m]??e[m]?.label??m;if(/^[A-Z]/.test(u.expected))return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA instanceof ${u.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`;return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${f}, \u05D4\u05EA\u05E7\u05D1\u05DC ${h}`}case"invalid_value":{if(u.values.length===1)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05E2\u05E8\u05DA \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA ${ce(u.values[0])}`;let d=u.values.map((h)=>ce(h));if(u.values.length===2)return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d[0]} \u05D0\u05D5 ${d[1]}`;let f=d[d.length-1];return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA \u05D4\u05DE\u05EA\u05D0\u05D9\u05DE\u05D5\u05EA \u05D4\u05DF ${d.slice(0,-1).join(", ")} \u05D0\u05D5 ${f}`}case"too_big":{let d=s(u.origin),f=n(u.origin??"value");if(u.origin==="string")return`${d?.longLabel??"\u05D0\u05E8\u05D5\u05DA"} \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.maximum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA":"\u05DC\u05DB\u05DC \u05D4\u05D9\u05D5\u05EA\u05E8"}`.trim();if(u.origin==="number"){let b=u.inclusive?`\u05E7\u05D8\u05DF \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.maximum}`:`\u05E7\u05D8\u05DF \u05DE-${u.maximum}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${b}`}if(u.origin==="array"||u.origin==="set"){let b=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA",y=u.inclusive?`${u.maximum} ${d?.unit??""} \u05D0\u05D5 \u05E4\u05D7\u05D5\u05EA`:`\u05E4\u05D7\u05D5\u05EA \u05DE-${u.maximum} ${d?.unit??""}`;return`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${f} ${b} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=u.inclusive?"<=":"<",h=i(u.origin??"value");if(d?.unit)return`${d.longLabel} \u05DE\u05D3\u05D9: ${f} ${h} ${m}${u.maximum.toString()} ${d.unit}`;return`${d?.longLabel??"\u05D2\u05D3\u05D5\u05DC"} \u05DE\u05D3\u05D9: ${f} ${h} ${m}${u.maximum.toString()}`}case"too_small":{let d=s(u.origin),f=n(u.origin??"value");if(u.origin==="string")return`${d?.shortLabel??"\u05E7\u05E6\u05E8"} \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DB\u05D4 \u05DC\u05D4\u05DB\u05D9\u05DC ${u.minimum.toString()} ${d?.unit??""} ${u.inclusive?"\u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8":"\u05DC\u05E4\u05D7\u05D5\u05EA"}`.trim();if(u.origin==="number"){let b=u.inclusive?`\u05D2\u05D3\u05D5\u05DC \u05D0\u05D5 \u05E9\u05D5\u05D5\u05D4 \u05DC-${u.minimum}`:`\u05D2\u05D3\u05D5\u05DC \u05DE-${u.minimum}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${f} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${b}`}if(u.origin==="array"||u.origin==="set"){let b=u.origin==="set"?"\u05E6\u05E8\u05D9\u05DB\u05D4":"\u05E6\u05E8\u05D9\u05DA";if(u.minimum===1&&u.inclusive){let S=u.origin==="set"?"\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3":"\u05DC\u05E4\u05D7\u05D5\u05EA \u05E4\u05E8\u05D9\u05D8 \u05D0\u05D7\u05D3";return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${f} ${b} \u05DC\u05D4\u05DB\u05D9\u05DC ${S}`}let y=u.inclusive?`${u.minimum} ${d?.unit??""} \u05D0\u05D5 \u05D9\u05D5\u05EA\u05E8`:`\u05D9\u05D5\u05EA\u05E8 \u05DE-${u.minimum} ${d?.unit??""}`;return`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${f} ${b} \u05DC\u05D4\u05DB\u05D9\u05DC ${y}`.trim()}let m=u.inclusive?">=":">",h=i(u.origin??"value");if(d?.unit)return`${d.shortLabel} \u05DE\u05D3\u05D9: ${f} ${h} ${m}${u.minimum.toString()} ${d.unit}`;return`${d?.shortLabel??"\u05E7\u05D8\u05DF"} \u05DE\u05D3\u05D9: ${f} ${h} ${m}${u.minimum.toString()}`}case"invalid_format":{let d=u;if(d.format==="starts_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1 "${d.prefix}"`;if(d.format==="ends_with")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${d.suffix}"`;if(d.format==="includes")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${d.includes}"`;if(d.format==="regex")return`\u05D4\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${d.pattern}`;let f=a[d.format],m=f?.label??d.format,b=(f?.gender??"m")==="f"?"\u05EA\u05E7\u05D9\u05E0\u05D4":"\u05EA\u05E7\u05D9\u05DF";return`${m} \u05DC\u05D0 ${b}`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${u.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${u.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${u.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${Q(u.keys,", ")}`;case"invalid_key":return"\u05E9\u05D3\u05D4 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1\u05D0\u05D5\u05D1\u05D9\u05D9\u05E7\u05D8";case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n(u.origin??"array")}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};var Zz=v(()=>{ke()});function y0(){return{localeError:V9()}}var V9=()=>{let e={string:{unit:"znakova",verb:"imati"},file:{unit:"bajtova",verb:"imati"},array:{unit:"stavki",verb:"imati"},set:{unit:"stavki",verb:"imati"}};function t(n){return e[n]??null}let r={regex:"unos",email:"email adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum i vrijeme",date:"ISO datum",time:"ISO vrijeme",duration:"ISO trajanje",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"IPv4 raspon",cidrv6:"IPv6 raspon",base64:"base64 kodirani tekst",base64url:"base64url kodirani tekst",json_string:"JSON tekst",e164:"E.164 broj",jwt:"JWT",template_literal:"unos"},o={nan:"NaN",string:"tekst",number:"broj",boolean:"boolean",array:"niz",object:"objekt",set:"skup",file:"datoteka",date:"datum",bigint:"bigint",symbol:"simbol",undefined:"undefined",null:"null",function:"funkcija",map:"mapa"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Neispravan unos: o\u010Dekuje se instanceof ${n.expected}, a primljeno je ${a}`;return`Neispravan unos: o\u010Dekuje se ${i}, a primljeno je ${a}`}case"invalid_value":if(n.values.length===1)return`Neispravna vrijednost: o\u010Dekivano ${ce(n.values[0])}`;return`Neispravna opcija: o\u010Dekivano jedno od ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=o[n.origin]??n.origin;if(s)return`Preveliko: o\u010Dekivano da ${a??"vrijednost"} ima ${i}${n.maximum.toString()} ${s.unit??"elemenata"}`;return`Preveliko: o\u010Dekivano da ${a??"vrijednost"} bude ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=o[n.origin]??n.origin;if(s)return`Premalo: o\u010Dekivano da ${a} ima ${i}${n.minimum.toString()} ${s.unit}`;return`Premalo: o\u010Dekivano da ${a} bude ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Neispravan tekst: mora zapo\u010Dinjati s "${i.prefix}"`;if(i.format==="ends_with")return`Neispravan tekst: mora zavr\u0161avati s "${i.suffix}"`;if(i.format==="includes")return`Neispravan tekst: mora sadr\u017Eavati "${i.includes}"`;if(i.format==="regex")return`Neispravan tekst: mora odgovarati uzorku ${i.pattern}`;return`Neispravna ${r[i.format]??n.format}`}case"not_multiple_of":return`Neispravan broj: mora biti vi\u0161ekratnik od ${n.divisor}`;case"unrecognized_keys":return`Neprepoznat${n.keys.length>1?"i klju\u010Devi":" klju\u010D"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Neispravan klju\u010D u ${o[n.origin]??n.origin}`;case"invalid_union":return"Neispravan unos";case"invalid_element":return`Neispravna vrijednost u ${o[n.origin]??n.origin}`;default:return"Neispravan unos"}}};var Uz=v(()=>{ke()});function b0(){return{localeError:W9()}}var W9=()=>{let e={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function t(n){return e[n]??null}let r={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"},o={nan:"NaN",number:"sz\xE1m",array:"t\xF6mb"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k instanceof ${n.expected}, a kapott \xE9rt\xE9k ${a}`;return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${i}, a kapott \xE9rt\xE9k ${a}`}case"invalid_value":if(n.values.length===1)return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${ce(n.values[0])}`;return`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${n.maximum.toString()} ${s.unit??"elem"}`;return`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${i}${n.minimum.toString()} ${s.unit}`;return`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`;if(i.format==="ends_with")return`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`;if(i.format==="includes")return`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`;if(i.format==="regex")return`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`;return`\xC9rv\xE9nytelen ${r[i.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};var Mz=v(()=>{ke()});function qz(e,t,r){return Math.abs(e)===1?t:r}function oc(e){if(!e)return"";let t=["\u0561","\u0565","\u0568","\u056B","\u0578","\u0578\u0582","\u0585"],r=e[e.length-1];return e+(t.includes(r)?"\u0576":"\u0568")}function S0(){return{localeError:G9()}}var G9=()=>{let e={string:{unit:{one:"\u0576\u0577\u0561\u0576",many:"\u0576\u0577\u0561\u0576\u0576\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},file:{unit:{one:"\u0562\u0561\u0575\u0569",many:"\u0562\u0561\u0575\u0569\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},array:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"},set:{unit:{one:"\u057F\u0561\u0580\u0580",many:"\u057F\u0561\u0580\u0580\u0565\u0580"},verb:"\u0578\u0582\u0576\u0565\u0576\u0561\u056C"}};function t(n){return e[n]??null}let r={regex:"\u0574\u0578\u0582\u057F\u0584",email:"\u0567\u056C. \u0570\u0561\u057D\u0581\u0565",url:"URL",emoji:"\u0567\u0574\u0578\u057B\u056B",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E \u0587 \u056A\u0561\u0574",date:"ISO \u0561\u0574\u057D\u0561\u0569\u056B\u057E",time:"ISO \u056A\u0561\u0574",duration:"ISO \u057F\u0587\u0578\u0572\u0578\u0582\u0569\u0575\u0578\u0582\u0576",ipv4:"IPv4 \u0570\u0561\u057D\u0581\u0565",ipv6:"IPv6 \u0570\u0561\u057D\u0581\u0565",cidrv4:"IPv4 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",cidrv6:"IPv6 \u0574\u056B\u057B\u0561\u056F\u0561\u0575\u0584",base64:"base64 \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",base64url:"base64url \u0571\u0587\u0561\u0579\u0561\u0583\u0578\u057E \u057F\u0578\u0572",json_string:"JSON \u057F\u0578\u0572",e164:"E.164 \u0570\u0561\u0574\u0561\u0580",jwt:"JWT",template_literal:"\u0574\u0578\u0582\u057F\u0584"},o={nan:"NaN",number:"\u0569\u056B\u057E",array:"\u0566\u0561\u0576\u0563\u057E\u0561\u056E"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 instanceof ${n.expected}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`;return`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${i}, \u057D\u057F\u0561\u0581\u057E\u0565\u056C \u0567 ${a}`}case"invalid_value":if(n.values.length===1)return`\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 ${ce(n.values[1])}`;return`\u054D\u056D\u0561\u056C \u057F\u0561\u0580\u0562\u0565\u0580\u0561\u056F\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567\u0580 \u0570\u0565\u057F\u0587\u0575\u0561\u056C\u0576\u0565\u0580\u056B\u0581 \u0574\u0565\u056F\u0568\u055D ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),c=qz(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${oc(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.maximum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0574\u0565\u056E \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${oc(n.origin??"\u0561\u0580\u056A\u0565\u0584")} \u056C\u056B\u0576\u056B ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),c=qz(a,s.unit.one,s.unit.many);return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${oc(n.origin)} \u056F\u0578\u0582\u0576\u0565\u0576\u0561 ${i}${n.minimum.toString()} ${c}`}return`\u0549\u0561\u0583\u0561\u0566\u0561\u0576\u0581 \u0583\u0578\u0584\u0580 \u0561\u0580\u056A\u0565\u0584\u2024 \u057D\u057A\u0561\u057D\u057E\u0578\u0582\u0574 \u0567, \u0578\u0580 ${oc(n.origin)} \u056C\u056B\u0576\u056B ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057D\u056F\u057D\u057E\u056B "${i.prefix}"-\u0578\u057E`;if(i.format==="ends_with")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0561\u057E\u0561\u0580\u057F\u057E\u056B "${i.suffix}"-\u0578\u057E`;if(i.format==="includes")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u057A\u0561\u0580\u0578\u0582\u0576\u0561\u056F\u056B "${i.includes}"`;if(i.format==="regex")return`\u054D\u056D\u0561\u056C \u057F\u0578\u0572\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0570\u0561\u0574\u0561\u057A\u0561\u057F\u0561\u057D\u056D\u0561\u0576\u056B ${i.pattern} \u0571\u0587\u0561\u0579\u0561\u0583\u056B\u0576`;return`\u054D\u056D\u0561\u056C ${r[i.format]??n.format}`}case"not_multiple_of":return`\u054D\u056D\u0561\u056C \u0569\u056B\u057E\u2024 \u057A\u0565\u057F\u0584 \u0567 \u0562\u0561\u0566\u0574\u0561\u057A\u0561\u057F\u056B\u056F \u056C\u056B\u0576\u056B ${n.divisor}-\u056B`;case"unrecognized_keys":return`\u0549\u0573\u0561\u0576\u0561\u0579\u057E\u0561\u056E \u0562\u0561\u0576\u0561\u056C\u056B${n.keys.length>1?"\u0576\u0565\u0580":""}. ${Q(n.keys,", ")}`;case"invalid_key":return`\u054D\u056D\u0561\u056C \u0562\u0561\u0576\u0561\u056C\u056B ${oc(n.origin)}-\u0578\u0582\u0574`;case"invalid_union":return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574";case"invalid_element":return`\u054D\u056D\u0561\u056C \u0561\u0580\u056A\u0565\u0584 ${oc(n.origin)}-\u0578\u0582\u0574`;default:return"\u054D\u056D\u0561\u056C \u0574\u0578\u0582\u057F\u0584\u0561\u0563\u0580\u0578\u0582\u0574"}}};var Fz=v(()=>{ke()});function v0(){return{localeError:Q9()}}var Q9=()=>{let e={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Input tidak valid: diharapkan instanceof ${n.expected}, diterima ${a}`;return`Input tidak valid: diharapkan ${i}, diterima ${a}`}case"invalid_value":if(n.values.length===1)return`Input tidak valid: diharapkan ${ce(n.values[0])}`;return`Pilihan tidak valid: diharapkan salah satu dari ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${i}${n.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`Terlalu kecil: diharapkan ${n.origin} memiliki ${i}${n.minimum.toString()} ${s.unit}`;return`Terlalu kecil: diharapkan ${n.origin} menjadi ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`String tidak valid: harus dimulai dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak valid: harus berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak valid: harus menyertakan "${i.includes}"`;if(i.format==="regex")return`String tidak valid: harus sesuai pola ${i.pattern}`;return`${r[i.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};var Kz=v(()=>{ke()});function w0(){return{localeError:Y9()}}var Y9=()=>{let e={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function t(n){return e[n]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"},o={nan:"NaN",number:"n\xFAmer",array:"fylki"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera instanceof ${n.expected}`;return`Rangt gildi: \xDE\xFA sl\xF3st inn ${a} \xFEar sem \xE1 a\xF0 vera ${i}`}case"invalid_value":if(n.values.length===1)return`Rangt gildi: gert r\xE1\xF0 fyrir ${ce(n.values[0])}`;return`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} hafi ${i}${n.maximum.toString()} ${s.unit??"hluti"}`;return`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin??"gildi"} s\xE9 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} hafi ${i}${n.minimum.toString()} ${s.unit}`;return`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${n.origin} s\xE9 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${i.prefix}"`;if(i.format==="ends_with")return`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${i.suffix}"`;if(i.format==="includes")return`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${i.includes}"`;if(i.format==="regex")return`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${i.pattern}`;return`Rangt ${r[i.format]??n.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${n.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${n.keys.length>1?"ir lyklar":"ur lykill"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${n.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${n.origin}`;default:return"Rangt gildi"}}};var Jz=v(()=>{ke()});function x0(){return{localeError:X9()}}var X9=()=>{let e={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function t(n){return e[n]??null}let r={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"numero",array:"vettore"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Input non valido: atteso instanceof ${n.expected}, ricevuto ${a}`;return`Input non valido: atteso ${i}, ricevuto ${a}`}case"invalid_value":if(n.values.length===1)return`Input non valido: atteso ${ce(n.values[0])}`;return`Opzione non valida: atteso uno tra ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Troppo grande: ${n.origin??"valore"} deve avere ${i}${n.maximum.toString()} ${s.unit??"elementi"}`;return`Troppo grande: ${n.origin??"valore"} deve essere ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`Troppo piccolo: ${n.origin} deve avere ${i}${n.minimum.toString()} ${s.unit}`;return`Troppo piccolo: ${n.origin} deve essere ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Stringa non valida: deve iniziare con "${i.prefix}"`;if(i.format==="ends_with")return`Stringa non valida: deve terminare con "${i.suffix}"`;if(i.format==="includes")return`Stringa non valida: deve includere "${i.includes}"`;if(i.format==="regex")return`Stringa non valida: deve corrispondere al pattern ${i.pattern}`;return`Input non valido: ${r[i.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};var Hz=v(()=>{ke()});function _0(){return{localeError:e7()}}var e7=()=>{let e={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function t(n){return e[n]??null}let r={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"},o={nan:"NaN",number:"\u6570\u5024",array:"\u914D\u5217"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u7121\u52B9\u306A\u5165\u529B: instanceof ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;return`\u7121\u52B9\u306A\u5165\u529B: ${i}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${a}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`}case"invalid_value":if(n.values.length===1)return`\u7121\u52B9\u306A\u5165\u529B: ${ce(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`;return`\u7121\u52B9\u306A\u9078\u629E: ${Q(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",s=t(n.origin);if(s)return`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${s.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;return`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",s=t(n.origin);if(s)return`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${s.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;return`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;if(i.format==="ends_with")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;if(i.format==="includes")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;if(i.format==="regex")return`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;return`\u7121\u52B9\u306A${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${Q(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};var Vz=v(()=>{ke()});function E0(){return{localeError:t7()}}var t7=()=>{let e={string:{unit:"\u10E1\u10D8\u10DB\u10D1\u10DD\u10DA\u10DD",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},file:{unit:"\u10D1\u10D0\u10D8\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},array:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"},set:{unit:"\u10D4\u10DA\u10D4\u10DB\u10D4\u10DC\u10E2\u10D8",verb:"\u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1"}};function t(n){return e[n]??null}let r={regex:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0",email:"\u10D4\u10DA-\u10E4\u10DD\u10E1\u10E2\u10D8\u10E1 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",url:"URL",emoji:"\u10D4\u10DB\u10DD\u10EF\u10D8",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8-\u10D3\u10E0\u10DD",date:"\u10D7\u10D0\u10E0\u10D8\u10E6\u10D8",time:"\u10D3\u10E0\u10DD",duration:"\u10EE\u10D0\u10DC\u10D2\u10E0\u10EB\u10DA\u10D8\u10D5\u10DD\u10D1\u10D0",ipv4:"IPv4 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",ipv6:"IPv6 \u10DB\u10D8\u10E1\u10D0\u10DB\u10D0\u10E0\u10D7\u10D8",cidrv4:"IPv4 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",cidrv6:"IPv6 \u10D3\u10D8\u10D0\u10DE\u10D0\u10D6\u10DD\u10DC\u10D8",base64:"base64-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",base64url:"base64url-\u10D9\u10DD\u10D3\u10D8\u10E0\u10D4\u10D1\u10E3\u10DA\u10D8 \u10D5\u10D4\u10DA\u10D8",json_string:"JSON \u10D5\u10D4\u10DA\u10D8",e164:"E.164 \u10DC\u10DD\u10DB\u10D4\u10E0\u10D8",jwt:"JWT",template_literal:"\u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"},o={nan:"NaN",number:"\u10E0\u10D8\u10EA\u10EE\u10D5\u10D8",string:"\u10D5\u10D4\u10DA\u10D8",boolean:"\u10D1\u10E3\u10DA\u10D4\u10D0\u10DC\u10D8",function:"\u10E4\u10E3\u10DC\u10E5\u10EA\u10D8\u10D0",array:"\u10DB\u10D0\u10E1\u10D8\u10D5\u10D8"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 instanceof ${n.expected}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`;return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${i}, \u10DB\u10D8\u10E6\u10D4\u10D1\u10E3\u10DA\u10D8 ${a}`}case"invalid_value":if(n.values.length===1)return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${ce(n.values[0])}`;return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D0\u10E0\u10D8\u10D0\u10DC\u10E2\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8\u10D0 \u10D4\u10E0\u10D7-\u10D4\u10E0\u10D7\u10D8 ${Q(n.values,"|")}-\u10D3\u10D0\u10DC`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit}`;return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10D3\u10D8\u10D3\u10D8: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin??"\u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0"} \u10D8\u10E7\u10DD\u10E1 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`;return`\u10D6\u10D4\u10D3\u10DB\u10D4\u10E2\u10D0\u10D3 \u10DE\u10D0\u10E2\u10D0\u10E0\u10D0: \u10DB\u10DD\u10E1\u10D0\u10DA\u10DD\u10D3\u10DC\u10D4\u10DA\u10D8 ${n.origin} \u10D8\u10E7\u10DD\u10E1 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10EC\u10E7\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.prefix}"-\u10D8\u10D7`;if(i.format==="ends_with")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10DB\u10D7\u10D0\u10D5\u10E0\u10D3\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 "${i.suffix}"-\u10D8\u10D7`;if(i.format==="includes")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D8\u10EA\u10D0\u10D5\u10D3\u10D4\u10E1 "${i.includes}"-\u10E1`;if(i.format==="regex")return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D5\u10D4\u10DA\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10E8\u10D4\u10D4\u10E1\u10D0\u10D1\u10D0\u10DB\u10D4\u10D1\u10DD\u10D3\u10D4\u10E1 \u10E8\u10D0\u10D1\u10DA\u10DD\u10DC\u10E1 ${i.pattern}`;return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E0\u10D8\u10EA\u10EE\u10D5\u10D8: \u10E3\u10DC\u10D3\u10D0 \u10D8\u10E7\u10DD\u10E1 ${n.divisor}-\u10D8\u10E1 \u10EF\u10D4\u10E0\u10D0\u10D3\u10D8`;case"unrecognized_keys":return`\u10E3\u10EA\u10DC\u10DD\u10D1\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1${n.keys.length>1?"\u10D4\u10D1\u10D8":"\u10D8"}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10D2\u10D0\u10E1\u10D0\u10E6\u10D4\u10D1\u10D8 ${n.origin}-\u10E8\u10D8`;case"invalid_union":return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0";case"invalid_element":return`\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10DB\u10DC\u10D8\u10E8\u10D5\u10DC\u10D4\u10DA\u10DD\u10D1\u10D0 ${n.origin}-\u10E8\u10D8`;default:return"\u10D0\u10E0\u10D0\u10E1\u10EC\u10DD\u10E0\u10D8 \u10E8\u10D4\u10E7\u10D5\u10D0\u10DC\u10D0"}}};var Wz=v(()=>{ke()});function Ju(){return{localeError:r7()}}var r7=()=>{let e={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function t(n){return e[n]??null}let r={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"},o={nan:"NaN",number:"\u179B\u17C1\u1781",array:"\u17A2\u17B6\u179A\u17C1 (Array)",null:"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A instanceof ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`;return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${i} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${a}`}case"invalid_value":if(n.values.length===1)return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${ce(n.values[0])}`;return`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()} ${s.unit??"\u1792\u17B6\u178F\u17BB"}`;return`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()} ${s.unit}`;return`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`;if(i.format==="ends_with")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`;if(i.format==="includes")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`;if(i.format==="regex")return`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`;return`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${Q(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};var k0=v(()=>{ke()});function I0(){return Ju()}var Gz=v(()=>{k0()});function A0(){return{localeError:n7()}}var n7=()=>{let e={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function t(n){return e[n]??null}let r={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"},o={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 instanceof ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`;return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${i}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${a}\uC785\uB2C8\uB2E4`}case"invalid_value":if(n.values.length===1)return`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${ce(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`;return`\uC798\uBABB\uB41C \uC635\uC158: ${Q(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",s=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(n.origin),c=a?.unit??"\uC694\uC18C";if(a)return`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${c} ${i}${s}`;return`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${i}${s}`}case"too_small":{let i=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",s=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",a=t(n.origin),c=a?.unit??"\uC694\uC18C";if(a)return`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${c} ${i}${s}`;return`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${i}${s}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`;if(i.format==="ends_with")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`;if(i.format==="includes")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`;if(i.format==="regex")return`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`;return`\uC798\uBABB\uB41C ${r[i.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${Q(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};var Qz=v(()=>{ke()});function Yz(e){let t=Math.abs(e),r=t%10,o=t%100;if(o>=11&&o<=19||r===0)return"many";if(r===1)return"one";return"few"}function T0(){return{localeError:o7()}}var Hu=(e)=>e.charAt(0).toUpperCase()+e.slice(1),o7=()=>{let e={string:{unit:{one:"simbolis",few:"simboliai",many:"simboli\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne ilgesn\u0117 kaip",notInclusive:"turi b\u016Bti trumpesn\u0117 kaip"},bigger:{inclusive:"turi b\u016Bti ne trumpesn\u0117 kaip",notInclusive:"turi b\u016Bti ilgesn\u0117 kaip"}}},file:{unit:{one:"baitas",few:"baitai",many:"bait\u0173"},verb:{smaller:{inclusive:"turi b\u016Bti ne didesnis kaip",notInclusive:"turi b\u016Bti ma\u017Eesnis kaip"},bigger:{inclusive:"turi b\u016Bti ne ma\u017Eesnis kaip",notInclusive:"turi b\u016Bti didesnis kaip"}}},array:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}},set:{unit:{one:"element\u0105",few:"elementus",many:"element\u0173"},verb:{smaller:{inclusive:"turi tur\u0117ti ne daugiau kaip",notInclusive:"turi tur\u0117ti ma\u017Eiau kaip"},bigger:{inclusive:"turi tur\u0117ti ne ma\u017Eiau kaip",notInclusive:"turi tur\u0117ti daugiau kaip"}}}};function t(n,i,s,a){let c=e[n]??null;if(c===null)return c;return{unit:c.unit[i],verb:c.verb[a][s?"inclusive":"notInclusive"]}}let r={regex:"\u012Fvestis",email:"el. pa\u0161to adresas",url:"URL",emoji:"jaustukas",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO data ir laikas",date:"ISO data",time:"ISO laikas",duration:"ISO trukm\u0117",ipv4:"IPv4 adresas",ipv6:"IPv6 adresas",cidrv4:"IPv4 tinklo prefiksas (CIDR)",cidrv6:"IPv6 tinklo prefiksas (CIDR)",base64:"base64 u\u017Ekoduota eilut\u0117",base64url:"base64url u\u017Ekoduota eilut\u0117",json_string:"JSON eilut\u0117",e164:"E.164 numeris",jwt:"JWT",template_literal:"\u012Fvestis"},o={nan:"NaN",number:"skai\u010Dius",bigint:"sveikasis skai\u010Dius",string:"eilut\u0117",boolean:"login\u0117 reik\u0161m\u0117",undefined:"neapibr\u0117\u017Eta reik\u0161m\u0117",function:"funkcija",symbol:"simbolis",array:"masyvas",object:"objektas",null:"nulin\u0117 reik\u0161m\u0117"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Gautas tipas ${a}, o tik\u0117tasi - instanceof ${n.expected}`;return`Gautas tipas ${a}, o tik\u0117tasi - ${i}`}case"invalid_value":if(n.values.length===1)return`Privalo b\u016Bti ${ce(n.values[0])}`;return`Privalo b\u016Bti vienas i\u0161 ${Q(n.values,"|")} pasirinkim\u0173`;case"too_big":{let i=o[n.origin]??n.origin,s=t(n.origin,Yz(Number(n.maximum)),n.inclusive??!1,"smaller");if(s?.verb)return`${Hu(i??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.maximum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne didesnis kaip":"ma\u017Eesnis kaip";return`${Hu(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.maximum.toString()} ${s?.unit}`}case"too_small":{let i=o[n.origin]??n.origin,s=t(n.origin,Yz(Number(n.minimum)),n.inclusive??!1,"bigger");if(s?.verb)return`${Hu(i??n.origin??"reik\u0161m\u0117")} ${s.verb} ${n.minimum.toString()} ${s.unit??"element\u0173"}`;let a=n.inclusive?"ne ma\u017Eesnis kaip":"didesnis kaip";return`${Hu(i??n.origin??"reik\u0161m\u0117")} turi b\u016Bti ${a} ${n.minimum.toString()} ${s?.unit}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Eilut\u0117 privalo prasid\u0117ti "${i.prefix}"`;if(i.format==="ends_with")return`Eilut\u0117 privalo pasibaigti "${i.suffix}"`;if(i.format==="includes")return`Eilut\u0117 privalo \u012Ftraukti "${i.includes}"`;if(i.format==="regex")return`Eilut\u0117 privalo atitikti ${i.pattern}`;return`Neteisingas ${r[i.format]??n.format}`}case"not_multiple_of":return`Skai\u010Dius privalo b\u016Bti ${n.divisor} kartotinis.`;case"unrecognized_keys":return`Neatpa\u017Eint${n.keys.length>1?"i":"as"} rakt${n.keys.length>1?"ai":"as"}: ${Q(n.keys,", ")}`;case"invalid_key":return"Rastas klaidingas raktas";case"invalid_union":return"Klaidinga \u012Fvestis";case"invalid_element":{let i=o[n.origin]??n.origin;return`${Hu(i??n.origin??"reik\u0161m\u0117")} turi klaiding\u0105 \u012Fvest\u012F`}default:return"Klaidinga \u012Fvestis"}}};var Xz=v(()=>{ke()});function R0(){return{localeError:i7()}}var i7=()=>{let e={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function t(n){return e[n]??null}let r={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"},o={nan:"NaN",number:"\u0431\u0440\u043E\u0458",array:"\u043D\u0438\u0437\u0430"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 instanceof ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`;return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${i}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${a}`}case"invalid_value":if(n.values.length===1)return`Invalid input: expected ${ce(n.values[0])}`;return`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`;return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${n.minimum.toString()} ${s.unit}`;return`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`;return`Invalid ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};var eN=v(()=>{ke()});function $0(){return{localeError:s7()}}var s7=()=>{let e={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function t(n){return e[n]??null}let r={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"nombor"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Input tidak sah: dijangka instanceof ${n.expected}, diterima ${a}`;return`Input tidak sah: dijangka ${i}, diterima ${a}`}case"invalid_value":if(n.values.length===1)return`Input tidak sah: dijangka ${ce(n.values[0])}`;return`Pilihan tidak sah: dijangka salah satu daripada ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Terlalu besar: dijangka ${n.origin??"nilai"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"elemen"}`;return`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`Terlalu kecil: dijangka ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`;return`Terlalu kecil: dijangka ${n.origin} adalah ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`String tidak sah: mesti bermula dengan "${i.prefix}"`;if(i.format==="ends_with")return`String tidak sah: mesti berakhir dengan "${i.suffix}"`;if(i.format==="includes")return`String tidak sah: mesti mengandungi "${i.includes}"`;if(i.format==="regex")return`String tidak sah: mesti sepadan dengan corak ${i.pattern}`;return`${r[i.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${Q(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};var tN=v(()=>{ke()});function O0(){return{localeError:a7()}}var a7=()=>{let e={string:{unit:"tekens",verb:"heeft"},file:{unit:"bytes",verb:"heeft"},array:{unit:"elementen",verb:"heeft"},set:{unit:"elementen",verb:"heeft"}};function t(n){return e[n]??null}let r={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"},o={nan:"NaN",number:"getal"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Ongeldige invoer: verwacht instanceof ${n.expected}, ontving ${a}`;return`Ongeldige invoer: verwacht ${i}, ontving ${a}`}case"invalid_value":if(n.values.length===1)return`Ongeldige invoer: verwacht ${ce(n.values[0])}`;return`Ongeldige optie: verwacht \xE9\xE9n van ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin),a=n.origin==="date"?"laat":n.origin==="string"?"lang":"groot";if(s)return`Te ${a}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} ${s.unit??"elementen"} ${s.verb}`;return`Te ${a}: verwacht dat ${n.origin??"waarde"} ${i}${n.maximum.toString()} is`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin),a=n.origin==="date"?"vroeg":n.origin==="string"?"kort":"klein";if(s)return`Te ${a}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} ${s.unit} ${s.verb}`;return`Te ${a}: verwacht dat ${n.origin} ${i}${n.minimum.toString()} is`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Ongeldige tekst: moet met "${i.prefix}" beginnen`;if(i.format==="ends_with")return`Ongeldige tekst: moet op "${i.suffix}" eindigen`;if(i.format==="includes")return`Ongeldige tekst: moet "${i.includes}" bevatten`;if(i.format==="regex")return`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`;return`Ongeldig: ${r[i.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};var rN=v(()=>{ke()});function C0(){return{localeError:c7()}}var c7=()=>{let e={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function t(n){return e[n]??null}let r={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"tall",array:"liste"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Ugyldig input: forventet instanceof ${n.expected}, fikk ${a}`;return`Ugyldig input: forventet ${i}, fikk ${a}`}case"invalid_value":if(n.values.length===1)return`Ugyldig verdi: forventet ${ce(n.values[0])}`;return`Ugyldig valg: forventet en av ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()} ${s.unit??"elementer"}`;return`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()} ${s.unit}`;return`For lite(n): forventet ${n.origin} til \xE5 ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Ugyldig streng: m\xE5 starte med "${i.prefix}"`;if(i.format==="ends_with")return`Ugyldig streng: m\xE5 ende med "${i.suffix}"`;if(i.format==="includes")return`Ugyldig streng: m\xE5 inneholde "${i.includes}"`;if(i.format==="regex")return`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`;return`Ugyldig ${r[i.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};var nN=v(()=>{ke()});function P0(){return{localeError:l7()}}var l7=()=>{let e={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function t(n){return e[n]??null}let r={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"},o={nan:"NaN",number:"numara",array:"saf",null:"gayb"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`F\xE2sit giren: umulan instanceof ${n.expected}, al\u0131nan ${a}`;return`F\xE2sit giren: umulan ${i}, al\u0131nan ${a}`}case"invalid_value":if(n.values.length===1)return`F\xE2sit giren: umulan ${ce(n.values[0])}`;return`F\xE2sit tercih: m\xFBteberler ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} ${s.unit??"elements"} sahip olmal\u0131yd\u0131.`;return`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${i}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} ${s.unit} sahip olmal\u0131yd\u0131.`;return`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${i}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`;if(i.format==="ends_with")return`F\xE2sit metin: "${i.suffix}" ile bitmeli.`;if(i.format==="includes")return`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`;if(i.format==="regex")return`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`;return`F\xE2sit ${r[i.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};var oN=v(()=>{ke()});function z0(){return{localeError:u7()}}var u7=()=>{let e={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function t(n){return e[n]??null}let r={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"},o={nan:"NaN",number:"\u0639\u062F\u062F",array:"\u0627\u0631\u06D0"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F instanceof ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${i} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${a} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`}case"invalid_value":if(n.values.length===1)return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${ce(n.values[0])} \u0648\u0627\u06CC`;return`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${Q(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`;return`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} ${s.unit} \u0648\u0644\u0631\u064A`;return`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${i}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`;if(i.format==="ends_with")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`;if(i.format==="includes")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`;if(i.format==="regex")return`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`;return`${r[i.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};var iN=v(()=>{ke()});function N0(){return{localeError:d7()}}var d7=()=>{let e={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function t(n){return e[n]??null}let r={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"},o={nan:"NaN",number:"liczba",array:"tablica"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano instanceof ${n.expected}, otrzymano ${a}`;return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${i}, otrzymano ${a}`}case"invalid_value":if(n.values.length===1)return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${ce(n.values[0])}`;return`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.maximum.toString()} ${s.unit??"element\xF3w"}`;return`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${n.minimum.toString()} ${s.unit??"element\xF3w"}`;return`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`;if(i.format==="ends_with")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`;if(i.format==="includes")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`;if(i.format==="regex")return`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`;return`Nieprawid\u0142ow(y/a/e) ${r[i.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};var sN=v(()=>{ke()});function D0(){return{localeError:f7()}}var f7=()=>{let e={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function t(n){return e[n]??null}let r={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"},o={nan:"NaN",number:"n\xFAmero",null:"nulo"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Tipo inv\xE1lido: esperado instanceof ${n.expected}, recebido ${a}`;return`Tipo inv\xE1lido: esperado ${i}, recebido ${a}`}case"invalid_value":if(n.values.length===1)return`Entrada inv\xE1lida: esperado ${ce(n.values[0])}`;return`Op\xE7\xE3o inv\xE1lida: esperada uma das ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Muito grande: esperado que ${n.origin??"valor"} tivesse ${i}${n.maximum.toString()} ${s.unit??"elementos"}`;return`Muito grande: esperado que ${n.origin??"valor"} fosse ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`Muito pequeno: esperado que ${n.origin} tivesse ${i}${n.minimum.toString()} ${s.unit}`;return`Muito pequeno: esperado que ${n.origin} fosse ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`;if(i.format==="ends_with")return`Texto inv\xE1lido: deve terminar com "${i.suffix}"`;if(i.format==="includes")return`Texto inv\xE1lido: deve incluir "${i.includes}"`;if(i.format==="regex")return`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`;return`${r[i.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};var aN=v(()=>{ke()});function L0(){return{localeError:p7()}}var p7=()=>{let e={string:{unit:"caractere",verb:"s\u0103 aib\u0103"},file:{unit:"octe\u021Bi",verb:"s\u0103 aib\u0103"},array:{unit:"elemente",verb:"s\u0103 aib\u0103"},set:{unit:"elemente",verb:"s\u0103 aib\u0103"},map:{unit:"intr\u0103ri",verb:"s\u0103 aib\u0103"}};function t(n){return e[n]??null}let r={regex:"intrare",email:"adres\u0103 de email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"dat\u0103 \u0219i or\u0103 ISO",date:"dat\u0103 ISO",time:"or\u0103 ISO",duration:"durat\u0103 ISO",ipv4:"adres\u0103 IPv4",ipv6:"adres\u0103 IPv6",mac:"adres\u0103 MAC",cidrv4:"interval IPv4",cidrv6:"interval IPv6",base64:"\u0219ir codat base64",base64url:"\u0219ir codat base64url",json_string:"\u0219ir JSON",e164:"num\u0103r E.164",jwt:"JWT",template_literal:"intrare"},o={nan:"NaN",string:"\u0219ir",number:"num\u0103r",boolean:"boolean",function:"func\u021Bie",array:"matrice",object:"obiect",undefined:"nedefinit",symbol:"simbol",bigint:"num\u0103r mare",void:"void",never:"never",map:"hart\u0103",set:"set"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;return`Intrare invalid\u0103: a\u0219teptat ${i}, primit ${a}`}case"invalid_value":if(n.values.length===1)return`Intrare invalid\u0103: a\u0219teptat ${ce(n.values[0])}`;return`Op\u021Biune invalid\u0103: a\u0219teptat una dintre ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"elemente"}`;return`Prea mare: a\u0219teptat ca ${n.origin??"valoarea"} s\u0103 fie ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`Prea mic: a\u0219teptat ca ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`;return`Prea mic: a\u0219teptat ca ${n.origin} s\u0103 fie ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u0218ir invalid: trebuie s\u0103 \xEEnceap\u0103 cu "${i.prefix}"`;if(i.format==="ends_with")return`\u0218ir invalid: trebuie s\u0103 se termine cu "${i.suffix}"`;if(i.format==="includes")return`\u0218ir invalid: trebuie s\u0103 includ\u0103 "${i.includes}"`;if(i.format==="regex")return`\u0218ir invalid: trebuie s\u0103 se potriveasc\u0103 cu modelul ${i.pattern}`;return`Format invalid: ${r[i.format]??n.format}`}case"not_multiple_of":return`Num\u0103r invalid: trebuie s\u0103 fie multiplu de ${n.divisor}`;case"unrecognized_keys":return`Chei nerecunoscute: ${Q(n.keys,", ")}`;case"invalid_key":return`Cheie invalid\u0103 \xEEn ${n.origin}`;case"invalid_union":return"Intrare invalid\u0103";case"invalid_element":return`Valoare invalid\u0103 \xEEn ${n.origin}`;default:return"Intrare invalid\u0103"}}};var cN=v(()=>{ke()});function lN(e,t,r,o){let n=Math.abs(e),i=n%10,s=n%100;if(s>=11&&s<=19)return o;if(i===1)return t;if(i>=2&&i<=4)return r;return o}function B0(){return{localeError:m7()}}var m7=()=>{let e={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0441\u0438\u0432"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C instanceof ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`;return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${i}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${a}`}case"invalid_value":if(n.values.length===1)return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${ce(n.values[0])}`;return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s){let a=Number(n.maximum),c=lN(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.maximum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s){let a=Number(n.minimum),c=lN(a,s.unit.one,s.unit.few,s.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${n.minimum.toString()} ${c}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`;return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};var uN=v(()=>{ke()});function j0(){return{localeError:h7()}}var h7=()=>{let e={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function t(n){return e[n]??null}let r={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"},o={nan:"NaN",number:"\u0161tevilo",array:"tabela"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Neveljaven vnos: pri\u010Dakovano instanceof ${n.expected}, prejeto ${a}`;return`Neveljaven vnos: pri\u010Dakovano ${i}, prejeto ${a}`}case"invalid_value":if(n.values.length===1)return`Neveljaven vnos: pri\u010Dakovano ${ce(n.values[0])}`;return`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${i}${n.maximum.toString()} ${s.unit??"elementov"}`;return`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${i}${n.minimum.toString()} ${s.unit}`;return`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`;if(i.format==="ends_with")return`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`;if(i.format==="includes")return`Neveljaven niz: mora vsebovati "${i.includes}"`;if(i.format==="regex")return`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`;return`Neveljaven ${r[i.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};var dN=v(()=>{ke()});function Z0(){return{localeError:g7()}}var g7=()=>{let e={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function t(n){return e[n]??null}let r={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"},o={nan:"NaN",number:"antal",array:"lista"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Ogiltig inmatning: f\xF6rv\xE4ntat instanceof ${n.expected}, fick ${a}`;return`Ogiltig inmatning: f\xF6rv\xE4ntat ${i}, fick ${a}`}case"invalid_value":if(n.values.length===1)return`Ogiltig inmatning: f\xF6rv\xE4ntat ${ce(n.values[0])}`;return`Ogiltigt val: f\xF6rv\xE4ntade en av ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()} ${s.unit??"element"}`;return`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()} ${s.unit}`;return`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`;if(i.format==="ends_with")return`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`;if(i.format==="includes")return`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`;if(i.format==="regex")return`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`;return`Ogiltig(t) ${r[i.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${Q(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};var fN=v(()=>{ke()});function U0(){return{localeError:y7()}}var y7=()=>{let e={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function t(n){return e[n]??null}let r={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"},o={nan:"NaN",number:"\u0B8E\u0BA3\u0BCD",array:"\u0B85\u0BA3\u0BBF",null:"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 instanceof ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`;return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${i}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${a}`}case"invalid_value":if(n.values.length===1)return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${ce(n.values[0])}`;return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Q(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} ${s.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;return`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} ${s.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;return`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${i}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;if(i.format==="ends_with")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;if(i.format==="includes")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;if(i.format==="regex")return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};var pN=v(()=>{ke()});function M0(){return{localeError:b7()}}var b7=()=>{let e={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function t(n){return e[n]??null}let r={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"},o={nan:"NaN",number:"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02",array:"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)",null:"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 instanceof ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`;return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${i} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${a}`}case"invalid_value":if(n.values.length===1)return`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${ce(n.values[0])}`;return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);if(s)return`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()} ${s.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`;return`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",s=t(n.origin);if(s)return`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()} ${s.unit}`;return`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`;if(i.format==="ends_with")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`;if(i.format==="includes")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`;if(i.format==="regex")return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`;return`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${r[i.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${Q(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};var mN=v(()=>{ke()});function q0(){return{localeError:S7()}}var S7=()=>{let e={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function t(n){return e[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"},o={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Ge\xE7ersiz de\u011Fer: beklenen instanceof ${n.expected}, al\u0131nan ${a}`;return`Ge\xE7ersiz de\u011Fer: beklenen ${i}, al\u0131nan ${a}`}case"invalid_value":if(n.values.length===1)return`Ge\xE7ersiz de\u011Fer: beklenen ${ce(n.values[0])}`;return`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()} ${s.unit??"\xF6\u011Fe"}`;return`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`;return`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Ge\xE7ersiz metin: "${i.prefix}" ile ba\u015Flamal\u0131`;if(i.format==="ends_with")return`Ge\xE7ersiz metin: "${i.suffix}" ile bitmeli`;if(i.format==="includes")return`Ge\xE7ersiz metin: "${i.includes}" i\xE7ermeli`;if(i.format==="regex")return`Ge\xE7ersiz metin: ${i.pattern} desenine uymal\u0131`;return`Ge\xE7ersiz ${r[i.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};var hN=v(()=>{ke()});function Vu(){return{localeError:v7()}}var v7=()=>{let e={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function t(n){return e[n]??null}let r={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"},o={nan:"NaN",number:"\u0447\u0438\u0441\u043B\u043E",array:"\u043C\u0430\u0441\u0438\u0432"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F instanceof ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`;return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${i}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${a}`}case"invalid_value":if(n.values.length===1)return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${ce(n.values[0])}`;return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`;return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`;return`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`;if(i.format==="ends_with")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`;if(i.format==="includes")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`;if(i.format==="regex")return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`;return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};var F0=v(()=>{ke()});function K0(){return Vu()}var gN=v(()=>{F0()});function J0(){return{localeError:w7()}}var w7=()=>{let e={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function t(n){return e[n]??null}let r={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"},o={nan:"NaN",number:"\u0646\u0645\u0628\u0631",array:"\u0622\u0631\u06D2",null:"\u0646\u0644"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: instanceof ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${i} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${a} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`}case"invalid_value":if(n.values.length===1)return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${ce(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;return`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${Q(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${n.maximum.toString()} ${s.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`;return`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${i}${n.minimum.toString()} ${s.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`;return`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${i}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;if(i.format==="ends_with")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;if(i.format==="includes")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;if(i.format==="regex")return`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;return`\u063A\u0644\u0637 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${Q(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};var yN=v(()=>{ke()});function H0(){return{localeError:x7()}}var x7=()=>{let e={string:{unit:"belgi",verb:"bo\u2018lishi kerak"},file:{unit:"bayt",verb:"bo\u2018lishi kerak"},array:{unit:"element",verb:"bo\u2018lishi kerak"},set:{unit:"element",verb:"bo\u2018lishi kerak"},map:{unit:"yozuv",verb:"bo\u2018lishi kerak"}};function t(n){return e[n]??null}let r={regex:"kirish",email:"elektron pochta manzili",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO sana va vaqti",date:"ISO sana",time:"ISO vaqt",duration:"ISO davomiylik",ipv4:"IPv4 manzil",ipv6:"IPv6 manzil",mac:"MAC manzil",cidrv4:"IPv4 diapazon",cidrv6:"IPv6 diapazon",base64:"base64 kodlangan satr",base64url:"base64url kodlangan satr",json_string:"JSON satr",e164:"E.164 raqam",jwt:"JWT",template_literal:"kirish"},o={nan:"NaN",number:"raqam",array:"massiv"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`Noto\u2018g\u2018ri kirish: kutilgan instanceof ${n.expected}, qabul qilingan ${a}`;return`Noto\u2018g\u2018ri kirish: kutilgan ${i}, qabul qilingan ${a}`}case"invalid_value":if(n.values.length===1)return`Noto\u2018g\u2018ri kirish: kutilgan ${ce(n.values[0])}`;return`Noto\u2018g\u2018ri variant: quyidagilardan biri kutilgan ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()} ${s.unit} ${s.verb}`;return`Juda katta: kutilgan ${n.origin??"qiymat"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()} ${s.unit} ${s.verb}`;return`Juda kichik: kutilgan ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Noto\u2018g\u2018ri satr: "${i.prefix}" bilan boshlanishi kerak`;if(i.format==="ends_with")return`Noto\u2018g\u2018ri satr: "${i.suffix}" bilan tugashi kerak`;if(i.format==="includes")return`Noto\u2018g\u2018ri satr: "${i.includes}" ni o\u2018z ichiga olishi kerak`;if(i.format==="regex")return`Noto\u2018g\u2018ri satr: ${i.pattern} shabloniga mos kelishi kerak`;return`Noto\u2018g\u2018ri ${r[i.format]??n.format}`}case"not_multiple_of":return`Noto\u2018g\u2018ri raqam: ${n.divisor} ning karralisi bo\u2018lishi kerak`;case"unrecognized_keys":return`Noma\u2019lum kalit${n.keys.length>1?"lar":""}: ${Q(n.keys,", ")}`;case"invalid_key":return`${n.origin} dagi kalit noto\u2018g\u2018ri`;case"invalid_union":return"Noto\u2018g\u2018ri kirish";case"invalid_element":return`${n.origin} da noto\u2018g\u2018ri qiymat`;default:return"Noto\u2018g\u2018ri kirish"}}};var bN=v(()=>{ke()});function V0(){return{localeError:_7()}}var _7=()=>{let e={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function t(n){return e[n]??null}let r={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"},o={nan:"NaN",number:"s\u1ED1",array:"m\u1EA3ng"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i instanceof ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`;return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${i}, nh\u1EADn \u0111\u01B0\u1EE3c ${a}`}case"invalid_value":if(n.values.length===1)return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${ce(n.values[0])}`;return`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${s.verb} ${i}${n.maximum.toString()} ${s.unit??"ph\u1EA7n t\u1EED"}`;return`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${s.verb} ${i}${n.minimum.toString()} ${s.unit}`;return`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`;if(i.format==="ends_with")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`;if(i.format==="includes")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`;if(i.format==="regex")return`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`;return`${r[i.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${Q(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};var SN=v(()=>{ke()});function W0(){return{localeError:E7()}}var E7=()=>{let e={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function t(n){return e[n]??null}let r={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"},o={nan:"NaN",number:"\u6570\u5B57",array:"\u6570\u7EC4",null:"\u7A7A\u503C(null)"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B instanceof ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`;return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${i}\uFF0C\u5B9E\u9645\u63A5\u6536 ${a}`}case"invalid_value":if(n.values.length===1)return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${ce(n.values[0])}`;return`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()} ${s.unit??"\u4E2A\u5143\u7D20"}`;return`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()} ${s.unit}`;return`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`;if(i.format==="ends_with")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`;if(i.format==="includes")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`;if(i.format==="regex")return`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`;return`\u65E0\u6548${r[i.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${Q(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};var vN=v(()=>{ke()});function G0(){return{localeError:k7()}}var k7=()=>{let e={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function t(n){return e[n]??null}let r={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"},o={nan:"NaN"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA instanceof ${n.expected}\uFF0C\u4F46\u6536\u5230 ${a}`;return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${i}\uFF0C\u4F46\u6536\u5230 ${a}`}case"invalid_value":if(n.values.length===1)return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${ce(n.values[0])}`;return`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()} ${s.unit??"\u500B\u5143\u7D20"}`;return`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${i}${n.maximum.toString()}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()} ${s.unit}`;return`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${i}${n.minimum.toString()}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`;if(i.format==="ends_with")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`;if(i.format==="includes")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`;if(i.format==="regex")return`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`;return`\u7121\u6548\u7684 ${r[i.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${Q(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};var wN=v(()=>{ke()});function Q0(){return{localeError:I7()}}var I7=()=>{let e={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function t(n){return e[n]??null}let r={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"},o={nan:"NaN",number:"n\u1ECD\u0301mb\xE0",array:"akop\u1ECD"};return(n)=>{switch(n.code){case"invalid_type":{let i=o[n.expected]??n.expected,s=le(n.input),a=o[s]??s;if(/^[A-Z]/.test(n.expected))return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi instanceof ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${a}`;return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${i}, \xE0m\u1ECD\u0300 a r\xED ${a}`}case"invalid_value":if(n.values.length===1)return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${ce(n.values[0])}`;return`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${Q(n.values,"|")}`;case"too_big":{let i=n.inclusive?"<=":"<",s=t(n.origin);if(s)return`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${s.verb} ${i}${n.maximum} ${s.unit}`;return`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.maximum}`}case"too_small":{let i=n.inclusive?">=":">",s=t(n.origin);if(s)return`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${s.verb} ${i}${n.minimum} ${s.unit}`;return`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${i}${n.minimum}`}case"invalid_format":{let i=n;if(i.format==="starts_with")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${i.prefix}"`;if(i.format==="ends_with")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${i.suffix}"`;if(i.format==="includes")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${i.includes}"`;if(i.format==="regex")return`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${i.pattern}`;return`A\u1E63\xEC\u1E63e: ${r[i.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${Q(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};var xN=v(()=>{ke()});var Wu={};Lt(Wu,{ar:()=>e0,az:()=>t0,be:()=>r0,bg:()=>n0,ca:()=>o0,cs:()=>i0,da:()=>s0,de:()=>a0,el:()=>c0,en:()=>Ku,eo:()=>u0,es:()=>d0,fa:()=>f0,fi:()=>p0,fr:()=>m0,frCA:()=>h0,he:()=>g0,hr:()=>y0,hu:()=>b0,hy:()=>S0,id:()=>v0,is:()=>w0,it:()=>x0,ja:()=>_0,ka:()=>E0,kh:()=>I0,km:()=>Ju,ko:()=>A0,lt:()=>T0,mk:()=>R0,ms:()=>$0,nl:()=>O0,no:()=>C0,ota:()=>P0,pl:()=>N0,ps:()=>z0,pt:()=>D0,ro:()=>L0,ru:()=>B0,sl:()=>j0,sv:()=>Z0,ta:()=>U0,th:()=>M0,tr:()=>q0,ua:()=>K0,uk:()=>Vu,ur:()=>J0,uz:()=>H0,vi:()=>V0,yo:()=>Q0,zhCN:()=>W0,zhTW:()=>G0});var Y0=v(()=>{Ez();kz();Az();Tz();Rz();$z();Oz();Cz();Pz();l0();zz();Nz();Dz();Lz();Bz();jz();Zz();Uz();Mz();Fz();Kz();Jz();Hz();Vz();Wz();Gz();k0();Qz();Xz();eN();tN();rN();nN();oN();iN();sN();aN();cN();uN();dN();fN();pN();mN();hN();gN();F0();yN();bN();SN();vN();wN();xN()});class t_{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];if(this._map.set(e,r),r&&typeof r==="object"&&"id"in r)this._idmap.set(r.id,e);return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);if(t&&typeof t==="object"&&"id"in t)this._idmap.delete(t.id);return this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let o={...r,...this._map.get(e)};return Object.keys(o).length?o:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function Nm(){return new t_}var _N,X0,e_,Vt;var Gu=v(()=>{X0=Symbol("ZodOutput"),e_=Symbol("ZodInput");(_N=globalThis).__zod_globalRegistry??(_N.__zod_globalRegistry=Nm());Vt=globalThis.__zod_globalRegistry});function r_(e,t){return new e({type:"string",...de(t)})}function n_(e,t){return new e({type:"string",coerce:!0,...de(t)})}function Dm(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...de(t)})}function Qu(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...de(t)})}function Lm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...de(t)})}function Bm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...de(t)})}function jm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...de(t)})}function Zm(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...de(t)})}function Yu(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...de(t)})}function Um(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...de(t)})}function Mm(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...de(t)})}function qm(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...de(t)})}function Fm(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...de(t)})}function Km(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...de(t)})}function Jm(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...de(t)})}function Hm(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...de(t)})}function Vm(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...de(t)})}function Wm(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...de(t)})}function o_(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...de(t)})}function Gm(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...de(t)})}function Qm(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...de(t)})}function Ym(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...de(t)})}function Xm(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...de(t)})}function eh(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...de(t)})}function th(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...de(t)})}function s_(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...de(t)})}function a_(e,t){return new e({type:"string",format:"date",check:"string_format",...de(t)})}function c_(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...de(t)})}function l_(e,t){return new e({type:"string",format:"duration",check:"string_format",...de(t)})}function u_(e,t){return new e({type:"number",checks:[],...de(t)})}function d_(e,t){return new e({type:"number",coerce:!0,checks:[],...de(t)})}function f_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...de(t)})}function p_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...de(t)})}function m_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...de(t)})}function h_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...de(t)})}function g_(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...de(t)})}function y_(e,t){return new e({type:"boolean",...de(t)})}function b_(e,t){return new e({type:"boolean",coerce:!0,...de(t)})}function S_(e,t){return new e({type:"bigint",...de(t)})}function v_(e,t){return new e({type:"bigint",coerce:!0,...de(t)})}function w_(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...de(t)})}function x_(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...de(t)})}function __(e,t){return new e({type:"symbol",...de(t)})}function E_(e,t){return new e({type:"undefined",...de(t)})}function k_(e,t){return new e({type:"null",...de(t)})}function I_(e){return new e({type:"any"})}function A_(e){return new e({type:"unknown"})}function T_(e,t){return new e({type:"never",...de(t)})}function R_(e,t){return new e({type:"void",...de(t)})}function $_(e,t){return new e({type:"date",...de(t)})}function O_(e,t){return new e({type:"date",coerce:!0,...de(t)})}function C_(e,t){return new e({type:"nan",...de(t)})}function qn(e,t){return new xm({check:"less_than",...de(t),value:e,inclusive:!1})}function Br(e,t){return new xm({check:"less_than",...de(t),value:e,inclusive:!0})}function Fn(e,t){return new _m({check:"greater_than",...de(t),value:e,inclusive:!1})}function mr(e,t){return new _m({check:"greater_than",...de(t),value:e,inclusive:!0})}function rh(e){return Fn(0,e)}function nh(e){return qn(0,e)}function oh(e){return Br(0,e)}function ih(e){return mr(0,e)}function _i(e,t){return new _w({check:"multiple_of",...de(t),value:e})}function Ei(e,t){return new Iw({check:"max_size",...de(t),maximum:e})}function Kn(e,t){return new Aw({check:"min_size",...de(t),minimum:e})}function Us(e,t){return new Tw({check:"size_equals",...de(t),size:e})}function Ms(e,t){return new Rw({check:"max_length",...de(t),maximum:e})}function xo(e,t){return new $w({check:"min_length",...de(t),minimum:e})}function qs(e,t){return new Ow({check:"length_equals",...de(t),length:e})}function ic(e,t){return new Cw({check:"string_format",format:"regex",...de(t),pattern:e})}function sc(e){return new Pw({check:"string_format",format:"lowercase",...de(e)})}function ac(e){return new zw({check:"string_format",format:"uppercase",...de(e)})}function cc(e,t){return new Nw({check:"string_format",format:"includes",...de(t),includes:e})}function lc(e,t){return new Dw({check:"string_format",format:"starts_with",...de(t),prefix:e})}function uc(e,t){return new Lw({check:"string_format",format:"ends_with",...de(t),suffix:e})}function sh(e,t,r){return new Bw({check:"property",property:e,schema:t,...de(r)})}function dc(e,t){return new jw({check:"mime_type",mime:e,...de(t)})}function pn(e){return new Zw({check:"overwrite",tx:e})}function fc(e){return pn((t)=>t.normalize(e))}function pc(){return pn((e)=>e.trim())}function mc(){return pn((e)=>e.toLowerCase())}function hc(){return pn((e)=>e.toUpperCase())}function gc(){return pn((e)=>zv(e))}function P_(e,t,r){return new e({type:"array",element:t,...de(r)})}function T7(e,t,r){return new e({type:"union",options:t,...de(r)})}function R7(e,t,r){return new e({type:"union",options:t,inclusive:!1,...de(r)})}function $7(e,t,r,o){return new e({type:"union",options:r,discriminator:t,...de(o)})}function O7(e,t,r){return new e({type:"intersection",left:t,right:r})}function C7(e,t,r,o){let n=r instanceof Ne;return new e({type:"tuple",items:t,rest:n?r:null,...de(n?o:r)})}function P7(e,t,r,o){return new e({type:"record",keyType:t,valueType:r,...de(o)})}function z7(e,t,r,o){return new e({type:"map",keyType:t,valueType:r,...de(o)})}function N7(e,t,r){return new e({type:"set",valueType:t,...de(r)})}function D7(e,t,r){let o=Array.isArray(t)?Object.fromEntries(t.map((n)=>[n,n])):t;return new e({type:"enum",entries:o,...de(r)})}function L7(e,t,r){return new e({type:"enum",entries:t,...de(r)})}function B7(e,t,r){return new e({type:"literal",values:Array.isArray(t)?t:[t],...de(r)})}function z_(e,t){return new e({type:"file",...de(t)})}function j7(e,t){return new e({type:"transform",transform:t})}function Z7(e,t){return new e({type:"optional",innerType:t})}function U7(e,t){return new e({type:"nullable",innerType:t})}function M7(e,t,r){return new e({type:"default",innerType:t,get defaultValue(){return typeof r==="function"?r():Dv(r)}})}function q7(e,t,r){return new e({type:"nonoptional",innerType:t,...de(r)})}function F7(e,t){return new e({type:"success",innerType:t})}function K7(e,t,r){return new e({type:"catch",innerType:t,catchValue:typeof r==="function"?r:()=>r})}function J7(e,t,r){return new e({type:"pipe",in:t,out:r})}function H7(e,t){return new e({type:"readonly",innerType:t})}function V7(e,t,r){return new e({type:"template_literal",parts:t,...de(r)})}function W7(e,t){return new e({type:"lazy",getter:t})}function G7(e,t){return new e({type:"promise",innerType:t})}function N_(e,t,r){let o=de(r);return o.abort??(o.abort=!0),new e({type:"custom",check:"custom",fn:t,...o})}function D_(e,t,r){return new e({type:"custom",check:"custom",fn:t,...de(r)})}function L_(e,t){let r=EN((o)=>(o.addIssue=(n)=>{if(typeof n==="string")o.issues.push(Ya(n,o.value,r._zod.def));else{let i=n;if(i.fatal)i.continue=!1;i.code??(i.code="custom"),i.input??(i.input=o.value),i.inst??(i.inst=r),i.continue??(i.continue=!r._zod.def.abort),o.issues.push(Ya(i))}},e(o.value,o)),t);return r}function EN(e,t){let r=new rt({check:"custom",...de(t)});return r._zod.check=e,r}function B_(e){let t=new rt({check:"describe"});return t._zod.onattach=[(r)=>{let o=Vt.get(r)??{};Vt.add(r,{...o,description:e})}],t._zod.check=()=>{},t}function j_(e){let t=new rt({check:"meta"});return t._zod.onattach=[(r)=>{let o=Vt.get(r)??{};Vt.add(r,{...o,...e})}],t._zod.check=()=>{},t}function Z_(e,t){let r=de(t),o=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];if(r.case!=="sensitive")o=o.map((h)=>typeof h==="string"?h.toLowerCase():h),n=n.map((h)=>typeof h==="string"?h.toLowerCase():h);let i=new Set(o),s=new Set(n),a=e.Codec??Fu,c=e.Boolean??Mu,d=new(e.String??Zs)({type:"string",error:r.error}),f=new c({type:"boolean",error:r.error}),m=new a({type:"pipe",in:d,out:f,transform:(h,b)=>{let y=h;if(r.case!=="sensitive")y=y.toLowerCase();if(i.has(y))return!0;else if(s.has(y))return!1;else return b.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...s],input:b.value,inst:m,continue:!1}),{}},reverseTransform:(h,b)=>{if(h===!0)return o[0]||"true";else return n[0]||"false"},error:r.error});return m}function yc(e,t,r,o={}){let n=de(o),i={...de(o),check:"string_format",type:"string",format:t,fn:typeof r==="function"?r:(a)=>r.test(a),...n};if(r instanceof RegExp)i.pattern=r;return new e(i)}var i_;var kN=v(()=>{Em();Gu();Xx();ke();i_={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function ki(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";return{processors:e.processors??{},metadataRegistry:e?.metadata??Vt,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function We(e,t,r={path:[],schemaPath:[]}){var o;let n=e._zod.def,i=t.seen.get(e);if(i){if(i.count++,r.schemaPath.includes(e))i.cycle=r.path;return i.schema}let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,d);else{let m=s.schema,h=t.processors[n.type];if(!h)throw Error(`[toJSONSchema]: Non-representable type encountered: ${n.type}`);h(e,t,m,d)}let f=e._zod.parent;if(f){if(!s.ref)s.ref=f;We(f,t,d),t.seen.get(f).isParent=!0}}let c=t.metadataRegistry.get(e);if(c)Object.assign(s.schema,c);if(t.io==="input"&&hr(e))delete s.schema.examples,delete s.schema.default;if(t.io==="input"&&"_prefault"in s.schema)(o=s.schema).default??(o.default=s.schema._prefault);return delete s.schema._prefault,t.seen.get(e).schema}function Ii(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=new Map;for(let s of e.seen.entries()){let a=e.metadataRegistry.get(s[0])?.id;if(a){let c=o.get(a);if(c&&c!==s[0])throw Error(`Duplicate schema id "${a}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);o.set(a,s[0])}}let n=(s)=>{let a=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){let f=e.external.registry.get(s[0])?.id,m=e.external.uri??((b)=>b);if(f)return{ref:m(f)};let h=s[1].defId??s[1].schema.id??`schema${e.counter++}`;return s[1].defId=h,{defId:h,ref:`${m("__shared")}#/${a}/${h}`}}if(s[1]===r)return{ref:"#"};let u=`${"#"}/${a}/`,d=s[1].schema.id??`__schema${e.counter++}`;return{defId:d,ref:u+d}},i=(s)=>{if(s[1].schema.$ref)return;let a=s[1],{ref:c,defId:u}=n(s);if(a.def={...a.schema},u)a.defId=u;let d=a.schema;for(let f in d)delete d[f];d.$ref=c};if(e.cycles==="throw")for(let s of e.seen.entries()){let a=s[1];if(a.cycle)throw Error(`Cycle detected: #/${a.cycle?.join("/")}/<root>
|
|
218
|
+
|
|
219
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let s of e.seen.entries()){let a=s[1];if(t===s[0]){i(s);continue}if(e.external){let u=e.external.registry.get(s[0])?.id;if(t!==s[0]&&u){i(s);continue}}if(e.metadataRegistry.get(s[0])?.id){i(s);continue}if(a.cycle){i(s);continue}if(a.count>1){if(e.reused==="ref"){i(s);continue}}}}function Ai(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let o=(a)=>{let c=e.seen.get(a);if(c.ref===null)return;let u=c.def??c.schema,d={...u},f=c.ref;if(c.ref=null,f){o(f);let h=e.seen.get(f),b=h.schema;if(b.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0"))u.allOf=u.allOf??[],u.allOf.push(b);else Object.assign(u,b);if(Object.assign(u,d),a._zod.parent===f)for(let S in u){if(S==="$ref"||S==="allOf")continue;if(!(S in d))delete u[S]}if(b.$ref&&h.def)for(let S in u){if(S==="$ref"||S==="allOf")continue;if(S in h.def&&JSON.stringify(u[S])===JSON.stringify(h.def[S]))delete u[S]}}let m=a._zod.parent;if(m&&m!==f){o(m);let h=e.seen.get(m);if(h?.schema.$ref){if(u.$ref=h.schema.$ref,h.def)for(let b in u){if(b==="$ref"||b==="allOf")continue;if(b in h.def&&JSON.stringify(u[b])===JSON.stringify(h.def[b]))delete u[b]}}}e.override({zodSchema:a,jsonSchema:u,path:c.path??[]})};for(let a of[...e.seen.entries()].reverse())o(a[0]);let n={};if(e.target==="draft-2020-12")n.$schema="https://json-schema.org/draft/2020-12/schema";else if(e.target==="draft-07")n.$schema="http://json-schema.org/draft-07/schema#";else if(e.target==="draft-04")n.$schema="http://json-schema.org/draft-04/schema#";else if(e.target==="openapi-3.0");if(e.external?.uri){let a=e.external.registry.get(t)?.id;if(!a)throw Error("Schema is missing an `id` property");n.$id=e.external.uri(a)}Object.assign(n,r.def??r.schema);let i=e.metadataRegistry.get(t)?.id;if(i!==void 0&&n.id===i)delete n.id;let s=e.external?.defs??{};for(let a of e.seen.entries()){let c=a[1];if(c.def&&c.defId){if(c.def.id===c.defId)delete c.def.id;s[c.defId]=c.def}}if(e.external);else if(Object.keys(s).length>0)if(e.target==="draft-2020-12")n.$defs=s;else n.definitions=s;try{let a=JSON.parse(JSON.stringify(n));return Object.defineProperty(a,"~standard",{value:{...t["~standard"],jsonSchema:{input:bc(t,"input",e.processors),output:bc(t,"output",e.processors)}},enumerable:!1,writable:!1}),a}catch(a){throw Error("Error converting schema to JSON.")}}function hr(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let o=e._zod.def;if(o.type==="transform")return!0;if(o.type==="array")return hr(o.element,r);if(o.type==="set")return hr(o.valueType,r);if(o.type==="lazy")return hr(o.getter(),r);if(o.type==="promise"||o.type==="optional"||o.type==="nonoptional"||o.type==="nullable"||o.type==="readonly"||o.type==="default"||o.type==="prefault")return hr(o.innerType,r);if(o.type==="intersection")return hr(o.left,r)||hr(o.right,r);if(o.type==="record"||o.type==="map")return hr(o.keyType,r)||hr(o.valueType,r);if(o.type==="pipe"){if(e._zod.traits.has("$ZodCodec"))return!0;return hr(o.in,r)||hr(o.out,r)}if(o.type==="object"){for(let n in o.shape)if(hr(o.shape[n],r))return!0;return!1}if(o.type==="union"){for(let n of o.options)if(hr(n,r))return!0;return!1}if(o.type==="tuple"){for(let n of o.items)if(hr(n,r))return!0;if(o.rest&&hr(o.rest,r))return!0;return!1}return!1}var U_=(e,t={})=>(r)=>{let o=ki({...r,processors:t});return We(e,o),Ii(o,e),Ai(o,e)},bc=(e,t,r={})=>(o)=>{let{libraryOptions:n,target:i}=o??{},s=ki({...n??{},target:i,io:t,processors:r});return We(e,s),Ii(s,e),Ai(s,e)};var Xu=v(()=>{Gu()});function uh(e,t){if("_idmap"in e){let o=e,n=ki({...t,processors:ah}),i={};for(let c of o._idmap.entries()){let[u,d]=c;We(d,n)}let s={},a={registry:o,uri:t?.uri,defs:i};n.external=a;for(let c of o._idmap.entries()){let[u,d]=c;Ii(n,d),s[u]=Ai(n,d)}if(Object.keys(i).length>0){let c=n.target==="draft-2020-12"?"$defs":"definitions";s.__shared={[c]:i}}return{schemas:s}}let r=ki({...t,processors:ah});return We(e,r),Ii(r,e),Ai(r,e)}var Q7,M_=(e,t,r,o)=>{let n=r;n.type="string";let{minimum:i,maximum:s,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if(typeof i==="number")n.minLength=i;if(typeof s==="number")n.maxLength=s;if(a){if(n.format=Q7[a]??a,n.format==="")delete n.format;if(a==="time")delete n.format}if(u)n.contentEncoding=u;if(c&&c.size>0){let d=[...c];if(d.length===1)n.pattern=d[0].source;else if(d.length>1)n.allOf=[...d.map((f)=>({...t.target==="draft-07"||t.target==="draft-04"||t.target==="openapi-3.0"?{type:"string"}:{},pattern:f.source}))]}},q_=(e,t,r,o)=>{let n=r,{minimum:i,maximum:s,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:d}=e._zod.bag;if(typeof a==="string"&&a.includes("int"))n.type="integer";else n.type="number";let f=typeof d==="number"&&d>=(i??Number.NEGATIVE_INFINITY),m=typeof u==="number"&&u<=(s??Number.POSITIVE_INFINITY),h=t.target==="draft-04"||t.target==="openapi-3.0";if(f)if(h)n.minimum=d,n.exclusiveMinimum=!0;else n.exclusiveMinimum=d;else if(typeof i==="number")n.minimum=i;if(m)if(h)n.maximum=u,n.exclusiveMaximum=!0;else n.exclusiveMaximum=u;else if(typeof s==="number")n.maximum=s;if(typeof c==="number")n.multipleOf=c},F_=(e,t,r,o)=>{r.type="boolean"},K_=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("BigInt cannot be represented in JSON Schema")},J_=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Symbols cannot be represented in JSON Schema")},H_=(e,t,r,o)=>{if(t.target==="openapi-3.0")r.type="string",r.nullable=!0,r.enum=[null];else r.type="null"},V_=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Undefined cannot be represented in JSON Schema")},W_=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Void cannot be represented in JSON Schema")},G_=(e,t,r,o)=>{r.not={}},Q_=(e,t,r,o)=>{},Y_=(e,t,r,o)=>{},X_=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Date cannot be represented in JSON Schema")},eE=(e,t,r,o)=>{let n=e._zod.def,i=Ou(n.entries);if(i.every((s)=>typeof s==="number"))r.type="number";if(i.every((s)=>typeof s==="string"))r.type="string";r.enum=i},tE=(e,t,r,o)=>{let n=e._zod.def,i=[];for(let s of n.values)if(s===void 0){if(t.unrepresentable==="throw")throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof s==="bigint")if(t.unrepresentable==="throw")throw Error("BigInt literals cannot be represented in JSON Schema");else i.push(Number(s));else i.push(s);if(i.length===0);else if(i.length===1){let s=i[0];if(r.type=s===null?"null":typeof s,t.target==="draft-04"||t.target==="openapi-3.0")r.enum=[s];else r.const=s}else{if(i.every((s)=>typeof s==="number"))r.type="number";if(i.every((s)=>typeof s==="string"))r.type="string";if(i.every((s)=>typeof s==="boolean"))r.type="boolean";if(i.every((s)=>s===null))r.type="null";r.enum=i}},rE=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("NaN cannot be represented in JSON Schema")},nE=(e,t,r,o)=>{let n=r,i=e._zod.pattern;if(!i)throw Error("Pattern not found in template literal");n.type="string",n.pattern=i.source},oE=(e,t,r,o)=>{let n=r,i={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=e._zod.bag;if(s!==void 0)i.minLength=s;if(a!==void 0)i.maxLength=a;if(c)if(c.length===1)i.contentMediaType=c[0],Object.assign(n,i);else Object.assign(n,i),n.anyOf=c.map((u)=>({contentMediaType:u}));else Object.assign(n,i)},iE=(e,t,r,o)=>{r.type="boolean"},sE=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Custom types cannot be represented in JSON Schema")},aE=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Function types cannot be represented in JSON Schema")},cE=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Transforms cannot be represented in JSON Schema")},lE=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Map cannot be represented in JSON Schema")},uE=(e,t,r,o)=>{if(t.unrepresentable==="throw")throw Error("Set cannot be represented in JSON Schema")},dE=(e,t,r,o)=>{let n=r,i=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;if(typeof s==="number")n.minItems=s;if(typeof a==="number")n.maxItems=a;n.type="array",n.items=We(i.element,t,{...o,path:[...o.path,"items"]})},fE=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object",n.properties={};let s=i.shape;for(let u in s)n.properties[u]=We(s[u],t,{...o,path:[...o.path,"properties",u]});let a=new Set(Object.keys(s)),c=new Set([...a].filter((u)=>{let d=i.shape[u]._zod;if(t.io==="input")return d.optin===void 0;else return d.optout===void 0}));if(c.size>0)n.required=Array.from(c);if(i.catchall?._zod.def.type==="never")n.additionalProperties=!1;else if(!i.catchall){if(t.io==="output")n.additionalProperties=!1}else if(i.catchall)n.additionalProperties=We(i.catchall,t,{...o,path:[...o.path,"additionalProperties"]})},ch=(e,t,r,o)=>{let n=e._zod.def,i=n.inclusive===!1,s=n.options.map((a,c)=>We(a,t,{...o,path:[...o.path,i?"oneOf":"anyOf",c]}));if(i)r.oneOf=s;else r.anyOf=s},pE=(e,t,r,o)=>{let n=e._zod.def,i=We(n.left,t,{...o,path:[...o.path,"allOf",0]}),s=We(n.right,t,{...o,path:[...o.path,"allOf",1]}),a=(u)=>("allOf"in u)&&Object.keys(u).length===1,c=[...a(i)?i.allOf:[i],...a(s)?s.allOf:[s]];r.allOf=c},mE=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="array";let s=t.target==="draft-2020-12"?"prefixItems":"items",a=t.target==="draft-2020-12"?"items":t.target==="openapi-3.0"?"items":"additionalItems",c=i.items.map((m,h)=>We(m,t,{...o,path:[...o.path,s,h]})),u=i.rest?We(i.rest,t,{...o,path:[...o.path,a,...t.target==="openapi-3.0"?[i.items.length]:[]]}):null;if(t.target==="draft-2020-12"){if(n.prefixItems=c,u)n.items=u}else if(t.target==="openapi-3.0"){if(n.items={anyOf:c},u)n.items.anyOf.push(u);if(n.minItems=c.length,!u)n.maxItems=c.length}else if(n.items=c,u)n.additionalItems=u;let{minimum:d,maximum:f}=e._zod.bag;if(typeof d==="number")n.minItems=d;if(typeof f==="number")n.maxItems=f},hE=(e,t,r,o)=>{let n=r,i=e._zod.def;n.type="object";let s=i.keyType,c=s._zod.bag?.patterns;if(i.mode==="loose"&&c&&c.size>0){let d=We(i.valueType,t,{...o,path:[...o.path,"patternProperties","*"]});n.patternProperties={};for(let f of c)n.patternProperties[f.source]=d}else{if(t.target==="draft-07"||t.target==="draft-2020-12")n.propertyNames=We(i.keyType,t,{...o,path:[...o.path,"propertyNames"]});n.additionalProperties=We(i.valueType,t,{...o,path:[...o.path,"additionalProperties"]})}let u=s._zod.values;if(u){let d=[...u].filter((f)=>typeof f==="string"||typeof f==="number");if(d.length>0)n.required=d}},gE=(e,t,r,o)=>{let n=e._zod.def,i=We(n.innerType,t,o),s=t.seen.get(e);if(t.target==="openapi-3.0")s.ref=n.innerType,r.nullable=!0;else r.anyOf=[i,{type:"null"}]},yE=(e,t,r,o)=>{let n=e._zod.def;We(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},bE=(e,t,r,o)=>{let n=e._zod.def;We(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.default=JSON.parse(JSON.stringify(n.defaultValue))},SE=(e,t,r,o)=>{let n=e._zod.def;We(n.innerType,t,o);let i=t.seen.get(e);if(i.ref=n.innerType,t.io==="input")r._prefault=JSON.parse(JSON.stringify(n.defaultValue))},vE=(e,t,r,o)=>{let n=e._zod.def;We(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType;let s;try{s=n.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=s},wE=(e,t,r,o)=>{let n=e._zod.def,i=n.in._zod.traits.has("$ZodTransform"),s=t.io==="input"?i?n.out:n.in:n.out;We(s,t,o);let a=t.seen.get(e);a.ref=s},xE=(e,t,r,o)=>{let n=e._zod.def;We(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType,r.readOnly=!0},_E=(e,t,r,o)=>{let n=e._zod.def;We(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},lh=(e,t,r,o)=>{let n=e._zod.def;We(n.innerType,t,o);let i=t.seen.get(e);i.ref=n.innerType},EE=(e,t,r,o)=>{let n=e._zod.innerType;We(n,t,o);let i=t.seen.get(e);i.ref=n},ah;var ed=v(()=>{Xu();ke();Q7={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},ah={string:M_,number:q_,boolean:F_,bigint:K_,symbol:J_,null:H_,undefined:V_,void:W_,never:G_,any:Q_,unknown:Y_,date:X_,enum:eE,literal:tE,nan:rE,template_literal:nE,file:oE,success:iE,custom:sE,function:aE,transform:cE,map:lE,set:uE,array:dE,object:fE,union:ch,intersection:pE,tuple:mE,record:hE,nullable:gE,nonoptional:yE,default:bE,prefault:SE,catch:vE,pipe:wE,readonly:xE,promise:_E,optional:lh,lazy:EE}});class kE{get metadataRegistry(){return this.ctx.metadataRegistry}get target(){return this.ctx.target}get unrepresentable(){return this.ctx.unrepresentable}get override(){return this.ctx.override}get io(){return this.ctx.io}get counter(){return this.ctx.counter}set counter(e){this.ctx.counter=e}get seen(){return this.ctx.seen}constructor(e){let t=e?.target??"draft-2020-12";if(t==="draft-4")t="draft-04";if(t==="draft-7")t="draft-07";this.ctx=ki({processors:ah,target:t,...e?.metadata&&{metadata:e.metadata},...e?.unrepresentable&&{unrepresentable:e.unrepresentable},...e?.override&&{override:e.override},...e?.io&&{io:e.io}})}process(e,t={path:[],schemaPath:[]}){return We(e,this.ctx,t)}emit(e,t){if(t){if(t.cycles)this.ctx.cycles=t.cycles;if(t.reused)this.ctx.reused=t.reused;if(t.external)this.ctx.external=t.external}Ii(this.ctx,e);let r=Ai(this.ctx,e),{"~standard":o,...n}=r;return n}}var IN=v(()=>{ed();Xu()});var AN={};var TN=()=>{};var _o={};Lt(_o,{$ZodAny:()=>wx,$ZodArray:()=>Ix,$ZodAsyncError:()=>Mn,$ZodBase64:()=>dx,$ZodBase64URL:()=>fx,$ZodBigInt:()=>Om,$ZodBigIntFormat:()=>yx,$ZodBoolean:()=>Mu,$ZodCIDRv4:()=>cx,$ZodCIDRv6:()=>lx,$ZodCUID:()=>Gw,$ZodCUID2:()=>Qw,$ZodCatch:()=>Fx,$ZodCheck:()=>rt,$ZodCheckBigIntFormat:()=>kw,$ZodCheckEndsWith:()=>Lw,$ZodCheckGreaterThan:()=>_m,$ZodCheckIncludes:()=>Nw,$ZodCheckLengthEquals:()=>Ow,$ZodCheckLessThan:()=>xm,$ZodCheckLowerCase:()=>Pw,$ZodCheckMaxLength:()=>Rw,$ZodCheckMaxSize:()=>Iw,$ZodCheckMimeType:()=>jw,$ZodCheckMinLength:()=>$w,$ZodCheckMinSize:()=>Aw,$ZodCheckMultipleOf:()=>_w,$ZodCheckNumberFormat:()=>Ew,$ZodCheckOverwrite:()=>Zw,$ZodCheckProperty:()=>Bw,$ZodCheckRegex:()=>Cw,$ZodCheckSizeEquals:()=>Tw,$ZodCheckStartsWith:()=>Dw,$ZodCheckStringFormat:()=>nc,$ZodCheckUpperCase:()=>zw,$ZodCodec:()=>Fu,$ZodCustom:()=>Yx,$ZodCustomStringFormat:()=>hx,$ZodDate:()=>kx,$ZodDefault:()=>Zx,$ZodDiscriminatedUnion:()=>Rx,$ZodE164:()=>px,$ZodEmail:()=>Jw,$ZodEmoji:()=>Vw,$ZodEncodeError:()=>Ds,$ZodEnum:()=>zx,$ZodError:()=>Du,$ZodExactOptional:()=>Bx,$ZodFile:()=>Dx,$ZodFunction:()=>Wx,$ZodGUID:()=>Fw,$ZodIPv4:()=>ix,$ZodIPv6:()=>sx,$ZodISODate:()=>rx,$ZodISODateTime:()=>tx,$ZodISODuration:()=>ox,$ZodISOTime:()=>nx,$ZodIntersection:()=>$x,$ZodJWT:()=>mx,$ZodKSUID:()=>ex,$ZodLazy:()=>Qx,$ZodLiteral:()=>Nx,$ZodMAC:()=>ax,$ZodMap:()=>Cx,$ZodNaN:()=>Kx,$ZodNanoID:()=>Ww,$ZodNever:()=>_x,$ZodNonOptional:()=>Mx,$ZodNull:()=>vx,$ZodNullable:()=>jx,$ZodNumber:()=>$m,$ZodNumberFormat:()=>gx,$ZodObject:()=>_z,$ZodObjectJIT:()=>Ax,$ZodOptional:()=>Pm,$ZodPipe:()=>zm,$ZodPrefault:()=>Ux,$ZodPreprocess:()=>Jx,$ZodPromise:()=>Gx,$ZodReadonly:()=>Hx,$ZodRealError:()=>Er,$ZodRecord:()=>Ox,$ZodRegistry:()=>t_,$ZodSet:()=>Px,$ZodString:()=>Zs,$ZodStringFormat:()=>Xe,$ZodSuccess:()=>qx,$ZodSymbol:()=>bx,$ZodTemplateLiteral:()=>Vx,$ZodTransform:()=>Lx,$ZodTuple:()=>Cm,$ZodType:()=>Ne,$ZodULID:()=>Yw,$ZodURL:()=>Hw,$ZodUUID:()=>Kw,$ZodUndefined:()=>Sx,$ZodUnion:()=>qu,$ZodUnknown:()=>xx,$ZodVoid:()=>Ex,$ZodXID:()=>Xw,$ZodXor:()=>Tx,$brand:()=>Ov,$constructor:()=>Z,$input:()=>e_,$output:()=>X0,Doc:()=>km,JSONSchema:()=>AN,JSONSchemaGenerator:()=>kE,NEVER:()=>$v,TimePrecision:()=>i_,_any:()=>I_,_array:()=>P_,_base64:()=>Ym,_base64url:()=>Xm,_bigint:()=>S_,_boolean:()=>y_,_catch:()=>K7,_check:()=>EN,_cidrv4:()=>Gm,_cidrv6:()=>Qm,_coercedBigint:()=>v_,_coercedBoolean:()=>b_,_coercedDate:()=>O_,_coercedNumber:()=>d_,_coercedString:()=>n_,_cuid:()=>qm,_cuid2:()=>Fm,_custom:()=>N_,_date:()=>$_,_decode:()=>pm,_decodeAsync:()=>hm,_default:()=>M7,_discriminatedUnion:()=>$7,_e164:()=>eh,_email:()=>Dm,_emoji:()=>Um,_encode:()=>fm,_encodeAsync:()=>mm,_endsWith:()=>uc,_enum:()=>D7,_file:()=>z_,_float32:()=>p_,_float64:()=>m_,_gt:()=>Fn,_gte:()=>mr,_guid:()=>Qu,_includes:()=>cc,_int:()=>f_,_int32:()=>h_,_int64:()=>w_,_intersection:()=>O7,_ipv4:()=>Vm,_ipv6:()=>Wm,_isoDate:()=>a_,_isoDateTime:()=>s_,_isoDuration:()=>l_,_isoTime:()=>c_,_jwt:()=>th,_ksuid:()=>Hm,_lazy:()=>W7,_length:()=>qs,_literal:()=>B7,_lowercase:()=>sc,_lt:()=>qn,_lte:()=>Br,_mac:()=>o_,_map:()=>z7,_max:()=>Br,_maxLength:()=>Ms,_maxSize:()=>Ei,_mime:()=>dc,_min:()=>mr,_minLength:()=>xo,_minSize:()=>Kn,_multipleOf:()=>_i,_nan:()=>C_,_nanoid:()=>Mm,_nativeEnum:()=>L7,_negative:()=>nh,_never:()=>T_,_nonnegative:()=>ih,_nonoptional:()=>q7,_nonpositive:()=>oh,_normalize:()=>fc,_null:()=>k_,_nullable:()=>U7,_number:()=>u_,_optional:()=>Z7,_overwrite:()=>pn,_parse:()=>Xa,_parseAsync:()=>ec,_pipe:()=>J7,_positive:()=>rh,_promise:()=>G7,_property:()=>sh,_readonly:()=>H7,_record:()=>P7,_refine:()=>D_,_regex:()=>ic,_safeDecode:()=>ym,_safeDecodeAsync:()=>Sm,_safeEncode:()=>gm,_safeEncodeAsync:()=>bm,_safeParse:()=>tc,_safeParseAsync:()=>rc,_set:()=>N7,_size:()=>Us,_slugify:()=>gc,_startsWith:()=>lc,_string:()=>r_,_stringFormat:()=>yc,_stringbool:()=>Z_,_success:()=>F7,_superRefine:()=>L_,_symbol:()=>__,_templateLiteral:()=>V7,_toLowerCase:()=>mc,_toUpperCase:()=>hc,_transform:()=>j7,_trim:()=>pc,_tuple:()=>C7,_uint32:()=>g_,_uint64:()=>x_,_ulid:()=>Km,_undefined:()=>E_,_union:()=>T7,_unknown:()=>A_,_uppercase:()=>ac,_url:()=>Yu,_uuid:()=>Lm,_uuidv4:()=>Bm,_uuidv6:()=>jm,_uuidv7:()=>Zm,_void:()=>R_,_xid:()=>Jm,_xor:()=>R7,clone:()=>fr,config:()=>gt,createStandardJSONSchemaMethod:()=>bc,createToJSONSchemaMethod:()=>U_,decode:()=>GV,decodeAsync:()=>YV,describe:()=>B_,encode:()=>WV,encodeAsync:()=>QV,extractDefs:()=>Ii,finalize:()=>Ai,flattenError:()=>Lu,formatError:()=>Bu,globalConfig:()=>Ns,globalRegistry:()=>Vt,initializeContext:()=>ki,isValidBase64:()=>ux,isValidBase64URL:()=>Sz,isValidJWT:()=>vz,locales:()=>Wu,meta:()=>j_,parse:()=>um,parseAsync:()=>dm,prettifyError:()=>qv,process:()=>We,regexes:()=>Lr,registry:()=>Nm,safeDecode:()=>e9,safeDecodeAsync:()=>r9,safeEncode:()=>XV,safeEncodeAsync:()=>t9,safeParse:()=>Kv,safeParseAsync:()=>Jv,toDotPath:()=>YP,toJSONSchema:()=>uh,treeifyError:()=>Mv,util:()=>ue,version:()=>Uw});var jr=v(()=>{ke();wm();Y0();ed();IN();TN();Ls();Hv();Fv();Xx();Em();Mw();Gu();kN();Xu()});var dh={};Lt(dh,{endsWith:()=>uc,gt:()=>Fn,gte:()=>mr,includes:()=>cc,length:()=>qs,lowercase:()=>sc,lt:()=>qn,lte:()=>Br,maxLength:()=>Ms,maxSize:()=>Ei,mime:()=>dc,minLength:()=>xo,minSize:()=>Kn,multipleOf:()=>_i,negative:()=>nh,nonnegative:()=>ih,nonpositive:()=>oh,normalize:()=>fc,overwrite:()=>pn,positive:()=>rh,property:()=>sh,regex:()=>ic,size:()=>Us,slugify:()=>gc,startsWith:()=>lc,toLowerCase:()=>mc,toUpperCase:()=>hc,trim:()=>pc,uppercase:()=>ac});var fh=v(()=>{jr()});var Sc={};Lt(Sc,{ZodISODate:()=>mh,ZodISODateTime:()=>ph,ZodISODuration:()=>gh,ZodISOTime:()=>hh,date:()=>AE,datetime:()=>IE,duration:()=>RE,time:()=>TE});function IE(e){return s_(ph,e)}function AE(e){return a_(mh,e)}function TE(e){return c_(hh,e)}function RE(e){return l_(gh,e)}var ph,mh,hh,gh;var td=v(()=>{jr();nd();ph=Z("ZodISODateTime",(e,t)=>{tx.init(e,t),et.init(e,t)});mh=Z("ZodISODate",(e,t)=>{rx.init(e,t),et.init(e,t)});hh=Z("ZodISOTime",(e,t)=>{nx.init(e,t),et.init(e,t)});gh=Z("ZodISODuration",(e,t)=>{ox.init(e,t),et.init(e,t)})});var RN=(e,t)=>{Du.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:(r)=>Bu(e,r)},flatten:{value:(r)=>Lu(e,r)},addIssue:{value:(r)=>{e.issues.push(r),e.message=JSON.stringify(e.issues,Ga,2)}},addIssues:{value:(r)=>{e.issues.push(...r),e.message=JSON.stringify(e.issues,Ga,2)}},isEmpty:{get(){return e.issues.length===0}}})},$N,kr;var $E=v(()=>{jr();jr();ke();$N=Z("ZodError",RN),kr=Z("ZodError",RN,{Parent:Error})});var OE,CE,PE,zE,NE,DE,LE,BE,jE,ZE,UE,ME;var qE=v(()=>{jr();$E();OE=Xa(kr),CE=ec(kr),PE=tc(kr),zE=rc(kr),NE=fm(kr),DE=pm(kr),LE=mm(kr),BE=hm(kr),jE=gm(kr),ZE=ym(kr),UE=bm(kr),ME=Sm(kr)});var rd={};Lt(rd,{ZodAny:()=>QE,ZodArray:()=>tk,ZodBase64:()=>Ch,ZodBase64URL:()=>Ph,ZodBigInt:()=>Ic,ZodBigIntFormat:()=>Dh,ZodBoolean:()=>kc,ZodCIDRv4:()=>$h,ZodCIDRv6:()=>Oh,ZodCUID:()=>_h,ZodCUID2:()=>Eh,ZodCatch:()=>_k,ZodCodec:()=>hd,ZodCustom:()=>gd,ZodCustomStringFormat:()=>_c,ZodDate:()=>ud,ZodDefault:()=>yk,ZodDiscriminatedUnion:()=>nk,ZodE164:()=>zh,ZodEmail:()=>vh,ZodEmoji:()=>wh,ZodEnum:()=>wc,ZodExactOptional:()=>mk,ZodFile:()=>fk,ZodFunction:()=>Pk,ZodGUID:()=>id,ZodIPv4:()=>Th,ZodIPv6:()=>Rh,ZodIntersection:()=>ok,ZodJWT:()=>Nh,ZodKSUID:()=>Ah,ZodLazy:()=>$k,ZodLiteral:()=>dk,ZodMAC:()=>FE,ZodMap:()=>lk,ZodNaN:()=>kk,ZodNanoID:()=>xh,ZodNever:()=>XE,ZodNonOptional:()=>Mh,ZodNull:()=>WE,ZodNullable:()=>gk,ZodNumber:()=>Ec,ZodNumberFormat:()=>Ks,ZodObject:()=>fd,ZodOptional:()=>Uh,ZodPipe:()=>md,ZodPrefault:()=>Sk,ZodPreprocess:()=>Ik,ZodPromise:()=>Ck,ZodReadonly:()=>Ak,ZodRecord:()=>vc,ZodSet:()=>uk,ZodString:()=>xc,ZodStringFormat:()=>et,ZodSuccess:()=>xk,ZodSymbol:()=>HE,ZodTemplateLiteral:()=>Rk,ZodTransform:()=>pk,ZodTuple:()=>sk,ZodType:()=>Be,ZodULID:()=>kh,ZodURL:()=>ld,ZodUUID:()=>Jn,ZodUndefined:()=>VE,ZodUnion:()=>pd,ZodUnknown:()=>YE,ZodVoid:()=>ek,ZodXID:()=>Ih,ZodXor:()=>rk,_ZodString:()=>Sh,_default:()=>bk,_function:()=>B2,any:()=>h2,array:()=>dd,base64:()=>YN,base64url:()=>XN,bigint:()=>u2,boolean:()=>JE,catch:()=>Ek,check:()=>j2,cidrv4:()=>GN,cidrv6:()=>QN,codec:()=>z2,cuid:()=>MN,cuid2:()=>qN,custom:()=>Z2,date:()=>y2,describe:()=>U2,discriminatedUnion:()=>_2,e164:()=>e2,email:()=>CN,emoji:()=>ZN,enum:()=>jh,exactOptional:()=>hk,file:()=>$2,float32:()=>s2,float64:()=>a2,function:()=>B2,guid:()=>PN,hash:()=>i2,hex:()=>o2,hostname:()=>n2,httpUrl:()=>jN,instanceof:()=>q2,int:()=>yh,int32:()=>c2,int64:()=>d2,intersection:()=>ik,invertCodec:()=>N2,ipv4:()=>HN,ipv6:()=>WN,json:()=>K2,jwt:()=>t2,keyof:()=>b2,ksuid:()=>JN,lazy:()=>Ok,literal:()=>R2,looseObject:()=>w2,looseRecord:()=>k2,mac:()=>VN,map:()=>I2,meta:()=>M2,nan:()=>P2,nanoid:()=>UN,nativeEnum:()=>T2,never:()=>Lh,nonoptional:()=>wk,null:()=>GE,nullable:()=>ad,nullish:()=>O2,number:()=>KE,object:()=>S2,optional:()=>sd,partialRecord:()=>E2,pipe:()=>bh,prefault:()=>vk,preprocess:()=>J2,promise:()=>L2,readonly:()=>Tk,record:()=>ck,refine:()=>zk,set:()=>A2,strictObject:()=>v2,string:()=>od,stringFormat:()=>r2,stringbool:()=>F2,success:()=>C2,superRefine:()=>Nk,symbol:()=>p2,templateLiteral:()=>D2,transform:()=>Zh,tuple:()=>ak,uint32:()=>l2,uint64:()=>f2,ulid:()=>FN,undefined:()=>m2,union:()=>Bh,unknown:()=>Fs,url:()=>BN,uuid:()=>zN,uuidv4:()=>NN,uuidv6:()=>DN,uuidv7:()=>LN,void:()=>g2,xid:()=>KN,xor:()=>x2});function cd(e,t,r){let o=Object.getPrototypeOf(e),n=ON.get(o);if(!n)n=new Set,ON.set(o,n);if(n.has(t))return;n.add(t);for(let i in r){let s=r[i];Object.defineProperty(o,i,{configurable:!0,enumerable:!1,get(){let a=s.bind(this);return Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a}),a},set(a){Object.defineProperty(this,i,{configurable:!0,writable:!0,enumerable:!0,value:a})}})}}function od(e){return r_(xc,e)}function CN(e){return Dm(vh,e)}function PN(e){return Qu(id,e)}function zN(e){return Lm(Jn,e)}function NN(e){return Bm(Jn,e)}function DN(e){return jm(Jn,e)}function LN(e){return Zm(Jn,e)}function BN(e){return Yu(ld,e)}function jN(e){return Yu(ld,{protocol:Lr.httpProtocol,hostname:Lr.domain,...ue.normalizeParams(e)})}function ZN(e){return Um(wh,e)}function UN(e){return Mm(xh,e)}function MN(e){return qm(_h,e)}function qN(e){return Fm(Eh,e)}function FN(e){return Km(kh,e)}function KN(e){return Jm(Ih,e)}function JN(e){return Hm(Ah,e)}function HN(e){return Vm(Th,e)}function VN(e){return o_(FE,e)}function WN(e){return Wm(Rh,e)}function GN(e){return Gm($h,e)}function QN(e){return Qm(Oh,e)}function YN(e){return Ym(Ch,e)}function XN(e){return Xm(Ph,e)}function e2(e){return eh(zh,e)}function t2(e){return th(Nh,e)}function r2(e,t,r={}){return yc(_c,e,t,r)}function n2(e){return yc(_c,"hostname",Lr.hostname,e)}function o2(e){return yc(_c,"hex",Lr.hex,e)}function i2(e,t){let r=t?.enc??"hex",o=`${e}_${r}`,n=Lr[o];if(!n)throw Error(`Unrecognized hash format: ${o}`);return yc(_c,o,n,t)}function KE(e){return u_(Ec,e)}function yh(e){return f_(Ks,e)}function s2(e){return p_(Ks,e)}function a2(e){return m_(Ks,e)}function c2(e){return h_(Ks,e)}function l2(e){return g_(Ks,e)}function JE(e){return y_(kc,e)}function u2(e){return S_(Ic,e)}function d2(e){return w_(Dh,e)}function f2(e){return x_(Dh,e)}function p2(e){return __(HE,e)}function m2(e){return E_(VE,e)}function GE(e){return k_(WE,e)}function h2(){return I_(QE)}function Fs(){return A_(YE)}function Lh(e){return T_(XE,e)}function g2(e){return R_(ek,e)}function y2(e){return $_(ud,e)}function dd(e,t){return P_(tk,e,t)}function b2(e){let t=e._zod.def.shape;return jh(Object.keys(t))}function S2(e,t){let r={type:"object",shape:e??{},...ue.normalizeParams(t)};return new fd(r)}function v2(e,t){return new fd({type:"object",shape:e,catchall:Lh(),...ue.normalizeParams(t)})}function w2(e,t){return new fd({type:"object",shape:e,catchall:Fs(),...ue.normalizeParams(t)})}function Bh(e,t){return new pd({type:"union",options:e,...ue.normalizeParams(t)})}function x2(e,t){return new rk({type:"union",options:e,inclusive:!1,...ue.normalizeParams(t)})}function _2(e,t,r){return new nk({type:"union",options:t,discriminator:e,...ue.normalizeParams(r)})}function ik(e,t){return new ok({type:"intersection",left:e,right:t})}function ak(e,t,r){let o=t instanceof Ne,n=o?r:t;return new sk({type:"tuple",items:e,rest:o?t:null,...ue.normalizeParams(n)})}function ck(e,t,r){if(!t||!t._zod)return new vc({type:"record",keyType:od(),valueType:e,...ue.normalizeParams(t)});return new vc({type:"record",keyType:e,valueType:t,...ue.normalizeParams(r)})}function E2(e,t,r){let o=fr(e);return o._zod.values=void 0,new vc({type:"record",keyType:o,valueType:t,...ue.normalizeParams(r)})}function k2(e,t,r){return new vc({type:"record",keyType:e,valueType:t,mode:"loose",...ue.normalizeParams(r)})}function I2(e,t,r){return new lk({type:"map",keyType:e,valueType:t,...ue.normalizeParams(r)})}function A2(e,t){return new uk({type:"set",valueType:e,...ue.normalizeParams(t)})}function jh(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map((o)=>[o,o])):e;return new wc({type:"enum",entries:r,...ue.normalizeParams(t)})}function T2(e,t){return new wc({type:"enum",entries:e,...ue.normalizeParams(t)})}function R2(e,t){return new dk({type:"literal",values:Array.isArray(e)?e:[e],...ue.normalizeParams(t)})}function $2(e){return z_(fk,e)}function Zh(e){return new pk({type:"transform",transform:e})}function sd(e){return new Uh({type:"optional",innerType:e})}function hk(e){return new mk({type:"optional",innerType:e})}function ad(e){return new gk({type:"nullable",innerType:e})}function O2(e){return sd(ad(e))}function bk(e,t){return new yk({type:"default",innerType:e,get defaultValue(){return typeof t==="function"?t():ue.shallowClone(t)}})}function vk(e,t){return new Sk({type:"prefault",innerType:e,get defaultValue(){return typeof t==="function"?t():ue.shallowClone(t)}})}function wk(e,t){return new Mh({type:"nonoptional",innerType:e,...ue.normalizeParams(t)})}function C2(e){return new xk({type:"success",innerType:e})}function Ek(e,t){return new _k({type:"catch",innerType:e,catchValue:typeof t==="function"?t:()=>t})}function P2(e){return C_(kk,e)}function bh(e,t){return new md({type:"pipe",in:e,out:t})}function z2(e,t,r){return new hd({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}function N2(e){let t=e._zod.def;return new hd({type:"pipe",in:t.out,out:t.in,transform:t.reverseTransform,reverseTransform:t.transform})}function Tk(e){return new Ak({type:"readonly",innerType:e})}function D2(e,t){return new Rk({type:"template_literal",parts:e,...ue.normalizeParams(t)})}function Ok(e){return new $k({type:"lazy",getter:e})}function L2(e){return new Ck({type:"promise",innerType:e})}function B2(e){return new Pk({type:"function",input:Array.isArray(e?.input)?ak(e?.input):e?.input??dd(Fs()),output:e?.output??Fs()})}function j2(e){let t=new rt({check:"custom"});return t._zod.check=e,t}function Z2(e,t){return N_(gd,e??(()=>!0),t)}function zk(e,t={}){return D_(gd,e,t)}function Nk(e,t){return L_(e,t)}function q2(e,t={}){let r=new gd({type:"custom",check:"custom",fn:(o)=>o instanceof e,abort:!0,...ue.normalizeParams(t)});return r._zod.bag.Class=e,r._zod.check=(o)=>{if(!(o.value instanceof e))o.issues.push({code:"invalid_type",expected:e.name,input:o.value,inst:r,path:[...r._zod.def.path??[]]})},r}function K2(e){let t=Ok(()=>Bh([od(e),KE(),JE(),GE(),dd(t),ck(od(),t)]));return t}function J2(e,t){return new Ik({type:"pipe",in:Zh(e),out:t})}var ON,Be,Sh,xc,et,vh,id,Jn,ld,wh,xh,_h,Eh,kh,Ih,Ah,Th,FE,Rh,$h,Oh,Ch,Ph,zh,Nh,_c,Ec,Ks,kc,Ic,Dh,HE,VE,WE,QE,YE,XE,ek,ud,tk,fd,pd,rk,nk,ok,sk,vc,lk,uk,wc,dk,fk,pk,Uh,mk,gk,yk,Sk,Mh,xk,_k,kk,md,hd,Ik,Ak,Rk,$k,Ck,Pk,gd,U2,M2,F2=(...e)=>Z_({Codec:hd,Boolean:kc,String:xc},...e);var nd=v(()=>{jr();jr();ed();Xu();fh();td();qE();ON=new WeakMap;Be=Z("ZodType",(e,t)=>(Ne.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:bc(e,"input"),output:bc(e,"output")}}),e.toJSONSchema=U_(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(r,o)=>OE(e,r,o,{callee:e.parse}),e.safeParse=(r,o)=>PE(e,r,o),e.parseAsync=async(r,o)=>CE(e,r,o,{callee:e.parseAsync}),e.safeParseAsync=async(r,o)=>zE(e,r,o),e.spa=e.safeParseAsync,e.encode=(r,o)=>NE(e,r,o),e.decode=(r,o)=>DE(e,r,o),e.encodeAsync=async(r,o)=>LE(e,r,o),e.decodeAsync=async(r,o)=>BE(e,r,o),e.safeEncode=(r,o)=>jE(e,r,o),e.safeDecode=(r,o)=>ZE(e,r,o),e.safeEncodeAsync=async(r,o)=>UE(e,r,o),e.safeDecodeAsync=async(r,o)=>ME(e,r,o),cd(e,"ZodType",{check(...r){let o=this.def;return this.clone(ue.mergeDefs(o,{checks:[...o.checks??[],...r.map((n)=>typeof n==="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),{parent:!0})},with(...r){return this.check(...r)},clone(r,o){return fr(this,r,o)},brand(){return this},register(r,o){return r.add(this,o),this},refine(r,o){return this.check(zk(r,o))},superRefine(r,o){return this.check(Nk(r,o))},overwrite(r){return this.check(pn(r))},optional(){return sd(this)},exactOptional(){return hk(this)},nullable(){return ad(this)},nullish(){return sd(ad(this))},nonoptional(r){return wk(this,r)},array(){return dd(this)},or(r){return Bh([this,r])},and(r){return ik(this,r)},transform(r){return bh(this,Zh(r))},default(r){return bk(this,r)},prefault(r){return vk(this,r)},catch(r){return Ek(this,r)},pipe(r){return bh(this,r)},readonly(){return Tk(this)},describe(r){let o=this.clone();return Vt.add(o,{description:r}),o},meta(...r){if(r.length===0)return Vt.get(this);let o=this.clone();return Vt.add(o,r[0]),o},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(r){return r(this)}}),Object.defineProperty(e,"description",{get(){return Vt.get(e)?.description},configurable:!0}),e)),Sh=Z("_ZodString",(e,t)=>{Zs.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(o,n,i)=>M_(e,o,n,i);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,cd(e,"_ZodString",{regex(...o){return this.check(ic(...o))},includes(...o){return this.check(cc(...o))},startsWith(...o){return this.check(lc(...o))},endsWith(...o){return this.check(uc(...o))},min(...o){return this.check(xo(...o))},max(...o){return this.check(Ms(...o))},length(...o){return this.check(qs(...o))},nonempty(...o){return this.check(xo(1,...o))},lowercase(o){return this.check(sc(o))},uppercase(o){return this.check(ac(o))},trim(){return this.check(pc())},normalize(...o){return this.check(fc(...o))},toLowerCase(){return this.check(mc())},toUpperCase(){return this.check(hc())},slugify(){return this.check(gc())}})}),xc=Z("ZodString",(e,t)=>{Zs.init(e,t),Sh.init(e,t),e.email=(r)=>e.check(Dm(vh,r)),e.url=(r)=>e.check(Yu(ld,r)),e.jwt=(r)=>e.check(th(Nh,r)),e.emoji=(r)=>e.check(Um(wh,r)),e.guid=(r)=>e.check(Qu(id,r)),e.uuid=(r)=>e.check(Lm(Jn,r)),e.uuidv4=(r)=>e.check(Bm(Jn,r)),e.uuidv6=(r)=>e.check(jm(Jn,r)),e.uuidv7=(r)=>e.check(Zm(Jn,r)),e.nanoid=(r)=>e.check(Mm(xh,r)),e.guid=(r)=>e.check(Qu(id,r)),e.cuid=(r)=>e.check(qm(_h,r)),e.cuid2=(r)=>e.check(Fm(Eh,r)),e.ulid=(r)=>e.check(Km(kh,r)),e.base64=(r)=>e.check(Ym(Ch,r)),e.base64url=(r)=>e.check(Xm(Ph,r)),e.xid=(r)=>e.check(Jm(Ih,r)),e.ksuid=(r)=>e.check(Hm(Ah,r)),e.ipv4=(r)=>e.check(Vm(Th,r)),e.ipv6=(r)=>e.check(Wm(Rh,r)),e.cidrv4=(r)=>e.check(Gm($h,r)),e.cidrv6=(r)=>e.check(Qm(Oh,r)),e.e164=(r)=>e.check(eh(zh,r)),e.datetime=(r)=>e.check(IE(r)),e.date=(r)=>e.check(AE(r)),e.time=(r)=>e.check(TE(r)),e.duration=(r)=>e.check(RE(r))});et=Z("ZodStringFormat",(e,t)=>{Xe.init(e,t),Sh.init(e,t)}),vh=Z("ZodEmail",(e,t)=>{Jw.init(e,t),et.init(e,t)});id=Z("ZodGUID",(e,t)=>{Fw.init(e,t),et.init(e,t)});Jn=Z("ZodUUID",(e,t)=>{Kw.init(e,t),et.init(e,t)});ld=Z("ZodURL",(e,t)=>{Hw.init(e,t),et.init(e,t)});wh=Z("ZodEmoji",(e,t)=>{Vw.init(e,t),et.init(e,t)});xh=Z("ZodNanoID",(e,t)=>{Ww.init(e,t),et.init(e,t)});_h=Z("ZodCUID",(e,t)=>{Gw.init(e,t),et.init(e,t)});Eh=Z("ZodCUID2",(e,t)=>{Qw.init(e,t),et.init(e,t)});kh=Z("ZodULID",(e,t)=>{Yw.init(e,t),et.init(e,t)});Ih=Z("ZodXID",(e,t)=>{Xw.init(e,t),et.init(e,t)});Ah=Z("ZodKSUID",(e,t)=>{ex.init(e,t),et.init(e,t)});Th=Z("ZodIPv4",(e,t)=>{ix.init(e,t),et.init(e,t)});FE=Z("ZodMAC",(e,t)=>{ax.init(e,t),et.init(e,t)});Rh=Z("ZodIPv6",(e,t)=>{sx.init(e,t),et.init(e,t)});$h=Z("ZodCIDRv4",(e,t)=>{cx.init(e,t),et.init(e,t)});Oh=Z("ZodCIDRv6",(e,t)=>{lx.init(e,t),et.init(e,t)});Ch=Z("ZodBase64",(e,t)=>{dx.init(e,t),et.init(e,t)});Ph=Z("ZodBase64URL",(e,t)=>{fx.init(e,t),et.init(e,t)});zh=Z("ZodE164",(e,t)=>{px.init(e,t),et.init(e,t)});Nh=Z("ZodJWT",(e,t)=>{mx.init(e,t),et.init(e,t)});_c=Z("ZodCustomStringFormat",(e,t)=>{hx.init(e,t),et.init(e,t)});Ec=Z("ZodNumber",(e,t)=>{$m.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(o,n,i)=>q_(e,o,n,i),cd(e,"ZodNumber",{gt(o,n){return this.check(Fn(o,n))},gte(o,n){return this.check(mr(o,n))},min(o,n){return this.check(mr(o,n))},lt(o,n){return this.check(qn(o,n))},lte(o,n){return this.check(Br(o,n))},max(o,n){return this.check(Br(o,n))},int(o){return this.check(yh(o))},safe(o){return this.check(yh(o))},positive(o){return this.check(Fn(0,o))},nonnegative(o){return this.check(mr(0,o))},negative(o){return this.check(qn(0,o))},nonpositive(o){return this.check(Br(0,o))},multipleOf(o,n){return this.check(_i(o,n))},step(o,n){return this.check(_i(o,n))},finite(){return this}});let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??0.5),e.isFinite=!0,e.format=r.format??null});Ks=Z("ZodNumberFormat",(e,t)=>{gx.init(e,t),Ec.init(e,t)});kc=Z("ZodBoolean",(e,t)=>{Mu.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>F_(e,r,o,n)});Ic=Z("ZodBigInt",(e,t)=>{Om.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(o,n,i)=>K_(e,o,n,i),e.gte=(o,n)=>e.check(mr(o,n)),e.min=(o,n)=>e.check(mr(o,n)),e.gt=(o,n)=>e.check(Fn(o,n)),e.gte=(o,n)=>e.check(mr(o,n)),e.min=(o,n)=>e.check(mr(o,n)),e.lt=(o,n)=>e.check(qn(o,n)),e.lte=(o,n)=>e.check(Br(o,n)),e.max=(o,n)=>e.check(Br(o,n)),e.positive=(o)=>e.check(Fn(BigInt(0),o)),e.negative=(o)=>e.check(qn(BigInt(0),o)),e.nonpositive=(o)=>e.check(Br(BigInt(0),o)),e.nonnegative=(o)=>e.check(mr(BigInt(0),o)),e.multipleOf=(o,n)=>e.check(_i(o,n));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});Dh=Z("ZodBigIntFormat",(e,t)=>{yx.init(e,t),Ic.init(e,t)});HE=Z("ZodSymbol",(e,t)=>{bx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>J_(e,r,o,n)});VE=Z("ZodUndefined",(e,t)=>{Sx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>V_(e,r,o,n)});WE=Z("ZodNull",(e,t)=>{vx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>H_(e,r,o,n)});QE=Z("ZodAny",(e,t)=>{wx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Q_(e,r,o,n)});YE=Z("ZodUnknown",(e,t)=>{xx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>Y_(e,r,o,n)});XE=Z("ZodNever",(e,t)=>{_x.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>G_(e,r,o,n)});ek=Z("ZodVoid",(e,t)=>{Ex.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>W_(e,r,o,n)});ud=Z("ZodDate",(e,t)=>{kx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(o,n,i)=>X_(e,o,n,i),e.min=(o,n)=>e.check(mr(o,n)),e.max=(o,n)=>e.check(Br(o,n));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});tk=Z("ZodArray",(e,t)=>{Ix.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>dE(e,r,o,n),e.element=t.element,cd(e,"ZodArray",{min(r,o){return this.check(xo(r,o))},nonempty(r){return this.check(xo(1,r))},max(r,o){return this.check(Ms(r,o))},length(r,o){return this.check(qs(r,o))},unwrap(){return this.element}})});fd=Z("ZodObject",(e,t)=>{Ax.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>fE(e,r,o,n),ue.defineLazy(e,"shape",()=>t.shape),cd(e,"ZodObject",{keyof(){return jh(Object.keys(this._zod.def.shape))},catchall(r){return this.clone({...this._zod.def,catchall:r})},passthrough(){return this.clone({...this._zod.def,catchall:Fs()})},loose(){return this.clone({...this._zod.def,catchall:Fs()})},strict(){return this.clone({...this._zod.def,catchall:Lh()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(r){return ue.extend(this,r)},safeExtend(r){return ue.safeExtend(this,r)},merge(r){return ue.merge(this,r)},pick(r){return ue.pick(this,r)},omit(r){return ue.omit(this,r)},partial(...r){return ue.partial(Uh,this,r[0])},required(...r){return ue.required(Mh,this,r[0])}})});pd=Z("ZodUnion",(e,t)=>{qu.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ch(e,r,o,n),e.options=t.options});rk=Z("ZodXor",(e,t)=>{pd.init(e,t),Tx.init(e,t),e._zod.processJSONSchema=(r,o,n)=>ch(e,r,o,n),e.options=t.options});nk=Z("ZodDiscriminatedUnion",(e,t)=>{pd.init(e,t),Rx.init(e,t)});ok=Z("ZodIntersection",(e,t)=>{$x.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>pE(e,r,o,n)});sk=Z("ZodTuple",(e,t)=>{Cm.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>mE(e,r,o,n),e.rest=(r)=>e.clone({...e._zod.def,rest:r})});vc=Z("ZodRecord",(e,t)=>{Ox.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>hE(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType});lk=Z("ZodMap",(e,t)=>{Cx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lE(e,r,o,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...r)=>e.check(Kn(...r)),e.nonempty=(r)=>e.check(Kn(1,r)),e.max=(...r)=>e.check(Ei(...r)),e.size=(...r)=>e.check(Us(...r))});uk=Z("ZodSet",(e,t)=>{Px.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>uE(e,r,o,n),e.min=(...r)=>e.check(Kn(...r)),e.nonempty=(r)=>e.check(Kn(1,r)),e.max=(...r)=>e.check(Ei(...r)),e.size=(...r)=>e.check(Us(...r))});wc=Z("ZodEnum",(e,t)=>{zx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(o,n,i)=>eE(e,o,n,i),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(o,n)=>{let i={};for(let s of o)if(r.has(s))i[s]=t.entries[s];else throw Error(`Key ${s} not found in enum`);return new wc({...t,checks:[],...ue.normalizeParams(n),entries:i})},e.exclude=(o,n)=>{let i={...t.entries};for(let s of o)if(r.has(s))delete i[s];else throw Error(`Key ${s} not found in enum`);return new wc({...t,checks:[],...ue.normalizeParams(n),entries:i})}});dk=Z("ZodLiteral",(e,t)=>{Nx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>tE(e,r,o,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});fk=Z("ZodFile",(e,t)=>{Dx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>oE(e,r,o,n),e.min=(r,o)=>e.check(Kn(r,o)),e.max=(r,o)=>e.check(Ei(r,o)),e.mime=(r,o)=>e.check(dc(Array.isArray(r)?r:[r],o))});pk=Z("ZodTransform",(e,t)=>{Lx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>cE(e,r,o,n),e._zod.parse=(r,o)=>{if(o.direction==="backward")throw new Ds(e.constructor.name);r.addIssue=(i)=>{if(typeof i==="string")r.issues.push(ue.issue(i,r.value,t));else{let s=i;if(s.fatal)s.continue=!1;s.code??(s.code="custom"),s.input??(s.input=r.value),s.inst??(s.inst=e),r.issues.push(ue.issue(s))}};let n=t.transform(r.value,r);if(n instanceof Promise)return n.then((i)=>(r.value=i,r.fallback=!0,r));return r.value=n,r.fallback=!0,r}});Uh=Z("ZodOptional",(e,t)=>{Pm.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});mk=Z("ZodExactOptional",(e,t)=>{Bx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>lh(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});gk=Z("ZodNullable",(e,t)=>{jx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>gE(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});yk=Z("ZodDefault",(e,t)=>{Zx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>bE(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});Sk=Z("ZodPrefault",(e,t)=>{Ux.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>SE(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Mh=Z("ZodNonOptional",(e,t)=>{Mx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>yE(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});xk=Z("ZodSuccess",(e,t)=>{qx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>iE(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});_k=Z("ZodCatch",(e,t)=>{Fx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>vE(e,r,o,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});kk=Z("ZodNaN",(e,t)=>{Kx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>rE(e,r,o,n)});md=Z("ZodPipe",(e,t)=>{zm.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>wE(e,r,o,n),e.in=t.in,e.out=t.out});hd=Z("ZodCodec",(e,t)=>{md.init(e,t),Fu.init(e,t)});Ik=Z("ZodPreprocess",(e,t)=>{md.init(e,t),Jx.init(e,t)}),Ak=Z("ZodReadonly",(e,t)=>{Hx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>xE(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Rk=Z("ZodTemplateLiteral",(e,t)=>{Vx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>nE(e,r,o,n)});$k=Z("ZodLazy",(e,t)=>{Qx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>EE(e,r,o,n),e.unwrap=()=>e._zod.def.getter()});Ck=Z("ZodPromise",(e,t)=>{Gx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>_E(e,r,o,n),e.unwrap=()=>e._zod.def.innerType});Pk=Z("ZodFunction",(e,t)=>{Wx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>aE(e,r,o,n)});gd=Z("ZodCustom",(e,t)=>{Yx.init(e,t),Be.init(e,t),e._zod.processJSONSchema=(r,o,n)=>sE(e,r,o,n)});U2=B_,M2=j_});function tW(e){gt({customError:e})}function rW(){return gt().customError}var eW,Dk;var H2=v(()=>{jr();eW={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};(function(e){})(Dk||(Dk={}))});function oW(e,t){let r=e.$schema;if(r==="https://json-schema.org/draft/2020-12/schema")return"draft-2020-12";if(r==="http://json-schema.org/draft-07/schema#")return"draft-7";if(r==="http://json-schema.org/draft-04/schema#")return"draft-4";return t??"draft-2020-12"}function iW(e,t){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");let r=e.slice(1).split("/").filter(Boolean);if(r.length===0)return t.rootSchema;let o=t.version==="draft-2020-12"?"$defs":"definitions";if(r[0]===o){let n=r[1];if(!n||!t.defs[n])throw Error(`Reference not found: ${e}`);return t.defs[n]}throw Error(`Reference not found: ${e}`)}function V2(e,t){if(e.not!==void 0){if(typeof e.not==="object"&&Object.keys(e.not).length===0)return Se.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let n=e.$ref;if(t.refs.has(n))return t.refs.get(n);if(t.processing.has(n))return Se.lazy(()=>{if(!t.refs.has(n))throw Error(`Circular reference not resolved: ${n}`);return t.refs.get(n)});t.processing.add(n);let i=iW(n,t),s=rr(i,t);return t.refs.set(n,s),t.processing.delete(n),s}if(e.enum!==void 0){let n=e.enum;if(t.version==="openapi-3.0"&&e.nullable===!0&&n.length===1&&n[0]===null)return Se.null();if(n.length===0)return Se.never();if(n.length===1)return Se.literal(n[0]);if(n.every((s)=>typeof s==="string"))return Se.enum(n);let i=n.map((s)=>Se.literal(s));if(i.length<2)return i[0];return Se.union([i[0],i[1],...i.slice(2)])}if(e.const!==void 0)return Se.literal(e.const);let r=e.type;if(Array.isArray(r)){let n=r.map((i)=>{let s={...e,type:i};return V2(s,t)});if(n.length===0)return Se.never();if(n.length===1)return n[0];return Se.union(n)}if(!r)return Se.any();let o;switch(r){case"string":{let n=Se.string();if(e.format){let i=e.format;if(i==="email")n=n.check(Se.email());else if(i==="uri"||i==="uri-reference")n=n.check(Se.url());else if(i==="uuid"||i==="guid")n=n.check(Se.uuid());else if(i==="date-time")n=n.check(Se.iso.datetime());else if(i==="date")n=n.check(Se.iso.date());else if(i==="time")n=n.check(Se.iso.time());else if(i==="duration")n=n.check(Se.iso.duration());else if(i==="ipv4")n=n.check(Se.ipv4());else if(i==="ipv6")n=n.check(Se.ipv6());else if(i==="mac")n=n.check(Se.mac());else if(i==="cidr")n=n.check(Se.cidrv4());else if(i==="cidr-v6")n=n.check(Se.cidrv6());else if(i==="base64")n=n.check(Se.base64());else if(i==="base64url")n=n.check(Se.base64url());else if(i==="e164")n=n.check(Se.e164());else if(i==="jwt")n=n.check(Se.jwt());else if(i==="emoji")n=n.check(Se.emoji());else if(i==="nanoid")n=n.check(Se.nanoid());else if(i==="cuid")n=n.check(Se.cuid());else if(i==="cuid2")n=n.check(Se.cuid2());else if(i==="ulid")n=n.check(Se.ulid());else if(i==="xid")n=n.check(Se.xid());else if(i==="ksuid")n=n.check(Se.ksuid())}if(typeof e.minLength==="number")n=n.min(e.minLength);if(typeof e.maxLength==="number")n=n.max(e.maxLength);if(e.pattern)n=n.regex(new RegExp(e.pattern));o=n;break}case"number":case"integer":{let n=r==="integer"?Se.number().int():Se.number();if(typeof e.minimum==="number")n=n.min(e.minimum);if(typeof e.maximum==="number")n=n.max(e.maximum);if(typeof e.exclusiveMinimum==="number")n=n.gt(e.exclusiveMinimum);else if(e.exclusiveMinimum===!0&&typeof e.minimum==="number")n=n.gt(e.minimum);if(typeof e.exclusiveMaximum==="number")n=n.lt(e.exclusiveMaximum);else if(e.exclusiveMaximum===!0&&typeof e.maximum==="number")n=n.lt(e.maximum);if(typeof e.multipleOf==="number")n=n.multipleOf(e.multipleOf);o=n;break}case"boolean":{o=Se.boolean();break}case"null":{o=Se.null();break}case"object":{let n={},i=e.properties||{},s=new Set(e.required||[]);for(let[c,u]of Object.entries(i)){let d=rr(u,t);n[c]=s.has(c)?d:d.optional()}if(e.propertyNames){let c=rr(e.propertyNames,t),u=e.additionalProperties&&typeof e.additionalProperties==="object"?rr(e.additionalProperties,t):Se.any();if(Object.keys(n).length===0){o=Se.record(c,u);break}let d=Se.object(n).passthrough(),f=Se.looseRecord(c,u);o=Se.intersection(d,f);break}if(e.patternProperties){let c=e.patternProperties,u=Object.keys(c),d=[];for(let m of u){let h=rr(c[m],t),b=Se.string().regex(new RegExp(m));d.push(Se.looseRecord(b,h))}let f=[];if(Object.keys(n).length>0)f.push(Se.object(n).passthrough());if(f.push(...d),f.length===0)o=Se.object({}).passthrough();else if(f.length===1)o=f[0];else{let m=Se.intersection(f[0],f[1]);for(let h=2;h<f.length;h++)m=Se.intersection(m,f[h]);o=m}break}let a=Se.object(n);if(e.additionalProperties===!1)o=a.strict();else if(typeof e.additionalProperties==="object")o=a.catchall(rr(e.additionalProperties,t));else o=a.passthrough();break}case"array":{let{prefixItems:n,items:i}=e;if(n&&Array.isArray(n)){let s=n.map((c)=>rr(c,t)),a=i&&typeof i==="object"&&!Array.isArray(i)?rr(i,t):void 0;if(a)o=Se.tuple(s).rest(a);else o=Se.tuple(s);if(typeof e.minItems==="number")o=o.check(Se.minLength(e.minItems));if(typeof e.maxItems==="number")o=o.check(Se.maxLength(e.maxItems))}else if(Array.isArray(i)){let s=i.map((c)=>rr(c,t)),a=e.additionalItems&&typeof e.additionalItems==="object"?rr(e.additionalItems,t):void 0;if(a)o=Se.tuple(s).rest(a);else o=Se.tuple(s);if(typeof e.minItems==="number")o=o.check(Se.minLength(e.minItems));if(typeof e.maxItems==="number")o=o.check(Se.maxLength(e.maxItems))}else if(i!==void 0){let s=rr(i,t),a=Se.array(s);if(typeof e.minItems==="number")a=a.min(e.minItems);if(typeof e.maxItems==="number")a=a.max(e.maxItems);o=a}else o=Se.array(Se.any());break}default:throw Error(`Unsupported type: ${r}`)}return o}function rr(e,t){if(typeof e==="boolean")return e?Se.any():Se.never();let r=V2(e,t),o=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){let a=e.anyOf.map((u)=>rr(u,t)),c=Se.union(a);r=o?Se.intersection(r,c):c}if(e.oneOf&&Array.isArray(e.oneOf)){let a=e.oneOf.map((u)=>rr(u,t)),c=Se.xor(a);r=o?Se.intersection(r,c):c}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)r=o?r:Se.any();else{let a=o?r:rr(e.allOf[0],t),c=o?0:1;for(let u=c;u<e.allOf.length;u++)a=Se.intersection(a,rr(e.allOf[u],t));r=a}if(e.nullable===!0&&t.version==="openapi-3.0")r=Se.nullable(r);if(e.readOnly===!0)r=Se.readonly(r);if(e.default!==void 0)r=r.default(e.default);let n={},i=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(let a of i)if(a in e)n[a]=e[a];let s=["contentEncoding","contentMediaType","contentSchema"];for(let a of s)if(a in e)n[a]=e[a];for(let a of Object.keys(e))if(!nW.has(a))n[a]=e[a];if(Object.keys(n).length>0)t.registry.add(r,n);if(e.description)r=r.describe(e.description);return r}function W2(e,t){if(typeof e==="boolean")return e?Se.any():Se.never();let r;try{r=JSON.parse(JSON.stringify(e))}catch{throw Error("fromJSONSchema input is not valid JSON (possibly cyclic); use $defs/$ref for recursive schemas")}let o=oW(r,t?.defaultTarget),n=r.$defs||r.definitions||{},i={version:o,defs:n,refs:new Map,processing:new Set,rootSchema:r,registry:t?.registry??Vt};return rr(r,i)}var Se,nW;var G2=v(()=>{Gu();fh();td();nd();Se={...rd,...dh,iso:Sc},nW=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"])});var Lk={};Lt(Lk,{bigint:()=>lW,boolean:()=>cW,date:()=>uW,number:()=>aW,string:()=>sW});function sW(e){return n_(xc,e)}function aW(e){return d_(Ec,e)}function cW(e){return b_(kc,e)}function lW(e){return v_(Ic,e)}function uW(e){return O_(ud,e)}var Q2=v(()=>{jr();nd()});var l={};Lt(l,{$brand:()=>Ov,$input:()=>e_,$output:()=>X0,NEVER:()=>$v,TimePrecision:()=>i_,ZodAny:()=>QE,ZodArray:()=>tk,ZodBase64:()=>Ch,ZodBase64URL:()=>Ph,ZodBigInt:()=>Ic,ZodBigIntFormat:()=>Dh,ZodBoolean:()=>kc,ZodCIDRv4:()=>$h,ZodCIDRv6:()=>Oh,ZodCUID:()=>_h,ZodCUID2:()=>Eh,ZodCatch:()=>_k,ZodCodec:()=>hd,ZodCustom:()=>gd,ZodCustomStringFormat:()=>_c,ZodDate:()=>ud,ZodDefault:()=>yk,ZodDiscriminatedUnion:()=>nk,ZodE164:()=>zh,ZodEmail:()=>vh,ZodEmoji:()=>wh,ZodEnum:()=>wc,ZodError:()=>$N,ZodExactOptional:()=>mk,ZodFile:()=>fk,ZodFirstPartyTypeKind:()=>Dk,ZodFunction:()=>Pk,ZodGUID:()=>id,ZodIPv4:()=>Th,ZodIPv6:()=>Rh,ZodISODate:()=>mh,ZodISODateTime:()=>ph,ZodISODuration:()=>gh,ZodISOTime:()=>hh,ZodIntersection:()=>ok,ZodIssueCode:()=>eW,ZodJWT:()=>Nh,ZodKSUID:()=>Ah,ZodLazy:()=>$k,ZodLiteral:()=>dk,ZodMAC:()=>FE,ZodMap:()=>lk,ZodNaN:()=>kk,ZodNanoID:()=>xh,ZodNever:()=>XE,ZodNonOptional:()=>Mh,ZodNull:()=>WE,ZodNullable:()=>gk,ZodNumber:()=>Ec,ZodNumberFormat:()=>Ks,ZodObject:()=>fd,ZodOptional:()=>Uh,ZodPipe:()=>md,ZodPrefault:()=>Sk,ZodPreprocess:()=>Ik,ZodPromise:()=>Ck,ZodReadonly:()=>Ak,ZodRealError:()=>kr,ZodRecord:()=>vc,ZodSet:()=>uk,ZodString:()=>xc,ZodStringFormat:()=>et,ZodSuccess:()=>xk,ZodSymbol:()=>HE,ZodTemplateLiteral:()=>Rk,ZodTransform:()=>pk,ZodTuple:()=>sk,ZodType:()=>Be,ZodULID:()=>kh,ZodURL:()=>ld,ZodUUID:()=>Jn,ZodUndefined:()=>VE,ZodUnion:()=>pd,ZodUnknown:()=>YE,ZodVoid:()=>ek,ZodXID:()=>Ih,ZodXor:()=>rk,_ZodString:()=>Sh,_default:()=>bk,_function:()=>B2,any:()=>h2,array:()=>dd,base64:()=>YN,base64url:()=>XN,bigint:()=>u2,boolean:()=>JE,catch:()=>Ek,check:()=>j2,cidrv4:()=>GN,cidrv6:()=>QN,clone:()=>fr,codec:()=>z2,coerce:()=>Lk,config:()=>gt,core:()=>_o,cuid:()=>MN,cuid2:()=>qN,custom:()=>Z2,date:()=>y2,decode:()=>DE,decodeAsync:()=>BE,describe:()=>U2,discriminatedUnion:()=>_2,e164:()=>e2,email:()=>CN,emoji:()=>ZN,encode:()=>NE,encodeAsync:()=>LE,endsWith:()=>uc,enum:()=>jh,exactOptional:()=>hk,file:()=>$2,flattenError:()=>Lu,float32:()=>s2,float64:()=>a2,formatError:()=>Bu,fromJSONSchema:()=>W2,function:()=>B2,getErrorMap:()=>rW,globalRegistry:()=>Vt,gt:()=>Fn,gte:()=>mr,guid:()=>PN,hash:()=>i2,hex:()=>o2,hostname:()=>n2,httpUrl:()=>jN,includes:()=>cc,instanceof:()=>q2,int:()=>yh,int32:()=>c2,int64:()=>d2,intersection:()=>ik,invertCodec:()=>N2,ipv4:()=>HN,ipv6:()=>WN,iso:()=>Sc,json:()=>K2,jwt:()=>t2,keyof:()=>b2,ksuid:()=>JN,lazy:()=>Ok,length:()=>qs,literal:()=>R2,locales:()=>Wu,looseObject:()=>w2,looseRecord:()=>k2,lowercase:()=>sc,lt:()=>qn,lte:()=>Br,mac:()=>VN,map:()=>I2,maxLength:()=>Ms,maxSize:()=>Ei,meta:()=>M2,mime:()=>dc,minLength:()=>xo,minSize:()=>Kn,multipleOf:()=>_i,nan:()=>P2,nanoid:()=>UN,nativeEnum:()=>T2,negative:()=>nh,never:()=>Lh,nonnegative:()=>ih,nonoptional:()=>wk,nonpositive:()=>oh,normalize:()=>fc,null:()=>GE,nullable:()=>ad,nullish:()=>O2,number:()=>KE,object:()=>S2,optional:()=>sd,overwrite:()=>pn,parse:()=>OE,parseAsync:()=>CE,partialRecord:()=>E2,pipe:()=>bh,positive:()=>rh,prefault:()=>vk,preprocess:()=>J2,prettifyError:()=>qv,promise:()=>L2,property:()=>sh,readonly:()=>Tk,record:()=>ck,refine:()=>zk,regex:()=>ic,regexes:()=>Lr,registry:()=>Nm,safeDecode:()=>ZE,safeDecodeAsync:()=>ME,safeEncode:()=>jE,safeEncodeAsync:()=>UE,safeParse:()=>PE,safeParseAsync:()=>zE,set:()=>A2,setErrorMap:()=>tW,size:()=>Us,slugify:()=>gc,startsWith:()=>lc,strictObject:()=>v2,string:()=>od,stringFormat:()=>r2,stringbool:()=>F2,success:()=>C2,superRefine:()=>Nk,symbol:()=>p2,templateLiteral:()=>D2,toJSONSchema:()=>uh,toLowerCase:()=>mc,toUpperCase:()=>hc,transform:()=>Zh,treeifyError:()=>Mv,trim:()=>pc,tuple:()=>ak,uint32:()=>l2,uint64:()=>f2,ulid:()=>FN,undefined:()=>m2,union:()=>Bh,unknown:()=>Fs,uppercase:()=>ac,url:()=>BN,util:()=>ue,uuid:()=>zN,uuidv4:()=>NN,uuidv6:()=>DN,uuidv7:()=>LN,void:()=>g2,xid:()=>KN,xor:()=>x2});var Bk=v(()=>{jr();jr();l0();jr();ed();G2();Y0();td();td();Q2();nd();fh();$E();qE();H2();gt(Ku())});var Y2=v(()=>{Bk();Bk()});var jk=v(()=>{Y2()});var pe=v(()=>{jk()});function Tc(e){return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0))}function qh(e){if(Array.isArray(e))return e.map(qh);if(!e||typeof e!=="object")return e;if(e instanceof Uint8Array)return e;return Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0).map(([t,r])=>[t,qh(r)]))}var Js={};Lt(Js,{CORE_SCHEMA:()=>FW,DEFAULT_SCHEMA:()=>lI,FAILSAFE_SCHEMA:()=>MW,JSON_SCHEMA:()=>qW,Schema:()=>UW,Type:()=>Rc,YAMLException:()=>JW,default:()=>YD,dump:()=>vd,load:()=>$c,loadAll:()=>KW,safeDump:()=>GW,safeLoad:()=>VW,safeLoadAll:()=>WW,types:()=>HW});function NW(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function bd(){if(uD)return Ti;uD=1;function e(s){return typeof s>"u"||s===null}function t(s){return typeof s==="object"&&s!==null}function r(s){if(Array.isArray(s))return s;else if(e(s))return[];return[s]}function o(s,a){if(a){let c=Object.keys(a);for(let u=0,d=c.length;u<d;u+=1){let f=c[u];s[f]=a[f]}}return s}function n(s,a){let c="";for(let u=0;u<a;u+=1)c+=s;return c}function i(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return Ti.isNothing=e,Ti.isObject=t,Ti.toArray=r,Ti.repeat=n,Ti.isNegativeZero=i,Ti.extend=o,Ti}function Sd(){if(dD)return Zk;dD=1;function e(r,o){let n="",i=r.reason||"(unknown reason)";if(!r.mark)return i;if(r.mark.name)n+='in "'+r.mark.name+'" ';if(n+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!o&&r.mark.snippet)n+=`
|
|
220
|
+
|
|
221
|
+
`+r.mark.snippet;return i+" "+n}function t(r,o){if(Error.call(this),this.name="YAMLException",this.reason=r,this.mark=o,this.message=e(this,!1),Error.captureStackTrace)Error.captureStackTrace(this,this.constructor);else this.stack=Error().stack||""}return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=function(o){return this.name+": "+e(this,o)},Zk=t,Zk}function DW(){if(fD)return Uk;fD=1;let e=bd();function t(n,i,s,a,c){let u="",d="",f=Math.floor(c/2)-1;if(a-i>f)u=" ... ",i=a-f+u.length;if(s-a>f)d=" ...",s=a+f-d.length;return{str:u+n.slice(i,s).replace(/\t/g,"\u2192")+d,pos:a-i+u.length}}function r(n,i){return e.repeat(" ",i-n.length)+n}function o(n,i){if(i=Object.create(i||null),!n.buffer)return null;if(!i.maxLength)i.maxLength=79;if(typeof i.indent!=="number")i.indent=1;if(typeof i.linesBefore!=="number")i.linesBefore=3;if(typeof i.linesAfter!=="number")i.linesAfter=2;let s=/\r?\n|\r|\0/g,a=[0],c=[],u,d=-1;while(u=s.exec(n.buffer))if(c.push(u.index),a.push(u.index+u[0].length),n.position<=u.index&&d<0)d=a.length-2;if(d<0)d=a.length-1;let f="",m=Math.min(n.line+i.linesAfter,c.length).toString().length,h=i.maxLength-(i.indent+m+3);for(let y=1;y<=i.linesBefore;y++){if(d-y<0)break;let S=t(n.buffer,a[d-y],c[d-y],n.position-(a[d]-a[d-y]),h);f=e.repeat(" ",i.indent)+r((n.line-y+1).toString(),m)+" | "+S.str+`
|
|
222
|
+
`+f}let b=t(n.buffer,a[d],c[d],n.position,h);f+=e.repeat(" ",i.indent)+r((n.line+1).toString(),m)+" | "+b.str+`
|
|
223
|
+
`,f+=e.repeat("-",i.indent+m+3+b.pos)+`^
|
|
224
|
+
`;for(let y=1;y<=i.linesAfter;y++){if(d+y>=c.length)break;let S=t(n.buffer,a[d+y],c[d+y],n.position-(a[d]-a[d+y]),h);f+=e.repeat(" ",i.indent)+r((n.line+y+1).toString(),m)+" | "+S.str+`
|
|
225
|
+
`}return f.replace(/\n$/,"")}return Uk=o,Uk}function gr(){if(pD)return Mk;pD=1;let e=Sd(),t=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],r=["scalar","sequence","mapping"];function o(i){let s={};if(i!==null)Object.keys(i).forEach(function(a){i[a].forEach(function(c){s[String(c)]=a})});return s}function n(i,s){if(s=s||{},Object.keys(s).forEach(function(a){if(t.indexOf(a)===-1)throw new e('Unknown option "'+a+'" is met in definition of "'+i+'" YAML type.')}),this.options=s,this.tag=i,this.kind=s.kind||null,this.resolve=s.resolve||function(){return!0},this.construct=s.construct||function(a){return a},this.instanceOf=s.instanceOf||null,this.predicate=s.predicate||null,this.represent=s.represent||null,this.representName=s.representName||null,this.defaultStyle=s.defaultStyle||null,this.multi=s.multi||!1,this.styleAliases=o(s.styleAliases||null),r.indexOf(this.kind)===-1)throw new e('Unknown kind "'+this.kind+'" is specified for "'+i+'" YAML type.')}return Mk=n,Mk}function ND(){if(mD)return qk;mD=1;let e=Sd(),t=gr();function r(i,s){let a=[];return i[s].forEach(function(c){let u=a.length;a.forEach(function(d,f){if(d.tag===c.tag&&d.kind===c.kind&&d.multi===c.multi)u=f}),a[u]=c}),a}function o(){let i={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}};function s(a){if(a.multi)i.multi[a.kind].push(a),i.multi.fallback.push(a);else i[a.kind][a.tag]=i.fallback[a.tag]=a}for(let a=0,c=arguments.length;a<c;a+=1)arguments[a].forEach(s);return i}function n(i){return this.extend(i)}return n.prototype.extend=function(s){let a=[],c=[];if(s instanceof t)c.push(s);else if(Array.isArray(s))c=c.concat(s);else if(s&&(Array.isArray(s.implicit)||Array.isArray(s.explicit))){if(s.implicit)a=a.concat(s.implicit);if(s.explicit)c=c.concat(s.explicit)}else throw new e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");a.forEach(function(d){if(!(d instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(d.loadKind&&d.loadKind!=="scalar")throw new e("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(d.multi)throw new e("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),c.forEach(function(d){if(!(d instanceof t))throw new e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});let u=Object.create(n.prototype);return u.implicit=(this.implicit||[]).concat(a),u.explicit=(this.explicit||[]).concat(c),u.compiledImplicit=r(u,"implicit"),u.compiledExplicit=r(u,"explicit"),u.compiledTypeMap=o(u.compiledImplicit,u.compiledExplicit),u},qk=n,qk}function DD(){if(hD)return Fk;return hD=1,Fk=new(gr())("tag:yaml.org,2002:str",{kind:"scalar",construct:function(t){return t!==null?t:""}}),Fk}function LD(){if(gD)return Kk;return gD=1,Kk=new(gr())("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(t){return t!==null?t:[]}}),Kk}function BD(){if(yD)return Jk;return yD=1,Jk=new(gr())("tag:yaml.org,2002:map",{kind:"mapping",construct:function(t){return t!==null?t:{}}}),Jk}function jD(){if(bD)return Hk;return bD=1,Hk=new(ND())({explicit:[DD(),LD(),BD()]}),Hk}function ZD(){if(SD)return Vk;SD=1;let e=gr();function t(n){if(n===null)return!0;let i=n.length;return i===1&&n==="~"||i===4&&(n==="null"||n==="Null"||n==="NULL")}function r(){return null}function o(n){return n===null}return Vk=new e("tag:yaml.org,2002:null",{kind:"scalar",resolve:t,construct:r,predicate:o,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"}),Vk}function UD(){if(vD)return Wk;vD=1;let e=gr();function t(n){if(n===null)return!1;let i=n.length;return i===4&&(n==="true"||n==="True"||n==="TRUE")||i===5&&(n==="false"||n==="False"||n==="FALSE")}function r(n){return n==="true"||n==="True"||n==="TRUE"}function o(n){return Object.prototype.toString.call(n)==="[object Boolean]"}return Wk=new e("tag:yaml.org,2002:bool",{kind:"scalar",resolve:t,construct:r,predicate:o,represent:{lowercase:function(n){return n?"true":"false"},uppercase:function(n){return n?"TRUE":"FALSE"},camelcase:function(n){return n?"True":"False"}},defaultStyle:"lowercase"}),Wk}function MD(){if(wD)return Gk;wD=1;let e=bd(),t=gr();function r(u){return u>=48&&u<=57||u>=65&&u<=70||u>=97&&u<=102}function o(u){return u>=48&&u<=55}function n(u){return u>=48&&u<=57}function i(u){if(u===null)return!1;let d=u.length,f=0,m=!1;if(!d)return!1;let h=u[f];if(h==="-"||h==="+")h=u[++f];if(h==="0"){if(f+1===d)return!0;if(h=u[++f],h==="b"){f++;for(;f<d;f++){if(h=u[f],h!=="0"&&h!=="1")return!1;m=!0}return m&&isFinite(s(u))}if(h==="x"){f++;for(;f<d;f++){if(!r(u.charCodeAt(f)))return!1;m=!0}return m&&isFinite(s(u))}if(h==="o"){f++;for(;f<d;f++){if(!o(u.charCodeAt(f)))return!1;m=!0}return m&&isFinite(s(u))}}for(;f<d;f++){if(!n(u.charCodeAt(f)))return!1;m=!0}if(!m)return!1;return isFinite(s(u))}function s(u){let d=u,f=1,m=d[0];if(m==="-"||m==="+"){if(m==="-")f=-1;d=d.slice(1),m=d[0]}if(d==="0")return 0;if(m==="0"){if(d[1]==="b")return f*parseInt(d.slice(2),2);if(d[1]==="x")return f*parseInt(d.slice(2),16);if(d[1]==="o")return f*parseInt(d.slice(2),8)}return f*parseInt(d,10)}function a(u){return s(u)}function c(u){return Object.prototype.toString.call(u)==="[object Number]"&&(u%1===0&&!e.isNegativeZero(u))}return Gk=new t("tag:yaml.org,2002:int",{kind:"scalar",resolve:i,construct:a,predicate:c,represent:{binary:function(u){return u>=0?"0b"+u.toString(2):"-0b"+u.toString(2).slice(1)},octal:function(u){return u>=0?"0o"+u.toString(8):"-0o"+u.toString(8).slice(1)},decimal:function(u){return u.toString(10)},hexadecimal:function(u){return u>=0?"0x"+u.toString(16).toUpperCase():"-0x"+u.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Gk}function qD(){if(xD)return Qk;xD=1;let e=bd(),t=gr(),r=new RegExp("^(?:[-+]?(?:[0-9]+)(?:\\.[0-9]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$"),o=new RegExp("^(?:[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function n(u){if(u===null)return!1;if(!r.test(u))return!1;if(isFinite(parseFloat(u,10)))return!0;return o.test(u)}function i(u){let d=u.toLowerCase(),f=d[0]==="-"?-1:1;if("+-".indexOf(d[0])>=0)d=d.slice(1);if(d===".inf")return f===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY;else if(d===".nan")return NaN;return f*parseFloat(d,10)}let s=/^[-+]?[0-9]+e/;function a(u,d){if(isNaN(u))switch(d){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===u)switch(d){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===u)switch(d){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(e.isNegativeZero(u))return"-0.0";let f=u.toString(10);return s.test(f)?f.replace("e",".e"):f}function c(u){return Object.prototype.toString.call(u)==="[object Number]"&&(u%1!==0||e.isNegativeZero(u))}return Qk=new t("tag:yaml.org,2002:float",{kind:"scalar",resolve:n,construct:i,predicate:c,represent:a,defaultStyle:"lowercase"}),Qk}function FD(){if(_D)return Yk;return _D=1,Yk=jD().extend({implicit:[ZD(),UD(),MD(),qD()]}),Yk}function KD(){if(ED)return Xk;return ED=1,Xk=FD(),Xk}function JD(){if(kD)return eI;kD=1;let e=gr(),t=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),r=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function o(s){if(s===null)return!1;if(t.exec(s)!==null)return!0;if(r.exec(s)!==null)return!0;return!1}function n(s){let a=0,c=null,u=t.exec(s);if(u===null)u=r.exec(s);if(u===null)throw Error("Date resolve error");let d=+u[1],f=+u[2]-1,m=+u[3];if(!u[4])return new Date(Date.UTC(d,f,m));let h=+u[4],b=+u[5],y=+u[6];if(u[7]){a=u[7].slice(0,3);while(a.length<3)a+="0";a=+a}if(u[9]){let x=+u[10],_=+(u[11]||0);if(c=(x*60+_)*60000,u[9]==="-")c=-c}let S=new Date(Date.UTC(d,f,m,h,b,y,a));if(c)S.setTime(S.getTime()-c);return S}function i(s){return s.toISOString()}return eI=new e("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:o,construct:n,instanceOf:Date,represent:i}),eI}function HD(){if(ID)return tI;ID=1;let e=gr();function t(r){return r==="<<"||r===null}return tI=new e("tag:yaml.org,2002:merge",{kind:"scalar",resolve:t}),tI}function VD(){if(AD)return rI;AD=1;let e=gr(),t=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
|
|
226
|
+
\r`;function r(s){if(s===null)return!1;let a=0,c=s.length,u=t;for(let d=0;d<c;d++){let f=u.indexOf(s.charAt(d));if(f>64)continue;if(f<0)return!1;a+=6}return a%8===0}function o(s){let a=s.replace(/[\r\n=]/g,""),c=a.length,u=t,d=0,f=[];for(let h=0;h<c;h++){if(h%4===0&&h)f.push(d>>16&255),f.push(d>>8&255),f.push(d&255);d=d<<6|u.indexOf(a.charAt(h))}let m=c%4*6;if(m===0)f.push(d>>16&255),f.push(d>>8&255),f.push(d&255);else if(m===18)f.push(d>>10&255),f.push(d>>2&255);else if(m===12)f.push(d>>4&255);return new Uint8Array(f)}function n(s){let a="",c=0,u=s.length,d=t;for(let m=0;m<u;m++){if(m%3===0&&m)a+=d[c>>18&63],a+=d[c>>12&63],a+=d[c>>6&63],a+=d[c&63];c=(c<<8)+s[m]}let f=u%3;if(f===0)a+=d[c>>18&63],a+=d[c>>12&63],a+=d[c>>6&63],a+=d[c&63];else if(f===2)a+=d[c>>10&63],a+=d[c>>4&63],a+=d[c<<2&63],a+=d[64];else if(f===1)a+=d[c>>2&63],a+=d[c<<4&63],a+=d[64],a+=d[64];return a}function i(s){return Object.prototype.toString.call(s)==="[object Uint8Array]"}return rI=new e("tag:yaml.org,2002:binary",{kind:"scalar",resolve:r,construct:o,predicate:i,represent:n}),rI}function WD(){if(TD)return nI;TD=1;let e=gr(),t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;function o(i){if(i===null)return!0;let s={},a=i;for(let c=0,u=a.length;c<u;c+=1){let d=a[c],f=!1;if(r.call(d)!=="[object Object]")return!1;let m;for(m in d)if(t.call(d,m))if(!f)f=!0;else return!1;if(!f)return!1;if(t.call(s,m))return!1;Object.defineProperty(s,m,{value:!0})}return!0}function n(i){return i!==null?i:[]}return nI=new e("tag:yaml.org,2002:omap",{kind:"sequence",resolve:o,construct:n}),nI}function GD(){if(RD)return oI;RD=1;let e=gr(),t=Object.prototype.toString;function r(n){if(n===null)return!0;let i=n,s=Array(i.length);for(let a=0,c=i.length;a<c;a+=1){let u=i[a];if(t.call(u)!=="[object Object]")return!1;let d=Object.keys(u);if(d.length!==1)return!1;s[a]=[d[0],u[d[0]]]}return!0}function o(n){if(n===null)return[];let i=n,s=Array(i.length);for(let a=0,c=i.length;a<c;a+=1){let u=i[a],d=Object.keys(u);s[a]=[d[0],u[d[0]]]}return s}return oI=new e("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:r,construct:o}),oI}function QD(){if($D)return iI;$D=1;let e=gr(),t=Object.prototype.hasOwnProperty;function r(n){if(n===null)return!0;let i=n;for(let s in i)if(t.call(i,s)){if(i[s]!==null)return!1}return!0}function o(n){return n!==null?n:{}}return iI=new e("tag:yaml.org,2002:set",{kind:"mapping",resolve:r,construct:o}),iI}function cI(){if(OD)return sI;return OD=1,sI=KD().extend({implicit:[JD(),HD()],explicit:[VD(),WD(),GD(),QD()]}),sI}function LW(){if(CD)return Fh;CD=1;let e=bd(),t=Sd(),r=DW(),o=cI(),n=Object.prototype.hasOwnProperty,i=1,s=2,a=3,c=4,u=1,d=2,f=3,m=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,h=/[\x85\u2028\u2029]/,b=/[,\[\]{}]/,y=/^(?:!|!!|![0-9A-Za-z-]+!)$/,S=/^(?:!|[^,\[\]{}])(?:%[0-9a-f]{2}|[0-9a-z\-#;/?:@&=+$,_.!~*'()\[\]])*$/i;function x(p){return Object.prototype.toString.call(p)}function _(p){return p===10||p===13}function A(p){return p===9||p===32}function O(p){return p===9||p===32||p===10||p===13}function L(p){return p===44||p===91||p===93||p===123||p===125}function z(p){if(p>=48&&p<=57)return p-48;let U=p|32;if(U>=97&&U<=102)return U-97+10;return-1}function J(p){if(p===120)return 2;if(p===117)return 4;if(p===85)return 8;return 0}function P(p){if(p>=48&&p<=57)return p-48;return-1}function W(p){switch(p){case 48:return"\x00";case 97:return"\x07";case 98:return"\b";case 116:return"\t";case 9:return"\t";case 110:return`
|
|
227
|
+
`;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 101:return"\x1B";case 32:return" ";case 34:return'"';case 47:return"/";case 92:return"\\";case 78:return"\x85";case 95:return"\xA0";case 76:return"\u2028";case 80:return"\u2029";default:return""}}function ee(p){if(p<=65535)return String.fromCharCode(p);return String.fromCharCode((p-65536>>10)+55296,(p-65536&1023)+56320)}function j(p,U,ne){if(U==="__proto__")Object.defineProperty(p,U,{configurable:!0,enumerable:!0,writable:!0,value:ne});else p[U]=ne}let R=Array(256),B=Array(256);for(let p=0;p<256;p++)R[p]=W(p)?1:0,B[p]=W(p);function k(p,U){this.input=p,this.filename=U.filename||null,this.schema=U.schema||o,this.onWarning=U.onWarning||null,this.legacy=U.legacy||!1,this.json=U.json||!1,this.listener=U.listener||null,this.maxDepth=typeof U.maxDepth==="number"?U.maxDepth:100,this.maxTotalMergeKeys=typeof U.maxTotalMergeKeys==="number"?U.maxTotalMergeKeys:1e4,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=p.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.depth=0,this.totalMergeKeys=0,this.firstTabInLine=-1,this.documents=[],this.anchorMapTransactions=[]}function T(p,U){let ne={name:p.filename,buffer:p.input.slice(0,-1),position:p.position,line:p.line,column:p.position-p.lineStart};return ne.snippet=r(ne),new t(U,ne)}function I(p,U){throw T(p,U)}function q(p,U){if(p.onWarning)p.onWarning.call(null,T(p,U))}function N(p,U,ne){let ie=p.anchorMapTransactions;if(ie.length!==0){let X=ie[ie.length-1];if(!n.call(X,U))X[U]={existed:n.call(p.anchorMap,U),value:p.anchorMap[U]}}p.anchorMap[U]=ne}function H(p){p.anchorMapTransactions.push(Object.create(null))}function G(p){let U=p.anchorMapTransactions.pop(),ne=p.anchorMapTransactions;if(ne.length===0)return;let ie=ne[ne.length-1],X=Object.keys(U);for(let w=0,V=X.length;w<V;w+=1){let g=X[w];if(!n.call(ie,g))ie[g]=U[g]}}function re(p){let U=p.anchorMapTransactions.pop(),ne=Object.keys(U);for(let ie=ne.length-1;ie>=0;ie-=1){let X=U[ne[ie]];if(X.existed)p.anchorMap[ne[ie]]=X.value;else delete p.anchorMap[ne[ie]]}}function ae(p){return{position:p.position,line:p.line,lineStart:p.lineStart,lineIndent:p.lineIndent,firstTabInLine:p.firstTabInLine,tag:p.tag,anchor:p.anchor,kind:p.kind,result:p.result}}function me(p,U){p.position=U.position,p.line=U.line,p.lineStart=U.lineStart,p.lineIndent=U.lineIndent,p.firstTabInLine=U.firstTabInLine,p.tag=U.tag,p.anchor=U.anchor,p.kind=U.kind,p.result=U.result}let be={YAML:function(U,ne,ie){if(U.version!==null)I(U,"duplication of %YAML directive");if(ie.length!==1)I(U,"YAML directive accepts exactly one argument");let X=/^([0-9]+)\.([0-9]+)$/.exec(ie[0]);if(X===null)I(U,"ill-formed argument of the YAML directive");let w=parseInt(X[1],10),V=parseInt(X[2],10);if(w!==1)I(U,"unacceptable YAML version of the document");if(U.version=ie[0],U.checkLineBreaks=V<2,V!==1&&V!==2)q(U,"unsupported YAML version of the document")},TAG:function(U,ne,ie){let X;if(ie.length!==2)I(U,"TAG directive accepts exactly two arguments");let w=ie[0];if(X=ie[1],!y.test(w))I(U,"ill-formed tag handle (first argument) of the TAG directive");if(n.call(U.tagMap,w))I(U,'there is a previously declared suffix for "'+w+'" tag handle');if(!S.test(X))I(U,"ill-formed tag prefix (second argument) of the TAG directive");try{X=decodeURIComponent(X)}catch(V){I(U,"tag prefix is malformed: "+X)}U.tagMap[w]=X}};function ve(p,U,ne,ie){if(U<ne){let X=p.input.slice(U,ne);if(ie)for(let w=0,V=X.length;w<V;w+=1){let g=X.charCodeAt(w);if(!(g===9||g>=32&&g<=1114111))I(p,"expected valid JSON character")}else if(m.test(X))I(p,"the stream contains non-printable characters");p.result+=X}}function Ae(p){if(p.totalMergeKeys++,p.maxTotalMergeKeys!==-1&&p.totalMergeKeys>p.maxTotalMergeKeys)I(p,"merge keys exceeded maxTotalMergeKeys ("+p.maxTotalMergeKeys+")")}function Ie(p,U,ne,ie){if(!e.isObject(ne))I(p,"cannot merge mappings; the provided source object is unacceptable");Ae(p);let X=Object.keys(ne);for(let w=0,V=X.length;w<V;w+=1){let g=X[w];if(Ae(p),!n.call(U,g))j(U,g,ne[g]),ie[g]=!0}}function we(p,U,ne,ie,X,w,V,g,E){if(Array.isArray(X)){X=Array.prototype.slice.call(X);for(let D=0,K=X.length;D<K;D+=1){if(Array.isArray(X[D]))I(p,"nested arrays are not supported inside keys");if(typeof X==="object"&&x(X[D])==="[object Object]")X[D]="[object Object]"}}if(typeof X==="object"&&x(X)==="[object Object]")X="[object Object]";if(X=String(X),U===null)U={};if(ie==="tag:yaml.org,2002:merge")if(Array.isArray(w)){if(w.length>100)I(p,"abnormal merge sequence size");for(let D=0,K=w.length;D<K;D+=1)Ie(p,U,w[D],ne)}else Ie(p,U,w,ne);else{if(!p.json&&!n.call(ne,X)&&n.call(U,X))p.line=V||p.line,p.lineStart=g||p.lineStart,p.position=E||p.position,I(p,"duplicated mapping key");j(U,X,w),delete ne[X]}return U}function Ue(p){let U=p.input.charCodeAt(p.position);if(U===10)p.position++;else if(U===13){if(p.position++,p.input.charCodeAt(p.position)===10)p.position++}else I(p,"a line break is expected");p.line+=1,p.lineStart=p.position,p.firstTabInLine=-1}function De(p,U,ne){let ie=0,X=p.input.charCodeAt(p.position);while(X!==0){while(A(X)){if(X===9&&p.firstTabInLine===-1)p.firstTabInLine=p.position;X=p.input.charCodeAt(++p.position)}if(U&&X===35)do X=p.input.charCodeAt(++p.position);while(X!==10&&X!==13&&X!==0);if(_(X)){Ue(p),X=p.input.charCodeAt(p.position),ie++,p.lineIndent=0;while(X===32)p.lineIndent++,X=p.input.charCodeAt(++p.position)}else break}if(ne!==-1&&ie!==0&&p.lineIndent<ne)q(p,"deficient indentation");return ie}function Qe(p){let U=p.position,ne=p.input.charCodeAt(U);if((ne===45||ne===46)&&ne===p.input.charCodeAt(U+1)&&ne===p.input.charCodeAt(U+2)){if(U+=3,ne=p.input.charCodeAt(U),ne===0||O(ne))return!0}return!1}function bt(p,U){if(U===1)p.result+=" ";else if(U>1)p.result+=e.repeat(`
|
|
228
|
+
`,U-1)}function Tt(p,U,ne){let ie,X,w,V,g,E,D=p.kind,K=p.result,M=p.input.charCodeAt(p.position);if(O(M)||L(M)||M===35||M===38||M===42||M===33||M===124||M===62||M===39||M===34||M===37||M===64||M===96)return!1;if(M===63||M===45){let te=p.input.charCodeAt(p.position+1);if(O(te)||ne&&L(te))return!1}p.kind="scalar",p.result="",ie=X=p.position,w=!1;while(M!==0){if(M===58){let te=p.input.charCodeAt(p.position+1);if(O(te)||ne&&L(te))break}else if(M===35){let te=p.input.charCodeAt(p.position-1);if(O(te))break}else if(p.position===p.lineStart&&Qe(p)||ne&&L(M))break;else if(_(M))if(V=p.line,g=p.lineStart,E=p.lineIndent,De(p,!1,-1),p.lineIndent>=U){w=!0,M=p.input.charCodeAt(p.position);continue}else{p.position=X,p.line=V,p.lineStart=g,p.lineIndent=E;break}if(w)ve(p,ie,X,!1),bt(p,p.line-V),ie=X=p.position,w=!1;if(!A(M))X=p.position+1;M=p.input.charCodeAt(++p.position)}if(ve(p,ie,X,!1),p.result)return!0;return p.kind=D,p.result=K,!1}function Dt(p,U){let ne,ie,X=p.input.charCodeAt(p.position);if(X!==39)return!1;p.kind="scalar",p.result="",p.position++,ne=ie=p.position;while((X=p.input.charCodeAt(p.position))!==0)if(X===39)if(ve(p,ne,p.position,!0),X=p.input.charCodeAt(++p.position),X===39)ne=p.position,p.position++,ie=p.position;else return!0;else if(_(X))ve(p,ne,ie,!0),bt(p,De(p,!1,U)),ne=ie=p.position;else if(p.position===p.lineStart&&Qe(p))I(p,"unexpected end of the document within a single quoted scalar");else if(p.position++,!A(X))ie=p.position;I(p,"unexpected end of the stream within a single quoted scalar")}function lt(p,U){let ne,ie,X,w=p.input.charCodeAt(p.position);if(w!==34)return!1;p.kind="scalar",p.result="",p.position++,ne=ie=p.position;while((w=p.input.charCodeAt(p.position))!==0)if(w===34)return ve(p,ne,p.position,!0),p.position++,!0;else if(w===92){if(ve(p,ne,p.position,!0),w=p.input.charCodeAt(++p.position),_(w))De(p,!1,U);else if(w<256&&R[w])p.result+=B[w],p.position++;else if((X=J(w))>0){let V=X,g=0;for(;V>0;V--)if(w=p.input.charCodeAt(++p.position),(X=z(w))>=0)g=(g<<4)+X;else I(p,"expected hexadecimal character");p.result+=ee(g),p.position++}else I(p,"unknown escape sequence");ne=ie=p.position}else if(_(w))ve(p,ne,ie,!0),bt(p,De(p,!1,U)),ne=ie=p.position;else if(p.position===p.lineStart&&Qe(p))I(p,"unexpected end of the document within a double quoted scalar");else if(p.position++,!A(w))ie=p.position;I(p,"unexpected end of the stream within a double quoted scalar")}function $r(p,U){let ne=!0,ie,X,w,V=p.tag,g,E=p.anchor,D,K,M,te,se=Object.create(null),ye,fe,Re,ze=p.input.charCodeAt(p.position);if(ze===91)D=93,te=!1,g=[];else if(ze===123)D=125,te=!0,g={};else return!1;if(p.anchor!==null)N(p,p.anchor,g);ze=p.input.charCodeAt(++p.position);while(ze!==0){if(De(p,!0,U),ze=p.input.charCodeAt(p.position),ze===D)return p.position++,p.tag=V,p.anchor=E,p.kind=te?"mapping":"sequence",p.result=g,!0;else if(!ne)I(p,"missed comma between flow collection entries");else if(ze===44)I(p,"expected the node content, but found ','");if(fe=ye=Re=null,K=M=!1,ze===63){let On=p.input.charCodeAt(p.position+1);if(O(On))K=M=!0,p.position++,De(p,!0,U)}if(ie=p.line,X=p.lineStart,w=p.position,$n(p,U,i,!1,!0),fe=p.tag,ye=p.result,De(p,!0,U),ze=p.input.charCodeAt(p.position),(M||p.line===ie)&&ze===58)K=!0,ze=p.input.charCodeAt(++p.position),De(p,!0,U),$n(p,U,i,!1,!0),Re=p.result;if(te)we(p,g,se,fe,ye,Re,ie,X,w);else if(K)g.push(we(p,null,se,fe,ye,Re,ie,X,w));else g.push(ye);if(De(p,!0,U),ze=p.input.charCodeAt(p.position),ze===44)ne=!0,ze=p.input.charCodeAt(++p.position);else ne=!1}I(p,"unexpected end of the stream within a flow collection")}function Rn(p,U){let ne,ie=u,X=!1,w=!1,V=U,g=0,E=!1,D,K=p.input.charCodeAt(p.position);if(K===124)ne=!1;else if(K===62)ne=!0;else return!1;p.kind="scalar",p.result="";while(K!==0)if(K=p.input.charCodeAt(++p.position),K===43||K===45)if(u===ie)ie=K===43?f:d;else I(p,"repeat of a chomping mode identifier");else if((D=P(K))>=0)if(D===0)I(p,"bad explicit indentation width of a block scalar; it cannot be less than one");else if(!w)V=U+D-1,w=!0;else I(p,"repeat of an indentation width identifier");else break;if(A(K)){do K=p.input.charCodeAt(++p.position);while(A(K));if(K===35)do K=p.input.charCodeAt(++p.position);while(!_(K)&&K!==0)}while(K!==0){Ue(p),p.lineIndent=0,K=p.input.charCodeAt(p.position);while((!w||p.lineIndent<V)&&K===32)p.lineIndent++,K=p.input.charCodeAt(++p.position);if(!w&&p.lineIndent>V)V=p.lineIndent;if(_(K)){g++;continue}if(!w&&V===0)I(p,"missing indentation for block scalar");if(p.lineIndent<V){if(ie===f)p.result+=e.repeat(`
|
|
229
|
+
`,X?1+g:g);else if(ie===u){if(X)p.result+=`
|
|
230
|
+
`}break}if(ne)if(A(K))E=!0,p.result+=e.repeat(`
|
|
231
|
+
`,X?1+g:g);else if(E)E=!1,p.result+=e.repeat(`
|
|
232
|
+
`,g+1);else if(g===0){if(X)p.result+=" "}else p.result+=e.repeat(`
|
|
233
|
+
`,g);else p.result+=e.repeat(`
|
|
234
|
+
`,X?1+g:g);X=!0,w=!0,g=0;let M=p.position;while(!_(K)&&K!==0)K=p.input.charCodeAt(++p.position);ve(p,M,p.position,!1)}return!0}function Le(p,U){let{tag:ne,anchor:ie}=p,X=[],w=!1;if(p.firstTabInLine!==-1)return!1;if(p.anchor!==null)N(p,p.anchor,X);let V=p.input.charCodeAt(p.position);while(V!==0){if(p.firstTabInLine!==-1)p.position=p.firstTabInLine,I(p,"tab characters must not be used in indentation");if(V!==45)break;let g=p.input.charCodeAt(p.position+1);if(!O(g))break;if(w=!0,p.position++,De(p,!0,-1)){if(p.lineIndent<=U){X.push(null),V=p.input.charCodeAt(p.position);continue}}let E=p.line;if($n(p,U,a,!1,!0),X.push(p.result),De(p,!0,-1),V=p.input.charCodeAt(p.position),(p.line===E||p.lineIndent>U)&&V!==0)I(p,"bad indentation of a sequence entry");else if(p.lineIndent<U)break}if(w)return p.tag=ne,p.anchor=ie,p.kind="sequence",p.result=X,!0;return!1}function io(p,U,ne){let ie,X,w,V,g=p.tag,E=p.anchor,D={},K=Object.create(null),M=null,te=null,se=null,ye=!1,fe=!1;if(p.firstTabInLine!==-1)return!1;if(p.anchor!==null)N(p,p.anchor,D);let Re=p.input.charCodeAt(p.position);while(Re!==0){if(!ye&&p.firstTabInLine!==-1)p.position=p.firstTabInLine,I(p,"tab characters must not be used in indentation");let ze=p.input.charCodeAt(p.position+1),On=p.line;if((Re===63||Re===58)&&O(ze)){if(Re===63){if(ye)we(p,D,K,M,te,null,X,w,V),M=te=se=null;fe=!0,ye=!0,ie=!0}else if(ye)ye=!1,ie=!0;else I(p,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line");p.position+=1,Re=ze}else{if(X=p.line,w=p.lineStart,V=p.position,!$n(p,ne,s,!1,!0))break;if(p.line===On){Re=p.input.charCodeAt(p.position);while(A(Re))Re=p.input.charCodeAt(++p.position);if(Re===58){if(Re=p.input.charCodeAt(++p.position),!O(Re))I(p,"a whitespace character is expected after the key-value separator within a block mapping");if(ye)we(p,D,K,M,te,null,X,w,V),M=te=se=null;fe=!0,ye=!1,ie=!1,M=p.tag,te=p.result}else if(fe)I(p,"can not read an implicit mapping pair; a colon is missed");else return p.tag=g,p.anchor=E,!0}else if(fe)I(p,"can not read a block mapping entry; a multiline key may not be an implicit key");else return p.tag=g,p.anchor=E,!0}if(p.line===On||p.lineIndent>U){if(ye)X=p.line,w=p.lineStart,V=p.position;if($n(p,U,c,!0,ie))if(ye)te=p.result;else se=p.result;if(!ye)we(p,D,K,M,te,se,X,w,V),M=te=se=null;De(p,!0,-1),Re=p.input.charCodeAt(p.position)}if((p.line===On||p.lineIndent>U)&&Re!==0)I(p,"bad indentation of a mapping entry");else if(p.lineIndent<U)break}if(ye)we(p,D,K,M,te,null,X,w,V);if(fe)p.tag=g,p.anchor=E,p.kind="mapping",p.result=D;return fe}function as(p){let U=!1,ne=!1,ie,X,w=p.input.charCodeAt(p.position);if(w!==33)return!1;if(p.tag!==null)I(p,"duplication of a tag property");if(w=p.input.charCodeAt(++p.position),w===60)U=!0,w=p.input.charCodeAt(++p.position);else if(w===33)ne=!0,ie="!!",w=p.input.charCodeAt(++p.position);else ie="!";let V=p.position;if(U){do w=p.input.charCodeAt(++p.position);while(w!==0&&w!==62);if(p.position<p.length)X=p.input.slice(V,p.position),w=p.input.charCodeAt(++p.position);else I(p,"unexpected end of the stream within a verbatim tag")}else{while(w!==0&&!O(w)){if(w===33)if(!ne){if(ie=p.input.slice(V-1,p.position+1),!y.test(ie))I(p,"named tag handle cannot contain such characters");ne=!0,V=p.position+1}else I(p,"tag suffix cannot contain exclamation marks");w=p.input.charCodeAt(++p.position)}if(X=p.input.slice(V,p.position),b.test(X))I(p,"tag suffix cannot contain flow indicator characters")}if(X&&!S.test(X))I(p,"tag name cannot contain such characters: "+X);try{X=decodeURIComponent(X)}catch(g){I(p,"tag name is malformed: "+X)}if(U)p.tag=X;else if(n.call(p.tagMap,ie))p.tag=p.tagMap[ie]+X;else if(ie==="!")p.tag="!"+X;else if(ie==="!!")p.tag="tag:yaml.org,2002:"+X;else I(p,'undeclared tag handle "'+ie+'"');return!0}function cs(p){let U=p.input.charCodeAt(p.position);if(U!==38)return!1;if(p.anchor!==null)I(p,"duplication of an anchor property");U=p.input.charCodeAt(++p.position);let ne=p.position;while(U!==0&&!O(U)&&!L(U))U=p.input.charCodeAt(++p.position);if(p.position===ne)I(p,"name of an anchor node must contain at least one character");return p.anchor=p.input.slice(ne,p.position),!0}function wa(p){let U=p.input.charCodeAt(p.position);if(U!==42)return!1;U=p.input.charCodeAt(++p.position);let ne=p.position;while(U!==0&&!O(U)&&!L(U))U=p.input.charCodeAt(++p.position);if(p.position===ne)I(p,"name of an alias node must contain at least one character");let ie=p.input.slice(ne,p.position);if(!n.call(p.anchorMap,ie))I(p,'unidentified alias "'+ie+'"');return p.result=p.anchorMap[ie],De(p,!0,-1),!0}function ls(p,U,ne,ie){let X=ae(p);if(H(p),me(p,U),p.tag=null,p.anchor=null,p.kind=null,p.result=null,io(p,ne,ie)&&p.kind==="mapping")return G(p),!0;return re(p),me(p,X),!1}function $n(p,U,ne,ie,X){let w,V,g=1,E=!1,D=!1,K=null,M,te,se;if(p.depth>=p.maxDepth)I(p,"nesting exceeded maxDepth ("+p.maxDepth+")");if(p.depth+=1,p.listener!==null)p.listener("open",p);p.tag=null,p.anchor=null,p.kind=null,p.result=null;let ye=w=V=c===ne||a===ne;if(ie){if(De(p,!0,-1)){if(E=!0,p.lineIndent>U)g=1;else if(p.lineIndent===U)g=0;else if(p.lineIndent<U)g=-1}}if(g===1)while(!0){let fe=p.input.charCodeAt(p.position),Re=ae(p);if(E&&(fe===33&&p.tag!==null||fe===38&&p.anchor!==null))break;if(!as(p)&&!cs(p))break;if(K===null)K=Re;if(De(p,!0,-1)){if(E=!0,V=ye,p.lineIndent>U)g=1;else if(p.lineIndent===U)g=0;else if(p.lineIndent<U)g=-1}else V=!1}if(V)V=E||X;if(g===1||c===ne){if(i===ne||s===ne)te=U;else te=U+1;if(se=p.position-p.lineStart,g===1)if(V&&(Le(p,se)||io(p,se,te))||$r(p,te))D=!0;else{let fe=p.input.charCodeAt(p.position);if(K!==null&&ye&&!V&&fe!==124&&fe!==62&&ls(p,K,K.position-K.lineStart,te))D=!0;else if(w&&Rn(p,te)||Dt(p,te)||lt(p,te))D=!0;else if(wa(p)){if(D=!0,p.tag!==null||p.anchor!==null)I(p,"alias node should not have any properties")}else if(Tt(p,te,i===ne)){if(D=!0,p.tag===null)p.tag="?"}if(p.anchor!==null)N(p,p.anchor,p.result)}else if(g===0)D=V&&Le(p,se)}if(p.tag===null){if(p.anchor!==null)N(p,p.anchor,p.result)}else if(p.tag==="?"){if(p.result!==null&&p.kind!=="scalar")I(p,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+p.kind+'"');for(let fe=0,Re=p.implicitTypes.length;fe<Re;fe+=1)if(M=p.implicitTypes[fe],M.resolve(p.result)){if(p.result=M.construct(p.result),p.tag=M.tag,p.anchor!==null)N(p,p.anchor,p.result);break}}else if(p.tag!=="!"){if(n.call(p.typeMap[p.kind||"fallback"],p.tag))M=p.typeMap[p.kind||"fallback"][p.tag];else{M=null;let fe=p.typeMap.multi[p.kind||"fallback"];for(let Re=0,ze=fe.length;Re<ze;Re+=1)if(p.tag.slice(0,fe[Re].tag.length)===fe[Re].tag){M=fe[Re];break}}if(!M)I(p,"unknown tag !<"+p.tag+">");if(p.result!==null&&M.kind!==p.kind)I(p,"unacceptable node kind for !<"+p.tag+'> tag; it should be "'+M.kind+'", not "'+p.kind+'"');if(!M.resolve(p.result,p.tag))I(p,"cannot resolve a node with !<"+p.tag+"> explicit tag");else if(p.result=M.construct(p.result,p.tag),p.anchor!==null)N(p,p.anchor,p.result)}if(p.listener!==null)p.listener("close",p);return p.depth-=1,p.tag!==null||p.anchor!==null||D}function jl(p){let U=p.position,ne=!1,ie;p.version=null,p.checkLineBreaks=p.legacy,p.tagMap=Object.create(null),p.anchorMap=Object.create(null);while((ie=p.input.charCodeAt(p.position))!==0){if(De(p,!0,-1),ie=p.input.charCodeAt(p.position),p.lineIndent>0||ie!==37)break;ne=!0,ie=p.input.charCodeAt(++p.position);let X=p.position;while(ie!==0&&!O(ie))ie=p.input.charCodeAt(++p.position);let w=p.input.slice(X,p.position),V=[];if(w.length<1)I(p,"directive name must not be less than one character in length");while(ie!==0){while(A(ie))ie=p.input.charCodeAt(++p.position);if(ie===35){do ie=p.input.charCodeAt(++p.position);while(ie!==0&&!_(ie));break}if(_(ie))break;X=p.position;while(ie!==0&&!O(ie))ie=p.input.charCodeAt(++p.position);V.push(p.input.slice(X,p.position))}if(ie!==0)Ue(p);if(n.call(be,w))be[w](p,w,V);else q(p,'unknown document directive "'+w+'"')}if(De(p,!0,-1),p.lineIndent===0&&p.input.charCodeAt(p.position)===45&&p.input.charCodeAt(p.position+1)===45&&p.input.charCodeAt(p.position+2)===45)p.position+=3,De(p,!0,-1);else if(ne)I(p,"directives end mark is expected");if($n(p,p.lineIndent-1,c,!1,!0),De(p,!0,-1),p.checkLineBreaks&&h.test(p.input.slice(U,p.position)))q(p,"non-ASCII line breaks are interpreted as content");if(p.documents.push(p.result),p.position===p.lineStart&&Qe(p)){if(p.input.charCodeAt(p.position)===46)p.position+=3,De(p,!0,-1);return}if(p.position<p.length-1)I(p,"end of the stream or a document separator is expected")}function Vo(p,U){if(p=String(p),U=U||{},p.length!==0){if(p.charCodeAt(p.length-1)!==10&&p.charCodeAt(p.length-1)!==13)p+=`
|
|
235
|
+
`;if(p.charCodeAt(0)===65279)p=p.slice(1)}let ne=new k(p,U),ie=p.indexOf("\x00");if(ie!==-1)ne.position=ie,I(ne,"null byte is not allowed in input");ne.input+="\x00";while(ne.input.charCodeAt(ne.position)===32)ne.lineIndent+=1,ne.position+=1;while(ne.position<ne.length-1)jl(ne);return ne.documents}function xa(p,U,ne){if(U!==null&&typeof U==="object"&&typeof ne>"u")ne=U,U=null;let ie=Vo(p,ne);if(typeof U!=="function")return ie;for(let X=0,w=ie.length;X<w;X+=1)U(ie[X])}function _a(p,U){let ne=Vo(p,U);if(ne.length===0)return;else if(ne.length===1)return ne[0];throw new t("expected a single document in the stream, but found more")}return Fh.loadAll=xa,Fh.load=_a,Fh}function BW(){if(PD)return aI;PD=1;let e=bd(),t=Sd(),r=cI(),o=Object.prototype.toString,n=Object.prototype.hasOwnProperty,i=65279,s=9,a=10,c=13,u=32,d=33,f=34,m=35,h=37,b=38,y=39,S=42,x=44,_=45,A=58,O=61,L=62,z=63,J=64,P=91,W=93,ee=96,j=123,R=124,B=125,k={};k[0]="\\0",k[7]="\\a",k[8]="\\b",k[9]="\\t",k[10]="\\n",k[11]="\\v",k[12]="\\f",k[13]="\\r",k[27]="\\e",k[34]="\\\"",k[92]="\\\\",k[133]="\\N",k[160]="\\_",k[8232]="\\L",k[8233]="\\P";let T=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],I=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function q(w,V){if(V===null)return{};let g={},E=Object.keys(V);for(let D=0,K=E.length;D<K;D+=1){let M=E[D],te=String(V[M]);if(M.slice(0,2)==="!!")M="tag:yaml.org,2002:"+M.slice(2);let se=w.compiledTypeMap.fallback[M];if(se&&n.call(se.styleAliases,te))te=se.styleAliases[te];g[M]=te}return g}function N(w){let V,g,E=w.toString(16).toUpperCase();if(w<=255)V="x",g=2;else if(w<=65535)V="u",g=4;else if(w<=4294967295)V="U",g=8;else throw new t("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+V+e.repeat("0",g-E.length)+E}let H=1,G=2;function re(w){this.schema=w.schema||r,this.indent=Math.max(1,w.indent||2),this.noArrayIndent=w.noArrayIndent||!1,this.skipInvalid=w.skipInvalid||!1,this.flowLevel=e.isNothing(w.flowLevel)?-1:w.flowLevel,this.styleMap=q(this.schema,w.styles||null),this.sortKeys=w.sortKeys||!1,this.lineWidth=w.lineWidth||80,this.noRefs=w.noRefs||!1,this.noCompatMode=w.noCompatMode||!1,this.condenseFlow=w.condenseFlow||!1,this.quotingType=w.quotingType==='"'?G:H,this.forceQuotes=w.forceQuotes||!1,this.replacer=typeof w.replacer==="function"?w.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function ae(w,V){let g=e.repeat(" ",V),E=0,D="",K=w.length;while(E<K){let M,te=w.indexOf(`
|
|
236
|
+
`,E);if(te===-1)M=w.slice(E),E=K;else M=w.slice(E,te+1),E=te+1;if(M.length&&M!==`
|
|
237
|
+
`)D+=g;D+=M}return D}function me(w,V){return`
|
|
238
|
+
`+e.repeat(" ",w.indent*V)}function be(w,V){for(let g=0,E=w.implicitTypes.length;g<E;g+=1)if(w.implicitTypes[g].resolve(V))return!0;return!1}function ve(w){return w===u||w===s}function Ae(w){return w>=32&&w<=126||w>=161&&w<=55295&&w!==8232&&w!==8233||w>=57344&&w<=65533&&w!==i||w>=65536&&w<=1114111}function Ie(w){return Ae(w)&&w!==i&&w!==c&&w!==a}function we(w,V,g){let E=Ie(w),D=E&&!ve(w);return(g?E:E&&w!==x&&w!==P&&w!==W&&w!==j&&w!==B)&&w!==m&&!(V===A&&!D)||Ie(V)&&!ve(V)&&w===m||V===A&&D}function Ue(w){return Ae(w)&&w!==i&&!ve(w)&&w!==_&&w!==z&&w!==A&&w!==x&&w!==P&&w!==W&&w!==j&&w!==B&&w!==m&&w!==b&&w!==S&&w!==d&&w!==R&&w!==O&&w!==L&&w!==y&&w!==f&&w!==h&&w!==J&&w!==ee}function De(w){return!ve(w)&&w!==A}function Qe(w,V){let g=w.charCodeAt(V),E;if(g>=55296&&g<=56319&&V+1<w.length){if(E=w.charCodeAt(V+1),E>=56320&&E<=57343)return(g-55296)*1024+E-56320+65536}return g}function bt(w){return/^\n* /.test(w)}let Tt=1,Dt=2,lt=3,$r=4,Rn=5;function Le(w,V,g,E,D,K,M,te){let se,ye=0,fe=null,Re=!1,ze=!1,On=E!==-1,us=-1,Zl=Ue(Qe(w,0))&&De(Qe(w,w.length-1));if(V||M)for(se=0;se<w.length;ye>=65536?se+=2:se++){if(ye=Qe(w,se),!Ae(ye))return Rn;Zl=Zl&&we(ye,fe,te),fe=ye}else{for(se=0;se<w.length;ye>=65536?se+=2:se++){if(ye=Qe(w,se),ye===a){if(Re=!0,On)ze=ze||se-us-1>E&&w[us+1]!==" ",us=se}else if(!Ae(ye))return Rn;Zl=Zl&&we(ye,fe,te),fe=ye}ze=ze||On&&(se-us-1>E&&w[us+1]!==" ")}if(!Re&&!ze){if(Zl&&!M&&!D(w))return Tt;return K===G?Rn:Dt}if(g>9&&bt(w))return Rn;if(!M)return ze?$r:lt;return K===G?Rn:Dt}function io(w,V,g,E,D){w.dump=function(){if(V.length===0)return w.quotingType===G?'""':"''";if(!w.noCompatMode){if(T.indexOf(V)!==-1||I.test(V))return w.quotingType===G?'"'+V+'"':"'"+V+"'"}let K=w.indent*Math.max(1,g),M=w.lineWidth===-1?-1:Math.max(Math.min(w.lineWidth,40),w.lineWidth-K),te=E||w.flowLevel>-1&&g>=w.flowLevel;function se(ye){return be(w,ye)}switch(Le(V,te,w.indent,M,se,w.quotingType,w.forceQuotes&&!E,D)){case Tt:return V;case Dt:return"'"+V.replace(/'/g,"''")+"'";case lt:return"|"+as(V,w.indent)+cs(ae(V,K));case $r:return">"+as(V,w.indent)+cs(ae(wa(V,M),K));case Rn:return'"'+$n(V)+'"';default:throw new t("impossible error: invalid scalar style")}}()}function as(w,V){let g=bt(w)?String(V):"",E=w[w.length-1]===`
|
|
239
|
+
`,K=E&&(w[w.length-2]===`
|
|
240
|
+
`||w===`
|
|
241
|
+
`)?"+":E?"":"-";return g+K+`
|
|
242
|
+
`}function cs(w){return w[w.length-1]===`
|
|
243
|
+
`?w.slice(0,-1):w}function wa(w,V){let g=/(\n+)([^\n]*)/g,E=function(){let te=w.indexOf(`
|
|
244
|
+
`);return te=te!==-1?te:w.length,g.lastIndex=te,ls(w.slice(0,te),V)}(),D=w[0]===`
|
|
245
|
+
`||w[0]===" ",K,M;while(M=g.exec(w)){let te=M[1],se=M[2];K=se[0]===" ",E+=te+(!D&&!K&&se!==""?`
|
|
246
|
+
`:"")+ls(se,V),D=K}return E}function ls(w,V){if(w===""||w[0]===" ")return w;let g=/ [^ ]/g,E,D=0,K,M=0,te=0,se="";while(E=g.exec(w)){if(te=E.index,te-D>V)K=M>D?M:te,se+=`
|
|
247
|
+
`+w.slice(D,K),D=K+1;M=te}if(se+=`
|
|
248
|
+
`,w.length-D>V&&M>D)se+=w.slice(D,M)+`
|
|
249
|
+
`+w.slice(M+1);else se+=w.slice(D);return se.slice(1)}function $n(w){let V="",g=0;for(let E=0;E<w.length;g>=65536?E+=2:E++){g=Qe(w,E);let D=k[g];if(!D&&Ae(g)){if(V+=w[E],g>=65536)V+=w[E+1]}else V+=D||N(g)}return V}function jl(w,V,g){let E="",D=w.tag;for(let K=0,M=g.length;K<M;K+=1){let te=g[K];if(w.replacer)te=w.replacer.call(g,String(K),te);if(U(w,V,te,!1,!1)||typeof te>"u"&&U(w,V,null,!1,!1)){if(E!=="")E+=","+(!w.condenseFlow?" ":"");E+=w.dump}}w.tag=D,w.dump="["+E+"]"}function Vo(w,V,g,E){let D="",K=w.tag;for(let M=0,te=g.length;M<te;M+=1){let se=g[M];if(w.replacer)se=w.replacer.call(g,String(M),se);if(U(w,V+1,se,!0,!0,!1,!0)||typeof se>"u"&&U(w,V+1,null,!0,!0,!1,!0)){if(!E||D!=="")D+=me(w,V);if(w.dump&&a===w.dump.charCodeAt(0))D+="-";else D+="- ";D+=w.dump}}w.tag=K,w.dump=D||"[]"}function xa(w,V,g){let E="",D=w.tag,K=Object.keys(g);for(let M=0,te=K.length;M<te;M+=1){let se="";if(E!=="")se+=", ";if(w.condenseFlow)se+='"';let ye=K[M],fe=g[ye];if(w.replacer)fe=w.replacer.call(g,ye,fe);if(!U(w,V,ye,!1,!1))continue;if(w.dump.length>1024)se+="? ";if(se+=w.dump+(w.condenseFlow?'"':"")+":"+(w.condenseFlow?"":" "),!U(w,V,fe,!1,!1))continue;se+=w.dump,E+=se}w.tag=D,w.dump="{"+E+"}"}function _a(w,V,g,E){let D="",K=w.tag,M=Object.keys(g);if(w.sortKeys===!0)M.sort();else if(typeof w.sortKeys==="function")M.sort(w.sortKeys);else if(w.sortKeys)throw new t("sortKeys must be a boolean or a function");for(let te=0,se=M.length;te<se;te+=1){let ye="";if(!E||D!=="")ye+=me(w,V);let fe=M[te],Re=g[fe];if(w.replacer)Re=w.replacer.call(g,fe,Re);if(!U(w,V+1,fe,!0,!0,!0))continue;let ze=w.tag!==null&&w.tag!=="?"||w.dump&&w.dump.length>1024;if(ze)if(w.dump&&a===w.dump.charCodeAt(0))ye+="?";else ye+="? ";if(ye+=w.dump,ze)ye+=me(w,V);if(!U(w,V+1,Re,!0,ze))continue;if(w.dump&&a===w.dump.charCodeAt(0))ye+=":";else ye+=": ";ye+=w.dump,D+=ye}w.tag=K,w.dump=D||"{}"}function p(w,V,g){let E=g?w.explicitTypes:w.implicitTypes;for(let D=0,K=E.length;D<K;D+=1){let M=E[D];if((M.instanceOf||M.predicate)&&(!M.instanceOf||typeof V==="object"&&V instanceof M.instanceOf)&&(!M.predicate||M.predicate(V))){if(g)if(M.multi&&M.representName)w.tag=M.representName(V);else w.tag=M.tag;else w.tag="?";if(M.represent){let te=w.styleMap[M.tag]||M.defaultStyle,se;if(o.call(M.represent)==="[object Function]")se=M.represent(V,te);else if(n.call(M.represent,te))se=M.represent[te](V,te);else throw new t("!<"+M.tag+'> tag resolver accepts not "'+te+'" style');w.dump=se}return!0}}return!1}function U(w,V,g,E,D,K,M){if(w.tag=null,w.dump=g,!p(w,g,!1))p(w,g,!0);let te=o.call(w.dump),se=E;if(E)E=w.flowLevel<0||w.flowLevel>V;let ye=te==="[object Object]"||te==="[object Array]",fe,Re;if(ye)fe=w.duplicates.indexOf(g),Re=fe!==-1;if(w.tag!==null&&w.tag!=="?"||Re||w.indent!==2&&V>0)D=!1;if(Re&&w.usedDuplicates[fe])w.dump="*ref_"+fe;else{if(ye&&Re&&!w.usedDuplicates[fe])w.usedDuplicates[fe]=!0;if(te==="[object Object]"){if(E&&Object.keys(w.dump).length!==0){if(_a(w,V,w.dump,D),Re)w.dump="&ref_"+fe+w.dump}else if(xa(w,V,w.dump),Re)w.dump="&ref_"+fe+" "+w.dump}else if(te==="[object Array]"){if(E&&w.dump.length!==0){if(w.noArrayIndent&&!M&&V>0)Vo(w,V-1,w.dump,D);else Vo(w,V,w.dump,D);if(Re)w.dump="&ref_"+fe+w.dump}else if(jl(w,V,w.dump),Re)w.dump="&ref_"+fe+" "+w.dump}else if(te==="[object String]"){if(w.tag!=="?")io(w,w.dump,V,K,se)}else if(te==="[object Undefined]")return!1;else{if(w.skipInvalid)return!1;throw new t("unacceptable kind of an object to dump "+te)}if(w.tag!==null&&w.tag!=="?"){let ze=encodeURI(w.tag[0]==="!"?w.tag.slice(1):w.tag).replace(/!/g,"%21");if(w.tag[0]==="!")ze="!"+ze;else if(ze.slice(0,18)==="tag:yaml.org,2002:")ze="!!"+ze.slice(18);else ze="!<"+ze+">";w.dump=ze+" "+w.dump}}return!0}function ne(w,V){let g=[],E=[];ie(w,g,E);let D=E.length;for(let K=0;K<D;K+=1)V.duplicates.push(g[E[K]]);V.usedDuplicates=Array(D)}function ie(w,V,g){if(w!==null&&typeof w==="object"){let E=V.indexOf(w);if(E!==-1){if(g.indexOf(E)===-1)g.push(E)}else if(V.push(w),Array.isArray(w))for(let D=0,K=w.length;D<K;D+=1)ie(w[D],V,g);else{let D=Object.keys(w);for(let K=0,M=D.length;K<M;K+=1)ie(w[D[K]],V,g)}}}function X(w,V){V=V||{};let g=new re(V);if(!g.noRefs)ne(w,g);let E=w;if(g.replacer)E=g.replacer.call({"":E},"",E);if(U(g,0,E,!0,!0))return g.dump+`
|
|
250
|
+
`;return""}return aI.dump=X,aI}function jW(){if(zD)return nr;zD=1;let e=LW(),t=BW();function r(o,n){return function(){throw Error("Function yaml."+o+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}return nr.Type=gr(),nr.Schema=ND(),nr.FAILSAFE_SCHEMA=jD(),nr.JSON_SCHEMA=FD(),nr.CORE_SCHEMA=KD(),nr.DEFAULT_SCHEMA=cI(),nr.load=e.load,nr.loadAll=e.loadAll,nr.dump=t.dump,nr.YAMLException=Sd(),nr.types={binary:VD(),float:qD(),map:BD(),null:ZD(),pairs:GD(),set:QD(),timestamp:JD(),bool:UD(),int:MD(),merge:HD(),omap:WD(),seq:LD(),str:DD()},nr.safeLoad=r("safeLoad","load"),nr.safeLoadAll=r("safeLoadAll","loadAll"),nr.safeDump=r("safeDump","dump"),nr}var nr,Fh,Ti,uD,Zk,dD,Uk,fD,Mk,pD,qk,mD,Fk,hD,Kk,gD,Jk,yD,Hk,bD,Vk,SD,Wk,vD,Gk,wD,Qk,xD,Yk,_D,Xk,ED,eI,kD,tI,ID,rI,AD,nI,TD,oI,RD,iI,$D,sI,OD,CD,aI,PD,zD,ZW,YD,Rc,UW,MW,qW,FW,lI,$c,KW,vd,JW,HW,VW,WW,GW;var Oc=v(()=>{nr={},Fh={},Ti={};aI={};ZW=jW(),YD=NW(ZW),{Type:Rc,Schema:UW,FAILSAFE_SCHEMA:MW,JSON_SCHEMA:qW,CORE_SCHEMA:FW,DEFAULT_SCHEMA:lI,load:$c,loadAll:KW,dump:vd,YAMLException:JW,types:HW,safeLoad:VW,safeLoadAll:WW,safeDump:GW}=YD});function Cc(e){return vd(e,{skipInvalid:!0,noRefs:!0,sortKeys:!0})}function XD(e){return $c(e)}function yr(e,t){if(!e.trim())return{ok:!1,error:"file is empty"};let r;try{r=$c(e)}catch(n){return{ok:!1,error:Ve(n,"YAML parse error")}}if(!QW(r))return{ok:!1,error:"expected a YAML mapping (key: value pairs)"};if(!t)return{ok:!0,data:r};let o=t.safeParse(r);if(!o.success)return{ok:!1,error:`invalid field(s): ${o.error.issues.map((i)=>i.path.map(String).join(".")).join(", ")}`};return{ok:!0,data:o.data}}function QW(e){return Boolean(e)&&typeof e==="object"&&!Array.isArray(e)}var Hn=v(()=>{Oc()});var uI,eL;var dI=v(()=>{pe();uI=l.object({title:l.string().trim().min(1).max(500).optional(),introduction:l.string().trim().min(1).max(4000).optional(),topics:l.array(l.string().trim().min(1).max(500)).max(20).optional(),topicsHeading:l.string().trim().min(1).max(120).optional(),contactLabel:l.string().trim().min(1).max(80).optional(),contactNote:l.string().trim().min(1).max(240).optional(),mapCaption:l.string().trim().min(1).max(160).optional(),refusal:l.string().trim().min(1).max(500).optional(),faqHeading:l.string().trim().min(1).max(120).optional()}),eL=uI.omit({introduction:!0})});function Hs(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function rL(e){let t=Reflect.get(Js,"types"),r=Hs(t)?t[e]:void 0;if(!(r instanceof Rc))throw Error(`Required YAML type is unavailable: ${e}`);return r}function eG(e,t){let r=0,o=1;for(let n of e.split(":").reverse())r+=(t?Number.parseFloat(n):Number.parseInt(n,10))*o,o*=60;return r}function tL(e){let t=rL(e);return new Rc(`tag:yaml.org,2002:${e}`,{kind:"scalar",resolve:(r)=>typeof r==="string"&&(e==="int"?YW:XW).test(r)&&!r.endsWith("_"),construct:(r)=>{let o=r.replace(/_/g,""),n=o.startsWith("-")?-1:1,i=o.replace(/^[+-]/,"");if(i.includes(":"))return n*eG(i,e==="float");if(e==="int"&&i==="0")return 0;if(e==="int"&&/^0[0-7]+$/.test(i))return n*Number.parseInt(i,8);return t.construct(o)},predicate:t.predicate??void 0,represent:t.represent??void 0,defaultStyle:t.defaultStyle??void 0})}var YW,XW,fI,tG,rG,nG;var nL=v(()=>{Oc();YW=/^[+-]?(?:0|0b[01_]*[01]|0x[\da-fA-F_]*[\da-fA-F]|0[0-7_]*[0-7]|[1-9](?:[\d_]*\d)?|[1-9][\d_]*(?::[0-5]?\d)+)$/,XW=/^(?:[-+]?(?:0|[1-9][\d_]*)(?:\.[\d_]*)?(?:[eE][-+]?\d+)?|\.[\d_]+(?:[eE][-+]?\d+)?|[-+]?\d[\d_]*(?::[0-5]?\d)+\.[\d_]*|[-+]?\.(?:inf|Inf|INF)|\.(?:nan|NaN|NAN))$/;fI=rL("binary"),tG=new Rc("tag:yaml.org,2002:binary",{kind:"scalar",resolve:(e)=>fI.resolve(e),construct:(e)=>{let t=fI.construct(e);if(!(t instanceof Uint8Array))throw Error("Invalid YAML binary result");return typeof Buffer>"u"?Array.from(t):Buffer.from(t)},predicate:(e)=>typeof Buffer<"u"&&Buffer.isBuffer(e),represent:fI.represent??void 0}),rG=new Rc("tag:yaml.org,2002:str",{kind:"scalar",resolve:(e)=>typeof e==="string"&&e.includes(":"),construct:(e)=>e}),nG=lI.extend({implicit:[tL("int"),tL("float"),rG],explicit:[tG]})});var pI=v(()=>{Oc();nL()});var oL,iL,sL,iG;var mI=v(()=>{pI();pe();oL=l.object({audiences:l.array(l.string()).optional(),positioning:l.string().optional()}),iL=l.object({summary:l.string().optional(),traits:l.array(l.string()).optional(),principles:l.array(l.string()).optional(),preferredTerms:l.array(l.string()).optional(),avoid:l.array(l.string()).optional()}),sL=l.object({artDirection:l.string().optional(),palette:l.array(l.string()).optional(),composition:l.string().optional(),mood:l.string().optional(),preferred:l.array(l.string()).optional(),avoid:l.array(l.string()).optional()}),iG=l.object({name:l.string().describe("Style guide name"),messaging:oL.optional(),voice:iL.optional(),visual:sL.optional()})});var cL=v(()=>{pI();dI();mI()});var sG,Kh,r_e,hI="data-ask-sheet",aG;var gI=v(()=>{pe();sG=l.object({public:l.boolean(),preview:l.boolean()}),Kh=l.object({name:l.string().trim().min(1).max(200),url:l.string().url().optional()}),r_e=l.object({sources:l.array(l.object({id:l.string(),title:l.string(),brain:Kh.optional()}))}),aG=`body *:not([${hI}], [${hI}] *) { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }`});var Ri;var Jh=v(()=>{pe();Ri=l.discriminatedUnion("kind",[l.object({kind:l.literal("user"),userId:l.string().min(1),canonicalId:l.string().min(1).optional()}),l.object({kind:l.literal("external"),externalActorId:l.string().min(1)}),l.object({kind:l.literal("agent"),agentId:l.string().min(1)}),l.object({kind:l.literal("service"),serviceId:l.string().min(1)})])});var cG,a_e,Pc,lG,uG,lL,c_e,dG,fG,uL;var dL=v(()=>{pe();cG=l.strictObject({messageCharacters:l.number().int().positive(),requestTimeoutSeconds:l.number().int().positive().max(2147483)}),a_e=l.strictObject({limits:cG,maxCostMicroUsd:l.number().int().positive()}),Pc=l.number().int().nonnegative(),lG=l.strictObject({modelCalls:Pc,inputTokens:Pc,cachedInputTokens:Pc,outputTokens:Pc,reasoningTokens:Pc,embeddingTokens:Pc}),uG=l.discriminatedUnion("state",[l.strictObject({state:l.literal("known"),microUsd:l.number().int().nonnegative(),pricing:l.string().trim().min(1).max(120)}),l.strictObject({state:l.literal("unknown"),reason:l.enum(["missing-usage","unsupported-pricing"])})]),lL=l.strictObject({usage:lG,cost:uG}),c_e=l.strictObject({topics:l.array(l.string().trim().min(1).max(500)).max(20),introduction:l.string().trim().min(1).max(4000).optional(),refusal:l.string().trim().min(1).max(500).optional()}),dG=l.enum(["in-scope","off-topic","abusive","injection","harmful"]),fG=dG.exclude(["in-scope"]),uL=l.discriminatedUnion("outcome",[l.strictObject({outcome:l.literal("answered")}),l.strictObject({outcome:l.literal("refused"),category:fG}),l.strictObject({outcome:l.literal("unscreened")})])});function mG(e){let t=pG.safeParse(e);if(!t.success)return e;return{...t.data,cards:t.data.cards.filter((r)=>yI.safeParse(r).success)}}var fL,pL,mL,hL,gL,yL,zc,bL,SL,vL,wL,xL,yI,_L,EL,kL,pG,IL;var wd=v(()=>{pe();gI();dL();fL=l.object({id:l.string(),toolCallId:l.string().optional(),toolName:l.string(),summary:l.string(),completionSummary:l.string().optional(),preview:l.string().optional(),args:l.unknown()}),pL=l.enum(["approval-requested","approval-responded","output-available","output-denied","output-error"]),mL=l.object({kind:l.literal("tool-approval"),id:l.string(),toolCallId:l.string().optional(),toolName:l.string(),input:l.record(l.string(),l.unknown()).optional(),summary:l.string(),completionSummary:l.string().optional(),preview:l.string().optional(),state:pL,output:l.unknown().optional(),error:l.string().optional()}),hL=l.object({entityType:l.string().optional(),entityId:l.string().optional(),attachmentType:l.string().optional()}),gL=l.object({mediaType:l.string().min(1),url:l.string().min(1),downloadUrl:l.string().min(1).optional(),previewUrl:l.string().min(1).optional(),filename:l.string().min(1).optional(),sizeBytes:l.number().nonnegative().optional(),source:hL.optional()}),yL=l.object({kind:l.literal("attachment"),id:l.string(),jobId:l.string().optional(),title:l.string(),description:l.string().optional(),attachment:gL}),zc=l.object({id:l.string().min(1),title:l.string().min(1).optional(),source:l.string().min(1),url:l.string().min(1).optional(),entityType:l.string().min(1).optional(),entityId:l.string().min(1).optional(),excerpt:l.string().min(1).optional(),provenance:l.record(l.string(),l.unknown()).optional(),brain:Kh.optional()}),bL=l.object({kind:l.literal("sources"),id:l.string().min(1),title:l.string().min(1).optional(),sources:l.array(zc).min(1)}),SL=l.object({type:l.literal("prompt"),id:l.string().min(1),label:l.string().min(1),prompt:l.string().min(1),description:l.string().min(1).optional()}),vL=l.object({type:l.literal("event"),id:l.string().min(1),label:l.string().min(1),event:l.string().min(1),fromState:l.string().min(1).optional(),description:l.string().min(1).optional()}),wL=l.discriminatedUnion("type",[SL,vL]),xL=l.object({kind:l.literal("actions"),id:l.string().min(1),title:l.string().min(1).optional(),defaultOpen:l.boolean().optional(),actions:l.array(wL).min(1)}),yI=l.discriminatedUnion("kind",[mL,yL,bL,xL]),_L=l.object({toolName:l.string(),args:l.record(l.string(),l.unknown()).optional(),jobId:l.string().optional(),data:l.unknown().optional(),error:l.object({message:l.string(),code:l.string().optional()}).optional()}),EL=l.object({faqId:l.string().min(1)}),kL=l.object({text:l.string(),error:l.string().optional(),toolResults:l.array(_L).optional(),cards:l.array(yI).optional(),pendingConfirmations:l.array(fL).optional(),usage:l.object({promptTokens:l.number(),completionTokens:l.number(),totalTokens:l.number()}),guestSettlement:lL.optional(),guestScreening:uL.optional(),askedBefore:EL.optional()}),pG=l.looseObject({cards:l.array(l.unknown())});IL=l.preprocess((e)=>mG(qh(e)),kL)});function Ee(e){return Object.freeze({name:e.channel,schema:e.request,response:e.response,delivery:e.delivery})}var bI,hG,gG,AL,yG,bG,SG,vG;var TL=v(()=>{pe();Jh();wd();bI=l.object({state:l.string(),response:l.string(),sources:l.array(zc)}),hG=l.object({agent:l.string().trim().min(1).max(253),question:l.string().trim().min(1).max(4000)}),gG=Ee({channel:"a2a:ask:request",request:hG,response:bI,delivery:"request"}),AL=l.object({entityType:l.string().optional(),entityId:l.string().optional(),actor:Ri.optional(),interfaceType:l.string().optional(),userPermissionLevel:l.enum(["admin","trusted","public"])}),yG=l.object({agent:l.string().trim().min(1).max(253),instruction:l.string().trim().min(1).max(2000),selection:l.string().min(1).max(8000),...AL.shape}),bG=Ee({channel:"a2a:call:request",request:yG,response:bI,delivery:"request"}),SG=l.object({agents:l.array(l.object({id:l.string(),label:l.string()}))}),vG=Ee({channel:"a2a:call:agents",request:AL,response:SG,delivery:"request"})});var wG,RL,xG,_G;var $L=v(()=>{pe();wd();wG=l.object({type:l.literal("event"),event:l.string().min(1),fromState:l.string().min(1).optional()}),RL=l.object({conversationId:l.string().min(1),interfaceType:l.string().min(1),channelId:l.string().min(1).optional(),channelName:l.string().min(1),userPermissionLevel:l.enum(["admin","trusted","public"]),isAnchor:l.boolean(),action:wG}),xG=IL.nullable(),_G=Ee({channel:"agent:action:request",request:RL,response:xG,delivery:"request"})});var OL,EG,CL,kG;var PL=v(()=>{pe();wd();OL=l.object({question:l.string().trim().min(1)}),EG=l.object({faqId:l.string().min(1),faqQuestion:l.string().min(1),answer:l.string().trim().min(1),sources:l.array(zc).default([])}),CL=l.object({hit:EG.optional()}),kG=Ee({channel:"guest:asked-before",request:OL,response:CL,delivery:"collect"})});var IG,zL,NL,O_e,AG,TG;var DL=v(()=>{pe();IG=l.enum(["admin","trusted","public"]),zL=l.object({conversationId:l.string().min(1),message:l.string(),interfaceType:l.string().min(1),channelId:l.string().optional(),channelName:l.string().optional(),userPermissionLevel:IG}),NL=l.object({id:l.string().min(1),source:l.string().min(1),title:l.string().optional(),content:l.string().min(1),provenance:l.record(l.string(),l.unknown()).optional()}),O_e=l.object({items:l.array(NL).default([])}),AG=l.object({items:l.array(l.unknown()).default([]).transform((e)=>e.flatMap((t)=>{let r=NL.safeParse(t);return r.success?[r.data]:[]}))}),TG=Ee({channel:"agent:context:request",request:zL,response:AG,delivery:"collect"})});var RG,$G;var LL=v(()=>{pe();RG=l.strictObject({entityType:l.string().min(1),entityId:l.string().min(1)}),$G=l.strictObject({startedAt:l.string().datetime(),retrieved:l.array(RG).max(50)})});var BL,OG,jL,CG;var ZL=v(()=>{pe();Jh();BL=l.object({actor:Ri}),OG=l.object({userId:l.string().min(1),personId:l.string().min(1),canonicalId:l.string().min(1).optional(),displayName:l.string().min(1),permissionLevel:l.enum(["admin","trusted","public"])}),jL=l.object({principal:OG.nullable()}),CG=Ee({channel:"auth:principal:resolve",request:BL,response:jL,delivery:"request"})});var UL=()=>{};var ML=()=>{};var SI,PG,qL,zG,NG;var FL=v(()=>{pe();SI=l.strictObject({name:l.string().min(1).optional(),address:l.email()}),PG=l.strictObject({personId:l.string().min(1).max(200),displayName:l.string().trim().min(1).max(200),permissionLevel:l.enum(["admin","trusted","public"])}),qL=l.strictObject({messageId:l.string().min(1),sourceRef:l.string().min(1),threadId:l.string().min(1).optional(),from:SI,replyTo:SI.optional(),to:l.array(SI),subject:l.string(),receivedAt:l.iso.datetime(),text:l.string(),html:l.string().min(1).optional(),headers:l.strictObject({listUnsubscribe:l.string().min(1).optional(),autoSubmitted:l.string().min(1).optional(),precedence:l.string().min(1).optional(),inReplyTo:l.string().min(1).optional(),references:l.array(l.string().min(1)).optional()}),sender:PG.optional()}),zG=l.strictObject({}),NG=Ee({channel:"email:inbound",request:qL,response:zG,delivery:"request"})});var DG,LG,KL,vI,BG,JL,jG;var HL=v(()=>{pe();DG=l.strictObject({permissionLevel:l.enum(["admin","trusted","public"])}),LG=l.custom((e)=>typeof AbortSignal<"u"&&e instanceof AbortSignal),KL=l.strictObject({sourceRef:l.string().regex(/^imap:[a-f0-9]{64}$/),actor:DG,signal:LG.optional()}),vI=l.strictObject({name:l.string().trim().min(1).max(300).optional(),address:l.email().max(320)}),BG=l.strictObject({messageId:l.string().trim().min(1).max(2000),from:vI,replyTo:vI.optional(),to:l.array(vI).max(100),subject:l.string().max(1000),receivedAt:l.iso.datetime(),text:l.string().max(1e5),inReplyTo:l.string().trim().min(1).max(2000).optional(),references:l.array(l.string().trim().min(1).max(2000)).max(100),truncated:l.boolean()}),JL=l.discriminatedUnion("kind",[l.strictObject({kind:l.literal("available"),message:BG}),l.strictObject({kind:l.literal("unavailable")})]),jG=Ee({channel:"email:source-read",request:KL,response:JL,delivery:"request"})});var VL=()=>{};var WL=v(()=>{VL()});var ZG;var GL=v(()=>{pe();ZG=l.object({url:l.string(),authToken:l.string().optional()})});var UG;var QL=v(()=>{pe();UG=l.object({success:l.boolean(),entityId:l.string().optional(),error:l.string().optional()})});var YL=()=>{};function Hh(e,t="handler_failed"){let r=t,o;try{if(e!==null&&typeof e==="object"){let n=xd.safeParse(Reflect.get(e,"code"));if(n.success)r=n.data,o=_d.shape.message.safeParse(Reflect.get(e,"publicMessage")).data;else{let i=Reflect.get(e,"name");if(i==="AbortError")r="cancelled";if(i==="TimeoutError")r="deadline_exceeded"}}}catch{}return new $i(r,{cause:e,...o!==void 0?{publicMessage:o}:{}})}var xd,eB=1024,_d,XL,$i;var tB=v(()=>{pe();xd=l.enum(["no_handler","handler_failed","invalid_input","invalid_response","unauthenticated","permission_denied","not_found","conflict","cancelled","deadline_exceeded"]),_d=l.object({code:xd,message:l.string().max(eB)}),XL={no_handler:"No handler is available for this capability",handler_failed:"The operation failed",invalid_input:"Invalid input",invalid_response:"Invalid response",unauthenticated:"Authentication required",permission_denied:"Permission denied",not_found:"Not found",conflict:"The operation conflicts with the current state",cancelled:"The operation was cancelled",deadline_exceeded:"The execution deadline was exceeded"};$i=class $i extends Error{code;publicMessage;constructor(e,t={}){let r=xd.parse(e),o=_d.shape.message.parse(t.publicMessage??XL[r]);super(t.message??o,{cause:t.cause});this.name="SdkError",this.code=r,this.publicMessage=o}toJSON(){let e=xd.safeParse(this.code),t=e.data??"handler_failed",r=e.success?_d.shape.message.safeParse(this.publicMessage).data:void 0;return{code:t,message:r??XL[t]}}}});var Vh,Wh;var wI=v(()=>{pe();Vh=l.lazy(()=>l.union([l.null(),l.boolean(),l.number().finite().refine((e)=>!Number.isInteger(e)||Number.isSafeInteger(e),{message:"integer exceeds the JSON-safe range"}),l.string(),l.array(Vh),l.record(l.string(),Vh)])),Wh=l.record(l.string(),Vh)});var MG;var rB=v(()=>{pe();MG=l.enum(["user","assistant"])});var qG,Eo;var nB=v(()=>{pe();qG=l.object({entityType:l.string().min(1),entityId:l.string().min(1),contentHash:l.string().min(1).optional()}),Eo=l.object({rootJobId:l.string().min(1),causationId:l.string().min(1),projectionId:l.string().min(1).optional(),projectionLineage:l.array(l.string().min(1)),sourceEntity:qG.optional(),derivationDepth:l.number().int().nonnegative()}).superRefine((e,t)=>{if(e.derivationDepth!==e.projectionLineage.length)t.addIssue({code:"custom",path:["derivationDepth"],message:"Derivation depth must equal projection lineage length"});let r=e.projectionLineage.at(-1);if(e.projectionId!==r)t.addIssue({code:"custom",path:["projectionId"],message:"Current projection must equal the final projection lineage entry"})})});var xI=10,oB=82,_I,FG,KG,JG,HG,VG,WG;var iB=v(()=>{pe();_I=l.object({title:l.string().min(1).max(200),lines:l.array(l.string().min(1)).min(1).max(xI),actions:l.array(l.object({label:l.string().min(1).max(80),value:l.string().min(1).max(oB)})).max(xI)}),FG=_I.extend({channelId:l.string().min(1),interfaceType:l.string().min(1),reactions:l.array(l.object({messageId:l.string().min(1),emoji:l.string().min(1)}))}),KG=l.object({messageId:l.string().min(1)}),JG=l.object({conversationId:l.string().min(1),noticeMessageId:l.string().min(1),value:l.string().min(1),by:l.string().min(1)}),HG=Ee({channel:"chat:space-notice",request:FG,response:KG,delivery:"request"}),VG=_I.nullable(),WG=Ee({channel:"chat:space-notice-action",request:JG,response:VG,delivery:"collect"})});function Oi(e,t){return Object.freeze({name:e,schema:t})}var gEe;var EI=v(()=>{pe();gEe=l.object({name:l.string(),schema:l.custom((e)=>typeof e==="object"&&e!==null&&("safeParse"in e))})});var kI,II,GG,QG,YG,XG;var sB=v(()=>{pe();EI();kI={progress:"job-progress"},II={completed:"publish:completed",failed:"publish:failed"},GG=l.object({entityType:l.string().min(1),entityId:l.string().min(1),result:l.object({id:l.string(),url:l.string().optional()})}),QG=l.object({entityType:l.string().min(1),entityId:l.string().min(1),error:l.string(),retryCount:l.number(),willRetry:l.boolean()}),YG=Oi(II.completed,GG),XG=Oi(II.failed,QG)});var aB,cB,eQ;var lB=v(()=>{pe();aB=l.object({entityType:l.string().min(1),entityId:l.string(),metadata:l.record(l.string(),l.unknown()).default({}),content:l.string().default("")}),cB=l.object({relativePath:l.string(),leaf:l.object({start:l.number().int().nonnegative(),end:l.number().int().nonnegative()}).nullable(),owner:l.object({entityType:l.string(),id:l.string()}).optional(),writable:l.boolean().optional()}),eQ=Ee({channel:"sync:path:request",request:aB,response:cB,delivery:"request"})});var tQ,rQ,nQ,oQ;var uB=v(()=>{pe();tQ=l.strictObject({}),rQ=l.object({branch:l.string(),hasChanges:l.boolean(),ahead:l.number(),behind:l.number(),lastCommit:l.string().nullable(),remote:l.string().nullable()}),nQ=l.object({syncPath:l.string(),isInitialized:l.boolean(),watchEnabled:l.boolean(),lastSync:l.string().nullable(),totalFiles:l.number(),byEntityType:l.record(l.string(),l.number()),git:rQ.nullable(),managementUrl:l.string().optional()}),oQ=Ee({channel:"sync:status:request",request:tQ,response:nQ,delivery:"request"})});var dB=()=>{};var fB,iQ,sQ;var pB=v(()=>{pe();fB=l.strictObject({waveId:l.string().trim().min(1),sourceTypes:l.array(l.string().trim().min(1)),changedTargetTypes:l.array(l.string().trim().min(1))}),iQ=l.strictObject({}),sQ=Ee({channel:"projection:wave-ready",request:fB,response:iQ,delivery:"collect"})});var aQ,cQ,lQ;var mB=v(()=>{pe();aQ=l.strictObject({}),cQ=l.string(),lQ=Ee({channel:"plugin:site-builder:head-scripts",request:aQ,response:cQ,delivery:"collect"})});function hB(e){return typeof e==="function"}var gB=".site-build-manifest.json",uQ,dQ,fQ,pQ;var yB=v(()=>{pe();uQ=`/${gB}`,dQ=Ee({channel:"site:build:requested",request:l.object({reason:l.string().min(1)}),response:l.void(),delivery:"command"});fQ=l.object({outputDir:l.string(),environment:l.enum(["preview","production"]),routesBuilt:l.number(),siteConfig:l.object({title:l.string().optional(),description:l.string().optional(),url:l.string().optional(),copyright:l.string().optional(),themeMode:l.enum(["light","dark"]).optional()}),generateEntityUrl:l.custom(hB),reportFailure:l.custom(hB)}),pQ=Ee({channel:"site:build:staging",request:fQ,response:l.void(),delivery:"command"})});var mQ,hQ,gQ;var bB=v(()=>{pe();mQ=l.object({id:l.string().min(1),trigger:l.string().min(1),playbookId:l.string().min(1),once:l.boolean().default(!0),starterText:l.string().min(1),description:l.string().min(1).optional(),starterPrompt:l.string().min(1)}).strict(),hQ=l.object({registered:l.boolean(),id:l.string(),ignored:l.boolean().optional(),reason:l.string().optional()}),gQ=Ee({channel:"playbooks:register-lifecycle-starter",request:mQ,response:hQ,delivery:"request"})});var yQ,bQ,SQ;var SB=v(()=>{pe();yQ=l.object({id:l.string().min(1),markdown:l.string().min(1)}).strict(),bQ=l.object({created:l.boolean()}),SQ=Ee({channel:"playbooks:seed",request:yQ,response:bQ,delivery:"request"})});var vB,Gh,AI,wB,xB,vQ,wQ;var _B=v(()=>{pe();vB=["name","headline","industry","location","website","story"],Gh=l.enum(vB),AI=l.object({name:l.string().optional(),headline:l.string().optional(),industry:l.string().optional(),location:l.string().optional(),website:l.string().optional(),story:l.string().optional()}),wB=l.enum(["fill","preserve","unchanged"]),xB=l.object({field:Gh,current:l.string().nullable(),imported:l.string(),outcome:wB}),vQ=Ee({channel:"@brains/profile:import-preview",request:l.object({fields:AI}),response:l.object({fields:l.array(xB),changed:l.boolean(),revision:l.string()}),delivery:"request"}),wQ=Ee({channel:"@brains/profile:import-apply",request:l.object({fields:AI,revision:l.string()}),response:l.object({filled:l.array(Gh),kept:l.array(Gh)}),delivery:"request"})});function EQ(e){return typeof e==="object"&&e!==null&&"name"in e&&typeof e.name==="string"&&"publish"in e&&typeof e.publish==="function"}var xQ,_Q,kQ,IQ,AQ,TQ,EB,RQ;var kB=v(()=>{pe();xQ=l.enum(["provider"]),_Q=l.object({executionMode:xQ.optional(),publishResultIdField:l.string().min(1).optional(),publishTimestampField:l.string().min(1).optional(),enabled:l.boolean().optional()}).strict();kQ=l.custom(EQ),IQ=l.object({entityType:l.string(),provider:kQ.optional(),config:_Q.optional()}),AQ=Ee({channel:"publish:register",request:IQ,response:l.void(),delivery:"command"}),TQ=l.union([l.string().min(1),l.object({location:l.enum(["metadata","frontmatter"]),field:l.string().min(1)})]),EB=l.object({entityType:l.string().min(1),attachmentType:l.string().min(1),mediaEntityType:l.enum(["image"]),targetEntityField:TQ.optional(),requiredWhen:l.object({status:l.string().min(1).optional(),visibility:l.string().min(1).optional()}).optional(),autoGenerate:l.boolean().optional(),requiredForPublish:l.boolean().optional()}),RQ=Ee({channel:"publish-assets:register",request:EB,response:l.void(),delivery:"command"})});var $Q,OQ,CQ,PQ,zQ,NQ;var IB=v(()=>{pe();$Q=l.object({entityType:l.string()}),OQ=Ee({channel:"generate:execute",request:$Q,response:l.void(),delivery:"command"}),CQ=l.object({entityType:l.string(),entityId:l.string()}),PQ=Ee({channel:"generate:report:success",request:CQ,response:l.void(),delivery:"command"}),zQ=l.object({entityType:l.string(),error:l.string()}),NQ=Ee({channel:"generate:report:failure",request:zQ,response:l.void(),delivery:"command"})});var DQ,AB,TB,RB;var $B=v(()=>{pe();DQ=l.object({message:l.string().describe("Natural language response to the query"),summary:l.string().optional().describe("Brief summary if applicable"),topics:l.array(l.string()).optional().describe("Related topics mentioned"),sources:l.array(l.object({id:l.string(),type:l.string(),excerpt:l.string().optional(),relevance:l.number().min(0).max(1).optional()})).optional().describe("Source entities used to answer the query"),metadata:l.record(l.string(),l.unknown()).optional()}).describe("defaultQueryResponse"),AB=l.object({message:l.string()}).describe("simpleTextResponse"),TB=l.object({success:l.boolean(),entityId:l.string().optional(),message:l.string()}).describe("createEntityResponse"),RB=l.object({success:l.boolean(),entityId:l.string(),changes:l.array(l.string()).optional(),message:l.string()}).describe("updateEntityResponse")});var OB,CB,LQ,PB,zB,BQ;var NB=v(()=>{pe();OB=l.discriminatedUnion("type",[l.strictObject({type:l.literal("email"),address:l.email()})]),CB=l.strictObject({recipient:OB.optional(),title:l.string().min(1),body:l.string().min(1),html:l.string().min(1).optional(),sensitivity:l.enum(["normal","secret"]).default("normal"),idempotencyKey:l.string().trim().min(1).max(200).optional(),replyTo:l.email().optional()}),LQ=l.enum(["recipient-missing","transport-missing","delivery-failed"]),PB=l.string().regex(/^[a-z0-9_:.-]{1,80}$/u),zB=l.discriminatedUnion("status",[l.strictObject({status:l.literal("sent"),deliveryId:l.string().optional()}),l.strictObject({status:l.literal("failed"),failure:LQ,transportCode:PB.optional()})]),BQ=Ee({channel:"notifications:send",request:CB,response:zB,delivery:"request"})});var jQ,DB,ZQ;var LB=v(()=>{pe();jQ=l.strictObject({}),DB=l.strictObject({titles:l.array(l.string().trim().min(1).max(500)).max(20)}),ZQ=Ee({channel:"topics:public-titles",request:jQ,response:DB,delivery:"request"})});var UQ,MQ,qQ;var BB=v(()=>{pe();UQ=l.strictObject({}),MQ=l.strictObject({types:l.array(l.string().trim().min(1))}),qQ=Ee({channel:"topics:source-types",request:UQ,response:MQ,delivery:"request"})});var jB,ZB,FQ;var UB=v(()=>{pe();jB=l.strictObject({id:l.string().regex(/^[a-z0-9][a-z0-9-]{0,79}$/),title:l.string().trim().min(1).max(200),body:l.string().trim().min(1).max(20000)}),ZB=l.strictObject({noteId:l.string(),created:l.boolean()}),FQ=Ee({channel:"note:capture",request:jB,response:ZB,delivery:"request"})});var Nc,Ed,KQ,JQ,HQ,VQ,WQ,GQ;var MB=v(()=>{pe();wI();Nc=l.string().regex(/^[a-z][a-z0-9-]{0,63}$/),Ed=l.string().min(32).max(512),KQ=l.strictObject({provider:Nc,brainState:Ed}),JQ=l.strictObject({authorizationUrl:l.url({protocol:/^https?$/})}),HQ=l.strictObject({provider:Nc,grant:Ed}),VQ=l.strictObject({provider:Nc,credential:Wh}),WQ=l.enum(["provider_denied","authorization_incomplete","credential_exchange_failed"]),GQ=l.union([l.strictObject({provider:Nc,state:Ed,grant:Ed}),l.strictObject({provider:Nc,state:Ed,error:WQ})])});var QQ,YQ,XQ,eY;var qB=v(()=>{pe();QQ=l.object({permissionLevel:l.enum(["public","trusted","admin"])}),YQ=l.object({id:l.string().min(1),title:l.string().min(1),sub:l.string().optional(),href:l.string().min(1),primary:l.boolean().optional(),keywords:l.array(l.string()).optional()}),XQ=l.array(YQ),eY=Ee({channel:"console:jump-destinations",request:QQ,response:XQ,delivery:"collect"})});var Qh,TI;var FB=v(()=>{pe();Qh=l.enum(["github","instagram","linkedin","podcast","email","website"]),TI=l.object({platform:Qh.describe("Social media platform"),url:l.string().describe("Profile or contact URL"),label:l.string().optional().describe("Optional display label")})});function Yh(e){if(!e.type.includes(":"))throw Error(`Job contract type "${e.type}" must name its owner, as "owner:job"`);return Object.freeze({type:e.type,input:e.input})}var KB,JB,tY,HB,rY;var VB=v(()=>{pe();KB=l.enum(["1:1","16:9","9:16","4:3","3:4"]),JB=l.object({prompt:l.string(),title:l.string().optional(),aspectRatio:KB.optional(),targetEntityType:l.string().optional(),targetEntityId:l.string().optional(),entityTitle:l.string().optional(),entityContent:l.string().optional()}),tY=Yh({type:"image:image-generate",input:JB}),HB=l.object({sourceEntityType:l.string().min(1),sourceEntityId:l.string().min(1),attachmentType:l.string().min(1),imageId:l.string().min(1),dedupKey:l.string().min(1).optional(),replace:l.boolean().optional(),targetEntityType:l.string().min(1).optional(),targetEntityId:l.string().min(1).optional(),targetImageField:l.enum(["coverImageId","ogImageId"]).optional()}),rY=Yh({type:"image:image-render-source",input:HB})});var nY;var WB=v(()=>{pe();nY=l.enum(["none","low","medium","high","xhigh","max"])});var Ot=v(()=>{dI();cL();gI();TL();$L();wd();PL();DL();LL();Jh();ZL();UL();ML();FL();HL();WL();GL();QL();YL();tB();wI();rB();nB();iB();sB();EI();lB();uB();dB();pB();mI();mB();yB();bB();SB();_B();kB();IB();$B();NB();LB();BB();UB();MB();qB();FB();VB();WB()});var aY,cY,Ct,br,Vs,lY,Ws="capability-bundles-v1",RI,uY,dY,fY,pY,GB,Xh,Gs,mn,mY,hY,gY,yY,bY,$I,SY,vY,eg;var ko=v(()=>{Ot();pe();aY=/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?$/,cY=/^[a-z0-9]+(?:-[a-z0-9]+)*$/,Ct=l.string().regex(aY,"expected exact pinned version"),br=l.string().regex(cY,"expected lowercase handle slug"),Vs=l.string().min(1),lY=l.string().startsWith("age1").min(1),RI=l.enum(["core","media","automation","web","chat","site","publishing","federation","team"]),uY=["professional","team","organization"],dY=l.enum(uY),fY=["person","team","organization"],pY=l.enum(fY),GB=l.array(RI).min(1),Xh=l.array(l.string().min(1)),Gs=l.strictObject({brainVersion:Ct,bundleContract:l.literal(Ws),bundles:GB,add:Xh.optional(),remove:Xh.optional(),githubOrg:l.string().min(1),contentRepoPrefix:l.string().min(1),domainSuffix:l.string().min(1),openaiApiKey:Vs,gitSyncToken:Vs,contentRepoAdminToken:Vs,agePublicKey:lY}).superRefine((e,t)=>{if(new Set(e.bundles).size!==e.bundles.length)t.addIssue({code:l.ZodIssueCode.custom,path:["bundles"],message:"canonical bundles must be unique"})}),mn=l.strictObject({members:l.array(br).min(1),brainVersionOverride:Ct.optional(),bundlesOverride:GB.optional(),addOverride:Xh.optional(),removeOverride:Xh.optional(),openaiApiKeyOverride:Vs.optional(),gitSyncTokenOverride:Vs.optional()}).superRefine((e,t)=>{if(new Set(e.members).size!==e.members.length)t.addIssue({code:l.ZodIssueCode.custom,path:["members"],message:"cohort members must be unique"});if(e.bundlesOverride&&new Set(e.bundlesOverride).size!==e.bundlesOverride.length)t.addIssue({code:l.ZodIssueCode.custom,path:["bundlesOverride"],message:"canonical bundle overrides must be unique"})}),mY=l.strictObject({platform:Qh,url:l.string().min(1),label:l.string().min(1).optional()}),hY=l.strictObject({name:l.string().min(1).optional(),description:l.string().min(1).optional(),website:l.string().min(1).optional(),email:l.string().min(1).optional(),story:l.string().min(1).optional(),socialLinks:l.array(mY).optional()}),gY=l.strictObject({delivery:l.literal("email"),email:l.string().email()}),yY=l.strictObject({enabled:l.boolean().optional(),endpoint:l.string().url().refine((e)=>new URL(e).protocol==="wss:",{message:"Jetstream endpoint must use wss"}).optional(),replayWindowSeconds:l.number().int().min(60).optional(),denyDids:l.array(l.string().startsWith("did:plc:")).optional(),denyDomains:l.array(l.string().min(1)).optional(),skillKeywords:l.array(l.string().min(1)).optional(),queueLimit:l.number().int().min(1).max(1e4).optional(),concurrency:l.number().int().min(1).max(32).optional(),perDidCooldownSeconds:l.number().int().nonnegative().optional(),fetchBudgetPerMinute:l.number().int().min(1).optional(),newAgentsPerHour:l.number().int().min(1).optional(),pendingCandidateCeiling:l.number().int().min(1).optional(),staleCandidateRetentionDays:l.number().int().min(1).optional(),requestTimeoutMs:l.number().int().min(100).optional(),maxResponseBytes:l.number().int().min(1024).optional(),maxRedirects:l.number().int().nonnegative().optional(),retryAttempts:l.number().int().min(1).optional(),heartbeatIntervalHours:l.number().min(1).optional()}),bY=l.strictObject({identifier:l.string().min(1),accountDid:l.string().min(1).optional(),lexiconAuthority:l.boolean().optional(),jetstream:yY.optional()}),$I=l.strictObject({package:l.string().min(1),version:Ct.optional(),theme:l.string().min(1).optional(),themeVersion:Ct.optional()}).superRefine((e,t)=>{let r=e.package.startsWith("@rizom/");if(r&&e.version===void 0)t.addIssue({code:l.ZodIssueCode.custom,path:["version"],message:"external @rizom site packages require an exact version pin"});if(!r&&e.version!==void 0)t.addIssue({code:l.ZodIssueCode.custom,path:["version"],message:"version is valid only for external @rizom site packages"});let o=e.theme?.startsWith("@rizom/")===!0;if(o&&e.themeVersion===void 0)t.addIssue({code:l.ZodIssueCode.custom,path:["themeVersion"],message:"external @rizom themes require an exact version pin"});if(!o&&e.themeVersion!==void 0)t.addIssue({code:l.ZodIssueCode.custom,path:["themeVersion"],message:"themeVersion is valid only for external @rizom themes"})}),SY=l.strictObject({onboarding:l.boolean().optional()}),vY=l.record(l.string().min(1),l.record(l.string(),l.unknown())),eg=l.strictObject({handle:br,discord:l.strictObject({enabled:l.boolean(),anchorUserId:l.string().min(1).optional()}),openaiApiKeyOverride:Vs.optional(),gitSyncTokenOverride:Vs.optional(),domainOverride:l.string().min(1).optional(),cloudflareZoneId:l.string().min(1).optional(),contentRepoOverride:l.string().min(1).optional(),profileKind:dY.optional(),anchorKind:pY.optional(),plugins:vY.optional(),spaces:l.array(l.string().min(1)).optional(),embeddingEnabled:l.boolean().optional(),embeddingModel:l.string().optional(),topicExtractionEnabled:l.boolean().optional(),skillDerivationEnabled:l.boolean().optional(),swotDerivationEnabled:l.boolean().optional(),addOverride:l.array(l.string().min(1)).optional(),removeOverride:l.array(l.string().min(1)).optional(),siteOverride:$I.optional(),setup:gY.optional(),atproto:bY.optional(),playbooks:SY.optional(),anchorProfile:hY.optional()})});import{access as wY,readdir as xY,readFile as _Y}from"fs/promises";import{basename as OI,join as kd,relative as EY}from"path";async function wt(e,t={}){let[r,o,n]=await Promise.all([CI(kd(e,"pilot.yaml"),Gs),IY(e),AY(e)]),i=TY(o,n),s=n.map((c)=>({id:c.id,members:[...c.data.members].sort(),...Tc({brainVersionOverride:c.data.brainVersionOverride,bundlesOverride:c.data.bundlesOverride,addOverride:c.data.addOverride,removeOverride:c.data.removeOverride,openaiApiKeyOverride:c.data.openaiApiKeyOverride,gitSyncTokenOverride:c.data.gitSyncTokenOverride})})).sort((c,u)=>c.id.localeCompare(u.id)),a=await Promise.all(o.map(async(c)=>{let u=i.get(c.data.handle);if(!u)throw new Qs(`User ${c.data.handle} must belong to exactly one cohort`);let d={...kY(c.data,u,r),snapshotStatus:await OY(e,c.data.handle)},f=await t.resolveStatus?.(d);return{...d,serverStatus:f?.serverStatus??"unknown",deployStatus:f?.deployStatus??"unknown",dnsStatus:f?.dnsStatus??"unknown",mcpStatus:f?.mcpStatus??"unknown"}}));return a.sort((c,u)=>c.handle.localeCompare(u.handle)),{pilot:r,cohorts:s,users:a}}function kY(e,t,r){let o=t.data.bundlesOverride===void 0;return{handle:e.handle,cohort:t.id,brainVersion:t.data.brainVersionOverride??r.brainVersion,bundleContract:r.bundleContract,bundles:[...t.data.bundlesOverride??r.bundles],add:QB(t.data.addOverride??(o?r.add:void 0),e.addOverride),remove:QB(t.data.removeOverride??(o?r.remove:void 0),e.removeOverride),domain:e.domainOverride??`${e.handle}${r.domainSuffix}`,...Tc({cloudflareZoneId:e.cloudflareZoneId}),contentRepo:e.contentRepoOverride??`${r.contentRepoPrefix}${e.handle}-content`,...Tc({profileKind:e.profileKind,anchorKind:e.anchorKind,embeddingEnabled:e.embeddingEnabled,embeddingModel:e.embeddingModel,spaces:e.spaces,plugins:e.plugins,topicExtractionEnabled:e.topicExtractionEnabled,skillDerivationEnabled:e.skillDerivationEnabled,swotDerivationEnabled:e.swotDerivationEnabled,siteOverride:e.siteOverride&&{...e.siteOverride}}),discordEnabled:e.discord.enabled,...Tc({discordAnchorUserId:e.discord.anchorUserId}),effectiveOpenaiApiKey:e.openaiApiKeyOverride??t.data.openaiApiKeyOverride??r.openaiApiKey,effectiveGitSyncToken:e.gitSyncTokenOverride??t.data.gitSyncTokenOverride??r.gitSyncToken,...Tc({setup:e.setup,atproto:e.atproto,playbooks:e.playbooks}),anchorProfile:RY(e.handle,e.anchorProfile)}}function QB(e,t){return CY([...e??[],...t??[]])}async function IY(e){let t=kd(e,"users"),r=(await YB(t)).filter((n)=>!OI(n).endsWith(".secrets.yaml"));return(await Promise.all(r.map(async(n)=>{let i=XB(OI(n)),s=await CI(n,eg);if(s.handle!==i){let a=ej(EY(e,n));throw new Qs(`${a} must declare handle: ${i}`)}return{id:i,data:s}}))).sort((n,i)=>n.id.localeCompare(i.id))}async function AY(e){let t=kd(e,"cohorts"),r=await YB(t);return(await Promise.all(r.map(async(n)=>({id:XB(OI(n)),data:await CI(n,mn)})))).sort((n,i)=>n.id.localeCompare(i.id))}function TY(e,t){let r=new Map(e.map((n)=>[n.data.handle,n])),o=new Map;for(let n of t)for(let i of n.data.members){if(!r.has(i))throw new Qs(`Cohort ${n.id} references unknown user ${i}`);if(o.has(i))throw new Qs(`User ${i} must belong to exactly one cohort`);o.set(i,n)}for(let n of e)if(!o.has(n.data.handle))throw new Qs(`User ${n.data.handle} must belong to exactly one cohort`);return o}function RY(e,t){return{name:t?.name??$Y(e),...t?.description?{description:t.description}:{},...t?.website?{website:t.website}:{},...t?.email?{email:t.email}:{},...t?.story?{story:t.story}:{},...t?.socialLinks?{socialLinks:t.socialLinks.map((r)=>({platform:r.platform,url:r.url,...r.label?{label:r.label}:{}}))}:{}}}function $Y(e){return e.split("-").filter((t)=>t.length>0).map((t)=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}async function OY(e,t){let r=kd(e,"users",t,"brain.yaml");try{return await wY(r),"present"}catch{return"missing"}}async function YB(e){return(await xY(e,{withFileTypes:!0})).filter((r)=>r.isFile()&&r.name.endsWith(".yaml")).map((r)=>kd(e,r.name)).sort((r,o)=>r.localeCompare(o))}async function CI(e,t){let r=await _Y(e,"utf8"),o=yr(r,t);if(!o.ok)throw new Qs(`${ej(e)}: ${o.error}`);return o.data}function CY(e){return[...new Set(e)]}function XB(e){return e.replace(/\.ya?ml$/,"")}function ej(e){return e.replaceAll("\\","/")}var Qs;var hn=v(()=>{Hn();ko();Qs=class Qs extends Error{}});import{mkdir as BY,writeFile as jY}from"fs/promises";import{join as oj}from"path";async function Ci(e,t={}){let o=(t.registry??await wt(e,t)).users.map((i)=>{let s=i.discordEnabled?"on":"off";return[i.handle,i.cohort,i.bundles.join(","),i.add.join(","),i.remove.join(","),i.brainVersion,i.domain,i.contentRepo,s,i.serverStatus,i.deployStatus,i.dnsStatus,i.mcpStatus]}),n=["<!-- generated by brains-ops; do not edit -->","",ZY,UY,...o.map((i)=>`| ${i.join(" | ")} |`),""].join(`
|
|
251
|
+
`);await BY(oj(e,"views"),{recursive:!0}),await jY(oj(e,"views","users.md"),n)}var ZY="| handle | cohort | bundles | add | remove | brainVersion | domain | contentRepo | discord | serverStatus | deployStatus | dnsStatus | mcpStatus |",UY="| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |";var Id=v(()=>{hn()});var lj=v(()=>{Un()});function Ad(e){if(e===null||typeof e!=="object"||Array.isArray(e))return!1;let t=lX(e);return t===Object.prototype||t===null}function uX(e){return e instanceof Error&&"code"in e&&typeof e.code==="string"}function rg(e){return uX(e)&&e.code==="ENOENT"}var lX;var Td=v(()=>{lX=Object.getPrototypeOf});import{lstat as LI,mkdir as uj,readFile as dj,unlink as dX,writeFile as fj}from"fs/promises";import{join as gn}from"path";import{isDeepStrictEqual as fX}from"util";function gj(e){return gn("deploy","runtime",pX.parse(e.tag))}function yj(e){let t={"@rizom/brain":Ct.parse(e.brainVersion)};for(let r of[...e.sitePackages].sort()){let o=r.lastIndexOf("@"),n=mj.parse(r.slice(0,o)),i=Ct.parse(r.slice(o+1));if(t[n]!==void 0&&t[n]!==i)throw Error(`Conflicting runtime dependency pin: ${r}`);t[n]=i}return hj.parse({name:"rover-pilot-runtime",private:!0,packageManager:"bun@1.4.0",dependencies:t,overrides:{"postcss-selector-parser":"7.1.6"}})}async function BI(e){try{return await LI(e),!0}catch(t){if(rg(t))return!1;throw t}}async function pj(e){if(!(await LI(e)).isFile())throw Error(`Runtime lock input must be a regular file: ${e}`)}async function bj(e){if(!(await LI(e)).isDirectory())throw Error(`Runtime lock input must be a directory: ${e}`)}async function Sj(e){for(let t of["deploy",gn("deploy","runtime")]){let r=gn(e,t);if(await BI(r))await bj(r)}}async function DI(e,t){let r=gn(e,"package.json"),o=gn(e,"bun.lock");await pj(r),await pj(o);let n=hj.parse(JSON.parse(await dj(r,"utf8")));if(!fX(n,yj(t)))throw Error(`Runtime dependency manifest does not match ${t.tag}`);if(!(await dj(o,"utf8")).trim())throw Error(`Empty runtime dependency lock: ${o}`)}async function vj(e,t){await Sj(e);let r=gn(e,gj(t));if(await bj(r),await BI(gn(r,".incomplete")))throw Error(`Incomplete runtime dependency lock: ${r}`);await DI(r,t)}async function wj(e,t,r=tr){if(Bun.version!=="1.4.0")throw Error("Runtime dependency locks must be generated with Bun 1.4.0");let o=yj(t);await Sj(e);let n=gn(e,gj(t));if(await BI(n))return await vj(e,t),"existing";await uj(gn(e,"deploy","runtime"),{recursive:!0}),await uj(n);let i=gn(n,".incomplete");return await fj(i,`Runtime dependency resolution has not completed.
|
|
252
|
+
`,{flag:"wx"}),await fj(gn(n,"package.json"),`${JSON.stringify(o,null,2)}
|
|
253
|
+
`,{flag:"wx"}),await r(process.execPath,["install","--lockfile-only","--ignore-scripts"],{cwd:n}),await DI(n,t),await r(process.execPath,["install","--frozen-lockfile","--ignore-scripts","--dry-run"],{cwd:n}),await DI(n,t),await dX(i),"created"}var pX,mj,hj;var jI=v(()=>{Td();pe();ko();Un();pX=l.string().regex(/^[a-zA-Z0-9_][a-zA-Z0-9_.-]{0,127}$/),mj=l.string().regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/),hj=l.strictObject({name:l.literal("rover-pilot-runtime"),private:l.literal(!0),packageManager:l.literal("bun@1.4.0"),dependencies:l.record(mj,Ct),overrides:l.strictObject({"postcss-selector-parser":l.literal("7.1.6")})})});import{createHash as mX}from"crypto";function ng(e,t=[]){let r=`brain-${e}`,o=[...new Set(t)].sort();if(o.length===0)return r;let n=`${r}--${o.map((a)=>a.replace(/^@/,"").replace("/","-").replace(/@(?=[^@]*$)/,"-")).join("--")}`,s=`--s${mX("sha256").update(JSON.stringify([e,...o])).digest("hex").slice(0,12)}`;return`${n.length+s.length<=hX?n:r}${s}`}function ZI(e){if(!e)return[];return[xj(e.package,e.version),xj(e.theme,e.themeVersion)].filter((t)=>t!==void 0)}function xj(e,t){if(!e?.startsWith("@rizom/"))return;if(t===void 0)throw Error(`Package ${e} has no explicit version pin`);return`${e}@${t}`}function gX(e){let t=new Map;for(let r of e){let o=[...new Set(ZI(r.siteOverride))].sort(),n=ng(r.brainVersion,o),i=t.get(n);if(i&&(i.brainVersion!==r.brainVersion||!Bun.deepEquals(i.sitePackages,o)))throw Error(`Image tag collision for distinct runtime requirements: ${n}`);t.set(n,{tag:n,brainVersion:r.brainVersion,sitePackages:o})}return[...t.values()].sort((r,o)=>r.tag.localeCompare(o.tag))}function yX(e,t){let r=new Map;for(let o of[...e,...t]){let n=o.lastIndexOf("@"),i=n>0?o.slice(0,n):o,s=r.get(i);if(s&&s!==o)throw Error(`Fleet shared images have conflicting pins for ${i}: ${s} and ${o}`);r.set(i,o)}return[...r.values()].sort()}async function _j(e){let t=e.brainVersionInput?.trim()??"";if(t){let o=yX([],(e.sitePackagesInput??"").split(/\s+/).filter(Boolean)),n=ng(t,o);if(!e.allowTagOverwrite&&await e.imageExists(n))throw Error(`Image tag ${n} already exists; published tags are immutable. Pick a new version, or pass overwrite=true only when replacing a tag whose containers were never deployed.`);return[{tag:n,brainVersion:t,sitePackages:o}]}let r=[];for(let o of gX(e.users))if(!await e.imageExists(o.tag))r.push(o);else await e.verifyImage(o);return r}var hX=128;var UI=v(()=>{lj();jI();hn();Un()});function MI(e,t){let r=e.indexOf("/");if(r===-1)return{org:t,name:e};return{org:e.slice(0,r),name:e.slice(r+1)}}function Aj(e,t){let{org:r,name:o}=MI(e,t);return`${r}/${o}`}import{mkdtemp as wX,mkdir as xX,readFile as _X,rm as EX,writeFile as kX}from"fs/promises";import{tmpdir as IX}from"os";import{dirname as AX,join as $j}from"path";async function Oj(e,t,r,o,n={}){if(o.length===0)return;let i=n.env??process.env,s=Dr(e),a=Tj(i,s,r.effectiveGitSyncToken),c=n.contentRepoAdminTokenSelector?Tj(i,s,n.contentRepoAdminTokenSelector):void 0,u=MI(r.contentRepo,t),d=n.contentRepoRemoteResolver?.(r,t,a)??OX(u,a);if(!d)return;let f=await wX($j(IX(),`brains-ops-content-sync-${r.handle}-`)),m=n.runCommand??tr,h=n.fetchImpl??fetch;try{if(!n.contentRepoRemoteResolver){if(!c)throw Error(`${n.contentRepoAdminTokenSelector??"CONTENT_REPO_ADMIN_TOKEN"} is required to check or create content repos`);await CX(u,c,h)}await m("git",["clone",d,f]),await PX(f,m),await m("git",["config","user.name","brains-ops[bot]"],{cwd:f}),await m("git",["config","user.email","41898282+github-actions[bot]@users.noreply.github.com"],{cwd:f});let b=!1;for(let y of o)if(await RX(f,y))b=!0;if(!b)return;await m("git",["add","."],{cwd:f}),await m("git",["commit","-m",`chore(content): seed ${r.handle} anchor profile`],{cwd:f}),await m("git",["push","origin","HEAD:main"],{cwd:f})}finally{await EX(f,{recursive:!0,force:!0})}}async function RX(e,t){let r=$j(e,t.path),o=await _X(r,"utf8").catch(()=>{return});if(o===t.content)return!1;if(o!==void 0&&!$X(o))return!1;return await xX(AX(r),{recursive:!0}),await kX(r,t.content),!0}function $X(e){return TX.some((t)=>e.includes(t))}function Tj(e,t,r){return jt(r,e,t)}function OX(e,t){if(!t)return;return`https://x-access-token:${encodeURIComponent(t)}@github.com/${e.org}/${e.name}.git`}async function CX(e,t,r){let{org:o,name:n}=e,s=`https://api.github.com/repos/${`${encodeURIComponent(o)}/${encodeURIComponent(n)}`}`,a={Accept:"application/vnd.github+json",Authorization:`Bearer ${t}`,"User-Agent":"brains-ops","X-GitHub-Api-Version":"2022-11-28"},c=await r(s,{headers:a});if(c.ok)return;if(c.status!==404)throw Error(`Failed to check GitHub repo ${o}/${n}: ${c.status} ${await Rj(c)}`);let u=await r(`https://api.github.com/orgs/${encodeURIComponent(o)}/repos`,{method:"POST",headers:a,body:JSON.stringify({name:n,private:!0,auto_init:!1})});if(u.ok){console.log(`Created missing content repo ${o}/${n}`);return}if(u.status===422){if((await r(s,{headers:a})).ok)return}throw Error(`Failed to create GitHub repo ${o}/${n}: ${u.status} ${await Rj(u)}`)}async function Rj(e){let t=await e.text();return t.trim().length===0?e.statusText:t}async function PX(e,t){try{await t("git",["checkout","-B","main","origin/main"],{cwd:e})}catch{await t("git",["checkout","-B","main"],{cwd:e})}}var TX;var Cj=v(()=>{bi();Un();TX=["name: Your Name Here","Delete this and write your own"]});function qI(e,t,r={}){let o={...e};for(let n of Object.keys(t)){let i=t[n];if(i===null&&r.nulls!=="preserve")delete o[n];else if(Ad(o[n])&&Ad(i))o[n]=qI(o[n],i,r);else o[n]=i}return o}var Pj=v(()=>{Td()});function og(e){return async(t)=>({brainYaml:zX(t,e),envFile:LX(t,e),contentRepoFiles:NX(t)})}function zX(e,t){let r={...e.setup?.delivery==="email"?{"auth-service":{setupEmail:e.setup.email},notifications:{defaultRecipient:{type:"email",address:e.setup.email}},email:{transport:"resend",apiKey:"${SETUP_EMAIL_API_KEY}",from:"${SETUP_EMAIL_FROM}"}}:{},...e.playbooks?.onboarding?{onboarding:{enabled:!0}}:{},...e.topicExtractionEnabled!==void 0?{topics:{enableAutoExtraction:e.topicExtractionEnabled}}:{},...e.skillDerivationEnabled!==void 0?{agents:{enableSkillDerivation:e.skillDerivationEnabled}}:{},...e.swotDerivationEnabled!==void 0?{assessment:{enableSwotDerivation:e.swotDerivationEnabled}}:{},"directory-sync":{git:{repo:zj(e,t),authToken:"${GIT_SYNC_TOKEN}"}},...e.atproto?{atproto:{...e.atproto,appPassword:"${ATPROTO_APP_PASSWORD}"}}:{}};return Cc({brain:"brain",bundleContract:e.bundleContract,kind:e.profileKind??"professional",domain:e.domain,bundles:e.bundles,...e.anchorKind?{anchor:e.anchorKind}:{},...e.embeddingEnabled!==void 0?{embedding:{enabled:e.embeddingEnabled}}:{},...e.embeddingModel?{embeddingModel:e.embeddingModel}:{},...e.add.length>0?{add:e.add}:{},...e.remove.length>0?{remove:e.remove}:{},...e.siteOverride?{site:{package:e.siteOverride.package,...e.siteOverride.theme?{theme:e.siteOverride.theme}:{}}}:{},...e.spaces&&e.spaces.length>0?{spaces:e.spaces}:{},anchors:e.discordEnabled&&e.discordAnchorUserId?[`discord:${e.discordAnchorUserId}`]:[],plugins:qI(r,e.plugins??{},{nulls:"preserve"})})}function zj(e,t){return Aj(e.contentRepo,t)}function NX(e){return[{path:"anchor-profile/anchor-profile.md",content:DX(e)}]}function DX(e){let t={name:e.anchorProfile.name,...e.anchorProfile.description?{description:e.anchorProfile.description}:{},...e.anchorProfile.website?{website:e.anchorProfile.website}:{},...e.anchorProfile.email?{email:e.anchorProfile.email}:{},...e.anchorProfile.socialLinks?{socialLinks:e.anchorProfile.socialLinks}:{}},r=e.anchorProfile.story??"This profile was initialized by brains-ops. Edit it in your content repo.";return`---
|
|
254
|
+
${Cc(t).trimEnd()}
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
${r}
|
|
258
|
+
`}function LX(e,t){let r=ZI(e.siteOverride);return[`BRAIN_VERSION=${e.brainVersion}`,...r.length>0?[`IMAGE_TAG=${ng(e.brainVersion,r)}`]:[],`CONTENT_REPO=${zj(e,t)}`,""].join(`
|
|
259
|
+
`)}var FI=v(()=>{Pj();UI();Hn()});import{mkdir as BX,writeFile as jX}from"fs/promises";import{dirname as ZX,join as Nj}from"path";import{isDeepStrictEqual as UX}from"util";async function Lc(e,t,r,o,n={}){let i=og(t.pilot.githubOrg);for(let s of r){let a={};if(o){let m=await o(s);if(m!==void 0)a=m}let c=await i(s),u=a.brainYaml??c.brainYaml,d=a.envFile??c.envFile,f=a.contentRepoFiles??c.contentRepoFiles??[];if(d)await KI(e,s.handle,".env",d);if(u)await KI(e,s.handle,"brain.yaml",u);await Oj(e,t.pilot.githubOrg,s,f,{contentRepoAdminTokenSelector:t.pilot.contentRepoAdminToken,...n});for(let m of f)await KI(e,s.handle,Nj("content",m.path),m.content)}}async function KI(e,t,r,o){let n=Nj(e,"users",t,r),i=Bun.file(n);if(r==="brain.yaml"&&await i.exists()){let s=yr(await i.text()),a=yr(o);if(s.ok&&a.ok&&UX(s.data,a.data))return}await BX(ZX(n),{recursive:!0}),await jX(n,o)}async function ig(e,t){let r=await wt(e),o=r.users.find((n)=>n.handle===t);if(!o)throw Error(`Unknown user handle: ${t}`);return{registry:r,user:o}}async function Dj(e,t){let r=await wt(e),o=r.cohorts.find((n)=>n.id===t);if(!o)throw Error(`Unknown cohort: ${t}`);return{registry:r,users:r.users.filter((n)=>n.cohort===o.id)}}async function Lj(e){let t=await wt(e);return{registry:t,users:t.users}}var Rd=v(()=>{Hn();Cj();FI();hn()});function Fj(e){return Object.keys(e)}import{readFileSync as Od}from"fs";import{access as nee,rm as oee,writeFile as Wj}from"fs/promises";import{join as HI,relative as Kj}from"path";async function Qj(e,t,r={}){let{registry:o,user:n}=await ig(e,t),i=r.env??process.env,s=r.logger??console.log,a=Dr(e),c=HI(e,"users",`${t}.secrets.yaml.age`),u=HI(e,"users",`${t}.secrets.yaml`),d=Vj(Kj(e,c)),f=Vj(Kj(e,u)),m=aee(u),h=await cee(c,e,i,a),b=await Yj(u),y={sharedOpenaiApiKeySelector:o.pilot.openaiApiKey,sharedGitSyncTokenSelector:o.pilot.gitSyncToken,effectiveOpenaiApiKeySelector:n.effectiveOpenaiApiKey,effectiveGitSyncTokenSelector:n.effectiveGitSyncToken,discordEnabled:n.discordEnabled},S;try{S=iee(e,i,a,m,h,y)}catch(z){if(!r.dryRun&&m===void 0&&z instanceof Error){let J=uee(y);if(J.length>0)throw await dee(u,J),Error(`Missing required secrets for ${t}. Created ${f}; fill it in and rerun secrets:encrypt. ${z.message}`,{cause:z})}throw z}let x=`${Cc(S).trimEnd()}
|
|
260
|
+
`;lee(x,S);let _=Fj(S);if(r.dryRun){if(s(`Dry run: would encrypt ${_.length} secrets to ${d}.`),s(_.length>0?`Keys: ${_.join(", ")}`:"Keys: (none \u2014 shared defaults only)"),b)s(`Would remove plaintext file ${f}.`);return{encryptedPath:d,plaintextPath:f,deletedPlaintext:b,encryptedKeys:_,dryRun:!0}}let A=new Iu;A.addRecipient(o.pilot.agePublicKey);let O=await A.encrypt(x),L=hi.encode(O);if(await Wj(c,L),await oee(u,{force:!0}),s(`Encrypted ${_.length} secrets to ${d}.`),b)s(`Removed plaintext file ${f}.`);return{encryptedPath:d,plaintextPath:f,deletedPlaintext:b,encryptedKeys:_}}function iee(e,t,r,o,n,i){let s=Jj(e,t,r,o,n,"openaiApiKey",i.effectiveOpenaiApiKeySelector,i.sharedOpenaiApiKeySelector),a=Jj(e,t,r,o,n,"gitSyncToken",i.effectiveGitSyncTokenSelector,i.sharedGitSyncTokenSelector),c=i.discordEnabled?ag(e,t,r,o,n,"discordBotToken","DISCORD_BOT_TOKEN"):void 0,u=i.discordEnabled?ag(e,t,r,o,n,"discordPublicKey","DISCORD_PUBLIC_KEY"):void 0,d=i.discordEnabled?ag(e,t,r,o,n,"discordApplicationId","DISCORD_APPLICATION_ID"):void 0,f=cg(e,t,r,o,n,"atprotoAppPassword","ATPROTO_APP_PASSWORD"),m=Hj(cg(e,t,r,o,n,"certificatePem","CERTIFICATE_PEM")),h=Hj(cg(e,t,r,o,n,"privateKeyPem","PRIVATE_KEY_PEM"));return Gj.parse({...s?{openaiApiKey:s}:{},...a?{gitSyncToken:a}:{},...c?{discordBotToken:c}:{},...u?{discordPublicKey:u}:{},...d?{discordApplicationId:d}:{},...f?{atprotoAppPassword:f}:{},...m?{certificatePem:m}:{},...h?{privateKeyPem:h}:{}})}function Jj(e,t,r,o,n,i,s,a){if(s===a)return;return ag(e,t,r,o,n,i,s)}function ag(e,t,r,o,n,i,s){let a=cg(e,t,r,o,n,i,s);if(a===void 0||a.trim().length===0)throw Error(`Missing required secret value for ${String(i)}. Set it in users/<handle>.secrets.yaml or fall back to ${s}/${s}_FILE before running secrets:encrypt.`);return a}function Hj(e){return e?.replace(/\r\n?|\n/g,"\\n")}function cg(e,t,r,o,n,i,s){return see(o,n,i,s,t,r,e)}function see(e,t,r,o,n,i,s){let a=e?.[r];if(a!==void 0&&a.trim().length>0)return a;let c=jt(`${o}_FILE`,n,i);if(c&&c.trim().length>0)return Od(yi(c,s),"utf8");let u=jt(o,n,i);if(u!==void 0&&u.trim().length>0)return u;let d=t?.[r];if(d!==void 0&&d.trim().length>0)return d;return}function aee(e){let t;try{t=Od(e,"utf8")}catch{return}try{return WI(t)}catch(r){throw Error(`Unable to parse plaintext secrets file ${e}: ${Ve(r)}`,{cause:r})}}async function cee(e,t,r,o){if(!await Yj(e))return;let n=VI(t,r,o);if(!n)return;let i;try{let s=Od(e,"utf8"),a=hi.decode(s),c=new Au;c.addIdentity(n),i=await c.decrypt(a,"text")}catch{return}try{return WI(i)}catch(s){throw Error(`Unable to parse decrypted secrets from ${e}: ${Ve(s)}`,{cause:s})}}function VI(e,t,r){let o=jt("AGE_SECRET_KEY_FILE",t,r);if(o&&o.trim().length>0)return Ru(Od(yi(o,e),"utf8"));let n=jt("AGE_SECRET_KEY",t,r);if(n&&n.trim().length>0)return Ru(n);try{return Ru(Od(HI(e,".brains-ops","age","identity.txt"),"utf8"))}catch{return}}function WI(e){let t=XD(e),r={};if(t!==null&&typeof t==="object"&&!Array.isArray(t)){for(let[o,n]of Object.entries(t))if(typeof n==="string")r[o]=n}return Gj.partial().parse(r)}function lee(e,t){let r={...t},o={...WI(e)},n=new Set([...Object.keys(r),...Object.keys(o)]);for(let i of n)if(r[i]!==o[i])throw Error(`secrets:encrypt round-trip verification failed for ${i}; refusing to write a corrupted encrypted payload`)}function uee(e){return[...e.effectiveOpenaiApiKeySelector!==e.sharedOpenaiApiKeySelector?["openaiApiKey"]:[],...e.effectiveGitSyncTokenSelector!==e.sharedGitSyncTokenSelector?["gitSyncToken"]:[],...e.discordEnabled?["discordBotToken","discordPublicKey","discordApplicationId"]:[]]}async function dee(e,t){let r=["# local per-user secret staging file","# fill values, run `bunx brains-ops secrets:encrypt . <handle>`, then the plaintext file will be removed",...t.map((o)=>`${o}: `),""].join(`
|
|
261
|
+
`);await Wj(e,r,{flag:"wx"})}async function Yj(e){try{return await nee(e),!0}catch{return!1}}function Vj(e){return e.replaceAll("\\","/")}var Gj;var GI=v(()=>{mi();bi();Hn();pe();Ev();Rd();Gj=l.strictObject({gitSyncToken:l.string().min(1).optional(),discordBotToken:l.string().min(1).optional(),discordPublicKey:l.string().min(1).optional(),discordApplicationId:l.string().min(1).optional(),openaiApiKey:l.string().min(1).optional(),atprotoAppPassword:l.string().min(1).optional(),certificatePem:l.string().min(1).optional(),privateKeyPem:l.string().min(1).optional()})});function oZ(e){return`${e.slice(0,1).toUpperCase()}${e.slice(1)}`}var lg=()=>{};var fZ={};Lt(fZ,{upgradePilotRepo:()=>Vee});import{readFile as Fee}from"fs/promises";import{join as Kee}from"path";async function dZ(e){let t=Kee(e,"package.json"),o=Jee.parse(JSON.parse(await Fee(t,"utf8"))).devDependencies?.["@rizom/ops"];if(!o)throw Error(`${t} does not pin @rizom/ops as a devDependency`);return o}async function Hee(e,t){let o=await Bun.spawn(e,{cwd:t,stdout:"inherit",stderr:"inherit"}).exited;if(o!==0)throw Error(`${e.join(" ")} failed with exit ${o}`)}async function Vee(e,t={}){let r=t.exec??Hee,o=await dZ(e),n=t.version??"latest";await r(["bun","add","--dev","--exact",`@rizom/ops@${n}`],e);let i=await dZ(e);return await r(["bun","x","brains-ops","init","."],e),{from:o,to:i}}var Jee;var pZ=v(()=>{pe();Jee=l.object({devDependencies:l.record(l.string(),l.string()).optional()})});var qe=ge(function(rte){var XI=Symbol.for("yaml.alias"),mZ=Symbol.for("yaml.document"),dg=Symbol.for("yaml.map"),hZ=Symbol.for("yaml.pair"),eA=Symbol.for("yaml.scalar"),fg=Symbol.for("yaml.seq"),Ao=Symbol.for("yaml.node.type"),Wee=(e)=>!!e&&typeof e==="object"&&e[Ao]===XI,Gee=(e)=>!!e&&typeof e==="object"&&e[Ao]===mZ,Qee=(e)=>!!e&&typeof e==="object"&&e[Ao]===dg,Yee=(e)=>!!e&&typeof e==="object"&&e[Ao]===hZ,gZ=(e)=>!!e&&typeof e==="object"&&e[Ao]===eA,Xee=(e)=>!!e&&typeof e==="object"&&e[Ao]===fg;function yZ(e){if(e&&typeof e==="object")switch(e[Ao]){case dg:case fg:return!0}return!1}function ete(e){if(e&&typeof e==="object")switch(e[Ao]){case XI:case dg:case eA:case fg:return!0}return!1}var tte=(e)=>(gZ(e)||yZ(e))&&!!e.anchor;rte.ALIAS=XI;rte.DOC=mZ;rte.MAP=dg;rte.NODE_TYPE=Ao;rte.PAIR=hZ;rte.SCALAR=eA;rte.SEQ=fg;rte.hasAnchor=tte;rte.isAlias=Wee;rte.isCollection=yZ;rte.isDocument=Gee;rte.isMap=Qee;rte.isNode=ete;rte.isPair=Yee;rte.isScalar=gZ;rte.isSeq=Xee});var Cd=ge(function(Ste){var Pt=qe(),Ir=Symbol("break visit"),bZ=Symbol("skip children"),Vn=Symbol("remove node");function pg(e,t){let r=SZ(t);if(Pt.isDocument(e)){if(jc(null,e.contents,r,Object.freeze([e]))===Vn)e.contents=null}else jc(null,e,r,Object.freeze([]))}pg.BREAK=Ir;pg.SKIP=bZ;pg.REMOVE=Vn;function jc(e,t,r,o){let n=vZ(e,t,r,o);if(Pt.isNode(n)||Pt.isPair(n))return wZ(e,o,n),jc(e,n,r,o);if(typeof n!=="symbol"){if(Pt.isCollection(t)){o=Object.freeze(o.concat(t));for(let i=0;i<t.items.length;++i){let s=jc(i,t.items[i],r,o);if(typeof s==="number")i=s-1;else if(s===Ir)return Ir;else if(s===Vn)t.items.splice(i,1),i-=1}}else if(Pt.isPair(t)){o=Object.freeze(o.concat(t));let i=jc("key",t.key,r,o);if(i===Ir)return Ir;else if(i===Vn)t.key=null;let s=jc("value",t.value,r,o);if(s===Ir)return Ir;else if(s===Vn)t.value=null}}return n}async function mg(e,t){let r=SZ(t);if(Pt.isDocument(e)){if(await Zc(null,e.contents,r,Object.freeze([e]))===Vn)e.contents=null}else await Zc(null,e,r,Object.freeze([]))}mg.BREAK=Ir;mg.SKIP=bZ;mg.REMOVE=Vn;async function Zc(e,t,r,o){let n=await vZ(e,t,r,o);if(Pt.isNode(n)||Pt.isPair(n))return wZ(e,o,n),Zc(e,n,r,o);if(typeof n!=="symbol"){if(Pt.isCollection(t)){o=Object.freeze(o.concat(t));for(let i=0;i<t.items.length;++i){let s=await Zc(i,t.items[i],r,o);if(typeof s==="number")i=s-1;else if(s===Ir)return Ir;else if(s===Vn)t.items.splice(i,1),i-=1}}else if(Pt.isPair(t)){o=Object.freeze(o.concat(t));let i=await Zc("key",t.key,r,o);if(i===Ir)return Ir;else if(i===Vn)t.key=null;let s=await Zc("value",t.value,r,o);if(s===Ir)return Ir;else if(s===Vn)t.value=null}}return n}function SZ(e){if(typeof e==="object"&&(e.Collection||e.Node||e.Value))return Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e);return e}function vZ(e,t,r,o){if(typeof r==="function")return r(e,t,o);if(Pt.isMap(t))return r.Map?.(e,t,o);if(Pt.isSeq(t))return r.Seq?.(e,t,o);if(Pt.isPair(t))return r.Pair?.(e,t,o);if(Pt.isScalar(t))return r.Scalar?.(e,t,o);if(Pt.isAlias(t))return r.Alias?.(e,t,o);return}function wZ(e,t,r){let o=t[t.length-1];if(Pt.isCollection(o))o.items[e]=r;else if(Pt.isPair(o))if(e==="key")o.key=r;else o.value=r;else if(Pt.isDocument(o))o.contents=r;else{let n=Pt.isAlias(o)?"alias":"scalar";throw Error(`Cannot replace node with ${n} parent`)}}Ste.visit=pg;Ste.visitAsync=mg});var tA=ge(function(kte){var xZ=qe(),xte=Cd(),_te={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ete=(e)=>e.replace(/[!,[\]{}]/g,(t)=>_te[t]);class Yr{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Yr.defaultYaml,e),this.tags=Object.assign({},Yr.defaultTags,t)}clone(){let e=new Yr(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){let e=new Yr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Yr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Yr.defaultTags);break}return e}add(e,t){if(this.atNextDocument)this.yaml={explicit:Yr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Yr.defaultTags),this.atNextDocument=!1;let r=e.trim().split(/[ \t]+/),o=r.shift();switch(o){case"%TAG":{if(r.length!==2){if(t(0,"%TAG directive should contain exactly two parts"),r.length<2)return!1}let[n,i]=r;return this.tags[n]=i,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;let[n]=r;if(n==="1.1"||n==="1.2")return this.yaml.version=n,!0;else{let i=/^\d+\.\d+$/.test(n);return t(6,`Unsupported YAML version ${n}`,i),!1}}default:return t(0,`Unknown directive ${o}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){let i=e.slice(2,-1);if(i==="!"||i==="!!")return t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null;if(e[e.length-1]!==">")t("Verbatim tags must end with a >");return i}let[,r,o]=e.match(/^(.*!)([^!]*)$/s);if(!o)t(`The ${e} tag has no suffix`);let n=this.tags[r];if(n)try{return n+decodeURIComponent(o)}catch(i){return t(String(i)),null}if(r==="!")return e;return t(`Could not resolve tag: ${e}`),null}tagString(e){for(let[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+Ete(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags),o;if(e&&r.length>0&&xZ.isNode(e.contents)){let n={};xte.visit(e.contents,(i,s)=>{if(xZ.isNode(s)&&s.tag)n[s.tag]=!0}),o=Object.keys(n)}else o=[];for(let[n,i]of r){if(n==="!!"&&i==="tag:yaml.org,2002:")continue;if(!e||o.some((s)=>s.startsWith(i)))t.push(`%TAG ${n} ${i}`)}return t.join(`
|
|
262
|
+
`)}}Yr.defaultYaml={explicit:!1,version:"1.2"};Yr.defaultTags={"!!":"tag:yaml.org,2002:"};kte.Directives=Yr});var hg=ge(function($te){var _Z=qe(),Ate=Cd();function Tte(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let r=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(r)}return!0}function EZ(e){let t=new Set;return Ate.visit(e,{Value(r,o){if(o.anchor)t.add(o.anchor)}}),t}function kZ(e,t){for(let r=1;;++r){let o=`${e}${r}`;if(!t.has(o))return o}}function Rte(e,t){let r=[],o=new Map,n=null;return{onAnchor:(i)=>{r.push(i),n??(n=EZ(e));let s=kZ(t,n);return n.add(s),s},setAnchors:()=>{for(let i of r){let s=o.get(i);if(typeof s==="object"&&s.anchor&&(_Z.isScalar(s.node)||_Z.isCollection(s.node)))s.node.anchor=s.anchor;else{let a=Error("Failed to resolve repeated object (this should not happen)");throw a.source=i,a}}},sourceObjects:o}}$te.anchorIsValid=Tte;$te.anchorNames=EZ;$te.createNodeAnchors=Rte;$te.findNewAnchor=kZ});var rA=ge(function(Nte){function Pd(e,t,r,o){if(o&&typeof o==="object")if(Array.isArray(o))for(let n=0,i=o.length;n<i;++n){let s=o[n],a=Pd(e,o,String(n),s);if(a===void 0)delete o[n];else if(a!==s)o[n]=a}else if(o instanceof Map)for(let n of Array.from(o.keys())){let i=o.get(n),s=Pd(e,o,n,i);if(s===void 0)o.delete(n);else if(s!==i)o.set(n,s)}else if(o instanceof Set)for(let n of Array.from(o)){let i=Pd(e,o,n,n);if(i===void 0)o.delete(n);else if(i!==n)o.delete(n),o.add(i)}else for(let[n,i]of Object.entries(o)){let s=Pd(e,o,n,i);if(s===void 0)delete o[n];else if(s!==i)o[n]=s}return e.call(t,r,o)}Nte.applyReviver=Pd});var Pi=ge(function(Bte){var Lte=qe();function IZ(e,t,r){if(Array.isArray(e))return e.map((o,n)=>IZ(o,String(n),r));if(e&&typeof e.toJSON==="function"){if(!r||!Lte.hasAnchor(e))return e.toJSON(t,r);let o={aliasCount:0,count:1,res:void 0};r.anchors.set(e,o),r.onCreate=(i)=>{o.res=i,delete r.onCreate};let n=e.toJSON(t,r);if(r.onCreate)r.onCreate(n);return n}if(typeof e==="bigint"&&!r?.keep)return Number(e);return e}Bte.toJS=IZ});var gg=ge(function(Mte){var Zte=rA(),AZ=qe(),Ute=Pi();class TZ{constructor(e){Object.defineProperty(this,AZ.NODE_TYPE,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(this.range)e.range=this.range.slice();return e}toJS(e,{mapAsMap:t,maxAliasCount:r,onAnchor:o,reviver:n}={}){if(!AZ.isDocument(e))throw TypeError("A document argument is required");let i={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof r==="number"?r:100},s=Ute.toJS(this,"",i);if(typeof o==="function")for(let{count:a,res:c}of i.anchors.values())o(c,a);return typeof n==="function"?Zte.applyReviver(n,{"":s},"",s):s}}Mte.NodeBase=TZ});var zd=ge(function(Vte){var Fte=hg(),Kte=Cd(),Uc=qe(),Jte=gg(),Hte=Pi();class RZ extends Jte.NodeBase{constructor(e){super(Uc.ALIAS);this.source=e,Object.defineProperty(this,"tag",{set(){throw Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw ReferenceError("Alias resolution is disabled");let r;if(t?.aliasResolveCache)r=t.aliasResolveCache;else if(r=[],Kte.visit(e,{Node:(n,i)=>{if(Uc.isAlias(i)||Uc.hasAnchor(i))r.push(i)}}),t)t.aliasResolveCache=r;let o=void 0;for(let n of r){if(n===this)break;if(n.anchor===this.source)o=n}return o}toJSON(e,t){if(!t)return{source:this.source};let{anchors:r,doc:o,maxAliasCount:n}=t,i=this.resolve(o,t);if(!i){let a=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(a)}let s=r.get(i);if(!s)Hte.toJS(i,null,t),s=r.get(i);if(s?.res===void 0)throw ReferenceError("This should not happen: Alias anchor was not resolved?");if(n>=0){if(s.count+=1,s.aliasCount===0)s.aliasCount=yg(o,i,r);if(s.count*s.aliasCount>n)throw ReferenceError("Excessive alias count indicates a resource exhaustion attack")}return s.res}toString(e,t,r){let o=`*${this.source}`;if(e){if(Fte.anchorIsValid(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let n=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(n)}if(e.implicitKey)return`${o} `}return o}}function yg(e,t,r){if(Uc.isAlias(t)){let o=t.resolve(e),n=r&&o&&r.get(o);return n?n.count*n.aliasCount:0}else if(Uc.isCollection(t)){let o=0;for(let n of t.items){let i=yg(e,n,r);if(i>o)o=i}return o}else if(Uc.isPair(t)){let o=yg(e,t.key,r),n=yg(e,t.value,r);return Math.max(o,n)}return 1}Vte.Alias=RZ});var kt=ge(function(ere){var Gte=qe(),Qte=gg(),Yte=Pi(),Xte=(e)=>!e||typeof e!=="function"&&typeof e!=="object";class Ys extends Qte.NodeBase{constructor(e){super(Gte.SCALAR);this.value=e}toJSON(e,t){return t?.keep?this.value:Yte.toJS(this.value,e,t)}toString(){return String(this.value)}}Ys.BLOCK_FOLDED="BLOCK_FOLDED";Ys.BLOCK_LITERAL="BLOCK_LITERAL";Ys.PLAIN="PLAIN";Ys.QUOTE_DOUBLE="QUOTE_DOUBLE";Ys.QUOTE_SINGLE="QUOTE_SINGLE";ere.Scalar=Ys;ere.isScalarValue=Xte});var Nd=ge(function(are){var nre=zd(),Xs=qe(),$Z=kt(),ore="tag:yaml.org,2002:";function ire(e,t,r){if(t){let o=r.filter((i)=>i.tag===t),n=o.find((i)=>!i.format)??o[0];if(!n)throw Error(`Tag ${t} not found`);return n}return r.find((o)=>o.identify?.(e)&&!o.format)}function sre(e,t,r){if(Xs.isDocument(e))e=e.contents;if(Xs.isNode(e))return e;if(Xs.isPair(e)){let f=r.schema[Xs.MAP].createNode?.(r.schema,null,r);return f.items.push(e),f}if(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)e=e.valueOf();let{aliasDuplicateObjects:o,onAnchor:n,onTagObj:i,schema:s,sourceObjects:a}=r,c=void 0;if(o&&e&&typeof e==="object")if(c=a.get(e),c)return c.anchor??(c.anchor=n(e)),new nre.Alias(c.anchor);else c={anchor:null,node:null},a.set(e,c);if(t?.startsWith("!!"))t=ore+t.slice(2);let u=ire(e,t,s.tags);if(!u){if(e&&typeof e.toJSON==="function")e=e.toJSON();if(!e||typeof e!=="object"){let f=new $Z.Scalar(e);if(c)c.node=f;return f}u=e instanceof Map?s[Xs.MAP]:(Symbol.iterator in Object(e))?s[Xs.SEQ]:s[Xs.MAP]}if(i)i(u),delete r.onTagObj;let d=u?.createNode?u.createNode(r.schema,e,r):typeof u?.nodeClass?.from==="function"?u.nodeClass.from(r.schema,e,r):new $Z.Scalar(e);if(t)d.tag=t;else if(!u.default)d.tag=u.tag;if(c)c.node=d;return d}are.createNode=sre});var bg=ge(function(dre){var lre=Nd(),Wn=qe(),ure=gg();function nA(e,t,r){let o=r;for(let n=t.length-1;n>=0;--n){let i=t[n];if(typeof i==="number"&&Number.isInteger(i)&&i>=0){let s=[];s[i]=o,o=s}else o=new Map([[i,o]])}return lre.createNode(o,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}var OZ=(e)=>e==null||typeof e==="object"&&!!e[Symbol.iterator]().next().done;class CZ extends ure.NodeBase{constructor(e,t){super(e);Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));if(e)t.schema=e;if(t.items=t.items.map((r)=>Wn.isNode(r)||Wn.isPair(r)?r.clone(e):r),this.range)t.range=this.range.slice();return t}addIn(e,t){if(OZ(e))this.add(t);else{let[r,...o]=e,n=this.get(r,!0);if(Wn.isCollection(n))n.addIn(o,t);else if(n===void 0&&this.schema)this.set(r,nA(this.schema,o,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${o}`)}}deleteIn(e){let[t,...r]=e;if(r.length===0)return this.delete(t);let o=this.get(t,!0);if(Wn.isCollection(o))return o.deleteIn(r);else throw Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){let[r,...o]=e,n=this.get(r,!0);if(o.length===0)return!t&&Wn.isScalar(n)?n.value:n;else return Wn.isCollection(n)?n.getIn(o,t):void 0}hasAllNullValues(e){return this.items.every((t)=>{if(!Wn.isPair(t))return!1;let r=t.value;return r==null||e&&Wn.isScalar(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){let[t,...r]=e;if(r.length===0)return this.has(t);let o=this.get(t,!0);return Wn.isCollection(o)?o.hasIn(r):!1}setIn(e,t){let[r,...o]=e;if(o.length===0)this.set(r,t);else{let n=this.get(r,!0);if(Wn.isCollection(n))n.setIn(o,t);else if(n===void 0&&this.schema)this.set(r,nA(this.schema,o,t));else throw Error(`Expected YAML collection at ${r}. Remaining path: ${o}`)}}}dre.Collection=CZ;dre.collectionFromPath=nA;dre.isEmptyPath=OZ});var Dd=ge(function(yre){var hre=(e)=>e.replace(/^(?!$)(?: $)?/gm,"#");function oA(e,t){if(/^\n+$/.test(e))return e.substring(1);return t?e.replace(/^(?! *$)/gm,t):e}var gre=(e,t,r)=>e.endsWith(`
|
|
263
|
+
`)?oA(r,t):r.includes(`
|
|
264
|
+
`)?`
|
|
265
|
+
`+oA(r,t):(e.endsWith(" ")?"":" ")+r;yre.indentComment=oA;yre.lineComment=gre;yre.stringifyComment=hre});var zZ=ge(function(xre){function wre(e,t,r="flow",{indentAtStart:o,lineWidth:n=80,minContentWidth:i=20,onFold:s,onOverflow:a}={}){if(!n||n<0)return e;if(n<i)i=0;let c=Math.max(1+i,1+n-t.length);if(e.length<=c)return e;let u=[],d={},f=n-t.length;if(typeof o==="number")if(o>n-Math.max(2,i))u.push(0);else f=n-o;let m=void 0,h=void 0,b=!1,y=-1,S=-1,x=-1;if(r==="block"){if(y=PZ(e,y,t.length),y!==-1)f=y+c}for(let A;A=e[y+=1];){if(r==="quoted"&&A==="\\"){switch(S=y,e[y+1]){case"x":y+=3;break;case"u":y+=5;break;case"U":y+=9;break;default:y+=1}x=y}if(A===`
|
|
266
|
+
`){if(r==="block")y=PZ(e,y,t.length);f=y+t.length+c,m=void 0}else{if(A===" "&&h&&h!==" "&&h!==`
|
|
267
|
+
`&&h!=="\t"){let O=e[y+1];if(O&&O!==" "&&O!==`
|
|
268
|
+
`&&O!=="\t")m=y}if(y>=f)if(m)u.push(m),f=m+c,m=void 0;else if(r==="quoted"){while(h===" "||h==="\t")h=A,A=e[y+=1],b=!0;let O=y>x+1?y-2:S-1;if(d[O])return e;u.push(O),d[O]=!0,f=O+c,m=void 0}else b=!0}h=A}if(b&&a)a();if(u.length===0)return e;if(s)s();let _=e.slice(0,u[0]);for(let A=0;A<u.length;++A){let O=u[A],L=u[A+1]||e.length;if(O===0)_=`
|
|
269
|
+
${t}${e.slice(0,L)}`;else{if(r==="quoted"&&d[O])_+=`${e[O]}\\`;_+=`
|
|
270
|
+
${t}${e.slice(O+1,L)}`}}return _}function PZ(e,t,r){let o=t,n=t+1,i=e[n];while(i===" "||i==="\t")if(t<n+r)i=e[++t];else{do i=e[++t];while(i&&i!==`
|
|
271
|
+
`);o=t,n=t+1,i=e[n]}return o}xre.FOLD_BLOCK="block";xre.FOLD_FLOW="flow";xre.FOLD_QUOTED="quoted";xre.foldFlowLines=wre});var Bd=ge(function($re){var yn=kt(),zi=zZ(),vg=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),wg=(e)=>/^(%|---|\.\.\.)/m.test(e);function Are(e,t,r){if(!t||t<0)return!1;let o=t-r,n=e.length;if(n<=o)return!1;for(let i=0,s=0;i<n;++i)if(e[i]===`
|
|
272
|
+
`){if(i-s>o)return!0;if(s=i+1,n-s<=o)return!1}return!0}function Ld(e,t){let r=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return r;let{implicitKey:o}=t,n=t.options.doubleQuotedMinMultiLineLength,i=t.indent||(wg(e)?" ":""),s="",a=0;for(let c=0,u=r[c];u;u=r[++c]){if(u===" "&&r[c+1]==="\\"&&r[c+2]==="n")s+=r.slice(a,c)+"\\ ",c+=1,a=c,u="\\";if(u==="\\")switch(r[c+1]){case"u":{s+=r.slice(a,c);let d=r.substr(c+2,4);switch(d){case"0000":s+="\\0";break;case"0007":s+="\\a";break;case"000b":s+="\\v";break;case"001b":s+="\\e";break;case"0085":s+="\\N";break;case"00a0":s+="\\_";break;case"2028":s+="\\L";break;case"2029":s+="\\P";break;default:if(d.substr(0,2)==="00")s+="\\x"+d.substr(2);else s+=r.substr(c,6)}c+=5,a=c+1}break;case"n":if(o||r[c+2]==='"'||r.length<n)c+=1;else{s+=r.slice(a,c)+`
|
|
273
|
+
|
|
274
|
+
`;while(r[c+2]==="\\"&&r[c+3]==="n"&&r[c+4]!=='"')s+=`
|
|
275
|
+
`,c+=2;if(s+=i,r[c+2]===" ")s+="\\";c+=1,a=c+1}break;default:c+=1}}return s=a?s+r.slice(a):r,o?s:zi.foldFlowLines(s,i,zi.FOLD_QUOTED,vg(t,!1))}function iA(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
276
|
+
`)||/[ \t]\n|\n[ \t]/.test(e))return Ld(e,t);let r=t.indent||(wg(e)?" ":""),o="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
277
|
+
${r}`)+"'";return t.implicitKey?o:zi.foldFlowLines(o,r,zi.FOLD_FLOW,vg(t,!1))}function Mc(e,t){let{singleQuote:r}=t.options,o;if(r===!1)o=Ld;else{let n=e.includes('"'),i=e.includes("'");if(n&&!i)o=iA;else if(i&&!n)o=Ld;else o=r?iA:Ld}return o(e,t)}var sA;try{sA=new RegExp(`(^|(?<!
|
|
278
|
+
))
|
|
279
|
+
+(?!
|
|
280
|
+
|$)`,"g")}catch{sA=/\n+(?!\n|$)/g}function Sg({comment:e,type:t,value:r},o,n,i){let{blockQuote:s,commentString:a,lineWidth:c}=o.options;if(!s||/\n[\t ]+$/.test(r))return Mc(r,o);let u=o.indent||(o.forceBlockIndent||wg(r)?" ":""),d=s==="literal"?!0:s==="folded"||t===yn.Scalar.BLOCK_FOLDED?!1:t===yn.Scalar.BLOCK_LITERAL?!0:!Are(r,c,u.length);if(!r)return d?`|
|
|
281
|
+
`:`>
|
|
282
|
+
`;let f,m;for(m=r.length;m>0;--m){let L=r[m-1];if(L!==`
|
|
283
|
+
`&&L!=="\t"&&L!==" ")break}let h=r.substring(m),b=h.indexOf(`
|
|
284
|
+
`);if(b===-1)f="-";else if(r===h||b!==h.length-1){if(f="+",i)i()}else f="";if(h){if(r=r.slice(0,-h.length),h[h.length-1]===`
|
|
285
|
+
`)h=h.slice(0,-1);h=h.replace(sA,`$&${u}`)}let y=!1,S,x=-1;for(S=0;S<r.length;++S){let L=r[S];if(L===" ")y=!0;else if(L===`
|
|
286
|
+
`)x=S;else break}let _=r.substring(0,x<S?x+1:S);if(_)r=r.substring(_.length),_=_.replace(/\n+/g,`$&${u}`);let O=(y?u?"2":"1":"")+f;if(e){if(O+=" "+a(e.replace(/ ?[\r\n]+/g," ")),n)n()}if(!d){let L=r.replace(/\n+/g,`
|
|
287
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${u}`),z=!1,J=vg(o,!0);if(s!=="folded"&&t!==yn.Scalar.BLOCK_FOLDED)J.onOverflow=()=>{z=!0};let P=zi.foldFlowLines(`${_}${L}${h}`,u,zi.FOLD_BLOCK,J);if(!z)return`>${O}
|
|
288
|
+
${u}${P}`}return r=r.replace(/\n+/g,`$&${u}`),`|${O}
|
|
289
|
+
${u}${_}${r}${h}`}function Tre(e,t,r,o){let{type:n,value:i}=e,{actualString:s,implicitKey:a,indent:c,indentStep:u,inFlow:d}=t;if(a&&i.includes(`
|
|
290
|
+
`)||d&&/[[\]{},]/.test(i))return Mc(i,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(i))return a||d||!i.includes(`
|
|
291
|
+
`)?Mc(i,t):Sg(e,t,r,o);if(!a&&!d&&n!==yn.Scalar.PLAIN&&i.includes(`
|
|
292
|
+
`))return Sg(e,t,r,o);if(wg(i)){if(c==="")return t.forceBlockIndent=!0,Sg(e,t,r,o);else if(a&&c===u)return Mc(i,t)}let f=i.replace(/\n+/g,`$&
|
|
293
|
+
${c}`);if(s){let m=(y)=>y.default&&y.tag!=="tag:yaml.org,2002:str"&&y.test?.test(f),{compat:h,tags:b}=t.doc.schema;if(b.some(m)||h?.some(m))return Mc(i,t)}return a?f:zi.foldFlowLines(f,c,zi.FOLD_FLOW,vg(t,!1))}function Rre(e,t,r,o){let{implicitKey:n,inFlow:i}=t,s=typeof e.value==="string"?e:Object.assign({},e,{value:String(e.value)}),{type:a}=e;if(a!==yn.Scalar.QUOTE_DOUBLE){if(/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(s.value))a=yn.Scalar.QUOTE_DOUBLE}let c=(d)=>{switch(d){case yn.Scalar.BLOCK_FOLDED:case yn.Scalar.BLOCK_LITERAL:return n||i?Mc(s.value,t):Sg(s,t,r,o);case yn.Scalar.QUOTE_DOUBLE:return Ld(s.value,t);case yn.Scalar.QUOTE_SINGLE:return iA(s.value,t);case yn.Scalar.PLAIN:return Tre(s,t,r,o);default:return null}},u=c(a);if(u===null){let{defaultKeyType:d,defaultStringType:f}=t.options,m=n&&d||f;if(u=c(m),u===null)throw Error(`Unsupported default string type ${m}`)}return u}$re.stringifyString=Rre});var jd=ge(function(jre){var Cre=hg(),Ni=qe(),Pre=Dd(),zre=Bd();function Nre(e,t){let r=Object.assign({blockQuote:!0,commentString:Pre.stringifyComment,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t),o;switch(r.collectionStyle){case"block":o=!1;break;case"flow":o=!0;break;default:o=null}return{anchors:new Set,doc:e,flowCollectionPadding:r.flowCollectionPadding?" ":"",indent:"",indentStep:typeof r.indent==="number"?" ".repeat(r.indent):" ",inFlow:o,options:r}}function Dre(e,t){if(t.tag){let n=e.filter((i)=>i.tag===t.tag);if(n.length>0)return n.find((i)=>i.format===t.format)??n[0]}let r=void 0,o;if(Ni.isScalar(t)){o=t.value;let n=e.filter((i)=>i.identify?.(o));if(n.length>1){let i=n.filter((s)=>s.test);if(i.length>0)n=i}r=n.find((i)=>i.format===t.format)??n.find((i)=>!i.format)}else o=t,r=e.find((n)=>n.nodeClass&&o instanceof n.nodeClass);if(!r){let n=o?.constructor?.name??(o===null?"null":typeof o);throw Error(`Tag not resolved for ${n} value`)}return r}function Lre(e,t,{anchors:r,doc:o}){if(!o.directives)return"";let n=[],i=(Ni.isScalar(e)||Ni.isCollection(e))&&e.anchor;if(i&&Cre.anchorIsValid(i))r.add(i),n.push(`&${i}`);let s=e.tag??(t.default?null:t.tag);if(s)n.push(o.directives.tagString(s));return n.join(" ")}function Bre(e,t,r,o){if(Ni.isPair(e))return e.toString(t,r,o);if(Ni.isAlias(e)){if(t.doc.directives)return e.toString(t);if(t.resolvedAliases?.has(e))throw TypeError("Cannot stringify circular structure without alias nodes");else{if(t.resolvedAliases)t.resolvedAliases.add(e);else t.resolvedAliases=new Set([e]);e=e.resolve(t.doc)}}let n=void 0,i=Ni.isNode(e)?e:t.doc.createNode(e,{onTagObj:(c)=>n=c});n??(n=Dre(t.doc.schema.tags,i));let s=Lre(i,n,t);if(s.length>0)t.indentAtStart=(t.indentAtStart??0)+s.length+1;let a=typeof n.stringify==="function"?n.stringify(i,t,r,o):Ni.isScalar(i)?zre.stringifyString(i,t,r,o):i.toString(t,r,o);if(!s)return a;return Ni.isScalar(i)||a[0]==="{"||a[0]==="["?`${s} ${a}`:`${s}
|
|
294
|
+
${t.indent}${a}`}jre.createStringifyContext=Nre;jre.stringify=Bre});var LZ=ge(function(qre){var To=qe(),NZ=kt(),DZ=jd(),Zd=Dd();function Mre({key:e,value:t},r,o,n){let{allNullValues:i,doc:s,indent:a,indentStep:c,options:{commentString:u,indentSeq:d,simpleKeys:f}}=r,m=To.isNode(e)&&e.comment||null;if(f){if(m)throw Error("With simple keys, key nodes cannot have comments");if(To.isCollection(e)||!To.isNode(e)&&typeof e==="object")throw Error("With simple keys, collection cannot be used as a key value")}let h=!f&&(!e||m&&t==null&&!r.inFlow||To.isCollection(e)||(To.isScalar(e)?e.type===NZ.Scalar.BLOCK_FOLDED||e.type===NZ.Scalar.BLOCK_LITERAL:typeof e==="object"));r=Object.assign({},r,{allNullValues:!1,implicitKey:!h&&(f||!i),indent:a+c});let b=!1,y=!1,S=DZ.stringify(e,r,()=>b=!0,()=>y=!0);if(!h&&!r.inFlow&&S.length>1024){if(f)throw Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(r.inFlow){if(i||t==null){if(b&&o)o();return S===""?"?":h?`? ${S}`:S}}else if(i&&!f||t==null&&h){if(S=`? ${S}`,m&&!b)S+=Zd.lineComment(S,r.indent,u(m));else if(y&&n)n();return S}if(b)m=null;if(h){if(m)S+=Zd.lineComment(S,r.indent,u(m));S=`? ${S}
|
|
295
|
+
${a}:`}else if(S=`${S}:`,m)S+=Zd.lineComment(S,r.indent,u(m));let x,_,A;if(To.isNode(t))x=!!t.spaceBefore,_=t.commentBefore,A=t.comment;else if(x=!1,_=null,A=null,t&&typeof t==="object")t=s.createNode(t);if(r.implicitKey=!1,!h&&!m&&To.isScalar(t))r.indentAtStart=S.length+1;if(y=!1,!d&&c.length>=2&&!r.inFlow&&!h&&To.isSeq(t)&&!t.flow&&!t.tag&&!t.anchor)r.indent=r.indent.substring(2);let O=!1,L=DZ.stringify(t,r,()=>O=!0,()=>y=!0),z=" ";if(m||x||_){if(z=x?`
|
|
296
|
+
`:"",_){let J=u(_);z+=`
|
|
297
|
+
${Zd.indentComment(J,r.indent)}`}if(L===""&&!r.inFlow){if(z===`
|
|
298
|
+
`&&A)z=`
|
|
299
|
+
|
|
300
|
+
`}else z+=`
|
|
301
|
+
${r.indent}`}else if(!h&&To.isCollection(t)){let J=L[0],P=L.indexOf(`
|
|
302
|
+
`),W=P!==-1,ee=r.inFlow??t.flow??t.items.length===0;if(W||!ee){let j=!1;if(W&&(J==="&"||J==="!")){let R=L.indexOf(" ");if(J==="&"&&R!==-1&&R<P&&L[R+1]==="!")R=L.indexOf(" ",R+1);if(R===-1||P<R)j=!0}if(!j)z=`
|
|
303
|
+
${r.indent}`}}else if(L===""||L[0]===`
|
|
304
|
+
`)z="";if(S+=z+L,r.inFlow){if(O&&o)o()}else if(A&&!O)S+=Zd.lineComment(S,r.indent,u(A));else if(y&&n)n();return S}qre.stringifyPair=Mre});var aA=ge(function(Hre){var BZ=qr("process");function Kre(e,...t){if(e==="debug")console.log(...t)}function Jre(e,t){if(e==="debug"||e==="warn")if(typeof BZ.emitWarning==="function")BZ.emitWarning(t);else console.warn(t)}Hre.debug=Kre;Hre.warn=Jre});var kg=ge(function(Qre){var Eg=qe(),jZ=kt(),xg="<<",_g={identify:(e)=>e===xg||typeof e==="symbol"&&e.description===xg,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new jZ.Scalar(Symbol(xg)),{addToJSMap:ZZ}),stringify:()=>xg},Gre=(e,t)=>(_g.identify(t)||Eg.isScalar(t)&&(!t.type||t.type===jZ.Scalar.PLAIN)&&_g.identify(t.value))&&e?.doc.schema.tags.some((r)=>r.tag===_g.tag&&r.default);function ZZ(e,t,r){let o=UZ(e,r);if(Eg.isSeq(o))for(let n of o.items)cA(e,t,n);else if(Array.isArray(o))for(let n of o)cA(e,t,n);else cA(e,t,o)}function cA(e,t,r){let o=UZ(e,r);if(!Eg.isMap(o))throw Error("Merge sources must be maps or map aliases");let n=o.toJSON(null,e,Map);for(let[i,s]of n)if(t instanceof Map){if(!t.has(i))t.set(i,s)}else if(t instanceof Set)t.add(i);else if(!Object.prototype.hasOwnProperty.call(t,i))Object.defineProperty(t,i,{value:s,writable:!0,enumerable:!0,configurable:!0});return t}function UZ(e,t){return e&&Eg.isAlias(t)?t.resolve(e.doc,e):t}Qre.addMergeToJSMap=ZZ;Qre.isMergeKey=Gre;Qre.merge=_g});var uA=ge(function(ine){var tne=aA(),MZ=kg(),rne=jd(),qZ=qe(),lA=Pi();function nne(e,t,{key:r,value:o}){if(qZ.isNode(r)&&r.addToJSMap)r.addToJSMap(e,t,o);else if(MZ.isMergeKey(e,r))MZ.addMergeToJSMap(e,t,o);else{let n=lA.toJS(r,"",e);if(t instanceof Map)t.set(n,lA.toJS(o,n,e));else if(t instanceof Set)t.add(n);else{let i=one(r,n,e),s=lA.toJS(o,i,e);if(i in t)Object.defineProperty(t,i,{value:s,writable:!0,enumerable:!0,configurable:!0});else t[i]=s}}return t}function one(e,t,r){if(t===null)return"";if(typeof t!=="object")return String(t);if(qZ.isNode(e)&&r?.doc){let o=rne.createStringifyContext(r.doc,{});o.anchors=new Set;for(let i of r.anchors.keys())o.anchors.add(i.anchor);o.inFlow=!0,o.inStringifyKey=!0;let n=e.toString(o);if(!r.mapKeyWarned){let i=JSON.stringify(n);if(i.length>40)i=i.substring(0,36)+'..."';tne.warn(r.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${i}. Set mapAsMap: true to use object keys.`),r.mapKeyWarned=!0}return n}return JSON.stringify(t)}ine.addPairToJSMap=nne});var Di=ge(function(une){var FZ=Nd(),ane=LZ(),cne=uA(),Ig=qe();function lne(e,t,r){let o=FZ.createNode(e,void 0,r),n=FZ.createNode(t,void 0,r);return new Ag(o,n)}class Ag{constructor(e,t=null){Object.defineProperty(this,Ig.NODE_TYPE,{value:Ig.PAIR}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;if(Ig.isNode(t))t=t.clone(e);if(Ig.isNode(r))r=r.clone(e);return new Ag(t,r)}toJSON(e,t){let r=t?.mapAsMap?new Map:{};return cne.addPairToJSMap(t,r,this)}toString(e,t,r){return e?.doc?ane.stringifyPair(this,e,t,r):JSON.stringify(this)}}une.Pair=Ag;une.createPair=lne});var dA=ge(function(gne){var ea=qe(),KZ=jd(),Tg=Dd();function pne(e,t,r){return(t.inFlow??e.flow?hne:mne)(e,t,r)}function mne({comment:e,items:t},r,{blockItemPrefix:o,flowChars:n,itemIndent:i,onChompKeep:s,onComment:a}){let{indent:c,options:{commentString:u}}=r,d=Object.assign({},r,{indent:i,type:null}),f=!1,m=[];for(let b=0;b<t.length;++b){let y=t[b],S=null;if(ea.isNode(y)){if(!f&&y.spaceBefore)m.push("");if(Rg(r,m,y.commentBefore,f),y.comment)S=y.comment}else if(ea.isPair(y)){let _=ea.isNode(y.key)?y.key:null;if(_){if(!f&&_.spaceBefore)m.push("");Rg(r,m,_.commentBefore,f)}}f=!1;let x=KZ.stringify(y,d,()=>S=null,()=>f=!0);if(S)x+=Tg.lineComment(x,i,u(S));if(f&&S)f=!1;m.push(o+x)}let h;if(m.length===0)h=n.start+n.end;else{h=m[0];for(let b=1;b<m.length;++b){let y=m[b];h+=y?`
|
|
305
|
+
${c}${y}`:`
|
|
306
|
+
`}}if(e){if(h+=`
|
|
307
|
+
`+Tg.indentComment(u(e),c),a)a()}else if(f&&s)s();return h}function hne({items:e},t,{flowChars:r,itemIndent:o}){let{indent:n,indentStep:i,flowCollectionPadding:s,options:{commentString:a}}=t;o+=i;let c=Object.assign({},t,{indent:o,inFlow:!0,type:null}),u=!1,d=0,f=[];for(let b=0;b<e.length;++b){let y=e[b],S=null;if(ea.isNode(y)){if(y.spaceBefore)f.push("");if(Rg(t,f,y.commentBefore,!1),y.comment)S=y.comment}else if(ea.isPair(y)){let _=ea.isNode(y.key)?y.key:null;if(_){if(_.spaceBefore)f.push("");if(Rg(t,f,_.commentBefore,!1),_.comment)u=!0}let A=ea.isNode(y.value)?y.value:null;if(A){if(A.comment)S=A.comment;if(A.commentBefore)u=!0}else if(y.value==null&&_?.comment)S=_.comment}if(S)u=!0;let x=KZ.stringify(y,c,()=>S=null);if(u||(u=f.length>d||x.includes(`
|
|
308
|
+
`)),b<e.length-1)x+=",";else if(t.options.trailingComma){if(t.options.lineWidth>0)u||(u=f.reduce((_,A)=>_+A.length+2,2)+(x.length+2)>t.options.lineWidth);if(u)x+=","}if(S)x+=Tg.lineComment(x,o,a(S));f.push(x),d=f.length}let{start:m,end:h}=r;if(f.length===0)return m+h;else{if(!u){let b=f.reduce((y,S)=>y+S.length+2,2);u=t.options.lineWidth>0&&b>t.options.lineWidth}if(u){let b=m;for(let y of f)b+=y?`
|
|
309
|
+
${i}${n}${y}`:`
|
|
310
|
+
`;return`${b}
|
|
311
|
+
${n}${h}`}else return`${m}${s}${f.join(" ")}${s}${h}`}}function Rg({indent:e,options:{commentString:t}},r,o,n){if(o&&n)o=o.replace(/^\n+/,"");if(o){let i=Tg.indentComment(t(o),e);r.push(i.trimStart())}}gne.stringifyCollection=pne});var Bi=ge(function(xne){var bne=dA(),Sne=uA(),vne=bg(),Li=qe(),$g=Di(),wne=kt();function Ud(e,t){let r=Li.isScalar(t)?t.value:t;for(let o of e)if(Li.isPair(o)){if(o.key===t||o.key===r)return o;if(Li.isScalar(o.key)&&o.key.value===r)return o}return}class JZ extends vne.Collection{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Li.MAP,e);this.items=[]}static from(e,t,r){let{keepUndefined:o,replacer:n}=r,i=new this(e),s=(a,c)=>{if(typeof n==="function")c=n.call(t,a,c);else if(Array.isArray(n)&&!n.includes(a))return;if(c!==void 0||o)i.items.push($g.createPair(a,c,r))};if(t instanceof Map)for(let[a,c]of t)s(a,c);else if(t&&typeof t==="object")for(let a of Object.keys(t))s(a,t[a]);if(typeof e.sortMapEntries==="function")i.items.sort(e.sortMapEntries);return i}add(e,t){let r;if(Li.isPair(e))r=e;else if(!e||typeof e!=="object"||!("key"in e))r=new $g.Pair(e,e?.value);else r=new $g.Pair(e.key,e.value);let o=Ud(this.items,r.key),n=this.schema?.sortMapEntries;if(o){if(!t)throw Error(`Key ${r.key} already set`);if(Li.isScalar(o.value)&&wne.isScalarValue(r.value))o.value.value=r.value;else o.value=r.value}else if(n){let i=this.items.findIndex((s)=>n(r,s)<0);if(i===-1)this.items.push(r);else this.items.splice(i,0,r)}else this.items.push(r)}delete(e){let t=Ud(this.items,e);if(!t)return!1;return this.items.splice(this.items.indexOf(t),1).length>0}get(e,t){let o=Ud(this.items,e)?.value;return(!t&&Li.isScalar(o)?o.value:o)??void 0}has(e){return!!Ud(this.items,e)}set(e,t){this.add(new $g.Pair(e,t),!0)}toJSON(e,t,r){let o=r?new r:t?.mapAsMap?new Map:{};if(t?.onCreate)t.onCreate(o);for(let n of this.items)Sne.addPairToJSMap(t,o,n);return o}toString(e,t,r){if(!e)return JSON.stringify(this);for(let o of this.items)if(!Li.isPair(o))throw Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);if(!e.allNullValues&&this.hasAllNullValues(!1))e=Object.assign({},e,{allNullValues:!0});return bne.stringifyCollection(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}}xne.YAMLMap=JZ;xne.findPair=Ud});var qc=ge(function(Ane){var kne=qe(),HZ=Bi(),Ine={collection:"map",default:!0,nodeClass:HZ.YAMLMap,tag:"tag:yaml.org,2002:map",resolve(e,t){if(!kne.isMap(e))t("Expected a mapping for this tag");return e},createNode:(e,t,r)=>HZ.YAMLMap.from(e,t,r)};Ane.map=Ine});var ji=ge(function(zne){var Rne=Nd(),$ne=dA(),One=bg(),Cg=qe(),Cne=kt(),Pne=Pi();class VZ extends One.Collection{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Cg.SEQ,e);this.items=[]}add(e){this.items.push(e)}delete(e){let t=Og(e);if(typeof t!=="number")return!1;return this.items.splice(t,1).length>0}get(e,t){let r=Og(e);if(typeof r!=="number")return;let o=this.items[r];return!t&&Cg.isScalar(o)?o.value:o}has(e){let t=Og(e);return typeof t==="number"&&t<this.items.length}set(e,t){let r=Og(e);if(typeof r!=="number")throw Error(`Expected a valid index, not ${e}.`);let o=this.items[r];if(Cg.isScalar(o)&&Cne.isScalarValue(t))o.value=t;else this.items[r]=t}toJSON(e,t){let r=[];if(t?.onCreate)t.onCreate(r);let o=0;for(let n of this.items)r.push(Pne.toJS(n,String(o++),t));return r}toString(e,t,r){if(!e)return JSON.stringify(this);return $ne.stringifyCollection(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:t})}static from(e,t,r){let{replacer:o}=r,n=new this(e);if(t&&Symbol.iterator in Object(t)){let i=0;for(let s of t){if(typeof o==="function"){let a=t instanceof Set?s:String(i++);s=o.call(t,a,s)}n.items.push(Rne.createNode(s,void 0,r))}}return n}}function Og(e){let t=Cg.isScalar(e)?e.value:e;if(t&&typeof t==="string")t=Number(t);return typeof t==="number"&&Number.isInteger(t)&&t>=0?t:null}zne.YAMLSeq=VZ});var Fc=ge(function(Bne){var Dne=qe(),WZ=ji(),Lne={collection:"seq",default:!0,nodeClass:WZ.YAMLSeq,tag:"tag:yaml.org,2002:seq",resolve(e,t){if(!Dne.isSeq(e))t("Expected a sequence for this tag");return e},createNode:(e,t,r)=>WZ.YAMLSeq.from(e,t,r)};Bne.seq=Lne});var Md=ge(function(Mne){var Zne=Bd(),Une={identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify(e,t,r,o){return t=Object.assign({actualString:!0},t),Zne.stringifyString(e,t,r,o)}};Mne.string=Une});var Pg=ge(function(Fne){var GZ=kt(),QZ={identify:(e)=>e==null,createNode:()=>new GZ.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new GZ.Scalar(null),stringify:({source:e},t)=>typeof e==="string"&&QZ.test.test(e)?e:t.options.nullStr};Fne.nullTag=QZ});var fA=ge(function(Hne){var Jne=kt(),YZ={identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:(e)=>new Jne.Scalar(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},r){if(e&&YZ.test.test(e)){let o=e[0]==="t"||e[0]==="T";if(t===o)return e}return t?r.options.trueStr:r.options.falseStr}};Hne.boolTag=YZ});var Kc=ge(function(Gne){function Wne({format:e,minFractionDigits:t,tag:r,value:o}){if(typeof o==="bigint")return String(o);let n=typeof o==="number"?o:Number(o);if(!isFinite(n))return isNaN(n)?".nan":n<0?"-.inf":".inf";let i=Object.is(o,-0)?"-0":JSON.stringify(o);if(!e&&t&&(!r||r==="tag:yaml.org,2002:float")&&/^-?\d/.test(i)&&!i.includes("e")){let s=i.indexOf(".");if(s<0)s=i.length,i+=".";let a=t-(i.length-s-1);while(a-- >0)i+="0"}return i}Gne.stringifyNumber=Wne});var mA=ge(function(roe){var Yne=kt(),pA=Kc(),Xne={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:pA.stringifyNumber},eoe={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():pA.stringifyNumber(e)}},toe={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new Yne.Scalar(parseFloat(e)),r=e.indexOf(".");if(r!==-1&&e[e.length-1]==="0")t.minFractionDigits=e.length-r-1;return t},stringify:pA.stringifyNumber};roe.float=toe;roe.floatExp=eoe;roe.floatNaN=Xne});var gA=ge(function(loe){var XZ=Kc(),zg=(e)=>typeof e==="bigint"||Number.isInteger(e),hA=(e,t,r,{intAsBigInt:o})=>o?BigInt(e):parseInt(e.substring(t),r);function eU(e,t,r){let{value:o}=e;if(zg(o)&&o>=0)return r+o.toString(t);return XZ.stringifyNumber(e)}var soe={identify:(e)=>zg(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,r)=>hA(e,2,8,r),stringify:(e)=>eU(e,8,"0o")},aoe={identify:zg,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,r)=>hA(e,0,10,r),stringify:XZ.stringifyNumber},coe={identify:(e)=>zg(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,r)=>hA(e,2,16,r),stringify:(e)=>eU(e,16,"0x")};loe.int=aoe;loe.intHex=coe;loe.intOct=soe});var tU=ge(function(Soe){var poe=qc(),moe=Pg(),hoe=Fc(),goe=Md(),yoe=fA(),yA=mA(),bA=gA(),boe=[poe.map,hoe.seq,goe.string,moe.nullTag,yoe.boolTag,bA.intOct,bA.int,bA.intHex,yA.floatNaN,yA.floatExp,yA.float];Soe.schema=boe});var nU=ge(function(Aoe){var woe=kt(),xoe=qc(),_oe=Fc();function rU(e){return typeof e==="bigint"||Number.isInteger(e)}var Ng=({value:e})=>JSON.stringify(e),Eoe=[{identify:(e)=>typeof e==="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:(e)=>e,stringify:Ng},{identify:(e)=>e==null,createNode:()=>new woe.Scalar(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Ng},{identify:(e)=>typeof e==="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:(e)=>e==="true",stringify:Ng},{identify:rU,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:r})=>r?BigInt(e):parseInt(e,10),stringify:({value:e})=>rU(e)?e.toString():JSON.stringify(e)},{identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:(e)=>parseFloat(e),stringify:Ng}],koe={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},Ioe=[xoe.map,_oe.seq].concat(Eoe,koe);Aoe.schema=Ioe});var vA=ge(function(Ooe){var qd=qr("buffer"),SA=kt(),Roe=Bd(),$oe={identify:(e)=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof qd.Buffer==="function")return qd.Buffer.from(e,"base64");else if(typeof atob==="function"){let r=atob(e.replace(/[\n\r]/g,"")),o=new Uint8Array(r.length);for(let n=0;n<r.length;++n)o[n]=r.charCodeAt(n);return o}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:r},o,n,i){if(!r)return"";let s=r,a;if(typeof qd.Buffer==="function")a=s instanceof qd.Buffer?s.toString("base64"):qd.Buffer.from(s.buffer).toString("base64");else if(typeof btoa==="function"){let c="";for(let u=0;u<s.length;++u)c+=String.fromCharCode(s[u]);a=btoa(c)}else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=SA.Scalar.BLOCK_LITERAL),t!==SA.Scalar.QUOTE_DOUBLE){let c=Math.max(o.options.lineWidth-o.indent.length,o.options.minContentWidth),u=Math.ceil(a.length/c),d=Array(u);for(let f=0,m=0;f<u;++f,m+=c)d[f]=a.substr(m,c);a=d.join(t===SA.Scalar.BLOCK_LITERAL?`
|
|
312
|
+
`:" ")}return Roe.stringifyString({comment:e,type:t,value:a},o,n,i)}};Ooe.binary=$oe});var Lg=ge(function(Doe){var Dg=qe(),wA=Di(),Poe=kt(),zoe=ji();function oU(e,t){if(Dg.isSeq(e))for(let r=0;r<e.items.length;++r){let o=e.items[r];if(Dg.isPair(o))continue;else if(Dg.isMap(o)){if(o.items.length>1)t("Each pair must have its own sequence indicator");let n=o.items[0]||new wA.Pair(new Poe.Scalar(null));if(o.commentBefore)n.key.commentBefore=n.key.commentBefore?`${o.commentBefore}
|
|
313
|
+
${n.key.commentBefore}`:o.commentBefore;if(o.comment){let i=n.value??n.key;i.comment=i.comment?`${o.comment}
|
|
314
|
+
${i.comment}`:o.comment}o=n}e.items[r]=Dg.isPair(o)?o:new wA.Pair(o)}else t("Expected a sequence for this tag");return e}function iU(e,t,r){let{replacer:o}=r,n=new zoe.YAMLSeq(e);n.tag="tag:yaml.org,2002:pairs";let i=0;if(t&&Symbol.iterator in Object(t))for(let s of t){if(typeof o==="function")s=o.call(t,String(i++),s);let a,c;if(Array.isArray(s))if(s.length===2)a=s[0],c=s[1];else throw TypeError(`Expected [key, value] tuple: ${s}`);else if(s&&s instanceof Object){let u=Object.keys(s);if(u.length===1)a=u[0],c=s[a];else throw TypeError(`Expected tuple with one key, not ${u.length} keys`)}else a=s;n.items.push(wA.createPair(a,c,r))}return n}var Noe={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:oU,createNode:iU};Doe.createPairs=iU;Doe.pairs=Noe;Doe.resolvePairs=oU});var _A=ge(function(Moe){var sU=qe(),xA=Pi(),Fd=Bi(),Zoe=ji(),aU=Lg();class ta extends Zoe.YAMLSeq{constructor(){super();this.add=Fd.YAMLMap.prototype.add.bind(this),this.delete=Fd.YAMLMap.prototype.delete.bind(this),this.get=Fd.YAMLMap.prototype.get.bind(this),this.has=Fd.YAMLMap.prototype.has.bind(this),this.set=Fd.YAMLMap.prototype.set.bind(this),this.tag=ta.tag}toJSON(e,t){if(!t)return super.toJSON(e);let r=new Map;if(t?.onCreate)t.onCreate(r);for(let o of this.items){let n,i;if(sU.isPair(o))n=xA.toJS(o.key,"",t),i=xA.toJS(o.value,n,t);else n=xA.toJS(o,"",t);if(r.has(n))throw Error("Ordered maps must not include duplicate keys");r.set(n,i)}return r}static from(e,t,r){let o=aU.createPairs(e,t,r),n=new this;return n.items=o.items,n}}ta.tag="tag:yaml.org,2002:omap";var Uoe={collection:"seq",identify:(e)=>e instanceof Map,nodeClass:ta,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){let r=aU.resolvePairs(e,t),o=[];for(let{key:n}of r.items)if(sU.isScalar(n))if(o.includes(n.value))t(`Ordered maps must not include duplicate keys: ${n.value}`);else o.push(n.value);return Object.assign(new ta,r)},createNode:(e,t,r)=>ta.from(e,t,r)};Moe.YAMLOMap=ta;Moe.omap=Uoe});var fU=ge(function(Koe){var cU=kt();function lU({value:e,source:t},r){if(t&&(e?uU:dU).test.test(t))return t;return e?r.options.trueStr:r.options.falseStr}var uU={identify:(e)=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new cU.Scalar(!0),stringify:lU},dU={identify:(e)=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new cU.Scalar(!1),stringify:lU};Koe.falseTag=dU;Koe.trueTag=uU});var pU=ge(function(Yoe){var Voe=kt(),EA=Kc(),Woe={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:(e)=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:EA.stringifyNumber},Goe={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:(e)=>parseFloat(e.replace(/_/g,"")),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():EA.stringifyNumber(e)}},Qoe={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new Voe.Scalar(parseFloat(e.replace(/_/g,""))),r=e.indexOf(".");if(r!==-1){let o=e.substring(r+1).replace(/_/g,"");if(o[o.length-1]==="0")t.minFractionDigits=o.length}return t},stringify:EA.stringifyNumber};Yoe.float=Qoe;Yoe.floatExp=Goe;Yoe.floatNaN=Woe});var hU=ge(function(sie){var mU=Kc(),Kd=(e)=>typeof e==="bigint"||Number.isInteger(e);function Bg(e,t,r,{intAsBigInt:o}){let n=e[0];if(n==="-"||n==="+")t+=1;if(e=e.substring(t).replace(/_/g,""),o){switch(r){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}let s=BigInt(e);return n==="-"?BigInt(-1)*s:s}let i=parseInt(e,r);return n==="-"?-1*i:i}function kA(e,t,r){let{value:o}=e;if(Kd(o)){let n=o.toString(t);return o<0?"-"+r+n.substr(1):r+n}return mU.stringifyNumber(e)}var rie={identify:Kd,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,r)=>Bg(e,2,2,r),stringify:(e)=>kA(e,2,"0b")},nie={identify:Kd,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,r)=>Bg(e,1,8,r),stringify:(e)=>kA(e,8,"0")},oie={identify:Kd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,r)=>Bg(e,0,10,r),stringify:mU.stringifyNumber},iie={identify:Kd,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,r)=>Bg(e,2,16,r),stringify:(e)=>kA(e,16,"0x")};sie.int=oie;sie.intBin=rie;sie.intHex=iie;sie.intOct=nie});var IA=ge(function(fie){var Ug=qe(),jg=Di(),Zg=Bi();class ra extends Zg.YAMLMap{constructor(e){super(e);this.tag=ra.tag}add(e){let t;if(Ug.isPair(e))t=e;else if(e&&typeof e==="object"&&"key"in e&&"value"in e&&e.value===null)t=new jg.Pair(e.key,null);else t=new jg.Pair(e,null);if(!Zg.findPair(this.items,t.key))this.items.push(t)}get(e,t){let r=Zg.findPair(this.items,e);return!t&&Ug.isPair(r)?Ug.isScalar(r.key)?r.key.value:r.key:r}set(e,t){if(typeof t!=="boolean")throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let r=Zg.findPair(this.items,e);if(r&&!t)this.items.splice(this.items.indexOf(r),1);else if(!r&&t)this.items.push(new jg.Pair(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);else throw Error("Set items must all have null values")}static from(e,t,r){let{replacer:o}=r,n=new this(e);if(t&&Symbol.iterator in Object(t))for(let i of t){if(typeof o==="function")i=o.call(t,i,i);n.items.push(jg.createPair(i,null,r))}return n}}ra.tag="tag:yaml.org,2002:set";var die={collection:"map",identify:(e)=>e instanceof Set,nodeClass:ra,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,r)=>ra.from(e,t,r),resolve(e,t){if(Ug.isMap(e))if(e.hasAllNullValues(!0))return Object.assign(new ra,e);else t("Set items must all have null values");else t("Expected a mapping for this tag");return e}};fie.YAMLSet=ra;fie.set=die});var TA=ge(function(bie){var hie=Kc();function AA(e,t){let r=e[0],o=r==="-"||r==="+"?e.substring(1):e,n=(s)=>t?BigInt(s):Number(s),i=o.replace(/_/g,"").split(":").reduce((s,a)=>s*n(60)+n(a),n(0));return r==="-"?n(-1)*i:i}function gU(e){let{value:t}=e,r=(s)=>s;if(typeof t==="bigint")r=(s)=>BigInt(s);else if(isNaN(t)||!isFinite(t))return hie.stringifyNumber(e);let o="";if(t<0)o="-",t*=r(-1);let n=r(60),i=[t%n];if(t<60)i.unshift(0);else if(t=(t-i[0])/n,i.unshift(t%n),t>=60)t=(t-i[0])/n,i.unshift(t);return o+i.map((s)=>String(s).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}var gie={identify:(e)=>typeof e==="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:r})=>AA(e,r),stringify:gU},yie={identify:(e)=>typeof e==="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:(e)=>AA(e,!1),stringify:gU},yU={identify:(e)=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){let t=e.match(yU.test);if(!t)throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");let[,r,o,n,i,s,a]=t.map(Number),c=t[7]?Number((t[7]+"00").substr(1,3)):0,u=Date.UTC(r,o-1,n,i||0,s||0,a||0,c),d=t[8];if(d&&d!=="Z"){let f=AA(d,!1);if(Math.abs(f)<30)f*=60;u-=60000*f}return new Date(u)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""};bie.floatTime=yie;bie.intTime=gie;bie.timestamp=yU});var SU=ge(function(Cie){var xie=qc(),_ie=Pg(),Eie=Fc(),kie=Md(),Iie=vA(),bU=fU(),RA=pU(),Mg=hU(),Aie=kg(),Tie=_A(),Rie=Lg(),$ie=IA(),$A=TA(),Oie=[xie.map,Eie.seq,kie.string,_ie.nullTag,bU.trueTag,bU.falseTag,Mg.intBin,Mg.intOct,Mg.int,Mg.intHex,RA.floatNaN,RA.floatExp,RA.float,Iie.binary,Aie.merge,Tie.omap,Rie.pairs,$ie.set,$A.intTime,$A.floatTime,$A.timestamp];Cie.schema=Oie});var RU=ge(function(Uie){var _U=qc(),zie=Pg(),EU=Fc(),Nie=Md(),Die=fA(),OA=mA(),CA=gA(),Lie=tU(),Bie=nU(),kU=vA(),Jd=kg(),IU=_A(),AU=Lg(),vU=SU(),TU=IA(),qg=TA(),wU=new Map([["core",Lie.schema],["failsafe",[_U.map,EU.seq,Nie.string]],["json",Bie.schema],["yaml11",vU.schema],["yaml-1.1",vU.schema]]),xU={binary:kU.binary,bool:Die.boolTag,float:OA.float,floatExp:OA.floatExp,floatNaN:OA.floatNaN,floatTime:qg.floatTime,int:CA.int,intHex:CA.intHex,intOct:CA.intOct,intTime:qg.intTime,map:_U.map,merge:Jd.merge,null:zie.nullTag,omap:IU.omap,pairs:AU.pairs,seq:EU.seq,set:TU.set,timestamp:qg.timestamp},jie={"tag:yaml.org,2002:binary":kU.binary,"tag:yaml.org,2002:merge":Jd.merge,"tag:yaml.org,2002:omap":IU.omap,"tag:yaml.org,2002:pairs":AU.pairs,"tag:yaml.org,2002:set":TU.set,"tag:yaml.org,2002:timestamp":qg.timestamp};function Zie(e,t,r){let o=wU.get(t);if(o&&!e)return r&&!o.includes(Jd.merge)?o.concat(Jd.merge):o.slice();let n=o;if(!n)if(Array.isArray(e))n=[];else{let i=Array.from(wU.keys()).filter((s)=>s!=="yaml11").map((s)=>JSON.stringify(s)).join(", ");throw Error(`Unknown schema "${t}"; use one of ${i} or define customTags array`)}if(Array.isArray(e))for(let i of e)n=n.concat(i);else if(typeof e==="function")n=e(n.slice());if(r)n=n.concat(Jd.merge);return n.reduce((i,s)=>{let a=typeof s==="string"?xU[s]:s;if(!a){let c=JSON.stringify(s),u=Object.keys(xU).map((d)=>JSON.stringify(d)).join(", ");throw Error(`Unknown custom tag ${c}; use one of ${u}`)}if(!i.includes(a))i.push(a);return i},[])}Uie.coreKnownTags=jie;Uie.getTags=Zie});var NA=ge(function(Vie){var PA=qe(),Fie=qc(),Kie=Fc(),Jie=Md(),Fg=RU(),Hie=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;class zA{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:o,schema:n,sortMapEntries:i,toStringDefaults:s}){this.compat=Array.isArray(e)?Fg.getTags(e,"compat"):e?Fg.getTags(null,e):null,this.name=typeof n==="string"&&n||"core",this.knownTags=o?Fg.coreKnownTags:{},this.tags=Fg.getTags(t,this.name,r),this.toStringOptions=s??null,Object.defineProperty(this,PA.MAP,{value:Fie.map}),Object.defineProperty(this,PA.SCALAR,{value:Jie.string}),Object.defineProperty(this,PA.SEQ,{value:Kie.seq}),this.sortMapEntries=typeof i==="function"?i:i===!0?Hie:null}clone(){let e=Object.create(zA.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}Vie.Schema=zA});var $U=ge(function(Yie){var Gie=qe(),DA=jd(),Hd=Dd();function Qie(e,t){let r=[],o=t.directives===!0;if(t.directives!==!1&&e.directives){let c=e.directives.toString(e);if(c)r.push(c),o=!0;else if(e.directives.docStart)o=!0}if(o)r.push("---");let n=DA.createStringifyContext(e,t),{commentString:i}=n.options;if(e.commentBefore){if(r.length!==1)r.unshift("");let c=i(e.commentBefore);r.unshift(Hd.indentComment(c,""))}let s=!1,a=null;if(e.contents){if(Gie.isNode(e.contents)){if(e.contents.spaceBefore&&o)r.push("");if(e.contents.commentBefore){let d=i(e.contents.commentBefore);r.push(Hd.indentComment(d,""))}n.forceBlockIndent=!!e.comment,a=e.contents.comment}let c=a?void 0:()=>s=!0,u=DA.stringify(e.contents,n,()=>a=null,c);if(a)u+=Hd.lineComment(u,"",i(a));if((u[0]==="|"||u[0]===">")&&r[r.length-1]==="---")r[r.length-1]=`--- ${u}`;else r.push(u)}else r.push(DA.stringify(e.contents,n));if(e.directives?.docEnd)if(e.comment){let c=i(e.comment);if(c.includes(`
|
|
315
|
+
`))r.push("..."),r.push(Hd.indentComment(c,""));else r.push(`... ${c}`)}else r.push("...");else{let c=e.comment;if(c&&s)c=c.replace(/^\n+/,"");if(c){if((!s||a)&&r[r.length-1]!=="")r.push("");r.push(Hd.indentComment(i(c),""))}}return r.join(`
|
|
316
|
+
`)+`
|
|
317
|
+
`}Yie.stringifyDocument=Qie});var Vd=ge(function(ase){var ese=zd(),Jc=bg(),Xr=qe(),tse=Di(),rse=Pi(),nse=NA(),ose=$U(),LA=hg(),ise=rA(),sse=Nd(),BA=tA();class jA{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Xr.NODE_TYPE,{value:Xr.DOC});let o=null;if(typeof t==="function"||Array.isArray(t))o=t;else if(r===void 0&&t)r=t,t=void 0;let n=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=n;let{version:i}=n;if(r?._directives){if(this.directives=r._directives.atDocument(),this.directives.yaml.explicit)i=this.directives.yaml.version}else this.directives=new BA.Directives({version:i});this.setSchema(i,r),this.contents=e===void 0?null:this.createNode(e,o,r)}clone(){let e=Object.create(jA.prototype,{[Xr.NODE_TYPE]:{value:Xr.DOC}});if(e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives)e.directives=this.directives.clone();if(e.schema=this.schema.clone(),e.contents=Xr.isNode(this.contents)?this.contents.clone(e.schema):this.contents,this.range)e.range=this.range.slice();return e}add(e){if(Hc(this.contents))this.contents.add(e)}addIn(e,t){if(Hc(this.contents))this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let r=LA.anchorNames(this);e.anchor=!t||r.has(t)?LA.findNewAnchor(t||"a",r):t}return new ese.Alias(e.anchor)}createNode(e,t,r){let o=void 0;if(typeof t==="function")e=t.call({"":e},"",e),o=t;else if(Array.isArray(t)){let y=(x)=>typeof x==="number"||x instanceof String||x instanceof Number,S=t.filter(y).map(String);if(S.length>0)t=t.concat(S);o=t}else if(r===void 0&&t)r=t,t=void 0;let{aliasDuplicateObjects:n,anchorPrefix:i,flow:s,keepUndefined:a,onTagObj:c,tag:u}=r??{},{onAnchor:d,setAnchors:f,sourceObjects:m}=LA.createNodeAnchors(this,i||"a"),h={aliasDuplicateObjects:n??!0,keepUndefined:a??!1,onAnchor:d,onTagObj:c,replacer:o,schema:this.schema,sourceObjects:m},b=sse.createNode(e,u,h);if(s&&Xr.isCollection(b))b.flow=!0;return f(),b}createPair(e,t,r={}){let o=this.createNode(e,null,r),n=this.createNode(t,null,r);return new tse.Pair(o,n)}delete(e){return Hc(this.contents)?this.contents.delete(e):!1}deleteIn(e){if(Jc.isEmptyPath(e)){if(this.contents==null)return!1;return this.contents=null,!0}return Hc(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Xr.isCollection(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){if(Jc.isEmptyPath(e))return!t&&Xr.isScalar(this.contents)?this.contents.value:this.contents;return Xr.isCollection(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Xr.isCollection(this.contents)?this.contents.has(e):!1}hasIn(e){if(Jc.isEmptyPath(e))return this.contents!==void 0;return Xr.isCollection(this.contents)?this.contents.hasIn(e):!1}set(e,t){if(this.contents==null)this.contents=Jc.collectionFromPath(this.schema,[e],t);else if(Hc(this.contents))this.contents.set(e,t)}setIn(e,t){if(Jc.isEmptyPath(e))this.contents=t;else if(this.contents==null)this.contents=Jc.collectionFromPath(this.schema,Array.from(e),t);else if(Hc(this.contents))this.contents.setIn(e,t)}setSchema(e,t={}){if(typeof e==="number")e=String(e);let r;switch(e){case"1.1":if(this.directives)this.directives.yaml.version="1.1";else this.directives=new BA.Directives({version:"1.1"});r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":if(this.directives)this.directives.yaml.version=e;else this.directives=new BA.Directives({version:e});r={resolveKnownTags:!0,schema:"core"};break;case null:if(this.directives)delete this.directives;r=null;break;default:{let o=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${o}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(r)this.schema=new nse.Schema(Object.assign(r,t));else throw Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:o,onAnchor:n,reviver:i}={}){let s={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof o==="number"?o:100},a=rse.toJS(this.contents,t??"",s);if(typeof n==="function")for(let{count:c,res:u}of s.anchors.values())n(u,c);return typeof i==="function"?ise.applyReviver(i,{"":a},"",a):a}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return ose.stringifyDocument(this,e)}}function Hc(e){if(Xr.isCollection(e))return!0;throw Error("Expected a YAML collection as document contents")}ase.Document=jA});var Wd=ge(function(use){class Kg extends Error{constructor(e,t,r,o){super();this.name=e,this.code=r,this.message=o,this.pos=t}}class OU extends Kg{constructor(e,t,r){super("YAMLParseError",e,t,r)}}class CU extends Kg{constructor(e,t,r){super("YAMLWarning",e,t,r)}}var lse=(e,t)=>(r)=>{if(r.pos[0]===-1)return;r.linePos=r.pos.map((a)=>t.linePos(a));let{line:o,col:n}=r.linePos[0];r.message+=` at line ${o}, column ${n}`;let i=n-1,s=e.substring(t.lineStarts[o-1],t.lineStarts[o]).replace(/[\n\r]+$/,"");if(i>=60&&s.length>80){let a=Math.min(i-39,s.length-79);s="\u2026"+s.substring(a),i-=a-1}if(s.length>80)s=s.substring(0,79)+"\u2026";if(o>1&&/^ *$/.test(s.substring(0,i))){let a=e.substring(t.lineStarts[o-2],t.lineStarts[o-1]);if(a.length>80)a=a.substring(0,79)+`\u2026
|
|
318
|
+
`;s=a+s}if(/[^ ]/.test(s)){let a=1,c=r.linePos[1];if(c?.line===o&&c.col>n)a=Math.max(1,Math.min(c.col-n,80-i));let u=" ".repeat(i)+"^".repeat(a);r.message+=`:
|
|
319
|
+
|
|
320
|
+
${s}
|
|
321
|
+
${u}
|
|
322
|
+
`}};use.YAMLError=Kg;use.YAMLParseError=OU;use.YAMLWarning=CU;use.prettifyError=lse});var Gd=ge(function(gse){function hse(e,{flow:t,indicator:r,next:o,offset:n,onError:i,parentIndent:s,startOnNewline:a}){let c=!1,u=a,d=a,f="",m="",h=!1,b=!1,y=null,S=null,x=null,_=null,A=null,O=null,L=null;for(let P of e){if(b){if(P.type!=="space"&&P.type!=="newline"&&P.type!=="comma")i(P.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");b=!1}if(y){if(u&&P.type!=="comment"&&P.type!=="newline")i(y,"TAB_AS_INDENT","Tabs are not allowed as indentation");y=null}switch(P.type){case"space":if(!t&&(r!=="doc-start"||o?.type!=="flow-collection")&&P.source.includes("\t"))y=P;d=!0;break;case"comment":{if(!d)i(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let W=P.source.substring(1)||" ";if(!f)f=W;else f+=m+W;m="",u=!1;break}case"newline":if(u){if(f)f+=P.source;else if(!O||r!=="seq-item-ind")c=!0}else m+=P.source;if(u=!0,h=!0,S||x)_=P;d=!0;break;case"anchor":if(S)i(P,"MULTIPLE_ANCHORS","A node can have at most one anchor");if(P.source.endsWith(":"))i(P.offset+P.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0);S=P,L??(L=P.offset),u=!1,d=!1,b=!0;break;case"tag":{if(x)i(P,"MULTIPLE_TAGS","A node can have at most one tag");x=P,L??(L=P.offset),u=!1,d=!1,b=!0;break}case r:if(S||x)i(P,"BAD_PROP_ORDER",`Anchors and tags must be after the ${P.source} indicator`);if(O)i(P,"UNEXPECTED_TOKEN",`Unexpected ${P.source} in ${t??"collection"}`);O=P,u=r==="seq-item-ind"||r==="explicit-key-ind",d=!1;break;case"comma":if(t){if(A)i(P,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`);A=P,u=!1,d=!1;break}default:i(P,"UNEXPECTED_TOKEN",`Unexpected ${P.type} token`),u=!1,d=!1}}let z=e[e.length-1],J=z?z.offset+z.source.length:n;if(b&&o&&o.type!=="space"&&o.type!=="newline"&&o.type!=="comma"&&(o.type!=="scalar"||o.source!==""))i(o.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space");if(y&&(u&&y.indent<=s||o?.type==="block-map"||o?.type==="block-seq"))i(y,"TAB_AS_INDENT","Tabs are not allowed as indentation");return{comma:A,found:O,spaceBefore:c,comment:f,hasNewline:h,anchor:S,tag:x,newlineAfterProp:_,end:J,start:L??J}}gse.resolveProps=hse});var Jg=ge(function(bse){function ZA(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
323
|
+
`))return!0;if(e.end){for(let t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(let t of e.items){for(let r of t.start)if(r.type==="newline")return!0;if(t.sep){for(let r of t.sep)if(r.type==="newline")return!0}if(ZA(t.key)||ZA(t.value))return!0}return!1;default:return!0}}bse.containsNewline=ZA});var UA=ge(function(xse){var vse=Jg();function wse(e,t,r){if(t?.type==="flow-collection"){let o=t.end[0];if(o.indent===e&&(o.source==="]"||o.source==="}")&&vse.containsNewline(t))r(o,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}xse.flowIndentCheck=wse});var MA=ge(function(kse){var PU=qe();function Ese(e,t,r){let{uniqueKeys:o}=e.options;if(o===!1)return!1;let n=typeof o==="function"?o:(i,s)=>i===s||PU.isScalar(i)&&PU.isScalar(s)&&i.value===s.value;return t.some((i)=>n(i.key,r))}kse.mapIncludes=Ese});var BU=ge(function(Ose){var zU=Di(),Ase=Bi(),NU=Gd(),Tse=Jg(),DU=UA(),Rse=MA(),LU="All mapping items must start at the same column";function $se({composeNode:e,composeEmptyNode:t},r,o,n,i){let a=new(i?.nodeClass??Ase.YAMLMap)(r.schema);if(r.atRoot)r.atRoot=!1;let c=o.offset,u=null;for(let d of o.items){let{start:f,key:m,sep:h,value:b}=d,y=NU.resolveProps(f,{indicator:"explicit-key-ind",next:m??h?.[0],offset:c,onError:n,parentIndent:o.indent,startOnNewline:!0}),S=!y.found;if(S){if(m){if(m.type==="block-seq")n(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key");else if("indent"in m&&m.indent!==o.indent)n(c,"BAD_INDENT",LU)}if(!y.anchor&&!y.tag&&!h){if(u=y.end,y.comment)if(a.comment)a.comment+=`
|
|
324
|
+
`+y.comment;else a.comment=y.comment;continue}if(y.newlineAfterProp||Tse.containsNewline(m))n(m??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else if(y.found?.indent!==o.indent)n(c,"BAD_INDENT",LU);r.atKey=!0;let x=y.end,_=m?e(r,m,y,n):t(r,x,f,null,y,n);if(r.schema.compat)DU.flowIndentCheck(o.indent,m,n);if(r.atKey=!1,Rse.mapIncludes(r,a.items,_))n(x,"DUPLICATE_KEY","Map keys must be unique");let A=NU.resolveProps(h??[],{indicator:"map-value-ind",next:b,offset:_.range[2],onError:n,parentIndent:o.indent,startOnNewline:!m||m.type==="block-scalar"});if(c=A.end,A.found){if(S){if(b?.type==="block-map"&&!A.hasNewline)n(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings");if(r.options.strict&&y.start<A.found.offset-1024)n(_.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key")}let O=b?e(r,b,A,n):t(r,c,h,null,A,n);if(r.schema.compat)DU.flowIndentCheck(o.indent,b,n);c=O.range[2];let L=new zU.Pair(_,O);if(r.options.keepSourceTokens)L.srcToken=d;a.items.push(L)}else{if(S)n(_.range,"MISSING_CHAR","Implicit map keys need to be followed by map values");if(A.comment)if(_.comment)_.comment+=`
|
|
325
|
+
`+A.comment;else _.comment=A.comment;let O=new zU.Pair(_);if(r.options.keepSourceTokens)O.srcToken=d;a.items.push(O)}}if(u&&u<c)n(u,"IMPOSSIBLE","Map comment with trailing content");return a.range=[o.offset,c,u??c],a}Ose.resolveBlockMap=$se});var jU=ge(function(Lse){var Pse=ji(),zse=Gd(),Nse=UA();function Dse({composeNode:e,composeEmptyNode:t},r,o,n,i){let a=new(i?.nodeClass??Pse.YAMLSeq)(r.schema);if(r.atRoot)r.atRoot=!1;if(r.atKey)r.atKey=!1;let c=o.offset,u=null;for(let{start:d,value:f}of o.items){let m=zse.resolveProps(d,{indicator:"seq-item-ind",next:f,offset:c,onError:n,parentIndent:o.indent,startOnNewline:!0});if(!m.found)if(m.anchor||m.tag||f)if(f?.type==="block-seq")n(m.end,"BAD_INDENT","All sequence items must start at the same column");else n(c,"MISSING_CHAR","Sequence item without - indicator");else{if(u=m.end,m.comment)a.comment=m.comment;continue}let h=f?e(r,f,m,n):t(r,m.end,d,null,m,n);if(r.schema.compat)Nse.flowIndentCheck(o.indent,f,n);c=h.range[2],a.items.push(h)}return a.range=[o.offset,c,u??c],a}Lse.resolveBlockSeq=Dse});var Vc=ge(function(Zse){function jse(e,t,r,o){let n="";if(e){let i=!1,s="";for(let a of e){let{source:c,type:u}=a;switch(u){case"space":i=!0;break;case"comment":{if(r&&!i)o(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");let d=c.substring(1)||" ";if(!n)n=d;else n+=s+d;s="";break}case"newline":if(n)s+=c;i=!0;break;default:o(a,"UNEXPECTED_TOKEN",`Unexpected ${u} at node end`)}t+=c.length}}return{comment:n,offset:t}}Zse.resolveEnd=jse});var MU=ge(function(Wse){var Mse=qe(),qse=Di(),ZU=Bi(),Fse=ji(),Kse=Vc(),UU=Gd(),Jse=Jg(),Hse=MA(),qA="Block collections are not allowed within flow collections",FA=(e)=>e&&(e.type==="block-map"||e.type==="block-seq");function Vse({composeNode:e,composeEmptyNode:t},r,o,n,i){let s=o.start.source==="{",a=s?"flow map":"flow sequence",u=new(i?.nodeClass??(s?ZU.YAMLMap:Fse.YAMLSeq))(r.schema);u.flow=!0;let d=r.atRoot;if(d)r.atRoot=!1;if(r.atKey)r.atKey=!1;let f=o.offset+o.start.source.length;for(let S=0;S<o.items.length;++S){let x=o.items[S],{start:_,key:A,sep:O,value:L}=x,z=UU.resolveProps(_,{flow:a,indicator:"explicit-key-ind",next:A??O?.[0],offset:f,onError:n,parentIndent:o.indent,startOnNewline:!1});if(!z.found){if(!z.anchor&&!z.tag&&!O&&!L){if(S===0&&z.comma)n(z.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(S<o.items.length-1)n(z.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`);if(z.comment)if(u.comment)u.comment+=`
|
|
326
|
+
`+z.comment;else u.comment=z.comment;f=z.end;continue}if(!s&&r.options.strict&&Jse.containsNewline(A))n(A,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(S===0){if(z.comma)n(z.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`)}else{if(!z.comma)n(z.start,"MISSING_CHAR",`Missing , between ${a} items`);if(z.comment){let J="";e:for(let P of _)switch(P.type){case"comma":case"space":break;case"comment":J=P.source.substring(1);break e;default:break e}if(J){let P=u.items[u.items.length-1];if(Mse.isPair(P))P=P.value??P.key;if(P.comment)P.comment+=`
|
|
327
|
+
`+J;else P.comment=J;z.comment=z.comment.substring(J.length+1)}}}if(!s&&!O&&!z.found){let J=L?e(r,L,z,n):t(r,z.end,O,null,z,n);if(u.items.push(J),f=J.range[2],FA(L))n(J.range,"BLOCK_IN_FLOW",qA)}else{r.atKey=!0;let J=z.end,P=A?e(r,A,z,n):t(r,J,_,null,z,n);if(FA(A))n(P.range,"BLOCK_IN_FLOW",qA);r.atKey=!1;let W=UU.resolveProps(O??[],{flow:a,indicator:"map-value-ind",next:L,offset:P.range[2],onError:n,parentIndent:o.indent,startOnNewline:!1});if(W.found){if(!s&&!z.found&&r.options.strict){if(O)for(let R of O){if(R===W.found)break;if(R.type==="newline"){n(R,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}if(z.start<W.found.offset-1024)n(W.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else if(L)if("source"in L&&L.source?.[0]===":")n(L,"MISSING_CHAR",`Missing space after : in ${a}`);else n(W.start,"MISSING_CHAR",`Missing , or : between ${a} items`);let ee=L?e(r,L,W,n):W.found?t(r,W.end,O,null,W,n):null;if(ee){if(FA(L))n(ee.range,"BLOCK_IN_FLOW",qA)}else if(W.comment)if(P.comment)P.comment+=`
|
|
328
|
+
`+W.comment;else P.comment=W.comment;let j=new qse.Pair(P,ee);if(r.options.keepSourceTokens)j.srcToken=x;if(s){let R=u;if(Hse.mapIncludes(r,R.items,P))n(J,"DUPLICATE_KEY","Map keys must be unique");R.items.push(j)}else{let R=new ZU.YAMLMap(r.schema);R.flow=!0,R.items.push(j);let B=(ee??P).range;R.range=[P.range[0],B[1],B[2]],u.items.push(R)}f=ee?ee.range[2]:W.end}}let m=s?"}":"]",[h,...b]=o.end,y=f;if(h?.source===m)y=h.offset+h.source.length;else{let S=a[0].toUpperCase()+a.substring(1),x=d?`${S} must end with a ${m}`:`${S} in block collection must be sufficiently indented and end with a ${m}`;if(n(f,d?"MISSING_CHAR":"BAD_INDENT",x),h&&h.source.length!==1)b.unshift(h)}if(b.length>0){let S=Kse.resolveEnd(b,y,r.options.strict,n);if(S.comment)if(u.comment)u.comment+=`
|
|
329
|
+
`+S.comment;else u.comment=S.comment;u.range=[o.offset,y,S.offset]}else u.range=[o.offset,y,y];return u}Wse.resolveFlowCollection=Vse});var qU=ge(function(iae){var Qse=qe(),Yse=kt(),Xse=Bi(),eae=ji(),tae=BU(),rae=jU(),nae=MU();function KA(e,t,r,o,n,i){let s=r.type==="block-map"?tae.resolveBlockMap(e,t,r,o,i):r.type==="block-seq"?rae.resolveBlockSeq(e,t,r,o,i):nae.resolveFlowCollection(e,t,r,o,i),a=s.constructor;if(n==="!"||n===a.tagName)return s.tag=a.tagName,s;if(n)s.tag=n;return s}function oae(e,t,r,o,n){let i=o.tag,s=!i?null:t.directives.tagName(i.source,(m)=>n(i,"TAG_RESOLVE_FAILED",m));if(r.type==="block-seq"){let{anchor:m,newlineAfterProp:h}=o,b=m&&i?m.offset>i.offset?m:i:m??i;if(b&&(!h||h.offset<b.offset))n(b,"MISSING_CHAR","Missing newline after block sequence props")}let a=r.type==="block-map"?"map":r.type==="block-seq"?"seq":r.start.source==="{"?"map":"seq";if(!i||!s||s==="!"||s===Xse.YAMLMap.tagName&&a==="map"||s===eae.YAMLSeq.tagName&&a==="seq")return KA(e,t,r,n,s);let c=t.schema.tags.find((m)=>m.tag===s&&m.collection===a);if(!c){let m=t.schema.knownTags[s];if(m?.collection===a)t.schema.tags.push(Object.assign({},m,{default:!1})),c=m;else{if(m)n(i,"BAD_COLLECTION_TYPE",`${m.tag} used for ${a} collection, but expects ${m.collection??"scalar"}`,!0);else n(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,!0);return KA(e,t,r,n,s)}}let u=KA(e,t,r,n,s,c),d=c.resolve?.(u,(m)=>n(i,"TAG_RESOLVE_FAILED",m),t.options)??u,f=Qse.isNode(d)?d:new Yse.Scalar(d);if(f.range=u.range,f.tag=s,c?.format)f.format=c.format;return f}iae.composeCollection=oae});var HA=ge(function(uae){var JA=kt();function aae(e,t,r){let o=t.offset,n=cae(t,e.options.strict,r);if(!n)return{value:"",type:null,comment:"",range:[o,o,o]};let i=n.mode===">"?JA.Scalar.BLOCK_FOLDED:JA.Scalar.BLOCK_LITERAL,s=t.source?lae(t.source):[],a=s.length;for(let y=s.length-1;y>=0;--y){let S=s[y][1];if(S===""||S==="\r")a=y;else break}if(a===0){let y=n.chomp==="+"&&s.length>0?`
|
|
330
|
+
`.repeat(Math.max(1,s.length-1)):"",S=o+n.length;if(t.source)S+=t.source.length;return{value:y,type:i,comment:n.comment,range:[o,S,S]}}let c=t.indent+n.indent,u=t.offset+n.length,d=0;for(let y=0;y<a;++y){let[S,x]=s[y];if(x===""||x==="\r"){if(n.indent===0&&S.length>c)c=S.length}else{if(S.length<c)r(u+S.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator");if(n.indent===0)c=S.length;if(d=y,c===0&&!e.atRoot)r(u,"BAD_INDENT","Block scalar values in collections must be indented");break}u+=S.length+x.length+1}for(let y=s.length-1;y>=a;--y)if(s[y][0].length>c)a=y+1;let f="",m="",h=!1;for(let y=0;y<d;++y)f+=s[y][0].slice(c)+`
|
|
331
|
+
`;for(let y=d;y<a;++y){let[S,x]=s[y];u+=S.length+x.length+1;let _=x[x.length-1]==="\r";if(_)x=x.slice(0,-1);if(x&&S.length<c){let O=`Block scalar lines must not be less indented than their ${n.indent?"explicit indentation indicator":"first line"}`;r(u-x.length-(_?2:1),"BAD_INDENT",O),S=""}if(i===JA.Scalar.BLOCK_LITERAL)f+=m+S.slice(c)+x,m=`
|
|
332
|
+
`;else if(S.length>c||x[0]==="\t"){if(m===" ")m=`
|
|
333
|
+
`;else if(!h&&m===`
|
|
334
|
+
`)m=`
|
|
335
|
+
|
|
336
|
+
`;f+=m+S.slice(c)+x,m=`
|
|
337
|
+
`,h=!0}else if(x==="")if(m===`
|
|
338
|
+
`)f+=`
|
|
339
|
+
`;else m=`
|
|
340
|
+
`;else f+=m+x,m=" ",h=!1}switch(n.chomp){case"-":break;case"+":for(let y=a;y<s.length;++y)f+=`
|
|
341
|
+
`+s[y][0].slice(c);if(f[f.length-1]!==`
|
|
342
|
+
`)f+=`
|
|
343
|
+
`;break;default:f+=`
|
|
344
|
+
`}let b=o+n.length+t.source.length;return{value:f,type:i,comment:n.comment,range:[o,b,b]}}function cae({offset:e,props:t},r,o){if(t[0].type!=="block-scalar-header")return o(t[0],"IMPOSSIBLE","Block scalar header not found"),null;let{source:n}=t[0],i=n[0],s=0,a="",c=-1;for(let m=1;m<n.length;++m){let h=n[m];if(!a&&(h==="-"||h==="+"))a=h;else{let b=Number(h);if(!s&&b)s=b;else if(c===-1)c=e+m}}if(c!==-1)o(c,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${n}`);let u=!1,d="",f=n.length;for(let m=1;m<t.length;++m){let h=t[m];switch(h.type){case"space":u=!0;case"newline":f+=h.source.length;break;case"comment":if(r&&!u)o(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");f+=h.source.length,d=h.source.substring(1);break;case"error":o(h,"UNEXPECTED_TOKEN",h.message),f+=h.source.length;break;default:{let b=`Unexpected token in block scalar header: ${h.type}`;o(h,"UNEXPECTED_TOKEN",b);let y=h.source;if(y&&typeof y==="string")f+=y.length}}}return{mode:i,indent:s,chomp:a,comment:d,length:f}}function lae(e){let t=e.split(/\n( *)/),r=t[0],o=r.match(/^( *)/),i=[o?.[1]?[o[1],r.slice(o[1].length)]:["",r]];for(let s=1;s<t.length;s+=2)i.push([t[s],t[s+1]]);return i}uae.resolveBlockScalar=aae});var WA=ge(function(vae){var VA=kt(),fae=Vc();function pae(e,t,r){let{offset:o,type:n,source:i,end:s}=e,a,c,u=(m,h,b)=>r(o+m,h,b);switch(n){case"scalar":a=VA.Scalar.PLAIN,c=mae(i,u);break;case"single-quoted-scalar":a=VA.Scalar.QUOTE_SINGLE,c=hae(i,u);break;case"double-quoted-scalar":a=VA.Scalar.QUOTE_DOUBLE,c=gae(i,u);break;default:return r(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${n}`),{value:"",type:null,comment:"",range:[o,o+i.length,o+i.length]}}let d=o+i.length,f=fae.resolveEnd(s,d,t,r);return{value:c,type:a,comment:f.comment,range:[o,d,f.offset]}}function mae(e,t){let r="";switch(e[0]){case"\t":r="a tab character";break;case",":r="flow indicator character ,";break;case"%":r="directive indicator character %";break;case"|":case">":{r=`block scalar indicator ${e[0]}`;break}case"@":case"`":{r=`reserved character ${e[0]}`;break}}if(r)t(0,"BAD_SCALAR_START",`Plain value cannot start with ${r}`);return FU(e)}function hae(e,t){if(e[e.length-1]!=="'"||e.length===1)t(e.length,"MISSING_CHAR","Missing closing 'quote");return FU(e.slice(1,-1)).replace(/''/g,"'")}function FU(e){let t,r;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
345
|
+
`,"sy"),r=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
346
|
+
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,r=/[ \t]*(.*?)[ \t]*\r?\n/sy}let o=t.exec(e);if(!o)return e;let n=o[1],i=" ",s=t.lastIndex;r.lastIndex=s;while(o=r.exec(e)){if(o[1]==="")if(i===`
|
|
347
|
+
`)n+=i;else i=`
|
|
348
|
+
`;else n+=i+o[1],i=" ";s=r.lastIndex}let a=/[ \t]*(.*)/sy;return a.lastIndex=s,o=a.exec(e),n+i+(o?.[1]??"")}function gae(e,t){let r="";for(let o=1;o<e.length-1;++o){let n=e[o];if(n==="\r"&&e[o+1]===`
|
|
349
|
+
`)continue;if(n===`
|
|
350
|
+
`){let{fold:i,offset:s}=yae(e,o);r+=i,o=s}else if(n==="\\"){let i=e[++o],s=bae[i];if(s)r+=s;else if(i===`
|
|
351
|
+
`){i=e[o+1];while(i===" "||i==="\t")i=e[++o+1]}else if(i==="\r"&&e[o+1]===`
|
|
352
|
+
`){i=e[++o+1];while(i===" "||i==="\t")i=e[++o+1]}else if(i==="x"||i==="u"||i==="U"){let a=i==="x"?2:i==="u"?4:8;r+=Sae(e,o+1,a,t),o+=a}else{let a=e.substr(o-1,2);t(o-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),r+=a}}else if(n===" "||n==="\t"){let i=o,s=e[o+1];while(s===" "||s==="\t")s=e[++o+1];if(s!==`
|
|
353
|
+
`&&!(s==="\r"&&e[o+2]===`
|
|
354
|
+
`))r+=o>i?e.slice(i,o+1):n}else r+=n}if(e[e.length-1]!=='"'||e.length===1)t(e.length,"MISSING_CHAR",'Missing closing "quote');return r}function yae(e,t){let r="",o=e[t+1];while(o===" "||o==="\t"||o===`
|
|
355
|
+
`||o==="\r"){if(o==="\r"&&e[t+2]!==`
|
|
356
|
+
`)break;if(o===`
|
|
357
|
+
`)r+=`
|
|
358
|
+
`;t+=1,o=e[t+1]}if(!r)r=" ";return{fold:r,offset:t}}var bae={"0":"\x00",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
359
|
+
`,r:"\r",t:"\t",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\","\t":"\t"};function Sae(e,t,r,o){let n=e.substr(t,r),s=n.length===r&&/^[0-9a-fA-F]+$/.test(n)?parseInt(n,16):NaN;try{return String.fromCodePoint(s)}catch{let a=e.substr(t-2,r+2);return o(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}}vae.resolveFlowScalar=pae});var JU=ge(function(Aae){var na=qe(),KU=kt(),xae=HA(),_ae=WA();function Eae(e,t,r,o){let{value:n,type:i,comment:s,range:a}=t.type==="block-scalar"?xae.resolveBlockScalar(e,t,o):_ae.resolveFlowScalar(t,e.options.strict,o),c=r?e.directives.tagName(r.source,(f)=>o(r,"TAG_RESOLVE_FAILED",f)):null,u;if(e.options.stringKeys&&e.atKey)u=e.schema[na.SCALAR];else if(c)u=kae(e.schema,n,c,r,o);else if(t.type==="scalar")u=Iae(e,n,t,o);else u=e.schema[na.SCALAR];let d;try{let f=u.resolve(n,(m)=>o(r??t,"TAG_RESOLVE_FAILED",m),e.options);d=na.isScalar(f)?f:new KU.Scalar(f)}catch(f){let m=f instanceof Error?f.message:String(f);o(r??t,"TAG_RESOLVE_FAILED",m),d=new KU.Scalar(n)}if(d.range=a,d.source=n,i)d.type=i;if(c)d.tag=c;if(u.format)d.format=u.format;if(s)d.comment=s;return d}function kae(e,t,r,o,n){if(r==="!")return e[na.SCALAR];let i=[];for(let a of e.tags)if(!a.collection&&a.tag===r)if(a.default&&a.test)i.push(a);else return a;for(let a of i)if(a.test?.test(t))return a;let s=e.knownTags[r];if(s&&!s.collection)return e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s;return n(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${r}`,r!=="tag:yaml.org,2002:str"),e[na.SCALAR]}function Iae({atKey:e,directives:t,schema:r},o,n,i){let s=r.tags.find((a)=>(a.default===!0||e&&a.default==="key")&&a.test?.test(o))||r[na.SCALAR];if(r.compat){let a=r.compat.find((c)=>c.default&&c.test?.test(o))??r[na.SCALAR];if(s.tag!==a.tag){let c=t.tagString(s.tag),u=t.tagString(a.tag),d=`Value may be parsed as either ${c} or ${u}`;i(n,"TAG_RESOLVE_FAILED",d,!0)}}return s}Aae.composeScalar=Eae});var HU=ge(function($ae){function Rae(e,t,r){if(t){r??(r=t.length);for(let o=r-1;o>=0;--o){let n=t[o];switch(n.type){case"space":case"comment":case"newline":e-=n.source.length;continue}n=t[++o];while(n?.type==="space")e+=n.source.length,n=t[++o];break}}return e}$ae.emptyScalarPosition=Rae});var GU=ge(function(jae){var Cae=zd(),Pae=qe(),zae=qU(),VU=JU(),Nae=Vc(),Dae=HU(),Lae={composeNode:WU,composeEmptyNode:GA};function WU(e,t,r,o){let n=e.atKey,{spaceBefore:i,comment:s,anchor:a,tag:c}=r,u,d=!0;switch(t.type){case"alias":if(u=Bae(e,t,o),a||c)o(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":if(u=VU.composeScalar(e,t,c,o),a)u.anchor=a.source.substring(1);break;case"block-map":case"block-seq":case"flow-collection":try{if(u=zae.composeCollection(Lae,e,t,r,o),a)u.anchor=a.source.substring(1)}catch(f){let m=f instanceof Error?f.message:String(f);o(t,"RESOURCE_EXHAUSTION",m)}break;default:{let f=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;o(t,"UNEXPECTED_TOKEN",f),d=!1}}if(u??(u=GA(e,t.offset,void 0,null,r,o)),a&&u.anchor==="")o(a,"BAD_ALIAS","Anchor cannot be an empty string");if(n&&e.options.stringKeys&&(!Pae.isScalar(u)||typeof u.value!=="string"||u.tag&&u.tag!=="tag:yaml.org,2002:str"))o(c??t,"NON_STRING_KEY","With stringKeys, all keys must be strings");if(i)u.spaceBefore=!0;if(s)if(t.type==="scalar"&&t.source==="")u.comment=s;else u.commentBefore=s;if(e.options.keepSourceTokens&&d)u.srcToken=t;return u}function GA(e,t,r,o,{spaceBefore:n,comment:i,anchor:s,tag:a,end:c},u){let d={type:"scalar",offset:Dae.emptyScalarPosition(t,r,o),indent:-1,source:""},f=VU.composeScalar(e,d,a,u);if(s){if(f.anchor=s.source.substring(1),f.anchor==="")u(s,"BAD_ALIAS","Anchor cannot be an empty string")}if(n)f.spaceBefore=!0;if(i)f.comment=i,f.range[2]=c;return f}function Bae({options:e},{offset:t,source:r,end:o},n){let i=new Cae.Alias(r.substring(1));if(i.source==="")n(t,"BAD_ALIAS","Alias cannot be an empty string");if(i.source.endsWith(":"))n(t+r.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);let s=t+r.length,a=Nae.resolveEnd(o,s,e.strict,n);if(i.range=[t,s,a.offset],a.comment)i.comment=a.comment;return i}jae.composeEmptyNode=GA;jae.composeNode=WU});var YU=ge(function(Jae){var Mae=Vd(),QU=GU(),qae=Vc(),Fae=Gd();function Kae(e,t,{offset:r,start:o,value:n,end:i},s){let a=Object.assign({_directives:t},e),c=new Mae.Document(void 0,a),u={atKey:!1,atRoot:!0,directives:c.directives,options:c.options,schema:c.schema},d=Fae.resolveProps(o,{indicator:"doc-start",next:n??i?.[0],offset:r,onError:s,parentIndent:0,startOnNewline:!0});if(d.found){if(c.directives.docStart=!0,n&&(n.type==="block-map"||n.type==="block-seq")&&!d.hasNewline)s(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")}c.contents=n?QU.composeNode(u,n,d,s):QU.composeEmptyNode(u,d.end,o,null,d,s);let f=c.contents.range[2],m=qae.resolveEnd(i,f,!1,s);if(m.comment)c.comment=m.comment;return c.range=[r,f,m.offset],c}Jae.composeDoc=Kae});var QA=ge(function(Xae){var Vae=qr("process"),Wae=tA(),Gae=Vd(),Qd=Wd(),XU=qe(),Qae=YU(),Yae=Vc();function Yd(e){if(typeof e==="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:r}=e;return[t,t+(typeof r==="string"?r.length:1)]}function e6(e){let t="",r=!1,o=!1;for(let n=0;n<e.length;++n){let i=e[n];switch(i[0]){case"#":t+=(t===""?"":o?`
|
|
360
|
+
|
|
361
|
+
`:`
|
|
362
|
+
`)+(i.substring(1)||" "),r=!0,o=!1;break;case"%":if(e[n+1]?.[0]!=="#")n+=1;r=!1;break;default:if(!r)o=!0;r=!1}}return{comment:t,afterEmptyLine:o}}class t6{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,r,o,n)=>{let i=Yd(t);if(n)this.warnings.push(new Qd.YAMLWarning(i,r,o));else this.errors.push(new Qd.YAMLParseError(i,r,o))},this.directives=new Wae.Directives({version:e.version||"1.2"}),this.options=e}decorate(e,t){let{comment:r,afterEmptyLine:o}=e6(this.prelude);if(r){let n=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
363
|
+
${r}`:r;else if(o||e.directives.docStart||!n)e.commentBefore=r;else if(XU.isCollection(n)&&!n.flow&&n.items.length>0){let i=n.items[0];if(XU.isPair(i))i=i.key;let s=i.commentBefore;i.commentBefore=s?`${r}
|
|
364
|
+
${s}`:r}else{let i=n.commentBefore;n.commentBefore=i?`${r}
|
|
365
|
+
${i}`:r}}if(t){for(let n=0;n<this.errors.length;++n)e.errors.push(this.errors[n]);for(let n=0;n<this.warnings.length;++n)e.warnings.push(this.warnings[n])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:e6(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(let o of e)yield*this.next(o);yield*this.end(t,r)}*next(e){if(Vae.env.LOG_STREAM)console.dir(e,{depth:null});switch(e.type){case"directive":this.directives.add(e.source,(t,r,o)=>{let n=Yd(e);n[0]+=t,this.onError(n,"BAD_DIRECTIVE",r,o)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{let t=Qae.composeDoc(this.options,this.directives,e,this.onError);if(this.atDirectives&&!t.directives.docStart)this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line");if(this.decorate(t,!1),this.doc)yield this.doc;this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new Qd.YAMLParseError(Yd(e),"UNEXPECTED_TOKEN",t);if(this.atDirectives||!this.doc)this.errors.push(r);else this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){this.errors.push(new Qd.YAMLParseError(Yd(e),"UNEXPECTED_TOKEN","Unexpected doc-end without preceding document"));break}this.doc.directives.docEnd=!0;let t=Yae.resolveEnd(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let r=this.doc.comment;this.doc.comment=r?`${r}
|
|
366
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Qd.YAMLParseError(Yd(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let r=Object.assign({_directives:this.directives},this.options),o=new Gae.Document(void 0,r);if(this.atDirectives)this.onError(t,"MISSING_CHAR","Missing directives-end indicator line");o.range=[0,t,t],this.decorate(o,!1),yield o}}}Xae.Composer=t6});var o6=ge(function(cce){var tce=HA(),rce=WA(),nce=Wd(),r6=Bd();function oce(e,t=!0,r){if(e){let o=(n,i,s)=>{let a=typeof n==="number"?n:Array.isArray(n)?n[0]:n.offset;if(r)r(a,i,s);else throw new nce.YAMLParseError([a,a+1],i,s)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return rce.resolveFlowScalar(e,t,o);case"block-scalar":return tce.resolveBlockScalar({options:{strict:t}},e,o)}}return null}function ice(e,t){let{implicitKey:r=!1,indent:o,inFlow:n=!1,offset:i=-1,type:s="PLAIN"}=t,a=r6.stringifyString({type:s,value:e},{implicitKey:r,indent:o>0?" ".repeat(o):"",inFlow:n,options:{blockQuote:!0,lineWidth:-1}}),c=t.end??[{type:"newline",offset:-1,indent:o,source:`
|
|
367
|
+
`}];switch(a[0]){case"|":case">":{let u=a.indexOf(`
|
|
368
|
+
`),d=a.substring(0,u),f=a.substring(u+1)+`
|
|
369
|
+
`,m=[{type:"block-scalar-header",offset:i,indent:o,source:d}];if(!n6(m,c))m.push({type:"newline",offset:-1,indent:o,source:`
|
|
370
|
+
`});return{type:"block-scalar",offset:i,indent:o,props:m,source:f}}case'"':return{type:"double-quoted-scalar",offset:i,indent:o,source:a,end:c};case"'":return{type:"single-quoted-scalar",offset:i,indent:o,source:a,end:c};default:return{type:"scalar",offset:i,indent:o,source:a,end:c}}}function sce(e,t,r={}){let{afterKey:o=!1,implicitKey:n=!1,inFlow:i=!1,type:s}=r,a="indent"in e?e.indent:null;if(o&&typeof a==="number")a+=2;if(!s)switch(e.type){case"single-quoted-scalar":s="QUOTE_SINGLE";break;case"double-quoted-scalar":s="QUOTE_DOUBLE";break;case"block-scalar":{let u=e.props[0];if(u.type!=="block-scalar-header")throw Error("Invalid block scalar header");s=u.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:s="PLAIN"}let c=r6.stringifyString({type:s,value:t},{implicitKey:n||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}});switch(c[0]){case"|":case">":ace(e,c);break;case'"':YA(e,c,"double-quoted-scalar");break;case"'":YA(e,c,"single-quoted-scalar");break;default:YA(e,c,"scalar")}}function ace(e,t){let r=t.indexOf(`
|
|
371
|
+
`),o=t.substring(0,r),n=t.substring(r+1)+`
|
|
372
|
+
`;if(e.type==="block-scalar"){let i=e.props[0];if(i.type!=="block-scalar-header")throw Error("Invalid block scalar header");i.source=o,e.source=n}else{let{offset:i}=e,s="indent"in e?e.indent:-1,a=[{type:"block-scalar-header",offset:i,indent:s,source:o}];if(!n6(a,"end"in e?e.end:void 0))a.push({type:"newline",offset:-1,indent:s,source:`
|
|
373
|
+
`});for(let c of Object.keys(e))if(c!=="type"&&c!=="offset")delete e[c];Object.assign(e,{type:"block-scalar",indent:s,props:a,source:n})}}function n6(e,t){if(t)for(let r of t)switch(r.type){case"space":case"comment":e.push(r);break;case"newline":return e.push(r),!0}return!1}function YA(e,t,r){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=r,e.source=t;break;case"block-scalar":{let o=e.props.slice(1),n=t.length;if(e.props[0].type==="block-scalar-header")n-=e.props[0].source.length;for(let i of o)i.offset+=n;delete e.props,Object.assign(e,{type:r,source:t,end:o});break}case"block-map":case"block-seq":{let n={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
|
|
374
|
+
`};delete e.items,Object.assign(e,{type:r,source:t,end:[n]});break}default:{let o="indent"in e?e.indent:-1,n="end"in e&&Array.isArray(e.end)?e.end.filter((i)=>i.type==="space"||i.type==="comment"||i.type==="newline"):[];for(let i of Object.keys(e))if(i!=="type"&&i!=="offset")delete e[i];Object.assign(e,{type:r,indent:o,source:t,end:n})}}}cce.createScalarToken=ice;cce.resolveAsScalar=oce;cce.setScalarValue=sce});var i6=ge(function(pce){var fce=(e)=>("type"in e)?Vg(e):Hg(e);function Vg(e){switch(e.type){case"block-scalar":{let t="";for(let r of e.props)t+=Vg(r);return t+e.source}case"block-map":case"block-seq":{let t="";for(let r of e.items)t+=Hg(r);return t}case"flow-collection":{let t=e.start.source;for(let r of e.items)t+=Hg(r);for(let r of e.end)t+=r.source;return t}case"document":{let t=Hg(e);if(e.end)for(let r of e.end)t+=r.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(let r of e.end)t+=r.source;return t}}}function Hg({start:e,key:t,sep:r,value:o}){let n="";for(let i of e)n+=i.source;if(t)n+=Vg(t);if(r)for(let i of r)n+=i.source;if(o)n+=Vg(o);return n}pce.stringify=fce});var c6=ge(function(gce){var XA=Symbol("break visit"),hce=Symbol("skip children"),s6=Symbol("remove item");function oa(e,t){if("type"in e&&e.type==="document")e={start:e.start,value:e.value};a6(Object.freeze([]),e,t)}oa.BREAK=XA;oa.SKIP=hce;oa.REMOVE=s6;oa.itemAtPath=(e,t)=>{let r=e;for(let[o,n]of t){let i=r?.[o];if(i&&"items"in i)r=i.items[n];else return}return r};oa.parentCollection=(e,t)=>{let r=oa.itemAtPath(e,t.slice(0,-1)),o=t[t.length-1][0],n=r?.[o];if(n&&"items"in n)return n;throw Error("Parent collection not found")};function a6(e,t,r){let o=r(t,e);if(typeof o==="symbol")return o;for(let n of["key","value"]){let i=t[n];if(i&&"items"in i){for(let s=0;s<i.items.length;++s){let a=a6(Object.freeze(e.concat([[n,s]])),i.items[s],r);if(typeof a==="number")s=a-1;else if(a===XA)return XA;else if(a===s6)i.items.splice(s,1),s-=1}if(typeof o==="function"&&n==="key")o=o(t,e)}}return typeof o==="function"?o(t,e):o}gce.visit=oa});var Wg=ge(function(Ece){var eT=o6(),bce=i6(),Sce=c6(),tT="\uFEFF",rT="\x02",nT="\x18",oT="\x1F",vce=(e)=>!!e&&("items"in e),wce=(e)=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function xce(e){switch(e){case tT:return"<BOM>";case rT:return"<DOC>";case nT:return"<FLOW_END>";case oT:return"<SCALAR>";default:return JSON.stringify(e)}}function _ce(e){switch(e){case tT:return"byte-order-mark";case rT:return"doc-mode";case nT:return"flow-error-end";case oT:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
375
|
+
`:case`\r
|
|
376
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case"\t":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}Ece.createScalarToken=eT.createScalarToken;Ece.resolveAsScalar=eT.resolveAsScalar;Ece.setScalarValue=eT.setScalarValue;Ece.stringify=bce.stringify;Ece.visit=Sce.visit;Ece.BOM=tT;Ece.DOCUMENT=rT;Ece.FLOW_END=nT;Ece.SCALAR=oT;Ece.isCollection=vce;Ece.isScalar=wce;Ece.prettyToken=xce;Ece.tokenType=_ce});var sT=ge(function(Zce){var Xd=Wg();function bn(e){switch(e){case void 0:case" ":case`
|
|
377
|
+
`:case"\r":case"\t":return!0;default:return!1}}var l6=new Set("0123456789ABCDEFabcdef"),Bce=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Gg=new Set(",[]{}"),jce=new Set(` ,[]{}
|
|
378
|
+
\r `),iT=(e)=>!e||jce.has(e);class u6{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let r=this.next??"stream";while(r&&(t||this.hasChars(1)))r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];while(t===" "||t==="\t")t=this.buffer[++e];if(!t||t==="#"||t===`
|
|
379
|
+
`)return!0;if(t==="\r")return this.buffer[e+1]===`
|
|
380
|
+
`;return!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;while(t===" ")t=this.buffer[++r+e];if(t==="\r"){let o=this.buffer[r+e+1];if(o===`
|
|
381
|
+
`||!o&&!this.atEnd)return e+r+1}return t===`
|
|
382
|
+
`||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){let r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&bn(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;if(typeof e!=="number"||e!==-1&&e<this.pos)e=this.buffer.indexOf(`
|
|
383
|
+
`,this.pos),this.lineEndPos=e;if(e===-1)return this.atEnd?this.buffer.substring(this.pos):null;if(this.buffer[e-1]==="\r")e-=1;return this.buffer.substring(this.pos,e)}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Xd.BOM)yield*this.pushCount(1),e=e.substring(1);if(e[0]==="%"){let t=e.length,r=e.indexOf("#");while(r!==-1){let n=e[r-1];if(n===" "||n==="\t"){t=r-1;break}else r=e.indexOf("#",r+1)}while(!0){let n=e[t-1];if(n===" "||n==="\t")t-=1;else break}let o=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-o),this.pushNewline(),"stream"}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield Xd.DOCUMENT,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");let t=this.peek(3);if((t==="---"||t==="...")&&bn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}if(this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!bn(this.charAt(1)))this.indentNext=this.indentValue;return yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&bn(t)){let r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(iT),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,r=-1;do{if(e=yield*this.pushNewline(),e>0)t=yield*this.pushSpaces(!1),this.indentValue=r=t;else t=0;t+=yield*this.pushSpaces(!0)}while(e+t>0);let o=this.getLine();if(o===null)return this.setNext("flow");if(r!==-1&&r<this.indentNext&&o[0]!=="#"||r===0&&(o.startsWith("---")||o.startsWith("..."))&&bn(o[3])){if(!(r===this.indentNext-1&&this.flowLevel===1&&(o[0]==="]"||o[0]==="}")))return this.flowLevel=0,yield Xd.FLOW_END,yield*this.parseLineStart()}let n=0;while(o[n]===",")n+=yield*this.pushCount(1),n+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(n+=yield*this.pushIndicators(),o[n]){case void 0:return"flow";case"#":return yield*this.pushCount(o.length-n),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(iT),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{let i=this.charAt(1);if(this.flowKey||bn(i)||i===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e==="'")while(t!==-1&&this.buffer[t+1]==="'")t=this.buffer.indexOf("'",t+2);else while(t!==-1){let n=0;while(this.buffer[t-1-n]==="\\")n+=1;if(n%2===0)break;t=this.buffer.indexOf('"',t+1)}let r=this.buffer.substring(0,t),o=r.indexOf(`
|
|
384
|
+
`,this.pos);if(o!==-1){while(o!==-1){let n=this.continueScalar(o+1);if(n===-1)break;o=r.indexOf(`
|
|
385
|
+
`,n)}if(o!==-1)t=o-(r[o-1]==="\r"?2:1)}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;while(!0){let t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil((t)=>bn(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,r;e:for(let n=this.pos;r=this.buffer[n];++n)switch(r){case" ":t+=1;break;case`
|
|
386
|
+
`:e=n,t=0;break;case"\r":{let i=this.buffer[n+1];if(!i&&!this.atEnd)return this.setNext("block-scalar");if(i===`
|
|
387
|
+
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){if(this.blockScalarIndent===-1)this.indentNext=t;else this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let n=this.continueScalar(e+1);if(n===-1)break;e=this.buffer.indexOf(`
|
|
388
|
+
`,n)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let o=e+1;r=this.buffer[o];while(r===" ")r=this.buffer[++o];if(r==="\t"){while(r==="\t"||r===" "||r==="\r"||r===`
|
|
389
|
+
`)r=this.buffer[++o];e=o-1}else if(!this.blockScalarKeep)do{let n=e-1,i=this.buffer[n];if(i==="\r")i=this.buffer[--n];let s=n;while(i===" ")i=this.buffer[--n];if(i===`
|
|
390
|
+
`&&n>=this.pos&&n+1+t>s)e=n;else break}while(!0);return yield Xd.SCALAR,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,r=this.pos-1,o;while(o=this.buffer[++r])if(o===":"){let n=this.buffer[r+1];if(bn(n)||e&&Gg.has(n))break;t=r}else if(bn(o)){let n=this.buffer[r+1];if(o==="\r")if(n===`
|
|
391
|
+
`)r+=1,o=`
|
|
392
|
+
`,n=this.buffer[r+1];else t=r;if(n==="#"||e&&Gg.has(n))break;if(o===`
|
|
393
|
+
`){let i=this.continueScalar(r+1);if(i===-1)break;r=Math.max(r,i-2)}}else{if(e&&Gg.has(o))break;t=r}if(!o&&!this.atEnd)return this.setNext("plain-scalar");return yield Xd.SCALAR,yield*this.pushToIndex(t+1,!0),e?"flow":"doc"}*pushCount(e){if(e>0)return yield this.buffer.substr(this.pos,e),this.pos+=e,e;return 0}*pushToIndex(e,t){let r=this.buffer.slice(this.pos,e);if(r)return yield r,this.pos+=r.length,r.length;else if(t)yield"";return 0}*pushIndicators(){let e=0;e:while(!0){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(iT),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{let t=this.flowLevel>0,r=this.charAt(1);if(bn(r)||t&&Gg.has(r)){if(!t)this.indentNext=this.indentValue+1;else if(this.flowKey)this.flowKey=!1;e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];while(!bn(t)&&t!==">")t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];while(t)if(Bce.has(t))t=this.buffer[++e];else if(t==="%"&&l6.has(this.buffer[e+1])&&l6.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];if(e===`
|
|
394
|
+
`)return yield*this.pushCount(1);else if(e==="\r"&&this.charAt(1)===`
|
|
395
|
+
`)return yield*this.pushCount(2);else return 0}*pushSpaces(e){let t=this.pos-1,r;do r=this.buffer[++t];while(r===" "||e&&r==="\t");let o=t-this.pos;if(o>0)yield this.buffer.substr(this.pos,o),this.pos=t;return o}*pushUntil(e){let t=this.pos,r=this.buffer[t];while(!e(r))r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}Zce.Lexer=u6});var aT=ge(function(Mce){class d6{constructor(){this.lineStarts=[],this.addNewLine=(e)=>this.lineStarts.push(e),this.linePos=(e)=>{let t=0,r=this.lineStarts.length;while(t<r){let n=t+r>>1;if(this.lineStarts[n]<e)t=n+1;else r=n}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let o=this.lineStarts[t-1];return{line:t,col:e-o+1}}}}Mce.LineCounter=d6});var cT=ge(function(Jce){var Fce=qr("process"),f6=Wg(),Kce=sT();function Zi(e,t){for(let r=0;r<e.length;++r)if(e[r].type===t)return!0;return!1}function p6(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function h6(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Qg(e){switch(e.type){case"document":return e.start;case"block-map":{let t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Wc(e){if(e.length===0)return[];let t=e.length;e:while(--t>=0)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}while(e[++t]?.type==="space");return e.splice(t,e.length)}function Yg(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let r=0;r<t.length;++r)e.push(t[r])}function m6(e){if(e.start.type==="flow-seq-start"){for(let t of e.items)if(t.sep&&!t.value&&!Zi(t.start,"explicit-key-ind")&&!Zi(t.sep,"map-value-ind")){if(t.key)t.value=t.key;if(delete t.key,h6(t.value))if(t.value.end)Yg(t.value.end,t.sep);else t.value.end=t.sep;else Yg(t.start,t.sep);delete t.sep}}}class g6{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Kce.Lexer,this.onNewLine=e}*parse(e,t=!1){if(this.onNewLine&&this.offset===0)this.onNewLine(0);for(let r of this.lexer.lex(e,t))yield*this.next(r);if(!t)yield*this.end()}*next(e){if(this.source=e,Fce.env.LOG_TOKENS)console.log("|",f6.prettyToken(e));if(this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=f6.tokenType(e);if(!t){let r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}else if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":if(this.atNewLine=!0,this.indent=0,this.onNewLine)this.onNewLine(this.offset+e.length);break;case"space":if(this.atNewLine&&e[0]===" ")this.indent+=e.length;break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":if(this.atNewLine)this.indent+=e.length;break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){while(this.stack.length>0)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){while(this.stack.length>0)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{let r=this.peek(1);if(t.type==="block-scalar")t.indent="indent"in r?r.indent:0;else if(t.type==="flow-collection"&&r.type==="document")t.indent=0;if(t.type==="flow-collection")m6(t);switch(r.type){case"document":r.value=t;break;case"block-scalar":r.props.push(t);break;case"block-map":{let o=r.items[r.items.length-1];if(o.value){r.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(o.sep)o.value=t;else{Object.assign(o,{key:t,sep:[]}),this.onKeyLine=!o.explicitKey;return}break}case"block-seq":{let o=r.items[r.items.length-1];if(o.value)r.items.push({start:[],value:t});else o.value=t;break}case"flow-collection":{let o=r.items[r.items.length-1];if(!o||o.value)r.items.push({start:[],key:t,sep:[]});else if(o.sep)o.value=t;else Object.assign(o,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){let o=t.items[t.items.length-1];if(o&&!o.sep&&!o.value&&o.start.length>0&&p6(o.start)===-1&&(t.indent===0||o.start.every((n)=>n.type!=="comment"||n.indent<t.indent))){if(r.type==="document")r.end=o.start;else r.items.push({start:o.start});t.items.splice(-1,1)}}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{let e={type:"document",offset:this.offset,start:[]};if(this.type==="doc-start")e.start.push(this.sourceToken);this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{if(p6(e.start)!==-1)yield*this.pop(),yield*this.step();else e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);if(t)this.stack.push(t);else yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){let t=Qg(this.peek(2)),r=Wc(t),o;if(e.end)o=e.end,o.push(this.sourceToken),delete e.end;else o=[this.sourceToken];let n={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=n}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
396
|
+
`)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
397
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){let r="end"in t.value?t.value.end:void 0;if((Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment")r?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){let o=e.items[e.items.length-2]?.value?.end;if(Array.isArray(o)){Yg(o,t.start),o.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let r=!this.onKeyLine&&this.indent===e.indent,o=r&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind",n=[];if(o&&t.sep&&!t.value){let i=[];for(let s=0;s<t.sep.length;++s){let a=t.sep[s];switch(a.type){case"newline":i.push(s);break;case"space":break;case"comment":if(a.indent>e.indent)i.length=0;break;default:i.length=0}}if(i.length>=2)n=t.sep.splice(i[1])}switch(this.type){case"anchor":case"tag":if(o||t.value)n.push(this.sourceToken),e.items.push({start:n}),this.onKeyLine=!0;else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"explicit-key-ind":if(!t.sep&&!t.explicitKey)t.start.push(this.sourceToken),t.explicitKey=!0;else if(o||t.value)n.push(this.sourceToken),e.items.push({start:n,explicitKey:!0});else this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]});this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(!t.sep)if(Zi(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let i=Wc(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]})}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Zi(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:n,key:null,sep:[this.sourceToken]}]});else if(h6(t.key)&&!Zi(t.sep,"newline")){let i=Wc(t.start),s=t.key,a=t.sep;a.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:s,sep:a}]})}else if(n.length>0)t.sep=t.sep.concat(n,this.sourceToken);else t.sep.push(this.sourceToken);else if(!t.sep)Object.assign(t,{key:null,sep:[this.sourceToken]});else if(t.value||o)e.items.push({start:n,key:null,sep:[this.sourceToken]});else if(Zi(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]});else t.sep.push(this.sourceToken);this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let i=this.flowScalar(this.type);if(o||t.value)e.items.push({start:n,key:i,sep:[]}),this.onKeyLine=!0;else if(t.sep)this.stack.push(i);else Object.assign(t,{key:i,sep:[]}),this.onKeyLine=!0;return}default:{let i=this.startBlockValue(e);if(i){if(i.type==="block-seq"){if(!t.explicitKey&&t.sep&&!Zi(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else if(r)e.items.push({start:n});this.stack.push(i);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){let r="end"in t.value?t.value.end:void 0;if((Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment")r?.push(this.sourceToken);else e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){let o=e.items[e.items.length-2]?.value?.end;if(Array.isArray(o)){Yg(o,t.start),o.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;if(t.value||Zi(t.start,"seq-item-ind"))e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return}if(this.indent>e.indent){let r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":if(!t||t.sep)e.items.push({start:[this.sourceToken]});else t.start.push(this.sourceToken);return;case"map-value-ind":if(!t||t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":if(!t||t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{let o=this.flowScalar(this.type);if(!t||t.value)e.items.push({start:[],key:o,sep:[]});else if(t.sep)this.stack.push(o);else Object.assign(t,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}let r=this.startBlockValue(e);if(r)this.stack.push(r);else yield*this.pop(),yield*this.step()}else{let r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){let o=Qg(r),n=Wc(o);m6(e);let i=e.end.splice(1,e.end.length);i.push(this.sourceToken);let s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
398
|
+
`)+1;while(t!==0)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
399
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;let t=Qg(e),r=Wc(t);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;let t=Qg(e),r=Wc(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){if(this.type!=="comment")return!1;if(this.indent<=t)return!1;return e.every((r)=>r.type==="newline"||r.type==="space")}*documentEnd(e){if(this.type!=="doc-mode"){if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:if(e.end)e.end.push(this.sourceToken);else e.end=[this.sourceToken];if(this.type==="newline")yield*this.pop()}}}Jce.Parser=g6});var w6=ge(function(tle){var y6=QA(),Vce=Vd(),ef=Wd(),Wce=aA(),Gce=qe(),Qce=aT(),b6=cT();function S6(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new Qce.LineCounter||null,prettyErrors:t}}function Yce(e,t={}){let{lineCounter:r,prettyErrors:o}=S6(t),n=new b6.Parser(r?.addNewLine),i=new y6.Composer(t),s=Array.from(i.compose(n.parse(e)));if(o&&r)for(let a of s)a.errors.forEach(ef.prettifyError(e,r)),a.warnings.forEach(ef.prettifyError(e,r));if(s.length>0)return s;return Object.assign([],{empty:!0},i.streamInfo())}function v6(e,t={}){let{lineCounter:r,prettyErrors:o}=S6(t),n=new b6.Parser(r?.addNewLine),i=new y6.Composer(t),s=null;for(let a of i.compose(n.parse(e),!0,e.length))if(!s)s=a;else if(s.options.logLevel!=="silent"){s.errors.push(new ef.YAMLParseError(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}if(o&&r)s.errors.forEach(ef.prettifyError(e,r)),s.warnings.forEach(ef.prettifyError(e,r));return s}function Xce(e,t,r){let o=void 0;if(typeof t==="function")o=t;else if(r===void 0&&t&&typeof t==="object")r=t;let n=v6(e,r);if(!n)return null;if(n.warnings.forEach((i)=>Wce.warn(n.options.logLevel,i)),n.errors.length>0)if(n.options.logLevel!=="silent")throw n.errors[0];else n.errors=[];return n.toJS(Object.assign({reviver:o},r))}function ele(e,t,r){let o=null;if(typeof t==="function"||Array.isArray(t))o=t;else if(r===void 0&&t)r=t;if(typeof r==="string")r=r.length;if(typeof r==="number"){let n=Math.round(r);r=n<1?void 0:n>8?{indent:8}:{indent:n}}if(e===void 0){let{keepUndefined:n}=r??t??{};if(!n)return}if(Gce.isDocument(e)&&!o)return e.toString(r);return new Vce.Document(e,o,r).toString(r)}tle.parse=Xce;tle.parseAllDocuments=Yce;tle.parseDocument=v6;tle.stringify=ele});var sle,ale,cle,lT,lle,Ui,ule,dle,fle,ple,FOe,mle,hle,gle,Xg,x6,yle,ble,Sle,vle,wle,xle,_le,Ele,kle,Ile,Sn,Ro,Ale,$o,uT,Tle,Rle,$le,Ole,Cle,Ple,zle,Nle,Dle,en,Lle,Ble,jle;var Gc=v(()=>{sle=QA(),ale=Vd(),cle=NA(),lT=Wd(),lle=zd(),Ui=qe(),ule=Di(),dle=kt(),fle=Bi(),ple=ji(),FOe=Wg(),mle=sT(),hle=aT(),gle=cT(),Xg=w6(),x6=Cd();yle=sle.Composer,ble=ale.Document,Sle=cle.Schema,vle=lT.YAMLError,wle=lT.YAMLParseError,xle=lT.YAMLWarning,_le=lle.Alias,Ele=Ui.isAlias,kle=Ui.isCollection,Ile=Ui.isDocument,Sn=Ui.isMap,Ro=Ui.isNode,Ale=Ui.isPair,$o=Ui.isScalar,uT=Ui.isSeq,Tle=ule.Pair,Rle=dle.Scalar,$le=fle.YAMLMap,Ole=ple.YAMLSeq,Cle=mle.Lexer,Ple=hle.LineCounter,zle=gle.Parser,Nle=Xg.parse,Dle=Xg.parseAllDocuments,en=Xg.parseDocument,Lle=Xg.stringify,Ble=x6.visit,jle=x6.visitAsync});var I6={};Lt(I6,{migratePilotDeploySecrets:()=>E6,migratePilotEnvSchema:()=>k6,migratePilotRepoProviderKeys:()=>Hle,migrateProviderKeyFieldsYaml:()=>pT,openaiSelectorFor:()=>mT,renameProviderKeyFields:()=>Mi});import{readdir as Zle,readFile as dT,writeFile as _6}from"fs/promises";import{join as Oo}from"path";function pT(e){let t=en(e,{keepSourceTokens:!0});return Mi(t)?t.toString({lineWidth:0}):e}function Mi(e){if(!Sn(e.contents))return!1;return e.contents.items.filter((r)=>{if(!$o(r.key)||typeof r.key.value!=="string")return!1;let o=Ule[r.key.value];if(!o)return!1;if(r.key.value==="aiApiKey"&&$o(r.value)&&r.value.value===ty)r.value.value=ry;return r.key.value=o,!0}).length>0}function mT(e){return e===ty?ry:e}function E6(e){return e.replace(new RegExp(`^(\\s+- )${ty}$`,"m"),`$1${ry}`)}function k6(e){return e.replace(new RegExp(`^${ty}=`,"m"),`${ry}=`)}async function ey(e){try{return(await Zle(e)).filter((r)=>r.endsWith(".yaml")).sort()}catch{return[]}}async function fT(e){try{return await dT(e,"utf8")}catch{return}}async function Kle(e){let t=await ey(Oo(e,"cohorts")),r=await Promise.all(t.map(async(i)=>{let s=yr(await dT(Oo(e,"cohorts",i),"utf8"),qle);return s.ok&&s.data.aiApiKeyOverride?s.data.members:[]})),o=(await ey(Oo(e,"users"))).filter((i)=>!i.endsWith(".secrets.yaml")),n=await Promise.all(o.map(async(i)=>{let s=yr(await dT(Oo(e,"users",i),"utf8"),Mle);return s.ok&&s.data.aiApiKeyOverride?[i.replace(/\.yaml$/,"")]:[]}));return[...new Set([...r.flat(),...n.flat()])]}async function Jle(e,t,r,o){let n=Oo(e,"users",`${t}.secrets.yaml.age`),i=await fT(n);if(i===void 0)return!1;if(!r)throw Error(`users/${t}.secrets.yaml.age may hold the legacy AI key; set AGE_SECRET_KEY or AGE_SECRET_KEY_FILE to migrate it`);let s=new Au;s.addIdentity(r);let a=await s.decrypt(hi.decode(i),"text"),c=pT(a);if(c===a)return!1;let u=new Iu;return u.addRecipient(o),await _6(n,hi.encode(await u.encrypt(c))),!0}async function Hle(e,t){let r=["pilot.yaml",...(await ey(Oo(e,"cohorts"))).map((c)=>`cohorts/${c}`),...(await ey(Oo(e,"users"))).filter((c)=>!c.endsWith(".secrets.yaml")).map((c)=>`users/${c}`)],o=await Kle(e),n=await Promise.all([...r.map((c)=>({file:c,migrate:pT})),{file:".env.schema",migrate:k6},{file:"deploy/kamal/deploy.yml",migrate:E6}].map(async({file:c,migrate:u})=>{let d=Oo(e,c),f=await fT(d);if(f===void 0)return[];let m=u(f);if(m===f)return[];return await _6(d,m),[c]})),i=yr(await fT(Oo(e,"pilot.yaml"))??"",Fle),s=VI(e,t,Dr(e)),a=o.length===0?[]:await Promise.all(o.map(async(c)=>{if(!i.ok)throw Error("pilot.yaml needs agePublicKey to re-encrypt secrets");return await Jle(e,c,s,i.data.agePublicKey)?[`users/${c}.secrets.yaml.age`]:[]}));return[...n.flat(),...a.flat()]}var ty="AI_API_KEY",ry="OPENAI_API_KEY",Ule,Mle,qle,Fle;var ny=v(()=>{mi();bi();Hn();pe();Gc();GI();Ule={aiApiKey:"openaiApiKey",aiApiKeyOverride:"openaiApiKeyOverride"};Mle=l.looseObject({aiApiKeyOverride:l.string().optional()}),qle=l.looseObject({members:l.array(l.string()).default([]),aiApiKeyOverride:l.string().optional()}),Fle=l.looseObject({agePublicKey:l.string()})});function $6(e){if(e==="core")return{bundles:["core","media","web","chat"]};if(e==="default")return{bundles:["core","media","automation","web","chat","site","publishing","federation"],add:["obsidian-vault"],remove:[...Gle]};return{bundles:["core","media","automation","web","chat","site","publishing","federation"],add:["obsidian-vault"]}}function Qle(e){let t=Vle.parse(e);return Gs.parse({brainVersion:t.brainVersion,bundleContract:Ws,...$6(t.preset),githubOrg:t.githubOrg,contentRepoPrefix:t.contentRepoPrefix,domainSuffix:t.domainSuffix,openaiApiKey:mT(t.aiApiKey),gitSyncToken:t.gitSyncToken,contentRepoAdminToken:t.contentRepoAdminToken,agePublicKey:t.agePublicKey})}function Yle(e){let t=Wle.parse(e),r=t.presetOverride?$6(t.presetOverride):void 0;return mn.parse({members:[...t.members],...t.brainVersionOverride?{brainVersionOverride:t.brainVersionOverride}:{},...r?{bundlesOverride:r.bundles,...r.add?{addOverride:r.add}:{},...r.remove?{removeOverride:r.remove}:{}}:{},...t.aiApiKeyOverride?{openaiApiKeyOverride:t.aiApiKeyOverride}:{},...t.gitSyncTokenOverride?{gitSyncTokenOverride:t.gitSyncTokenOverride}:{}})}function O6(e){let t=en(e,{keepSourceTokens:!0});if(t.errors.length>0)throw Error(`Invalid desired-state YAML: ${t.errors[0]?.message}`);if(!Sn(t.contents))throw Error("Desired-state YAML must contain a mapping");return t}function hT(e,t){if(!Sn(e.contents))return;return e.contents.items.find((r)=>$o(r.key)&&r.key.value===t)}function A6(e,t){if(!Ro(e)||!Ro(t))return;if(e.commentBefore!==void 0)t.commentBefore=e.commentBefore;if(e.comment!==void 0)t.comment=e.comment;if(e.spaceBefore!==void 0)t.spaceBefore=e.spaceBefore}function T6(e,t){if(!e||!Ro(t))return;let r=[Ro(e.key)?e.key.commentBefore:void 0,Ro(e.key)?e.key.comment:void 0,Ro(e.value)?e.value.commentBefore:void 0,Ro(e.value)?e.value.comment:void 0].filter((o)=>o!==void 0);if(r.length===0)return;t.commentBefore=[t.commentBefore,...r].filter((o)=>o!==void 0).join(`
|
|
400
|
+
`)}function C6(e,t,r,o){if(!Sn(e.contents))throw Error("Desired-state YAML must contain a mapping");let n=e.contents.items.findIndex((s)=>$o(s.key)&&s.key.value===t),i=e.createPair(r,[...o]);if(n>=0){let s=e.contents.items[n];A6(s?.key,i.key),A6(s?.value,i.value),e.contents.items.splice(n,1,i)}else e.contents.add(i);return i}function P6(e){let t=O6(e),r=Qle(t.toJS()),o=hT(t,"schemaVersion"),n=hT(t,"model");T6(o,hT(t,"brainVersion")?.key),t.delete("schemaVersion"),t.set("bundleContract",Ws);let i=C6(t,"preset","bundles",r.bundles);if(T6(n,i.key),t.delete("model"),r.add)t.set("add",r.add);else t.delete("add");if(r.remove)t.set("remove",r.remove);else t.delete("remove");return Mi(t),Gs.parse(t.toJS()),t.toString({lineWidth:0})}function z6(e){let t=O6(e),r=Yle(t.toJS());if(r.bundlesOverride)C6(t,"presetOverride","bundlesOverride",r.bundlesOverride);else t.delete("presetOverride"),t.delete("bundlesOverride");if(r.addOverride)t.set("addOverride",r.addOverride);else t.delete("addOverride");if(r.removeOverride)t.set("removeOverride",r.removeOverride);else t.delete("removeOverride");return Mi(t),mn.parse(t.toJS()),t.toString({lineWidth:0})}var R6,tf,Vle,Wle,Gle;var N6=v(()=>{ny();Hn();pe();Gc();ko();R6=l.enum(["core","default","pro"]),tf=l.string().min(1),Vle=l.strictObject({schemaVersion:l.literal(1),brainVersion:Ct,model:l.literal("rover"),githubOrg:l.string().min(1),contentRepoPrefix:l.string().min(1),domainSuffix:l.string().min(1),preset:R6,aiApiKey:tf,gitSyncToken:tf,contentRepoAdminToken:tf,agePublicKey:l.string().startsWith("age1").min(1)}),Wle=l.strictObject({members:l.array(br).min(1),brainVersionOverride:Ct.optional(),presetOverride:R6.optional(),aiApiKeyOverride:tf.optional(),gitSyncTokenOverride:tf.optional()}).superRefine((e,t)=>{if(new Set(e.members).size!==e.members.length)t.addIssue({code:l.ZodIssueCode.custom,path:["members"],message:"cohort members must be unique"})}),Gle=["series","portfolio","content-pipeline","social-media","newsletter","stock-photo"]});function L6(e,t){let r=en(e,{keepSourceTokens:!0});if(r.errors.length>0||!Sn(r.contents))throw Error(`Invalid ${t} YAML`);return r}function nue(e,t){return e.length===t.length&&e.every((r,o)=>r===t[o])}function B6(e,t,r){if(!nue(t,r.sourceBundles))throw Error(`${e} source bundles changed after review: expected [${r.sourceBundles.join(", ")}], received [${t.join(", ")}]`)}function j6(e){let t=yr(e,rue);if(!t.ok)throw Error(`Invalid capability bundle review: ${t.error}`);return t.data}function Z6(e,t){let r=L6(e,"pilot desired-state"),o=eue.parse(r.toJS());return B6("pilot.yaml",o.bundles,t),r.set("bundleContract",Ws),r.set("bundles",t.targetBundles),Mi(r),Gs.parse(r.toJS()),r.toString({lineWidth:0})}function U6(e,t,r){let o=L6(e,`cohort ${t}`),n=tue.parse(o.toJS());if(n.bundlesOverride===void 0){if(r!==void 0)throw Error(`Capability bundle review names inheriting cohort ${t}`)}else{if(r===void 0)throw Error(`Cohort ${t} has an explicit legacy bundle selection but no reviewed mapping`);B6(`cohort ${t}`,n.bundlesOverride,r),o.set("bundlesOverride",r.targetBundles)}return Mi(o),mn.parse(o.toJS()),o.toString({lineWidth:0})}var Xle,gT,oy,eue,tue,D6,rue;var M6=v(()=>{ny();Hn();pe();Gc();ko();Xle=l.enum(["core","site","publishing","team"]),gT=l.array(Xle).min(1),oy=l.array(l.string().min(1)),eue=l.strictObject({brainVersion:Ct,bundles:gT,add:oy.optional(),remove:oy.optional(),githubOrg:l.string().min(1),contentRepoPrefix:l.string().min(1),domainSuffix:l.string().min(1),aiApiKey:l.string().min(1),gitSyncToken:l.string().min(1),contentRepoAdminToken:l.string().min(1),agePublicKey:l.string().startsWith("age1").min(1)}),tue=l.strictObject({members:l.array(br).min(1),brainVersionOverride:Ct.optional(),bundlesOverride:gT.optional(),addOverride:oy.optional(),removeOverride:oy.optional(),aiApiKeyOverride:l.string().min(1).optional(),gitSyncTokenOverride:l.string().min(1).optional()}),D6=l.strictObject({sourceBundles:gT,targetBundles:l.array(RI).min(1)}),rue=l.strictObject({bundleContract:l.literal(Ws),pilot:D6,cohorts:l.record(br,D6)})});var H6={};Lt(H6,{loadCapabilityBundleReview:()=>fue,loadReviewedSitePins:()=>due,parseReviewedSitePins:()=>J6,stageLegacyCrossover:()=>mue});import{access as oue,cp as iue,mkdir as q6,readFile as Yc,readdir as K6,writeFile as Qc}from"fs/promises";import{basename as sue,join as Gn,relative as iy,resolve as F6}from"path";import{fileURLToPath as aue}from"url";function J6(e){let t=yr(e,cue);if(!t.ok)throw Error(`Invalid reviewed site pins: ${t.error}`);return t.data.sites}async function due(e){return J6(await Yc(e,"utf8"))}async function fue(e){return j6(await Yc(e,"utf8"))}async function pue(e,t){let r=Gn(e,"users"),o=(await K6(r,{withFileTypes:!0})).filter((s)=>s.isFile()&&/\.ya?ml$/.test(s.name)).map((s)=>s.name).sort(),n=new Set(Object.keys(t??{})),i=[];for(let s of o){let a=Gn(r,s),c=await Yc(a,"utf8"),u=en(c,{keepSourceTokens:!0});if(u.errors.length>0||!Sn(u.contents))throw Error(`Invalid user desired-state YAML: ${s}`);let d=lue.parse(u.toJS());if(!d.siteOverride)continue;let f=t?.[d.handle];if(!f)throw Error(`User ${d.handle} has a siteOverride but no reviewed site pin`);if(n.delete(d.handle),f.package!==d.siteOverride.package||f.theme!==d.siteOverride.theme)throw Error(`Reviewed site pin identity does not match user ${d.handle}`);if(d.siteOverride.version!==void 0&&d.siteOverride.version!==f.version)throw Error(`Reviewed site version does not match the existing pin for user ${d.handle}`);if(d.siteOverride.themeVersion!==void 0&&d.siteOverride.themeVersion!==f.themeVersion)throw Error(`Reviewed theme version does not match the existing pin for user ${d.handle}`);if(u.setIn(["siteOverride","version"],f.version),f.themeVersion!==void 0)u.setIn(["siteOverride","themeVersion"],f.themeVersion);else u.deleteIn(["siteOverride","themeVersion"]);eg.parse(u.toJS());let m=u.toString({lineWidth:0});if(m!==c)await Qc(a,m),i.push(iy(e,a))}if(n.size>0)throw Error(`Reviewed site pins do not match site users: ${[...n].sort().join(", ")}`);return i}async function mue(e,t,r={}){let o=F6(e),n=F6(t);if(o===n||n.startsWith(`${o}/`))throw Error("Crossover output must be outside the source repository");await iue(o,n,{recursive:!0,errorOnExist:!0,force:!1,filter:(A)=>{let O=sue(A);return O!==".git"&&O!==".operator"&&O!==".brains-ops"&&O!==".turbo"&&O!=="dist"&&O!=="node_modules"&&O!==".env"&&O!==".env.local"&&!O.endsWith(".secrets.yaml")}});let i=[],s=Gn(n,"docs","canonical-crossover-record.md");try{await oue(s)}catch{await q6(Gn(n,"docs"),{recursive:!0}),await Qc(s,await Yc(uue,"utf8")),i.push("docs/canonical-crossover-record.md")}let a=Gn(n,"pilot.yaml"),c=await Yc(a,"utf8"),d=en(c).toJS();if(!Ad(d))throw Error(`${a} is not a YAML mapping`);let f=Array.isArray(d.bundles),m=r.bundleReview,h;if(f){if(!m)throw Error("Current canonical desired state requires an explicit capability bundle review manifest");h=Z6(c,m.pilot)}else h=P6(c);await Qc(a,h),i.push("pilot.yaml");let b=Gn(n,"cohorts"),y=(await K6(b,{withFileTypes:!0})).filter((A)=>A.isFile()&&/\.ya?ml$/.test(A.name)).map((A)=>A.name).sort(),S=new Set(Object.keys(m?.cohorts??{}));for(let A of y){let O=Gn(b,A),L=await Yc(O,"utf8"),z=A.replace(/\.ya?ml$/,""),J=m?.cohorts[z];if(J)S.delete(z);await Qc(O,f?U6(L,z,J):z6(L)),i.push(iy(n,O))}if(f&&S.size>0)throw Error(`Capability bundle review names unknown cohorts: ${[...S].sort().join(", ")}`);i.push(...await pue(n,r.sitePins));let x=await wt(n),_=og(x.pilot.githubOrg);for(let A of x.users){let O=await _(A),L=Gn(n,"users",A.handle);if(await q6(L,{recursive:!0}),O.brainYaml){let z=Gn(L,"brain.yaml");await Qc(z,O.brainYaml),i.push(iy(n,z))}if(O.envFile){let z=Gn(L,".env");await Qc(z,O.envFile),i.push(iy(n,z))}}return await Ci(n,{registry:x}),i.push("views/users.md"),{outputDir:n,changedFiles:[...new Set(i)].sort()}}var cue,lue,uue;var V6=v(()=>{Hn();Td();pe();Gc();FI();N6();M6();hn();Id();ko();cue=l.strictObject({sites:l.record(br,$I)}),lue=l.object({handle:br,siteOverride:l.object({package:l.string().min(1),version:Ct.optional(),theme:l.string().min(1).optional(),themeVersion:Ct.optional()}).optional()}).passthrough(),uue=aue(new URL("../templates/rover-pilot/docs/canonical-crossover-record.md",import.meta.url))});var G6,hue,gue,yue,Co,rf,bue,yT,Sue,W6,vue,wue,Q6,ICe,Y6;var sy=v(()=>{jk();G6=["primary","secondary"],hue=l.custom((e)=>typeof e==="function","Expected a React component"),gue=l.strictObject({show:l.boolean().optional(),label:l.string().min(1).optional(),slot:l.enum(G6).optional(),priority:l.number().optional()}),yue=l.strictObject({id:l.string().min(1),template:l.string().min(1),content:l.unknown().optional(),dataQuery:l.looseObject({entityType:l.string().optional(),template:l.string().optional(),query:l.record(l.string(),l.unknown()).optional()}).optional(),order:l.number().optional()}),Co=l.string().regex(/^[A-Za-z]{2,3}(-[A-Za-z0-9]{2,8})*$/,{message:"must be a language tag such as en or zh-TW"}),rf=l.strictObject({title:l.string().optional(),description:l.string().optional(),navigationLabel:l.string().optional()}),bue=l.strictObject({id:l.string().min(1),path:l.string().startsWith("/"),title:l.string().optional(),pageLabel:l.string().optional(),description:l.string().optional(),sections:l.array(yue).optional(),layout:l.string().min(1).optional(),fullscreen:l.boolean().optional(),pluginId:l.string().optional(),sourceEntityType:l.string().optional(),external:l.boolean().optional(),navigation:gue.optional(),translations:l.record(Co,rf).optional()}),yT=l.strictObject({label:l.string().min(1),pluralName:l.string().min(1).optional(),layout:l.string().min(1).optional(),detailTemplate:l.string().min(1).optional(),paginate:l.boolean().optional(),pageSize:l.number().int().positive().optional(),citable:l.boolean().optional(),navigation:l.strictObject({show:l.boolean().optional(),slot:l.enum(G6).optional(),priority:l.number().optional()}).optional()}),Sue=l.strictObject({schema:l.custom((e)=>e instanceof l.ZodType,"Expected a Zod schema"),component:l.custom((e)=>typeof e==="function","Expected a React component"),title:l.string().min(1),description:l.string(),requiredPermission:l.enum(["admin","trusted","public"]).optional(),fullscreen:l.boolean().optional()}),W6=l.strictObject({namespace:l.string().min(1),sections:l.record(l.string(),Sue)}),vue=l.record(l.string(),l.json()),wue=l.record(l.string(),l.record(l.string(),vue)),Q6={layouts:l.record(l.string(),hue).refine((e)=>typeof e.default==="function",{message:'Site layouts must include a "default" component'}),routes:l.array(bue),content:wue.optional(),sections:l.union([W6,l.array(W6)]).optional(),themeOverride:l.string().optional(),headScripts:l.array(l.string()).optional(),entityDisplay:l.record(l.string(),yT),staticAssets:l.record(l.string(),l.string()).optional(),languages:l.array(Co).min(1).optional()},ICe=l.strictObject(Q6).partial(),Y6=l.strictObject(Q6).superRefine((e,t)=>{let r=e.languages??[],o=new Set;for(let[c,u]of r.entries()){let d=u.toLowerCase();if(o.has(d))t.addIssue({code:"custom",path:["languages",c],message:`Language "${u}" is declared twice`});o.add(d)}let n=r.slice(1).map((c)=>`/${c.toLowerCase()}`),i=new Set;for(let[c,u]of e.routes.entries()){if(i.has(u.id))t.addIssue({code:"custom",path:["routes",c,"id"],message:`Duplicate route id "${u.id}"`});i.add(u.id);let d=u.path.toLowerCase(),f=n.find((h)=>d===h||d.startsWith(`${h}/`));if(f)t.addIssue({code:"custom",path:["routes",c,"path"],message:`Route path "${u.path}" is under ${f}, where another language's pages are built`});let m=u.layout??"default";if(!e.layouts[m])t.addIssue({code:"custom",path:["routes",c,"layout"],message:`Unknown layout "${m}"`});for(let[h,b]of(u.sections??[]).entries()){let y=/^([^:.\s]+)\.([^:.\s]+)$/.exec(b.template);if(y)t.addIssue({code:"custom",path:["routes",c,"sections",h,"template"],message:`Section template "${b.template}" is written "${y[1]}:${y[2]}"`})}}let s=Array.isArray(e.sections)?e.sections:e.sections?[e.sections]:[],a=new Map(s.map((c)=>[c.namespace,c]));if(a.size!==s.length)t.addIssue({code:"custom",path:["sections"],message:"Section group namespaces must be unique"});for(let[c,u]of Object.entries(e.content??{})){let d=a.get(c);if(!d){t.addIssue({code:"custom",path:["content",c],message:`Content namespace "${c}" has no section group`});continue}for(let[f,m]of Object.entries(u)){let h=d.sections[f];if(!h){t.addIssue({code:"custom",path:["content",c,f],message:`Content section "${c}:${f}" is not defined`});continue}let b=h.schema.safeParse(m);if(!b.success)t.addIssue({code:"custom",path:["content",c,f],message:`Content does not satisfy the "${c}:${f}" schema: ${l.prettifyError(b.error)}`})}}})});var X6,eM,tM,ay,rM,_ue,nM,oM,Eue,iM,sM,kue,cy;var bT=v(()=>{Ot();pe();sy();sy();X6=l.object({id:l.string(),template:l.string(),content:l.unknown().optional(),dataQuery:l.looseObject({entityType:l.string().optional(),template:l.string().optional(),query:l.looseObject({id:l.string().optional(),limit:l.number().optional(),offset:l.number().optional()}).optional()}).optional(),order:l.number().optional()}),eM=["primary","secondary"],tM=l.object({show:l.boolean().default(!1),label:l.string().optional(),slot:l.enum(eM).default("primary"),priority:l.number().min(0).max(100).default(50)}).optional(),ay=l.object({id:l.string(),path:l.string(),title:l.string().default(""),pageLabel:l.string().optional(),description:l.string().default(""),sections:l.array(X6).default([]),layout:l.string().default("default"),fullscreen:l.boolean().optional(),pluginId:l.string().optional(),sourceEntityType:l.string().optional(),external:l.boolean().optional(),navigation:tM,translations:l.record(Co,rf).optional(),languages:l.array(Co).optional()}),rM=l.object({routes:l.array(ay),pluginId:l.string()}),_ue=Ee({channel:"plugin:site-builder:route:register",request:rM,response:l.void(),delivery:"command"}),nM=l.strictObject({}),oM=l.array(ay),Eue=Ee({channel:"site-builder:routes:list",request:nM,response:oM,delivery:"request"}),iM=l.strictObject({}),sM=l.array(ay),kue=Ee({channel:"plugin:site-builder:pages",request:iM,response:sM,delivery:"collect"}),cy=l.object({label:l.string(),href:l.string(),priority:l.number()})});var aM,cM,lM,Iue;var uM=v(()=>{Ot();pe();aM=l.object({pluginId:l.string(),slotName:l.string(),render:l.custom((e)=>typeof e==="function"),priority:l.number().optional()}),cM=l.strictObject({}),lM=l.array(aM),Iue=Ee({channel:"plugin:site-builder:slots",request:cM,response:lM,delivery:"collect"})});var dM="site:metadata:updated",ly,fM,pM,Xc,mM,Aue,Tue,Rue;var ST=v(()=>{Ot();pe();bT();ly=l.object({heading:l.string().describe("Main CTA heading text"),buttonText:l.string().describe("Call-to-action button text"),buttonLink:l.string().describe("URL or anchor for the CTA button")}),fM=l.object({title:l.string().optional(),description:l.string().optional(),copyright:l.string().optional(),cta:ly.optional()}),pM=l.object({blurb:l.string().optional().describe("Short italic subtitle under the section title")}),Xc=l.object({represents:l.enum(["brain","anchor"]).default("anchor").describe("Identity represented by the site"),title:l.string().describe("The site's title"),description:l.string().describe("The site's description"),url:l.string().optional().describe("Canonical site URL"),copyright:l.string().optional().describe("Copyright notice text"),logo:l.boolean().optional().describe("Whether to display logo instead of title text in header"),themeMode:l.enum(["light","dark"]).optional().describe("Default theme mode"),analyticsScript:l.string().optional().describe("Analytics script HTML"),cta:ly.optional().describe("Call-to-action configuration"),sections:l.record(l.string(),pM).optional().describe("Optional per-section blurbs, keyed by section id (e.g. 'essays', 'presentations', 'about'). Used by homepage templates that render editorial section headers."),translations:l.record(Co,fM).optional().describe("The site's title, description, copyright and call to action in its other languages, keyed by language tag. A site is built in a language only once it has one.")}),mM=l.strictObject({}),Aue=Ee({channel:"site:metadata:get",request:mM,response:Xc,delivery:"request"}),Tue=Oi(dM,Xc),Rue=Xc.extend({copyright:l.string(),navigation:l.object({primary:l.array(cy),secondary:l.array(cy)}),socialLinks:l.array(TI).optional().describe("Social media links from profile metadata"),photo:l.string().optional().describe("The anchor's photo, as ")})});var UCe;var vT=v(()=>{pe();UCe=l.record(l.string(),l.unknown())});var nf=v(()=>{vT()});var hM=v(()=>{Ot();nf()});var gM=v(()=>{nf();Ot()});var yM=v(()=>{nf();Ot()});var n1e;var bM=v(()=>{pe();n1e=l.record(l.string(),l.unknown())});var s1e;var SM=v(()=>{pe();Oc();s1e=l.record(l.string(),l.unknown())});var vM=v(()=>{Oc()});var wM=v(()=>{nf();hM();gM();yM();bM();SM();vM();vT()});var jue;var xM=v(()=>{pe();jue=l.object({slug:l.string(),title:l.string(),type:l.string(),entityId:l.string(),contentHash:l.string()})});var xT=v(()=>{wM();xM()});var _M=v(()=>{xT();pe()});var Zue,Uue,Mue;var dy=v(()=>{pe();Ot();Zue={url:l.string(),typeLabel:l.string(),listUrl:l.string(),listLabel:l.string()},Uue={url:l.string().nullable().default(null),typeLabel:l.string().nullable().default(null),listUrl:l.string().nullable().default(null),listLabel:l.string().nullable().default(null)},Mue=l.object({name:l.string(),description:l.string(),schema:l.unknown(),basePrompt:l.string().optional(),useKnowledgeContext:l.boolean().optional(),requiredPermission:l.enum(["admin","trusted","public"]),formatter:l.unknown().optional(),overlayFormatter:l.unknown().optional(),layout:l.object({component:l.unknown().optional(),fullscreen:l.boolean().optional(),formats:l.unknown().optional()}).optional(),dataSourceId:l.string().optional()})});var fy=v(()=>{dy()});var IM=v(()=>{fy()});var _T=()=>{};var Fue,Kue,el,AM,Jue;var TM=v(()=>{Ot();pe();_T();Fue=l.enum(["admin","trusted","public"]),Kue=l.enum(["create","update","delete","extract","publish"]),el=l.enum(["never","admin","trusted","public"]),AM=l.strictObject({create:el.optional(),update:el.optional(),delete:el.optional(),extract:el.optional(),publish:el.optional()}),Jue=l.record(l.string(),AM)});var RM=v(()=>{fy();dy()});var Hue,Vue,py,Wue,Gue,Que;var $M=v(()=>{pe();Hue=l.enum(["site-content-preview","site-content-production"]),Vue=l.enum(["web","image","pdf","epub"]),py=l.custom((e)=>typeof e==="function"),Wue=l.object({name:l.string(),schema:l.unknown(),description:l.string().optional(),pluginId:l.string(),renderers:l.object({web:l.union([py,l.string()]).optional(),image:l.union([py,l.string()]).optional(),pdf:l.union([py,l.string()]).optional(),epub:l.union([py,l.string()]).optional()})}),Gue=l.object({enableContentGeneration:l.boolean().default(!1),outputDir:l.string(),workingDir:l.string().optional(),environment:l.enum(["preview","production"]).default("preview"),siteConfig:l.object({title:l.string(),description:l.string(),url:l.string().optional()}).optional()}),Que=l.object({success:l.boolean(),routesBuilt:l.number(),errors:l.array(l.string()).optional(),warnings:l.array(l.string()).optional()})});var OM=v(()=>{dy();IM();fy();TM();_T();RM();$M()});var ET=ge(function(Xue,my){(function(){function e(g,E){Object.defineProperty(o.prototype,g,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",E[0],E[1])}})}function t(g){if(g===null||typeof g!=="object")return null;return g=De&&g[De]||g["@@iterator"],typeof g==="function"?g:null}function r(g,E){g=(g=g.constructor)&&(g.displayName||g.name)||"ReactClass";var D=g+"."+E;Qe[D]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",E,g),Qe[D]=!0)}function o(g,E,D){this.props=g,this.context=E,this.refs=Dt,this.updater=D||bt}function n(){}function i(g,E,D){this.props=g,this.context=E,this.refs=Dt,this.updater=D||bt}function s(){}function a(g){return""+g}function c(g){try{a(g);var E=!1}catch(M){E=!0}if(E){E=console;var D=E.error,K=typeof Symbol==="function"&&Symbol.toStringTag&&g[Symbol.toStringTag]||g.constructor.name||"Object";return D.call(E,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",K),a(g)}}function u(g){if(g==null)return null;if(typeof g==="function")return g.$$typeof===Rn?null:g.displayName||g.name||null;if(typeof g==="string")return g;switch(g){case H:return"Fragment";case re:return"Profiler";case G:return"StrictMode";case ve:return"Suspense";case Ae:return"SuspenseList";case Ue:return"Activity"}if(typeof g==="object")switch(typeof g.tag==="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),g.$$typeof){case N:return"Portal";case me:return g.displayName||"Context";case ae:return(g._context.displayName||"Context")+".Consumer";case be:var E=g.render;return g=g.displayName,g||(g=E.displayName||E.name||"",g=g!==""?"ForwardRef("+g+")":"ForwardRef"),g;case Ie:return E=g.displayName||null,E!==null?E:u(g.type)||"Memo";case we:E=g._payload,g=g._init;try{return u(g(E))}catch(D){}}return null}function d(g){if(g===H)return"<>";if(typeof g==="object"&&g!==null&&g.$$typeof===we)return"<...>";try{var E=u(g);return E?"<"+E+">":"<...>"}catch(D){return"<...>"}}function f(){var g=Le.A;return g===null?null:g.getOwner()}function m(){return Error("react-stack-top-frame")}function h(g){if(io.call(g,"key")){var E=Object.getOwnPropertyDescriptor(g,"key").get;if(E&&E.isReactWarning)return!1}return g.key!==void 0}function b(g,E){function D(){cs||(cs=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",E))}D.isReactWarning=!0,Object.defineProperty(g,"key",{get:D,configurable:!0})}function y(){var g=u(this.type);return ls[g]||(ls[g]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),g=this.props.ref,g!==void 0?g:null}function S(g,E,D,K,M,te){var se=D.ref;return g={$$typeof:q,type:g,key:E,props:D,_owner:K},(se!==void 0?se:null)!==null?Object.defineProperty(g,"ref",{enumerable:!1,get:y}):Object.defineProperty(g,"ref",{enumerable:!1,value:null}),g._store={},Object.defineProperty(g._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(g,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(g,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:M}),Object.defineProperty(g,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.freeze&&(Object.freeze(g.props),Object.freeze(g)),g}function x(g,E){return E=S(g.type,E,g.props,g._owner,g._debugStack,g._debugTask),g._store&&(E._store.validated=g._store.validated),E}function _(g){A(g)?g._store&&(g._store.validated=1):typeof g==="object"&&g!==null&&g.$$typeof===we&&(g._payload.status==="fulfilled"?A(g._payload.value)&&g._payload.value._store&&(g._payload.value._store.validated=1):g._store&&(g._store.validated=1))}function A(g){return typeof g==="object"&&g!==null&&g.$$typeof===q}function O(g){var E={"=":"=0",":":"=2"};return"$"+g.replace(/[=:]/g,function(D){return E[D]})}function L(g,E){return typeof g==="object"&&g!==null&&g.key!=null?(c(g.key),O(""+g.key)):E.toString(36)}function z(g){switch(g.status){case"fulfilled":return g.value;case"rejected":throw g.reason;default:switch(typeof g.status==="string"?g.then(s,s):(g.status="pending",g.then(function(E){g.status==="pending"&&(g.status="fulfilled",g.value=E)},function(E){g.status==="pending"&&(g.status="rejected",g.reason=E)})),g.status){case"fulfilled":return g.value;case"rejected":throw g.reason}}throw g}function J(g,E,D,K,M){var te=typeof g;if(te==="undefined"||te==="boolean")g=null;var se=!1;if(g===null)se=!0;else switch(te){case"bigint":case"string":case"number":se=!0;break;case"object":switch(g.$$typeof){case q:case N:se=!0;break;case we:return se=g._init,J(se(g._payload),E,D,K,M)}}if(se){se=g,M=M(se);var ye=K===""?"."+L(se,0):K;return $r(M)?(D="",ye!=null&&(D=ye.replace(xa,"$&/")+"/"),J(M,E,D,"",function(Re){return Re})):M!=null&&(A(M)&&(M.key!=null&&(se&&se.key===M.key||c(M.key)),D=x(M,D+(M.key==null||se&&se.key===M.key?"":(""+M.key).replace(xa,"$&/")+"/")+ye),K!==""&&se!=null&&A(se)&&se.key==null&&se._store&&!se._store.validated&&(D._store.validated=2),M=D),E.push(M)),1}if(se=0,ye=K===""?".":K+":",$r(g))for(var fe=0;fe<g.length;fe++)K=g[fe],te=ye+L(K,fe),se+=J(K,E,D,te,M);else if(fe=t(g),typeof fe==="function")for(fe===g.entries&&(Vo||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Vo=!0),g=fe.call(g),fe=0;!(K=g.next()).done;)K=K.value,te=ye+L(K,fe++),se+=J(K,E,D,te,M);else if(te==="object"){if(typeof g.then==="function")return J(z(g),E,D,K,M);throw E=String(g),Error("Objects are not valid as a React child (found: "+(E==="[object Object]"?"object with keys {"+Object.keys(g).join(", ")+"}":E)+"). If you meant to render a collection of children, use an array instead.")}return se}function P(g,E,D){if(g==null)return g;var K=[],M=0;return J(g,K,"","",function(te){return E.call(D,te,M++)}),K}function W(g){if(g._status===-1){var E=g._ioInfo;E!=null&&(E.start=E.end=performance.now()),E=g._result;var D=E();if(D.then(function(M){if(g._status===0||g._status===-1){g._status=1,g._result=M;var te=g._ioInfo;te!=null&&(te.end=performance.now()),D.status===void 0&&(D.status="fulfilled",D.value=M)}},function(M){if(g._status===0||g._status===-1){g._status=2,g._result=M;var te=g._ioInfo;te!=null&&(te.end=performance.now()),D.status===void 0&&(D.status="rejected",D.reason=M)}}),E=g._ioInfo,E!=null){E.value=D;var K=D.displayName;typeof K==="string"&&(E.name=K)}g._status===-1&&(g._status=0,g._result=D)}if(g._status===1)return E=g._result,E===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
401
|
+
|
|
402
|
+
Your code should look like:
|
|
403
|
+
const MyComponent = lazy(() => import('./MyComponent'))
|
|
404
|
+
|
|
405
|
+
Did you accidentally put curly braces around the import?`,E),"default"in E||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
406
|
+
|
|
407
|
+
Your code should look like:
|
|
408
|
+
const MyComponent = lazy(() => import('./MyComponent'))`,E),E.default;throw g._result}function ee(){var g=Le.H;return g===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
409
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
410
|
+
2. You might be breaking the Rules of Hooks
|
|
411
|
+
3. You might have more than one copy of React in the same app
|
|
412
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),g}function j(){Le.asyncTransitions--}function R(g){if(U===null)try{var E=("require"+Math.random()).slice(0,7);U=(my&&my[E]).call(my,"timers").setImmediate}catch(D){U=function(K){p===!1&&(p=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var M=new MessageChannel;M.port1.onmessage=K,M.port2.postMessage(void 0)}}return U(g)}function B(g){return 1<g.length&&typeof AggregateError==="function"?AggregateError(g):g[0]}function k(g,E){E!==ne-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),ne=E}function T(g,E,D){var K=Le.actQueue;if(K!==null)if(K.length!==0)try{I(K),R(function(){return T(g,E,D)});return}catch(M){Le.thrownErrors.push(M)}else Le.actQueue=null;0<Le.thrownErrors.length?(K=B(Le.thrownErrors),Le.thrownErrors.length=0,D(K)):E(g)}function I(g){if(!X){X=!0;var E=0;try{for(;E<g.length;E++){var D=g[E];do{Le.didUsePromise=!1;var K=D(!1);if(K!==null){if(Le.didUsePromise){g[E]=D,g.splice(0,E);return}D=K}else break}while(1)}g.length=0}catch(M){g.splice(0,E+1),Le.thrownErrors.push(M)}finally{X=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var q=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),H=Symbol.for("react.fragment"),G=Symbol.for("react.strict_mode"),re=Symbol.for("react.profiler"),ae=Symbol.for("react.consumer"),me=Symbol.for("react.context"),be=Symbol.for("react.forward_ref"),ve=Symbol.for("react.suspense"),Ae=Symbol.for("react.suspense_list"),Ie=Symbol.for("react.memo"),we=Symbol.for("react.lazy"),Ue=Symbol.for("react.activity"),De=Symbol.iterator,Qe={},bt={isMounted:function(){return!1},enqueueForceUpdate:function(g){r(g,"forceUpdate")},enqueueReplaceState:function(g){r(g,"replaceState")},enqueueSetState:function(g){r(g,"setState")}},Tt=Object.assign,Dt={};Object.freeze(Dt),o.prototype.isReactComponent={},o.prototype.setState=function(g,E){if(typeof g!=="object"&&typeof g!=="function"&&g!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,g,E,"setState")},o.prototype.forceUpdate=function(g){this.updater.enqueueForceUpdate(this,g,"forceUpdate")};var lt={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(V in lt)lt.hasOwnProperty(V)&&e(V,lt[V]);n.prototype=o.prototype,lt=i.prototype=new n,lt.constructor=i,Tt(lt,o.prototype),lt.isPureReactComponent=!0;var $r=Array.isArray,Rn=Symbol.for("react.client.reference"),Le={H:null,A:null,T:null,S:null,actQueue:null,asyncTransitions:0,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},io=Object.prototype.hasOwnProperty,as=console.createTask?console.createTask:function(){return null};lt={react_stack_bottom_frame:function(g){return g()}};var cs,wa,ls={},$n=lt.react_stack_bottom_frame.bind(lt,m)(),jl=as(d(m)),Vo=!1,xa=/\/+/g,_a=typeof reportError==="function"?reportError:function(g){if(typeof window==="object"&&typeof window.ErrorEvent==="function"){var E=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof g==="object"&&g!==null&&typeof g.message==="string"?String(g.message):String(g),error:g});if(!window.dispatchEvent(E))return}else if(typeof process==="object"&&typeof process.emit==="function"){process.emit("uncaughtException",g);return}console.error(g)},p=!1,U=null,ne=0,ie=!1,X=!1,w=typeof queueMicrotask==="function"?function(g){queueMicrotask(function(){return queueMicrotask(g)})}:R;lt=Object.freeze({__proto__:null,c:function(g){return ee().useMemoCache(g)}});var V={map:P,forEach:function(g,E,D){P(g,function(){E.apply(this,arguments)},D)},count:function(g){var E=0;return P(g,function(){E++}),E},toArray:function(g){return P(g,function(E){return E})||[]},only:function(g){if(!A(g))throw Error("React.Children.only expected to receive a single React element child.");return g}};Xue.Activity=Ue,Xue.Children=V,Xue.Component=o,Xue.Fragment=H,Xue.Profiler=re,Xue.PureComponent=i,Xue.StrictMode=G,Xue.Suspense=ve,Xue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Le,Xue.__COMPILER_RUNTIME=lt,Xue.act=function(g){var E=Le.actQueue,D=ne;ne++;var K=Le.actQueue=E!==null?E:[],M=!1;try{var te=g()}catch(fe){Le.thrownErrors.push(fe)}if(0<Le.thrownErrors.length)throw k(E,D),g=B(Le.thrownErrors),Le.thrownErrors.length=0,g;if(te!==null&&typeof te==="object"&&typeof te.then==="function"){var se=te;return w(function(){M||ie||(ie=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(fe,Re){M=!0,se.then(function(ze){if(k(E,D),D===0){try{I(K),R(function(){return T(ze,fe,Re)})}catch(us){Le.thrownErrors.push(us)}if(0<Le.thrownErrors.length){var On=B(Le.thrownErrors);Le.thrownErrors.length=0,Re(On)}}else fe(ze)},function(ze){k(E,D),0<Le.thrownErrors.length?(ze=B(Le.thrownErrors),Le.thrownErrors.length=0,Re(ze)):Re(ze)})}}}var ye=te;if(k(E,D),D===0&&(I(K),K.length!==0&&w(function(){M||ie||(ie=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),Le.actQueue=null),0<Le.thrownErrors.length)throw g=B(Le.thrownErrors),Le.thrownErrors.length=0,g;return{then:function(fe,Re){M=!0,D===0?(Le.actQueue=K,R(function(){return T(ye,fe,Re)})):fe(ye)}}},Xue.cache=function(g){return function(){return g.apply(null,arguments)}},Xue.cacheSignal=function(){return null},Xue.captureOwnerStack=function(){var g=Le.getCurrentStack;return g===null?null:g()},Xue.cloneElement=function(g,E,D){if(g===null||g===void 0)throw Error("The argument must be a React element, but you passed "+g+".");var K=Tt({},g.props),M=g.key,te=g._owner;if(E!=null){var se;e:{if(io.call(E,"ref")&&(se=Object.getOwnPropertyDescriptor(E,"ref").get)&&se.isReactWarning){se=!1;break e}se=E.ref!==void 0}se&&(te=f()),h(E)&&(c(E.key),M=""+E.key);for(ye in E)!io.call(E,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&E.ref===void 0||(K[ye]=E[ye])}var ye=arguments.length-2;if(ye===1)K.children=D;else if(1<ye){se=Array(ye);for(var fe=0;fe<ye;fe++)se[fe]=arguments[fe+2];K.children=se}K=S(g.type,M,K,te,g._debugStack,g._debugTask);for(M=2;M<arguments.length;M++)_(arguments[M]);return K},Xue.createContext=function(g){return g={$$typeof:me,_currentValue:g,_currentValue2:g,_threadCount:0,Provider:null,Consumer:null},g.Provider=g,g.Consumer={$$typeof:ae,_context:g},g._currentRenderer=null,g._currentRenderer2=null,g},Xue.createElement=function(g,E,D){for(var K=2;K<arguments.length;K++)_(arguments[K]);K={};var M=null;if(E!=null)for(fe in wa||!("__self"in E)||"key"in E||(wa=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),h(E)&&(c(E.key),M=""+E.key),E)io.call(E,fe)&&fe!=="key"&&fe!=="__self"&&fe!=="__source"&&(K[fe]=E[fe]);var te=arguments.length-2;if(te===1)K.children=D;else if(1<te){for(var se=Array(te),ye=0;ye<te;ye++)se[ye]=arguments[ye+2];Object.freeze&&Object.freeze(se),K.children=se}if(g&&g.defaultProps)for(fe in te=g.defaultProps,te)K[fe]===void 0&&(K[fe]=te[fe]);M&&b(K,typeof g==="function"?g.displayName||g.name||"Unknown":g);var fe=1e4>Le.recentlyCreatedOwnerStacks++;return S(g,M,K,f(),fe?Error("react-stack-top-frame"):$n,fe?as(d(g)):jl)},Xue.createRef=function(){var g={current:null};return Object.seal(g),g},Xue.forwardRef=function(g){g!=null&&g.$$typeof===Ie?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof g!=="function"?console.error("forwardRef requires a render function but was given %s.",g===null?"null":typeof g):g.length!==0&&g.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",g.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),g!=null&&g.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var E={$$typeof:be,render:g},D;return Object.defineProperty(E,"displayName",{enumerable:!1,configurable:!0,get:function(){return D},set:function(K){D=K,g.name||g.displayName||(Object.defineProperty(g,"name",{value:K}),g.displayName=K)}}),E},Xue.isValidElement=A,Xue.lazy=function(g){g={_status:-1,_result:g};var E={$$typeof:we,_payload:g,_init:W},D={name:"lazy",start:-1,end:-1,value:null,owner:null,debugStack:Error("react-stack-top-frame"),debugTask:console.createTask?console.createTask("lazy()"):null};return g._ioInfo=D,E._debugInfo=[{awaited:D}],E},Xue.memo=function(g,E){g==null&&console.error("memo: The first argument must be a component. Instead received: %s",g===null?"null":typeof g),E={$$typeof:Ie,type:g,compare:E===void 0?null:E};var D;return Object.defineProperty(E,"displayName",{enumerable:!1,configurable:!0,get:function(){return D},set:function(K){D=K,g.name||g.displayName||(Object.defineProperty(g,"name",{value:K}),g.displayName=K)}}),E},Xue.startTransition=function(g){var E=Le.T,D={};D._updatedFibers=new Set,Le.T=D;try{var K=g(),M=Le.S;M!==null&&M(D,K),typeof K==="object"&&K!==null&&typeof K.then==="function"&&(Le.asyncTransitions++,K.then(j,j),K.then(s,_a))}catch(te){_a(te)}finally{E===null&&D._updatedFibers&&(g=D._updatedFibers.size,D._updatedFibers.clear(),10<g&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),E!==null&&D.types!==null&&(E.types!==null&&E.types!==D.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),E.types=D.types),Le.T=E}},Xue.unstable_useCacheRefresh=function(){return ee().useCacheRefresh()},Xue.use=function(g){return ee().use(g)},Xue.useActionState=function(g,E,D){return ee().useActionState(g,E,D)},Xue.useCallback=function(g,E){return ee().useCallback(g,E)},Xue.useContext=function(g){var E=ee();return g.$$typeof===ae&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),E.useContext(g)},Xue.useDebugValue=function(g,E){return ee().useDebugValue(g,E)},Xue.useDeferredValue=function(g,E){return ee().useDeferredValue(g,E)},Xue.useEffect=function(g,E){return g==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?"),ee().useEffect(g,E)},Xue.useEffectEvent=function(g){return ee().useEffectEvent(g)},Xue.useId=function(){return ee().useId()},Xue.useImperativeHandle=function(g,E,D){return ee().useImperativeHandle(g,E,D)},Xue.useInsertionEffect=function(g,E){return g==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),ee().useInsertionEffect(g,E)},Xue.useLayoutEffect=function(g,E){return g==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),ee().useLayoutEffect(g,E)},Xue.useMemo=function(g,E){return ee().useMemo(g,E)},Xue.useOptimistic=function(g,E){return ee().useOptimistic(g,E)},Xue.useReducer=function(g,E,D){return ee().useReducer(g,E,D)},Xue.useRef=function(g){return ee().useRef(g)},Xue.useState=function(g){return ee().useState(g)},Xue.useSyncExternalStore=function(g,E,D){return ee().useSyncExternalStore(g,E,D)},Xue.useTransition=function(){return ee().useTransition()},Xue.version="19.2.7",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop==="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())})()});var CM,PM;var kT=v(()=>{CM=Ul(ET(),1),PM=CM.createContext(void 0)});var ede;var zM=v(()=>{xT();OM();kT();pe();ede=Ul(ET(),1)});var tde,rde;var NM=v(()=>{Ot();pe();ST();tde=Xc.omit({url:!0,analyticsScript:!0}),rde=tde.extend({title:l.string().optional().describe("Optional site title override"),description:l.string().optional().describe("Optional site description override")})});function IT(e,t={}){let r=DM(e),o=DM(t.sharedDomain??"rizom.ai").replace(/^\./,""),n=`.${o}`;if(r.endsWith(n)){let i=r.slice(0,-n.length);if(i.length>0&&!i.includes("."))return`${i}-preview.${o}`}return`preview.${r}`}function DM(e){return e.trim().replace(/^https?:\/\//i,"").replace(/\/$/,"").toLowerCase()}var LM=v(()=>{lg()});var nde,ode;var BM=v(()=>{pe();sy();nde=l.string(),ode=l.custom((e)=>{if(!Hs(e))return!1;let{plugin:t,...r}=e;if(t!==void 0&&typeof t!=="function")return!1;return Y6.safeParse(r).success})});var ide;var jM=v(()=>{lg();pe();ide=l.object({title:l.string().min(1),slug:l.string().min(1),description:l.string(),content:l.string(),author:l.string(),publishedAt:l.iso.datetime({offset:!0}),category:l.string().min(1).optional()})});var ZM=v(()=>{bT();uM();ST();_M();zM();NM();LM();BM();kT();jM()});function UM(e,t={}){return IT(e,t)}var MM=v(()=>{ZM()});var VM={};Lt(VM,{assertPilotUsersRemoved:()=>HM,createPilotOffboardDriver:()=>FM,offboardPilotUsers:()=>dde});import{access as sde,readdir as ade,readFile as cde,rm as of,writeFile as lde}from"fs/promises";import{basename as ude,join as Po}from"path";async function dde(e,t){let r=[...new Set(t.handles.map((f)=>br.parse(f)))].sort((f,m)=>f.localeCompare(m));if(r.length===0)throw Error("At least one pilot handle is required");let o=t.dryRun??!0,n=`sunset:${r.join(",")}`;if(!o&&t.confirmation!==n)throw Error(`Exact confirmation required: ${n}`);let i=t.env??process.env,s=t.logger??console.info,a=await wt(e),c=r.map((f)=>fde(a,f,i)),u=t.driver??FM({env:i,fetchImpl:t.fetchImpl,contentRepoTokenName:a.pilot.contentRepoAdminToken}),d=await Promise.all(c.map(async(f)=>({target:f,inspection:await u.inspect(f)})));if(mde(d),hde(d,o,s),!o){for(let f of d)if(!f.inspection.contentRepoArchived)await u.archiveContentRepo(f.target),s(`[${f.target.handle}] archived ${f.target.contentRepo}`);for(let f of d)for(let m of f.inspection.dnsRecords)await u.deleteDnsRecord(f.target,m),s(`[${f.target.handle}] deleted DNS ${m.name}`);for(let f of d)if(f.inspection.server)await u.deleteServer(f.target,f.inspection.server),s(`[${f.target.handle}] deleted ${f.target.instanceName}`);await pde(c,u,t.sleep??((f)=>new Promise((m)=>setTimeout(m,f)))),await gde(e,r),await Ci(e),await HM(e,r),s(`Removed desired state for ${r.length} pilot user(s)`)}return{dryRun:o,handles:r,confirmation:n,plans:d}}function fde(e,t,r){let o=e.users.find((d)=>d.handle===t),n=`${t}${e.pilot.domainSuffix}`,i=o?.domain??n,s=UM(i,{sharedDomain:e.pilot.domainSuffix}),a=o?.cloudflareZoneId??hy(r,"CF_ZONE_ID"),c=o?.contentRepo??`${e.pilot.contentRepoPrefix}${t}-content`,u=c.includes("/")?c:`${e.pilot.githubOrg}/${c}`;return{handle:t,instanceName:`rover-${t}`,domain:i,previewDomain:s,...i===n?{}:{wwwDomain:`www.${i}`},contentRepo:u,cloudflareZoneId:a}}async function pde(e,t,r){for(let o of e)for(let n=1;n<=20;n+=1){let i=await t.inspect(o);if(!i.server&&i.dnsRecords.length===0&&i.contentRepoArchived)break;if(n===20)throw Error(`[${o.handle}] provider cleanup did not converge`);await r(1500)}}function mde(e){for(let{target:t,inspection:r}of e){if(r.server&&r.server.name!==t.instanceName)throw Error(`[${t.handle}] unexpected server name: ${r.server.name}`);let o=new Set([t.domain,t.previewDomain,...t.wwwDomain?[t.wwwDomain]:[]]);for(let n of r.dnsRecords){if(!o.has(n.name))throw Error(`[${t.handle}] refusing unexpected DNS record ${n.name}`);if(n.type==="A"&&r.server?.ip&&n.content!==r.server.ip)throw Error(`[${t.handle}] ${n.name} does not point to the retiring server`)}}}function hde(e,t,r){r(`${t?"Dry run":"Apply"}: ${e.map(({target:o})=>o.handle).join(", ")}`);for(let{target:o,inspection:n}of e){let i=n.server?`delete ${o.instanceName}`:"already absent",s=n.dnsRecords.length>0?n.dnsRecords.map((c)=>`${c.type} ${c.name}`).join(", "):"already absent",a=n.contentRepoArchived?"already archived":`archive ${o.contentRepo}`;r(`[${o.handle}] server: ${i}; DNS: ${s}; repo: ${a}`)}r("Runtime backups: none")}async function gde(e,t){let r=new Set(t),o=Po(e,"cohorts");for(let n of(await ade(o)).filter((i)=>i.endsWith(".yaml"))){let i=Po(o,n),s=await cde(i,"utf8"),a=en(s);if(a.errors.length>0)throw Error(`${n}: ${a.errors[0]?.message??"invalid YAML"}`);let c=a.get("members",!0);if(!uT(c))throw Error(`${n}: members must be a sequence`);let u=c.items.filter((d)=>!$o(d)||typeof d.value!=="string"||!r.has(d.value));if(u.length===c.items.length)continue;if(u.length===0){await of(i);continue}c.items=u,mn.parse(a.toJS()),await lde(i,a.toString())}for(let n of t)await Promise.all([of(Po(e,"users",`${n}.yaml`),{force:!0}),of(Po(e,"users",`${n}.secrets.yaml`),{force:!0}),of(Po(e,"users",`${n}.secrets.yaml.age`),{force:!0}),of(Po(e,"users",n),{recursive:!0,force:!0})])}function FM(e){let t=e.fetchImpl??fetch,r=hy(e.env,"HCLOUD_TOKEN"),o=hy(e.env,"CF_API_TOKEN"),n=hy(e.env,e.contentRepoTokenName);return{async inspect(i){let[s,a,c]=await Promise.all([yde(t,r,i.instanceName),Promise.all([i.domain,i.previewDomain,...i.wwwDomain?[i.wwwDomain]:[]].map((u)=>bde(t,o,i.cloudflareZoneId,u))).then((u)=>u.flat()),Sde(t,n,i.contentRepo)]);if(s.length>1)throw Error(`[${i.handle}] expected at most one server, found ${s.length}`);return{...s[0]?{server:s[0]}:{},dnsRecords:a,contentRepoArchived:c.archived}},async archiveContentRepo(i){await tl(t,`https://api.github.com/repos/${i.contentRepo}`,{method:"PATCH",headers:KM(n),body:JSON.stringify({archived:!0})},"GitHub repository archive")},async deleteDnsRecord(i,s){if(rl(await tl(t,`https://api.cloudflare.com/client/v4/zones/${i.cloudflareZoneId}/dns_records/${s.id}`,{method:"DELETE",headers:JM(o)},"Cloudflare DNS delete")).success!==!0)throw Error(`Cloudflare DNS delete failed for ${s.name}`)},async deleteServer(i,s){await tl(t,`https://api.hetzner.cloud/v1/servers/${s.id}`,{method:"DELETE",headers:{Authorization:`Bearer ${r}`}},"Hetzner server delete",!0)}}}async function yde(e,t,r){let o=new URL("https://api.hetzner.cloud/v1/servers");o.searchParams.set("label_selector",`brain=${r}`);let i=rl(await tl(e,o.toString(),{headers:{Authorization:`Bearer ${t}`}},"Hetzner server lookup")).servers;if(!Array.isArray(i))throw Error("Hetzner server lookup returned an invalid payload");return i.map((s)=>{let a=rl(s),c=qM(a.public_net),u=qM(c?.ipv4);return{id:vde(a.id,"Hetzner server id"),name:sf(a.name,"Hetzner server name"),...typeof u?.ip==="string"?{ip:u.ip}:{}}})}async function bde(e,t,r,o){let n=new URL(`https://api.cloudflare.com/client/v4/zones/${r}/dns_records`);n.searchParams.set("name",o);let i=rl(await tl(e,n.toString(),{headers:JM(t)},"Cloudflare DNS lookup")),s=i.result;if(i.success!==!0||!Array.isArray(s))throw Error(`Cloudflare DNS lookup failed for ${o}`);return s.map((a)=>{let c=rl(a),u=sf(c.type,"Cloudflare record type");if(u!=="A"&&u!=="CNAME")throw Error(`Unsupported Cloudflare record type ${u} for ${o}`);return{id:sf(c.id,"Cloudflare record id"),name:sf(c.name,"Cloudflare record name"),type:u,content:sf(c.content,"Cloudflare record content")}})}async function Sde(e,t,r){let o=rl(await tl(e,`https://api.github.com/repos/${r}`,{headers:KM(t)},"GitHub repository lookup"));if(typeof o.archived!=="boolean")throw Error(`Invalid repository archive state for ${r}`);return{archived:o.archived}}async function tl(e,t,r,o,n=!1){let i=await e(t,r),s=await i.text();if(!i.ok)throw Error(`${o} failed (${i.status}): ${s}`);if(!s&&n)return{};try{return JSON.parse(s)}catch{throw Error(`${o} returned an invalid JSON response`)}}function KM(e){return{Accept:"application/vnd.github+json",Authorization:`Bearer ${e}`,"Content-Type":"application/json","X-GitHub-Api-Version":"2022-11-28"}}function JM(e){return{Authorization:`Bearer ${e}`}}function hy(e,t){let r=e[t];if(!r)throw Error(`Missing required environment variable: ${t}`);return r}function rl(e){if(!Hs(e))throw Error("Provider returned an unexpected payload");return e}function qM(e){return Hs(e)?e:void 0}function sf(e,t){if(typeof e!=="string"||e.length===0)throw Error(`Missing ${t}`);return e}function vde(e,t){if(typeof e!=="number")throw Error(`Missing ${t}`);return e}async function wde(e){try{return await sde(e),!0}catch{return!1}}async function HM(e,t){for(let r of t)for(let o of[Po(e,"users",`${r}.yaml`),Po(e,"users",`${r}.secrets.yaml.age`),Po(e,"users",r)])if(await wde(o))throw Error(`Offboarded user state remains: ${ude(o)}`)}var WM=v(()=>{Gc();hn();MM();Id();ko()});var GM="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";import{webcrypto as QM}from"crypto";function _de(e){if(e<0)throw RangeError("Wrong ID size");try{if(!qi||qi.length<e)qi=Buffer.allocUnsafe(e*xde),QM.getRandomValues(qi),nl=0;else if(nl+e>qi.length)QM.getRandomValues(qi),nl=0}catch(t){throw qi=void 0,t}nl+=e}function YM(e=21){_de(e|=0);let t="";for(let r=nl-e;r<nl;r++)t+=GM[qi[r]&63];return t}var xde=128,qi,nl;var XM=()=>{};function zo(e=12){return YM(e)}var af=v(()=>{XM()});import{openSync as Ede,writeSync as kde}from"fs";class Ar{static instance=null;level;context;useStderr;format;logFile;fileHandle;constructor(e={},t){if(this.level=e.level??ia.INFO,this.context=e.context??void 0,this.useStderr=e.useStderr??!1,this.format=e.format??"text",this.logFile=e.logFile,t!==void 0)this.fileHandle=t;else if(this.logFile)try{this.fileHandle=Ede(this.logFile,"a")}catch{}}static getInstance(e){if(!Ar.instance)Ar.instance=new Ar(e);else{if(e?.useStderr!==void 0)Ar.instance.useStderr=e.useStderr;if(e?.level!==void 0)Ar.instance.level=e.level}return Ar.instance}static resetInstance(){Ar.instance=null}static createFresh(e){return new Ar(e)}formatEntry(e,t,r){let o=new Date().toISOString();if(this.format==="json"){let n={ts:o,level:e,msg:t};if(this.context)n.ctx=this.context;if(r.length>0)n.data=r;return JSON.stringify(n)}return this.context?`[${o}] [${this.context}] ${t}`:`[${o}] ${t}`}write(e,t,r,o){if(this.format==="json")e(this.formatEntry(t,r,o));else if(o.length>0)e(this.formatEntry(t,r,[]),...o);else e(this.formatEntry(t,r,[]));if(this.fileHandle!==void 0){let n=this.formatJsonEntry(t,r,o);try{kde(this.fileHandle,n+`
|
|
413
|
+
`)}catch{}}}formatJsonEntry(e,t,r){let o={ts:new Date().toISOString(),level:e,msg:t};if(this.context)o.ctx=this.context;if(r.length>0)o.data=r;return JSON.stringify(o)}silly(e,...t){if(this.level<=ia.SILLY)this.write(console.debug.bind(console),"silly",e,t)}verbose(e,...t){if(this.level<=ia.VERBOSE)this.write(console.debug.bind(console),"verbose",e,t)}debug(e,...t){if(this.level<=ia.DEBUG)this.write(console.debug.bind(console),"debug",e,t)}info(e,...t){if(this.level<=ia.INFO){let r=this.useStderr?console.error.bind(console):console.info.bind(console);this.write(r,"info",e,t)}}warn(e,...t){if(this.level<=ia.WARN)this.write(console.warn.bind(console),"warn",e,t)}error(e,...t){if(this.level<=ia.ERROR)this.write(console.error.bind(console),"error",e,t)}child(e){return new Ar({level:this.level,context:e,useStderr:this.useStderr,format:this.format},this.fileHandle)}setUseStderr(e){this.useStderr=e}}var ia,gNe;var AT=v(()=>{ia={SILLY:0,VERBOSE:1,DEBUG:2,INFO:3,WARN:4,ERROR:5,NONE:6};gNe=Ar.getInstance()});var TT,Ide,ol,vNe;var cf=v(()=>{Ot();pe();TT=l.enum(["file_operations","content_operations","data_processing","batch_processing"]),Ide=l.looseObject({pluginId:l.string().optional(),progressToken:l.union([l.string(),l.number()]).optional(),operationType:TT,operationTarget:l.string().optional(),interfaceType:l.string().optional(),conversationId:l.string().optional(),channelId:l.string().optional(),requestedByActor:Ri.optional(),requestedByUserId:l.string().optional(),requestedByInterface:l.string().optional(),silent:l.boolean().optional(),provenance:Eo.optional()}),ol=l.looseObject({pluginId:l.string().optional(),progressToken:l.union([l.string(),l.number()]).optional(),operationType:TT,operationTarget:l.string().optional(),interfaceType:l.string().optional(),conversationId:l.string().optional(),channelId:l.string().optional(),requestedByActor:Ri.optional(),requestedByUserId:l.string().optional(),requestedByInterface:l.string().optional(),silent:l.boolean().optional(),provenance:Eo.optional(),rootJobId:l.string()}),vNe=l.enum(["none","skip","replace","coalesce"])});var Ade,Fi=15000;var lf=v(()=>{cf();pe();Ade=l.object({id:l.string(),type:l.string(),data:l.string(),status:l.enum(["pending","processing","completed","failed"]),source:l.string().nullable(),priority:l.number(),retryCount:l.number(),maxRetries:l.number(),lastError:l.string().nullable(),lastErrorPublic:l.unknown(),createdAt:l.number(),scheduledFor:l.number(),startedAt:l.number().nullable(),completedAt:l.number().nullable(),attemptId:l.string().nullable(),workerSlotId:l.string().nullable(),workerSessionId:l.string().nullable(),leaseExpiresAt:l.number().nullable(),attemptHeartbeatAt:l.number().nullable(),runtimeUpdatedAt:l.number().nullable(),metadata:ol,progress:l.custom((e)=>typeof e==="object"&&e!==null&&("progress"in e)&&typeof e.progress==="number").nullable(),result:l.unknown().nullable().optional()})});var RT,eq,Oe,Tde,Rde,tq,rq,nq;var No=v(()=>{Ot();pe();cf();RT=l.enum(["pending","processing","completed","failed"]),eq=l.enum(["completed","failed"]),Oe={PENDING:"pending",PROCESSING:"processing",COMPLETED:"completed",FAILED:"failed"},Tde=l.object({id:l.string(),type:l.string(),status:RT,data:l.unknown(),result:l.unknown().optional(),lastError:l.string().optional().nullable(),attempts:l.number(),maxRetries:l.number(),priority:l.number(),createdAt:l.date(),updatedAt:l.date(),processedAt:l.date().optional().nullable(),completedAt:l.date().optional().nullable(),failedAt:l.date().optional().nullable()}),Rde=l.object({jobId:l.string(),type:l.string(),status:eq,result:l.unknown().optional(),error:l.string().optional()}),tq=l.object({success:l.literal(!1),error:l.string().optional()}),rq=l.object({id:l.string(),type:l.enum(["job","batch"]),status:RT,message:l.string().optional(),progress:l.object({current:l.number(),total:l.number(),percentage:l.number()}).optional(),aggregationKey:l.string().optional(),batchDetails:l.object({totalOperations:l.number(),completedOperations:l.number(),failedOperations:l.number(),currentOperation:l.string().optional(),errors:l.array(l.string()).optional()}).optional(),jobDetails:l.object({jobType:l.string(),priority:l.number(),retryCount:l.number()}).optional(),metadata:ol}),nq=Oi(kI.progress,rq)});var Ce,Wt;var vn=v(()=>{Ce=class Ce extends Error{code;extendedCode;rawCode;constructor(e,t,r,o,n){if(t!==void 0)e=`${t}: ${e}`;super(e,{cause:n});this.code=t,this.extendedCode=r,this.rawCode=o,this.name="LibsqlError"}};Wt=class Wt extends Ce{statementIndex;constructor(e,t,r,o,n,i){super(e,r,o,n,i);this.statementIndex=t,this.name="LibsqlBatchError"}}});function oq(e){let t=$de.exec(e);if(t===null)throw new Ce(`The URL '${e}' is not in a valid format`,"URL_INVALID");let r=t.groups,o=r.scheme,n=r.authority!==void 0?Ode(r.authority):void 0,i=sa(r.path),s=r.query!==void 0?Pde(r.query):void 0,a=r.fragment!==void 0?sa(r.fragment):void 0;return{scheme:o,authority:n,path:i,query:s,fragment:a}}function Ode(e){let t=Cde.exec(e);if(t===null)throw new Ce("The authority part of the URL is not in a valid format","URL_INVALID");let r=t.groups,o=sa(r.host_br??r.host),n=r.port?parseInt(r.port,10):void 0,i=r.username!==void 0?{username:sa(r.username),password:r.password!==void 0?sa(r.password):void 0}:void 0;return{host:o,port:n,userinfo:i}}function Pde(e){let t=e.split("&"),r=[];for(let o of t){if(o==="")continue;let n,i,s=o.indexOf("=");if(s<0)n=o,i="";else n=o.substring(0,s),i=o.substring(s+1);r.push({key:sa(n.replaceAll("+"," ")),value:sa(i.replaceAll("+"," "))})}return{pairs:r}}function sa(e){try{return decodeURIComponent(e)}catch(t){if(t instanceof URIError)throw new Ce(`URL component has invalid percent encoding: ${t}`,"URL_INVALID",void 0,void 0,t);throw t}}function uf(e,t,r){if(t===void 0)throw new Ce(`URL with scheme ${JSON.stringify(e+":")} requires authority (the "//" part)`,"URL_INVALID");let o=`${e}:`,n=zde(t.host),i=Nde(t.port),a=`//${Dde(t.userinfo)}${n}${i}`,c=r.split("/").map(encodeURIComponent).join("/");if(c!==""&&!c.startsWith("/"))c="/"+c;return new URL(`${o}${a}${c}`)}function zde(e){return e.includes(":")?`[${encodeURI(e)}]`:encodeURI(e)}function Nde(e){return e!==void 0?`:${e}`:""}function Dde(e){if(e===void 0)return"";let t=encodeURIComponent(e.username),r=e.password!==void 0?`:${encodeURIComponent(e.password)}`:"";return`${t}${r}@`}var $de,Cde;var gy=v(()=>{vn();$de=(()=>new RegExp("^(?<scheme>[A-Za-z][A-Za-z.+-]*):(//(?<authority>[^/?#]*))?(?<path>[^?#]*)(\\?(?<query>[^#]*))?(#(?<fragment>.*))?$","su"))();Cde=(()=>new RegExp("^((?<username>[^:]*)(:(?<password>.*))?@)?((?<host>[^:\\[\\]]*)|(\\[(?<host_br>[^\\[\\]]*)\\]))(:(?<port>[0-9]*))?$","su"))()});var sl,iq,sq,df,yy,Lde,Gt,aq,uq=(e)=>e.replace(/=/g,"").replace(/[+\/]/g,(t)=>t=="+"?"-":"_"),dq=(e)=>e.replace(/[^A-Za-z0-9\+\/]/g,""),fq=(e)=>{let t,r,o,n,i="",s=e.length%3;for(let a=0;a<e.length;){if((r=e.charCodeAt(a++))>255||(o=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255)throw TypeError("invalid character found");t=r<<16|o<<8|n,i+=df[t>>18&63]+df[t>>12&63]+df[t>>6&63]+df[t&63]}return s?i.slice(0,s-3)+"===".substring(s):i},CT,$T,by=(e,t=!1)=>t?uq($T(e)):$T(e),Bde=(e)=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?Gt(192|t>>>6)+Gt(128|t&63):Gt(224|t>>>12&15)+Gt(128|t>>>6&63)+Gt(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return Gt(240|t>>>18&7)+Gt(128|t>>>12&63)+Gt(128|t>>>6&63)+Gt(128|t&63)}},jde,pq=(e)=>e.replace(jde,Bde),cq,il=(e,t=!1)=>t?uq(cq(e)):cq(e),lq=(e)=>il(e,!0),Zde,Ude=(e)=>{switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),r=t-65536;return Gt((r>>>10)+55296)+Gt((r&1023)+56320);case 3:return Gt((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Gt((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},mq=(e)=>e.replace(Zde,Ude),hq=(e)=>{if(e=e.replace(/\s+/g,""),!Lde.test(e))throw TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let t,r,o,n=[];for(let i=0;i<e.length;)if(t=yy[e.charAt(i++)]<<18|yy[e.charAt(i++)]<<12|(r=yy[e.charAt(i++)])<<6|(o=yy[e.charAt(i++)]),r===64)n.push(Gt(t>>16&255));else if(o===64)n.push(Gt(t>>16&255,t>>8&255));else n.push(Gt(t>>16&255,t>>8&255,t&255));return n.join("")},PT,gq,yq=(e)=>gq(bq(e)),Mde,bq=(e)=>dq(e.replace(/[-_]/g,(t)=>t=="-"?"+":"/")),OT=(e)=>Mde(bq(e)),qde=(e)=>{if(typeof e!=="string")return!1;let t=e.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(t)||!/[^\s0-9a-zA-Z\-_]/.test(t)},Sq=(e)=>({value:e,enumerable:!1,writable:!0,configurable:!0}),vq=function(){let e=(t,r)=>Object.defineProperty(String.prototype,t,Sq(r));e("fromBase64",function(){return OT(this)}),e("toBase64",function(t){return il(this,t)}),e("toBase64URI",function(){return il(this,!0)}),e("toBase64URL",function(){return il(this,!0)}),e("toUint8Array",function(){return yq(this)})},wq=function(){let e=(t,r)=>Object.defineProperty(Uint8Array.prototype,t,Sq(r));e("toBase64",function(t){return by(this,t)}),e("toBase64URI",function(){return by(this,!0)}),e("toBase64URL",function(){return by(this,!0)})},Fde=()=>{vq(),wq()},al;var Sy=v(()=>{sl=typeof Buffer==="function",iq=typeof TextDecoder==="function"?new TextDecoder("utf-8",{ignoreBOM:!0}):void 0,sq=typeof TextEncoder==="function"?new TextEncoder:void 0,df=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),yy=((e)=>{let t={};return e.forEach((r,o)=>t[r]=o),t})(df),Lde=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Gt=String.fromCharCode.bind(String),aq=typeof Uint8Array.from==="function"?Uint8Array.from.bind(Uint8Array):(e)=>new Uint8Array(Array.prototype.slice.call(e,0)),CT=typeof btoa==="function"?(e)=>btoa(e):sl?(e)=>Buffer.from(e,"binary").toString("base64"):fq,$T=sl?(e)=>Buffer.from(e).toString("base64"):(e)=>{let r=[];for(let o=0,n=e.length;o<n;o+=4096)r.push(Gt.apply(null,e.subarray(o,o+4096)));return CT(r.join(""))},jde=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,cq=sl?(e)=>Buffer.from(e,"utf8").toString("base64"):sq?(e)=>$T(sq.encode(e)):(e)=>CT(pq(e)),Zde=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,PT=typeof atob==="function"?(e)=>atob(dq(e)):sl?(e)=>Buffer.from(e,"base64").toString("binary"):hq,gq=sl?(e)=>aq(Buffer.from(e,"base64")):(e)=>aq(PT(e).split("").map((t)=>t.charCodeAt(0))),Mde=sl?(e)=>Buffer.from(e,"base64").toString("utf8"):iq?(e)=>iq.decode(gq(e)):(e)=>mq(PT(e)),al={version:"3.8.0",VERSION:"3.8.0",atob:PT,atobPolyfill:hq,btoa:CT,btoaPolyfill:fq,fromBase64:OT,toBase64:il,encode:il,encodeURI:lq,encodeURL:lq,utob:pq,btou:mq,decode:OT,isValid:qde,fromUint8Array:by,toUint8Array:yq,extendString:vq,extendUint8Array:wq,extendBuiltins:Fde}});function Ki(e){if(e==="write")return"BEGIN IMMEDIATE";else if(e==="read")return"BEGIN TRANSACTION READONLY";else if(e==="deferred")return"BEGIN DEFERRED";else throw RangeError('Unknown transaction mode, supported values are "write", "read" and "deferred"')}class cl{columns;columnTypes;rows;rowsAffected;lastInsertRowid;constructor(e,t,r,o,n){this.columns=e,this.columnTypes=t,this.rows=r,this.rowsAffected=o,this.lastInsertRowid=n}toJSON(){return{columns:this.columns,columnTypes:this.columnTypes,rows:this.rows.map(Kde),rowsAffected:this.rowsAffected,lastInsertRowid:this.lastInsertRowid!==void 0?""+this.lastInsertRowid:null}}}function Kde(e){return Array.prototype.map.call(e,Jde)}function Jde(e){if(typeof e==="bigint")return""+e;else if(e instanceof ArrayBuffer)return al.fromUint8Array(new Uint8Array(e));else return e}var Qn="https://github.com/libsql/libsql-client-ts#supported-urls";var ll=v(()=>{Sy()});function _q(e){return e.scheme==="file"&&(e.path===":memory:"||e.path.startsWith(":memory:?"))}function ff(e,t){if(typeof e!=="object")throw TypeError(`Expected client configuration as object, got ${typeof e}`);let{url:r,authToken:o,tls:n,intMode:i,concurrency:s}=e;s=Math.max(0,s||20),i??="number";let a=[];if(r===xq)r="file::memory:";let c=oq(r),u=c.scheme.toLowerCase(),d=u==="file"&&c.path===xq&&c.authority===void 0,f;if(d)f={cache:{values:["shared","private"],update:(y,S)=>a.push(`${y}=${S}`)}};else f={tls:{values:["0","1"],update:(y,S)=>n=S==="1"},authToken:{update:(y,S)=>o=S}};for(let{key:y,value:S}of c.query?.pairs??[]){if(!Object.hasOwn(f,y))throw new Ce(`Unsupported URL query parameter ${JSON.stringify(y)}`,"URL_PARAM_NOT_SUPPORTED");let x=f[y];if(x.values!==void 0&&!x.values.includes(S))throw new Ce(`Unknown value for the "${y}" query argument: ${JSON.stringify(S)}. Supported values are: [${x.values.map((_)=>'"'+_+'"').join(", ")}]`,"URL_INVALID");if(x.update!==void 0)x?.update(y,S)}let m=a.length===0?"":`?${a.join("&")}`,h=c.path+m,b;if(u==="libsql")if(n===!1){if(c.authority?.port===void 0)throw new Ce('A "libsql:" URL with ?tls=0 must specify an explicit port',"URL_INVALID");b=t?"http":"ws"}else b=t?"https":"wss";else b=u;if(b==="http"||b==="ws")n??=!1;else n??=!0;if(b!=="http"&&b!=="ws"&&b!=="https"&&b!=="wss"&&b!=="file")throw new Ce(`The client supports only "libsql:", "wss:", "ws:", "https:", "http:" and "file:" URLs, got ${JSON.stringify(c.scheme+":")}. For more information, please read ${Qn}`,"URL_SCHEME_NOT_SUPPORTED");if(i!=="number"&&i!=="bigint"&&i!=="string")throw TypeError(`Invalid value for intMode, expected "number", "bigint" or "string", got ${JSON.stringify(i)}`);if(c.fragment!==void 0)throw new Ce(`URL fragments are not supported: ${JSON.stringify("#"+c.fragment)}`,"URL_INVALID");if(d)return{scheme:"file",tls:!1,path:h,intMode:i,concurrency:s,syncUrl:e.syncUrl,syncInterval:e.syncInterval,readYourWrites:e.readYourWrites,offline:e.offline,fetch:e.fetch,timeout:e.timeout,authToken:void 0,encryptionKey:void 0,remoteEncryptionKey:void 0,authority:void 0};return{scheme:b,tls:n,authority:c.authority,path:h,authToken:o,intMode:i,concurrency:s,encryptionKey:e.encryptionKey,remoteEncryptionKey:e.remoteEncryptionKey,syncUrl:e.syncUrl,syncInterval:e.syncInterval,readYourWrites:e.readYourWrites,offline:e.offline,fetch:e.fetch,timeout:e.timeout}}var xq=":memory:";var pf=v(()=>{vn();gy();ll()});var kq=ge(function(tn){var Hde=tn&&tn.__createBinding||(Object.create?function(e,t,r,o){if(o===void 0)o=r;var n=Object.getOwnPropertyDescriptor(t,r);if(!n||("get"in n?!t.__esModule:n.writable||n.configurable))n={enumerable:!0,get:function(){return t[r]}};Object.defineProperty(e,o,n)}:function(e,t,r,o){if(o===void 0)o=r;e[o]=t[r]}),Vde=tn&&tn.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),Eq=tn&&tn.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null){for(var r in e)if(r!=="default"&&Object.prototype.hasOwnProperty.call(e,r))Hde(t,e,r)}return Vde(t,e),t};Object.defineProperty(tn,"__esModule",{value:!0});tn.load=tn.currentTarget=void 0;var Wde=Eq(qr("path")),Gde=Eq(qr("fs"));function Qde(){let e=null;switch(process.platform){case"android":switch(process.arch){case"arm":return"android-arm-eabi";case"arm64":return"android-arm64"}e="Android";break;case"win32":switch(process.arch){case"x64":return"win32-x64-msvc";case"arm64":return"win32-arm64-msvc";case"ia32":return"win32-ia32-msvc"}e="Windows";break;case"darwin":switch(process.arch){case"x64":return"darwin-x64";case"arm64":return"darwin-arm64"}e="macOS";break;case"linux":switch(process.arch){case"x64":case"arm64":return Yde()?`linux-${process.arch}-gnu`:`linux-${process.arch}-musl`;case"arm":return"linux-arm-gnueabihf"}e="Linux";break;case"freebsd":if(process.arch==="x64")return"freebsd-x64";e="FreeBSD";break}if(e)throw Error(`Neon: unsupported ${e} architecture: ${process.arch}`);throw Error(`Neon: unsupported system: ${process.platform}`)}tn.currentTarget=Qde;function Yde(){let e=process.report?.getReport();if(typeof e!=="object"||!e||!("header"in e))return!1;let t=e.header;return typeof t==="object"&&!!t&&"glibcVersionRuntime"in t}function Xde(e){let t=Wde.join(e,"index.node");return Gde.existsSync(t)?qr(t):null}tn.load=Xde});var Tq=ge(function(UNe,Aq){var Iq=()=>process.platform==="linux",zT=null,efe=()=>{if(!zT)zT=Iq()&&process.report?process.report.getReport():{};return zT};Aq.exports={isLinux:Iq,getReport:efe}});var Oq=ge(function(MNe,$q){var Rq=qr("fs"),tfe=(e)=>Rq.readFileSync(e,"utf-8"),rfe=(e)=>new Promise((t,r)=>{Rq.readFile(e,"utf-8",(o,n)=>{if(o)r(o);else t(n)})});$q.exports={LDD_PATH:"/usr/bin/ldd",readFileSync:tfe,readFile:rfe}});var Vq=ge(function(qNe,Hq){var Pq=qr("child_process"),{isLinux:ul,getReport:zq}=Tq(),{LDD_PATH:vy,readFile:Nq,readFileSync:Dq}=Oq(),Yn,Xn,Ji="",Lq=()=>{if(!Ji)return new Promise((e)=>{Pq.exec("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",(t,r)=>{Ji=t?" ":r,e(Ji)})});return Ji},Bq=()=>{if(!Ji)try{Ji=Pq.execSync("getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true",{encoding:"utf8"})}catch(e){Ji=" "}return Ji},Do="glibc",jq=/GLIBC\s(\d+\.\d+)/,aa="musl",nfe=Do.toUpperCase(),ofe=aa.toLowerCase(),ife=(e)=>e.includes("libc.musl-")||e.includes("ld-musl-"),Zq=()=>{let e=zq();if(e.header&&e.header.glibcVersionRuntime)return Do;if(Array.isArray(e.sharedObjects)){if(e.sharedObjects.some(ife))return aa}return null},Uq=(e)=>{let[t,r]=e.split(/[\r\n]+/);if(t&&t.includes(Do))return Do;if(r&&r.includes(aa))return aa;return null},Mq=(e)=>{if(e.includes(ofe))return aa;if(e.includes(nfe))return Do;return null},sfe=async()=>{if(Yn!==void 0)return Yn;Yn=null;try{let e=await Nq(vy);Yn=Mq(e)}catch(e){}return Yn},afe=()=>{if(Yn!==void 0)return Yn;Yn=null;try{let e=Dq(vy);Yn=Mq(e)}catch(e){}return Yn},qq=async()=>{let e=null;if(ul()){if(e=await sfe(),!e)e=Zq();if(!e){let t=await Lq();e=Uq(t)}}return e},Fq=()=>{let e=null;if(ul()){if(e=afe(),!e)e=Zq();if(!e){let t=Bq();e=Uq(t)}}return e},cfe=async()=>ul()&&await qq()!==Do,lfe=()=>ul()&&Fq()!==Do,ufe=async()=>{if(Xn!==void 0)return Xn;Xn=null;try{let t=(await Nq(vy)).match(jq);if(t)Xn=t[1]}catch(e){}return Xn},dfe=()=>{if(Xn!==void 0)return Xn;Xn=null;try{let t=Dq(vy).match(jq);if(t)Xn=t[1]}catch(e){}return Xn},Kq=()=>{let e=zq();if(e.header&&e.header.glibcVersionRuntime)return e.header.glibcVersionRuntime;return null},Cq=(e)=>e.trim().split(/\s+/)[1],Jq=(e)=>{let[t,r,o]=e.split(/[\r\n]+/);if(t&&t.includes(Do))return Cq(t);if(r&&o&&r.includes(aa))return Cq(o);return null},ffe=async()=>{let e=null;if(ul()){if(e=await ufe(),!e)e=Kq();if(!e){let t=await Lq();e=Jq(t)}}return e},pfe=()=>{let e=null;if(ul()){if(e=dfe(),!e)e=Kq();if(!e){let t=Bq();e=Jq(t)}}return e};Hq.exports={GLIBC:Do,MUSL:aa,family:qq,familySync:Fq,isNonGlibcLinux:cfe,isNonGlibcLinuxSync:lfe,version:ffe,versionSync:pfe}});var Gq=ge(function(FNe,Wq){var mfe={ALLOW:0,DENY:1};Wq.exports=mfe});var Yq=ge(function(KNe,Qq){var NT={value:"SqliteError",writable:!0,enumerable:!1,configurable:!0};function ca(e,t,r){if(new.target!==ca)return new ca(e,t);if(typeof t!=="string")throw TypeError("Expected second argument to be a string");Error.call(this,e),NT.value=""+e,Object.defineProperty(this,"message",NT),Error.captureStackTrace(this,ca),this.code=t,this.rawCode=r}Object.setPrototypeOf(ca,Error);Object.setPrototypeOf(ca.prototype,Error.prototype);Object.defineProperty(ca.prototype,"name",NT);Qq.exports=ca});var s4=ge(function(JNe,wy){var __dirname="/home/runner/work/brains/brains/node_modules/libsql",{load:hfe,currentTarget:gfe}=kq(),{familySync:Xq,GLIBC:yfe,MUSL:bfe}=Vq();function Sfe(){if(process.env.LIBSQL_JS_DEV)return hfe(__dirname);let e=gfe();if(Xq()==yfe)switch(e){case"linux-x64-musl":e="linux-x64-gnu";break;case"linux-arm64-musl":e="linux-arm64-gnu";break}if(e==="linux-arm-gnueabihf"&&Xq()==bfe)e="linux-arm-musleabihf";return qr(`@libsql/${e}`)}var{databaseOpen:vfe,databaseOpenWithSync:wfe,databaseInTransaction:xfe,databaseInterrupt:_fe,databaseClose:Efe,databaseSyncSync:kfe,databaseSyncUntilSync:Ife,databaseExecSync:Afe,databasePrepareSync:Tfe,databaseDefaultSafeIntegers:Rfe,databaseAuthorizer:$fe,databaseLoadExtension:Ofe,databaseMaxWriteReplicationIndex:Cfe,statementRaw:Pfe,statementIsReader:zfe,statementGet:e4,statementRun:t4,statementInterrupt:Nfe,statementRowsSync:r4,statementColumns:Dfe,statementSafeIntegers:Lfe,rowsNext:Bfe}=Sfe(),jfe=Gq(),n4=Yq();function dl(e){if(e.libsqlError)return new n4(e.message,e.code,e.rawCode);return e}class o4{constructor(e,t){let r=t?.encryptionCipher??"aes256cbc";if(t&&t.syncUrl){var o="";if(t.syncAuth)console.warn("Warning: The `syncAuth` option is deprecated, please use `authToken` option instead."),o=t.syncAuth;else if(t.authToken)o=t.authToken;let i=t?.encryptionKey??"",s=t?.syncPeriod??0,a=t?.readYourWrites??!0,c=t?.offline??!1,u=t?.remoteEncryptionKey??"";this.db=wfe(e,t.syncUrl,o,r,i,s,a,c,u)}else{let i=t?.authToken??"",s=t?.encryptionKey??"",a=t?.timeout??0,c=t?.remoteEncryptionKey??"";this.db=vfe(e,i,r,s,a,c)}this.memory=e===":memory:",this.readonly=!1,this.name="",this.open=!0;let n=this.db;Object.defineProperties(this,{inTransaction:{get(){return xfe(n)}}})}sync(){return kfe.call(this.db)}syncUntil(e){return Ife.call(this.db,e)}prepare(e){try{let t=Tfe.call(this.db,e);return new i4(t)}catch(t){throw dl(t)}}transaction(e){if(typeof e!=="function")throw TypeError("Expected first argument to be a function");let t=this,r=(n)=>(...i)=>{t.exec("BEGIN "+n);try{let s=e(...i);return t.exec("COMMIT"),s}catch(s){throw t.exec("ROLLBACK"),s}},o={default:{value:r("")},deferred:{value:r("DEFERRED")},immediate:{value:r("IMMEDIATE")},exclusive:{value:r("EXCLUSIVE")},database:{value:this,enumerable:!0}};return Object.defineProperties(o.default.value,o),Object.defineProperties(o.deferred.value,o),Object.defineProperties(o.immediate.value,o),Object.defineProperties(o.exclusive.value,o),o.default.value}pragma(e,t){if(t==null)t={};if(typeof e!=="string")throw TypeError("Expected first argument to be a string");if(typeof t!=="object")throw TypeError("Expected second argument to be an options object");let r=t.simple,o=this.prepare(`PRAGMA ${e}`,this,!0);return r?o.pluck().get():o.all()}backup(e,t){throw Error("not implemented")}serialize(e){throw Error("not implemented")}function(e,t,r){if(t==null)t={};if(typeof t==="function")r=t,t={};if(typeof e!=="string")throw TypeError("Expected first argument to be a string");if(typeof r!=="function")throw TypeError("Expected last argument to be a function");if(typeof t!=="object")throw TypeError("Expected second argument to be an options object");if(!e)throw TypeError("User-defined function name cannot be an empty string");throw Error("not implemented")}aggregate(e,t){if(typeof e!=="string")throw TypeError("Expected first argument to be a string");if(typeof t!=="object"||t===null)throw TypeError("Expected second argument to be an options object");if(!e)throw TypeError("User-defined function name cannot be an empty string");throw Error("not implemented")}table(e,t){if(typeof e!=="string")throw TypeError("Expected first argument to be a string");if(!e)throw TypeError("Virtual table module name cannot be an empty string");throw Error("not implemented")}authorizer(e){$fe.call(this.db,e)}loadExtension(...e){Ofe.call(this.db,...e)}maxWriteReplicationIndex(){return Cfe.call(this.db)}exec(e){try{Afe.call(this.db,e)}catch(t){throw dl(t)}}interrupt(){_fe.call(this.db)}close(){Efe.call(this.db),this.open=!1}defaultSafeIntegers(e){return Rfe.call(this.db,e??!0),this}unsafeMode(...e){throw Error("not implemented")}}class i4{constructor(e){this.stmt=e,this.pluckMode=!1}raw(e){return Pfe.call(this.stmt,e??!0),this}pluck(e){return this.pluckMode=e??!0,this}get reader(){return zfe.call(this.stmt)}run(...e){try{if(e.length==1&&typeof e[0]==="object")return t4.call(this.stmt,e[0]);else return t4.call(this.stmt,e.flat())}catch(t){throw dl(t)}}get(...e){try{if(e.length==1&&typeof e[0]==="object")return e4.call(this.stmt,e[0]);else return e4.call(this.stmt,e.flat())}catch(t){throw dl(t)}}iterate(...e){var t=void 0;if(e.length==1&&typeof e[0]==="object")t=r4.call(this.stmt,e[0]);else t=r4.call(this.stmt,e.flat());return{nextRows:Array(100),nextRowIndex:100,next(){try{if(this.nextRowIndex===100)Bfe.call(t,this.nextRows),this.nextRowIndex=0;let o=this.nextRows[this.nextRowIndex];if(this.nextRows[this.nextRowIndex]=void 0,!o)return{done:!0};return this.nextRowIndex++,{value:o,done:!1}}catch(o){throw dl(o)}},[Symbol.iterator](){return this}}}all(...e){try{let t=[];for(let r of this.iterate(...e))if(this.pluckMode)t.push(r[Object.keys(r)[0]]);else t.push(r);return t}catch(t){throw dl(t)}}interrupt(){Nfe.call(this.stmt)}columns(){return Dfe.call(this.stmt)}safeIntegers(e){return Lfe.call(this.stmt,e??!0),this}}wy.exports=o4;wy.exports.Authorization=jfe;wy.exports.SqliteError=n4});import{Buffer as c4}from"buffer";function l4(e){if(e.scheme!=="file")throw new Ce(`URL scheme ${JSON.stringify(e.scheme+":")} is not supported by the local sqlite3 client. For more information, please read ${Qn}`,"URL_SCHEME_NOT_SUPPORTED");let t=e.authority;if(t!==void 0){let s=t.host.toLowerCase();if(s!==""&&s!=="localhost")throw new Ce(`Invalid host in file URL: ${JSON.stringify(t.host)}. A "file:" URL with an absolute path should start with one slash ("file:/absolute/path.db") or with three slashes ("file:///absolute/path.db"). For more information, please read ${Qn}`,"URL_INVALID");if(t.port!==void 0)throw new Ce("File URL cannot have a port","URL_INVALID");if(t.userinfo!==void 0)throw new Ce("File URL cannot have username and password","URL_INVALID")}let r=_q(e);if(r&&e.syncUrl)throw new Ce(`Embedded replica must use file for local db but URI with in-memory mode were provided instead: ${e.path}`,"URL_INVALID");let o=e.path;if(r)o=`${e.scheme}:${e.path}`;let n={authToken:e.authToken,encryptionKey:e.encryptionKey,remoteEncryptionKey:e.remoteEncryptionKey,syncUrl:e.syncUrl,syncPeriod:e.syncInterval,readYourWrites:e.readYourWrites,offline:e.offline,timeout:e.timeout},i=new mf.default(o,n);return zt(i,"SELECT 1 AS checkThatTheDatabaseCanBeOpened",e.intMode),new u4(o,n,i,e.intMode)}class u4{#e;#t;#r;#n;closed;protocol;constructor(e,t,r,o){this.#e=e,this.#t=t,this.#r=r,this.#n=o,this.closed=!1,this.protocol="file"}async execute(e,t){let r;if(typeof e==="string")r={sql:e,args:t||[]};else r=e;return this.#o(),zt(this.#i(),r,this.#n)}async batch(e,t="deferred"){this.#o();let r=this.#i();try{zt(r,Ki(t),this.#n);let o=[];for(let n=0;n<e.length;n++)try{if(!r.inTransaction)throw new Wt("The transaction has been rolled back",n,"TRANSACTION_CLOSED");let i=e[n],s=Array.isArray(i)?{sql:i[0],args:i[1]||[]}:i;o.push(zt(r,s,this.#n))}catch(i){if(i instanceof Wt)throw i;if(i instanceof Ce)throw new Wt(i.message,n,i.code,i.extendedCode,i.rawCode,i.cause instanceof Error?i.cause:void 0);throw i}return zt(r,"COMMIT",this.#n),o}finally{if(r.inTransaction)zt(r,"ROLLBACK",this.#n)}}async migrate(e){this.#o();let t=this.#i();try{zt(t,"PRAGMA foreign_keys=off",this.#n),zt(t,Ki("deferred"),this.#n);let r=[];for(let o=0;o<e.length;o++)try{if(!t.inTransaction)throw new Wt("The transaction has been rolled back",o,"TRANSACTION_CLOSED");r.push(zt(t,e[o],this.#n))}catch(n){if(n instanceof Wt)throw n;if(n instanceof Ce)throw new Wt(n.message,o,n.code,n.extendedCode,n.rawCode,n.cause instanceof Error?n.cause:void 0);throw n}return zt(t,"COMMIT",this.#n),r}finally{if(t.inTransaction)zt(t,"ROLLBACK",this.#n);zt(t,"PRAGMA foreign_keys=on",this.#n)}}async transaction(e="write"){let t=this.#i();return zt(t,Ki(e),this.#n),this.#r=null,new d4(t,this.#n)}async executeMultiple(e){this.#o();let t=this.#i();try{return f4(t,e)}finally{if(t.inTransaction)zt(t,"ROLLBACK",this.#n)}}async sync(){this.#o();let e=await this.#i().sync();return{frames_synced:e.frames_synced,frame_no:e.frame_no}}async reconnect(){try{if(!this.closed&&this.#r!==null)this.#r.close()}finally{this.#r=new mf.default(this.#e,this.#t),this.closed=!1}}close(){if(this.closed=!0,this.#r!==null)this.#r.close(),this.#r=null}#o(){if(this.closed)throw new Ce("The client is closed","CLIENT_CLOSED")}#i(){if(this.#r===null)this.#r=new mf.default(this.#e,this.#t);return this.#r}}class d4{#e;#t;constructor(e,t){this.#e=e,this.#t=t}async execute(e,t){let r;if(typeof e==="string")r={sql:e,args:t||[]};else r=e;return this.#r(),zt(this.#e,r,this.#t)}async batch(e){let t=[];for(let r=0;r<e.length;r++)try{this.#r();let o=e[r],n=Array.isArray(o)?{sql:o[0],args:o[1]||[]}:o;t.push(zt(this.#e,n,this.#t))}catch(o){if(o instanceof Wt)throw o;if(o instanceof Ce)throw new Wt(o.message,r,o.code,o.extendedCode,o.rawCode,o.cause instanceof Error?o.cause:void 0);throw o}return t}async executeMultiple(e){return this.#r(),f4(this.#e,e)}async rollback(){if(!this.#e.open)return;this.#r(),zt(this.#e,"ROLLBACK",this.#t)}async commit(){this.#r(),zt(this.#e,"COMMIT",this.#t)}close(){if(this.#e.inTransaction)zt(this.#e,"ROLLBACK",this.#t)}get closed(){return!this.#e.inTransaction}#r(){if(this.closed)throw new Ce("The transaction is closed","TRANSACTION_CLOSED")}}function zt(e,t,r){let o,n;if(typeof t==="string")o=t,n=[];else if(o=t.sql,Array.isArray(t.args))n=t.args.map((i)=>a4(i,r));else{n={};for(let i in t.args){let s=i[0]==="@"||i[0]==="$"||i[0]===":"?i.substring(1):i;n[s]=a4(t.args[i],r)}}try{let i=e.prepare(o);i.safeIntegers(!0);let s=!0;try{i.raw(!0)}catch{s=!1}if(s){let a=Array.from(i.columns().map((m)=>m.name)),c=Array.from(i.columns().map((m)=>m.type??"")),u=i.all(n).map((m)=>Zfe(m,a,r)),d=0,f=void 0;return new cl(a,c,u,0,void 0)}else{let a=i.run(n),c=a.changes,u=BigInt(a.lastInsertRowid);return new cl([],[],[],c,u)}}catch(i){throw p4(i)}}function Zfe(e,t,r){let o={};Object.defineProperty(o,"length",{value:e.length});for(let n=0;n<e.length;++n){let i=Ufe(e[n],r);Object.defineProperty(o,n,{value:i});let s=t[n];if(!Object.hasOwn(o,s))Object.defineProperty(o,s,{value:i,enumerable:!0,configurable:!0,writable:!0})}return o}function Ufe(e,t){if(typeof e==="bigint")if(t==="number"){if(e<Mfe||e>qfe)throw RangeError("Received integer which cannot be safely represented as a JavaScript number");return Number(e)}else if(t==="bigint")return e;else if(t==="string")return""+e;else throw Error("Invalid value for IntMode");else if(e instanceof c4)return e.buffer;return e}function a4(e,t){if(typeof e==="number"){if(!Number.isFinite(e))throw RangeError("Only finite numbers (not Infinity or NaN) can be passed as arguments");return e}else if(typeof e==="bigint"){if(e<Ffe||e>Kfe)throw RangeError("bigint is too large to be represented as a 64-bit integer and passed as argument");return e}else if(typeof e==="boolean")switch(t){case"bigint":return e?1n:0n;case"string":return e?"1":"0";default:return e?1:0}else if(e instanceof ArrayBuffer)return c4.from(e);else if(e instanceof Date)return e.valueOf();else if(e===void 0)throw TypeError("undefined cannot be passed as argument to the database");else return e}function f4(e,t){try{e.exec(t)}catch(r){throw p4(r)}}function p4(e){if(e instanceof mf.default.SqliteError){let t=e.code,r=Jfe(e.rawCode);return new Ce(e.message,r,t,e.rawCode,e)}return e}function Jfe(e){if(e===void 0)return"SQLITE_UNKNOWN";let t=e&255;return Hfe[t]??`SQLITE_UNKNOWN_${t.toString()}`}var mf,Mfe,qfe=9007199254740991n,Ffe,Kfe=9223372036854775807n,Hfe;var m4=v(()=>{vn();pf();ll();mf=Ul(s4(),1);vn();Mfe=-9007199254740991n;Ffe=-9223372036854775808n;Hfe={1:"SQLITE_ERROR",2:"SQLITE_INTERNAL",3:"SQLITE_PERM",4:"SQLITE_ABORT",5:"SQLITE_BUSY",6:"SQLITE_LOCKED",7:"SQLITE_NOMEM",8:"SQLITE_READONLY",9:"SQLITE_INTERRUPT",10:"SQLITE_IOERR",11:"SQLITE_CORRUPT",12:"SQLITE_NOTFOUND",13:"SQLITE_FULL",14:"SQLITE_CANTOPEN",15:"SQLITE_PROTOCOL",16:"SQLITE_EMPTY",17:"SQLITE_SCHEMA",18:"SQLITE_TOOBIG",19:"SQLITE_CONSTRAINT",20:"SQLITE_MISMATCH",21:"SQLITE_MISUSE",22:"SQLITE_NOLFS",23:"SQLITE_AUTH",24:"SQLITE_FORMAT",25:"SQLITE_RANGE",26:"SQLITE_NOTADB",27:"SQLITE_NOTICE",28:"SQLITE_WARNING"}});var Hi;var DT=v(()=>{if(typeof WebSocket<"u")Hi=WebSocket;else if(typeof global<"u")Hi=global.WebSocket;else if(typeof window<"u")Hi=window.WebSocket;else if(typeof self<"u")Hi=self.WebSocket});class fl{constructor(){this.intMode="number"}intMode}var Ge,Pe,hf,xt,gf,pl,la,wn,or,eo;var _t=v(()=>{Ge=class Ge extends Error{constructor(e){super(e);this.name="ClientError"}};Pe=class Pe extends Ge{constructor(e){super(e);this.name="ProtoError"}};hf=class hf extends Ge{code;proto;constructor(e,t){super(e);this.name="ResponseError",this.code=t.code,this.proto=t,this.stack=void 0}};xt=class xt extends Ge{constructor(e,t){if(t!==void 0){super(`${e}: ${t}`);this.cause=t}else super(e);this.name="ClosedError"}};gf=class gf extends Ge{constructor(e){super(e);this.name="WebSocketUnsupportedError"}};pl=class pl extends Ge{constructor(e){super(e);this.name="WebSocketError"}};la=class la extends Ge{status;constructor(e,t){super(e);this.status=t,this.name="HttpServerError"}};wn=class wn extends Ge{constructor(e){super(e);this.name="ProtocolVersionError"}};or=class or extends Ge{constructor(e){super(e);this.name="InternalError"}};eo=class eo extends Ge{constructor(e){super(e);this.name="MisuseError"}}});function Tr(e){if(typeof e==="string")return e;throw ml(e,"string")}function Zr(e){if(e===null||e===void 0)return;else if(typeof e==="string")return e;throw ml(e,"string or null")}function Lo(e){if(typeof e==="number")return e;throw ml(e,"number")}function Vi(e){if(typeof e==="boolean")return e;throw ml(e,"boolean")}function yf(e){if(Array.isArray(e))return e;throw ml(e,"array")}function It(e){if(e!==null&&typeof e==="object"&&!Array.isArray(e))return e;throw ml(e,"object")}function xn(e,t){return yf(e).map((r)=>t(It(r)))}function ml(e,t){if(e===void 0)return new Pe(`Expected ${t}, but the property was missing`);let r=typeof e;if(e===null)r="null";else if(Array.isArray(e))r="array";return new Pe(`Expected ${t}, received ${r}`)}function ua(e,t){return t(It(e))}var hl=v(()=>{_t()});class h4{#e;#t;constructor(e){this.#e=e,this.#t=!1}begin(){this.#e.push("{"),this.#t=!0}end(){this.#e.push("}"),this.#t=!1}#r(e){if(this.#t)this.#e.push('"'),this.#t=!1;else this.#e.push(',"');this.#e.push(e),this.#e.push('":')}string(e,t){this.#r(e),this.#e.push(JSON.stringify(t))}stringRaw(e,t){this.#r(e),this.#e.push('"'),this.#e.push(t),this.#e.push('"')}number(e,t){this.#r(e),this.#e.push(""+t)}boolean(e,t){this.#r(e),this.#e.push(t?"true":"false")}object(e,t,r){this.#r(e),this.begin(),r(this,t),this.end()}arrayObjects(e,t,r){this.#r(e),this.#e.push("[");for(let o=0;o<t.length;++o){if(o!==0)this.#e.push(",");this.begin(),r(this,t[o]),this.end()}this.#e.push("]")}}function bf(e,t){let r=[],o=new h4(r);return o.begin(),t(o,e),o.end(),r.join("")}var da=0,Sf=1,vf=2,g4=5;class y4{#e;#t;#r;constructor(e){this.#e=e,this.#t=new DataView(e.buffer,e.byteOffset,e.byteLength),this.#r=0}varint(){let e=0;for(let t=0;;t+=7){let r=this.#e[this.#r++];if(e|=(r&127)<<t,!(r&128))break}return e}varintBig(){let e=0n;for(let t=0n;;t+=7n){let r=this.#e[this.#r++];if(e|=BigInt(r&127)<<t,!(r&128))break}return e}bytes(e){let t=new Uint8Array(this.#e.buffer,this.#e.byteOffset+this.#r,e);return this.#r+=e,t}double(){let e=this.#t.getFloat64(this.#r,!0);return this.#r+=8,e}skipVarint(){for(;;)if(!(this.#e[this.#r++]&128))break}skip(e){this.#r+=e}eof(){return this.#r>=this.#e.byteLength}}class b4{#e;#t;constructor(e){this.#e=e,this.#t=-1}setup(e){this.#t=e}#r(e){if(this.#t!==e)throw new Pe(`Expected wire type ${e}, got ${this.#t}`);this.#t=-1}bytes(){this.#r(vf);let e=this.#e.varint();return this.#e.bytes(e)}string(){return new TextDecoder().decode(this.bytes())}message(e){return Wi(this.bytes(),e)}int32(){return this.#r(da),this.#e.varint()}uint32(){return this.int32()}bool(){return this.int32()!==0}uint64(){return this.#r(da),this.#e.varintBig()}sint64(){let e=this.uint64();return e>>1n^-(e&1n)}double(){return this.#r(Sf),this.#e.double()}maybeSkip(){if(this.#t<0)return;else if(this.#t===da)this.#e.skipVarint();else if(this.#t===Sf)this.#e.skip(8);else if(this.#t===vf){let e=this.#e.varint();this.#e.skip(e)}else if(this.#t===g4)this.#e.skip(4);else throw new Pe(`Unexpected wire type ${this.#t}`);this.#t=-1}}function Wi(e,t){let r=new y4(e),o=new b4(r),n=t.default();while(!r.eof()){let i=r.varint(),s=i>>3,a=i&7;o.setup(a);let c=t[s];if(c!==void 0){let u=c(o,n);if(u!==void 0)n=u}o.maybeSkip()}return n}var LT=v(()=>{_t()});class BT{#e;#t;#r;#n;constructor(){this.#e=new ArrayBuffer(256),this.#t=new Uint8Array(this.#e),this.#r=new DataView(this.#e),this.#n=0}#o(e){if(this.#n+e<=this.#e.byteLength)return;let t=this.#e.byteLength;while(t<this.#n+e)t*=2;let r=new ArrayBuffer(t),o=new Uint8Array(r),n=new DataView(r);o.set(new Uint8Array(this.#e,0,this.#n)),this.#e=r,this.#t=o,this.#r=n}#i(e){this.#o(5),e=0|e;do{let t=e&127;e>>>=7,t|=e?128:0,this.#t[this.#n++]=t}while(e)}#a(e){this.#o(10),e=e&0xffffffffffffffffn;do{let t=Number(e&0x7fn);e>>=7n,t|=e?128:0,this.#t[this.#n++]=t}while(e)}#s(e,t){this.#i(e<<3|t)}bytes(e,t){this.#s(e,vf),this.#i(t.byteLength),this.#o(t.byteLength),this.#t.set(t,this.#n),this.#n+=t.byteLength}string(e,t){this.bytes(e,new TextEncoder().encode(t))}message(e,t,r){let o=new BT;r(o,t),this.bytes(e,o.data())}int32(e,t){this.#s(e,da),this.#i(t)}uint32(e,t){this.int32(e,t)}bool(e,t){this.int32(e,t?1:0)}sint64(e,t){this.#s(e,da),this.#a(t<<1n^t>>63n)}double(e,t){this.#s(e,Sf),this.#o(8),this.#r.setFloat64(this.#n,t,!0),this.#n+=8}data(){return new Uint8Array(this.#e,0,this.#n)}}function wf(e,t){let r=new BT;return t(r,e),r.data()}var S4=()=>{};var jT=v(()=>{hl();LT();S4()});class Gi{#e;#t;constructor(){this.#e=new Set,this.#t=new Set}alloc(){for(let t of this.#t){if(this.#t.delete(t),this.#e.add(t),!this.#e.has(this.#e.size-1))this.#t.add(this.#e.size-1);return t}let e=this.#e.size;return this.#e.add(e),e}free(e){if(!this.#e.delete(e))throw new or("Freeing an id that is not allocated");if(this.#t.delete(this.#e.size),e<this.#e.size)this.#t.add(e)}}var ZT=v(()=>{_t()});function Je(e,t){throw new or(t)}var rn=v(()=>{_t()});function gl(e){if(e===null)return null;else if(typeof e==="string")return e;else if(typeof e==="number"){if(!Number.isFinite(e))throw RangeError("Only finite numbers (not Infinity or NaN) can be passed as arguments");return e}else if(typeof e==="bigint"){if(e<Wfe||e>Gfe)throw RangeError("This bigint value is too large to be represented as a 64-bit integer and passed as argument");return e}else if(typeof e==="boolean")return e?1n:0n;else if(e instanceof ArrayBuffer)return new Uint8Array(e);else if(e instanceof Uint8Array)return e;else if(e instanceof Date)return+e.valueOf();else if(typeof e==="object")return""+e.toString();else throw TypeError("Unsupported type of value")}function UT(e,t){if(e===null)return null;else if(typeof e==="number")return e;else if(typeof e==="string")return e;else if(typeof e==="bigint")if(t==="number"){let r=Number(e);if(!Number.isSafeInteger(r))throw RangeError("Received integer which is too large to be safely represented as a JavaScript number");return r}else if(t==="bigint")return e;else if(t==="string")return""+e;else throw new eo("Invalid value for IntMode");else if(e instanceof Uint8Array)return e.slice().buffer;else if(e===void 0)throw new Pe("Received unrecognized type of Value");else throw Je(e,"Impossible type of Value")}var Wfe,Gfe=9223372036854775807n;var MT=v(()=>{_t();rn();Wfe=-9223372036854775808n});function fa(e){return{affectedRowCount:e.affectedRowCount,lastInsertRowid:e.lastInsertRowid,columnNames:e.cols.map((t)=>t.name),columnDecltypes:e.cols.map((t)=>t.decltype)}}function _y(e,t){let r=fa(e),o=e.rows.map((n)=>v4(r.columnNames,n,t));return{...r,rows:o}}function Ey(e,t){let r=fa(e),o;if(e.rows.length>0)o=v4(r.columnNames,e.rows[0],t);return{...r,row:o}}function ky(e,t){let r=fa(e),o;if(e.rows.length>0&&r.columnNames.length>0)o=UT(e.rows[0][0],t);return{...r,value:o}}function v4(e,t,r){let o={};Object.defineProperty(o,"length",{value:t.length});for(let n=0;n<t.length;++n){let i=UT(t[n],r);Object.defineProperty(o,n,{value:i});let s=e[n];if(s!==void 0&&!Object.hasOwn(o,s))Object.defineProperty(o,s,{value:i,enumerable:!0,configurable:!0,writable:!0})}return o}function Bo(e){return new hf(e.message,e)}var xf=v(()=>{_t();MT()});class pa{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=void 0}_getSqlId(e){if(this.#e!==e)throw new eo("Attempted to use SQL text opened with other object");else if(this.#r!==void 0)throw new xt("SQL text is closed",this.#r);return this.#t}close(){this._setClosed(new Ge("SQL text was manually closed"))}_setClosed(e){if(this.#r===void 0)this.#r=e,this.#e._closeSql(this.#t)}get closed(){return this.#r!==void 0}}function _f(e,t){if(t instanceof pa)return{sqlId:t._getSqlId(e)};else return{sql:""+t}}var yl=v(()=>{_t()});class Qi{#e;#t;constructor(){this.#e=[],this.#t=[]}get length(){return this.#e.length+this.#t.length}push(e){this.#e.push(e)}shift(){if(this.#t.length===0&&this.#e.length>0)this.#t=this.#e.reverse(),this.#e=[];return this.#t.pop()}first(){return this.#t.length!==0?this.#t[this.#t.length-1]:this.#e[0]}}class Ef{sql;_args;_namedArgs;constructor(e){this.sql=e,this._args=[],this._namedArgs=new Map}bindIndexes(e){this._args.length=0;for(let t of e)this._args.push(gl(t));return this}bindIndex(e,t){if(e!==(e|0)||e<=0)throw RangeError("Index of a positional argument must be positive integer");while(this._args.length<e)this._args.push(null);return this._args[e-1]=gl(t),this}bindName(e,t){return this._namedArgs.set(e,gl(t)),this}unbindAll(){return this._args.length=0,this._namedArgs.clear(),this}}function Iy(e,t,r){let o,n=[],i=[];if(t instanceof Ef){o=t.sql,n=t._args;for(let[c,u]of t._namedArgs.entries())i.push({name:c,value:u})}else if(Array.isArray(t))if(o=t[0],Array.isArray(t[1]))n=t[1].map((c)=>gl(c));else i=Object.entries(t[1]).map(([c,u])=>({name:c,value:gl(u)}));else o=t;let{sql:s,sqlId:a}=_f(e,o);return{sql:s,sqlId:a,args:n,namedArgs:i,wantRows:r}}var Ay=v(()=>{yl();MT()});class Ty{_stream;#e;_steps;#t;constructor(e,t){this._stream=e,this.#e=t,this._steps=[],this.#t=!1}step(){return new qT(this)}execute(){if(this.#t)throw new eo("This batch has already been executed");this.#t=!0;let e={steps:this._steps.map((t)=>t.proto)};if(this.#e)return Yfe(this._stream,this._steps,e);else return Qfe(this._stream,this._steps,e)}}function Qfe(e,t,r){return e._batch(r).then((o)=>{for(let n=0;n<t.length;++n){let i=o.stepResults.get(n),s=o.stepErrors.get(n);t[n].callback(i,s)}})}async function Yfe(e,t,r){let o=await e._openCursor(r);try{let n=0,i=void 0,s=[];for(;;){let a=await o.next();if(a===void 0)break;if(a.type==="step_begin"){if(a.step<n||a.step>=t.length)throw new Pe("Server produced StepBeginEntry for unexpected step");else if(i!==void 0)throw new Pe("Server produced StepBeginEntry before terminating previous step");for(let c=n;c<a.step;++c)t[c].callback(void 0,void 0);n=a.step+1,i=a,s=[]}else if(a.type==="step_end"){if(i===void 0)throw new Pe("Server produced StepEndEntry but no step is active");let c={cols:i.cols,rows:s,affectedRowCount:a.affectedRowCount,lastInsertRowid:a.lastInsertRowid};t[i.step].callback(c,void 0),i=void 0,s=[]}else if(a.type==="step_error"){if(i===void 0){if(a.step>=t.length)throw new Pe("Server produced StepErrorEntry for unexpected step");for(let c=n;c<a.step;++c)t[c].callback(void 0,void 0)}else{if(a.step!==i.step)throw new Pe("Server produced StepErrorEntry for unexpected step");i=void 0,s=[]}t[a.step].callback(void 0,a.error),n=a.step+1}else if(a.type==="row"){if(i===void 0)throw new Pe("Server produced RowEntry but no step is active");s.push(a.row)}else if(a.type==="error")throw Bo(a.error);else if(a.type==="none")throw new Pe("Server produced unrecognized CursorEntry");else throw Je(a,"Impossible CursorEntry")}if(i!==void 0)throw new Pe("Server closed Cursor before terminating active step");for(let a=n;a<t.length;++a)t[a].callback(void 0,void 0)}finally{o.close()}}class qT{_batch;#e;_index;constructor(e){this._batch=e,this.#e=[],this._index=void 0}condition(e){return this.#e.push(e._proto),this}query(e){return this.#t(e,!0,_y)}queryRow(e){return this.#t(e,!0,Ey)}queryValue(e){return this.#t(e,!0,ky)}run(e){return this.#t(e,!1,fa)}#t(e,t,r){if(this._index!==void 0)throw new eo("This BatchStep has already been added to the batch");let o=Iy(this._batch._stream._sqlOwner(),e,t),n;if(this.#e.length===0)n=void 0;else if(this.#e.length===1)n=this.#e[0];else n={type:"and",conds:this.#e.slice()};let i={stmt:o,condition:n};return new Promise((s,a)=>{let c=(u,d)=>{if(u!==void 0&&d!==void 0)a(new Pe("Server returned both result and error"));else if(d!==void 0)a(Bo(d));else if(u!==void 0)s(r(u,this._batch._stream.intMode));else s(void 0)};this._index=this._batch._steps.length,this._batch._steps.push({proto:i,callback:c})})}}class ut{_batch;_proto;constructor(e,t){this._batch=e,this._proto=t}static ok(e){return new ut(e._batch,{type:"ok",step:w4(e)})}static error(e){return new ut(e._batch,{type:"error",step:w4(e)})}static not(e){return new ut(e._batch,{type:"not",cond:e._proto})}static and(e,t){for(let r of t)x4(e,r);return new ut(e,{type:"and",conds:t.map((r)=>r._proto)})}static or(e,t){for(let r of t)x4(e,r);return new ut(e,{type:"or",conds:t.map((r)=>r._proto)})}static isAutocommit(e){return e._stream.client()._ensureVersion(3,"BatchCond.isAutocommit()"),new ut(e,{type:"is_autocommit"})}}function w4(e){if(e._index===void 0)throw new eo("Cannot add a condition referencing a step that has not been added to the batch");return e._index}function x4(e,t){if(t._batch!==e)throw new eo("Cannot mix BatchCond objects for different Batch objects")}var FT=v(()=>{_t();xf();Ay();rn()});function _4(e){return{paramNames:e.params.map((t)=>t.name),columns:e.cols,isExplain:e.isExplain,isReadonly:e.isReadonly}}class bl{constructor(e){this.intMode=e}query(e){return this.#e(e,!0,_y)}queryRow(e){return this.#e(e,!0,Ey)}queryValue(e){return this.#e(e,!0,ky)}run(e){return this.#e(e,!1,fa)}#e(e,t,r){let o=Iy(this._sqlOwner(),e,t);return this._execute(o).then((n)=>r(n,this.intMode))}batch(e=!1){return new Ty(this,e)}describe(e){let t=_f(this._sqlOwner(),e);return this._describe(t).then(_4)}sequence(e){let t=_f(this._sqlOwner(),e);return this._sequence(t)}intMode}var Ry=v(()=>{FT();xf();yl();Ay()});class kf{}var Xfe=1000,epe=10,KT;var E4=v(()=>{_t();KT=class KT extends kf{#e;#t;#r;#n;#o;#i;#a;constructor(e,t,r){super();this.#e=e,this.#t=t,this.#r=r,this.#n=new Qi,this.#o=new Qi,this.#i=void 0,this.#a=!1}async next(){for(;;){if(this.#i!==void 0)throw new xt("Cursor is closed",this.#i);while(!this.#a&&this.#o.length<epe)this.#o.push(this.#s());let e=this.#n.shift();if(this.#a||e!==void 0)return e;await this.#o.shift().then((t)=>{if(t===void 0)return;for(let r of t.entries)this.#n.push(r);this.#a||=t.done})}}#s(){return this.#t._sendCursorRequest(this,{type:"fetch_cursor",cursorId:this.#r,maxCount:Xfe}).then((e)=>e,(e)=>{this._setClosed(e);return})}_setClosed(e){if(this.#i!==void 0)return;this.#i=e,this.#t._sendCursorRequest(this,{type:"close_cursor",cursorId:this.#r}).catch(()=>{return}),this.#t._cursorClosed(this)}close(){this._setClosed(new Ge("Cursor was manually closed"))}get closed(){return this.#i!==void 0}}});var If;var JT=v(()=>{_t();Ry();E4();If=class If extends bl{#e;#t;#r;#n;#o;#i;static open(e){let t=e._streamIdAlloc.alloc(),r=new If(e,t),o=()=>{return},n=(s)=>r.#l(s),i={type:"open_stream",streamId:t};return e._sendRequest(i,{responseCallback:o,errorCallback:n}),r}constructor(e,t){super(e.intMode);this.#e=e,this.#t=t,this.#r=new Qi,this.#n=void 0,this.#o=!1,this.#i=void 0}client(){return this.#e}_sqlOwner(){return this.#e}_execute(e){return this.#a({type:"execute",streamId:this.#t,stmt:e}).then((t)=>t.result)}_batch(e){return this.#a({type:"batch",streamId:this.#t,batch:e}).then((t)=>t.result)}_describe(e){return this.#e._ensureVersion(2,"describe()"),this.#a({type:"describe",streamId:this.#t,sql:e.sql,sqlId:e.sqlId}).then((t)=>t.result)}_sequence(e){return this.#e._ensureVersion(2,"sequence()"),this.#a({type:"sequence",streamId:this.#t,sql:e.sql,sqlId:e.sqlId}).then((t)=>{return})}getAutocommit(){return this.#e._ensureVersion(3,"getAutocommit()"),this.#a({type:"get_autocommit",streamId:this.#t}).then((e)=>e.isAutocommit)}#a(e){return new Promise((t,r)=>{this.#s({type:"request",request:e,responseCallback:t,errorCallback:r})})}_openCursor(e){return this.#e._ensureVersion(3,"cursor"),new Promise((t,r)=>{this.#s({type:"cursor",batch:e,cursorCallback:t,errorCallback:r})})}_sendCursorRequest(e,t){if(e!==this.#n)throw new or("Cursor not associated with the stream attempted to execute a request");return new Promise((r,o)=>{if(this.#i!==void 0)o(new xt("Stream is closed",this.#i));else this.#e._sendRequest(t,{responseCallback:r,errorCallback:o})})}_cursorClosed(e){if(e!==this.#n)throw new or("Cursor was closed, but it was not associated with the stream");this.#n=void 0,this.#c()}#s(e){if(this.#i!==void 0)e.errorCallback(new xt("Stream is closed",this.#i));else if(this.#o)e.errorCallback(new xt("Stream is closing",void 0));else this.#r.push(e),this.#c()}#c(){for(;;){let e=this.#r.first();if(e===void 0&&this.#n===void 0&&this.#o){this.#l(new Ge("Stream was gracefully closed"));break}else if(e?.type==="request"&&this.#n===void 0){let{request:t,responseCallback:r,errorCallback:o}=e;this.#r.shift(),this.#e._sendRequest(t,{responseCallback:r,errorCallback:o})}else if(e?.type==="cursor"&&this.#n===void 0){let{batch:t,cursorCallback:r}=e;this.#r.shift();let o=this.#e._cursorIdAlloc.alloc(),n=new KT(this.#e,this,o),i={type:"open_cursor",streamId:this.#t,cursorId:o,batch:t},s=()=>{return},a=(c)=>n._setClosed(c);this.#e._sendRequest(i,{responseCallback:s,errorCallback:a}),this.#n=n,r(n)}else break}}#l(e){if(this.#i!==void 0)return;if(this.#i=e,this.#n!==void 0)this.#n._setClosed(e);for(;;){let n=this.#r.shift();if(n!==void 0)n.errorCallback(e);else break}let t={type:"close_stream",streamId:this.#t},r=()=>this.#e._streamIdAlloc.free(this.#t),o=()=>{return};this.#e._sendRequest(t,{responseCallback:r,errorCallback:o})}close(){this.#l(new Ge("Stream was manually closed"))}closeGracefully(){this.#o=!0,this.#c()}get closed(){return this.#i!==void 0||this.#o}}});function Af(e,t){if(t.sql!==void 0)e.string("sql",t.sql);if(t.sqlId!==void 0)e.number("sql_id",t.sqlId);e.arrayObjects("args",t.args,k4),e.arrayObjects("named_args",t.namedArgs,tpe),e.boolean("want_rows",t.wantRows)}function tpe(e,t){e.string("name",t.name),e.object("value",t.value,k4)}function Sl(e,t){e.arrayObjects("steps",t.steps,rpe)}function rpe(e,t){if(t.condition!==void 0)e.object("condition",t.condition,HT);e.object("stmt",t.stmt,Af)}function HT(e,t){if(e.stringRaw("type",t.type),t.type==="ok"||t.type==="error")e.number("step",t.step);else if(t.type==="not")e.object("cond",t.cond,HT);else if(t.type==="and"||t.type==="or")e.arrayObjects("conds",t.conds,HT);else if(t.type==="is_autocommit");else throw Je(t,"Impossible type of BatchCond")}function k4(e,t){if(t===null)e.stringRaw("type","null");else if(typeof t==="bigint")e.stringRaw("type","integer"),e.stringRaw("value",""+t);else if(typeof t==="number")e.stringRaw("type","float"),e.number("value",t);else if(typeof t==="string")e.stringRaw("type","text"),e.string("value",t);else if(t instanceof Uint8Array)e.stringRaw("type","blob"),e.stringRaw("base64",al.fromUint8Array(t));else if(t===void 0);else throw Je(t,"Impossible type of Value")}var VT=v(()=>{Sy();rn()});function I4(e,t){if(e.stringRaw("type",t.type),t.type==="hello"){if(t.jwt!==void 0)e.string("jwt",t.jwt)}else if(t.type==="request")e.number("request_id",t.requestId),e.object("request",t.request,npe);else throw Je(t,"Impossible type of ClientMsg")}function npe(e,t){if(e.stringRaw("type",t.type),t.type==="open_stream")e.number("stream_id",t.streamId);else if(t.type==="close_stream")e.number("stream_id",t.streamId);else if(t.type==="execute")e.number("stream_id",t.streamId),e.object("stmt",t.stmt,Af);else if(t.type==="batch")e.number("stream_id",t.streamId),e.object("batch",t.batch,Sl);else if(t.type==="open_cursor")e.number("stream_id",t.streamId),e.number("cursor_id",t.cursorId),e.object("batch",t.batch,Sl);else if(t.type==="close_cursor")e.number("cursor_id",t.cursorId);else if(t.type==="fetch_cursor")e.number("cursor_id",t.cursorId),e.number("max_count",t.maxCount);else if(t.type==="sequence"){if(e.number("stream_id",t.streamId),t.sql!==void 0)e.string("sql",t.sql);if(t.sqlId!==void 0)e.number("sql_id",t.sqlId)}else if(t.type==="describe"){if(e.number("stream_id",t.streamId),t.sql!==void 0)e.string("sql",t.sql);if(t.sqlId!==void 0)e.number("sql_id",t.sqlId)}else if(t.type==="store_sql")e.number("sql_id",t.sqlId),e.string("sql",t.sql);else if(t.type==="close_sql")e.number("sql_id",t.sqlId);else if(t.type==="get_autocommit")e.number("stream_id",t.streamId);else throw Je(t,"Impossible type of Request")}var A4=v(()=>{VT();rn()});function Tf(e,t){if(t.sql!==void 0)e.string(1,t.sql);if(t.sqlId!==void 0)e.int32(2,t.sqlId);for(let r of t.args)e.message(3,r,R4);for(let r of t.namedArgs)e.message(4,r,ope);e.bool(5,t.wantRows)}function ope(e,t){e.string(1,t.name),e.message(2,t.value,R4)}function vl(e,t){for(let r of t.steps)e.message(1,r,ipe)}function ipe(e,t){if(t.condition!==void 0)e.message(1,t.condition,WT);e.message(2,t.stmt,Tf)}function WT(e,t){if(t.type==="ok")e.uint32(1,t.step);else if(t.type==="error")e.uint32(2,t.step);else if(t.type==="not")e.message(3,t.cond,WT);else if(t.type==="and")e.message(4,t.conds,T4);else if(t.type==="or")e.message(5,t.conds,T4);else if(t.type==="is_autocommit")e.message(6,void 0,$4);else throw Je(t,"Impossible type of BatchCond")}function T4(e,t){for(let r of t)e.message(1,r,WT)}function R4(e,t){if(t===null)e.message(1,void 0,$4);else if(typeof t==="bigint")e.sint64(2,t);else if(typeof t==="number")e.double(3,t);else if(typeof t==="string")e.string(4,t);else if(t instanceof Uint8Array)e.bytes(5,t);else if(t===void 0);else throw Je(t,"Impossible type of Value")}function $4(e,t){}var GT=v(()=>{rn()});function O4(e,t){if(t.type==="hello")e.message(1,t,spe);else if(t.type==="request")e.message(2,t,ape);else throw Je(t,"Impossible type of ClientMsg")}function spe(e,t){if(t.jwt!==void 0)e.string(1,t.jwt)}function ape(e,t){e.int32(1,t.requestId);let r=t.request;if(r.type==="open_stream")e.message(2,r,cpe);else if(r.type==="close_stream")e.message(3,r,lpe);else if(r.type==="execute")e.message(4,r,upe);else if(r.type==="batch")e.message(5,r,dpe);else if(r.type==="open_cursor")e.message(6,r,fpe);else if(r.type==="close_cursor")e.message(7,r,ppe);else if(r.type==="fetch_cursor")e.message(8,r,mpe);else if(r.type==="sequence")e.message(9,r,hpe);else if(r.type==="describe")e.message(10,r,gpe);else if(r.type==="store_sql")e.message(11,r,ype);else if(r.type==="close_sql")e.message(12,r,bpe);else if(r.type==="get_autocommit")e.message(13,r,Spe);else throw Je(r,"Impossible type of Request")}function cpe(e,t){e.int32(1,t.streamId)}function lpe(e,t){e.int32(1,t.streamId)}function upe(e,t){e.int32(1,t.streamId),e.message(2,t.stmt,Tf)}function dpe(e,t){e.int32(1,t.streamId),e.message(2,t.batch,vl)}function fpe(e,t){e.int32(1,t.streamId),e.int32(2,t.cursorId),e.message(3,t.batch,vl)}function ppe(e,t){e.int32(1,t.cursorId)}function mpe(e,t){e.int32(1,t.cursorId),e.uint32(2,t.maxCount)}function hpe(e,t){if(e.int32(1,t.streamId),t.sql!==void 0)e.string(2,t.sql);if(t.sqlId!==void 0)e.int32(3,t.sqlId)}function gpe(e,t){if(e.int32(1,t.streamId),t.sql!==void 0)e.string(2,t.sql);if(t.sqlId!==void 0)e.int32(3,t.sqlId)}function ype(e,t){e.int32(1,t.sqlId),e.string(2,t.sql)}function bpe(e,t){e.int32(1,t.sqlId)}function Spe(e,t){e.int32(1,t.streamId)}var C4=v(()=>{GT();rn()});function Yi(e){let t=Tr(e.message),r=Zr(e.code);return{message:t,code:r}}function Rf(e){let t=xn(e.cols,P4),r=yf(e.rows).map((s)=>xn(s,z4)),o=Lo(e.affected_row_count),n=Zr(e.last_insert_rowid),i=n!==void 0?BigInt(n):void 0;return{cols:t,rows:r,affectedRowCount:o,lastInsertRowid:i}}function P4(e){let t=Zr(e.name),r=Zr(e.decltype);return{name:t,decltype:r}}function $y(e){let t=new Map;yf(e.step_results).forEach((o,n)=>{if(o!==null)t.set(n,Rf(It(o)))});let r=new Map;return yf(e.step_errors).forEach((o,n)=>{if(o!==null)r.set(n,Yi(It(o)))}),{stepResults:t,stepErrors:r}}function Oy(e){let t=Tr(e.type);if(t==="step_begin"){let r=Lo(e.step),o=xn(e.cols,P4);return{type:"step_begin",step:r,cols:o}}else if(t==="step_end"){let r=Lo(e.affected_row_count),o=Zr(e.last_insert_rowid),n=o!==void 0?BigInt(o):void 0;return{type:"step_end",affectedRowCount:r,lastInsertRowid:n}}else if(t==="step_error"){let r=Lo(e.step),o=Yi(It(e.error));return{type:"step_error",step:r,error:o}}else if(t==="row")return{type:"row",row:xn(e.row,z4)};else if(t==="error")return{type:"error",error:Yi(It(e.error))};else throw new Pe("Unexpected type of CursorEntry")}function Cy(e){let t=xn(e.params,vpe),r=xn(e.cols,wpe),o=Vi(e.is_explain),n=Vi(e.is_readonly);return{params:t,cols:r,isExplain:o,isReadonly:n}}function vpe(e){return{name:Zr(e.name)}}function wpe(e){let t=Tr(e.name),r=Zr(e.decltype);return{name:t,decltype:r}}function z4(e){let t=Tr(e.type);if(t==="null")return null;else if(t==="integer"){let r=Tr(e.value);return BigInt(r)}else if(t==="float")return Lo(e.value);else if(t==="text")return Tr(e.value);else if(t==="blob")return al.toUint8Array(Tr(e.base64));else throw new Pe("Unexpected type of Value")}var Py=v(()=>{Sy();_t();hl()});function N4(e){let t=Tr(e.type);if(t==="hello_ok")return{type:"hello_ok"};else if(t==="hello_error")return{type:"hello_error",error:Yi(It(e.error))};else if(t==="response_ok"){let r=Lo(e.request_id),o=xpe(It(e.response));return{type:"response_ok",requestId:r,response:o}}else if(t==="response_error"){let r=Lo(e.request_id),o=Yi(It(e.error));return{type:"response_error",requestId:r,error:o}}else throw new Pe("Unexpected type of ServerMsg")}function xpe(e){let t=Tr(e.type);if(t==="open_stream")return{type:"open_stream"};else if(t==="close_stream")return{type:"close_stream"};else if(t==="execute")return{type:"execute",result:Rf(It(e.result))};else if(t==="batch")return{type:"batch",result:$y(It(e.result))};else if(t==="open_cursor")return{type:"open_cursor"};else if(t==="close_cursor")return{type:"close_cursor"};else if(t==="fetch_cursor"){let r=xn(e.entries,Oy),o=Vi(e.done);return{type:"fetch_cursor",entries:r,done:o}}else if(t==="sequence")return{type:"sequence"};else if(t==="describe")return{type:"describe",result:Cy(It(e.result))};else if(t==="store_sql")return{type:"store_sql"};else if(t==="close_sql")return{type:"close_sql"};else if(t==="get_autocommit")return{type:"get_autocommit",isAutocommit:Vi(e.is_autocommit)};else throw new Pe("Unexpected type of Response")}var D4=v(()=>{_t();hl();Py()});var nn,Xi,L4,B4,wl,_pe,Epe,zy,kpe,Ipe,Ape,xl,Tpe,Rpe,$pe;var Ny=v(()=>{nn={default(){return{message:"",code:void 0}},1(e,t){t.message=e.string()},2(e,t){t.code=e.string()}},Xi={default(){return{cols:[],rows:[],affectedRowCount:0,lastInsertRowid:void 0}},1(e,t){t.cols.push(e.message(L4))},2(e,t){t.rows.push(e.message(B4))},3(e,t){t.affectedRowCount=Number(e.uint64())},4(e,t){t.lastInsertRowid=e.sint64()}},L4={default(){return{name:void 0,decltype:void 0}},1(e,t){t.name=e.string()},2(e,t){t.decltype=e.string()}},B4={default(){return[]},1(e,t){t.push(e.message($pe))}},wl={default(){return{stepResults:new Map,stepErrors:new Map}},1(e,t){let[r,o]=e.message(_pe);t.stepResults.set(r,o)},2(e,t){let[r,o]=e.message(Epe);t.stepErrors.set(r,o)}},_pe={default(){return[0,Xi.default()]},1(e,t){t[0]=e.uint32()},2(e,t){t[1]=e.message(Xi)}},Epe={default(){return[0,nn.default()]},1(e,t){t[0]=e.uint32()},2(e,t){t[1]=e.message(nn)}},zy={default(){return{type:"none"}},1(e){return e.message(kpe)},2(e){return e.message(Ipe)},3(e){return e.message(Ape)},4(e){return{type:"row",row:e.message(B4)}},5(e){return{type:"error",error:e.message(nn)}}},kpe={default(){return{type:"step_begin",step:0,cols:[]}},1(e,t){t.step=e.uint32()},2(e,t){t.cols.push(e.message(L4))}},Ipe={default(){return{type:"step_end",affectedRowCount:0,lastInsertRowid:void 0}},1(e,t){t.affectedRowCount=e.uint32()},2(e,t){t.lastInsertRowid=e.uint64()}},Ape={default(){return{type:"step_error",step:0,error:nn.default()}},1(e,t){t.step=e.uint32()},2(e,t){t.error=e.message(nn)}},xl={default(){return{params:[],cols:[],isExplain:!1,isReadonly:!1}},1(e,t){t.params.push(e.message(Tpe))},2(e,t){t.cols.push(e.message(Rpe))},3(e,t){t.isExplain=e.bool()},4(e,t){t.isReadonly=e.bool()}},Tpe={default(){return{name:void 0}},1(e,t){t.name=e.string()}},Rpe={default(){return{name:"",decltype:void 0}},1(e,t){t.name=e.string()},2(e,t){t.decltype=e.string()}},$pe={default(){return},1(e){return null},2(e){return e.sint64()},3(e){return e.double()},4(e){return e.string()},5(e){return e.bytes()}}});var j4,Ope,Cpe,Ppe,zpe,Npe,Dpe,Lpe,Bpe;var Z4=v(()=>{Ny();j4={default(){return{type:"none"}},1(e){return{type:"hello_ok"}},2(e){return e.message(Ope)},3(e){return e.message(Ppe)},4(e){return e.message(Cpe)}},Ope={default(){return{type:"hello_error",error:nn.default()}},1(e,t){t.error=e.message(nn)}},Cpe={default(){return{type:"response_error",requestId:0,error:nn.default()}},1(e,t){t.requestId=e.int32()},2(e,t){t.error=e.message(nn)}},Ppe={default(){return{type:"response_ok",requestId:0,response:{type:"none"}}},1(e,t){t.requestId=e.int32()},2(e,t){t.response={type:"open_stream"}},3(e,t){t.response={type:"close_stream"}},4(e,t){t.response=e.message(zpe)},5(e,t){t.response=e.message(Npe)},6(e,t){t.response={type:"open_cursor"}},7(e,t){t.response={type:"close_cursor"}},8(e,t){t.response=e.message(Dpe)},9(e,t){t.response={type:"sequence"}},10(e,t){t.response=e.message(Lpe)},11(e,t){t.response={type:"store_sql"}},12(e,t){t.response={type:"close_sql"}},13(e,t){t.response=e.message(Bpe)}},zpe={default(){return{type:"execute",result:Xi.default()}},1(e,t){t.result=e.message(Xi)}},Npe={default(){return{type:"batch",result:wl.default()}},1(e,t){t.result=e.message(wl)}},Dpe={default(){return{type:"fetch_cursor",entries:[],done:!1}},1(e,t){t.entries.push(e.message(zy))},2(e,t){t.done=e.bool()}},Lpe={default(){return{type:"describe",result:xl.default()}},1(e,t){t.result=e.message(xl)}},Bpe={default(){return{type:"get_autocommit",isAutocommit:!1}},1(e,t){t.isAutocommit=e.bool()}}});var U4,QT,Dy;var Ly=v(()=>{jT();_t();ZT();xf();yl();rn();JT();A4();C4();D4();Z4();U4=new Map([["hrana2",{version:2,encoding:"json"}],["hrana1",{version:1,encoding:"json"}]]),QT=new Map([["hrana3-protobuf",{version:3,encoding:"protobuf"}],["hrana3",{version:3,encoding:"json"}],["hrana2",{version:2,encoding:"json"}],["hrana1",{version:1,encoding:"json"}]]);Dy=class Dy extends fl{#e;#t;#r;#n;#o;#i;#a;#s;#c;_streamIdAlloc;_cursorIdAlloc;#l;constructor(e,t){super();this.#e=e,this.#t=[],this.#r=!1,this.#n=void 0,this.#o=!1,this.#i=void 0,this.#a=!1,this.#s=new Map,this.#c=new Gi,this._streamIdAlloc=new Gi,this._cursorIdAlloc=new Gi,this.#l=new Gi,this.#e.binaryType="arraybuffer",this.#e.addEventListener("open",()=>this.#f()),this.#e.addEventListener("close",(r)=>this.#g(r)),this.#e.addEventListener("error",(r)=>this.#p(r)),this.#e.addEventListener("message",(r)=>this.#y(r)),this.#d({type:"hello",jwt:t})}#d(e){if(this.#n!==void 0)throw new or("Trying to send a message on a closed client");if(this.#r)this.#m(e);else{let t=()=>this.#m(e),r=()=>{return};this.#t.push({openCallback:t,errorCallback:r})}}#f(){let e=this.#e.protocol;if(e===void 0){this.#u(new Ge("The `WebSocket.protocol` property is undefined. This most likely means that the WebSocket implementation provided by the environment is broken. If you are using Miniflare 2, please update to Miniflare 3, which fixes this problem."));return}else if(e==="")this.#i={version:1,encoding:"json"};else if(this.#i=QT.get(e),this.#i===void 0){this.#u(new Pe(`Unrecognized WebSocket subprotocol: ${JSON.stringify(e)}`));return}for(let t of this.#t)t.openCallback();this.#t.length=0,this.#r=!0}#m(e){let t=this.#i.encoding;if(t==="json"){let r=bf(e,I4);this.#e.send(r)}else if(t==="protobuf"){let r=wf(e,O4);this.#e.send(r)}else throw Je(t,"Impossible encoding")}getVersion(){return new Promise((e,t)=>{if(this.#a=!0,this.#n!==void 0)t(this.#n);else if(!this.#r){let r=()=>e(this.#i.version);this.#t.push({openCallback:r,errorCallback:t})}else e(this.#i.version)})}_ensureVersion(e,t){if(this.#i===void 0||!this.#a)throw new wn(`${t} is supported only on protocol version ${e} and higher, but the version supported by the WebSocket server is not yet known. Use Client.getVersion() to wait until the version is available.`);else if(this.#i.version<e)throw new wn(`${t} is supported on protocol version ${e} and higher, but the WebSocket server only supports version ${this.#i.version}`)}_sendRequest(e,t){if(this.#n!==void 0){t.errorCallback(new xt("Client is closed",this.#n));return}let r=this.#c.alloc();this.#s.set(r,{...t,type:e.type}),this.#d({type:"request",requestId:r,request:e})}#p(e){let r=e.message??"WebSocket was closed due to an error";this.#u(new pl(r))}#g(e){let t=`WebSocket was closed with code ${e.code}`;if(e.reason)t+=`: ${e.reason}`;this.#u(new pl(t))}#u(e){if(this.#n!==void 0)return;this.#n=e;for(let t of this.#t)t.errorCallback(e);this.#t.length=0;for(let[t,r]of this.#s.entries())r.errorCallback(e),this.#c.free(t);this.#s.clear(),this.#e.close()}#y(e){if(this.#n!==void 0)return;try{let t,r=this.#i.encoding;if(r==="json"){if(typeof e.data!=="string"){this.#e.close(3003,"Only text messages are accepted with JSON encoding"),this.#u(new Pe("Received non-text message from server with JSON encoding"));return}t=ua(JSON.parse(e.data),N4)}else if(r==="protobuf"){if(!(e.data instanceof ArrayBuffer)){this.#e.close(3003,"Only binary messages are accepted with Protobuf encoding"),this.#u(new Pe("Received non-binary message from server with Protobuf encoding"));return}t=Wi(new Uint8Array(e.data),j4)}else throw Je(r,"Impossible encoding");this.#b(t)}catch(t){this.#e.close(3007,"Could not handle message"),this.#u(t)}}#b(e){if(e.type==="none")throw new Pe("Received an unrecognized ServerMsg");else if(e.type==="hello_ok"||e.type==="hello_error"){if(this.#o)throw new Pe("Received a duplicated hello response");if(this.#o=!0,e.type==="hello_error")throw Bo(e.error);return}else if(!this.#o)throw new Pe("Received a non-hello message before a hello response");if(e.type==="response_ok"){let t=e.requestId,r=this.#s.get(t);if(this.#s.delete(t),r===void 0)throw new Pe("Received unexpected OK response");this.#c.free(t);try{if(r.type!==e.response.type)throw console.dir({responseState:r,msg:e}),new Pe("Received unexpected type of response");r.responseCallback(e.response)}catch(o){throw r.errorCallback(o),o}}else if(e.type==="response_error"){let t=e.requestId,r=this.#s.get(t);if(this.#s.delete(t),r===void 0)throw new Pe("Received unexpected error response");this.#c.free(t),r.errorCallback(Bo(e.error))}else throw Je(e,"Impossible ServerMsg type")}openStream(){return If.open(this)}storeSql(e){this._ensureVersion(2,"storeSql()");let t=this.#l.alloc(),r=new pa(this,t),o=()=>{return},n=(s)=>r._setClosed(s),i={type:"store_sql",sqlId:t,sql:e};return this._sendRequest(i,{responseCallback:o,errorCallback:n}),r}_closeSql(e){if(this.#n!==void 0)return;let t=()=>this.#l.free(e),r=(n)=>this.#u(n),o={type:"close_sql",sqlId:e};this._sendRequest(o,{responseCallback:t,errorCallback:r})}close(){this.#u(new Ge("Client was manually closed"))}get closed(){return this.#n!==void 0}}});var ma;var M4=v(()=>{if(typeof queueMicrotask<"u")ma=queueMicrotask;else{let e=Promise.resolve();ma=(t)=>{e.then(t)}}});class YT{#e;#t;#r;constructor(e){this.#e=new Uint8Array(new ArrayBuffer(e)),this.#t=0,this.#r=0}get length(){return this.#r-this.#t}data(){return this.#e.slice(this.#t,this.#r)}push(e){this.#n(e.byteLength),this.#e.set(e,this.#r),this.#r+=e.byteLength}#n(e){if(this.#r+e<=this.#e.byteLength)return;let t=this.#r-this.#t;if(t+e<=this.#e.byteLength&&2*this.#r>=this.#e.byteLength)this.#e.copyWithin(0,this.#t,this.#r);else{let r=this.#e.byteLength;do r*=2;while(t+e>r);let o=new Uint8Array(new ArrayBuffer(r));o.set(this.#e.slice(this.#t,this.#r),0),this.#e=o}this.#r=t,this.#t=0}shift(e){this.#t+=e}}function q4(e){let t=Zr(e.baton),r=Zr(e.base_url),o=xn(e.results,jpe);return{baton:t,baseUrl:r,results:o}}function jpe(e){let t=Tr(e.type);if(t==="ok")return{type:"ok",response:Zpe(It(e.response))};else if(t==="error")return{type:"error",error:Yi(It(e.error))};else throw new Pe("Unexpected type of StreamResult")}function Zpe(e){let t=Tr(e.type);if(t==="close")return{type:"close"};else if(t==="execute")return{type:"execute",result:Rf(It(e.result))};else if(t==="batch")return{type:"batch",result:$y(It(e.result))};else if(t==="sequence")return{type:"sequence"};else if(t==="describe")return{type:"describe",result:Cy(It(e.result))};else if(t==="store_sql")return{type:"store_sql"};else if(t==="close_sql")return{type:"close_sql"};else if(t==="get_autocommit")return{type:"get_autocommit",isAutocommit:Vi(e.is_autocommit)};else throw new Pe("Unexpected type of StreamResponse")}function F4(e){let t=Zr(e.baton),r=Zr(e.base_url);return{baton:t,baseUrl:r}}var XT=v(()=>{_t();hl();Py()});var K4,Upe,Mpe,qpe,Fpe,Kpe,Jpe,J4;var eR=v(()=>{Ny();K4={default(){return{baton:void 0,baseUrl:void 0,results:[]}},1(e,t){t.baton=e.string()},2(e,t){t.baseUrl=e.string()},3(e,t){t.results.push(e.message(Upe))}},Upe={default(){return{type:"none"}},1(e){return{type:"ok",response:e.message(Mpe)}},2(e){return{type:"error",error:e.message(nn)}}},Mpe={default(){return{type:"none"}},1(e){return{type:"close"}},2(e){return e.message(qpe)},3(e){return e.message(Fpe)},4(e){return{type:"sequence"}},5(e){return e.message(Kpe)},6(e){return{type:"store_sql"}},7(e){return{type:"close_sql"}},8(e){return e.message(Jpe)}},qpe={default(){return{type:"execute",result:Xi.default()}},1(e,t){t.result=e.message(Xi)}},Fpe={default(){return{type:"batch",result:wl.default()}},1(e,t){t.result=e.message(wl)}},Kpe={default(){return{type:"describe",result:xl.default()}},1(e,t){t.result=e.message(xl)}},Jpe={default(){return{type:"get_autocommit",isAutocommit:!1}},1(e,t){t.isAutocommit=e.bool()}},J4={default(){return{baton:void 0,baseUrl:void 0}},1(e,t){t.baton=e.string()},2(e,t){t.baseUrl=e.string()}}});var tR;var H4=v(()=>{hl();LT();_t();rn();XT();eR();Py();Ny();tR=class tR extends kf{#e;#t;#r;#n;#o;#i;constructor(e,t){super();this.#e=e,this.#t=t,this.#r=void 0,this.#n=new YT(16384),this.#o=void 0,this.#i=!1}async open(e){if(e.body===null)throw new Pe("No response body for cursor request");this.#r=e.body[Symbol.asyncIterator]();let t=await this.#a(F4,J4);if(t===void 0)throw new Pe("Empty response to cursor request");return t}next(){return this.#a(Oy,zy)}close(){this._setClosed(new Ge("Cursor was manually closed"))}_setClosed(e){if(this.#o!==void 0)return;if(this.#o=e,this.#e._cursorClosed(this),this.#r!==void 0)this.#r.return()}get closed(){return this.#o!==void 0}async#a(e,t){for(;;){if(this.#i)return;else if(this.#o!==void 0)throw new xt("Cursor is closed",this.#o);if(this.#t==="json"){let n=this.#s();if(n!==void 0){let i=new TextDecoder().decode(n),s=JSON.parse(i);return ua(s,e)}}else if(this.#t==="protobuf"){let n=this.#c();if(n!==void 0)return Wi(n,t)}else throw Je(this.#t,"Impossible encoding");if(this.#r===void 0)throw new or("Attempted to read from HTTP cursor before it was opened");let{value:r,done:o}=await this.#r.next();if(o&&this.#n.length===0)this.#i=!0;else if(o)throw new Pe("Unexpected end of cursor stream");else this.#n.push(r)}}#s(){let e=this.#n.data(),t=10,r=e.indexOf(10);if(r<0)return;let o=e.slice(0,r);return this.#n.shift(r+1),o}#c(){let e=this.#n.data(),t=0,r=0;for(;;){if(r>=e.byteLength)return;let n=e[r];if(t|=(n&127)<<7*r,r+=1,!(n&128))break}if(e.byteLength<r+t)return;let o=e.slice(r,r+t);return this.#n.shift(r+t),o}}});function V4(e,t){if(t.baton!==void 0)e.string("baton",t.baton);e.arrayObjects("requests",t.requests,Hpe)}function Hpe(e,t){if(e.stringRaw("type",t.type),t.type==="close");else if(t.type==="execute")e.object("stmt",t.stmt,Af);else if(t.type==="batch")e.object("batch",t.batch,Sl);else if(t.type==="sequence"){if(t.sql!==void 0)e.string("sql",t.sql);if(t.sqlId!==void 0)e.number("sql_id",t.sqlId)}else if(t.type==="describe"){if(t.sql!==void 0)e.string("sql",t.sql);if(t.sqlId!==void 0)e.number("sql_id",t.sqlId)}else if(t.type==="store_sql")e.number("sql_id",t.sqlId),e.string("sql",t.sql);else if(t.type==="close_sql")e.number("sql_id",t.sqlId);else if(t.type==="get_autocommit");else throw Je(t,"Impossible type of StreamRequest")}function W4(e,t){if(t.baton!==void 0)e.string("baton",t.baton);e.object("batch",t.batch,Sl)}var rR=v(()=>{VT();rn()});function G4(e,t){if(t.baton!==void 0)e.string(1,t.baton);for(let r of t.requests)e.message(2,r,Vpe)}function Vpe(e,t){if(t.type==="close")e.message(1,t,Wpe);else if(t.type==="execute")e.message(2,t,Gpe);else if(t.type==="batch")e.message(3,t,Qpe);else if(t.type==="sequence")e.message(4,t,Ype);else if(t.type==="describe")e.message(5,t,Xpe);else if(t.type==="store_sql")e.message(6,t,eme);else if(t.type==="close_sql")e.message(7,t,tme);else if(t.type==="get_autocommit")e.message(8,t,rme);else throw Je(t,"Impossible type of StreamRequest")}function Wpe(e,t){}function Gpe(e,t){e.message(1,t.stmt,Tf)}function Qpe(e,t){e.message(1,t.batch,vl)}function Ype(e,t){if(t.sql!==void 0)e.string(1,t.sql);if(t.sqlId!==void 0)e.int32(2,t.sqlId)}function Xpe(e,t){if(t.sql!==void 0)e.string(1,t.sql);if(t.sqlId!==void 0)e.int32(2,t.sqlId)}function eme(e,t){e.int32(1,t.sqlId),e.string(2,t.sql)}function tme(e,t){e.int32(1,t.sqlId)}function rme(e,t){}function Q4(e,t){if(t.baton!==void 0)e.string(1,t.baton);e.message(2,t.batch,vl)}var nR=v(()=>{GT();rn()});function nme(e,t){if(t.results.length!==e.length)throw new Pe("Server returned unexpected number of pipeline results");for(let r=0;r<e.length;++r){let o=t.results[r],n=e[r];if(o.type==="ok"){if(o.response.type!==n.request.type)throw new Pe("Received unexpected type of response");n.responseCallback(o.response)}else if(o.type==="error")n.errorCallback(Bo(o.error));else if(o.type==="none")throw new Pe("Received unrecognized type of StreamResult");else throw Je(o,"Received impossible type of StreamResult")}}async function ome(e,t){if(t==="json"){let r=await e.json();return ua(r,q4)}if(t==="protobuf"){let r=await e.arrayBuffer();return Wi(new Uint8Array(r),K4)}throw await e.body?.cancel(),Je(t,"Impossible encoding")}async function ime(e){let t=e.headers.get("content-type")??"text/plain",r=`Server returned HTTP status ${e.status}`;if(t==="application/json"){let o=await e.json();if("message"in o)return Bo(o);return new la(r,e.status)}if(t==="text/plain"){let o=(await e.text()).trim();if(o!=="")r+=`: ${o}`;return new la(r,e.status)}return await e.body?.cancel(),new la(r,e.status)}var By;var oR=v(()=>{_t();jT();ZT();M4();xf();yl();Ry();rn();H4();rR();nR();rR();nR();XT();eR();By=class By extends bl{#e;#t;#r;#n;#o;#i;#a;#s;#c;#l;#d;#f;#m;constructor(e,t,r,o,n){super(e.intMode);this.#e=e,this.#t=t.toString(),this.#r=r,this.#n=o,this.#o=n,this.#i=void 0,this.#a=new Qi,this.#s=!1,this.#l=!1,this.#d=!1,this.#f=void 0,this.#m=new Gi}client(){return this.#e}_sqlOwner(){return this}storeSql(e){let t=this.#m.alloc();return this.#p({type:"store_sql",sqlId:t,sql:e}).then(()=>{return},(r)=>this._setClosed(r)),new pa(this,t)}_closeSql(e){if(this.#f!==void 0)return;this.#p({type:"close_sql",sqlId:e}).then(()=>this.#m.free(e),(t)=>this._setClosed(t))}_execute(e){return this.#p({type:"execute",stmt:e}).then((t)=>t.result)}_batch(e){return this.#p({type:"batch",batch:e}).then((t)=>t.result)}_describe(e){return this.#p({type:"describe",sql:e.sql,sqlId:e.sqlId}).then((t)=>t.result)}_sequence(e){return this.#p({type:"sequence",sql:e.sql,sqlId:e.sqlId}).then((t)=>{return})}getAutocommit(){return this.#e._ensureVersion(3,"getAutocommit()"),this.#p({type:"get_autocommit"}).then((e)=>e.isAutocommit)}#p(e){return new Promise((t,r)=>{this.#g({type:"pipeline",request:e,responseCallback:t,errorCallback:r})})}_openCursor(e){return new Promise((t,r)=>{this.#g({type:"cursor",batch:e,cursorCallback:t,errorCallback:r})})}_cursorClosed(e){if(e!==this.#c)throw new or("Cursor was closed, but it was not associated with the stream");this.#c=void 0,ma(()=>this.#u())}close(){this._setClosed(new Ge("Stream was manually closed"))}closeGracefully(){this.#l=!0,ma(()=>this.#u())}get closed(){return this.#f!==void 0||this.#l}_setClosed(e){if(this.#f!==void 0)return;if(this.#f=e,this.#c!==void 0)this.#c._setClosed(e);this.#e._streamClosed(this);for(;;){let t=this.#a.shift();if(t!==void 0)t.errorCallback(e);else break}if((this.#i!==void 0||this.#s)&&!this.#d)this.#a.push({type:"pipeline",request:{type:"close"},responseCallback:()=>{return},errorCallback:()=>{return}}),this.#d=!0,ma(()=>this.#u())}#g(e){if(this.#f!==void 0)throw new xt("Stream is closed",this.#f);else if(this.#l)throw new xt("Stream is closing",void 0);else this.#a.push(e),ma(()=>this.#u())}#u(){if(this.#s||this.#c!==void 0)return;if(this.#l&&this.#a.length===0){this._setClosed(new Ge("Stream was gracefully closed"));return}let e=this.#e._endpoint;if(e===void 0){this.#e._endpointPromise.then(()=>this.#u(),(r)=>this._setClosed(r));return}let t=this.#a.shift();if(t===void 0)return;else if(t.type==="pipeline"){let r=[t];for(;;){let o=this.#a.first();if(o!==void 0&&o.type==="pipeline")r.push(o),this.#a.shift();else if(o===void 0&&this.#l&&!this.#d){r.push({type:"pipeline",request:{type:"close"},responseCallback:()=>{return},errorCallback:()=>{return}}),this.#d=!0;break}else break}this.#y(e,r)}else if(t.type==="cursor")this.#b(e,t);else throw Je(t,"Impossible type of QueueEntry")}#y(e,t){this.#h(()=>this.#S(t,e),(r)=>ome(r,e.encoding),(r)=>r.baton,(r)=>r.baseUrl,(r)=>nme(t,r),(r)=>t.forEach((o)=>o.errorCallback(r)))}#b(e,t){let r=new tR(this,e.encoding);this.#c=r,this.#h(()=>this.#v(t,e),(o)=>r.open(o),(o)=>o.baton,(o)=>o.baseUrl,(o)=>t.cursorCallback(r),(o)=>t.errorCallback(o))}#h(e,t,r,o,n,i){let s;try{let a=e(),c=this.#n;s=c(a)}catch(a){s=Promise.reject(a)}this.#s=!0,s.then((a)=>{if(!a.ok)return ime(a).then((c)=>{throw c});return t(a)}).then((a)=>{this.#i=r(a),this.#t=o(a)??this.#t,n(a)}).catch((a)=>{this._setClosed(a),i(a)}).finally(()=>{this.#s=!1,this.#u()})}#S(e,t){return this.#w(new URL(t.pipelinePath,this.#t),{baton:this.#i,requests:e.map((r)=>r.request)},t.encoding,V4,G4)}#v(e,t){if(t.cursorPath===void 0)throw new wn(`Cursors are supported only on protocol version 3 and higher, but the HTTP server only supports version ${t.version}.`);return this.#w(new URL(t.cursorPath,this.#t),{baton:this.#i,batch:e.batch},t.encoding,W4,Q4)}#w(e,t,r,o,n){let i,s;if(r==="json")i=bf(t,o),s="application/json";else if(r==="protobuf")i=wf(t,n),s="application/x-protobuf";else throw Je(r,"Impossible encoding");let a=new Headers;if(a.set("content-type",s),this.#r!==void 0)a.set("authorization",`Bearer ${this.#r}`);if(this.#o!==void 0)a.set("x-turso-encryption-key",this.#o);return new Request(e.toString(),{method:"POST",headers:a,body:i})}}});async function ame(e,t){let r=e;for(let o of sme){let n=new URL(o.versionPath,t),i=new Request(n.toString(),{method:"GET"}),s=await r(i);if(await s.arrayBuffer(),s.ok)return o}return iR}var sme,iR,jy;var sR=v(()=>{_t();oR();sme=[{versionPath:"v3-protobuf",pipelinePath:"v3-protobuf/pipeline",cursorPath:"v3-protobuf/cursor",version:3,encoding:"protobuf"}],iR={versionPath:"v2",pipelinePath:"v2/pipeline",cursorPath:void 0,version:2,encoding:"json"};jy=class jy extends fl{#e;#t;#r;#n;#o;#i;_endpointPromise;_endpoint;constructor(e,t,r,o,n=2){super();if(this.#e=e,this.#t=t,this.#r=r??globalThis.fetch,this.#n=o,this.#o=void 0,this.#i=new Set,n==3)this._endpointPromise=ame(this.#r,this.#e),this._endpointPromise.then((i)=>this._endpoint=i,(i)=>this.#a(i));else this._endpointPromise=Promise.resolve(iR),this._endpointPromise.then((i)=>this._endpoint=i,(i)=>this.#a(i))}async getVersion(){if(this._endpoint!==void 0)return this._endpoint.version;return(await this._endpointPromise).version}_ensureVersion(e,t){if(e<=iR.version)return;else if(this._endpoint===void 0)throw new wn(`${t} is supported only on protocol version ${e} and higher, but the version supported by the HTTP server is not yet known. Use Client.getVersion() to wait until the version is available.`);else if(this._endpoint.version<e)throw new wn(`${t} is supported only on protocol version ${e} and higher, but the HTTP server only supports version ${this._endpoint.version}.`)}openStream(){if(this.#o!==void 0)throw new xt("Client is closed",this.#o);let e=new By(this,this.#e,this.#t,this.#r,this.#n);return this.#i.add(e),e}_streamClosed(e){this.#i.delete(e)}close(){this.#a(new Ge("Client was manually closed"))}get closed(){return this.#o!==void 0}#a(e){if(this.#o!==void 0)return;this.#o=e;for(let t of Array.from(this.#i))t._setClosed(new xt("Client was closed",e))}}});var Y4=v(()=>{_t()});function aR(e,t,r=2){if(typeof Hi>"u")throw new gf("WebSockets are not supported in this environment");var o=void 0;if(r==3)o=Array.from(QT.keys());else o=Array.from(U4.keys());let n=new Hi(e,o);return new Dy(n,t)}function cR(e,t,r,o,n=2){return new jy(e instanceof URL?e:new URL(e),t,r,o,n)}var Zy=v(()=>{DT();Ly();_t();sR();Ly();DT();FT();Y4();yl();Ay();Ry();sR();oR();Ly();JT();_t()});class $f{#e;#t;#r;constructor(e,t){this.#e=e,this.#t=t,this.#r=void 0}execute(e){return this.batch([e]).then((t)=>t[0])}async batch(e){let t=this._getStream();if(t.closed)throw new Ce("Cannot execute statements because the transaction is closed","TRANSACTION_CLOSED");try{let r=e.map(jo),o;if(this.#r===void 0){this._getSqlCache().apply(r);let i=t.batch(this.#t>=3),s=i.step(),a=s.run(Ki(this.#e)),c=s;o=r.map((u)=>{let d=i.step().condition(ut.ok(c));if(this.#t>=3)d.condition(ut.not(ut.isAutocommit(i)));let f=d.query(u);return f.catch(()=>{return}),c=d,f}),this.#r=i.execute().then(()=>a).then(()=>{return});try{await this.#r}catch(u){throw this.close(),u}}else{if(this.#t<3)await this.#r;this._getSqlCache().apply(r);let i=t.batch(this.#t>=3),s=void 0;o=r.map((a)=>{let c=i.step();if(s!==void 0)c.condition(ut.ok(s));if(this.#t>=3)c.condition(ut.not(ut.isAutocommit(i)));let u=c.query(a);return u.catch(()=>{return}),s=c,u}),await i.execute()}let n=[];for(let i=0;i<o.length;i++)try{let s=await o[i];if(s===void 0)throw new Wt("Statement in a transaction was not executed, probably because the transaction has been rolled back",i,"TRANSACTION_CLOSED");n.push(El(s))}catch(s){if(s instanceof Wt)throw s;let a=st(s);if(a instanceof Ce)throw new Wt(a.message,i,a.code,a.extendedCode,a.rawCode,a.cause instanceof Error?a.cause:void 0);throw a}return n}catch(r){throw st(r)}}async executeMultiple(e){let t=this._getStream();if(t.closed)throw new Ce("Cannot execute statements because the transaction is closed","TRANSACTION_CLOSED");try{if(this.#r===void 0){this.#r=t.run(Ki(this.#e)).then(()=>{return});try{await this.#r}catch(r){throw this.close(),r}}else await this.#r;await t.sequence(e)}catch(r){throw st(r)}}async rollback(){try{let e=this._getStream();if(e.closed)return;if(this.#r!==void 0);else return;let t=e.run("ROLLBACK").catch((r)=>{throw st(r)});e.closeGracefully(),await t}catch(e){throw st(e)}finally{this.close()}}async commit(){try{let e=this._getStream();if(e.closed)throw new Ce("Cannot commit the transaction because it is already closed","TRANSACTION_CLOSED");if(this.#r!==void 0)await this.#r;else return;let t=e.run("COMMIT").catch((r)=>{throw st(r)});e.closeGracefully(),await t}catch(e){throw st(e)}finally{this.close()}}}async function _l(e,t,r,o,n=!1){if(n)r.step().run("PRAGMA foreign_keys=off");let i=r.step(),s=i.run(Ki(e)),a=i,c=o.map((h)=>{let b=r.step().condition(ut.ok(a));if(t>=3)b.condition(ut.not(ut.isAutocommit(r)));let y=b.query(h);return a=b,y}),u=r.step().condition(ut.ok(a));if(t>=3)u.condition(ut.not(ut.isAutocommit(r)));let d=u.run("COMMIT");if(r.step().condition(ut.not(ut.ok(u))).run("ROLLBACK").catch((h)=>{return}),n)r.step().run("PRAGMA foreign_keys=on");await r.execute();let m=[];await s;for(let h=0;h<c.length;h++)try{let b=await c[h];if(b===void 0)throw new Wt("Statement in a batch was not executed, probably because the transaction has been rolled back",h,"TRANSACTION_CLOSED");m.push(El(b))}catch(b){if(b instanceof Wt)throw b;let y=st(b);if(y instanceof Ce)throw new Wt(y.message,h,y.code,y.extendedCode,y.rawCode,y.cause instanceof Error?y.cause:void 0);throw y}return await d,m}function jo(e){let t,r;if(Array.isArray(e))[t,r]=e;else if(typeof e==="string")t=e;else t=e.sql,r=e.args;let o=new Ef(t);if(r)if(Array.isArray(r))o.bindIndexes(r);else for(let[n,i]of Object.entries(r))o.bindName(n,i);return o}function El(e){let t=e.columnNames.map((s)=>s??""),r=e.columnDecltypes.map((s)=>s??""),o=e.rows,n=e.affectedRowCount,i=e.lastInsertRowid!==void 0?e.lastInsertRowid:void 0;return new cl(t,r,o,n,i)}function st(e){if(e instanceof Ge){let t=X4(e);return new Ce(e.message,t,void 0,void 0,e)}return e}function X4(e){if(e instanceof hf&&e.code!==void 0)return e.code;else if(e instanceof Pe)return"HRANA_PROTO_ERROR";else if(e instanceof xt)return e.cause instanceof Ge?X4(e.cause):"HRANA_CLOSED_ERROR";else if(e instanceof pl)return"HRANA_WEBSOCKET_ERROR";else if(e instanceof la)return"SERVER_ERROR";else if(e instanceof wn)return"PROTOCOL_VERSION_ERROR";else if(e instanceof or)return"INTERNAL_ERROR";else return"UNKNOWN"}var uR=v(()=>{Zy();vn();ll()});class kl{#e;#t;capacity;constructor(e,t){this.#e=e,this.#t=new eF,this.capacity=t}apply(e){if(this.capacity<=0)return;let t=new Set;for(let r of e){if(typeof r.sql!=="string")continue;let o=r.sql;if(o.length>=5000)continue;let n=this.#t.get(o);if(n===void 0){while(this.#t.size+1>this.capacity){let[i,s]=this.#t.peekLru();if(t.has(s))break;s.close(),this.#t.delete(i)}if(this.#t.size+1<=this.capacity)n=this.#e.storeSql(o),this.#t.set(o,n)}if(n!==void 0)r.sql=n,t.add(n)}}}class eF{#e;constructor(){this.#e=new Map}get(e){let t=this.#e.get(e);if(t!==void 0)this.#e.delete(e),this.#e.set(e,t);return t}set(e,t){this.#e.set(e,t)}peekLru(){for(let e of this.#e.entries())return e;return}delete(e){this.#e.delete(e)}get size(){return this.#e.size}}var dR=ge(function(JLe,rF){function cme(e){var t=0,r=[];function o(){if(t--,t<e)n()}function n(){var c=r.shift();if(a.queue=r.length,c)s(c.fn).then(c.resolve).catch(c.reject)}function i(c){return new Promise(function(u,d){r.push({fn:c,resolve:u,reject:d}),a.queue=r.length})}function s(c){t++;try{return Promise.resolve(c()).then(function(u){return o(),u},function(u){throw o(),u})}catch(u){return o(),Promise.reject(u)}}var a=function(c){if(t>=e)return i(c);else return s(c)};return a}function lme(e,t){var r=!1,o=this;return Promise.all(e.map(function(){var n=arguments;return o(function(){if(!r)return t.apply(void 0,n).catch(function(i){throw r=!0,i})})}))}function tF(e){return e.queue=0,e.map=lme,e}rF.exports=function(e){if(e)return tF(cme(e));else return tF(function(t){return t()})}});function iF(e){if(e.scheme!=="wss"&&e.scheme!=="ws")throw new Ce(`The WebSocket client supports only "libsql:", "wss:" and "ws:" URLs, got ${JSON.stringify(e.scheme+":")}. For more information, please read ${Qn}`,"URL_SCHEME_NOT_SUPPORTED");if(e.encryptionKey!==void 0)throw new Ce("Encryption key is not supported by the remote client.","ENCRYPTION_KEY_NOT_SUPPORTED");if(e.scheme==="ws"&&e.tls)throw new Ce('A "ws:" URL cannot opt into TLS by using ?tls=1',"URL_INVALID");else if(e.scheme==="wss"&&!e.tls)throw new Ce('A "wss:" URL cannot opt out of TLS by using ?tls=0',"URL_INVALID");let t=uf(e.scheme,e.authority,e.path),r;try{r=aR(t,e.authToken)}catch(o){if(o instanceof gf){let n=e.scheme==="wss"?"https":"http",i=uf(n,e.authority,e.path);throw new Ce(`This environment does not support WebSockets, please switch to the HTTP client by using a "${n}:" URL (${JSON.stringify(i)}). For more information, please read ${Qn}`,"WEBSOCKETS_NOT_SUPPORTED")}throw st(o)}return new sF(r,t,e.authToken,e.intMode,e.concurrency)}class sF{#e;#t;#r;#n;#o;closed;protocol;#i;#a;constructor(e,t,r,o,n){this.#e=t,this.#t=r,this.#r=o,this.#n=this.#c(e),this.#o=void 0,this.closed=!1,this.protocol="ws",this.#a=oF.default(n)}async limit(e){return this.#a(e)}async execute(e,t){let r;if(typeof e==="string")r={sql:e,args:t||[]};else r=e;return this.limit(async()=>{let o=await this.#s();try{let n=jo(r);o.conn.sqlCache.apply([n]);let i=o.stream.query(n);o.stream.closeGracefully();let s=await i;return El(s)}catch(n){throw st(n)}finally{this._closeStream(o)}})}async batch(e,t="deferred"){return this.limit(async()=>{let r=await this.#s();try{let n=e.map((u)=>{if(Array.isArray(u))return{sql:u[0],args:u[1]||[]};return u}).map(jo),i=await r.conn.client.getVersion();r.conn.sqlCache.apply(n);let s=r.stream.batch(i>=3);return await _l(t,i,s,n)}catch(o){throw st(o)}finally{this._closeStream(r)}})}async migrate(e){return this.limit(async()=>{let t=await this.#s();try{let r=e.map(jo),o=await t.conn.client.getVersion(),n=t.stream.batch(o>=3);return await _l("deferred",o,n,r,!0)}catch(r){throw st(r)}finally{this._closeStream(t)}})}async transaction(e="write"){return this.limit(async()=>{let t=await this.#s();try{let r=await t.conn.client.getVersion();return new aF(this,t,e,r)}catch(r){throw this._closeStream(t),st(r)}})}async executeMultiple(e){return this.limit(async()=>{let t=await this.#s();try{let r=t.stream.sequence(e);t.stream.closeGracefully(),await r}catch(r){throw st(r)}finally{this._closeStream(t)}})}sync(){throw new Ce("sync not supported in ws mode","SYNC_NOT_SUPPORTED")}async#s(){if(this.closed)throw new Ce("The client is closed","CLIENT_CLOSED");if(new Date().valueOf()-this.#n.openTime.valueOf()>ume&&this.#o===void 0){let o=this.#c();this.#o=o,o.client.getVersion().then((n)=>{if(this.#n!==o){if(this.#n.streamStates.size===0)this.#n.client.close()}this.#n=o,this.#o=void 0},(n)=>{this.#o=void 0})}if(this.#n.client.closed)try{if(this.#o!==void 0)this.#n=this.#o;else this.#n=this.#c()}catch(o){throw st(o)}let r=this.#n;try{if(r.useSqlCache===void 0){if(r.useSqlCache=await r.client.getVersion()>=2,r.useSqlCache)r.sqlCache.capacity=nF}let o=r.client.openStream();o.intMode=this.#r;let n={conn:r,stream:o};return r.streamStates.add(n),n}catch(o){throw st(o)}}#c(e){try{return e??=aR(this.#e,this.#t),{client:e,useSqlCache:void 0,sqlCache:new kl(e,0),openTime:new Date,streamStates:new Set}}catch(t){throw st(t)}}async reconnect(){try{for(let r of Array.from(this.#n.streamStates))try{r.stream.close()}catch{}this.#n.client.close()}catch{}if(this.#o){try{this.#o.client.close()}catch{}this.#o=void 0}let e=this.#c(),t=await e.client.getVersion();if(e.useSqlCache=t>=2,e.useSqlCache)e.sqlCache.capacity=nF;this.#n=e,this.closed=!1}_closeStream(e){e.stream.close();let t=e.conn;if(t.streamStates.delete(e),t.streamStates.size===0&&t!==this.#n)t.client.close()}close(){if(this.#n.client.close(),this.closed=!0,this.#o){try{this.#o.client.close()}catch{}this.#o=void 0}this.closed=!0}}var oF,ume=60000,nF=100,aF;var cF=v(()=>{Zy();vn();pf();uR();gy();ll();oF=Ul(dR(),1);vn();aF=class aF extends $f{#e;#t;constructor(e,t,r,o){super(r,o);this.#e=e,this.#t=t}_getStream(){return this.#t.stream}_getSqlCache(){return this.#t.conn.sqlCache}close(){this.#e._closeStream(this.#t)}get closed(){return this.#t.stream.closed}}});function uF(e){if(e.scheme!=="https"&&e.scheme!=="http")throw new Ce(`The HTTP client supports only "libsql:", "https:" and "http:" URLs, got ${JSON.stringify(e.scheme+":")}. For more information, please read ${Qn}`,"URL_SCHEME_NOT_SUPPORTED");if(e.encryptionKey!==void 0)throw new Ce("Encryption key is not supported by the remote client.","ENCRYPTION_KEY_NOT_SUPPORTED");if(e.scheme==="http"&&e.tls)throw new Ce('A "http:" URL cannot opt into TLS by using ?tls=1',"URL_INVALID");else if(e.scheme==="https"&&!e.tls)throw new Ce('A "https:" URL cannot opt out of TLS by using ?tls=0',"URL_INVALID");let t=uf(e.scheme,e.authority,e.path);return new fF(t,e.authToken,e.intMode,e.fetch,e.concurrency,e.remoteEncryptionKey)}class fF{#e;protocol;#t;#r;#n;#o;#i;#a;#s;constructor(e,t,r,o,n,i){this.#t=e,this.#i=t,this.#r=r,this.#n=o,this.#o=n,this.#a=i,this.#e=cR(this.#t,this.#i,this.#n,i),this.#e.intMode=this.#r,this.protocol="http",this.#s=lF.default(this.#o)}async limit(e){return this.#s(e)}async execute(e,t){let r;if(typeof e==="string")r={sql:e,args:t||[]};else r=e;return this.limit(async()=>{try{let o=jo(r),n,i=this.#e.openStream();try{n=i.query(o)}finally{i.closeGracefully()}let s=await n;return El(s)}catch(o){throw st(o)}})}async batch(e,t="deferred"){return this.limit(async()=>{try{let o=e.map((c)=>{if(Array.isArray(c))return{sql:c[0],args:c[1]||[]};return c}).map(jo),n=await this.#e.getVersion(),i,s=this.#e.openStream();try{new kl(s,dF).apply(o);let u=s.batch(!1);i=_l(t,n,u,o)}finally{s.closeGracefully()}return await i}catch(r){throw st(r)}})}async migrate(e){return this.limit(async()=>{try{let t=e.map(jo),r=await this.#e.getVersion(),o,n=this.#e.openStream();try{let s=n.batch(!1);o=_l("deferred",r,s,t,!0)}finally{n.closeGracefully()}return await o}catch(t){throw st(t)}})}async transaction(e="write"){return this.limit(async()=>{try{let t=await this.#e.getVersion();return new pF(this.#e.openStream(),e,t)}catch(t){throw st(t)}})}async executeMultiple(e){return this.limit(async()=>{try{let t,r=this.#e.openStream();try{t=r.sequence(e)}finally{r.closeGracefully()}await t}catch(t){throw st(t)}})}sync(){throw new Ce("sync not supported in http mode","SYNC_NOT_SUPPORTED")}close(){this.#e.close()}async reconnect(){try{if(!this.closed)this.#e.close()}finally{this.#e=cR(this.#t,this.#i,this.#n,this.#a),this.#e.intMode=this.#r}}get closed(){return this.#e.closed}}var lF,dF=30,pF;var mF=v(()=>{Zy();vn();pf();uR();gy();ll();lF=Ul(dR(),1);vn();pF=class pF extends $f{#e;#t;constructor(e,t,r){super(t,r);this.#e=e,this.#t=new kl(e,dF)}_getStream(){return this.#e}_getSqlCache(){return this.#t}close(){this.#e.close()}get closed(){return this.#e.closed}}});function Il(e){return dme(ff(e,!0))}function dme(e){if(e.scheme==="wss"||e.scheme==="ws")return iF(e);else if(e.scheme==="https"||e.scheme==="http")return uF(e);else return l4(e)}var fR=v(()=>{pf();m4();cF();mF();vn()});function oe(e,t){if(!e||typeof e!=="object")return!1;if(e instanceof t)return!0;if(!Object.prototype.hasOwnProperty.call(t,F))throw Error(`Class "${t.name??"<unknown>"}" doesn't look like a Drizzle entity. If this is incorrect and the class is provided by Drizzle, please report this as a bug.`);let r=Object.getPrototypeOf(e).constructor;if(r)while(r){if(F in r&&r[F]===t[F])return!0;r=Object.getPrototypeOf(r)}return!1}var F;var $e=v(()=>{F=Symbol.for("drizzle:entityKind")});var He;var _n=v(()=>{$e();He=class He{constructor(e,t){this.table=e,this.config=t,this.name=t.name,this.keyAsName=t.keyAsName,this.notNull=t.notNull,this.default=t.default,this.defaultFn=t.defaultFn,this.onUpdateFn=t.onUpdateFn,this.hasDefault=t.hasDefault,this.primary=t.primaryKey,this.isUnique=t.isUnique,this.uniqueName=t.uniqueName,this.uniqueType=t.uniqueType,this.dataType=t.dataType,this.columnType=t.columnType,this.generated=t.generated,this.generatedIdentity=t.generatedIdentity}static[F]="Column";name;keyAsName;primary;notNull;default;defaultFn;onUpdateFn;hasDefault;isUnique;uniqueName;uniqueType;dataType;columnType;enumValues=void 0;generated=void 0;generatedIdentity=void 0;config;mapFromDriverValue(e){return e}mapToDriverValue(e){return e}shouldDisableInsert(){return this.config.generated!==void 0&&this.config.generated.type!=="byDefault"}}});var Of;var Uy=v(()=>{$e();Of=class Of{static[F]="ColumnBuilder";config;constructor(e,t,r){this.config={name:e,keyAsName:e==="",notNull:!1,default:void 0,hasDefault:!1,primaryKey:!1,isUnique:!1,uniqueName:void 0,uniqueType:void 0,dataType:t,columnType:r,generated:void 0}}$type(){return this}notNull(){return this.config.notNull=!0,this}default(e){return this.config.default=e,this.config.hasDefault=!0,this}$defaultFn(e){return this.config.defaultFn=e,this.config.hasDefault=!0,this}$default=this.$defaultFn;$onUpdateFn(e){return this.config.onUpdateFn=e,this.config.hasDefault=!0,this}$onUpdate=this.$onUpdateFn;primaryKey(){return this.config.primaryKey=!0,this.config.notNull=!0,this}setName(e){if(this.config.name!=="")return;this.config.name=e}}});var ir;var Al=v(()=>{ir=Symbol.for("drizzle:Name")});var pR,hF;var gF=v(()=>{$e();Al();pR=class pR{static[F]="PgForeignKeyBuilder";reference;_onUpdate="no action";_onDelete="no action";constructor(e,t){if(this.reference=()=>{let{name:r,columns:o,foreignColumns:n}=e();return{name:r,columns:o,foreignTable:n[0].table,foreignColumns:n}},t)this._onUpdate=t.onUpdate,this._onDelete=t.onDelete}onUpdate(e){return this._onUpdate=e===void 0?"no action":e,this}onDelete(e){return this._onDelete=e===void 0?"no action":e,this}build(e){return new hF(e,this)}};hF=class hF{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static[F]="PgForeignKey";reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:r}=this.reference(),o=t.map((s)=>s.name),n=r.map((s)=>s.name),i=[this.table[ir],...o,r[0].table[ir],...n];return e??`${i.join("_")}_fk`}}});function My(e,...t){return e(...t)}var mR=()=>{};function hR(e,t){return`${e[ir]}_${t.join("_")}_unique`}var yF,fme,bF;var SF=v(()=>{$e();Al();yF=class yF{constructor(e,t){this.name=t,this.columns=e}static[F]="PgUniqueConstraintBuilder";columns;nullsNotDistinctConfig=!1;nullsNotDistinct(){return this.nullsNotDistinctConfig=!0,this}build(e){return new bF(e,this.columns,this.nullsNotDistinctConfig,this.name)}};fme=class fme{static[F]="PgUniqueOnConstraintBuilder";name;constructor(e){this.name=e}on(...e){return new yF(e,this.name)}};bF=class bF{constructor(e,t,r,o){this.table=e,this.columns=t,this.name=o??hR(this.table,this.columns.map((n)=>n.name)),this.nullsNotDistinct=r}static[F]="PgUniqueConstraint";columns;name;nullsNotDistinct=!1;getName(){return this.name}}});function vF(e,t,r){for(let o=t;o<e.length;o++){let n=e[o];if(n==="\\"){o++;continue}if(n==='"')return[e.slice(t,o).replace(/\\/g,""),o+1];if(r)continue;if(n===","||n==="}")return[e.slice(t,o).replace(/\\/g,""),o]}return[e.slice(t).replace(/\\/g,""),e.length]}function wF(e,t=0){let r=[],o=t,n=!1;while(o<e.length){let i=e[o];if(i===","){if(n||o===t)r.push("");n=!0,o++;continue}if(n=!1,i==="\\"){o+=2;continue}if(i==='"'){let[c,u]=vF(e,o+1,!0);r.push(c),o=u;continue}if(i==="}")return[r,o+1];if(i==="{"){let[c,u]=wF(e,o+1);r.push(c),o=u;continue}let[s,a]=vF(e,o,!1);r.push(s),o=a}return[r,o]}function xF(e){let[t]=wF(e,1);return t}function gR(e){return`{${e.map((t)=>{if(Array.isArray(t))return gR(t);if(typeof t==="string")return`"${t.replace(/\\/g,"\\\\").replace(/"/g,"\\\"")}"`;return`${t}`}).join(",")}}`}var _F=()=>{};var Cf,Tl,EF,pme,kF,yR;var IF=v(()=>{Uy();_n();$e();gF();mR();SF();_F();Cf=class Cf extends Of{foreignKeyConfigs=[];static[F]="PgColumnBuilder";array(e){return new kF(this.config.name,this,e)}references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e,t){return this.config.isUnique=!0,this.config.uniqueName=e,this.config.uniqueType=t?.nulls,this}generatedAlwaysAs(e){return this.config.generated={as:e,type:"always",mode:"stored"},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:r,actions:o})=>My((n,i)=>{let s=new pR(()=>{let a=n();return{columns:[e],foreignColumns:[a]}});if(i.onUpdate)s.onUpdate(i.onUpdate);if(i.onDelete)s.onDelete(i.onDelete);return s.build(t)},r,o))}buildExtraConfigColumn(e){return new EF(e,this.config)}};Tl=class Tl extends He{constructor(e,t){if(!t.uniqueName)t.uniqueName=hR(e,[t.name]);super(e,t);this.table=e}static[F]="PgColumn"};EF=class EF extends Tl{static[F]="ExtraConfigColumn";getSQLType(){return this.getSQLType()}indexConfig={order:this.config.order??"asc",nulls:this.config.nulls??"last",opClass:this.config.opClass};defaultConfig={order:"asc",nulls:"last",opClass:void 0};asc(){return this.indexConfig.order="asc",this}desc(){return this.indexConfig.order="desc",this}nullsFirst(){return this.indexConfig.nulls="first",this}nullsLast(){return this.indexConfig.nulls="last",this}op(e){return this.indexConfig.opClass=e,this}};pme=class pme{static[F]="IndexedColumn";constructor(e,t,r,o){this.name=e,this.keyAsName=t,this.type=r,this.indexConfig=o}name;keyAsName;type;indexConfig};kF=class kF extends Cf{static[F]="PgArrayBuilder";constructor(e,t,r){super(e,"array","PgArray");this.config.baseBuilder=t,this.config.size=r}build(e){let t=this.config.baseBuilder.build(e);return new yR(e,this.config,t)}};yR=class yR extends Tl{constructor(e,t,r,o){super(e,t);this.baseColumn=r,this.range=o,this.size=t.size}size;static[F]="PgArray";getSQLType(){return`${this.baseColumn.getSQLType()}[${typeof this.size==="number"?this.size:""}]`}mapFromDriverValue(e){if(typeof e==="string")e=xF(e);return e.map((t)=>this.baseColumn.mapFromDriverValue(t))}mapToDriverValue(e,t=!1){let r=e.map((o)=>o===null?null:oe(this.baseColumn,yR)?this.baseColumn.mapToDriverValue(o,!0):this.baseColumn.mapToDriverValue(o));if(t)return r;return gR(r)}}});function RF(e){return!!e&&typeof e==="function"&&AF in e&&e[AF]===!0}var mme,TF,AF,hme,$F;var OF=v(()=>{$e();IF();mme=class mme extends Cf{static[F]="PgEnumObjectColumnBuilder";constructor(e,t){super(e,"string","PgEnumObjectColumn");this.config.enum=t}build(e){return new TF(e,this.config)}};TF=class TF extends Tl{static[F]="PgEnumObjectColumn";enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t);this.enum=t.enum}getSQLType(){return this.enum.enumName}};AF=Symbol.for("drizzle:isPgEnum");hme=class hme extends Cf{static[F]="PgEnumColumnBuilder";constructor(e,t){super(e,"string","PgEnumColumn");this.config.enum=t}build(e){return new $F(e,this.config)}};$F=class $F extends Tl{static[F]="PgEnumColumn";enum=this.config.enum;enumValues=this.config.enum.enumValues;constructor(e,t){super(e,t);this.enum=t.enum}getSQLType(){return this.enum.enumName}}});var dt,Pf;var En=v(()=>{$e();dt=class dt{static[F]="Subquery";constructor(e,t,r,o=!1,n=[]){this._={brand:"Subquery",sql:e,selectedFields:t,alias:r,isWith:o,usedTables:n}}};Pf=class Pf extends dt{static[F]="WithSubquery"}});var CF="0.45.2";var PF=()=>{};var bR,SR,zF;var NF=v(()=>{mR();PF();zF={startActiveSpan(e,t){if(!bR)return t();if(!SR)SR=bR.trace.getTracer("drizzle-orm",CF);return My((r,o)=>o.startActiveSpan(e,(n)=>{try{return t(n)}catch(i){throw n.setStatus({code:r.SpanStatusCode.ERROR,message:i instanceof Error?i.message:"Unknown error"}),i}finally{n.end()}}),bR,SR)}}});var ft;var Zo=v(()=>{ft=Symbol.for("drizzle:ViewBaseConfig")});function es(e){return e[ir]}function ha(e){return`${e[qy]??"public"}.${e[ir]}`}var qy,Fy,DF,vR,wR,zf,LF,gme,he;var sr=v(()=>{$e();Al();qy=Symbol.for("drizzle:Schema"),Fy=Symbol.for("drizzle:Columns"),DF=Symbol.for("drizzle:ExtraConfigColumns"),vR=Symbol.for("drizzle:OriginalName"),wR=Symbol.for("drizzle:BaseName"),zf=Symbol.for("drizzle:IsAlias"),LF=Symbol.for("drizzle:ExtraConfigBuilder"),gme=Symbol.for("drizzle:IsDrizzleTable");he=class he{static[F]="Table";static Symbol={Name:ir,Schema:qy,OriginalName:vR,Columns:Fy,ExtraConfigColumns:DF,BaseName:wR,IsAlias:zf,ExtraConfigBuilder:LF};[ir];[vR];[qy];[Fy];[DF];[wR];[zf]=!1;[gme]=!0;[LF]=void 0;constructor(e,t,r){this[ir]=this[vR]=e,this[qy]=t,this[wR]=r}}});function xR(e){return e!==null&&e!==void 0&&typeof e.getSQL==="function"}function bme(e){let t={sql:"",params:[]};for(let r of e)if(t.sql+=r.sql,t.params.push(...r.params),r.typings?.length){if(!t.typings)t.typings=[];t.typings.push(...r.typings)}return t}function BF(e){return typeof e==="object"&&e!==null&&"mapToDriverValue"in e&&typeof e.mapToDriverValue==="function"}function C(e,...t){let r=[];if(t.length>0||e.length>0&&e[0]!=="")r.push(new Nt(e[0]));for(let[o,n]of t.entries())r.push(n,new Nt(e[o+1]));return new _e(r)}function Nf(e,t){return e.map((r)=>{if(oe(r,ts)){if(!(r.name in t))throw Error(`No value for placeholder "${r.name}" was provided`);return t[r.name]}if(oe(r,Ur)&&oe(r.value,ts)){if(!(r.value.name in t))throw Error(`No value for placeholder "${r.value.name}" was provided`);return r.encoder.mapToDriverValue(t[r.value.name])}return r})}var yme,Nt,_e,Ky,jF,ZF,nje,Ur,ts,Sme,on;var Qt=v(()=>{$e();OF();En();NF();Zo();_n();sr();yme=class yme{static[F]="FakePrimitiveParam"};Nt=class Nt{static[F]="StringChunk";value;constructor(e){this.value=Array.isArray(e)?e:[e]}getSQL(){return new _e([this])}};_e=class _e{constructor(e){this.queryChunks=e;for(let t of e)if(oe(t,he)){let r=t[he.Symbol.Schema];this.usedTables.push(r===void 0?t[he.Symbol.Name]:r+"."+t[he.Symbol.Name])}}static[F]="SQL";decoder=jF;shouldInlineParams=!1;usedTables=[];append(e){return this.queryChunks.push(...e.queryChunks),this}toQuery(e){return zF.startActiveSpan("drizzle.buildSQL",(t)=>{let r=this.buildQueryFromSourceParams(this.queryChunks,e);return t?.setAttributes({"drizzle.query.text":r.sql,"drizzle.query.params":JSON.stringify(r.params)}),r})}buildQueryFromSourceParams(e,t){let r=Object.assign({},t,{inlineParams:t.inlineParams||this.shouldInlineParams,paramStartIndex:t.paramStartIndex||{value:0}}),{casing:o,escapeName:n,escapeParam:i,prepareTyping:s,inlineParams:a,paramStartIndex:c}=r;return bme(e.map((u)=>{if(oe(u,Nt))return{sql:u.value.join(""),params:[]};if(oe(u,Ky))return{sql:n(u.value),params:[]};if(u===void 0)return{sql:"",params:[]};if(Array.isArray(u)){let d=[new Nt("(")];for(let[f,m]of u.entries())if(d.push(m),f<u.length-1)d.push(new Nt(", "));return d.push(new Nt(")")),this.buildQueryFromSourceParams(d,r)}if(oe(u,_e))return this.buildQueryFromSourceParams(u.queryChunks,{...r,inlineParams:a||u.shouldInlineParams});if(oe(u,he)){let d=u[he.Symbol.Schema],f=u[he.Symbol.Name];return{sql:d===void 0||u[zf]?n(f):n(d)+"."+n(f),params:[]}}if(oe(u,He)){let d=o.getColumnCasing(u);if(t.invokeSource==="indexes")return{sql:n(d),params:[]};let f=u.table[he.Symbol.Schema];return{sql:u.table[zf]||f===void 0?n(u.table[he.Symbol.Name])+"."+n(d):n(f)+"."+n(u.table[he.Symbol.Name])+"."+n(d),params:[]}}if(oe(u,on)){let d=u[ft].schema,f=u[ft].name;return{sql:d===void 0||u[ft].isAlias?n(f):n(d)+"."+n(f),params:[]}}if(oe(u,Ur)){if(oe(u.value,ts))return{sql:i(c.value++,u),params:[u],typings:["none"]};let d=u.value===null?null:u.encoder.mapToDriverValue(u.value);if(oe(d,_e))return this.buildQueryFromSourceParams([d],r);if(a)return{sql:this.mapInlineParam(d,r),params:[]};let f=["none"];if(s)f=[s(u.encoder)];return{sql:i(c.value++,d),params:[d],typings:f}}if(oe(u,ts))return{sql:i(c.value++,u),params:[u],typings:["none"]};if(oe(u,_e.Aliased)&&u.fieldAlias!==void 0)return{sql:n(u.fieldAlias),params:[]};if(oe(u,dt)){if(u._.isWith)return{sql:n(u._.alias),params:[]};return this.buildQueryFromSourceParams([new Nt("("),u._.sql,new Nt(") "),new Ky(u._.alias)],r)}if(RF(u)){if(u.schema)return{sql:n(u.schema)+"."+n(u.enumName),params:[]};return{sql:n(u.enumName),params:[]}}if(xR(u)){if(u.shouldOmitSQLParens?.())return this.buildQueryFromSourceParams([u.getSQL()],r);return this.buildQueryFromSourceParams([new Nt("("),u.getSQL(),new Nt(")")],r)}if(a)return{sql:this.mapInlineParam(u,r),params:[]};return{sql:i(c.value++,u),params:[u],typings:["none"]}}))}mapInlineParam(e,{escapeString:t}){if(e===null)return"null";if(typeof e==="number"||typeof e==="boolean")return e.toString();if(typeof e==="string")return t(e);if(typeof e==="object"){let r=e.toString();if(r==="[object Object]")return t(JSON.stringify(e));return t(r)}throw Error("Unexpected param value: "+e)}getSQL(){return this}as(e){if(e===void 0)return this;return new _e.Aliased(this,e)}mapWith(e){return this.decoder=typeof e==="function"?{mapFromDriverValue:e}:e,this}inlineParams(){return this.shouldInlineParams=!0,this}if(e){return e?this:void 0}};Ky=class Ky{constructor(e){this.value=e}static[F]="Name";brand;getSQL(){return new _e([this])}};jF={mapFromDriverValue:(e)=>e},ZF={mapToDriverValue:(e)=>e},nje={...jF,...ZF};Ur=class Ur{constructor(e,t=ZF){this.value=e,this.encoder=t}static[F]="Param";brand;getSQL(){return new _e([this])}};((e)=>{function t(){return new _e([])}e.empty=t;function r(c){return new _e(c)}e.fromList=r;function o(c){return new _e([new Nt(c)])}e.raw=o;function n(c,u){let d=[];for(let[f,m]of c.entries()){if(f>0&&u!==void 0)d.push(u);d.push(m)}return new _e(d)}e.join=n;function i(c){return new Ky(c)}e.identifier=i;function s(c){return new ts(c)}e.placeholder=s;function a(c,u){return new Ur(c,u)}e.param=a})(C||(C={}));((e)=>{class t{constructor(r,o){this.sql=r,this.fieldAlias=o}static[F]="SQL.Aliased";isSelectionField=!1;getSQL(){return this.sql}clone(){return new t(this.sql,this.fieldAlias)}}e.Aliased=t})(_e||(_e={}));ts=class ts{constructor(e){this.name=e}static[F]="Placeholder";getSQL(){return new _e([this])}};Sme=Symbol.for("drizzle:IsDrizzleView");on=class on{static[F]="View";[ft];[Sme]=!0;constructor({name:e,schema:t,selectedFields:r,query:o}){this[ft]={name:e,originalName:e,schema:t,selectedFields:r,query:o,isExisting:!o,isAlias:!1}}getSQL(){return new _e([this])}};He.prototype.getSQL=function(){return new _e([this])};he.prototype.getSQL=function(){return new _e([this])};dt.prototype.getSQL=function(){return new _e([this])}});function _R(e,t,r){let o={},n=e.reduce((i,{path:s,field:a},c)=>{let u;if(oe(a,He))u=a;else if(oe(a,_e))u=a.decoder;else if(oe(a,dt))u=a._.sql.decoder;else u=a.sql.decoder;let d=i;for(let[f,m]of s.entries())if(f<s.length-1){if(!(m in d))d[m]={};d=d[m]}else{let h=t[c],b=d[m]=h===null?null:u.mapFromDriverValue(h);if(r&&oe(a,He)&&s.length===2){let y=s[0];if(!(y in o))o[y]=b===null?es(a.table):!1;else if(typeof o[y]==="string"&&o[y]!==es(a.table))o[y]=!1}}return i},{});if(r&&Object.keys(o).length>0){for(let[i,s]of Object.entries(o))if(typeof s==="string"&&!r[s])n[i]=null}return n}function sn(e,t){return Object.entries(e).reduce((r,[o,n])=>{if(typeof o!=="string")return r;let i=t?[...t,o]:[o];if(oe(n,He)||oe(n,_e)||oe(n,_e.Aliased)||oe(n,dt))r.push({path:i,field:n});else if(oe(n,he))r.push(...sn(n[he.Symbol.Columns],i));else r.push(...sn(n,i));return r},[])}function Df(e,t){let r=Object.keys(e),o=Object.keys(t);if(r.length!==o.length)return!1;for(let[n,i]of r.entries())if(i!==o[n])return!1;return!0}function Jy(e,t){let r=Object.entries(t).filter(([,o])=>o!==void 0).map(([o,n])=>{if(oe(n,_e)||oe(n,He))return[o,n];else return[o,new Ur(n,e[he.Symbol.Columns][o])]});if(r.length===0)throw Error("No values to set");return Object.fromEntries(r)}function UF(e,t){for(let r of t)for(let o of Object.getOwnPropertyNames(r.prototype)){if(o==="constructor")continue;Object.defineProperty(e.prototype,o,Object.getOwnPropertyDescriptor(r.prototype,o)||Object.create(null))}}function Hy(e){return e[he.Symbol.Columns]}function Lf(e){return oe(e,dt)?e._.alias:oe(e,on)?e[ft].name:oe(e,_e)?void 0:e[he.Symbol.IsAlias]?e[he.Symbol.Name]:e[he.Symbol.BaseName]}function to(e,t){return{name:typeof e==="string"&&e.length>0?e:"",config:typeof e==="object"?e:t}}function MF(e){if(typeof e!=="object"||e===null)return!1;if(e.constructor.name!=="Object")return!1;if("logger"in e){let t=typeof e.logger;if(t!=="boolean"&&(t!=="object"||typeof e.logger.logQuery!=="function")&&t!=="undefined")return!1;return!0}if("schema"in e){let t=typeof e.schema;if(t!=="object"&&t!=="undefined")return!1;return!0}if("casing"in e){let t=typeof e.casing;if(t!=="string"&&t!=="undefined")return!1;return!0}if("mode"in e){if(e.mode!=="default"||e.mode!=="planetscale"||e.mode!==void 0)return!1;return!0}if("connection"in e){let t=typeof e.connection;if(t!=="string"&&t!=="object"&&t!=="undefined")return!1;return!0}if("client"in e){let t=typeof e.client;if(t!=="object"&&t!=="function"&&t!=="undefined")return!1;return!0}if(Object.keys(e).length===0)return!0;return!1}var ER;var Sr=v(()=>{_n();$e();Qt();En();sr();Zo();ER=typeof TextDecoder>"u"?null:new TextDecoder});var qF,kR,IR;var Vy=v(()=>{$e();qF=class qF{static[F]="ConsoleLogWriter";write(e){console.log(e)}};kR=class kR{static[F]="DefaultLogger";writer;constructor(e){this.writer=e?.writer??new qF}logQuery(e,t){let r=t.map((n)=>{try{return JSON.stringify(n)}catch{return String(n)}}),o=r.length?` -- params: [${r.join(", ")}]`:"";this.writer.write(`Query: ${e}${o}`)}};IR=class IR{static[F]="NoopLogger";logQuery(){}}});var FF,KF,AR;var JF=v(()=>{$e();sr();FF=Symbol.for("drizzle:PgInlineForeignKeys"),KF=Symbol.for("drizzle:EnableRLS");AR=class AR extends he{static[F]="PgTable";static Symbol=Object.assign({},he.Symbol,{InlineForeignKeys:FF,EnableRLS:KF});[FF]=[];[KF]=!1;[he.Symbol.ExtraConfigBuilder]=void 0;[he.Symbol.ExtraConfigColumns]={}}});var TR,HF;var VF=v(()=>{$e();JF();TR=class TR{static[F]="PgPrimaryKeyBuilder";columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new HF(e,this.columns,this.name)}};HF=class HF{constructor(e,t,r){this.table=e,this.columns=t,this.name=r}static[F]="PgPrimaryKey";columns;name;getName(){return this.name??`${this.table[AR.Symbol.Name]}_${this.columns.map((e)=>e.name).join("_")}_pk`}}});function Rr(e,t){if(BF(t)&&!xR(e)&&!oe(e,Ur)&&!oe(e,ts)&&!oe(e,He)&&!oe(e,he)&&!oe(e,on))return new Ur(e,t);return e}function tt(...e){let t=e.filter((r)=>r!==void 0);if(t.length===0)return;if(t.length===1)return new _e(t);return new _e([new Nt("("),C.join(t,new Nt(" and ")),new Nt(")")])}function an(...e){let t=e.filter((r)=>r!==void 0);if(t.length===0)return;if(t.length===1)return new _e(t);return new _e([new Nt("("),C.join(t,new Nt(" or ")),new Nt(")")])}function GF(e){return C`not ${e}`}function ns(e,t){if(Array.isArray(t)){if(t.length===0)return C`false`;return C`${e} in ${t.map((r)=>Rr(r,e))}`}return C`${e} in ${Rr(t,e)}`}function Wy(e,t){if(Array.isArray(t)){if(t.length===0)return C`true`;return C`${e} not in ${t.map((r)=>Rr(r,e))}`}return C`${e} not in ${Rr(t,e)}`}function Mr(e){return C`${e} is null`}function XF(e){return C`${e} is not null`}function Gy(e){return C`exists ${e}`}function os(e){return C`not exists ${e}`}function e3(e,t,r){return C`${e} between ${Rr(t,e)} and ${Rr(r,e)}`}function t3(e,t,r){return C`${e} not between ${Rr(t,e)} and ${Rr(r,e)}`}function r3(e,t){return C`${e} like ${t}`}function n3(e,t){return C`${e} not like ${t}`}function o3(e,t){return C`${e} ilike ${t}`}function i3(e,t){return C`${e} not ilike ${t}`}var je=(e,t)=>C`${e} = ${Rr(t,e)}`,WF=(e,t)=>C`${e} <> ${Rr(t,e)}`,kn=(e,t)=>C`${e} > ${Rr(t,e)}`,QF=(e,t)=>C`${e} >= ${Rr(t,e)}`,YF=(e,t)=>C`${e} < ${Rr(t,e)}`,rs=(e,t)=>C`${e} <= ${Rr(t,e)}`;var s3=v(()=>{_n();$e();sr();Qt()});function Uo(e){return C`${e} asc`}function ga(e){return C`${e} desc`}var a3=v(()=>{Qt()});var RR=v(()=>{s3();a3()});function l3(){return{and:tt,between:e3,eq:je,exists:Gy,gt:kn,gte:QF,ilike:o3,inArray:ns,isNull:Mr,isNotNull:XF,like:r3,lt:YF,lte:rs,ne:WF,not:GF,notBetween:t3,notExists:os,notLike:n3,notIlike:i3,notInArray:Wy,or:an,sql:C}}function u3(){return{sql:C,asc:Uo,desc:ga}}function d3(e,t){if(Object.keys(e).length===1&&"default"in e&&!oe(e.default,he))e=e.default;let r={},o={},n={};for(let[i,s]of Object.entries(e))if(oe(s,he)){let a=ha(s),c=o[a];r[a]=i,n[i]={tsName:i,dbName:s[he.Symbol.Name],schema:s[he.Symbol.Schema],columns:s[he.Symbol.Columns],relations:c?.relations??{},primaryKey:c?.primaryKey??[]};for(let d of Object.values(s[he.Symbol.Columns]))if(d.primary)n[i].primaryKey.push(d);let u=s[he.Symbol.ExtraConfigBuilder]?.(s[he.Symbol.ExtraConfigColumns]);if(u){for(let d of Object.values(u))if(oe(d,TR))n[i].primaryKey.push(...d.columns)}}else if(oe(s,c3)){let a=ha(s.table),c=r[a],u=s.config(t(s.table)),d;for(let[f,m]of Object.entries(u))if(c){let h=n[c];if(h.relations[f]=m,d)h.primaryKey.push(...d)}else{if(!(a in o))o[a]={relations:{},primaryKey:d};o[a].relations[f]=m}}return{tables:n,tableNamesMap:r}}function vme(e){return function(r,o){return new is(e,r,o,o?.fields.reduce((n,i)=>n&&i.notNull,!0)??!1)}}function wme(e){return function(r,o){return new Bf(e,r,o)}}function f3(e,t,r){if(oe(r,is)&&r.config)return{fields:r.config.fields,references:r.config.references};let o=t[ha(r.referencedTable)];if(!o)throw Error(`Table "${r.referencedTable[he.Symbol.Name]}" not found in schema`);let n=e[o];if(!n)throw Error(`Table "${o}" not found in schema`);let i=r.sourceTable,s=t[ha(i)];if(!s)throw Error(`Table "${i[he.Symbol.Name]}" not found in schema`);let a=[];for(let c of Object.values(n.relations))if(r.relationName&&r!==c&&c.relationName===r.relationName||!r.relationName&&c.referencedTable===r.sourceTable)a.push(c);if(a.length>1)throw r.relationName?Error(`There are multiple relations with name "${r.relationName}" in table "${o}"`):Error(`There are multiple relations between "${o}" and "${r.sourceTable[he.Symbol.Name]}". Please specify relation name`);if(a[0]&&oe(a[0],is)&&a[0].config)return{fields:a[0].config.references,references:a[0].config.fields};throw Error(`There is not enough information to infer relation "${s}.${r.fieldName}"`)}function p3(e){return{one:vme(e),many:wme(e)}}function Qy(e,t,r,o,n=(i)=>i){let i={};for(let[s,a]of o.entries())if(a.isJson){let c=t.relations[a.tsKey],u=r[s],d=typeof u==="string"?JSON.parse(u):u;i[a.tsKey]=oe(c,is)?d&&Qy(e,e[a.relationTableTsKey],d,a.selection,n):d.map((f)=>Qy(e,e[a.relationTableTsKey],f,a.selection,n))}else{let c=n(r[s]),u=a.field,d;if(oe(u,He))d=u;else if(oe(u,_e))d=u.decoder;else d=u.sql.decoder;i[a.tsKey]=c===null?null:d.mapFromDriverValue(c)}return i}var $R,c3,is,Bf;var jf=v(()=>{sr();_n();$e();VF();RR();Qt();$R=class $R{constructor(e,t,r){this.sourceTable=e,this.referencedTable=t,this.relationName=r,this.referencedTableName=t[he.Symbol.Name]}static[F]="Relation";referencedTableName;fieldName};c3=class c3{constructor(e,t){this.table=e,this.config=t}static[F]="Relations"};is=class is extends $R{constructor(e,t,r,o){super(e,t,r?.relationName);this.config=r,this.isNullable=o}static[F]="One";withFieldName(e){let t=new is(this.sourceTable,this.referencedTable,this.config,this.isNullable);return t.fieldName=e,t}};Bf=class Bf extends $R{constructor(e,t,r){super(e,t,r?.relationName);this.config=r}static[F]="Many";withFieldName(e){let t=new Bf(this.sourceTable,this.referencedTable,this.config);return t.fieldName=e,t}}});function Zf(e,t){return new Proxy(e,new ya(t,!1))}function ro(e,t){return new Proxy(e,new Rl(new Proxy(e.table,new ya(t,!1))))}function OR(e,t){return new _e.Aliased(Uf(e.sql,t),e.fieldAlias)}function Uf(e,t){return C.join(e.queryChunks.map((r)=>{if(oe(r,He))return ro(r,t);if(oe(r,_e))return Uf(r,t);if(oe(r,_e.Aliased))return OR(r,t);return r}))}var Rl,ya,xme;var Mf=v(()=>{_n();$e();Qt();sr();Zo();Rl=class Rl{constructor(e){this.table=e}static[F]="ColumnAliasProxyHandler";get(e,t){if(t==="table")return this.table;return e[t]}};ya=class ya{constructor(e,t){this.alias=e,this.replaceOriginalName=t}static[F]="TableAliasProxyHandler";get(e,t){if(t===he.Symbol.IsAlias)return!0;if(t===he.Symbol.Name)return this.alias;if(this.replaceOriginalName&&t===he.Symbol.OriginalName)return this.alias;if(t===ft)return{...e[ft],name:this.alias,isAlias:!0};if(t===he.Symbol.Columns){let o=e[he.Symbol.Columns];if(!o)return o;let n={};return Object.keys(o).map((i)=>{n[i]=new Proxy(o[i],new Rl(new Proxy(e,this)))}),n}let r=e[t];if(oe(r,He))return new Proxy(r,new Rl(new Proxy(e,this)));return r}};xme=class xme{constructor(e){this.alias=e}static[F]="RelationTableAliasProxyHandler";get(e,t){if(t==="sourceTable")return Zf(e.sourceTable,this.alias);return e[t]}}});var at;var ba=v(()=>{Mf();_n();$e();Qt();En();Zo();at=class at{static[F]="SelectionProxyHandler";config;constructor(e){this.config={...e}}get(e,t){if(t==="_")return{...e._,selectedFields:new Proxy(e._.selectedFields,this)};if(t===ft)return{...e[ft],selectedFields:new Proxy(e[ft].selectedFields,this)};if(typeof t==="symbol")return e[t];let o=(oe(e,dt)?e._.selectedFields:oe(e,on)?e[ft].selectedFields:e)[t];if(oe(o,_e.Aliased)){if(this.config.sqlAliasedBehavior==="sql"&&!o.isSelectionField)return o.sql;let n=o.clone();return n.isSelectionField=!0,n}if(oe(o,_e)){if(this.config.sqlBehavior==="sql")return o;throw Error(`You tried to reference "${t}" field from a subquery, which is a raw SQL field, but it doesn't have an alias declared. Please add an alias to the field using ".as('alias')" method.`)}if(oe(o,He)){if(this.config.alias)return new Proxy(o,new Rl(new Proxy(o.table,new ya(this.config.alias,this.config.replaceOriginalName??!1))));return o}if(typeof o!=="object"||o===null)return o;return new Proxy(o,new at(this.config))}}});var vr;var Mo=v(()=>{$e();vr=class vr{static[F]="QueryPromise";[Symbol.toStringTag]="QueryPromise";catch(e){return this.then(void 0,e)}finally(e){return this.then((t)=>(e?.(),t),(t)=>{throw e?.(),t})}then(e,t){return this.execute().then(e,t)}}});var CR,m3;var PR=v(()=>{$e();Al();CR=class CR{static[F]="SQLiteForeignKeyBuilder";reference;_onUpdate;_onDelete;constructor(e,t){if(this.reference=()=>{let{name:r,columns:o,foreignColumns:n}=e();return{name:r,columns:o,foreignTable:n[0].table,foreignColumns:n}},t)this._onUpdate=t.onUpdate,this._onDelete=t.onDelete}onUpdate(e){return this._onUpdate=e,this}onDelete(e){return this._onDelete=e,this}build(e){return new m3(e,this)}};m3=class m3{constructor(e,t){this.table=e,this.reference=t.reference,this.onUpdate=t._onUpdate,this.onDelete=t._onDelete}static[F]="SQLiteForeignKey";reference;onUpdate;onDelete;getName(){let{name:e,columns:t,foreignColumns:r}=this.reference(),o=t.map((s)=>s.name),n=r.map((s)=>s.name),i=[this.table[ir],...o,r[0].table[ir],...n];return e??`${i.join("_")}_fk`}}});function zR(e,t){return`${e[ir]}_${t.join("_")}_unique`}var h3,_me,g3;var NR=v(()=>{$e();Al();h3=class h3{constructor(e,t){this.name=t,this.columns=e}static[F]="SQLiteUniqueConstraintBuilder";columns;build(e){return new g3(e,this.columns,this.name)}};_me=class _me{static[F]="SQLiteUniqueOnConstraintBuilder";name;constructor(e){this.name=e}on(...e){return new h3(e,this.name)}};g3=class g3{constructor(e,t,r){this.table=e,this.columns=t,this.name=r??zR(this.table,this.columns.map((o)=>o.name))}static[F]="SQLiteUniqueConstraint";columns;name;getName(){return this.name}}});var Zt,yt;var ss=v(()=>{Uy();_n();$e();PR();NR();Zt=class Zt extends Of{static[F]="SQLiteColumnBuilder";foreignKeyConfigs=[];references(e,t={}){return this.foreignKeyConfigs.push({ref:e,actions:t}),this}unique(e){return this.config.isUnique=!0,this.config.uniqueName=e,this}generatedAlwaysAs(e,t){return this.config.generated={as:e,type:"always",mode:t?.mode??"virtual"},this}buildForeignKeys(e,t){return this.foreignKeyConfigs.map(({ref:r,actions:o})=>((n,i)=>{let s=new CR(()=>{let a=n();return{columns:[e],foreignColumns:[a]}});if(i.onUpdate)s.onUpdate(i.onUpdate);if(i.onDelete)s.onDelete(i.onDelete);return s.build(t)})(r,o))}};yt=class yt extends He{constructor(e,t){if(!t.uniqueName)t.uniqueName=zR(e,[t.name]);super(e,t);this.table=e}static[F]="SQLiteColumn"}});function _3(e,t){let{name:r,config:o}=to(e,t);if(o?.mode==="json")return new S3(r);if(o?.mode==="bigint")return new y3(r);return new w3(r)}var y3,b3,S3,v3,w3,x3;var DR=v(()=>{$e();Sr();ss();y3=class y3 extends Zt{static[F]="SQLiteBigIntBuilder";constructor(e){super(e,"bigint","SQLiteBigInt")}build(e){return new b3(e,this.config)}};b3=class b3 extends yt{static[F]="SQLiteBigInt";getSQLType(){return"blob"}mapFromDriverValue(e){if(typeof Buffer<"u"&&Buffer.from){let t=Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e);return BigInt(t.toString("utf8"))}return BigInt(ER.decode(e))}mapToDriverValue(e){return Buffer.from(e.toString())}};S3=class S3 extends Zt{static[F]="SQLiteBlobJsonBuilder";constructor(e){super(e,"json","SQLiteBlobJson")}build(e){return new v3(e,this.config)}};v3=class v3 extends yt{static[F]="SQLiteBlobJson";getSQLType(){return"blob"}mapFromDriverValue(e){if(typeof Buffer<"u"&&Buffer.from){let t=Buffer.isBuffer(e)?e:e instanceof ArrayBuffer?Buffer.from(e):e.buffer?Buffer.from(e.buffer,e.byteOffset,e.byteLength):Buffer.from(e);return JSON.parse(t.toString("utf8"))}return JSON.parse(ER.decode(e))}mapToDriverValue(e){return Buffer.from(JSON.stringify(e))}};w3=class w3 extends Zt{static[F]="SQLiteBlobBufferBuilder";constructor(e){super(e,"buffer","SQLiteBlobBuffer")}build(e){return new x3(e,this.config)}};x3=class x3 extends yt{static[F]="SQLiteBlobBuffer";mapFromDriverValue(e){if(Buffer.isBuffer(e))return e;return Buffer.from(e)}getSQLType(){return"blob"}}});function I3(e){return(t,r)=>{let{name:o,config:n}=to(t,r);return new E3(o,n,e)}}var E3,k3;var LR=v(()=>{$e();Sr();ss();E3=class E3 extends Zt{static[F]="SQLiteCustomColumnBuilder";constructor(e,t,r){super(e,"custom","SQLiteCustomColumn");this.config.fieldConfig=t,this.config.customTypeParams=r}build(e){return new k3(e,this.config)}};k3=class k3 extends yt{static[F]="SQLiteCustomColumn";sqlName;mapTo;mapFrom;constructor(e,t){super(e,t);this.sqlName=t.customTypeParams.dataType(t.fieldConfig),this.mapTo=t.customTypeParams.toDriver,this.mapFrom=t.customTypeParams.fromDriver}getSQLType(){return this.sqlName}mapFromDriverValue(e){return typeof this.mapFrom==="function"?this.mapFrom(e):e}mapToDriverValue(e){return typeof this.mapTo==="function"?this.mapTo(e):e}}});function ar(e,t){let{name:r,config:o}=to(e,t);if(o?.mode==="timestamp"||o?.mode==="timestamp_ms")return new R3(r,o.mode);if(o?.mode==="boolean")return new O3(r,o.mode);return new A3(r)}var Yy,Xy,A3,T3,R3,$3,O3,C3;var BR=v(()=>{$e();Qt();Sr();ss();Yy=class Yy extends Zt{static[F]="SQLiteBaseIntegerBuilder";constructor(e,t,r){super(e,t,r);this.config.autoIncrement=!1}primaryKey(e){if(e?.autoIncrement)this.config.autoIncrement=!0;return this.config.hasDefault=!0,super.primaryKey()}};Xy=class Xy extends yt{static[F]="SQLiteBaseInteger";autoIncrement=this.config.autoIncrement;getSQLType(){return"integer"}};A3=class A3 extends Yy{static[F]="SQLiteIntegerBuilder";constructor(e){super(e,"number","SQLiteInteger")}build(e){return new T3(e,this.config)}};T3=class T3 extends Xy{static[F]="SQLiteInteger"};R3=class R3 extends Yy{static[F]="SQLiteTimestampBuilder";constructor(e,t){super(e,"date","SQLiteTimestamp");this.config.mode=t}defaultNow(){return this.default(C`(cast((julianday('now') - 2440587.5)*86400000 as integer))`)}build(e){return new $3(e,this.config)}};$3=class $3 extends Xy{static[F]="SQLiteTimestamp";mode=this.config.mode;mapFromDriverValue(e){if(this.config.mode==="timestamp")return new Date(e*1000);return new Date(e)}mapToDriverValue(e){let t=e.getTime();if(this.config.mode==="timestamp")return Math.floor(t/1000);return t}};O3=class O3 extends Yy{static[F]="SQLiteBooleanBuilder";constructor(e,t){super(e,"boolean","SQLiteBoolean");this.config.mode=t}build(e){return new C3(e,this.config)}};C3=class C3 extends Xy{static[F]="SQLiteBoolean";mode=this.config.mode;mapFromDriverValue(e){return Number(e)===1}mapToDriverValue(e){return e?1:0}}});function j3(e,t){let{name:r,config:o}=to(e,t),n=o?.mode;return n==="number"?new N3(r):n==="bigint"?new L3(r):new P3(r)}var P3,z3,N3,D3,L3,B3;var jR=v(()=>{$e();Sr();ss();P3=class P3 extends Zt{static[F]="SQLiteNumericBuilder";constructor(e){super(e,"string","SQLiteNumeric")}build(e){return new z3(e,this.config)}};z3=class z3 extends yt{static[F]="SQLiteNumeric";mapFromDriverValue(e){if(typeof e==="string")return e;return String(e)}getSQLType(){return"numeric"}};N3=class N3 extends Zt{static[F]="SQLiteNumericNumberBuilder";constructor(e){super(e,"number","SQLiteNumericNumber")}build(e){return new D3(e,this.config)}};D3=class D3 extends yt{static[F]="SQLiteNumericNumber";mapFromDriverValue(e){if(typeof e==="number")return e;return Number(e)}mapToDriverValue=String;getSQLType(){return"numeric"}};L3=class L3 extends Zt{static[F]="SQLiteNumericBigIntBuilder";constructor(e){super(e,"bigint","SQLiteNumericBigInt")}build(e){return new B3(e,this.config)}};B3=class B3 extends yt{static[F]="SQLiteNumericBigInt";mapFromDriverValue=BigInt;mapToDriverValue=String;getSQLType(){return"numeric"}}});function M3(e){return new Z3(e??"")}var Z3,U3;var ZR=v(()=>{$e();ss();Z3=class Z3 extends Zt{static[F]="SQLiteRealBuilder";constructor(e){super(e,"number","SQLiteReal")}build(e){return new U3(e,this.config)}};U3=class U3 extends yt{static[F]="SQLiteReal";getSQLType(){return"real"}}});function pt(e,t={}){let{name:r,config:o}=to(e,t);if(o.mode==="json")return new K3(r);return new q3(r,o)}var q3,F3,K3,J3;var UR=v(()=>{$e();Sr();ss();q3=class q3 extends Zt{static[F]="SQLiteTextBuilder";constructor(e,t){super(e,"string","SQLiteText");this.config.enumValues=t.enum,this.config.length=t.length}build(e){return new F3(e,this.config)}};F3=class F3 extends yt{static[F]="SQLiteText";enumValues=this.config.enumValues;length=this.config.length;constructor(e,t){super(e,t)}getSQLType(){return`text${this.config.length?`(${this.config.length})`:""}`}};K3=class K3 extends Zt{static[F]="SQLiteTextJsonBuilder";constructor(e){super(e,"json","SQLiteTextJson")}build(e){return new J3(e,this.config)}};J3=class J3 extends yt{static[F]="SQLiteTextJson";getSQLType(){return"text"}mapFromDriverValue(e){return JSON.parse(e)}mapToDriverValue(e){return JSON.stringify(e)}}});function H3(){return{blob:_3,customType:I3,integer:ar,numeric:j3,real:M3,text:pt}}var V3=v(()=>{DR();LR();BR();jR();ZR();UR()});function Eme(e,t,r,o,n=e){let i=new At(e,o,n),s=typeof t==="function"?t(H3()):t,a=Object.fromEntries(Object.entries(s).map(([u,d])=>{let f=d;f.setName(u);let m=f.build(i);return i[MR].push(...f.buildForeignKeys(m,i)),[u,m]})),c=Object.assign(i,a);if(c[he.Symbol.Columns]=a,c[he.Symbol.ExtraConfigColumns]=a,r)c[At.Symbol.ExtraConfigBuilder]=r;return c}var MR,At,qf=(e,t,r)=>Eme(e,t,r);var qo=v(()=>{$e();sr();V3();MR=Symbol.for("drizzle:SQLiteInlineForeignKeys");At=class At extends he{static[F]="SQLiteTable";static Symbol=Object.assign({},he.Symbol,{InlineForeignKeys:MR});[he.Symbol.Columns];[MR]=[];[he.Symbol.ExtraConfigBuilder]=void 0}});var kme,W3;var G3=v(()=>{$e();kme=class kme{constructor(e,t){this.name=e,this.value=t}static[F]="SQLiteCheckBuilder";brand;build(e){return new W3(e,this)}};W3=class W3{constructor(e,t){this.table=e,this.name=t.name,this.value=t.value}static[F]="SQLiteCheck";name;value}});function Fo(e){return new Q3(e,!1)}var Q3,Y3,X3;var e5=v(()=>{$e();Q3=class Q3{constructor(e,t){this.name=e,this.unique=t}static[F]="SQLiteIndexBuilderOn";on(...e){return new Y3(this.name,e,this.unique)}};Y3=class Y3{static[F]="SQLiteIndexBuilder";config;constructor(e,t,r){this.config={name:e,columns:t,unique:r,where:void 0}}where(e){return this.config.where=e,this}build(e){return new X3(this.config,e)}};X3=class X3{static[F]="SQLiteIndex";config;constructor(e,t){this.config={...e,table:t}}}});var Ime,t5;var r5=v(()=>{$e();qo();Ime=class Ime{static[F]="SQLitePrimaryKeyBuilder";columns;name;constructor(e,t){this.columns=e,this.name=t}build(e){return new t5(e,this.columns,this.name)}};t5=class t5{constructor(e,t,r){this.table=e,this.columns=t,this.name=r}static[F]="SQLitePrimaryKey";columns;name;getName(){return this.name??`${this.table[At.Symbol.Name]}_${this.columns.map((e)=>e.name).join("_")}_pk`}}});function In(e){if(oe(e,At))return[`${e[he.Symbol.BaseName]}`];if(oe(e,dt))return e._.usedTables??[];if(oe(e,_e))return e.usedTables??[];return[]}var $l=v(()=>{$e();Qt();En();sr();qo()});var eb;var n5=v(()=>{$e();Mo();ba();qo();sr();Sr();$l();eb=class eb extends vr{constructor(e,t,r,o){super();this.table=e,this.session=t,this.dialect=r,this.config={table:e,withList:o}}static[F]="SQLiteDelete";config;where(e){return this.config.where=e,this}orderBy(...e){if(typeof e[0]==="function"){let t=e[0](new Proxy(this.config.table[he.Symbol.Columns],new at({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),r=Array.isArray(t)?t:[t];this.config.orderBy=r}else{let t=e;this.config.orderBy=t}return this}limit(e){return this.config.limit=e,this}returning(e=this.table[At.Symbol.Columns]){return this.config.returning=sn(e),this}getSQL(){return this.dialect.buildDeleteQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e=!0){return this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0,void 0,{type:"delete",tables:In(this.config.table)})}prepare(){return this._prepare(!1)}run=(e)=>this._prepare().run(e);all=(e)=>this._prepare().all(e);get=(e)=>this._prepare().get(e);values=(e)=>this._prepare().values(e);async execute(e){return this._prepare().execute(e)}$dynamic(){return this}}});function Ame(e){return(e.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).map((r)=>r.toLowerCase()).join("_")}function Tme(e){return(e.replace(/['\u2019]/g,"").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g)??[]).reduce((r,o,n)=>{let i=n===0?o.toLowerCase():`${o[0].toUpperCase()}${o.slice(1)}`;return r+i},"")}function Rme(e){return e}var qR;var o5=v(()=>{$e();sr();qR=class qR{static[F]="CasingCache";cache={};cachedTables={};convert;constructor(e){this.convert=e==="snake_case"?Ame:e==="camelCase"?Tme:Rme}getColumnCasing(e){if(!e.keyAsName)return e.name;let t=e.table[he.Symbol.Schema]??"public",r=e.table[he.Symbol.OriginalName],o=`${t}.${r}.${e.name}`;if(!this.cache[o])this.cacheTable(e.table);return this.cache[o]}cacheTable(e){let t=e[he.Symbol.Schema]??"public",r=e[he.Symbol.OriginalName],o=`${t}.${r}`;if(!this.cachedTables[o]){for(let n of Object.values(e[he.Symbol.Columns])){let i=`${o}.${n.name}`;this.cache[i]=this.convert(n.name)}this.cachedTables[o]=!0}}clearCache(){this.cache={},this.cachedTables={}}}});var Ol,Ko,FR;var tb=v(()=>{$e();Ol=class Ol extends Error{static[F]="DrizzleError";constructor({message:e,cause:t}){super(e);this.name="DrizzleError",this.cause=t}};Ko=class Ko extends Error{constructor(e,t,r){super(`Failed query: ${e}
|
|
414
|
+
params: ${t}`);if(this.query=e,this.params=t,this.cause=r,Error.captureStackTrace(this,Ko),r)this.cause=r}};FR=class FR extends Ol{static[F]="TransactionRollbackError";constructor(){super({message:"Rollback"})}}});var i5=()=>{};var s5=()=>{};var a5=v(()=>{i5();s5()});var KR=v(()=>{RR();a5();Qt()});var JR=v(()=>{DR();ss();LR();BR();jR();ZR();UR()});var Jo;var Ff=v(()=>{$e();Qt();Jo=class Jo extends on{static[F]="SQLiteViewBase"}});var Cl,HR,VR;var rb=v(()=>{Mf();o5();_n();$e();tb();jf();KR();Qt();JR();qo();En();sr();Sr();Zo();Ff();Cl=class Cl{static[F]="SQLiteDialect";casing;constructor(e){this.casing=new qR(e?.casing)}escapeName(e){return`"${e.replace(/"/g,'""')}"`}escapeParam(e){return"?"}escapeString(e){return`'${e.replace(/'/g,"''")}'`}buildWithCTE(e){if(!e?.length)return;let t=[C`with `];for(let[r,o]of e.entries())if(t.push(C`${C.identifier(o._.alias)} as (${o._.sql})`),r<e.length-1)t.push(C`, `);return t.push(C` `),C.join(t)}buildDeleteQuery({table:e,where:t,returning:r,withList:o,limit:n,orderBy:i}){let s=this.buildWithCTE(o),a=r?C` returning ${this.buildSelection(r,{isSingleTable:!0})}`:void 0,c=t?C` where ${t}`:void 0,u=this.buildOrderBy(i),d=this.buildLimit(n);return C`${s}delete from ${e}${c}${a}${u}${d}`}buildUpdateSet(e,t){let r=e[he.Symbol.Columns],o=Object.keys(r).filter((i)=>t[i]!==void 0||r[i]?.onUpdateFn!==void 0),n=o.length;return C.join(o.flatMap((i,s)=>{let a=r[i],c=a.onUpdateFn?.(),u=t[i]??(oe(c,_e)?c:C.param(c,a)),d=C`${C.identifier(this.casing.getColumnCasing(a))} = ${u}`;if(s<n-1)return[d,C.raw(", ")];return[d]}))}buildUpdateQuery({table:e,set:t,where:r,returning:o,withList:n,joins:i,from:s,limit:a,orderBy:c}){let u=this.buildWithCTE(n),d=this.buildUpdateSet(e,t),f=s&&C.join([C.raw(" from "),this.buildFromTable(s)]),m=this.buildJoins(i),h=o?C` returning ${this.buildSelection(o,{isSingleTable:!0})}`:void 0,b=r?C` where ${r}`:void 0,y=this.buildOrderBy(c),S=this.buildLimit(a);return C`${u}update ${e} set ${d}${f}${m}${b}${h}${y}${S}`}buildSelection(e,{isSingleTable:t=!1}={}){let r=e.length,o=e.flatMap(({field:n},i)=>{let s=[];if(oe(n,_e.Aliased)&&n.isSelectionField)s.push(C.identifier(n.fieldAlias));else if(oe(n,_e.Aliased)||oe(n,_e)){let a=oe(n,_e.Aliased)?n.sql:n;if(t)s.push(new _e(a.queryChunks.map((c)=>{if(oe(c,He))return C.identifier(this.casing.getColumnCasing(c));return c})));else s.push(a);if(oe(n,_e.Aliased))s.push(C` as ${C.identifier(n.fieldAlias)}`)}else if(oe(n,He)){let a=n.table[he.Symbol.Name];if(n.columnType==="SQLiteNumericBigInt")if(t)s.push(C`cast(${C.identifier(this.casing.getColumnCasing(n))} as text)`);else s.push(C`cast(${C.identifier(a)}.${C.identifier(this.casing.getColumnCasing(n))} as text)`);else if(t)s.push(C.identifier(this.casing.getColumnCasing(n)));else s.push(C`${C.identifier(a)}.${C.identifier(this.casing.getColumnCasing(n))}`)}else if(oe(n,dt)){let a=Object.entries(n._.selectedFields);if(a.length===1){let c=a[0][1],u=oe(c,_e)?c.decoder:oe(c,He)?{mapFromDriverValue:(d)=>c.mapFromDriverValue(d)}:c.sql.decoder;if(u)n._.sql.decoder=u}s.push(n)}if(i<r-1)s.push(C`, `);return s});return C.join(o)}buildJoins(e){if(!e||e.length===0)return;let t=[];if(e)for(let[r,o]of e.entries()){if(r===0)t.push(C` `);let n=o.table,i=o.on?C` on ${o.on}`:void 0;if(oe(n,At)){let s=n[At.Symbol.Name],a=n[At.Symbol.Schema],c=n[At.Symbol.OriginalName],u=s===c?void 0:o.alias;t.push(C`${C.raw(o.joinType)} join ${a?C`${C.identifier(a)}.`:void 0}${C.identifier(c)}${u&&C` ${C.identifier(u)}`}${i}`)}else t.push(C`${C.raw(o.joinType)} join ${n}${i}`);if(r<e.length-1)t.push(C` `)}return C.join(t)}buildLimit(e){return typeof e==="object"||typeof e==="number"&&e>=0?C` limit ${e}`:void 0}buildOrderBy(e){let t=[];if(e){for(let[r,o]of e.entries())if(t.push(o),r<e.length-1)t.push(C`, `)}return t.length>0?C` order by ${C.join(t)}`:void 0}buildFromTable(e){if(oe(e,he)&&e[he.Symbol.IsAlias])return C`${C`${C.identifier(e[he.Symbol.Schema]??"")}.`.if(e[he.Symbol.Schema])}${C.identifier(e[he.Symbol.OriginalName])} ${C.identifier(e[he.Symbol.Name])}`;return e}buildSelectQuery({withList:e,fields:t,fieldsFlat:r,where:o,having:n,table:i,joins:s,orderBy:a,groupBy:c,limit:u,offset:d,distinct:f,setOperators:m}){let h=r??sn(t);for(let R of h)if(oe(R.field,He)&&es(R.field.table)!==(oe(i,dt)?i._.alias:oe(i,Jo)?i[ft].name:oe(i,_e)?void 0:es(i))&&!((B)=>s?.some(({alias:k})=>k===(B[he.Symbol.IsAlias]?es(B):B[he.Symbol.BaseName])))(R.field.table)){let B=es(R.field.table);throw Error(`Your "${R.path.join("->")}" field references a column "${B}"."${R.field.name}", but the table "${B}" is not part of the query! Did you forget to join it?`)}let b=!s||s.length===0,y=this.buildWithCTE(e),S=f?C` distinct`:void 0,x=this.buildSelection(h,{isSingleTable:b}),_=this.buildFromTable(i),A=this.buildJoins(s),O=o?C` where ${o}`:void 0,L=n?C` having ${n}`:void 0,z=[];if(c){for(let[R,B]of c.entries())if(z.push(B),R<c.length-1)z.push(C`, `)}let J=z.length>0?C` group by ${C.join(z)}`:void 0,P=this.buildOrderBy(a),W=this.buildLimit(u),ee=d?C` offset ${d}`:void 0,j=C`${y}select${S} ${x} from ${_}${A}${O}${J}${L}${P}${W}${ee}`;if(m.length>0)return this.buildSetOperations(j,m);return j}buildSetOperations(e,t){let[r,...o]=t;if(!r)throw Error("Cannot pass undefined values to any set operator");if(o.length===0)return this.buildSetOperationQuery({leftSelect:e,setOperator:r});return this.buildSetOperations(this.buildSetOperationQuery({leftSelect:e,setOperator:r}),o)}buildSetOperationQuery({leftSelect:e,setOperator:{type:t,isAll:r,rightSelect:o,limit:n,orderBy:i,offset:s}}){let a=C`${e.getSQL()} `,c=C`${o.getSQL()}`,u;if(i&&i.length>0){let h=[];for(let b of i)if(oe(b,yt))h.push(C.identifier(b.name));else if(oe(b,_e)){for(let y=0;y<b.queryChunks.length;y++){let S=b.queryChunks[y];if(oe(S,yt))b.queryChunks[y]=C.identifier(this.casing.getColumnCasing(S))}h.push(C`${b}`)}else h.push(C`${b}`);u=C` order by ${C.join(h,C`, `)}`}let d=typeof n==="object"||typeof n==="number"&&n>=0?C` limit ${n}`:void 0,f=C.raw(`${t} ${r?"all ":""}`),m=s?C` offset ${s}`:void 0;return C`${a}${f}${c}${u}${d}${m}`}buildInsertQuery({table:e,values:t,onConflict:r,returning:o,withList:n,select:i}){let s=[],a=e[he.Symbol.Columns],c=Object.entries(a).filter(([b,y])=>!y.shouldDisableInsert()),u=c.map(([,b])=>C.identifier(this.casing.getColumnCasing(b)));if(i){let b=t;if(oe(b,_e))s.push(b);else s.push(b.getSQL())}else{let b=t;s.push(C.raw("values "));for(let[y,S]of b.entries()){let x=[];for(let[_,A]of c){let O=S[_];if(O===void 0||oe(O,Ur)&&O.value===void 0){let L;if(A.default!==null&&A.default!==void 0)L=oe(A.default,_e)?A.default:C.param(A.default,A);else if(A.defaultFn!==void 0){let z=A.defaultFn();L=oe(z,_e)?z:C.param(z,A)}else if(!A.default&&A.onUpdateFn!==void 0){let z=A.onUpdateFn();L=oe(z,_e)?z:C.param(z,A)}else L=C`null`;x.push(L)}else x.push(O)}if(s.push(x),y<b.length-1)s.push(C`, `)}}let d=this.buildWithCTE(n),f=C.join(s),m=o?C` returning ${this.buildSelection(o,{isSingleTable:!0})}`:void 0,h=r?.length?C.join(r):void 0;return C`${d}insert into ${e} ${u} ${f}${h}${m}`}sqlToQuery(e,t){return e.toQuery({casing:this.casing,escapeName:this.escapeName,escapeParam:this.escapeParam,escapeString:this.escapeString,invokeSource:t})}buildRelationalQuery({fullSchema:e,schema:t,tableNamesMap:r,table:o,tableConfig:n,queryConfig:i,tableAlias:s,nestedQueryRelation:a,joinOn:c}){let u=[],d,f,m=[],h,b=[];if(i===!0)u=Object.entries(n.columns).map(([x,_])=>({dbKey:_.name,tsKey:x,field:ro(_,s),relationTableTsKey:void 0,isJson:!1,selection:[]}));else{let S=Object.fromEntries(Object.entries(n.columns).map(([z,J])=>[z,ro(J,s)]));if(i.where){let z=typeof i.where==="function"?i.where(S,l3()):i.where;h=z&&Uf(z,s)}let x=[],_=[];if(i.columns){let z=!1;for(let[J,P]of Object.entries(i.columns)){if(P===void 0)continue;if(J in n.columns){if(!z&&P===!0)z=!0;_.push(J)}}if(_.length>0)_=z?_.filter((J)=>i.columns?.[J]===!0):Object.keys(n.columns).filter((J)=>!_.includes(J))}else _=Object.keys(n.columns);for(let z of _){let J=n.columns[z];x.push({tsKey:z,value:J})}let A=[];if(i.with)A=Object.entries(i.with).filter((z)=>!!z[1]).map(([z,J])=>({tsKey:z,queryConfig:J,relation:n.relations[z]}));let O;if(i.extras){O=typeof i.extras==="function"?i.extras(S,{sql:C}):i.extras;for(let[z,J]of Object.entries(O))x.push({tsKey:z,value:OR(J,s)})}for(let{tsKey:z,value:J}of x)u.push({dbKey:oe(J,_e.Aliased)?J.fieldAlias:n.columns[z].name,tsKey:z,field:oe(J,He)?ro(J,s):J,relationTableTsKey:void 0,isJson:!1,selection:[]});let L=typeof i.orderBy==="function"?i.orderBy(S,u3()):i.orderBy??[];if(!Array.isArray(L))L=[L];m=L.map((z)=>{if(oe(z,He))return ro(z,s);return Uf(z,s)}),d=i.limit,f=i.offset;for(let{tsKey:z,queryConfig:J,relation:P}of A){let W=f3(t,r,P),ee=ha(P.referencedTable),j=r[ee],R=`${s}_${z}`,B=tt(...W.fields.map((I,q)=>je(ro(W.references[q],R),ro(I,s)))),k=this.buildRelationalQuery({fullSchema:e,schema:t,tableNamesMap:r,table:e[j],tableConfig:t[j],queryConfig:oe(P,is)?J===!0?{limit:1}:{...J,limit:1}:J,tableAlias:R,joinOn:B,nestedQueryRelation:P}),T=C`(${k.sql})`.as(z);u.push({dbKey:z,tsKey:z,field:T,relationTableTsKey:j,isJson:!0,selection:k.selection})}}if(u.length===0)throw new Ol({message:`No fields selected for table "${n.tsName}" ("${s}"). You need to have at least one item in "columns", "with" or "extras". If you need to select all columns, omit the "columns" key or set it to undefined.`});let y;if(h=tt(c,h),a){let S=C`json_array(${C.join(u.map(({field:A})=>oe(A,yt)?C.identifier(this.casing.getColumnCasing(A)):oe(A,_e.Aliased)?A.sql:A),C`, `)})`;if(oe(a,Bf))S=C`coalesce(json_group_array(${S}), json_array())`;let x=[{dbKey:"data",tsKey:"data",field:S.as("data"),isJson:!0,relationTableTsKey:n.tsName,selection:u}];if(d!==void 0||f!==void 0||m.length>0)y=this.buildSelectQuery({table:Zf(o,s),fields:{},fieldsFlat:[{path:[],field:C.raw("*")}],where:h,limit:d,offset:f,orderBy:m,setOperators:[]}),h=void 0,d=void 0,f=void 0,m=void 0;else y=Zf(o,s);y=this.buildSelectQuery({table:oe(y,At)?y:new dt(y,{},s),fields:{},fieldsFlat:x.map(({field:A})=>({path:[],field:oe(A,He)?ro(A,s):A})),joins:b,where:h,limit:d,offset:f,orderBy:m,setOperators:[]})}else y=this.buildSelectQuery({table:Zf(o,s),fields:{},fieldsFlat:u.map(({field:S})=>({path:[],field:oe(S,He)?ro(S,s):S})),joins:b,where:h,limit:d,offset:f,orderBy:m,setOperators:[]});return{tableTsKey:n.tsName,sql:y,selection:u}}};HR=class HR extends Cl{static[F]="SQLiteSyncDialect";migrate(e,t,r){let o=r===void 0?"__drizzle_migrations":typeof r==="string"?"__drizzle_migrations":r.migrationsTable??"__drizzle_migrations",n=C`
|
|
415
|
+
CREATE TABLE IF NOT EXISTS ${C.identifier(o)} (
|
|
416
|
+
id SERIAL PRIMARY KEY,
|
|
417
|
+
hash text NOT NULL,
|
|
418
|
+
created_at numeric
|
|
419
|
+
)
|
|
420
|
+
`;t.run(n);let s=t.values(C`SELECT id, hash, created_at FROM ${C.identifier(o)} ORDER BY created_at DESC LIMIT 1`)[0]??void 0;t.run(C`BEGIN`);try{for(let a of e)if(!s||Number(s[2])<a.folderMillis){for(let c of a.sql)t.run(C.raw(c));t.run(C`INSERT INTO ${C.identifier(o)} ("hash", "created_at") VALUES(${a.hash}, ${a.folderMillis})`)}t.run(C`COMMIT`)}catch(a){throw t.run(C`ROLLBACK`),a}}};VR=class VR extends Cl{static[F]="SQLiteAsyncDialect";async migrate(e,t,r){let o=r===void 0?"__drizzle_migrations":typeof r==="string"?"__drizzle_migrations":r.migrationsTable??"__drizzle_migrations",n=C`
|
|
421
|
+
CREATE TABLE IF NOT EXISTS ${C.identifier(o)} (
|
|
422
|
+
id SERIAL PRIMARY KEY,
|
|
423
|
+
hash text NOT NULL,
|
|
424
|
+
created_at numeric
|
|
425
|
+
)
|
|
426
|
+
`;await t.run(n);let s=(await t.values(C`SELECT id, hash, created_at FROM ${C.identifier(o)} ORDER BY created_at DESC LIMIT 1`))[0]??void 0;await t.transaction(async(a)=>{for(let c of e)if(!s||Number(s[2])<c.folderMillis){for(let u of c.sql)await a.run(C.raw(u));await a.run(C`INSERT INTO ${C.identifier(o)} ("hash", "created_at") VALUES(${c.hash}, ${c.folderMillis})`)}})}}});var WR;var c5=v(()=>{$e();WR=class WR{static[F]="TypedQueryBuilder";getSelectedFields(){return this._.selectedFields}}});function nb(e,t){return(r,o,...n)=>{let i=[o,...n].map((s)=>({type:e,isAll:t,rightSelect:s}));for(let s of i)if(!Df(r.getSelectedFields(),s.rightSelect.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return r.addSetOperators(i)}}var An,l5,GR,$me=()=>({union:Ome,unionAll:Cme,intersect:Pme,except:zme}),Ome,Cme,Pme,zme;var QR=v(()=>{$e();c5();Mo();ba();Qt();En();sr();Sr();Zo();$l();Ff();An=class An{static[F]="SQLiteSelectBuilder";fields;session;dialect;withList;distinct;constructor(e){this.fields=e.fields,this.session=e.session,this.dialect=e.dialect,this.withList=e.withList,this.distinct=e.distinct}from(e){let t=!!this.fields,r;if(this.fields)r=this.fields;else if(oe(e,dt))r=Object.fromEntries(Object.keys(e._.selectedFields).map((o)=>[o,e[o]]));else if(oe(e,Jo))r=e[ft].selectedFields;else if(oe(e,_e))r={};else r=Hy(e);return new GR({table:e,fields:r,isPartialSelect:t,session:this.session,dialect:this.dialect,withList:this.withList,distinct:this.distinct})}};l5=class l5 extends WR{static[F]="SQLiteSelectQueryBuilder";_;config;joinsNotNullableMap;tableName;isPartialSelect;session;dialect;cacheConfig=void 0;usedTables=new Set;constructor({table:e,fields:t,isPartialSelect:r,session:o,dialect:n,withList:i,distinct:s}){super();this.config={withList:i,table:e,fields:{...t},distinct:s,setOperators:[]},this.isPartialSelect=r,this.session=o,this.dialect=n,this._={selectedFields:t,config:this.config},this.tableName=Lf(e),this.joinsNotNullableMap=typeof this.tableName==="string"?{[this.tableName]:!0}:{};for(let a of In(e))this.usedTables.add(a)}getUsedTables(){return[...this.usedTables]}createJoin(e){return(t,r)=>{let o=this.tableName,n=Lf(t);for(let i of In(t))this.usedTables.add(i);if(typeof n==="string"&&this.config.joins?.some((i)=>i.alias===n))throw Error(`Alias "${n}" is already used in this query`);if(!this.isPartialSelect){if(Object.keys(this.joinsNotNullableMap).length===1&&typeof o==="string")this.config.fields={[o]:this.config.fields};if(typeof n==="string"&&!oe(t,_e)){let i=oe(t,dt)?t._.selectedFields:oe(t,on)?t[ft].selectedFields:t[he.Symbol.Columns];this.config.fields[n]=i}}if(typeof r==="function")r=r(new Proxy(this.config.fields,new at({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));if(!this.config.joins)this.config.joins=[];if(this.config.joins.push({on:r,table:t,joinType:e,alias:n}),typeof n==="string")switch(e){case"left":{this.joinsNotNullableMap[n]=!1;break}case"right":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([i])=>[i,!1])),this.joinsNotNullableMap[n]=!0;break}case"cross":case"inner":{this.joinsNotNullableMap[n]=!0;break}case"full":{this.joinsNotNullableMap=Object.fromEntries(Object.entries(this.joinsNotNullableMap).map(([i])=>[i,!1])),this.joinsNotNullableMap[n]=!1;break}}return this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");crossJoin=this.createJoin("cross");createSetOperator(e,t){return(r)=>{let o=typeof r==="function"?r($me()):r;if(!Df(this.getSelectedFields(),o.getSelectedFields()))throw Error("Set operator error (union / intersect / except): selected fields are not the same or are in a different order");return this.config.setOperators.push({type:e,isAll:t,rightSelect:o}),this}}union=this.createSetOperator("union",!1);unionAll=this.createSetOperator("union",!0);intersect=this.createSetOperator("intersect",!1);except=this.createSetOperator("except",!1);addSetOperators(e){return this.config.setOperators.push(...e),this}where(e){if(typeof e==="function")e=e(new Proxy(this.config.fields,new at({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));return this.config.where=e,this}having(e){if(typeof e==="function")e=e(new Proxy(this.config.fields,new at({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})));return this.config.having=e,this}groupBy(...e){if(typeof e[0]==="function"){let t=e[0](new Proxy(this.config.fields,new at({sqlAliasedBehavior:"alias",sqlBehavior:"sql"})));this.config.groupBy=Array.isArray(t)?t:[t]}else this.config.groupBy=e;return this}orderBy(...e){if(typeof e[0]==="function"){let t=e[0](new Proxy(this.config.fields,new at({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),r=Array.isArray(t)?t:[t];if(this.config.setOperators.length>0)this.config.setOperators.at(-1).orderBy=r;else this.config.orderBy=r}else{let t=e;if(this.config.setOperators.length>0)this.config.setOperators.at(-1).orderBy=t;else this.config.orderBy=t}return this}limit(e){if(this.config.setOperators.length>0)this.config.setOperators.at(-1).limit=e;else this.config.limit=e;return this}offset(e){if(this.config.setOperators.length>0)this.config.setOperators.at(-1).offset=e;else this.config.offset=e;return this}getSQL(){return this.dialect.buildSelectQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}as(e){let t=[];if(t.push(...In(this.config.table)),this.config.joins)for(let r of this.config.joins)t.push(...In(r.table));return new Proxy(new dt(this.getSQL(),this.config.fields,e,!1,[...new Set(t)]),new at({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}getSelectedFields(){return new Proxy(this.config.fields,new at({alias:this.tableName,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}$dynamic(){return this}};GR=class GR extends l5{static[F]="SQLiteSelect";_prepare(e=!0){if(!this.session)throw Error("Cannot execute a query on a query builder. Please use a database instance instead.");let t=sn(this.config.fields),r=this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),t,"all",!0,void 0,{type:"select",tables:[...this.usedTables]},this.cacheConfig);return r.joinsNotNullableMap=this.joinsNotNullableMap,r}$withCache(e){return this.cacheConfig=e===void 0?{config:{},enable:!0,autoInvalidate:!0}:e===!1?{enable:!1}:{enable:!0,autoInvalidate:!0,...e},this}prepare(){return this._prepare(!1)}run=(e)=>this._prepare().run(e);all=(e)=>this._prepare().all(e);get=(e)=>this._prepare().get(e);values=(e)=>this._prepare().values(e);async execute(){return this.all()}};UF(GR,[vr]);Ome=nb("union",!1),Cme=nb("union",!0),Pme=nb("intersect",!1),zme=nb("except",!1)});var Sa;var ob=v(()=>{$e();ba();rb();En();QR();Sa=class Sa{static[F]="SQLiteQueryBuilder";dialect;dialectConfig;constructor(e){this.dialect=oe(e,Cl)?e:void 0,this.dialectConfig=oe(e,Cl)?void 0:e}$with=(e,t)=>{let r=this;return{as:(n)=>{if(typeof n==="function")n=n(r);return new Proxy(new Pf(n.getSQL(),t??("getSelectedFields"in n?n.getSelectedFields()??{}:{}),e,!0),new at({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}};with(...e){let t=this;function r(n){return new An({fields:n??void 0,session:void 0,dialect:t.getDialect(),withList:e})}function o(n){return new An({fields:n??void 0,session:void 0,dialect:t.getDialect(),withList:e,distinct:!0})}return{select:r,selectDistinct:o}}select(e){return new An({fields:e??void 0,session:void 0,dialect:this.getDialect()})}selectDistinct(e){return new An({fields:e??void 0,session:void 0,dialect:this.getDialect(),distinct:!0})}getDialect(){if(!this.dialect)this.dialect=new HR(this.dialectConfig);return this.dialect}}});var ib,YR;var u5=v(()=>{$e();Mo();Qt();qo();sr();Sr();$l();ob();ib=class ib{constructor(e,t,r,o){this.table=e,this.session=t,this.dialect=r,this.withList=o}static[F]="SQLiteInsertBuilder";values(e){if(e=Array.isArray(e)?e:[e],e.length===0)throw Error("values() must be called with at least one value");let t=e.map((r)=>{let o={},n=this.table[he.Symbol.Columns];for(let i of Object.keys(r)){let s=r[i];o[i]=oe(s,_e)?s:new Ur(s,n[i])}return o});return new YR(this.table,t,this.session,this.dialect,this.withList)}select(e){let t=typeof e==="function"?e(new Sa):e;if(!oe(t,_e)&&!Df(this.table[Fy],t._.selectedFields))throw Error("Insert select error: selected fields are not the same or are in a different order compared to the table definition");return new YR(this.table,t,this.session,this.dialect,this.withList,!0)}};YR=class YR extends vr{constructor(e,t,r,o,n,i){super();this.session=r,this.dialect=o,this.config={table:e,values:t,withList:n,select:i}}static[F]="SQLiteInsert";config;returning(e=this.config.table[At.Symbol.Columns]){return this.config.returning=sn(e),this}onConflictDoNothing(e={}){if(!this.config.onConflict)this.config.onConflict=[];if(e.target===void 0)this.config.onConflict.push(C` on conflict do nothing`);else{let t=Array.isArray(e.target)?C`${e.target}`:C`${[e.target]}`,r=e.where?C` where ${e.where}`:C``;this.config.onConflict.push(C` on conflict ${t} do nothing${r}`)}return this}onConflictDoUpdate(e){if(e.where&&(e.targetWhere||e.setWhere))throw Error('You cannot use both "where" and "targetWhere"/"setWhere" at the same time - "where" is deprecated, use "targetWhere" or "setWhere" instead.');if(!this.config.onConflict)this.config.onConflict=[];let t=e.where?C` where ${e.where}`:void 0,r=e.targetWhere?C` where ${e.targetWhere}`:void 0,o=e.setWhere?C` where ${e.setWhere}`:void 0,n=Array.isArray(e.target)?C`${e.target}`:C`${[e.target]}`,i=this.dialect.buildUpdateSet(this.config.table,Jy(this.config.table,e.set));return this.config.onConflict.push(C` on conflict ${n}${r} do update set ${i}${t}${o}`),this}getSQL(){return this.dialect.buildInsertQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e=!0){return this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0,void 0,{type:"insert",tables:In(this.config.table)})}prepare(){return this._prepare(!1)}run=(e)=>this._prepare().run(e);all=(e)=>this._prepare().all(e);get=(e)=>this._prepare().get(e);values=(e)=>this._prepare().values(e);async execute(){return this.config.returning?this.all():this.run()}$dynamic(){return this}}});var sb,d5;var f5=v(()=>{$e();Mo();ba();qo();En();sr();Sr();Zo();$l();Ff();sb=class sb{constructor(e,t,r,o){this.table=e,this.session=t,this.dialect=r,this.withList=o}static[F]="SQLiteUpdateBuilder";set(e){return new d5(this.table,Jy(this.table,e),this.session,this.dialect,this.withList)}};d5=class d5 extends vr{constructor(e,t,r,o,n){super();this.session=r,this.dialect=o,this.config={set:t,table:e,withList:n,joins:[]}}static[F]="SQLiteUpdate";config;from(e){return this.config.from=e,this}createJoin(e){return(t,r)=>{let o=Lf(t);if(typeof o==="string"&&this.config.joins.some((n)=>n.alias===o))throw Error(`Alias "${o}" is already used in this query`);if(typeof r==="function"){let n=this.config.from?oe(t,At)?t[he.Symbol.Columns]:oe(t,dt)?t._.selectedFields:oe(t,Jo)?t[ft].selectedFields:void 0:void 0;r=r(new Proxy(this.config.table[he.Symbol.Columns],new at({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})),n&&new Proxy(n,new at({sqlAliasedBehavior:"sql",sqlBehavior:"sql"})))}return this.config.joins.push({on:r,table:t,joinType:e,alias:o}),this}}leftJoin=this.createJoin("left");rightJoin=this.createJoin("right");innerJoin=this.createJoin("inner");fullJoin=this.createJoin("full");where(e){return this.config.where=e,this}orderBy(...e){if(typeof e[0]==="function"){let t=e[0](new Proxy(this.config.table[he.Symbol.Columns],new at({sqlAliasedBehavior:"alias",sqlBehavior:"sql"}))),r=Array.isArray(t)?t:[t];this.config.orderBy=r}else{let t=e;this.config.orderBy=t}return this}limit(e){return this.config.limit=e,this}returning(e=this.config.table[At.Symbol.Columns]){return this.config.returning=sn(e),this}getSQL(){return this.dialect.buildUpdateQuery(this.config)}toSQL(){let{typings:e,...t}=this.dialect.sqlToQuery(this.getSQL());return t}_prepare(e=!0){return this.session[e?"prepareOneTimeQuery":"prepareQuery"](this.dialect.sqlToQuery(this.getSQL()),this.config.returning,this.config.returning?"all":"run",!0,void 0,{type:"insert",tables:In(this.config.table)})}prepare(){return this._prepare(!1)}run=(e)=>this._prepare().run(e);all=(e)=>this._prepare().all(e);get=(e)=>this._prepare().get(e);values=(e)=>this._prepare().values(e);async execute(){return this.config.returning?this.all():this.run()}$dynamic(){return this}}});var XR=v(()=>{n5();u5();ob();QR();f5()});var Kf;var p5=v(()=>{$e();Qt();Kf=class Kf extends _e{constructor(e){super(Kf.buildEmbeddedCount(e.source,e.filters).queryChunks);this.params=e,this.session=e.session,this.sql=Kf.buildCount(e.source,e.filters)}sql;static[F]="SQLiteCountBuilderAsync";[Symbol.toStringTag]="SQLiteCountBuilderAsync";session;static buildEmbeddedCount(e,t){return C`(select count(*) from ${e}${C.raw(" where ").if(t)}${t})`}static buildCount(e,t){return C`select count(*) from ${e}${C.raw(" where ").if(t)}${t}`}then(e,t){return Promise.resolve(this.session.count(this.sql)).then(e,t)}catch(e){return this.then(void 0,e)}finally(e){return this.then((t)=>(e?.(),t),(t)=>{throw e?.(),t})}}});var t$,ab,e$;var m5=v(()=>{$e();Mo();jf();t$=class t${constructor(e,t,r,o,n,i,s,a){this.mode=e,this.fullSchema=t,this.schema=r,this.tableNamesMap=o,this.table=n,this.tableConfig=i,this.dialect=s,this.session=a}static[F]="SQLiteAsyncRelationalQueryBuilder";findMany(e){return this.mode==="sync"?new e$(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?e:{},"many"):new ab(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?e:{},"many")}findFirst(e){return this.mode==="sync"?new e$(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},"first"):new ab(this.fullSchema,this.schema,this.tableNamesMap,this.table,this.tableConfig,this.dialect,this.session,e?{...e,limit:1}:{limit:1},"first")}};ab=class ab extends vr{constructor(e,t,r,o,n,i,s,a,c){super();this.fullSchema=e,this.schema=t,this.tableNamesMap=r,this.table=o,this.tableConfig=n,this.dialect=i,this.session=s,this.config=a,this.mode=c}static[F]="SQLiteAsyncRelationalQuery";mode;getSQL(){return this.dialect.buildRelationalQuery({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName}).sql}_prepare(e=!1){let{query:t,builtQuery:r}=this._toSQL();return this.session[e?"prepareOneTimeQuery":"prepareQuery"](r,void 0,this.mode==="first"?"get":"all",!0,(o,n)=>{let i=o.map((s)=>Qy(this.schema,this.tableConfig,s,t.selection,n));if(this.mode==="first")return i[0];return i})}prepare(){return this._prepare(!1)}_toSQL(){let e=this.dialect.buildRelationalQuery({fullSchema:this.fullSchema,schema:this.schema,tableNamesMap:this.tableNamesMap,table:this.table,tableConfig:this.tableConfig,queryConfig:this.config,tableAlias:this.tableConfig.tsName}),t=this.dialect.sqlToQuery(e.sql);return{query:e,builtQuery:t}}toSQL(){return this._toSQL().builtQuery}executeRaw(){if(this.mode==="first")return this._prepare(!1).get();return this._prepare(!1).all()}async execute(){return this.executeRaw()}};e$=class e$ extends ab{static[F]="SQLiteSyncRelationalQuery";sync(){return this.executeRaw()}}});var Pl;var h5=v(()=>{$e();Mo();Pl=class Pl extends vr{constructor(e,t,r,o,n){super();this.execute=e,this.getSQL=t,this.dialect=o,this.mapBatchResult=n,this.config={action:r}}static[F]="SQLiteRaw";config;getQuery(){return{...this.dialect.sqlToQuery(this.getSQL()),method:this.config.action}}mapResult(e,t){return t?this.mapBatchResult(e):e}_prepare(){return this}isResponseInArrayMode(){return!1}}});var Jf;var cb=v(()=>{$e();ba();Qt();XR();En();p5();m5();h5();Jf=class Jf{constructor(e,t,r,o){this.resultKind=e,this.dialect=t,this.session=r,this._=o?{schema:o.schema,fullSchema:o.fullSchema,tableNamesMap:o.tableNamesMap}:{schema:void 0,fullSchema:{},tableNamesMap:{}},this.query={};let n=this.query;if(this._.schema)for(let[i,s]of Object.entries(this._.schema))n[i]=new t$(e,o.fullSchema,this._.schema,this._.tableNamesMap,o.fullSchema[i],s,t,r);this.$cache={invalidate:async(i)=>{}}}static[F]="BaseSQLiteDatabase";query;$with=(e,t)=>{let r=this;return{as:(n)=>{if(typeof n==="function")n=n(new Sa(r.dialect));return new Proxy(new Pf(n.getSQL(),t??("getSelectedFields"in n?n.getSelectedFields()??{}:{}),e,!0),new at({alias:e,sqlAliasedBehavior:"alias",sqlBehavior:"error"}))}}};$count(e,t){return new Kf({source:e,filters:t,session:this.session})}with(...e){let t=this;function r(a){return new An({fields:a??void 0,session:t.session,dialect:t.dialect,withList:e})}function o(a){return new An({fields:a??void 0,session:t.session,dialect:t.dialect,withList:e,distinct:!0})}function n(a){return new sb(a,t.session,t.dialect,e)}function i(a){return new ib(a,t.session,t.dialect,e)}function s(a){return new eb(a,t.session,t.dialect,e)}return{select:r,selectDistinct:o,update:n,insert:i,delete:s}}select(e){return new An({fields:e??void 0,session:this.session,dialect:this.dialect})}selectDistinct(e){return new An({fields:e??void 0,session:this.session,dialect:this.dialect,distinct:!0})}update(e){return new sb(e,this.session,this.dialect)}$cache;insert(e){return new ib(e,this.session,this.dialect)}delete(e){return new eb(e,this.session,this.dialect)}run(e){let t=typeof e==="string"?C.raw(e):e.getSQL();if(this.resultKind==="async")return new Pl(async()=>this.session.run(t),()=>t,"run",this.dialect,this.session.extractRawRunValueFromBatchResult.bind(this.session));return this.session.run(t)}all(e){let t=typeof e==="string"?C.raw(e):e.getSQL();if(this.resultKind==="async")return new Pl(async()=>this.session.all(t),()=>t,"all",this.dialect,this.session.extractRawAllValueFromBatchResult.bind(this.session));return this.session.all(t)}get(e){let t=typeof e==="string"?C.raw(e):e.getSQL();if(this.resultKind==="async")return new Pl(async()=>this.session.get(t),()=>t,"get",this.dialect,this.session.extractRawGetValueFromBatchResult.bind(this.session));return this.session.get(t)}values(e){let t=typeof e==="string"?C.raw(e):e.getSQL();if(this.resultKind==="async")return new Pl(async()=>this.session.values(t),()=>t,"values",this.dialect,this.session.extractRawValuesValueFromBatchResult.bind(this.session));return this.session.values(t)}transaction(e,t){return this.session.transaction(e,t)}}});async function r$(e,t){let r=`${e}-${JSON.stringify(t)}`,n=new TextEncoder().encode(r),i=await crypto.subtle.digest("SHA-256",n);return[...new Uint8Array(i)].map((c)=>c.toString(16).padStart(2,"0")).join("")}var g5,Hf;var n$=v(()=>{$e();g5=class g5{static[F]="Cache"};Hf=class Hf extends g5{strategy(){return"all"}static[F]="NoopCache";async get(e){return}async put(e,t,r,o){}async onMutate(e){}}});var y5=v(()=>{n$()});function lb(e,t){return new Proxy(e,new ya(t,!1))}var b5=v(()=>{Mf()});var S5,o$,i$,s$;var a$=v(()=>{n$();$e();tb();Mo();cb();S5=class S5 extends vr{constructor(e){super();this.resultCb=e}static[F]="ExecuteResultSync";async execute(){return this.resultCb()}sync(){return this.resultCb()}};o$=class o${constructor(e,t,r,o,n,i){if(this.mode=e,this.executeMethod=t,this.query=r,this.cache=o,this.queryMetadata=n,this.cacheConfig=i,o&&o.strategy()==="all"&&i===void 0)this.cacheConfig={enable:!0,autoInvalidate:!0};if(!this.cacheConfig?.enable)this.cacheConfig=void 0}static[F]="PreparedQuery";joinsNotNullableMap;async queryWithCache(e,t,r){if(this.cache===void 0||oe(this.cache,Hf)||this.queryMetadata===void 0)try{return await r()}catch(o){throw new Ko(e,t,o)}if(this.cacheConfig&&!this.cacheConfig.enable)try{return await r()}catch(o){throw new Ko(e,t,o)}if((this.queryMetadata.type==="insert"||this.queryMetadata.type==="update"||this.queryMetadata.type==="delete")&&this.queryMetadata.tables.length>0)try{let[o]=await Promise.all([r(),this.cache.onMutate({tables:this.queryMetadata.tables})]);return o}catch(o){throw new Ko(e,t,o)}if(!this.cacheConfig)try{return await r()}catch(o){throw new Ko(e,t,o)}if(this.queryMetadata.type==="select"){let o=await this.cache.get(this.cacheConfig.tag??await r$(e,t),this.queryMetadata.tables,this.cacheConfig.tag!==void 0,this.cacheConfig.autoInvalidate);if(o===void 0){let n;try{n=await r()}catch(i){throw new Ko(e,t,i)}return await this.cache.put(this.cacheConfig.tag??await r$(e,t),n,this.cacheConfig.autoInvalidate?this.queryMetadata.tables:[],this.cacheConfig.tag!==void 0,this.cacheConfig.config),n}return o}try{return await r()}catch(o){throw new Ko(e,t,o)}}getQuery(){return this.query}mapRunResult(e,t){return e}mapAllResult(e,t){throw Error("Not implemented")}mapGetResult(e,t){throw Error("Not implemented")}execute(e){if(this.mode==="async")return this[this.executeMethod](e);return new S5(()=>this[this.executeMethod](e))}mapResult(e,t){switch(this.executeMethod){case"run":return this.mapRunResult(e,t);case"all":return this.mapAllResult(e,t);case"get":return this.mapGetResult(e,t)}}};i$=class i${constructor(e){this.dialect=e}static[F]="SQLiteSession";prepareOneTimeQuery(e,t,r,o,n,i,s){return this.prepareQuery(e,t,r,o,n,i,s)}run(e){let t=this.dialect.sqlToQuery(e);try{return this.prepareOneTimeQuery(t,void 0,"run",!1).run()}catch(r){throw new Ol({cause:r,message:`Failed to run the query '${t.sql}'`})}}extractRawRunValueFromBatchResult(e){return e}all(e){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(e),void 0,"run",!1).all()}extractRawAllValueFromBatchResult(e){throw Error("Not implemented")}get(e){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(e),void 0,"run",!1).get()}extractRawGetValueFromBatchResult(e){throw Error("Not implemented")}values(e){return this.prepareOneTimeQuery(this.dialect.sqlToQuery(e),void 0,"run",!1).values()}async count(e){return(await this.values(e))[0][0]}extractRawValuesValueFromBatchResult(e){throw Error("Not implemented")}};s$=class s$ extends Jf{constructor(e,t,r,o,n=0){super(e,t,r,o);this.schema=o,this.nestedIndex=n}static[F]="SQLiteTransaction";rollback(){throw new FR}}});var c$,Nme,Dme,ub;var v5=v(()=>{$e();ba();Sr();ob();qo();Ff();c$=class c${constructor(e){this.name=e}static[F]="SQLiteViewBuilderCore";config={}};Nme=class Nme extends c${static[F]="SQLiteViewBuilder";as(e){if(typeof e==="function")e=e(new Sa);let t=new at({alias:this.name,sqlBehavior:"error",sqlAliasedBehavior:"alias",replaceOriginalName:!0}),r=e.getSelectedFields();return new Proxy(new ub({config:{name:this.name,schema:void 0,selectedFields:r,query:e.getSQL().inlineParams()}}),t)}};Dme=class Dme extends c${static[F]="SQLiteManualViewBuilder";columns;constructor(e,t){super(e);this.columns=Hy(qf(e,t))}existing(){return new Proxy(new ub({config:{name:this.name,schema:void 0,selectedFields:this.columns,query:void 0}}),new at({alias:this.name,sqlBehavior:"error",sqlAliasedBehavior:"alias",replaceOriginalName:!0}))}as(e){return new Proxy(new ub({config:{name:this.name,schema:void 0,selectedFields:this.columns,query:e.inlineParams()}}),new at({alias:this.name,sqlBehavior:"error",sqlAliasedBehavior:"alias",replaceOriginalName:!0}))}};ub=class ub extends Jo{static[F]="SQLiteView";constructor({config:e}){super(e)}}});var db=v(()=>{b5();G3();JR();cb();rb();PR();e5();r5();XR();a$();qo();NR();$l();v5()});function w5(e){return Object.keys(e).reduce((t,r)=>{if(Object.prototype.propertyIsEnumerable.call(e,r))t[r]=e[r];return t},{})}function fb(e){if(typeof ArrayBuffer<"u"&&e instanceof ArrayBuffer){if(typeof Buffer<"u"){if(!(e instanceof Buffer))return Buffer.from(e);return e}if(typeof TextDecoder<"u")return new TextDecoder().decode(e);throw Error("TextDecoder is not available. Please provide either Buffer or TextDecoder polyfill.")}return e}var pb,l$,x5;var u$=v(()=>{y5();$e();Vy();Qt();db();a$();Sr();pb=class pb extends i${constructor(e,t,r,o,n){super(t);this.client=e,this.schema=r,this.options=o,this.tx=n,this.logger=o.logger??new IR,this.cache=o.cache??new Hf}static[F]="LibSQLSession";logger;cache;prepareQuery(e,t,r,o,n,i,s){return new x5(this.client,e,this.logger,this.cache,i,s,t,this.tx,r,o,n)}async batch(e){let t=[],r=[];for(let n of e){let i=n._prepare(),s=i.getQuery();t.push(i),r.push({sql:s.sql,args:s.params})}return(await this.client.batch(r)).map((n,i)=>t[i].mapResult(n,!0))}async migrate(e){let t=[],r=[];for(let n of e){let i=n._prepare(),s=i.getQuery();t.push(i),r.push({sql:s.sql,args:s.params})}return(await this.client.migrate(r)).map((n,i)=>t[i].mapResult(n,!0))}async transaction(e,t){let r=await this.client.transaction(),o=new pb(this.client,this.dialect,this.schema,this.options,r),n=new l$("async",this.dialect,o,this.schema);try{let i=await e(n);return await r.commit(),i}catch(i){throw await r.rollback(),i}}extractRawAllValueFromBatchResult(e){return e.rows}extractRawGetValueFromBatchResult(e){return e.rows[0]}extractRawValuesValueFromBatchResult(e){return e.rows}};l$=class l$ extends s${static[F]="LibSQLTransaction";async transaction(e){let t=`sp${this.nestedIndex}`,r=new l$("async",this.dialect,this.session,this.schema,this.nestedIndex+1);await this.session.run(C.raw(`savepoint ${t}`));try{let o=await e(r);return await this.session.run(C.raw(`release savepoint ${t}`)),o}catch(o){throw await this.session.run(C.raw(`rollback to savepoint ${t}`)),o}}};x5=class x5 extends o${constructor(e,t,r,o,n,i,s,a,c,u,d){super("async",c,t,o,n,i);this.client=e,this.logger=r,this.fields=s,this.tx=a,this._isResponseInArrayMode=u,this.customResultMapper=d,this.customResultMapper=d,this.fields=s}static[F]="LibSQLPreparedQuery";async run(e){let t=Nf(this.query.params,e??{});return this.logger.logQuery(this.query.sql,t),await this.queryWithCache(this.query.sql,t,async()=>{let r={sql:this.query.sql,args:t};return this.tx?this.tx.execute(r):this.client.execute(r)})}async all(e){let{fields:t,logger:r,query:o,tx:n,client:i,customResultMapper:s}=this;if(!t&&!s){let c=Nf(o.params,e??{});return r.logQuery(o.sql,c),await this.queryWithCache(o.sql,c,async()=>{let u={sql:o.sql,args:c};return(n?n.execute(u):i.execute(u)).then(({rows:d})=>this.mapAllResult(d))})}let a=await this.values(e);return this.mapAllResult(a)}mapAllResult(e,t){if(t)e=e.rows;if(!this.fields&&!this.customResultMapper)return e.map((r)=>w5(r));if(this.customResultMapper)return this.customResultMapper(e,fb);return e.map((r)=>_R(this.fields,Array.prototype.slice.call(r).map((o)=>fb(o)),this.joinsNotNullableMap))}async get(e){let{fields:t,logger:r,query:o,tx:n,client:i,customResultMapper:s}=this;if(!t&&!s){let c=Nf(o.params,e??{});return r.logQuery(o.sql,c),await this.queryWithCache(o.sql,c,async()=>{let u={sql:o.sql,args:c};return(n?n.execute(u):i.execute(u)).then(({rows:d})=>this.mapGetResult(d))})}let a=await this.values(e);return this.mapGetResult(a)}mapGetResult(e,t){if(t)e=e.rows;let r=e[0];if(!this.fields&&!this.customResultMapper)return w5(r);if(!r)return;if(this.customResultMapper)return this.customResultMapper(e,fb);return _R(this.fields,Array.prototype.slice.call(r).map((o)=>fb(o)),this.joinsNotNullableMap)}async values(e){let t=Nf(this.query.params,e??{});return this.logger.logQuery(this.query.sql,t),await this.queryWithCache(this.query.sql,t,async()=>{let r={sql:this.query.sql,args:t};return(this.tx?this.tx.execute(r):this.client.execute(r)).then(({rows:o})=>o)})}isResponseInArrayMode(){return this._isResponseInArrayMode}}});function zl(e,t={}){let r=new VR({casing:t.casing}),o;if(t.logger===!0)o=new kR;else if(t.logger!==!1)o=t.logger;let n;if(t.schema){let a=d3(t.schema,p3);n={fullSchema:t.schema,schema:a.tables,tableNamesMap:a.tableNamesMap}}let i=new pb(e,r,n,{logger:o,cache:t.cache},void 0),s=new _5("async",r,i,n);if(s.$client=e,s.$cache=t.cache,s.$cache)s.$cache.invalidate=t.cache?.onMutate;return s}var _5;var E5=v(()=>{$e();Vy();jf();cb();rb();u$();_5=class _5 extends Jf{static[F]="LibSQLDatabase";async batch(e){return this.session.batch(e)}}});function mb(...e){if(typeof e[0]==="string"){let t=Il({url:e[0]});return zl(t,e[1])}if(MF(e[0])){let{connection:t,client:r,...o}=e[0];if(r)return zl(r,o);let n=typeof t==="string"?Il({url:t}):Il(t);return zl(n,o)}return zl(e[0],e[1])}var k5=v(()=>{fR();Sr();E5();((e)=>{function t(r){return zl({},r)}e.mock=t})(mb||(mb={}))});var I5=v(()=>{k5();u$()});function Lme(){return new Promise((e)=>setTimeout(e,0))}function jme(){if(d$)return;d$=!0,setTimeout(()=>{d$=!1,f$=performance.now()},0)}async function Vf(e=Bme){if(jme(),performance.now()-f$<e)return;await Lme(),f$=performance.now()}var Bme=50,f$,d$=!1;var A5=v(()=>{f$=performance.now()});function T5(e){if(e.authToken!==void 0)return e.authToken;if(e.authTokenEnv===void 0)return;return process.env[e.authTokenEnv]}function qme(e){return e instanceof Ce&&/^SQLITE_(?:BUSY|LOCKED)$/u.test(e.code)}async function hb(e,t){let r=Date.now()+(t.budgetMs??Zme),o=async(n)=>{if(t.isClosed())throw new Ce("The client is closed","CLIENT_CLOSED");try{return await e()}catch(i){if(t.isClosed()||!qme(i))throw i;await t.afterRefusal?.();let s=Math.min(Ume*2**(n-1),Mme),a=s/2+Math.random()*(s/2);if(t.isClosed()||Date.now()+a>=r)throw i;if(await new Promise((c)=>setTimeout(c,a)),t.isClosed()||Date.now()>=r)throw i;return o(n+1)}};return o(1)}function p$(e,t={}){let r=Il({...e,...e.url.startsWith("file:")?{timeout:0}:{}});if(e.url.startsWith("file:")&&e.syncUrl===void 0){let o=r.transaction.bind(r),n=()=>r.closed,i=t.contentionRetryBudgetMs,s=r.execute.bind(r),a=r.batch.bind(r),c=r.migrate.bind(r),u={isClosed:n,budgetMs:i,afterRefusal:async()=>{await Promise.resolve(r.reconnect())}};async function d(f,m){return await Vf(),hb(()=>typeof f==="string"?s(f,m):s(f),u)}r.execute=d,r.batch=async(f,m)=>(await Vf(),hb(()=>a(f,m),u)),r.migrate=async(f)=>(await Vf(),hb(()=>c(f),u)),r.transaction=async(f)=>(await Vf(),hb(()=>o(f),u))}return r}function gb(e){let{url:t,schema:r}=e,o=T5(e),n={contentionRetryBudgetMs:e.contentionRetryBudgetMs},i=o?p$({url:t,authToken:o},n):p$({url:t},n);return{db:mb(i,{schema:r}),client:i,url:t}}async function yb(e,t){if(!t.startsWith("file:"))return;for(let r of["PRAGMA busy_timeout = 0","PRAGMA journal_mode = WAL"])await e.execute(r)}var Zme=5000,Ume=5,Mme=40;var m$=v(()=>{fR();I5();A5()});var R5=v(()=>{AT();m$()});var h$=v(()=>{m$();R5()});var g$=v(()=>{Mf();Uy();_n();$e();tb();Vy();Mo();jf();KR();En();sr();Sr();Zo()});var Y,Me;var y$=v(()=>{db();g$();af();Y=qf("job_queue",{id:pt("id").primaryKey().$defaultFn(()=>zo()),type:pt("type").notNull(),data:pt("data").notNull(),result:pt("result",{mode:"json"}),progress:pt("progress",{mode:"json"}).$type(),source:pt("source"),metadata:pt("metadata",{mode:"json"}).$type().notNull(),status:pt("status",{enum:["pending","processing","completed","failed"]}).notNull().default("pending"),priority:ar("priority").notNull().default(0),retryCount:ar("retryCount").notNull().default(0),maxRetries:ar("maxRetries").notNull().default(3),lastError:pt("lastError"),lastErrorPublic:pt("lastErrorPublic",{mode:"json"}),createdAt:ar("createdAt").notNull().$defaultFn(()=>Date.now()),scheduledFor:ar("scheduledFor").notNull().$defaultFn(()=>Date.now()),startedAt:ar("startedAt"),completedAt:ar("completedAt"),attemptId:pt("attemptId"),workerSlotId:pt("workerSlotId"),workerSessionId:pt("workerSessionId"),leaseExpiresAt:ar("leaseExpiresAt"),attemptHeartbeatAt:ar("attemptHeartbeatAt"),runtimeUpdatedAt:ar("runtimeUpdatedAt"),brainVersion:pt("brainVersion"),brainVersionSortKey:pt("brainVersionSortKey")},(e)=>({queueReadyIdx:Fo("idx_job_queue_ready").on(e.status,e.priority,e.scheduledFor),jobTypeIdx:Fo("idx_job_queue_type").on(e.type,e.status),runtimeUpdatesIdx:Fo("idx_job_queue_runtime_updates").on(e.runtimeUpdatedAt,e.id),jobSourceIdx:Fo("idx_job_queue_source").on(e.source),rootJobIdx:Fo("idx_job_queue_root_job").on(C`json_extract(${e.metadata}, '$.rootJobId')`,e.createdAt,e.id),deduplicationIdx:Fo("idx_job_queue_deduplication").on(e.type,C`json_extract(${e.metadata}, '$.deduplicationKey')`,e.status)})),Me=qf("job_worker_sessions",{slotId:pt("slotId").primaryKey(),sessionId:pt("sessionId").notNull().unique(),startedAt:ar("startedAt").notNull(),heartbeatAt:ar("heartbeatAt").notNull(),expiresAt:ar("expiresAt").notNull().default(0),brainVersion:pt("brainVersion"),brainVersionSortKey:pt("brainVersionSortKey"),stableSlotId:pt("stableSlotId")},(e)=>({heartbeatIdx:Fo("idx_job_worker_sessions_heartbeat").on(e.heartbeatAt),expiresIdx:Fo("idx_job_worker_sessions_expires").on(e.expiresAt)}))});function $5(e){return gb({url:e.url,schema:{jobQueue:Y,jobWorkerSessions:Me},authToken:e.authToken,authTokenEnv:"JOB_QUEUE_DATABASE_AUTH_TOKEN",contentionRetryBudgetMs:0})}var O5=v(()=>{h$();y$()});class b${declarations=new Map;handlers=new Map;validators=new Map;logger;mode;finalizedRegistrations;constructor(e,t){this.logger=e.child("HandlerRegistry"),this.mode=t}registerHandler(e,t,r){if(this.finalizedRegistrations)throw Error("Job handler registrations are finalized");if(this.declarations.has(e))throw Error(`Job handler is already registered for type: ${e}`);if(this.declarations.set(e,{handler:t,pluginId:r}),this.validators.set(e,t),this.mode!=="validation-only")this.handlers.set(e,t);this.logger.debug("Registered job execution declaration",{type:e,pluginId:r,mode:this.mode})}unregisterHandler(e){this.declarations.delete(e),this.handlers.delete(e),this.validators.delete(e),this.logger.debug("Unregistered job handler",{type:e})}unregisterPluginHandlers(e){let t=[...this.declarations.entries()].filter(([,r])=>r.pluginId===e).map(([r])=>r);for(let r of t)this.declarations.delete(r),this.handlers.delete(r),this.validators.delete(r);if(t.length>0)this.logger.debug("Unregistered plugin handlers",{pluginId:e,count:t.length,types:t})}finalizeRegistrations(){return this.finalizedRegistrations??=Object.freeze([...this.declarations.entries()].sort(([e],[t])=>e.localeCompare(t)).map(([e,t])=>Object.freeze({type:e,pluginId:t.pluginId}))),this.finalizedRegistrations}getExecutionRegistrations(){return this.finalizedRegistrations}getRegisteredTypes(){return[...this.handlers.keys()]}getExclusiveTypes(){return[...this.handlers].filter(([,e])=>e.exclusive===!0).map(([e])=>e)}getHandler(e){return this.handlers.get(e)}getValidator(e){return this.validators.get(e)}}class S${tails=new Map;async run(e,t){let r=this.tails.get(e),o=()=>{},n=new Promise((i)=>{o=i});this.tails.set(e,n),await r;try{return await t()}finally{if(o(),this.tails.get(e)===n)this.tails.delete(e)}}}class v${findDuplicate(e,t,r){if(!t||t==="none")return null;let o=this.filterByDeduplicationKey(e,r).sort((i,s)=>s.createdAt-i.createdAt||s.id.localeCompare(i.id)),n=o.find((i)=>i.status===Oe.PENDING)??null;if(t==="skip"||t==="replace")return n;return n??o[0]??null}filterByDeduplicationKey(e,t){if(!t)return e;return e.filter((r)=>{let o=Fme.safeParse(r.metadata);return o.success&&o.data.deduplicationKey===t})}}var Fme;var C5=v(()=>{pe();No();Fme=l.looseObject({deduplicationKey:l.string().optional()})});function N5(e){return`${String(e.length).padStart(2,"0")}${e}`}function Jme(e){return Kme.test(e)?`0${N5(e)}`:`1${e}`}function Wf(e){let t=P5.exec(e);if(!t)throw Error(`Invalid brain version "${e}"`);let[,r="",o="",n="",i]=t,s=[r,o,n].map(N5).join("");return i===void 0?`${s}~`:`${s}-${i.split(".").map(Jme).join("!")}`}var P5,Kme,z5;var w$=v(()=>{pe();P5=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*)?$/u,Kme=/^\d+$/u,z5=l.string().regex(P5,"Brain version must be a semver version")});function D5(e){return JSON.stringify(new $i(e).toJSON())}class x${db;transactionClient;databaseUrl;logger;deduplicator=new v$;writeRetryBudgetMs;constructor(e,t,r,o,n){this.db=e,this.transactionClient=t,this.databaseUrl=r,this.logger=o.child("JobQueueRepository"),this.writeRetryBudgetMs=n?.writeRetryBudgetMs??Hme}async insert(e){await this.write("insert",async()=>this.db.insert(Y).values(e))}async enqueueAtomic(e){return Qme.run(this.databaseUrl,async()=>{let t=Date.now()+this.writeRetryBudgetMs;return this.attemptEnqueue(e,t,1)})}async attemptEnqueue(e,t,r){let o=await this.runEnqueueTransaction(e,t,r);if(o.retry)return this.attemptEnqueue(e,t,r+1);return o.decision}async runEnqueueTransaction(e,t,r){let o=await this.acquireWriteTransaction(e,t),n={prepared:!1},i=!1;try{let s=await this.decideEnqueue(o,e,()=>{n.prepared=!0});return i=!0,await o.commit(),{retry:!1,decision:s}}catch(s){let a=i&&this.isSerializationConflict(s)&&!o.closed,c=!0;if(!o.closed)try{await o.rollback()}catch(u){c=!1,this.logger.error("Failed to roll back atomic enqueue",{type:e.jobData.type,rollbackError:u})}if(n.prepared)e.onInsertRollback?.();if(!a||!c)throw s;return await this.waitForConflictRetry("commit",e,t,r,s),{retry:!0}}finally{o.close()}}async decideEnqueue(e,t,r){let{jobData:o,strategy:n,deduplicationKey:i,beforeInsert:s}=t,a=n??"none",c=async()=>{await s?.(),r()},u=async()=>{await c(),await this.insertJob(e,o)};if(a==="none")return await u(),{kind:"inserted",jobId:o.id};let d=await this.getActiveDeduplicationCandidates(e,o.type,i),f=this.deduplicator.findDuplicate(d,a,i);if(!f)return await u(),{kind:"inserted",jobId:o.id};if(a==="skip")return await this.raiseBrainVersion(e,f.id,o),{kind:"skipped",jobId:f.id};if(a==="coalesce"){if(await this.raiseBrainVersion(e,f.id,o),(await e.execute({sql:"UPDATE `job_queue` SET `scheduledFor` = ? WHERE `id` = ? AND `status` = ?",args:[Date.now(),f.id,f.status]})).rowsAffected!==1)throw Error(`Atomic coalesce lost selected job ${f.id}`);return{kind:"coalesced",jobId:f.id}}await c();let m=Date.now();if((await e.execute({sql:"UPDATE `job_queue`\n SET `status` = ?,\n `lastError` = ?,\n `lastErrorPublic` = ?,\n `completedAt` = ?,\n `runtimeUpdatedAt` = max(?, coalesce((SELECT max(`runtimeUpdatedAt`) FROM `job_queue`), 0) + 1)\n WHERE `id` = ? AND `status` = ?",args:[Oe.FAILED,"Replaced by newer job",D5("cancelled"),m,m,f.id,Oe.PENDING]})).rowsAffected!==1)throw Error(`Atomic replace lost selected job ${f.id}`);return await this.insertJob(e,o),{kind:"replaced",jobId:o.id,replacedJobId:f.id}}async getActiveDeduplicationCandidates(e,t,r){return(await e.execute(r?{sql:"SELECT `id`, `status`, `createdAt`, `metadata`\n FROM `job_queue`\n WHERE `type` = ?\n AND json_extract(`metadata`, '$.deduplicationKey') = ?\n AND `status` IN (?, ?)",args:[t,r,Oe.PENDING,Oe.PROCESSING]}:{sql:"SELECT `id`, `status`, `createdAt`, `metadata`\n FROM `job_queue`\n WHERE `type` = ? AND `status` IN (?, ?)",args:[t,Oe.PENDING,Oe.PROCESSING]})).rows.map((n)=>this.parseDeduplicationCandidate(n))}parseDeduplicationCandidate(e){let{id:t,status:r,createdAt:o,metadata:n}=e;if(typeof t!=="string"||r!==Oe.PENDING&&r!==Oe.PROCESSING||typeof o!=="number"&&typeof o!=="bigint"||typeof n!=="string")throw Error("Invalid active job row returned during atomic enqueue");let i=JSON.parse(n);return{id:t,status:r,createdAt:Number(o),metadata:i}}async raiseBrainVersion(e,t,r){if(!r.brainVersion)return;let o=Wf(r.brainVersion);await e.execute({sql:"UPDATE `job_queue`\n SET `brainVersion` = ?, `brainVersionSortKey` = ?\n WHERE `id` = ?\n AND (`brainVersionSortKey` IS NULL OR `brainVersionSortKey` < ?)",args:[r.brainVersion,o,t,o]})}async insertJob(e,t){if((await e.execute({sql:"INSERT INTO `job_queue` (\n `id`, `type`, `data`, `result`, `source`, `metadata`,\n `status`, `priority`, `retryCount`, `maxRetries`,\n `lastError`, `createdAt`, `scheduledFor`, `startedAt`,\n `completedAt`, `brainVersion`, `brainVersionSortKey`\n ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)",args:[t.id,t.type,t.data,this.serializeJson(t.result),t.source,JSON.stringify(t.metadata),t.status,t.priority,t.retryCount,t.maxRetries,t.lastError,t.createdAt,t.scheduledFor,t.startedAt,t.completedAt,t.brainVersion??null,t.brainVersion?Wf(t.brainVersion):null]})).rowsAffected!==1)throw Error(`Atomic enqueue did not insert job ${t.id}`)}serializeJson(e){if(e===void 0||e===null)return null;return JSON.stringify(e)}acquireWriteTransaction(e,t){return this.retryOnConflict("acquire",e,()=>this.transactionClient.transaction("write"),(r)=>this.isSerializationConflict(r),t)}async waitForConflictRetry(e,t,r,o,n){let i=Math.min(Vme*2**(o-1),Wme),s=i/2+Math.random()*(i/2);if(Date.now()+s>=r)throw this.transactionConflictError(e,t,o,n);await new Promise((a)=>setTimeout(a,s))}async retryOnConflict(e,t,r,o,n=Date.now()+this.writeRetryBudgetMs,i=1){try{return await r()}catch(s){if(!o(s))throw s;return await this.waitForConflictRetry(e,t,n,i,s),this.retryOnConflict(e,t,r,o,n,i+1)}}transactionConflictError(e,t,r,o){if(typeof t==="string")return Error(`Failed job queue write "${t}" within ${this.writeRetryBudgetMs}ms after ${r} attempts`,{cause:o});let n=t.strategy??"none",i=t.deduplicationKey?"present":"absent";return Error(`Failed to ${e} atomic enqueue transaction for type "${t.jobData.type}" within ${this.writeRetryBudgetMs}ms after ${r} attempts (strategy: ${n}, key: ${i})`,{cause:o})}write(e,t){return this.retryOnConflict("write",e,t,(r)=>{let o=new Set;for(let n=r;n!==void 0&&!o.has(n);){if(o.add(n),typeof n==="object"&&n!==null&&"code"in n&&/^SQLITE_(?:BUSY|LOCKED)(?:_|$)/u.test(String(n.code)))return!0;n=n instanceof Error?n.cause:void 0}return!1})}isSerializationConflict(e){for(let t=e;t!==void 0;){let r=typeof t==="object"&&t!==null&&"code"in t?String(t.code):"",o=Ve(t,"");if(/SQLITE_(?:BUSY|LOCKED)/u.test(r)||/SQLITE_(?:BUSY|LOCKED)|database is locked|transaction (?:busy|conflict)/iu.test(o))return!0;t=t instanceof Error?t.cause:void 0}return!1}async startWorkerSession(e,t,r=Date.now(),o=Fi,n,i){let s=r+o,a={brainVersion:n??null,brainVersionSortKey:n?Wf(n):null,stableSlotId:i??null};await this.write("start worker session",async()=>{await this.db.insert(Me).values({slotId:e,sessionId:t,startedAt:r,heartbeatAt:r,expiresAt:s,...a}).onConflictDoUpdate({target:Me.slotId,set:{sessionId:t,startedAt:r,heartbeatAt:r,expiresAt:s,...a}}),await this.pruneDeadWorkerSessions(r,o)})}async heartbeatWorkerSession(e,t,r=Date.now(),o=Fi){return(await this.write("heartbeat worker session",async()=>{let i=await this.db.update(Me).set({heartbeatAt:r,expiresAt:r+o}).where(tt(je(Me.slotId,e),je(Me.sessionId,t))).returning({slotId:Me.slotId});return await this.pruneDeadWorkerSessions(r,o),i})).length===1}async pruneDeadWorkerSessions(e,t){let r=this.db.select({id:Y.id}).from(Y).where(tt(je(Y.workerSlotId,Me.slotId),je(Y.workerSessionId,Me.sessionId),je(Y.status,Oe.PROCESSING),kn(Y.leaseExpiresAt,e)));await this.db.delete(Me).where(tt(rs(Me.expiresAt,e-t),os(r)))}async endWorkerSession(e,t){return(await this.write("end worker session",async()=>this.db.delete(Me).where(tt(je(Me.slotId,e),je(Me.sessionId,t))).returning({slotId:Me.slotId}))).length===1}async complete(e,t,r){let o=Date.now(),i=(await this.write("complete",async()=>this.db.update(Y).set({status:Oe.COMPLETED,result:t,lastError:null,lastErrorPublic:null,completedAt:o,runtimeUpdatedAt:this.nextRuntimeUpdatedAt(o)}).where(this.attemptWriteGuard(e,r)).returning({id:Y.id}))).length===1;if(i)this.logger.debug("Job completed",{jobId:e,hasResult:t!==void 0});return i}async update(e,t,r){let n=(await this.write("update",async()=>this.db.update(Y).set({data:JSON.stringify(t)}).where(this.attemptWriteGuard(e,r)).returning({id:Y.id}))).length===1;if(n)this.logger.debug("Job data updated",{jobId:e});return n}async recordAttemptProgress(e,t,r,o=Date.now()){return(await this.write("record progress",async()=>this.db.update(Y).set({attemptHeartbeatAt:o,runtimeUpdatedAt:this.nextRuntimeUpdatedAt(o),progress:r}).where(this.attemptWriteGuard(e,t)).returning({id:Y.id}))).length===1}async renewAttemptLease(e,t,r,o){return(await this.write("renew attempt lease",async()=>this.db.update(Y).set({attemptHeartbeatAt:r,leaseExpiresAt:r+o}).where(this.attemptWriteGuard(e,t)).returning({id:Y.id}))).length===1}async fail(e,t,r,o=Date.now()){let i=(await this.db.select({retryCount:Y.retryCount,maxRetries:Y.maxRetries,type:Y.type,scheduledFor:Y.scheduledFor,startedAt:Y.startedAt,runtimeUpdatedAt:Y.runtimeUpdatedAt}).from(Y).where(this.attemptWriteGuard(e,r)).limit(1))[0];if(!i)return!1;let s=i.retryCount<i.maxRetries,a=s?i.retryCount+1:i.retryCount,c=Math.min(1000*2**i.retryCount,60000),u=s?o+c:i.scheduledFor;if((await this.write("fail",async()=>this.db.update(Y).set({status:s?Oe.PENDING:Oe.FAILED,retryCount:a,lastError:t.message,lastErrorPublic:Hh(t).toJSON(),scheduledFor:u,completedAt:s?null:o,runtimeUpdatedAt:s?i.runtimeUpdatedAt:this.nextRuntimeUpdatedAt(o),startedAt:s?null:i.startedAt,attemptId:null,workerSlotId:null,workerSessionId:null,leaseExpiresAt:null,attemptHeartbeatAt:null}).where(tt(this.attemptWriteGuard(e,r),je(Y.retryCount,i.retryCount))).returning({id:Y.id}))).length!==1)return!1;if(s)this.logger.debug("Job scheduled for retry",{jobId:e,retryCount:a,backoffMs:c,scheduledFor:new Date(u).toISOString()});else this.logger.error("Job failed after max retries",{jobId:e,type:i.type,retryCount:i.retryCount,error:t.message});return!0}async retireUnownedActiveJob(e){let t=e.reason.trim();if(t.length===0)throw Error("Retired job reason must not be empty");let o=(await this.write("retire unowned job",async()=>this.db.update(Y).set({status:Oe.FAILED,lastError:t,lastErrorPublic:new $i("no_handler").toJSON(),completedAt:e.now,runtimeUpdatedAt:this.nextRuntimeUpdatedAt(e.now)}).where(tt(je(Y.id,e.jobId),je(Y.type,e.expectedType),an(je(Y.status,Oe.PENDING),je(Y.status,Oe.PROCESSING)),Mr(Y.attemptId),Mr(Y.workerSlotId),Mr(Y.workerSessionId),Mr(Y.leaseExpiresAt),Mr(Y.attemptHeartbeatAt),Mr(Y.progress),Mr(Y.result))).returning()))[0]??null;if(o)this.logger.warn("Retired unowned legacy job",{jobId:o.id,type:o.type,reason:t});return o}async getStatus(e){return(await this.db.select().from(Y).where(je(Y.id,e)).limit(1))[0]??null}async getJobsByRootJobId(e){return this.db.select().from(Y).where(C`json_extract(${Y.metadata}, '$.rootJobId') = ${e}`).orderBy(Uo(Y.createdAt),Uo(Y.id))}async getStatusByEntityId(e){return(await this.db.select().from(Y).where(C`json_extract(${Y.data}, '$.id') = ${e}`).orderBy(ga(Y.createdAt)).limit(1))[0]??null}async getStats(){let e=await this.db.select({status:Y.status,count:C`count(*)`}).from(Y).groupBy(Y.status),t={pending:0,processing:0,failed:0,completed:0,total:0};for(let r of e){let o=Number(r.count);t[r.status]=o,t.total+=o}return t}async getDiagnostics(e=Date.now()){let[t,r,o]=await Promise.all([this.db.select({type:Y.type,status:Y.status,count:C`count(*)`}).from(Y).groupBy(Y.type,Y.status),this.db.select({oldestPendingAt:C`min(case when ${Y.status} = ${Oe.PENDING} then ${Y.createdAt} end)`,duePending:C`coalesce(sum(case when ${Y.status} = ${Oe.PENDING} and ${Y.scheduledFor} <= ${e} then 1 else 0 end), 0)`,oldestDuePendingAt:C`min(case when ${Y.status} = ${Oe.PENDING} and ${Y.scheduledFor} <= ${e} then ${Y.scheduledFor} end)`,latestClaimAt:C`max(${Y.startedAt})`,oldestProcessingAt:C`min(case when ${Y.status} = ${Oe.PROCESSING} then ${Y.startedAt} end)`,staleLeaseCount:C`coalesce(sum(case when ${Y.status} = ${Oe.PROCESSING} and ${Y.leaseExpiresAt} is not null and ${Y.leaseExpiresAt} <= ${e} then 1 else 0 end), 0)`}).from(Y),this.db.select({total:C`count(*)`,active:C`coalesce(sum(case when ${Me.expiresAt} > ${e} then 1 else 0 end), 0)`,stale:C`coalesce(sum(case when ${Me.expiresAt} <= ${e} then 1 else 0 end), 0)`,latestHeartbeatAt:C`max(${Me.heartbeatAt})`}).from(Me)]),n={pending:0,processing:0,completed:0,failed:0},i=t.map((u)=>{let d=Number(u.count);return n[u.status]+=d,{type:u.type,status:u.status,count:d}}),s=r[0],a=o[0],c=(u)=>u===null||u===void 0?null:Math.max(0,e-Number(u));return{totals:n,byType:i,oldestPendingAgeMs:c(s?.oldestPendingAt),duePending:Number(s?.duePending??0),oldestDuePendingAgeMs:c(s?.oldestDuePendingAt),latestClaimAgeMs:c(s?.latestClaimAt),oldestProcessingAgeMs:c(s?.oldestProcessingAt),staleLeaseCount:Number(s?.staleLeaseCount??0),workerSessions:{total:Number(a?.total??0),active:Number(a?.active??0),stale:Number(a?.stale??0),latestHeartbeatAgeMs:c(a?.latestHeartbeatAt)}}}async getRuntimeUpdates(e,t){let r=Gme.parse(t);if(r===0)return[];return(await this.db.select().from(Y).where(C`(${Y.runtimeUpdatedAt}, ${Y.id}) > (${e.updatedAt}, ${e.jobId})`).orderBy(Uo(Y.runtimeUpdatedAt),Uo(Y.id)).limit(r)).map((n)=>({job:n,cursor:{updatedAt:n.runtimeUpdatedAt??0,jobId:n.id}}))}async cleanup(e){let t=Date.now()-e;return(await this.write("cleanup",async()=>this.db.delete(Y).where(tt(an(je(Y.status,Oe.COMPLETED),je(Y.status,Oe.FAILED)),rs(Y.completedAt,t))))).rowsAffected}async getActiveJobs(e){let t=an(je(Y.status,Oe.PENDING),je(Y.status,Oe.PROCESSING)),r=e&&e.length>0?tt(t,ns(Y.type,e)):t;return this.db.select().from(Y).where(r).orderBy(ga(Y.createdAt))}async getRecentJobs(e,t=20){let r=e&&e.length>0?ns(Y.type,e):void 0;return this.db.select().from(Y).where(r).orderBy(ga(Y.createdAt)).limit(t)}async getFailedJobs(e){let t=je(Y.status,Oe.FAILED),r=e&&e.length>0?tt(t,ns(Y.type,e)):t;return this.db.select().from(Y).where(r).orderBy(ga(Y.createdAt))}async claimNextReady(e){let{now:t,attemptId:r,workerSlotId:o,workerSessionId:n,leaseDurationMs:i,executableTypes:s,exclusiveTypes:a=[],brainVersion:c}=e,u=c?this.brainVersionGate(c,t):{admissible:void 0,noNewerWorker:void 0},d=this.db.select({slotId:Me.slotId}).from(Me).where(tt(je(Me.slotId,o),je(Me.sessionId,n),kn(Me.expiresAt,t))),f=this.noNewerLiveInstance(o,n,t),m=this.db.select({slotId:Me.slotId}).from(Me).where(tt(je(Me.slotId,Y.workerSlotId),je(Me.sessionId,Y.workerSessionId))),h=tt(je(Y.status,Oe.PROCESSING),an(Mr(Y.attemptId),os(m),rs(Y.leaseExpiresAt,t))),b=lb(Y,"running"),y=this.db.select({id:b.id}).from(b).where(tt(je(b.type,Y.type),je(b.status,Oe.PROCESSING),kn(b.leaseExpiresAt,t),C`${b.id} <> ${Y.id}`)),S=a.length===0?void 0:an(Wy(Y.type,[...a]),os(y)),x=C`${Y.status} = ${Oe.PROCESSING} AND ${Y.retryCount} + 1 > ${Y.maxRetries}`,_=this.db.select({id:Y.id}).from(Y).where(tt(ns(Y.type,s),S,u.admissible,an(tt(je(Y.status,Oe.PENDING),rs(Y.scheduledFor,t)),h))).orderBy(Uo(Y.priority),Uo(Y.createdAt)).limit(1),O=(await this.write("claim",async()=>this.db.update(Y).set({status:C`CASE WHEN ${x} THEN ${Oe.FAILED} ELSE ${Oe.PROCESSING} END`,retryCount:C`CASE WHEN ${Y.status} = ${Oe.PROCESSING} THEN ${Y.retryCount} + 1 ELSE ${Y.retryCount} END`,lastError:C`CASE WHEN ${Y.status} = ${Oe.PROCESSING} THEN 'Attempt lease expired' ELSE ${Y.lastError} END`,lastErrorPublic:C`CASE WHEN ${Y.status} = ${Oe.PROCESSING} THEN ${D5("deadline_exceeded")} ELSE ${Y.lastErrorPublic} END`,startedAt:C`CASE WHEN ${x} THEN ${Y.startedAt} ELSE ${t} END`,completedAt:C`CASE WHEN ${x} THEN ${t} ELSE NULL END`,attemptId:C`CASE WHEN ${x} THEN ${Y.attemptId} ELSE ${r} END`,workerSlotId:C`CASE WHEN ${x} THEN ${Y.workerSlotId} ELSE ${o} END`,workerSessionId:C`CASE WHEN ${x} THEN ${Y.workerSessionId} ELSE ${n} END`,leaseExpiresAt:C`CASE WHEN ${x} THEN ${Y.leaseExpiresAt} ELSE ${t+i} END`,attemptHeartbeatAt:C`CASE WHEN ${x} THEN ${Y.attemptHeartbeatAt} ELSE ${t} END`,runtimeUpdatedAt:C`CASE WHEN ${x} THEN ${this.nextRuntimeUpdatedAt(t)} ELSE ${Y.runtimeUpdatedAt} END`}).where(tt(ns(Y.id,_),Gy(d),f,u.noNewerWorker)).returning()))[0];if(!O)return null;if(O.status===Oe.FAILED)return O;return this.logger.debug("Job claimed",{jobId:O.id,attemptId:O.attemptId,workerSlotId:o,workerSessionId:n}),O}noNewerLiveInstance(e,t,r){let o=lb(Me,"claimer"),n=lb(Me,"peer"),i=this.db.select({slotId:n.slotId}).from(n).innerJoin(o,tt(je(o.slotId,e),je(o.sessionId,t))).where(tt(je(n.stableSlotId,o.stableSlotId),kn(n.expiresAt,r),an(kn(n.startedAt,o.startedAt),tt(je(n.startedAt,o.startedAt),kn(n.slotId,o.slotId)))));return os(i)}brainVersionGate(e,t){let r=Wf(e),o=this.db.select({slotId:Me.slotId}).from(Me).where(tt(kn(Me.expiresAt,t),kn(Me.brainVersionSortKey,r)));return{admissible:an(Mr(Y.brainVersionSortKey),rs(Y.brainVersionSortKey,r)),noNewerWorker:os(o)}}nextRuntimeUpdatedAt(e){return C`max(${e}, coalesce((select max(${Y.runtimeUpdatedAt}) from ${Y}), 0) + 1)`}attemptWriteGuard(e,t){return t?tt(je(Y.id,e),je(Y.status,Oe.PROCESSING),je(Y.attemptId,t)):tt(je(Y.id,e),Mr(Y.attemptId),an(je(Y.status,Oe.PENDING),je(Y.status,Oe.PROCESSING)))}}var Hme=2000,Vme=5,Wme=40,Gme,Qme;var L5=v(()=>{g$();db();y$();Ot();pe();No();lf();C5();w$();Gme=l.number().int().min(0).max(1000),Qme=new S$});import{AsyncLocalStorage as Yme}from"async_hooks";class Nl{storage=new Yme;static createFresh(){return new Nl}constructor(){}current(){return this.storage.getStore()}run(e,t,r){if(t.length===0)throw Error("Operation ID must not be empty");let o=Eo.parse(e),n=Xme(o);return this.storage.run(Object.freeze({provenance:n,operationId:t}),r)}}function Xme(e){if(Object.freeze(e.projectionLineage),e.sourceEntity)Object.freeze(e.sourceEntity);return Object.freeze(e)}var bb=v(()=>{Ot()});class Gf{client;logger;handlerRegistry;repository;walInitialization=null;walInitializationSettled=!1;closeRequested=!1;clientClosed=!1;inFlightEnqueues=0;databaseUrl;operationContext;projectionAdmission;directWorkerSlotId=`direct:${zo()}`;directWorkerSessionId=zo();directLeaseDurationMs;directSessionStart=null;brainVersion;close(){this.closeRequested=!0,this.closeClientWhenReady()}static createFresh(e,t,r){return new Gf(e,t??Ar.getInstance(),r)}constructor(e,t,r){this.brainVersion=e.brainVersion===void 0?void 0:z5.parse(e.brainVersion);let{db:o,client:n,url:i}=$5(e);this.client=n,this.databaseUrl=i,this.logger=t.child("JobQueueService"),this.operationContext=r?.operationContext??Nl.createFresh(),this.projectionAdmission=r?.projectionAdmission,this.handlerRegistry=new b$(this.logger,r?.handlerRegistrationMode??"combined"),this.repository=new x$(o,n,i,this.logger),this.directLeaseDurationMs=e.claimTimeoutMs??300000}initialize(){if(this.closeRequested)return Promise.resolve();return this.walInitialization??=this.initializeWALMode(),this.walInitialization}async initializeWALMode(){try{await yb(this.client,this.databaseUrl)}catch(e){this.logger.warn("Failed to enable WAL mode (non-fatal)",e)}finally{this.walInitializationSettled=!0,this.closeClientWhenReady()}}closeClientWhenReady(){if(!this.closeRequested||this.inFlightEnqueues>0||this.walInitialization!==null&&!this.walInitializationSettled)return;this.closeClient()}closeClient(){if(this.clientClosed)return;this.clientClosed=!0,this.client.close()}registerHandler(e,t,r){this.handlerRegistry.registerHandler(e,t,r)}unregisterHandler(e){this.handlerRegistry.unregisterHandler(e)}unregisterPluginHandlers(e){this.handlerRegistry.unregisterPluginHandlers(e)}getRegisteredTypes(){return this.handlerRegistry.getRegisteredTypes()}getHandler(e){return this.handlerRegistry.getHandler(e)}getValidator(e){return this.handlerRegistry.getValidator(e)}finalizeHandlerRegistrations(){return this.handlerRegistry.finalizeRegistrations()}getExecutionRegistrations(){return this.handlerRegistry.getExecutionRegistrations()}async enqueue(e){if(this.closeRequested)throw Error("Cannot enqueue a job after the queue service is closed");this.inFlightEnqueues++;try{return await this.enqueueValidated(e)}finally{this.inFlightEnqueues--,this.closeClientWhenReady()}}async enqueueValidated(e){let{type:t,data:r,options:o}=e,n=this.handlerRegistry.getValidator(t);if(!n)throw Error(`No job type declared: ${t}`);let i=n.validateAndParse(r);if(i===null)throw Error(`Invalid job data for type: ${t}`);let s=Date.now(),a=zo(),c=o?.rootJobId??(o?.detached?a:this.operationContext.current()?.provenance.rootJobId)??a,u=this.createJobProvenance(a,c,o),d=o?.metadata??{operationType:"data_processing"},{provenance:f,...m}=d,h={id:a,type:t,data:JSON.stringify(i),status:Oe.PENDING,priority:o?.priority??0,maxRetries:o?.maxRetries??3,retryCount:0,source:o?.source??null,metadata:{...m,...o?.deduplicationKey&&{deduplicationKey:o.deduplicationKey},rootJobId:c,provenance:u},createdAt:s,scheduledFor:o?.delayMs?s+o.delayMs:s,result:null,lastError:null,startedAt:null,completedAt:null,brainVersion:this.brainVersion},b,y=()=>{b?.rollback(),b=void 0};try{let S=await this.repository.enqueueAtomic({jobData:h,strategy:o?.deduplication,deduplicationKey:o?.deduplicationKey,beforeInsert:async()=>{b=await this.projectionAdmission?.reserveJobAdmission(u)},onInsertRollback:y});if(b?.commit(),b=void 0,S.kind==="skipped")this.logger.debug("Skipping duplicate job (already pending)",{type:t,existingJobId:S.jobId});else if(S.kind==="coalesced")this.logger.debug("Coalescing with existing job",{type:t,existingJobId:S.jobId});else{if(S.kind==="replaced")this.logger.debug("Replacing duplicate job",{type:t,oldJobId:S.replacedJobId});this.logger.debug("Job enqueued",{id:S.jobId,type:t,priority:h.priority,rootJobId:h.metadata.rootJobId})}return S.jobId}catch(S){throw y(),this.logger.error("Failed to enqueue job",{type:t,error:Ve(S)}),S}}createJobProvenance(e,t,r){let o=this.operationContext.current(),n=r?.metadata.provenance??o?.provenance,i=n?.rootJobId===t?n:void 0,s=o?.provenance.rootJobId===t?o.operationId:void 0,a=r?.projection,c=a?[...i?.projectionLineage??[],a.id]:[...i?.projectionLineage??[]],u=a?.id??i?.projectionId;return Eo.parse({rootJobId:t,causationId:s??i?.causationId??e,...u?{projectionId:u}:{},projectionLineage:c,...a?.sourceEntity?{sourceEntity:a.sourceEntity}:i?.sourceEntity?{sourceEntity:i.sourceEntity}:{},derivationDepth:c.length})}async dequeue(e){let t=this.handlerRegistry.getRegisteredTypes();if(t.length===0)return null;let{onTerminalReclaim:r,...o}=e??await this.getDirectClaimOptions(),n=Date.now(),i=await this.repository.claimNextReady({...o,workerSlotId:this.sessionSlotId(o.workerSlotId,o.workerSessionId),brainVersion:this.brainVersion,now:n,attemptId:zo(),executableTypes:t,exclusiveTypes:this.handlerRegistry.getExclusiveTypes()});if(!i)return null;if(i.status===Oe.FAILED)return this.logger.warn("Expired attempt failed terminally on reclaim",{id:i.id,type:i.type,retryCount:i.retryCount}),await r?.(i),null;return this.logger.debug("Job dequeued",{id:i.id,type:i.type,priority:i.priority,retryCount:i.retryCount,attemptId:i.attemptId,workerSlotId:i.workerSlotId,workerSessionId:i.workerSessionId}),i}async startWorkerSession(e,t,r=Fi){await this.repository.startWorkerSession(this.sessionSlotId(e,t),t,Date.now(),r,this.brainVersion,this.versionedSlotId(e))}heartbeatWorkerSession(e,t,r=Fi){return this.repository.heartbeatWorkerSession(this.sessionSlotId(e,t),t,Date.now(),r)}endWorkerSession(e,t){return this.repository.endWorkerSession(this.sessionSlotId(e,t),t)}versionedSlotId(e){return this.brainVersion?`${e}@${this.brainVersion}`:e}sessionSlotId(e,t){return`${this.versionedSlotId(e)}#${t}`}renewAttemptLease(e,t,r){return this.repository.renewAttemptLease(e,t,Date.now(),r)}recordAttemptProgress(e,t,r){return this.repository.recordAttemptProgress(e,t,r)}complete(e,t,r){return this.repository.complete(e,t,r)}update(e,t,r){return this.repository.update(e,t,r)}fail(e,t,r){return this.repository.fail(e,t,r)}retireUnownedActiveJob(e){return this.repository.retireUnownedActiveJob(e)}async getDirectClaimOptions(){return this.directSessionStart??=this.repository.startWorkerSession(this.sessionSlotId(this.directWorkerSlotId,this.directWorkerSessionId),this.directWorkerSessionId,Date.now(),this.directLeaseDurationMs,this.brainVersion),await this.directSessionStart,{workerSlotId:this.directWorkerSlotId,workerSessionId:this.directWorkerSessionId,leaseDurationMs:this.directLeaseDurationMs}}async getStatus(e){return this.repository.getStatus(e)}async getJobsByRootJobId(e){return this.repository.getJobsByRootJobId(e)}async getStatusByEntityId(e){return this.repository.getStatusByEntityId(e)}async getStats(){return this.repository.getStats()}getDiagnostics(e){return this.repository.getDiagnostics(e)}async waitForIdle(e={}){let t=e.quietMs??250,r=e.pollIntervalMs??25,o=Date.now()+(e.timeoutMs??30000),n=async(i)=>{e.signal?.throwIfAborted();let{totals:s}=await this.getDiagnostics(),c=s.pending===0&&s.processing===0?i??Date.now():null;if(c!==null&&Date.now()-c>=t)return;if(Date.now()>=o)throw Error(`Timed out waiting for the job queue to settle: ${s.pending} pending, ${s.processing} processing`);return await Bun.sleep(r),n(c)};return n(null)}getRuntimeUpdates(e,t=1000){return this.repository.getRuntimeUpdates(e,t)}async cleanup(e){let t=await this.repository.cleanup(e);if(t>0)this.logger.info("Cleaned up old jobs",{deletedCount:t,olderThanMs:e});return t}async getActiveJobs(e){return this.repository.getActiveJobs(e)}async getRecentJobs(e,t){return this.repository.getRecentJobs(e,t)}async getFailedJobs(e){return this.repository.getFailedJobs(e)}}var B5=v(()=>{af();AT();lf();No();h$();O5();L5();Ot();bb();w$()});var _$=()=>{};var j5=v(()=>{af();No();lf();No();_$();bb()});var Z5=v(()=>{No();_$()});var Sb,U5;var E$=v(()=>{pe();Sb=l.object({success:l.boolean(),data:l.unknown().optional(),error:l.string().optional(),code:l.string().optional()}),U5=l.object({id:l.string().min(1),timestamp:l.string(),type:l.string().min(1),source:l.string().min(1),target:l.string().optional(),metadata:l.record(l.string(),l.unknown()).optional()})});var rFe;var M5=v(()=>{pe();E$();rFe=l.union([l.object({noop:l.literal(!0)}),Sb])});var vb=v(()=>{M5()});var q5=v(()=>{vb()});var F5=v(()=>{vb()});var K5=v(()=>{F5()});var vFe;var k$=v(()=>{pe();vFe=l.looseObject({issues:l.array(l.looseObject({message:l.string()})).optional()})});var J5=v(()=>{q5();vb();K5();k$();Ot();bb()});var lhe;var H5=v(()=>{pe();E$();lhe=l.object({id:l.string().min(1),requestId:l.string().min(1),success:l.boolean(),data:l.unknown().optional(),error:l.object({message:l.string(),code:l.string().optional()}).optional(),timestamp:l.string().datetime()})});var BFe;var V5=v(()=>{Ot();BFe=new $i("invalid_response").toJSON()});var W5=v(()=>{J5();H5();k$();V5()});var n3e;var G5=v(()=>{pe();W5();cf();No();n3e=l.preprocess((e)=>{if(typeof e!=="string")return e;return JSON.parse(e)},l.record(l.string(),l.unknown()))});var s3e;var Q5=v(()=>{pe();s3e=l.record(l.string(),l.unknown())});var Y5=v(()=>{Ot();af()});var X5=v(()=>{B5();j5();Z5();G5();Q5();lf();No();cf();Y5()});var I$={};Lt(I$,{LEGACY_PROJECTION_JOB_TYPES:()=>t8,LEGACY_PROJECTION_RETIREMENT_REASON:()=>n8,legacyProjectionJobTypeSchema:()=>r8,retireLegacyProjectionJob:()=>mhe});import{existsSync as dhe}from"fs";import{resolve as fhe}from"path";function e8(e){return{id:e.id,type:e.type,status:e.status,retryCount:e.retryCount,maxRetries:e.maxRetries,createdAt:e.createdAt,startedAt:e.startedAt,completedAt:e.completedAt}}function phe(e,t){if(e.type!==t)throw Error(`Job ${e.id} has type ${e.type}; expected ${t}`);if(e.status!=="pending"&&e.status!=="processing")throw Error(`Job ${e.id} is already terminal (${e.status})`);if(e.attemptId!==null||e.workerSlotId!==null||e.workerSessionId!==null||e.leaseExpiresAt!==null||e.attemptHeartbeatAt!==null)throw Error(`Job ${e.id} still has attempt ownership`);if(e.progress!==null||e.result!=null)throw Error(`Job ${e.id} contains partial progress or a result`)}async function mhe(e){let t=fhe(e.databasePath);if(!dhe(t))throw Error(`Job database does not exist: ${t}`);let r=r8.parse(e.jobType),o=Gf.createFresh({url:`file:${t}`});try{let n=await o.getStatus(e.jobId);if(!n)throw Error(`Job not found: ${e.jobId}`);if(phe(n,r),e.dryRun){if(e.confirmation!==void 0)throw Error("Dry-run recovery must not include confirmation");return{databasePath:t,job:e8(n),retired:!1}}let i=`retire:${n.id}`;if(e.confirmation!==i)throw Error(`Refusing to retire ${n.id}; expected --confirm ${i}`);let s=await o.retireUnownedActiveJob({jobId:n.id,expectedType:r,reason:n8,now:e.now?.()??Date.now()});if(!s)throw Error(`Job ${n.id} changed or acquired ownership before retirement`);return{databasePath:t,job:e8(s),retired:!0}}finally{o.close()}}var t8,r8,n8="Retired legacy projection job superseded by scheduler-owned projections";var A$=v(()=>{X5();pe();t8=["conversation-memory:project","skill:project","swot:derive","topic:project"],r8=l.enum(t8)});function Ut(e,t,r,o,n){return i8.parse({id:e,operation:t,count:r,targetProbeCount:o,settleMs:n})}function l8(e){return _b.parse(structuredClone(She[e]))}function Eb(e){let t=`stress:${e.handle}`;if(e.confirmation!==t)throw Error(`Directory-sync stress requires --confirm ${t}`);let r=/(^|[-_.])smoke($|[-_.])/i;if(!r.test(e.handle)||!r.test(e.domain)||!r.test(e.contentRepo))throw Error("Directory-sync stress is smoke-only; handle, domain, and content repository must all identify smoke")}async function R$(e,t={}){let r=t.fetchImpl??fetch,o=t.now??(()=>new Date),n=t.timeoutMs??20000,i=o(),s=new AbortController,a=setTimeout(()=>s.abort(),n);try{let c=await r(e,{method:"GET",signal:s.signal});return await c.arrayBuffer(),T$.parse({timestamp:i.toISOString(),endpoint:new URL(e).pathname,status:c.status,durationMs:Math.max(0,o().getTime()-i.getTime()),ok:c.ok})}catch(c){return T$.parse({timestamp:i.toISOString(),endpoint:new URL(e).pathname,status:0,durationMs:Math.max(0,o().getTime()-i.getTime()),ok:!1,error:whe(c)})}finally{clearTimeout(a)}}async function u8(e,t){let r=_b.parse(e),o=[],n,i=await t.prepare(r),s,a;try{try{await t.startMonitoring()}catch(c){n=`monitor: ${wb(c)}`}if(!n)for(let c of r.phases)try{let u=s8.parse(await t.executePhase(c,i));if(o.push(u),!u.success){n=`${c.id}: ${u.error??"phase failed"}`;break}}catch(u){let d=wb(u);o.push({id:c.id,operation:c.operation,count:c.count,success:!1,error:d}),n=`${c.id}: ${d}`;break}}finally{try{if(s=a8.parse(await t.cleanup(i)),!s.success&&!n)n=s.error??"cleanup failed"}catch(c){let u=wb(c);s={success:!1,probesRemaining:0,error:u},n??=`cleanup: ${u}`}try{a=c8.parse(await t.stopMonitoring())}catch(c){let u=wb(c);a={health:[],runtime:[]},n??=`monitor: ${u}`}}return n??=vhe(a,r.maximumExternalAiCalls??0),bhe.parse({profile:r.profile,success:n===void 0&&o.length===r.phases.length&&s.success,baseline:i,phases:o,cleanup:s,metrics:a,...n?{failure:n}:{}})}function vhe(e,t=0){let r=e.health.find((i)=>!i.ok);if(r)return`health: ${r.endpoint} unavailable`;let o=e.externalAiCalls??0;if(o>t)return t===0?`external AI: observed ${o} call(s)`:`external AI: observed ${o} call(s), cap ${t}`;if(e.container?.oomKilled)return"container: OOM killed";let n=e.container?.restartCount??0;if(n>0)return`container: restarted ${n} time(s)`;if(e.container&&e.container.status!=="running")return`container: ${e.container.status}`;return}function whe(e){if(e instanceof Error)return`${e.name}: ${e.message}`;return String(e)}function wb(e){return Ve(e)}var xb,o8,i8,_b,hhe,T$,ghe,s8,a8,yhe,c8,bhe,She;var $$=v(()=>{pe();xb=l.enum(["regression","load","stress"]),o8=l.enum(["add","update","rename","delete"]),i8=l.object({id:l.string().min(1),operation:o8,count:l.number().int().positive().max(700),targetProbeCount:l.number().int().min(0).max(700),settleMs:l.number().int().nonnegative().max(300000)}),_b=l.object({profile:xb,maximumProbeCount:l.number().int().positive().max(700),maximumExternalAiCalls:l.number().int().nonnegative().max(1e4).optional(),phases:l.array(i8).min(1)}),hhe=l.object({entities:l.number().int().nonnegative(),notes:l.number().int().nonnegative(),version:l.string().min(1)}),T$=l.object({timestamp:l.iso.datetime(),endpoint:l.string().startsWith("/"),status:l.number().int().nonnegative(),durationMs:l.number().nonnegative(),ok:l.boolean(),error:l.string().optional()}),ghe=l.object({timestamp:l.iso.datetime(),cpuPercent:l.number().nonnegative(),memoryPercent:l.number().nonnegative(),pids:l.number().int().nonnegative()}),s8=l.object({id:l.string().min(1),operation:o8,count:l.number().int().positive(),success:l.boolean(),commitLatencyMs:l.number().nonnegative().optional(),persistenceLatencyMs:l.number().nonnegative().optional(),error:l.string().optional()}),a8=l.object({success:l.boolean(),probesRemaining:l.number().int().nonnegative(),finalEntities:l.number().int().nonnegative().optional(),finalNotes:l.number().int().nonnegative().optional(),contentTreeRestored:l.boolean().optional(),error:l.string().optional()}),yhe=l.object({status:l.string(),restartCount:l.number().int().nonnegative(),oomKilled:l.boolean()}),c8=l.object({health:l.array(T$),runtime:l.array(ghe),externalAiCalls:l.number().int().nonnegative().optional(),container:yhe.optional()}),bhe=l.object({profile:xb,success:l.boolean(),baseline:hhe,phases:l.array(s8),cleanup:a8,metrics:c8,failure:l.string().optional()}),She={regression:{profile:"regression",maximumProbeCount:20,phases:[Ut("add20","add",20,20,0),Ut("update20","update",20,20,30000),Ut("delete20","delete",20,0,150000)]},load:{profile:"load",maximumProbeCount:350,phases:[Ut("add50","add",50,50,0),Ut("add150","add",100,150,0),Ut("add350","add",200,350,0),Ut("update350a","update",350,350,45000),Ut("rename100","rename",100,350,45000),Ut("update350b","update",350,350,45000),Ut("delete350","delete",350,0,150000)]},stress:{profile:"stress",maximumProbeCount:700,phases:[Ut("add50","add",50,50,0),Ut("add150","add",100,150,0),Ut("add350","add",200,350,0),Ut("add700","add",350,700,0),Ut("update700a","update",700,700,45000),Ut("rename200","rename",200,700,45000),Ut("update700b","update",700,700,45000),Ut("delete700","delete",700,0,150000)]}}});import{spawn as xhe}from"child_process";async function d8(e,t,r,o){let n=await e(t,r,o);if(n.exitCode!==0)throw no(t,r,n);return n}function no(e,t,r){let o=r.stderr.trim()||r.stdout.trim();return Error(`${e} ${t.join(" ")} exited with ${r.exitCode}${o?`: ${o}`:""}`)}var Ho=async(e,t,r={})=>new Promise((o,n)=>{let i=xhe(e,[...t],{cwd:r.cwd,env:r.env?{...process.env,...r.env}:process.env,stdio:["pipe","pipe","pipe"]}),s="",a="";i.stdout.setEncoding("utf8"),i.stderr.setEncoding("utf8"),i.stdout.on("data",(c)=>{s+=c}),i.stderr.on("data",(c)=>{a+=c}),i.on("error",n),i.on("close",(c)=>{o({exitCode:c??1,stdout:s,stderr:a})}),i.stdin.end(r.stdin)});var Qf=()=>{};class Dl{#e;#t;dir;constructor(e,t,r){this.#e=e,this.dir=t,this.#t=r}static async clone(e,t,r,o){let n=new Dl(e,r,o);return await d8(e,"git",["-c","credential.helper=","-c",`credential.helper=${f8}`,"clone","--branch","main","--single-branch",`https://github.com/${t}.git`,r],{env:n.environment()}),await n.run(["config","--local","credential.helper",f8]),await n.run(["reset","--hard","origin/main"]),n}async run(e,t=!0){let r=await this.#e("git",e,{cwd:this.dir,env:this.environment()});if(t&&r.exitCode!==0)throw no("git",e,r);return r}async output(e){return(await this.run(e)).stdout.trim()}async sync(e=!1){if(await this.run(["fetch","origin","main"]),e)await this.run(["reset","--hard","origin/main"]);else await this.run(["pull","--rebase","origin","main"])}async commitAll(e){await this.run(["add","-A"]),await this.run(["-c","user.name=brains-ops","-c","user.email=ops@rizom.ai","commit","-m",e])}async pushMainWithRebase(){for(let e=1;e<=5;e+=1){if((await this.run(["push","origin","main"],!1)).exitCode===0)return;await this.run(["pull","--rebase","origin","main"])}throw Error("Unable to push content main after five rebase attempts")}async pruneStressBackupBranches(){let t=(await this.run(["ls-remote","--heads","origin","refs/heads/ops/directory-sync-stress-backup-*"])).stdout.split(/\r?\n/).map((r)=>r.match(/\trefs\/heads\/(ops\/directory-sync-stress-backup-[^\s]+)$/)?.[1]).filter((r)=>r!==void 0).sort();for(let r of t)await this.run(["push","origin","--delete",r]);return t}environment(){return{GH_TOKEN:this.#t,GITHUB_TOKEN:this.#t}}}var f8='!f() { test "$1" = get && echo username=x-access-token && echo "password=$GH_TOKEN"; }; f';var p8=v(()=>{Qf()});function Yf(e){return e.entityCounts.find((t)=>t.entityType==="note")?.count??0}class O${#e;#t=[];#r=[];#n=new Set(["/health/ready"]);#o=!0;#i;#a;#s="";#c=0;#l;constructor(e){this.#e=e}get startedAt(){return this.#s}get error(){return this.#a}get healthSamples(){return this.#t}get runtimeSamples(){return this.#r}gateHealthSamples(){return this.#t.slice(this.#c,this.#l??this.#t.length)}markGateEnd(){this.#l=this.#t.length}async discoverEndpoints(){for(let e of["/health/live","/health/operate"])if((await R$(`https://${this.#e.domain}${e}`,{fetchImpl:this.#e.fetchImpl,now:this.#e.now,timeoutMs:5000})).status!==404)this.#n.add(e)}start(){this.#o=!1,this.#a=void 0,this.#c=this.#t.length,this.#l=void 0,this.#s=this.#e.now().toISOString(),this.#i=Promise.all([this.#m(),this.#p()]).then(()=>{return}).catch((e)=>{this.#a=e,this.#o=!0})}async stop(){this.#o=!0,await this.#i}async waitForHealthSnapshot(e){return this.waitForEntityBaseline(void 0,void 0,e)}async waitForEntityBaseline(e,t,r){let o=this.#e.now().getTime();while(this.#e.now().getTime()-o<r){let n=await this.fetchHealthPayload();if(this.#f(n,e,t))return n;await this.#e.sleep(5000)}return}async waitForStableEntityBaseline(e,t,r){let o=this.#e.now().getTime(),n=0;while(this.#e.now().getTime()-o<r){let i=await this.fetchHealthPayload();if(this.#f(i,e,t)){if(n+=1,n===2)return i}else n=0;await this.#e.sleep(5000)}return}async fetchHealthPayload(){let e=await this.#d();if(e===void 0)return;let t=await this.#e.readEntityCounts();if(!t)return;return{version:e,entities:t.reduce((r,o)=>r+o.count,0),entityCounts:t}}async#d(){let e=this.#e.now(),t=new AbortController,r=setTimeout(()=>t.abort(),20000);try{let o=await this.#e.fetchImpl(`https://${this.#e.domain}/health/operate`,{signal:t.signal}),n=await o.text();if(this.#t.push({timestamp:e.toISOString(),endpoint:"/health/operate",status:o.status,durationMs:Math.max(0,this.#e.now().getTime()-e.getTime()),ok:o.ok}),!o.ok)return;return _he.parse(JSON.parse(n)).app.version}catch(o){this.#t.push({timestamp:e.toISOString(),endpoint:"/health/operate",status:0,durationMs:Math.max(0,this.#e.now().getTime()-e.getTime()),ok:!1,error:o instanceof Error?`${o.name}: ${o.message}`:String(o)});return}finally{clearTimeout(r)}}#f(e,t,r){return e!==void 0&&(t===void 0||Yf(e)===t)&&(r===void 0||e.entities===r)}async#m(){while(!this.#o){for(let e of this.#n)this.#t.push(await R$(`https://${this.#e.domain}${e}`,{fetchImpl:this.#e.fetchImpl,now:this.#e.now,timeoutMs:20000}));await this.#e.sleep(4000)}}async#p(){while(!this.#o){let e=await this.#e.sampleRuntime();if(e)this.#r.push(e);await this.#e.sleep(1000)}}}var m8,_he;var h8=v(()=>{pe();$$();m8=l.array(l.object({entityType:l.string(),count:l.number().int().nonnegative()})),_he=l.object({status:l.literal("ready"),operationalStatus:l.literal("operational"),app:l.object({version:l.string()})})});var kb={};Lt(kb,{applyDirectorySyncStressPhase:()=>S8,cleanupDirectorySyncStress:()=>zhe,listProbeFiles:()=>va,parseStressRuntimeSample:()=>v8,removeProbeFiles:()=>B$,runDeployedDirectorySyncStress:()=>Che,runStressCommand:()=>Ho,verifyDirectorySyncStressAccess:()=>Phe});import{chmod as Ehe,mkdir as P$,mkdtemp as z$,readFile as khe,readdir as Ihe,rename as Ahe,rm as ep,writeFile as Tn}from"fs/promises";import{tmpdir as N$}from"os";import{join as ct,resolve as D$}from"path";async function Che(e){let t=e.now??(()=>new Date),r=t().toISOString(),o=j$(r),n=D$(e.artifactsDir??ct(e.rootDir,".brains-ops","stress",o));await P$(n,{recursive:!0});let{pilot:i,user:s}=await L$(e.rootDir,e.handle);Eb({handle:s.handle,domain:s.domain,contentRepo:s.contentRepo,confirmation:e.confirmation});let a=xb.parse(e.profile),c=e.plan?_b.parse(e.plan):l8(a);if(c.profile!==a)throw Error(`Directory-sync stress plan profile ${c.profile} does not match requested profile ${a}`);if((c.maximumExternalAiCalls??0)===0)b8(s);let u=The.parse(e.env??process.env),d=new y8({runId:o,artifactsDir:n,user:s,githubOrg:i.githubOrg,serverLabel:`${i.contentRepoPrefix}${s.handle}`,environment:u,fetchImpl:e.fetchImpl??fetch,commandRunner:e.commandRunner??Ho,logger:e.logger??console.info,now:t,sleep:e.sleep??Bun.sleep}),f;try{f=await u8(c,d)}finally{await d.dispose()}let m={runId:o,artifactsDir:n,target:{handle:s.handle,domain:s.domain,contentRepo:`${i.githubOrg}/${s.contentRepo}`},startedAt:r,completedAt:t().toISOString(),report:f};return await Lhe(m),m}async function Phe(e){let r=(e.now??(()=>new Date))().toISOString(),o=j$(r),n=D$(e.artifactsDir??ct(e.rootDir,".brains-ops","stress",`access-check-${o}`));await P$(n,{recursive:!0});let{pilot:i,user:s}=await L$(e.rootDir,e.handle);Eb({handle:s.handle,domain:s.domain,contentRepo:s.contentRepo,confirmation:e.confirmation}),b8(s);let a=(e.env??process.env).CONTENT_REPO_ADMIN_TOKEN;if(!a)throw Error("Missing CONTENT_REPO_ADMIN_TOKEN");let c=await z$(ct(N$(),"brains-ops-directory-sync-access-check-"));try{let u=await Dl.clone(e.commandRunner??Ho,`${i.githubOrg}/${s.contentRepo}`,ct(c,"content"),a),d=await u.output(["rev-parse","HEAD"]);await u.run(["push","--dry-run","origin",`HEAD:refs/heads/ops/directory-sync-stress-access-check-${o}`]);let f={success:!0,artifactsDir:n,checkedAt:r,remoteHead:d,target:{handle:s.handle,domain:s.domain,contentRepo:`${i.githubOrg}/${s.contentRepo}`}};return await Tn(ct(n,"access-check.json"),`${JSON.stringify(f,null,2)}
|
|
427
|
+
`),f}finally{await ep(c,{recursive:!0,force:!0})}}async function zhe(e){let t=e.now??(()=>new Date),r=D$(e.artifactsDir??ct(e.rootDir,".brains-ops","stress",`cleanup-${j$(t().toISOString())}`));await P$(r,{recursive:!0});let{pilot:o,user:n}=await L$(e.rootDir,e.handle);Eb({handle:n.handle,domain:n.domain,contentRepo:n.contentRepo,confirmation:e.confirmation});let i=(e.env??process.env).CONTENT_REPO_ADMIN_TOKEN;if(!i)throw Error("Missing CONTENT_REPO_ADMIN_TOKEN");let s=e.commandRunner??Ho,a=e.logger??console.info,c=await z$(ct(N$(),"brains-ops-directory-sync-cleanup-")),u=ct(c,"content");try{let d=await Dl.clone(s,`${o.githubOrg}/${n.contentRepo}`,u,i),f=await B$(d.dir),m;if(f>0)await d.commitAll("test(directory-sync): clean residual stress probes"),await d.pushMainWithRebase(),m=await d.output(["rev-parse","HEAD"]),a(`Removed ${f} directory-sync stress probes`);let h=(await va(d.dir)).length,b=h===0?await d.pruneStressBackupBranches():[],y={success:h===0,artifactsDir:r,probesRemoved:f,probesRemaining:h,backupBranchesDeleted:b,...m?{cleanupCommit:m}:{}};return await Tn(ct(r,"cleanup.json"),`${JSON.stringify(y,null,2)}
|
|
428
|
+
`),y}finally{await ep(c,{recursive:!0,force:!0})}}class y8{#e;#t;#r;#n;#o;#i;#a;#s;#c;#l;#d;constructor(e){this.#e=e,this.#t=new O$({domain:e.user.domain,fetchImpl:e.fetchImpl,now:e.now,sleep:e.sleep,sampleRuntime:()=>this.#b(),readEntityCounts:()=>this.#y()})}async prepare(e){this.#r=await z$(ct(N$(),"brains-ops-directory-sync-stress-"));let t=ct(this.#r,"content");this.#o=ct(this.#r,"id_ed25519"),this.#i=ct(this.#r,"known_hosts"),this.#a=await this.#m(),await Tn(this.#o,Dhe(this.#e.environment.KAMAL_SSH_PRIVATE_KEY),{mode:384}),await Ehe(this.#o,384);let r=await this.#S("ssh-keyscan",["-T","10","-t","ed25519",this.#a]);if(r.exitCode!==0||!r.stdout.trim())throw Error("Unable to resolve smoke SSH host key");await Tn(this.#i,r.stdout,{mode:384});let o=await this.#h(["docker","ps","--filter","label=service=rover","--filter","label=role=web","--format","{{.Names}}"]);if(this.#s=o.stdout.trim().split(/\r?\n/)[0],!this.#s||!/^[A-Za-z0-9_.-]+$/.test(this.#s))throw Error("Unable to resolve a running smoke container");let n=await Dl.clone(this.#e.commandRunner,`${this.#e.githubOrg}/${this.#e.user.contentRepo}`,t,this.#e.environment.CONTENT_REPO_ADMIN_TOKEN);if(this.#n=n,(await va(n.dir)).length>0)throw Error("Directory-sync stress probes already exist");let i=await n.output(["rev-parse","HEAD"]);this.#l=await n.output(["rev-parse","HEAD^{tree}"]),this.#d=await this.#f();let s=await this.#t.waitForHealthSnapshot(60000);if(!s)throw Error("Smoke health was unavailable before stress testing");return this.#c=`ops/directory-sync-stress-backup-${this.#e.runId}`,await n.run(["push","origin",`HEAD:refs/heads/${this.#c}`]),await this.#t.discoverEndpoints(),await Tn(ct(this.#e.artifactsDir,"state.json"),`${JSON.stringify({runId:this.#e.runId,profile:e.profile,originalHead:i,originalTree:this.#l,backupBranch:this.#c,baseline:{entities:s.entities,notes:Yf(s),version:s.version}},null,2)}
|
|
429
|
+
`),this.#e.logger(`Prepared ${e.profile} directory-sync stress run for ${this.#e.user.handle}`),{entities:s.entities,notes:Yf(s),version:s.version}}async startMonitoring(){this.#v(),this.#t.start()}async executePhase(e,t){this.#v();let r=this.#n;if(!r)throw Error("Directory-sync stress checkout is not prepared");await r.sync();let o=this.#t.healthSamples.length,n=this.#e.now().getTime(),i=await this.#g();if(i?.pending!==0||i.processing!==0)return Ll(e,"health did not provide a drained queue before the phase");await S8(r.dir,e),await r.commitAll(`test(directory-sync): stress ${e.id}`),await r.pushMainWithRebase();let s=this.#e.now().getTime(),a=await r.output(["rev-parse","HEAD"]),c=await this.#p(a,900000);if(c===void 0)return Ll(e,"runtime did not pull the phase commit");let u;if(e.operation==="rename"){let h=t.notes+e.targetProbeCount;if(e.settleMs>0)await this.#e.sleep(e.settleMs);let b=await this.#t.waitForStableEntityBaseline(h,void 0,1200000);if(u=this.#e.now().getTime()-s,!b)return Ll(e,`health did not stabilize at ${h} notes`,c,u)}else if(e.operation==="add"||e.operation==="delete"){let h=t.notes+e.targetProbeCount,b=this.#e.now().getTime(),y=await this.#t.waitForEntityBaseline(h,void 0,1200000);if(u=this.#e.now().getTime()-b,!y)return Ll(e,`health did not reach ${h} notes`,c,u)}if(e.operation!=="rename"&&e.settleMs>0)await this.#e.sleep(e.settleMs);let d=e.operation==="delete"?0:Math.ceil(e.count/50);if(!await this.#u(i.completedImports+d,1200000))return Ll(e,`health did not observe ${d} completed import job(s) with a drained queue`,c,u);let m=this.#t.healthSamples.slice(o).find((h)=>!h.ok);if(m)return Ll(e,`${m.endpoint} unavailable (${m.status===0?m.error??"unknown":m.status})`,c,u);return this.#e.logger(`Completed ${e.id} in ${this.#e.now().getTime()-n}ms`),{id:e.id,operation:e.operation,count:e.count,success:!0,commitLatencyMs:c,...u===void 0?{}:{persistenceLatencyMs:u}}}async cleanup(e){let t=this.#n;if(!t)return{success:!1,probesRemaining:0,error:"stress checkout was not prepared"};try{if(await t.sync(!0),await B$(t.dir)>0)await t.commitAll("test(directory-sync): remove stress probes"),await t.pushMainWithRebase();let o=(await va(t.dir)).length;this.#t.markGateEnd();let n=await this.#t.waitForEntityBaseline(e.notes,e.entities,1200000);await t.sync(!0);let s=await t.output(["rev-parse","HEAD^{tree}"])===this.#l,a=o===0&&n!==void 0&&s;if(a&&this.#c){if((await t.run(["push","origin","--delete",this.#c],!1)).exitCode!==0)this.#e.logger(`Warning: unable to delete backup branch ${this.#c}`)}return{success:a,probesRemaining:o,...n?{finalEntities:n.entities,finalNotes:Yf(n)}:{},contentTreeRestored:s,...!a?{error:!n?"entity baseline was not restored before cleanup timeout":!s?"content tree differs from the pre-stress baseline":"stress probes remain after cleanup"}:{}}}catch(r){return{success:!1,probesRemaining:(await va(t.dir)).length,error:Ve(r)}}}async stopMonitoring(){await this.#t.stop(),await Tn(ct(this.#e.artifactsDir,"health-samples.json"),`${JSON.stringify(this.#t.healthSamples,null,2)}
|
|
430
|
+
`);let e=0;if(this.#s&&this.#t.startedAt){let o=await this.#h(["docker","logs","--since",this.#t.startedAt,this.#s],!1),n=`${o.stdout}${o.stderr}`;e=n.match(/\] ai:usage \{/g)?.length??0,await Tn(ct(this.#e.artifactsDir,"runtime.log"),n)}let t=await this.#f(),r={health:this.#t.gateHealthSamples(),runtime:[...this.#t.runtimeSamples],externalAiCalls:e,...t?{container:t}:{}};if(this.#t.error)throw this.#t.error;return r}async dispose(){if(await this.#t.stop(),this.#r)await ep(this.#r,{recursive:!0,force:!0})}async#f(){if(!this.#s)return;let e=await this.#h(["docker","inspect",this.#s],!1);if(e.exitCode!==0)throw Error(`docker inspect ${this.#s} exited with code ${e.exitCode}`);let t;try{t=l.array(l.object({RestartCount:l.number().int().nonnegative(),State:l.object({Status:l.string(),OOMKilled:l.boolean(),StartedAt:l.string().min(1)})})).parse(JSON.parse(e.stdout))}catch(i){throw Error(`Could not read docker inspect output for ${this.#s}`,{cause:i})}let r=t[0];if(!r)throw Error("docker inspect reported no such container");let o=Math.max(0,r.RestartCount-(this.#d?.restartCount??0)),n=this.#d!==void 0&&r.State.StartedAt!==this.#d.startedAt;return{status:r.State.Status,restartCount:Math.max(o,n?1:0),oomKilled:r.State.OOMKilled&&!(this.#d?.oomKilled??!1),startedAt:r.State.StartedAt}}async#m(){let e=encodeURIComponent(`brain=${this.#e.serverLabel}`),t=await this.#e.fetchImpl(`https://api.hetzner.cloud/v1/servers?label_selector=${e}`,{headers:{Authorization:`Bearer ${this.#e.environment.HCLOUD_TOKEN}`}});if(!t.ok)throw Error(`Hetzner server lookup failed with ${t.status}`);let o=Rhe.parse(await t.json()).servers[0];if(o?.status!=="running")throw Error("Smoke server is not running");return o.public_net.ipv4.ip}async#p(e,t){let r=this.#s;if(!r)throw Error("Directory-sync stress container is not prepared");let o=this.#e.now().getTime();while(this.#e.now().getTime()-o<t){if((await this.#h(["docker","exec",r,"git","-C","/app/brain-data","merge-base","--is-ancestor",e,"HEAD"],!1)).exitCode===0)return this.#e.now().getTime()-o;await this.#e.sleep(5000)}return}async#g(){let e=new AbortController,t=setTimeout(()=>e.abort(),20000),r;try{let i=await this.#e.fetchImpl(`https://${this.#e.user.domain}/health/operate`,{method:"GET",signal:e.signal});if(!i.ok)return;r=await i.json()}catch{return}finally{clearTimeout(t)}let o=$he.safeParse(r);if(!o.success)throw Error(`Unexpected /health/operate payload from ${this.#e.user.domain}`,{cause:o.error});let n=o.data.resources.queue.byType.filter((i)=>i.type==="directory-sync:directory-import"&&i.status==="completed").reduce((i,s)=>i+s.count,0);return{pending:o.data.resources.queue.totals.pending,processing:o.data.resources.queue.totals.processing,completedImports:n}}async#u(e,t){let r=this.#e.now().getTime(),o=0;while(this.#e.now().getTime()-r<t){let n=await this.#g();if(n?.pending===0&&n.processing===0&&n.completedImports>=e){if(o+=1,o===2)return!0}else o=0;await this.#e.sleep(5000)}return!1}async#y(){let e=this.#s;if(!e)throw Error("Directory-sync stress container is not prepared");let t=await this.#h(["docker","exec",e,"bun","-e",`'${Ohe}'`],!1);if(t.exitCode!==0)return;try{return m8.parse(JSON.parse(t.stdout))}catch(r){throw Error(`Could not read entity counts from ${e}`,{cause:r})}}async#b(){let e=this.#s;if(!e)throw Error("Directory-sync stress container is not prepared");let t=await this.#h(["timeout","15","docker","stats","--no-stream","--format","{{.CPUPerc}},{{.MemPerc}},{{.PIDs}}",e],!1);return v8(t.stdout.trim(),this.#e.now().toISOString())}async#h(e,t=!0){let r=this.#o,o=this.#i,n=this.#a;if(!r||!o||!n)throw Error("Directory-sync stress SSH access is not prepared");let i=await this.#S("ssh",["-i",r,"-o","BatchMode=yes","-o","IdentitiesOnly=yes","-o","ConnectTimeout=10","-o","StrictHostKeyChecking=yes","-o",`UserKnownHostsFile=${o}`,`root@${n}`,...e]);if(t&&i.exitCode!==0)throw no("ssh",e,i);return i}async#S(e,t,r){return this.#e.commandRunner(e,t,r)}#v(){if(!this.#n||!this.#o||!this.#i||!this.#a||!this.#s)throw Error("Directory-sync stress driver is not prepared")}}function b8(e){if(e.embeddingEnabled!==!1)throw Error("Directory-sync stress requires embeddingEnabled: false for a hermetic smoke workload");if(e.topicExtractionEnabled!==!1)throw Error("Directory-sync stress requires topicExtractionEnabled: false for a hermetic smoke workload");if(e.skillDerivationEnabled!==!1)throw Error("Directory-sync stress requires skillDerivationEnabled: false for a hermetic smoke workload");if(e.swotDerivationEnabled!==!1)throw Error("Directory-sync stress requires swotDerivationEnabled: false for a hermetic smoke workload")}async function L$(e,t){let r=await wt(e),o=r.users.find((n)=>n.handle===t);if(!o)throw Error(`Unknown pilot user: ${t}`);return{pilot:r.pilot,user:o}}async function S8(e,t){let r=await va(e);switch(t.operation){case"add":{let o=t.targetProbeCount-r.length;if(o!==t.count)throw Error(`${t.id} expected to add ${t.count} probes from ${r.length}`);let n=r.map(Nhe).filter((s)=>s!==void 0),i=n.length===0?1:Math.max(...n)+1;for(let s=i;s<i+o;s+=1){let a=String(s).padStart(3,"0");await Tn(ct(e,`directory-sync-stress-${a}.md`),["---",`title: "Directory Sync Stress ${a}"`,"---","",`Deterministic directory-sync stress probe ${a}.`,"Payload: abcdefghijklmnopqrstuvwxyz-0123456789-abcdefghijklmnopqrstuvwxyz.",""].join(`
|
|
431
|
+
`))}break}case"update":{if(r.length!==t.count)throw Error(`${t.id} expected ${t.count} probes, found ${r.length}`);for(let o of r){let n=ct(e,o),i=await khe(n,"utf8");await Tn(n,`${i.trimEnd()}
|
|
432
|
+
|
|
433
|
+
Update marker: ${t.id}.
|
|
434
|
+
`)}break}case"rename":{let o=r.filter((n)=>/^directory-sync-stress-\d+\.md$/.test(n)).slice(0,t.count);if(o.length!==t.count)throw Error(`${t.id} expected ${t.count} unrenamed probes, found ${o.length}`);for(let n of o)await Ahe(ct(e,n),ct(e,n.replace("directory-sync-stress-","directory-sync-stress-renamed-")));break}case"delete":{if(r.length!==t.count)throw Error(`${t.id} expected ${t.count} probes, found ${r.length}`);await Promise.all(r.map((o)=>ep(ct(e,o),{force:!0})));break}}}async function va(e){return(await Ihe(e)).filter((r)=>/^directory-sync-stress-(?:renamed-)?\d+\.md$/.test(r)&&!r.includes("/")).sort()}async function B$(e){let t=await va(e);return await Promise.all(t.map((r)=>ep(ct(e,r),{force:!0}))),t.length}function Nhe(e){let t=e.match(/(\d+)\.md$/)?.[1];return t?Number.parseInt(t,10):void 0}function Ll(e,t,r,o){return{id:e.id,operation:e.operation,count:e.count,success:!1,...r===void 0?{}:{commitLatencyMs:r},...o===void 0?{}:{persistenceLatencyMs:o},error:t}}function v8(e,t){let[r,o,n]=e.split(",");if(!r||!o||!n)return;let i=Number.parseFloat(r.replace("%","")),s=Number.parseFloat(o.replace("%","")),a=Number.parseInt(n,10);if(!Number.isFinite(i)||!Number.isFinite(s)||!Number.isFinite(a))return;return{timestamp:t,cpuPercent:i,memoryPercent:s,pids:a}}function Dhe(e){return`${e.replace(/\r\n/g,`
|
|
435
|
+
`).replace(/\\n/g,`
|
|
436
|
+
`).trimEnd()}
|
|
437
|
+
`}function j$(e){return e.replace(/[-:.TZ]/g,"").slice(0,14)}async function Lhe(e){await Tn(ct(e.artifactsDir,"report.json"),`${JSON.stringify(e,null,2)}
|
|
438
|
+
`),await Tn(ct(e.artifactsDir,"report.md"),Bhe(e))}function Bhe(e){let t=e.report.metrics.runtime,r=e.report.metrics.health,o=t.map((a)=>a.cpuPercent).sort((a,c)=>a-c),n=t.map((a)=>a.memoryPercent),i=r.filter((a)=>!a.ok),s=["# Directory-sync stress report","",`- Run: \`${e.runId}\``,`- Target: \`${e.target.handle}\` (${e.target.domain})`,`- Profile: \`${e.report.profile}\``,`- Version: \`${e.report.baseline.version}\``,`- Result: **${e.report.success?"PASS":"FAIL"}**`,`- Started: ${e.startedAt}`,`- Completed: ${e.completedAt}`,"","## Phases","","| Phase | Operation | Count | Result | Pull latency | Persistence latency |","| --- | --- | ---: | --- | ---: | ---: |",...e.report.phases.map((a)=>`| ${a.id} | ${a.operation} | ${a.count} | ${a.success?"pass":`fail: ${a.error??"unknown"}`} | ${g8(a.commitLatencyMs)} | ${g8(a.persistenceLatencyMs)} |`),"","## Runtime","",`- Samples: ${t.length}`,`- CPU p50/p95/p99/max: ${Xf(C$(o,0.5))} / ${Xf(C$(o,0.95))} / ${Xf(C$(o,0.99))} / ${Xf(o.at(-1))}`,`- Memory max: ${Xf(n.length?Math.max(...n):void 0)}`,`- PIDs max: ${t.length?Math.max(...t.map((a)=>a.pids)):"n/a"}`,`- Container status/restarts/OOM: ${e.report.metrics.container?`${e.report.metrics.container.status} / ${e.report.metrics.container.restartCount} / ${e.report.metrics.container.oomKilled}`:"unknown"}`,`- External AI calls: ${e.report.metrics.externalAiCalls??0}`,`- Health samples: ${r.length}`,`- Health failures: ${i.length}`,"","## Cleanup","",`- Result: ${e.report.cleanup.success?"pass":"fail"}`,`- Remaining probes: ${e.report.cleanup.probesRemaining}`,`- Final entities: ${e.report.cleanup.finalEntities??"unknown"}`,`- Final notes: ${e.report.cleanup.finalNotes??"unknown"}`,`- Content tree restored: ${e.report.cleanup.contentTreeRestored??"unknown"}`,""];if(e.report.failure)s.push("## Failure","",e.report.failure,"");return`${s.join(`
|
|
439
|
+
`)}
|
|
440
|
+
`}function C$(e,t){if(e.length===0)return;let r=Math.max(0,Math.ceil(e.length*t)-1);return e[r]}function Xf(e){return e===void 0?"n/a":`${e.toFixed(2)}%`}function g8(e){return e===void 0?"n/a":`${(e/1000).toFixed(1)}s`}var The,Rhe,$he,Ohe;var Ib=v(()=>{pe();$$();hn();Qf();p8();h8();Qf();The=l.object({HCLOUD_TOKEN:l.string().min(1),KAMAL_SSH_PRIVATE_KEY:l.string().min(1),CONTENT_REPO_ADMIN_TOKEN:l.string().min(1)}),Rhe=l.object({servers:l.array(l.object({id:l.number().int(),status:l.string(),public_net:l.object({ipv4:l.object({ip:l.string().min(1)})})}))}),$he=l.object({status:l.literal("ready"),operationalStatus:l.literal("operational"),resources:l.object({queue:l.object({totals:l.object({pending:l.number().int().nonnegative(),processing:l.number().int().nonnegative()}),byType:l.array(l.object({type:l.string(),status:l.string(),count:l.number().int().nonnegative()}))})})}),Ohe=['import { Database } from "bun:sqlite";','const path = (process.env.XDG_DATA_HOME || "./data") + "/brain.db";',"const db = new Database(path, { readonly: true });",'const rows = db.query(`SELECT "entityType" AS "entityType", COUNT(*) AS "count" FROM entities GROUP BY "entityType"`).all();',"process.stdout.write(JSON.stringify(rows));"].join(" ")});var w8=v(()=>{bi()});var jhe="/usr/local/sbin/brains-health-watchdog",Zhe="ai.rizom.brain.watchdog",Uhe="true",Z$,x8,n5e;var _8=v(async()=>{w8();Z$=`${Zhe}=${Uhe}`,x8=`#!/usr/bin/env bash
|
|
441
|
+
set -euo pipefail
|
|
442
|
+
umask 077
|
|
443
|
+
|
|
444
|
+
lock_path="\${BRAIN_WATCHDOG_LOCK_PATH:-/run/brains-health-watchdog.lock}"
|
|
445
|
+
exec 9>"$lock_path"
|
|
446
|
+
flock -n 9 || exit 0
|
|
447
|
+
|
|
448
|
+
incident_dir="\${BRAIN_WATCHDOG_INCIDENT_DIR:-/var/log/brains-health-watchdog}"
|
|
449
|
+
state_dir="\${BRAIN_WATCHDOG_STATE_DIR:-/var/lib/brains-health-watchdog}"
|
|
450
|
+
MAX_RESTARTS=3
|
|
451
|
+
WINDOW_SECONDS=3600
|
|
452
|
+
mkdir -p "$incident_dir" "$state_dir"
|
|
453
|
+
|
|
454
|
+
write_safe_inspect() {
|
|
455
|
+
docker inspect --format '{"id":{{json .Id}},"name":{{json .Name}},"image":{{json .Config.Image}},"state":{{json .State}},"restartPolicy":{{json .HostConfig.RestartPolicy}}}' "$1"
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
while read -r container_id; do
|
|
459
|
+
[ -n "$container_id" ] || continue
|
|
460
|
+
service_name=$(docker inspect --format '{{ index .Config.Labels "service" }}' "$container_id" 2>/dev/null || true)
|
|
461
|
+
container_name=$(docker inspect --format '{{ .Name }}' "$container_id" 2>/dev/null | tr -d '/' || true)
|
|
462
|
+
state_key=$(printf '%s-%s-%s' "$service_name" "$container_name" "$container_id" | tr -c 'A-Za-z0-9_.-' '_')
|
|
463
|
+
state_path="$state_dir/$state_key.restarts"
|
|
464
|
+
recent_path="$state_path.tmp"
|
|
465
|
+
now_epoch=$(date -u +%s)
|
|
466
|
+
cutoff_epoch=$((now_epoch - WINDOW_SECONDS))
|
|
467
|
+
touch "$state_path"
|
|
468
|
+
awk -v cutoff="$cutoff_epoch" '$1 >= cutoff' "$state_path" >"$recent_path"
|
|
469
|
+
restart_count=$(wc -l <"$recent_path")
|
|
470
|
+
|
|
471
|
+
timestamp=$(date -u +%Y%m%dT%H%M%SZ)
|
|
472
|
+
incident_path="$incident_dir/$timestamp-$state_key.log"
|
|
473
|
+
temporary_path="$incident_path.tmp"
|
|
474
|
+
|
|
475
|
+
if [ "$restart_count" -ge "$MAX_RESTARTS" ]; then
|
|
476
|
+
{
|
|
477
|
+
printf '{"timestamp":"%s","event":"restart-suppressed","reason":"restart-budget-exhausted","service":"%s","container":"%s","restartsInWindow":%s}\\n' "$timestamp" "$service_name" "$container_name" "$restart_count"
|
|
478
|
+
write_safe_inspect "$container_id"
|
|
479
|
+
docker logs --timestamps --tail 1000 "$container_id"
|
|
480
|
+
} >"$temporary_path" 2>&1
|
|
481
|
+
mv "$temporary_path" "$incident_path"
|
|
482
|
+
mv "$recent_path" "$state_path"
|
|
483
|
+
logger -t brains-health-watchdog "restart budget exhausted container=$container_name service=$service_name incident=$incident_path"
|
|
484
|
+
continue
|
|
485
|
+
fi
|
|
486
|
+
|
|
487
|
+
{
|
|
488
|
+
printf '{"timestamp":"%s","event":"container-restart","reason":"docker-health-unhealthy","service":"%s","container":"%s"}\\n' "$timestamp" "$service_name" "$container_name"
|
|
489
|
+
write_safe_inspect "$container_id"
|
|
490
|
+
docker logs --timestamps --tail 1000 "$container_id"
|
|
491
|
+
} >"$temporary_path" 2>&1
|
|
492
|
+
mv "$temporary_path" "$incident_path"
|
|
493
|
+
printf '%s\\n' "$now_epoch" >>"$recent_path"
|
|
494
|
+
mv "$recent_path" "$state_path"
|
|
495
|
+
|
|
496
|
+
logger -t brains-health-watchdog "restarting unhealthy container=$container_name service=$service_name incident=$incident_path"
|
|
497
|
+
docker restart "$container_id"
|
|
498
|
+
done < <(docker ps --filter health=unhealthy --filter label=${Z$} --format '{{.ID}}')
|
|
499
|
+
`,n5e=`[Unit]
|
|
500
|
+
Description=Restart persistently unhealthy Brain containers
|
|
501
|
+
After=docker.service
|
|
502
|
+
Requires=docker.service
|
|
503
|
+
|
|
504
|
+
[Service]
|
|
505
|
+
Type=oneshot
|
|
506
|
+
ExecStart=${jhe}
|
|
507
|
+
`});var k8=`#!/usr/bin/env bash
|
|
508
|
+
set -euo pipefail
|
|
509
|
+
umask 077
|
|
510
|
+
|
|
511
|
+
mode="\${1:?run or cleanup mode is required}"
|
|
512
|
+
run_id="\${2:?smoke run ID is required}"
|
|
513
|
+
watchdog_payload_base64="__WATCHDOG_PAYLOAD_BASE64__"
|
|
514
|
+
watchdog_label_filter="__WATCHDOG_LABEL_FILTER__"
|
|
515
|
+
remote_dir="/tmp/brains-health-watchdog-smoke-$run_id"
|
|
516
|
+
image="alpine:3.20"
|
|
517
|
+
prefix="brains-watchdog-smoke-$run_id"
|
|
518
|
+
smoke_brain="$prefix-brain"
|
|
519
|
+
unrelated="$prefix-unrelated"
|
|
520
|
+
false_label="$prefix-false"
|
|
521
|
+
healthy_brain="$prefix-healthy"
|
|
522
|
+
containers=("$smoke_brain" "$unrelated" "$false_label" "$healthy_brain")
|
|
523
|
+
|
|
524
|
+
pass() {
|
|
525
|
+
printf 'PASS %s\\n' "$1"
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
fail() {
|
|
529
|
+
printf 'FAIL %s\\n' "$1" >&2
|
|
530
|
+
exit 1
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
cleanup_fixtures() {
|
|
534
|
+
docker rm -f "\${containers[@]}" >/dev/null 2>&1 || true
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
cleanup_on_exit() {
|
|
538
|
+
status=$?
|
|
539
|
+
trap - EXIT
|
|
540
|
+
cleanup_fixtures
|
|
541
|
+
exit "$status"
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
wait_for_health() {
|
|
545
|
+
container="$1"
|
|
546
|
+
expected="$2"
|
|
547
|
+
for _attempt in $(seq 1 40); do
|
|
548
|
+
actual=$(docker inspect --format '{{.State.Health.Status}}' "$container" 2>/dev/null || true)
|
|
549
|
+
if [ "$actual" = "$expected" ]; then
|
|
550
|
+
return 0
|
|
551
|
+
fi
|
|
552
|
+
sleep 1
|
|
553
|
+
done
|
|
554
|
+
fail "container $container did not reach health=$expected"
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
started_at() {
|
|
558
|
+
docker inspect --format '{{.State.StartedAt}}' "$1"
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
if [ "$(id -u)" -ne 0 ]; then
|
|
562
|
+
fail "watchdog smoke requires the fleet deployment's root SSH posture"
|
|
563
|
+
fi
|
|
564
|
+
command -v docker >/dev/null 2>&1 || fail "missing remote command: docker"
|
|
565
|
+
|
|
566
|
+
if [ "$mode" = "cleanup" ]; then
|
|
567
|
+
cleanup_fixtures
|
|
568
|
+
rm -rf -- "$remote_dir"
|
|
569
|
+
pass "removed residual watchdog smoke fixtures for $run_id"
|
|
570
|
+
exit 0
|
|
571
|
+
fi
|
|
572
|
+
[ "$mode" = "run" ] || fail "unknown watchdog smoke mode: $mode"
|
|
573
|
+
trap cleanup_on_exit EXIT
|
|
574
|
+
|
|
575
|
+
mkdir -p "$remote_dir/incidents" "$remote_dir/state"
|
|
576
|
+
for command in awk base64 cmp find flock grep logger systemctl; do
|
|
577
|
+
command -v "$command" >/dev/null 2>&1 || fail "missing remote command: $command"
|
|
578
|
+
done
|
|
579
|
+
expected_watchdog="$remote_dir/expected-watchdog.sh"
|
|
580
|
+
printf '%s' "$watchdog_payload_base64" | base64 --decode >"$expected_watchdog"
|
|
581
|
+
chmod 0700 "$expected_watchdog"
|
|
582
|
+
bash -n "$expected_watchdog"
|
|
583
|
+
pass "rendered packaged watchdog payload is valid Bash"
|
|
584
|
+
|
|
585
|
+
systemctl is-enabled --quiet brains-health-watchdog.timer || fail "watchdog timer is not enabled"
|
|
586
|
+
systemctl is-active --quiet brains-health-watchdog.timer || fail "watchdog timer is not active"
|
|
587
|
+
installed_watchdog="/usr/local/sbin/brains-health-watchdog"
|
|
588
|
+
[ -x "$installed_watchdog" ] || fail "fleet deployment did not install $installed_watchdog"
|
|
589
|
+
grep -Fq -- "--filter label=$watchdog_label_filter" "$installed_watchdog" || fail "installed watchdog lacks the exact Brain selector"
|
|
590
|
+
if grep -Fq -- "--filter label=service " "$installed_watchdog"; then
|
|
591
|
+
fail "installed watchdog still contains the generic service selector"
|
|
592
|
+
fi
|
|
593
|
+
cmp -s "$expected_watchdog" "$installed_watchdog" || fail "installed watchdog differs from the packaged canonical payload; deploy the smoke target first"
|
|
594
|
+
pass "installed fleet watchdog matches the packaged payload and uses only the exact Brain selector"
|
|
595
|
+
|
|
596
|
+
exec 8>/run/brains-health-watchdog.lock
|
|
597
|
+
flock -n 8 || fail "installed watchdog is currently running; retry later"
|
|
598
|
+
pass "installed timer is isolated behind its global watchdog lock"
|
|
599
|
+
|
|
600
|
+
mapfile -t deployed_containers < <(
|
|
601
|
+
docker ps \\
|
|
602
|
+
--filter label=service=rover \\
|
|
603
|
+
--filter label=role=web \\
|
|
604
|
+
--format '{{.Names}}'
|
|
605
|
+
)
|
|
606
|
+
[ "\${#deployed_containers[@]}" -eq 1 ] || fail "expected one running rover web container, found \${#deployed_containers[@]}"
|
|
607
|
+
deployed_container="\${deployed_containers[0]}"
|
|
608
|
+
actual_label=$(docker inspect --format '{{ index .Config.Labels "ai.rizom.brain.watchdog" }}' "$deployed_container")
|
|
609
|
+
[ "$actual_label" = "true" ] || fail "deployed rover container lacks ai.rizom.brain.watchdog=true"
|
|
610
|
+
actual_health=$(docker inspect --format '{{.State.Health.Status}}' "$deployed_container" 2>/dev/null || true)
|
|
611
|
+
[ "$actual_health" = "healthy" ] || fail "deployed rover container is not Docker-healthy"
|
|
612
|
+
healthcheck=$(docker inspect --format '{{json .Config.Healthcheck.Test}}' "$deployed_container")
|
|
613
|
+
printf '%s' "$healthcheck" | grep -Fq '/health/live' || fail "Docker healthcheck does not use /health/live"
|
|
614
|
+
if printf '%s' "$healthcheck" | grep -Fq '/health/operate'; then
|
|
615
|
+
fail "Docker healthcheck unexpectedly uses /health/operate"
|
|
616
|
+
fi
|
|
617
|
+
deployed_started_before=$(started_at "$deployed_container")
|
|
618
|
+
pass "deployed fleet image inherited the ownership label and liveness healthcheck"
|
|
619
|
+
|
|
620
|
+
live_status=$(docker exec "$deployed_container" curl --silent --output /dev/null --write-out '%{http_code}' http://127.0.0.1:8080/health/live || true)
|
|
621
|
+
[ "$live_status" = "200" ] || fail "deployed /health/live returned $live_status"
|
|
622
|
+
operate_status=$(docker exec "$deployed_container" curl --silent --output /dev/null --write-out '%{http_code}' http://127.0.0.1:8080/health/operate || true)
|
|
623
|
+
case "$operate_status" in
|
|
624
|
+
200) pass "/health/operate is currently healthy; Docker remains tied to /health/live" ;;
|
|
625
|
+
503) pass "/health/operate is degraded while Docker liveness remains healthy" ;;
|
|
626
|
+
*) fail "deployed /health/operate returned unexpected status $operate_status" ;;
|
|
627
|
+
esac
|
|
628
|
+
|
|
629
|
+
preexisting=$(docker ps --filter health=unhealthy --filter "label=$watchdog_label_filter" --format '{{.ID}}')
|
|
630
|
+
[ -z "$preexisting" ] || fail "pre-existing unhealthy Brain-labelled container detected: $preexisting"
|
|
631
|
+
|
|
632
|
+
docker image inspect "$image" >/dev/null 2>&1 || docker pull "$image" >"$remote_dir/docker-pull.log"
|
|
633
|
+
health_args=(--health-interval 1s --health-timeout 1s --health-retries 1 --health-start-period 1s)
|
|
634
|
+
docker run -d --name "$smoke_brain" \\
|
|
635
|
+
--label ai.rizom.brain.watchdog=true \\
|
|
636
|
+
--label service=watchdog-smoke-brain \\
|
|
637
|
+
--health-cmd 'exit 1' "\${health_args[@]}" \\
|
|
638
|
+
"$image" sh -c 'echo smoke-brain-start; exec sleep 600' >/dev/null
|
|
639
|
+
docker run -d --name "$unrelated" \\
|
|
640
|
+
--label service=watchdog-smoke-unrelated \\
|
|
641
|
+
--health-cmd 'exit 1' "\${health_args[@]}" \\
|
|
642
|
+
"$image" sh -c 'echo smoke-unrelated-start; exec sleep 600' >/dev/null
|
|
643
|
+
docker run -d --name "$false_label" \\
|
|
644
|
+
--label ai.rizom.brain.watchdog=false \\
|
|
645
|
+
--label service=watchdog-smoke-false \\
|
|
646
|
+
--health-cmd 'exit 1' "\${health_args[@]}" \\
|
|
647
|
+
"$image" sh -c 'echo smoke-false-start; exec sleep 600' >/dev/null
|
|
648
|
+
docker run -d --name "$healthy_brain" \\
|
|
649
|
+
--label ai.rizom.brain.watchdog=true \\
|
|
650
|
+
--label service=watchdog-smoke-healthy \\
|
|
651
|
+
--health-cmd 'exit 0' "\${health_args[@]}" \\
|
|
652
|
+
"$image" sh -c 'echo smoke-healthy-start; exec sleep 600' >/dev/null
|
|
653
|
+
|
|
654
|
+
wait_for_health "$smoke_brain" unhealthy
|
|
655
|
+
wait_for_health "$unrelated" unhealthy
|
|
656
|
+
wait_for_health "$false_label" unhealthy
|
|
657
|
+
wait_for_health "$healthy_brain" healthy
|
|
658
|
+
pass "watchdog isolation fixtures reached their expected health states"
|
|
659
|
+
|
|
660
|
+
smoke_brain_id=$(docker ps --filter "name=^/$smoke_brain$" --format '{{.ID}}')
|
|
661
|
+
smoke_brain_full_id=$(docker inspect --format '{{.Id}}' "$smoke_brain")
|
|
662
|
+
unrelated_full_id=$(docker inspect --format '{{.Id}}' "$unrelated")
|
|
663
|
+
false_full_id=$(docker inspect --format '{{.Id}}' "$false_label")
|
|
664
|
+
healthy_full_id=$(docker inspect --format '{{.Id}}' "$healthy_brain")
|
|
665
|
+
unrelated_started_before=$(started_at "$unrelated")
|
|
666
|
+
false_started_before=$(started_at "$false_label")
|
|
667
|
+
healthy_started_before=$(started_at "$healthy_brain")
|
|
668
|
+
|
|
669
|
+
successful_restarts=0
|
|
670
|
+
for attempt in 1 2 3 4; do
|
|
671
|
+
wait_for_health "$smoke_brain" unhealthy
|
|
672
|
+
eligible=$(docker ps --filter health=unhealthy --filter "label=$watchdog_label_filter" --format '{{.ID}}')
|
|
673
|
+
[ "$eligible" = "$smoke_brain_id" ] || fail "unexpected watchdog eligibility set before attempt $attempt: $eligible"
|
|
674
|
+
started_before=$(started_at "$smoke_brain")
|
|
675
|
+
BRAIN_WATCHDOG_INCIDENT_DIR="$remote_dir/incidents" \\
|
|
676
|
+
BRAIN_WATCHDOG_STATE_DIR="$remote_dir/state" \\
|
|
677
|
+
BRAIN_WATCHDOG_LOCK_PATH="$remote_dir/watchdog.lock" \\
|
|
678
|
+
"$installed_watchdog" \\
|
|
679
|
+
>"$remote_dir/watchdog-$attempt.stdout.log" \\
|
|
680
|
+
2>"$remote_dir/watchdog-$attempt.stderr.log"
|
|
681
|
+
started_after=$(started_at "$smoke_brain")
|
|
682
|
+
if [ "$attempt" -le 3 ]; then
|
|
683
|
+
[ "$started_before" != "$started_after" ] || fail "attempt $attempt did not restart the eligible Brain fixture"
|
|
684
|
+
successful_restarts=$((successful_restarts + 1))
|
|
685
|
+
else
|
|
686
|
+
[ "$started_before" = "$started_after" ] || fail "attempt 4 exceeded the three-per-hour restart budget"
|
|
687
|
+
fi
|
|
688
|
+
done
|
|
689
|
+
[ "$successful_restarts" -eq 3 ] || fail "expected three successful restarts, got $successful_restarts"
|
|
690
|
+
pass "eligible Brain fixture restarted three times and was then suppressed"
|
|
691
|
+
|
|
692
|
+
[ "$(started_at "$unrelated")" = "$unrelated_started_before" ] || fail "unrelated service-labelled container was restarted"
|
|
693
|
+
[ "$(started_at "$false_label")" = "$false_started_before" ] || fail "false-labelled container was restarted"
|
|
694
|
+
[ "$(started_at "$healthy_brain")" = "$healthy_started_before" ] || fail "healthy Brain-labelled container was restarted"
|
|
695
|
+
[ "$(started_at "$deployed_container")" = "$deployed_started_before" ] || fail "deployed rover container changed during isolation smoke"
|
|
696
|
+
pass "ineligible fixtures and the deployed rover container were untouched"
|
|
697
|
+
|
|
698
|
+
mapfile -t state_files < <(find "$remote_dir/state" -maxdepth 1 -type f -name '*.restarts' -print)
|
|
699
|
+
[ "\${#state_files[@]}" -eq 1 ] || fail "expected one restart state file, found \${#state_files[@]}"
|
|
700
|
+
printf '%s' "\${state_files[0]}" | grep -Fq "$smoke_brain_id" || fail "restart state is not keyed by the eligible container ID"
|
|
701
|
+
restart_count=$(wc -l <"\${state_files[0]}" | tr -d ' ')
|
|
702
|
+
[ "$restart_count" -eq 3 ] || fail "restart state contains $restart_count entries instead of 3"
|
|
703
|
+
|
|
704
|
+
mapfile -t incident_files < <(find "$remote_dir/incidents" -maxdepth 1 -type f -name '*.log' -print)
|
|
705
|
+
[ "\${#incident_files[@]}" -ge 1 ] || fail "no watchdog incidents were captured"
|
|
706
|
+
grep -R -Fq 'smoke-brain-start' "$remote_dir/incidents" || fail "eligible container diagnostics were not captured"
|
|
707
|
+
grep -R -Fq 'restart-budget-exhausted' "$remote_dir/incidents" || fail "restart-budget suppression incident was not captured"
|
|
708
|
+
for untouched_id in "$unrelated_full_id" "$false_full_id" "$healthy_full_id"; do
|
|
709
|
+
if grep -R -Fq "$untouched_id" "$remote_dir/incidents"; then
|
|
710
|
+
fail "incident output contains an ineligible container ID"
|
|
711
|
+
fi
|
|
712
|
+
done
|
|
713
|
+
pass "incident and state artifacts exist only for the eligible Brain fixture"
|
|
714
|
+
|
|
715
|
+
cat >"$remote_dir/summary.txt" <<EOF
|
|
716
|
+
run_id=$run_id
|
|
717
|
+
deployed_container=$deployed_container
|
|
718
|
+
deployed_container_label=$actual_label
|
|
719
|
+
deployed_container_health=$actual_health
|
|
720
|
+
deployed_container_healthcheck=$healthcheck
|
|
721
|
+
live_status=$live_status
|
|
722
|
+
operate_status=$operate_status
|
|
723
|
+
smoke_brain_id=$smoke_brain_full_id
|
|
724
|
+
successful_restarts=$successful_restarts
|
|
725
|
+
restart_budget_entries=$restart_count
|
|
726
|
+
incident_files=\${#incident_files[@]}
|
|
727
|
+
unrelated_restarted=false
|
|
728
|
+
false_label_restarted=false
|
|
729
|
+
healthy_brain_restarted=false
|
|
730
|
+
deployed_container_restarted=false
|
|
731
|
+
EOF
|
|
732
|
+
pass "fleet watchdog isolation smoke completed"
|
|
733
|
+
printf 'REMOTE_ARTIFACT_DIR=%s\\n' "$remote_dir"
|
|
734
|
+
`;var E8=()=>{};var F$={};Lt(F$,{assertHealthWatchdogSmokeTarget:()=>q$,cleanupHealthWatchdogSmoke:()=>Whe,renderHealthWatchdogSmokeRemoteScript:()=>R8,runHealthWatchdogSmoke:()=>Vhe});import{access as qhe,chmod as Fhe,mkdir as I8,mkdtemp as Khe,rm as M$,writeFile as Bl}from"fs/promises";import{tmpdir as Jhe}from"os";import{join as oo,resolve as A8}from"path";function q$(e){let t=`watchdog-smoke:${e.handle}`;if(e.confirmation!==t)throw Error(`Health watchdog smoke requires --confirm ${t}`);if(!/^[A-Za-z0-9][A-Za-z0-9_.-]{0,100}$/.test(e.runId))throw Error("Health watchdog smoke run ID is invalid");let r=/(^|[-_.])smoke($|[-_.])/i;if(!r.test(e.handle)||!r.test(e.domain))throw Error("Health watchdog smoke is smoke-only; handle and domain must both identify smoke")}function R8(){return k8.replace("__WATCHDOG_PAYLOAD_BASE64__",Buffer.from(x8,"utf8").toString("base64")).replace("__WATCHDOG_LABEL_FILTER__",Z$)}async function Vhe(e){let t=A8(e.artifactsDir??oo(e.rootDir,".brains-ops","watchdog-smoke",e.runId)),r=await $8(e.rootDir,e.handle);q$({handle:r.user.handle,domain:r.user.domain,confirmation:e.confirmation,runId:e.runId}),await I8(t,{recursive:!0});let o=T8.parse(e.env??process.env),n=e.commandRunner??Ho,i=e.logger??console.info,s=await O8({target:r,environment:o,commandRunner:n,fetchImpl:e.fetchImpl??fetch}),a=`/tmp/brains-health-watchdog-smoke-${e.runId}`,c,u=!1;try{let m=await U$(s,"run",e.runId);if(await Ab(t,"remote",m),m.stdout.trim())i(m.stdout.trim());if(m.exitCode!==0)c=no("ssh",["watchdog-smoke","run"],m);let h=await Ghe(s,a,t);if(await Ab(t,"scp",h),h.exitCode===0){if(u=await Qhe(oo(t,"summary.txt")),!u)c??=Error("Health watchdog smoke evidence is missing summary.txt")}else c??=no("scp",[a,t],h)}catch(m){c=Error(Ve(m,"Health watchdog smoke execution failed"))}let d;try{let m=await U$(s,"cleanup",e.runId);if(await Ab(t,"cleanup",m),m.exitCode!==0)d=no("ssh",["watchdog-smoke","cleanup"],m)}catch(m){d=Error(Ve(m,"Health watchdog smoke cleanup failed"))}finally{await M$(s.temporaryRoot,{recursive:!0,force:!0})}if(c)throw c;if(d)throw d;if(!u)throw Error("Health watchdog smoke completed without copied evidence");let f={success:!0,runId:e.runId,artifactsDir:t,target:{handle:r.user.handle,domain:r.user.domain,serverIp:s.serverIp}};return await Bl(oo(t,"result.json"),`${JSON.stringify(f,null,2)}
|
|
735
|
+
`),f}async function Whe(e){let t=A8(e.artifactsDir??oo(e.rootDir,".brains-ops","watchdog-smoke",`cleanup-${e.runId}`)),r=await $8(e.rootDir,e.handle);q$({handle:r.user.handle,domain:r.user.domain,confirmation:e.confirmation,runId:e.runId}),await I8(t,{recursive:!0});let o=T8.parse(e.env??process.env),n=await O8({target:r,environment:o,commandRunner:e.commandRunner??Ho,fetchImpl:e.fetchImpl??fetch});try{let s=await U$(n,"cleanup",e.runId);if(await Ab(t,"cleanup",s),s.stdout.trim())(e.logger??console.info)(s.stdout.trim());if(s.exitCode!==0)throw no("ssh",["watchdog-smoke","cleanup"],s)}finally{await M$(n.temporaryRoot,{recursive:!0,force:!0})}let i={success:!0,runId:e.runId,artifactsDir:t,target:{handle:r.user.handle,domain:r.user.domain,serverIp:n.serverIp}};return await Bl(oo(t,"result.json"),`${JSON.stringify(i,null,2)}
|
|
736
|
+
`),i}async function $8(e,t){let r=await wt(e),o=r.users.find((n)=>n.handle===t);if(!o)throw Error(`Unknown pilot user: ${t}`);return{pilot:r.pilot,user:o}}async function O8(e){let t=await Khe(oo(Jhe(),"brains-ops-watchdog-smoke-")),r=oo(t,"id_ed25519"),o=oo(t,"known_hosts");try{let n=encodeURIComponent(`brain=${e.target.pilot.contentRepoPrefix}${e.target.user.handle}`),i=await e.fetchImpl(`https://api.hetzner.cloud/v1/servers?label_selector=${n}`,{headers:{Authorization:`Bearer ${e.environment.HCLOUD_TOKEN}`}});if(!i.ok)throw Error(`Hetzner server lookup failed with ${i.status}`);let s=Hhe.parse(await i.json());if(s.servers.length!==1)throw Error(`Expected one smoke server, found ${s.servers.length}`);let a=s.servers[0];if(a?.status!=="running")throw Error("Smoke server is not running");await Bl(r,Yhe(e.environment.KAMAL_SSH_PRIVATE_KEY),{mode:384}),await Fhe(r,384);let c=await e.commandRunner("ssh-keyscan",["-T","10","-t","ed25519",a.public_net.ipv4.ip]);if(c.exitCode!==0||!c.stdout.trim())throw Error("Unable to resolve watchdog smoke SSH host key");return await Bl(o,c.stdout,{mode:384}),{temporaryRoot:t,sshKeyPath:r,knownHostsPath:o,serverIp:a.public_net.ipv4.ip,commandRunner:e.commandRunner}}catch(n){throw await M$(t,{recursive:!0,force:!0}),n}}async function U$(e,t,r){return e.commandRunner("ssh",[...C8(e),`root@${e.serverIp}`,"bash","-s","--",t,r],{stdin:R8()})}async function Ghe(e,t,r){return e.commandRunner("scp",[...C8(e),"-r",`root@${e.serverIp}:${t}/.`,r])}function C8(e){return["-i",e.sshKeyPath,"-o","BatchMode=yes","-o","IdentitiesOnly=yes","-o","ConnectTimeout=10","-o","StrictHostKeyChecking=yes","-o",`UserKnownHostsFile=${e.knownHostsPath}`]}async function Qhe(e){try{return await qhe(e),!0}catch{return!1}}async function Ab(e,t,r){await Promise.all([Bl(oo(e,`${t}.stdout.log`),r.stdout),Bl(oo(e,`${t}.stderr.log`),r.stderr)])}function Yhe(e){return`${e.replace(/\r\n/g,`
|
|
737
|
+
`).replace(/\\n/g,`
|
|
738
|
+
`).trimEnd()}
|
|
739
|
+
`}var T8,Hhe;var K$=v(async()=>{pe();E8();hn();Qf();await _8();T8=l.object({HCLOUD_TOKEN:l.string().min(1),KAMAL_SSH_PRIVATE_KEY:l.string().min(1)}),Hhe=l.object({servers:l.array(l.object({status:l.string(),public_net:l.object({ipv4:l.object({ip:l.string().min(1)})})}))})});import{parseArgs as gK}from"util";function nt(e){return e}class rp extends Error{constructor(e){super(e);this.name="CliUsageError"}}function yK(e,t){let r={...t};for(let o of e)for(let[n,i]of Object.entries(o.flags??{})){let s=r[n];if(s===void 0){r[n]=i;continue}if(s.type!==i.type||s.short!==i.short||s.default!==i.default)throw Error(`Conflicting definitions for flag --${n}: commands must agree on type, short, and default`)}return r}function bK(e){let t={};for(let[r,o]of Object.entries(e))t[r]={type:o.type,...o.short!==void 0?{short:o.short}:{},...o.default!==void 0?{default:o.default}:{}};return t}function SK(e){if(!(e instanceof Error)||!("code"in e))return!1;return e.code==="ERR_PARSE_ARGS_UNKNOWN_OPTION"||e.code==="ERR_PARSE_ARGS_INVALID_OPTION_VALUE"}function V$(e,t){let r=yK(t.commands,t.globalFlags??{}),o,n;try{({values:o,positionals:n}=gK({args:e,options:bK(r),allowPositionals:!0,strict:t.strict??!0}))}catch(s){if(SK(s))throw new rp(s.message.split(". ")[0]??s.message);throw s}if("help"in r&&o.help===!0)return{command:"help",args:[],flags:{help:!0}};if("version"in r&&o.version===!0)return{command:"version",args:[],flags:{version:!0}};let i={};for(let[s,a]of Object.entries(r)){let c=o[s];if(typeof c==="string"&&a.type==="string")i[s]=c;else if(typeof c==="boolean"&&a.type==="boolean")i[s]=c}return{command:n[0]??"help",args:n.slice(1),flags:i}}function W$(e){let t=e.reduce((r,o)=>Math.max(r,o.label.length),0);return e.map((r)=>` ${r.label.padEnd(t)} ${r.description}`)}function vK(e){return W$(e.map((t)=>({label:t.usage?`${t.name} ${t.usage}`:t.name,description:t.description})))}function wK(e,t){let r=t.type==="string"?` ${t.placeholder??"<value>"}`:"",o=t.short!==void 0?`, -${t.short}`:"";return`--${e}${r}${o}`}function G$(e){return W$(Object.entries(e).map(([t,r])=>({label:wK(t,r),description:r.description})))}function Q$(e,t){return`Usage: ${e} ${t.name}${t.usage?` ${t.usage}`:""}`}function xK(e){return JSON.stringify(Object.entries(e).map(([t,r])=>[t,r.type,r.short??"",r.description,r.placeholder??"",r.default??""]).sort((t,r)=>String(t[0]).localeCompare(String(r[0]))))}function _K(e){let t=[],r=new Map;for(let n of e){let i=n.flags??{};if(Object.keys(i).length===0)continue;let s=xK(i),a=r.get(s);if(a){a.names.push(n.name);continue}let c={names:[n.name],flags:i};r.set(s,c),t.push(c)}let o=[];for(let n of t)o.push("",`${n.names.join(" / ")} options:`),o.push(...G$(n.flags));return o}function Y$(e){let t=[e.intro,"",`Usage: ${e.cliName} ${e.usage??"<command> [args]"}`,"","Commands:",...vK(e.commands)];if(e.globalFlags&&Object.keys(e.globalFlags).length>0)t.push("","Options:",...G$(e.globalFlags));return t.push(..._K(e.commands)),t.join(`
|
|
740
|
+
`)}function X$(e){let t=new Map;for(let r of e){if(t.has(r.name))throw Error(`Duplicate command name: ${r.name}`);t.set(r.name,r)}return t}function ot(e,t){let r=e[t];return typeof r==="string"?r:void 0}function ds(e,t){let r=e[t];return typeof r==="boolean"?r:void 0}var np={name:"@rizom/ops",version:"0.2.0-alpha.700",description:"Operator CLI for managing private brain fleet registry repos",keywords:["brains","ops","cli","deploy","fleet","operator"],license:"AGPL-3.0-only",author:"Yeehaa <yeehaa@rizom.ai> (https://rizom.ai)",bin:{"brains-ops":"./dist/brains-ops.js"},bugs:"https://github.com/rizom-ai/brains/issues",dependencies:{"@libsql/client":"^0.17.4","age-encryption":"^0.3.0",yaml:"^2.9.0"},devDependencies:{"@brains/contracts":"workspace:*","@brains/deploy-support":"workspace:*","@brains/eslint-config":"workspace:*","@brains/job-queue":"workspace:*","@brains/profile":"workspace:*","@brains/site-composition":"workspace:*","@brains/test-utils":"workspace:*","@brains/typescript-config":"workspace:*","@brains/utils":"workspace:*","@types/bun":"^1.4.0",typescript:"^7.0.2"},engines:{bun:">=1.3.3"},exports:{".":{types:"./dist/index.d.ts",import:"./dist/index.js"},"./deploy":{types:"./dist/deploy.d.ts",import:"./dist/deploy.js",bun:"./dist/deploy.js"}},files:["dist","templates"],homepage:"https://github.com/rizom-ai/brains/tree/main/packages/brains-ops#readme",main:"./dist/index.js",publishConfig:{access:"public"},repository:{type:"git",url:"https://github.com/rizom-ai/brains.git",directory:"packages/brains-ops"},scripts:{build:"bun scripts/build.ts",lint:"eslint . --max-warnings 0","lint:fix":"eslint . --max-warnings 0 --fix",prepublishOnly:"bun scripts/build.ts",test:"bun test --timeout 20000","test:smoke":"bun run build && RUN_SMOKE_TESTS=1 bun test --timeout 60000",typecheck:"tsc --noEmit"},type:"module",types:"./dist/index.d.ts"};Ev();bi();import{writeFile as PY}from"fs/promises";import{join as tj}from"path";import{createSign as dW,generateKeyPairSync as fW}from"crypto";import{mkdir as pW,writeFile as X2}from"fs/promises";import{join as eD}from"path";async function wV(e){let t=await e.text();if(!t.trim())return;try{return JSON.parse(t)}catch{return t}}async function Wa(e,t,r){let o=await wV(e),n=t.safeParse(o);if(!e.ok||!n.success){let i=r.formatError??xV;throw Error(`${r.label}${i(e,o)}`)}return n.data}function xV(e,t){let r=t===void 0?"":`: ${typeof t==="string"?t:JSON.stringify(t)}`;return` (${e.status} ${e.statusText}${r})`}pe();var mW="2.5.4.3",hW="1.2.840.113549.1.1.11",nD="https://api.cloudflare.com/client/v4",gW="origin-rsa",yW=5475,oD=15000;function iD(e){return{Authorization:`Bearer ${e}`,"Content-Type":"application/json"}}var tD=l.looseObject({message:l.string().optional()}),bW=l.looseObject({errors:l.array(tD).optional(),messages:l.array(tD).optional()}),SW=l.looseObject({certificate:l.string().min(1),expires_on:l.string().optional()}),vW=l.looseObject({success:l.literal(!0),result:SW}),wW=l.looseObject({success:l.literal(!0)});function xW(){let{privateKey:e,publicKey:t}=fW("rsa",{modulusLength:2048,privateKeyEncoding:{type:"pkcs8",format:"pem"},publicKeyEncoding:{type:"spki",format:"der"}});return{privateKeyPem:e,publicKeyDer:Buffer.from(t)}}function _W(e,t){let r=yd($W(yd(rD(mW),AW(e)))),o=yd(IW(0),r,Buffer.from(t.publicKeyDer),OW(0,Buffer.alloc(0))),n=dW("sha256").update(o).sign(t.privateKeyPem),i=yd(o,yd(rD(hW),RW()),TW(n));return{csrPem:kW("CERTIFICATE REQUEST",i),certificationRequestInfoDer:o,signature:n}}async function EW(e,t,r,o){let n=await e(`${nD}/certificates`,{method:"POST",headers:iD(t),body:JSON.stringify({hostnames:[o,`*.${o}`],requested_validity:yW,request_type:gW,csr:r}),signal:AbortSignal.timeout(oD)}),i=await Wa(n,vW,{label:"Cloudflare Origin CA request failed",formatError:aD}),a={certificatePem:`${i.result.certificate.trim()}
|
|
741
|
+
`};if(i.result.expires_on)a.expiresOn=i.result.expires_on;return a}async function sD(e,t,r){let o=await e(`${nD}/zones/${r}/settings/ssl`,{method:"PATCH",headers:iD(t),body:JSON.stringify({value:"strict"}),signal:AbortSignal.timeout(oD)});await Wa(o,wW,{label:"Cloudflare zone SSL update failed",formatError:aD})}function kW(e,t){let o=t.toString("base64").match(/.{1,64}/g)??[];return[`-----BEGIN ${e}-----`,...o,`-----END ${e}-----`,""].join(`
|
|
742
|
+
`)}function IW(e){if(e!==0)throw Error("Only zero-valued INTEGER encoding is currently supported");return Buffer.from([2,1,0])}function rD(e){let t=e.split(".").map((s)=>Number(s));if(t.length<2||t.some((s)=>Number.isNaN(s)))throw Error(`Invalid OID: ${e}`);let r=t[0],o=t[1];if(r===void 0||o===void 0)throw Error(`Invalid OID: ${e}`);let i=[r*40+o];for(let s of t.slice(2)){let a=PW(s);i.push(...a)}return Ac(6,Buffer.from(i))}function AW(e){return Ac(12,Buffer.from(e,"utf8"))}function TW(e){return Ac(3,Buffer.concat([Buffer.from([0]),e]))}function RW(){return Buffer.from([5,0])}function yd(...e){return Ac(48,Buffer.concat(e))}function $W(...e){return Ac(49,Buffer.concat(e))}function OW(e,t){return Ac(160+e,t)}function Ac(e,t){return Buffer.concat([Buffer.from([e]),CW(t.length),t])}function CW(e){if(e<128)return Buffer.from([e]);let t=[],r=e;while(r>0)t.unshift(r&255),r>>=8;return Buffer.from([128|t.length,...t])}function PW(e){if(!Number.isInteger(e)||e<0)throw Error(`Invalid OID component: ${e}`);if(e===0)return[0];let t=[],r=e;while(r>0)t.unshift(r&127),r>>=7;for(let o=0;o<t.length-1;o+=1)t[o]=(t[o]??0)|128;return t}function aD(e,t){let r=zW(t),o=r.length>0?`: ${r.join("; ")}`:"";return` (${e.status} ${e.statusText}${o})`}function zW(e){let t=bW.safeParse(e);if(!t.success)return[];return[...t.data.errors??[],...t.data.messages??[]].map((r)=>r.message).filter((r)=>typeof r==="string"&&r.length>0)}async function cD(e,t,r){let o=xW(),{csrPem:n}=_W(r,o),i=await EW(e,t,n,r);return{certificatePem:i.certificatePem,privateKeyPem:o.privateKeyPem,...i.expiresOn!==void 0&&{expiresOn:i.expiresOn}}}async function lD(e,t){let r=eD(e,"origin.pem"),o=eD(e,"origin.key");return await pW(e,{recursive:!0}),await Promise.all([X2(r,t.certificatePem,"utf-8"),X2(o,t.privateKeyPem,{encoding:"utf-8",mode:384})]),{certificatePath:r,privateKeyPath:o}}hn();Tu();Un();async function nj(e,t={}){try{return await zY(e,t),{success:!0}}catch(r){return{success:!1,message:Ve(r,"Certificate bootstrap failed")}}}async function zY(e,t={}){let r=await wt(e),o=DY(r,t.handle),n=o.domain,i=t.env??process.env,s=Dr(e),a=t.cfApiToken??jt("CF_API_TOKEN",i,s),c=t.cfZoneId??o.cloudflareZoneId??jt("CF_ZONE_ID",i,s);if(!a)throw Error("Missing CF_API_TOKEN");if(!c)throw Error("Missing CF_ZONE_ID");let u=t.fetchImpl??fetch,d=t.logger??console.log,f=await cD(u,a,n),m=tj(e,".brains-ops","certs",o.id),{certificatePath:h,privateKeyPath:b}=await lD(m,f),y=tj(m,"secrets.yaml");await PY(y,NY(f.certificatePem,f.privateKeyPem),"utf-8"),await sD(u,a,c);let S=Ha(t.pushTo);if(S)await gi([["CERTIFICATE_PEM",f.certificatePem],["PRIVATE_KEY_PEM",f.privateKeyPem]],{logger:d,runCommand:t.runCommand??tr});if(d(`Issued ${o.id} Origin CA cert for ${n} and *.${n}`),d(`Wrote ${h}`),d(`Wrote ${b}`),d(`Wrote ${y}`),f.expiresOn)d(`Expires on ${f.expiresOn}`);if(d("Cloudflare zone SSL mode set to Full (strict)"),S)d(`Pushed CERTIFICATE_PEM and PRIVATE_KEY_PEM to ${S}`);return{domain:n,certificatePath:h,privateKeyPath:b,certificatePem:f.certificatePem,secretsSnippetPath:y}}function NY(e,t){return[`certificatePem: ${rj(e)}`,`privateKeyPem: ${rj(t)}`,""].join(`
|
|
743
|
+
`)}function rj(e){return`"${e.replace(/"/g,"\\\"").replace(/\n/g,"\\n")}"`}function DY(e,t){if(!t)return{id:"shared",domain:LY(e.pilot.domainSuffix)};let r=e.users.find((o)=>o.handle===t);if(!r)throw Error(`Unknown user handle: ${t}`);return{id:t,domain:r.domain,...r.cloudflareZoneId?{cloudflareZoneId:r.cloudflareZoneId}:{}}}function LY(e){let t=e.trim().replace(/^\./,"").replace(/\.$/,"");if(!t||t.includes("*"))throw Error(`Invalid pilot domainSuffix: ${e}`);return t}import{access as ij,chmod as PI,mkdir as tg,readFile as aj,writeFile as sj}from"fs/promises";import{dirname as MY,join as Dc}from"path";import{fileURLToPath as qY}from"url";bi();Id();var FY=["pilot.yaml","package.json",".env.schema",".gitignore","cohorts/cohort-1.yaml","users/alice.yaml",".github/actions/varlock-env/action.yml",".github/workflows/build.yml",".github/workflows/deploy.yml",".github/workflows/directory-sync-stress.yml",".github/workflows/health-watchdog-smoke.yml",".github/workflows/offboard.yml",".github/workflows/reconcile.yml",".github/workflows/upgrade.yml","deploy/Dockerfile","deploy/kamal/deploy.yml","deploy/scripts/helpers.ts","deploy/scripts/create-predeploy-backup.ts","deploy/scripts/install-health-watchdog.ts","deploy/scripts/provision-server.ts","deploy/scripts/pull-local-models.ts","deploy/scripts/update-dns.ts","deploy/scripts/write-ssh-key.ts","deploy/scripts/decrypt-user-secrets.ts","deploy/scripts/validate-secrets.ts","deploy/scripts/write-kamal-secrets.ts","deploy/scripts/resolve-user-config.ts","deploy/scripts/resolve-missing-images.ts","deploy/scripts/verify-runtime-image.ts","deploy/scripts/resolve-deploy-handles.ts","deploy/scripts/sync-content-repo.ts",".kamal/hooks/pre-deploy","docs/onboarding-checklist.md","docs/canonical-crossover-record.md","docs/operator-playbook.md","docs/user-onboarding.md","README.md"],zI=new Set([".kamal/hooks/pre-deploy"]),KY=new Set(["cohorts/cohort-1.yaml","users/alice.yaml","docs/canonical-crossover-record.md"]),JY=qY(new URL("../templates/rover-pilot/",import.meta.url));function Io(e){return(t)=>t.includes(e)}function HY(e){return UP.find((t)=>e===`deploy/scripts/${t}`)}function NI(e){return e.replace(/\n {2}secret:\n(?: {4}- .*\n)+\nvolumes:\n/,`
|
|
744
|
+
secret:
|
|
745
|
+
- __DYNAMIC_SECRETS__
|
|
746
|
+
|
|
747
|
+
volumes:
|
|
748
|
+
`)}function VY(e){return KP(e,"rover",NI)}function WY(e){if(e.includes("DISCORD_APPLICATION_ID")&&e.includes("ATPROTO_APP_PASSWORD"))return!1;let t=Va(NI(e)),r=Va(NI(sm(am({serviceName:"rover"}))));return t===r}var GY=[/\n# Stored with the per-user Discord credentials and injected at deploy time\.\n# @sensitive\nDISCORD_PUBLIC_KEY=\n\n# @sensitive\nDISCORD_APPLICATION_ID=\n/,/\n# AT Protocol publishing\/discovery \(optional, per-user\)\n# Comes from the decrypted users\/<handle>\.secrets\.yaml\.age file when configured\.\n# @sensitive\nATPROTO_APP_PASSWORD=\n/],QY=[/# OpenAI, the provider of the canonical chat and embedding models\n[^]*?\nGOOGLE_GENERATIVE_AI_API_KEY=\n/,/# AI provider\n[^]*?\nAI_API_KEY=\n/];function YY(e,t){let r=(o)=>GY.reduce((n,i)=>n.replace(i,`
|
|
749
|
+
`),QY.reduce((n,i)=>n.replace(i,`__PROVIDER_KEYS__
|
|
750
|
+
`),o));return r(e)===r(t)}var XY=[['writeSecretGitHubEnv("AI_API_KEY", secrets["aiApiKey"]);','writeSecretGitHubEnv("OPENAI_API_KEY", secrets["openaiApiKey"]);'],[`"shared_ai_api_key_secret_name",
|
|
751
|
+
requireFlatValue(pilot, "aiApiKey", "pilot.yaml"),`,`"shared_openai_api_key_secret_name",
|
|
752
|
+
requireFlatValue(pilot, "openaiApiKey", "pilot.yaml"),`]],eX=[`writeSecretGitHubEnv("DISCORD_PUBLIC_KEY", secrets["discordPublicKey"]);
|
|
753
|
+
writeSecretGitHubEnv("DISCORD_APPLICATION_ID", secrets["discordApplicationId"]);
|
|
754
|
+
`,`writeSecretGitHubEnv("ATPROTO_APP_PASSWORD", secrets["atprotoAppPassword"]);
|
|
755
|
+
`];function tX(e,t){let r=(o)=>eX.reduce((n,i)=>n.replace(i,""),XY.reduce((n,[i,s])=>n.replace(i,s),o));return r(e)===r(t)}function rX(e){return e.includes('if (eventName !== "push") {')&&e.includes('const currentSha = requireEnv("GITHUB_SHA");')||e.includes("path.match(/^users\\/([^/]+)\\/")&&!e.includes("existsSync(`users/${handle}.yaml`)")}var nX={".env.schema":YY,"deploy/Dockerfile":(e)=>FP(e),"deploy/kamal/deploy.yml":(e)=>VY(e)||WY(e),"deploy/scripts/decrypt-user-secrets.ts":tX,"deploy/scripts/resolve-deploy-handles.ts":(e)=>rX(e),"deploy/scripts/helpers.ts":Io('"@rizom/ops/deploy"'),"deploy/scripts/resolve-user-config.ts":Io("sitePackagesFor"),"deploy/scripts/resolve-missing-images.ts":Io("runResolveMissingImages"),"deploy/scripts/sync-content-repo.ts":Io("GIT_SYNC_TOKEN"),".github/workflows/build.yml":Io("resolve-missing-images.ts"),".github/workflows/deploy.yml":Io("install-health-watchdog.ts"),".github/workflows/offboard.yml":Io("user:offboard"),".github/workflows/reconcile.yml":Io("brains-ops reconcile"),".github/workflows/upgrade.yml":Io("brains-ops upgrade")};function oX(e,t,r){let o=HY(e);if(o&&MP(o,t,r))return!0;return nX[e]?.(t,r)??!1}async function cj(e){await tg(e,{recursive:!0});let t=Dc(e,"views","users.md"),r=!0;try{await ij(t)}catch{r=!1}let o=!0;try{await ij(Dc(e,"pilot.yaml"))}catch{o=!1}await tg(Dc(e,"users"),{recursive:!0}),await tg(Dc(e,"cohorts"),{recursive:!0});let n=FY.filter((i)=>!(o&&KY.has(i))).map(async(i)=>{let s=Dc(e,i);await tg(MY(s),{recursive:!0}),await iX(i,s)});if(await Promise.all(n),!r)await Ci(e)}async function iX(e,t){let r=await sX(e);try{if(await sj(t,r,{flag:"wx"}),zI.has(e))await PI(t,493);return}catch(n){if(!cX(n,"EEXIST"))throw n}let o=await aj(t,"utf8");if(o===r){if(zI.has(e))await PI(t,493);return}if(!oX(e,o,r))return;if(await sj(t,r),zI.has(e))await PI(t,493)}async function sX(e){if(e===".gitignore")return`node_modules/
|
|
177
756
|
.brains-ops/
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
`)};
|
|
757
|
+
users/*.secrets.yaml
|
|
758
|
+
`;if(e==="deploy/Dockerfile")return qP();if(e==="deploy/kamal/deploy.yml")return am({serviceName:"rover"});if(e===".kamal/hooks/pre-deploy")return kv({deployConfigPath:"deploy/kamal/deploy.yml",brainYamlPath:"${BRAIN_YAML_PATH:-brain.yaml}"});let t=Dc(JY,e),r=await aj(t,"utf8");return aX(r)}function aX(e){return e.replaceAll("__BRAINS_OPS_VERSION__",np.version).replaceAll("__BUN_VERSION__",Bun.version)}function cX(e,t){return typeof e==="object"&&e!==null&&"code"in e&&e.code===t}hn();UI();jI();ko();import{lookup as bX}from"dns/promises";function kj(e={}){let t=e.fetchImpl??fetch,r=e.lookupHost??bX;return async function(n){let i=await SX(n.domain,r),[s,a,c]=await Promise.all([Ej(n.domain,"/health/ready",t),Ej(n.domain,"/health/operate",t),vX(n.domain,t)]);return{dnsStatus:i,serverStatus:s,deployStatus:a,mcpStatus:c}}}async function SX(e,t){try{return(await t(e)).address?"ready":"failed"}catch{return"failed"}}async function Ej(e,t,r){try{return(await Ij(r,`https://${e}${t}`,{method:"GET"})).ok?"ready":"failed"}catch{return"failed"}}async function vX(e,t){try{let r=await Ij(t,`https://${e}/mcp`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize",params:{}})});return r.status===401||r.ok?"ready":"failed"}catch{return"failed"}}async function Ij(e,t,r){let o=new AbortController,n=setTimeout(()=>o.abort(),5000);try{return await e(t,{...r,signal:o.signal})}finally{clearTimeout(n)}}Rd();async function Bj(e,t,r,o={}){let{registry:n,user:i}=await ig(e,t);await Lc(e,n,[i],r,o)}Rd();async function sg(e,t,r={}){let{registry:o,users:n}=await Lj(e);await Lc(e,o,n,t,r)}import{createHash as MX}from"crypto";import{cp as qX,lstat as FX,mkdtemp as KX,readFile as JX,readdir as HX,readlink as VX,rm as WX}from"fs/promises";import{tmpdir as GX}from"os";import{basename as QX,join as $d,relative as YX,resolve as XX,sep as eee}from"path";var tee=new Set([".git",".operator",".brains-ops",".turbo","dist","node_modules"]);async function Uj(e){let t=XX(e),r=await KX($d(GX(),"brains-ops-reconcile-")),o=$d(r,"repo");try{await qX(t,o,{recursive:!0,errorOnExist:!0,force:!1,filter:(a)=>ree(t,a)});let n=await JI(o);await jj(o);let i=await JI(o);await jj(o);let s=await JI(o);return{firstPassChangedFiles:Zj(n,i),secondPassChangedFiles:Zj(i,s)}}finally{await WX(r,{recursive:!0,force:!0})}}function ree(e,t){let r=YX(e,t);if(r.length===0)return!0;if(r.split(eee).some((n)=>tee.has(n)))return!1;if(r===".env"||r===".env.local")return!1;return!QX(r).endsWith(".secrets.yaml")}async function jj(e){await sg(e,void 0,{env:{},contentRepoRemoteResolver:()=>{return},fetchImpl:async()=>{throw Error("Dry-run reconcile attempted external HTTP access")},runCommand:async()=>{throw Error("Dry-run reconcile attempted a subprocess")}})}async function JI(e){let t=new Map;return await Mj(e,"",t),t}async function Mj(e,t,r){let o=$d(e,t),n=await HX(o,{withFileTypes:!0});n.sort((i,s)=>i.name.localeCompare(s.name));for(let i of n){let s=$d(t,i.name),a=$d(e,s);if(i.isDirectory()){await Mj(e,s,r);continue}let u=(await FX(a)).isSymbolicLink()?`symlink:${await VX(a)}`:await JX(a);r.set(s,MX("sha256").update(u).digest("hex"))}}function Zj(e,t){return[...new Set([...e.keys(),...t.keys()])].filter((o)=>e.get(o)!==t.get(o)).sort()}Rd();async function qj(e,t,r,o={}){let{registry:n,users:i}=await Dj(e,t);await Lc(e,n,i,r,o)}Id();GI();bi();Tu();Un();import{readFileSync as fee}from"fs";async function Xj(e,t={}){let r=t.env??process.env,o=t.logger??console.log,n=Dr(e),i=Av(`${e}/.env.schema`),s=mee(i),a=[],c=[],u=new Map;for(let f of s){u.set(f.key,f.required);let m=hee(f.key,r,n,e);if(m===void 0||m.trim().length===0){c.push(f.key);continue}a.push([f.key,m])}if(a.length===0)throw Error("No pushable local secrets found for this pilot repo");let d=(f)=>u.get(f)??!1;if(t.dryRun)return o(`Dry run: would push ${a.length} secrets to GitHub Secrets.`),o(`Secrets: ${a.map(([f])=>f).join(", ")}`),wv(o,c,d),{pushedKeys:a.map(([f])=>f),skippedKeys:c,dryRun:!0};return await gi(a,{logger:o,runCommand:t.runCommand??tr}),wv(o,c,d),{pushedKeys:a.map(([f])=>f),skippedKeys:c}}var pee=new Set(["DISCORD_BOT_TOKEN","DISCORD_PUBLIC_KEY","DISCORD_APPLICATION_ID"]);function mee(e){return e.filter((t)=>!pee.has(t.key)).map((t)=>({key:t.key,required:t.required}))}function hee(e,t,r,o){let n=jt(`${e}_FILE`,t,r);if(n&&n.trim().length>0)return fee(yi(n,o),"utf8");let i=jt(e,t,r);if(i===void 0||i.trim().length===0)return;return i}pe();import{execFileSync as eZ}from"child_process";import{chmodSync as gee,existsSync as yee,mkdirSync as bee,readFileSync as tZ,writeFileSync as See}from"fs";import{dirname as vee,join as wee}from"path";import{homedir as xee}from"os";Rv();Tu();Un();var rZ=l.object({id:l.number(),name:l.string(),public_key:l.string()}),_ee=l.object({ssh_keys:l.array(rZ)}),Eee={createEd25519KeyPair(e,t){eZ("ssh-keygen",["-t","ed25519","-f",e,"-C",t,"-N",""],{stdio:"ignore"})},derivePublicKey(e){return eZ("ssh-keygen",["-y","-f",e],{encoding:"utf-8",stdio:["ignore","pipe","inherit"]}).trim()}};async function QI(e,t={}){try{let r=await nZ(e,t);return{success:!0,message:r.createdLocalKey?`SSH deploy key ready at ${r.privateKeyPath}`:`SSH deploy key already ready at ${r.privateKeyPath}`}}catch(r){return{success:!1,message:Ve(r,"SSH key bootstrap failed")}}}async function nZ(e,t={}){let r=t.env??process.env,o=Dr(e),n=t.logger??console.log,i=t.fetchImpl??fetch,s=t.sshKeygen??Eee,a=jt("HCLOUD_TOKEN",r,o);if(!a)throw Error("Missing HCLOUD_TOKEN");let c=jt("HCLOUD_SSH_KEY_NAME",r,o);if(!c)throw Error("Missing HCLOUD_SSH_KEY_NAME");let u=jt("KAMAL_SSH_PRIVATE_KEY_FILE",r,o),d=u?yi(u,e):wee(xee(),".ssh",`${Iee(c)}_ed25519`),f=`${d}.pub`,m=!1;if(!yee(d))bee(vee(d),{recursive:!0,mode:448}),s.createEd25519KeyPair(d,c),m=!0;gee(d,384);let h;if(m)h=tZ(f,"utf-8").trim();else h=s.derivePublicKey(d),See(f,`${h}
|
|
759
|
+
`,"utf-8");if(h.length===0)throw Error(`Unable to derive a public key from ${d}`);let b=await kee({fetchImpl:i,hcloudToken:a,publicKey:h,sshKeyName:c}),y=Ha(t.pushTo);if(y)await gi([["KAMAL_SSH_PRIVATE_KEY",tZ(d,"utf-8")]],{logger:n,runCommand:t.runCommand??tr});if(n(m?`Created ${d}`:`Reusing ${d}`),n(b?`Registered Hetzner SSH key ${c}`:`Hetzner SSH key ${c} already exists`),y)n(`Pushed KAMAL_SSH_PRIVATE_KEY to ${y}`);return{createdHetznerKey:b,createdLocalKey:m,privateKeyPath:d,publicKeyPath:f,sshKeyName:c}}async function kee(e){let t=new URL("https://api.hetzner.cloud/v1/ssh_keys");t.searchParams.set("name",e.sshKeyName);let r=await e.fetchImpl(t.toString(),{headers:{Authorization:`Bearer ${e.hcloudToken}`,"Content-Type":"application/json"}}),{ssh_keys:o}=await Wa(r,_ee,{label:"Hetzner SSH key lookup failed"}),[n]=o;if(n){if(n.public_key.trim()!==e.publicKey)throw Error(`Existing Hetzner SSH key ${e.sshKeyName} does not match the local public key`);return!1}let i=await e.fetchImpl("https://api.hetzner.cloud/v1/ssh_keys",{method:"POST",headers:{Authorization:`Bearer ${e.hcloudToken}`,"Content-Type":"application/json"},body:JSON.stringify({name:e.sshKeyName,public_key:e.publicKey})});return await Wa(i,l.object({ssh_key:rZ}),{label:"Hetzner SSH key create failed"}),!0}function Iee(e){return e.replace(/[^A-Za-z0-9._-]+/g,"_")}Td();lg();Hn();ko();import{access as Aee,mkdir as iZ,readFile as Tee,writeFile as aZ}from"fs/promises";import{basename as Ree,join as Bc}from"path";async function cZ(e,t,r){let o=br.parse(t),n=br.parse(r.cohort),i=Bc(e,"users"),s=Bc(e,"cohorts"),a=Bc(i,`${o}.yaml`),c=Bc(i,`${o}.secrets.yaml`),u=Bc(i,`${o}.secrets.yaml.age`),d=Bc(s,`${n}.yaml`);await Promise.all([iZ(i,{recursive:!0}),iZ(s,{recursive:!0})]);let f=r.discord===!0||Boolean(r.anchorId),m=await sZ(a,Cee(o,f,r.anchorId)),b=await Nee(u)?!1:await sZ(c,Pee(o,f)),{addedToCohort:y}=await $ee(d,o);return{handle:o,cohort:n,userPath:a,secretsTemplatePath:c,cohortPath:d,createdUser:m,createdSecretsTemplate:b,addedToCohort:y}}async function $ee(e,t){let r=await Oee(e);if(r.members.includes(t))return{addedToCohort:!1};let o={...r,members:[...r.members,t].sort()};return await aZ(e,zee(o)),{addedToCohort:!0}}async function Oee(e){try{let t=await Tee(e,"utf8"),r=yr(t,mn);if(!r.ok)throw Error(`${Ree(e)}: ${r.error}`);return r.data}catch(t){if(rg(t))return{members:[]};throw t}}function Cee(e,t,r){return[`handle: ${e}`,"anchorProfile:",` name: ${Bee(e)}`,"discord:",` enabled: ${String(t)}`,...t&&r?[` anchorUserId: ${JSON.stringify(r)}`]:[],""].join(`
|
|
760
|
+
`)}function Pee(e,t){return["# local per-user secret staging file",`# fill values, run \`bunx brains-ops secrets:encrypt . ${e}\`, then the plaintext file will be removed`,...t?["discordBotToken: "]:[],"atprotoAppPassword: ","# For custom-domain sites, paste PEMs with literal \\n escapes.","certificatePem: ","privateKeyPem: ",""].join(`
|
|
761
|
+
`)}function zee(e){return["members:",...e.members.map((t)=>` - ${t}`),...e.brainVersionOverride?[`brainVersionOverride: ${e.brainVersionOverride}`]:[],...e.bundlesOverride?["bundlesOverride:",...e.bundlesOverride.map((t)=>` - ${t}`)]:[],...e.addOverride?["addOverride:",...e.addOverride.map((t)=>` - ${t}`)]:[],...e.removeOverride?["removeOverride:",...e.removeOverride.map((t)=>` - ${t}`)]:[],...e.openaiApiKeyOverride?[`openaiApiKeyOverride: ${e.openaiApiKeyOverride}`]:[],...e.gitSyncTokenOverride?[`gitSyncTokenOverride: ${e.gitSyncTokenOverride}`]:[],""].join(`
|
|
762
|
+
`)}async function sZ(e,t){try{return await aZ(e,t,{flag:"wx"}),!0}catch(r){if(Dee(r))return!1;throw r}}async function Nee(e){try{return await Aee(e),!0}catch{return!1}}function Dee(e){return Lee(e,"EEXIST")}function Lee(e,t){return typeof e==="object"&&e!==null&&"code"in e&&e.code===t}function Bee(e){return e.split("-").filter((t)=>t.length>0).map(oZ).join(" ")}pe();hn();var jee=l.looseObject({status:l.string(),operationalStatus:l.string(),checks:l.array(l.looseObject({name:l.string(),status:l.string(),message:l.string().optional()})).default([]),app:l.looseObject({daemons:l.array(l.looseObject({name:l.string().optional(),status:l.string().optional(),health:l.looseObject({status:l.string().optional(),message:l.string().optional()}).optional()})).default([])}).default({daemons:[]})});async function uZ(e,t,r={}){let o=r.fetchImpl??fetch,i=(await wt(e)).users.find((m)=>m.handle===t);if(!i)throw Error(`Unknown pilot user: ${t}`);let s=`https://${i.domain}`,a=[],c=[],u=l.number().int().positive().max(30).parse(r.operationalRetryAttempts??6),d=l.number().int().nonnegative().max(60000).parse(r.operationalRetryDelayMs??1e4),f=r.sleep??((m)=>new Promise((h)=>setTimeout(h,m)));if(await ug("health",()=>Zee(o,s,u,d,f),a,c),await ug("mcp-auth-gate",()=>qee(o,s),a,c),i.bundles.includes("site"))await ug("site",()=>lZ(o,`${s}/`,"site"),a,c),await ug("studio",()=>lZ(o,`${s}/studio`,"studio"),a,c),r.logger?.("WARN Manual check still required: passkey setup/handoff completed from the setup email.");return{handle:i.handle,bundles:i.bundles,domain:i.domain,contentRepo:i.contentRepo,checks:a,failedChecks:c}}async function ug(e,t,r,o){try{await t(),r.push(e)}catch(n){o.push({name:e,message:Ve(n)})}}async function Zee(e,t,r,o,n){let i;for(let s=1;s<=r;s++)try{await Uee(e,t);return}catch(a){if(i=a,s<r)await n(o)}throw i}async function Uee(e,t){let o=await YI(e,`${t}/health/operate`,{method:"GET"}),n=await o.json().catch(()=>null),i=jee.safeParse(n);if(!o.ok){let a=i.success?i.data.checks.filter((c)=>c.status!=="healthy").slice(0,10).map((c)=>`${c.name}: ${Mee(c.message??c.status)}`):[];throw Error(`/health/operate returned ${o.status}, expected 200${a.length>0?` (${a.join("; ")})`:""}`)}if(!i.success)throw Error(`/health/operate response did not match expected shape: ${i.error.message}`);let s=i.data;if(s.status!=="ready")throw Error(`/health/operate status is ${s.status}, expected ready`);if(s.operationalStatus!=="operational")throw Error(`/health/operate operationalStatus is ${s.operationalStatus}, expected operational`);for(let a of s.app.daemons){let c=a.status??"unknown",u=a.health?.status;if(c==="error"||u==="unhealthy")throw Error(`daemon ${a.name??"unknown"} is unhealthy (${c}/${u??"unknown"})`)}}function Mee(e){let t=e.replaceAll(/\s+/g," ").trim();return t.length<=300?t:`${t.slice(0,297)}...`}async function qee(e,t){let r=await YI(e,`${t}/mcp`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",id:1,method:"initialize"})});if(r.status<400||r.status>=500)throw Error(`unauthenticated POST /mcp returned ${r.status}, expected a 4xx auth failure`)}async function lZ(e,t,r){let o=await YI(e,t,{method:"GET"});if(o.status>=400)throw Error(`${r} ${t} returned ${o.status}, expected < 400`)}async function YI(e,t,r){let o=new AbortController,n=setTimeout(()=>o.abort(),20000);try{return await e(t,{...r,redirect:"follow",signal:o.signal})}finally{clearTimeout(n)}}var z8="brains-ops",J$={type:"string",placeholder:"<target>",description:"Push target (`gh` or `github`)"},Tb={type:"boolean",description:"Show what would happen without writing anything"};function mt(e){return{success:!1,message:Q$(z8,e)}}var N8=nt({name:"init",usage:"<repo>",description:"Create a pilot repo skeleton",run:async({args:e})=>{let t=e[0];if(!t)return mt(N8);return await cj(t),{success:!0,message:`Initialized ${t}`}}}),D8=nt({name:"upgrade",usage:"<repo>",description:"Bump @rizom/ops and refresh the generated scaffold",flags:{to:{type:"string",placeholder:"<version>",description:"Explicit @rizom/ops version (`latest` by default)"}},run:async({args:e,flags:t})=>{let r=e[0];if(!r)return mt(D8);let o=ot(t,"to"),{upgradePilotRepo:n}=await Promise.resolve().then(() => (pZ(),fZ)),{from:i,to:s}=await n(r,{...o&&o!=="latest"?{version:o}:{}});return{success:!0,message:i===s?`Already at @rizom/ops@${s}; scaffold refreshed`:`Upgraded @rizom/ops ${i} -> ${s}; scaffold refreshed`}}}),L8=nt({name:"images:lock",usage:"<repo> [--brain-version <version>] [--site-packages <pins>]",description:"Create immutable runtime dependency locks for operator review (no build or deploy)",flags:{"brain-version":{type:"string",placeholder:"<version>",description:"Lock one exact Brain version instead of the declared fleet"},"site-packages":{type:"string",placeholder:"<pins>",description:"Exact site/theme pins for an explicit Brain version"}},run:async({args:e,flags:t},r)=>{let o=e[0],n=ot(t,"brain-version"),i=ot(t,"site-packages");if(!o||i!==void 0&&!n)return mt(L8);if(n!==void 0)Ct.parse(n);let{users:s}=await wt(o),a=await _j({users:s,brainVersionInput:n,sitePackagesInput:i,imageExists:async()=>!1,verifyImage:async()=>{throw Error("Lock generation must not inspect images")}}),c=[];for(let u of a){let d=await wj(o,u,r.imageLockRunCommand);c.push(`${d}: ${u.tag}`)}return{success:!0,message:["Review and commit runtime dependency locks before building:",...c].join(`
|
|
763
|
+
`)}}}),B8=nt({name:"crossover:stage",usage:"<source-repo> <output-dir> <bundle-review.yaml> [site-pins.yaml]",description:"Stage a reviewed capability-bundle crossover copy",run:async({args:e})=>{let t=e[0],r=e[1],o=e[2],n=e[3];if(!t||!r||!o)return mt(B8);let{loadCapabilityBundleReview:i,loadReviewedSitePins:s,stageLegacyCrossover:a}=await Promise.resolve().then(() => (V6(),H6)),c=await i(o),u=n?await s(n):void 0,d=await a(t,r,{bundleReview:c,sitePins:u});return{success:!0,message:`Staged ${d.changedFiles.length} reviewed crossover files in ${d.outputDir}`}}}),j8=nt({name:"migrate:provider-keys",usage:"<repo>",description:"Move a pilot repo from the legacy AI_API_KEY to the OpenAI key its brains read",run:async({args:e})=>{let t=e[0];if(!t)return mt(j8);let{migratePilotRepoProviderKeys:r}=await Promise.resolve().then(() => (ny(),I6)),o=await r(t,process.env);return{success:!0,message:o.length===0?`${t} already uses the OpenAI key`:`Migrated ${o.length} files: ${o.join(", ")}. Then run brains-ops init ${t} to refresh the deploy scripts.`}}}),Z8=nt({name:"render",usage:"<repo>",description:"Render the observed users table to views/users.md",run:async({args:e},t)=>{let r=e[0];if(!r)return mt(Z8);let o=t.resolveStatus??kj({...t.fetchImpl?{fetchImpl:t.fetchImpl}:{},...t.lookupHost?{lookupHost:t.lookupHost}:{}});return await Ci(r,{resolveStatus:o}),{success:!0,message:`Rendered ${r}/views/users.md`}}}),U8=nt({name:"user:add",usage:"<repo> <handle> --cohort <cohort> [--discord] [--anchor-id <id>]",description:"Add a user to a cohort",flags:{cohort:{type:"string",placeholder:"<cohort>",description:"Cohort the user joins"},discord:{type:"boolean",description:"Enable Discord for the user (browser chat is the default)"},"anchor-id":{type:"string",placeholder:"<id>",description:"Discord anchor user id stored on the user record (implies --discord)"}},run:async({args:e,flags:t})=>{let r=e[0],o=e[1],n=ot(t,"cohort");if(!r||!o||!n)return mt(U8);let i=ot(t,"anchor-id");return await cZ(r,o,{cohort:n,...ds(t,"discord")?{discord:!0}:{},...i?{anchorId:i}:{}}),{success:!0,message:`Added ${o} to ${n}`}}}),M8=nt({name:"user:offboard",usage:"<repo> <handle>... [--apply --confirm sunset:<sorted-comma-separated-handles>]",description:"Archive content and remove pilot users, DNS, and servers",flags:{apply:{type:"boolean",description:"Apply the plan (defaults to a read-only dry run)"},confirm:{type:"string",placeholder:"<confirmation>",description:"Exact batch confirmation required with --apply"}},run:async({args:e,flags:t},r)=>{let o=e[0],n=e.slice(1);if(!o||n.length===0)return mt(M8);let i=ds(t,"apply")??!1,s=ot(t,"confirm"),{offboardPilotUsers:a}=await Promise.resolve().then(() => (WM(),VM)),c=await a(o,{handles:n,dryRun:!i,...s?{confirmation:s}:{},...r.env?{env:r.env}:{},...r.fetchImpl?{fetchImpl:r.fetchImpl}:{},...r.logger?{logger:r.logger}:{},...r.pilotOffboardDriver?{driver:r.pilotOffboardDriver}:{}});return{success:!0,message:c.dryRun?`Dry run: ${c.handles.length} pilot user(s); apply with --apply --confirm ${c.confirmation}`:`Offboarded ${c.handles.length} pilot user(s)`}}}),q8=nt({name:"onboard",usage:"<repo> <handle>",description:"Generate a user's brain.yaml and .env",run:async({args:e},t)=>{let r=e[0],o=e[1];if(!r||!o)return mt(q8);return await Bj(r,o,t.runner,{...t.env?{env:t.env}:{}}),{success:!0,message:`Onboarded ${o}`}}}),F8=nt({name:"age-key:bootstrap",usage:"<repo>",description:"Generate the pilot age key and optional GitHub secret",flags:{"push-to":J$},run:async({args:e,flags:t},r)=>{let o=e[0];if(!o)return mt(F8);let n=ot(t,"push-to");return NP(o,{...r.logger?{logger:r.logger}:{},...n?{pushTo:n}:{},...r.bootstrapRunCommand?{runCommand:r.bootstrapRunCommand}:{}})}}),K8=nt({name:"ssh-key:bootstrap",usage:"<repo>",description:"Bootstrap a deploy SSH key and optional GitHub secret",flags:{"push-to":J$},run:async({args:e,flags:t},r)=>{let o=e[0];if(!o)return mt(K8);let n=ot(t,"push-to");return QI(o,{...r.env?{env:r.env}:{},...r.fetchImpl?{fetchImpl:r.fetchImpl}:{},...r.logger?{logger:r.logger}:{},...n?{pushTo:n}:{},...r.bootstrapRunCommand?{runCommand:r.bootstrapRunCommand}:{},...r.sshKeygen?{sshKeygen:r.sshKeygen}:{}})}}),J8=nt({name:"cert:bootstrap",usage:"<repo>",description:"Issue Cloudflare Origin CA certificates for pilot users",flags:{handle:{type:"string",placeholder:"<handle>",description:"Only issue the certificate for this user handle"},"push-to":J$},run:async({args:e,flags:t},r)=>{let o=e[0];if(!o)return mt(J8);let n=ot(t,"handle"),i=ot(t,"push-to");return nj(o,{...r.env?{env:r.env}:{},...r.fetchImpl?{fetchImpl:r.fetchImpl}:{},...r.logger?{logger:r.logger}:{},...n?{handle:n}:{},...i?{pushTo:i}:{},...r.bootstrapRunCommand?{runCommand:r.bootstrapRunCommand}:{}})}}),H8=nt({name:"secrets:push",usage:"<repo>",description:"Push env-backed local secrets to GitHub Secrets",flags:{"dry-run":Tb},run:async({args:e,flags:t},r)=>{let o=e[0];if(!o)return mt(H8);let n=await Xj(o,{env:r.env,logger:r.logger,dryRun:ds(t,"dry-run")});return{success:!0,message:n.dryRun?`Dry run: would push ${n.pushedKeys.length} secrets`:`Pushed ${n.pushedKeys.length} secrets`}}}),V8=nt({name:"secrets:encrypt",usage:"<repo> <handle>",description:"Encrypt pilot secrets for a user with age",flags:{"dry-run":Tb},run:async({args:e,flags:t},r)=>{let o=e[0],n=e[1];if(!o||!n)return mt(V8);let i=await Qj(o,n,{env:r.env,logger:r.logger,dryRun:ds(t,"dry-run")});return{success:!0,message:i.dryRun?`Dry run: would encrypt ${i.encryptedKeys.length} secrets for ${n}`:`Encrypted ${i.encryptedKeys.length} secrets for ${n}`}}}),W8=nt({name:"recover:retire-legacy-projection-job",usage:"<database> <job-id> --type <legacy-type> (--dry-run | --confirm retire:<job-id>)",description:"Retire one exact unowned pre-scheduler projection job",flags:{type:{type:"string",placeholder:"<legacy-type>",description:"Exact retired projection job type"},confirm:{type:"string",placeholder:"retire:<job-id>",description:"Exact job retirement confirmation"},"dry-run":Tb},run:async({args:e,flags:t},r)=>{let o=e[0],n=e[1],i=ot(t,"type"),s=ot(t,"confirm"),a=ds(t,"dry-run")??!1;if(!o||!n||!i||a===(s!==void 0))return mt(W8);let{legacyProjectionJobTypeSchema:c}=await Promise.resolve().then(() => (A$(),I$)),u=c.safeParse(i);if(!u.success)return{success:!1,message:`Unsupported legacy projection job type: ${i}`};let d=r.legacyProjectionJobRecoveryRunner??(await Promise.resolve().then(() => (A$(),I$))).retireLegacyProjectionJob;try{let f=await d({databasePath:o,jobId:n,jobType:u.data,...s?{confirmation:s}:{},dryRun:a});return{success:!0,message:f.retired?`Retired unowned legacy projection job ${f.job.id} (${f.job.type})`:`Dry run: legacy projection job ${f.job.id} (${f.job.type}) is unowned and retirable`}}catch(f){return{success:!1,message:`Legacy projection job recovery failed: ${Ve(f)}`}}}}),G8=nt({name:"stress:directory-sync",usage:"<repo> <handle> --profile <regression|load|stress> --confirm stress:<handle> [--artifacts-dir <path>]",description:"Run a smoke-only directory-sync stress profile",flags:{profile:{type:"string",placeholder:"<profile>",description:"Stress profile (`regression`, `load`, or `stress`)"},confirm:{type:"string",placeholder:"stress:<handle>",description:"Explicit smoke target confirmation"},"artifacts-dir":{type:"string",placeholder:"<path>",description:"Directory for JSON, Markdown, samples, and logs"}},run:async({args:e,flags:t},r)=>{let o=e[0],n=e[1],i=ot(t,"profile"),s=ot(t,"confirm");if(!o||!n||!s||i!=="regression"&&i!=="load"&&i!=="stress")return mt(G8);let a=r.directorySyncStressRunner??(await Promise.resolve().then(() => (Ib(),kb))).runDeployedDirectorySyncStress,c=ot(t,"artifacts-dir"),u=await a({rootDir:o,handle:n,profile:i,confirmation:s,...c?{artifactsDir:c}:{},...r.env?{env:r.env}:{},...r.fetchImpl?{fetchImpl:r.fetchImpl}:{},...r.logger?{logger:r.logger}:{}});return{success:u.report.success,message:`${u.report.success?"Passed":"Failed"} ${i} directory-sync stress for ${n}; artifacts: ${u.artifactsDir}`}}}),Q8=nt({name:"stress:directory-sync:verify-access",usage:"<repo> <handle> --confirm stress:<handle> [--artifacts-dir <path>]",description:"Verify smoke stress credentials without remote writes",flags:{confirm:{type:"string",placeholder:"stress:<handle>",description:"Explicit smoke target confirmation"},"artifacts-dir":{type:"string",placeholder:"<path>",description:"Directory for the access-check result"}},run:async({args:e,flags:t},r)=>{let o=e[0],n=e[1],i=ot(t,"confirm");if(!o||!n||!i)return mt(Q8);let s=r.directorySyncStressAccessRunner??(await Promise.resolve().then(() => (Ib(),kb))).verifyDirectorySyncStressAccess,a=ot(t,"artifacts-dir"),c=await s({rootDir:o,handle:n,confirmation:i,...a?{artifactsDir:a}:{},...r.env?{env:r.env}:{}});return{success:c.success,message:`Verified directory-sync stress access for ${n} at ${c.remoteHead}; artifacts: ${c.artifactsDir}`}}}),Y8=nt({name:"stress:directory-sync:cleanup",usage:"<repo> <handle> --confirm stress:<handle> [--artifacts-dir <path>]",description:"Remove residual smoke directory-sync stress probes",flags:{confirm:{type:"string",placeholder:"stress:<handle>",description:"Explicit smoke target confirmation"},"artifacts-dir":{type:"string",placeholder:"<path>",description:"Directory for the cleanup result"}},run:async({args:e,flags:t},r)=>{let o=e[0],n=e[1],i=ot(t,"confirm");if(!o||!n||!i)return mt(Y8);let s=r.directorySyncStressCleanupRunner??(await Promise.resolve().then(() => (Ib(),kb))).cleanupDirectorySyncStress,a=ot(t,"artifacts-dir"),c=await s({rootDir:o,handle:n,confirmation:i,...a?{artifactsDir:a}:{},...r.env?{env:r.env}:{},...r.logger?{logger:r.logger}:{}});return{success:c.success,message:`${c.success?"Cleaned":"Failed to clean"} directory-sync stress probes for ${n}; removed ${c.probesRemoved}, remaining ${c.probesRemaining}`}}}),X8={confirm:{type:"string",placeholder:"watchdog-smoke:<handle>",description:"Explicit smoke target confirmation"},"run-id":{type:"string",placeholder:"<id>",description:"Stable workflow run identifier used for cleanup"},"artifacts-dir":{type:"string",placeholder:"<path>",description:"Directory for remote smoke evidence"}},eK=nt({name:"smoke:health-watchdog",usage:"<repo> <handle> --confirm watchdog-smoke:<handle> --run-id <id> [--artifacts-dir <path>]",description:"Run the smoke-fleet host watchdog isolation check",flags:X8,run:async({args:e,flags:t},r)=>{let o=e[0],n=e[1],i=ot(t,"confirm"),s=ot(t,"run-id");if(!o||!n||!i||!s)return mt(eK);let a=r.healthWatchdogSmokeRunner??(await K$().then(() => F$)).runHealthWatchdogSmoke,c=ot(t,"artifacts-dir"),u=await a({rootDir:o,handle:n,confirmation:i,runId:s,...c?{artifactsDir:c}:{},...r.env?{env:r.env}:{},...r.fetchImpl?{fetchImpl:r.fetchImpl}:{},...r.logger?{logger:r.logger}:{}});return{success:u.success,message:`Passed health watchdog smoke for ${n}; artifacts: ${u.artifactsDir}`}}}),tK=nt({name:"smoke:health-watchdog:cleanup",usage:"<repo> <handle> --confirm watchdog-smoke:<handle> --run-id <id> [--artifacts-dir <path>]",description:"Remove residual smoke-fleet watchdog fixtures",flags:X8,run:async({args:e,flags:t},r)=>{let o=e[0],n=e[1],i=ot(t,"confirm"),s=ot(t,"run-id");if(!o||!n||!i||!s)return mt(tK);let a=r.healthWatchdogSmokeCleanupRunner??(await K$().then(() => F$)).cleanupHealthWatchdogSmoke,c=ot(t,"artifacts-dir"),u=await a({rootDir:o,handle:n,confirmation:i,runId:s,...c?{artifactsDir:c}:{},...r.env?{env:r.env}:{},...r.fetchImpl?{fetchImpl:r.fetchImpl}:{},...r.logger?{logger:r.logger}:{}});return{success:u.success,message:`Cleaned health watchdog smoke fixtures for ${n}; artifacts: ${u.artifactsDir}`}}}),rK=nt({name:"verify-user",usage:"<repo> <handle>",description:"Probe a deployed user's endpoints",run:async({args:e},t)=>{let r=e[0],o=e[1];if(!r||!o)return mt(rK);let n=await uZ(r,o,{...t.fetchImpl?{fetchImpl:t.fetchImpl}:{},...t.logger?{logger:t.logger}:{},...t.verificationRetryAttempts!==void 0?{operationalRetryAttempts:t.verificationRetryAttempts}:{},...t.verificationRetryDelayMs!==void 0?{operationalRetryDelayMs:t.verificationRetryDelayMs}:{},...t.sleep?{sleep:t.sleep}:{}}),i=n.checks.length>0?n.checks.join(", "):"none";if(n.failedChecks.length>0){let s=n.failedChecks.map((a)=>` ${a.name}: ${a.message}`).join(`
|
|
764
|
+
`);return{success:!1,message:`Verified ${n.handle} (${n.bundles.join(",")}) at https://${n.domain}: passed ${i}; failed:
|
|
765
|
+
${s}`}}return{success:!0,message:`Verified ${n.handle} (${n.bundles.join(",")}) at https://${n.domain}: ${i}`}}}),nK=nt({name:"reconcile-cohort",usage:"<repo> <cohort>",description:"Reconcile all users in a cohort",run:async({args:e},t)=>{let r=e[0],o=e[1];if(!r||!o)return mt(nK);return await qj(r,o,t.runner,{...t.env?{env:t.env}:{}}),{success:!0,message:`Reconciled cohort ${o}`}}});function P8(e,t){return[e,...t.length===0?["- (none)"]:t.map((r)=>`- ${r}`)]}var oK=nt({name:"reconcile-all",usage:"<repo> [--dry-run]",description:"Reconcile every cohort",flags:{"dry-run":Tb},run:async({args:e,flags:t},r)=>{let o=e[0];if(!o)return mt(oK);if(ds(t,"dry-run")){let n=await Uj(o),i=n.firstPassChangedFiles.length,s=n.secondPassChangedFiles.length;return{success:s===0,message:[`Dry-run reconcile found ${i} first-pass changed file(s); second pass ${s===0?"converged with zero drift":`still changed ${s} file(s)`}`,...P8("First-pass changed files:",n.firstPassChangedFiles),...P8("Second-pass changed files:",n.secondPassChangedFiles)].join(`
|
|
766
|
+
`)}}return await sg(o,r.runner,{...r.env?{env:r.env}:{}}),{success:!0,message:"Reconciled all cohorts"}}}),Xhe=nt({name:"help",description:"Show this help message",run:()=>({success:!0,message:Y$({cliName:z8,intro:"brains-ops \u2014 operator CLI for private brain fleet repos",commands:Rb,globalFlags:H$})})}),ege=nt({name:"version",description:"Show version",run:()=>({success:!0,message:`brains-ops ${np.version}`})}),H$={help:{type:"boolean",short:"h",description:"Show help"},version:{type:"boolean",short:"v",description:"Show version"}},Rb=[N8,D8,L8,B8,j8,Z8,U8,M8,q8,F8,K8,J8,H8,V8,W8,G8,Q8,Y8,eK,tK,rK,nK,oK,Xhe,ege],tge=X$(Rb);async function iK(e,t={}){let r=tge.get(e.command);if(!r)return{success:!1,message:`Unknown command: ${e.command}`};return r.run({args:e.args,flags:e.flags},t)}function sK(e){return V$(e,{commands:Rb,globalFlags:H$})}var tp;try{tp=await iK(sK(process.argv.slice(2)))}catch(e){if(e instanceof rp)console.error(e.message),process.exit(1);throw e}if(tp.message)(tp.success?console.info:console.error)(tp.message);process.exit(tp.success?0:1);
|